From: Yaowu Xu Date: Wed, 16 Dec 2015 16:03:59 +0000 (-0800) Subject: Merge branch 'master' into nextgenv2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dab7515aa4860e201bde9e2c8406c4e15819b65b;p=libvpx Merge branch 'master' into nextgenv2 With a few manual fixes of merge conflicts. Change-Id: I0dd65ff90f9fa8606e5563f528659e2607b12376 --- dab7515aa4860e201bde9e2c8406c4e15819b65b diff --cc vp10/decoder/decodeframe.c index e93619f9a,31b9c7e49..7fed6d53c --- a/vp10/decoder/decodeframe.c +++ b/vp10/decoder/decodeframe.c @@@ -1218,13 -1140,11 +1218,11 @@@ static void setup_loopfilter(struct loo static INLINE int read_delta_q(struct vpx_read_bit_buffer *rb) { return vpx_rb_read_bit(rb) ? - vpx_rb_read_inv_signed_literal(rb, CONFIG_MISC_FIXES ? 6 : 4) : 0; + vpx_rb_read_inv_signed_literal(rb, 6) : 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); @@@ -2216,12 -2091,28 +2205,26 @@@ static size_t read_uncompressed_header( 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); - cm->tx_mode = (!cm->seg.enabled && xd->lossless[0]) ? ONLY_4X4 - : read_tx_mode(rb); -#if CONFIG_MISC_FIXES + cm->tx_mode = (xd->lossless[0]) ? ONLY_4X4 + : read_tx_mode(rb); cm->reference_mode = read_frame_reference_mode(cm, rb); -#endif setup_tile_info(cm, rb); sz = vpx_rb_read_literal(rb, 16); diff --cc vp10/encoder/bitstream.c index 1288e5028,361ac9962..434cc99f7 --- a/vp10/encoder/bitstream.c +++ b/vp10/encoder/bitstream.c @@@ -1400,9 -897,18 +1400,10 @@@ static void write_txfm_mode(TX_MODE mod 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 (cm->tx_mode == TX_MODE_SELECT) { int i, j; unsigned int ct_8x8p[TX_SIZES - 3][2]; @@@ -1750,7 -1259,8 +1751,7 @@@ static void write_uncompressed_header(V encode_loopfilter(&cm->lf, wb); encode_quantization(cm, wb); encode_segmentation(cm, xd, wb); - if (!cm->seg.enabled && xd->lossless[0]) -#if CONFIG_MISC_FIXES + if (xd->lossless[0]) cm->tx_mode = TX_4X4; else write_txfm_mode(cm->tx_mode, wb); diff --cc vp10/encoder/rdopt.c index 18e677953,bbddc1d29..c65021b4b --- a/vp10/encoder/rdopt.c +++ b/vp10/encoder/rdopt.c @@@ -1050,10 -725,11 +1050,10 @@@ static void super_block_yrd(VP10_COMP * assert(bs == xd->mi[0]->mbmi.sb_type); - if (xd->lossless[xd->mi[0]->mbmi.segment_id]) { - if (CONFIG_MISC_FIXES && xd->lossless[0]) { ++ if (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 || - xd->lossless[xd->mi[0]->mbmi.segment_id]) { + } else if (cpi->sf.tx_size_search_method == USE_LARGESTALL) { choose_largest_tx_size(cpi, x, rate, distortion, skip, ret_sse, ref_best_rd, bs); } else {