From: Pieter du P. <mjp...@so...> - 2007-01-22 17:15:32
|
Hi, I attached a patch for mjpeg_play/lavtools/jpeg2yuv.c in order to speed it up when an identical filename has to be processed in succession. This is usually the case when you'd like to produce some video of 'stills'. eg. Generating 10 seconds of still video from x.jpg, in 6 different ways: jpeg2yuv -v3 -R0 -n1 -Ip -f25 -l250 -j x.jpg > x.yuv jpeg2yuv -v3 -R0 -n250 -Ip -f25 -l1 -j x.jpg > x.yuv yes x.jpg | head -3 | jpeg2yuv -v3 -R0 -n1 -Ip -f25 -l250 > x.yuv yes x.jpg | head -3 | jpeg2yuv -v3 -R0 -n250 -Ip -f25 -l1 > x.yuv echo x.jpg | jpeg2yuv -v3 -R0 -n1 -Ip -f25 -l250 > x.yuv echo x.jpg | jpeg2yuv -v3 -R0 -n250 -Ip -f25 -l1 > x.yuv Apart from the last 3 examples, the current code for jpeg2yuv opens, reads, closes and analyses the jpg file 250 times. This has a serious speed impact. The suggested patch simply enables the code to remember the last used filename. If the current filename in the iteration is the same as the last used one, it skips opening, reading, closing and analysing the jpg file. It would be nice to have my patch included, as: - it does not change any functionality of jpeg2yuv. - it does not change jpeg2yuv's command line interface. - it massively speeds up the generation of stills, when using jpg2yuv as shown in my first 3 examples. As most users will opt for the first or second example, this patch will help them. Regards -- Pieter |