summaryrefslogtreecommitdiff
path: root/vp9/decoder
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@google.com>2012-11-23 11:23:50 -0800
committerRonald S. Bultje <rbultje@google.com>2012-11-24 21:22:42 -0800
commit25b609b62bbb3ee6b8b4c303675a6ff54484739a (patch)
tree4baa094bd189bc850aa8800c013c67e74da642b8 /vp9/decoder
parent9dc7d4fb976d3ab52ee03822170cd484ff316be5 (diff)
downloadlibvpx-25b609b62bbb3ee6b8b4c303675a6ff54484739a.tar
libvpx-25b609b62bbb3ee6b8b4c303675a6ff54484739a.tar.gz
libvpx-25b609b62bbb3ee6b8b4c303675a6ff54484739a.tar.bz2
libvpx-25b609b62bbb3ee6b8b4c303675a6ff54484739a.zip
Move switch(tx_size) around txsize to detokenize.c.
Add a new function vp9_decode_mb_tokens() that handles the switch between different per-tx-size detokenize functions. Make actual implementations (vp9_decode_mb_tokens_NxN()) static. Change-Id: I9e0c4ef410bfa90128a02b472c079a955776816d
Diffstat (limited to 'vp9/decoder')
-rw-r--r--vp9/decoder/decodframe.c16
-rw-r--r--vp9/decoder/detokenize.c36
-rw-r--r--vp9/decoder/detokenize.h10
3 files changed, 32 insertions, 30 deletions
diff --git a/vp9/decoder/decodframe.c b/vp9/decoder/decodframe.c
index 46821073f..b4b6e2f34 100644
--- a/vp9/decoder/decodframe.c
+++ b/vp9/decoder/decodframe.c
@@ -287,13 +287,7 @@ static void decode_superblock(VP9D_COMP *pbi, MACROBLOCKD *xd,
xd->eobs[i] = 0;
}
- if (tx_size == TX_16X16) {
- eobtotal = vp9_decode_mb_tokens_16x16(pbi, xd, bc);
- } else if (tx_size == TX_8X8) {
- eobtotal = vp9_decode_mb_tokens_8x8(pbi, xd, bc);
- } else {
- eobtotal = vp9_decode_mb_tokens_4x4(pbi, xd, bc);
- }
+ eobtotal = vp9_decode_mb_tokens(pbi, xd, bc);
if (eobtotal == 0) { // skip loopfilter
xd->mode_info_context->mbmi.mb_skip_coeff = 1;
continue;
@@ -391,12 +385,8 @@ static void decode_macroblock(VP9D_COMP *pbi, MACROBLOCKD *xd,
xd->block[i].eob = 0;
xd->eobs[i] = 0;
}
- if (tx_size == TX_16X16) {
- eobtotal = vp9_decode_mb_tokens_16x16(pbi, xd, bc);
- } else if (tx_size == TX_8X8) {
- eobtotal = vp9_decode_mb_tokens_8x8(pbi, xd, bc);
- } else if (mode != B_PRED) {
- eobtotal = vp9_decode_mb_tokens_4x4(pbi, xd, bc);
+ if (mode != B_PRED) {
+ eobtotal = vp9_decode_mb_tokens(pbi, xd, bc);
}
}
diff --git a/vp9/decoder/detokenize.c b/vp9/decoder/detokenize.c
index 29ec9787b..b6823e7ef 100644
--- a/vp9/decoder/detokenize.c
+++ b/vp9/decoder/detokenize.c
@@ -256,9 +256,9 @@ static int get_eob(MACROBLOCKD* const xd, int segment_id, int eob_max) {
}
-int vp9_decode_mb_tokens_16x16(VP9D_COMP* const pbi,
- MACROBLOCKD* const xd,
- BOOL_DECODER* const bc) {
+static int vp9_decode_mb_tokens_16x16(VP9D_COMP* const pbi,
+ MACROBLOCKD* const xd,
+ BOOL_DECODER* const bc) {
ENTROPY_CONTEXT* const A = (ENTROPY_CONTEXT *)xd->above_context;
ENTROPY_CONTEXT* const L = (ENTROPY_CONTEXT *)xd->left_context;
unsigned short* const eobs = xd->eobs;
@@ -297,9 +297,9 @@ int vp9_decode_mb_tokens_16x16(VP9D_COMP* const pbi,
return eobtotal;
}
-int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
- MACROBLOCKD* const xd,
- BOOL_DECODER* const bc) {
+static int vp9_decode_mb_tokens_8x8(VP9D_COMP* const pbi,
+ MACROBLOCKD* const xd,
+ BOOL_DECODER* const bc) {
ENTROPY_CONTEXT *const A = (ENTROPY_CONTEXT *)xd->above_context;
ENTROPY_CONTEXT *const L = (ENTROPY_CONTEXT *)xd->left_context;
unsigned short *const eobs = xd->eobs;
@@ -419,9 +419,9 @@ int vp9_decode_mb_tokens_4x4_uv(VP9D_COMP* const dx,
return eobtotal;
}
-int vp9_decode_mb_tokens_4x4(VP9D_COMP* const dx,
- MACROBLOCKD* const xd,
- BOOL_DECODER* const bc) {
+static int vp9_decode_mb_tokens_4x4(VP9D_COMP* const dx,
+ MACROBLOCKD* const xd,
+ BOOL_DECODER* const bc) {
int i, eobtotal = 0;
PLANE_TYPE type;
@@ -440,3 +440,21 @@ int vp9_decode_mb_tokens_4x4(VP9D_COMP* const dx,
return eobtotal + vp9_decode_mb_tokens_4x4_uv(dx, xd, bc);
}
+
+int vp9_decode_mb_tokens(VP9D_COMP* const dx,
+ MACROBLOCKD* const xd,
+ BOOL_DECODER* const bc) {
+ const TX_SIZE tx_size = xd->mode_info_context->mbmi.txfm_size;
+ int eobtotal;
+
+ if (tx_size == TX_16X16) {
+ eobtotal = vp9_decode_mb_tokens_16x16(dx, xd, bc);
+ } else if (tx_size == TX_8X8) {
+ eobtotal = vp9_decode_mb_tokens_8x8(dx, xd, bc);
+ } else {
+ assert(tx_size == TX_4X4);
+ eobtotal = vp9_decode_mb_tokens_4x4(dx, xd, bc);
+ }
+
+ return eobtotal;
+}
diff --git a/vp9/decoder/detokenize.h b/vp9/decoder/detokenize.h
index a8f78f4cc..9f00d297d 100644
--- a/vp9/decoder/detokenize.h
+++ b/vp9/decoder/detokenize.h
@@ -20,16 +20,10 @@ int vp9_decode_coefs_4x4(VP9D_COMP *dx, MACROBLOCKD *xd,
BOOL_DECODER* const bc,
PLANE_TYPE type, int i);
-int vp9_decode_mb_tokens_4x4(VP9D_COMP* const, MACROBLOCKD* const,
- BOOL_DECODER* const);
+int vp9_decode_mb_tokens(VP9D_COMP* const, MACROBLOCKD* const,
+ BOOL_DECODER* const);
int vp9_decode_mb_tokens_4x4_uv(VP9D_COMP* const dx, MACROBLOCKD* const xd,
BOOL_DECODER* const bc);
-int vp9_decode_mb_tokens_8x8(VP9D_COMP* const, MACROBLOCKD* const,
- BOOL_DECODER* const);
-
-int vp9_decode_mb_tokens_16x16(VP9D_COMP* const, MACROBLOCKD* const,
- BOOL_DECODER* const);
-
#endif /* DETOKENIZE_H */