diff options
author | Sean Bartell <wingedtachikoma@gmail.com> | 2011-06-25 21:32:25 -0400 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2012-04-25 22:13:20 +0200 |
commit | f40bfc9267b13b54e6379dfe7539447662879d24 (patch) | |
tree | 9b20069d5e62809ff434061ad730096836f916f2 /lib/rbcodec/codecs/libwmapro/wma.h | |
parent | a0009907de7a0107d49040d8a180f140e2eff299 (diff) | |
download | rockbox-f40bfc9267b13b54e6379dfe7539447662879d24.tar.gz rockbox-f40bfc9267b13b54e6379dfe7539447662879d24.zip |
Add codecs to librbcodec.
Change-Id: Id7f4717d51ed02d67cb9f9cb3c0ada4a81843f97
Reviewed-on: http://gerrit.rockbox.org/137
Reviewed-by: Nils Wallménius <nils@rockbox.org>
Tested-by: Nils Wallménius <nils@rockbox.org>
Diffstat (limited to 'lib/rbcodec/codecs/libwmapro/wma.h')
-rw-r--r-- | lib/rbcodec/codecs/libwmapro/wma.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/libwmapro/wma.h b/lib/rbcodec/codecs/libwmapro/wma.h new file mode 100644 index 0000000000..6fa7b94724 --- /dev/null +++ b/lib/rbcodec/codecs/libwmapro/wma.h | |||
@@ -0,0 +1,75 @@ | |||
1 | /* | ||
2 | * WMA compatible codec | ||
3 | * Copyright (c) 2002-2007 The FFmpeg Project | ||
4 | * | ||
5 | * This file is part of FFmpeg. | ||
6 | * | ||
7 | * FFmpeg is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU Lesser General Public | ||
9 | * License as published by the Free Software Foundation; either | ||
10 | * version 2.1 of the License, or (at your option) any later version. | ||
11 | * | ||
12 | * FFmpeg is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * Lesser General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU Lesser General Public | ||
18 | * License along with FFmpeg; if not, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
20 | */ | ||
21 | |||
22 | #ifndef AVCODEC_WMA_H | ||
23 | #define AVCODEC_WMA_H | ||
24 | |||
25 | #include "ffmpeg_get_bits.h" | ||
26 | #include "ffmpeg_put_bits.h" | ||
27 | |||
28 | #define WMAPRO_FRACT (17) | ||
29 | #define WMAPRO_DSP_SAMPLE_DEPTH (WMAPRO_FRACT + 8) | ||
30 | |||
31 | /* size of blocks */ | ||
32 | #define BLOCK_MIN_BITS 7 | ||
33 | #define BLOCK_MAX_BITS 11 | ||
34 | #define BLOCK_MAX_SIZE (1 << BLOCK_MAX_BITS) | ||
35 | |||
36 | #define BLOCK_NB_SIZES (BLOCK_MAX_BITS - BLOCK_MIN_BITS + 1) | ||
37 | |||
38 | /* XXX: find exact max size */ | ||
39 | #define HIGH_BAND_MAX_SIZE 16 | ||
40 | |||
41 | #define NB_LSP_COEFS 10 | ||
42 | |||
43 | /* XXX: is it a suitable value ? */ | ||
44 | #define MAX_CODED_SUPERFRAME_SIZE 16384 | ||
45 | |||
46 | #define MAX_CHANNELS 2 | ||
47 | |||
48 | #define NOISE_TAB_SIZE 8192 | ||
49 | |||
50 | #define LSP_POW_BITS 7 | ||
51 | |||
52 | //FIXME should be in wmadec | ||
53 | #define VLCBITS 9 | ||
54 | #define VLCMAX ((22+VLCBITS-1)/VLCBITS) | ||
55 | |||
56 | typedef struct CoefVLCTable { | ||
57 | int n; ///< total number of codes | ||
58 | int max_level; | ||
59 | const uint32_t *huffcodes; ///< VLC bit values | ||
60 | const uint8_t *huffbits; ///< VLC bit size | ||
61 | const uint16_t *levels; ///< table to build run/level tables | ||
62 | } CoefVLCTable; | ||
63 | |||
64 | |||
65 | int ff_wma_get_frame_len_bits(int sample_rate, int version, | ||
66 | unsigned int decode_flags); | ||
67 | unsigned int ff_wma_get_large_val(GetBitContext* gb); | ||
68 | int ff_wma_run_level_decode(GetBitContext* gb, | ||
69 | VLC *vlc, | ||
70 | const int32_t *level_table, const uint16_t *run_table, | ||
71 | int version, int32_t *ptr, int offset, | ||
72 | int num_coefs, int block_len, int frame_len_bits, | ||
73 | int coef_nb_bits); | ||
74 | |||
75 | #endif /* AVCODEC_WMA_H */ | ||