Merge changes Ia37f170d,Ie3082db5 into nextgenv2
* changes: Record YUV planes' txfm block coeff cost in handle_inter_mode() Separate coefficient cost of U/V planes in write_modes_b()
This commit is contained in:
@@ -251,8 +251,7 @@ typedef struct {
|
|||||||
int current_q_index;
|
int current_q_index;
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_RD_DEBUG
|
#if CONFIG_RD_DEBUG
|
||||||
int64_t txb_cost_y;
|
int64_t txb_coeff_cost[MAX_MB_PLANE];
|
||||||
int64_t txb_cost_uv;
|
|
||||||
int mi_row;
|
int mi_row;
|
||||||
int mi_col;
|
int mi_col;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1756,8 +1756,7 @@ static void write_modes_b(AV1_COMP *cpi, const TileInfo *const tile,
|
|||||||
int plane;
|
int plane;
|
||||||
int bh, bw;
|
int bh, bw;
|
||||||
#if CONFIG_RD_DEBUG
|
#if CONFIG_RD_DEBUG
|
||||||
int64_t txb_cost_y = 0;
|
int64_t txb_coeff_cost[MAX_MB_PLANE] = { 0 };
|
||||||
int64_t txb_cost_uv = 0;
|
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_RANS
|
#if CONFIG_RANS
|
||||||
(void)tok;
|
(void)tok;
|
||||||
@@ -1903,10 +1902,7 @@ static void write_modes_b(AV1_COMP *cpi, const TileInfo *const tile,
|
|||||||
#endif // CONFIG_VAR_TX
|
#endif // CONFIG_VAR_TX
|
||||||
|
|
||||||
#if CONFIG_RD_DEBUG
|
#if CONFIG_RD_DEBUG
|
||||||
if (plane == 0)
|
txb_coeff_cost[plane] += token_stats.cost;
|
||||||
txb_cost_y += token_stats.cost;
|
|
||||||
else
|
|
||||||
txb_cost_uv += token_stats.cost;
|
|
||||||
#else
|
#else
|
||||||
(void)token_stats;
|
(void)token_stats;
|
||||||
#endif
|
#endif
|
||||||
@@ -1916,14 +1912,11 @@ static void write_modes_b(AV1_COMP *cpi, const TileInfo *const tile,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if CONFIG_RD_DEBUG
|
#if CONFIG_RD_DEBUG
|
||||||
if (m->mbmi.txb_cost_y != txb_cost_y) {
|
for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
|
||||||
dump_mode_info(m);
|
if (m->mbmi.txb_coeff_cost[plane] != txb_coeff_cost[plane]) {
|
||||||
assert(0);
|
dump_mode_info(m);
|
||||||
}
|
assert(0);
|
||||||
|
}
|
||||||
if (m->mbmi.txb_cost_uv != txb_cost_uv) {
|
|
||||||
dump_mode_info(m);
|
|
||||||
assert(0);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3417,6 +3417,10 @@ static void select_tx_type_yrd(const AV1_COMP *cpi, MACROBLOCK *x,
|
|||||||
for (idx = 0; idx < xd->n8_w; ++idx)
|
for (idx = 0; idx < xd->n8_w; ++idx)
|
||||||
mbmi->inter_tx_size[idy][idx] = best_tx_size[idy][idx];
|
mbmi->inter_tx_size[idy][idx] = best_tx_size[idy][idx];
|
||||||
mbmi->tx_size = best_tx;
|
mbmi->tx_size = best_tx;
|
||||||
|
#if CONFIG_RD_DEBUG
|
||||||
|
// record plane y's transform block coefficient cost
|
||||||
|
mbmi->txb_coeff_cost[0] = rd_stats->txb_coeff_cost[0];
|
||||||
|
#endif
|
||||||
memcpy(x->blk_skip[0], best_blk_skip, sizeof(best_blk_skip[0]) * n4);
|
memcpy(x->blk_skip[0], best_blk_skip, sizeof(best_blk_skip[0]) * n4);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3537,10 +3541,7 @@ static int inter_block_uvrd(const AV1_COMP *cpi, MACROBLOCK *x,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
rd_stats->rate += pn_rd_stats.rate;
|
av1_merge_rd_stats(rd_stats, &pn_rd_stats);
|
||||||
rd_stats->dist += pn_rd_stats.dist;
|
|
||||||
rd_stats->sse += pn_rd_stats.sse;
|
|
||||||
rd_stats->skip &= pn_rd_stats.skip;
|
|
||||||
|
|
||||||
this_rd =
|
this_rd =
|
||||||
AOMMIN(RDCOST(x->rdmult, x->rddiv, rd_stats->rate, rd_stats->dist),
|
AOMMIN(RDCOST(x->rdmult, x->rddiv, rd_stats->rate, rd_stats->dist),
|
||||||
@@ -7524,6 +7525,11 @@ static int64_t handle_inter_mode(
|
|||||||
#if CONFIG_VAR_TX
|
#if CONFIG_VAR_TX
|
||||||
is_cost_valid_uv =
|
is_cost_valid_uv =
|
||||||
inter_block_uvrd(cpi, x, &rd_stats_uv, bsize, ref_best_rd - rdcosty);
|
inter_block_uvrd(cpi, x, &rd_stats_uv, bsize, ref_best_rd - rdcosty);
|
||||||
|
#if CONFIG_RD_DEBUG
|
||||||
|
// record uv planes' transform block coefficient cost
|
||||||
|
mbmi->txb_coeff_cost[1] = rd_stats_uv.txb_coeff_cost[1];
|
||||||
|
mbmi->txb_coeff_cost[2] = rd_stats_uv.txb_coeff_cost[2];
|
||||||
|
#endif
|
||||||
*rate_uv = rd_stats_uv.rate;
|
*rate_uv = rd_stats_uv.rate;
|
||||||
distortion_uv = rd_stats_uv.dist;
|
distortion_uv = rd_stats_uv.dist;
|
||||||
skippable_uv = rd_stats_uv.skip;
|
skippable_uv = rd_stats_uv.skip;
|
||||||
|
|||||||
Reference in New Issue
Block a user