[FFmpeg-devel] Fix mjpeg decoder runaway from internal buffer

Michael Niedermayer michaelni
Mon Oct 25 12:32:08 CEST 2010


On Mon, Oct 25, 2010 at 11:59:55AM +0200, Luca Barbato wrote:
> On 10/21/2010 04:20 PM, Anatoly Nenashev wrote:
>> 1) Without overread checker
>>
>> Pass # | real | user | sys |
>> ------------------------------------------------------------------------------
>>
>> 1 | 1m23,462s | 1m9,927s | 0m11,994s |
>> 2 | 1m21,598s | 1m9,624s | 0m11,959s |
>> 3 | 1m22,672s | 1m10,743s | 0m11,913s |
>> 4 | 1m21,598s | 1m9,640s | 0m11,944s |
>> 5 | 1m21,586s | 1m9,620s | 0m11,953s |
>>
>> 2) With overread checker
>>
>> Pass # | real | user | sys |
>> ------------------------------------------------------------------------------
>>
>> 1 | 1m23,370s | 1m9,347s | 0m11,869s |
>> 2 | 1m20,922s | 1m9,249s | 0m11,659s |
>> 3 | 1m21,062s | 1m9,279s | 0m11,769s |
>> 4 | 1m20,804s | 1m8,885s | 0m11,906s |
>> 5 | 1m20,782s | 1m9,118s | 0m11,649s |
>>
>> Original Big Buck Bunny mjpeg video was truncated in 2 minutes.
>> I've reboot system before any series of tests to clear any caches.
>
> Looks like the check somehow helps not sure why since it's basically  
> adding a branch more in a number of places =| Michael?

START/STOP_TIMER should be tried.
But the core issue is that adding a check there is unneeded and it increases
the amount of computations neccessary. Some specific compiler may compile it
to faster code this doesnt make adding unneeded checks ok though.

A check done per block with sufficiently sized buffer needs fewer computations

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

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101025/b6d7b671/attachment.pgp>



More information about the ffmpeg-devel mailing list