From 8fbd4f51a8bf8ae56303d1c7a18bf357b606df61 Mon Sep 17 00:00:00 2001 From: Måns Rullgård Date: Tue, 22 Jun 2010 23:12:48 +0000 Subject: Improve some uses of ff_cropTbl with constant offset Originally committed as revision 23728 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/h264idct.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libavcodec/h264idct.c') diff --git a/libavcodec/h264idct.c b/libavcodec/h264idct.c index da5c6a5182..31e072f984 100644 --- a/libavcodec/h264idct.c +++ b/libavcodec/h264idct.c @@ -143,24 +143,24 @@ void ff_h264_idct8_add_c(uint8_t *dst, DCTELEM *block, int stride){ // assumes all AC coefs are 0 void ff_h264_idct_dc_add_c(uint8_t *dst, DCTELEM *block, int stride){ int i, j; - uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; int dc = (block[0] + 32) >> 6; + uint8_t *cm = ff_cropTbl + MAX_NEG_CROP + dc; for( j = 0; j < 4; j++ ) { for( i = 0; i < 4; i++ ) - dst[i] = cm[ dst[i] + dc ]; + dst[i] = cm[ dst[i] ]; dst += stride; } } void ff_h264_idct8_dc_add_c(uint8_t *dst, DCTELEM *block, int stride){ int i, j; - uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; int dc = (block[0] + 32) >> 6; + uint8_t *cm = ff_cropTbl + MAX_NEG_CROP + dc; for( j = 0; j < 8; j++ ) { for( i = 0; i < 8; i++ ) - dst[i] = cm[ dst[i] + dc ]; + dst[i] = cm[ dst[i] ]; dst += stride; } } -- cgit v1.2.3