[level map] cleanup and remove assertions Removed assertions were not properly set up and may cause decoding failure when USE_CASUAL_CTX is enabled. This CL does not change bitstream. Change-Id: Ib9193cbda32f342335a79aca39e9cc49204a0ec9
diff --git a/av1/decoder/decodetxb.c b/av1/decoder/decodetxb.c index 30330f0..aa5cda7 100644 --- a/av1/decoder/decodetxb.c +++ b/av1/decoder/decodetxb.c
@@ -160,7 +160,6 @@ c = *eob - 1 - i; int is_nz; int coeff_ctx = get_nz_map_ctx(levels, c, scan, bwl, height, tx_type, 1); - // int eob_ctx = get_eob_ctx(tcoeffs, scan[c], txs_ctx, tx_type); if (c < *eob - 1) { is_nz = av1_read_record_bin( @@ -180,16 +179,12 @@ int k; for (k = 0; k < NUM_BASE_LEVELS; ++k) { int ctx = coeff_ctx; -#if 0 // USE_CAUSAL_BASE_CTX read_coeffs - int is_k = av1_read_record_bit(counts, r, ACCT_STR); -#else int is_k = av1_read_record_bin( counts, r, ec_ctx->coeff_base_cdf[txs_ctx][plane_type][k][ctx], 2, ACCT_STR); if (counts) ++counts->coeff_base[txs_ctx][plane_type][k][ctx][is_k]; -#endif - // is_k = 1 if level > (k+1) + // semantic: is_k = 1 if level > (k+1) if (is_k == 0) { cul_level += k + 1; break;
diff --git a/av1/encoder/encodetxb.c b/av1/encoder/encodetxb.c index e715a54..dbb7d90 100644 --- a/av1/encoder/encodetxb.c +++ b/av1/encoder/encodetxb.c
@@ -318,7 +318,6 @@ for (int i = 0; i < eob; ++i) { c = eob - 1 - i; coeff_ctx = get_nz_map_ctx(tcoeff, c, scan, bwl, height, tx_type, 0); - if (c == eob - 1) assert(coeff_ctx == 0); tran_low_t v = tcoeff[scan[c]]; int is_nz = (v != 0); @@ -587,7 +586,6 @@ int level = abs(v); #if USE_CAUSAL_BASE_CTX coeff_ctx = get_nz_map_ctx(qcoeff, c, scan, bwl, height, tx_type, 0); - if (c == eob - 1) assert(coeff_ctx == 0); #endif if (c < eob - 1) { @@ -2018,7 +2016,6 @@ #if USE_CAUSAL_BASE_CTX coeff_ctx = get_nz_map_ctx(tcoeff, c, scan, bwl, height, tx_type, 0); - if (c == eob - 1) assert(coeff_ctx == 0); if (c < eob - 1) { ++(*nz_map_count)[coeff_ctx][is_nz]; update_cdf(ec_ctx->nz_map_cdf[txsize_ctx][plane_type][coeff_ctx], is_nz,