avcodec/adpcm: improve decooding output for 4-bit ADPCM IMA WAV

(cherry picked from commit f11422f1a6251e2b3c42b4044efbc722b863778d)
This commit is contained in:
Paul B Mahol
2025-03-17 21:01:16 +00:00
committed by michaelni
parent 066432ebcf
commit e0638cee0a
4 changed files with 7 additions and 7 deletions

View File

@@ -1551,8 +1551,8 @@ static int adpcm_decode_frame(AVCodecContext *avctx, AVFrame *frame,
samples = &samples_p[i][1 + n * 8];
for (int m = 0; m < 8; m += 2) {
int v = bytestream2_get_byteu(&gb);
samples[m ] = adpcm_ima_expand_nibble(cs, v & 0x0F, 3);
samples[m + 1] = adpcm_ima_expand_nibble(cs, v >> 4 , 3);
samples[m ] = ff_adpcm_ima_qt_expand_nibble(cs, v & 0x0F);
samples[m + 1] = ff_adpcm_ima_qt_expand_nibble(cs, v >> 4);
}
}
}

View File

@@ -1,4 +1,4 @@
af0b82a719762cc6e1a952a6081231cf *tests/data/fate/acodec-adpcm-ima_wav.wav
267324 tests/data/fate/acodec-adpcm-ima_wav.wav
78a2af1c895792d0c221d127bdd48ece *tests/data/fate/acodec-adpcm-ima_wav.out.wav
stddev: 903.51 PSNR: 37.21 MAXDIFF:34026 bytes: 1058400/ 1061748
a57d7b0ca564b5fed4bf78fc9f91d8e2 *tests/data/fate/acodec-adpcm-ima_wav.out.wav
stddev: 903.56 PSNR: 37.21 MAXDIFF:34029 bytes: 1058400/ 1061748

View File

@@ -1,4 +1,4 @@
6f0df0f3275f833c341d63b9054caebb *tests/data/fate/acodec-adpcm-ima_wav-trellis.wav
267324 tests/data/fate/acodec-adpcm-ima_wav-trellis.wav
26a9b280c14737b159c56e60181f1170 *tests/data/fate/acodec-adpcm-ima_wav-trellis.out.wav
stddev: 710.03 PSNR: 39.30 MAXDIFF:25944 bytes: 1058400/ 1061748
1af83218cde84bd7cd2297c04ef97f79 *tests/data/fate/acodec-adpcm-ima_wav-trellis.out.wav
stddev: 710.09 PSNR: 39.30 MAXDIFF:25941 bytes: 1058400/ 1061748

View File

@@ -1 +1 @@
1ee96f1efc09251a732621049dc5b66e
b4697f4f64c12afb37acfebd5f7a756c