Commit ae5cfde1 authored by Jingning Han's avatar Jingning Han

Refactor to use block_size_wide/high[] consistently

Replace the computation of block size in pixels with lookup table
directly.

Change-Id: I39589b2bc1d20372969ff5ad0f60639e64a19b41
parent 73db4ac1
......@@ -45,9 +45,11 @@ static const uint8_t mi_height_log2_lookup[BLOCK_SIZES] = {
static const uint8_t block_size_wide[BLOCK_SIZES] = {
4, 4, 8, 8, 8, 16, 16, 16, 32, 32, 32, 64, 64, IF_EXT_PARTITION(64, 128, 128)
};
static const uint8_t block_size_high[BLOCK_SIZES] = {
4, 8, 4, 8, 16, 8, 16, 32, 16, 32, 64, 32, 64, IF_EXT_PARTITION(128, 64, 128)
};
static const uint8_t num_4x4_blocks_wide_lookup[BLOCK_SIZES] = {
1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16, IF_EXT_PARTITION(16, 32, 32)
};
......
......@@ -914,8 +914,8 @@ int findSamples(const AV1_COMMON *cm, MACROBLOCKD *xd, int mi_row, int mi_col,
mi_step = AOMMIN(xd->n8_w, num_8x8_blocks_wide_lookup[mbmi->sb_type]);
if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE) {
int bw = num_4x4_blocks_wide_lookup[mbmi->sb_type] * 4;
int bh = num_4x4_blocks_high_lookup[mbmi->sb_type] * 4;
int bw = block_size_wide[mbmi->sb_type];
int bh = block_size_high[mbmi->sb_type];
int mv_row = mbmi->mv[0].as_mv.row;
int mv_col = mbmi->mv[0].as_mv.col;
int cr_offset = -AOMMAX(bh, 8) / 2 - 1;
......@@ -969,8 +969,8 @@ int findSamples(const AV1_COMMON *cm, MACROBLOCKD *xd, int mi_row, int mi_col,
mi_step = AOMMIN(xd->n8_h, num_8x8_blocks_high_lookup[mbmi->sb_type]);
if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE) {
int bw = num_4x4_blocks_wide_lookup[mbmi->sb_type] * 4;
int bh = num_4x4_blocks_high_lookup[mbmi->sb_type] * 4;
int bw = block_size_wide[mbmi->sb_type];
int bh = block_size_high[mbmi->sb_type];
int mv_row = mbmi->mv[0].as_mv.row;
int mv_col = mbmi->mv[0].as_mv.col;
int cr_offset = i * 8 + AOMMAX(bh, 8) / 2 - 1;
......@@ -1020,8 +1020,8 @@ int findSamples(const AV1_COMMON *cm, MACROBLOCKD *xd, int mi_row, int mi_col,
MB_MODE_INFO *mbmi = &mi->mbmi;
if (mbmi->ref_frame[0] == ref_frame && mbmi->ref_frame[1] == NONE) {
int bw = num_4x4_blocks_wide_lookup[mbmi->sb_type] * 4;
int bh = num_4x4_blocks_high_lookup[mbmi->sb_type] * 4;
int bw = block_size_wide[mbmi->sb_type];
int bh = block_size_high[mbmi->sb_type];
int mv_row = mbmi->mv[0].as_mv.row;
int mv_col = mbmi->mv[0].as_mv.col;
int cr_offset = -AOMMAX(bh, 8) / 2 - 1;
......@@ -1070,8 +1070,8 @@ int findSamples(const AV1_COMMON *cm, MACROBLOCKD *xd, int mi_row, int mi_col,
} else {
MODE_INFO *mi = xd->mi[0];
MB_MODE_INFO *mbmi = &mi->mbmi;
int bw = num_4x4_blocks_wide_lookup[mbmi->sb_type] * 4;
int bh = num_4x4_blocks_high_lookup[mbmi->sb_type] * 4;
int bw = block_size_wide[mbmi->sb_type];
int bh = block_size_high[mbmi->sb_type];
int mv_row = mbmi->mv[0].as_mv.row;
int mv_col = mbmi->mv[0].as_mv.col;
int cr_offset = AOMMAX(bh, 8) / 2 - 1;
......
......@@ -293,8 +293,8 @@ static void init_wedge_signs() {
BLOCK_SIZE sb_type;
memset(wedge_signflip_lookup, 0, sizeof(wedge_signflip_lookup));
for (sb_type = BLOCK_4X4; sb_type < BLOCK_SIZES; ++sb_type) {
const int bw = 4 * num_4x4_blocks_wide_lookup[sb_type];
const int bh = 4 * num_4x4_blocks_high_lookup[sb_type];
const int bw = block_size_wide[sb_type];
const int bh = block_size_high[sb_type];
const wedge_params_type wedge_params = wedge_params_lookup[sb_type];
const int wbits = wedge_params.bits;
const int wtypes = 1 << wbits;
......@@ -317,8 +317,8 @@ static void init_wedge_masks() {
memset(wedge_masks, 0, sizeof(wedge_masks));
for (bsize = BLOCK_4X4; bsize < BLOCK_SIZES; ++bsize) {
const uint8_t *mask;
const int bw = 4 * num_4x4_blocks_wide_lookup[bsize];
const int bh = 4 * num_4x4_blocks_high_lookup[bsize];
const int bw = block_size_wide[bsize];
const int bh = block_size_high[bsize];
const wedge_params_type *wedge_params = &wedge_params_lookup[bsize];
const int wbits = wedge_params->bits;
const int wtypes = 1 << wbits;
......@@ -390,8 +390,7 @@ static void build_masked_compound_wedge(uint8_t *dst, int dst_stride,
const uint8_t *mask =
av1_get_contiguous_soft_mask(wedge_index, wedge_sign, sb_type);
aom_blend_a64_mask(dst, dst_stride, src0, src0_stride, src1, src1_stride,
mask, 4 * num_4x4_blocks_wide_lookup[sb_type], h, w, subh,
subw);
mask, block_size_wide[sb_type], h, w, subh, subw);
}
#if CONFIG_AOM_HIGHBITDEPTH
......@@ -405,9 +404,9 @@ static void build_masked_compound_wedge_highbd(
const int subw = (2 << b_width_log2_lookup[sb_type]) == w;
const uint8_t *mask =
av1_get_contiguous_soft_mask(wedge_index, wedge_sign, sb_type);
aom_highbd_blend_a64_mask(
dst_8, dst_stride, src0_8, src0_stride, src1_8, src1_stride, mask,
4 * num_4x4_blocks_wide_lookup[sb_type], h, w, subh, subw, bd);
aom_highbd_blend_a64_mask(dst_8, dst_stride, src0_8, src0_stride, src1_8,
src1_stride, mask, block_size_wide[sb_type], h, w,
subh, subw, bd);
}
#endif // CONFIG_AOM_HIGHBITDEPTH
......@@ -732,9 +731,8 @@ void av1_build_inter_predictor_sub8x8(MACROBLOCKD *xd, int plane, int i, int ir,
struct macroblockd_plane *const pd = &xd->plane[plane];
MODE_INFO *const mi = xd->mi[0];
const BLOCK_SIZE plane_bsize = get_plane_block_size(mi->mbmi.sb_type, pd);
const int width = 4 * num_4x4_blocks_wide_lookup[plane_bsize];
const int height = 4 * num_4x4_blocks_high_lookup[plane_bsize];
const int width = block_size_wide[plane_bsize];
const int height = block_size_high[plane_bsize];
uint8_t *const dst = &pd->dst.buf[(ir * pd->dst.stride + ic) << 2];
int ref;
const int is_compound = has_second_ref(&mi->mbmi);
......@@ -774,8 +772,8 @@ static void build_inter_predictors_for_planes(MACROBLOCKD *xd, BLOCK_SIZE bsize,
const int mi_y = mi_row * MI_SIZE;
for (plane = plane_from; plane <= plane_to; ++plane) {
const struct macroblockd_plane *pd = &xd->plane[plane];
const int bw = 4 * num_4x4_blocks_wide_lookup[bsize] >> pd->subsampling_x;
const int bh = 4 * num_4x4_blocks_high_lookup[bsize] >> pd->subsampling_y;
const int bw = block_size_wide[bsize] >> pd->subsampling_x;
const int bh = block_size_high[bsize] >> pd->subsampling_y;
if (xd->mi[0]->mbmi.sb_type < BLOCK_8X8) {
const PARTITION_TYPE bp = bsize - xd->mi[0]->mbmi.sb_type;
......@@ -1102,8 +1100,8 @@ void av1_build_inter_predictors_sb_extend(MACROBLOCKD *xd,
get_plane_block_size(bsize, &xd->plane[plane]);
const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
const int bw = 4 * num_4x4_w;
const int bh = 4 * num_4x4_h;
const int bw = block_size_wide[plane_bsize];
const int bh = block_size_high[plane_bsize];
if (xd->mi[0]->mbmi.sb_type < BLOCK_8X8) {
int x, y;
......@@ -1610,8 +1608,8 @@ static void combine_interintra(INTERINTRA_MODE mode, int use_wedge_interintra,
uint8_t *comppred, int compstride,
const uint8_t *interpred, int interstride,
const uint8_t *intrapred, int intrastride) {
const int bw = 4 * num_4x4_blocks_wide_lookup[plane_bsize];
const int bh = 4 * num_4x4_blocks_high_lookup[plane_bsize];
const int bw = block_size_wide[plane_bsize];
const int bh = block_size_high[plane_bsize];
const int size_scale = ii_size_scales[plane_bsize];
int i, j;
......@@ -1621,9 +1619,9 @@ static void combine_interintra(INTERINTRA_MODE mode, int use_wedge_interintra,
av1_get_contiguous_soft_mask(wedge_index, wedge_sign, bsize);
const int subw = 2 * num_4x4_blocks_wide_lookup[bsize] == bw;
const int subh = 2 * num_4x4_blocks_high_lookup[bsize] == bh;
aom_blend_a64_mask(
comppred, compstride, intrapred, intrastride, interpred, interstride,
mask, 4 * num_4x4_blocks_wide_lookup[bsize], bh, bw, subh, subw);
aom_blend_a64_mask(comppred, compstride, intrapred, intrastride,
interpred, interstride, mask, block_size_wide[bsize],
bh, bw, subh, subw);
}
return;
}
......@@ -1722,8 +1720,8 @@ static void combine_interintra_highbd(
int wedge_sign, BLOCK_SIZE bsize, BLOCK_SIZE plane_bsize,
uint8_t *comppred8, int compstride, const uint8_t *interpred8,
int interstride, const uint8_t *intrapred8, int intrastride, int bd) {
const int bw = 4 * num_4x4_blocks_wide_lookup[plane_bsize];
const int bh = 4 * num_4x4_blocks_high_lookup[plane_bsize];
const int bw = block_size_wide[plane_bsize];
const int bh = block_size_high[plane_bsize];
const int size_scale = ii_size_scales[plane_bsize];
int i, j;
......@@ -2055,8 +2053,8 @@ void av1_build_inter_predictors_for_planes_single_buf(
get_plane_block_size(bsize, &xd->plane[plane]);
const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
const int bw = 4 * num_4x4_w;
const int bh = 4 * num_4x4_h;
const int bw = block_size_wide;
const int bh = block_size_high;
if (xd->mi[0]->mbmi.sb_type < BLOCK_8X8) {
int x, y;
......
......@@ -311,10 +311,10 @@ void av1_decode_palette_tokens(MACROBLOCKD *const xd, int plane,
const MODE_INFO *const mi = xd->mi[0];
const MB_MODE_INFO *const mbmi = &mi->mbmi;
const BLOCK_SIZE bsize = mbmi->sb_type;
const int rows = (4 * num_4x4_blocks_high_lookup[bsize]) >>
(xd->plane[plane != 0].subsampling_y);
const int cols = (4 * num_4x4_blocks_wide_lookup[bsize]) >>
(xd->plane[plane != 0].subsampling_x);
const int rows =
(block_size_high[bsize]) >> (xd->plane[plane != 0].subsampling_y);
const int cols =
(block_size_wide[bsize]) >> (xd->plane[plane != 0].subsampling_x);
uint8_t color_order[PALETTE_MAX_SIZE];
const int n = mbmi->palette_mode_info.palette_size[plane != 0];
int i, j;
......
......@@ -1871,10 +1871,10 @@ static void write_modes_b(AV1_COMP *cpi, const TileInfo *const tile,
#if CONFIG_PALETTE
for (plane = 0; plane <= 1; ++plane) {
if (m->mbmi.palette_mode_info.palette_size[plane] > 0) {
const int rows = (4 * num_4x4_blocks_high_lookup[m->mbmi.sb_type]) >>
(xd->plane[plane].subsampling_y);
const int cols = (4 * num_4x4_blocks_wide_lookup[m->mbmi.sb_type]) >>
(xd->plane[plane].subsampling_x);
const int rows =
block_size_high[m->mbmi.sb_type] >> (xd->plane[plane].subsampling_y);
const int cols =
block_size_wide[m->mbmi.sb_type] >> (xd->plane[plane].subsampling_x);
assert(*tok < tok_end);
pack_palette_tokens(w, tok, m->mbmi.palette_mode_info.palette_size[plane],
rows * cols - 1);
......
......@@ -676,7 +676,7 @@ static void init_variance_tree(VAR_TREE *const vt,
if (bsize > leaf_size) {
const BLOCK_SIZE subsize = get_subsize(bsize, PARTITION_SPLIT);
const int px = num_4x4_blocks_wide_lookup[subsize] * 4;
const int px = block_size_wide[subsize];
init_variance_tree(vt->split[0],
#if CONFIG_AOM_HIGHBITDEPTH
......
......@@ -38,8 +38,8 @@ void av1_subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
struct macroblock_plane *const p = &x->plane[plane];
const struct macroblockd_plane *const pd = &x->e_mbd.plane[plane];
const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
const int bw = 4 * num_4x4_blocks_wide_lookup[plane_bsize];
const int bh = 4 * num_4x4_blocks_high_lookup[plane_bsize];
const int bw = block_size_wide[plane_bsize];
const int bh = block_size_high[plane_bsize];
#if CONFIG_AOM_HIGHBITDEPTH
if (x->e_mbd.cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
......@@ -482,7 +482,7 @@ void av1_xform_quant(const AV1_COMMON *cm, MACROBLOCK *x, int plane, int block,
tran_low_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block);
tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
uint16_t *const eob = &p->eobs[block];
const int diff_stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize];
const int diff_stride = block_size_wide[plane_bsize];
#if CONFIG_AOM_QM
int seg_id = xd->mi[0]->mbmi.segment_id;
const qm_val_t *qmatrix = pd->seg_qmatrix[seg_id][!is_inter][tx_size];
......
......@@ -2562,8 +2562,8 @@ int av1_find_best_masked_sub_pixel_tree_up(
int idx, best_idx = -1;
unsigned int cost_array[5];
int kr, kc;
const int w = 4 * num_4x4_blocks_wide_lookup[mbmi->sb_type];
const int h = 4 * num_4x4_blocks_high_lookup[mbmi->sb_type];
const int w = block_size_wide[mbmi->sb_type];
const int h = block_size_high[mbmi->sb_type];
int offset;
int y_stride;
const uint8_t *y;
......@@ -3064,8 +3064,8 @@ int av1_find_best_obmc_sub_pixel_tree_up(
int idx, best_idx = -1;
unsigned int cost_array[5];
int kr, kc;
const int w = 4 * num_4x4_blocks_wide_lookup[mbmi->sb_type];
const int h = 4 * num_4x4_blocks_high_lookup[mbmi->sb_type];
const int w = block_size_wide[mbmi->sb_type];
const int h = block_size_high[mbmi->sb_type];
int offset;
int y_stride;
const uint8_t *y;
......
......@@ -717,7 +717,7 @@ int av1_raster_block_offset(BLOCK_SIZE plane_bsize, int raster_block,
int16_t *av1_raster_block_offset_int16(BLOCK_SIZE plane_bsize, int raster_block,
int16_t *base) {
const int stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize];
const int stride = block_size_wide[plane_bsize];
return base + av1_raster_block_offset(plane_bsize, raster_block, stride);
}
......
......@@ -1853,8 +1853,8 @@ static int rd_pick_palette_intra_sby(
int rate_overhead = 0;
MACROBLOCKD *const xd = &x->e_mbd;
MODE_INFO *const mic = xd->mi[0];
const int rows = 4 * num_4x4_blocks_high_lookup[bsize];
const int cols = 4 * num_4x4_blocks_wide_lookup[bsize];
const int rows = block_size_high[bsize];
const int cols = block_size_wide[bsize];
int this_rate, colors, n;
RD_STATS tokenonly_rd_stats;
int64_t this_rd;
......@@ -2816,8 +2816,8 @@ static int64_t rd_pick_intra_sby_mode(const AV1_COMP *const cpi, MACROBLOCK *x,
int64_t this_distortion, this_rd;
TX_SIZE best_tx = TX_4X4;
#if CONFIG_EXT_INTRA || CONFIG_PALETTE
const int rows = 4 * num_4x4_blocks_high_lookup[bsize];
const int cols = 4 * num_4x4_blocks_wide_lookup[bsize];
const int rows = block_size_high[bsize];
const int cols = block_size_wide[bsize];
#endif // CONFIG_EXT_INTRA || CONFIG_PALETTE
#if CONFIG_EXT_INTRA
const int intra_filter_ctx = av1_get_pred_context_intra_interp(xd);
......@@ -3737,10 +3737,8 @@ static void rd_pick_palette_intra_sbuv(
MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
const BLOCK_SIZE bsize = mbmi->sb_type;
const int rows =
(4 * num_4x4_blocks_high_lookup[bsize]) >> (xd->plane[1].subsampling_y);
const int cols =
(4 * num_4x4_blocks_wide_lookup[bsize]) >> (xd->plane[1].subsampling_x);
const int rows = block_size_high[bsize] >> (xd->plane[1].subsampling_y);
const int cols = block_size_wide[bsize] >> (xd->plane[1].subsampling_x);
int this_rate;
int64_t this_rd;
int colors_u, colors_v, colors;
......@@ -4057,10 +4055,8 @@ static int64_t rd_pick_intra_sbuv_mode(const AV1_COMP *const cpi, MACROBLOCK *x,
od_encode_checkpoint(&x->daala_enc, &buf);
#endif
#if CONFIG_PALETTE
const int rows =
(4 * num_4x4_blocks_high_lookup[bsize]) >> (xd->plane[1].subsampling_y);
const int cols =
(4 * num_4x4_blocks_wide_lookup[bsize]) >> (xd->plane[1].subsampling_x);
const int rows = block_size_high[bsize] >> (xd->plane[1].subsampling_y);
const int cols = block_size_wide[bsize] >> (xd->plane[1].subsampling_x);
PALETTE_MODE_INFO palette_mode_info;
PALETTE_MODE_INFO *const pmi = &xd->mi[0]->mbmi.palette_mode_info;
uint8_t *best_palette_color_map = NULL;
......@@ -4847,8 +4843,8 @@ static void joint_motion_search(const AV1_COMP *cpi, MACROBLOCK *x,
int_mv single_newmv[TOTAL_REFS_PER_FRAME],
int *rate_mv, const int block) {
const AV1_COMMON *const cm = &cpi->common;
const int pw = 4 * num_4x4_blocks_wide_lookup[bsize];
const int ph = 4 * num_4x4_blocks_high_lookup[bsize];
const int pw = block_size_wide[bsize];
const int ph = block_size_high[bsize];
MACROBLOCKD *xd = &x->e_mbd;
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
const int refs[2] = { mbmi->ref_frame[0],
......@@ -5445,8 +5441,8 @@ static int64_t rd_pick_best_sub8x8_mode(
const int try_second =
x->second_best_mv.as_int != INVALID_MV &&
x->second_best_mv.as_int != x->best_mv.as_int;
const int pw = 4 * num_4x4_blocks_wide_lookup[bsize];
const int ph = 4 * num_4x4_blocks_high_lookup[bsize];
const int pw = block_size_wide[bsize];
const int ph = block_size_high[bsize];
// Use up-sampled reference frames.
struct buf_2d backup_pred = pd->pre[0];
const YV12_BUFFER_CONFIG *upsampled_ref =
......@@ -6244,8 +6240,8 @@ static void single_motion_search(const AV1_COMP *const cpi, MACROBLOCK *x,
int best_mv_var;
const int try_second = x->second_best_mv.as_int != INVALID_MV &&
x->second_best_mv.as_int != x->best_mv.as_int;
const int pw = 4 * num_4x4_blocks_wide_lookup[bsize];
const int ph = 4 * num_4x4_blocks_high_lookup[bsize];
const int pw = block_size_wide[bsize];
const int ph = block_size_high[bsize];
// Use up-sampled reference frames.
struct macroblockd_plane *const pd = &xd->plane[0];
struct buf_2d backup_pred = pd->pre[ref_idx];
......@@ -6481,7 +6477,7 @@ static void do_masked_motion_search_indexed(const AV1_COMP *const cpi,
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
BLOCK_SIZE sb_type = mbmi->sb_type;
const uint8_t *mask;
const int mask_stride = 4 * num_4x4_blocks_wide_lookup[bsize];
const int mask_stride = block_size_wide[bsize];
mask = av1_get_contiguous_soft_mask(wedge_index, wedge_sign, sb_type);
if (which == 0 || which == 2)
......@@ -6684,8 +6680,8 @@ static int64_t pick_wedge(const AV1_COMP *const cpi, const MACROBLOCK *const x,
int *const best_wedge_index) {
const MACROBLOCKD *const xd = &x->e_mbd;
const struct buf_2d *const src = &x->plane[0].src;
const int bw = 4 * num_4x4_blocks_wide_lookup[bsize];
const int bh = 4 * num_4x4_blocks_high_lookup[bsize];
const int bw = block_size_wide[bsize];
const int bh = block_size_high[bsize];
const int N = bw * bh;
int rate;
int64_t dist;
......@@ -6759,8 +6755,8 @@ static int64_t pick_wedge_fixed_sign(
const int wedge_sign, int *const best_wedge_index) {
const MACROBLOCKD *const xd = &x->e_mbd;
const struct buf_2d *const src = &x->plane[0].src;
const int bw = 4 * num_4x4_blocks_wide_lookup[bsize];
const int bh = 4 * num_4x4_blocks_high_lookup[bsize];
const int bw = block_size_wide[bsize];
const int bh = block_size_high[bsize];
const int N = bw * bh;
int rate;
int64_t dist;
......@@ -6816,7 +6812,7 @@ static int64_t pick_interinter_wedge(const AV1_COMP *const cpi,
const uint8_t *const p1) {
const MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
const int bw = 4 * num_4x4_blocks_wide_lookup[bsize];
const int bw = block_size_wide[bsize];
int64_t rd;
int wedge_index = -1;
......@@ -6890,7 +6886,7 @@ static int64_t handle_inter_mode(
int rate_mv = 0;
#if CONFIG_EXT_INTER
int pred_exists = 1;
const int bw = 4 * num_4x4_blocks_wide_lookup[bsize];
const int bw = block_size_wide[bsize];
int mv_idx = (this_mode == NEWFROMNEARMV) ? 1 : 0;
int_mv single_newmv[TOTAL_REFS_PER_FRAME];
const unsigned int *const interintra_mode_cost =
......@@ -8156,10 +8152,8 @@ static void restore_uv_color_map(const AV1_COMP *const cpi, MACROBLOCK *x) {
MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
PALETTE_MODE_INFO *const pmi = &mbmi->palette_mode_info;
const BLOCK_SIZE bsize = mbmi->sb_type;
const int rows =
(4 * num_4x4_blocks_high_lookup[bsize]) >> (xd->plane[1].subsampling_y);
const int cols =
(4 * num_4x4_blocks_wide_lookup[bsize]) >> (xd->plane[1].subsampling_x);
const int rows = block_size_high[bsize] >> (xd->plane[1].subsampling_y);
const int cols = block_size_wide[bsize] >> (xd->plane[1].subsampling_x);
int src_stride = x->plane[1].src.stride;
const uint8_t *const src_u = x->plane[1].src.buf;
const uint8_t *const src_v = x->plane[2].src.buf;
......@@ -8494,8 +8488,8 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
#endif
#if CONFIG_PALETTE || CONFIG_EXT_INTRA
const int rows = 4 * num_4x4_blocks_high_lookup[bsize];
const int cols = 4 * num_4x4_blocks_wide_lookup[bsize];
const int rows = block_size_high[bsize];
const int cols = block_size_wide[bsize];
#endif // CONFIG_PALETTE || CONFIG_EXT_INTRA
#if CONFIG_PALETTE
int palette_ctx = 0;
......
......@@ -394,10 +394,10 @@ void av1_tokenize_palette_sb(const AV1_COMP *cpi,
int i, j;
int this_rate = 0;
uint8_t color_order[PALETTE_MAX_SIZE];
const int rows = (4 * num_4x4_blocks_high_lookup[bsize]) >>
(xd->plane[plane != 0].subsampling_y);
const int cols = (4 * num_4x4_blocks_wide_lookup[bsize]) >>
(xd->plane[plane != 0].subsampling_x);
const int rows =
block_size_high[bsize] >> (xd->plane[plane != 0].subsampling_y);
const int cols =
block_size_wide[bsize] >> (xd->plane[plane != 0].subsampling_x);
const aom_prob(*const probs)[PALETTE_COLOR_CONTEXTS][PALETTE_COLORS - 1] =
plane == 0 ? av1_default_palette_y_color_prob
: av1_default_palette_uv_color_prob;
......
......@@ -45,8 +45,8 @@ TEST_P(AV1SubtractBlockTest, SimpleSubtract) {
// FIXME(rbultje) split in its own file
for (BLOCK_SIZE bsize = BLOCK_4X4; bsize < BLOCK_SIZES;
bsize = static_cast<BLOCK_SIZE>(static_cast<int>(bsize) + 1)) {
const int block_width = 4 * num_4x4_blocks_wide_lookup[bsize];
const int block_height = 4 * num_4x4_blocks_high_lookup[bsize];
const int block_width = block_size_wide[bsize];
const int block_height = block_size_high[bsize];
int16_t *diff = reinterpret_cast<int16_t *>(
aom_memalign(16, sizeof(*diff) * block_width * block_height * 2));
uint8_t *pred = reinterpret_cast<uint8_t *>(
......
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