[FFmpeg-devel] [PATCH] Mobotix .mxg demixer and MxPEG decoder basic implementation

Michael Niedermayer michaelni
Tue Aug 17 04:28:49 CEST 2010


On Tue, Aug 17, 2010 at 01:53:27AM +0400, Anatoly Nenashev wrote:
> On 16.08.2010 18:54, Michael Niedermayer wrote:
>> On Wed, Aug 11, 2010 at 09:22:48PM +0400, Anatoly Nenashev wrote:
>>    
>>> On 11.08.2010 20:13, Michael Niedermayer wrote:
>>>      
>> [...]
>>    
>>>      
>>>>> diff -r 02ffe42e2ae2 libavcodec/mjpegdec.c
>>>>> --- a/libavcodec/mjpegdec.c	Sun Aug 01 14:52:28 2010 +0400
>>>>> +++ b/libavcodec/mjpegdec.c	Tue Aug 10 23:42:47 2010 +0400
>>>>> @@ -331,18 +331,28 @@
>>>>>                s->avctx->pix_fmt = PIX_FMT_GRAY16;
>>>>>        }
>>>>>
>>>>> -    if(s->picture.data[0])
>>>>> -        s->avctx->release_buffer(s->avctx,&s->picture);
>>>>> +    if (CODEC_ID_MXPEG == s->avctx->codec_id) {
>>>>> +        if (s->avctx->reget_buffer(s->avctx,&s->picture)<   0) {
>>>>>
>>>>>          
>>>> this makes double buffering with direct rendering impossible
>>>>
>>>>
>>>>
>>>>        
>>> Well, I'm not agree or there is something I don't understand. By my 
>>> opinion
>>> reget_buffer do 3 things:
>>> 1) create new buffer
>>> 2) copy data from old buffer to new buffer
>>>      
>> and then 0-100% of that is overwritten
>> if you copy explicitly just what needs copying then it should be faster
>>
>>    
>
> May be faster or may be not. 


> In most cases there will be a small difference 
> between two sequential frames.

true for h264 as well still we dont copy the whole frame "just in case"
before
also it trashes the cache


>  Also conditional copy may cause a problem 
> with branch prediction. Can I move this issue to further optimizations ?

hmm, the patchset is in poor shape already, that wouldnt make it better 

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100817/c0fb524c/attachment.pgp>



More information about the ffmpeg-devel mailing list