ADST_ADST, // TM
};
-static INLINE TX_TYPE get_tx_type(PLANE_TYPE plane_type,
- const MACROBLOCKD *xd) {
- const MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi;
-
- if (plane_type != PLANE_TYPE_Y || xd->lossless || is_inter_block(mbmi))
- return DCT_DCT;
-
- return intra_mode_to_tx_type_lookup[mbmi->mode];
-}
-
-static INLINE TX_TYPE get_tx_type_4x4(PLANE_TYPE plane_type,
- const MACROBLOCKD *xd, int ib) {
+static INLINE TX_TYPE get_tx_type(PLANE_TYPE plane_type, const MACROBLOCKD *xd,
+ int block_idx) {
const MODE_INFO *const mi = xd->mi[0];
+ const MB_MODE_INFO *const mbmi = &mi->mbmi;
- if (plane_type != PLANE_TYPE_Y || xd->lossless || is_inter_block(&mi->mbmi))
+ if (plane_type != PLANE_TYPE_Y || xd->lossless || is_inter_block(mbmi) ||
+ mbmi->tx_size >= TX_32X32)
return DCT_DCT;
- return intra_mode_to_tx_type_lookup[get_y_mode(mi, ib)];
+ return intra_mode_to_tx_type_lookup[get_y_mode(mi, block_idx)];
}
void vp10_setup_block_planes(MACROBLOCKD *xd, int ss_x, int ss_y);
token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >> 1;
}
-static INLINE const scan_order *get_scan(const MACROBLOCKD *xd, TX_SIZE tx_size,
- PLANE_TYPE type, int block_idx) {
- const MODE_INFO *const mi = xd->mi[0];
-
- if (is_inter_block(&mi->mbmi) || type != PLANE_TYPE_Y || xd->lossless) {
- return &vp10_default_scan_orders[tx_size];
- } else {
- const PREDICTION_MODE mode = get_y_mode(mi, block_idx);
- return &vp10_scan_orders[tx_size][intra_mode_to_tx_type_lookup[mode]];
- }
+static INLINE const scan_order *get_scan(TX_SIZE tx_size, TX_TYPE tx_type) {
+ return &vp10_scan_orders[tx_size][tx_type];
}
#ifdef __cplusplus
TX_SIZE tx_size) {
struct macroblockd_plane *const pd = &xd->plane[plane];
PREDICTION_MODE mode = (plane == 0) ? mbmi->mode : mbmi->uv_mode;
+ PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
uint8_t *dst;
+ int block_idx = (row << 1) + col;
dst = &pd->dst.buf[4 * row * pd->dst.stride + 4 * col];
if (mbmi->sb_type < BLOCK_8X8)
col, row, plane);
if (!mbmi->skip) {
- const TX_TYPE tx_type = (plane || xd->lossless) ?
- DCT_DCT : intra_mode_to_tx_type_lookup[mode];
- const scan_order *sc = (plane || xd->lossless) ?
- &vp10_default_scan_orders[tx_size] : &vp10_scan_orders[tx_size][tx_type];
+ TX_TYPE tx_type = get_tx_type(plane_type, xd, block_idx);
+ const scan_order *sc = get_scan(tx_size, tx_type);
const int eob = vp10_decode_block_tokens(xd, plane, sc, col, row, tx_size,
- r, mbmi->segment_id);
+ r, mbmi->segment_id);
inverse_transform_block_intra(xd, plane, tx_type, tx_size,
dst, pd->dst.stride, eob);
}
MB_MODE_INFO *const mbmi, int plane,
int row, int col, TX_SIZE tx_size) {
struct macroblockd_plane *const pd = &xd->plane[plane];
- const scan_order *sc = &vp10_default_scan_orders[tx_size];
+ 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);
+ const scan_order *sc = get_scan(tx_size, tx_type);
const int eob = vp10_decode_block_tokens(xd, plane, sc, col, row, tx_size, r,
mbmi->segment_id);
const int mul = 1 + (tx_size == TX_32X32);
const int16_t *dequant_ptr = pd->dequant;
const uint8_t *const band_translate = get_band_translate(tx_size);
- const scan_order *const so = get_scan(xd, tx_size, type, block);
+ TX_TYPE tx_type = get_tx_type(type, xd, block);
+ const scan_order *const so = get_scan(tx_size, tx_type);
const int16_t *const scan = so->scan;
const int16_t *const nb = so->neighbors;
int next = eob, sz = 0;
MACROBLOCKD *const xd = &x->e_mbd;
const struct macroblock_plane *const p = &x->plane[plane];
const struct macroblockd_plane *const pd = &xd->plane[plane];
- const scan_order *const scan_order = &vp10_default_scan_orders[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);
+ const scan_order *const scan_order = get_scan(tx_size, tx_type);
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);
MACROBLOCKD *const xd = &x->e_mbd;
const struct macroblock_plane *const p = &x->plane[plane];
const struct macroblockd_plane *const pd = &xd->plane[plane];
- const scan_order *const scan_order = &vp10_default_scan_orders[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);
+ const scan_order *const scan_order = get_scan(tx_size, tx_type);
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);
tran_low_t *coeff = BLOCK_OFFSET(p->coeff, block);
tran_low_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block);
tran_low_t *dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
- const scan_order *scan_order;
- TX_TYPE tx_type = DCT_DCT;
+ PLANE_TYPE plane_type = (plane == 0) ? PLANE_TYPE_Y : PLANE_TYPE_UV;
+ TX_TYPE tx_type = get_tx_type(plane_type, xd, block);
+ const scan_order *const scan_order = get_scan(tx_size, tx_type);
PREDICTION_MODE mode;
const int bwl = b_width_log2_lookup[plane_bsize];
const int diff_stride = 4 * (1 << bwl);
src = &p->src.buf[4 * (j * src_stride + i)];
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);
- scan_order = &vp10_scan_orders[TX_4X4][tx_type];
- mode = plane == 0 ? get_y_mode(xd->mi[0], block) : mbmi->uv_mode;
- } else {
- mode = plane == 0 ? mbmi->mode : mbmi->uv_mode;
- if (tx_size == TX_32X32) {
- scan_order = &vp10_default_scan_orders[TX_32X32];
- } else {
- tx_type = get_tx_type(pd->plane_type, xd);
- scan_order = &vp10_scan_orders[tx_size][tx_type];
- }
- }
-
+ mode = plane == 0 ? get_y_mode(xd->mi[0], block) : mbmi->uv_mode;
vp10_predict_intra_block(xd, bwl, tx_size, mode, x->skip_encode ? src : dst,
x->skip_encode ? src_stride : dst_stride,
dst, dst_stride, i, j, plane);
for (r = 0; r < max_blocks_high; r += block_step) {
for (c = 0; c < num_4x4_w; c += block_step) {
if (c < max_blocks_wide) {
- const scan_order *const scan_order = &vp10_default_scan_orders[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);
+ const scan_order *const scan_order = get_scan(tx_size, tx_type);
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);
int use_fast_coef_casting) {
MACROBLOCKD *const xd = &x->e_mbd;
const struct macroblockd_plane *const pd = &xd->plane[plane];
+ TX_TYPE tx_type;
struct rdcost_block_args args;
vp10_zero(args);
args.x = x;
vp10_get_entropy_contexts(bsize, tx_size, pd, args.t_above, args.t_left);
- args.so = get_scan(xd, tx_size, pd->plane_type, 0);
+ tx_type = get_tx_type(pd->plane_type, xd, 0);
+ args.so = get_scan(tx_size, tx_type);
vp10_foreach_transformed_block_in_plane(xd, bsize, plane,
block_rd_txfm, &args);
vpx_highbd_subtract_block(4, 4, src_diff, 8, src, src_stride,
dst, dst_stride, xd->bd);
if (xd->lossless) {
- const scan_order *so = &vp10_default_scan_orders[TX_4X4];
+ TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block);
+ const scan_order *so = get_scan(TX_4X4, tx_type);
vp10_highbd_fwht4x4(src_diff, coeff, 8);
vp10_regular_quantize_b_4x4(x, 0, block, so->scan, so->iscan);
ratey += cost_coeffs(x, 0, block, tempa + idx, templ + idy, TX_4X4,
p->eobs[block], xd->bd);
} else {
int64_t unused;
- const TX_TYPE tx_type = get_tx_type_4x4(PLANE_TYPE_Y, xd, block);
- const scan_order *so = &vp10_scan_orders[TX_4X4][tx_type];
+ TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block);
+ const scan_order *so = get_scan(TX_4X4, tx_type);
if (tx_type == DCT_DCT)
vpx_highbd_fdct4x4(src_diff, coeff, 8);
else
vpx_subtract_block(4, 4, src_diff, 8, src, src_stride, dst, dst_stride);
if (xd->lossless) {
- const scan_order *so = &vp10_default_scan_orders[TX_4X4];
+ TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block);
+ const scan_order *so = get_scan(TX_4X4, tx_type);
vp10_fwht4x4(src_diff, coeff, 8);
vp10_regular_quantize_b_4x4(x, 0, block, so->scan, so->iscan);
ratey += cost_coeffs(x, 0, block, tempa + idx, templ + idy, TX_4X4,
p->eobs[block]);
} else {
int64_t unused;
- const TX_TYPE tx_type = get_tx_type_4x4(PLANE_TYPE_Y, xd, block);
- const scan_order *so = &vp10_scan_orders[TX_4X4][tx_type];
+ TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block);
+ const scan_order *so = get_scan(TX_4X4, tx_type);
vp10_fht4x4(src_diff, coeff, 8, tx_type);
vp10_regular_quantize_b_4x4(x, 0, block, so->scan, so->iscan);
ratey += cost_coeffs(x, 0, block, tempa + idx, templ + idy, TX_4X4,
pd->dst.stride)];
int64_t thisdistortion = 0, thissse = 0;
int thisrate = 0, ref;
- const scan_order *so = &vp10_default_scan_orders[TX_4X4];
+ TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, i);
+ const scan_order *so = get_scan(TX_4X4, tx_type);
const int is_compound = has_second_ref(&mi->mbmi);
const InterpKernel *kernel = vp10_filter_kernels[mi->mbmi.interp_filter];
const tran_low_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block);
const int segment_id = mbmi->segment_id;
const int16_t *scan, *nb;
- const scan_order *so;
+ const TX_TYPE tx_type = get_tx_type(type, xd, block);
+ const scan_order *const so = get_scan(tx_size, tx_type);
const int ref = is_inter_block(mbmi);
unsigned int (*const counts)[COEFF_CONTEXTS][ENTROPY_TOKENS] =
td->rd_counts.coef_counts[tx_size][type][ref];
pt = get_entropy_context(tx_size, pd->above_context + aoff,
pd->left_context + loff);
- so = get_scan(xd, tx_size, type, block);
scan = so->scan;
nb = so->neighbors;
c = 0;