History

merge 2-channel M/S stereo decoding code with the multichannel version

Originally committed as revision 19718 to svn://svn.ffmpeg.org/ffmpeg/trunk

Sascha Sommer committed 17 years ago

Commit f53e96e1 parent b97e0d71 file · +7 −29Browse files

Unified · Split

libavcodec/wmaprodec.c+7−29
@@ -161,34 +161,7 @@ static void inverse_channel_transform(WMA3DecodeContext *s) · 160 unmodified lines
161 int i;161 int i;
162 162
163 for (i = 0; i < s->num_chgroups; i++) {163 for (i = 0; i < s->num_chgroups; i++) {
164 164 if (s->chgroup[i].transform) {
165 if (s->chgroup[i].transform == 1) {
166 /** M/S stereo decoding */
167 int16_t* sfb_offsets = s->cur_sfb_offsets;
168 float* ch0 = *sfb_offsets + s->channel[0].coeffs;
169 float* ch1 = *sfb_offsets++ + s->channel[1].coeffs;
170 const char* tb = s->chgroup[i].transform_band;
171 const char* tb_end = tb + s->num_bands;
172
173 while (tb < tb_end) {
174 const float* ch0_end = s->channel[0].coeffs +
175 FFMIN(*sfb_offsets, s->subframe_len);
176 if (*tb++ == 1) {
177 while (ch0 < ch0_end) {
178 const float v1 = *ch0;
179 const float v2 = *ch1;
180 *ch0++ = v1 - v2;
181 *ch1++ = v1 + v2;
182 }
183 } else {
184 while (ch0 < ch0_end) {
185 *ch0++ *= 181.0 / 128;
186 *ch1++ *= 181.0 / 128;
187 }
188 }
189 ++sfb_offsets;
190 }
191 } else if (s->chgroup[i].transform) {
192 float data[WMAPRO_MAX_CHANNELS];165 float data[WMAPRO_MAX_CHANNELS];
193 const int num_channels = s->chgroup[i].num_channels;166 const int num_channels = s->chgroup[i].num_channels;
194 float** ch_data = s->chgroup[i].channel_data;167 float** ch_data = s->chgroup[i].channel_data;
@@ -199,8 +172,8 @@ static void inverse_channel_transform(WMA3DecodeContext *s) · 4 unmodified lines
199 /** multichannel decorrelation */172 /** multichannel decorrelation */
200 for (sfb = s->cur_sfb_offsets;173 for (sfb = s->cur_sfb_offsets;
201 sfb < s->cur_sfb_offsets + s->num_bands;sfb++) {174 sfb < s->cur_sfb_offsets + s->num_bands;sfb++) {
175 int y;
202 if (*tb++ == 1) {176 if (*tb++ == 1) {
203 int y;
204 /** multiply values with the decorrelation_matrix */177 /** multiply values with the decorrelation_matrix */
205 for (y = sfb[0]; y < FFMIN(sfb[1], s->subframe_len); y++) {178 for (y = sfb[0]; y < FFMIN(sfb[1], s->subframe_len); y++) {
206 const float* mat = s->chgroup[i].decorrelation_matrix;179 const float* mat = s->chgroup[i].decorrelation_matrix;
@@ -220,6 +193,11 @@ static void inverse_channel_transform(WMA3DecodeContext *s) · 13 unmodified lines
220 (*ch)[y] = sum;193 (*ch)[y] = sum;
221 }194 }
222 }195 }
196 } else if (s->num_channels == 2) {
197 for (y = sfb[0]; y < FFMIN(sfb[1], s->subframe_len); y++) {
198 ch_data[0][y] *= 181.0 / 128;
199 ch_data[1][y] *= 181.0 / 128;
200 }
223 }201 }
224 }202 }
225 }203 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t