Commit e89ea0ce authored by Angie Chiang's avatar Angie Chiang Committed by Gerrit Code Review
Browse files

Merge "Refactor: Replace rate dist sse skip by RD_STATS in VAR_TX" into nextgenv2

parents 21378b8a b5dda488
......@@ -6180,11 +6180,12 @@ static void rd_supertx_sb(const AV1_COMP *const cpi, ThreadData *td,
ENTROPY_CONTEXT ctxl[2 * MAX_MIB_SIZE];
const struct macroblockd_plane *const pd = &xd->plane[plane];
int coeff_ctx = 1;
RD_STATS this_rd_stats;
this_rate = 0;
this_dist = 0;
pnsse = 0;
pnskip = 1;
this_rd_stats.rate = 0;
this_rd_stats.dist = 0;
this_rd_stats.sse = 0;
this_rd_stats.skip = 1;
tx_size = max_txsize_lookup[bsize];
tx_size =
......@@ -6194,8 +6195,13 @@ static void rd_supertx_sb(const AV1_COMP *const cpi, ThreadData *td,
av1_subtract_plane(x, bsize, plane);
av1_tx_block_rd_b(cpi, x, tx_size, 0, 0, plane, 0,
get_plane_block_size(bsize, pd), coeff_ctx, &this_rate,
&this_dist, &pnsse, &pnskip);
get_plane_block_size(bsize, pd), coeff_ctx,
&this_rd_stats);
this_rate = this_rd_stats.rate;
this_dist = this_rd_stats.dist;
pnsse = this_rd_stats.sse;
pnskip = this_rd_stats.skip;
#else
tx_size = max_txsize_lookup[bsize];
tx_size =
......@@ -6223,7 +6229,9 @@ static void rd_supertx_sb(const AV1_COMP *const cpi, ThreadData *td,
ENTROPY_CONTEXT ctxl[2 * MAX_MIB_SIZE];
const struct macroblockd_plane *const pd = &xd->plane[0];
int coeff_ctx = 1;
RD_STATS this_rd_stats;
#endif // CONFIG_VAR_TX
#if CONFIG_EXT_TX
if (!ext_tx_used_inter[ext_tx_set][tx_type]) continue;
#else
......@@ -6232,15 +6240,20 @@ static void rd_supertx_sb(const AV1_COMP *const cpi, ThreadData *td,
mbmi->tx_type = tx_type;
#if CONFIG_VAR_TX
this_rate = 0;
this_dist = 0;
pnsse = 0;
pnskip = 1;
this_rd_stats.rate = 0;
this_rd_stats.dist = 0;
this_rd_stats.sse = 0;
this_rd_stats.skip = 1;
av1_get_entropy_contexts(bsize, tx_size, pd, ctxa, ctxl);
coeff_ctx = combine_entropy_contexts(ctxa[0], ctxl[0]);
av1_tx_block_rd_b(cpi, x, tx_size, 0, 0, 0, 0, bsize, coeff_ctx, &this_rate,
&this_dist, &pnsse, &pnskip);
av1_tx_block_rd_b(cpi, x, tx_size, 0, 0, 0, 0, bsize, coeff_ctx,
&this_rd_stats);
this_rate = this_rd_stats.rate;
this_dist = this_rd_stats.dist;
pnsse = this_rd_stats.sse;
pnskip = this_rd_stats.skip;
#else
av1_txfm_rd_in_plane_supertx(x, cpi, &this_rate, &this_dist, &pnskip,
&pnsse, INT64_MAX, 0, bsize, tx_size, 0);
......
This diff is collapsed.
......@@ -26,6 +26,16 @@ struct AV1_COMP;
struct macroblock;
struct RD_COST;
#if CONFIG_VAR_TX
// TODO(angiebird): Merge RD_COST and RD_STATS
typedef struct RD_STATS {
int rate;
int64_t dist;
int64_t sse;
int skip;
} RD_STATS;
#endif
int av1_cost_coeffs(const AV1_COMMON *const cm, MACROBLOCK *x, int plane,
int block, int coeff_ctx, TX_SIZE tx_size,
const int16_t *scan, const int16_t *nb,
......@@ -77,8 +87,7 @@ void av1_rd_pick_inter_mode_sub8x8(const struct AV1_COMP *cpi,
#if CONFIG_VAR_TX
void av1_tx_block_rd_b(const AV1_COMP *cpi, MACROBLOCK *x, TX_SIZE tx_size,
int blk_row, int blk_col, int plane, int block,
int plane_bsize, int coeff_ctx, int *rate, int64_t *dist,
int64_t *bsse, int *skip);
int plane_bsize, int coeff_ctx, RD_STATS *rd_stats);
#endif
void av1_txfm_rd_in_plane_supertx(MACROBLOCK *x, const AV1_COMP *cpi, int *rate,
......
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