ref: 55c2646666f35bb8841e50cfdafd9c5c695948bc
parent: 155b9416b36d9708b18f22ef2bc396fba264f513
parent: 97d1f1aaaeead02e59b4124b29de65fb49cf05a7
author: Jingning Han <[email protected]>
date: Tue Jul 7 19:09:39 EDT 2015
Merge "Rework scan order fetch logic for decoder"
--- a/vp9/decoder/vp9_decodeframe.c
+++ b/vp9/decoder/vp9_decodeframe.c
@@ -315,7 +315,10 @@
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 @@
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],
--- a/vp9/decoder/vp9_detokenize.c
+++ b/vp9/decoder/vp9_detokenize.c
@@ -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 @@
}
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 @@
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;
}
--- a/vp9/decoder/vp9_detokenize.h
+++ b/vp9/decoder/vp9_detokenize.h
@@ -14,6 +14,7 @@
#include "vp9/decoder/vp9_decoder.h"
#include "vp9/decoder/vp9_reader.h"
+#include "vp9/common/vp9_scan.h"
#ifdef __cplusplus
extern "C" {
@@ -20,7 +21,7 @@
#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);