summaryrefslogtreecommitdiff
path: root/libavcodec/bink.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-07-30 11:22:11 +0200
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-07-30 11:22:11 +0200
commit0e29c4f761575d60c764e56ed1d07b432eaf0262 (patch)
tree875d08087c3eb5a316ae6cd092af5b17c4d8f490 /libavcodec/bink.c
parentfaba79e0800ded6285e2cf75622fa42077e781f4 (diff)
Revert bink dequantization hack that is no longer necessary.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavcodec/bink.c')
-rw-r--r--libavcodec/bink.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index 534d63b5a6..6b58f7716b 100644
--- a/libavcodec/bink.c
+++ b/libavcodec/bink.c
@@ -572,22 +572,6 @@ static inline int binkb_get_value(BinkContext *c, int bundle_num)
return ret;
}
-static inline DCTELEM dequant(DCTELEM in, uint32_t quant, int dc)
-{
- /* Note: multiplication is unsigned but we want signed shift
- * otherwise clipping breaks.
- * TODO: The official decoder does not use clipping at all
- * but instead uses the full 32-bit result.
- * However clipping at least gets rid of the case that a
- * half-black half-white intra block gets black and white swapped
- * and should cause at most minor differences (except for DC). */
- int32_t res = in * quant;
- res >>= 11;
- if (!dc)
- res = av_clip_int16(res);
- return res;
-}
-
/**
* Read 8x8 block of DCT coefficients.
*
@@ -686,10 +670,10 @@ static int read_dct_coeffs(GetBitContext *gb, int32_t block[64], const uint8_t *
quant = quant_matrices[quant_idx];
- block[0] = dequant(block[0], quant[0], 1);
+ block[0] = (block[0] * quant[0]) >> 11;
for (i = 0; i < coef_count; i++) {
int idx = coef_idx[i];
- block[scan[idx]] = dequant(block[scan[idx]], quant[idx], 0);
+ block[scan[idx]] = (block[scan[idx]] * quant[idx]) >> 11;
}
return 0;