Mercurial > mplayer.hg
comparison libfaad2/ssr.c @ 12527:4a370c80fe5c
update to the 2.0 release of faad, patch by adland
author | diego |
---|---|
date | Wed, 02 Jun 2004 22:59:04 +0000 |
parents | 3185f64f6350 |
children | d81145997036 |
comparison
equal
deleted
inserted
replaced
12526:e183ad37d24c | 12527:4a370c80fe5c |
---|---|
1 /* | 1 /* |
2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding | 2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
3 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com | 3 ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com |
4 ** | 4 ** |
5 ** This program is free software; you can redistribute it and/or modify | 5 ** This program is free software; you can redistribute it and/or modify |
6 ** it under the terms of the GNU General Public License as published by | 6 ** it under the terms of the GNU General Public License as published by |
7 ** the Free Software Foundation; either version 2 of the License, or | 7 ** the Free Software Foundation; either version 2 of the License, or |
8 ** (at your option) any later version. | 8 ** (at your option) any later version. |
20 ** forbidden. | 20 ** forbidden. |
21 ** | 21 ** |
22 ** Commercial non-GPL licensing of this software is possible. | 22 ** Commercial non-GPL licensing of this software is possible. |
23 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. | 23 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. |
24 ** | 24 ** |
25 ** $Id: ssr.c,v 1.5 2003/09/09 18:09:52 menno Exp $ | 25 ** $Id: ssr.c,v 1.2 2003/10/03 22:22:27 alex Exp $ |
26 **/ | 26 **/ |
27 | 27 |
28 #include "common.h" | 28 #include "common.h" |
29 #include "structs.h" | 29 #include "structs.h" |
30 | 30 |
41 real_t ipqf_buffer[SSR_BANDS][96/4], | 41 real_t ipqf_buffer[SSR_BANDS][96/4], |
42 real_t *prev_fmd, uint16_t frame_len) | 42 real_t *prev_fmd, uint16_t frame_len) |
43 { | 43 { |
44 uint8_t band; | 44 uint8_t band; |
45 uint16_t ssr_frame_len = frame_len/SSR_BANDS; | 45 uint16_t ssr_frame_len = frame_len/SSR_BANDS; |
46 real_t time_tmp[2048]; | 46 real_t time_tmp[2048] = {0}; |
47 real_t output[1024]; | 47 real_t output[1024] = {0}; |
48 | |
49 memset(output, 0, 1024*sizeof(real_t)); | |
50 memset(time_tmp, 0, 2048*sizeof(real_t)); | |
51 | 48 |
52 for (band = 0; band < SSR_BANDS; band++) | 49 for (band = 0; band < SSR_BANDS; band++) |
53 { | 50 { |
54 int16_t j; | 51 int16_t j; |
55 | 52 |
88 real_t gc_function[2*1024/SSR_BANDS]; | 85 real_t gc_function[2*1024/SSR_BANDS]; |
89 | 86 |
90 if (window_sequence != EIGHT_SHORT_SEQUENCE) | 87 if (window_sequence != EIGHT_SHORT_SEQUENCE) |
91 { | 88 { |
92 ssr_gc_function(ssr, &prev_fmd[band * frame_len*2], | 89 ssr_gc_function(ssr, &prev_fmd[band * frame_len*2], |
93 gc_function, window_sequence, frame_len); | 90 gc_function, window_sequence, band, frame_len); |
94 | 91 |
95 for (i = 0; i < frame_len*2; i++) | 92 for (i = 0; i < frame_len*2; i++) |
96 data[band * frame_len*2 + i] *= gc_function[i]; | 93 data[band * frame_len*2 + i] *= gc_function[i]; |
97 for (i = 0; i < frame_len; i++) | 94 for (i = 0; i < frame_len; i++) |
98 { | 95 { |
134 } | 131 } |
135 } | 132 } |
136 | 133 |
137 static void ssr_gc_function(ssr_info *ssr, real_t *prev_fmd, | 134 static void ssr_gc_function(ssr_info *ssr, real_t *prev_fmd, |
138 real_t *gc_function, uint8_t window_sequence, | 135 real_t *gc_function, uint8_t window_sequence, |
139 uint16_t frame_len) | 136 uint8_t band, uint16_t frame_len) |
140 { | 137 { |
141 uint16_t i; | 138 uint16_t i; |
142 uint16_t len_area1, len_area2; | 139 uint16_t len_area1, len_area2; |
143 int32_t aloc[10]; | 140 int32_t aloc[10]; |
144 real_t alev[10]; | 141 real_t alev[10]; |