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
diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c
index c5dfadd..192ec47 100644
--- a/av1/encoder/encodemb.c
+++ b/av1/encoder/encodemb.c
@@ -85,10 +85,10 @@
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 @@
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 @@
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 @@
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);
diff --git a/av1/encoder/quantize.c b/av1/encoder/quantize.c
index d3b8c1c..f3de6ad 100644
--- a/av1/encoder/quantize.c
+++ b/av1/encoder/quantize.c
@@ -344,7 +344,7 @@
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_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 @@
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 @@
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 @@
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 @@
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;
diff --git a/av1/encoder/quantize.h b/av1/encoder/quantize.h
index 7394887..1c32ee1 100644
--- a/av1/encoder/quantize.h
+++ b/av1/encoder/quantize.h
@@ -28,7 +28,7 @@
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 @@
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 @@
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 @@
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 @@
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,
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 4707517..9e3ca3d 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -135,7 +135,7 @@
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 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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
&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
diff --git a/av1/encoder/tokenize.c b/av1/encoder/tokenize.c
index 89ea05b..4e16d92 100644
--- a/av1/encoder/tokenize.c
+++ b/av1/encoder/tokenize.c
@@ -362,11 +362,11 @@
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 @@
#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 @@
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) {