Commit 1e84af52 authored by Luc Trudeau's avatar Luc Trudeau Committed by David Michael Barr

[CFL] CfL Initialization Simplification

The CfL context is now stored inside MACROBLOCKD instead of
MACROBLOCKD only storing a pointer to the CfL context.
The intent is to avoid race conditions as MACROBLOCKD is stored
inside ThreadData. This change also simplifies CfL Initialization.

Change-Id: I991503716b21fc9aca60caddb2008b8bff397e6d
parent 88c1c3f4
...@@ -713,7 +713,7 @@ typedef struct macroblockd { ...@@ -713,7 +713,7 @@ typedef struct macroblockd {
DECLARE_ALIGNED(16, uint8_t, seg_mask[2 * MAX_SB_SQUARE]); DECLARE_ALIGNED(16, uint8_t, seg_mask[2 * MAX_SB_SQUARE]);
#if CONFIG_CFL #if CONFIG_CFL
CFL_CTX *cfl; CFL_CTX cfl;
#endif #endif
#if CONFIG_JNT_COMP #if CONFIG_JNT_COMP
......
...@@ -75,7 +75,6 @@ static void cfl_subtract_averages(CFL_CTX *cfl, TX_SIZE tx_size) { ...@@ -75,7 +75,6 @@ static void cfl_subtract_averages(CFL_CTX *cfl, TX_SIZE tx_size) {
const int block_row_stride = MAX_SB_SIZE << tx_size_high_log2[tx_size]; const int block_row_stride = MAX_SB_SIZE << tx_size_high_log2[tx_size];
const int num_pel_log2 = const int num_pel_log2 =
(tx_size_high_log2[tx_size] + tx_size_wide_log2[tx_size]); (tx_size_high_log2[tx_size] + tx_size_wide_log2[tx_size]);
int16_t *pred_buf_q3 = cfl->pred_buf_q3; int16_t *pred_buf_q3 = cfl->pred_buf_q3;
cfl_pad(cfl, width, height); cfl_pad(cfl, width, height);
...@@ -147,7 +146,7 @@ static void cfl_build_prediction_hbd(const int16_t *pred_buf_q3, uint16_t *dst, ...@@ -147,7 +146,7 @@ static void cfl_build_prediction_hbd(const int16_t *pred_buf_q3, uint16_t *dst,
#endif // CONFIG_HIGHBITDEPTH #endif // CONFIG_HIGHBITDEPTH
static void cfl_compute_parameters(MACROBLOCKD *const xd, TX_SIZE tx_size) { static void cfl_compute_parameters(MACROBLOCKD *const xd, TX_SIZE tx_size) {
CFL_CTX *const cfl = xd->cfl; CFL_CTX *const cfl = &xd->cfl;
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi; MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
// Do not call cfl_compute_parameters multiple time on the same values. // Do not call cfl_compute_parameters multiple time on the same values.
...@@ -188,7 +187,7 @@ static void cfl_compute_parameters(MACROBLOCKD *const xd, TX_SIZE tx_size) { ...@@ -188,7 +187,7 @@ static void cfl_compute_parameters(MACROBLOCKD *const xd, TX_SIZE tx_size) {
void cfl_predict_block(MACROBLOCKD *const xd, uint8_t *dst, int dst_stride, void cfl_predict_block(MACROBLOCKD *const xd, uint8_t *dst, int dst_stride,
int row, int col, TX_SIZE tx_size, int plane) { int row, int col, TX_SIZE tx_size, int plane) {
CFL_CTX *const cfl = xd->cfl; CFL_CTX *const cfl = &xd->cfl;
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi; MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
if (!cfl->are_parameters_computed) cfl_compute_parameters(xd, tx_size); if (!cfl->are_parameters_computed) cfl_compute_parameters(xd, tx_size);
...@@ -462,7 +461,7 @@ static void sub8x8_set_val(CFL_CTX *cfl, int row, int col, TX_SIZE y_tx_size) { ...@@ -462,7 +461,7 @@ static void sub8x8_set_val(CFL_CTX *cfl, int row, int col, TX_SIZE y_tx_size) {
void cfl_store_tx(MACROBLOCKD *const xd, int row, int col, TX_SIZE tx_size, void cfl_store_tx(MACROBLOCKD *const xd, int row, int col, TX_SIZE tx_size,
BLOCK_SIZE bsize) { BLOCK_SIZE bsize) {
CFL_CTX *const cfl = xd->cfl; CFL_CTX *const cfl = &xd->cfl;
struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y]; struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y];
uint8_t *dst = uint8_t *dst =
&pd->dst.buf[(row * pd->dst.stride + col) << tx_size_wide_log2[0]]; &pd->dst.buf[(row * pd->dst.stride + col) << tx_size_wide_log2[0]];
...@@ -480,7 +479,7 @@ void cfl_store_tx(MACROBLOCKD *const xd, int row, int col, TX_SIZE tx_size, ...@@ -480,7 +479,7 @@ void cfl_store_tx(MACROBLOCKD *const xd, int row, int col, TX_SIZE tx_size,
} }
void cfl_store_block(MACROBLOCKD *const xd, BLOCK_SIZE bsize, TX_SIZE tx_size) { void cfl_store_block(MACROBLOCKD *const xd, BLOCK_SIZE bsize, TX_SIZE tx_size) {
CFL_CTX *const cfl = xd->cfl; CFL_CTX *const cfl = &xd->cfl;
struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y]; struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y];
int row = 0; int row = 0;
int col = 0; int col = 0;
......
...@@ -720,9 +720,6 @@ void cfl_init(CFL_CTX *cfl, AV1_COMMON *cm); ...@@ -720,9 +720,6 @@ void cfl_init(CFL_CTX *cfl, AV1_COMMON *cm);
#endif // CONFIG_CFL #endif // CONFIG_CFL
static INLINE void av1_init_macroblockd(AV1_COMMON *cm, MACROBLOCKD *xd, static INLINE void av1_init_macroblockd(AV1_COMMON *cm, MACROBLOCKD *xd,
#if CONFIG_CFL
CFL_CTX *cfl,
#endif
tran_low_t *dqcoeff) { tran_low_t *dqcoeff) {
for (int i = 0; i < MAX_MB_PLANE; ++i) { for (int i = 0; i < MAX_MB_PLANE; ++i) {
xd->plane[i].dqcoeff = dqcoeff; xd->plane[i].dqcoeff = dqcoeff;
...@@ -763,12 +760,11 @@ static INLINE void av1_init_macroblockd(AV1_COMMON *cm, MACROBLOCKD *xd, ...@@ -763,12 +760,11 @@ static INLINE void av1_init_macroblockd(AV1_COMMON *cm, MACROBLOCKD *xd,
xd->fc = cm->fc; xd->fc = cm->fc;
xd->above_seg_context = cm->above_seg_context; xd->above_seg_context = cm->above_seg_context;
xd->above_txfm_context = cm->above_txfm_context; xd->above_txfm_context = cm->above_txfm_context;
#if CONFIG_CFL
cfl_init(cfl, cm);
xd->cfl = cfl;
#endif
xd->mi_stride = cm->mi_stride; xd->mi_stride = cm->mi_stride;
xd->error_info = &cm->error; xd->error_info = &cm->error;
#if CONFIG_CFL
cfl_init(&xd->cfl, cm);
#endif
} }
static INLINE void set_skip_context(MACROBLOCKD *xd, int mi_row, int mi_col) { static INLINE void set_skip_context(MACROBLOCKD *xd, int mi_row, int mi_col) {
......
...@@ -219,7 +219,7 @@ static void predict_and_reconstruct_intra_block( ...@@ -219,7 +219,7 @@ static void predict_and_reconstruct_intra_block(
} }
} }
#if CONFIG_CFL #if CONFIG_CFL
if (plane == AOM_PLANE_Y && xd->cfl->store_y) { if (plane == AOM_PLANE_Y && xd->cfl.store_y) {
cfl_store_tx(xd, row, col, tx_size, mbmi->sb_type); cfl_store_tx(xd, row, col, tx_size, mbmi->sb_type);
} }
#endif // CONFIG_CFL #endif // CONFIG_CFL
...@@ -326,8 +326,8 @@ static void set_offsets(AV1_COMMON *const cm, MACROBLOCKD *const xd, ...@@ -326,8 +326,8 @@ static void set_offsets(AV1_COMMON *const cm, MACROBLOCKD *const xd,
xd->mi[0]->mbmi.mi_col = mi_col; xd->mi[0]->mbmi.mi_col = mi_col;
#endif #endif
#if CONFIG_CFL #if CONFIG_CFL
xd->cfl->mi_row = mi_row; xd->cfl.mi_row = mi_row;
xd->cfl->mi_col = mi_col; xd->cfl.mi_col = mi_col;
#endif #endif
assert(x_mis && y_mis); assert(x_mis && y_mis);
...@@ -398,7 +398,7 @@ static void decode_token_and_recon_block(AV1Decoder *const pbi, ...@@ -398,7 +398,7 @@ static void decode_token_and_recon_block(AV1Decoder *const pbi,
set_offsets(cm, xd, bsize, mi_row, mi_col, bw, bh, x_mis, y_mis); set_offsets(cm, xd, bsize, mi_row, mi_col, bw, bh, x_mis, y_mis);
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi; MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
#if CONFIG_CFL #if CONFIG_CFL
CFL_CTX *const cfl = xd->cfl; CFL_CTX *const cfl = &xd->cfl;
cfl->is_chroma_reference = is_chroma_reference( cfl->is_chroma_reference = is_chroma_reference(
mi_row, mi_col, bsize, cfl->subsampling_x, cfl->subsampling_y); mi_row, mi_col, bsize, cfl->subsampling_x, cfl->subsampling_y);
#endif // CONFIG_CFL #endif // CONFIG_CFL
...@@ -2234,11 +2234,7 @@ static const uint8_t *decode_tiles(AV1Decoder *pbi, const uint8_t *data, ...@@ -2234,11 +2234,7 @@ static const uint8_t *decode_tiles(AV1Decoder *pbi, const uint8_t *data,
td->bit_reader.accounting = NULL; td->bit_reader.accounting = NULL;
} }
#endif #endif
av1_init_macroblockd(cm, &td->xd, av1_init_macroblockd(cm, &td->xd, td->dqcoeff);
#if CONFIG_CFL
&td->cfl,
#endif
td->dqcoeff);
// Initialise the tile context from the frame context // Initialise the tile context from the frame context
td->tctx = *cm->fc; td->tctx = *cm->fc;
......
...@@ -1120,16 +1120,16 @@ static void read_intra_frame_mode_info(AV1_COMMON *const cm, ...@@ -1120,16 +1120,16 @@ static void read_intra_frame_mode_info(AV1_COMMON *const cm,
if (is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x, if (is_chroma_reference(mi_row, mi_col, bsize, xd->plane[1].subsampling_x,
xd->plane[1].subsampling_y)) { xd->plane[1].subsampling_y)) {
#if CONFIG_CFL #if CONFIG_CFL
xd->cfl->is_chroma_reference = 1; xd->cfl.is_chroma_reference = 1;
#endif // CONFIG_CFL #endif // CONFIG_CFL
mbmi->uv_mode = read_intra_mode_uv(ec_ctx, r, mbmi->mode); mbmi->uv_mode = read_intra_mode_uv(ec_ctx, r, mbmi->mode);
#if CONFIG_CFL #if CONFIG_CFL
if (mbmi->uv_mode == UV_CFL_PRED) { if (mbmi->uv_mode == UV_CFL_PRED) {
mbmi->cfl_alpha_idx = read_cfl_alphas(ec_ctx, r, &mbmi->cfl_alpha_signs); mbmi->cfl_alpha_idx = read_cfl_alphas(ec_ctx, r, &mbmi->cfl_alpha_signs);
xd->cfl->store_y = 1; xd->cfl.store_y = 1;
} else { } else {
xd->cfl->store_y = 0; xd->cfl.store_y = 0;
} }
#endif // CONFIG_CFL #endif // CONFIG_CFL
...@@ -1137,8 +1137,8 @@ static void read_intra_frame_mode_info(AV1_COMMON *const cm, ...@@ -1137,8 +1137,8 @@ static void read_intra_frame_mode_info(AV1_COMMON *const cm,
// Avoid decoding angle_info if there is is no chroma prediction // Avoid decoding angle_info if there is is no chroma prediction
mbmi->uv_mode = UV_DC_PRED; mbmi->uv_mode = UV_DC_PRED;
#if CONFIG_CFL #if CONFIG_CFL
xd->cfl->is_chroma_reference = 0; xd->cfl.is_chroma_reference = 0;
xd->cfl->store_y = 1; xd->cfl.store_y = 1;
#endif #endif
} }
...@@ -1489,9 +1489,9 @@ static void read_intra_block_mode_info(AV1_COMMON *const cm, const int mi_row, ...@@ -1489,9 +1489,9 @@ static void read_intra_block_mode_info(AV1_COMMON *const cm, const int mi_row,
if (mbmi->uv_mode == UV_CFL_PRED) { if (mbmi->uv_mode == UV_CFL_PRED) {
mbmi->cfl_alpha_idx = mbmi->cfl_alpha_idx =
read_cfl_alphas(xd->tile_ctx, r, &mbmi->cfl_alpha_signs); read_cfl_alphas(xd->tile_ctx, r, &mbmi->cfl_alpha_signs);
xd->cfl->store_y = 1; xd->cfl.store_y = 1;
} else { } else {
xd->cfl->store_y = 0; xd->cfl.store_y = 0;
} }
#endif // CONFIG_CFL #endif // CONFIG_CFL
...@@ -1499,8 +1499,8 @@ static void read_intra_block_mode_info(AV1_COMMON *const cm, const int mi_row, ...@@ -1499,8 +1499,8 @@ static void read_intra_block_mode_info(AV1_COMMON *const cm, const int mi_row,
// Avoid decoding angle_info if there is is no chroma prediction // Avoid decoding angle_info if there is is no chroma prediction
mbmi->uv_mode = UV_DC_PRED; mbmi->uv_mode = UV_DC_PRED;
#if CONFIG_CFL #if CONFIG_CFL
xd->cfl->is_chroma_reference = 0; xd->cfl.is_chroma_reference = 0;
xd->cfl->store_y = 1; xd->cfl.store_y = 1;
#endif #endif
} }
......
...@@ -39,9 +39,6 @@ typedef struct TileData { ...@@ -39,9 +39,6 @@ typedef struct TileData {
DECLARE_ALIGNED(16, MACROBLOCKD, xd); DECLARE_ALIGNED(16, MACROBLOCKD, xd);
/* dqcoeff are shared by all the planes. So planes must be decoded serially */ /* dqcoeff are shared by all the planes. So planes must be decoded serially */
DECLARE_ALIGNED(16, tran_low_t, dqcoeff[MAX_TX_SQUARE]); DECLARE_ALIGNED(16, tran_low_t, dqcoeff[MAX_TX_SQUARE]);
#if CONFIG_CFL
CFL_CTX cfl;
#endif
DECLARE_ALIGNED(16, FRAME_CONTEXT, tctx); DECLARE_ALIGNED(16, FRAME_CONTEXT, tctx);
DECLARE_ALIGNED(16, uint8_t, color_index_map[2][MAX_PALETTE_SQUARE]); DECLARE_ALIGNED(16, uint8_t, color_index_map[2][MAX_PALETTE_SQUARE]);
} TileData; } TileData;
......
...@@ -337,8 +337,8 @@ static void set_offsets(const AV1_COMP *const cpi, const TileInfo *const tile, ...@@ -337,8 +337,8 @@ static void set_offsets(const AV1_COMP *const cpi, const TileInfo *const tile,
mbmi = &xd->mi[0]->mbmi; mbmi = &xd->mi[0]->mbmi;
#if CONFIG_CFL #if CONFIG_CFL
xd->cfl->mi_row = mi_row; xd->cfl.mi_row = mi_row;
xd->cfl->mi_col = mi_col; xd->cfl.mi_col = mi_col;
#endif #endif
mbmi->segment_id = 0; mbmi->segment_id = 0;
...@@ -3615,9 +3615,7 @@ void av1_encode_tile(AV1_COMP *cpi, ThreadData *td, int tile_row, ...@@ -3615,9 +3615,7 @@ void av1_encode_tile(AV1_COMP *cpi, ThreadData *td, int tile_row,
td->mb.e_mbd.tile_ctx = &this_tile->tctx; td->mb.e_mbd.tile_ctx = &this_tile->tctx;
#if CONFIG_CFL #if CONFIG_CFL
MACROBLOCKD *const xd = &td->mb.e_mbd; cfl_init(&td->mb.e_mbd.cfl, cm);
xd->cfl = &this_tile->cfl;
cfl_init(xd->cfl, cm);
#endif #endif
#if CONFIG_LOOPFILTERING_ACROSS_TILES #if CONFIG_LOOPFILTERING_ACROSS_TILES
...@@ -4852,7 +4850,7 @@ static void encode_superblock(const AV1_COMP *const cpi, TileDataEnc *tile_data, ...@@ -4852,7 +4850,7 @@ static void encode_superblock(const AV1_COMP *const cpi, TileDataEnc *tile_data,
if (!is_inter) { if (!is_inter) {
#if CONFIG_CFL #if CONFIG_CFL
xd->cfl->store_y = 1; xd->cfl.store_y = 1;
#endif // CONFIG_CFL #endif // CONFIG_CFL
mbmi->skip = 1; mbmi->skip = 1;
for (int plane = 0; plane < num_planes; ++plane) { for (int plane = 0; plane < num_planes; ++plane) {
...@@ -4860,7 +4858,7 @@ static void encode_superblock(const AV1_COMP *const cpi, TileDataEnc *tile_data, ...@@ -4860,7 +4858,7 @@ static void encode_superblock(const AV1_COMP *const cpi, TileDataEnc *tile_data,
mi_row, mi_col); mi_row, mi_col);
} }
#if CONFIG_CFL #if CONFIG_CFL
xd->cfl->store_y = 0; xd->cfl.store_y = 0;
#endif // CONFIG_CFL #endif // CONFIG_CFL
if (!dry_run) { if (!dry_run) {
sum_intra_stats(td->counts, xd, mi, xd->above_mi, xd->left_mi, sum_intra_stats(td->counts, xd, mi, xd->above_mi, xd->left_mi,
...@@ -4998,7 +4996,7 @@ static void encode_superblock(const AV1_COMP *const cpi, TileDataEnc *tile_data, ...@@ -4998,7 +4996,7 @@ static void encode_superblock(const AV1_COMP *const cpi, TileDataEnc *tile_data,
set_txfm_ctxs(tx_size, xd->n8_w, xd->n8_h, (mbmi->skip || seg_skip), xd); set_txfm_ctxs(tx_size, xd->n8_w, xd->n8_h, (mbmi->skip || seg_skip), xd);
} }
#if CONFIG_CFL #if CONFIG_CFL
CFL_CTX *const cfl = xd->cfl; CFL_CTX *const cfl = &xd->cfl;
if (is_inter_block(mbmi) && if (is_inter_block(mbmi) &&
!is_chroma_reference(mi_row, mi_col, bsize, cfl->subsampling_x, !is_chroma_reference(mi_row, mi_col, bsize, cfl->subsampling_x,
cfl->subsampling_y)) { cfl->subsampling_y)) {
......
...@@ -941,7 +941,7 @@ void av1_encode_block_intra(int plane, int block, int blk_row, int blk_col, ...@@ -941,7 +941,7 @@ void av1_encode_block_intra(int plane, int block, int blk_row, int blk_col,
if (*eob) *(args->skip) = 0; if (*eob) *(args->skip) = 0;
#if CONFIG_CFL #if CONFIG_CFL
if (plane == AOM_PLANE_Y && xd->cfl->store_y) { if (plane == AOM_PLANE_Y && xd->cfl.store_y) {
cfl_store_tx(xd, blk_row, blk_col, tx_size, plane_bsize); cfl_store_tx(xd, blk_row, blk_col, tx_size, plane_bsize);
} }
#endif // CONFIG_CFL #endif // CONFIG_CFL
......
...@@ -111,10 +111,6 @@ FILE *kf_list; ...@@ -111,10 +111,6 @@ FILE *kf_list;
FILE *keyfile; FILE *keyfile;
#endif #endif
#if CONFIG_CFL
CFL_CTX NULL_CFL;
#endif
#if CONFIG_INTERNAL_STATS #if CONFIG_INTERNAL_STATS
typedef enum { Y, U, V, ALL } STAT_TYPE; typedef enum { Y, U, V, ALL } STAT_TYPE;
#endif // CONFIG_INTERNAL_STATS #endif // CONFIG_INTERNAL_STATS
...@@ -1037,11 +1033,7 @@ static void update_frame_size(AV1_COMP *cpi) { ...@@ -1037,11 +1033,7 @@ static void update_frame_size(AV1_COMP *cpi) {
av1_set_mb_mi(cm, cm->width, cm->height); av1_set_mb_mi(cm, cm->width, cm->height);
av1_init_context_buffers(cm); av1_init_context_buffers(cm);
av1_init_macroblockd(cm, xd, av1_init_macroblockd(cm, xd, NULL);
#if CONFIG_CFL
&NULL_CFL,
#endif
NULL);
memset(cpi->mbmi_ext_base, 0, memset(cpi->mbmi_ext_base, 0,
cm->mi_rows * cm->mi_cols * sizeof(*cpi->mbmi_ext_base)); cm->mi_rows * cm->mi_cols * sizeof(*cpi->mbmi_ext_base));
set_tile_info(cpi); set_tile_info(cpi);
......
...@@ -570,7 +570,7 @@ void av1_first_pass(AV1_COMP *cpi, const struct lookahead_entry *source) { ...@@ -570,7 +570,7 @@ void av1_first_pass(AV1_COMP *cpi, const struct lookahead_entry *source) {
#if CONFIG_CFL #if CONFIG_CFL
// Don't store luma on the fist pass since chroma is not computed // Don't store luma on the fist pass since chroma is not computed
xd->cfl->store_y = 0; xd->cfl.store_y = 0;
#endif // CONFIG_CFL #endif // CONFIG_CFL
av1_frame_init_quantizer(cpi); av1_frame_init_quantizer(cpi);
......
...@@ -2145,7 +2145,7 @@ static void block_rd_txfm(int plane, int block, int blk_row, int blk_col, ...@@ -2145,7 +2145,7 @@ static void block_rd_txfm(int plane, int block, int blk_row, int blk_col,
return; return;
} }
#if CONFIG_CFL #if CONFIG_CFL
if (plane == AOM_PLANE_Y && xd->cfl->store_y) { if (plane == AOM_PLANE_Y && xd->cfl.store_y) {
assert(!is_inter_block(mbmi) || plane_bsize < BLOCK_8X8); assert(!is_inter_block(mbmi) || plane_bsize < BLOCK_8X8);
cfl_store_tx(xd, blk_row, blk_col, tx_size, plane_bsize); cfl_store_tx(xd, blk_row, blk_col, tx_size, plane_bsize);
} }
...@@ -5418,7 +5418,7 @@ static int cfl_rd_pick_alpha(MACROBLOCK *const x, const AV1_COMP *const cpi, ...@@ -5418,7 +5418,7 @@ static int cfl_rd_pick_alpha(MACROBLOCK *const x, const AV1_COMP *const cpi,
mbmi->cfl_alpha_idx = ind; mbmi->cfl_alpha_idx = ind;
mbmi->cfl_alpha_signs = signs; mbmi->cfl_alpha_signs = signs;
#if CONFIG_DEBUG #if CONFIG_DEBUG
xd->cfl->rate = best_rate; xd->cfl.rate = best_rate;
#endif // CONFIG_DEBUG #endif // CONFIG_DEBUG
return best_rate_overhead; return best_rate_overhead;
} }
...@@ -5494,7 +5494,7 @@ static int64_t rd_pick_intra_sbuv_mode(const AV1_COMP *const cpi, MACROBLOCK *x, ...@@ -5494,7 +5494,7 @@ static int64_t rd_pick_intra_sbuv_mode(const AV1_COMP *const cpi, MACROBLOCK *x,
if (mode == UV_CFL_PRED) { if (mode == UV_CFL_PRED) {
this_rate += cfl_alpha_rate; this_rate += cfl_alpha_rate;
#if CONFIG_DEBUG #if CONFIG_DEBUG
assert(xd->cfl->rate == this_rate); assert(xd->cfl.rate == this_rate);
#endif // CONFIG_DEBUG #endif // CONFIG_DEBUG
} }
#endif #endif
...@@ -5562,15 +5562,15 @@ static void choose_intra_uv_mode(const AV1_COMP *const cpi, MACROBLOCK *const x, ...@@ -5562,15 +5562,15 @@ static void choose_intra_uv_mode(const AV1_COMP *const cpi, MACROBLOCK *const x,
#if CONFIG_CFL #if CONFIG_CFL
// Only store reconstructed luma when there's chroma RDO. When there's no // Only store reconstructed luma when there's chroma RDO. When there's no
// chroma RDO, the reconstructed luma will be stored in encode_superblock(). // chroma RDO, the reconstructed luma will be stored in encode_superblock().
xd->cfl->store_y = !x->skip_chroma_rd; xd->cfl.store_y = !x->skip_chroma_rd;
if (xd->cfl->store_y) { if (xd->cfl.store_y) {
// Perform one extra call to txfm_rd_in_plane(), with the values chosen // Perform one extra call to txfm_rd_in_plane(), with the values chosen
// during luma RDO, so we can store reconstructed luma values // during luma RDO, so we can store reconstructed luma values
RD_STATS this_rd_stats; RD_STATS this_rd_stats;
txfm_rd_in_plane(x, cpi, &this_rd_stats, INT64_MAX, AOM_PLANE_Y, txfm_rd_in_plane(x, cpi, &this_rd_stats, INT64_MAX, AOM_PLANE_Y,
mbmi->sb_type, mbmi->tx_size, mbmi->sb_type, mbmi->tx_size,
cpi->sf.use_fast_coef_costing); cpi->sf.use_fast_coef_costing);
xd->cfl->store_y = 0; xd->cfl.store_y = 0;
} }
#endif // CONFIG_CFL #endif // CONFIG_CFL
rd_pick_intra_sbuv_mode(cpi, x, rate_uv, rate_uv_tokenonly, dist_uv, skip_uv, rd_pick_intra_sbuv_mode(cpi, x, rate_uv, rate_uv_tokenonly, dist_uv, skip_uv,
...@@ -8686,15 +8686,15 @@ void av1_rd_pick_intra_mode_sb(const AV1_COMP *cpi, MACROBLOCK *x, ...@@ -8686,15 +8686,15 @@ void av1_rd_pick_intra_mode_sb(const AV1_COMP *cpi, MACROBLOCK *x,
#if CONFIG_CFL #if CONFIG_CFL
// Only store reconstructed luma when there's chroma RDO. When there's no // Only store reconstructed luma when there's chroma RDO. When there's no
// chroma RDO, the reconstructed luma will be stored in encode_superblock(). // chroma RDO, the reconstructed luma will be stored in encode_superblock().
xd->cfl->store_y = !x->skip_chroma_rd; xd->cfl.store_y = !x->skip_chroma_rd;
if (xd->cfl->store_y) { if (xd->cfl.store_y) {
// Perform one extra call to txfm_rd_in_plane(), with the values chosen // Perform one extra call to txfm_rd_in_plane(), with the values chosen
// during luma RDO, so we can store reconstructed luma values // during luma RDO, so we can store reconstructed luma values
RD_STATS this_rd_stats; RD_STATS this_rd_stats;
txfm_rd_in_plane(x, cpi, &this_rd_stats, INT64_MAX, AOM_PLANE_Y, txfm_rd_in_plane(x, cpi, &this_rd_stats, INT64_MAX, AOM_PLANE_Y,
mbmi->sb_type, mbmi->tx_size, mbmi->sb_type, mbmi->tx_size,
cpi->sf.use_fast_coef_costing); cpi->sf.use_fast_coef_costing);
xd->cfl->store_y = 0; xd->cfl.store_y = 0;
} }
#endif // CONFIG_CFL #endif // CONFIG_CFL
max_uv_tx_size = uv_txsize_lookup[bsize][mbmi->tx_size][pd[1].subsampling_x] max_uv_tx_size = uv_txsize_lookup[bsize][mbmi->tx_size][pd[1].subsampling_x]
......
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