[FFmpeg-soc] [soc]: r4436 - in wmapro: wma3data.h wma3dec.c
faust3
subversion at mplayerhq.hu
Fri Jun 12 11:31:53 CEST 2009
Author: faust3
Date: Fri Jun 12 11:31:53 2009
New Revision: 4436
Log:
drop name prefixes for tables and static functions
Modified:
wmapro/wma3data.h
wmapro/wma3dec.c
Modified: wmapro/wma3data.h
==============================================================================
--- wmapro/wma3data.h Thu Jun 11 19:23:53 2009 (r4435)
+++ wmapro/wma3data.h Fri Jun 12 11:31:53 2009 (r4436)
@@ -31,7 +31,7 @@
/**
* @brief frequencies to divide the frequency spectrum into scale factor bands
*/
-static const uint16_t ff_wma3_critical_freq[] = {
+static const uint16_t critical_freq[] = {
100, 200, 300, 400, 510, 630, 770,
920, 1080, 1270, 1480, 1720, 2000, 2320,
2700, 3150, 3700, 4400, 5300, 6400, 7700,
@@ -43,9 +43,9 @@ static const uint16_t ff_wma3_critical_f
* @name huffman tables for DPCM-coded scale factors
* @{
*/
-#define FF_WMA3_HUFF_SCALE_SIZE 121
-#define FF_WMA3_HUFF_SCALE_MAXBITS 19
-static const uint16_t ff_wma3_scale_huffcodes[FF_WMA3_HUFF_SCALE_SIZE] = {
+#define HUFF_SCALE_SIZE 121
+#define HUFF_SCALE_MAXBITS 19
+static const uint16_t scale_huffcodes[HUFF_SCALE_SIZE] = {
0xE639, 0xE6C2, 0xE6C1, 0xE6C0, 0xE63F, 0xE63E, 0xE63D, 0xE63C,
0xE63B, 0xE63A, 0xE638, 0xE637, 0xE636, 0xE635, 0xE634, 0xE632,
0xE633, 0xE620, 0x737B, 0xE610, 0xE611, 0xE612, 0xE613, 0xE614,
@@ -64,7 +64,7 @@ static const uint16_t ff_wma3_scale_huff
0xE6F5,
};
-static const uint8_t ff_wma3_scale_huffbits[FF_WMA3_HUFF_SCALE_SIZE] = {
+static const uint8_t scale_huffbits[HUFF_SCALE_SIZE] = {
19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 19, 19, 19, 19, 19, 19,
19, 19, 18, 19, 19, 19, 19, 19,
@@ -89,9 +89,9 @@ static const uint8_t ff_wma3_scale_huffb
* @name huffman, run and level tables for run level coded scale factors
* @{
*/
-#define FF_WMA3_HUFF_SCALE_RL_SIZE 120
-#define FF_WMA3_HUFF_SCALE_RL_MAXBITS 21
-static const uint32_t ff_wma3_scale_rl_huffcodes[FF_WMA3_HUFF_SCALE_RL_SIZE] = {
+#define HUFF_SCALE_RL_SIZE 120
+#define HUFF_SCALE_RL_MAXBITS 21
+static const uint32_t scale_rl_huffcodes[HUFF_SCALE_RL_SIZE] = {
0x00010C, 0x000001, 0x10FE2A, 0x000003, 0x000003, 0x000001, 0x000013,
0x000020, 0x000029, 0x000014, 0x000016, 0x000045, 0x000049, 0x00002F,
0x000042, 0x00008E, 0x00008F, 0x000129, 0x000009, 0x00000D, 0x0004AC,
@@ -112,7 +112,7 @@ static const uint32_t ff_wma3_scale_rl_h
0x0002B1,
};
-static const uint8_t ff_wma3_scale_rl_huffbits[FF_WMA3_HUFF_SCALE_RL_SIZE] = {
+static const uint8_t scale_rl_huffbits[HUFF_SCALE_RL_SIZE] = {
9, 2, 21, 2, 4, 5, 5,
6, 6, 7, 7, 7, 7, 6,
7, 8, 8, 9, 10, 10, 11,
@@ -134,7 +134,7 @@ static const uint8_t ff_wma3_scale_rl_hu
};
-static const uint8_t ff_wma3_scale_rl_run[FF_WMA3_HUFF_SCALE_RL_SIZE] = {
+static const uint8_t scale_rl_run[HUFF_SCALE_RL_SIZE] = {
0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 1, 2, 3,
@@ -144,7 +144,7 @@ static const uint8_t ff_wma3_scale_rl_ru
0, 1, 0, 1, 0, 1,
};
-static const uint8_t ff_wma3_scale_rl_level[FF_WMA3_HUFF_SCALE_RL_SIZE] = {
+static const uint8_t scale_rl_level[HUFF_SCALE_RL_SIZE] = {
0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4,
@@ -160,9 +160,9 @@ static const uint8_t ff_wma3_scale_rl_le
* @name huffman, run and level codes for run level coded coefficients
* @{
*/
-#define FF_WMA3_HUFF_COEF0_SIZE 272
-#define FF_WMA3_HUFF_COEF0_MAXBITS 21
-static const uint32_t ff_wma3_coef0_huffcodes[FF_WMA3_HUFF_COEF0_SIZE] = {
+#define HUFF_COEF0_SIZE 272
+#define HUFF_COEF0_MAXBITS 21
+static const uint32_t coef0_huffcodes[HUFF_COEF0_SIZE] = {
0x00004A, 0x00002B, 0x000000, 0x000003, 0x000006, 0x000009, 0x00000F,
0x000010, 0x000016, 0x000011, 0x000016, 0x000028, 0x00002F, 0x000026,
0x000029, 0x000045, 0x000055, 0x00005D, 0x000042, 0x00004E, 0x000051,
@@ -204,7 +204,7 @@ static const uint32_t ff_wma3_coef0_huff
0x087448, 0x0047E4, 0x043A20, 0x00542A, 0x087449, 0x00898C,
};
-static const uint8_t ff_wma3_coef0_huffbits[FF_WMA3_HUFF_COEF0_SIZE] = {
+static const uint8_t coef0_huffbits[HUFF_COEF0_SIZE] = {
8, 7, 2, 3, 3, 4, 4,
5, 5, 6, 6, 6, 6, 7,
7, 7, 7, 7, 8, 8, 8,
@@ -247,9 +247,9 @@ static const uint8_t ff_wma3_coef0_huffb
};
-#define FF_WMA3_HUFF_COEF1_SIZE 244
-#define FF_WMA3_HUFF_COEF1_MAXBITS 22
-static const uint32_t ff_wma3_coef1_huffcodes[FF_WMA3_HUFF_COEF1_SIZE] = {
+#define HUFF_COEF1_SIZE 244
+#define HUFF_COEF1_MAXBITS 22
+static const uint32_t coef1_huffcodes[HUFF_COEF1_SIZE] = {
0x0001E2, 0x00007F, 0x000000, 0x000002, 0x000008, 0x00000E, 0x000019,
0x00002F, 0x000037, 0x000060, 0x00006C, 0x000095, 0x0000C6, 0x0000F0,
0x00012E, 0x000189, 0x0001A5, 0x0001F8, 0x000253, 0x00030A, 0x000344,
@@ -287,7 +287,7 @@ static const uint32_t ff_wma3_coef1_huff
0x175AC0, 0x005D61, 0x3F3C05, 0x006130, 0x3F3C04, 0x0062B5,
};
-static const uint8_t ff_wma3_coef1_huffbits[FF_WMA3_HUFF_COEF1_SIZE] = {
+static const uint8_t coef1_huffbits[HUFF_COEF1_SIZE] = {
9, 7, 2, 3, 4, 4, 5,
6, 6, 7, 7, 8, 8, 8,
9, 9, 9, 9, 10, 10, 10,
@@ -326,7 +326,7 @@ static const uint8_t ff_wma3_coef1_huffb
};
-static const uint8_t ff_wma3_coef0_run[FF_WMA3_HUFF_COEF0_SIZE] = {
+static const uint8_t coef0_run[HUFF_COEF0_SIZE] = {
0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
@@ -349,7 +349,7 @@ static const uint8_t ff_wma3_coef0_run[F
1, 0, 1, 0, 1, 0,
};
-static const uint8_t ff_wma3_coef0_level[FF_WMA3_HUFF_COEF0_SIZE] = {
+static const uint8_t coef0_level[HUFF_COEF0_SIZE] = {
0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -373,7 +373,7 @@ static const uint8_t ff_wma3_coef0_level
};
-static const uint8_t ff_wma3_coef1_run[FF_WMA3_HUFF_COEF1_SIZE] = {
+static const uint8_t coef1_run[HUFF_COEF1_SIZE] = {
0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
@@ -390,7 +390,7 @@ static const uint8_t ff_wma3_coef1_run[F
1, 0, 1, 0, 1, 0, 1, 0, 0, 0,
};
-static const uint8_t ff_wma3_coef1_level[FF_WMA3_HUFF_COEF1_SIZE] = {
+static const uint8_t coef1_level[HUFF_COEF1_SIZE] = {
0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -413,9 +413,9 @@ static const uint8_t ff_wma3_coef1_level
* @name huffman and vector lookup tables for vector-coded coefficients
* @{
*/
-#define FF_WMA3_HUFF_VEC4_SIZE 127
-#define FF_WMA3_HUFF_VEC4_MAXBITS 14
-static const uint16_t ff_wma3_vec4_huffcodes[FF_WMA3_HUFF_VEC4_SIZE] = {
+#define HUFF_VEC4_SIZE 127
+#define HUFF_VEC4_MAXBITS 14
+static const uint16_t vec4_huffcodes[HUFF_VEC4_SIZE] = {
0x0019, 0x0027, 0x00F2, 0x03BA, 0x0930, 0x1267, 0x0031, 0x0030,
0x0097, 0x0221, 0x058B, 0x0124, 0x00EB, 0x01D4, 0x03D8, 0x0584,
0x0364, 0x045F, 0x0F66, 0x0931, 0x24CD, 0x002F, 0x0039, 0x00E8,
@@ -434,7 +434,7 @@ static const uint16_t ff_wma3_vec4_huffc
0x03C4, 0x08B8, 0x078B, 0x0755, 0x0581, 0x0F67, 0x0000,
};
-static const uint8_t ff_wma3_vec4_huffbits[FF_WMA3_HUFF_VEC4_SIZE] = {
+static const uint8_t vec4_huffbits[HUFF_VEC4_SIZE] = {
5, 6, 8, 10, 12, 13, 6, 6,
8, 10, 11, 9, 8, 9, 10, 11,
10, 11, 12, 12, 14, 6, 6, 8,
@@ -454,9 +454,9 @@ static const uint8_t ff_wma3_vec4_huffbi
};
-#define FF_WMA3_HUFF_VEC2_SIZE 137
-#define FF_WMA3_HUFF_VEC2_MAXBITS 12
-static const uint16_t ff_wma3_vec2_huffcodes[FF_WMA3_HUFF_VEC2_SIZE] = {
+#define HUFF_VEC2_SIZE 137
+#define HUFF_VEC2_MAXBITS 12
+static const uint16_t vec2_huffcodes[HUFF_VEC2_SIZE] = {
0x055, 0x01C, 0x01A, 0x02B, 0x028, 0x067, 0x08B, 0x039,
0x170, 0x10D, 0x2A5, 0x047, 0x464, 0x697, 0x523, 0x8CB,
0x01B, 0x00E, 0x000, 0x010, 0x012, 0x036, 0x048, 0x04C,
@@ -477,7 +477,7 @@ static const uint16_t ff_wma3_vec2_huffc
0x001,
};
-static const uint8_t ff_wma3_vec2_huffbits[FF_WMA3_HUFF_VEC2_SIZE] = {
+static const uint8_t vec2_huffbits[HUFF_VEC2_SIZE] = {
7, 6, 6, 6, 7, 7, 8, 9,
9, 10, 10, 11, 11, 11, 12, 12,
6, 4, 5, 5, 6, 6, 7, 8,
@@ -499,9 +499,9 @@ static const uint8_t ff_wma3_vec2_huffbi
};
-#define FF_WMA3_HUFF_VEC1_SIZE 101
-#define FF_WMA3_HUFF_VEC1_MAXBITS 11
-static const uint16_t ff_wma3_vec1_huffcodes[FF_WMA3_HUFF_VEC1_SIZE] = {
+#define HUFF_VEC1_SIZE 101
+#define HUFF_VEC1_MAXBITS 11
+static const uint16_t vec1_huffcodes[HUFF_VEC1_SIZE] = {
0x01A, 0x003, 0x017, 0x010, 0x00C, 0x009, 0x005, 0x000,
0x00D, 0x00A, 0x009, 0x00C, 0x00F, 0x002, 0x004, 0x007,
0x00B, 0x00F, 0x01C, 0x006, 0x010, 0x015, 0x01C, 0x022,
@@ -517,7 +517,7 @@ static const uint16_t ff_wma3_vec1_huffc
0x297, 0x355, 0x372, 0x373, 0x016,
};
-static const uint8_t ff_wma3_vec1_huffbits[FF_WMA3_HUFF_VEC1_SIZE] = {
+static const uint8_t vec1_huffbits[HUFF_VEC1_SIZE] = {
7, 6, 5, 5, 5, 5, 5, 5,
4, 4, 4, 4, 4, 5, 5, 5,
5, 5, 5, 6, 6, 6, 6, 6,
@@ -534,7 +534,7 @@ static const uint8_t ff_wma3_vec1_huffbi
};
-static const uint16_t ff_wma3_symbol_to_vec4[FF_WMA3_HUFF_VEC4_SIZE] = {
+static const uint16_t symbol_to_vec4[HUFF_VEC4_SIZE] = {
0, 1, 2, 3, 4, 5, 16, 17, 18, 19,
20, 32, 33, 34, 35, 48, 49, 50, 64, 65,
80, 256, 257, 258, 259, 260, 272, 273, 274, 275,
@@ -551,7 +551,7 @@ static const uint16_t ff_wma3_symbol_to_
};
-static const uint8_t ff_wma3_symbol_to_vec2[FF_WMA3_HUFF_VEC2_SIZE] = {
+static const uint8_t symbol_to_vec2[HUFF_VEC2_SIZE] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
@@ -569,7 +569,7 @@ static const uint8_t ff_wma3_symbol_to_v
/**
* @brief decorrelation matrix for multichannel streams
**/
-static const float ff_wma3_default_decorrelation_matrices[] = {
+static const float default_decorrelation_matrices[] = {
1.000000, 0.707031, -0.707031, 0.707031, 0.707031, 0.578125, 0.707031,
0.410156, 0.578125, -0.707031, 0.410156, 0.578125, 0.000000, -0.816406,
0.500000, 0.652344, 0.500000, 0.269531, 0.500000, 0.269531, -0.500000,
@@ -588,14 +588,14 @@ static const float ff_wma3_default_decor
/**
* @brief default decorrelation matrix offsets
*/
-static const float *ff_wma3_default_decorrelation[] = {
+static const float *default_decorrelation[] = {
NULL,
- &ff_wma3_default_decorrelation_matrices[0],
- &ff_wma3_default_decorrelation_matrices[1],
- &ff_wma3_default_decorrelation_matrices[5],
- &ff_wma3_default_decorrelation_matrices[14],
- &ff_wma3_default_decorrelation_matrices[30],
- &ff_wma3_default_decorrelation_matrices[55]
+ &default_decorrelation_matrices[0],
+ &default_decorrelation_matrices[1],
+ &default_decorrelation_matrices[5],
+ &default_decorrelation_matrices[14],
+ &default_decorrelation_matrices[30],
+ &default_decorrelation_matrices[55]
};
#endif /* AVCODEC_WMA3DATA_H */
Modified: wmapro/wma3dec.c
==============================================================================
--- wmapro/wma3dec.c Thu Jun 11 19:23:53 2009 (r4435)
+++ wmapro/wma3dec.c Fri Jun 12 11:31:53 2009 (r4436)
@@ -100,11 +100,11 @@
#define VLCBITS 9
#define SCALEVLCBITS 8
-#define VEC4MAXDEPTH ((FF_WMA3_HUFF_VEC4_MAXBITS+VLCBITS-1)/VLCBITS)
-#define VEC2MAXDEPTH ((FF_WMA3_HUFF_VEC2_MAXBITS+VLCBITS-1)/VLCBITS)
-#define VEC1MAXDEPTH ((FF_WMA3_HUFF_VEC1_MAXBITS+VLCBITS-1)/VLCBITS)
-#define SCALEMAXDEPTH ((FF_WMA3_HUFF_SCALE_MAXBITS+SCALEVLCBITS-1)/SCALEVLCBITS)
-#define SCALERLMAXDEPTH ((FF_WMA3_HUFF_SCALE_RL_MAXBITS+VLCBITS-1)/VLCBITS)
+#define VEC4MAXDEPTH ((HUFF_VEC4_MAXBITS+VLCBITS-1)/VLCBITS)
+#define VEC2MAXDEPTH ((HUFF_VEC2_MAXBITS+VLCBITS-1)/VLCBITS)
+#define VEC1MAXDEPTH ((HUFF_VEC1_MAXBITS+VLCBITS-1)/VLCBITS)
+#define SCALEMAXDEPTH ((HUFF_SCALE_MAXBITS+SCALEVLCBITS-1)/SCALEVLCBITS)
+#define SCALERLMAXDEPTH ((HUFF_SCALE_RL_MAXBITS+VLCBITS-1)/VLCBITS)
static VLC sf_vlc; ///< scale factor dpcm vlc
static VLC sf_rl_vlc; ///< scale factor run length vlc
@@ -219,7 +219,7 @@ typedef struct WMA3DecodeContext {
*@brief helper function to print the most important members of the context
*@param s context
*/
-static void av_cold wma_dump_context(WMA3DecodeContext *s)
+static void av_cold dump_context(WMA3DecodeContext *s)
{
#define PRINT(a,b) av_log(s->avctx,AV_LOG_DEBUG," %s = %d\n", a, b);
#define PRINT_HEX(a,b) av_log(s->avctx,AV_LOG_DEBUG," %s = %x\n", a, b);
@@ -240,7 +240,7 @@ static void av_cold wma_dump_context(WMA
*@param decode_flags codec compression features
*@return number of output samples per frame
*/
-static int av_cold wma_get_samples_per_frame(int sample_rate,
+static int av_cold get_samples_per_frame(int sample_rate,
unsigned int decode_flags)
{
@@ -279,7 +279,7 @@ static int av_cold wma_get_samples_per_f
*@param avctx codec context
*@return 0 on success, < 0 otherwise
*/
-static av_cold int wma_decode_end(AVCodecContext *avctx)
+static av_cold int decode_end(AVCodecContext *avctx)
{
WMA3DecodeContext *s = avctx->priv_data;
int i;
@@ -300,7 +300,7 @@ static av_cold int wma_decode_end(AVCode
*@param avctx codec context
*@return 0 on success, -1 otherwise
*/
-static av_cold int wma_decode_init(AVCodecContext *avctx)
+static av_cold int decode_init(AVCodecContext *avctx)
{
WMA3DecodeContext *s = avctx->priv_data;
uint8_t *edata_ptr = avctx->extradata;
@@ -344,7 +344,7 @@ static av_cold int wma_decode_init(AVCod
}
/** get frame len */
- s->samples_per_frame = wma_get_samples_per_frame(avctx->sample_rate,
+ s->samples_per_frame = get_samples_per_frame(avctx->sample_rate,
s->decode_flags);
/** init previous block len */
@@ -382,37 +382,37 @@ static av_cold int wma_decode_init(AVCod
return -1;
}
- INIT_VLC_STATIC(&sf_vlc, SCALEVLCBITS, FF_WMA3_HUFF_SCALE_SIZE,
- ff_wma3_scale_huffbits, 1, 1,
- ff_wma3_scale_huffcodes, 2, 2, 616);
+ INIT_VLC_STATIC(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE,
+ scale_huffbits, 1, 1,
+ scale_huffcodes, 2, 2, 616);
- INIT_VLC_STATIC(&sf_rl_vlc, VLCBITS, FF_WMA3_HUFF_SCALE_RL_SIZE,
- ff_wma3_scale_rl_huffbits, 1, 1,
- ff_wma3_scale_rl_huffcodes, 4, 4, 1406);
+ INIT_VLC_STATIC(&sf_rl_vlc, VLCBITS, HUFF_SCALE_RL_SIZE,
+ scale_rl_huffbits, 1, 1,
+ scale_rl_huffcodes, 4, 4, 1406);
- INIT_VLC_STATIC(&coef_vlc[0], VLCBITS, FF_WMA3_HUFF_COEF0_SIZE,
- ff_wma3_coef0_huffbits, 1, 1,
- ff_wma3_coef0_huffcodes, 4, 4, 2108);
+ INIT_VLC_STATIC(&coef_vlc[0], VLCBITS, HUFF_COEF0_SIZE,
+ coef0_huffbits, 1, 1,
+ coef0_huffcodes, 4, 4, 2108);
- s->coef_max[0] = ((FF_WMA3_HUFF_COEF0_MAXBITS+VLCBITS-1)/VLCBITS);
+ s->coef_max[0] = ((HUFF_COEF0_MAXBITS+VLCBITS-1)/VLCBITS);
- INIT_VLC_STATIC(&coef_vlc[1], VLCBITS, FF_WMA3_HUFF_COEF1_SIZE,
- ff_wma3_coef1_huffbits, 1, 1,
- ff_wma3_coef1_huffcodes, 4, 4, 3912);
+ INIT_VLC_STATIC(&coef_vlc[1], VLCBITS, HUFF_COEF1_SIZE,
+ coef1_huffbits, 1, 1,
+ coef1_huffcodes, 4, 4, 3912);
- s->coef_max[1] = ((FF_WMA3_HUFF_COEF1_MAXBITS+VLCBITS-1)/VLCBITS);
+ s->coef_max[1] = ((HUFF_COEF1_MAXBITS+VLCBITS-1)/VLCBITS);
- INIT_VLC_STATIC(&vec4_vlc, VLCBITS, FF_WMA3_HUFF_VEC4_SIZE,
- ff_wma3_vec4_huffbits, 1, 1,
- ff_wma3_vec4_huffcodes, 2, 2, 604);
+ INIT_VLC_STATIC(&vec4_vlc, VLCBITS, HUFF_VEC4_SIZE,
+ vec4_huffbits, 1, 1,
+ vec4_huffcodes, 2, 2, 604);
- INIT_VLC_STATIC(&vec2_vlc, VLCBITS, FF_WMA3_HUFF_VEC2_SIZE,
- ff_wma3_vec2_huffbits, 1, 1,
- ff_wma3_vec2_huffcodes, 2, 2, 562);
+ INIT_VLC_STATIC(&vec2_vlc, VLCBITS, HUFF_VEC2_SIZE,
+ vec2_huffbits, 1, 1,
+ vec2_huffcodes, 2, 2, 562);
- INIT_VLC_STATIC(&vec1_vlc, VLCBITS, FF_WMA3_HUFF_VEC1_SIZE,
- ff_wma3_vec1_huffbits, 1, 1,
- ff_wma3_vec1_huffcodes, 2, 2, 562);
+ INIT_VLC_STATIC(&vec1_vlc, VLCBITS, HUFF_VEC1_SIZE,
+ vec1_huffbits, 1, 1,
+ vec1_huffcodes, 2, 2, 562);
s->num_sfb = av_mallocz(sizeof(int8_t)*s->num_possible_block_sizes);
s->sfb_offsets = av_mallocz(MAX_BANDS *
@@ -426,7 +426,7 @@ static av_cold int wma_decode_init(AVCod
!s->sfb_offsets || !s->subwoofer_cutoffs || !s->sf_offsets) {
av_log(avctx, AV_LOG_ERROR,
"failed to allocate scale factor offset tables\n");
- wma_decode_end(avctx);
+ decode_end(avctx);
return -1;
}
@@ -442,7 +442,7 @@ static av_cold int wma_decode_init(AVCod
sfb_offsets[0] = 0;
for (x=0;x < MAX_BANDS-1 && sfb_offsets[band-1] < subframe_len;x++) {
- int offset = (subframe_len * 2 * ff_wma3_critical_freq[x])
+ int offset = (subframe_len * 2 * critical_freq[x])
/ s->avctx->sample_rate + 2;
offset -= offset % 4;
if ( offset > sfb_offsets[band - 1] ) {
@@ -503,7 +503,7 @@ static av_cold int wma_decode_init(AVCod
for (i=0;i<33;i++)
sin64[i] = sin(i*M_PI / 64.0);
- wma_dump_context(s);
+ dump_context(s);
avctx->channel_layout = channel_mask;
return 0;
}
@@ -528,7 +528,7 @@ static av_cold int wma_decode_init(AVCod
*@param s context
*@return 0 on success, < 0 in case of an error
*/
-static int wma_decode_tilehdr(WMA3DecodeContext *s)
+static int decode_tilehdr(WMA3DecodeContext *s)
{
int c;
int missing_samples = s->num_channels * s->samples_per_frame;
@@ -696,7 +696,7 @@ static int wma_decode_tilehdr(WMA3Decode
*@param s codec context
*@param chgroup channel group for which the matrix needs to be calculated
*/
-static void wma_decode_decorrelation_matrix(WMA3DecodeContext* s,
+static void decode_decorrelation_matrix(WMA3DecodeContext* s,
WMA3ChannelGroup* chgroup)
{
int i;
@@ -757,7 +757,7 @@ static void wma_decode_decorrelation_mat
*@param s codec context
*@return 0 in case of bitstream errors, 1 on success
*/
-static int wma_decode_channel_transform(WMA3DecodeContext* s)
+static int decode_channel_transform(WMA3DecodeContext* s)
{
int i;
/* should never consume more than 1921 bits for the 8 channel case
@@ -827,7 +827,7 @@ static int wma_decode_channel_transform(
if (get_bits1(&s->gb)) {
chgroup->transform = 2;
if (get_bits1(&s->gb))
- wma_decode_decorrelation_matrix(s, chgroup);
+ decode_decorrelation_matrix(s, chgroup);
else {
/** FIXME: more than 6 coupled channels not supported */
if (chgroup->num_channels > 6) {
@@ -835,7 +835,7 @@ static int wma_decode_channel_transform(
"coupled channels > 6\n");
} else {
memcpy(chgroup->decorrelation_matrix,
- ff_wma3_default_decorrelation[chgroup->num_channels],
+ default_decorrelation[chgroup->num_channels],
sizeof(float) * chgroup->num_channels *
chgroup->num_channels);
}
@@ -866,7 +866,7 @@ static int wma_decode_channel_transform(
*@param s codec context
*@return the decoded coefficient
*/
-static unsigned int wma_get_large_val(WMA3DecodeContext* s)
+static unsigned int get_large_val(WMA3DecodeContext* s)
{
/** consumes up to 34 bits */
int n_bits = 8;
@@ -889,7 +889,7 @@ static unsigned int wma_get_large_val(WM
*@param c current channel number
*@return 0 in case of bitstream errors, 1 on success
*/
-static int wma_decode_coeffs(WMA3DecodeContext *s, int c)
+static int decode_coeffs(WMA3DecodeContext *s, int c)
{
int vlctable;
VLC* vlc;
@@ -910,11 +910,11 @@ static int wma_decode_coeffs(WMA3DecodeC
vlcmax = s->coef_max[vlctable];
if (vlctable) {
- run = ff_wma3_coef1_run;
- level = ff_wma3_coef1_level;
+ run = coef1_run;
+ level = coef1_level;
} else {
- run = ff_wma3_coef0_run;
- level = ff_wma3_coef0_level;
+ run = coef0_run;
+ level = coef0_level;
}
/** for subframe_len 128 the first zero coefficient will switch to
@@ -933,26 +933,26 @@ static int wma_decode_coeffs(WMA3DecodeC
idx = get_vlc2(&s->gb, vec4_vlc.table, VLCBITS, VEC4MAXDEPTH);
- if ( idx == FF_WMA3_HUFF_VEC4_SIZE - 1 ) {
+ if ( idx == HUFF_VEC4_SIZE - 1 ) {
for (i=0 ; i < 4 ; i+= 2) {
idx = get_vlc2(&s->gb, vec2_vlc.table, VLCBITS, VEC2MAXDEPTH);
- if ( idx == FF_WMA3_HUFF_VEC2_SIZE - 1 ) {
+ if ( idx == HUFF_VEC2_SIZE - 1 ) {
vals[i] = get_vlc2(&s->gb, vec1_vlc.table, VLCBITS, VEC1MAXDEPTH);
- if (vals[i] == FF_WMA3_HUFF_VEC1_SIZE - 1)
- vals[i] += wma_get_large_val(s);
+ if (vals[i] == HUFF_VEC1_SIZE - 1)
+ vals[i] += get_large_val(s);
vals[i+1] = get_vlc2(&s->gb, vec1_vlc.table, VLCBITS, VEC1MAXDEPTH);
- if (vals[i+1] == FF_WMA3_HUFF_VEC1_SIZE - 1)
- vals[i+1] += wma_get_large_val(s);
+ if (vals[i+1] == HUFF_VEC1_SIZE - 1)
+ vals[i+1] += get_large_val(s);
} else {
- vals[i] = (ff_wma3_symbol_to_vec2[idx] >> 4) & 0xF;
- vals[i+1] = ff_wma3_symbol_to_vec2[idx] & 0xF;
+ vals[i] = (symbol_to_vec2[idx] >> 4) & 0xF;
+ vals[i+1] = symbol_to_vec2[idx] & 0xF;
}
}
} else {
- vals[0] = (ff_wma3_symbol_to_vec4[idx] >> 8) >> 4;
- vals[1] = (ff_wma3_symbol_to_vec4[idx] >> 8) & 0xF;
- vals[2] = (ff_wma3_symbol_to_vec4[idx] >> 4) & 0xF;
- vals[3] = ff_wma3_symbol_to_vec4[idx] & 0xF;
+ vals[0] = (symbol_to_vec4[idx] >> 8) >> 4;
+ vals[1] = (symbol_to_vec4[idx] >> 8) & 0xF;
+ vals[2] = (symbol_to_vec4[idx] >> 4) & 0xF;
+ vals[3] = symbol_to_vec4[idx] & 0xF;
}
/** decode sign */
@@ -986,7 +986,7 @@ static int wma_decode_coeffs(WMA3DecodeC
} else if ( idx == 1)
break;
else {
- val = wma_get_large_val(s);
+ val = get_large_val(s);
/** escape decode */
if (get_bits1(&s->gb)) {
if (get_bits1(&s->gb)) {
@@ -1015,7 +1015,7 @@ static int wma_decode_coeffs(WMA3DecodeC
*@param s codec context
*@return 0 in case of bitstream errors, 1 on success
*/
-static int wma_decode_scale_factors(WMA3DecodeContext* s)
+static int decode_scale_factors(WMA3DecodeContext* s)
{
int i;
@@ -1093,8 +1093,8 @@ static int wma_decode_scale_factors(WMA3
} else if (idx == 1) {
break;
} else {
- skip = ff_wma3_scale_rl_run[idx];
- val = ff_wma3_scale_rl_level[idx];
+ skip = scale_rl_run[idx];
+ val = scale_rl_level[idx];
sign = get_bits1(&s->gb)-1;
}
@@ -1124,7 +1124,7 @@ static int wma_decode_scale_factors(WMA3
*@brief Reconstruct the individual channel data.
*@param s codec context
*/
-static void wma_inverse_channel_transform(WMA3DecodeContext *s)
+static void inverse_channel_transform(WMA3DecodeContext *s)
{
int i;
@@ -1198,7 +1198,7 @@ static void wma_inverse_channel_transfor
*@brief Apply sine window and reconstruct the output buffer.
*@param s codec context
*/
-static void wma_window(WMA3DecodeContext *s)
+static void window(WMA3DecodeContext *s)
{
int i;
for (i=0;i<s->channels_for_cur_subframe;i++) {
@@ -1229,7 +1229,7 @@ static void wma_window(WMA3DecodeContext
*@param s codec context
*@return 0 if decoding failed, 1 on success
*/
-static int wma_decode_subframe(WMA3DecodeContext *s)
+static int decode_subframe(WMA3DecodeContext *s)
{
int offset = s->samples_per_frame;
int subframe_len = s->samples_per_frame;
@@ -1342,7 +1342,7 @@ static int wma_decode_subframe(WMA3Decod
}
- if (!wma_decode_channel_transform(s))
+ if (!decode_channel_transform(s))
return 0;
@@ -1396,7 +1396,7 @@ static int wma_decode_subframe(WMA3Decod
}
/** decode scale factors */
- if (!wma_decode_scale_factors(s))
+ if (!decode_scale_factors(s))
return 0;
}
@@ -1408,7 +1408,7 @@ static int wma_decode_subframe(WMA3Decod
int c = s->channel_indexes_for_cur_subframe[i];
if (s->channel[c].transmit_coefs &&
get_bits_count(&s->gb) < s->num_saved_bits)
- wma_decode_coeffs(s,c);
+ decode_coeffs(s,c);
}
DBG(s->avctx,AV_LOG_DEBUG,"BITSTREAM: subframe length was %i\n",
@@ -1416,7 +1416,7 @@ static int wma_decode_subframe(WMA3Decod
if (transmit_coeffs) {
/** reconstruct the per channel data */
- wma_inverse_channel_transform(s);
+ inverse_channel_transform(s);
for (i=0;i<s->channels_for_cur_subframe;i++) {
int c = s->channel_indexes_for_cur_subframe[i];
int* sf;
@@ -1451,7 +1451,7 @@ static int wma_decode_subframe(WMA3Decod
}
/** window and overlapp-add */
- wma_window(s);
+ window(s);
/** handled one subframe */
for (i=0;i<s->channels_for_cur_subframe;i++) {
@@ -1472,7 +1472,7 @@ static int wma_decode_subframe(WMA3Decod
*@return 0 if the trailer bit indicates that this is the last frame,
* 1 if there are additional frames
*/
-static int wma_decode_frame(WMA3DecodeContext *s)
+static int decode_frame(WMA3DecodeContext *s)
{
GetBitContext* gb = &s->gb;
int more_frames = 0;
@@ -1494,7 +1494,7 @@ static int wma_decode_frame(WMA3DecodeCo
DBG(s->avctx,AV_LOG_DEBUG,"decoding frame with length %x\n",len);
/** decode tile information */
- if (wma_decode_tilehdr(s)) {
+ if (decode_tilehdr(s)) {
s->packet_loss = 1;
return 0;
}
@@ -1544,7 +1544,7 @@ static int wma_decode_frame(WMA3DecodeCo
/** decode all subframes */
while (!s->parsed_all_subframes) {
- if (!wma_decode_subframe(s)) {
+ if (!decode_subframe(s)) {
s->packet_loss = 1;
return 0;
}
@@ -1599,7 +1599,7 @@ static int wma_decode_frame(WMA3DecodeCo
*@param gb bitstream reader context
*@return remaining size in bits
*/
-static int wma_remaining_bits(WMA3DecodeContext *s, GetBitContext* gb)
+static int remaining_bits(WMA3DecodeContext *s, GetBitContext* gb)
{
return s->buf_bit_size - get_bits_count(gb);
}
@@ -1611,7 +1611,7 @@ static int wma_remaining_bits(WMA3Decode
*@param len length of the partial frame
*@param append decides wether to reset the buffer or not
*/
-static void wma_save_bits(WMA3DecodeContext *s, GetBitContext* gb, int len,
+static void save_bits(WMA3DecodeContext *s, GetBitContext* gb, int len,
int append)
{
int buflen;
@@ -1675,7 +1675,7 @@ static void wma_save_bits(WMA3DecodeCont
*@param avpkt input packet
*@return number of bytes that were read from the input buffer
*/
-static int wma_decode_packet(AVCodecContext *avctx,
+static int decode_packet(AVCodecContext *avctx,
void *data, int *data_size, AVPacket* avpkt)
{
GetBitContext gb;
@@ -1721,13 +1721,13 @@ static int wma_decode_packet(AVCodecCont
if (num_bits_prev_frame > 0) {
/** append the previous frame data to the remaining data from the
previous packet to create a full frame */
- wma_save_bits(s, &gb, num_bits_prev_frame, 1);
+ save_bits(s, &gb, num_bits_prev_frame, 1);
DBG(avctx, AV_LOG_DEBUG, "accumulated %x bits of frame data\n",
s->num_saved_bits - s->frame_offset);
/** decode the cross packet frame if it is valid */
if (!s->packet_loss)
- wma_decode_frame(s);
+ decode_frame(s);
} else if (s->num_saved_bits - s->frame_offset) {
DBG(avctx, AV_LOG_DEBUG, "ignoring %x previously saved bits\n",
s->num_saved_bits - s->frame_offset);
@@ -1736,15 +1736,15 @@ static int wma_decode_packet(AVCodecCont
s->packet_loss = 0;
/** decode the rest of the packet */
while (!s->packet_loss && more_frames &&
- wma_remaining_bits(s,&gb) > s->log2_frame_size) {
+ remaining_bits(s,&gb) > s->log2_frame_size) {
int frame_size = show_bits(&gb, s->log2_frame_size);
/** there is enough data for a full frame */
- if (wma_remaining_bits(s,&gb) >= frame_size && frame_size > 0) {
- wma_save_bits(s, &gb, frame_size, 0);
+ if (remaining_bits(s,&gb) >= frame_size && frame_size > 0) {
+ save_bits(s, &gb, frame_size, 0);
/** decode the frame */
- more_frames = wma_decode_frame(s);
+ more_frames = decode_frame(s);
if (!more_frames) {
DBG(avctx, AV_LOG_DEBUG, "no more frames\n");
@@ -1756,7 +1756,7 @@ static int wma_decode_packet(AVCodecCont
if (!s->packet_loss) {
/** save the rest of the data so that it can be decoded
with the next packet */
- wma_save_bits(s, &gb, wma_remaining_bits(s,&gb), 0);
+ save_bits(s, &gb, remaining_bits(s,&gb), 0);
}
*data_size = (int8_t *)s->samples - (int8_t *)data;
@@ -1768,7 +1768,7 @@ static int wma_decode_packet(AVCodecCont
*@brief Clear decoder buffers (for seeking).
*@param avctx codec context
*/
-static void wma_flush(AVCodecContext *avctx)
+static void flush(AVCodecContext *avctx)
{
WMA3DecodeContext *s = avctx->priv_data;
int i;
@@ -1789,10 +1789,10 @@ AVCodec wmapro_decoder =
CODEC_TYPE_AUDIO,
CODEC_ID_WMAPRO,
sizeof(WMA3DecodeContext),
- wma_decode_init,
+ decode_init,
NULL,
- wma_decode_end,
- wma_decode_packet,
- .flush= wma_flush,
+ decode_end,
+ decode_packet,
+ .flush= flush,
.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 9 Professional"),
};
More information about the FFmpeg-soc
mailing list