diff options
author | Yaowu Xu <yaowu@google.com> | 2015-12-15 16:02:39 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-12-15 16:02:39 +0000 |
commit | 9232f69b2689e6d9781e058a1b75febddb430ca2 (patch) | |
tree | d45e02bd43d10a3348989410570f847da3e80d84 /vp10/encoder | |
parent | a5af49331dda0ed58305a66acd1d85887210af56 (diff) | |
parent | c7101830a6f1e58c5e441eb29cecbefdb6c5632a (diff) | |
download | libvpx-9232f69b2689e6d9781e058a1b75febddb430ca2.tar libvpx-9232f69b2689e6d9781e058a1b75febddb430ca2.tar.gz libvpx-9232f69b2689e6d9781e058a1b75febddb430ca2.tar.bz2 libvpx-9232f69b2689e6d9781e058a1b75febddb430ca2.zip |
Merge "Fix a enc/dec mismatch under CONFIG_MISC_FIXES"
Diffstat (limited to 'vp10/encoder')
-rw-r--r-- | vp10/encoder/bitstream.c | 23 | ||||
-rw-r--r-- | vp10/encoder/rdopt.c | 2 |
2 files changed, 13 insertions, 12 deletions
diff --git a/vp10/encoder/bitstream.c b/vp10/encoder/bitstream.c index 5f6d9d342..361ac9962 100644 --- a/vp10/encoder/bitstream.c +++ b/vp10/encoder/bitstream.c @@ -897,18 +897,17 @@ static void write_txfm_mode(TX_MODE mode, struct vpx_write_bit_buffer *wb) { if (mode != TX_MODE_SELECT) vpx_wb_write_literal(wb, mode, 2); } +#else +static void write_txfm_mode(TX_MODE mode, struct vpx_writer *wb) { + vpx_write_literal(wb, VPXMIN(mode, ALLOW_32X32), 2); + if (mode >= ALLOW_32X32) + vpx_write_bit(wb, mode == TX_MODE_SELECT); +} #endif + static void update_txfm_probs(VP10_COMMON *cm, vpx_writer *w, FRAME_COUNTS *counts) { -#if !CONFIG_MISC_FIXES - // Mode - vpx_write_literal(w, VPXMIN(cm->tx_mode, ALLOW_32X32), 2); - if (cm->tx_mode >= ALLOW_32X32) - vpx_write_bit(w, cm->tx_mode == TX_MODE_SELECT); - - // Probabilities -#endif if (cm->tx_mode == TX_MODE_SELECT) { int i, j; @@ -1261,7 +1260,7 @@ static void write_uncompressed_header(VP10_COMP *cpi, encode_quantization(cm, wb); encode_segmentation(cm, xd, wb); #if CONFIG_MISC_FIXES - if (!cm->seg.enabled && xd->lossless[0]) + if (xd->lossless[0]) cm->tx_mode = TX_4X4; else write_txfm_mode(cm->tx_mode, wb); @@ -1291,10 +1290,12 @@ static size_t write_compressed_header(VP10_COMP *cpi, uint8_t *data) { vpx_start_encode(&header_bc, data); #if !CONFIG_MISC_FIXES - if (cpi->td.mb.e_mbd.lossless[0]) + if (cpi->td.mb.e_mbd.lossless[0]) { cm->tx_mode = TX_4X4; - else + } else { + write_txfm_mode(cm->tx_mode, &header_bc); update_txfm_probs(cm, &header_bc, counts); + } #else update_txfm_probs(cm, &header_bc, counts); #endif diff --git a/vp10/encoder/rdopt.c b/vp10/encoder/rdopt.c index bba21716f..bbddc1d29 100644 --- a/vp10/encoder/rdopt.c +++ b/vp10/encoder/rdopt.c @@ -725,7 +725,7 @@ static void super_block_yrd(VP10_COMP *cpi, MACROBLOCK *x, int *rate, assert(bs == xd->mi[0]->mbmi.sb_type); - if (CONFIG_MISC_FIXES && xd->lossless[xd->mi[0]->mbmi.segment_id]) { + if (CONFIG_MISC_FIXES && xd->lossless[0]) { choose_smallest_tx_size(cpi, x, rate, distortion, skip, ret_sse, ref_best_rd, bs); } else if (cpi->sf.tx_size_search_method == USE_LARGESTALL || |