[FFmpeg-soc] [soc]: r3808 - in dirac/libavcodec: dirac.c dirac.h dirac_arith.c dirac_arith.h diracdec.c
conrad
subversion at mplayerhq.hu
Tue Nov 11 09:38:02 CET 2008
Author: conrad
Date: Tue Nov 11 09:38:01 2008
New Revision: 3808
Log:
*_t is a reserved namespace when POSIX headers are included
Modified:
dirac/libavcodec/dirac.c
dirac/libavcodec/dirac.h
dirac/libavcodec/dirac_arith.c
dirac/libavcodec/dirac_arith.h
dirac/libavcodec/diracdec.c
Modified: dirac/libavcodec/dirac.c
==============================================================================
--- dirac/libavcodec/dirac.c (original)
+++ dirac/libavcodec/dirac.c Tue Nov 11 09:38:01 2008
@@ -96,18 +96,15 @@ static const color_specification dirac_c
static const float dirac_preset_kr[] = { 0.2126, 0.299, 0 /* XXX */ };
static const float dirac_preset_kb[] = { 0.0722, 0.114, 0 /* XXX */ };
-/* Weights for qpel/eighth pel interpolation. */
-typedef uint8_t weights_t[4];
-
/* Quarter pixel interpolation. */
-static const weights_t qpel_weights[] = {
+static const uint8_t qpel_weights[][4] = {
{ 4, 0, 0, 0 }, /* rx=0, ry=0 */
{ 2, 0, 2, 0 }, /* rx=0, ry=1 */
{ 2, 2, 0, 0 }, /* rx=1, ry=0 */
{ 1, 1, 1, 1 }, /* rx=1, ry=1 */
};
-static const weights_t eighthpel_weights[] = {
+static const uint8_t eighthpel_weights[][4] = {
{ 16, 0, 0, 0 }, /* rx=0, ry=0 */
{ 12, 0, 4, 0 }, /* rx=0, ry=1 */
{ 8, 0, 8, 0 }, /* rx=0, ry=2 */
Modified: dirac/libavcodec/dirac.h
==============================================================================
--- dirac/libavcodec/dirac.h (original)
+++ dirac/libavcodec/dirac.h Tue Nov 11 09:38:01 2008
@@ -39,25 +39,25 @@ typedef enum {
COLOR_PRIMARY_SDTV_525, ///< SMPTE 170M, 525 primaries
COLOR_PRIMARY_SDTV_625, ///< EBU Tech 3213-E, 625 primaries
COLOR_PRIMARY_DCINEMA, ///< SMPTE 428.1, CIE XYZ
-} color_primary_t;
+} dirac_color_primary;
typedef enum {
COLOR_MATRIX_HDTV, ///< ITU-R BT.709, also computer/web
COLOR_MATRIX_SDTV, ///< ITU-R BT.601
COLOR_MATRIX_REVERSIBLE, ///< ITU-T H.264
-} color_matrix_t;
+} dirac_color_matrix;
typedef enum {
TRANSFER_FUNC_TV,
TRANSFER_FUNC_EXTENDED_GAMUT,
TRANSFER_FUNC_LINEAR,
TRANSFER_FUNC_DCI_GAMMA
-} transfer_func_t;
+} dirac_transfer_func;
typedef struct {
- color_primary_t primaries;
- color_matrix_t matrix;
- transfer_func_t transfer_function;
+ dirac_color_primary primaries;
+ dirac_color_matrix matrix;
+ dirac_transfer_func transfer_function;
} color_specification;
#define DIRAC_SIGN(x) ((x) > 0 ? 2 : ((x) < 0 ? 1 : 0))
@@ -142,15 +142,13 @@ extern struct dirac_arith_context_set ff
extern struct dirac_arith_context_set ff_dirac_context_set_dc;
extern struct dirac_arith_context_set ff_dirac_context_sets_waveletcoeff[];
-typedef int16_t vect_t[2];
-
#define DIRAC_REF_MASK_REF1 1
#define DIRAC_REF_MASK_REF2 2
#define DIRAC_REF_MASK_GLOBAL 4
struct dirac_blockmotion {
uint8_t use_ref;
- vect_t vect[2];
+ int16_t vect[2][2];
int16_t dc[3];
};
@@ -247,14 +245,14 @@ typedef enum {
pc_aux_data = 0x20,
pc_padding = 0x60,
pc_intra_ref = 0x0c
-} parse_code_t;
+} dirac_parse_code;
typedef enum {
subband_ll = 0,
subband_hl = 1,
subband_lh = 2,
subband_hh = 3
-} subband_t;
+} dirac_subband;
/**
* Calculate the width of a subband on a given level
@@ -325,7 +323,7 @@ static int inline coeff_quant_offset(Dir
* @return horizontal position within the coefficient array
*/
static int inline coeff_posx(DiracContext *s, int level,
- subband_t orientation, int x)
+ dirac_subband orientation, int x)
{
if (orientation == subband_hl || orientation == subband_hh)
return subband_width(s, level) + x;
@@ -343,7 +341,7 @@ static int inline coeff_posx(DiracContex
* @return vertical position within the coefficient array
*/
static inline
-int coeff_posy(DiracContext *s, int level, subband_t orientation, int y)
+int coeff_posy(DiracContext *s, int level, dirac_subband orientation, int y)
{
if (orientation == subband_lh || orientation == subband_hh)
return subband_height(s, level) + y;
@@ -375,7 +373,7 @@ int zero_neighbourhood(DiracContext *s,
* @return prediction for the sign: -1 when negative, 1 when positive, 0 when 0
*/
static inline
-int sign_predict(DiracContext *s, int16_t *data, subband_t orientation,
+int sign_predict(DiracContext *s, int16_t *data, dirac_subband orientation,
int v, int h)
{
if (orientation == subband_hl && v > 0)
Modified: dirac/libavcodec/dirac_arith.c
==============================================================================
--- dirac/libavcodec/dirac_arith.c (original)
+++ dirac/libavcodec/dirac_arith.c Tue Nov 11 09:38:01 2008
@@ -62,7 +62,7 @@ static uint16_t arith_lookup[256] = {
805, 750, 690, 625, 553, 471, 376, 255
};
-static void dirac_arith_init_common(dirac_arith_state_t arith)
+static void dirac_arith_init_common(dirac_arith_state arith)
{
int i;
@@ -82,7 +82,7 @@ static void dirac_arith_init_common(dira
* @param gb GetBitContext to read from
* @param length amount of bytes to decode
*/
-void dirac_arith_init(dirac_arith_state_t arith,
+void dirac_arith_init(dirac_arith_state arith,
GetBitContext *gb, int length)
{
align_get_bits(gb);
@@ -94,7 +94,7 @@ void dirac_arith_init(dirac_arith_state_
dirac_arith_init_common(arith);
}
-void dirac_arith_coder_init(dirac_arith_state_t arith, PutBitContext *pb)
+void dirac_arith_coder_init(dirac_arith_state arith, PutBitContext *pb)
{
arith->pb = pb;
arith->carry = 0;
@@ -110,7 +110,7 @@ void dirac_arith_coder_init(dirac_arith_
* @param context the context of the bit to read
* @return the bit read
*/
-int dirac_arith_get_bit(dirac_arith_state_t arith, int context)
+int dirac_arith_get_bit(dirac_arith_state arith, int context)
{
GetBitContext *gb = arith->gb;
unsigned int prob_zero = arith->contexts[context];
@@ -166,7 +166,7 @@ int dirac_arith_get_bit(dirac_arith_stat
* @param context the context of the bit to write
* @param bit the bit to write
*/
-void dirac_arith_put_bit(dirac_arith_state_t arith, int context, int bit)
+void dirac_arith_put_bit(dirac_arith_state arith, int context, int bit)
{
PutBitContext *pb = arith->pb;
unsigned int prob_zero = arith->contexts[context];
@@ -215,7 +215,7 @@ unsigned int follow_context(int index,
* @param context_set the collection of contexts to read the unsigned int
* @return value read by arithmetic decoder
*/
-unsigned int dirac_arith_read_uint(dirac_arith_state_t arith,
+unsigned int dirac_arith_read_uint(dirac_arith_state arith,
struct dirac_arith_context_set *context_set)
{
int ret = 1;
@@ -238,7 +238,7 @@ unsigned int dirac_arith_read_uint(dirac
* @param context_set the collection of contexts used to write the unsigned int
* @param i value to write
*/
-void dirac_arith_write_uint(dirac_arith_state_t arith,
+void dirac_arith_write_uint(dirac_arith_state arith,
struct dirac_arith_context_set *context_set,
unsigned int i)
{
@@ -258,7 +258,7 @@ void dirac_arith_write_uint(dirac_arith_
* @param context_set the collection of contexts to read the signed int
* @return value read by arithmetic decoder
*/
-int dirac_arith_read_int(dirac_arith_state_t arith,
+int dirac_arith_read_int(dirac_arith_state arith,
struct dirac_arith_context_set *context_set)
{
int ret = dirac_arith_read_uint(arith, context_set);
@@ -274,7 +274,7 @@ int dirac_arith_read_int(dirac_arith_sta
* @param context_set the collection of contexts used to write the signed int
* @param i value to write
*/
-void dirac_arith_write_int(dirac_arith_state_t arith,
+void dirac_arith_write_int(dirac_arith_state arith,
struct dirac_arith_context_set *context_set,
int i)
{
@@ -288,7 +288,7 @@ void dirac_arith_write_int(dirac_arith_s
* Flush the arithmetic decoder, consume all bytes up to the
* initialized length.
*/
-void dirac_arith_flush(dirac_arith_state_t arith)
+void dirac_arith_flush(dirac_arith_state arith)
{
assert(!arith->pb);
skip_bits_long(arith->gb, arith->bits_left);
@@ -299,7 +299,7 @@ void dirac_arith_flush(dirac_arith_state
/**
* Flush the arithmetic coder.
*/
-void dirac_arith_coder_flush(dirac_arith_state_t arith)
+void dirac_arith_coder_flush(dirac_arith_state arith)
{
int i;
int rem;
Modified: dirac/libavcodec/dirac_arith.h
==============================================================================
--- dirac/libavcodec/dirac_arith.h (original)
+++ dirac/libavcodec/dirac_arith.h Tue Nov 11 09:38:01 2008
@@ -86,7 +86,7 @@ typedef struct dirac_arith_state {
GetBitContext *gb;
PutBitContext *pb;
-} *dirac_arith_state_t;
+} *dirac_arith_state;
struct dirac_arith_context_set {
unsigned int follow[6]; ///< the first follow contexts
@@ -95,31 +95,31 @@ struct dirac_arith_context_set {
unsigned int sign; ///< context to read the sign
};
-void dirac_arith_init(dirac_arith_state_t arith,
+void dirac_arith_init(dirac_arith_state arith,
GetBitContext *gb, int length);
-void dirac_arith_coder_init(dirac_arith_state_t arith, PutBitContext *pb);
+void dirac_arith_coder_init(dirac_arith_state arith, PutBitContext *pb);
-int dirac_arith_get_bit(dirac_arith_state_t arith, int context);
+int dirac_arith_get_bit(dirac_arith_state arith, int context);
-void dirac_arith_put_bit(dirac_arith_state_t arith, int bit, int context);
+void dirac_arith_put_bit(dirac_arith_state arith, int bit, int context);
-unsigned int dirac_arith_read_uint(dirac_arith_state_t arith,
+unsigned int dirac_arith_read_uint(dirac_arith_state arith,
struct dirac_arith_context_set *context_set);
-int dirac_arith_read_int(dirac_arith_state_t arith,
+int dirac_arith_read_int(dirac_arith_state arith,
struct dirac_arith_context_set *context_set);
-void dirac_arith_write_uint(dirac_arith_state_t arith,
+void dirac_arith_write_uint(dirac_arith_state arith,
struct dirac_arith_context_set *context_set,
unsigned int i);
-void dirac_arith_write_int(dirac_arith_state_t arith,
+void dirac_arith_write_int(dirac_arith_state arith,
struct dirac_arith_context_set *context_set,
int i);
-void dirac_arith_flush(dirac_arith_state_t arith);
+void dirac_arith_flush(dirac_arith_state arith);
-void dirac_arith_coder_flush(dirac_arith_state_t arith);
+void dirac_arith_coder_flush(dirac_arith_state arith);
#endif /* AVCODEC_DIRAC_ARITH_H */
Modified: dirac/libavcodec/diracdec.c
==============================================================================
--- dirac/libavcodec/diracdec.c (original)
+++ dirac/libavcodec/diracdec.c Tue Nov 11 09:38:01 2008
@@ -83,7 +83,7 @@ static inline int coeff_dequant(int coef
* @param qfact quantizer factor
*/
static void coeff_unpack(DiracContext *s, int16_t *data, int level,
- subband_t orientation, int v, int h,
+ dirac_subband orientation, int v, int h,
int qoffset, int qfactor)
{
int parent = 0;
@@ -140,7 +140,7 @@ static void coeff_unpack(DiracContext *s
* @param quant quantizer factor
*/
static void codeblock(DiracContext *s, int16_t *data, int level,
- subband_t orientation, int x, int y,
+ dirac_subband orientation, int x, int y,
int qoffset, int qfactor)
{
int blockcnt_one = (s->codeblocksh[level] + s->codeblocksv[level]) == 2;
@@ -190,7 +190,7 @@ static void intra_dc_prediction(DiracCon
* @param orientation orientation of the subband
*/
static int subband(DiracContext *s, int16_t *data, int level,
- subband_t orientation)
+ dirac_subband orientation)
{
GetBitContext *gb = &s->gb;
unsigned int length;
@@ -579,7 +579,7 @@ static void decode_component(DiracContex
{
GetBitContext *gb = &s->gb;
int level;
- subband_t orientation;
+ dirac_subband orientation;
/* Align for coefficient bitstream. */
align_get_bits(gb);
More information about the FFmpeg-soc
mailing list