avcodec/adpcm: Fix indentation

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-06-08 16:52:15 +02:00
parent 421de73a10
commit 6914aa7fb4

View File

@ -1034,18 +1034,18 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
} }
bytestream2_skip(&gb, avctx->block_align - avctx->channels * 4); bytestream2_skip(&gb, avctx->block_align - avctx->channels * 4);
} else { } else {
for (int n = 0; n < (nb_samples - 1) / 8; n++) { for (int n = 0; n < (nb_samples - 1) / 8; n++) {
for (int i = 0; i < avctx->channels; i++) { for (int i = 0; i < avctx->channels; i++) {
ADPCMChannelStatus *cs = &c->status[i]; ADPCMChannelStatus *cs = &c->status[i];
samples = &samples_p[i][1 + n * 8]; samples = &samples_p[i][1 + n * 8];
for (int m = 0; m < 8; m += 2) { for (int m = 0; m < 8; m += 2) {
int v = bytestream2_get_byteu(&gb); int v = bytestream2_get_byteu(&gb);
samples[m ] = adpcm_ima_expand_nibble(cs, v & 0x0F, 3); samples[m ] = adpcm_ima_expand_nibble(cs, v & 0x0F, 3);
samples[m + 1] = adpcm_ima_expand_nibble(cs, v >> 4 , 3); samples[m + 1] = adpcm_ima_expand_nibble(cs, v >> 4 , 3);
}
} }
} }
} }
}
break; break;
case AV_CODEC_ID_ADPCM_4XM: case AV_CODEC_ID_ADPCM_4XM:
for (int i = 0; i < avctx->channels; i++) for (int i = 0; i < avctx->channels; i++)
@ -1823,41 +1823,41 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
} }
for (int m = 0; m < blocks; m++) { for (int m = 0; m < blocks; m++) {
for (int channel = 0; channel < avctx->channels; channel++) { for (int channel = 0; channel < avctx->channels; channel++) {
int prev1 = c->status[channel].sample1; int prev1 = c->status[channel].sample1;
int prev2 = c->status[channel].sample2; int prev2 = c->status[channel].sample2;
samples = samples_p[channel] + m * 16; samples = samples_p[channel] + m * 16;
/* Read in every sample for this channel. */ /* Read in every sample for this channel. */
for (int i = 0; i < samples_per_block; i++) { for (int i = 0; i < samples_per_block; i++) {
int byte = bytestream2_get_byteu(&gb); int byte = bytestream2_get_byteu(&gb);
int scale = 1 << (byte >> 4); int scale = 1 << (byte >> 4);
int index = byte & 0xf; int index = byte & 0xf;
int factor1 = ff_adpcm_afc_coeffs[0][index]; int factor1 = ff_adpcm_afc_coeffs[0][index];
int factor2 = ff_adpcm_afc_coeffs[1][index]; int factor2 = ff_adpcm_afc_coeffs[1][index];
/* Decode 16 samples. */ /* Decode 16 samples. */
for (int n = 0; n < 16; n++) { for (int n = 0; n < 16; n++) {
int32_t sampledat; int32_t sampledat;
if (n & 1) { if (n & 1) {
sampledat = sign_extend(byte, 4); sampledat = sign_extend(byte, 4);
} else { } else {
byte = bytestream2_get_byteu(&gb); byte = bytestream2_get_byteu(&gb);
sampledat = sign_extend(byte >> 4, 4); sampledat = sign_extend(byte >> 4, 4);
}
sampledat = ((prev1 * factor1 + prev2 * factor2) >> 11) +
sampledat * scale;
*samples = av_clip_int16(sampledat);
prev2 = prev1;
prev1 = *samples++;
} }
sampledat = ((prev1 * factor1 + prev2 * factor2) >> 11) +
sampledat * scale;
*samples = av_clip_int16(sampledat);
prev2 = prev1;
prev1 = *samples++;
} }
}
c->status[channel].sample1 = prev1; c->status[channel].sample1 = prev1;
c->status[channel].sample2 = prev2; c->status[channel].sample2 = prev2;
} }
} }
bytestream2_seek(&gb, 0, SEEK_END); bytestream2_seek(&gb, 0, SEEK_END);
break; break;