From 18b6a69ce9fcbd12476cfbe8ca9cd7e148dc21c5 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Wed, 4 May 2011 07:35:30 -0400 Subject: Revert "VC1: merge idct8x8, coeff adjustments and put_pixels." This reverts commit f8bed30d8b176fa030f6737765338bb4a2bcabc9. The reason for this is that the overlap filter, which runs after IDCT, should run on unclamped values, and thus IDCT and put_pixels() cannot be merged if we want to attempt to be bitexact. --- libavcodec/vc1dsp.c | 54 ++++++++++------------------------------------------- 1 file changed, 10 insertions(+), 44 deletions(-) (limited to 'libavcodec/vc1dsp.c') diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c index 3d02db7bcc..e1315533c4 100644 --- a/libavcodec/vc1dsp.c +++ b/libavcodec/vc1dsp.c @@ -199,7 +199,7 @@ static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, int linesize, DCTELEM *block) } } -static av_always_inline void vc1_inv_trans_8x8_c(DCTELEM block[64], int shl, int sub) +static void vc1_inv_trans_8x8_c(DCTELEM block[64]) { int i; register int t1,t2,t3,t4,t5,t6,t7,t8; @@ -254,50 +254,20 @@ static av_always_inline void vc1_inv_trans_8x8_c(DCTELEM block[64], int shl, int t3 = 9 * src[ 8] - 16 * src[24] + 4 * src[40] + 15 * src[56]; t4 = 4 * src[ 8] - 9 * src[24] + 15 * src[40] - 16 * src[56]; - dst[ 0] = (((t5 + t1 ) >> 7) - sub) << shl; - dst[ 8] = (((t6 + t2 ) >> 7) - sub) << shl; - dst[16] = (((t7 + t3 ) >> 7) - sub) << shl; - dst[24] = (((t8 + t4 ) >> 7) - sub) << shl; - dst[32] = (((t8 - t4 + 1) >> 7) - sub) << shl; - dst[40] = (((t7 - t3 + 1) >> 7) - sub) << shl; - dst[48] = (((t6 - t2 + 1) >> 7) - sub) << shl; - dst[56] = (((t5 - t1 + 1) >> 7) - sub) << shl; + dst[ 0] = (t5 + t1) >> 7; + dst[ 8] = (t6 + t2) >> 7; + dst[16] = (t7 + t3) >> 7; + dst[24] = (t8 + t4) >> 7; + dst[32] = (t8 - t4 + 1) >> 7; + dst[40] = (t7 - t3 + 1) >> 7; + dst[48] = (t6 - t2 + 1) >> 7; + dst[56] = (t5 - t1 + 1) >> 7; src++; dst++; } } -static void vc1_inv_trans_8x8_add_c(uint8_t *dest, int linesize, DCTELEM *block) -{ - vc1_inv_trans_8x8_c(block, 0, 0); - ff_add_pixels_clamped_c(block, dest, linesize); -} - -static void vc1_inv_trans_8x8_put_signed_c(uint8_t *dest, int linesize, DCTELEM *block) -{ - vc1_inv_trans_8x8_c(block, 0, 0); - ff_put_signed_pixels_clamped_c(block, dest, linesize); -} - -static void vc1_inv_trans_8x8_put_signed_rangered_c(uint8_t *dest, int linesize, DCTELEM *block) -{ - vc1_inv_trans_8x8_c(block, 1, 0); - ff_put_signed_pixels_clamped_c(block, dest, linesize); -} - -static void vc1_inv_trans_8x8_put_c(uint8_t *dest, int linesize, DCTELEM *block) -{ - vc1_inv_trans_8x8_c(block, 0, 0); - ff_put_pixels_clamped_c(block, dest, linesize); -} - -static void vc1_inv_trans_8x8_put_rangered_c(uint8_t *dest, int linesize, DCTELEM *block) -{ - vc1_inv_trans_8x8_c(block, 1, 64); - ff_put_pixels_clamped_c(block, dest, linesize); -} - /** Do inverse transform on 8x4 part of block */ static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, DCTELEM *block) @@ -692,11 +662,7 @@ static void avg_no_rnd_vc1_chroma_mc8_c(uint8_t *dst/*align 8*/, uint8_t *src/*a } av_cold void ff_vc1dsp_init(VC1DSPContext* dsp) { - dsp->vc1_inv_trans_8x8_add = vc1_inv_trans_8x8_add_c; - dsp->vc1_inv_trans_8x8_put_signed[0] = vc1_inv_trans_8x8_put_signed_c; - dsp->vc1_inv_trans_8x8_put_signed[1] = vc1_inv_trans_8x8_put_signed_rangered_c; - dsp->vc1_inv_trans_8x8_put[0] = vc1_inv_trans_8x8_put_c; - dsp->vc1_inv_trans_8x8_put[1] = vc1_inv_trans_8x8_put_rangered_c; + dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_c; dsp->vc1_inv_trans_4x8 = vc1_inv_trans_4x8_c; dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_c; dsp->vc1_inv_trans_4x4 = vc1_inv_trans_4x4_c; -- cgit v1.2.3