[Ffmpeg-devel] MpegEncContext Pictures in codec development

Denis Fortin fortin
Fri Sep 29 21:15:06 CEST 2006


Le vendredi 29 septembre 2006 ? 20:59 +0200, Michael Niedermayer a
?crit :
> Hi
> 
> On Thu, Sep 28, 2006 at 09:37:30PM +0200, Denis Fortin wrote:
> > Hi,
> > 
> > I'm writing a codec (vc1 coder), and i'm a little confused about all
> > those pictures in 
> > MpegEncContext.
> > 
> > Currently i need to store the result of an encoded/decoded I frame (for
> > future use in P frames). From what i could understand new_picture is the
> > original picture (the one to encode) and current_picture is the one i
> > should use to store the encoded/decoded I frame.
> > Am i right ?
> 
> yes
> 
> 
> > Then how can i get a correctly allocated current_picture ?
> 
> IIRC MPV_frame_start() does that for you
> 
> 
> > 
> > More generally, how the picture/ff_find_unused_picture stuff is
> > working : 
> 
> RTFS :)
> but maybe you wont need ff_find_unused_picture() at all i dunno
> 
> 
> > When encoding a P frame, how should i get the forward/backward ref
> > pictures ?
> 
> P frames dont have backward ref pictures
> 
> 
> > How the reordered P frames are stored while encoding the forward ref
> > picture ?
> >            vv        
> >           IPPIPP...
> 
> if you have only I and P frames then there should be no reordering

Thanks for your answers.
I started this encoder without using much of mpegvideo.c but
after more RTFS i think it's more reasonable to integrate it in
mpegvideo.c like the wmv2 encoder and use some new switch()  
	case CODEC_ID_WMV3:
          case CODEC_ID_VC1: 
 	...

is this kind of patch acceptable ?

Denis Fortin






More information about the ffmpeg-devel mailing list