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

Michael Niedermayer michaelni
Fri Mar 30 13:42:27 CEST 2007


Hi

On Fri, Mar 30, 2007 at 04:29:44PM +0800, Xiaohui Sun wrote:
> 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?

both encoder and decoder have the same init code so its duplicated once
it might or might not work without setting coded_frame but that was not what
i meant
as said just leave it as it is

tough you could remove the unneeded casts

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

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070330/a29c9139/attachment.pgp>



More information about the ffmpeg-devel mailing list