[FFmpeg-devel] [PATCH] swr: handle initial negative sample index outside DSP function.

Michael Niedermayer michaelni at gmx.at
Thu Jun 12 04:30:29 CEST 2014


On Wed, Jun 11, 2014 at 09:32:18PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Wed, Jun 11, 2014 at 7:44 AM, Michael Niedermayer <michaelni at gmx.at>
> wrote:
> >
> > On Tue, Jun 10, 2014 at 09:50:14PM -0400, Ronald S. Bultje wrote:
> > > The new function in struct Resampler and code therefore in resample()
> > > are admittedly butt-ugly. I'll probably clean it up but at least it
> > > works so I figured I'd send it out and see what people think. What I'd
> > > really like to do is to be able to expose ResampleContext to
> swresample.c
> > > if people are OK with that.
> >
> > exposing it may be ok, but theres not always a ResampleContext
> > we also support resampling through soxr (which uses a fft based
> > resampler).
> > i think the patch will break that due to
> > invert_initial_buffer_func being NULL
> >
> > also this seems to give different output with
> > ./ffmpeg -i matrixbench_mpeg2.mpg -af asetnsamples=1,aresample=8000 -t 30
> foo.wav
> > vs.
> > ./ffmpeg -i matrixbench_mpeg2.mpg -af asetnsamples=1024,aresample=8000 -t
> 30 foo.wav
> 
> 
> That's different already, no?
> 
> Before:
> bash-3.2$ ./ffmpeg -nostats -cpuflags all -threads 1 -thread_type
> frame+slice -i
> /Users/ronaldbultje/Projects/ffmpeg/x86-64-gpl/tests/data/asynth-44100-1.wav
> -af asetnsamples=1024,aresample=8000 -t 30 -f md5 -v 0 -
> MD5=8939e8aacdd4493d8955f1c8e0d362ec
> bash-3.2$ ./ffmpeg -nostats -cpuflags all -threads 1 -thread_type
> frame+slice -i
> /Users/ronaldbultje/Projects/ffmpeg/x86-64-gpl/tests/data/asynth-44100-1.wav
> -af asetnsamples=1,aresample=8000 -t 30 -f md5 -v 0 -
> MD5=ed3e37946eadc20221681d35c6386a49

the difference is because of the 0 padding of the last frame
done by asetnsamples
that can be disabled with asetnsamples=1024:p=0
or apparently by limiting to a shorter duration

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140612/315e693d/attachment.asc>


More information about the ffmpeg-devel mailing list