Commit 55c26466 authored by Jingning Han's avatar Jingning Han Committed by Gerrit Code Review
Browse files

Merge "Rework scan order fetch logic for decoder"

parents 155b9416 97d1f1aa
...@@ -315,7 +315,10 @@ static void predict_and_reconstruct_intra_block(int plane, int block, ...@@ -315,7 +315,10 @@ static void predict_and_reconstruct_intra_block(int plane, int block,
x, y, plane); x, y, plane);
if (!mi->mbmi.skip) { 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, plane_bsize, x, y, tx_size,
args->r, args->seg_id); args->r, args->seg_id);
inverse_transform_block(xd, plane, block, tx_size, dst, pd->dst.stride, 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, ...@@ -337,8 +340,9 @@ static void reconstruct_inter_block(int plane, int block,
MACROBLOCKD *const xd = args->xd; MACROBLOCKD *const xd = args->xd;
struct macroblockd_plane *const pd = &xd->plane[plane]; struct macroblockd_plane *const pd = &xd->plane[plane];
int x, y, eob; 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); 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); x, y, tx_size, args->r, args->seg_id);
inverse_transform_block(xd, plane, block, tx_size, inverse_transform_block(xd, plane, block, tx_size,
&pd->dst.buf[4 * y * pd->dst.stride + 4 * x], &pd->dst.buf[4 * y * pd->dst.stride + 4 * x],
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#if CONFIG_COEFFICIENT_RANGE_CHECKING #if CONFIG_COEFFICIENT_RANGE_CHECKING
#include "vp9/common/vp9_idct.h" #include "vp9/common/vp9_idct.h"
#endif #endif
#include "vp9/common/vp9_scan.h"
#include "vp9/decoder/vp9_detokenize.h" #include "vp9/decoder/vp9_detokenize.h"
...@@ -207,7 +206,7 @@ static int decode_coefs(const MACROBLOCKD *xd, ...@@ -207,7 +206,7 @@ static int decode_coefs(const MACROBLOCKD *xd,
} }
int vp9_decode_block_tokens(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, BLOCK_SIZE plane_bsize, int x, int y,
TX_SIZE tx_size, vp9_reader *r, TX_SIZE tx_size, vp9_reader *r,
int seg_id) { int seg_id) {
...@@ -215,10 +214,9 @@ int vp9_decode_block_tokens(MACROBLOCKD *xd, ...@@ -215,10 +214,9 @@ int vp9_decode_block_tokens(MACROBLOCKD *xd,
const int16_t *const dequant = pd->seg_dequant[seg_id]; const int16_t *const dequant = pd->seg_dequant[seg_id];
const int ctx = get_entropy_context(tx_size, pd->above_context + x, const int ctx = get_entropy_context(tx_size, pd->above_context + x,
pd->left_context + y); 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, const int eob = decode_coefs(xd, pd->plane_type,
pd->dqcoeff, tx_size, 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); vp9_set_contexts(xd, pd, plane_bsize, tx_size, eob > 0, x, y);
return eob; return eob;
} }
......
...@@ -14,13 +14,14 @@ ...@@ -14,13 +14,14 @@
#include "vp9/decoder/vp9_decoder.h" #include "vp9/decoder/vp9_decoder.h"
#include "vp9/decoder/vp9_reader.h" #include "vp9/decoder/vp9_reader.h"
#include "vp9/common/vp9_scan.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
int vp9_decode_block_tokens(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, BLOCK_SIZE plane_bsize, int x, int y,
TX_SIZE tx_size, vp9_reader *r, TX_SIZE tx_size, vp9_reader *r,
int seg_id); 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