[xiph-commits] r11106 - in experimental/derf/theora-exp: examples
include/theora lib tools
j at svn.xiph.org
j at svn.xiph.org
Fri Apr 7 08:24:32 PDT 2006
Author: j
Date: 2006-04-07 08:24:16 -0700 (Fri, 07 Apr 2006)
New Revision: 11106
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/dequant.h
experimental/derf/theora-exp/lib/encint.h
experimental/derf/theora-exp/lib/encmsc.c
experimental/derf/theora-exp/lib/encode.c
experimental/derf/theora-exp/lib/enquant.c
experimental/derf/theora-exp/lib/enquant.h
experimental/derf/theora-exp/lib/huffenc.c
experimental/derf/theora-exp/lib/huffenc.h
experimental/derf/theora-exp/lib/impmap.c
experimental/derf/theora-exp/lib/info.c
experimental/derf/theora-exp/lib/internal.h
experimental/derf/theora-exp/lib/quant.c
experimental/derf/theora-exp/lib/quant.h
experimental/derf/theora-exp/lib/state.c
experimental/derf/theora-exp/tools/quantgen.c
Log:
remove more theora_ traces in the public api
Modified: experimental/derf/theora-exp/examples/dump_video.c
===================================================================
--- experimental/derf/theora-exp/examples/dump_video.c 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/examples/dump_video.c 2006-04-07 15:24:16 UTC (rev 11106)
@@ -65,7 +65,7 @@
ogg_page og;
ogg_stream_state vo;
ogg_stream_state to;
-theora_info ti;
+th_info ti;
th_comment tc;
th_setup_info *ts;
th_dec_ctx *td;
@@ -106,7 +106,7 @@
}
static void open_video(void){
- theora_stripe_callback cb;
+ th_stripe_callback cb;
int pli;
/*Here we allocate a buffer so we can use the striped decode feature.
There's no real reason to do this in this application, because we want to
Modified: experimental/derf/theora-exp/examples/encoder_example.c
===================================================================
--- experimental/derf/theora-exp/examples/encoder_example.c 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/examples/encoder_example.c 2006-04-07 15:24:16 UTC (rev 11106)
@@ -1062,7 +1062,7 @@
ogg_packet op; /* one raw packet of data for decode */
th_enc_ctx *td;
- theora_info ti;
+ th_info ti;
th_comment tc;
vorbis_info vi; /* struct that stores all the static vorbis bitstream
Modified: experimental/derf/theora-exp/examples/player_example.c
===================================================================
--- experimental/derf/theora-exp/examples/player_example.c 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/examples/player_example.c 2006-04-07 15:24:16 UTC (rev 11106)
@@ -83,7 +83,7 @@
ogg_page og;
ogg_stream_state vo;
ogg_stream_state to;
-theora_info ti;
+th_info ti;
th_comment tc;
th_setup_info *ts;
th_dec_ctx *td;
@@ -398,7 +398,7 @@
We don't actually make use of the information in this example;
a real player should attempt to perform color correction for
whatever display device it supports. */
-static void report_colorspace(theora_info *ti)
+static void report_colorspace(th_info *ti)
{
switch(ti->colorspace){
case TH_CS_UNSPECIFIED:
Modified: experimental/derf/theora-exp/include/theora/codec.h
===================================================================
--- experimental/derf/theora-exp/include/theora/codec.h 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/include/theora/codec.h 2006-04-07 15:24:16 UTC (rev 11106)
@@ -123,15 +123,15 @@
int ystride;
/**A pointer to the first row.*/
unsigned char *data;
-}theora_img_plane;
+}th_img_plane;
/**A complete image buffer for an uncompressed frame.
* The chroma planes may be decimated by a factor of two in either direction,
- * as indicated by theora_info#pixel_fmt.
+ * as indicated by th_info#pixel_fmt.
* The width and height of the Y' plane must be multiples of 16.
* They may need to be cropped for display, using the rectangle specified by
- * theora_info#pic_x, theora_info#pic_y, theora_info#pic_width, and
- * theora_info#pic_height.
+ * th_info#pic_x, th_info#pic_y, th_info#pic_width, and
+ * th_info#pic_height.
* All samples are 8 bits.
* \note The term YUV often used to describe a colorspace is ambiguous.
* The exact parameters of the RGB to YUV conversion process aside, in many
@@ -140,7 +140,7 @@
* 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 th_ycbcr_buffer[3];
+typedef th_img_plane th_ycbcr_buffer[3];
/**Theora bitstream information.
* This contains the basic playback parameters for a stream, and corresponds to
@@ -267,7 +267,7 @@
* but it cannot be set larger than the amount permitted by this field after
* the headers have been output.*/
int keyframe_granule_shift;
-}theora_info;
+}th_info;
/**The comment information.
*
@@ -287,7 +287,7 @@
* See <a href="http://www.theora.org/doc/Theora_I_spec.pdf">the Theora
* specification</a>, Section 6.3.3 for details.
*
- * In filling in this structure, theora_decode_header() will null-terminate
+ * In filling in this structure, th_decode_headerin() will null-terminate
* the user_comment strings for safety.
* However, the bitstream format itself treats them as 8-bit clean vectors,
* possibly containing null characters, and so the length array should be
@@ -320,7 +320,7 @@
/**#nranges <tt>+1</tt> base matrices.
Matrices \a i and <tt>i+1</tt> form the endpoints of range \a i.*/
const th_quant_base *base_matrices;
-}theora_quant_ranges;
+}th_quant_ranges;
/**A complete set of quantization parameters.
The quantizer for each coefficient is calculated as:
@@ -387,8 +387,8 @@
/**The loop filter limit values.*/
unsigned char loop_filter_limits[64];
/**The \a qi ranges for each \a ci and \a pli.*/
- theora_quant_ranges qi_ranges[2][3];
-}theora_quant_info;
+ th_quant_ranges qi_ranges[2][3];
+}th_quant_info;
@@ -415,7 +415,7 @@
/**The number of bits in the code.
* This must be between 0 and 32, inclusive.*/
int nbits;
-}theora_huff_code;
+}th_huff_code;
@@ -477,16 +477,16 @@
/**\name Functions for manipulating header data*/
/*@{*/
-/**Initializes a theora_info structure.
- * This should be called on a freshly allocated #theora_info structure before
+/**Initializes a th_info structure.
+ * This should be called on a freshly allocated #th_info structure before
* attempting to use it.
- * \param _info The #theora_info struct to initialize.*/
-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
+ * \param _info The #th_info struct to initialize.*/
+extern void th_info_init(th_info *_info);
+/**Clears a #th_info structure.
+ * This should be called on a #th_info structure after it is no longer
* needed.
- * \param _info The #theora_info struct to clear.*/
-extern void th_info_clear(theora_info *_info);
+ * \param _info The #th_info struct to clear.*/
+extern void th_info_clear(th_info *_info);
/**Initialize a #th_comment structure.
* This should be called on a freshly allocated #th_comment structure
Modified: experimental/derf/theora-exp/include/theora/theoradec.h
===================================================================
--- experimental/derf/theora-exp/include/theora/theoradec.h 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/include/theora/theoradec.h 2006-04-07 15:24:16 UTC (rev 11106)
@@ -69,14 +69,14 @@
/**Sets the striped decode callback function.
* If set, this function will be called as each piece of a frame is fully
* 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
+ * You can pass in a #th_stripe_callback with
+ * th_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.
+ * \param[in] _buf #th_stripe_callback: The callback parameters.
* \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>.*/
+ * <tt>sizeof(th_stripe_callback)</tt>.*/
#define TH_DECCTL_SET_STRIPE_CB (7)
/*@}*/
@@ -123,7 +123,7 @@
void *ctx;
/**The callback function pointer.*/
th_stripe_decoded_func stripe_decoded;
-}theora_stripe_callback;
+}th_stripe_callback;
@@ -172,7 +172,7 @@
* packets may follow.
* This can be used on the first packet of any logical stream to determine if
* that stream is a Theora stream.
- * \param _info A #theora_info structure to fill in.
+ * \param _info A #th_info structure to fill in.
* This must have been previously initialized with
* th_info_init().
* The application may immediately begin using the contents of
@@ -206,15 +206,15 @@
* <tt>libtheora</tt>.
* \retval TH_NOTFORMAT The packet was not a Theora header.
*/
-extern int th_decode_headerin(theora_info *_info,th_comment *_tc,
+extern int th_decode_headerin(th_info *_info,th_comment *_tc,
th_setup_info **_setup,ogg_packet *_op);
/**Allocates a decoder instance.
- * \param _info A #theora_info struct filled via th_decode_headerin().
+ * \param _info A #th_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 th_dec_ctx *th_decode_alloc(const theora_info *_info,
+extern th_dec_ctx *th_decode_alloc(const th_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
Modified: experimental/derf/theora-exp/include/theora/theoraenc.h
===================================================================
--- experimental/derf/theora-exp/include/theora/theoraenc.h 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/include/theora/theoraenc.h 2006-04-07 15:24:16 UTC (rev 11106)
@@ -33,7 +33,7 @@
* This mode attempts to encode the video with a constant psychovisual
* quality.
* 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
+ * See the #th_info struct documentation for details on how the default
* encoding mode is chosen.*/
typedef struct th_vbr_cfg{
/**The target quality index.
@@ -67,7 +67,7 @@
* This mode encodes the video with a constant quality index.
* This is the fastest encoding mode.
* 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
+ * See the #th_info struct documentation for details on how the default
* encoding mode is chosen.*/
typedef struct th_cqi_cfg{
/**The target quality index.
@@ -88,13 +88,13 @@
* this call.
* <tt>NULL</tt> may be specified to revert to the default tables.
*
- * \param[in] _buf <tt>#theora_huff_code[#TH_NHUFFMAN_TABLES][#TH_NDCT_TOKENS]</tt>
+ * \param[in] _buf <tt>#th_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)*#TH_NHUFFMAN_TABLES*#TH_NDCT_TOKENS</tt>.
+ * <tt>sizeof(#th_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.
@@ -107,19 +107,19 @@
* These two conditions ensure that the actual quantizer for a given \a qti,
* \a pli, and \a ci does not increase as \a qi increases.
*
- * \param[in] _buf #theora_quant_info
+ * \param[in] _buf #th_quant_info
* \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>.
+ * <tt>sizeof(#th_quant_info)</tt>.
* \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>.
- * If it is set before encoding begins, theora_info#keyframe_granule_shift will
+ * <tt>1<<th_info#keyframe_granule_shift</tt>.
+ * If it is set before encoding begins, th_info#keyframe_granule_shift will
* be enlarged appropriately.
*
* \param[in] _buf <tt>ogg_uint32_t</tt>: The maximum distance between key
@@ -189,14 +189,14 @@
* This can be done at any time during the encoding process, with different
* configuration parameters, to encode different regions of the video segment
* with different qualities.
- * See the #theora_info struct documentation for details on how the default
+ * See the #th_info struct documentation for details on how the default
* encoding mode is chosen.
*
* \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
+ * #th_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 TH_EINVAL The configuration parameters do not meet one of their
@@ -208,14 +208,14 @@
/**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
+ * See the #th_info struct documentation for details on how the default
* encoding mode is chosen.
*
* \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.
+ * #th_info struct when the encoder was initialized.
* \retval OC_EFAULT \a _enc_ctx is <tt>NULL</tt>.
* \retval TH_EINVAL \a _buf_sz is not <tt>sizeof(#th_cqi_cfg)</tt>.
* \retval TH_IMPL Not supported by this implementation.*/
@@ -225,10 +225,10 @@
/**The quantization parameters used by VP3.*/
-extern const theora_quant_info TH_VP31_QUANT_INFO;
+extern const th_quant_info TH_VP31_QUANT_INFO;
/**The Huffman tables used by VP3.*/
-extern const theora_huff_code
+extern const th_huff_code
TH_VP31_HUFF_CODES[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS];
@@ -253,7 +253,7 @@
*
* The functions are listed in the order they are used in a typical encode.
* The basic steps are:
- * - Fill in a #theora_info structure with details on the format of the video
+ * - Fill in a #th_info structure with details on the format of the video
* you wish to encode.
* - Allocate a #th_enc_ctx handle with th_encode_alloc().
* - Perform any additional encoder configuration required with
@@ -267,11 +267,11 @@
* - Call th_encode_free() to release all encoder memory.*/
/*@{*/
/**Allocates an encoder instance.
- * \param _info A #theora_info struct filled with the desired encoding
+ * \param _info A #th_info struct filled with the desired encoding
* parameters.
* \return The initialized #th_enc_ctx handle.
* \retval NULL If the encoding parameters were invalid.*/
-extern th_enc_ctx *th_encode_alloc(const theora_info *_info);
+extern th_enc_ctx *th_encode_alloc(const th_info *_info);
/**Encoder control function.
* This is used to provide advanced control the encoding process.
* \param _enc A #th_enc_ctx handle.
Modified: experimental/derf/theora-exp/lib/decinfo.c
===================================================================
--- experimental/derf/theora-exp/lib/decinfo.c 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/lib/decinfo.c 2006-04-07 15:24:16 UTC (rev 11106)
@@ -25,7 +25,7 @@
return ret[0]|ret[1]<<8|ret[2]<<16|ret[3]<<24;
}
-static int oc_info_unpack(oggpack_buffer *_opb,theora_info *_info){
+static int oc_info_unpack(oggpack_buffer *_opb,th_info *_info){
long val;
/*Check the codec bitstream version.*/
theora_read(_opb,8,&val);
@@ -128,7 +128,7 @@
oc_huff_trees_clear(_setup->huff_tables);
}
-static int oc_dec_headerin(oggpack_buffer *_opb,theora_info *_info,
+static int oc_dec_headerin(oggpack_buffer *_opb,th_info *_info,
th_comment *_tc,th_setup_info **_setup,ogg_packet *_op){
char buffer[6];
long val;
@@ -196,7 +196,7 @@
/*Decodes one header packet.
This should be called repeatedly with the packets at the beginning of the
stream until it returns 0.*/
-int th_decode_headerin(theora_info *_info,th_comment *_tc,
+int th_decode_headerin(th_info *_info,th_comment *_tc,
th_setup_info **_setup,ogg_packet *_op){
oggpack_buffer opb;
int ret;
Modified: experimental/derf/theora-exp/lib/decint.h
===================================================================
--- experimental/derf/theora-exp/lib/decint.h 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/lib/decint.h 2006-04-07 15:24:16 UTC (rev 11106)
@@ -22,7 +22,7 @@
/*The Huffman codes.*/
oc_huff_node *huff_tables[TH_NHUFFMAN_TABLES];
/*The quantization parameters.*/
- theora_quant_info qinfo;
+ th_quant_info qinfo;
};
@@ -71,7 +71,7 @@
/*The buffer used for the post-processed frame.*/
th_ycbcr_buffer pp_frame_buf;
/*The striped decode callback function.*/
- theora_stripe_callback stripe_cb;
+ th_stripe_callback stripe_cb;
};
/*Fix-ups for the libogg1 API, which returns -1 when there are insufficient
Modified: experimental/derf/theora-exp/lib/decode.c
===================================================================
--- experimental/derf/theora-exp/lib/decode.c 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/lib/decode.c 2006-04-07 15:24:16 UTC (rev 11106)
@@ -205,7 +205,7 @@
-static int oc_dec_init(oc_dec_ctx *_dec,const theora_info *_info,
+static int oc_dec_init(oc_dec_ctx *_dec,const th_info *_info,
const th_setup_info *_setup){
int qti;
int pli;
@@ -1589,7 +1589,7 @@
}
static void oc_dec_deblock_frag_rows(oc_dec_ctx *_dec,
- theora_img_plane *_dst,theora_img_plane *_src,int _pli,int _fragy0,
+ th_img_plane *_dst,th_img_plane *_src,int _pli,int _fragy0,
int _fragy_end){
oc_fragment_plane *fplane;
int *variance;
@@ -1787,9 +1787,9 @@
#define OC_DERING_THRESH3 (5*OC_DERING_THRESH1)
#define OC_DERING_THRESH4 (10*OC_DERING_THRESH1)
-static void oc_dec_dering_frag_rows(oc_dec_ctx *_dec,theora_img_plane *_img,
+static void oc_dec_dering_frag_rows(oc_dec_ctx *_dec,th_img_plane *_img,
int _pli,int _fragy0,int _fragy_end){
- theora_img_plane *iplane;
+ th_img_plane *iplane;
oc_fragment_plane *fplane;
oc_fragment *frag;
int *variance;
@@ -1848,7 +1848,7 @@
-th_dec_ctx *th_decode_alloc(const theora_info *_info,
+th_dec_ctx *th_decode_alloc(const th_info *_info,
const th_setup_info *_setup){
oc_dec_ctx *dec;
if(_info==NULL||_setup==NULL)return NULL;
@@ -1900,10 +1900,10 @@
return 0;
}break;
case TH_DECCTL_SET_STRIPE_CB:{
- theora_stripe_callback *cb;
+ th_stripe_callback *cb;
if(_dec==NULL||_buf==NULL)return TH_FAULT;
- if(_buf_sz!=sizeof(theora_stripe_callback))return TH_EINVAL;
- cb=(theora_stripe_callback *)_buf;
+ if(_buf_sz!=sizeof(th_stripe_callback))return TH_EINVAL;
+ cb=(th_stripe_callback *)_buf;
_dec->stripe_cb.ctx=cb->ctx;
_dec->stripe_cb.stripe_decoded=cb->stripe_decoded;
return 0;
@@ -1935,7 +1935,7 @@
if(_dec->state.frame_type!=OC_INTRA_FRAME&&
(_dec->state.ref_frame_idx[OC_FRAME_GOLD]<0||
_dec->state.ref_frame_idx[OC_FRAME_PREV]<0)){
- theora_info *info;
+ th_info *info;
size_t yplane_sz;
size_t cplane_sz;
int yhstride;
Modified: experimental/derf/theora-exp/lib/dequant.c
===================================================================
--- experimental/derf/theora-exp/lib/dequant.c 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/lib/dequant.c 2006-04-07 15:24:16 UTC (rev 11106)
@@ -7,7 +7,7 @@
int oc_quant_params_unpack(oggpack_buffer *_opb,
- theora_quant_info *_qinfo){
+ th_quant_info *_qinfo){
th_quant_base *base_mats;
long val;
int nbase_mats;
@@ -50,7 +50,7 @@
}
nbits=oc_ilog(nbase_mats-1);
for(i=0;i<6;i++){
- theora_quant_ranges *qranges;
+ th_quant_ranges *qranges;
th_quant_base *qrbms;
int *qrsizes;
qti=i/3;
@@ -107,7 +107,7 @@
return 0;
}
-void oc_quant_params_clear(theora_quant_info *_qinfo){
+void oc_quant_params_clear(th_quant_info *_qinfo){
int i;
for(i=6;i-->0;){
int qti;
Modified: experimental/derf/theora-exp/lib/dequant.h
===================================================================
--- experimental/derf/theora-exp/lib/dequant.h 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/lib/dequant.h 2006-04-07 15:24:16 UTC (rev 11106)
@@ -3,7 +3,7 @@
# include "quant.h"
int oc_quant_params_unpack(oggpack_buffer *_opb,
- theora_quant_info *_qinfo);
-void oc_quant_params_clear(theora_quant_info *_qinfo);
+ th_quant_info *_qinfo);
+void oc_quant_params_clear(th_quant_info *_qinfo);
#endif
Modified: experimental/derf/theora-exp/lib/encint.h
===================================================================
--- experimental/derf/theora-exp/lib/encint.h 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/lib/encint.h 2006-04-07 15:24:16 UTC (rev 11106)
@@ -124,7 +124,7 @@
/*Pointers to the Huffman codes associated with each mode scheme.
The first 7 are always OC_MODE_CODESA, and the last is always
OC_MODE_CODESB.*/
- const theora_huff_code *mode_codes[8];
+ const th_huff_code *mode_codes[8];
/*Pointers to the a list containing the index of each mode in the mode
alphabet used by each scheme.
The first entry points to the dynamic scheme0_ranks, while the remaining
@@ -211,9 +211,9 @@
/*The bounding value array used for the loop filter.*/
int bounding_values[512];
/*The huffman tables in use.*/
- theora_huff_code huff_codes[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS];
+ th_huff_code huff_codes[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS];
/*The quantization parameters in use.*/
- theora_quant_info qinfo;
+ th_quant_info qinfo;
/*Pointers to the quantization tables in use.*/
oc_quant_table *enquant_tables[2][3];
/*Storage for the actual quantization tables.*/
@@ -236,7 +236,7 @@
extern const int OC_DCT_VAL_CAT_SIZES[6];
extern const int OC_DCT_VAL_CAT_SHIFTS[6];
extern const int OC_MODE_HAS_MV[OC_NMODES];
-extern const theora_huff_code OC_MV_CODES[2][63];
+extern const th_huff_code OC_MV_CODES[2][63];
/*The number of fractional bits in bitrate statistics.*/
#define OC_BIT_SCALE (7)
Modified: experimental/derf/theora-exp/lib/encmsc.c
===================================================================
--- experimental/derf/theora-exp/lib/encmsc.c 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/lib/encmsc.c 2006-04-07 15:24:16 UTC (rev 11106)
@@ -7,12 +7,12 @@
/*The VLC code used for mode schemes 0-6.*/
-static const theora_huff_code OC_MODE_CODESA[OC_NMODES]={
+static const th_huff_code OC_MODE_CODESA[OC_NMODES]={
{0x00,1},{0x02,2},{0x06,3},{0x0E,4},{0x1E,5},{0x3E,6},{0x7E,7},{0x7F,7}
};
/*The CLC code used for mode scheme 7.*/
-static const theora_huff_code OC_MODE_CODESB[OC_NMODES]={
+static const th_huff_code OC_MODE_CODESB[OC_NMODES]={
{0x00,3},{0x01,3},{0x02,3},{0x03,3},{0x04,3},{0x05,3},{0x06,3},{0x07,3}
};
Modified: experimental/derf/theora-exp/lib/encode.c
===================================================================
--- experimental/derf/theora-exp/lib/encode.c 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/lib/encode.c 2006-04-07 15:24:16 UTC (rev 11106)
@@ -42,7 +42,7 @@
const int OC_MODE_HAS_MV[OC_NMODES]={0,0,1,1,1,1,0,1};
/*The Huffman codes used for motion vectors.*/
-const theora_huff_code OC_MV_CODES[2][63]={
+const th_huff_code OC_MV_CODES[2][63]={
/*Scheme 1: VLC code.*/
{
{0xFF,8},{0xFD,8},{0xFB,8},{0xF9,8},{0xF7,8},{0xF5,8},{0xF3,8},
@@ -291,7 +291,7 @@
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[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS]){
+ const th_huff_code _codes[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS]){
int ret;
if(_enc==NULL)return TH_FAULT;
if(_enc->packet_state>OC_PACKET_SETUP_HDR)return TH_EINVAL;
@@ -317,7 +317,7 @@
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(th_enc_ctx *_enc,
- const theora_quant_info *_qinfo){
+ const th_quant_info *_qinfo){
int qti;
int pli;
int qri;
@@ -654,7 +654,7 @@
ti=_enc->dct_token_offs[0][zzi];
ebi=_enc->extra_bits_offs[zzi];
for(pli=0;pli<3;pli++){
- const theora_huff_code *huff_codes;
+ const th_huff_code *huff_codes;
int token;
int ti_end;
/*Step 2: Write the tokens using these tables.*/
@@ -728,7 +728,7 @@
static void oc_enc_mb_modes_pack(oc_enc_ctx *_enc){
- const theora_huff_code *codes;
+ const th_huff_code *codes;
const int *mode_ranks;
int *coded_mbi;
int *coded_mbi_end;
@@ -752,7 +752,7 @@
coded_mbi=_enc->state.coded_mbis;
coded_mbi_end=coded_mbi+_enc->state.ncoded_mbis;
for(;coded_mbi<coded_mbi_end;coded_mbi++){
- const theora_huff_code *code;
+ const th_huff_code *code;
oc_mb *mb;
mb=_enc->state.mbs+*coded_mbi;
code=codes+mode_ranks[mb->mode];
@@ -761,7 +761,7 @@
}
static void oc_enc_mv_pack(oc_enc_ctx *_enc,int _dx,int _dy){
- const theora_huff_code *code;
+ const th_huff_code *code;
code=OC_MV_CODES[_enc->mv_scheme]+_dx+31;
oggpackB_write(&_enc->opb,code->pattern,code->nbits);
code=OC_MV_CODES[_enc->mv_scheme]+_dy+31;
@@ -807,7 +807,7 @@
static void oc_enc_enable_default_mode(oc_enc_ctx *_enc){
/*TODO: Right now we always use VBR mode.
When a CBR mode is available, we should use that by default if the user
- specifies a bitrate, but not a quality, in the theora_info struct.*/
+ specifies a bitrate, but not a quality, in the th_info struct.*/
if(_enc->vbr==NULL)_enc->vbr=oc_enc_vbr_alloc(_enc);
oc_enc_vbr_enable(_enc->vbr,NULL);
}
@@ -1058,7 +1058,7 @@
}
-static int oc_enc_init(oc_enc_ctx *_enc,const theora_info *_info){
+static int oc_enc_init(oc_enc_ctx *_enc,const th_info *_info){
int ret;
/*Initialize the shared encoder/decoder state.*/
ret=oc_state_init(&_enc->state,_info);
@@ -1322,7 +1322,7 @@
}
-th_enc_ctx *th_encode_alloc(const theora_info *_info){
+th_enc_ctx *th_encode_alloc(const th_info *_info){
oc_enc_ctx *enc;
if(_info==NULL)return NULL;
enc=_ogg_malloc(sizeof(*enc));
@@ -1342,24 +1342,24 @@
-typedef theora_huff_code theora_huff_table[TH_NDCT_TOKENS];
+typedef th_huff_code theora_huff_table[TH_NDCT_TOKENS];
int th_encode_ctl(th_enc_ctx *_enc,int _req,void *_buf,
size_t _buf_sz){
switch(_req){
case TH_ENCCTL_SET_HUFFMAN_CODES:{
if(_buf==NULL&&_buf_sz!=0||_buf!=NULL&&
- _buf_sz!=sizeof(theora_huff_code)*TH_NHUFFMAN_TABLES*TH_NDCT_TOKENS){
+ _buf_sz!=sizeof(th_huff_code)*TH_NHUFFMAN_TABLES*TH_NDCT_TOKENS){
return TH_EINVAL;
}
return oc_enc_set_huffman_codes(_enc,(theora_huff_table *)_buf);
}break;
case TH_ENCCTL_SET_QUANT_PARAMS:{
if(_buf==NULL&&_buf_sz!=0||
- _buf!=NULL&&_buf_sz!=sizeof(theora_quant_info)){
+ _buf!=NULL&&_buf_sz!=sizeof(th_quant_info)){
return TH_EINVAL;
}
- return oc_enc_set_quant_params(_enc,(theora_quant_info *)_buf);
+ return oc_enc_set_quant_params(_enc,(th_quant_info *)_buf);
}break;
case TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE:{
ogg_uint32_t keyframe_frequency_force;
Modified: experimental/derf/theora-exp/lib/enquant.c
===================================================================
--- experimental/derf/theora-exp/lib/enquant.c 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/lib/enquant.c 2006-04-07 15:24:16 UTC (rev 11106)
@@ -74,7 +74,7 @@
}
};
-const theora_quant_info TH_VP31_QUANT_INFO={
+const th_quant_info TH_VP31_QUANT_INFO={
{
220,200,190,180,170,170,160,160,
150,150,140,140,130,130,120,120,
@@ -549,7 +549,7 @@
}
};
-const theora_quant_info OC_DEF_QUANT_INFO[4]={
+const th_quant_info OC_DEF_QUANT_INFO[4]={
{
{
15, 14, 13, 13, 12, 12, 11, 11,
@@ -730,8 +730,8 @@
void oc_quant_params_pack(oggpack_buffer *_opb,
- const theora_quant_info *_qinfo){
- const theora_quant_ranges *qranges;
+ const th_quant_info *_qinfo){
+ const th_quant_ranges *qranges;
const th_quant_base *base_mats[2*3*64];
int indices[2][3][64];
int nbase_mats;
@@ -833,7 +833,7 @@
/*See comments at oc_dequant_tables_init() for how the quantization tables'
storage should be initialized.*/
void oc_enquant_tables_init(oc_quant_table *_dequant[2][3],
- oc_quant_table *_enquant[2][3],const theora_quant_info *_qinfo){
+ oc_quant_table *_enquant[2][3],const th_quant_info *_qinfo){
int qti;
int pli;
/*Initialize the dequantization tables first.*/
Modified: experimental/derf/theora-exp/lib/enquant.h
===================================================================
--- experimental/derf/theora-exp/lib/enquant.h 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/lib/enquant.h 2006-04-07 15:24:16 UTC (rev 11106)
@@ -12,15 +12,15 @@
/*The default quantization parameters used by VP3.1.*/
-extern const theora_quant_info TH_VP31_QUANT_INFO;
+extern const th_quant_info TH_VP31_QUANT_INFO;
/*Our default quantization parameters.*/
-extern const theora_quant_info OC_DEF_QUANT_INFO[4];
+extern const th_quant_info OC_DEF_QUANT_INFO[4];
void oc_quant_params_pack(oggpack_buffer *_opb,
- const theora_quant_info *_qinfo);
+ const th_quant_info *_qinfo);
void oc_enquant_tables_init(oc_quant_table *_dequant[2][3],
- oc_quant_table *_enquant[2][3],const theora_quant_info *_qinfo);
+ oc_quant_table *_enquant[2][3],const th_quant_info *_qinfo);
#endif
Modified: experimental/derf/theora-exp/lib/huffenc.c
===================================================================
--- experimental/derf/theora-exp/lib/huffenc.c 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/lib/huffenc.c 2006-04-07 15:24:16 UTC (rev 11106)
@@ -6,7 +6,7 @@
/*The default Huffman codes used for VP3.1.*/
-const theora_huff_code TH_VP31_HUFF_CODES[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS]={
+const th_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,7 +848,7 @@
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[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS]){
+ const th_huff_code _codes[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS]){
int i;
for(i=0;i<TH_NHUFFMAN_TABLES;i++){
oc_huff_entry entries[TH_NDCT_TOKENS];
Modified: experimental/derf/theora-exp/lib/huffenc.h
===================================================================
--- experimental/derf/theora-exp/lib/huffenc.h 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/lib/huffenc.h 2006-04-07 15:24:16 UTC (rev 11106)
@@ -4,13 +4,13 @@
-extern const theora_huff_code
+extern const th_huff_code
TH_VP31_HUFF_CODES[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS];
int oc_huff_codes_pack(oggpack_buffer *_opb,
- const theora_huff_code _codes[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS]);
+ const th_huff_code _codes[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS]);
Modified: experimental/derf/theora-exp/lib/impmap.c
===================================================================
--- experimental/derf/theora-exp/lib/impmap.c 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/lib/impmap.c 2006-04-07 15:24:16 UTC (rev 11106)
@@ -465,7 +465,7 @@
This should already be adjusted to cover only the visible
frame, and not the full encoded frame.*/
static void oc_seg_sum_moments(oc_seg_ctx *_seg,
- const theora_img_plane *_iplane){
+ const th_img_plane *_iplane){
const unsigned char *ypix;
int ymax;
int y;
@@ -1301,7 +1301,7 @@
_iplane: The image plane the block is contained in.*/
static void oc_seg_splitmerge_is(oc_seg_ctx *_seg,
int _x0,int _y0,int _level,int _area,float _sumx,float _sumx2,float _bic,
- const theora_img_plane *_iplane){
+ const th_img_plane *_iplane){
const unsigned char *ypix;
int size;
int y;
@@ -1345,7 +1345,7 @@
static void oc_seg_splitmerge_bs(oc_seg_ctx *_seg,
int _x0,int _y0,int _width,int _height,int _level,
int _area,float _sumx,float _sumx2,float _bic,
- const theora_img_plane *_iplane){
+ const th_img_plane *_iplane){
const unsigned char *ypix;
int size;
int y;
@@ -1397,7 +1397,7 @@
_iplane: The image plane the block is contained in.*/
static void oc_seg_splitmerge_it(oc_seg_ctx *_seg,
int _x0,int _y0,int _level,int _area,float _sumx,float _sumx2,float _bic,
- const theora_img_plane *_iplane){
+ const th_img_plane *_iplane){
float sumx[4];
float sumx2[4];
float bic[4];
@@ -1466,7 +1466,7 @@
static void oc_seg_splitmerge_bt(oc_seg_ctx *_seg,
int _x0,int _y0,int _width,int _height,int _level,
int _area,float _sumx,float _sumx2,float _bic,
- const theora_img_plane *_iplane){
+ const th_img_plane *_iplane){
float sumx[4];
float sumx2[4];
float bic[4];
@@ -1629,7 +1629,7 @@
/*Perform segmentation over the given image plane.
_seg: The segmentation context.
_iplane: The image plane to segment.*/
-static void oc_seg_plane(oc_seg_ctx *_seg,const theora_img_plane *_iplane){
+static void oc_seg_plane(oc_seg_ctx *_seg,const th_img_plane *_iplane){
float sumx;
float sumx2;
float var;
@@ -2109,7 +2109,7 @@
return ret;
}
static void oc_impmap_fill(oc_impmap_ctx *_impmap,float _duration){
- theora_img_plane yplane;
+ th_img_plane yplane;
float imp_sum;
int img_offset;
int nmbs;
@@ -2245,7 +2245,7 @@
oc_impmap_ctx *oc_impmap_alloc(oc_enc_ctx *_enc){
- theora_info *info;
+ th_info *info;
oc_impmap_ctx *impmap;
int edge_sz;
int width;
Modified: experimental/derf/theora-exp/lib/info.c
===================================================================
--- experimental/derf/theora-exp/lib/info.c 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/lib/info.c 2006-04-07 15:24:16 UTC (rev 11106)
@@ -19,7 +19,7 @@
-void th_info_init(theora_info *_info){
+void th_info_init(th_info *_info){
memset(_info,0,sizeof(*_info));
_info->version_major=TH_VERSION_MAJOR;
_info->version_minor=TH_VERSION_MINOR;
@@ -27,7 +27,7 @@
_info->keyframe_granule_shift=6;
}
-void th_info_clear(theora_info *_info){
+void th_info_clear(th_info *_info){
memset(_info,0,sizeof(*_info));
}
Modified: experimental/derf/theora-exp/lib/internal.h
===================================================================
--- experimental/derf/theora-exp/lib/internal.h 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/lib/internal.h 2006-04-07 15:24:16 UTC (rev 11106)
@@ -249,7 +249,7 @@
/*Common state information between the encoder and decoder.*/
struct oc_theora_state{
/*The stream information.*/
- theora_info info;
+ th_info info;
/*Table for shared accelerated functions.*/
oc_base_opt_vtable opt_vtable;
/*CPU flags to detect the presence of extended instruction sets.*/
@@ -376,7 +376,7 @@
int oc_frag_pred_dc(const oc_fragment *_frag,
const oc_fragment_plane *_fplane,int _x,int _y,int _pred_last[3]);
-int oc_state_init(oc_theora_state *_state,const theora_info *_info);
+int oc_state_init(oc_theora_state *_state,const th_info *_info);
void oc_state_clear(oc_theora_state *_state);
void oc_state_vtable_init_c(oc_theora_state *_state);
void oc_state_borders_fill_rows(oc_theora_state *_state,int _refi,int _pli,
Modified: experimental/derf/theora-exp/lib/quant.c
===================================================================
--- experimental/derf/theora-exp/lib/quant.c 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/lib/quant.c 2006-04-07 15:24:16 UTC (rev 11106)
@@ -24,7 +24,7 @@
matrices being used for the current frame, and to recalculate these as the
qi values change between frames (this is what VP3 did).*/
void oc_dequant_tables_init(oc_quant_table *_dequant[2][3],
- int _pp_dc_scale[64],const theora_quant_info *_qinfo){
+ int _pp_dc_scale[64],const th_quant_info *_qinfo){
int qti;
int pli;
for(qti=0;qti<2;qti++)for(pli=0;pli<3;pli++){
Modified: experimental/derf/theora-exp/lib/quant.h
===================================================================
--- experimental/derf/theora-exp/lib/quant.h 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/lib/quant.h 2006-04-07 15:24:16 UTC (rev 11106)
@@ -23,6 +23,6 @@
void oc_dequant_tables_init(oc_quant_table *_dequant[2][3],
- int _pp_dc_scale[64],const theora_quant_info *_qinfo);
+ int _pp_dc_scale[64],const th_quant_info *_qinfo);
#endif
Modified: experimental/derf/theora-exp/lib/state.c
===================================================================
--- experimental/derf/theora-exp/lib/state.c 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/lib/state.c 2006-04-07 15:24:16 UTC (rev 11106)
@@ -445,7 +445,7 @@
factor of 2 on the appropriate sides.
_enc: The encoding context to store the buffers in.*/
static void oc_state_ref_bufs_init(oc_theora_state *_state){
- theora_info *info;
+ th_info *info;
unsigned char *ref_frame_data;
size_t yplane_sz;
size_t cplane_sz;
@@ -526,7 +526,7 @@
}
-int oc_state_init(oc_theora_state *_state,const theora_info *_info){
+int oc_state_init(oc_theora_state *_state,const th_info *_info){
/*First validate the parameters.*/
if(_info==NULL)return TH_FAULT;
/*The width and height of the encoded frame must be multiples of 16.
@@ -583,7 +583,7 @@
_yend: The Y coordinate of the row to stop padding at.*/
void oc_state_borders_fill_rows(oc_theora_state *_state,int _refi,int _pli,
int _y0,int _yend){
- theora_img_plane *iplane;
+ th_img_plane *iplane;
unsigned char *apix;
unsigned char *bpix;
unsigned char *epix;
@@ -609,7 +609,7 @@
_refi: The index of the reference buffer to pad.
_pli: The color plane.*/
void oc_state_borders_fill_caps(oc_theora_state *_state,int _refi,int _pli){
- theora_img_plane *iplane;
+ th_img_plane *iplane;
unsigned char *apix;
unsigned char *bpix;
unsigned char *epix;
@@ -662,7 +662,7 @@
memcpy(_state->input,_img,sizeof(th_ycbcr_buffer));
}
for(pli=0;pli<3;pli++){
- theora_img_plane *iplane;
+ th_img_plane *iplane;
oc_fragment_plane *fplane;
oc_fragment *frag;
oc_fragment *vfrag_end;
@@ -979,7 +979,7 @@
_fragy_end: The Y coordinate of the fragment row to stop filtering at.*/
void oc_state_loop_filter_frag_rows(oc_theora_state *_state,int *_bv,
int _refi,int _pli,int _fragy0,int _fragy_end){
- theora_img_plane *iplane;
+ th_img_plane *iplane;
oc_fragment_plane *fplane;
oc_fragment *frag_top;
oc_fragment *frag0;
Modified: experimental/derf/theora-exp/tools/quantgen.c
===================================================================
--- experimental/derf/theora-exp/tools/quantgen.c 2006-04-07 15:18:49 UTC (rev 11105)
+++ experimental/derf/theora-exp/tools/quantgen.c 2006-04-07 15:24:16 UTC (rev 11106)
@@ -628,7 +628,7 @@
if(pci<8)printf(",");
}
printf("\n};\n");
- printf("\nconst theora_quant_info OC_DEF_QUANT_INFO[4]={");
+ printf("\nconst th_quant_info OC_DEF_QUANT_INFO[4]={");
for(pfi=0;pfi<4;pfi++){
printf("\n {");
printf("\n {");
More information about the commits
mailing list