[xiph-commits] r17309 - experimental/derf/theora-ptalarbvorm/lib
tterribe at svn.xiph.org
tterribe at svn.xiph.org
Sun Jun 27 22:43:49 PDT 2010
Author: tterribe
Date: 2010-06-27 22:43:49 -0700 (Sun, 27 Jun 2010)
New Revision: 17309
Modified:
experimental/derf/theora-ptalarbvorm/lib/encfrag.c
experimental/derf/theora-ptalarbvorm/lib/encint.h
experimental/derf/theora-ptalarbvorm/lib/enquant.c
experimental/derf/theora-ptalarbvorm/lib/fdct.c
experimental/derf/theora-ptalarbvorm/lib/fragment.c
experimental/derf/theora-ptalarbvorm/lib/idct.c
experimental/derf/theora-ptalarbvorm/lib/internal.h
experimental/derf/theora-ptalarbvorm/lib/state.c
Log:
Replace the arch-specific vtable invocation trampolines with macros.
This eliminates an extra function call, which was particularly expensive on
x86-64 with its register parameters, since most of the functions dropped their
first argument (passed solely to access the vtable), meaning all the rest of
the arguments had to shift over one register.
In the decoder, such invocations are rare enough that this makes no measurable
performance difference, but in the encoder we now make enough per-block calls
that this actually speeds things up by 1.1%.
This also paves the way for arch-specific functions which do not require an
indirect call, such as on the C64x, where they are both unnecessary and
particularly expensive.
Modified: experimental/derf/theora-ptalarbvorm/lib/encfrag.c
===================================================================
--- experimental/derf/theora-ptalarbvorm/lib/encfrag.c 2010-06-28 02:00:08 UTC (rev 17308)
+++ experimental/derf/theora-ptalarbvorm/lib/encfrag.c 2010-06-28 05:43:49 UTC (rev 17309)
@@ -19,11 +19,6 @@
#include "encint.h"
-void oc_enc_frag_sub(const oc_enc_ctx *_enc,ogg_int16_t _diff[64],
- const unsigned char *_src,const unsigned char *_ref,int _ystride){
- (*_enc->opt_vtable.frag_sub)(_diff,_src,_ref,_ystride);
-}
-
void oc_enc_frag_sub_c(ogg_int16_t _diff[64],const unsigned char *_src,
const unsigned char *_ref,int _ystride){
int i;
@@ -35,11 +30,6 @@
}
}
-void oc_enc_frag_sub_128(const oc_enc_ctx *_enc,ogg_int16_t _diff[64],
- const unsigned char *_src,int _ystride){
- (*_enc->opt_vtable.frag_sub_128)(_diff,_src,_ystride);
-}
-
void oc_enc_frag_sub_128_c(ogg_int16_t *_diff,
const unsigned char *_src,int _ystride){
int i;
@@ -50,11 +40,6 @@
}
}
-unsigned oc_enc_frag_sad(const oc_enc_ctx *_enc,const unsigned char *_x,
- const unsigned char *_y,int _ystride){
- return (*_enc->opt_vtable.frag_sad)(_x,_y,_ystride);
-}
-
unsigned oc_enc_frag_sad_c(const unsigned char *_src,
const unsigned char *_ref,int _ystride){
unsigned sad;
@@ -69,12 +54,6 @@
return sad;
}
-unsigned oc_enc_frag_sad_thresh(const oc_enc_ctx *_enc,
- const unsigned char *_src,const unsigned char *_ref,int _ystride,
- unsigned _thresh){
- return (*_enc->opt_vtable.frag_sad_thresh)(_src,_ref,_ystride,_thresh);
-}
-
unsigned oc_enc_frag_sad_thresh_c(const unsigned char *_src,
const unsigned char *_ref,int _ystride,unsigned _thresh){
unsigned sad;
@@ -90,13 +69,6 @@
return sad;
}
-unsigned oc_enc_frag_sad2_thresh(const oc_enc_ctx *_enc,
- const unsigned char *_src,const unsigned char *_ref1,
- const unsigned char *_ref2,int _ystride,unsigned _thresh){
- return (*_enc->opt_vtable.frag_sad2_thresh)(_src,_ref1,_ref2,_ystride,
- _thresh);
-}
-
unsigned oc_enc_frag_sad2_thresh_c(const unsigned char *_src,
const unsigned char *_ref1,const unsigned char *_ref2,int _ystride,
unsigned _thresh){
@@ -322,11 +294,6 @@
return sad-dc;
}
-unsigned oc_enc_frag_satd(const oc_enc_ctx *_enc,unsigned *_dc,
- const unsigned char *_src,const unsigned char *_ref,int _ystride){
- return (*_enc->opt_vtable.frag_satd)(_dc,_src,_ref,_ystride);
-}
-
unsigned oc_enc_frag_satd_c(unsigned *_dc,const unsigned char *_src,
const unsigned char *_ref,int _ystride){
ogg_int16_t buf[64];
@@ -334,12 +301,6 @@
return oc_hadamard_sad(_dc,buf);
}
-unsigned oc_enc_frag_satd2(const oc_enc_ctx *_enc,unsigned *_dc,
- const unsigned char *_src,const unsigned char *_ref1,
- const unsigned char *_ref2,int _ystride){
- return (*_enc->opt_vtable.frag_satd2)(_dc,_src,_ref1,_ref2,_ystride);
-}
-
unsigned oc_enc_frag_satd2_c(unsigned *_dc,const unsigned char *_src,
const unsigned char *_ref1,const unsigned char *_ref2,int _ystride){
ogg_int16_t buf[64];
@@ -347,11 +308,6 @@
return oc_hadamard_sad(_dc,buf);
}
-unsigned oc_enc_frag_intra_satd(const oc_enc_ctx *_enc,unsigned *_dc,
- const unsigned char *_src,int _ystride){
- return (*_enc->opt_vtable.frag_intra_satd)(_dc,_src,_ystride);
-}
-
unsigned oc_enc_frag_intra_satd_c(unsigned *_dc,
const unsigned char *_src,int _ystride){
ogg_int16_t buf[64];
@@ -359,11 +315,6 @@
return oc_hadamard_sad(_dc,buf);
}
-unsigned oc_enc_frag_ssd(const oc_enc_ctx *_enc,const unsigned char *_src,
- const unsigned char *_ref,int _ystride){
- return (*_enc->opt_vtable.frag_ssd)(_src,_ref,_ystride);
-}
-
unsigned oc_enc_frag_ssd_c(const unsigned char *_src,
const unsigned char *_ref,int _ystride){
unsigned ret;
@@ -378,12 +329,6 @@
return ret;
}
-unsigned oc_enc_frag_border_ssd(const oc_enc_ctx *_enc,
- const unsigned char *_src,const unsigned char *_ref,int _ystride,
- ogg_int64_t _mask){
- return (*_enc->opt_vtable.frag_border_ssd)(_src,_ref,_ystride,_mask);
-}
-
unsigned oc_enc_frag_border_ssd_c(const unsigned char *_src,
const unsigned char *_ref,int _ystride,ogg_int64_t _mask){
unsigned ret;
@@ -400,11 +345,6 @@
return ret;
}
-void oc_enc_frag_copy2(const oc_enc_ctx *_enc,unsigned char *_dst,
- const unsigned char *_src1,const unsigned char *_src2,int _ystride){
- (*_enc->opt_vtable.frag_copy2)(_dst,_src1,_src2,_ystride);
-}
-
void oc_enc_frag_copy2_c(unsigned char *_dst,
const unsigned char *_src1,const unsigned char *_src2,int _ystride){
int i;
@@ -416,13 +356,3 @@
_src2+=_ystride;
}
}
-
-void oc_enc_frag_recon_intra(const oc_enc_ctx *_enc,
- unsigned char *_dst,int _ystride,const ogg_int16_t _residue[64]){
- (*_enc->opt_vtable.frag_recon_intra)(_dst,_ystride,_residue);
-}
-
-void oc_enc_frag_recon_inter(const oc_enc_ctx *_enc,unsigned char *_dst,
- const unsigned char *_src,int _ystride,const ogg_int16_t _residue[64]){
- (*_enc->opt_vtable.frag_recon_inter)(_dst,_src,_ystride,_residue);
-}
Modified: experimental/derf/theora-ptalarbvorm/lib/encint.h
===================================================================
--- experimental/derf/theora-ptalarbvorm/lib/encint.h 2010-06-28 02:00:08 UTC (rev 17308)
+++ experimental/derf/theora-ptalarbvorm/lib/encint.h 2010-06-28 05:43:49 UTC (rev 17309)
@@ -542,45 +542,74 @@
/*Encoder-specific accelerated functions.*/
-void oc_enc_frag_sub(const oc_enc_ctx *_enc,ogg_int16_t _diff[64],
- const unsigned char *_src,const unsigned char *_ref,int _ystride);
-void oc_enc_frag_sub_128(const oc_enc_ctx *_enc,ogg_int16_t _diff[64],
- const unsigned char *_src,int _ystride);
-unsigned oc_enc_frag_sad(const oc_enc_ctx *_enc,const unsigned char *_src,
- const unsigned char *_ref,int _ystride);
-unsigned oc_enc_frag_sad_thresh(const oc_enc_ctx *_enc,
- const unsigned char *_src,const unsigned char *_ref,int _ystride,
- unsigned _thresh);
-unsigned oc_enc_frag_sad2_thresh(const oc_enc_ctx *_enc,
- const unsigned char *_src,const unsigned char *_ref1,
- const unsigned char *_ref2,int _ystride,unsigned _thresh);
-unsigned oc_enc_frag_satd(const oc_enc_ctx *_enc,unsigned *_dc,
- const unsigned char *_src,const unsigned char *_ref,int _ystride);
-unsigned oc_enc_frag_satd2(const oc_enc_ctx *_enc,unsigned *_dc,
- const unsigned char *_src,const unsigned char *_ref1,
- const unsigned char *_ref2,int _ystride);
-unsigned oc_enc_frag_intra_satd(const oc_enc_ctx *_enc,unsigned *_dc,
- const unsigned char *_src,int _ystride);
-unsigned oc_enc_frag_ssd(const oc_enc_ctx *_enc,const unsigned char *_src,
- const unsigned char *_ref,int _ystride);
-unsigned oc_enc_frag_border_ssd(const oc_enc_ctx *_enc,
- const unsigned char *_src,const unsigned char *_ref,int _ystride,
- ogg_int64_t _mask);
-void oc_enc_frag_copy2(const oc_enc_ctx *_enc,unsigned char *_dst,
- const unsigned char *_src1,const unsigned char *_src2,int _ystride);
-void oc_enc_enquant_table_init(const oc_enc_ctx *_enc,
- void *_enquant,const ogg_uint16_t _dequant[64]);
-void oc_enc_enquant_table_fixup(const oc_enc_ctx *_enc,
- void *_enquant[3][3][2],int _nqis);
-int oc_enc_quantize(const oc_enc_ctx *_enc,
- ogg_int16_t _qdct[64],const ogg_int16_t _dct[64],
- const ogg_uint16_t _dequant[64],const void *_enquant);
-void oc_enc_frag_recon_intra(const oc_enc_ctx *_enc,
- unsigned char *_dst,int _ystride,const ogg_int16_t _residue[64]);
-void oc_enc_frag_recon_inter(const oc_enc_ctx *_enc,unsigned char *_dst,
- const unsigned char *_src,int _ystride,const ogg_int16_t _residue[64]);
-void oc_enc_fdct8x8(const oc_enc_ctx *_enc,ogg_int16_t _y[64],
- const ogg_int16_t _x[64]);
+# if !defined(oc_enc_frag_sub)
+# define oc_enc_frag_sub(_enc,_diff,_src,_ref,_ystride) \
+ ((*(_enc)->opt_vtable.frag_sub)(_diff,_src,_ref,_ystride))
+# endif
+#if !defined(oc_enc_frag_sub_128)
+# define oc_enc_frag_sub_128(_enc,_diff,_src,_ystride) \
+ ((*(_enc)->opt_vtable.frag_sub_128)(_diff,_src,_ystride))
+# endif
+#if !defined(oc_enc_frag_sad)
+# define oc_enc_frag_sad(_enc,_src,_ref,_ystride) \
+ ((*(_enc)->opt_vtable.frag_sad)(_src,_ref,_ystride))
+#endif
+#if !defined(oc_enc_frag_sad_thresh)
+# define oc_enc_frag_sad_thresh(_enc,_src,_ref,_ystride,_thresh) \
+ ((*(_enc)->opt_vtable.frag_sad_thresh)(_src,_ref,_ystride,_thresh))
+#endif
+#if !defined(oc_enc_frag_sad2_thresh)
+# define oc_enc_frag_sad2_thresh(_enc,_src,_ref1,_ref2,_ystride,_thresh) \
+ ((*(_enc)->opt_vtable.frag_sad2_thresh)(_src,_ref1,_ref2,_ystride,_thresh))
+#endif
+#if !defined(oc_enc_frag_satd)
+# define oc_enc_frag_satd(_enc,_dc,_src,_ref,_ystride) \
+ ((*(_enc)->opt_vtable.frag_satd)(_dc,_src,_ref,_ystride))
+#endif
+#if !defined(oc_enc_frag_satd2)
+# define oc_enc_frag_satd2(_enc,_dc,_src,_ref1,_ref2,_ystride) \
+ ((*(_enc)->opt_vtable.frag_satd2)(_dc,_src,_ref1,_ref2,_ystride))
+#endif
+#if !defined(oc_enc_frag_intra_satd)
+# define oc_enc_frag_intra_satd(_enc,_dc,_src,_ystride) \
+ ((*(_enc)->opt_vtable.frag_intra_satd)(_dc,_src,_ystride))
+#endif
+#if !defined(oc_enc_frag_ssd)
+# define oc_enc_frag_ssd(_enc,_src,_ref,_ystride) \
+ ((*(_enc)->opt_vtable.frag_ssd)(_src,_ref,_ystride))
+#endif
+#if !defined(oc_enc_frag_border_ssd)
+# define oc_enc_frag_border_ssd(_enc,_src,_ref,_ystride,_mask) \
+ ((*(_enc)->opt_vtable.frag_border_ssd)(_src,_ref,_ystride,_mask))
+#endif
+#if !defined(oc_enc_frag_copy2)
+# define oc_enc_frag_copy2(_enc,_dst,_src1,_src2,_ystride) \
+ ((*(_enc)->opt_vtable.frag_copy2)(_dst,_src1,_src2,_ystride))
+#endif
+#if !defined(oc_enc_enquant_table_init)
+# define oc_enc_enquant_table_init(_enc,_enquant,_dequant) \
+ ((*(_enc)->opt_vtable.enquant_table_init)(_enquant,_dequant))
+#endif
+#if !defined(oc_enc_enquant_table_fixup)
+# define oc_enc_enquant_table_fixup(_enc,_enquant,_nqis) \
+ ((*(_enc)->opt_vtable.enquant_table_fixup)(_enquant,_nqis))
+#endif
+#if !defined(oc_enc_quantize)
+# define oc_enc_quantize(_enc,_qdct,_dct,_dequant,_enquant) \
+ ((*(_enc)->opt_vtable.quantize)(_qdct,_dct,_dequant,_enquant))
+#endif
+#if !defined(oc_enc_frag_recon_intra)
+# define oc_enc_frag_recon_intra(_enc,_dst,_ystride,_residue) \
+ ((*(_enc)->opt_vtable.frag_recon_intra)(_dst,_ystride,_residue))
+#endif
+#if !defined(oc_enc_frag_recon_inter)
+# define oc_enc_frag_recon_inter(_enc,_dst,_src,_ystride,_residue) \
+ ((*(_enc)->opt_vtable.frag_recon_inter)(_dst,_src,_ystride,_residue))
+#endif
+#if !defined(oc_enc_fdct8x8)
+# define oc_enc_fdct8x8(_enc,_y,_x) \
+ ((*(_enc)->opt_vtable.fdct8x8)(_y,_x))
+#endif
/*Default pure-C implementations.*/
void oc_enc_vtable_init_c(oc_enc_ctx *_enc);
Modified: experimental/derf/theora-ptalarbvorm/lib/enquant.c
===================================================================
--- experimental/derf/theora-ptalarbvorm/lib/enquant.c 2010-06-28 02:00:08 UTC (rev 17308)
+++ experimental/derf/theora-ptalarbvorm/lib/enquant.c 2010-06-28 05:43:49 UTC (rev 17309)
@@ -129,11 +129,6 @@
_this->l=l;
}
-void oc_enc_enquant_table_init(const oc_enc_ctx *_enc,void *_enquant,
- const ogg_uint16_t _dequant[64]){
- (*_enc->opt_vtable.enquant_table_init)(_enquant,_dequant);
-}
-
void oc_enc_enquant_table_init_c(void *_enquant,
const ogg_uint16_t _dequant[64]){
oc_iquant *enquant;
@@ -150,11 +145,6 @@
for(zzi=0;zzi<64;zzi++)oc_iquant_init(enquant+zzi,_dequant[zzi]);
}
-void oc_enc_enquant_table_fixup(const oc_enc_ctx *_enc,
- void *_enquant[3][3][2],int _nqis){
- (*_enc->opt_vtable.enquant_table_fixup)(_enquant,_nqis);
-}
-
void oc_enc_enquant_table_fixup_c(void *_enquant[3][3][2],int _nqis){
int pli;
int qii;
@@ -165,12 +155,6 @@
}
}
-int oc_enc_quantize(const oc_enc_ctx *_enc,
- ogg_int16_t _qdct[64],const ogg_int16_t _dct[64],
- const ogg_uint16_t _dequant[64],const void *_enquant){
- return (*_enc->opt_vtable.quantize)(_qdct,_dct,_dequant,_enquant);
-}
-
int oc_enc_quantize_c(ogg_int16_t _qdct[64],const ogg_int16_t _dct[64],
const ogg_uint16_t _dequant[64],const void *_enquant){
const oc_iquant *enquant;
@@ -180,6 +164,7 @@
int d;
int s;
enquant=(const oc_iquant *)_enquant;
+ nonzero=0;
for(zzi=0;zzi<64;zzi++){
val=_dct[OC_FZIG_ZAG[zzi]];
d=_dequant[zzi];
Modified: experimental/derf/theora-ptalarbvorm/lib/fdct.c
===================================================================
--- experimental/derf/theora-ptalarbvorm/lib/fdct.c 2010-06-28 02:00:08 UTC (rev 17308)
+++ experimental/derf/theora-ptalarbvorm/lib/fdct.c 2010-06-28 05:43:49 UTC (rev 17309)
@@ -120,11 +120,6 @@
_y[7]=v;
}
-void oc_enc_fdct8x8(const oc_enc_ctx *_enc,ogg_int16_t _y[64],
- const ogg_int16_t _x[64]){
- (*_enc->opt_vtable.fdct8x8)(_y,_x);
-}
-
/*Performs a forward 8x8 Type-II DCT transform.
The output is scaled by a factor of 4 relative to the orthonormal version
of the transform.
Modified: experimental/derf/theora-ptalarbvorm/lib/fragment.c
===================================================================
--- experimental/derf/theora-ptalarbvorm/lib/fragment.c 2010-06-28 02:00:08 UTC (rev 17308)
+++ experimental/derf/theora-ptalarbvorm/lib/fragment.c 2010-06-28 05:43:49 UTC (rev 17309)
@@ -17,11 +17,6 @@
#include <string.h>
#include "internal.h"
-void oc_frag_copy(const oc_theora_state *_state,unsigned char *_dst,
- const unsigned char *_src,int _ystride){
- (*_state->opt_vtable.frag_copy)(_dst,_src,_ystride);
-}
-
void oc_frag_copy_c(unsigned char *_dst,const unsigned char *_src,int _ystride){
int i;
for(i=8;i-->0;){
@@ -31,11 +26,6 @@
}
}
-void oc_frag_recon_intra(const oc_theora_state *_state,unsigned char *_dst,
- int _ystride,const ogg_int16_t _residue[64]){
- _state->opt_vtable.frag_recon_intra(_dst,_ystride,_residue);
-}
-
void oc_frag_recon_intra_c(unsigned char *_dst,int _ystride,
const ogg_int16_t _residue[64]){
int i;
@@ -46,11 +36,6 @@
}
}
-void oc_frag_recon_inter(const oc_theora_state *_state,unsigned char *_dst,
- const unsigned char *_src,int _ystride,const ogg_int16_t _residue[64]){
- _state->opt_vtable.frag_recon_inter(_dst,_src,_ystride,_residue);
-}
-
void oc_frag_recon_inter_c(unsigned char *_dst,
const unsigned char *_src,int _ystride,const ogg_int16_t _residue[64]){
int i;
@@ -62,12 +47,6 @@
}
}
-void oc_frag_recon_inter2(const oc_theora_state *_state,unsigned char *_dst,
- const unsigned char *_src1,const unsigned char *_src2,int _ystride,
- const ogg_int16_t _residue[64]){
- _state->opt_vtable.frag_recon_inter2(_dst,_src1,_src2,_ystride,_residue);
-}
-
void oc_frag_recon_inter2_c(unsigned char *_dst,const unsigned char *_src1,
const unsigned char *_src2,int _ystride,const ogg_int16_t _residue[64]){
int i;
@@ -80,8 +59,4 @@
}
}
-void oc_restore_fpu(const oc_theora_state *_state){
- _state->opt_vtable.restore_fpu();
-}
-
void oc_restore_fpu_c(void){}
Modified: experimental/derf/theora-ptalarbvorm/lib/idct.c
===================================================================
--- experimental/derf/theora-ptalarbvorm/lib/idct.c 2010-06-28 02:00:08 UTC (rev 17308)
+++ experimental/derf/theora-ptalarbvorm/lib/idct.c 2010-06-28 05:43:49 UTC (rev 17309)
@@ -295,11 +295,6 @@
for(out=_y,end=out+64;out<end;out++)*out=(ogg_int16_t)(*out+8>>4);
}
-void oc_idct8x8(const oc_theora_state *_state,ogg_int16_t _y[64],
- int _last_zzi){
- (*_state->opt_vtable.idct8x8)(_y,_last_zzi);
-}
-
/*Performs an inverse 8x8 Type-II DCT transform.
The input is assumed to be scaled by a factor of 4 relative to orthonormal
version of the transform.*/
Modified: experimental/derf/theora-ptalarbvorm/lib/internal.h
===================================================================
--- experimental/derf/theora-ptalarbvorm/lib/internal.h 2010-06-28 02:00:08 UTC (rev 17308)
+++ experimental/derf/theora-ptalarbvorm/lib/internal.h 2010-06-28 05:43:49 UTC (rev 17309)
@@ -84,76 +84,76 @@
(_info)->version_subminor>=(_sub)))
/*A keyframe.*/
-#define OC_INTRA_FRAME (0)
+# define OC_INTRA_FRAME (0)
/*A predicted frame.*/
-#define OC_INTER_FRAME (1)
+# define OC_INTER_FRAME (1)
/*A frame of unknown type (frame type decision has not yet been made).*/
-#define OC_UNKWN_FRAME (-1)
+# define OC_UNKWN_FRAME (-1)
/*The amount of padding to add to the reconstructed frame buffers on all
sides.
This is used to allow unrestricted motion vectors without special casing.
This must be a multiple of 2.*/
-#define OC_UMV_PADDING (16)
+# define OC_UMV_PADDING (16)
/*Frame classification indices.*/
/*The previous golden frame.*/
-#define OC_FRAME_GOLD (0)
+# define OC_FRAME_GOLD (0)
/*The previous frame.*/
-#define OC_FRAME_PREV (1)
+# define OC_FRAME_PREV (1)
/*The current frame.*/
-#define OC_FRAME_SELF (2)
+# define OC_FRAME_SELF (2)
/*The input or output buffer.*/
-#define OC_FRAME_IO (3)
+# define OC_FRAME_IO (3)
/*Uncompressed prev golden frame.*/
-#define OC_FRAME_GOLD_ORIG (4)
+# define OC_FRAME_GOLD_ORIG (4)
/*Uncompressed previous frame. */
-#define OC_FRAME_PREV_ORIG (5)
+# define OC_FRAME_PREV_ORIG (5)
/*Macroblock modes.*/
/*Macro block is invalid: It is never coded.*/
-#define OC_MODE_INVALID (-1)
+# define OC_MODE_INVALID (-1)
/*Encoded difference from the same macro block in the previous frame.*/
-#define OC_MODE_INTER_NOMV (0)
+# define OC_MODE_INTER_NOMV (0)
/*Encoded with no motion compensated prediction.*/
-#define OC_MODE_INTRA (1)
+# define OC_MODE_INTRA (1)
/*Encoded difference from the previous frame offset by the given motion
vector.*/
-#define OC_MODE_INTER_MV (2)
+# define OC_MODE_INTER_MV (2)
/*Encoded difference from the previous frame offset by the last coded motion
vector.*/
-#define OC_MODE_INTER_MV_LAST (3)
+# define OC_MODE_INTER_MV_LAST (3)
/*Encoded difference from the previous frame offset by the second to last
coded motion vector.*/
-#define OC_MODE_INTER_MV_LAST2 (4)
+# define OC_MODE_INTER_MV_LAST2 (4)
/*Encoded difference from the same macro block in the previous golden
frame.*/
-#define OC_MODE_GOLDEN_NOMV (5)
+# define OC_MODE_GOLDEN_NOMV (5)
/*Encoded difference from the previous golden frame offset by the given motion
vector.*/
-#define OC_MODE_GOLDEN_MV (6)
+# define OC_MODE_GOLDEN_MV (6)
/*Encoded difference from the previous frame offset by the individual motion
vectors given for each block.*/
-#define OC_MODE_INTER_MV_FOUR (7)
+# define OC_MODE_INTER_MV_FOUR (7)
/*The number of (coded) modes.*/
-#define OC_NMODES (8)
+# define OC_NMODES (8)
/*Determines the reference frame used for a given MB mode.*/
-#define OC_FRAME_FOR_MODE(_x) \
+# define OC_FRAME_FOR_MODE(_x) \
OC_UNIBBLE_TABLE32(OC_FRAME_PREV,OC_FRAME_SELF,OC_FRAME_PREV,OC_FRAME_PREV, \
OC_FRAME_PREV,OC_FRAME_GOLD,OC_FRAME_GOLD,OC_FRAME_PREV,(_x))
/*Constants for the packet state machine common between encoder and decoder.*/
/*Next packet to emit/read: Codec info header.*/
-#define OC_PACKET_INFO_HDR (-3)
+# define OC_PACKET_INFO_HDR (-3)
/*Next packet to emit/read: Comment header.*/
-#define OC_PACKET_COMMENT_HDR (-2)
+# define OC_PACKET_COMMENT_HDR (-2)
/*Next packet to emit/read: Codec setup header.*/
-#define OC_PACKET_SETUP_HDR (-1)
+# define OC_PACKET_SETUP_HDR (-1)
/*No more packets to emit/read.*/
-#define OC_PACKET_DONE (INT_MAX)
+# define OC_PACKET_DONE (INT_MAX)
@@ -443,30 +443,55 @@
int oc_state_loop_filter_init(oc_theora_state *_state,int *_bv);
void oc_state_loop_filter(oc_theora_state *_state,int _frame);
-#if defined(OC_DUMP_IMAGES)
+# if defined(OC_DUMP_IMAGES)
int oc_state_dump_frame(const oc_theora_state *_state,int _frame,
const char *_suf);
-#endif
+# endif
/*Shared accelerated functions.*/
-void oc_frag_copy(const oc_theora_state *_state,unsigned char *_dst,
- const unsigned char *_src,int _ystride);
-void oc_frag_recon_intra(const oc_theora_state *_state,
- unsigned char *_dst,int _dst_ystride,const ogg_int16_t _residue[64]);
-void oc_frag_recon_inter(const oc_theora_state *_state,unsigned char *_dst,
- const unsigned char *_src,int _ystride,const ogg_int16_t _residue[64]);
-void oc_frag_recon_inter2(const oc_theora_state *_state,
- unsigned char *_dst,const unsigned char *_src1,const unsigned char *_src2,
- int _ystride,const ogg_int16_t _residue[64]);
-void oc_idct8x8(const oc_theora_state *_state,ogg_int16_t _y[64],int _last_zzi);
-void oc_state_frag_recon(const oc_theora_state *_state,ptrdiff_t _fragi,
- int _pli,ogg_int16_t _dct_coeffs[64],int _last_zzi,ogg_uint16_t _dc_quant);
-void oc_state_frag_copy_list(const oc_theora_state *_state,
- const ptrdiff_t *_fragis,ptrdiff_t _nfragis,
- int _dst_frame,int _src_frame,int _pli);
-void oc_state_loop_filter_frag_rows(const oc_theora_state *_state,
- int _bv[256],int _refi,int _pli,int _fragy0,int _fragy_end);
-void oc_restore_fpu(const oc_theora_state *_state);
+# if !defined(oc_frag_copy)
+# define oc_frag_copy(_state,_dst,_src,_ystride) \
+ ((*(_state)->opt_vtable.frag_copy)(_dst,_src,_ystride))
+# endif
+# if !defined(oc_frag_recon_intra)
+# define oc_frag_recon_intra(_state,_dst,_dst_ystride,_residue) \
+ ((*(_state)->opt_vtable.frag_recon_intra)(_dst,_dst_ystride,_residue))
+# endif
+# if !defined(oc_frag_recon_inter)
+# define oc_frag_recon_inter(_state,_dst,_src,_ystride,_residue) \
+ ((*(_state)->opt_vtable.frag_recon_inter)(_dst,_src,_ystride,_residue))
+# endif
+# if !defined(oc_frag_recon_inter2)
+# define oc_frag_recon_inter2(_state,_dst,_src1,_src2,_ystride,_residue) \
+ ((*(_state)->opt_vtable.frag_recon_inter2)(_dst, \
+ _src1,_src2,_ystride,_residue))
+# endif
+# if !defined(oc_idct8x8)
+# define oc_idct8x8(_state,_y,_last_zzi) \
+ ((*(_state)->opt_vtable.idct8x8)(_y,_last_zzi))
+# endif
+# if !defined(oc_state_frag_recon)
+# define oc_state_frag_recon(_state,_fragi, \
+ _pli,_dct_coeffs,_last_zzi,_dc_quant) \
+ ((*(_state)->opt_vtable.state_frag_recon)(_state,_fragi, \
+ _pli,_dct_coeffs,_last_zzi,_dc_quant))
+# endif
+# if !defined(oc_state_frag_copy_list)
+# define oc_state_frag_copy_list(_state,_fragis,_nfragis, \
+ _dst_frame,_src_frame,_pli) \
+ ((*(_state)->opt_vtable.state_frag_copy_list)(_state,_fragis,_nfragis, \
+ _dst_frame,_src_frame,_pli))
+# endif
+# if !defined(oc_state_loop_filter_frag_rows)
+# define oc_state_loop_filter_frag_rows(_state, \
+ _bv,_refi,_pli,_fragy0,_fragy_end) \
+ ((*(_state)->opt_vtable.state_loop_filter_frag_rows)(_state, \
+ _bv,_refi,_pli,_fragy0,_fragy_end))
+# endif
+# if !defined(oc_restore_fpu)
+# define oc_restore_fpu(_state) \
+ ((*(_state)->opt_vtable.restore_fpu)())
+# endif
/*Default pure-C implementations.*/
void oc_frag_copy_c(unsigned char *_dst,
Modified: experimental/derf/theora-ptalarbvorm/lib/state.c
===================================================================
--- experimental/derf/theora-ptalarbvorm/lib/state.c 2010-06-28 02:00:08 UTC (rev 17308)
+++ experimental/derf/theora-ptalarbvorm/lib/state.c 2010-06-28 05:43:49 UTC (rev 17309)
@@ -868,12 +868,6 @@
#endif
}
-void oc_state_frag_recon(const oc_theora_state *_state,ptrdiff_t _fragi,
- int _pli,ogg_int16_t _dct_coeffs[64],int _last_zzi,ogg_uint16_t _dc_quant){
- _state->opt_vtable.state_frag_recon(_state,_fragi,_pli,_dct_coeffs,
- _last_zzi,_dc_quant);
-}
-
void oc_state_frag_recon_c(const oc_theora_state *_state,ptrdiff_t _fragi,
int _pli,ogg_int16_t _dct_coeffs[64],int _last_zzi,ogg_uint16_t _dc_quant){
unsigned char *dst;
@@ -924,13 +918,6 @@
_dst_frame: The reference frame to copy to.
_src_frame: The reference frame to copy from.
_pli: The color plane the fragments lie in.*/
-void oc_state_frag_copy_list(const oc_theora_state *_state,
- const ptrdiff_t *_fragis,ptrdiff_t _nfragis,
- int _dst_frame,int _src_frame,int _pli){
- _state->opt_vtable.state_frag_copy_list(_state,_fragis,_nfragis,_dst_frame,
- _src_frame,_pli);
-}
-
void oc_state_frag_copy_list_c(const oc_theora_state *_state,
const ptrdiff_t *_fragis,ptrdiff_t _nfragis,
int _dst_frame,int _src_frame,int _pli){
@@ -1008,12 +995,6 @@
_pli: The color plane to filter.
_fragy0: The Y coordinate of the first fragment row to filter.
_fragy_end: The Y coordinate of the fragment row to stop filtering at.*/
-void oc_state_loop_filter_frag_rows(const oc_theora_state *_state,int _bv[256],
- int _refi,int _pli,int _fragy0,int _fragy_end){
- _state->opt_vtable.state_loop_filter_frag_rows(_state,_bv,_refi,_pli,
- _fragy0,_fragy_end);
-}
-
void oc_state_loop_filter_frag_rows_c(const oc_theora_state *_state,int *_bv,
int _refi,int _pli,int _fragy0,int _fragy_end){
const oc_fragment_plane *fplane;
More information about the commits
mailing list