[FFmpeg-devel] [RFC] use ff_avc_find_startcode in ff_find_start_code

Reimar Döffinger Reimar.Doeffinger
Tue Feb 19 10:22:09 CET 2008


Hello,
On Tue, Feb 19, 2008 at 03:57:07AM +0100, Michael Niedermayer wrote:
> On Mon, Feb 18, 2008 at 11:07:38PM +0100, Reimar D?ffinger wrote:
> > First I wonder if that ff_find_start_code function is
> > not quite buggy anyway, or is it intentional that it searches for 
> > 00 00 01 00 in the part involving the state but for 00 00 01 ?? in the
> > later code? If so, could somebody document the code?.
> > Anyway, this is a quite ugly patch that makes the function use
> > ff_avc_find_startcode (since that is in lavf, it can't be used as is of
> > course).
> > It probably also breaks the original use of ff_avc_find_startcode,
> > though I found the current behaviour a bit strange as well, and this
> > function is undocumented, too.
> > This causes at least a 6% speedup when decoding
> > http://samples.mplayerhq.hu/GXF/THX_Science_FLT_1920.gxf (I only tested
> > with MPlayer though).
> 
> current code:
> 7054 dezicycles in findsc, 262131 runs, 13 skips
> 7082 dezicycles in findsc, 262134 runs, 10 skips
> 
> your code:
> 11371 dezicycles in findsc, 262119 runs, 25 skips
> 11624 dezicycles in findsc, 262115 runs, 29 skips
> 
> gcc: 4.3.0 20080127 (experimental)
> 800mhz duron
> ffmpeg -v 9 -i matrixbench_mpeg2.mpg -vcodec copy -an -y test.avi

Please use MPlayer, for some reason it gives these numbers:
current code:
1039 dezicycles in test, 4096 runs, 0 skips
1031 dezicycles in test, 8192 runs, 0 skips
1022 dezicycles in test, 16384 runs, 0 skips

my code:
623 dezicycles in test, 4096 runs, 0 skips
624 dezicycles in test, 8192 runs, 0 skips
631 dezicycles in test, 16384 runs, 0 skips

Whereas ffplay gives:
current code:
5769 dezicycles in test, 4094 runs, 2 skips
5373 dezicycles in test, 8190 runs, 2 skips
4624 dezicycles in test, 16380 runs, 4 skips

my code:
8577 dezicycles in test, 4093 runs, 3 skips
7994 dezicycles in test, 8189 runs, 3 skips
6804 dezicycles in test, 16378 runs, 6 skips

Greetings,
Reimar D?ffinger




More information about the ffmpeg-devel mailing list