Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-02-28 14:31:56 +0400
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-03-17 02:01:00 +0400
commitd66e305bd1b4f3e91ae4e7e549148509d0811672 (patch)
tree0c2d149ae94922d03c098d08e938d3f64ee01bb9 /libavcodec/mpegvideo.c
parent1c79b1625d4d257bfd01eccb84cc0ab355fb9a9e (diff)
er: move relevant fields from Picture to ERPicture
This is done to disentangle ER from mpegvideo. In order to use a classic Picture, callers can use ff_mpeg_set_erpic() or use a custom function to set the fields. Please note that buffers need to be allocated before calling ff_er_frame_end().
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 59c64b8e95..46754ddc2b 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -2482,13 +2482,32 @@ void ff_MPV_report_decode_progress(MpegEncContext *s)
}
#if CONFIG_ERROR_RESILIENCE
+void ff_mpeg_set_erpic(ERPicture *dst, Picture *src)
+{
+ int i;
+
+ if (!src)
+ return;
+
+ dst->f = &src->f;
+ dst->tf = &src->tf;
+
+ for (i = 0; i < 2; i++) {
+ dst->motion_val[i] = src->motion_val[i];
+ dst->ref_index[i] = src->ref_index[i];
+ }
+
+ dst->mb_type = src->mb_type;
+ dst->field_picture = src->field_picture;
+}
+
void ff_mpeg_er_frame_start(MpegEncContext *s)
{
ERContext *er = &s->er;
- er->cur_pic = s->current_picture_ptr;
- er->last_pic = s->last_picture_ptr;
- er->next_pic = s->next_picture_ptr;
+ ff_mpeg_set_erpic(&er->cur_pic, s->current_picture_ptr);
+ ff_mpeg_set_erpic(&er->next_pic, s->next_picture_ptr);
+ ff_mpeg_set_erpic(&er->last_pic, s->last_picture_ptr);
er->pp_time = s->pp_time;
er->pb_time = s->pb_time;