Commit 97d1f1aa authored by Jingning Han's avatar Jingning Han

Rework scan order fetch logic for decoder

Save redundant call for getting prediction mode to obtain scan
order for detokenization.

Change-Id: I0683ef119f1579d1261ed5d59052a1745b68ef6f
parent a652048e
......@@ -315,7 +315,10 @@ static void predict_and_reconstruct_intra_block(int plane, int block,
x, y, plane);
if (!mi->mbmi.skip) {
const int eob = vp9_decode_block_tokens(xd, plane, block,
const scan_order *sc = (plane || xd->lossless) ?
&vp9_default_scan_orders[tx_size] :
&vp9_scan_orders[tx_size][intra_mode_to_tx_type_lookup[mode]];
const int eob = vp9_decode_block_tokens(xd, plane, sc,
plane_bsize, x, y, tx_size,
args->r, args->seg_id);
inverse_transform_block(xd, plane, block, tx_size, dst, pd->dst.stride,
......@@ -337,8 +340,9 @@ static void reconstruct_inter_block(int plane, int block,
MACROBLOCKD *const xd = args->xd;
struct macroblockd_plane *const pd = &xd->plane[plane];
int x, y, eob;
const scan_order *sc = &vp9_default_scan_orders[tx_size];
txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &x, &y);
eob = vp9_decode_block_tokens(xd, plane, block, plane_bsize,
eob = vp9_decode_block_tokens(xd, plane, sc, plane_bsize,
x, y, tx_size, args->r, args->seg_id);
inverse_transform_block(xd, plane, block, tx_size,
&pd->dst.buf[4 * y * pd->dst.stride + 4 * x],
......
......@@ -17,7 +17,6 @@
#if CONFIG_COEFFICIENT_RANGE_CHECKING
#include "vp9/common/vp9_idct.h"
#endif
#include "vp9/common/vp9_scan.h"
#include "vp9/decoder/vp9_detokenize.h"
......@@ -207,7 +206,7 @@ static int decode_coefs(const MACROBLOCKD *xd,
}
int vp9_decode_block_tokens(MACROBLOCKD *xd,
int plane, int block,
int plane, const scan_order *sc,
BLOCK_SIZE plane_bsize, int x, int y,
TX_SIZE tx_size, vp9_reader *r,
int seg_id) {
......@@ -215,10 +214,9 @@ 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 scan_order *so = get_scan(xd, tx_size, pd->plane_type, block);
const int eob = decode_coefs(xd, pd->plane_type,
pd->dqcoeff, tx_size,
dequant, ctx, so->scan, so->neighbors, r);
dequant, ctx, sc->scan, sc->neighbors, r);
vp9_set_contexts(xd, pd, plane_bsize, tx_size, eob > 0, x, y);
return eob;
}
......
......@@ -14,13 +14,14 @@
#include "vp9/decoder/vp9_decoder.h"
#include "vp9/decoder/vp9_reader.h"
#include "vp9/common/vp9_scan.h"
#ifdef __cplusplus
extern "C" {
#endif
int vp9_decode_block_tokens(MACROBLOCKD *xd,
int plane, int block,
int plane, const scan_order *sc,
BLOCK_SIZE plane_bsize, int x, int y,
TX_SIZE tx_size, vp9_reader *r,
int seg_id);
......
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