comparison wmaprodec.c @ 10084:bf63f070fbf7 libavcodec

whitespace cosmetics
author diego
date Tue, 25 Aug 2009 20:02:30 +0000
parents 57d76996ccb8
children 071d6d272a77
comparison
equal deleted inserted replaced
10083:8071f8b68d05 10084:bf63f070fbf7
94 static av_cold int decode_end(AVCodecContext *avctx) 94 static av_cold int decode_end(AVCodecContext *avctx)
95 { 95 {
96 WMA3DecodeContext *s = avctx->priv_data; 96 WMA3DecodeContext *s = avctx->priv_data;
97 int i; 97 int i;
98 98
99 for (i = 0 ; i < WMAPRO_BLOCK_SIZES ; i++) 99 for (i = 0; i < WMAPRO_BLOCK_SIZES; i++)
100 ff_mdct_end(&s->mdct_ctx[i]); 100 ff_mdct_end(&s->mdct_ctx[i]);
101 101
102 return 0; 102 return 0;
103 } 103 }
104 104
111 WMA3ChannelGroup *chgroup) 111 WMA3ChannelGroup *chgroup)
112 { 112 {
113 int i; 113 int i;
114 int offset = 0; 114 int offset = 0;
115 int8_t rotation_offset[WMAPRO_MAX_CHANNELS * WMAPRO_MAX_CHANNELS]; 115 int8_t rotation_offset[WMAPRO_MAX_CHANNELS * WMAPRO_MAX_CHANNELS];
116 memset(chgroup->decorrelation_matrix,0, 116 memset(chgroup->decorrelation_matrix, 0,
117 sizeof(float) *s->num_channels * s->num_channels); 117 sizeof(float) *s->num_channels * s->num_channels);
118 118
119 for (i = 0; i < chgroup->num_channels * (chgroup->num_channels - 1) >> 1; i++) 119 for (i = 0; i < chgroup->num_channels * (chgroup->num_channels - 1) >> 1; i++)
120 rotation_offset[i] = get_bits(&s->gb,6); 120 rotation_offset[i] = get_bits(&s->gb, 6);
121 121
122 for (i = 0; i < chgroup->num_channels; i++) 122 for (i = 0; i < chgroup->num_channels; i++)
123 chgroup->decorrelation_matrix[chgroup->num_channels * i + i] = 123 chgroup->decorrelation_matrix[chgroup->num_channels * i + i] =
124 get_bits1(&s->gb) ? 1.0 : -1.0; 124 get_bits1(&s->gb) ? 1.0 : -1.0;
125 125
126 for (i = 1; i < chgroup->num_channels; i++) { 126 for (i = 1; i < chgroup->num_channels; i++) {
127 int x; 127 int x;
128 for (x = 0; x < i; x++) { 128 for (x = 0; x < i; x++) {
129 int y; 129 int y;
130 for (y = 0; y < i + 1 ; y++) { 130 for (y = 0; y < i + 1; y++) {
131 float v1 = chgroup->decorrelation_matrix[x * chgroup->num_channels + y]; 131 float v1 = chgroup->decorrelation_matrix[x * chgroup->num_channels + y];
132 float v2 = chgroup->decorrelation_matrix[i * chgroup->num_channels + y]; 132 float v2 = chgroup->decorrelation_matrix[i * chgroup->num_channels + y];
133 int n = rotation_offset[offset + x]; 133 int n = rotation_offset[offset + x];
134 float sinv; 134 float sinv;
135 float cosv; 135 float cosv;
170 const char* tb = s->chgroup[i].transform_band; 170 const char* tb = s->chgroup[i].transform_band;
171 const char* tb_end = tb + s->num_bands; 171 const char* tb_end = tb + s->num_bands;
172 172
173 while (tb < tb_end) { 173 while (tb < tb_end) {
174 const float* ch0_end = s->channel[0].coeffs + 174 const float* ch0_end = s->channel[0].coeffs +
175 FFMIN(*sfb_offsets,s->subframe_len); 175 FFMIN(*sfb_offsets, s->subframe_len);
176 if (*tb++ == 1) { 176 if (*tb++ == 1) {
177 while (ch0 < ch0_end) { 177 while (ch0 < ch0_end) {
178 const float v1 = *ch0; 178 const float v1 = *ch0;
179 const float v2 = *ch1; 179 const float v2 = *ch1;
180 *ch0++ = v1 - v2; 180 *ch0++ = v1 - v2;
195 float** ch_end = ch_data + num_channels; 195 float** ch_end = ch_data + num_channels;
196 const int8_t* tb = s->chgroup[i].transform_band; 196 const int8_t* tb = s->chgroup[i].transform_band;
197 int16_t* sfb; 197 int16_t* sfb;
198 198
199 /** multichannel decorrelation */ 199 /** multichannel decorrelation */
200 for (sfb = s->cur_sfb_offsets ; 200 for (sfb = s->cur_sfb_offsets;
201 sfb < s->cur_sfb_offsets + s->num_bands;sfb++) { 201 sfb < s->cur_sfb_offsets + s->num_bands;sfb++) {
202 if (*tb++ == 1) { 202 if (*tb++ == 1) {
203 int y; 203 int y;
204 /** multiply values with the decorrelation_matrix */ 204 /** multiply values with the decorrelation_matrix */
205 for (y = sfb[0]; y < FFMIN(sfb[1], s->subframe_len); y++) { 205 for (y = sfb[0]; y < FFMIN(sfb[1], s->subframe_len); y++) {
206 const float* mat = s->chgroup[i].decorrelation_matrix; 206 const float* mat = s->chgroup[i].decorrelation_matrix;
207 const float* data_end = data + num_channels; 207 const float* data_end = data + num_channels;
208 float* data_ptr = data; 208 float* data_ptr = data;
209 float** ch; 209 float** ch;
210 210
211 for (ch = ch_data;ch < ch_end; ch++) 211 for (ch = ch_data; ch < ch_end; ch++)
212 *data_ptr++ = (*ch)[y]; 212 *data_ptr++ = (*ch)[y];
213 213
214 for (ch = ch_data; ch < ch_end; ch++) { 214 for (ch = ch_data; ch < ch_end; ch++) {
215 float sum = 0; 215 float sum = 0;
216 data_ptr = data; 216 data_ptr = data;