[xiph-commits] r11071 - in experimental/derf/theora-exp: examples
include/theora lib tools
j at svn.xiph.org
j at svn.xiph.org
Thu Mar 30 14:37:09 PST 2006
Author: j
Date: 2006-03-30 14:36:54 -0800 (Thu, 30 Mar 2006)
New Revision: 11071
Modified:
experimental/derf/theora-exp/examples/dump_video.c
experimental/derf/theora-exp/examples/encoder_example.c
experimental/derf/theora-exp/examples/player_example.c
experimental/derf/theora-exp/include/theora/codec.h
experimental/derf/theora-exp/include/theora/theoradec.h
experimental/derf/theora-exp/include/theora/theoraenc.h
experimental/derf/theora-exp/lib/decinfo.c
experimental/derf/theora-exp/lib/decint.h
experimental/derf/theora-exp/lib/decode.c
experimental/derf/theora-exp/lib/dequant.c
experimental/derf/theora-exp/lib/encinfo.c
experimental/derf/theora-exp/lib/encint.h
experimental/derf/theora-exp/lib/encode.c
experimental/derf/theora-exp/lib/encvbr.c
experimental/derf/theora-exp/lib/encvbr.h
experimental/derf/theora-exp/lib/enquant.c
experimental/derf/theora-exp/lib/enquant.h
experimental/derf/theora-exp/lib/huffdec.c
experimental/derf/theora-exp/lib/huffdec.h
experimental/derf/theora-exp/lib/huffenc.c
experimental/derf/theora-exp/lib/huffenc.h
experimental/derf/theora-exp/lib/huffman.h
experimental/derf/theora-exp/lib/info.c
experimental/derf/theora-exp/lib/internal.c
experimental/derf/theora-exp/lib/internal.h
experimental/derf/theora-exp/lib/quant.c
experimental/derf/theora-exp/lib/state.c
experimental/derf/theora-exp/tools/quantgen.c
Log:
in order to seperate the namespace from mainline theora, and thus
make it possible to use mainline encoder and theora-exp decoder at
the same time, replace global variables. OC_ -> TH_ and theora_ -> th_
Modified: experimental/derf/theora-exp/examples/dump_video.c
===================================================================
--- experimental/derf/theora-exp/examples/dump_video.c 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/examples/dump_video.c 2006-03-30 22:36:54 UTC (rev 11071)
@@ -66,9 +66,9 @@
ogg_stream_state vo;
ogg_stream_state to;
theora_info ti;
-theora_comment tc;
-theora_setup_info *ts;
-theora_dec_ctx *td;
+th_comment tc;
+th_setup_info *ts;
+th_dec_ctx *td;
int theora_p=0;
int theora_processing_headers;
@@ -87,9 +87,9 @@
got_sigint = 1;
}
-static theora_ycbcr_buffer ycbcr;
+static th_ycbcr_buffer ycbcr;
-static void stripe_decoded(theora_ycbcr_buffer _dst,theora_ycbcr_buffer _src,
+static void stripe_decoded(th_ycbcr_buffer _dst,th_ycbcr_buffer _src,
int _fragy0,int _fragy_end){
int pli;
for(pli=0;pli<3;pli++){
@@ -130,8 +130,8 @@
instead (though in C++ platform-dependent calling convention differences
prevent us from using a real member function pointer).*/
cb.ctx=ycbcr;
- cb.stripe_decoded=(theora_stripe_decoded_func)stripe_decoded;
- theora_decode_ctl(td,OC_DECCTL_SET_STRIPE_CB,&cb,sizeof(cb));
+ cb.stripe_decoded=(th_stripe_decoded_func)stripe_decoded;
+ th_decode_ctl(td,TH_DECCTL_SET_STRIPE_CB,&cb,sizeof(cb));
}
static void video_write(void){
@@ -139,8 +139,8 @@
int i;
/*Uncomment the following to do normal, non-striped decoding.
- theora_ycbcr_buffer ycbcr;
- theora_decode_ycbcr_out(td,ycbcr);*/
+ th_ycbcr_buffer ycbcr;
+ th_decode_ycbcr_out(td,ycbcr);*/
if(!raw)fprintf(outfile, "FRAME\n");
for(pli=0;pli<3;pli++){
@@ -226,8 +226,8 @@
/*vorbis_comment_init(&vc);*/
/* init supporting Theora structures needed in header parsing */
- theora_comment_init(&tc);
- theora_info_init(&ti);
+ th_comment_init(&tc);
+ th_info_init(&ti);
/* Ogg file open; parse the headers */
/* Only interested in Vorbis/Theora streams */
@@ -251,7 +251,7 @@
/* identify the codec: try theora */
if(!theora_p && (theora_processing_headers=
- theora_decode_headerin(&ti,&tc,&ts,&op))>=0){
+ th_decode_headerin(&ti,&tc,&ts,&op))>=0){
/* it is theora */
memcpy(&to,&test,sizeof(test));
theora_p=1;
@@ -272,7 +272,7 @@
/* look for further theora headers */
while(theora_processing_headers&&(ret=ogg_stream_packetpeek(&to,&op))){
if(ret<0)continue;
- theora_processing_headers=theora_decode_headerin(&ti,&tc,&ts,&op);
+ theora_processing_headers=th_decode_headerin(&ti,&tc,&ts,&op);
if(theora_processing_headers<0){
printf("Error parsing Theora stream headers; corrupt stream?\n");
exit(1);
@@ -304,18 +304,18 @@
/* and now we have it all. initialize decoders */
if(theora_p){
- td=theora_decode_alloc(&ti,ts);
+ td=th_decode_alloc(&ti,ts);
fprintf(stderr,"Ogg logical stream %lx is Theora %dx%d %.02f fps video\nEncoded frame content is %dx%d with %dx%d offset\n",
to.serialno,ti.frame_width,ti.frame_height,
(double)ti.fps_numerator/ti.fps_denominator,
ti.pic_width, ti.pic_height, ti.pic_x, ti.pic_y);
}else{
/* tear down the partial theora setup */
- theora_info_clear(&ti);
- theora_comment_clear(&tc);
+ th_info_clear(&ti);
+ th_comment_clear(&tc);
}
/*Either way, we're done with the codec setup data.*/
- theora_setup_free(ts);
+ th_setup_free(ts);
/* open video */
if(theora_p)open_video();
@@ -343,8 +343,8 @@
/* theora is one in, one out... */
if(ogg_stream_packetout(&to,&op)>0){
- if(theora_decode_packetin(td,&op,&videobuf_granulepos)>=0){
- videobuf_time=theora_granule_time(td,videobuf_granulepos);
+ if(th_decode_packetin(td,&op,&videobuf_granulepos)>=0){
+ videobuf_time=th_granule_time(td,videobuf_granulepos);
videobuf_ready=1;
frames++;
}
@@ -372,9 +372,9 @@
if(theora_p){
ogg_stream_clear(&to);
- theora_decode_free(td);
- theora_comment_clear(&tc);
- theora_info_clear(&ti);
+ th_decode_free(td);
+ th_comment_clear(&tc);
+ th_info_clear(&ti);
}
ogg_sync_clear(&oy);
Modified: experimental/derf/theora-exp/examples/encoder_example.c
===================================================================
--- experimental/derf/theora-exp/examples/encoder_example.c 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/examples/encoder_example.c 2006-03-30 22:36:54 UTC (rev 11071)
@@ -918,12 +918,12 @@
int fetch_and_process_video(FILE *video,ogg_page *videopage,
ogg_stream_state *to,
- theora_enc_ctx *td,
+ th_enc_ctx *td,
int videoflag){
/* You'll go to Hell for using static variables */
static int state=-1;
static unsigned char *yuvframe[3];
- static theora_ycbcr_buffer ycbcr;
+ static th_ycbcr_buffer ycbcr;
ogg_packet op;
int pic_sz;
int frame_c_w;
@@ -1032,10 +1032,10 @@
ycbcr[2].ystride=c_w;
ycbcr[2].data=ycbcr[1].data+c_sz;
- theora_encode_ycbcr_in(td,ycbcr);
+ th_encode_ycbcr_in(td,ycbcr);
/* if there's only one frame, it's the last in the stream */
- while(theora_encode_packetout(td,state<2,&op)){
+ while(th_encode_packetout(td,state<2,&op)){
ogg_stream_packetin(to,&op);
}
@@ -1061,9 +1061,9 @@
ogg_page og; /* one Ogg bitstream page. Vorbis packets are inside */
ogg_packet op; /* one raw packet of data for decode */
- theora_enc_ctx *td;
+ th_enc_ctx *td;
theora_info ti;
- theora_comment tc;
+ th_comment tc;
vorbis_info vi; /* struct that stores all the static vorbis bitstream
settings */
@@ -1188,7 +1188,7 @@
pic_x=frame_w-pic_w>>1&~1;
pic_y=frame_h-pic_h>>1&~1;
- theora_info_init(&ti);
+ th_info_init(&ti);
ti.frame_width=frame_w;
ti.frame_height=frame_h;
ti.pic_width=pic_w;
@@ -1199,22 +1199,22 @@
ti.fps_denominator=video_fps_d;
ti.aspect_numerator=video_par_n;
ti.aspect_denominator=video_par_d;
- ti.colorspace=OC_CS_UNSPECIFIED;
+ ti.colorspace=TH_CS_UNSPECIFIED;
ti.target_bitrate=video_r;
ti.quality=video_q;
ti.keyframe_granule_shift=6;
if(dst_c_dec_h==2){
- if(dst_c_dec_v==2)ti.pixel_fmt=OC_PF_420;
- else ti.pixel_fmt=OC_PF_422;
+ if(dst_c_dec_v==2)ti.pixel_fmt=TH_PF_420;
+ else ti.pixel_fmt=TH_PF_422;
}
- else ti.pixel_fmt=OC_PF_444;
+ else ti.pixel_fmt=TH_PF_444;
- td=theora_encode_alloc(&ti);
- theora_info_clear(&ti);
+ td=th_encode_alloc(&ti);
+ th_info_clear(&ti);
if(vp3_compatible){
- ret=theora_encode_ctl(td,OC_ENCCTL_SET_VP3_COMPATIBLE,&vp3_compatible,
+ ret=th_encode_ctl(td,TH_ENCCTL_SET_VP3_COMPATIBLE,&vp3_compatible,
sizeof(vp3_compatible));
if(ret<0||!vp3_compatible){
fprintf(stderr,"Could not enable strict VP3 compatibility.\n");
@@ -1246,10 +1246,10 @@
/* write the bitstream header packets with proper page interleave */
- theora_comment_init(&tc);
+ th_comment_init(&tc);
/* first packet will get its own page automatically */
- if(theora_encode_flushheader(td,&tc,&op)<=0){
+ if(th_encode_flushheader(td,&tc,&op)<=0){
fprintf(stderr,"Internal Theora library error.\n");
exit(1);
}
@@ -1263,7 +1263,7 @@
/* create the remaining theora headers */
for(;;){
- ret=theora_encode_flushheader(td,&tc,&op);
+ ret=th_encode_flushheader(td,&tc,&op);
if(ret<0){
fprintf(stderr,"Internal Theora library error.\n");
exit(1);
@@ -1342,7 +1342,7 @@
double audiotime=
audioflag?vorbis_granule_time(&vd,ogg_page_granulepos(&audiopage)):-1;
double videotime=
- videoflag?theora_granule_time(td,ogg_page_granulepos(&videopage)):-1;
+ videoflag?th_granule_time(td,ogg_page_granulepos(&videopage)):-1;
if(!audioflag){
audio_or_video=1;
@@ -1399,8 +1399,8 @@
}
if(video){
ogg_stream_clear(&to);
- theora_encode_free(td);
- theora_comment_clear(&tc);
+ th_encode_free(td);
+ th_comment_clear(&tc);
}
if(outfile && outfile!=stdout)fclose(outfile);
Modified: experimental/derf/theora-exp/examples/player_example.c
===================================================================
--- experimental/derf/theora-exp/examples/player_example.c 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/examples/player_example.c 2006-03-30 22:36:54 UTC (rev 11071)
@@ -84,9 +84,9 @@
ogg_stream_state vo;
ogg_stream_state to;
theora_info ti;
-theora_comment tc;
-theora_setup_info *ts;
-theora_dec_ctx *td;
+th_comment tc;
+th_setup_info *ts;
+th_dec_ctx *td;
vorbis_info vi;
vorbis_dsp_state vd;
vorbis_block vb;
@@ -331,10 +331,10 @@
int pli;
int wscale, hscale;
int i;
- theora_ycbcr_buffer ycbcr;
+ th_ycbcr_buffer ycbcr;
int crop_offset;
- theora_decode_ycbcr_out(td,ycbcr);
+ th_decode_ycbcr_out(td,ycbcr);
/* Lock SDL_yuv_overlay */
if ( SDL_MUSTLOCK(screen) ) {
@@ -372,7 +372,7 @@
}
/* dump the theora (or vorbis) comment header */
-static int dump_comments(theora_comment *tc){
+static int dump_comments(th_comment *tc){
int i, len;
char *value;
FILE *out=stdout;
@@ -401,13 +401,13 @@
static void report_colorspace(theora_info *ti)
{
switch(ti->colorspace){
- case OC_CS_UNSPECIFIED:
+ case TH_CS_UNSPECIFIED:
/* nothing to report */
break;;
- case OC_CS_ITU_REC_470M:
+ case TH_CS_ITU_REC_470M:
fprintf(stderr," encoder specified ITU Rec 470M (NTSC) color.\n");
break;;
- case OC_CS_ITU_REC_470BG:
+ case TH_CS_ITU_REC_470BG:
fprintf(stderr," encoder specified ITU Rec 470BG (PAL) color.\n");
break;;
default:
@@ -474,8 +474,8 @@
vorbis_comment_init(&vc);
/* init supporting Theora structures needed in header parsing */
- theora_comment_init(&tc);
- theora_info_init(&ti);
+ th_comment_init(&tc);
+ th_info_init(&ti);
/* Ogg file open; parse the headers */
/* Only interested in Vorbis/Theora streams */
@@ -499,7 +499,7 @@
/* identify the codec: try theora */
if(!theora_p && (theora_processing_headers=
- theora_decode_headerin(&ti,&tc,&ts,&op))>=0){
+ th_decode_headerin(&ti,&tc,&ts,&op))>=0){
/* it is theora */
memcpy(&to,&test,sizeof(test));
theora_p=1;
@@ -526,7 +526,7 @@
/* look for further theora headers */
while(theora_processing_headers&&(ret=ogg_stream_packetpeek(&to,&op))){
if(ret<0)continue;
- theora_processing_headers=theora_decode_headerin(&ti,&tc,&ts,&op);
+ theora_processing_headers=th_decode_headerin(&ti,&tc,&ts,&op);
if(theora_processing_headers<0){
printf("Error parsing Theora stream headers; corrupt stream?\n");
exit(1);
@@ -572,7 +572,7 @@
/* and now we have it all. initialize decoders */
if(theora_p){
- td=theora_decode_alloc(&ti,ts);
+ td=th_decode_alloc(&ti,ts);
printf("Ogg logical stream %lx is Theora %dx%d %.02f fps video\n",
to.serialno,ti.frame_width,ti.frame_height,
(double)ti.fps_numerator/ti.fps_denominator);
@@ -581,18 +581,18 @@
ti.pic_width, ti.pic_height, ti.pic_x, ti.pic_y);
report_colorspace(&ti);
dump_comments(&tc);
- theora_decode_ctl(td,OC_DECCTL_GET_PPLEVEL_MAX,&pp_level_max,
+ th_decode_ctl(td,TH_DECCTL_GET_PPLEVEL_MAX,&pp_level_max,
sizeof(pp_level_max));
pp_level=pp_level_max;
- theora_decode_ctl(td,OC_DECCTL_SET_PPLEVEL,&pp_level,sizeof(pp_level));
+ th_decode_ctl(td,TH_DECCTL_SET_PPLEVEL,&pp_level,sizeof(pp_level));
pp_inc=0;
}else{
/* tear down the partial theora setup */
- theora_info_clear(&ti);
- theora_comment_clear(&tc);
+ th_info_clear(&ti);
+ th_comment_clear(&tc);
}
/*Either way, we're done with the codec setup data.*/
- theora_setup_free(ts);
+ th_setup_free(ts);
if(vorbis_p){
vorbis_synthesis_init(&vd,&vi);
vorbis_block_init(&vd,&vb);
@@ -665,7 +665,7 @@
if(pp_inc){
pp_level+=pp_inc;
- theora_decode_ctl(td,OC_DECCTL_SET_PPLEVEL,&pp_level,
+ th_decode_ctl(td,TH_DECCTL_SET_PPLEVEL,&pp_level,
sizeof(pp_level));
pp_inc=0;
}
@@ -676,11 +676,11 @@
page and compute the correct granulepos for the first packet after
a seek or a gap.*/
if(op.granulepos>=0){
- theora_decode_ctl(td,OC_DECCTL_SET_GRANPOS,&op.granulepos,
+ th_decode_ctl(td,TH_DECCTL_SET_GRANPOS,&op.granulepos,
sizeof(op.granulepos));
}
- if(theora_decode_packetin(td,&op,&videobuf_granulepos)>=0){
- videobuf_time=theora_granule_time(td,videobuf_granulepos);
+ if(th_decode_packetin(td,&op,&videobuf_granulepos)>=0){
+ videobuf_time=th_granule_time(td,videobuf_granulepos);
frames++;
/* is it already too old to be useful? This is only actually
@@ -790,9 +790,9 @@
}
if(theora_p){
ogg_stream_clear(&to);
- theora_decode_free(td);
- theora_comment_clear(&tc);
- theora_info_clear(&ti);
+ th_decode_free(td);
+ th_comment_clear(&tc);
+ th_info_clear(&ti);
}
ogg_sync_clear(&oy);
Modified: experimental/derf/theora-exp/include/theora/codec.h
===================================================================
--- experimental/derf/theora-exp/include/theora/codec.h 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/include/theora/codec.h 2006-03-30 22:36:54 UTC (rev 11071)
@@ -55,19 +55,19 @@
/**\name Error codes*/
/*@{*/
/**An invalid pointer was provided.*/
-#define OC_FAULT (-1)
+#define TH_FAULT (-1)
/**An invalid argument was provided.*/
-#define OC_EINVAL (-10)
+#define TH_EINVAL (-10)
/**The contents of the header were incomplete, invalid, or unexpected.*/
-#define OC_BADHEADER (-20)
+#define TH_BADHEADER (-20)
/**The header does not belong to a Theora stream.*/
-#define OC_NOTFORMAT (-21)
+#define TH_NOTFORMAT (-21)
/**The bitstream version is too high.*/
-#define OC_VERSION (-22)
+#define TH_VERSION (-22)
/**The specified function is not implemented.*/
-#define OC_IMPL (-23)
+#define TH_IMPL (-23)
/**There were errors in the video data packet.*/
-#define OC_BADPACKET (-24)
+#define TH_BADPACKET (-24)
/*@}*/
/**The currently defined color space tags.
@@ -77,14 +77,14 @@
typedef enum{
/**The color space was not specified at the encoder.
It may be conveyed by an external means.*/
- OC_CS_UNSPECIFIED,
+ TH_CS_UNSPECIFIED,
/**A color space designed for NTSC content.*/
- OC_CS_ITU_REC_470M,
+ TH_CS_ITU_REC_470M,
/**A color space designed for PAL/SECAM content.*/
- OC_CS_ITU_REC_470BG,
+ TH_CS_ITU_REC_470BG,
/**The total number of currently defined color spaces.*/
- OC_CS_NSPACES
-}theora_colorspace;
+ TH_CS_NSPACES
+}th_colorspace;
/**The currently defined pixel format tags.
* See <a href="http://www.theora.org/doc/Theora_I_spec.pdf">the Theora
@@ -92,16 +92,16 @@
* locations.*/
typedef enum{
/**Chroma decimation by 2 in both the X and Y directions (4:2:0).*/
- OC_PF_420,
+ TH_PF_420,
/**Currently reserved.*/
- OC_PF_RSVD,
+ TH_PF_RSVD,
/**Chroma decimation by 2 in the X direction (4:2:2).*/
- OC_PF_422,
+ TH_PF_422,
/**No chroma decimation (4:4:4).*/
- OC_PF_444,
+ TH_PF_444,
/**The total number of currently defined pixel formats.*/
- OC_PF_NFORMATS
-}theora_pixel_fmt;
+ TH_PF_NFORMATS
+}th_pixel_fmt;
@@ -140,17 +140,17 @@
* Y'CbCr, and they appear in that order, always.
* The prime symbol denotes that the Y channel is non-linear.
* Cb and Cr stand for "Chroma blue" and "Chroma red" respectively.*/
-typedef theora_img_plane theora_ycbcr_buffer[3];
+typedef theora_img_plane th_ycbcr_buffer[3];
/**Theora bitstream information.
* This contains the basic playback parameters for a stream, and corresponds to
* the initial 'info' header packet.
* To initialize an encoder, the application fills in this structure and
- * passes it to theora_encode_alloc().
+ * passes it to th_encode_alloc().
* A default encoding mode is chosen based on the values of the #quality and
* #target_bitrate fields.
- * On decode, it is filled in by theora_decode_headerin(), and then passed to
- * theora_decode_alloc().
+ * On decode, it is filled in by th_decode_headerin(), and then passed to
+ * th_decode_alloc().
*
* Encoded Theora frames must be a multiple of 16 in size;
* this is what the #frame_width and #frame_height members represent.
@@ -223,9 +223,9 @@
ogg_uint32_t aspect_denominator;
/*@}*/
/**The color space.*/
- theora_colorspace colorspace;
+ th_colorspace colorspace;
/**The pixel format.*/
- theora_pixel_fmt pixel_fmt;
+ th_pixel_fmt pixel_fmt;
/**The target bit-rate in bits per second.
If initializing an encoder with this struct, set this field to a non-zero
value to activate CBR encoding by default.*/
@@ -256,13 +256,13 @@
/**The amount to shift to extract the last keyframe number from the granule
* position.
* This can be at most 31.
- * theora_info_init() will set this to a default value (currently <tt>6</tt>,
+ * th_info_init() will set this to a default value (currently <tt>6</tt>,
* which is good for streaming applications), but you can set it to 0 to
* make every frame a keyframe.
* The maximum distance between key frames is
* <tt>1<<#keyframe_granule_shift</tt>.
* The keyframe frequency can be more finely controlled with
- * #OC_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE, which can also be adjusted
+ * #TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE, which can also be adjusted
* during encoding (for example, to force the next frame to be a keyframe),
* but it cannot be set larger than the amount permitted by this field after
* the headers have been output.*/
@@ -293,7 +293,7 @@
* possibly containing null characters, and so the length array should be
* treated as their authoritative length.
*/
-typedef struct theora_comment{
+typedef struct th_comment{
/**The array of comment string vectors.*/
char **user_comments;
/**An array of the corresponding length of each vector, in bytes.*/
@@ -303,12 +303,12 @@
/**The null-terminated vendor string.
This identifies the software used to encode the stream.*/
char *vendor;
-}theora_comment;
+}th_comment;
/**A single base matrix.*/
-typedef unsigned char theora_quant_base[64];
+typedef unsigned char th_quant_base[64];
/**A set of \a qi ranges.*/
typedef struct{
@@ -319,7 +319,7 @@
const int *sizes;
/**#nranges <tt>+1</tt> base matrices.
Matrices \a i and <tt>i+1</tt> form the endpoints of range \a i.*/
- const theora_quant_base *base_matrices;
+ const th_quant_base *base_matrices;
}theora_quant_ranges;
/**A complete set of quantization parameters.
@@ -393,9 +393,9 @@
/**The number of Huffman tables used by Theora.*/
-#define OC_NHUFFMAN_TABLES (80)
+#define TH_NHUFFMAN_TABLES (80)
/**The number of DCT token values in each table.*/
-#define OC_NDCT_TOKENS (32)
+#define TH_NDCT_TOKENS (32)
/**A Huffman code for a Theora DCT token.
* Each set of Huffman codes in a given table must form a complete, prefix-free
@@ -426,7 +426,7 @@
/**Retrieves a human-readable string to identify the library vendor and
* version.
* \return the version string.*/
-extern const char *theora_version_string(void);
+extern const char *th_version_string(void);
/**Retrieves the library version number.
* This is the highest bitstream version that the encoder library will produce,
* or that the decoder library can decode.
@@ -436,42 +436,42 @@
* (VERSION_MAJOR<<16)+(VERSION_MINOR<<8)+(VERSION_SUBMINOR)
* \endcode
* \return the version number.*/
-extern ogg_uint32_t theora_version_number(void);
+extern ogg_uint32_t th_version_number(void);
/**Converts a granule position to an absolute frame number.
* The granule position is interpreted in the context of a given
- * #theora_enc_ctx or #theora_dec_ctx handle (either will suffice).
- * \param _encdec A previously allocated #theora_enc_ctx or #theora_dec_ctx
+ * #th_enc_ctx or #th_dec_ctx handle (either will suffice).
+ * \param _encdec A previously allocated #th_enc_ctx or #th_dec_ctx
* handle.
* \param _granpos The granule position to convert.
* \returns The absolute frame number corresponding to \a _granpos.
* \retval -1 The given granule position was invalid (i.e. negative).*/
-extern ogg_int64_t theora_granule_frame(void *_encdec,ogg_int64_t _granpos);
+extern ogg_int64_t th_granule_frame(void *_encdec,ogg_int64_t _granpos);
/**Converts a granule position to an absolute time in seconds.
* The granule position is interpreted in the context of a given
- * #theora_enc_ctx or #theora_dec_ctx handle (either will suffice).
- * \param _encdec A previously allocated #theora_enc_ctx or #theora_dec_ctx
+ * #th_enc_ctx or #th_dec_ctx handle (either will suffice).
+ * \param _encdec A previously allocated #th_enc_ctx or #th_dec_ctx
* handle.
* \param _granpos The granule position to convert.
* \return The absolute time in seconds corresponding to \a _granpos.
* \retval -1 The given granule position was invalid (i.e. negative).*/
-extern double theora_granule_time(void *_encdec,ogg_int64_t _granpos);
+extern double th_granule_time(void *_encdec,ogg_int64_t _granpos);
/**Determines whether a Theora packet is a header or not.
* This function does no verification beyond checking the packet type bit, so
* it should not be used for bitstream identification; use
- * theora_decode_headerin() for that.
+ * th_decode_headerin() for that.
* \param _op An <tt>ogg_packet</tt> containing encoded Theora data.
* \retval 1 The packet is a header packet
* \retval 0 The packet is a video data packet.*/
-extern int theora_packet_isheader(ogg_packet *_op);
+extern int th_packet_isheader(ogg_packet *_op);
/**Determines whether a theora packet is a key frame or not.
* This function does no verification beyond checking the packet type and
* key frame bits, so it should not be used for bitstream identification; use
- * theora_decode_headerin() for that.
+ * th_decode_headerin() for that.
* \param _op An <tt>ogg_packet</tt> containing encoded Theora data.
* \retval 1 The packet contains a key frame.
* \retval 0 The packet contains a delta frame.
* \retval -1 The packet is not a video data packet.*/
-extern int theora_packet_iskeyframe(ogg_packet *_op);
+extern int th_packet_iskeyframe(ogg_packet *_op);
/*@}*/
@@ -481,66 +481,66 @@
* This should be called on a freshly allocated #theora_info structure before
* attempting to use it.
* \param _info The #theora_info struct to initialize.*/
-extern void theora_info_init(theora_info *_info);
+extern void th_info_init(theora_info *_info);
/**Clears a #theora_info structure.
* This should be called on a #theora_info structure after it is no longer
* needed.
* \param _info The #theora_info struct to clear.*/
-extern void theora_info_clear(theora_info *_info);
+extern void th_info_clear(theora_info *_info);
-/**Initialize a #theora_comment structure.
- * This should be called on a freshly allocated #theora_comment structure
+/**Initialize a #th_comment structure.
+ * This should be called on a freshly allocated #th_comment structure
* before attempting to use it.
- * \param _tc The #theora_comment struct to initialize.*/
-extern void theora_comment_init(theora_comment *_tc);
-/**Add a comment to an initialized #theora_comment structure.
- * \note Neither theora_comment_add() nor theora_comment_add_tag() support
+ * \param _tc The #th_comment struct to initialize.*/
+extern void th_comment_init(th_comment *_tc);
+/**Add a comment to an initialized #th_comment structure.
+ * \note Neither th_comment_add() nor th_comment_add_tag() support
* comments containing null values, although the bitstream format does
* support them.
- * To add such comments you will need to manipulate the #theora_comment
+ * To add such comments you will need to manipulate the #th_comment
* structure directly.
- * \param _tc The #theora_comment struct to add the comment to.
+ * \param _tc The #th_comment struct to add the comment to.
* \param _comment Must be a null-terminated UTF-8 string containing the
* comment in "TAG=the value" form.*/
-extern void theora_comment_add(theora_comment *_tc, char *_comment);
-/**Add a comment to an initialized #theora_comment structure.
- * \note Neither theora_comment_add() nor theora_comment_add_tag() support
+extern void th_comment_add(th_comment *_tc, char *_comment);
+/**Add a comment to an initialized #th_comment structure.
+ * \note Neither th_comment_add() nor th_comment_add_tag() support
* comments containing null values, although the bitstream format does
* support them.
- * To add such comments you will need to manipulate the #theora_comment
+ * To add such comments you will need to manipulate the #th_comment
* structure directly.
- * \param _tc The #theora_comment struct to add the comment to.
+ * \param _tc The #th_comment struct to add the comment to.
* \param _tag A null-terminated string containing the tag associated with
* the comment.
* \param _val The corresponding value as a null-terminated string.*/
-extern void theora_comment_add_tag(theora_comment *_tc,char *_tag,char *_val);
+extern void th_comment_add_tag(th_comment *_tc,char *_tag,char *_val);
/**Look up a comment value by its tag.
- * \param _tc An initialized #theora_comment structure.
+ * \param _tc An initialized #th_comment structure.
* \param _tag The tag to look up.
* \param _count The instance of the tag.
* The same tag can appear multiple times, each with a distinct
* value, so an index is required to retrieve them all.
* The order these values appear in is significant and should be
* preserved.
- * Use theora_comment_query_count() to get the legal range for
+ * Use th_comment_query_count() to get the legal range for
* the \a _count parameter.
* \return A pointer to the queried tag's value.
* \retval NULL If no matching tag is found.*/
-extern char *theora_comment_query(theora_comment *_tc,char *_tag,int _count);
+extern char *th_comment_query(th_comment *_tc,char *_tag,int _count);
/**Look up the number of instances of a tag.
* Call this first when querying for a specific tag and then iterate over the
- * number of instances with separate calls to theora_comment_query() to
+ * number of instances with separate calls to th_comment_query() to
* retrieve all instances in order.
- * \param _tc An initialized #theora_comment structure.
+ * \param _tc An initialized #th_comment structure.
* \param _tag The tag to look up.
* \return The number on instances of this particular tag.*/
-extern int theora_comment_query_count(theora_comment *_tc,char *_tag);
-/**Clears a #theora_comment structure.
- * This should be called on a #theora_comment structure after it is no longer
+extern int th_comment_query_count(th_comment *_tc,char *_tag);
+/**Clears a #th_comment structure.
+ * This should be called on a #th_comment structure after it is no longer
* needed.
* It will free all memory used by the structure members.
- * \param _tc The #theora_comment struct to clear.*/
-extern void theora_comment_clear(theora_comment *_tc);
+ * \param _tc The #th_comment struct to clear.*/
+extern void th_comment_clear(th_comment *_tc);
/*@}*/
/*@}*/
Modified: experimental/derf/theora-exp/include/theora/theoradec.h
===================================================================
--- experimental/derf/theora-exp/include/theora/theoradec.h 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/include/theora/theoradec.h 2006-03-30 22:36:54 UTC (rev 11071)
@@ -29,9 +29,9 @@
-/**\name theora_decode_ctl() codes
+/**\name th_decode_ctl() codes
* \anchor decctlcodes
- * These are the available request codes for theora_decode_ctl().
+ * These are the available request codes for th_decode_ctl().
* By convention, these are odd, to distinguish them from the
* \ref encctlcodes "encoder control codes".
* Keep any experimental or vendor-specific values above \c 0x8000.*/
@@ -39,45 +39,45 @@
/**Gets the maximum post-processing level.
*
* \param[out] _buf int: The maximum post-processing level.
- * \retval OC_FAULT \a _dec_ctx or \a _buf is <tt>NULL</tt>.
- * \retval OC_EINVAL \a _buf_sz is not <tt>sizeof(int)</tt>.
- * \retval OC_IMPL Not supported by this implementation.*/
-#define OC_DECCTL_GET_PPLEVEL_MAX (1)
+ * \retval TH_FAULT \a _dec_ctx or \a _buf is <tt>NULL</tt>.
+ * \retval TH_EINVAL \a _buf_sz is not <tt>sizeof(int)</tt>.
+ * \retval TH_IMPL Not supported by this implementation.*/
+#define TH_DECCTL_GET_PPLEVEL_MAX (1)
/**Sets the post-processing level.
* By default, post-processing is disabled.
*
* \param[in] _buf int: The new post-processing level.
* 0 to disable; larger values use more CPU.
- * \retval OC_FAULT \a _dec_ctx or \a _buf is <tt>NULL</tt>.
- * \retval OC_EINVAL \a _buf_sz is not <tt>sizeof(int)</tt>, or the
+ * \retval TH_FAULT \a _dec_ctx or \a _buf is <tt>NULL</tt>.
+ * \retval TH_EINVAL \a _buf_sz is not <tt>sizeof(int)</tt>, or the
* post-processing level is out of bounds.
* The maximum post-processing level may be
* implementation-specific, and can be obtained via
- * #OC_DECCTL_GET_PPLEVEL_MAX.
- * \retval OC_IMPL Not supported by this implementation.*/
-#define OC_DECCTL_SET_PPLEVEL (3)
+ * #TH_DECCTL_GET_PPLEVEL_MAX.
+ * \retval TH_IMPL Not supported by this implementation.*/
+#define TH_DECCTL_SET_PPLEVEL (3)
/**Sets the granule position.
* Call this after a seek, before decoding the first frame, to ensure that the
* proper granule position is returned for all subsequent frames.
*
* \param[in] _buf <tt>ogg_int64_t</tt>: The granule position of the next
* frame.
- * \retval OC_FAULT \a _dec_ctx or \a _buf is <tt>NULL</tt>.
- * \retval OC_EINVAL \a _buf_sz is not <tt>sizeof(ogg_int64_t)</tt>, or the
+ * \retval TH_FAULT \a _dec_ctx or \a _buf is <tt>NULL</tt>.
+ * \retval TH_EINVAL \a _buf_sz is not <tt>sizeof(ogg_int64_t)</tt>, or the
* granule position is negative.*/
-#define OC_DECCTL_SET_GRANPOS (5)
+#define TH_DECCTL_SET_GRANPOS (5)
/**Sets the striped decode callback function.
* If set, this function will be called as each piece of a frame is fully
- * decoded in theora_decode_packetin().
+ * decoded in th_decode_packetin().
* You can pass in a #theora_stripe_callback with
* theora_stripe_callback#stripe_decoded set to <tt>NULL</tt> to disable the
* callbacks at any point.
*
* \param[in] _buf #theora_stripe_callback: The callback parameters.
- * \retval OC_FAULT \a _dec_ctx or \a _buf is <tt>NULL</tt>.
- * \retval OC_EINVAL \a _buf_sz is not
+ * \retval TH_FAULT \a _dec_ctx or \a _buf is <tt>NULL</tt>.
+ * \retval TH_EINVAL \a _buf_sz is not
* <tt>sizeof(theora_stripe_callback)</tt>.*/
-#define OC_DECCTL_SET_STRIPE_CB (7)
+#define TH_DECCTL_SET_STRIPE_CB (7)
/*@}*/
@@ -85,7 +85,7 @@
/**A callback function for striped decode.
* This is a function pointer to an application-provided function that will be
* called each time a section of the image is fully decoded in
- * theora_decode_packetin().
+ * th_decode_packetin().
* This allows the application to process the section immediately, while it is
* still in cache.
* Note that the frame is decoded bottom to top, so \a _yfrag0 will steadily
@@ -95,7 +95,7 @@
* format and the number of post-processing filters enabled, and may not even
* be constant for the entire frame.
* If a non-<tt>NULL</tt> \a _granpos pointer is passed to
- * theora_decode_packetin(), the granule position for the frame will be stored
+ * th_decode_packetin(), the granule position for the frame will be stored
* in it before the first callback is made.
* If an entire frame is dropped (a 0-byte packet), then no callbacks will be
* made at all for that frame.
@@ -113,16 +113,16 @@
* this will always be divisible by two.
* I.e., this section contains fragment rows
* <tt>\a _yfrag0 ...\a _yfrag_end -1</tt>.*/
-typedef void (*theora_stripe_decoded_func)(void *_ctx,theora_ycbcr_buffer _buf,
+typedef void (*th_stripe_decoded_func)(void *_ctx,th_ycbcr_buffer _buf,
int _yfrag0,int _yfrag_end);
-/**The striped decode callback data to pass to #OC_DECCTL_SET_STRIPE_CB.*/
+/**The striped decode callback data to pass to #TH_DECCTL_SET_STRIPE_CB.*/
typedef struct{
/**An application-provided context pointer.
* This will be passed back verbatim to the application.*/
void *ctx;
/**The callback function pointer.*/
- theora_stripe_decoded_func stripe_decoded;
+ th_stripe_decoded_func stripe_decoded;
}theora_stripe_callback;
@@ -134,14 +134,14 @@
warning.*/
/*@{*/
/**The decoder context.*/
-typedef struct theora_dec_ctx theora_dec_ctx;
+typedef struct th_dec_ctx th_dec_ctx;
/**Setup information.
This contains auxiliary information (Huffman tables and quantization
- parameters) decoded from the setup header by theora_decode_headerin() to be
- passed to theora_decode_alloc().
+ parameters) decoded from the setup header by th_decode_headerin() to be
+ passed to th_decode_alloc().
It can be re-used to initialize any number of decoders, and can be freed
- via theora_setup_free() at any time.*/
-typedef struct theora_setup_info theora_setup_info;
+ via th_setup_free() at any time.*/
+typedef struct th_setup_info th_setup_info;
/*@}*/
@@ -154,15 +154,15 @@
*
* The functions are listed in the order they are used in a typical decode.
* The basic steps are:
- * - Parse the header packets by repeatedly calling theora_decode_headerin().
- * - Allocate a #theora_dec_ctx handle with theora_decode_alloc().
- * - Call theora_setup_free() to free any memory used for codec setup
+ * - Parse the header packets by repeatedly calling th_decode_headerin().
+ * - Allocate a #th_dec_ctx handle with th_decode_alloc().
+ * - Call th_setup_free() to free any memory used for codec setup
* information.
- * - Perform any additional decoder configuration with theora_decode_ctl().
+ * - Perform any additional decoder configuration with th_decode_ctl().
* - For each video data packet:
- * - Submit the packet to the decoder via theora_decode_packetin().
- * - Retrieve the uncompressed video data via theora_decode_ycbcr_out().
- * - Call theora_decode_free() to release all decoder memory.*/
+ * - Submit the packet to the decoder via th_decode_packetin().
+ * - Retrieve the uncompressed video data via th_decode_ycbcr_out().
+ * - Call th_decode_free() to release all decoder memory.*/
/*@{*/
/**Decodes the header packets of a Theora stream.
* This should be called on the initial packets of the stream, in succession,
@@ -174,11 +174,11 @@
* that stream is a Theora stream.
* \param _info A #theora_info structure to fill in.
* This must have been previously initialized with
- * theora_info_init().
+ * th_info_init().
* The application may immediately begin using the contents of
* this structure after the first header is decoded, though it
* must continue to be passed in on all subsequent calls.
- * \param _tc A #theora_comment structure to fill in.
+ * \param _tc A #th_comment structure to fill in.
* The application may immediately begin using the contents of
* this structure after the second header is decoded, though it
* must continue to be passed in on all subsequent calls.
@@ -194,46 +194,46 @@
* \retval 0 The first video data packet was encountered after all
* required header packets were parsed.
* The packet just passed in on this call should be saved
- * and fed to theora_decode_packetin() to begin decoding
+ * and fed to th_decode_packetin() to begin decoding
* video data.
- * \retval OC_FAULT One of \a _info, \a _tc, or \a _setup was
+ * \retval TH_FAULT One of \a _info, \a _tc, or \a _setup was
* <tt>NULL</tt>.
- * \retval OC_BADHEADER \a _op was <tt>NULL</tt>, the packet was not the next
+ * \retval TH_BADHEADER \a _op was <tt>NULL</tt>, the packet was not the next
* header packet in the expected sequence, or the format
* of the header data was invalid.
- * \retval OC_VERSION The packet data was a Theora info header, but for a
+ * \retval TH_VERSION The packet data was a Theora info header, but for a
* bitstream version not decodable with this version of
* <tt>libtheora</tt>.
- * \retval OC_NOTFORMAT The packet was not a Theora header.
+ * \retval TH_NOTFORMAT The packet was not a Theora header.
*/
-extern int theora_decode_headerin(theora_info *_info,theora_comment *_tc,
- theora_setup_info **_setup,ogg_packet *_op);
+extern int th_decode_headerin(theora_info *_info,th_comment *_tc,
+ th_setup_info **_setup,ogg_packet *_op);
/**Allocates a decoder instance.
- * \param _info A #theora_info struct filled via theora_decode_headerin().
- * \param _setup A #theora_setup_info handle returned via
- * theora_decode_headerin().
- * \return The initialized #theora_dec_ctx handle.
+ * \param _info A #theora_info struct filled via th_decode_headerin().
+ * \param _setup A #th_setup_info handle returned via
+ * th_decode_headerin().
+ * \return The initialized #th_dec_ctx handle.
* \retval NULL If the decoding parameters were invalid.*/
-extern theora_dec_ctx *theora_decode_alloc(const theora_info *_info,
- const theora_setup_info *_setup);
+extern th_dec_ctx *th_decode_alloc(const theora_info *_info,
+ const th_setup_info *_setup);
/**Releases all storage used for the decoder setup information.
* This should be called after you no longer want to create any decoders for
- * a stream whose headers you have parsed with theora_decode_headerin().
+ * a stream whose headers you have parsed with th_decode_headerin().
* \param _setup The setup information to free.
* This can safely be <tt>NULL</tt>.*/
-extern void theora_setup_free(theora_setup_info *_setup);
+extern void th_setup_free(th_setup_info *_setup);
/**Decoder control function.
* This is used to provide advanced control of the decoding process.
- * \param _dec A #theora_dec_ctx handle.
+ * \param _dec A #th_dec_ctx handle.
* \param _req The control code to process.
* See \ref decctlcodes "the list of available control codes"
* for details.
* \param _buf The parameters for this control code.
* \param _buf_sz The size of the parameter buffer.*/
-extern int theora_decode_ctl(theora_dec_ctx *_dec,int _req,void *_buf,
+extern int th_decode_ctl(th_dec_ctx *_dec,int _req,void *_buf,
size_t _buf_sz);
/**Submits a packet containing encoded video data to the decoder.
- * \param _dec A #theora_dec_ctx handle.
+ * \param _dec A #th_dec_ctx handle.
* \param _op An <tt>ogg_packet</tt> containing encoded video data.
* \param _granpos Returns the granule position of the decoded packet.
* If non-<tt>NULL</tt>, the granule position for this specific
@@ -241,18 +241,18 @@
* This is computed incrementally from previously decoded
* packets.
* After a seek, the correct granule position must be set via
- * #OC_DECCTL_SET_GRANPOS for this to work properly.
+ * #TH_DECCTL_SET_GRANPOS for this to work properly.
* \retval 0 Success.
- * \retval OC_FAULT \a _dec or _op was <tt>NULL</tt>.
- * \retval OC_BADPACKET \a _op does not contain encoded video data.
- * \retval OC_IMPL The video data uses bitstream features which this
+ * \retval TH_FAULT \a _dec or _op was <tt>NULL</tt>.
+ * \retval TH_BADPACKET \a _op does not contain encoded video data.
+ * \retval TH_IMPL The video data uses bitstream features which this
* library does not support.*/
-extern int theora_decode_packetin(theora_dec_ctx *_dec,const ogg_packet *_op,
+extern int th_decode_packetin(th_dec_ctx *_dec,const ogg_packet *_op,
ogg_int64_t *_granpos);
/**Outputs the next available frame of decoded Y'CbCr data.
- * If a striped decode callback has been set with #OC_DECCTL_SET_STRIPE_CB,
+ * If a striped decode callback has been set with #TH_DECCTL_SET_STRIPE_CB,
* then the application does not need to call this function.
- * \param _dec A #theora_dec_ctx handle.
+ * \param _dec A #th_dec_ctx handle.
* \param _ycbcr A video buffer structure to fill in.
* <tt>libtheora</tt> will fill in all the members of this
* structure, including the pointers to the uncompressed video
@@ -263,11 +263,11 @@
* subsequent frames are decoded.
* \retval 0 Success
*/
-extern int theora_decode_ycbcr_out(theora_dec_ctx *_dec,
- theora_ycbcr_buffer _ycbcr);
+extern int th_decode_ycbcr_out(th_dec_ctx *_dec,
+ th_ycbcr_buffer _ycbcr);
/**Frees an allocated decoder instance.
- * \param _dec A #theora_dec_ctx handle.*/
-extern void theora_decode_free(theora_dec_ctx *_dec);
+ * \param _dec A #th_dec_ctx handle.*/
+extern void th_decode_free(th_dec_ctx *_dec);
/*@}*/
/*@}*/
Modified: experimental/derf/theora-exp/include/theora/theoraenc.h
===================================================================
--- experimental/derf/theora-exp/include/theora/theoraenc.h 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/include/theora/theoraenc.h 2006-03-30 22:36:54 UTC (rev 11071)
@@ -32,10 +32,10 @@
/**The configuration information for the VBR encoding mode.
* This mode attempts to encode the video with a constant psychovisual
* quality.
- * It can be enabled by calling theora_encode_ctl() with #OC_ENCCTL_SETUP_VBR.
+ * It can be enabled by calling th_encode_ctl() with #TH_ENCCTL_SETUP_VBR.
* See the #theora_info struct documentation for details on how the default
* encoding mode is chosen.*/
-typedef struct theora_vbr_cfg{
+typedef struct th_vbr_cfg{
/**The target quality index.
* Valid values range from 0 to 63, inclusive, with higher values giving
* higher quality.
@@ -61,24 +61,24 @@
* higher quality.
* This must be at least as large as #df_qi_max.*/
int df_qi_max;
-}theora_vbr_cfg;
+}th_vbr_cfg;
/**The configuration information for the constant QI encoding mode.
* This mode encodes the video with a constant quality index.
* This is the fastest encoding mode.
- * It can be enabled by calling theora_encode_ctl() with #OC_ENCCTL_SETUP_CQI.
+ * It can be enabled by calling th_encode_ctl() with #TH_ENCCTL_SETUP_CQI.
* See the #theora_info struct documentation for details on how the default
* encoding mode is chosen.*/
-typedef struct theora_cqi_cfg{
+typedef struct th_cqi_cfg{
/**The target quality index.
Valid values range from 0 to 63, inclusive, with higher values giving
higher quality.*/
int qi;
-}theora_cqi_cfg;
+}th_cqi_cfg;
-/**\name theora_encode_ctl() codes
+/**\name th_encode_ctl() codes
* \anchor encctlcodes
- * These are the available request codes for theora_encode_ctl().
+ * These are the available request codes for th_encode_ctl().
* By convention, these are even, to distinguish them from the
* \ref decctlcodes "decoder control codes".
* Keep any experimental or vendor-specific values above \c 0x8000.*/
@@ -88,15 +88,15 @@
* this call.
* <tt>NULL</tt> may be specified to revert to the default tables.
*
- * \param[in] _buf <tt>#theora_huff_code[#OC_NHUFFMAN_TABLES][#OC_NDCT_TOKENS]</tt>
- * \retval OC_FAULT \a _enc_ctx is <tt>NULL</tt>.
- * \retval OC_EINVAL Encoding has already begun or one or more of the given
+ * \param[in] _buf <tt>#theora_huff_code[#TH_NHUFFMAN_TABLES][#TH_NDCT_TOKENS]</tt>
+ * \retval TH_FAULT \a _enc_ctx is <tt>NULL</tt>.
+ * \retval TH_EINVAL Encoding has already begun or one or more of the given
* tables is not full or prefix-free, \a _buf is
* <tt>NULL</tt> and \a _buf_sz is not zero, or \a _buf is
* non-<tt>NULL</tt> and \a _buf_sz is not
- * <tt>sizeof(#theora_huff_code)*#OC_NHUFFMAN_TABLES*#OC_NDCT_TOKENS</tt>.
- * \retval OC_IMPL Not supported by this implementation.*/
-#define OC_ENCCTL_SET_HUFFMAN_CODES (0)
+ * <tt>sizeof(#theora_huff_code)*#TH_NHUFFMAN_TABLES*#TH_NDCT_TOKENS</tt>.
+ * \retval TH_IMPL Not supported by this implementation.*/
+#define TH_ENCCTL_SET_HUFFMAN_CODES (0)
/**Sets the quantization parameters to use.
* The parameters are copied, not stored by reference, so they can be freed
* after this call.
@@ -108,14 +108,14 @@
* \a pli, and \a ci does not increase as \a qi increases.
*
* \param[in] _buf #theora_quant_info
- * \retval OC_FAULT \a _enc_ctx is <tt>NULL</tt>.
- * \retval OC_EINVAL Encoding has already begun, the quantization parameters
+ * \retval TH_FAULT \a _enc_ctx is <tt>NULL</tt>.
+ * \retval TH_EINVAL Encoding has already begun, the quantization parameters
* do not meet one of the above stated conditions, \a _buf
* is <tt>NULL</tt> and \a _buf_sz is not zero, or \a _buf
* is non-<tt>NULL</tt> and \a _buf_sz is not
* <tt>sizeof(#theora_quant_info)</tt>.
- * \retval OC_IMPL Not supported by this implementation.*/
-#define OC_ENCCTL_SET_QUANT_PARAMS (2)
+ * \retval TH_IMPL Not supported by this implementation.*/
+#define TH_ENCCTL_SET_QUANT_PARAMS (2)
/**Sets the maximum distance between key frames.
* This can be changed during an encode, but will be bounded by
* <tt>1<<theora_info#keyframe_granule_shift</tt>.
@@ -125,10 +125,10 @@
* \param[in] _buf <tt>ogg_uint32_t</tt>: The maximum distance between key
* frames.
* \param[out] _buf <tt>ogg_uint32_t</tt>: The actual maximum distance set.
- * \retval OC_FAULT \a _enc_ctx or \a _buf is <tt>NULL</tt>.
- * \retval OC_EINVAL \a _buf_sz is not <tt>sizeof(ogg_uint32_t)</tt>.
- * \retval OC_IMPL Not supported by this implementation.*/
-#define OC_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE (4)
+ * \retval TH_FAULT \a _enc_ctx or \a _buf is <tt>NULL</tt>.
+ * \retval TH_EINVAL \a _buf_sz is not <tt>sizeof(ogg_uint32_t)</tt>.
+ * \retval TH_IMPL Not supported by this implementation.*/
+#define TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE (4)
/**Disables any encoder features that would prevent lossless transcoding back
* to VP3.
* This primarily means disabling block-level QI values and not using 4MV mode
@@ -153,10 +153,10 @@
* 4:2:0, the picture region is smaller than the full frame,
* or if encoding has begun, preventing the quantization
* tables and codebooks from being set.
- * \retval OC_FAULT \a _enc_ctx or \a _buf is <tt>NULL</tt>.
- * \retval OC_EINVAL \a _buf_sz is not <tt>sizeof(int)</tt>.
- * \retval OC_IMPL Not supported by this implementation.*/
-#define OC_ENCCTL_SET_VP3_COMPATIBLE (10)
+ * \retval TH_FAULT \a _enc_ctx or \a _buf is <tt>NULL</tt>.
+ * \retval TH_EINVAL \a _buf_sz is not <tt>sizeof(int)</tt>.
+ * \retval TH_IMPL Not supported by this implementation.*/
+#define TH_ENCCTL_SET_VP3_COMPATIBLE (10)
/**Gets the maximum speed level.
* Higher speed levels favor quicker encoding over better quality per bit.
* Depending on the encoding mode, and the internal algorithms used, quality
@@ -166,25 +166,25 @@
* the current encoding mode (VBR vs. CQI, etc.).
*
* \param[out] _buf int: The maximum encoding speed level.
- * \retval OC_FAULT \a _enc_ctx or \a _buf is <tt>NULL</tt>.
- * \retval OC_EINVAL \a _buf_sz is not <tt>sizeof(int)</tt>.
- * \retval OC_IMPL Not supported by this implementation in the current
+ * \retval TH_FAULT \a _enc_ctx or \a _buf is <tt>NULL</tt>.
+ * \retval TH_EINVAL \a _buf_sz is not <tt>sizeof(int)</tt>.
+ * \retval TH_IMPL Not supported by this implementation in the current
* encoding mode.*/
-#define OC_ENCCTL_GET_SPLEVEL_MAX (12)
+#define TH_ENCCTL_GET_SPLEVEL_MAX (12)
/**Sets the speed level.
* By default, the slowest speed (0) is used.
*
* \param[in] _buf int: The new encoding speed level.
* 0 is slowest, larger values use less CPU.
- * \retval OC_FAULT \a _enc_ctx or \a _buf is <tt>NULL</tt>.
- * \retval OC_EINVAL \a _buf_sz is not <tt>sizeof(int)</tt>, or the
+ * \retval TH_FAULT \a _enc_ctx or \a _buf is <tt>NULL</tt>.
+ * \retval TH_EINVAL \a _buf_sz is not <tt>sizeof(int)</tt>, or the
* encoding speed level is out of bounds.
* The maximum encoding speed level may be
* implementation- and encoding mode-specific, and can be
- * obtained via #OC_ENCCTL_GET_SPLEVEL_MAX.
- * \retval OC_IMPL Not supported by this implementation in the current
+ * obtained via #TH_ENCCTL_GET_SPLEVEL_MAX.
+ * \retval TH_IMPL Not supported by this implementation in the current
* encoding mode.*/
-#define OC_ENCCTL_SET_SPLEVEL (14)
+#define TH_ENCCTL_SET_SPLEVEL (14)
/**Puts the encoder in VBR mode.
* This can be done at any time during the encoding process, with different
* configuration parameters, to encode different regions of the video segment
@@ -192,44 +192,44 @@
* See the #theora_info struct documentation for details on how the default
* encoding mode is chosen.
*
- * \param[in] _buf <tt>#theora_vbr_cfg</tt>: the configuration parameters.
+ * \param[in] _buf <tt>#th_vbr_cfg</tt>: the configuration parameters.
* This may be <tt>NULL</tt>, in which the current VBR
* configuration is unchanged.
* The default is to use the QI setting passed in via the
* #theora_info struct when the encoder was initialized, with
* a full range of admissible quantizers.
* \retval OC_EFAULT \a _enc_ctx is <tt>NULL</tt>.
- * \retval OC_EINVAL The configuration parameters do not meet one of their
+ * \retval TH_EINVAL The configuration parameters do not meet one of their
* stated requirements, \a _buf is <tt>NULL</tt> and
* \a _buf_sz is not zero, or \a _buf is non-<tt>NULL</tt>
- * and \a _buf_sz is not <tt>sizeof(#theora_vbr_cfg)</tt>.
- * \retval OC_IMPL Not supported by this implementation.*/
-#define OC_ENCCTL_SETUP_VBR (16)
+ * and \a _buf_sz is not <tt>sizeof(#th_vbr_cfg)</tt>.
+ * \retval TH_IMPL Not supported by this implementation.*/
+#define TH_ENCCTL_SETUP_VBR (16)
/**Puts the encoder in CQI mode.
* This can be done at any time during the encoding process, with different QI
* values.
* See the #theora_info struct documentation for details on how the default
* encoding mode is chosen.
*
- * \param[in] _buf <tt>#theora_cqi_cfg</tt>: the configuration parameters.
+ * \param[in] _buf <tt>#th_cqi_cfg</tt>: the configuration parameters.
* This may be <tt>NULL</tt>, in which case the current CQI
* configuration is unchanged.
* The default is to use the QI setting passed in via the
* #theora_info struct when the encoder was initialized.
* \retval OC_EFAULT \a _enc_ctx is <tt>NULL</tt>.
- * \retval OC_EINVAL \a _buf_sz is not <tt>sizeof(#theora_cqi_cfg)</tt>.
- * \retval OC_IMPL Not supported by this implementation.*/
-#define OC_ENCCTL_SETUP_CQI (18)
+ * \retval TH_EINVAL \a _buf_sz is not <tt>sizeof(#th_cqi_cfg)</tt>.
+ * \retval TH_IMPL Not supported by this implementation.*/
+#define TH_ENCCTL_SETUP_CQI (18)
/*@}*/
/**The quantization parameters used by VP3.*/
-extern const theora_quant_info OC_VP31_QUANT_INFO;
+extern const theora_quant_info TH_VP31_QUANT_INFO;
/**The Huffman tables used by VP3.*/
extern const theora_huff_code
- OC_VP31_HUFF_CODES[OC_NHUFFMAN_TABLES][OC_NDCT_TOKENS];
+ TH_VP31_HUFF_CODES[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS];
@@ -240,7 +240,7 @@
warning.*/
/*@{*/
/**The encoder context.*/
-typedef struct theora_enc_ctx theora_enc_ctx;
+typedef struct th_enc_ctx th_enc_ctx;
/*@}*/
@@ -255,38 +255,38 @@
* The basic steps are:
* - Fill in a #theora_info structure with details on the format of the video
* you wish to encode.
- * - Allocate a #theora_enc_ctx handle with theora_encode_alloc().
+ * - Allocate a #th_enc_ctx handle with th_encode_alloc().
* - Perform any additional encoder configuration required with
- * theora_encode_ctl().
- * - Repeatedly call theora_encode_flushheader() to retrieve all the header
+ * th_encode_ctl().
+ * - Repeatedly call th_encode_flushheader() to retrieve all the header
* packets.
* - For each uncompressed frame:
- * - Submit the uncompressed frame via theora_encode_ycbcr_in()
- * - Repeatedly call theora_encode_packetout() to retrieve any video data
+ * - Submit the uncompressed frame via th_encode_ycbcr_in()
+ * - Repeatedly call th_encode_packetout() to retrieve any video data
* packets that are ready.
- * - Call theora_encode_free() to release all encoder memory.*/
+ * - Call th_encode_free() to release all encoder memory.*/
/*@{*/
/**Allocates an encoder instance.
* \param _info A #theora_info struct filled with the desired encoding
* parameters.
- * \return The initialized #theora_enc_ctx handle.
+ * \return The initialized #th_enc_ctx handle.
* \retval NULL If the encoding parameters were invalid.*/
-extern theora_enc_ctx *theora_encode_alloc(const theora_info *_info);
+extern th_enc_ctx *th_encode_alloc(const theora_info *_info);
/**Encoder control function.
* This is used to provide advanced control the encoding process.
- * \param _enc A #theora_enc_ctx handle.
+ * \param _enc A #th_enc_ctx handle.
* \param _req The control code to process.
* See \ref encctlcodes "the list of available control codes"
* for details.
* \param _buf The parameters for this control code.
* \param _buf_sz The size of the parameter buffer.*/
-extern int theora_encode_ctl(theora_enc_ctx *_enc,int _req,void *_buf,
+extern int th_encode_ctl(th_enc_ctx *_enc,int _req,void *_buf,
size_t _buf_sz);
/**Outputs the next header packet.
* This should be called repeatedly after encoder initialization until it
* returns 0 to get all of the header packets, in order, before encoding
* actual video data.
- * \param _enc A #theora_enc_ctx handle.
+ * \param _enc A #th_enc_ctx handle.
* \param _comments The metadata to place in the comment header, when it is
* encoded.
* \param _op An <tt>ogg_packet</tt> structure to fill.
@@ -297,19 +297,19 @@
* \return A positive value indicates that a header packet was successfully
* produced.
* \retval 0 No packet was produced, and no more header packets remain.
- * \retval OC_FAULT \a _enc, \a _comments, or \a _op was <tt>NULL</tt>.*/
-extern int theora_encode_flushheader(theora_enc_ctx *_enc,
- theora_comment *_comments,ogg_packet *_op);
+ * \retval TH_FAULT \a _enc, \a _comments, or \a _op was <tt>NULL</tt>.*/
+extern int th_encode_flushheader(th_enc_ctx *_enc,
+ th_comment *_comments,ogg_packet *_op);
/**Submits an uncompressed frame to the encoder.
- * \param _enc A #theora_enc_ctx handle.
+ * \param _enc A #th_enc_ctx handle.
* \param _ycbcr A buffer of Y'CbCr data to encode.
* \retval 0 Success.
- * \retval OC_FAULT \a _enc or \a _ycbcr is <tt>NULL</tt>.
- * \retval OC_EINVAL The buffer size does not match the frame size the encoder
+ * \retval TH_FAULT \a _enc or \a _ycbcr is <tt>NULL</tt>.
+ * \retval TH_EINVAL The buffer size does not match the frame size the encoder
* was initialized with, or encoding has already completed.
*/
-extern int theora_encode_ycbcr_in(theora_enc_ctx *_enc,
- theora_ycbcr_buffer _ycbcr);
+extern int th_encode_ycbcr_in(th_enc_ctx *_enc,
+ th_ycbcr_buffer _ycbcr);
/**Retrieves encoded video data packets.
* This should be called repeatedly after each frame is submitted to flush any
* encoded packets, until it returns 0.
@@ -318,7 +318,7 @@
* \note Currently the encoder operates in a one-frame-in, one-packet-out
* manner.
* However, this may be changed in the future.
- * \param _enc A #theora_enc_ctx handle.
+ * \param _enc A #th_enc_ctx handle.
* \param _last Set this flag to a non-zero value if no more uncompressed
* frames will be submitted.
* This ensures that a proper EOS flag is set on the last packet.
@@ -330,12 +330,12 @@
* produced.
* \retval 0 No packet was produced, and no more encoded video data
* remains.
- * \retval OC_FAULT \a _enc or \a _op was <tt>NULL</tt>.*/
-extern int theora_encode_packetout(theora_enc_ctx *_enc,int _last,
+ * \retval TH_FAULT \a _enc or \a _op was <tt>NULL</tt>.*/
+extern int th_encode_packetout(th_enc_ctx *_enc,int _last,
ogg_packet *_op);
/**Frees an allocated encoder instance.
- * \param _enc A #theora_enc_ctx handle.*/
-extern void theora_encode_free(theora_enc_ctx *_enc);
+ * \param _enc A #th_enc_ctx handle.*/
+extern void th_encode_free(th_enc_ctx *_enc);
/*@}*/
/*@}*/
Modified: experimental/derf/theora-exp/lib/decinfo.c
===================================================================
--- experimental/derf/theora-exp/lib/decinfo.c 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/decinfo.c 2006-03-30 22:36:54 UTC (rev 11071)
@@ -34,12 +34,12 @@
_info->version_minor=(unsigned char)val;
theora_read(_opb,8,&val);
_info->version_subminor=(unsigned char)val;
- if(_info->version_major>OC_VERSION_MAJOR||
- _info->version_major==OC_VERSION_MAJOR&&
- (_info->version_minor>OC_VERSION_MINOR||
- _info->version_minor==OC_VERSION_MINOR&&
- _info->version_subminor>OC_VERSION_SUB)){
- return OC_VERSION;
+ if(_info->version_major>TH_VERSION_MAJOR||
+ _info->version_major==TH_VERSION_MAJOR&&
+ (_info->version_minor>TH_VERSION_MINOR||
+ _info->version_minor==TH_VERSION_MINOR&&
+ _info->version_subminor>TH_VERSION_SUB)){
+ return TH_VERSION;
}
/*Read the encoded frame description.*/
theora_read(_opb,16,&val);
@@ -66,14 +66,14 @@
_info->pic_width+_info->pic_x>_info->frame_width||
_info->pic_height+_info->pic_y>_info->frame_height||
_info->fps_numerator<=0||_info->fps_denominator<=0){
- return OC_BADHEADER;
+ return TH_BADHEADER;
}
theora_read(_opb,24,&val);
_info->aspect_numerator=(ogg_uint32_t)val;
theora_read(_opb,24,&val);
_info->aspect_denominator=(ogg_uint32_t)val;
theora_read(_opb,8,&val);
- _info->colorspace=(theora_colorspace)val;
+ _info->colorspace=(th_colorspace)val;
theora_read(_opb,24,&val);
_info->target_bitrate=(int)val;
theora_read(_opb,6,&val);
@@ -81,16 +81,16 @@
theora_read(_opb,5,&val);
_info->keyframe_granule_shift=(int)val;
theora_read(_opb,2,&val);
- _info->pixel_fmt=(theora_pixel_fmt)val;
- if(theora_read(_opb,3,&val)<0||val!=0)return OC_BADHEADER;
+ _info->pixel_fmt=(th_pixel_fmt)val;
+ if(theora_read(_opb,3,&val)<0||val!=0)return TH_BADHEADER;
return 0;
}
-static int oc_comment_unpack(oggpack_buffer *_opb,theora_comment *_tc){
+static int oc_comment_unpack(oggpack_buffer *_opb,th_comment *_tc){
long len;
/*Read the vendor string.*/
len=oc_unpack_length(_opb);
- if(len<0)return OC_BADHEADER;
+ if(len<0)return TH_BADHEADER;
_tc->vendor=_ogg_malloc((size_t)len+1);
oc_unpack_octets(_opb,_tc->vendor,len);
_tc->vendor[len]='\0';
@@ -104,17 +104,17 @@
_tc->comments*sizeof(_tc->user_comments[0]));
for(i=0;i<_tc->comments;i++){
len=oc_unpack_length(_opb);
- if(len<0)return OC_BADHEADER;
+ if(len<0)return TH_BADHEADER;
_tc->comment_lengths[i]=len;
_tc->user_comments[i]=_ogg_malloc((size_t)len+1);
oc_unpack_octets(_opb,_tc->user_comments[i],len);
_tc->user_comments[i][len]='\0';
}
}
- return theora_read(_opb,0,&len)<0?OC_BADHEADER:0;
+ return theora_read(_opb,0,&len)<0?TH_BADHEADER:0;
}
-static int oc_setup_unpack(oggpack_buffer *_opb,theora_setup_info *_setup){
+static int oc_setup_unpack(oggpack_buffer *_opb,th_setup_info *_setup){
int ret;
/*Read the quantizer tables.*/
ret=oc_quant_params_unpack(_opb,&_setup->qinfo);
@@ -123,13 +123,13 @@
return oc_huff_trees_unpack(_opb,_setup->huff_tables);
}
-static void oc_setup_clear(theora_setup_info *_setup){
+static void oc_setup_clear(th_setup_info *_setup){
oc_quant_params_clear(&_setup->qinfo);
oc_huff_trees_clear(_setup->huff_tables);
}
static int oc_dec_headerin(oggpack_buffer *_opb,theora_info *_info,
- theora_comment *_tc,theora_setup_info **_setup,ogg_packet *_op){
+ th_comment *_tc,th_setup_info **_setup,ogg_packet *_op){
char buffer[6];
long val;
int packtype;
@@ -143,35 +143,35 @@
}
/*Check the codec string.*/
oc_unpack_octets(_opb,buffer,6);
- if(memcmp(buffer,"theora",6)!=0)return OC_NOTFORMAT;
+ if(memcmp(buffer,"theora",6)!=0)return TH_NOTFORMAT;
switch(packtype){
/*Codec info header.*/
case 0x80:{
/*This should be the first packet, and we should not already be
initialized.*/
- if(!_op->b_o_s||_info->frame_width>0)return OC_BADHEADER;
+ if(!_op->b_o_s||_info->frame_width>0)return TH_BADHEADER;
ret=oc_info_unpack(_opb,_info);
- if(ret<0)theora_info_clear(_info);
+ if(ret<0)th_info_clear(_info);
else ret=3;
}break;
/*Comment header.*/
case 0x81:{
- if(_tc==NULL)return OC_FAULT;
+ if(_tc==NULL)return TH_FAULT;
/*We shoud have already decoded the info header, and should not yet have
decoded the comment header.*/
- if(_info->frame_width<=0||_tc->vendor!=NULL)return OC_BADHEADER;
+ if(_info->frame_width<=0||_tc->vendor!=NULL)return TH_BADHEADER;
ret=oc_comment_unpack(_opb,_tc);
- if(ret<0)theora_comment_clear(_tc);
+ if(ret<0)th_comment_clear(_tc);
else ret=2;
}break;
/*Codec setup header.*/
case 0x82:{
oc_setup_info *setup;
- if(_tc==NULL||_setup==NULL)return OC_FAULT;
+ if(_tc==NULL||_setup==NULL)return TH_FAULT;
/*We should have already decoded the info header and the comment header,
and should not yet have decoded the setup header.*/
if(_info->frame_width<=0||_tc->vendor==NULL||*_setup!=NULL){
- return OC_BADHEADER;
+ return TH_BADHEADER;
}
setup=(oc_setup_info *)_ogg_calloc(1,sizeof(*setup));
ret=oc_setup_unpack(_opb,setup);
@@ -186,7 +186,7 @@
}break;
default:{
/*We don't know what this header is.*/
- return OC_BADHEADER;
+ return TH_BADHEADER;
}break;
}
return ret;
@@ -196,19 +196,19 @@
/*Decodes one header packet.
This should be called repeatedly with the packets at the beginning of the
stream until it returns 0.*/
-int theora_decode_headerin(theora_info *_info,theora_comment *_tc,
- theora_setup_info **_setup,ogg_packet *_op){
+int th_decode_headerin(theora_info *_info,th_comment *_tc,
+ th_setup_info **_setup,ogg_packet *_op){
oggpack_buffer opb;
int ret;
- if(_op==NULL)return OC_BADHEADER;
- if(_info==NULL)return OC_FAULT;
+ if(_op==NULL)return TH_BADHEADER;
+ if(_info==NULL)return TH_FAULT;
oggpackB_readinit(&opb,_op->packet,_op->bytes);
ret=oc_dec_headerin(&opb,_info,_tc,_setup,_op);
/*TODO: Clear opb in libogg2.*/
return ret;
}
-void theora_setup_free(theora_setup_info *_setup){
+void th_setup_free(th_setup_info *_setup){
if(_setup!=NULL){
oc_setup_clear(_setup);
_ogg_free(_setup);
Modified: experimental/derf/theora-exp/lib/decint.h
===================================================================
--- experimental/derf/theora-exp/lib/decint.h 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/decint.h 2006-03-30 22:36:54 UTC (rev 11071)
@@ -4,8 +4,8 @@
# include "theora/theoradec.h"
# include "internal.h"
-typedef struct theora_setup_info oc_setup_info;
-typedef struct theora_dec_ctx oc_dec_ctx;
+typedef struct th_setup_info oc_setup_info;
+typedef struct th_dec_ctx oc_dec_ctx;
# include "idct.h"
# include "huffdec.h"
@@ -18,16 +18,16 @@
-struct theora_setup_info{
+struct th_setup_info{
/*The Huffman codes.*/
- oc_huff_node *huff_tables[OC_NHUFFMAN_TABLES];
+ oc_huff_node *huff_tables[TH_NHUFFMAN_TABLES];
/*The quantization parameters.*/
theora_quant_info qinfo;
};
-struct theora_dec_ctx{
+struct th_dec_ctx{
/*Shared encoder/decoder state.*/
oc_theora_state state;
/*Whether or not packets are ready to be emitted.
@@ -38,7 +38,7 @@
/*Buffer in which to assemble packets.*/
oggpack_buffer opb;
/*Huffman decode trees.*/
- oc_huff_node *huff_tables[OC_NHUFFMAN_TABLES];
+ oc_huff_node *huff_tables[TH_NHUFFMAN_TABLES];
/*The index of one past the last token in each plane for each coefficient.
The final entries are the total number of tokens for each coefficient.*/
int ti0[3][64];
@@ -69,7 +69,7 @@
/*Whether or not the post-processsed frame buffer has space for chroma.*/
int pp_frame_has_chroma;
/*The buffer used for the post-processed frame.*/
- theora_ycbcr_buffer pp_frame_buf;
+ th_ycbcr_buffer pp_frame_buf;
/*The striped decode callback function.*/
theora_stripe_callback stripe_cb;
};
Modified: experimental/derf/theora-exp/lib/decode.c
===================================================================
--- experimental/derf/theora-exp/lib/decode.c 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/decode.c 2006-03-30 22:36:54 UTC (rev 11071)
@@ -206,7 +206,7 @@
static int oc_dec_init(oc_dec_ctx *_dec,const theora_info *_info,
- const theora_setup_info *_setup){
+ const th_setup_info *_setup){
int qti;
int pli;
int qi;
@@ -261,7 +261,7 @@
long val;
/*Check to make sure this is a data packet.*/
theora_read1(&_dec->opb,&val);
- if(val!=0)return OC_BADPACKET;
+ if(val!=0)return TH_BADPACKET;
/*Read in the frame type (I or P).*/
theora_read1(&_dec->opb,&val);
_dec->state.frame_type=(int)val;
@@ -286,7 +286,7 @@
Most of the other unused bits in the VP3 headers were eliminated.
I don't know why these remain.*/
theora_read(&_dec->opb,3,&val);
- if(val!=0)return OC_IMPL;
+ if(val!=0)return TH_IMPL;
}
return 0;
}
@@ -825,7 +825,7 @@
/*A jump table for compute the first coefficient value the given token value
represents.*/
-static const oc_token_dec1val_func OC_TOKEN_DEC1VAL_TABLE[OC_NDCT_TOKENS-
+static const oc_token_dec1val_func OC_TOKEN_DEC1VAL_TABLE[TH_NDCT_TOKENS-
OC_NDCT_EOB_TOKEN_MAX]={
(oc_token_dec1val_func)oc_token_dec1val_zrl,
(oc_token_dec1val_func)oc_token_dec1val_zrl,
@@ -1164,7 +1164,7 @@
/*A jump table for expanding token values into coefficient values.
This reduces all the conditional branches, etc., needed to parse these token
values down to one indirect jump.*/
-static const oc_token_expand_func OC_TOKEN_EXPAND_TABLE[OC_NDCT_TOKENS-
+static const oc_token_expand_func OC_TOKEN_EXPAND_TABLE[TH_NDCT_TOKENS-
OC_NDCT_EOB_TOKEN_MAX]={
oc_token_expand_zrl,
oc_token_expand_zrl,
@@ -1848,8 +1848,8 @@
-theora_dec_ctx *theora_decode_alloc(const theora_info *_info,
- const theora_setup_info *_setup){
+th_dec_ctx *th_decode_alloc(const theora_info *_info,
+ const th_setup_info *_setup){
oc_dec_ctx *dec;
if(_info==NULL||_setup==NULL)return NULL;
dec=_ogg_malloc(sizeof(*dec));
@@ -1861,37 +1861,37 @@
return dec;
}
-void theora_decode_free(theora_dec_ctx *_dec){
+void th_decode_free(th_dec_ctx *_dec){
if(_dec!=NULL){
oc_dec_clear(_dec);
_ogg_free(_dec);
}
}
-int theora_decode_ctl(theora_dec_ctx *_dec,int _req,void *_buf,
+int th_decode_ctl(th_dec_ctx *_dec,int _req,void *_buf,
size_t _buf_sz){
switch(_req){
- case OC_DECCTL_GET_PPLEVEL_MAX:{
- if(_dec==NULL||_buf==NULL)return OC_FAULT;
- if(_buf_sz!=sizeof(int))return OC_EINVAL;
+ case TH_DECCTL_GET_PPLEVEL_MAX:{
+ if(_dec==NULL||_buf==NULL)return TH_FAULT;
+ if(_buf_sz!=sizeof(int))return TH_EINVAL;
(*(int *)_buf)=OC_PP_LEVEL_MAX;
return 0;
}break;
- case OC_DECCTL_SET_PPLEVEL:{
+ case TH_DECCTL_SET_PPLEVEL:{
int pp_level;
- if(_dec==NULL||_buf==NULL)return OC_FAULT;
- if(_buf_sz!=sizeof(int))return OC_EINVAL;
+ if(_dec==NULL||_buf==NULL)return TH_FAULT;
+ if(_buf_sz!=sizeof(int))return TH_EINVAL;
pp_level=*(int *)_buf;
- if(pp_level<0||pp_level>OC_PP_LEVEL_MAX)return OC_EINVAL;
+ if(pp_level<0||pp_level>OC_PP_LEVEL_MAX)return TH_EINVAL;
_dec->pp_level=pp_level;
return 0;
}break;
- case OC_DECCTL_SET_GRANPOS:{
+ case TH_DECCTL_SET_GRANPOS:{
ogg_int64_t granpos;
- if(_dec==NULL||_buf==NULL)return OC_FAULT;
- if(_buf_sz!=sizeof(ogg_int64_t))return OC_EINVAL;
+ if(_dec==NULL||_buf==NULL)return TH_FAULT;
+ if(_buf_sz!=sizeof(ogg_int64_t))return TH_EINVAL;
granpos=*(ogg_int64_t *)_buf;
- if(granpos<0)return OC_EINVAL;
+ if(granpos<0)return TH_EINVAL;
_dec->state.granpos=granpos;
_dec->state.keyframe_num=
granpos>>_dec->state.info.keyframe_granule_shift;
@@ -1899,29 +1899,29 @@
(granpos&(1<<_dec->state.info.keyframe_granule_shift)-1);
return 0;
}break;
- case OC_DECCTL_SET_STRIPE_CB:{
+ case TH_DECCTL_SET_STRIPE_CB:{
theora_stripe_callback *cb;
- if(_dec==NULL||_buf==NULL)return OC_FAULT;
- if(_buf_sz!=sizeof(theora_stripe_callback))return OC_EINVAL;
+ if(_dec==NULL||_buf==NULL)return TH_FAULT;
+ if(_buf_sz!=sizeof(theora_stripe_callback))return TH_EINVAL;
cb=(theora_stripe_callback *)_buf;
_dec->stripe_cb.ctx=cb->ctx;
_dec->stripe_cb.stripe_decoded=cb->stripe_decoded;
return 0;
}break;
- default:return OC_IMPL;
+ default:return TH_IMPL;
}
}
-int theora_decode_packetin(theora_dec_ctx *_dec,const ogg_packet *_op,
+int th_decode_packetin(th_dec_ctx *_dec,const ogg_packet *_op,
ogg_int64_t *_granpos){
int ret;
- if(_dec==NULL||_op==NULL)return OC_FAULT;
+ if(_dec==NULL||_op==NULL)return TH_FAULT;
/*A completely empty packet indicates a dropped frame and is treated exactly
like an inter frame with no coded blocks.
Only proceed if we have a non-empty packet.*/
if(_op->bytes!=0){
oc_dec_pipeline_state pipe;
- theora_ycbcr_buffer stripe_buf;
+ th_ycbcr_buffer stripe_buf;
int stripe_fragy;
int refi;
int pli;
@@ -2111,7 +2111,7 @@
return 0;
}
-int theora_decode_ycbcr_out(theora_dec_ctx *_dec,theora_ycbcr_buffer _ycbcr){
+int th_decode_ycbcr_out(th_dec_ctx *_dec,th_ycbcr_buffer _ycbcr){
oc_ycbcr_buffer_flip(_ycbcr,_dec->pp_frame_buf);
return 0;
}
Modified: experimental/derf/theora-exp/lib/dequant.c
===================================================================
--- experimental/derf/theora-exp/lib/dequant.c 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/dequant.c 2006-03-30 22:36:54 UTC (rev 11071)
@@ -8,7 +8,7 @@
int oc_quant_params_unpack(oggpack_buffer *_opb,
theora_quant_info *_qinfo){
- theora_quant_base *base_mats;
+ th_quant_base *base_mats;
long val;
int nbase_mats;
int sizes[64];
@@ -51,7 +51,7 @@
nbits=oc_ilog(nbase_mats-1);
for(i=0;i<6;i++){
theora_quant_ranges *qranges;
- theora_quant_base *qrbms;
+ th_quant_base *qrbms;
int *qrsizes;
qti=i/3;
pli=i%3;
@@ -93,12 +93,12 @@
constructed qinfo.*/
if(qi>63){
_ogg_free(base_mats);
- return OC_BADHEADER;
+ return TH_BADHEADER;
}
qranges->nranges=qri;
qranges->sizes=qrsizes=(int *)_ogg_malloc(qri*sizeof(qrsizes[0]));
memcpy(qrsizes,sizes,qri*sizeof(qrsizes[0]));
- qranges->base_matrices=qrbms=(theora_quant_base *)_ogg_malloc(
+ qranges->base_matrices=qrbms=(th_quant_base *)_ogg_malloc(
(qri+1)*sizeof(qrbms[0]));
do memcpy(qrbms[qri],base_mats[indices[qri]],sizeof(qrbms[qri]));
while(qri-->0);
Modified: experimental/derf/theora-exp/lib/encinfo.c
===================================================================
--- experimental/derf/theora-exp/lib/encinfo.c 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/encinfo.c 2006-03-30 22:36:54 UTC (rev 11071)
@@ -15,9 +15,9 @@
-int theora_encode_flushheader(theora_enc_ctx *_enc,theora_comment *_tc,
+int th_encode_flushheader(th_enc_ctx *_enc,th_comment *_tc,
ogg_packet *_op){
- if(_enc==NULL||_op==NULL)return OC_FAULT;
+ if(_enc==NULL||_op==NULL)return TH_FAULT;
switch(_enc->packet_state){
/*Codec info header.*/
case OC_PACKET_INFO_HDR:{
@@ -27,9 +27,9 @@
/*Write the codec string.*/
oc_pack_octets(&_enc->opb,"theora",6);
/*Write the codec bitstream version.*/
- oggpackB_write(&_enc->opb,OC_VERSION_MAJOR,8);
- oggpackB_write(&_enc->opb,OC_VERSION_MINOR,8);
- oggpackB_write(&_enc->opb,OC_VERSION_SUB,8);
+ oggpackB_write(&_enc->opb,TH_VERSION_MAJOR,8);
+ oggpackB_write(&_enc->opb,TH_VERSION_MINOR,8);
+ oggpackB_write(&_enc->opb,TH_VERSION_SUB,8);
/*Describe the encoded frame.*/
oggpackB_write(&_enc->opb,_enc->state.info.frame_width>>4,16);
oggpackB_write(&_enc->opb,_enc->state.info.frame_height>>4,16);
@@ -56,8 +56,8 @@
const char *vendor;
int vendor_len;
int i;
- if(_tc==NULL)return OC_FAULT;
- vendor=theora_version_string();
+ if(_tc==NULL)return TH_FAULT;
+ vendor=th_version_string();
vendor_len=strlen(vendor);
oggpackB_reset(&_enc->opb);
/*Mark this packet as the comment header.*/
Modified: experimental/derf/theora-exp/lib/encint.h
===================================================================
--- experimental/derf/theora-exp/lib/encint.h 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/encint.h 2006-03-30 22:36:54 UTC (rev 11071)
@@ -10,7 +10,7 @@
typedef struct oc_mode_scheme_chooser oc_mode_scheme_chooser;
typedef struct oc_enc_vbr_ctx oc_enc_vbr_ctx;
typedef struct oc_mcenc_ctx oc_mcenc_ctx;
-typedef struct theora_enc_ctx oc_enc_ctx;
+typedef struct th_enc_ctx oc_enc_ctx;
# include "fdct.h"
# include "huffenc.h"
@@ -146,7 +146,7 @@
-struct theora_enc_ctx{
+struct th_enc_ctx{
/*Shared encoder/decoder state.*/
oc_theora_state state;
/*The start of the encoder pipeline.*/
@@ -211,7 +211,7 @@
/*The bounding value array used for the loop filter.*/
int bounding_values[512];
/*The huffman tables in use.*/
- theora_huff_code huff_codes[OC_NHUFFMAN_TABLES][OC_NDCT_TOKENS];
+ theora_huff_code huff_codes[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS];
/*The quantization parameters in use.*/
theora_quant_info qinfo;
/*Pointers to the quantization tables in use.*/
@@ -280,7 +280,7 @@
oc_enc_vbr_ctx *oc_enc_vbr_alloc(oc_enc_ctx *_enc);
void oc_enc_vbr_free(oc_enc_vbr_ctx *_vbr);
-int oc_enc_vbr_enable(oc_enc_vbr_ctx *_vbr,theora_vbr_cfg *_cfg);
+int oc_enc_vbr_enable(oc_enc_vbr_ctx *_vbr,th_vbr_cfg *_cfg);
void oc_enc_set_speed_null(oc_enc_ctx *_enc,int _speed);
void oc_enc_frag_intra_fdct(oc_enc_ctx *_enc,const oc_fragment *_frag,
Modified: experimental/derf/theora-exp/lib/encode.c
===================================================================
--- experimental/derf/theora-exp/lib/encode.c 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/encode.c 2006-03-30 22:36:54 UTC (rev 11071)
@@ -287,15 +287,15 @@
This may be NULL, in which case the default Huffman codes will be
used.
Return: 0 on success, or a negative value on error.
- OC_FAULT if _enc is NULL
- OC_EINVAL if the setup header has already been written, the code is
+ TH_FAULT if _enc is NULL
+ TH_EINVAL if the setup header has already been written, the code is
not prefix free, or does not form a full binary tree.*/
static int oc_enc_set_huffman_codes(oc_enc_ctx *_enc,
- const theora_huff_code _codes[OC_NHUFFMAN_TABLES][OC_NDCT_TOKENS]){
+ const theora_huff_code _codes[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS]){
int ret;
- if(_enc==NULL)return OC_FAULT;
- if(_enc->packet_state>OC_PACKET_SETUP_HDR)return OC_EINVAL;
- if(_codes==NULL)_codes=OC_VP31_HUFF_CODES;
+ if(_enc==NULL)return TH_FAULT;
+ if(_enc->packet_state>OC_PACKET_SETUP_HDR)return TH_EINVAL;
+ if(_codes==NULL)_codes=TH_VP31_HUFF_CODES;
/*Validate the codes.*/
oggpackB_reset(&_enc->opb);
ret=oc_huff_codes_pack(&_enc->opb,_codes);
@@ -312,39 +312,39 @@
This can be NULL, in which case the default quantization parameters
will be used.*
Return: 0 on success, or a negative value on error.
- OC_FAULT if _enc is NULL.
- OC_EINVAL if the setup header has already been written, or it cannot
+ TH_FAULT if _enc is NULL.
+ TH_EINVAL if the setup header has already been written, or it cannot
be verified that the quantization level of for a particular qti,
pli, and ci never increases as qi increases.*/
-static int oc_enc_set_quant_params(theora_enc_ctx *_enc,
+static int oc_enc_set_quant_params(th_enc_ctx *_enc,
const theora_quant_info *_qinfo){
int qti;
int pli;
int qri;
int qi;
int ci;
- if(_enc==NULL)return OC_FAULT;
- if(_enc->packet_state>OC_PACKET_SETUP_HDR)return OC_EINVAL;
+ if(_enc==NULL)return TH_FAULT;
+ if(_enc->packet_state>OC_PACKET_SETUP_HDR)return TH_EINVAL;
if(_qinfo==NULL)_qinfo=OC_DEF_QUANT_INFO+_enc->state.info.pixel_fmt;
/*Verify that, for a given qti, pli and ci, the actual quantizer will never
increase as qi increases.
This is required for efficient quantizer selection.*/
for(qi=64;qi-->1;){
- if(_qinfo->ac_scale[qi]>_qinfo->ac_scale[qi-1])return OC_EINVAL;
- if(_qinfo->dc_scale[qi]>_qinfo->dc_scale[qi-1])return OC_EINVAL;
+ if(_qinfo->ac_scale[qi]>_qinfo->ac_scale[qi-1])return TH_EINVAL;
+ if(_qinfo->dc_scale[qi]>_qinfo->dc_scale[qi-1])return TH_EINVAL;
}
for(qti=0;qti<2;qti++)for(pli=0;pli<3;pli++){
- if(_qinfo->qi_ranges[qti][pli].nranges<=0)return OC_EINVAL;
+ if(_qinfo->qi_ranges[qti][pli].nranges<=0)return TH_EINVAL;
for(qi=qri=0;qri<_qinfo->qi_ranges[qti][pli].nranges;qri++){
qi+=_qinfo->qi_ranges[qti][pli].sizes[qri];
for(ci=0;ci<64;ci++){
if(_qinfo->qi_ranges[qti][pli].base_matrices[qri+1][ci]>
_qinfo->qi_ranges[qti][pli].base_matrices[qri][ci]){
- return OC_EINVAL;
+ return TH_EINVAL;
}
}
}
- if(qi!=63)return OC_EINVAL;
+ if(qi!=63)return TH_EINVAL;
}
/*TODO: Analyze for packing purposes instead of just doing a shallow copy.*/
memcpy(&_enc->qinfo,_qinfo,sizeof(_enc->qinfo));
@@ -1090,7 +1090,7 @@
/*Mark us as not VP3-compatible.*/
_enc->vp3_compatible=0;
/*Set the Huffman codes and quantization parameters to the defaults.*/
- memcpy(_enc->huff_codes,OC_VP31_HUFF_CODES,sizeof(_enc->huff_codes));
+ memcpy(_enc->huff_codes,TH_VP31_HUFF_CODES,sizeof(_enc->huff_codes));
oc_enc_set_quant_params(_enc,NULL);
/*Initialize the static pipeline stages.*/
oc_fdct_pipe_init(&_enc->fdct_pipe,_enc);
@@ -1322,7 +1322,7 @@
}
-theora_enc_ctx *theora_encode_alloc(const theora_info *_info){
+th_enc_ctx *th_encode_alloc(const theora_info *_info){
oc_enc_ctx *enc;
if(_info==NULL)return NULL;
enc=_ogg_malloc(sizeof(*enc));
@@ -1333,7 +1333,7 @@
return enc;
}
-void theora_encode_free(theora_enc_ctx *_enc){
+void th_encode_free(th_enc_ctx *_enc){
if(_enc!=NULL){
oc_enc_clear(_enc);
_ogg_free(_enc);
@@ -1342,29 +1342,29 @@
-typedef theora_huff_code theora_huff_table[OC_NDCT_TOKENS];
+typedef theora_huff_code theora_huff_table[TH_NDCT_TOKENS];
-int theora_encode_ctl(theora_enc_ctx *_enc,int _req,void *_buf,
+int th_encode_ctl(th_enc_ctx *_enc,int _req,void *_buf,
size_t _buf_sz){
switch(_req){
- case OC_ENCCTL_SET_HUFFMAN_CODES:{
+ case TH_ENCCTL_SET_HUFFMAN_CODES:{
if(_buf==NULL&&_buf_sz!=0||_buf!=NULL&&
- _buf_sz!=sizeof(theora_huff_code)*OC_NHUFFMAN_TABLES*OC_NDCT_TOKENS){
- return OC_EINVAL;
+ _buf_sz!=sizeof(theora_huff_code)*TH_NHUFFMAN_TABLES*TH_NDCT_TOKENS){
+ return TH_EINVAL;
}
return oc_enc_set_huffman_codes(_enc,(theora_huff_table *)_buf);
}break;
- case OC_ENCCTL_SET_QUANT_PARAMS:{
+ case TH_ENCCTL_SET_QUANT_PARAMS:{
if(_buf==NULL&&_buf_sz!=0||
_buf!=NULL&&_buf_sz!=sizeof(theora_quant_info)){
- return OC_EINVAL;
+ return TH_EINVAL;
}
return oc_enc_set_quant_params(_enc,(theora_quant_info *)_buf);
}break;
- case OC_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE:{
+ case TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE:{
ogg_uint32_t keyframe_frequency_force;
- if(_enc==NULL||_buf==NULL)return OC_FAULT;
- if(_buf_sz!=sizeof(ogg_uint32_t))return OC_EINVAL;
+ if(_enc==NULL||_buf==NULL)return TH_FAULT;
+ if(_buf_sz!=sizeof(ogg_uint32_t))return TH_EINVAL;
keyframe_frequency_force=*(ogg_uint32_t *)_buf;
if(_enc->packet_state==OC_PACKET_INFO_HDR){
/*It's still early enough to enlarge keyframe_granule_shift.*/
@@ -1377,18 +1377,18 @@
*(ogg_uint32_t *)_buf=_enc->keyframe_frequency_force;
return 0;
}break;
- case OC_ENCCTL_SET_VP3_COMPATIBLE:{
+ case TH_ENCCTL_SET_VP3_COMPATIBLE:{
int vp3_compatible;
int ret;
- if(_enc==NULL||_buf==NULL)return OC_FAULT;
- if(_buf_sz!=sizeof(int))return OC_EINVAL;
+ if(_enc==NULL||_buf==NULL)return TH_FAULT;
+ if(_buf_sz!=sizeof(int))return TH_EINVAL;
vp3_compatible=*(int *)_buf;
_enc->vp3_compatible=vp3_compatible;
- ret=oc_enc_set_huffman_codes(_enc,OC_VP31_HUFF_CODES);
+ ret=oc_enc_set_huffman_codes(_enc,TH_VP31_HUFF_CODES);
if(ret<0)vp3_compatible=0;
- ret=oc_enc_set_quant_params(_enc,&OC_VP31_QUANT_INFO);
+ ret=oc_enc_set_quant_params(_enc,&TH_VP31_QUANT_INFO);
if(ret<0)vp3_compatible=0;
- if(_enc->state.info.pixel_fmt!=OC_PF_420||
+ if(_enc->state.info.pixel_fmt!=TH_PF_420||
_enc->state.info.pic_width<_enc->state.info.frame_width||
_enc->state.info.pic_height<_enc->state.info.frame_height||
/*If we have more than 4095 super blocks, VP3's RLE coding might
@@ -1404,41 +1404,41 @@
*(int *)_buf=vp3_compatible;
return 0;
}break;
- case OC_ENCCTL_GET_SPLEVEL_MAX:{
- if(_enc==NULL||_buf==NULL)return OC_FAULT;
- if(_buf_sz!=sizeof(int))return OC_EINVAL;
+ case TH_ENCCTL_GET_SPLEVEL_MAX:{
+ if(_enc==NULL||_buf==NULL)return TH_FAULT;
+ if(_buf_sz!=sizeof(int))return TH_EINVAL;
/*We can only manipulate speed in the context of a given encoding mode.
Ensure one is selected if the user has not already done so.*/
if(_enc->set_speed==NULL)oc_enc_enable_default_mode(_enc);
*(int *)_buf=_enc->speed_max;
return 0;
}break;
- case OC_ENCCTL_SET_SPLEVEL:{
+ case TH_ENCCTL_SET_SPLEVEL:{
int speed;
- if(_enc==NULL||_buf==NULL)return OC_FAULT;
- if(_buf_sz!=sizeof(int))return OC_EINVAL;
+ if(_enc==NULL||_buf==NULL)return TH_FAULT;
+ if(_buf_sz!=sizeof(int))return TH_EINVAL;
speed=*(int *)_buf;
/*We can only manipulate speed in the context of a given encoding mode.
Ensure one is selected if the user has not already done so.*/
if(_enc->set_speed==NULL)oc_enc_enable_default_mode(_enc);
- if(speed<0||speed>_enc->speed_max)return OC_EINVAL;
+ if(speed<0||speed>_enc->speed_max)return TH_EINVAL;
(*_enc->set_speed)(_enc,speed);
return 0;
}break;
- case OC_ENCCTL_SETUP_VBR:{
- if(_enc==NULL)return OC_FAULT;
- if(_buf==NULL&&_buf_sz!=0||_buf!=NULL&&_buf_sz!=sizeof(theora_vbr_cfg)){
- return OC_EINVAL;
+ case TH_ENCCTL_SETUP_VBR:{
+ if(_enc==NULL)return TH_FAULT;
+ if(_buf==NULL&&_buf_sz!=0||_buf!=NULL&&_buf_sz!=sizeof(th_vbr_cfg)){
+ return TH_EINVAL;
}
if(_enc->vbr==NULL)_enc->vbr=oc_enc_vbr_alloc(_enc);
- return oc_enc_vbr_enable(_enc->vbr,(theora_vbr_cfg *)_buf);
+ return oc_enc_vbr_enable(_enc->vbr,(th_vbr_cfg *)_buf);
}break;
- default:return OC_IMPL;
+ default:return TH_IMPL;
}
}
-int theora_encode_ycbcr_in(theora_enc_ctx *_enc,theora_ycbcr_buffer _img){
- theora_ycbcr_buffer img;
+int th_encode_ycbcr_in(th_enc_ctx *_enc,th_ycbcr_buffer _img){
+ th_ycbcr_buffer img;
int y_avail[3];
int cwidth;
int cheight;
@@ -1446,17 +1446,17 @@
int rfi;
int pli;
/*Step 1: validate parameters.*/
- if(_enc==NULL||_img==NULL)return OC_FAULT;
- if(_enc->packet_state==OC_PACKET_DONE)return OC_EINVAL;
+ if(_enc==NULL||_img==NULL)return TH_FAULT;
+ if(_enc->packet_state==OC_PACKET_DONE)return TH_EINVAL;
if(_img[0].width!=(int)_enc->state.info.frame_width||
_img[0].height!=(int)_enc->state.info.frame_height){
- return OC_EINVAL;
+ return TH_EINVAL;
}
cwidth=_enc->state.info.frame_width>>!(_enc->state.info.pixel_fmt&1);
cheight=_enc->state.info.frame_height>>!(_enc->state.info.pixel_fmt&2);
if(_img[1].width!=cwidth||_img[2].width!=cwidth||
_img[1].height!=cheight||_img[2].height!=cheight){
- return OC_EINVAL;
+ return TH_EINVAL;
}
/*Flip the input buffer upside down.*/
oc_ycbcr_buffer_flip(img,_img);
@@ -1514,8 +1514,8 @@
return 0;
}
-int theora_encode_packetout(theora_enc_ctx *_enc,int _last,ogg_packet *_op){
- if(_enc==NULL||_op==NULL)return OC_FAULT;
+int th_encode_packetout(th_enc_ctx *_enc,int _last,ogg_packet *_op){
+ if(_enc==NULL||_op==NULL)return TH_FAULT;
if(_enc->packet_state!=OC_PACKET_READY)return 0;
_op->packet=oggpackB_get_buffer(&_enc->opb);
_op->bytes=oggpackB_bytes(&_enc->opb);
Modified: experimental/derf/theora-exp/lib/encvbr.c
===================================================================
--- experimental/derf/theora-exp/lib/encvbr.c 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/encvbr.c 2006-03-30 22:36:54 UTC (rev 11071)
@@ -1360,12 +1360,12 @@
oc_impmap_free(_vbr->impmap);
}
-static int oc_enc_vbr_cfg(oc_enc_vbr_ctx *_vbr,theora_vbr_cfg *_cfg){
+static int oc_enc_vbr_cfg(oc_enc_vbr_ctx *_vbr,th_vbr_cfg *_cfg){
if(_cfg->qi<0||_cfg->qi>63||_cfg->kf_qi_min<0||_cfg->kf_qi_min>63||
_cfg->kf_qi_max<_cfg->kf_qi_min||_cfg->kf_qi_max>63||
_cfg->df_qi_min<0||_cfg->df_qi_min>63||
_cfg->df_qi_max<_cfg->df_qi_min||_cfg->df_qi_max>63){
- return OC_EINVAL;
+ return TH_EINVAL;
}
memcpy(&_vbr->cfg,_cfg,sizeof(_vbr->cfg));
return 0;
@@ -1400,7 +1400,7 @@
}
}
-int oc_enc_vbr_enable(oc_enc_vbr_ctx *_vbr,theora_vbr_cfg *_cfg){
+int oc_enc_vbr_enable(oc_enc_vbr_ctx *_vbr,th_vbr_cfg *_cfg){
if(_cfg!=NULL){
int ret;
ret=oc_enc_vbr_cfg(_vbr,_cfg);
Modified: experimental/derf/theora-exp/lib/encvbr.h
===================================================================
--- experimental/derf/theora-exp/lib/encvbr.h 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/encvbr.h 2006-03-30 22:36:54 UTC (rev 11071)
@@ -12,7 +12,7 @@
/*Context information for the VBR encoder.*/
struct oc_enc_vbr_ctx{
/*Configuration information.*/
- theora_vbr_cfg cfg;
+ th_vbr_cfg cfg;
/*The main VBR encoder's pipe stage.*/
oc_enc_pipe_stage pipe;
/*The scale factor for the current quality setting.*/
Modified: experimental/derf/theora-exp/lib/enquant.c
===================================================================
--- experimental/derf/theora-exp/lib/enquant.c 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/enquant.c 2006-03-30 22:36:54 UTC (rev 11071)
@@ -7,7 +7,7 @@
/*The default quantization parameters used by VP3.1.*/
static const int OC_VP31_RANGE_SIZES[1]={63};
-static const theora_quant_base OC_VP31_BASES_INTRA_Y[2]={
+static const th_quant_base OC_VP31_BASES_INTRA_Y[2]={
{
16, 11, 10, 16, 24, 40, 51, 61,
12, 12, 14, 19, 26, 58, 60, 55,
@@ -29,7 +29,7 @@
72, 92, 95, 98,112, 100,103, 99
}
};
-static const theora_quant_base OC_VP31_BASES_INTRA_C[2]={
+static const th_quant_base OC_VP31_BASES_INTRA_C[2]={
{
17, 18, 24, 47, 99, 99, 99, 99,
18, 21, 26, 66, 99, 99, 99, 99,
@@ -51,7 +51,7 @@
99, 99, 99, 99, 99, 99, 99, 99
}
};
-static const theora_quant_base OC_VP31_BASES_INTER[2]={
+static const th_quant_base OC_VP31_BASES_INTER[2]={
{
16, 16, 16, 20, 24, 28, 32, 40,
16, 16, 20, 24, 28, 32, 40, 48,
@@ -74,7 +74,7 @@
}
};
-const theora_quant_info OC_VP31_QUANT_INFO={
+const theora_quant_info TH_VP31_QUANT_INFO={
{
220,200,190,180,170,170,160,160,
150,150,140,140,130,130,120,120,
@@ -123,7 +123,7 @@
static const int OC_DEF_QRANGE_SIZES[3]={15,16,32};
-static const theora_quant_base OC_DEF_BASE_MATRICES[9][4]={
+static const th_quant_base OC_DEF_BASE_MATRICES[9][4]={
/*Y' matrices, 4:4:4 subsampling.*/
{
/*qi=0.*/
@@ -732,7 +732,7 @@
void oc_quant_params_pack(oggpack_buffer *_opb,
const theora_quant_info *_qinfo){
const theora_quant_ranges *qranges;
- const theora_quant_base *base_mats[2*3*64];
+ const th_quant_base *base_mats[2*3*64];
int indices[2][3][64];
int nbase_mats;
int nbits;
Modified: experimental/derf/theora-exp/lib/enquant.h
===================================================================
--- experimental/derf/theora-exp/lib/enquant.h 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/enquant.h 2006-03-30 22:36:54 UTC (rev 11071)
@@ -12,7 +12,7 @@
/*The default quantization parameters used by VP3.1.*/
-extern const theora_quant_info OC_VP31_QUANT_INFO;
+extern const theora_quant_info TH_VP31_QUANT_INFO;
/*Our default quantization parameters.*/
extern const theora_quant_info OC_DEF_QUANT_INFO[4];
Modified: experimental/derf/theora-exp/lib/huffdec.c
===================================================================
--- experimental/derf/theora-exp/lib/huffdec.c 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/huffdec.c 2006-03-30 22:36:54 UTC (rev 11071)
@@ -78,8 +78,8 @@
oc_huff_node *binode;
long bits;
/*Prevent infinite recursion.*/
- if(++_depth>32)return OC_BADHEADER;
- if(theora_read1(_opb,&bits)<0)return OC_BADHEADER;
+ if(++_depth>32)return TH_BADHEADER;
+ if(theora_read1(_opb,&bits)<0)return TH_BADHEADER;
/*Read an internal node:*/
if(!bits){
int ret;
@@ -94,7 +94,7 @@
}
/*Read a leaf node:*/
else{
- if(theora_read(_opb,OC_NDCT_TOKEN_BITS,&bits)<0)return OC_BADHEADER;
+ if(theora_read(_opb,OC_NDCT_TOKEN_BITS,&bits)<0)return TH_BADHEADER;
binode=oc_huff_node_alloc(0);
binode->depth=(unsigned char)(_depth>1);
binode->token=(unsigned char)bits;
@@ -219,9 +219,9 @@
_nodes: The table to fill with the Huffman trees.
Return: 0 on success, or a negative value on error.*/
int oc_huff_trees_unpack(oggpack_buffer *_opb,
- oc_huff_node *_nodes[OC_NHUFFMAN_TABLES]){
+ oc_huff_node *_nodes[TH_NHUFFMAN_TABLES]){
int i;
- for(i=0;i<OC_NHUFFMAN_TABLES;i++){
+ for(i=0;i<TH_NHUFFMAN_TABLES;i++){
int ret;
ret=oc_huff_tree_unpack(_opb,_nodes+i,0);
if(ret<0)return ret;
@@ -233,17 +233,17 @@
/*Makes a copy of the given set of Huffman trees.
_dst: The array to store the copy in.
_src: The array of trees to copy.*/
-void oc_huff_trees_copy(oc_huff_node *_dst[OC_NHUFFMAN_TABLES],
- const oc_huff_node *const _src[OC_NHUFFMAN_TABLES]){
+void oc_huff_trees_copy(oc_huff_node *_dst[TH_NHUFFMAN_TABLES],
+ const oc_huff_node *const _src[TH_NHUFFMAN_TABLES]){
int i;
- for(i=0;i<OC_NHUFFMAN_TABLES;i++)_dst[i]=oc_huff_tree_copy(_src[i]);
+ for(i=0;i<TH_NHUFFMAN_TABLES;i++)_dst[i]=oc_huff_tree_copy(_src[i]);
}
/*Frees the memory used by a set of Huffman trees.
_nodes: The array of trees to free.*/
-void oc_huff_trees_clear(oc_huff_node *_nodes[OC_NHUFFMAN_TABLES]){
+void oc_huff_trees_clear(oc_huff_node *_nodes[TH_NHUFFMAN_TABLES]){
int i;
- for(i=0;i<OC_NHUFFMAN_TABLES;i++)oc_huff_tree_free(_nodes[i]);
+ for(i=0;i<TH_NHUFFMAN_TABLES;i++)oc_huff_tree_free(_nodes[i]);
}
/*Unpacks a single token using the given Huffman tree.
Modified: experimental/derf/theora-exp/lib/huffdec.h
===================================================================
--- experimental/derf/theora-exp/lib/huffdec.h 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/huffdec.h 2006-03-30 22:36:54 UTC (rev 11071)
@@ -42,10 +42,10 @@
int oc_huff_trees_unpack(oggpack_buffer *_opb,
- oc_huff_node *_nodes[OC_NHUFFMAN_TABLES]);
-void oc_huff_trees_copy(oc_huff_node *_dst[OC_NHUFFMAN_TABLES],
- const oc_huff_node *const _src[OC_NHUFFMAN_TABLES]);
-void oc_huff_trees_clear(oc_huff_node *_nodes[OC_NHUFFMAN_TABLES]);
+ oc_huff_node *_nodes[TH_NHUFFMAN_TABLES]);
+void oc_huff_trees_copy(oc_huff_node *_dst[TH_NHUFFMAN_TABLES],
+ const oc_huff_node *const _src[TH_NHUFFMAN_TABLES]);
+void oc_huff_trees_clear(oc_huff_node *_nodes[TH_NHUFFMAN_TABLES]);
int oc_huff_token_decode(oggpack_buffer *_opb,const oc_huff_node *_node);
Modified: experimental/derf/theora-exp/lib/huffenc.c
===================================================================
--- experimental/derf/theora-exp/lib/huffenc.c 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/huffenc.c 2006-03-30 22:36:54 UTC (rev 11071)
@@ -6,7 +6,7 @@
/*The default Huffman codes used for VP3.1.*/
-const theora_huff_code OC_VP31_HUFF_CODES[OC_NHUFFMAN_TABLES][OC_NDCT_TOKENS]={
+const theora_huff_code TH_VP31_HUFF_CODES[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS]={
{
{0x002D, 6},{0x0026, 7},{0x0166, 9},{0x004E, 8},
{0x02CE,10},{0x059E,11},{0x027D,11},{0x0008, 5},
@@ -848,10 +848,10 @@
Return: 0 on success, or a negative value if one of the given Huffman tables
does not form a full, prefix-free code.*/
int oc_huff_codes_pack(oggpack_buffer *_opb,
- const theora_huff_code _codes[OC_NHUFFMAN_TABLES][OC_NDCT_TOKENS]){
+ const theora_huff_code _codes[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS]){
int i;
- for(i=0;i<OC_NHUFFMAN_TABLES;i++){
- oc_huff_entry entries[OC_NDCT_TOKENS];
+ for(i=0;i<TH_NHUFFMAN_TABLES;i++){
+ oc_huff_entry entries[TH_NDCT_TOKENS];
int bpos;
int maxlen;
int mask;
@@ -859,24 +859,24 @@
/*First, find the maximum code length so we can align all the bit
patterns.*/
maxlen=_codes[i][0].nbits;
- for(j=1;j<OC_NDCT_TOKENS;j++){
+ for(j=1;j<TH_NDCT_TOKENS;j++){
maxlen=OC_MAXI(_codes[i][j].nbits,maxlen);
}
mask=(1<<maxlen)-1;
/*Copy over the codes into our temporary workspace.
The bit patterns are aligned, and the original entry each code is from
is stored as well.*/
- for(j=0;j<OC_NDCT_TOKENS;j++){
+ for(j=0;j<TH_NDCT_TOKENS;j++){
entries[j].shift=maxlen-_codes[i][j].nbits;
entries[j].pattern=_codes[i][j].pattern<<entries[j].shift&mask;
entries[j].token=j;
}
/*Sort the codes into ascending order.
This is the order the leaves of the tree will be traversed.*/
- qsort(entries,OC_NDCT_TOKENS,sizeof(entries[0]),huff_entry_cmp);
+ qsort(entries,TH_NDCT_TOKENS,sizeof(entries[0]),huff_entry_cmp);
/*For each leaf of the tree:*/
bpos=maxlen;
- for(j=0;j<OC_NDCT_TOKENS;j++){
+ for(j=0;j<TH_NDCT_TOKENS;j++){
int bit;
/*If this code has any bits at all.*/
if(entries[j].shift<maxlen){
@@ -890,19 +890,19 @@
bit=1<<bpos;
for(;entries[j].pattern&bit;bpos++)bit<<=1;
/*Validate the code.*/
- if(j+1<OC_NDCT_TOKENS){
+ if(j+1<TH_NDCT_TOKENS){
mask=~(bit-1)<<1;
/*The next entry should have a 1 bit where we had a 0, and should
match our code above that bit.
This verifies both fullness and prefix-freeness simultaneously.*/
if(!(entries[j+1].pattern&bit)||
(entries[j].pattern&mask)!=(entries[j+1].pattern&mask)){
- return OC_EINVAL;
+ return TH_EINVAL;
}
}
/*If there are no more codes, we should have ascended back to the top
of the tree.*/
- else if(bpos<maxlen)return OC_EINVAL;
+ else if(bpos<maxlen)return TH_EINVAL;
}
}
}
Modified: experimental/derf/theora-exp/lib/huffenc.h
===================================================================
--- experimental/derf/theora-exp/lib/huffenc.h 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/huffenc.h 2006-03-30 22:36:54 UTC (rev 11071)
@@ -5,12 +5,12 @@
extern const theora_huff_code
- OC_VP31_HUFF_CODES[OC_NHUFFMAN_TABLES][OC_NDCT_TOKENS];
+ TH_VP31_HUFF_CODES[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS];
int oc_huff_codes_pack(oggpack_buffer *_opb,
- const theora_huff_code _codes[OC_NHUFFMAN_TABLES][OC_NDCT_TOKENS]);
+ const theora_huff_code _codes[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS]);
Modified: experimental/derf/theora-exp/lib/huffman.h
===================================================================
--- experimental/derf/theora-exp/lib/huffman.h 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/huffman.h 2006-03-30 22:36:54 UTC (rev 11071)
@@ -48,6 +48,6 @@
#define OC_NDCT_RUN_MAX (32)
#define OC_NDCT_RUN_CAT1A_MAX (28)
-extern const int OC_DCT_TOKEN_EXTRA_BITS[OC_NDCT_TOKENS];
+extern const int OC_DCT_TOKEN_EXTRA_BITS[TH_NDCT_TOKENS];
#endif
Modified: experimental/derf/theora-exp/lib/info.c
===================================================================
--- experimental/derf/theora-exp/lib/info.c 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/info.c 2006-03-30 22:36:54 UTC (rev 11071)
@@ -19,25 +19,25 @@
-void theora_info_init(theora_info *_info){
+void th_info_init(theora_info *_info){
memset(_info,0,sizeof(*_info));
- _info->version_major=OC_VERSION_MAJOR;
- _info->version_minor=OC_VERSION_MINOR;
- _info->version_subminor=OC_VERSION_SUB;
+ _info->version_major=TH_VERSION_MAJOR;
+ _info->version_minor=TH_VERSION_MINOR;
+ _info->version_subminor=TH_VERSION_SUB;
_info->keyframe_granule_shift=6;
}
-void theora_info_clear(theora_info *_info){
+void th_info_clear(theora_info *_info){
memset(_info,0,sizeof(*_info));
}
-void theora_comment_init(theora_comment *_tc){
+void th_comment_init(th_comment *_tc){
memset(_tc,0,sizeof(*_tc));
}
-void theora_comment_add(theora_comment *_tc,char *_comment){
+void th_comment_add(th_comment *_tc,char *_comment){
int comment_len;
_tc->user_comments=_ogg_realloc(_tc->user_comments,
(_tc->comments+2)*sizeof(*_tc->user_comments));
@@ -51,7 +51,7 @@
_tc->user_comments[_tc->comments]=NULL;
}
-void theora_comment_add_tag(theora_comment *_tc,char *_tag,char *_val){
+void th_comment_add_tag(th_comment *_tc,char *_tag,char *_val){
char *comment;
int tag_len;
int val_len;
@@ -62,11 +62,11 @@
memcpy(comment,_tag,tag_len);
comment[tag_len]='=';
memcpy(comment+tag_len+1,_val,val_len+1);
- theora_comment_add(_tc,comment);
+ th_comment_add(_tc,comment);
_ogg_free(comment);
}
-char *theora_comment_query(theora_comment *_tc,char *_tag,int _count){
+char *th_comment_query(th_comment *_tc,char *_tag,int _count){
long i;
int found;
int tag_len;
@@ -83,7 +83,7 @@
return NULL;
}
-int theora_comment_query_count(theora_comment *_tc,char *_tag){
+int th_comment_query_count(th_comment *_tc,char *_tag){
long i;
int tag_len;
int count;
@@ -96,7 +96,7 @@
return count;
}
-void theora_comment_clear(theora_comment *_tc){
+void th_comment_clear(th_comment *_tc){
if(_tc!=NULL){
long i;
for(i=0;i<_tc->comments;i++)_ogg_free(_tc->user_comments[i]);
Modified: experimental/derf/theora-exp/lib/internal.c
===================================================================
--- experimental/derf/theora-exp/lib/internal.c 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/internal.c 2006-03-30 22:36:54 UTC (rev 11071)
@@ -68,7 +68,7 @@
/*A list of the indices in the oc_mb.map array that can be valid for each of
the various chroma decimation types.*/
-const int OC_MB_MAP_IDXS[OC_PF_NFORMATS][12]={
+const int OC_MB_MAP_IDXS[TH_PF_NFORMATS][12]={
{0,1,2,3,4,8},
{0,1,2,3,4,5,8,9},
{0,1,2,3,4,6,8,10},
@@ -77,13 +77,13 @@
/*The number of indices in the oc_mb.map array that can be valid for each of
the various chroma decimation types.*/
-const int OC_MB_MAP_NIDXS[OC_PF_NFORMATS]={6,8,8,12};
+const int OC_MB_MAP_NIDXS[TH_PF_NFORMATS]={6,8,8,12};
/*The number of extra bits that are coded with each of the DCT tokens.
Each DCT token has some fixed number of additional bits (possibly 0) stored
after the token itself, containing, for example, coefficient magnitude,
sign bits, etc.*/
-const int OC_DCT_TOKEN_EXTRA_BITS[OC_NDCT_TOKENS]={
+const int OC_DCT_TOKEN_EXTRA_BITS[TH_NDCT_TOKENS]={
0,0,0,2,3,4,12,3,6,
0,0,0,0,
1,1,1,1,2,3,4,5,6,10,
@@ -155,7 +155,7 @@
a given token value.
This reduces all the conditional branches, etc., needed to parse these token
values down to one indirect jump.*/
-static const oc_token_skip_func OC_TOKEN_SKIP_TABLE[OC_NDCT_TOKENS]={
+static const oc_token_skip_func OC_TOKEN_SKIP_TABLE[TH_NDCT_TOKENS]={
oc_token_skip_eob,
oc_token_skip_eob,
oc_token_skip_eob,
@@ -269,7 +269,7 @@
/*A table of functions used to fill in the chroma plane motion vectors for a
macro block when 4 different motion vectors are specified in the luma
plane.*/
-const oc_set_chroma_mvs_func OC_SET_CHROMA_MVS_TABLE[OC_PF_NFORMATS]={
+const oc_set_chroma_mvs_func OC_SET_CHROMA_MVS_TABLE[TH_PF_NFORMATS]={
oc_set_chroma_mvs00,
oc_set_chroma_mvs01,
oc_set_chroma_mvs10,
@@ -331,8 +331,8 @@
_dst: The destination buffer.
This can be the same as _src.
_src: The source buffer.*/
-void oc_ycbcr_buffer_flip(theora_ycbcr_buffer _dst,
- const theora_ycbcr_buffer _src){
+void oc_ycbcr_buffer_flip(th_ycbcr_buffer _dst,
+ const th_ycbcr_buffer _src){
int pli;
for(pli=0;pli<3;pli++){
_dst[pli].width=_src[pli].width;
@@ -342,18 +342,18 @@
}
}
-const char *theora_version_string(void){
+const char *th_version_string(void){
return OC_VENDOR_STRING;
}
-ogg_uint32_t theora_version_number(void){
- return (OC_VERSION_MAJOR<<16)+(OC_VERSION_MINOR<<8)+(OC_VERSION_SUB);
+ogg_uint32_t th_version_number(void){
+ return (TH_VERSION_MAJOR<<16)+(TH_VERSION_MINOR<<8)+(TH_VERSION_SUB);
}
/*Determines the packet type.
Note that this correctly interprets a 0-byte packet as a video data packet.
Return: 1 for a header packet, 0 for a data packet.*/
-int theora_packet_isheader(ogg_packet *_op){
+int th_packet_isheader(ogg_packet *_op){
return _op->bytes>0?_op->packet[0]>>7:0;
}
@@ -361,7 +361,7 @@
Note that this correctly interprets a 0-byte packet as a delta frame.
Return: 1 for a key frame, 0 for a delta frame, and -1 for a header
packet.*/
-int theora_packet_iskeyframe(ogg_packet *_op){
+int th_packet_iskeyframe(ogg_packet *_op){
return _op->bytes<=0?0:_op->packet[0]&0x80?-1:!(_op->packet[0]&0x40);
}
Modified: experimental/derf/theora-exp/lib/internal.h
===================================================================
--- experimental/derf/theora-exp/lib/internal.h 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/internal.h 2006-03-30 22:36:54 UTC (rev 11071)
@@ -16,9 +16,9 @@
# define OC_VENDOR_STRING "derf's experimental encoder library " __DATE__
/*Theora bitstream version.*/
-# define OC_VERSION_MAJOR (3)
-# define OC_VERSION_MINOR (2)
-# define OC_VERSION_SUB (0)
+# define TH_VERSION_MAJOR (3)
+# define TH_VERSION_MINOR (2)
+# define TH_VERSION_SUB (0)
/*A keyframe.*/
#define OC_INTRA_FRAME (0)
@@ -291,7 +291,7 @@
/*A copy of the image data used to fill the input pointers in each fragment.
If the data pointers or strides change, these input pointers must be
re-populated.*/
- theora_ycbcr_buffer input;
+ th_ycbcr_buffer input;
/*The number of unique border patterns.*/
int nborders;
/*The storage for the border info for all border fragments.
@@ -300,7 +300,7 @@
/*The index of the buffers being used for each OC_FRAME_* reference frame.*/
int ref_frame_idx[3];
/*The actual buffers used for the previously decoded frames.*/
- theora_ycbcr_buffer ref_frame_bufs[3];
+ th_ycbcr_buffer ref_frame_bufs[3];
/*The storage for the reference frame buffers.*/
unsigned char *ref_frame_data;
/*The frame number of the last keyframe.*/
@@ -352,14 +352,14 @@
extern const int OC_MB_MAP[2][2];
/*A list of the indices in the oc_mb.map array that can be valid for each of
the various chroma decimation types.*/
-extern const int OC_MB_MAP_IDXS[OC_PF_NFORMATS][12];
+extern const int OC_MB_MAP_IDXS[TH_PF_NFORMATS][12];
/*The number of indices in the oc_mb.map array that can be valid for each of
the various chroma decimation types.*/
-extern const int OC_MB_MAP_NIDXS[OC_PF_NFORMATS];
+extern const int OC_MB_MAP_NIDXS[TH_PF_NFORMATS];
/*A table of functions used to fill in the Cb,Cr plane motion vectors for a
macro block when 4 different motion vectors are specified in the luma
plane.*/
-extern const oc_set_chroma_mvs_func OC_SET_CHROMA_MVS_TABLE[OC_PF_NFORMATS];
+extern const oc_set_chroma_mvs_func OC_SET_CHROMA_MVS_TABLE[TH_PF_NFORMATS];
@@ -368,8 +368,8 @@
void **oc_calloc_2d(size_t _height,size_t _width,size_t _sz);
void oc_free_2d(void **_ptr);
-void oc_ycbcr_buffer_flip(theora_ycbcr_buffer _dst,
- const theora_ycbcr_buffer _src);
+void oc_ycbcr_buffer_flip(th_ycbcr_buffer _dst,
+ const th_ycbcr_buffer _src);
int oc_dct_token_skip(int _token,int _extra_bits);
@@ -384,7 +384,7 @@
void oc_state_borders_fill_caps(oc_theora_state *_state,int _refi,int _pli);
void oc_state_borders_fill(oc_theora_state *_state,int _refi);
void oc_state_fill_buffer_ptrs(oc_theora_state *_state,int _buf_idx,
- theora_ycbcr_buffer _img);
+ th_ycbcr_buffer _img);
int oc_state_mbi_for_pos(oc_theora_state *_state,int _mbx,int _mby);
int oc_state_get_mv_offsets(oc_theora_state *_state,int *_offset0,
int *_offset1,int _dx,int _dy,int _ystride,int _pli);
Modified: experimental/derf/theora-exp/lib/quant.c
===================================================================
--- experimental/derf/theora-exp/lib/quant.c 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/quant.c 2006-03-30 22:36:54 UTC (rev 11071)
@@ -42,7 +42,7 @@
continue;
}
for(qi=qri=0;qri<=_qinfo->qi_ranges[qti][pli].nranges;qri++){
- theora_quant_base base;
+ th_quant_base base;
ogg_uint32_t q;
int qi_start;
int qi_end;
Modified: experimental/derf/theora-exp/lib/state.c
===================================================================
--- experimental/derf/theora-exp/lib/state.c 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/lib/state.c 2006-03-30 22:36:54 UTC (rev 11071)
@@ -528,7 +528,7 @@
int oc_state_init(oc_theora_state *_state,const theora_info *_info){
/*First validate the parameters.*/
- if(_info==NULL)return OC_FAULT;
+ if(_info==NULL)return TH_FAULT;
/*The width and height of the encoded frame must be multiples of 16.
They must also, when divided by 16, fit into a 16-bit unsigned integer.
The displayable frame offset coordinates must fit into an 8-bit unsigned
@@ -544,9 +544,9 @@
_info->pic_y+_info->pic_height>_info->frame_height||
_info->pic_x>255||
_info->frame_height-_info->pic_height-_info->pic_y>255||
- _info->colorspace<0||_info->colorspace>=OC_CS_NSPACES||
- _info->pixel_fmt<0||_info->pixel_fmt>=OC_PF_NFORMATS){
- return OC_EINVAL;
+ _info->colorspace<0||_info->colorspace>=TH_CS_NSPACES||
+ _info->pixel_fmt<0||_info->pixel_fmt>=TH_PF_NFORMATS){
+ return TH_EINVAL;
}
memset(_state,0,sizeof(*_state));
memcpy(&_state->info,_info,sizeof(*_info));
@@ -652,14 +652,14 @@
while the last corresponds to the input image.
_img: The image buffer to fill the fragments with.*/
void oc_state_fill_buffer_ptrs(oc_theora_state *_state,int _buf_idx,
- theora_ycbcr_buffer _img){
+ th_ycbcr_buffer _img){
int pli;
/*Special handling for the input image to give us the opportunity to skip
some updates.
The other buffers do not change throughout the encoding process.*/
if(_buf_idx==OC_FRAME_IO){
- if(memcmp(_state->input,_img,sizeof(theora_ycbcr_buffer))==0)return;
- memcpy(_state->input,_img,sizeof(theora_ycbcr_buffer));
+ if(memcmp(_state->input,_img,sizeof(th_ycbcr_buffer))==0)return;
+ memcpy(_state->input,_img,sizeof(th_ycbcr_buffer));
}
for(pli=0;pli<3;pli++){
theora_img_plane *iplane;
@@ -1067,26 +1067,26 @@
pframe=_state->granpos-(iframe<<_state->info.keyframe_granule_shift);
sprintf(fname,"%08i%s.png",(int)(iframe+pframe),_suf);
fp=fopen(fname,"wb");
- if(fp==NULL)return OC_FAULT;
+ if(fp==NULL)return TH_FAULT;
image=(png_bytep *)oc_malloc_2d(height,6*width,sizeof(image[0][0]));
png=png_create_write_struct(PNG_LIBPNG_VER_STRING,NULL,NULL,NULL);
if(png==NULL){
oc_free_2d(image);
fclose(fp);
- return OC_FAULT;
+ return TH_FAULT;
}
info=png_create_info_struct(png);
if(info==NULL){
png_destroy_write_struct(&png,NULL);
oc_free_2d(image);
fclose(fp);
- return OC_FAULT;
+ return TH_FAULT;
}
if(setjmp(png_jmpbuf(png))){
png_destroy_write_struct(&png,&info);
oc_free_2d(image);
fclose(fp);
- return OC_FAULT;
+ return TH_FAULT;
}
framei=_state->ref_frame_idx[_frame];
y_row=_state->ref_frame_bufs[framei][0].data;
@@ -1141,12 +1141,12 @@
png_set_IHDR(png,info,width,height,16,PNG_COLOR_TYPE_RGB,
PNG_INTERLACE_NONE,PNG_COMPRESSION_TYPE_DEFAULT,PNG_FILTER_TYPE_DEFAULT);
switch(_state->info.colorspace){
- case OC_CS_ITU_REC_470M:{
+ case TH_CS_ITU_REC_470M:{
png_set_gAMA(png,info,2.2);
png_set_cHRM_fixed(png,info,31006,31616,
67000,32000,21000,71000,14000,8000);
}break;
- case OC_CS_ITU_REC_470BG:{
+ case TH_CS_ITU_REC_470BG:{
png_set_gAMA(png,info,2.67);
png_set_cHRM_fixed(png,info,31271,32902,
64000,33000,29000,60000,15000,6000);
@@ -1166,7 +1166,7 @@
-ogg_int64_t theora_granule_frame(void *_encdec,ogg_int64_t _granpos){
+ogg_int64_t th_granule_frame(void *_encdec,ogg_int64_t _granpos){
oc_theora_state *state;
state=(oc_theora_state *)_encdec;
if(_granpos>=0){
@@ -1179,7 +1179,7 @@
return -1;
}
-double theora_granule_time(void *_encdec,ogg_int64_t _granpos){
+double th_granule_time(void *_encdec,ogg_int64_t _granpos){
oc_theora_state *state;
state=(oc_theora_state *)_encdec;
if(_granpos>=0){
Modified: experimental/derf/theora-exp/tools/quantgen.c
===================================================================
--- experimental/derf/theora-exp/tools/quantgen.c 2006-03-29 23:15:35 UTC (rev 11070)
+++ experimental/derf/theora-exp/tools/quantgen.c 2006-03-30 22:36:54 UTC (rev 11071)
@@ -600,7 +600,7 @@
if(qri+1<NQRANGES)printf(",");
}
printf("};\n");
- printf("\nstatic const theora_quant_base OC_DEF_BASE_MATRICES[9][%i]={",
+ printf("\nstatic const th_quant_base OC_DEF_BASE_MATRICES[9][%i]={",
NQRANGES+1);
for(pci=0;pci<9;pci++){
if(pci==0)chx=chy=pli=pfi=0;
More information about the commits
mailing list