[FFmpeg-devel] Reducing time spent in av_find_stream_info()

Diego Santa Cruz Diego.SantaCruz
Wed Nov 14 16:35:05 CET 2007


> >
> > I see, any hints about which framerates should be kept? I will try
also
> 
> well, i dont know, but all which occur in real files at least :)
> 
> 
> > to reduce the complexity of the calculations.
> >

OK I have done both :)

First patch attached (ffmpeg-fp-dur-error.patch) changes the
computations to use 64 bit fixed-point arithmetic. On our platform (ARM
300 MHz, soft-float) it is around x3 faster. On platforms with an FPU I
do not know how it compares (but I guess most platforms with a fast FPU
are much faster than my underpowered CPU and would not notice the
difference anyhow).

Second patch attached (ffmpeg-info-fps.patch) modifies the table of
standard framerates. The new set is much reduced (from 725 to 42). I
replaced all framerates 1 to 60 in 1/12 steps by all regular framerates
derived from 18, 24, 30 and 60 which are not below 1 fps and which are
also a multiple of 1/12 (as was the case before). Note that this second
patch is independent of the one above, although it may not apply cleanly
without it due to nearby changes. I also added 17.98 = 18*1000/1001,
since I guess this might appear in some cases...

-- 
------------------------------------------------------------------------
--

Diego Santa Cruz, PhD
Software Architect, SpinetiX S.A.

PSE-C, CH-1015, Lausanne, Switzerland 
Tel:    +41 (0) 21 693 89 81
Mail:   Diego.SantaCruz at spinetix.com

Get Information : www.spinetix.com

------------------------------------------------------------------------
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-fp-dur-error.patch
Type: application/octet-stream
Size: 3044 bytes
Desc: ffmpeg-fp-dur-error.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071114/5009fea5/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-info-fps.patch
Type: application/octet-stream
Size: 2488 bytes
Desc: ffmpeg-info-fps.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071114/5009fea5/attachment-0001.obj>



More information about the ffmpeg-devel mailing list