summaryrefslogtreecommitdiff
path: root/vp10/decoder
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2015-12-14 18:49:59 -0800
committerYaowu Xu <yaowu@google.com>2015-12-14 20:56:37 -0800
commitc7101830a6f1e58c5e441eb29cecbefdb6c5632a (patch)
tree720fc97a1518ba1ef6970580b7423e1708455825 /vp10/decoder
parent4d2cfeab361e013d225b7c6ab30d0420b2652e28 (diff)
downloadlibvpx-c7101830a6f1e58c5e441eb29cecbefdb6c5632a.tar
libvpx-c7101830a6f1e58c5e441eb29cecbefdb6c5632a.tar.gz
libvpx-c7101830a6f1e58c5e441eb29cecbefdb6c5632a.tar.bz2
libvpx-c7101830a6f1e58c5e441eb29cecbefdb6c5632a.zip
Fix a enc/dec mismatch under CONFIG_MISC_FIXES
The culprit is on the decode side xd->lossless[i] setup was in wrong location where segment features are not yet decoded. Also on the encoder side, transform mode was not set consistently between when tx_mode is selected and how tx_mode is enforced in tx size selection. Change-Id: I4c4c32188fda7530cadab9b46d4201f33f7ceca3
Diffstat (limited to 'vp10/decoder')
-rw-r--r--vp10/decoder/decodeframe.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/vp10/decoder/decodeframe.c b/vp10/decoder/decodeframe.c
index 70d012b27..31b9c7e49 100644
--- a/vp10/decoder/decodeframe.c
+++ b/vp10/decoder/decodeframe.c
@@ -1143,24 +1143,13 @@ static INLINE int read_delta_q(struct vpx_read_bit_buffer *rb) {
vpx_rb_read_inv_signed_literal(rb, CONFIG_MISC_FIXES ? 6 : 4) : 0;
}
-static void setup_quantization(VP10_COMMON *const cm, MACROBLOCKD *const xd,
+static void setup_quantization(VP10_COMMON *const cm,
struct vpx_read_bit_buffer *rb) {
- int i;
-
cm->base_qindex = vpx_rb_read_literal(rb, QINDEX_BITS);
cm->y_dc_delta_q = read_delta_q(rb);
cm->uv_dc_delta_q = read_delta_q(rb);
cm->uv_ac_delta_q = read_delta_q(rb);
cm->dequant_bit_depth = cm->bit_depth;
- for (i = 0; i < MAX_SEGMENTS; ++i) {
- const int qindex = CONFIG_MISC_FIXES && cm->seg.enabled ?
- vp10_get_qindex(&cm->seg, i, cm->base_qindex) :
- cm->base_qindex;
- xd->lossless[i] = qindex == 0 &&
- cm->y_dc_delta_q == 0 &&
- cm->uv_dc_delta_q == 0 &&
- cm->uv_ac_delta_q == 0;
- }
#if CONFIG_VP9_HIGHBITDEPTH
xd->bd = (int)cm->bit_depth;
@@ -1874,9 +1863,7 @@ static void read_bitdepth_colorspace_sampling(
static size_t read_uncompressed_header(VP10Decoder *pbi,
struct vpx_read_bit_buffer *rb) {
VP10_COMMON *const cm = &pbi->common;
-#if CONFIG_MISC_FIXES
MACROBLOCKD *const xd = &pbi->mb;
-#endif
BufferPool *const pool = cm->buffer_pool;
RefCntBuffer *const frame_bufs = pool->frame_bufs;
int i, mask, ref_index = 0;
@@ -2104,12 +2091,26 @@ static size_t read_uncompressed_header(VP10Decoder *pbi,
vp10_setup_past_independence(cm);
setup_loopfilter(&cm->lf, rb);
- setup_quantization(cm, &pbi->mb, rb);
+ setup_quantization(cm, rb);
setup_segmentation(cm, rb);
+
+ {
+ int i;
+ for (i = 0; i < MAX_SEGMENTS; ++i) {
+ const int qindex = CONFIG_MISC_FIXES && cm->seg.enabled ?
+ vp10_get_qindex(&cm->seg, i, cm->base_qindex) :
+ cm->base_qindex;
+ xd->lossless[i] = qindex == 0 &&
+ cm->y_dc_delta_q == 0 &&
+ cm->uv_dc_delta_q == 0 &&
+ cm->uv_ac_delta_q == 0;
+ }
+ }
+
setup_segmentation_dequant(cm);
#if CONFIG_MISC_FIXES
- cm->tx_mode = (!cm->seg.enabled && xd->lossless[0]) ? ONLY_4X4
- : read_tx_mode(rb);
+ cm->tx_mode = (xd->lossless[0]) ? ONLY_4X4
+ : read_tx_mode(rb);
cm->reference_mode = read_frame_reference_mode(cm, rb);
#endif