diff options
author | Michael Niedermayer | 2004-12-08 18:02:56 +0000 |
---|---|---|
committer | Michael Niedermayer | 2004-12-08 18:02:56 +0000 |
commit | 0fd6aea1f1cc1ceaf2da578ce22d53427ddc4047 (patch) | |
tree | bfdbeb798149ef065faef506b7cafdf58dc81548 /libavcodec/dsputil.c | |
parent | bbf18b21b76f61da7df206a3084cd34341de44d0 (diff) |
more flexible frame skip decission
Originally committed as revision 3743 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r-- | libavcodec/dsputil.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 1fc698a62f..e5e05921db 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -2891,6 +2891,9 @@ void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type){ case FF_CMP_DCT: cmp[i]= c->dct_sad[i]; break; + case FF_CMP_DCTMAX: + cmp[i]= c->dct_max[i]; + break; case FF_CMP_PSNR: cmp[i]= c->quant_psnr[i]; break; @@ -3114,6 +3117,23 @@ static int dct_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2 return sum; } +static int dct_max8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ + MpegEncContext * const s= (MpegEncContext *)c; + uint64_t __align8 aligned_temp[sizeof(DCTELEM)*64/8]; + DCTELEM * const temp= (DCTELEM*)aligned_temp; + int sum=0, i; + + assert(h==8); + + s->dsp.diff_pixels(temp, src1, src2, stride); + s->dsp.fdct(temp); + + for(i=0; i<64; i++) + sum= FFMAX(sum, ABS(temp[i])); + + return sum; +} + void simple_idct(DCTELEM *block); //FIXME static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ @@ -3343,6 +3363,7 @@ static int vsse16_c(/*MpegEncContext*/ void *c, uint8_t *s1, uint8_t *s2, int st WARPER8_16_SQ(hadamard8_diff8x8_c, hadamard8_diff16_c) WARPER8_16_SQ(hadamard8_intra8x8_c, hadamard8_intra16_c) WARPER8_16_SQ(dct_sad8x8_c, dct_sad16_c) +WARPER8_16_SQ(dct_max8x8_c, dct_max16_c) WARPER8_16_SQ(quant_psnr8x8_c, quant_psnr16_c) WARPER8_16_SQ(rd8x8_c, rd16_c) WARPER8_16_SQ(bit8x8_c, bit16_c) @@ -3599,6 +3620,7 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx) SET_CMP_FUNC(hadamard8_diff) c->hadamard8_diff[4]= hadamard8_intra16_c; SET_CMP_FUNC(dct_sad) + SET_CMP_FUNC(dct_max) c->sad[0]= pix_abs16_c; c->sad[1]= pix_abs8_c; c->sse[0]= sse16_c; |