Fix compile error of when TEST_OPTIMIZE_TXB is 1
Change-Id: I9ad1986d3f2332e81e80d687663ffd89e4efa1db
diff --git a/av1/encoder/encodetxb.c b/av1/encoder/encodetxb.c
index 577cf16..ac09fdd 100644
--- a/av1/encoder/encodetxb.c
+++ b/av1/encoder/encodetxb.c
@@ -1572,7 +1572,7 @@
{ 1, 0 }, { 2, 0 }, { 0, 1 }, { 0, 2 }, { 1, 1 },
};
-static int try_level_down_ref(int coeff_idx, const TxbProbs *txb_probs,
+static int try_level_down_ref(int coeff_idx, const LV_MAP_COEFF_COST *txb_costs,
TxbInfo *txb_info,
int (*cost_map)[COST_MAP_SIZE]) {
if (cost_map) {
@@ -1591,7 +1591,7 @@
if (nb_scan_idx < txb_info->eob && nb_row >= 0 && nb_col >= 0 &&
nb_row < txb_info->stride && nb_col < txb_info->stride) {
tran_low_t nb_coeff = txb_info->qcoeff[nb_coeff_idx];
- int cost = get_coeff_cost(nb_coeff, nb_scan_idx, txb_info, txb_probs);
+ int cost = get_coeff_cost(nb_coeff, nb_scan_idx, txb_info, txb_costs);
if (cost_map)
cost_map[nb_row - row + COST_MAP_OFFSET]
[nb_col - col + COST_MAP_OFFSET] -= cost;
@@ -1608,7 +1608,7 @@
if (nb_scan_idx < txb_info->eob && nb_row >= 0 && nb_col >= 0 &&
nb_row < txb_info->stride && nb_col < txb_info->stride) {
tran_low_t nb_coeff = txb_info->qcoeff[nb_coeff_idx];
- int cost = get_coeff_cost(nb_coeff, nb_scan_idx, txb_info, txb_probs);
+ int cost = get_coeff_cost(nb_coeff, nb_scan_idx, txb_info, txb_costs);
if (cost_map)
cost_map[nb_row - row + COST_MAP_OFFSET]
[nb_col - col + COST_MAP_OFFSET] += cost;
@@ -1620,13 +1620,14 @@
}
static void test_level_down(int coeff_idx, const TxbCache *txb_cache,
- const TxbProbs *txb_probs, TxbInfo *txb_info) {
+ const LV_MAP_COEFF_COST *txb_costs,
+ TxbInfo *txb_info) {
int cost_map[COST_MAP_SIZE][COST_MAP_SIZE];
int ref_cost_map[COST_MAP_SIZE][COST_MAP_SIZE];
const int cost_diff =
- try_level_down(coeff_idx, txb_cache, txb_probs, txb_info, cost_map);
+ try_level_down(coeff_idx, txb_cache, txb_costs, txb_info, cost_map, 0);
const int cost_diff_ref =
- try_level_down_ref(coeff_idx, txb_probs, txb_info, ref_cost_map);
+ try_level_down_ref(coeff_idx, txb_costs, txb_info, ref_cost_map);
if (cost_diff != cost_diff_ref) {
printf("qc %d cost_diff %d cost_diff_ref %d\n", txb_info->qcoeff[coeff_idx],
cost_diff, cost_diff_ref);
@@ -1659,7 +1660,7 @@
}
#if TEST_OPTIMIZE_TXB
-void test_try_change_eob(TxbInfo *txb_info, TxbProbs *txb_probs,
+void test_try_change_eob(TxbInfo *txb_info, const LV_MAP_COEFF_COST *txb_costs,
TxbCache *txb_cache) {
int eob = txb_info->eob;
const int16_t *scan = txb_info->scan_order->scan;
@@ -1670,13 +1671,13 @@
if (abs(last_coeff) == 1) {
int new_eob;
int cost_diff =
- try_change_eob(&new_eob, last_ci, txb_cache, txb_probs, txb_info, 0);
+ try_change_eob(&new_eob, last_ci, txb_cache, txb_costs, txb_info, 0);
int org_eob = txb_info->eob;
- int cost = get_txb_cost(txb_info, txb_probs);
+ int cost = get_txb_cost(txb_info, txb_costs);
txb_info->qcoeff[last_ci] = get_lower_coeff(last_coeff);
set_eob(txb_info, new_eob);
- int new_cost = get_txb_cost(txb_info, txb_probs);
+ int new_cost = get_txb_cost(txb_info, txb_costs);
set_eob(txb_info, org_eob);
txb_info->qcoeff[last_ci] = last_coeff;
@@ -1740,7 +1741,7 @@
stats->cost_diff = try_level_down(coeff_idx, txb_cache, txb_costs, txb_info,
NULL, fast_mode);
#if TEST_OPTIMIZE_TXB
- test_level_down(coeff_idx, txb_cache, txb_probs, txb_info);
+ test_level_down(coeff_idx, txb_cache, txb_costs, txb_info);
#endif
}
stats->rd_diff = RDCOST(txb_info->rdmult, stats->cost_diff, stats->dist_diff);
@@ -1762,7 +1763,7 @@
int64_t org_dist =
av1_block_error_c(txb_info->tcoeff, txb_info->dqcoeff, max_eob, &sse) *
(1 << (2 * txb_info->shift));
- int org_cost = get_txb_cost(txb_info, txb_probs);
+ int org_cost = get_txb_cost(txb_info, txb_costs);
#endif
tran_low_t *org_qcoeff = txb_info->qcoeff;
@@ -1832,7 +1833,7 @@
int64_t new_dist =
av1_block_error_c(txb_info->tcoeff, txb_info->dqcoeff, max_eob, &sse) *
(1 << (2 * txb_info->shift));
- int new_cost = get_txb_cost(txb_info, txb_probs);
+ int new_cost = get_txb_cost(txb_info, txb_costs);
int64_t ref_dist_diff = new_dist - org_dist;
int ref_cost_diff = new_cost - org_cost;
if (cost_diff != ref_cost_diff || dist_diff != ref_dist_diff)