diff options
author | Måns Rullgård <mans@mansr.com> | 2010-06-22 23:12:48 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2010-06-22 23:12:48 +0000 |
commit | 8fbd4f51a8bf8ae56303d1c7a18bf357b606df61 (patch) | |
tree | 610d916dda31bc04e497492cceaabf7248813257 /libavcodec/vc1dsp.c | |
parent | 25d3445811bd75df1de726973de00d1ebfaf9ed4 (diff) | |
download | ffmpeg-8fbd4f51a8bf8ae56303d1c7a18bf357b606df61.tar.gz |
Improve some uses of ff_cropTbl with constant offset
Originally committed as revision 23728 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vc1dsp.c')
-rw-r--r-- | libavcodec/vc1dsp.c | 60 |
1 files changed, 32 insertions, 28 deletions
diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c index 47b69c8214..8634bef69b 100644 --- a/libavcodec/vc1dsp.c +++ b/libavcodec/vc1dsp.c @@ -182,18 +182,19 @@ static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, int linesize, DCTELEM *block) { int i; int dc = block[0]; - const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; + const uint8_t *cm; dc = (3 * dc + 1) >> 1; dc = (3 * dc + 16) >> 5; + cm = ff_cropTbl + MAX_NEG_CROP + dc; for(i = 0; i < 8; i++){ - dest[0] = cm[dest[0]+dc]; - dest[1] = cm[dest[1]+dc]; - dest[2] = cm[dest[2]+dc]; - dest[3] = cm[dest[3]+dc]; - dest[4] = cm[dest[4]+dc]; - dest[5] = cm[dest[5]+dc]; - dest[6] = cm[dest[6]+dc]; - dest[7] = cm[dest[7]+dc]; + dest[0] = cm[dest[0]]; + dest[1] = cm[dest[1]]; + dest[2] = cm[dest[2]]; + dest[3] = cm[dest[3]]; + dest[4] = cm[dest[4]]; + dest[5] = cm[dest[5]]; + dest[6] = cm[dest[6]]; + dest[7] = cm[dest[7]]; dest += linesize; } } @@ -273,18 +274,19 @@ static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, DCTELEM *block) { int i; int dc = block[0]; - const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; + const uint8_t *cm; dc = ( 3 * dc + 1) >> 1; dc = (17 * dc + 64) >> 7; + cm = ff_cropTbl + MAX_NEG_CROP + dc; for(i = 0; i < 4; i++){ - dest[0] = cm[dest[0]+dc]; - dest[1] = cm[dest[1]+dc]; - dest[2] = cm[dest[2]+dc]; - dest[3] = cm[dest[3]+dc]; - dest[4] = cm[dest[4]+dc]; - dest[5] = cm[dest[5]+dc]; - dest[6] = cm[dest[6]+dc]; - dest[7] = cm[dest[7]+dc]; + dest[0] = cm[dest[0]]; + dest[1] = cm[dest[1]]; + dest[2] = cm[dest[2]]; + dest[3] = cm[dest[3]]; + dest[4] = cm[dest[4]]; + dest[5] = cm[dest[5]]; + dest[6] = cm[dest[6]]; + dest[7] = cm[dest[7]]; dest += linesize; } } @@ -350,14 +352,15 @@ static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, int linesize, DCTELEM *block) { int i; int dc = block[0]; - const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; + const uint8_t *cm; dc = (17 * dc + 4) >> 3; dc = (12 * dc + 64) >> 7; + cm = ff_cropTbl + MAX_NEG_CROP + dc; for(i = 0; i < 8; i++){ - dest[0] = cm[dest[0]+dc]; - dest[1] = cm[dest[1]+dc]; - dest[2] = cm[dest[2]+dc]; - dest[3] = cm[dest[3]+dc]; + dest[0] = cm[dest[0]]; + dest[1] = cm[dest[1]]; + dest[2] = cm[dest[2]]; + dest[3] = cm[dest[3]]; dest += linesize; } } @@ -423,14 +426,15 @@ static void vc1_inv_trans_4x4_dc_c(uint8_t *dest, int linesize, DCTELEM *block) { int i; int dc = block[0]; - const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; + const uint8_t *cm; dc = (17 * dc + 4) >> 3; dc = (17 * dc + 64) >> 7; + cm = ff_cropTbl + MAX_NEG_CROP + dc; for(i = 0; i < 4; i++){ - dest[0] = cm[dest[0]+dc]; - dest[1] = cm[dest[1]+dc]; - dest[2] = cm[dest[2]+dc]; - dest[3] = cm[dest[3]+dc]; + dest[0] = cm[dest[0]]; + dest[1] = cm[dest[1]]; + dest[2] = cm[dest[2]]; + dest[3] = cm[dest[3]]; dest += linesize; } } |