* Musepack decoder core
* Copyright (c) 2006 Konstantin Shishkov
*
- * This file is part of FFmpeg.
+ * This file is part of Libav.
*
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
- * @file libavcodec/mpc.c Musepack decoder core
+ * @file
+ * Musepack decoder core
* MPEG Audio Layer 1/2 -like codec with frames of 1152 samples
* divided into 32 subbands.
*/
/**
* Process decoded Musepack data and produce PCM
*/
-static void mpc_synth(MPCContext *c, int16_t *out)
+static void mpc_synth(MPCContext *c, int16_t *out, int channels)
{
int dither_state = 0;
int i, ch;
OUT_INT samples[MPA_MAX_CHANNELS * MPA_FRAME_SIZE], *samples_ptr;
- for(ch = 0; ch < 2; ch++){
+ for(ch = 0; ch < channels; ch++){
samples_ptr = samples + ch;
for(i = 0; i < SAMPLES_PER_BAND; i++) {
ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]),
ff_mpa_synth_window, &dither_state,
- samples_ptr, 2,
+ samples_ptr, channels,
c->sb_samples[ch][i]);
- samples_ptr += 64;
+ samples_ptr += 32 * channels;
}
}
- for(i = 0; i < MPC_FRAME_SIZE*2; i++)
+ for(i = 0; i < MPC_FRAME_SIZE*channels; i++)
*out++=samples[i];
}
-void ff_mpc_dequantize_and_synth(MPCContext * c, int maxband, void *data)
+void ff_mpc_dequantize_and_synth(MPCContext * c, int maxband, void *data, int channels)
{
int i, j, ch;
Band *bands = c->bands;
}
}
- mpc_synth(c, data);
+ mpc_synth(c, data, channels);
}