[Ffmpeg-devel] [PATCH] ported SGI decoder to the new API

Xiaohui Sun sunxiaohui
Fri Mar 30 10:29:44 CEST 2007


Michael Niedermayer wrote:
> Hi
>
> On Fri, Mar 30, 2007 at 08:49:37AM +0800, Xiaohui Sun wrote:
>   
>> Michael Niedermayer wrote:
>>     
>>> Hi
>>>
>>> On Thu, Mar 29, 2007 at 06:54:19PM +0800, Xiaohui Sun wrote:
>>>  
>>>       
>> [...]
>>
>>     
>>>> +    avctx->codec_id = CODEC_ID_SGI;
>>>>    
>>>>         
>>> uneeded codec_id has to be at that value already
>>>
>>> [...]
>>>  
>>>       
>>>> Index: libavcodec/sgienc.c
>>>> ===================================================================
>>>> --- libavcodec/sgienc.c	(revision 0)
>>>> +++ libavcodec/sgienc.c	(revision 0)
>>>> @@ -0,0 +1,258 @@
>>>>    
>>>>         
>>> [...]
>>>  
>>>       
>>>> +static int encode_init(AVCodecContext *avctx){
>>>> +    SgiContext *s = avctx->priv_data;
>>>> +
>>>> +    avcodec_get_frame_defaults((AVFrame*)&s->picture);
>>>> +    avctx->coded_frame = (AVFrame*)&s->picture;
>>>> +
>>>> +    return 0;
>>>> +}
>>>>    
>>>>         
>>> this function is still duplicated
>>>
>>>  
>>>       
>> I think we don't need this function and put these code in 
>> encode_frame(), right?
>>     
>
> would that remove the duplicated code? if not how should that help?
> anyway this one is just a minor nitpick, just keep the duplicate init
> if you like
>
>   

in this function, we just get the frame and put this into the avctx. I 
have no idea if these steps are necessary, it not, we can
simply remove the codes. or what do you mean of the duplication?









More information about the ffmpeg-devel mailing list