Problem with IMA ADPCM decoding

harishjennykn harishjennykn at yahoo.com
Mon Apr 14 23:01:07 PDT 2014


Hello !

Initially Bitrate is calculated correctly  as 4055 and then it gets changed
to
8126 in the following location - 
riff-media.c ( gst_riff_create_audio_caps function ) 


case GST_RIFF_WAVE_FORMAT_DVI_ADPCM:
        /* Many encoding tools create a wrong bitrate information in the
         * header, so either we calculate the bitrate or mark it as invalid
         * as this would probably confuse timing */
        strf->av_bps = 0;
        if (strf->channels != 0 && strf->rate != 0 && strf->blockalign != 0)
{
          int spb = ((strf->blockalign - strf->channels * 4) / 2) * 2;
          strf->av_bps =
              gst_util_uint64_scale_int (strf->rate, strf->blockalign, spb);
          GST_DEBUG ("fixing av_bps to calculated value %d of IMA DVI
ADPCM",
              strf->av_bps);
        }
      }


In this case , the channel is 1 , rate is 8000 and blockalign is 256
spb becomes 252
av_bps becomes 8126

The timestamp is calculated based on BPS.

Example gst debug log- 
0:00:00.041163544  1480  0x848a230 INFO                wavparse
gstwavparse.c:695:gst_wavparse_calculate_duration:<wavparse0> Got duration
(bps) 0:00:05.009106572


With gstreamer-0.10 there is no BPS correction and hence the timestamp is
shown
as 
0:00:00.070851887  1699  0x9de8a60 INFO                wavparse
gstwavparse.c:1130:gst_wavparse_calculate_duration:<wavparse0> Got duration
(bps) 0:00:10.037977806


Hence the behaviour!


~HJ



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Problem-with-IMA-ADPCM-decoding-tp4666392p4666442.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list