[FFmpeg-trac] #6596(avformat:new): G726 codec suspected to not comply with ITU standard

FFmpeg trac at avcodec.org
Fri Aug 18 11:22:59 EEST 2017


#6596: G726 codec suspected to not comply with ITU standard
-------------------------------------+-------------------------------------
             Reporter:               |                     Type:  defect
  alban.meffre                       |                 Priority:  critical
               Status:  new          |                  Version:  git-
            Component:  avformat     |  master
             Keywords:  G726 ITU     |               Blocked By:
  standard compliance                |  Reproduced by developer:  0
             Blocking:               |
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 the G726 codec ffmpeg implementation seems not to comply with ITU standard
 below are the files and commands needed to perform verification


 *** test vectors ***

 original test vectors from the ITU in ASCII format
 (https://www.itu.int/net/itu-t/sigdb/speaudio/Gseries.htm)

 NRM.M : the test input vector encoded in mu law (sample rate 8kHz, mono)
 RN24FM.I : the expected result , unpacked to right justified codes


 input_mulaw.bin : binary version of the above NRM.M input file
 input_mulaw.wav : playable version

 $ ffmpeg -f mulaw -ar 8000 -i input_mulaw.bin -acodec copy input_mulaw.wav

 *** encoding with ITU compliant G726 encoder ***

 g726encode.exe : g726 encoder from the ITU-T user's group on software
 tools

 output_g726.bin : output result

 $ g726encode.exe -3 -u -i input_mulaw.bin -o output_g726.bin

 *** binary comparison between output and ITU test vector ***

 RN24FM.bin : bit packed binary version of the above RN24FM.I file


 !!!!!! these two file's contents are identical -> g726encode.exe IS ITU
 compliant !!!!!!

 *** decode and listen to the result ***

 output_g726_decoded_pcm_s16le.bin : decoded result of g726encode.exe

 $ g726decode.exe -3 -l -i output_g726.bin -o
 output_g726_decoded_pcm_s16le.bin

 this file can be played correctely -> g726decode.exe IS ITU compliant too

 $ ffplay -f s16le -ar 8000 output_g726_decoded_pcm_s16le.bin

 *** encoding with ffmpeg and listen to the result ***

 output_g726_ffmpeg.bin : ffmpeg g726 encode output result
 output_g726_ffmpeg.wav : ffmpeg g726 encode output result (playable)

 $ ffmpeg -f mulaw -ar 8000 -i input_mulaw.bin -acodec g726 -code_size 3
 output_g726_ffmpeg.wav
 $ ffmpeg -f mulaw -ar 8000 -i input_mulaw.bin -acodec g726 -code_size 3 -f
 u8 output_g726_ffmpeg.bin

 output_g726_ffmpeg_decoded_pcm_s16le.bin : decoded result of
 output_g726_ffmpeg.bin

 $ g726decode.exe -3 -l -i output_g726_ffmpeg.bin -o
 output_g726_ffmpeg_decoded_pcm_s16le.bin

 !!!!!! this file cannot be played correctely -> ffmpeg's implementation of
 the g726 codec is not compliant with ITU !!!!!!

 $ ffplay -f s16le -ar 8000 output_g726_ffmpeg_decoded_pcm_s16le.bin

--
Ticket URL: <https://trac.ffmpeg.org/ticket/6596>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list