@ -21,6 +21,7 @@
*/
*/
# include "avcodec.h"
# include "avcodec.h"
# include "encode.h"
# include "internal.h"
# include "internal.h"
static int yuv4_encode_frame ( AVCodecContext * avctx , AVPacket * pkt ,
static int yuv4_encode_frame ( AVCodecContext * avctx , AVPacket * pkt ,
@ -30,7 +31,9 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
uint8_t * y , * u , * v ;
uint8_t * y , * u , * v ;
int i , j , ret ;
int i , j , ret ;
if ( ( ret = ff_alloc_packet2 ( avctx , pkt , 6 * ( avctx - > width + 1 > > 1 ) * ( avctx - > height + 1 > > 1 ) , 0 ) ) < 0 )
ret = ff_get_encode_buffer ( avctx , pkt , 6 * ( avctx - > width + 1 > > 1 )
* ( avctx - > height + 1 > > 1 ) , 0 ) ;
if ( ret < 0 )
return ret ;
return ret ;
dst = pkt - > data ;
dst = pkt - > data ;
@ -62,6 +65,7 @@ const AVCodec ff_yuv4_encoder = {
. long_name = NULL_IF_CONFIG_SMALL ( " Uncompressed packed 4:2:0 " ) ,
. long_name = NULL_IF_CONFIG_SMALL ( " Uncompressed packed 4:2:0 " ) ,
. type = AVMEDIA_TYPE_VIDEO ,
. type = AVMEDIA_TYPE_VIDEO ,
. id = AV_CODEC_ID_YUV4 ,
. id = AV_CODEC_ID_YUV4 ,
. capabilities = AV_CODEC_CAP_DR1 ,
. encode2 = yuv4_encode_frame ,
. encode2 = yuv4_encode_frame ,
. pix_fmts = ( const enum AVPixelFormat [ ] ) { AV_PIX_FMT_YUV420P , AV_PIX_FMT_NONE } ,
. pix_fmts = ( const enum AVPixelFormat [ ] ) { AV_PIX_FMT_YUV420P , AV_PIX_FMT_NONE } ,
} ;
} ;