mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-26 00:31:12 +00:00
Merge commit 'b64bd2e18bac1bd3e3e0ae4aebcad1c33f031c66' into release/0.10
* commit 'b64bd2e18bac1bd3e3e0ae4aebcad1c33f031c66': qdm2: refactor joined stereo support adpcm: Write the correct number of samples for ima-dk4 imc: Catch a division by zero atrac3: Error on impossible encoding/channel combinations Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
a88ed5a481
@ -717,7 +717,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
|
||||
src++;
|
||||
*samples++ = cs->predictor;
|
||||
}
|
||||
for (n = nb_samples >> (1 - st); n > 0; n--, src++) {
|
||||
for (n = (nb_samples >> (1 - st)) - 1; n > 0; n--) {
|
||||
uint8_t v = *src;
|
||||
*samples++ = adpcm_ima_expand_nibble(&c->status[0 ], v >> 4 , 3);
|
||||
*samples++ = adpcm_ima_expand_nibble(&c->status[st], v & 0x0F, 3);
|
||||
|
@ -769,7 +769,7 @@ static void fill_coding_method_array (sb_int8_array tone_level_idx, sb_int8_arra
|
||||
static void synthfilt_build_sb_samples (QDM2Context *q, GetBitContext *gb, int length, int sb_min, int sb_max)
|
||||
{
|
||||
int sb, j, k, n, ch, run, channels;
|
||||
int joined_stereo, zero_encoding, chs;
|
||||
int joined_stereo, zero_encoding;
|
||||
int type34_first;
|
||||
float type34_div = 0;
|
||||
float type34_predictor;
|
||||
@ -923,16 +923,18 @@ static void synthfilt_build_sb_samples (QDM2Context *q, GetBitContext *gb, int l
|
||||
}
|
||||
|
||||
if (joined_stereo) {
|
||||
float tmp[10][MPA_MAX_CHANNELS];
|
||||
|
||||
for (k = 0; k < run; k++) {
|
||||
tmp[k][0] = samples[k];
|
||||
tmp[k][1] = (sign_bits[(j + k) / 8]) ? -samples[k] : samples[k];
|
||||
for (k = 0; k < run && j + k < 128; k++) {
|
||||
q->sb_samples[0][j + k][sb] =
|
||||
q->tone_level[0][sb][(j + k) / 2] * samples[k];
|
||||
if (q->nb_channels == 2) {
|
||||
if (sign_bits[(j + k) / 8])
|
||||
q->sb_samples[1][j + k][sb] =
|
||||
q->tone_level[1][sb][(j + k) / 2] * -samples[k];
|
||||
else
|
||||
q->sb_samples[1][j + k][sb] =
|
||||
q->tone_level[1][sb][(j + k) / 2] * samples[k];
|
||||
}
|
||||
}
|
||||
for (chs = 0; chs < q->nb_channels; chs++)
|
||||
for (k = 0; k < run; k++)
|
||||
if ((j + k) < 128)
|
||||
q->sb_samples[chs][j + k][sb] = q->tone_level[chs][sb][((j + k)/2)] * tmp[k][chs];
|
||||
} else {
|
||||
for (k = 0; k < run; k++)
|
||||
if ((j + k) < 128)
|
||||
|
Loading…
Reference in New Issue
Block a user