Commit 5c6744b5 authored by Sarah Parker's avatar Sarah Parker

Add cdfs and mask buffers for mrc-tx

These are not currently being used for anything so there is
no impact on performance.

Change-Id: Ida4e0afcc10bee665f8daa379314cd18b3a4ea28
parent cbf4fa13
...@@ -776,6 +776,10 @@ typedef struct macroblockd { ...@@ -776,6 +776,10 @@ 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]);
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SEGMENT #endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SEGMENT
#if CONFIG_MRC_TX
uint8_t *mrc_mask;
#endif // CONFIG_MRC_TX
#if CONFIG_CFL #if CONFIG_CFL
CFL_CTX *cfl; CFL_CTX *cfl;
#endif #endif
......
...@@ -3035,6 +3035,9 @@ void av1_average_tile_intra_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[], ...@@ -3035,6 +3035,9 @@ void av1_average_tile_intra_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[],
AVERAGE_TILE_CDFS(palette_uv_size_cdf) AVERAGE_TILE_CDFS(palette_uv_size_cdf)
AVERAGE_TILE_CDFS(palette_y_color_index_cdf) AVERAGE_TILE_CDFS(palette_y_color_index_cdf)
AVERAGE_TILE_CDFS(palette_uv_color_index_cdf) AVERAGE_TILE_CDFS(palette_uv_color_index_cdf)
#if CONFIG_MRC_TX
AVERAGE_TILE_CDFS(mrc_mask_intra_cdf)
#endif // CONFIG_MRC_TX
} }
void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc, void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc,
...@@ -3097,6 +3100,9 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc, ...@@ -3097,6 +3100,9 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc,
#endif #endif
#endif #endif
#endif #endif
#if CONFIG_MRC_TX
AVERAGE_TILE_CDFS(mrc_mask_inter_cdf)
#endif // CONFIG_MRC_TX
} }
#if CONFIG_PVQ #if CONFIG_PVQ
......
...@@ -1824,6 +1824,184 @@ const aom_cdf_prob default_palette_uv_color_index_cdf ...@@ -1824,6 +1824,184 @@ const aom_cdf_prob default_palette_uv_color_index_cdf
0 }, 0 },
} }
}; };
#if CONFIG_MRC_TX
// TODO(sarahparker) Tune these cdfs
const aom_cdf_prob default_mrc_mask_intra_cdf
[PALETTE_SIZES][PALETTE_COLOR_INDEX_CONTEXTS][CDF_SIZE(PALETTE_COLORS)] = {
{
{ AOM_ICDF(29568), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
{ AOM_ICDF(16384), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
{ AOM_ICDF(8832), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
{ AOM_ICDF(28672), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
{ AOM_ICDF(31872), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
},
{
{ AOM_ICDF(28032), AOM_ICDF(30326), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
{ AOM_ICDF(11647), AOM_ICDF(27405), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
{ AOM_ICDF(4352), AOM_ICDF(30659), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
{ AOM_ICDF(23552), AOM_ICDF(27800), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
{ AOM_ICDF(32256), AOM_ICDF(32504), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
},
{
{ AOM_ICDF(26112), AOM_ICDF(28374), AOM_ICDF(30039), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
{ AOM_ICDF(9472), AOM_ICDF(22576), AOM_ICDF(27712), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
{ AOM_ICDF(6656), AOM_ICDF(26138), AOM_ICDF(29608), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
{ AOM_ICDF(19328), AOM_ICDF(23791), AOM_ICDF(28946), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
{ AOM_ICDF(31744), AOM_ICDF(31984), AOM_ICDF(32336), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
},
{
{ AOM_ICDF(27904), AOM_ICDF(29215), AOM_ICDF(30075), AOM_ICDF(31190),
AOM_ICDF(32768), 0, 0, 0, 0 },
{ AOM_ICDF(9728), AOM_ICDF(22598), AOM_ICDF(26134), AOM_ICDF(29425),
AOM_ICDF(32768), 0, 0, 0, 0 },
{ AOM_ICDF(2688), AOM_ICDF(30066), AOM_ICDF(31058), AOM_ICDF(31933),
AOM_ICDF(32768), 0, 0, 0, 0 },
{ AOM_ICDF(22015), AOM_ICDF(25039), AOM_ICDF(27726), AOM_ICDF(29932),
AOM_ICDF(32768), 0, 0, 0, 0 },
{ AOM_ICDF(32383), AOM_ICDF(32482), AOM_ICDF(32554), AOM_ICDF(32660),
AOM_ICDF(32768), 0, 0, 0, 0 },
},
{
{ AOM_ICDF(24319), AOM_ICDF(26299), AOM_ICDF(27486), AOM_ICDF(28600),
AOM_ICDF(29804), AOM_ICDF(32768), 0, 0, 0 },
{ AOM_ICDF(7935), AOM_ICDF(18217), AOM_ICDF(21116), AOM_ICDF(25440),
AOM_ICDF(28589), AOM_ICDF(32768), 0, 0, 0 },
{ AOM_ICDF(6656), AOM_ICDF(25016), AOM_ICDF(27105), AOM_ICDF(28698),
AOM_ICDF(30399), AOM_ICDF(32768), 0, 0, 0 },
{ AOM_ICDF(19967), AOM_ICDF(24117), AOM_ICDF(26550), AOM_ICDF(28566),
AOM_ICDF(30224), AOM_ICDF(32768), 0, 0, 0 },
{ AOM_ICDF(31359), AOM_ICDF(31607), AOM_ICDF(31775), AOM_ICDF(31977),
AOM_ICDF(32258), AOM_ICDF(32768), 0, 0, 0 },
},
{
{ AOM_ICDF(26368), AOM_ICDF(27768), AOM_ICDF(28588), AOM_ICDF(29274),
AOM_ICDF(29997), AOM_ICDF(30917), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(8960), AOM_ICDF(18260), AOM_ICDF(20810), AOM_ICDF(23986),
AOM_ICDF(26627), AOM_ICDF(28882), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(7295), AOM_ICDF(24111), AOM_ICDF(25836), AOM_ICDF(27515),
AOM_ICDF(29033), AOM_ICDF(30769), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(22016), AOM_ICDF(25208), AOM_ICDF(27305), AOM_ICDF(28159),
AOM_ICDF(29221), AOM_ICDF(30274), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(31744), AOM_ICDF(31932), AOM_ICDF(32050), AOM_ICDF(32199),
AOM_ICDF(32335), AOM_ICDF(32521), AOM_ICDF(32768), 0, 0 },
},
{
{ AOM_ICDF(26624), AOM_ICDF(27872), AOM_ICDF(28599), AOM_ICDF(29153),
AOM_ICDF(29633), AOM_ICDF(30172), AOM_ICDF(30841), AOM_ICDF(32768),
0 },
{ AOM_ICDF(6655), AOM_ICDF(17569), AOM_ICDF(19587), AOM_ICDF(23345),
AOM_ICDF(25884), AOM_ICDF(28088), AOM_ICDF(29678), AOM_ICDF(32768),
0 },
{ AOM_ICDF(3584), AOM_ICDF(27296), AOM_ICDF(28429), AOM_ICDF(29158),
AOM_ICDF(30032), AOM_ICDF(30780), AOM_ICDF(31572), AOM_ICDF(32768),
0 },
{ AOM_ICDF(23551), AOM_ICDF(25855), AOM_ICDF(27070), AOM_ICDF(27893),
AOM_ICDF(28597), AOM_ICDF(29721), AOM_ICDF(30970), AOM_ICDF(32768),
0 },
{ AOM_ICDF(32128), AOM_ICDF(32173), AOM_ICDF(32245), AOM_ICDF(32337),
AOM_ICDF(32416), AOM_ICDF(32500), AOM_ICDF(32609), AOM_ICDF(32768),
0 },
},
};
const aom_cdf_prob default_mrc_mask_inter_cdf
[PALETTE_SIZES][PALETTE_COLOR_INDEX_CONTEXTS][CDF_SIZE(PALETTE_COLORS)] = {
{
{ AOM_ICDF(29568), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
{ AOM_ICDF(16384), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
{ AOM_ICDF(8832), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
{ AOM_ICDF(28672), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
{ AOM_ICDF(31872), AOM_ICDF(32768), 0, 0, 0, 0, 0, 0, 0 },
},
{
{ AOM_ICDF(28032), AOM_ICDF(30326), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
{ AOM_ICDF(11647), AOM_ICDF(27405), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
{ AOM_ICDF(4352), AOM_ICDF(30659), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
{ AOM_ICDF(23552), AOM_ICDF(27800), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
{ AOM_ICDF(32256), AOM_ICDF(32504), AOM_ICDF(32768), 0, 0, 0, 0, 0,
0 },
},
{
{ AOM_ICDF(26112), AOM_ICDF(28374), AOM_ICDF(30039), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
{ AOM_ICDF(9472), AOM_ICDF(22576), AOM_ICDF(27712), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
{ AOM_ICDF(6656), AOM_ICDF(26138), AOM_ICDF(29608), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
{ AOM_ICDF(19328), AOM_ICDF(23791), AOM_ICDF(28946), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
{ AOM_ICDF(31744), AOM_ICDF(31984), AOM_ICDF(32336), AOM_ICDF(32768),
0, 0, 0, 0, 0 },
},
{
{ AOM_ICDF(27904), AOM_ICDF(29215), AOM_ICDF(30075), AOM_ICDF(31190),
AOM_ICDF(32768), 0, 0, 0, 0 },
{ AOM_ICDF(9728), AOM_ICDF(22598), AOM_ICDF(26134), AOM_ICDF(29425),
AOM_ICDF(32768), 0, 0, 0, 0 },
{ AOM_ICDF(2688), AOM_ICDF(30066), AOM_ICDF(31058), AOM_ICDF(31933),
AOM_ICDF(32768), 0, 0, 0, 0 },
{ AOM_ICDF(22015), AOM_ICDF(25039), AOM_ICDF(27726), AOM_ICDF(29932),
AOM_ICDF(32768), 0, 0, 0, 0 },
{ AOM_ICDF(32383), AOM_ICDF(32482), AOM_ICDF(32554), AOM_ICDF(32660),
AOM_ICDF(32768), 0, 0, 0, 0 },
},
{
{ AOM_ICDF(24319), AOM_ICDF(26299), AOM_ICDF(27486), AOM_ICDF(28600),
AOM_ICDF(29804), AOM_ICDF(32768), 0, 0, 0 },
{ AOM_ICDF(7935), AOM_ICDF(18217), AOM_ICDF(21116), AOM_ICDF(25440),
AOM_ICDF(28589), AOM_ICDF(32768), 0, 0, 0 },
{ AOM_ICDF(6656), AOM_ICDF(25016), AOM_ICDF(27105), AOM_ICDF(28698),
AOM_ICDF(30399), AOM_ICDF(32768), 0, 0, 0 },
{ AOM_ICDF(19967), AOM_ICDF(24117), AOM_ICDF(26550), AOM_ICDF(28566),
AOM_ICDF(30224), AOM_ICDF(32768), 0, 0, 0 },
{ AOM_ICDF(31359), AOM_ICDF(31607), AOM_ICDF(31775), AOM_ICDF(31977),
AOM_ICDF(32258), AOM_ICDF(32768), 0, 0, 0 },
},
{
{ AOM_ICDF(26368), AOM_ICDF(27768), AOM_ICDF(28588), AOM_ICDF(29274),
AOM_ICDF(29997), AOM_ICDF(30917), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(8960), AOM_ICDF(18260), AOM_ICDF(20810), AOM_ICDF(23986),
AOM_ICDF(26627), AOM_ICDF(28882), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(7295), AOM_ICDF(24111), AOM_ICDF(25836), AOM_ICDF(27515),
AOM_ICDF(29033), AOM_ICDF(30769), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(22016), AOM_ICDF(25208), AOM_ICDF(27305), AOM_ICDF(28159),
AOM_ICDF(29221), AOM_ICDF(30274), AOM_ICDF(32768), 0, 0 },
{ AOM_ICDF(31744), AOM_ICDF(31932), AOM_ICDF(32050), AOM_ICDF(32199),
AOM_ICDF(32335), AOM_ICDF(32521), AOM_ICDF(32768), 0, 0 },
},
{
{ AOM_ICDF(26624), AOM_ICDF(27872), AOM_ICDF(28599), AOM_ICDF(29153),
AOM_ICDF(29633), AOM_ICDF(30172), AOM_ICDF(30841), AOM_ICDF(32768),
0 },
{ AOM_ICDF(6655), AOM_ICDF(17569), AOM_ICDF(19587), AOM_ICDF(23345),
AOM_ICDF(25884), AOM_ICDF(28088), AOM_ICDF(29678), AOM_ICDF(32768),
0 },
{ AOM_ICDF(3584), AOM_ICDF(27296), AOM_ICDF(28429), AOM_ICDF(29158),
AOM_ICDF(30032), AOM_ICDF(30780), AOM_ICDF(31572), AOM_ICDF(32768),
0 },
{ AOM_ICDF(23551), AOM_ICDF(25855), AOM_ICDF(27070), AOM_ICDF(27893),
AOM_ICDF(28597), AOM_ICDF(29721), AOM_ICDF(30970), AOM_ICDF(32768),
0 },
{ AOM_ICDF(32128), AOM_ICDF(32173), AOM_ICDF(32245), AOM_ICDF(32337),
AOM_ICDF(32416), AOM_ICDF(32500), AOM_ICDF(32609), AOM_ICDF(32768),
0 },
},
};
#endif // CONFIG_MRC_TX
#define MAX_COLOR_CONTEXT_HASH 8 #define MAX_COLOR_CONTEXT_HASH 8
// Negative values are invalid // Negative values are invalid
...@@ -4730,6 +4908,10 @@ static void init_mode_probs(FRAME_CONTEXT *fc) { ...@@ -4730,6 +4908,10 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_copy(fc->palette_uv_size_cdf, default_palette_uv_size_cdf); av1_copy(fc->palette_uv_size_cdf, default_palette_uv_size_cdf);
av1_copy(fc->palette_y_color_index_cdf, default_palette_y_color_index_cdf); av1_copy(fc->palette_y_color_index_cdf, default_palette_y_color_index_cdf);
av1_copy(fc->palette_uv_color_index_cdf, default_palette_uv_color_index_cdf); av1_copy(fc->palette_uv_color_index_cdf, default_palette_uv_color_index_cdf);
#if CONFIG_MRC_TX
av1_copy(fc->mrc_mask_inter_cdf, default_mrc_mask_inter_cdf);
av1_copy(fc->mrc_mask_intra_cdf, default_mrc_mask_intra_cdf);
#endif // CONFIG_MRC_TX
#if CONFIG_NEW_MULTISYMBOL #if CONFIG_NEW_MULTISYMBOL
av1_copy(fc->comp_inter_cdf, default_comp_inter_cdf); av1_copy(fc->comp_inter_cdf, default_comp_inter_cdf);
#endif // CONFIG_NEW_MULTISYMBOL #endif // CONFIG_NEW_MULTISYMBOL
......
...@@ -256,6 +256,12 @@ typedef struct frame_contexts { ...@@ -256,6 +256,12 @@ typedef struct frame_contexts {
aom_cdf_prob palette_uv_color_index_cdf[PALETTE_SIZES] aom_cdf_prob palette_uv_color_index_cdf[PALETTE_SIZES]
[PALETTE_COLOR_INDEX_CONTEXTS] [PALETTE_COLOR_INDEX_CONTEXTS]
[CDF_SIZE(PALETTE_COLORS)]; [CDF_SIZE(PALETTE_COLORS)];
#if CONFIG_MRC_TX
aom_cdf_prob mrc_mask_inter_cdf[PALETTE_SIZES][PALETTE_COLOR_INDEX_CONTEXTS]
[CDF_SIZE(PALETTE_COLORS)];
aom_cdf_prob mrc_mask_intra_cdf[PALETTE_SIZES][PALETTE_COLOR_INDEX_CONTEXTS]
[CDF_SIZE(PALETTE_COLORS)];
#endif // CONFIG_MRC_TX
#if CONFIG_NEW_MULTISYMBOL #if CONFIG_NEW_MULTISYMBOL
aom_cdf_prob comp_inter_cdf[COMP_INTER_CONTEXTS][CDF_SIZE(2)]; aom_cdf_prob comp_inter_cdf[COMP_INTER_CONTEXTS][CDF_SIZE(2)];
aom_cdf_prob single_ref_cdf[REF_CONTEXTS][SINGLE_REFS - 1][CDF_SIZE(2)]; aom_cdf_prob single_ref_cdf[REF_CONTEXTS][SINGLE_REFS - 1][CDF_SIZE(2)];
......
...@@ -3715,6 +3715,9 @@ static const uint8_t *decode_tiles(AV1Decoder *pbi, const uint8_t *data, ...@@ -3715,6 +3715,9 @@ static const uint8_t *decode_tiles(AV1Decoder *pbi, const uint8_t *data,
td->xd.plane[0].color_index_map = td->color_index_map[0]; td->xd.plane[0].color_index_map = td->color_index_map[0];
td->xd.plane[1].color_index_map = td->color_index_map[1]; td->xd.plane[1].color_index_map = td->color_index_map[1];
#if CONFIG_MRC_TX
td->xd.mrc_mask = td->mrc_mask;
#endif // CONFIG_MRC_TX
} }
} }
......
...@@ -55,6 +55,9 @@ typedef struct TileData { ...@@ -55,6 +55,9 @@ typedef struct TileData {
#endif #endif
DECLARE_ALIGNED(16, FRAME_CONTEXT, tctx); DECLARE_ALIGNED(16, FRAME_CONTEXT, tctx);
DECLARE_ALIGNED(16, uint8_t, color_index_map[2][MAX_SB_SQUARE]); DECLARE_ALIGNED(16, uint8_t, color_index_map[2][MAX_SB_SQUARE]);
#if CONFIG_MRC_TX
DECLARE_ALIGNED(16, uint8_t, mrc_mask[MAX_SB_SQUARE]);
#endif // CONFIG_MRC_TX
} TileData; } TileData;
typedef struct TileWorkerData { typedef struct TileWorkerData {
...@@ -73,6 +76,9 @@ typedef struct TileWorkerData { ...@@ -73,6 +76,9 @@ typedef struct TileWorkerData {
#endif #endif
FRAME_CONTEXT tctx; FRAME_CONTEXT tctx;
DECLARE_ALIGNED(16, uint8_t, color_index_map[2][MAX_SB_SQUARE]); DECLARE_ALIGNED(16, uint8_t, color_index_map[2][MAX_SB_SQUARE]);
#if CONFIG_MRC_TX
DECLARE_ALIGNED(16, uint8_t, mrc_mask[MAX_SB_SQUARE]);
#endif // CONFIG_MRC_TX
struct aom_internal_error_info error_info; struct aom_internal_error_info error_info;
} TileWorkerData; } TileWorkerData;
......
...@@ -228,6 +228,12 @@ struct macroblock { ...@@ -228,6 +228,12 @@ struct macroblock {
int partition_cost[PARTITION_CONTEXTS + CONFIG_UNPOISON_PARTITION_CTX] int partition_cost[PARTITION_CONTEXTS + CONFIG_UNPOISON_PARTITION_CTX]
[PARTITION_TYPES]; [PARTITION_TYPES];
#endif // CONFIG_EXT_PARTITION_TYPES #endif // CONFIG_EXT_PARTITION_TYPES
#if CONFIG_MRC_TX
int mrc_mask_inter_cost[PALETTE_SIZES][PALETTE_COLOR_INDEX_CONTEXTS]
[PALETTE_COLORS];
int mrc_mask_intra_cost[PALETTE_SIZES][PALETTE_COLOR_INDEX_CONTEXTS]
[PALETTE_COLORS];
#endif // CONFIG_MRC_TX
int palette_y_size_cost[PALETTE_BLOCK_SIZES][PALETTE_SIZES]; int palette_y_size_cost[PALETTE_BLOCK_SIZES][PALETTE_SIZES];
int palette_uv_size_cost[PALETTE_BLOCK_SIZES][PALETTE_SIZES]; int palette_uv_size_cost[PALETTE_BLOCK_SIZES][PALETTE_SIZES];
int palette_y_color_cost[PALETTE_SIZES][PALETTE_COLOR_INDEX_CONTEXTS] int palette_y_color_cost[PALETTE_SIZES][PALETTE_COLOR_INDEX_CONTEXTS]
......
...@@ -69,6 +69,10 @@ static void alloc_mode_context(AV1_COMMON *cm, int num_4x4_blk, ...@@ -69,6 +69,10 @@ static void alloc_mode_context(AV1_COMMON *cm, int num_4x4_blk,
cm, ctx->color_index_map[i], cm, ctx->color_index_map[i],
aom_memalign(32, num_pix * sizeof(*ctx->color_index_map[i]))); aom_memalign(32, num_pix * sizeof(*ctx->color_index_map[i])));
} }
#if CONFIG_MRC_TX
CHECK_MEM_ERROR(cm, ctx->mrc_mask,
aom_memalign(32, num_pix * sizeof(*ctx->mrc_mask)));
#endif // CONFIG_MRC_TX
} }
static void free_mode_context(PICK_MODE_CONTEXT *ctx) { static void free_mode_context(PICK_MODE_CONTEXT *ctx) {
...@@ -100,6 +104,10 @@ static void free_mode_context(PICK_MODE_CONTEXT *ctx) { ...@@ -100,6 +104,10 @@ static void free_mode_context(PICK_MODE_CONTEXT *ctx) {
aom_free(ctx->color_index_map[i]); aom_free(ctx->color_index_map[i]);
ctx->color_index_map[i] = 0; ctx->color_index_map[i] = 0;
} }
#if CONFIG_MRC_TX
aom_free(ctx->mrc_mask);
ctx->mrc_mask[i] = 0;
#endif // CONFIG_MRC_TX
} }
static void alloc_tree_contexts(AV1_COMMON *cm, PC_TREE *tree, static void alloc_tree_contexts(AV1_COMMON *cm, PC_TREE *tree,
......
...@@ -28,6 +28,9 @@ typedef struct { ...@@ -28,6 +28,9 @@ typedef struct {
MODE_INFO mic; MODE_INFO mic;
MB_MODE_INFO_EXT mbmi_ext; MB_MODE_INFO_EXT mbmi_ext;
uint8_t *color_index_map[2]; uint8_t *color_index_map[2];
#if CONFIG_MRC_TX
uint8_t *mrc_mask;
#endif // CONFIG_MRC_TX
#if CONFIG_VAR_TX #if CONFIG_VAR_TX
uint8_t *blk_skip[MAX_MB_PLANE]; uint8_t *blk_skip[MAX_MB_PLANE];
#endif #endif
......
...@@ -651,6 +651,9 @@ static void update_state(const AV1_COMP *const cpi, ThreadData *td, ...@@ -651,6 +651,9 @@ static void update_state(const AV1_COMP *const cpi, ThreadData *td,
#endif // CONFIG_LV_MAP #endif // CONFIG_LV_MAP
} }
for (i = 0; i < 2; ++i) pd[i].color_index_map = ctx->color_index_map[i]; for (i = 0; i < 2; ++i) pd[i].color_index_map = ctx->color_index_map[i];
#if CONFIG_MRC_TX
xd->mrc_mask = ctx->mrc_mask;
#endif // CONFIG_MRC_TX
// Restore the coding context of the MB to that that was in place // Restore the coding context of the MB to that that was in place
// when the mode was picked for it // when the mode was picked for it
for (y = 0; y < mi_height; y++) for (y = 0; y < mi_height; y++)
...@@ -1407,6 +1410,9 @@ static void rd_pick_sb_modes(const AV1_COMP *const cpi, TileDataEnc *tile_data, ...@@ -1407,6 +1410,9 @@ static void rd_pick_sb_modes(const AV1_COMP *const cpi, TileDataEnc *tile_data,
} }
for (i = 0; i < 2; ++i) pd[i].color_index_map = ctx->color_index_map[i]; for (i = 0; i < 2; ++i) pd[i].color_index_map = ctx->color_index_map[i];
#if CONFIG_MRC_TX
xd->mrc_mask = ctx->mrc_mask;
#endif // CONFIG_MRC_TX
ctx->skippable = 0; ctx->skippable = 0;
......
...@@ -132,6 +132,16 @@ void av1_fill_mode_rates(AV1_COMMON *const cm, MACROBLOCK *x, ...@@ -132,6 +132,16 @@ void av1_fill_mode_rates(AV1_COMMON *const cm, MACROBLOCK *x,
fc->palette_uv_color_index_cdf[i][j], NULL); fc->palette_uv_color_index_cdf[i][j], NULL);
} }
} }
#if CONFIG_MRC_TX
for (i = 0; i < PALETTE_SIZES; ++i) {
for (j = 0; j < PALETTE_COLOR_INDEX_CONTEXTS; ++j) {
av1_cost_tokens_from_cdf(x->mrc_mask_inter_cost[i][j],
fc->mrc_mask_inter_cdf[i][j], NULL);
av1_cost_tokens_from_cdf(x->mrc_mask_intra_cost[i][j],
fc->mrc_mask_intra_cdf[i][j], NULL);
}
}
#endif // CONFIG_MRC_TX
#if CONFIG_CFL #if CONFIG_CFL
int sign_cost[CFL_JOINT_SIGNS]; int sign_cost[CFL_JOINT_SIGNS];
......
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