OLD | NEW |
1 /* | 1 /* |
2 * COOK compatible decoder | 2 * COOK compatible decoder |
3 * Copyright (c) 2003 Sascha Sommer | 3 * Copyright (c) 2003 Sascha Sommer |
4 * Copyright (c) 2005 Benjamin Larsson | 4 * Copyright (c) 2005 Benjamin Larsson |
5 * | 5 * |
6 * This file is part of FFmpeg. | 6 * This file is part of FFmpeg. |
7 * | 7 * |
8 * FFmpeg is free software; you can redistribute it and/or | 8 * FFmpeg is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include <math.h> | 45 #include <math.h> |
46 #include <stddef.h> | 46 #include <stddef.h> |
47 #include <stdio.h> | 47 #include <stdio.h> |
48 | 48 |
49 #include "libavutil/lfg.h" | 49 #include "libavutil/lfg.h" |
50 #include "libavutil/random_seed.h" | 50 #include "libavutil/random_seed.h" |
51 #include "avcodec.h" | 51 #include "avcodec.h" |
52 #include "get_bits.h" | 52 #include "get_bits.h" |
53 #include "dsputil.h" | 53 #include "dsputil.h" |
54 #include "bytestream.h" | 54 #include "bytestream.h" |
| 55 #include "fft.h" |
55 | 56 |
56 #include "cookdata.h" | 57 #include "cookdata.h" |
57 | 58 |
58 /* the different Cook versions */ | 59 /* the different Cook versions */ |
59 #define MONO 0x1000001 | 60 #define MONO 0x1000001 |
60 #define STEREO 0x1000002 | 61 #define STEREO 0x1000002 |
61 #define JOINT_STEREO 0x1000003 | 62 #define JOINT_STEREO 0x1000003 |
62 #define MC_COOK 0x2000000 //multichannel Cook, not supported | 63 #define MC_COOK 0x2000000 //multichannel Cook, not supported |
63 | 64 |
64 #define SUBBAND_SIZE 20 | 65 #define SUBBAND_SIZE 20 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 VLC envelope_quant_index[13]; | 144 VLC envelope_quant_index[13]; |
144 VLC sqvh[7]; //scalar quantization | 145 VLC sqvh[7]; //scalar quantization |
145 | 146 |
146 /* generatable tables and related variables */ | 147 /* generatable tables and related variables */ |
147 int gain_size_factor; | 148 int gain_size_factor; |
148 float gain_table[23]; | 149 float gain_table[23]; |
149 | 150 |
150 /* data buffers */ | 151 /* data buffers */ |
151 | 152 |
152 uint8_t* decoded_bytes_buffer; | 153 uint8_t* decoded_bytes_buffer; |
153 DECLARE_ALIGNED_16(float,mono_mdct_output)[2048]; | 154 DECLARE_ALIGNED(16, float,mono_mdct_output)[2048]; |
154 float decode_buffer_1[1024]; | 155 float decode_buffer_1[1024]; |
155 float decode_buffer_2[1024]; | 156 float decode_buffer_2[1024]; |
156 float decode_buffer_0[1060]; /* static allocation for joint de
code */ | 157 float decode_buffer_0[1060]; /* static allocation for joint de
code */ |
157 | 158 |
158 const float *cplscales[5]; | 159 const float *cplscales[5]; |
159 int num_subpackets; | 160 int num_subpackets; |
160 COOKSubpacket subpacket[MAX_SUBPACKETS]; | 161 COOKSubpacket subpacket[MAX_SUBPACKETS]; |
161 } COOKContext; | 162 } COOKContext; |
162 | 163 |
163 static float pow2tab[127]; | 164 static float pow2tab[127]; |
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 { | 1289 { |
1289 .name = "cook", | 1290 .name = "cook", |
1290 .type = CODEC_TYPE_AUDIO, | 1291 .type = CODEC_TYPE_AUDIO, |
1291 .id = CODEC_ID_COOK, | 1292 .id = CODEC_ID_COOK, |
1292 .priv_data_size = sizeof(COOKContext), | 1293 .priv_data_size = sizeof(COOKContext), |
1293 .init = cook_decode_init, | 1294 .init = cook_decode_init, |
1294 .close = cook_decode_close, | 1295 .close = cook_decode_close, |
1295 .decode = cook_decode_frame, | 1296 .decode = cook_decode_frame, |
1296 .long_name = NULL_IF_CONFIG_SMALL("COOK"), | 1297 .long_name = NULL_IF_CONFIG_SMALL("COOK"), |
1297 }; | 1298 }; |
OLD | NEW |