From c71d6130974120d295ba1841056e8585302a16bc Mon Sep 17 00:00:00 2001 From: Angie Chiang Date: Tue, 24 Jan 2017 10:13:57 -0800 Subject: [PATCH] Fix bitstream error when entropy and adapt_scan on BUG=aomedia:310 Change-Id: I8e1a1c6d59e3d14ba132d2bbf4e203da26538bde --- av1/common/entropy.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/av1/common/entropy.c b/av1/common/entropy.c index 5056a8900..6ed3d94a0 100644 --- a/av1/common/entropy.c +++ b/av1/common/entropy.c @@ -4035,19 +4035,24 @@ void av1_adapt_coef_probs(AV1_COMMON *cm) { for (tx_size = 0; tx_size < TX_SIZES; tx_size++) adapt_coef_probs(cm, tx_size, count_sat, update_factor); +#if CONFIG_ENTROPY + if (cm->partial_prob_update == 0) +#endif + { #if CONFIG_ADAPT_SCAN - for (tx_size = 0; tx_size < TX_SIZES_ALL; ++tx_size) { + for (tx_size = 0; tx_size < TX_SIZES_ALL; ++tx_size) { #if !(CONFIG_VAR_TX || CONFIG_RECT_TX) - if (tx_size >= TX_SIZES) continue; + if (tx_size >= TX_SIZES) continue; #else - if (tx_size > TX_32X16) continue; + if (tx_size > TX_32X16) continue; #endif - for (tx_type = DCT_DCT; tx_type < TX_TYPES; ++tx_type) { - av1_update_scan_prob(cm, tx_size, tx_type, ADAPT_SCAN_UPDATE_RATE_16); - av1_update_scan_order_facade(cm, tx_size, tx_type); + for (tx_type = DCT_DCT; tx_type < TX_TYPES; ++tx_type) { + av1_update_scan_prob(cm, tx_size, tx_type, ADAPT_SCAN_UPDATE_RATE_16); + av1_update_scan_order_facade(cm, tx_size, tx_type); + } } - } #endif + } } #if CONFIG_ENTROPY