Commit 03f6fdcf authored by Urvang Joshi's avatar Urvang Joshi

Fix warnings reported by -Wshadow: Part1b: scan_order struct and variable

- Change struct name to all caps SCAN_ORDER to be locally consistent.
- Rename struct pointers to 'scan_order' instead of hard to read short
  names 'so' and 'sc'.

Cherry-picked from aomedia/master: 30abc082

Change-Id: Ib9f0eefe28fa97d23d642b77d7dc8e5f8613177d
parent fdb60962
......@@ -3799,7 +3799,7 @@ DECLARE_ALIGNED(16, static const int16_t, av1_qtr_iscan_32x32[1024]) = {
};
#endif // CONFIG_EXT_TX
const scan_order av1_default_scan_orders[TX_SIZES] = {
const SCAN_ORDER av1_default_scan_orders[TX_SIZES] = {
{ default_scan_4x4, av1_default_iscan_4x4, default_scan_4x4_neighbors },
{ default_scan_8x8, av1_default_iscan_8x8, default_scan_8x8_neighbors },
{ default_scan_16x16, av1_default_iscan_16x16, default_scan_16x16_neighbors },
......@@ -3807,7 +3807,7 @@ const scan_order av1_default_scan_orders[TX_SIZES] = {
};
#if CONFIG_EXT_TX
const scan_order av1_intra_scan_orders[TX_SIZES][TX_TYPES] = {
const SCAN_ORDER av1_intra_scan_orders[TX_SIZES][TX_TYPES] = {
{
// TX_4X4
{ default_scan_4x4, av1_default_iscan_4x4, default_scan_4x4_neighbors },
......@@ -3894,7 +3894,7 @@ const scan_order av1_intra_scan_orders[TX_SIZES][TX_TYPES] = {
}
};
const scan_order av1_inter_scan_orders[TX_SIZES_ALL][TX_TYPES] = {
const SCAN_ORDER av1_inter_scan_orders[TX_SIZES_ALL][TX_TYPES] = {
{
// TX_4X4
{ default_scan_4x4, av1_default_iscan_4x4, default_scan_4x4_neighbors },
......@@ -4135,7 +4135,7 @@ const scan_order av1_inter_scan_orders[TX_SIZES_ALL][TX_TYPES] = {
#else // CONFIG_EXT_TX
const scan_order av1_intra_scan_orders[TX_SIZES][TX_TYPES] = {
const SCAN_ORDER av1_intra_scan_orders[TX_SIZES][TX_TYPES] = {
{ // TX_4X4
{ default_scan_4x4, av1_default_iscan_4x4, default_scan_4x4_neighbors },
{ row_scan_4x4, av1_row_iscan_4x4, row_scan_4x4_neighbors },
......
......@@ -28,10 +28,10 @@ typedef struct {
const int16_t *scan;
const int16_t *iscan;
const int16_t *neighbors;
} scan_order;
} SCAN_ORDER;
extern const scan_order av1_default_scan_orders[TX_SIZES];
extern const scan_order av1_intra_scan_orders[TX_SIZES][TX_TYPES];
extern const SCAN_ORDER av1_default_scan_orders[TX_SIZES];
extern const SCAN_ORDER av1_intra_scan_orders[TX_SIZES][TX_TYPES];
static INLINE int get_coef_context(const int16_t *neighbors,
const uint8_t *token_cache, int c) {
......@@ -40,21 +40,21 @@ static INLINE int get_coef_context(const int16_t *neighbors,
1;
}
static INLINE const scan_order *get_intra_scan(TX_SIZE tx_size,
static INLINE const SCAN_ORDER *get_intra_scan(TX_SIZE tx_size,
TX_TYPE tx_type) {
return &av1_intra_scan_orders[tx_size][tx_type];
}
#if CONFIG_EXT_TX
extern const scan_order av1_inter_scan_orders[TX_SIZES_ALL][TX_TYPES];
extern const SCAN_ORDER av1_inter_scan_orders[TX_SIZES_ALL][TX_TYPES];
static INLINE const scan_order *get_inter_scan(TX_SIZE tx_size,
static INLINE const SCAN_ORDER *get_inter_scan(TX_SIZE tx_size,
TX_TYPE tx_type) {
return &av1_inter_scan_orders[tx_size][tx_type];
}
#endif // CONFIG_EXT_TX
static INLINE const scan_order *get_scan(TX_SIZE tx_size, TX_TYPE tx_type,
static INLINE const SCAN_ORDER *get_scan(TX_SIZE tx_size, TX_TYPE tx_type,
int is_inter) {
#if CONFIG_EXT_TX
return is_inter ? &av1_inter_scan_orders[tx_size][tx_type]
......
......@@ -295,9 +295,9 @@ static void predict_and_reconstruct_intra_block(MACROBLOCKD *const xd,
if (!mbmi->skip) {
TX_TYPE tx_type = get_tx_type(plane_type, xd, block_idx, tx_size);
const scan_order *sc = get_scan(tx_size, tx_type, 0);
const int eob = av1_decode_block_tokens(xd, plane, sc, col, row, tx_size,
tx_type, r, mbmi->segment_id);
const SCAN_ORDER *scan_order = get_scan(tx_size, tx_type, 0);
const int eob = av1_decode_block_tokens(
xd, plane, scan_order, col, row, tx_size, tx_type, r, mbmi->segment_id);
inverse_transform_block(xd, plane, tx_type, tx_size, dst, pd->dst.stride,
eob);
}
......@@ -329,7 +329,7 @@ static void decode_reconstruct_tx(MACROBLOCKD *const xd, aom_reader *r,
if (tx_size == plane_tx_size) {
PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
TX_TYPE tx_type = get_tx_type(plane_type, xd, block, plane_tx_size);
const scan_order *sc = get_scan(plane_tx_size, tx_type, 1);
const SCAN_ORDER *sc = get_scan(plane_tx_size, tx_type, 1);
const int eob =
av1_decode_block_tokens(xd, plane, sc, blk_col, blk_row, plane_tx_size,
tx_type, r, mbmi->segment_id);
......@@ -372,9 +372,9 @@ static int reconstruct_inter_block(MACROBLOCKD *const xd,
PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
int block_idx = (row << 1) + col;
TX_TYPE tx_type = get_tx_type(plane_type, xd, block_idx, tx_size);
const scan_order *sc = get_scan(tx_size, tx_type, 1);
const int eob = av1_decode_block_tokens(xd, plane, sc, col, row, tx_size,
tx_type, r, segment_id);
const SCAN_ORDER *scan_order = get_scan(tx_size, tx_type, 1);
const int eob = av1_decode_block_tokens(xd, plane, scan_order, col, row,
tx_size, tx_type, r, segment_id);
inverse_transform_block(xd, plane, tx_type, tx_size,
&pd->dst.buf[4 * row * pd->dst.stride + 4 * col],
......
......@@ -364,7 +364,7 @@ void av1_decode_palette_tokens(MACROBLOCKD *const xd, int plane,
#endif // CONFIG_PALETTE
int av1_decode_block_tokens(MACROBLOCKD *const xd, int plane,
const scan_order *sc, int x, int y, TX_SIZE tx_size,
const SCAN_ORDER *sc, int x, int y, TX_SIZE tx_size,
TX_TYPE tx_type,
#if CONFIG_ANS
struct AnsDecoder *const r,
......
......@@ -27,7 +27,7 @@ void av1_decode_palette_tokens(MACROBLOCKD *const xd, int plane, aom_reader *r);
#endif // CONFIG_PALETTE
int av1_decode_block_tokens(MACROBLOCKD *const xd, int plane,
const scan_order *sc, int x, int y, TX_SIZE tx_size,
const SCAN_ORDER *sc, int x, int y, TX_SIZE tx_size,
TX_TYPE tx_type,
#if CONFIG_ANS
struct AnsDecoder *const r,
......
......@@ -85,10 +85,10 @@ int av1_optimize_b(MACROBLOCK *mb, int plane, int block, TX_SIZE tx_size,
const int16_t *const dequant_ptr = pd->dequant;
const uint8_t *const band_translate = get_band_translate(tx_size);
TX_TYPE tx_type = get_tx_type(plane_type, xd, block, tx_size);
const scan_order *const so =
const SCAN_ORDER *const scan_order =
get_scan(tx_size, tx_type, is_inter_block(&xd->mi[0]->mbmi));
const int16_t *const scan = so->scan;
const int16_t *const nb = so->neighbors;
const int16_t *const scan = scan_order->scan;
const int16_t *const nb = scan_order->neighbors;
#if CONFIG_AOM_QM
int seg_id = xd->mi[0]->mbmi.segment_id;
const qm_val_t *iqmatrix = pd->seg_iqmatrix[seg_id][!ref][tx_size];
......@@ -447,7 +447,7 @@ void av1_xform_quant(MACROBLOCK *x, int plane, int block, int blk_row,
PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
TX_TYPE tx_type = get_tx_type(plane_type, xd, block, tx_size);
const int is_inter = is_inter_block(&xd->mi[0]->mbmi);
const scan_order *const scan_order = get_scan(tx_size, tx_type, is_inter);
const SCAN_ORDER *const scan_order = get_scan(tx_size, tx_type, is_inter);
tran_low_t *const coeff = BLOCK_OFFSET(p->coeff, block);
tran_low_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block);
tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
......@@ -520,7 +520,7 @@ void av1_xform_quant_nuq(MACROBLOCK *x, int plane, int block, int blk_row,
PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
TX_TYPE tx_type = get_tx_type(plane_type, xd, block, tx_size);
const int is_inter = is_inter_block(&xd->mi[0]->mbmi);
const scan_order *const scan_order = get_scan(tx_size, tx_type, is_inter);
const SCAN_ORDER *const scan_order = get_scan(tx_size, tx_type, is_inter);
tran_low_t *const coeff = BLOCK_OFFSET(p->coeff, block);
tran_low_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block);
tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
......@@ -593,7 +593,7 @@ void av1_xform_quant_fp_nuq(MACROBLOCK *x, int plane, int block, int blk_row,
const int is_inter = is_inter_block(&xd->mi[0]->mbmi);
PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
TX_TYPE tx_type = get_tx_type(plane_type, xd, block, tx_size);
const scan_order *const scan_order = get_scan(tx_size, tx_type, is_inter);
const SCAN_ORDER *const scan_order = get_scan(tx_size, tx_type, is_inter);
int dq = get_dq_profile_from_ctx(xd->qindex[xd->mi[0]->mbmi.segment_id], ctx,
is_inter, plane_type);
tran_low_t *const coeff = BLOCK_OFFSET(p->coeff, block);
......
......@@ -344,7 +344,7 @@ void av1_quantize_fp_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc, const QUANT_PARAM *qparam) {
const SCAN_ORDER *sc, const QUANT_PARAM *qparam) {
// obsolete skip_block
const int skip_block = 0;
......@@ -362,7 +362,7 @@ void av1_quantize_fp_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
void av1_quantize_b_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd, tran_low_t *dqcoeff_ptr,
uint16_t *eob_ptr, const scan_order *sc,
uint16_t *eob_ptr, const SCAN_ORDER *sc,
const QUANT_PARAM *qparam) {
// obsolete skip_block
const int skip_block = 0;
......@@ -382,7 +382,7 @@ void av1_quantize_dc_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc, const QUANT_PARAM *qparam) {
const SCAN_ORDER *sc, const QUANT_PARAM *qparam) {
// obsolete skip_block
const int skip_block = 0;
(void)sc;
......@@ -402,7 +402,7 @@ void av1_highbd_quantize_fp_facade(const tran_low_t *coeff_ptr,
tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc,
const SCAN_ORDER *sc,
const QUANT_PARAM *qparam) {
// obsolete skip_block
const int skip_block = 0;
......@@ -418,7 +418,7 @@ void av1_highbd_quantize_b_facade(const tran_low_t *coeff_ptr,
tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc,
const SCAN_ORDER *sc,
const QUANT_PARAM *qparam) {
// obsolete skip_block
const int skip_block = 0;
......@@ -434,7 +434,7 @@ void av1_highbd_quantize_dc_facade(const tran_low_t *coeff_ptr,
tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc,
const SCAN_ORDER *sc,
const QUANT_PARAM *qparam) {
// obsolete skip_block
const int skip_block = 0;
......
......@@ -28,7 +28,7 @@ typedef void (*AV1_QUANT_FACADE)(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc,
const SCAN_ORDER *sc,
const QUANT_PARAM *qparam);
typedef struct {
......@@ -80,19 +80,19 @@ void av1_quantize_fp_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc, const QUANT_PARAM *qparam);
const SCAN_ORDER *sc, const QUANT_PARAM *qparam);
void av1_quantize_b_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd, tran_low_t *dqcoeff_ptr,
uint16_t *eob_ptr, const scan_order *sc,
uint16_t *eob_ptr, const SCAN_ORDER *sc,
const QUANT_PARAM *qparam);
void av1_quantize_dc_facade(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
const MACROBLOCK_PLANE *p, tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc, const QUANT_PARAM *qparam);
const SCAN_ORDER *sc, const QUANT_PARAM *qparam);
#if CONFIG_NEW_QUANT
void quantize_dc_nuq(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
......@@ -128,7 +128,7 @@ void av1_highbd_quantize_fp_facade(const tran_low_t *coeff_ptr,
tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc,
const SCAN_ORDER *sc,
const QUANT_PARAM *qparam);
void av1_highbd_quantize_b_facade(const tran_low_t *coeff_ptr,
......@@ -136,7 +136,7 @@ void av1_highbd_quantize_b_facade(const tran_low_t *coeff_ptr,
tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc,
const SCAN_ORDER *sc,
const QUANT_PARAM *qparam);
void av1_highbd_quantize_dc_facade(const tran_low_t *coeff_ptr,
......@@ -144,7 +144,7 @@ void av1_highbd_quantize_dc_facade(const tran_low_t *coeff_ptr,
tran_low_t *qcoeff_ptr,
const MACROBLOCKD_PLANE *pd,
tran_low_t *dqcoeff_ptr, uint16_t *eob_ptr,
const scan_order *sc,
const SCAN_ORDER *sc,
const QUANT_PARAM *qparam);
void av1_highbd_quantize_dc(const tran_low_t *coeff_ptr, int n_coeffs,
......
......@@ -135,7 +135,7 @@ struct rdcost_block_args {
int64_t best_rd;
int exit_early;
int use_fast_coef_costing;
const scan_order *so;
const SCAN_ORDER *scan_order;
uint8_t skippable;
};
......@@ -1070,7 +1070,7 @@ static void dist_block(const AV1_COMP *cpi, MACROBLOCK *x, int plane, int block,
static int rate_block(int plane, int block, int coeff_ctx, TX_SIZE tx_size,
struct rdcost_block_args *args) {
return av1_cost_coeffs(args->x, plane, block, coeff_ctx, tx_size,
args->so->scan, args->so->neighbors,
args->scan_order->scan, args->scan_order->neighbors,
args->use_fast_coef_costing);
}
......@@ -1232,7 +1232,8 @@ static void txfm_rd_in_plane(MACROBLOCK *x, const AV1_COMP *cpi, int *rate,
av1_get_entropy_contexts(bsize, tx_size, pd, args.t_above, args.t_left);
tx_type = get_tx_type(pd->plane_type, xd, 0, tx_size);
args.so = get_scan(tx_size, tx_type, is_inter_block(&xd->mi[0]->mbmi));
args.scan_order =
get_scan(tx_size, tx_type, is_inter_block(&xd->mi[0]->mbmi));
av1_foreach_transformed_block_in_plane(xd, bsize, plane, block_rd_txfm,
&args);
......@@ -1275,7 +1276,8 @@ void av1_txfm_rd_in_plane_supertx(MACROBLOCK *x, const AV1_COMP *cpi, int *rate,
av1_get_entropy_contexts(bsize, tx_size, pd, args.t_above, args.t_left);
tx_type = get_tx_type(pd->plane_type, xd, 0, tx_size);
args.so = get_scan(tx_size, tx_type, is_inter_block(&xd->mi[0]->mbmi));
args.scan_order =
get_scan(tx_size, tx_type, is_inter_block(&xd->mi[0]->mbmi));
block_rd_txfm(plane, 0, 0, 0, get_plane_block_size(bsize, pd), tx_size,
&args);
......@@ -1946,7 +1948,7 @@ static int64_t rd_pick_intra4x4block(
dst_stride, xd->bd);
if (xd->lossless[xd->mi[0]->mbmi.segment_id]) {
TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block, TX_4X4);
const scan_order *so = get_scan(TX_4X4, tx_type, 0);
const SCAN_ORDER *scan_order = get_scan(TX_4X4, tx_type, 0);
const int coeff_ctx =
combine_entropy_contexts(*(tempa + idx), *(templ + idy));
#if CONFIG_NEW_QUANT
......@@ -1956,9 +1958,9 @@ static int64_t rd_pick_intra4x4block(
av1_xform_quant(x, 0, block, row + idy, col + idx, BLOCK_8X8,
TX_4X4, AV1_XFORM_QUANT_FP);
#endif // CONFIG_NEW_QUANT
ratey +=
av1_cost_coeffs(x, 0, block, coeff_ctx, TX_4X4, so->scan,
so->neighbors, cpi->sf.use_fast_coef_costing);
ratey += av1_cost_coeffs(x, 0, block, coeff_ctx, TX_4X4,
scan_order->scan, scan_order->neighbors,
cpi->sf.use_fast_coef_costing);
*(tempa + idx) = !(p->eobs[block] == 0);
*(templ + idy) = !(p->eobs[block] == 0);
can_skip &= (p->eobs[block] == 0);
......@@ -1971,7 +1973,7 @@ static int64_t rd_pick_intra4x4block(
int64_t dist;
unsigned int tmp;
TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block, TX_4X4);
const scan_order *so = get_scan(TX_4X4, tx_type, 0);
const SCAN_ORDER *scan_order = get_scan(TX_4X4, tx_type, 0);
const int coeff_ctx =
combine_entropy_contexts(*(tempa + idx), *(templ + idy));
#if CONFIG_NEW_QUANT
......@@ -1982,9 +1984,9 @@ static int64_t rd_pick_intra4x4block(
TX_4X4, AV1_XFORM_QUANT_FP);
#endif // CONFIG_NEW_QUANT
av1_optimize_b(x, 0, block, TX_4X4, coeff_ctx);
ratey +=
av1_cost_coeffs(x, 0, block, coeff_ctx, TX_4X4, so->scan,
so->neighbors, cpi->sf.use_fast_coef_costing);
ratey += av1_cost_coeffs(x, 0, block, coeff_ctx, TX_4X4,
scan_order->scan, scan_order->neighbors,
cpi->sf.use_fast_coef_costing);
*(tempa + idx) = !(p->eobs[block] == 0);
*(templ + idy) = !(p->eobs[block] == 0);
can_skip &= (p->eobs[block] == 0);
......@@ -2066,7 +2068,7 @@ static int64_t rd_pick_intra4x4block(
if (xd->lossless[xd->mi[0]->mbmi.segment_id]) {
TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block, TX_4X4);
const scan_order *so = get_scan(TX_4X4, tx_type, 0);
const SCAN_ORDER *scan_order = get_scan(TX_4X4, tx_type, 0);
const int coeff_ctx =
combine_entropy_contexts(*(tempa + idx), *(templ + idy));
#if CONFIG_NEW_QUANT
......@@ -2076,9 +2078,9 @@ static int64_t rd_pick_intra4x4block(
av1_xform_quant(x, 0, block, row + idy, col + idx, BLOCK_8X8, TX_4X4,
AV1_XFORM_QUANT_B);
#endif // CONFIG_NEW_QUANT
ratey +=
av1_cost_coeffs(x, 0, block, coeff_ctx, TX_4X4, so->scan,
so->neighbors, cpi->sf.use_fast_coef_costing);
ratey += av1_cost_coeffs(x, 0, block, coeff_ctx, TX_4X4,
scan_order->scan, scan_order->neighbors,
cpi->sf.use_fast_coef_costing);
*(tempa + idx) = !(p->eobs[block] == 0);
*(templ + idy) = !(p->eobs[block] == 0);
can_skip &= (p->eobs[block] == 0);
......@@ -2090,7 +2092,7 @@ static int64_t rd_pick_intra4x4block(
int64_t dist;
unsigned int tmp;
TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block, TX_4X4);
const scan_order *so = get_scan(TX_4X4, tx_type, 0);
const SCAN_ORDER *scan_order = get_scan(TX_4X4, tx_type, 0);
const int coeff_ctx =
combine_entropy_contexts(*(tempa + idx), *(templ + idy));
#if CONFIG_NEW_QUANT
......@@ -2101,9 +2103,9 @@ static int64_t rd_pick_intra4x4block(
AV1_XFORM_QUANT_FP);
#endif // CONFIG_NEW_QUANT
av1_optimize_b(x, 0, block, TX_4X4, coeff_ctx);
ratey +=
av1_cost_coeffs(x, 0, block, coeff_ctx, TX_4X4, so->scan,
so->neighbors, cpi->sf.use_fast_coef_costing);
ratey += av1_cost_coeffs(x, 0, block, coeff_ctx, TX_4X4,
scan_order->scan, scan_order->neighbors,
cpi->sf.use_fast_coef_costing);
*(tempa + idx) = !(p->eobs[block] == 0);
*(templ + idy) = !(p->eobs[block] == 0);
can_skip &= (p->eobs[block] == 0);
......@@ -2880,7 +2882,7 @@ void av1_tx_block_rd_b(const AV1_COMP *cpi, MACROBLOCK *x, TX_SIZE tx_size,
tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
TX_TYPE tx_type = get_tx_type(plane_type, xd, block, tx_size);
const scan_order *const scan_order =
const SCAN_ORDER *const scan_order =
get_scan(tx_size, tx_type, is_inter_block(&xd->mi[0]->mbmi));
BLOCK_SIZE txm_bsize = txsize_to_bsize[tx_size];
......@@ -4346,7 +4348,7 @@ static int64_t encode_inter_mb_segment(const AV1_COMP *const cpi, MACROBLOCK *x,
TX_SIZE tx_size = mi->mbmi.tx_size;
TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, i, tx_size);
const scan_order *so = get_scan(tx_size, tx_type, 1);
const SCAN_ORDER *scan_order = get_scan(tx_size, tx_type, 1);
const int num_4x4_w = num_4x4_blocks_wide_txsize_lookup[tx_size];
const int num_4x4_h = num_4x4_blocks_high_txsize_lookup[tx_size];
......@@ -4406,8 +4408,9 @@ static int64_t encode_inter_mb_segment(const AV1_COMP *const cpi, MACROBLOCK *x,
&dist, &ssz);
thisdistortion += dist;
thissse += ssz;
thisrate += av1_cost_coeffs(x, 0, block, coeff_ctx, tx_size, so->scan,
so->neighbors, cpi->sf.use_fast_coef_costing);
thisrate +=
av1_cost_coeffs(x, 0, block, coeff_ctx, tx_size, scan_order->scan,
scan_order->neighbors, cpi->sf.use_fast_coef_costing);
*(ta + (k & 1)) = !(p->eobs[block] == 0);
*(tl + (k >> 1)) = !(p->eobs[block] == 0);
#if CONFIG_EXT_TX
......
......@@ -362,11 +362,11 @@ static void cost_coeffs_b(int plane, int block, int blk_row, int blk_col,
const PLANE_TYPE type = pd->plane_type;
const int ref = is_inter_block(mbmi);
const TX_TYPE tx_type = get_tx_type(type, xd, block, tx_size);
const scan_order *const so = get_scan(tx_size, tx_type, ref);
const SCAN_ORDER *const scan_order = get_scan(tx_size, tx_type, ref);
int pt = get_entropy_context(tx_size, pd->above_context + blk_col,
pd->left_context + blk_row);
int rate =
av1_cost_coeffs(x, plane, block, pt, tx_size, so->scan, so->neighbors, 0);
int rate = av1_cost_coeffs(x, plane, block, pt, tx_size, scan_order->scan,
scan_order->neighbors, 0);
args->this_rate += rate;
av1_set_contexts(xd, pd, plane_bsize, tx_size, p->eobs[block] > 0, blk_col,
blk_row);
......@@ -476,7 +476,8 @@ static void tokenize_b(int plane, int block, int blk_row, int blk_col,
#endif // CONFIG_SUEPRTX
const int16_t *scan, *nb;
const TX_TYPE tx_type = get_tx_type(type, xd, block, tx_size);
const scan_order *const so = get_scan(tx_size, tx_type, is_inter_block(mbmi));
const SCAN_ORDER *const scan_order =
get_scan(tx_size, tx_type, is_inter_block(mbmi));
const int ref = is_inter_block(mbmi);
unsigned int(*const counts)[COEFF_CONTEXTS][ENTROPY_TOKENS] =
td->rd_counts.coef_counts[txsize_sqr_map[tx_size]][type][ref];
......@@ -501,8 +502,8 @@ static void tokenize_b(int plane, int block, int blk_row, int blk_col,
EXTRABIT extra;
pt = get_entropy_context(tx_size, pd->above_context + blk_col,
pd->left_context + blk_row);
scan = so->scan;
nb = so->neighbors;
scan = scan_order->scan;
nb = scan_order->neighbors;
c = 0;
while (c < eob) {
......
......@@ -70,7 +70,7 @@ class AV1QuantizeTest : public ::testing::TestWithParam<QuantizeFuncParams> {
QuantizeFpFunc quanFunc = params_.qFunc;
QuantizeFpFunc quanFuncRef = params_.qFuncRef;
const scan_order scanOrder = av1_default_scan_orders[txSize];
const SCAN_ORDER scanOrder = av1_default_scan_orders[txSize];
for (int i = 0; i < numTests; i++) {
int err_count = 0;
ref_eob = eob = -1;
......@@ -137,7 +137,7 @@ class AV1QuantizeTest : public ::testing::TestWithParam<QuantizeFuncParams> {
int log_scale = (txSize == TX_32X32);
QuantizeFpFunc quanFunc = params_.qFunc;
QuantizeFpFunc quanFuncRef = params_.qFuncRef;
const scan_order scanOrder = av1_default_scan_orders[txSize];
const SCAN_ORDER scanOrder = av1_default_scan_orders[txSize];
for (int i = 0; i < numTests; i++) {
ref_eob = eob = -1;
......
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