diff options
author | Emeric Grange <emeric.grange@gmail.com> | 2011-11-14 19:59:38 +0100 |
---|---|---|
committer | Emeric Grange <emeric.grange@gmail.com> | 2012-06-24 16:57:32 +0200 |
commit | d9cfde4f5fd2366ba66692997678d955513dea36 (patch) | |
tree | d51560f0217a8ff2dbf383ced8b9e1f9bd87d0af | |
parent | dd26593a4e46e5b7545b93c4304bc036e513a44b (diff) |
g3dvl: Better naming of the boolean decoder across the different files
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/common/blockd.h | 2 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/decoder/dboolhuff.c | 30 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/decoder/dboolhuff.h | 60 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/decoder/decodemv.c | 121 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/decoder/detokenize.c | 20 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/decoder/onyxd_if.c | 2 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/decoder/onyxd_int.h | 8 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/decoder/treereader.h | 6 |
8 files changed, 124 insertions, 125 deletions
diff --git a/src/gallium/auxiliary/vl/vp8/common/blockd.h b/src/gallium/auxiliary/vl/vp8/common/blockd.h index 2734a5372f..18cb36abe0 100644 --- a/src/gallium/auxiliary/vl/vp8/common/blockd.h +++ b/src/gallium/auxiliary/vl/vp8/common/blockd.h @@ -250,7 +250,7 @@ typedef struct MacroBlockD vp8_subpix_fn_t subpixel_predict8x8; vp8_subpix_fn_t subpixel_predict16x16; - void *current_bc; + void *current_bd; int corrupted; diff --git a/src/gallium/auxiliary/vl/vp8/decoder/dboolhuff.c b/src/gallium/auxiliary/vl/vp8/decoder/dboolhuff.c index 19d30b1f91..c5bf2fd404 100644 --- a/src/gallium/auxiliary/vl/vp8/decoder/dboolhuff.c +++ b/src/gallium/auxiliary/vl/vp8/decoder/dboolhuff.c @@ -11,39 +11,39 @@ #include "dboolhuff.h" -int vp8dx_start_decode(BOOL_DECODER *br, +int vp8dx_start_decode(BOOL_DECODER *bd, const unsigned char *data, unsigned int data_size) { - br->user_buffer_end = data + data_size; - br->user_buffer = data; - br->value = 0; - br->count = -8; - br->range = 255; + bd->user_buffer_end = data + data_size; + bd->user_buffer = data; + bd->value = 0; + bd->count = -8; + bd->range = 255; if (data_size && !data) return 1; /* Populate the buffer */ - vp8dx_bool_decoder_fill(br); + vp8dx_bool_decoder_fill(bd); return 0; } -void vp8dx_bool_decoder_fill(BOOL_DECODER *br) +void vp8dx_bool_decoder_fill(BOOL_DECODER *bd) { const unsigned char *bufptr; const unsigned char *bufend; VP8_BD_VALUE value; int count; - bufend = br->user_buffer_end; - bufptr = br->user_buffer; - value = br->value; - count = br->count; + bufend = bd->user_buffer_end; + bufptr = bd->user_buffer; + value = bd->value; + count = bd->count; VP8DX_BOOL_DECODER_FILL(count, value, bufptr, bufend); - br->user_buffer = bufptr; - br->value = value; - br->count = count; + bd->user_buffer = bufptr; + bd->value = value; + bd->count = count; } diff --git a/src/gallium/auxiliary/vl/vp8/decoder/dboolhuff.h b/src/gallium/auxiliary/vl/vp8/decoder/dboolhuff.h index fd54eb3f66..a10a7a44bc 100644 --- a/src/gallium/auxiliary/vl/vp8/decoder/dboolhuff.h +++ b/src/gallium/auxiliary/vl/vp8/decoder/dboolhuff.h @@ -39,11 +39,11 @@ typedef struct DECLARE_ALIGNED(16, extern const unsigned char, vp8_norm[256]); -int vp8dx_start_decode(BOOL_DECODER *br, +int vp8dx_start_decode(BOOL_DECODER *bd, const unsigned char *data, unsigned int data_size); -void vp8dx_bool_decoder_fill(BOOL_DECODER *br); +void vp8dx_bool_decoder_fill(BOOL_DECODER *bd); /** * The refill loop is used in several places, so define it in a macro to make @@ -77,7 +77,7 @@ void vp8dx_bool_decoder_fill(BOOL_DECODER *br); } \ while(0) -static int vp8dx_decode_bool(BOOL_DECODER *br, int probability) +static int vp8dx_decode_bool(BOOL_DECODER *bd, int probability) { unsigned int bit = 0; VP8_BD_VALUE value; @@ -86,13 +86,13 @@ static int vp8dx_decode_bool(BOOL_DECODER *br, int probability) int count; unsigned int range; - split = 1 + (((br->range - 1) * probability) >> 8); + split = 1 + (((bd->range - 1) * probability) >> 8); - if (br->count < 0) - vp8dx_bool_decoder_fill(br); + if (bd->count < 0) + vp8dx_bool_decoder_fill(bd); - value = br->value; - count = br->count; + value = bd->value; + count = bd->count; bigsplit = (VP8_BD_VALUE)split << (VP8_BD_VALUE_SIZE - 8); @@ -100,7 +100,7 @@ static int vp8dx_decode_bool(BOOL_DECODER *br, int probability) if (value >= bigsplit) { - range = br->range - split; + range = bd->range - split; value = value - bigsplit; bit = 1; } @@ -112,44 +112,44 @@ static int vp8dx_decode_bool(BOOL_DECODER *br, int probability) count -= shift; } - br->value = value; - br->count = count; - br->range = range; + bd->value = value; + bd->count = count; + bd->range = range; return bit; } -static int vp8_decode_value(BOOL_DECODER *br, int bits) +static int vp8_decode_value(BOOL_DECODER *bd, int bits) { int z = 0; int bit; for (bit = bits - 1; bit >= 0; bit--) { - z |= (vp8dx_decode_bool(br, 0x80) << bit); + z |= (vp8dx_decode_bool(bd, 0x80) << bit); } return z; } -static int vp8dx_bool_error(BOOL_DECODER *br) +/** + * Check if we have reached the end of the buffer. + * + * Variable 'count' stores the number of bits in the 'value' buffer, minus + * 8. The top byte is part of the algorithm, and the remainder is buffered + * to be shifted into it. So if count == 8, the top 16 bits of 'value' are + * occupied, 8 for the algorithm and 8 in the buffer. + * + * When reading a byte from the user's buffer, count is filled with 8 and + * one byte is filled into the value buffer. When we reach the end of the + * data, count is additionally filled with VP8_LOTS_OF_BITS. So when + * count == VP8_LOTS_OF_BITS - 1, the user's data has been exhausted. + */ +static int vp8dx_bool_error(BOOL_DECODER *bd) { - /* Check if we have reached the end of the buffer. - * - * Variable 'count' stores the number of bits in the 'value' buffer, minus - * 8. The top byte is part of the algorithm, and the remainder is buffered - * to be shifted into it. So if count == 8, the top 16 bits of 'value' are - * occupied, 8 for the algorithm and 8 in the buffer. - * - * When reading a byte from the user's buffer, count is filled with 8 and - * one byte is filled into the value buffer. When we reach the end of the - * data, count is additionally filled with VP8_LOTS_OF_BITS. So when - * count == VP8_LOTS_OF_BITS - 1, the user's data has been exhausted. - */ - if ((br->count > VP8_BD_VALUE_SIZE) && (br->count < VP8_LOTS_OF_BITS)) + if ((bd->count > VP8_BD_VALUE_SIZE) && (bd->count < VP8_LOTS_OF_BITS)) { - /* We have tried to decode bits after the end of stream was encountered. - */ + /* We have tried to decode bits after the end of stream was encountered. */ return 1; } diff --git a/src/gallium/auxiliary/vl/vp8/decoder/decodemv.c b/src/gallium/auxiliary/vl/vp8/decoder/decodemv.c index 4064ab2c18..090a69850b 100644 --- a/src/gallium/auxiliary/vl/vp8/decoder/decodemv.c +++ b/src/gallium/auxiliary/vl/vp8/decoder/decodemv.c @@ -19,50 +19,50 @@ #include <assert.h> #endif -static int vp8_read_bmode(vp8_reader *bc, const vp8_prob *p) +static int vp8_read_bmode(BOOL_DECODER *bd, const vp8_prob *p) { - const int i = vp8_treed_read(bc, vp8_bmode_tree, p); + const int i = vp8_treed_read(bd, vp8_bmode_tree, p); return i; } -static int vp8_read_ymode(vp8_reader *bc, const vp8_prob *p) +static int vp8_read_ymode(BOOL_DECODER *bd, const vp8_prob *p) { - const int i = vp8_treed_read(bc, vp8_ymode_tree, p); + const int i = vp8_treed_read(bd, vp8_ymode_tree, p); return i; } -static int vp8_kfread_ymode(vp8_reader *bc, const vp8_prob *p) +static int vp8_kfread_ymode(BOOL_DECODER *bd, const vp8_prob *p) { - const int i = vp8_treed_read(bc, vp8_kf_ymode_tree, p); + const int i = vp8_treed_read(bd, vp8_kf_ymode_tree, p); return i; } -static int vp8_read_uv_mode(vp8_reader *bc, const vp8_prob *p) +static int vp8_read_uv_mode(BOOL_DECODER *bd, const vp8_prob *p) { - const int i = vp8_treed_read(bc, vp8_uv_mode_tree, p); + const int i = vp8_treed_read(bd, vp8_uv_mode_tree, p); return i; } -static void vp8_read_mb_features(vp8_reader *r, MB_MODE_INFO *mi, MACROBLOCKD *x) +static void vp8_read_mb_features(BOOL_DECODER *bd, MB_MODE_INFO *mi, MACROBLOCKD *x) { /* Is segmentation enabled */ if (x->segmentation_enabled && x->update_mb_segmentation_map) { /* If so then read the segment id. */ - if (vp8_read(r, x->mb_segment_tree_probs[0])) - mi->segment_id = (unsigned char)(2 + vp8_read(r, x->mb_segment_tree_probs[2])); + if (vp8_read(bd, x->mb_segment_tree_probs[0])) + mi->segment_id = (unsigned char)(2 + vp8_read(bd, x->mb_segment_tree_probs[2])); else - mi->segment_id = (unsigned char)(vp8_read(r, x->mb_segment_tree_probs[1])); + mi->segment_id = (unsigned char)(vp8_read(bd, x->mb_segment_tree_probs[1])); } } static void vp8_kfread_modes(VP8D_COMP *pbi, MODE_INFO *m, int mb_row, int mb_col) { - vp8_reader *const bc = & pbi->bc; + BOOL_DECODER *const bd = &pbi->bd; const int mis = pbi->common.mode_info_stride; { @@ -74,15 +74,15 @@ static void vp8_kfread_modes(VP8D_COMP *pbi, MODE_INFO *m, int mb_row, int mb_co m->mbmi.segment_id = 0; if (pbi->mb.update_mb_segmentation_map) - vp8_read_mb_features(bc, &m->mbmi, &pbi->mb); + vp8_read_mb_features(bd, &m->mbmi, &pbi->mb); /* Read the macroblock coeff skip flag if this feature is in use, else default to 0 */ if (pbi->common.mb_no_coeff_skip) - m->mbmi.mb_skip_coeff = vp8_read(bc, pbi->prob_skip_false); + m->mbmi.mb_skip_coeff = vp8_read(bd, pbi->prob_skip_false); else m->mbmi.mb_skip_coeff = 0; - y_mode = (MB_PREDICTION_MODE)vp8_kfread_ymode(bc, pbi->common.kf_ymode_prob); + y_mode = (MB_PREDICTION_MODE)vp8_kfread_ymode(bd, pbi->common.kf_ymode_prob); m->mbmi.ref_frame = INTRA_FRAME; @@ -95,26 +95,26 @@ static void vp8_kfread_modes(VP8D_COMP *pbi, MODE_INFO *m, int mb_row, int mb_co const B_PREDICTION_MODE A = above_block_mode(m, i, mis); const B_PREDICTION_MODE L = left_block_mode(m, i); - m->bmi[i].as_mode = (B_PREDICTION_MODE)vp8_read_bmode(bc, pbi->common.kf_bmode_prob [A] [L]); + m->bmi[i].as_mode = (B_PREDICTION_MODE)vp8_read_bmode(bd, pbi->common.kf_bmode_prob [A] [L]); } while (++i < 16); } - m->mbmi.uv_mode = (MB_PREDICTION_MODE)vp8_read_uv_mode(bc, pbi->common.kf_uv_mode_prob); + m->mbmi.uv_mode = (MB_PREDICTION_MODE)vp8_read_uv_mode(bd, pbi->common.kf_uv_mode_prob); } } -static int read_mvcomponent(vp8_reader *r, const MV_CONTEXT *mvc) +static int read_mvcomponent(BOOL_DECODER *bd, const MV_CONTEXT *mvc) { const vp8_prob *const p = (const vp8_prob *)mvc; int x = 0; - if (vp8_read(r, p [mvpis_short])) /* Large */ + if (vp8_read(bd, p [mvpis_short])) /* Large */ { int i = 0; do { - x += vp8_read(r, p [MVPbits + i]) << i; + x += vp8_read(bd, p [MVPbits + i]) << i; } while (++i < 3); @@ -122,29 +122,29 @@ static int read_mvcomponent(vp8_reader *r, const MV_CONTEXT *mvc) do { - x += vp8_read(r, p [MVPbits + i]) << i; + x += vp8_read(bd, p [MVPbits + i]) << i; } while (--i > 3); - if (!(x & 0xFFF0) || vp8_read(r, p[MVPbits + 3])) + if (!(x & 0xFFF0) || vp8_read(bd, p[MVPbits + 3])) x += 8; } else /* Small */ - x = vp8_treed_read(r, vp8_small_mvtree, p + MVPshort); + x = vp8_treed_read(bd, vp8_small_mvtree, p + MVPshort); - if (x && vp8_read(r, p[MVPsign])) + if (x && vp8_read(bd, p[MVPsign])) x = -x; return x; } -static void read_mv(vp8_reader *r, MV *mv, const MV_CONTEXT *mvc) +static void read_mv(BOOL_DECODER *bd, MV *mv, const MV_CONTEXT *mvc) { - mv->row = (short)(read_mvcomponent(r, mvc) << 1); - mv->col = (short)(read_mvcomponent(r, ++mvc) << 1); + mv->row = (short)(read_mvcomponent(bd, mvc) << 1); + mv->col = (short)(read_mvcomponent(bd, ++mvc) << 1); } -static void read_mvcontexts(vp8_reader *bc, MV_CONTEXT *mvc) +static void read_mvcontexts(BOOL_DECODER *bd, MV_CONTEXT *mvc) { int i = 0; @@ -154,9 +154,9 @@ static void read_mvcontexts(vp8_reader *bc, MV_CONTEXT *mvc) vp8_prob *const pstop = p + MVPcount; do { - if (vp8_read(bc, *up++)) + if (vp8_read(bd, *up++)) { - const vp8_prob x = (vp8_prob)vp8_read_literal(bc, 7); + const vp8_prob x = (vp8_prob)vp8_read_literal(bd, 7); *p = x ? x << 1 : 1; } @@ -166,22 +166,23 @@ static void read_mvcontexts(vp8_reader *bc, MV_CONTEXT *mvc) while (++i < 2); } -static MB_PREDICTION_MODE read_mv_ref(vp8_reader *bc, const vp8_prob *p) +static MB_PREDICTION_MODE read_mv_ref(BOOL_DECODER *bd, const vp8_prob *p) { - const int i = vp8_treed_read(bc, vp8_mv_ref_tree, p); + const int i = vp8_treed_read(bd, vp8_mv_ref_tree, p); return (MB_PREDICTION_MODE)i; } -static B_PREDICTION_MODE sub_mv_ref(vp8_reader *bc, const vp8_prob *p) +static B_PREDICTION_MODE sub_mv_ref(BOOL_DECODER *bd, const vp8_prob *p) { - const int i = vp8_treed_read(bc, vp8_sub_mv_ref_tree, p); + const int i = vp8_treed_read(bd, vp8_sub_mv_ref_tree, p); return (B_PREDICTION_MODE)i; } static const unsigned char mbsplit_fill_count[4] = {8, 8, 4, 1}; -static const unsigned char mbsplit_fill_offset[4][16] = { +static const unsigned char mbsplit_fill_offset[4][16] = +{ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, { 0, 1, 4, 5, 8, 9, 12, 13, 2, 3, 6, 7, 10, 11, 14, 15}, { 0, 1, 4, 5, 2, 3, 6, 7, 8, 9, 12, 13, 10, 11, 14, 15}, @@ -190,47 +191,47 @@ static const unsigned char mbsplit_fill_offset[4][16] = { static void mb_mode_mv_init(VP8D_COMP *pbi) { - vp8_reader *const bc = & pbi->bc; + BOOL_DECODER *const bd = &pbi->bd; MV_CONTEXT *const mvc = pbi->common.fc.mvc; pbi->prob_skip_false = 0; if (pbi->common.mb_no_coeff_skip) - pbi->prob_skip_false = (vp8_prob)vp8_read_literal(bc, 8); + pbi->prob_skip_false = (vp8_prob)vp8_read_literal(bd, 8); if(pbi->common.frame_type != KEY_FRAME) { - pbi->prob_intra = (vp8_prob)vp8_read_literal(bc, 8); - pbi->prob_last = (vp8_prob)vp8_read_literal(bc, 8); - pbi->prob_gf = (vp8_prob)vp8_read_literal(bc, 8); + pbi->prob_intra = (vp8_prob)vp8_read_literal(bd, 8); + pbi->prob_last = (vp8_prob)vp8_read_literal(bd, 8); + pbi->prob_gf = (vp8_prob)vp8_read_literal(bd, 8); - if (vp8_read_bit(bc)) + if (vp8_read_bit(bd)) { int i = 0; do { - pbi->common.fc.ymode_prob[i] = (vp8_prob)vp8_read_literal(bc, 8); + pbi->common.fc.ymode_prob[i] = (vp8_prob)vp8_read_literal(bd, 8); } while (++i < 4); } - if (vp8_read_bit(bc)) + if (vp8_read_bit(bd)) { int i = 0; do { - pbi->common.fc.uv_mode_prob[i] = (vp8_prob)vp8_read_literal(bc, 8); + pbi->common.fc.uv_mode_prob[i] = (vp8_prob)vp8_read_literal(bd, 8); } while (++i < 3); } - read_mvcontexts(bc, mvc); + read_mvcontexts(bd, mvc); } } static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, int mb_row, int mb_col) { - vp8_reader *const bc = &pbi->bc; + BOOL_DECODER *const bd = &pbi->bd; MV_CONTEXT *const mvc = pbi->common.fc.mvc; const int mis = pbi->common.mode_info_stride; @@ -259,23 +260,23 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, /* If required read in new segmentation data for this MB */ if (pbi->mb.update_mb_segmentation_map) - vp8_read_mb_features(bc, mbmi, &pbi->mb); + vp8_read_mb_features(bd, mbmi, &pbi->mb); /* Read the macroblock coeff skip flag if this feature is in use, else default to 0 */ if (pbi->common.mb_no_coeff_skip) - mbmi->mb_skip_coeff = vp8_read(bc, pbi->prob_skip_false); + mbmi->mb_skip_coeff = vp8_read(bd, pbi->prob_skip_false); else mbmi->mb_skip_coeff = 0; - if ((mbmi->ref_frame = (MV_REFERENCE_FRAME) vp8_read(bc, pbi->prob_intra))) /* inter MB */ + if ((mbmi->ref_frame = (MV_REFERENCE_FRAME) vp8_read(bd, pbi->prob_intra))) /* inter MB */ { int rct[4]; vp8_prob mv_ref_p [VP8_MVREFS-1]; int_mv nearest, nearby, best_mv; - if (vp8_read(bc, pbi->prob_last)) + if (vp8_read(bd, pbi->prob_last)) { - mbmi->ref_frame = (MV_REFERENCE_FRAME)((int)mbmi->ref_frame + (int)(1 + vp8_read(bc, pbi->prob_gf))); + mbmi->ref_frame = (MV_REFERENCE_FRAME)((int)mbmi->ref_frame + (int)(1 + vp8_read(bd, pbi->prob_gf))); } vp8_find_near_mvs(&pbi->mb, mi, &nearest, &nearby, &best_mv, rct, mbmi->ref_frame, pbi->common.ref_frame_sign_bias); @@ -283,11 +284,11 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, vp8_mv_ref_probs(mv_ref_p, rct); mbmi->uv_mode = DC_PRED; - switch (mbmi->mode = read_mv_ref(bc, mv_ref_p)) + switch (mbmi->mode = read_mv_ref(bd, mv_ref_p)) { case SPLITMV: { - const int s = mbmi->partitioning = vp8_treed_read(bc, vp8_mbsplit_tree, vp8_mbsplit_probs); + const int s = mbmi->partitioning = vp8_treed_read(bd, vp8_mbsplit_tree, vp8_mbsplit_probs); const int num_p = vp8_mbsplit_count[s]; int j = 0; @@ -303,10 +304,10 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, abovemv.as_int = above_block_mv(mi, k, mis); mv_contz = vp8_mv_cont(&leftmv, &abovemv); - switch (sub_mv_ref(bc, vp8_sub_mv_ref_prob2[mv_contz])) /*pc->fc.sub_mv_ref_prob))*/ + switch (sub_mv_ref(bd, vp8_sub_mv_ref_prob2[mv_contz])) /*pc->fc.sub_mv_ref_prob))*/ { case NEW4X4: - read_mv(bc, &blockmv.as_mv, (const MV_CONTEXT *)mvc); + read_mv(bd, &blockmv.as_mv, (const MV_CONTEXT *)mvc); blockmv.as_mv.row += best_mv.as_mv.row; blockmv.as_mv.col += best_mv.as_mv.col; break; @@ -368,7 +369,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, break; case NEWMV: - read_mv(bc, &mv->as_mv, (const MV_CONTEXT *)mvc); + read_mv(bd, &mv->as_mv, (const MV_CONTEXT *)mvc); mv->as_mv.row += best_mv.as_mv.row; mv->as_mv.col += best_mv.as_mv.col; @@ -395,17 +396,17 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, mbmi->mv.as_int = 0; /* MB is intra coded */ - if ((mbmi->mode = (MB_PREDICTION_MODE)vp8_read_ymode(bc, pbi->common.fc.ymode_prob)) == B_PRED) + if ((mbmi->mode = (MB_PREDICTION_MODE)vp8_read_ymode(bd, pbi->common.fc.ymode_prob)) == B_PRED) { int j = 0; do { - mi->bmi[j].as_mode = (B_PREDICTION_MODE)vp8_read_bmode(bc, pbi->common.fc.bmode_prob); + mi->bmi[j].as_mode = (B_PREDICTION_MODE)vp8_read_bmode(bd, pbi->common.fc.bmode_prob); } while (++j < 16); } - mbmi->uv_mode = (MB_PREDICTION_MODE)vp8_read_uv_mode(bc, pbi->common.fc.uv_mode_prob); + mbmi->uv_mode = (MB_PREDICTION_MODE)vp8_read_uv_mode(bd, pbi->common.fc.uv_mode_prob); } } diff --git a/src/gallium/auxiliary/vl/vp8/decoder/detokenize.c b/src/gallium/auxiliary/vl/vp8/decoder/detokenize.c index 41e8a5cdae..4538d89001 100644 --- a/src/gallium/auxiliary/vl/vp8/decoder/detokenize.c +++ b/src/gallium/auxiliary/vl/vp8/decoder/detokenize.c @@ -172,7 +172,7 @@ int vp8_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *x) ENTROPY_CONTEXT *L = (ENTROPY_CONTEXT *)x->left_context; const FRAME_CONTEXT * const fc = &dx->common.fc; - BOOL_DECODER *bc = x->current_bc; + BOOL_DECODER *bd = x->current_bd; char *eobs = x->eobs; @@ -218,11 +218,11 @@ int vp8_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *x) eobtotal -= 16; } - bufend = bc->user_buffer_end; - bufptr = bc->user_buffer; - value = bc->value; - count = bc->count; - range = bc->range; + bufend = bd->user_buffer_end; + bufptr = bd->user_buffer; + value = bd->value; + count = bd->count; + range = bd->range; coef_probs = fc->coef_probs [type] [0] [0]; @@ -352,10 +352,10 @@ BLOCK_FINISHED: } FILL - bc->user_buffer = bufptr; - bc->value = value; - bc->count = count; - bc->range = range; + bd->user_buffer = bufptr; + bd->value = value; + bd->count = count; + bd->range = range; return eobtotal; } diff --git a/src/gallium/auxiliary/vl/vp8/decoder/onyxd_if.c b/src/gallium/auxiliary/vl/vp8/decoder/onyxd_if.c index eb924ccf00..6136fea4ad 100644 --- a/src/gallium/auxiliary/vl/vp8/decoder/onyxd_if.c +++ b/src/gallium/auxiliary/vl/vp8/decoder/onyxd_if.c @@ -261,6 +261,6 @@ void vp8_decoder_remove(VP8D_PTR ptr) return; vp8_remove_common(&pbi->common); - vpx_free(pbi->mbc); + vpx_free(pbi->mbd); vpx_free(pbi); } diff --git a/src/gallium/auxiliary/vl/vp8/decoder/onyxd_int.h b/src/gallium/auxiliary/vl/vp8/decoder/onyxd_int.h index 91db75f58c..773146915f 100644 --- a/src/gallium/auxiliary/vl/vp8/decoder/onyxd_int.h +++ b/src/gallium/auxiliary/vl/vp8/decoder/onyxd_int.h @@ -37,14 +37,14 @@ typedef struct DECLARE_ALIGNED(16, MACROBLOCKD, mb); DECLARE_ALIGNED(16, VP8_COMMON, common); - vp8_reader bc, bc2; + BOOL_DECODER bd, bd2; const unsigned char *data; unsigned int data_size; - vp8_reader *mbc; - int64_t last_time_stamp; - int ready_for_new_data; + BOOL_DECODER *mbd; + int64_t last_time_stamp; + int ready_for_new_data; vp8_prob prob_intra; vp8_prob prob_last; diff --git a/src/gallium/auxiliary/vl/vp8/decoder/treereader.h b/src/gallium/auxiliary/vl/vp8/decoder/treereader.h index 67836d4359..3ca517f417 100644 --- a/src/gallium/auxiliary/vl/vp8/decoder/treereader.h +++ b/src/gallium/auxiliary/vl/vp8/decoder/treereader.h @@ -15,8 +15,6 @@ #include "../common/treecoder.h" #include "dboolhuff.h" -typedef BOOL_DECODER vp8_reader; - #define vp8_read vp8dx_decode_bool #define vp8_read_literal vp8_decode_value #define vp8_read_bit( R) vp8_read( R, vp8_prob_half) @@ -24,11 +22,11 @@ typedef BOOL_DECODER vp8_reader; /* Intent of tree data structure is to make decoding trivial. */ /** must return a 0 or 1 !!! */ -static int vp8_treed_read(vp8_reader *const r, vp8_tree t, const vp8_prob *const p) +static int vp8_treed_read(BOOL_DECODER *const bd, vp8_tree t, const vp8_prob *const p) { register vp8_tree_index i = 0; - while ((i = t[i + vp8_read(r, p[i >> 1])]) > 0); + while ((i = t[i + vp8_read(bd, p[i >> 1])]) > 0); return -i; } |