Commit dfeaaeb0 authored by Scott LaVarnway's avatar Scott LaVarnway Committed by Gerrit Code Review

Merge "VP9: remove plane_type from macroblockd_plane"

parents b1d85bf6 2f8625d8
......@@ -129,7 +129,6 @@ void vp9_setup_block_planes(MACROBLOCKD *xd, int ss_x, int ss_y) {
int i;
for (i = 0; i < MAX_MB_PLANE; i++) {
xd->plane[i].plane_type = i ? PLANE_TYPE_UV : PLANE_TYPE_Y;
xd->plane[i].subsampling_x = i ? ss_x : 0;
xd->plane[i].subsampling_y = i ? ss_y : 0;
}
......
......@@ -120,7 +120,6 @@ struct buf_2d {
struct macroblockd_plane {
tran_low_t *dqcoeff;
PLANE_TYPE plane_type;
int subsampling_x;
int subsampling_y;
struct buf_2d dst;
......@@ -200,6 +199,10 @@ typedef struct macroblockd {
struct vpx_internal_error_info *error_info;
} MACROBLOCKD;
static INLINE PLANE_TYPE get_plane_type(int plane) {
return (PLANE_TYPE)(plane > 0);
}
static INLINE BLOCK_SIZE get_subsize(BLOCK_SIZE bsize,
PARTITION_TYPE partition) {
return subsize_lookup[partition][bsize];
......
......@@ -358,7 +358,7 @@ static INLINE void vp9_init_macroblockd(VP9_COMMON *cm, MACROBLOCKD *xd,
xd->above_context[i] = cm->above_context +
i * sizeof(*cm->above_context) * 2 * mi_cols_aligned_to_sb(cm->mi_cols);
if (xd->plane[i].plane_type == PLANE_TYPE_Y) {
if (get_plane_type(i) == PLANE_TYPE_Y) {
memcpy(xd->plane[i].seg_dequant, cm->y_dequant, sizeof(cm->y_dequant));
} else {
memcpy(xd->plane[i].seg_dequant, cm->uv_dequant, sizeof(cm->uv_dequant));
......
......@@ -259,7 +259,7 @@ int vp9_decode_block_tokens(MACROBLOCKD *xd,
const int16_t *const dequant = pd->seg_dequant[seg_id];
const int ctx = get_entropy_context(tx_size, pd->above_context + x,
pd->left_context + y);
const int eob = decode_coefs(xd, pd->plane_type,
const int eob = decode_coefs(xd, get_plane_type(plane),
pd->dqcoeff, tx_size,
dequant, ctx, sc->scan, sc->neighbors, r);
dec_set_contexts(xd, pd, tx_size, eob > 0, x, y);
......
......@@ -99,7 +99,7 @@ static int optimize_b(MACROBLOCK *mb, int plane, int block,
tran_low_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block);
tran_low_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
const int eob = p->eobs[block];
const PLANE_TYPE type = pd->plane_type;
const PLANE_TYPE type = get_plane_type(plane);
const int default_eob = 16 << (tx_size << 1);
const int mul = 1 + (tx_size == TX_32X32);
const int16_t *dequant_ptr = pd->dequant;
......@@ -789,7 +789,7 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
src_diff = &p->src_diff[4 * (j * diff_stride + i)];
if (tx_size == TX_4X4) {
tx_type = get_tx_type_4x4(pd->plane_type, xd, block);
tx_type = get_tx_type_4x4(get_plane_type(plane), xd, block);
scan_order = &vp9_scan_orders[TX_4X4][tx_type];
mode = plane == 0 ? get_y_mode(xd->mi[0], block) : mbmi->uv_mode;
} else {
......@@ -797,7 +797,7 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
if (tx_size == TX_32X32) {
scan_order = &vp9_default_scan_orders[TX_32X32];
} else {
tx_type = get_tx_type(pd->plane_type, xd);
tx_type = get_tx_type(get_plane_type(plane), xd);
scan_order = &vp9_scan_orders[tx_size][tx_type];
}
}
......
......@@ -341,8 +341,7 @@ static int cost_coeffs(MACROBLOCK *x,
MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
const struct macroblock_plane *p = &x->plane[plane];
const struct macroblockd_plane *pd = &xd->plane[plane];
const PLANE_TYPE type = pd->plane_type;
const PLANE_TYPE type = get_plane_type(plane);
const int16_t *band_count = &band_counts[tx_size][1];
const int eob = p->eobs[block];
const tran_low_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block);
......@@ -358,8 +357,8 @@ static int cost_coeffs(MACROBLOCK *x,
#endif
// Check for consistency of tx_size with mode info
assert(type == PLANE_TYPE_Y ? mbmi->tx_size == tx_size
: get_uv_tx_size(mbmi, pd) == tx_size);
assert(type == PLANE_TYPE_Y ? mbmi->tx_size == tx_size :
get_uv_tx_size(mbmi, &xd->plane[plane]) == tx_size);
if (eob == 0) {
// single eob token
......@@ -570,7 +569,7 @@ static void txfm_rd_in_plane(MACROBLOCK *x,
vp9_get_entropy_contexts(bsize, tx_size, pd, args.t_above, args.t_left);
args.so = get_scan(xd, tx_size, pd->plane_type, 0);
args.so = get_scan(xd, tx_size, get_plane_type(plane), 0);
vp9_foreach_transformed_block_in_plane(xd, bsize, plane,
block_rd_txfm, &args);
......
......@@ -503,7 +503,7 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
int c;
TOKENEXTRA *t = *tp; /* store tokens starting here */
int eob = p->eobs[block];
const PLANE_TYPE type = pd->plane_type;
const PLANE_TYPE type = get_plane_type(plane);
const tran_low_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block);
const int segment_id = mbmi->segment_id;
const int16_t *scan, *nb;
......
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