diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-05-27 19:55:35 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-05-27 19:55:35 +0000 |
commit | a4a750d3b2fbac34cbe3968db0988eb3af911f8f (patch) | |
tree | 1281abb219aa3a5e618d94dbe9b50184d5bd52a9 /libavcodec | |
parent | 50352827f6444cf74fe37de9827c3ebb9a55fbcb (diff) | |
download | ffmpeg-streaming-a4a750d3b2fbac34cbe3968db0988eb3af911f8f.zip ffmpeg-streaming-a4a750d3b2fbac34cbe3968db0988eb3af911f8f.tar.gz |
Rename alloc_picture to ff_alloc_picture and move its definition
in mpegvideo.h to avoid including mpegvideo_common.h in mpeg12.c,
because it contains motion code.
Originally committed as revision 18968 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpeg12.c | 3 | ||||
-rw-r--r-- | libavcodec/mpegvideo.c | 4 | ||||
-rw-r--r-- | libavcodec/mpegvideo.h | 6 | ||||
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 6 |
4 files changed, 12 insertions, 7 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 48c7899..477e99c 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -30,7 +30,6 @@ #include "avcodec.h" #include "dsputil.h" #include "mpegvideo.h" -#include "mpegvideo_common.h" #include "mpeg12.h" #include "mpeg12data.h" @@ -2373,7 +2372,7 @@ static int decode_chunks(AVCodecContext *avctx, /* Allocate a dummy frame */ i= ff_find_unused_picture(s2, 0); s2->last_picture_ptr= &s2->picture[i]; - if(alloc_picture(s2, s2->last_picture_ptr, 0) < 0) + if(ff_alloc_picture(s2, s2->last_picture_ptr, 0) < 0) return -1; } } diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index da157c7..7af9507 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -219,7 +219,7 @@ static int alloc_frame_buffer(MpegEncContext *s, Picture *pic) * allocates a Picture * The pixels are allocated/set by calling get_buffer() if shared=0 */ -int alloc_picture(MpegEncContext *s, Picture *pic, int shared){ +int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared){ const int big_mb_num= s->mb_stride*(s->mb_height+1) + 1; //the +1 is needed so memset(,,stride*height) does not sig11 const int mb_array_size= s->mb_stride*s->mb_height; const int b8_array_size= s->b8_stride*s->mb_height*2; @@ -917,7 +917,7 @@ alloc: pic->coded_picture_number= s->coded_picture_number++; - if(alloc_picture(s, pic, 0) < 0) + if(ff_alloc_picture(s, pic, 0) < 0) return -1; s->current_picture_ptr= pic; diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index c2947b4..61ecc18 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -711,6 +711,12 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64], uint16_t (*qmat16)[2][6 void ff_init_block_index(MpegEncContext *s); void ff_copy_picture(Picture *dst, Picture *src); +/** + * allocates a Picture + * The pixels are allocated/set by calling get_buffer() if shared=0 + */ +int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared); + extern const enum PixelFormat ff_pixfmt_list_420[]; extern const enum PixelFormat ff_hwaccel_pixfmt_list_420[]; diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index f1dcff4..4aa6d69 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -817,14 +817,14 @@ static int load_input_picture(MpegEncContext *s, AVFrame *pic_arg){ pic->data[i]= pic_arg->data[i]; pic->linesize[i]= pic_arg->linesize[i]; } - alloc_picture(s, (Picture*)pic, 1); + ff_alloc_picture(s, (Picture*)pic, 1); }else{ i= ff_find_unused_picture(s, 0); pic= (AVFrame*)&s->picture[i]; pic->reference= 3; - alloc_picture(s, (Picture*)pic, 0); + ff_alloc_picture(s, (Picture*)pic, 0); if( pic->data[0] + INPLACE_OFFSET == pic_arg->data[0] && pic->data[1] + INPLACE_OFFSET == pic_arg->data[1] @@ -1150,7 +1150,7 @@ no_output_pic: Picture *pic= &s->picture[i]; pic->reference = s->reordered_input_picture[0]->reference; - alloc_picture(s, pic, 0); + ff_alloc_picture(s, pic, 0); /* mark us unused / free shared pic */ if(s->reordered_input_picture[0]->type == FF_BUFFER_TYPE_INTERNAL) |