diff options
author | Emeric Grange <emeric.grange@gmail.com> | 2011-10-30 23:53:34 +0100 |
---|---|---|
committer | Emeric Grange <emeric.grange@gmail.com> | 2012-06-24 16:57:31 +0200 |
commit | dc970e677c95afbe09b5b968470df5035dc96653 (patch) | |
tree | 53c097033654355711fed95f465932042d572fa1 | |
parent | 275dd118dc8a334cf4823bdd3c36b1998799563c (diff) |
g3dvl: Mostly cosmetic cleanups
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/common/entropy.c | 1 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/common/entropymode.c | 37 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/common/entropymv.h | 18 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/common/mbpitch.c | 1 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/common/mv.h | 4 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/common/reconintra.c | 21 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/common/reconintra4x4.c | 3 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/common/yv12utils.c | 6 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/decoder/decodeframe.c | 30 |
9 files changed, 55 insertions, 66 deletions
diff --git a/src/gallium/auxiliary/vl/vp8/common/entropy.c b/src/gallium/auxiliary/vl/vp8/common/entropy.c index f945631abf..331e516674 100644 --- a/src/gallium/auxiliary/vl/vp8/common/entropy.c +++ b/src/gallium/auxiliary/vl/vp8/common/entropy.c @@ -103,7 +103,6 @@ void vp8_init_scan_order_mask() { vp8_default_zig_zag_mask[vp8_default_zig_zag1d[i]] = 1 << i; } - } static void init_bit_tree(vp8_tree_index *p, int n) diff --git a/src/gallium/auxiliary/vl/vp8/common/entropymode.c b/src/gallium/auxiliary/vl/vp8/common/entropymode.c index 3514c7cf37..309eb565c8 100644 --- a/src/gallium/auxiliary/vl/vp8/common/entropymode.c +++ b/src/gallium/auxiliary/vl/vp8/common/entropymode.c @@ -13,11 +13,11 @@ #include "entropy.h" #include "../vp8_mem.h" -static const unsigned int kf_y_mode_cts[VP8_YMODES] = { 1607, 915, 812, 811, 5455}; -static const unsigned int y_mode_cts [VP8_YMODES] = { 8080, 1908, 1582, 1007, 5874}; +static const unsigned int kf_y_mode_cts[VP8_YMODES] = {1607, 915, 812, 811, 5455}; +static const unsigned int y_mode_cts [VP8_YMODES] = {8080, 1908, 1582, 1007, 5874}; -static const unsigned int uv_mode_cts [VP8_UV_MODES] = { 59483, 13605, 16492, 4230}; -static const unsigned int kf_uv_mode_cts[VP8_UV_MODES] = { 5319, 1904, 1703, 674}; +static const unsigned int uv_mode_cts [VP8_UV_MODES] = {59483, 13605, 16492, 4230}; +static const unsigned int kf_uv_mode_cts[VP8_UV_MODES] = {5319, 1904, 1703, 674}; static const unsigned int bmode_cts[VP8_BINTRAMODES] = { @@ -93,10 +93,9 @@ vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS] = }, }; -const int vp8_mbsplit_count [VP8_NUMMBSPLITS] = { 2, 2, 4, 16}; - -const vp8_prob vp8_mbsplit_probs [VP8_NUMMBSPLITS-1] = { 110, 111, 150}; +const int vp8_mbsplit_count[VP8_NUMMBSPLITS] = {2, 2, 4, 16}; +const vp8_prob vp8_mbsplit_probs[VP8_NUMMBSPLITS-1] = {110, 111, 150}; /** Array indices are identical to previously-existing INTRAMODECONTEXTNODES. */ const vp8_tree_index vp8_bmode_tree[18] = /* INTRAMODECONTEXTNODE value */ @@ -186,32 +185,27 @@ struct vp8_token_struct vp8_small_mvencodings [8]; void vp8_init_mbmode_probs(VP8_COMMON *x) { - unsigned int bct [VP8_YMODES] [2]; /* num Ymodes > num UV modes */ + unsigned int bct [VP8_YMODES] [2]; /* num Ymodes > num UV modes */ vp8_tree_probs_from_distribution( VP8_YMODES, vp8_ymode_encodings, vp8_ymode_tree, - x->fc.ymode_prob, bct, y_mode_cts, - 256, 1 - ); + x->fc.ymode_prob, bct, y_mode_cts, 256, 1); + vp8_tree_probs_from_distribution( VP8_YMODES, vp8_kf_ymode_encodings, vp8_kf_ymode_tree, - x->kf_ymode_prob, bct, kf_y_mode_cts, - 256, 1 - ); + x->kf_ymode_prob, bct, kf_y_mode_cts, 256, 1); + vp8_tree_probs_from_distribution( VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree, - x->fc.uv_mode_prob, bct, uv_mode_cts, - 256, 1 - ); + x->fc.uv_mode_prob, bct, uv_mode_cts, 256, 1); + vp8_tree_probs_from_distribution( VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree, - x->kf_uv_mode_prob, bct, kf_uv_mode_cts, - 256, 1 - ); + x->kf_uv_mode_prob, bct, kf_uv_mode_cts, 256, 1); + memcpy(x->fc.sub_mv_ref_prob, sub_mv_ref_prob, sizeof(sub_mv_ref_prob)); } - static void intra_bmode_probs_from_distribution(vp8_prob p [VP8_BINTRAMODES-1], unsigned int branch_ct [VP8_BINTRAMODES-1] [2], const unsigned int events [VP8_BINTRAMODES]) @@ -245,7 +239,6 @@ void vp8_kf_default_bmode_probs(vp8_prob p [VP8_BINTRAMODES] [VP8_BINTRAMODES] [ while (++i < VP8_BINTRAMODES); } - void vp8_entropy_mode_init() { vp8_tokens_from_tree(vp8_bmode_encodings, vp8_bmode_tree); diff --git a/src/gallium/auxiliary/vl/vp8/common/entropymv.h b/src/gallium/auxiliary/vl/vp8/common/entropymv.h index 3c99dec182..664a850256 100644 --- a/src/gallium/auxiliary/vl/vp8/common/entropymv.h +++ b/src/gallium/auxiliary/vl/vp8/common/entropymv.h @@ -16,9 +16,9 @@ enum { - mv_max = 1023, /* max absolute value of a MV component */ - MVvals = (2 * mv_max) + 1, /* # possible values "" */ - mvfp_max = 255, /* max absolute value of a full pixel MV component */ + mv_max = 1023, /* max absolute value of a MV component */ + MVvals = (2 * mv_max) + 1, /* # possible values "" */ + mvfp_max = 255, /* max absolute value of a full pixel MV component */ MVfpvals = (2 * mvfp_max) +1, /* # possible full pixel MV values */ mvlong_width = 10, /* Large MVs have 9 bit magnitudes */ @@ -26,19 +26,19 @@ enum /* probability offsets for coding each MV component */ - mvpis_short = 0, /* short (<= 7) vs long (>= 8) */ - MVPsign, /* sign for non-zero */ - MVPshort, /* 8 short values = 7-position tree */ + mvpis_short = 0, /* short (<= 7) vs long (>= 8) */ + MVPsign, /* sign for non-zero */ + MVPshort, /* 8 short values = 7-position tree */ MVPbits = MVPshort + mvnum_short - 1, /* mvlong_width long value bits */ - MVPcount = MVPbits + mvlong_width /* (with independent probabilities) */ + MVPcount = MVPbits + mvlong_width /* (with independent probabilities) */ }; typedef struct mv_context { - vp8_prob prob[MVPcount]; /* often come in row, col pairs */ + vp8_prob prob[MVPcount]; /* often come in row, col pairs */ } MV_CONTEXT; extern const MV_CONTEXT vp8_mv_update_probs[2], vp8_default_mv_context[2]; -#endif +#endif /* ENTROPYMV_H */ diff --git a/src/gallium/auxiliary/vl/vp8/common/mbpitch.c b/src/gallium/auxiliary/vl/vp8/common/mbpitch.c index 4f0e3a5d6b..fefbf0fb6d 100644 --- a/src/gallium/auxiliary/vl/vp8/common/mbpitch.c +++ b/src/gallium/auxiliary/vl/vp8/common/mbpitch.c @@ -38,7 +38,6 @@ static void setup_block(BLOCKD *b, } } - static void setup_macroblock(MACROBLOCKD *x, BLOCKSET bs) { int block; diff --git a/src/gallium/auxiliary/vl/vp8/common/mv.h b/src/gallium/auxiliary/vl/vp8/common/mv.h index 8b88c7df2e..49dcf3472a 100644 --- a/src/gallium/auxiliary/vl/vp8/common/mv.h +++ b/src/gallium/auxiliary/vl/vp8/common/mv.h @@ -22,8 +22,8 @@ typedef struct typedef union { - uint32_t as_int; - MV as_mv; + uint32_t as_int; + MV as_mv; } int_mv; /* facilitates faster equality tests and copies */ #endif /* MV_H */ diff --git a/src/gallium/auxiliary/vl/vp8/common/reconintra.c b/src/gallium/auxiliary/vl/vp8/common/reconintra.c index 10e17d8520..58854545ba 100644 --- a/src/gallium/auxiliary/vl/vp8/common/reconintra.c +++ b/src/gallium/auxiliary/vl/vp8/common/reconintra.c @@ -69,8 +69,6 @@ void vp8_build_intra_predictors_mby(MACROBLOCKD *x) } - - shift = 3 + x->up_available + x->left_available; expected_dc = (average + (1 << (shift - 1))) >> shift; } @@ -82,6 +80,7 @@ void vp8_build_intra_predictors_mby(MACROBLOCKD *x) memset(ypred_ptr, expected_dc, 256); } break; + case V_PRED: { for (r = 0; r < 16; r++) @@ -95,6 +94,7 @@ void vp8_build_intra_predictors_mby(MACROBLOCKD *x) } } break; + case H_PRED: { for (r = 0; r < 16; r++) @@ -103,9 +103,9 @@ void vp8_build_intra_predictors_mby(MACROBLOCKD *x) memset(ypred_ptr, yleft_col[r], 16); ypred_ptr += 16; } - } break; + case TM_PRED: { for (r = 0; r < 16; r++) @@ -127,6 +127,7 @@ void vp8_build_intra_predictors_mby(MACROBLOCKD *x) } } break; + case B_PRED: case NEARESTMV: case NEARMV: @@ -200,6 +201,7 @@ void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x) } } break; + case V_PRED: { for (r = 0; r < 16; r++) @@ -212,6 +214,7 @@ void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x) } } break; + case H_PRED: { for (r = 0; r < 16; r++) @@ -219,9 +222,9 @@ void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x) memset(ypred_ptr, yleft_col[r], 16); ypred_ptr += y_stride; /*16;*/ } - } break; + case TM_PRED: { for (r = 0; r < 16; r++) @@ -243,6 +246,7 @@ void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x) } } break; + case B_PRED: case NEARESTMV: case NEARMV: @@ -317,6 +321,7 @@ void vp8_build_intra_predictors_mbuv(MACROBLOCKD *x) memset(vpred_ptr, expected_vdc, 64); } break; + case V_PRED: { int i; @@ -330,6 +335,7 @@ void vp8_build_intra_predictors_mbuv(MACROBLOCKD *x) } } break; + case H_PRED: { int i; @@ -342,6 +348,7 @@ void vp8_build_intra_predictors_mbuv(MACROBLOCKD *x) } } break; + case TM_PRED: { int i; @@ -373,6 +380,7 @@ void vp8_build_intra_predictors_mbuv(MACROBLOCKD *x) } } break; + case B_PRED: case NEARESTMV: case NEARMV: @@ -456,6 +464,7 @@ void vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x) } } break; + case V_PRED: { int i; @@ -468,6 +477,7 @@ void vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x) } } break; + case H_PRED: { int i; @@ -480,8 +490,8 @@ void vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x) vpred_ptr += uv_stride; /*8;*/ } } - break; + case TM_PRED: { int i; @@ -513,6 +523,7 @@ void vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x) } } break; + case B_PRED: case NEARESTMV: case NEARMV: diff --git a/src/gallium/auxiliary/vl/vp8/common/reconintra4x4.c b/src/gallium/auxiliary/vl/vp8/common/reconintra4x4.c index 8eed67ae5c..efa8ca07f4 100644 --- a/src/gallium/auxiliary/vl/vp8/common/reconintra4x4.c +++ b/src/gallium/auxiliary/vl/vp8/common/reconintra4x4.c @@ -138,7 +138,6 @@ void vp8_intra4x4_predict(BLOCKD *x, int b_mode, unsigned char *predictor) predictor[2 * 16 + 3] = predictor[3 * 16 + 2] = (ptr[5] + ptr[6] * 2 + ptr[7] + 2) >> 2; predictor[3 * 16 + 3] = (ptr[6] + ptr[7] * 2 + ptr[7] + 2) >> 2; - } break; @@ -172,7 +171,6 @@ void vp8_intra4x4_predict(BLOCKD *x, int b_mode, unsigned char *predictor) predictor[1 * 16 + 3] = predictor[0 * 16 + 2] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2; predictor[0 * 16 + 3] = (pp[6] + pp[7] * 2 + pp[8] + 2) >> 2; - } break; @@ -206,7 +204,6 @@ void vp8_intra4x4_predict(BLOCKD *x, int b_mode, unsigned char *predictor) predictor[0 * 16 + 2] = (pp[6] + pp[7] + 1) >> 1; predictor[1 * 16 + 3] = (pp[6] + pp[7] * 2 + pp[8] + 2) >> 2; predictor[0 * 16 + 3] = (pp[7] + pp[8] + 1) >> 1; - } break; diff --git a/src/gallium/auxiliary/vl/vp8/common/yv12utils.c b/src/gallium/auxiliary/vl/vp8/common/yv12utils.c index 16ff61b309..3ba77e981e 100644 --- a/src/gallium/auxiliary/vl/vp8/common/yv12utils.c +++ b/src/gallium/auxiliary/vl/vp8/common/yv12utils.c @@ -22,7 +22,7 @@ vp8_yv12_de_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf) /* buffer_alloc isn't accessed by most functions. Rather y_buffer, u_buffer and v_buffer point to buffer_alloc and are used. Clear out all of this so that a freed pointer isn't inadvertently used */ - memset (ybf, 0, sizeof (YV12_BUFFER_CONFIG)); + memset (ybf, 0, sizeof(YV12_BUFFER_CONFIG)); } else { @@ -32,7 +32,6 @@ vp8_yv12_de_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf) return 0; } - int vp8_yv12_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height, int border) { @@ -68,7 +67,7 @@ vp8_yv12_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height, int ybf->border = border; ybf->frame_size = yplane_size + 2 * uvplane_size; - ybf->buffer_alloc = (unsigned char *) vpx_memalign(32, ybf->frame_size); + ybf->buffer_alloc = (unsigned char *)vpx_memalign(32, ybf->frame_size); if (ybf->buffer_alloc == NULL) return -1; @@ -138,7 +137,6 @@ vp8_yv12_extend_frame_borders(YV12_BUFFER_CONFIG *ybf) dest_ptr2 += plane_stride; } - /***********/ /* U Plane */ /***********/ diff --git a/src/gallium/auxiliary/vl/vp8/decoder/decodeframe.c b/src/gallium/auxiliary/vl/vp8/decoder/decodeframe.c index e53d0bfa4d..a8c32b1dd2 100644 --- a/src/gallium/auxiliary/vl/vp8/decoder/decodeframe.c +++ b/src/gallium/auxiliary/vl/vp8/decoder/decodeframe.c @@ -27,7 +27,6 @@ #include "../common/extend.h" #include "../vp8_mem.h" #include "../common/idct.h" -#include "dequantize.h" #include "dboolhuff.h" #include <assert.h> @@ -69,8 +68,9 @@ void mb_init_dequantizer(VP8D_COMP *pbi, MACROBLOCKD *xd) { /* Abs Value */ if (xd->mb_segement_abs_delta == SEGMENT_ABSDATA) + { QIndex = xd->segment_feature_data[MB_LVL_ALT_Q][mbmi->segment_id]; - + } /* Delta Value */ else { @@ -289,7 +289,6 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd, unsigned int mb_i xd->dst.uv_stride, xd->eobs+16); } - static int get_delta_q(vp8_reader *bc, int prev, int *q_update) { int ret_val = 0; @@ -309,7 +308,6 @@ static int get_delta_q(vp8_reader *bc, int prev, int *q_update) return ret_val; } - static void decode_mb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mb_row, MACROBLOCKD *xd) { @@ -397,7 +395,6 @@ decode_mb_row(VP8D_COMP *pbi, VP8_COMMON *pc, int mb_row, MACROBLOCKD *xd) ++xd->mode_info_context; } - static unsigned int read_partition_size(const unsigned char *cx_size) { const unsigned int size = cx_size[0] + (cx_size[1] << 8) + (cx_size[2] << 16); @@ -499,7 +496,6 @@ static void setup_token_decoder(VP8D_COMP *pbi, } } - static void stop_token_decoder(VP8D_COMP *pbi) { VP8_COMMON *pc = &pbi->common; @@ -548,26 +544,22 @@ static void init_frame(VP8D_COMP *pbi) } else { - if (!pc->use_bilinear_mc_filter) - pc->mcomp_filter_type = SIXTAP; - else + if (pc->use_bilinear_mc_filter) + { pc->mcomp_filter_type = BILINEAR; - - /* To enable choice of different interploation filters */ - if (pc->mcomp_filter_type == SIXTAP) + xd->subpixel_predict = SUBPIX_INVOKE(RTCD_VTABLE(subpix), bilinear4x4); + xd->subpixel_predict8x4 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), bilinear8x4); + xd->subpixel_predict8x8 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), bilinear8x8); + xd->subpixel_predict16x16 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), bilinear16x16); + } + else { + pc->mcomp_filter_type = SIXTAP; xd->subpixel_predict = SUBPIX_INVOKE(RTCD_VTABLE(subpix), sixtap4x4); xd->subpixel_predict8x4 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), sixtap8x4); xd->subpixel_predict8x8 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), sixtap8x8); xd->subpixel_predict16x16 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), sixtap16x16); } - else - { - xd->subpixel_predict = SUBPIX_INVOKE(RTCD_VTABLE(subpix), bilinear4x4); - xd->subpixel_predict8x4 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), bilinear8x4); - xd->subpixel_predict8x8 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), bilinear8x8); - xd->subpixel_predict16x16 = SUBPIX_INVOKE(RTCD_VTABLE(subpix), bilinear16x16); - } } xd->left_context = &pc->left_context; |