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

Michael Niedermayer michaelni
Mon Aug 16 16:54:14 CEST 2010


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


[...]

>
>>    
>>> @@ -1026,6 +1044,12 @@
>>>       if(8*len + get_bits_count(&s->gb)>  s->gb.size_in_bits)
>>>           return -1;
>>>
>>> +    /* skip MXPEG audio data*/
>>> +    if ((s->avctx->codec_id == CODEC_ID_MXPEG)&&  (s->start_code == 
>>> APP13)) {
>>> +        skip_bits(&s->gb, (len-2)<<  3);
>>> +        return 0;
>>> +    }
>>>      
>> how does the audio data reach the video decoder?
>> this just looks like the demuxer is wrongly implemented
>>
>> [...]
>>
>>    
>
> On the other hand APP13 is valid marker for JPEG format. So, there no need 
> to extract this data from video stream.
> Also rejecting audio data from video stream will reduce the performance.

audio data in the video stream would lead to inconsistent audio on remuxing.


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

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- 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/20100816/67a10a26/attachment.pgp>



More information about the ffmpeg-devel mailing list