diff options
author | Emeric Grange <emeric.grange@gmail.com> | 2012-01-18 16:00:37 +0100 |
---|---|---|
committer | Emeric Grange <emeric.grange@gmail.com> | 2012-06-24 16:57:32 +0200 |
commit | 068ab275651f65ab65415fb1b0e017bc4ca8fd7b (patch) | |
tree | bcbdd31b934d7f5f7786b101c7fb45e0043aa5aa | |
parent | 5fdcf94993c4232057923f82c0a5b84777ed4234 (diff) |
g3dvl: minor cleanups
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/common/alloccommon.c | 6 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/common/blockd.c | 4 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/common/blockd.h | 2 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/common/coefupdateprobs.h | 7 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/common/entropy.c | 18 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/common/quant_common.c | 12 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/common/quant_common.h | 9 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/decoder/decodeframe.c | 5 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/decoder/dequantize.c | 4 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/decoder/idct_blk.c | 4 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/decoder/onyxd_if.c | 12 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vp8/decoder/treereader.c | 3 |
12 files changed, 46 insertions, 40 deletions
diff --git a/src/gallium/auxiliary/vl/vp8/common/alloccommon.c b/src/gallium/auxiliary/vl/vp8/common/alloccommon.c index 183806605e..ad075d6c82 100644 --- a/src/gallium/auxiliary/vl/vp8/common/alloccommon.c +++ b/src/gallium/auxiliary/vl/vp8/common/alloccommon.c @@ -16,8 +16,6 @@ #include "findnearmv.h" #include "entropymode.h" -//extern void vp8_init_scan_order_mask(); - static void update_mode_info_border(MODE_INFO *mi, int rows, int cols) { int i; @@ -107,6 +105,10 @@ int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height) return 0; } +/** + * Initialize version specific parameters. + * The VP8 "version" field is the equivalent of the mpeg "profile". + */ void vp8_setup_version(VP8_COMMON *cm) { switch (cm->version) diff --git a/src/gallium/auxiliary/vl/vp8/common/blockd.c b/src/gallium/auxiliary/vl/vp8/common/blockd.c index 5ff55c8897..cd93ae3ebc 100644 --- a/src/gallium/auxiliary/vl/vp8/common/blockd.c +++ b/src/gallium/auxiliary/vl/vp8/common/blockd.c @@ -56,7 +56,7 @@ static void setup_macroblock(MACROBLOCKD *x, BLOCKSET bs) v = &x->pre.v_buffer; } - for (block = 0; block < 16; block++) /* y blocks */ + for (block = 0; block < 16; block++) /* Y blocks */ { setup_block(&x->block[block], x->dst.y_stride, y, x->dst.y_stride, (block >> 2) * 4 * x->dst.y_stride + (block & 3) * 4, bs); @@ -112,7 +112,7 @@ void vp8_setup_block_dptrs(MACROBLOCKD *x) } } -void vp8_build_block_doffsets(MACROBLOCKD *x) +void vp8_setup_block_doffsets(MACROBLOCKD *x) { /* handle the destination pitch features */ setup_macroblock(x, DEST); diff --git a/src/gallium/auxiliary/vl/vp8/common/blockd.h b/src/gallium/auxiliary/vl/vp8/common/blockd.h index 5312803857..9388d505c4 100644 --- a/src/gallium/auxiliary/vl/vp8/common/blockd.h +++ b/src/gallium/auxiliary/vl/vp8/common/blockd.h @@ -240,7 +240,7 @@ typedef struct } MACROBLOCKD; -void vp8_build_block_doffsets(MACROBLOCKD *x); +void vp8_setup_block_doffsets(MACROBLOCKD *x); void vp8_setup_block_dptrs(MACROBLOCKD *x); void update_blockd_bmi(MACROBLOCKD *xd); diff --git a/src/gallium/auxiliary/vl/vp8/common/coefupdateprobs.h b/src/gallium/auxiliary/vl/vp8/common/coefupdateprobs.h index 072f75fffa..56c4a78ecb 100644 --- a/src/gallium/auxiliary/vl/vp8/common/coefupdateprobs.h +++ b/src/gallium/auxiliary/vl/vp8/common/coefupdateprobs.h @@ -13,9 +13,10 @@ #include "entropy.h" -/* Update probabilities for the nodes in the token entropy tree. - Generated file included by entropy.c */ - +/** + * Update probabilities for the nodes in the token entropy tree. + * Generated file included by entropy.c. + */ const vp8_prob vp8_coef_update_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES] = { { diff --git a/src/gallium/auxiliary/vl/vp8/common/entropy.c b/src/gallium/auxiliary/vl/vp8/common/entropy.c index 38d0b9f5bb..0423a5c51e 100644 --- a/src/gallium/auxiliary/vl/vp8/common/entropy.c +++ b/src/gallium/auxiliary/vl/vp8/common/entropy.c @@ -96,15 +96,6 @@ static const vp8_prob Pcat6[] = {254, 254, 243, 230, 196, 177, 153, 140, 133, 13 static vp8_tree_index cat1[2], cat2[4], cat3[6], cat4[8], cat5[10], cat6[22]; -void vp8_init_scan_order_mask() -{ - int i; - for (i = 0; i < 16; i++) - { - vp8_default_zig_zag_mask[vp8_default_zig_zag1d[i]] = 1 << i; - } -} - static void init_bit_tree(vp8_tree_index *p, int n) { int i = 0; @@ -127,6 +118,15 @@ static void init_bit_trees() init_bit_tree(cat6, 11); } +void vp8_init_scan_order_mask() +{ + int i; + for (i = 0; i < 16; i++) + { + vp8_default_zig_zag_mask[vp8_default_zig_zag1d[i]] = 1 << i; + } +} + void vp8_default_coef_probs(VP8_COMMON *pc) { int h = 0; diff --git a/src/gallium/auxiliary/vl/vp8/common/quant_common.c b/src/gallium/auxiliary/vl/vp8/common/quant_common.c index 36036d57a3..f5f252f013 100644 --- a/src/gallium/auxiliary/vl/vp8/common/quant_common.c +++ b/src/gallium/auxiliary/vl/vp8/common/quant_common.c @@ -35,7 +35,7 @@ static const int ac_qlookup[QINDEX_RANGE] = 213, 217, 221, 225, 229, 234, 239, 245, 249, 254, 259, 264, 269, 274, 279, 284, }; -int vp8_dc_quant(int QIndex, int Delta) +static int vp8_dc_quant(int QIndex, int Delta) { int retval; @@ -51,7 +51,7 @@ int vp8_dc_quant(int QIndex, int Delta) return retval; } -int vp8_dc2quant(int QIndex, int Delta) +static int vp8_dc2quant(int QIndex, int Delta) { int retval; @@ -67,7 +67,7 @@ int vp8_dc2quant(int QIndex, int Delta) return retval; } -int vp8_dc_uv_quant(int QIndex, int Delta) +static int vp8_dc_uv_quant(int QIndex, int Delta) { int retval; @@ -86,7 +86,7 @@ int vp8_dc_uv_quant(int QIndex, int Delta) return retval; } -int vp8_ac_yquant(int QIndex) +static int vp8_ac_yquant(int QIndex) { int retval; @@ -100,7 +100,7 @@ int vp8_ac_yquant(int QIndex) return retval; } -int vp8_ac2quant(int QIndex, int Delta) +static int vp8_ac2quant(int QIndex, int Delta) { int retval; @@ -119,7 +119,7 @@ int vp8_ac2quant(int QIndex, int Delta) return retval; } -int vp8_ac_uv_quant(int QIndex, int Delta) +static int vp8_ac_uv_quant(int QIndex, int Delta) { int retval; diff --git a/src/gallium/auxiliary/vl/vp8/common/quant_common.h b/src/gallium/auxiliary/vl/vp8/common/quant_common.h index 4686904d5f..47649c32aa 100644 --- a/src/gallium/auxiliary/vl/vp8/common/quant_common.h +++ b/src/gallium/auxiliary/vl/vp8/common/quant_common.h @@ -15,13 +15,6 @@ #include "blockd.h" #include "onyxc_int.h" -extern int vp8_ac_yquant(int QIndex); -extern int vp8_dc_quant(int QIndex, int Delta); -extern int vp8_dc2quant(int QIndex, int Delta); -extern int vp8_ac2quant(int QIndex, int Delta); -extern int vp8_dc_uv_quant(int QIndex, int Delta); -extern int vp8_ac_uv_quant(int QIndex, int Delta); - -extern void vp8_initialize_dequantizer(VP8_COMMON *pc); +void vp8_initialize_dequantizer(VP8_COMMON *pc); #endif /* QUANT_COMMON_H */ diff --git a/src/gallium/auxiliary/vl/vp8/decoder/decodeframe.c b/src/gallium/auxiliary/vl/vp8/decoder/decodeframe.c index 779711ec58..e9ef442a97 100644 --- a/src/gallium/auxiliary/vl/vp8/decoder/decodeframe.c +++ b/src/gallium/auxiliary/vl/vp8/decoder/decodeframe.c @@ -443,8 +443,7 @@ static void token_decoder_setup(VP8D_COMP *pbi, const unsigned char *partition_size_ptr = cx_data + i * 3; ptrdiff_t partition_size; - /* Calculate the length of this partition. The last partition - * size is implicit. */ + /* Calculate the length of this partition. The last partition size is implicit. */ if (i < num_part - 1) { partition_size = token_decoder_readpartitionsize(partition_size_ptr); @@ -772,7 +771,7 @@ int vp8_frame_decode(VP8D_COMP *pbi, struct pipe_vp8_picture_desc *frame_header) vp8_setup_block_dptrs(xd); - vp8_build_block_doffsets(xd); + vp8_setup_block_doffsets(xd); /* clear out the coeff buffer */ memset(xd->qcoeff, 0, sizeof(xd->qcoeff)); diff --git a/src/gallium/auxiliary/vl/vp8/decoder/dequantize.c b/src/gallium/auxiliary/vl/vp8/decoder/dequantize.c index b58ae7601b..d30593ed6b 100644 --- a/src/gallium/auxiliary/vl/vp8/decoder/dequantize.c +++ b/src/gallium/auxiliary/vl/vp8/decoder/dequantize.c @@ -13,10 +13,6 @@ #include "../common/idct.h" #include "../vp8_mem.h" -extern void vp8_short_idct4x4llm_c(short *input, short *output, int pitch) ; -extern void vp8_short_idct4x4llm_1_c(short *input, short *output, int pitch); - - void vp8_dequantize_b_c(BLOCKD *d) { int i; diff --git a/src/gallium/auxiliary/vl/vp8/decoder/idct_blk.c b/src/gallium/auxiliary/vl/vp8/decoder/idct_blk.c index ef67757b6a..b6b7f7b9ea 100644 --- a/src/gallium/auxiliary/vl/vp8/decoder/idct_blk.c +++ b/src/gallium/auxiliary/vl/vp8/decoder/idct_blk.c @@ -22,8 +22,8 @@ void vp8_dc_only_idct_add_c(short input_dc, unsigned char *pred_ptr, unsigned char *dst_ptr, int pitch, int stride); void vp8_dequant_dc_idct_add_y_block_c(short *q, short *dq, unsigned char *pre, - unsigned char *dst, int stride, char *eobs, - short *dc) + unsigned char *dst, int stride, + char *eobs, short *dc) { int i, j; diff --git a/src/gallium/auxiliary/vl/vp8/decoder/onyxd_if.c b/src/gallium/auxiliary/vl/vp8/decoder/onyxd_if.c index ad2b39401f..5fa37f9785 100644 --- a/src/gallium/auxiliary/vl/vp8/decoder/onyxd_if.c +++ b/src/gallium/auxiliary/vl/vp8/decoder/onyxd_if.c @@ -105,6 +105,9 @@ static int swap_frame_buffers(VP8_COMMON *cm) return err; } +/** + * Create a VP8 decoder instance. + */ VP8D_PTR vp8_decoder_create() { VP8D_COMP *pbi = vpx_memalign(32, sizeof(VP8D_COMP)); @@ -139,6 +142,9 @@ VP8D_PTR vp8_decoder_create() return (VP8D_PTR)pbi; } +/** + * Decode one VP8 frame. + */ int vp8_decoder_start(VP8D_PTR ptr, struct pipe_vp8_picture_desc *frame_header, const unsigned char *data, unsigned data_size, int64_t timestamp_deadline) @@ -216,6 +222,9 @@ int vp8_decoder_start(VP8D_PTR ptr, struct pipe_vp8_picture_desc *frame_header, return retcode; } +/** + * Return a decoded VP8 frame in a YV12 framebuffer. + */ int vp8_decoder_getframe(VP8D_PTR ptr, YV12_BUFFER_CONFIG *sd, int64_t *timestamp, @@ -249,6 +258,9 @@ int vp8_decoder_getframe(VP8D_PTR ptr, return ret; } +/** + * Destroy a VP8 decoder instance. + */ void vp8_decoder_remove(VP8D_PTR ptr) { VP8D_COMP *pbi = (VP8D_COMP *)ptr; diff --git a/src/gallium/auxiliary/vl/vp8/decoder/treereader.c b/src/gallium/auxiliary/vl/vp8/decoder/treereader.c index 7118ab720c..a017479126 100644 --- a/src/gallium/auxiliary/vl/vp8/decoder/treereader.c +++ b/src/gallium/auxiliary/vl/vp8/decoder/treereader.c @@ -14,6 +14,9 @@ #include <stddef.h> #include <limits.h> +/** + * Initialize the treereader. + */ int vp8dx_start_decode(BOOL_DECODER *bd, const unsigned char *data, unsigned int data_size) |