summaryrefslogtreecommitdiff
path: root/vp8/decoder/detokenize.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@google.com>2012-10-14 15:29:56 -0700
committerRonald S. Bultje <rbultje@google.com>2012-10-15 07:57:16 -0700
commit41e3a9ef14ce3e1da623e1e7e255e9376af3b7bd (patch)
tree58a245ac818531fc5be3dedb5390b6ff44cf6e2e /vp8/decoder/detokenize.c
parent5cfff7ce88b0dcd6684f78644449644412472e3a (diff)
downloadlibvpx-41e3a9ef14ce3e1da623e1e7e255e9376af3b7bd.tar
libvpx-41e3a9ef14ce3e1da623e1e7e255e9376af3b7bd.tar.gz
libvpx-41e3a9ef14ce3e1da623e1e7e255e9376af3b7bd.tar.bz2
libvpx-41e3a9ef14ce3e1da623e1e7e255e9376af3b7bd.zip
Add and consistently use PLANE_TYPE.
Change the macros PLANE_TYPE_{Y_NO_DC,Y2,UV,Y_WITH_DC} to a typed enum, and use this typed enum consistently across all places where relevant. In places where the type is implied (e.g. in functions that only handle second order planes or chroma planes), remove it as a function argument and instead hardcode the proper enum in the code directly. Change-Id: I93652b4a36aa43163d49c732b0bf5c4442738c47
Diffstat (limited to 'vp8/decoder/detokenize.c')
-rw-r--r--vp8/decoder/detokenize.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/vp8/decoder/detokenize.c b/vp8/decoder/detokenize.c
index 50e9a7dea..5b5ec7e2a 100644
--- a/vp8/decoder/detokenize.c
+++ b/vp8/decoder/detokenize.c
@@ -137,7 +137,7 @@ int get_token(int v) {
#if CONFIG_HYBRIDTRANSFORM
void static count_tokens_adaptive_scan(const MACROBLOCKD *xd, INT16 *qcoeff_ptr,
- int block, int type,
+ int block, PLANE_TYPE type,
TX_TYPE tx_type,
ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l,
int eob, int seg_eob,
@@ -182,7 +182,7 @@ void static count_tokens_adaptive_scan(const MACROBLOCKD *xd, INT16 *qcoeff_ptr,
}
#endif
-void static count_tokens(INT16 *qcoeff_ptr, int block, int type,
+void static count_tokens(INT16 *qcoeff_ptr, int block, PLANE_TYPE type,
ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l,
int eob, int seg_eob, FRAME_CONTEXT *const fc) {
int c, pt, token, band;
@@ -201,7 +201,7 @@ void static count_tokens(INT16 *qcoeff_ptr, int block, int type,
}
}
-void static count_tokens_8x8(INT16 *qcoeff_ptr, int block, int type,
+void static count_tokens_8x8(INT16 *qcoeff_ptr, int block, PLANE_TYPE type,
#if CONFIG_HYBRIDTRANSFORM8X8
TX_TYPE tx_type,
#endif
@@ -233,7 +233,7 @@ void static count_tokens_8x8(INT16 *qcoeff_ptr, int block, int type,
}
}
-void static count_tokens_16x16(INT16 *qcoeff_ptr, int block, int type,
+void static count_tokens_16x16(INT16 *qcoeff_ptr, int block, PLANE_TYPE type,
#if CONFIG_HYBRIDTRANSFORM16X16
TX_TYPE tx_type,
#endif
@@ -303,7 +303,8 @@ static int vp8_get_signed(BOOL_DECODER *br, int value_to_sign) {
} while (0);
static int vp8_decode_coefs(VP8D_COMP *dx, const MACROBLOCKD *xd,
- ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l, int type,
+ ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l,
+ PLANE_TYPE type,
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM16X16
TX_TYPE tx_type,
#endif
@@ -312,7 +313,7 @@ static int vp8_decode_coefs(VP8D_COMP *dx, const MACROBLOCKD *xd,
const int *coef_bands) {
FRAME_CONTEXT *const fc = &dx->common.fc;
BOOL_DECODER *br = xd->current_bc;
- int tmp, c = (type == 0);
+ int tmp, c = (type == PLANE_TYPE_Y_NO_DC);
const vp8_prob *prob, *coef_probs;
switch (block_type) {
@@ -450,7 +451,8 @@ int vp8_decode_mb_tokens_16x16(VP8D_COMP *pbi, MACROBLOCKD *xd) {
ENTROPY_CONTEXT* const L = (ENTROPY_CONTEXT *)xd->left_context;
char* const eobs = xd->eobs;
- int c, i, type, eobtotal = 0, seg_eob;
+ PLANE_TYPE type;
+ int c, i, eobtotal = 0, seg_eob;
const int segment_id = xd->mode_info_context->mbmi.segment_id;
const int seg_active = segfeature_active(xd, segment_id, SEG_LVL_EOB);
INT16 *qcoeff_ptr = &xd->qcoeff[0];
@@ -471,7 +473,6 @@ int vp8_decode_mb_tokens_16x16(VP8D_COMP *pbi, MACROBLOCKD *xd) {
// Luma block
{
const int* const scan = vp8_default_zig_zag1d_16x16;
- //printf("16: %d\n", tx_type);
c = vp8_decode_coefs(pbi, xd, A, L, type,
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM16X16
tx_type,
@@ -502,7 +503,6 @@ int vp8_decode_mb_tokens_16x16(VP8D_COMP *pbi, MACROBLOCKD *xd) {
ENTROPY_CONTEXT* const l = L + vp8_block2left_8x8[i];
const int* const scan = vp8_default_zig_zag1d_8x8;
- //printf("8: %d\n", tx_type);
c = vp8_decode_coefs(pbi, xd, a, l, type,
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM16X16
tx_type,
@@ -526,7 +526,8 @@ int vp8_decode_mb_tokens_8x8(VP8D_COMP *pbi, MACROBLOCKD *xd) {
ENTROPY_CONTEXT *const L = (ENTROPY_CONTEXT *)xd->left_context;
char *const eobs = xd->eobs;
- int c, i, type, eobtotal = 0, seg_eob;
+ PLANE_TYPE type;
+ int c, i, eobtotal = 0, seg_eob;
const int segment_id = xd->mode_info_context->mbmi.segment_id;
const int seg_active = segfeature_active(xd, segment_id, SEG_LVL_EOB);
INT16 *qcoeff_ptr = &xd->qcoeff[0];
@@ -633,8 +634,8 @@ int vp8_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *xd) {
char *const eobs = xd->eobs;
const int *scan = vp8_default_zig_zag1d;
-
- int c, i, type, eobtotal = 0, seg_eob = 16;
+ PLANE_TYPE type;
+ int c, i, eobtotal = 0, seg_eob = 16;
INT16 *qcoeff_ptr = &xd->qcoeff[0];
int segment_id = xd->mode_info_context->mbmi.segment_id;