summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmeric Grange <emeric.grange@gmail.com>2012-01-28 01:42:10 +0100
committerEmeric Grange <emeric.grange@gmail.com>2012-06-24 16:57:33 +0200
commitaed02ffe77dbc4ab05b2e63a26939b071ff0206c (patch)
tree5c76c4c652e19cbbca6b2a91edba65f7f00be354
parent78274d7b571acc8c81d18a6b72c348c1e2bf3b88 (diff)
g3dvl: vp8 minor cleanup
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
-rw-r--r--src/gallium/auxiliary/vl/vp8/coefupdateprobs.h2
-rw-r--r--src/gallium/auxiliary/vl/vp8/defaultcoefcounts.h2
-rw-r--r--src/gallium/auxiliary/vl/vp8/detokenize.c38
-rw-r--r--src/gallium/auxiliary/vl/vp8/detokenize.h4
-rw-r--r--src/gallium/auxiliary/vl/vp8/entropymode.c28
-rw-r--r--src/gallium/auxiliary/vl/vp8/entropymode.h14
-rw-r--r--src/gallium/auxiliary/vl/vp8/entropymv.h26
-rw-r--r--src/gallium/auxiliary/vl/vp8/recon.c10
-rw-r--r--src/gallium/auxiliary/vl/vp8/recon.h4
-rw-r--r--src/gallium/auxiliary/vl/vp8/recon_dispatch.h4
10 files changed, 66 insertions, 66 deletions
diff --git a/src/gallium/auxiliary/vl/vp8/coefupdateprobs.h b/src/gallium/auxiliary/vl/vp8/coefupdateprobs.h
index 56c4a78ecb..5e20f3b599 100644
--- a/src/gallium/auxiliary/vl/vp8/coefupdateprobs.h
+++ b/src/gallium/auxiliary/vl/vp8/coefupdateprobs.h
@@ -17,7 +17,7 @@
* 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] =
+const vp8_prob vp8_coef_update_probs[BLOCK_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES] =
{
{
{
diff --git a/src/gallium/auxiliary/vl/vp8/defaultcoefcounts.h b/src/gallium/auxiliary/vl/vp8/defaultcoefcounts.h
index dca1aa0b1f..95550e2895 100644
--- a/src/gallium/auxiliary/vl/vp8/defaultcoefcounts.h
+++ b/src/gallium/auxiliary/vl/vp8/defaultcoefcounts.h
@@ -15,7 +15,7 @@
/* Generated file, included by entropy.c */
-const unsigned int vp8_default_coef_counts [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS] =
+const unsigned int vp8_default_coef_counts[BLOCK_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS][MAX_ENTROPY_TOKENS] =
{
{
/* Block Type ( 0 ) */
diff --git a/src/gallium/auxiliary/vl/vp8/detokenize.c b/src/gallium/auxiliary/vl/vp8/detokenize.c
index 5788569058..c6336f985f 100644
--- a/src/gallium/auxiliary/vl/vp8/detokenize.c
+++ b/src/gallium/auxiliary/vl/vp8/detokenize.c
@@ -17,8 +17,6 @@
#include "detokenize.h"
#include "blockd.h"
-#define OCB_X PREV_COEF_CONTEXTS * ENTROPY_NODES
-
#define EOB_CONTEXT_NODE 0
#define ZERO_CONTEXT_NODE 1
#define ONE_CONTEXT_NODE 2
@@ -31,6 +29,8 @@
#define CAT_THREE_CONTEXT_NODE 9
#define CAT_FIVE_CONTEXT_NODE 10
+#define OCB_X PREV_COEF_CONTEXTS * ENTROPY_NODES
+
DECLARE_ALIGNED(16, static const unsigned char, coef_bands_x[16]) =
{
0 * OCB_X, 1 * OCB_X, 2 * OCB_X, 3 * OCB_X,
@@ -65,19 +65,19 @@ const unsigned char vp8_block2above[25] =
0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8
};
-void vp8_reset_mb_tokens_context(MACROBLOCKD *x)
+void vp8_reset_mb_tokens_context(MACROBLOCKD *mb)
{
/* Clear entropy contexts for Y2 blocks */
- if (x->mode_info_context->mbmi.mode != B_PRED &&
- x->mode_info_context->mbmi.mode != SPLITMV)
+ if (mb->mode_info_context->mbmi.mode != B_PRED &&
+ mb->mode_info_context->mbmi.mode != SPLITMV)
{
- memset(x->above_context, 0, sizeof(ENTROPY_CONTEXT_PLANES));
- memset(x->left_context, 0, sizeof(ENTROPY_CONTEXT_PLANES));
+ memset(mb->above_context, 0, sizeof(ENTROPY_CONTEXT_PLANES));
+ memset(mb->left_context, 0, sizeof(ENTROPY_CONTEXT_PLANES));
}
else
{
- memset(x->above_context, 0, sizeof(ENTROPY_CONTEXT_PLANES) - 1);
- memset(x->left_context, 0, sizeof(ENTROPY_CONTEXT_PLANES) - 1);
+ memset(mb->above_context, 0, sizeof(ENTROPY_CONTEXT_PLANES) - 1);
+ memset(mb->left_context, 0, sizeof(ENTROPY_CONTEXT_PLANES) - 1);
}
}
@@ -166,7 +166,7 @@ DECLARE_ALIGNED(16, extern const unsigned char, vp8_norm[256]);
#define DECODE_EXTRABIT_AND_ADJUST_VAL(t, bits_count) \
{ \
- split = 1 + (((range-1) * vp8d_token_extra_bits2[t].Probs[bits_count]) >> 8); \
+ split = 1 + (((range - 1) * vp8d_token_extra_bits2[t].Probs[bits_count]) >> 8); \
bigsplit = (VP8_BD_VALUE)split << (VP8_BD_VALUE_SIZE - 8); \
FILL \
if(value >= bigsplit) { \
@@ -184,15 +184,15 @@ DECLARE_ALIGNED(16, extern const unsigned char, vp8_norm[256]);
Dest = ((A) != 0) + ((B) != 0);
-int vp8_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *x)
+int vp8_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *mb)
{
- ENTROPY_CONTEXT *A = (ENTROPY_CONTEXT *)x->above_context;
- ENTROPY_CONTEXT *L = (ENTROPY_CONTEXT *)x->left_context;
+ ENTROPY_CONTEXT *A = (ENTROPY_CONTEXT *)mb->above_context;
+ ENTROPY_CONTEXT *L = (ENTROPY_CONTEXT *)mb->left_context;
const FRAME_CONTEXT * const fc = &dx->common.fc;
- BOOL_DECODER *bd = x->current_bd;
+ BOOL_DECODER *bd = mb->current_bd;
- char *eobs = x->eobs;
+ char *eobs = mb->eobs;
ENTROPY_CONTEXT *a;
ENTROPY_CONTEXT *l;
@@ -221,10 +221,10 @@ int vp8_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *x)
const vp8_prob *coef_probs;
scan = vp8_default_zig_zag1d;
- qcoeff_ptr = &x->qcoeff[0];
+ qcoeff_ptr = &mb->qcoeff[0];
- if (x->mode_info_context->mbmi.mode != B_PRED &&
- x->mode_info_context->mbmi.mode != SPLITMV)
+ if (mb->mode_info_context->mbmi.mode != B_PRED &&
+ mb->mode_info_context->mbmi.mode != SPLITMV)
{
i = 24;
stop = 24;
@@ -269,7 +269,7 @@ CHECK_0_:
do
{
DECODE_EXTRABIT_AND_ADJUST_VAL(DCT_VAL_CATEGORY6, bits_count);
- bits_count --;
+ bits_count--;
}
while (bits_count >= 0);
diff --git a/src/gallium/auxiliary/vl/vp8/detokenize.h b/src/gallium/auxiliary/vl/vp8/detokenize.h
index 06b2e0fc16..388d1e3fe6 100644
--- a/src/gallium/auxiliary/vl/vp8/detokenize.h
+++ b/src/gallium/auxiliary/vl/vp8/detokenize.h
@@ -14,7 +14,7 @@
#include "vp8_decoder.h"
-void vp8_reset_mb_tokens_context(MACROBLOCKD *x);
-int vp8_decode_mb_tokens(VP8D_COMP *, MACROBLOCKD *);
+void vp8_reset_mb_tokens_context(MACROBLOCKD *mb);
+int vp8_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *mb);
#endif /* DETOKENIZE_H */
diff --git a/src/gallium/auxiliary/vl/vp8/entropymode.c b/src/gallium/auxiliary/vl/vp8/entropymode.c
index 82bd9017bb..109f8930d1 100644
--- a/src/gallium/auxiliary/vl/vp8/entropymode.c
+++ b/src/gallium/auxiliary/vl/vp8/entropymode.c
@@ -44,9 +44,9 @@ int vp8_mv_cont(const int_mv *l, const int_mv *a)
return SUBMVREF_NORMAL;
}
-static const vp8_prob sub_mv_ref_prob [VP8_SUBMVREFS-1] = { 180, 162, 25};
+static const vp8_prob sub_mv_ref_prob[VP8_SUBMVREFS - 1] = { 180, 162, 25};
-const vp8_prob vp8_sub_mv_ref_prob2 [SUBMVREF_COUNT][VP8_SUBMVREFS-1] =
+const vp8_prob vp8_sub_mv_ref_prob2[SUBMVREF_COUNT][VP8_SUBMVREFS - 1] =
{
{ 147, 136, 18 },
{ 106, 145, 1 },
@@ -55,7 +55,7 @@ const vp8_prob vp8_sub_mv_ref_prob2 [SUBMVREF_COUNT][VP8_SUBMVREFS-1] =
{ 208, 1 , 1 }
};
-vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS] =
+vp8_mbsplit vp8_mbsplits[VP8_NUMMBSPLITS] =
{
{
0, 0, 0, 0,
@@ -85,7 +85,7 @@ 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 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 */
@@ -160,7 +160,7 @@ struct vp8_token_struct vp8_mv_ref_encoding_array [VP8_MVREFS];
struct vp8_token_struct vp8_sub_mv_ref_encoding_array [VP8_SUBMVREFS];
-const vp8_tree_index vp8_small_mvtree [14] =
+const vp8_tree_index vp8_small_mvtree[14] =
{
2, 8,
4, 6,
@@ -171,11 +171,11 @@ const vp8_tree_index vp8_small_mvtree [14] =
-6, -7
};
-struct vp8_token_struct vp8_small_mvencodings [8];
+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,
@@ -196,23 +196,23 @@ void vp8_init_mbmode_probs(VP8_COMMON *x)
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])
+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])
{
vp8_tree_probs_from_distribution(VP8_BINTRAMODES, vp8_bmode_encodings, vp8_bmode_tree,
p, branch_ct, events, 256, 1);
}
-void vp8_default_bmode_probs(vp8_prob p [VP8_BINTRAMODES-1])
+void vp8_default_bmode_probs(vp8_prob p[VP8_BINTRAMODES - 1])
{
- unsigned int branch_ct [VP8_BINTRAMODES-1] [2];
+ unsigned int branch_ct[VP8_BINTRAMODES - 1][2];
intra_bmode_probs_from_distribution(p, branch_ct, bmode_cts);
}
-void vp8_kf_default_bmode_probs(vp8_prob p [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1])
+void vp8_kf_default_bmode_probs(vp8_prob p[VP8_BINTRAMODES][VP8_BINTRAMODES][VP8_BINTRAMODES - 1])
{
- unsigned int branch_ct [VP8_BINTRAMODES-1] [2];
+ unsigned int branch_ct[VP8_BINTRAMODES - 1][2];
int i = 0, j = 0;
do
diff --git a/src/gallium/auxiliary/vl/vp8/entropymode.h b/src/gallium/auxiliary/vl/vp8/entropymode.h
index 316892ad57..3b99b40a91 100644
--- a/src/gallium/auxiliary/vl/vp8/entropymode.h
+++ b/src/gallium/auxiliary/vl/vp8/entropymode.h
@@ -20,15 +20,15 @@ typedef const int vp8_mbsplit[16];
#define VP8_NUMMBSPLITS 4
#define SUBMVREF_COUNT 5
-extern vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS];
+extern vp8_mbsplit vp8_mbsplits[VP8_NUMMBSPLITS];
-extern const int vp8_mbsplit_count [VP8_NUMMBSPLITS]; /* # of subsets */
+extern const int vp8_mbsplit_count[VP8_NUMMBSPLITS]; /* # of subsets */
-extern const vp8_prob vp8_mbsplit_probs [VP8_NUMMBSPLITS-1];
+extern const vp8_prob vp8_mbsplit_probs[VP8_NUMMBSPLITS - 1];
extern int vp8_mv_cont(const int_mv *l, const int_mv *a);
-extern const vp8_prob vp8_sub_mv_ref_prob2 [SUBMVREF_COUNT][VP8_SUBMVREFS-1];
+extern const vp8_prob vp8_sub_mv_ref_prob2[SUBMVREF_COUNT][VP8_SUBMVREFS - 1];
extern const vp8_tree_index vp8_bmode_tree[];
@@ -53,13 +53,13 @@ extern struct vp8_token_struct vp8_sub_mv_ref_encoding_array[VP8_SUBMVREFS];
extern const vp8_tree_index vp8_small_mvtree[];
-extern struct vp8_token_struct vp8_small_mvencodings [8];
+extern struct vp8_token_struct vp8_small_mvencodings[8];
void vp8_entropy_mode_init();
void vp8_init_mbmode_probs(VP8_COMMON *x);
-void vp8_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES-1]);
-void vp8_kf_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1]);
+void vp8_default_bmode_probs(vp8_prob dest[VP8_BINTRAMODES - 1]);
+void vp8_kf_default_bmode_probs(vp8_prob dest[VP8_BINTRAMODES][VP8_BINTRAMODES][VP8_BINTRAMODES - 1]);
#endif /* ENTROPYMODE_H */
diff --git a/src/gallium/auxiliary/vl/vp8/entropymv.h b/src/gallium/auxiliary/vl/vp8/entropymv.h
index d948c79f47..b4aefedc24 100644
--- a/src/gallium/auxiliary/vl/vp8/entropymv.h
+++ b/src/gallium/auxiliary/vl/vp8/entropymv.h
@@ -16,27 +16,27 @@
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 */
- MVfpvals = (2 * mvfp_max) +1, /* # possible full pixel MV values */
+ 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 */
- mvnum_short = 8, /* magnitudes 0 through 7 */
+ mvlong_width = 10, /**< Large MVs have 9 bit magnitudes */
+ mvnum_short = 8, /**< Magnitudes 0 through 7 */
- /* probability offsets for coding each MV component */
+ /* 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) */
+ MVPbits = MVPshort + mvnum_short - 1, /**< mvlong_width long value bits */
+ MVPcount = MVPbits + mvlong_width /**< (with independent probabilities) */
};
typedef struct
{
- 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];
diff --git a/src/gallium/auxiliary/vl/vp8/recon.c b/src/gallium/auxiliary/vl/vp8/recon.c
index 14785d105a..7f61cf275a 100644
--- a/src/gallium/auxiliary/vl/vp8/recon.c
+++ b/src/gallium/auxiliary/vl/vp8/recon.c
@@ -95,32 +95,32 @@ void vp8_recon2b_c(unsigned char *pred_ptr,
}
}
-void vp8_recon_mby_c(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *x)
+void vp8_recon_mby_c(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *mb)
{
int i;
for (i = 0; i < 16; i += 4)
{
- BLOCKD *b = &x->block[i];
+ BLOCKD *b = &mb->block[i];
RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
}
}
-void vp8_recon_mb_c(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *x)
+void vp8_recon_mb_c(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *mb)
{
int i;
for (i = 0; i < 16; i += 4)
{
- BLOCKD *b = &x->block[i];
+ BLOCKD *b = &mb->block[i];
RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
}
for (i = 16; i < 24; i += 2)
{
- BLOCKD *b = &x->block[i];
+ BLOCKD *b = &mb->block[i];
RECON_INVOKE(rtcd, recon2)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride);
}
diff --git a/src/gallium/auxiliary/vl/vp8/recon.h b/src/gallium/auxiliary/vl/vp8/recon.h
index 60c7831982..4bed1753e5 100644
--- a/src/gallium/auxiliary/vl/vp8/recon.h
+++ b/src/gallium/auxiliary/vl/vp8/recon.h
@@ -33,8 +33,8 @@ void vp8_recon2b_c(unsigned char *pred_ptr,
unsigned char *dst_ptr,
int stride);
-void vp8_recon_mby_c(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *x);
+void vp8_recon_mby_c(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *mb);
-void vp8_recon_mb_c(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *x);
+void vp8_recon_mb_c(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *mb);
#endif /* RECON_H */
diff --git a/src/gallium/auxiliary/vl/vp8/recon_dispatch.h b/src/gallium/auxiliary/vl/vp8/recon_dispatch.h
index d3182812b6..dc53da0067 100644
--- a/src/gallium/auxiliary/vl/vp8/recon_dispatch.h
+++ b/src/gallium/auxiliary/vl/vp8/recon_dispatch.h
@@ -24,10 +24,10 @@ struct vp8_recon_rtcd_vtable;
void sym(unsigned char *pred, short *diff, unsigned char *dst, int pitch)
#define prototype_recon_macroblock(sym) \
- void sym(const struct vp8_recon_rtcd_vtable *rtcd, MACROBLOCKD *x)
+ void sym(const struct vp8_recon_rtcd_vtable *rtcd, MACROBLOCKD *mb)
#define prototype_build_intra_predictors(sym) \
- void sym(MACROBLOCKD *x)
+ void sym(MACROBLOCKD *mb)
#define prototype_intra4x4_predict(sym) \
void sym(BLOCKD *x, int b_mode, unsigned char *predictor)