diff options
author | wm4 <nfxjfg@googlemail.com> | 2014-03-31 17:46:29 +0000 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-04-09 02:12:19 +0200 |
commit | f6774f905fb3cfdc319523ac640be30b14c1bc55 (patch) | |
tree | 6f0db53a2febce58c562d383e1f3f61c9c256275 /libavcodec/mpeg4videoenc.c | |
parent | 60fd7d36c47d62d4c603bf16c213b1a924f5cfcf (diff) | |
download | ffmpeg-f6774f905fb3cfdc319523ac640be30b14c1bc55.tar.gz |
mpegvideo: operate with pointers to AVFrames instead of whole structs
The most interesting parts are initialization in ff_MPV_common_init() and
uninitialization in ff_MPV_common_end().
ff_mpeg_unref_picture and ff_thread_release_buffer have additional NULL
checks for Picture.f, because these functions can be called on
uninitialized or partially initialized Pictures.
NULL pointer checks are added to ff_thread_release_buffer() stub function.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/mpeg4videoenc.c')
-rw-r--r-- | libavcodec/mpeg4videoenc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c index 3ddc3e4bea..189664dc3d 100644 --- a/libavcodec/mpeg4videoenc.c +++ b/libavcodec/mpeg4videoenc.c @@ -675,7 +675,7 @@ void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64], y = s->height - 16; offset = x + y * s->linesize; - p_pic = s->new_picture.f.data[0] + offset; + p_pic = s->new_picture.f->data[0] + offset; s->mb_skipped = 1; for (i = 0; i < s->max_b_frames; i++) { @@ -683,10 +683,10 @@ void ff_mpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64], int diff; Picture *pic = s->reordered_input_picture[i + 1]; - if (!pic || pic->f.pict_type != AV_PICTURE_TYPE_B) + if (!pic || pic->f->pict_type != AV_PICTURE_TYPE_B) break; - b_pic = pic->f.data[0] + offset; + b_pic = pic->f->data[0] + offset; if (!pic->shared) b_pic += INPLACE_OFFSET; diff = s->dsp.sad[0](NULL, p_pic, b_pic, s->linesize, 16); @@ -906,9 +906,9 @@ static void mpeg4_encode_gop_header(MpegEncContext *s) put_bits(&s->pb, 16, 0); put_bits(&s->pb, 16, GOP_STARTCODE); - time = s->current_picture_ptr->f.pts; + time = s->current_picture_ptr->f->pts; if (s->reordered_input_picture[1]) - time = FFMIN(time, s->reordered_input_picture[1]->f.pts); + time = FFMIN(time, s->reordered_input_picture[1]->f->pts); time = time * s->avctx->time_base.num; seconds = time / s->avctx->time_base.den; @@ -1118,7 +1118,7 @@ void ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number) } put_bits(&s->pb, 3, 0); /* intra dc VLC threshold */ if (!s->progressive_sequence) { - put_bits(&s->pb, 1, s->current_picture_ptr->f.top_field_first); + put_bits(&s->pb, 1, s->current_picture_ptr->f->top_field_first); put_bits(&s->pb, 1, s->alternate_scan); } // FIXME sprite stuff |