[FFmpeg-devel] [PATCH 4/4] Add MxPEG decoder

Anatoly Nenashev anatoly.nenashev
Wed Feb 16 23:27:22 CET 2011


On 17.02.2011 01:07, M?ns Rullg?rd wrote:
> Anatoly Nenashev<anatoly.nenashev at ovsoft.ru>  writes:
>
>    
>> On 17.02.2011 00:40, M?ns Rullg?rd wrote:
>>      
>>> Anatoly Nenashev<anatoly.nenashev at ovsoft.ru>   writes:
>>>
>>>
>>>        
>>>>    From e6a735d5d70e4ab64053e6223cb5a6296145cb26 Mon Sep 17 00:00:00 2001
>>>> From: anatoly<anatoly.nenashev at ovsoft.ru>
>>>> Date: Wed, 16 Feb 2011 23:28:07 +0300
>>>> Subject: [PATCH 4/4] Add MxPEG decoder
>>>>
>>>> ---
>>>>    libavcodec/Makefile    |    1 +
>>>>    libavcodec/allcodecs.c |    1 +
>>>>    libavcodec/mxpegdec.c  |  326 ++++++++++++++++++++++++++++++++++++++++++++++++
>>>>    3 files changed, 328 insertions(+), 0 deletions(-)
>>>>    create mode 100644 libavcodec/mxpegdec.c
>>>>
>>>>          
>>> This duplicates a lot of code from mjpegdec.c.  That is not good.
>>>
>>>
>>>        
>> I'm not agree with it. What part exactly was copypasted from original code?
>>      
> The big loop in decode_frame() is largely duplicated.  Your original
> patch only added a few small bits to it.
>
>    
Hmm... Let's compare them in details:
1) mxpeg_decode_app is simpler than mjpeg_decode_app
2) EOI processing is simpler
3) COM processing is much different
4) only SOF0 marker are supported, other SOFx markers are ignored
5) there is no restart_marker support
6) there is no DRI marker support
7) SOS processing is much different
8) the code at the label "the_end" is also different.

The only common parts are main loop "while" and case's names in 
"switch". To implement all this  stuff in original mjpeg code I should 
add a lot of "if else" in each "case" body. I don't think it makes code 
clearer and faster.



More information about the ffmpeg-devel mailing list