diff options
author | Jason Garrett-Glaser <darkshikari@gmail.com> | 2011-01-14 22:23:42 +0000 |
---|---|---|
committer | Jason Garrett-Glaser <darkshikari@gmail.com> | 2011-01-14 22:23:42 +0000 |
commit | 2e1866011591deab0fdeef23e0892589852a4a42 (patch) | |
tree | eec325401295a7b2e9ffb73c16d7a84492d66209 /libavcodec/svq3.c | |
parent | 0f27e6b4c2dddd7fc147a8df9d35b0fc7a23bd58 (diff) | |
download | ffmpeg-2e1866011591deab0fdeef23e0892589852a4a42.tar.gz |
Fix SVQ3
Regression in r26336-7.
Originally committed as revision 26341 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/svq3.c')
-rw-r--r-- | libavcodec/svq3.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 6d10fc5ae5..4a4a1c52cd 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -126,19 +126,21 @@ static const uint32_t svq3_dequant_coeff[32] = { }; -void ff_svq3_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qp) +void ff_svq3_luma_dc_dequant_idct_c(DCTELEM *block, int qp) { const int qmul = svq3_dequant_coeff[qp]; #define stride 16 int i; int temp[16]; static const int x_offset[4] = {0, 1*stride, 4* stride, 5*stride}; + static const int y_offset[4] = {0, 2*stride, 8* stride, 10*stride}; for (i = 0; i < 4; i++){ - const int z0= 13*(input[4*i+0] + input[4*i+1]); - const int z1= 13*(input[4*i+0] - input[4*i+1]); - const int z2= 7* input[4*i+2] - 17*input[4*i+3]; - const int z3= 17* input[4*i+2] + 7*input[4*i+3]; + const int offset = y_offset[i]; + const int z0 = 13*(block[offset+stride*0] + block[offset+stride*4]); + const int z1 = 13*(block[offset+stride*0] - block[offset+stride*4]); + const int z2 = 7* block[offset+stride*1] - 17*block[offset+stride*5]; + const int z3 = 17* block[offset+stride*1] + 7*block[offset+stride*5]; temp[4*i+0] = z0+z3; temp[4*i+1] = z1+z2; @@ -153,10 +155,10 @@ void ff_svq3_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qp) const int z2 = 7* temp[4*1+i] - 17*temp[4*3+i]; const int z3 = 17* temp[4*1+i] + 7*temp[4*3+i]; - output[stride*0 +offset] = ((z0 + z3)*qmul + 0x80000) >> 20; - output[stride*2 +offset] = ((z1 + z2)*qmul + 0x80000) >> 20; - output[stride*8 +offset] = ((z1 - z2)*qmul + 0x80000) >> 20; - output[stride*10+offset] = ((z0 - z3)*qmul + 0x80000) >> 20; + block[stride*0 +offset] = ((z0 + z3)*qmul + 0x80000) >> 20; + block[stride*2 +offset] = ((z1 + z2)*qmul + 0x80000) >> 20; + block[stride*8 +offset] = ((z1 - z2)*qmul + 0x80000) >> 20; + block[stride*10+offset] = ((z0 - z3)*qmul + 0x80000) >> 20; } } #undef stride |