Mercurial > audlegacy-plugins
annotate src/wma/libffwma/wma.h @ 957:f3ccef1dcd61 trunk
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
Patch by Ian Braithwaite ian braithwaite dot dk".
author | chainsaw |
---|---|
date | Sat, 14 Apr 2007 17:38:32 -0700 |
parents | |
children |
rev | line source |
---|---|
957
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
1 /* |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
2 * WMA compatible codec |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
3 * Copyright (c) 2002-2007 The FFmpeg Project. |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
4 * |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
5 * This file is part of FFmpeg. |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
6 * |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
7 * FFmpeg is free software; you can redistribute it and/or |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
9 * License as published by the Free Software Foundation; either |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
10 * version 2.1 of the License, or (at your option) any later version. |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
11 * |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
12 * FFmpeg is distributed in the hope that it will be useful, |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
15 * Lesser General Public License for more details. |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
16 * |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
18 * License along with FFmpeg; if not, write to the Free Software |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
20 */ |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
21 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
22 #ifndef WMA_H |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
23 #define WMA_H |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
24 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
25 /* #include "bitstream.h" */ |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
26 #include "dsputil.h" |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
27 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
28 /* size of blocks */ |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
29 #define BLOCK_MIN_BITS 7 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
30 #define BLOCK_MAX_BITS 11 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
31 #define BLOCK_MAX_SIZE (1 << BLOCK_MAX_BITS) |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
32 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
33 #define BLOCK_NB_SIZES (BLOCK_MAX_BITS - BLOCK_MIN_BITS + 1) |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
34 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
35 /* XXX: find exact max size */ |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
36 #define HIGH_BAND_MAX_SIZE 16 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
37 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
38 #define NB_LSP_COEFS 10 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
39 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
40 /* XXX: is it a suitable value ? */ |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
41 #define MAX_CODED_SUPERFRAME_SIZE 16384 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
42 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
43 #define MAX_CHANNELS 2 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
44 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
45 #define NOISE_TAB_SIZE 8192 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
46 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
47 #define LSP_POW_BITS 7 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
48 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
49 //FIXME should be in wmadec |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
50 #define VLCBITS 9 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
51 #define VLCMAX ((22+VLCBITS-1)/VLCBITS) |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
52 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
53 typedef struct CoefVLCTable { |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
54 int n; ///< total number of codes |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
55 int max_level; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
56 const uint32_t *huffcodes; ///< VLC bit values |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
57 const uint8_t *huffbits; ///< VLC bit size |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
58 const uint16_t *levels; ///< table to build run/level tables |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
59 } CoefVLCTable; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
60 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
61 typedef struct WMACodecContext { |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
62 AVCodecContext* avctx; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
63 GetBitContext gb; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
64 PutBitContext pb; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
65 int sample_rate; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
66 int nb_channels; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
67 int bit_rate; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
68 int version; ///< 1 = 0x160 (WMAV1), 2 = 0x161 (WMAV2) |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
69 int block_align; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
70 int use_bit_reservoir; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
71 int use_variable_block_len; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
72 int use_exp_vlc; ///< exponent coding: 0 = lsp, 1 = vlc + delta |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
73 int use_noise_coding; ///< true if perceptual noise is added |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
74 int byte_offset_bits; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
75 VLC exp_vlc; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
76 int exponent_sizes[BLOCK_NB_SIZES]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
77 uint16_t exponent_bands[BLOCK_NB_SIZES][25]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
78 int high_band_start[BLOCK_NB_SIZES]; ///< index of first coef in high band |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
79 int coefs_start; ///< first coded coef |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
80 int coefs_end[BLOCK_NB_SIZES]; ///< max number of coded coefficients |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
81 int exponent_high_sizes[BLOCK_NB_SIZES]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
82 int exponent_high_bands[BLOCK_NB_SIZES][HIGH_BAND_MAX_SIZE]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
83 VLC hgain_vlc; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
84 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
85 /* coded values in high bands */ |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
86 int high_band_coded[MAX_CHANNELS][HIGH_BAND_MAX_SIZE]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
87 int high_band_values[MAX_CHANNELS][HIGH_BAND_MAX_SIZE]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
88 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
89 /* there are two possible tables for spectral coefficients */ |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
90 //FIXME the following 3 tables should be shared between decoders |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
91 VLC coef_vlc[2]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
92 uint16_t *run_table[2]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
93 uint16_t *level_table[2]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
94 uint16_t *int_table[2]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
95 CoefVLCTable *coef_vlcs[2]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
96 /* frame info */ |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
97 int frame_len; ///< frame length in samples |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
98 int frame_len_bits; ///< frame_len = 1 << frame_len_bits |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
99 int nb_block_sizes; ///< number of block sizes |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
100 /* block info */ |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
101 int reset_block_lengths; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
102 int block_len_bits; ///< log2 of current block length |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
103 int next_block_len_bits; ///< log2 of next block length |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
104 int prev_block_len_bits; ///< log2 of prev block length |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
105 int block_len; ///< block length in samples |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
106 int block_num; ///< block number in current frame |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
107 int block_pos; ///< current position in frame |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
108 uint8_t ms_stereo; ///< true if mid/side stereo mode |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
109 uint8_t channel_coded[MAX_CHANNELS]; ///< true if channel is coded |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
110 int exponents_bsize[MAX_CHANNELS]; ///< log2 ratio frame/exp. length |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
111 DECLARE_ALIGNED_16(float, exponents[MAX_CHANNELS][BLOCK_MAX_SIZE]); |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
112 float max_exponent[MAX_CHANNELS]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
113 int16_t coefs1[MAX_CHANNELS][BLOCK_MAX_SIZE]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
114 DECLARE_ALIGNED_16(float, coefs[MAX_CHANNELS][BLOCK_MAX_SIZE]); |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
115 DECLARE_ALIGNED_16(FFTSample, output[BLOCK_MAX_SIZE * 2]); |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
116 MDCTContext mdct_ctx[BLOCK_NB_SIZES]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
117 float *windows[BLOCK_NB_SIZES]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
118 DECLARE_ALIGNED_16(FFTSample, mdct_tmp[BLOCK_MAX_SIZE]); ///< temporary storage for imdct |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
119 /* output buffer for one frame and the last for IMDCT windowing */ |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
120 DECLARE_ALIGNED_16(float, frame_out[MAX_CHANNELS][BLOCK_MAX_SIZE * 2]); |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
121 /* last frame info */ |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
122 uint8_t last_superframe[MAX_CODED_SUPERFRAME_SIZE + 4]; /* padding added */ |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
123 int last_bitoffset; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
124 int last_superframe_len; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
125 float noise_table[NOISE_TAB_SIZE]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
126 int noise_index; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
127 float noise_mult; /* XXX: suppress that and integrate it in the noise array */ |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
128 /* lsp_to_curve tables */ |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
129 float lsp_cos_table[BLOCK_MAX_SIZE]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
130 float lsp_pow_e_table[256]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
131 float lsp_pow_m_table1[(1 << LSP_POW_BITS)]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
132 float lsp_pow_m_table2[(1 << LSP_POW_BITS)]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
133 DSPContext dsp; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
134 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
135 #ifdef TRACE |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
136 int frame_count; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
137 #endif |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
138 } WMACodecContext; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
139 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
140 extern const uint16_t ff_wma_hgain_huffcodes[37]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
141 extern const uint8_t ff_wma_hgain_huffbits[37]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
142 extern const float ff_wma_lsp_codebook[NB_LSP_COEFS][16]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
143 extern const uint32_t ff_wma_scale_huffcodes[121]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
144 extern const uint8_t ff_wma_scale_huffbits[121]; |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
145 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
146 int ff_wma_init(AVCodecContext * avctx, int flags2); |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
147 int ff_wma_total_gain_to_bits(int total_gain); |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
148 int ff_wma_end(AVCodecContext *avctx); |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
149 |
f3ccef1dcd61
[svn] Hammer the WMA plugin into shape enough to bolt the following upstream commit on: "WMA decoder improvement, output closer to the dmo binary.
chainsaw
parents:
diff
changeset
|
150 #endif |