summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo_motion.c
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2014-03-31 17:46:29 +0000
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-04-09 02:12:19 +0200
commitf6774f905fb3cfdc319523ac640be30b14c1bc55 (patch)
tree6f0db53a2febce58c562d383e1f3f61c9c256275 /libavcodec/mpegvideo_motion.c
parent60fd7d36c47d62d4c603bf16c213b1a924f5cfcf (diff)
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/mpegvideo_motion.c')
-rw-r--r--libavcodec/mpegvideo_motion.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c
index 997a722a8c..1289da1f19 100644
--- a/libavcodec/mpegvideo_motion.c
+++ b/libavcodec/mpegvideo_motion.c
@@ -254,8 +254,8 @@ void mpeg_motion_internal(MpegEncContext *s,
#endif
v_edge_pos = s->v_edge_pos >> field_based;
- linesize = s->current_picture.f.linesize[0] << field_based;
- uvlinesize = s->current_picture.f.linesize[1] << field_based;
+ linesize = s->current_picture.f->linesize[0] << field_based;
+ uvlinesize = s->current_picture.f->linesize[1] << field_based;
dxy = ((motion_y & 1) << 1) | (motion_x & 1);
src_x = s->mb_x * 16 + (motion_x >> 1);
@@ -900,7 +900,7 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
} else {
if (s->picture_structure != s->field_select[dir][0] + 1 &&
s->pict_type != AV_PICTURE_TYPE_B && !s->first_field) {
- ref_picture = s->current_picture_ptr->f.data;
+ ref_picture = s->current_picture_ptr->f->data;
}
mpeg_motion(s, dest_y, dest_cb, dest_cr,
@@ -917,7 +917,7 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
|| s->pict_type == AV_PICTURE_TYPE_B || s->first_field) {
ref2picture = ref_picture;
} else {
- ref2picture = s->current_picture_ptr->f.data;
+ ref2picture = s->current_picture_ptr->f->data;
}
mpeg_motion(s, dest_y, dest_cb, dest_cr,
@@ -956,7 +956,7 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
/* opposite parity is always in the same frame if this is
* second field */
if (!s->first_field) {
- ref_picture = s->current_picture_ptr->f.data;
+ ref_picture = s->current_picture_ptr->f->data;
}
}
}