Commit 8b53d315 authored by Angie Chiang's avatar Angie Chiang

Pass tx_type into get_nz_map_ctx_from_count

Change-Id: I87ac57ad0ff1dcf926596f63420827531c6fd04d
parent e9125bae
......@@ -276,7 +276,9 @@ static INLINE int get_nz_count(const tran_low_t *tcoeffs, int bwl, int height,
static INLINE int get_nz_map_ctx_from_count(int count,
const tran_low_t *tcoeffs,
int coeff_idx, // raster order
int bwl, const int16_t *iscan) {
int bwl, const int16_t *iscan,
TX_TYPE tx_type) {
(void)tx_type;
const int row = coeff_idx >> bwl;
const int col = coeff_idx - (row << bwl);
int ctx = 0;
......@@ -327,11 +329,11 @@ static INLINE int get_nz_map_ctx(const tran_low_t *tcoeffs,
const int coeff_idx, // raster order
const int bwl, const int height,
const int16_t *iscan, TX_TYPE tx_type) {
(void)tx_type;
const int row = coeff_idx >> bwl;
const int col = coeff_idx - (row << bwl);
int count = get_nz_count(tcoeffs, bwl, height, row, col, iscan);
return get_nz_map_ctx_from_count(count, tcoeffs, coeff_idx, bwl, iscan);
return get_nz_map_ctx_from_count(count, tcoeffs, coeff_idx, bwl, iscan,
tx_type);
}
static INLINE int get_eob_ctx(const tran_low_t *tcoeffs,
......
......@@ -510,8 +510,8 @@ void gen_txb_cache(TxbCache *txb_cache, TxbInfo *txb_info) {
txb_cache->nz_count_arr[coeff_idx] =
get_nz_count(qcoeff, bwl, height, row, col, iscan);
const int nz_count = txb_cache->nz_count_arr[coeff_idx];
txb_cache->nz_ctx_arr[coeff_idx] =
get_nz_map_ctx_from_count(nz_count, qcoeff, coeff_idx, bwl, iscan);
txb_cache->nz_ctx_arr[coeff_idx] = get_nz_map_ctx_from_count(
nz_count, qcoeff, coeff_idx, bwl, iscan, txb_info->tx_type);
// gen_base_count_mag_arr
if (!has_base(qcoeff[coeff_idx], 0)) continue;
......@@ -717,8 +717,9 @@ static int try_neighbor_level_down_nz(int coeff_idx, int nb_coeff_idx,
const int count = txb_cache->nz_count_arr[coeff_idx];
assert(count > 0);
txb_info->qcoeff[nb_coeff_idx] = get_lower_coeff(nb_coeff);
const int new_ctx = get_nz_map_ctx_from_count(
count - 1, txb_info->qcoeff, coeff_idx, txb_info->bwl, iscan);
const int new_ctx =
get_nz_map_ctx_from_count(count - 1, txb_info->qcoeff, coeff_idx,
txb_info->bwl, iscan, txb_info->tx_type);
txb_info->qcoeff[nb_coeff_idx] = nb_coeff;
const int ctx = txb_cache->nz_ctx_arr[coeff_idx];
const int is_nz = abs_qc > 0;
......@@ -1023,8 +1024,9 @@ void update_level_down(int coeff_idx, TxbCache *txb_cache, TxbInfo *txb_info) {
assert(txb_cache->nz_count_arr[nb_coeff_idx] >= 0);
}
const int count = txb_cache->nz_count_arr[nb_coeff_idx];
txb_cache->nz_ctx_arr[nb_coeff_idx] = get_nz_map_ctx_from_count(
count, txb_info->qcoeff, nb_coeff_idx, txb_info->bwl, iscan);
txb_cache->nz_ctx_arr[nb_coeff_idx] =
get_nz_map_ctx_from_count(count, txb_info->qcoeff, nb_coeff_idx,
txb_info->bwl, iscan, txb_info->tx_type);
// int ref_ctx = get_nz_map_ctx(txb_info->qcoeff, nb_coeff_idx,
// txb_info->bwl, iscan, tx_type);
// if (ref_ctx != txb_cache->nz_ctx_arr[nb_coeff_idx])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment