Commit d6667dd5 authored by Jim Bankoski's avatar Jim Bankoski
Browse files

scan order table lookup same for encoder and decoder

Change-Id: I473947b5ca70b7a81151926284bff86f8555492a
parent 8cf352ab
...@@ -186,23 +186,19 @@ static int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a, ...@@ -186,23 +186,19 @@ static int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a,
static void get_scan(const MACROBLOCKD *xd, TX_SIZE tx_size, static void get_scan(const MACROBLOCKD *xd, TX_SIZE tx_size,
PLANE_TYPE type, int block_idx, PLANE_TYPE type, int block_idx,
const int16_t **scan, const int16_t **scan_nb) { const int16_t **scan, const int16_t **scan_nb) {
switch (tx_size) { const MODE_INFO *const mi = xd->mi_8x8[0];
case TX_4X4: const MB_MODE_INFO *const mbmi = &mi->mbmi;
get_scan_nb_4x4(get_tx_type_4x4(type, xd, block_idx), scan, scan_nb); const scan_order *so;
break;
case TX_8X8: if (is_inter_block(mbmi) || type != PLANE_TYPE_Y_WITH_DC || xd->lossless) {
get_scan_nb_8x8(get_tx_type_8x8(type, xd), scan, scan_nb); so = &inter_scan_orders[tx_size];
break; } else {
case TX_16X16: const MB_PREDICTION_MODE mode =
get_scan_nb_16x16(get_tx_type_16x16(type, xd), scan, scan_nb); mbmi->sb_type < BLOCK_8X8 ? mi->bmi[block_idx].as_mode : mbmi->mode;
break; so = &intra_scan_orders[tx_size][mode];
case TX_32X32:
*scan = vp9_default_scan_32x32;
*scan_nb = vp9_default_scan_32x32_neighbors;
break;
default:
assert(!"Invalid transform size.");
} }
*scan = so->scan;
*scan_nb = so->neighbors;
} }
#endif // VP9_COMMON_VP9_ENTROPY_H_ #endif // VP9_COMMON_VP9_ENTROPY_H_
...@@ -111,22 +111,11 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd, ...@@ -111,22 +111,11 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
const uint8_t *cat6; const uint8_t *cat6;
const uint8_t *band_translate = get_band_translate(tx_size); const uint8_t *band_translate = get_band_translate(tx_size);
const int dq_shift = (tx_size == TX_32X32); const int dq_shift = (tx_size == TX_32X32);
const MODE_INFO *const mi = xd->mi_8x8[0];
const MB_MODE_INFO *const mbmi = &mi->mbmi;
scan_order const *so;
int v; int v;
int16_t dqv = dq[0]; int16_t dqv = dq[0];
if (mbmi->ref_frame[0] > 0 || type != PLANE_TYPE_Y_WITH_DC || xd->lossless) { get_scan(xd, tx_size, type, block_idx, &scan, &nb);
so = &inter_scan_orders[tx_size];
} else {
MB_PREDICTION_MODE mode = mbmi->mode;
if (mbmi->sb_type < BLOCK_8X8)
mode = mi->bmi[block_idx].as_mode;
so = &intra_scan_orders[tx_size][mode];
}
scan = so->scan;
nb = so->neighbors;
while (c < seg_eob) { while (c < seg_eob) {
int val; int val;
if (c) if (c)
......
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