[FFmpeg-devel] [PATCH 2/2] avformat/riff: map 0069 twocc to ADPCM IMA XBOX decoder

Peter Ross pross at xvid.org
Thu Dec 12 00:25:55 EET 2024


---
Using AV_CODEC_ID_ADPCM_IMA_WAV for twocc 0x0069 causes subtle artefacts during
playback. The correct decoder is AV_CODEC_ID_ADPCM_IMA_XBOX.

Sample .wav and ref flac file: <https://github.com/vgmstream/vgmstream/files/15491901/flyaround_06.zip>

 libavformat/riff.c       | 2 +-
 tests/ref/fate/xmv-demux | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/riff.c b/libavformat/riff.c
index 98eeb88032..017a0658ef 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -564,7 +564,7 @@ const AVCodecTag ff_codec_wav_tags[] = {
     /* rogue format number */
     { AV_CODEC_ID_ADPCM_IMA_DK3,   0x0062 },
     { AV_CODEC_ID_ADPCM_G726,      0x0064 },
-    { AV_CODEC_ID_ADPCM_IMA_WAV,   0x0069 },
+    { AV_CODEC_ID_ADPCM_IMA_XBOX,  0x0069 },
     { AV_CODEC_ID_METASOUND,       0x0075 },
     { AV_CODEC_ID_G729,            0x0083 },
     { AV_CODEC_ID_AAC,             0x00ff },
diff --git a/tests/ref/fate/xmv-demux b/tests/ref/fate/xmv-demux
index 9cc26e41c3..603b958b73 100644
--- a/tests/ref/fate/xmv-demux
+++ b/tests/ref/fate/xmv-demux
@@ -6,7 +6,7 @@
 #sar 0: 0/1
 #tb 1: 16/11025
 #media_type 1: audio
-#codec_id 1: adpcm_ima_wav
+#codec_id 1: adpcm_ima_xbox
 #sample_rate 1: 44100
 #channel_layout_name 1: stereo
 0,          0,          0,        0,     1508, 0xefceba48
-- 
2.45.2

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241212/58336670/attachment.sig>


More information about the ffmpeg-devel mailing list