[FFmpeg-devel] [PATCH] ADPCM IMA AMV encoder (try 1)

Vladimir Voroshilov voroshil
Fri Oct 12 03:57:43 CEST 2007


2007/10/12, Michael Niedermayer <michaelni at gmx.at>:
> On Thu, Oct 11, 2007 at 10:59:30PM +0700, Vladimir Voroshilov wrote:
> > 2007/10/8, Benjamin Larsson <banan at ludd.ltu.se>:
> > > Hi.
> > >
> > > Vladimir Voroshilov wrote:
> > > > 2007/10/6, Vladimir Voroshilov <voroshil at gmail.com>:
> > > >
> > > >> Hi, All
> > > >>
> > > >> Since no reply was got in "Devel question : how to calculate
> > > >> frame_size in audio encoder (adpcm_encode_init) "' thread, i want (as
> > > >> suggested by Vitor) show you current version of ADPCM IMA AMV encoder
> > > >> in amv-codec-tools project.
> > > >>
> > > >> Due to fake codec tag (it uses PCM's 0x01 code) this codec can not be
> > > >> easily used outside AMV container.
> > > >>
> > > >> Number of 16-bit audio samples  per audio frame and audio frame size are
> > > >> calculated by folmulas below:
> > > >>
> > > >> samples_per_frame=audio_sample_rate/video_frame_rate
> > > >> audio_frame_size=(samples_per_frame/2)+8
> > > >>
> > > >> Current code sets frame_size to 0 inside adpcm_encode_init.
> > > >> frame_size receives real value at the end of avi_write_header:
> [...]
>
> also if this patch depends on some hack to the avi muxer then its rejected
> of course as it would make no sense to apply without that hack
>

Yes current code is unsusable without those hack. Unfortunately AMV
muxer is made currently as separate routines and not integrated into
AVI muxer yet.

For using encoder without hacked avi muxer you'll need some default
frame_size value to be set under init (something similar to IMA WAV
can be easiy implemented) and some rogue format code (to avoid using
PCM's 0x01).

What will you say about above fixes, should i'll add them?
-- 
Regards,
Vladimir Voroshilov     mailto:voroshil at gmail.com
JID: voroshil at gmail.com, voroshil at jabber.ru
ICQ: 95587719




More information about the ffmpeg-devel mailing list