diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2004-08-22 17:16:03 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-08-22 17:16:03 +0000 |
commit | 26efc54e4a6811f29d07d875185190175cb513e6 (patch) | |
tree | ae92d157d94487dfdc2cee4ea3cbb7c1f99d1144 /libavcodec/dsputil.h | |
parent | c931e6086012d955e2fd0c896ff1fdb9099b4204 (diff) | |
download | ffmpeg-26efc54e4a6811f29d07d875185190175cb513e6.tar.gz |
4x4 SSE compare function
wavelet based compare functions
make epzs_motion_search() more flexible so it can be used for a wider range of block sizes
make get_penalty_factor() independant of MpegEncContext
Originally committed as revision 3410 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dsputil.h')
-rw-r--r-- | libavcodec/dsputil.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index 2ec3dc50c1..494c6f61c5 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -163,6 +163,8 @@ typedef struct DSPContext { me_cmp_func vsad[5]; me_cmp_func vsse[5]; me_cmp_func nsse[5]; + me_cmp_func w53[5]; + me_cmp_func w97[5]; me_cmp_func me_pre_cmp[5]; me_cmp_func me_cmp[5]; @@ -351,6 +353,29 @@ static inline uint32_t no_rnd_avg32(uint32_t a, uint32_t b) return (a & b) + (((a ^ b) & ~BYTE_VEC32(0x01)) >> 1); } +static inline int get_penalty_factor(int lambda, int lambda2, int type){ + switch(type&0xFF){ + default: + case FF_CMP_SAD: + return lambda>>FF_LAMBDA_SHIFT; + case FF_CMP_DCT: + return (3*lambda)>>(FF_LAMBDA_SHIFT+1); + case FF_CMP_W53: + return (4*lambda)>>(FF_LAMBDA_SHIFT); + case FF_CMP_W97: + return (2*lambda)>>(FF_LAMBDA_SHIFT); + case FF_CMP_SATD: + return (2*lambda)>>FF_LAMBDA_SHIFT; + case FF_CMP_RD: + case FF_CMP_PSNR: + case FF_CMP_SSE: + case FF_CMP_NSSE: + return lambda2>>FF_LAMBDA_SHIFT; + case FF_CMP_BIT: + return 1; + } +} + /** * Empty mmx state. * this must be called between any dsp function and float/double code. |