diff options
author | Yaowu Xu <yaowu@google.com> | 2011-11-10 12:54:22 -0800 |
---|---|---|
committer | Yaowu Xu <yaowu@google.com> | 2011-11-11 07:31:00 -0800 |
commit | 982b061dc2f39cb4a7505260a856ce870ba7ba1c (patch) | |
tree | f27ad2f3d695162c567407b80ac4d1fb05b29350 /vp8/encoder/quantize.c | |
parent | a0ed4e63802a395c6147b5abb70311f50b98d95e (diff) | |
download | libvpx-982b061dc2f39cb4a7505260a856ce870ba7ba1c.tar libvpx-982b061dc2f39cb4a7505260a856ce870ba7ba1c.tar.gz libvpx-982b061dc2f39cb4a7505260a856ce870ba7ba1c.tar.bz2 libvpx-982b061dc2f39cb4a7505260a856ce870ba7ba1c.zip |
Make 8x8 and extend_qrange to work together
This commit added scaling factors to 8x8 transform, quant, dequant and
inverse transform pipeline to make 8x8 transform to work when configed
with enable-extend_qrange. This commit also disabled the trellis-quant
when extend_qrange is configured.
Change-Id: Icfb3192e4746f70a4bb35ad18b7b47705b657e52
Diffstat (limited to 'vp8/encoder/quantize.c')
-rw-r--r-- | vp8/encoder/quantize.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/vp8/encoder/quantize.c b/vp8/encoder/quantize.c index e95fa60e6..8bbc0d0a5 100644 --- a/vp8/encoder/quantize.c +++ b/vp8/encoder/quantize.c @@ -458,6 +458,9 @@ void vp8_fast_quantize_b_2x2_c(BLOCK *b, BLOCKD *d) qcoeff_ptr[rc] = x; // write to destination //dqcoeff_ptr[rc] = x * dequant_ptr[rc] / q2nd; // dequantized value dqcoeff_ptr[rc] = x * dequant_ptr[rc]; // dequantized value +#if CONFIG_EXTEND_QRANGE + dqcoeff_ptr[rc] = (dqcoeff_ptr[rc]+2)>>2; +#endif if (y) { @@ -506,6 +509,12 @@ void vp8_fast_quantize_b_8x8_c(BLOCK *b, BLOCKD *d) qcoeff_ptr[rc] = x; // write to destination //dqcoeff_ptr[rc] = x * dequant_ptr[rc!=0] / q1st; // dequantized value dqcoeff_ptr[rc] = x * dequant_ptr[rc!=0]; // dequantized value + +#if CONFIG_EXTEND_QRANGE + dqcoeff_ptr[rc] = (dqcoeff_ptr[rc]+2)>>2; +#endif + + if (y) { eob = i; // last nonzero coeffs @@ -562,6 +571,11 @@ void vp8_regular_quantize_b_2x2(BLOCK *b, BLOCKD *d) //dqcoeff_ptr[rc] = x * dequant_ptr[rc]/q2nd; // dequantized value dqcoeff_ptr[rc] = x * dequant_ptr[rc]; // dequantized value +#if CONFIG_EXTEND_QRANGE + dqcoeff_ptr[rc] = (dqcoeff_ptr[rc]+2)>>2; +#endif + + if (y) { eob = i; // last nonzero coeffs @@ -620,6 +634,9 @@ void vp8_regular_quantize_b_8x8(BLOCK *b, BLOCKD *d) qcoeff_ptr[rc] = x; // write to destination //dqcoeff_ptr[rc] = x * dequant_ptr[rc!=0] / q1st; // dequantized value dqcoeff_ptr[rc] = x * dequant_ptr[rc!=0]; // dequantized value +#if CONFIG_EXTEND_QRANGE + dqcoeff_ptr[rc] = (dqcoeff_ptr[rc]+2)>>2; +#endif if (y) { |