diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-02-28 11:31:56 +0100 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-03-16 23:01:00 +0100 |
commit | d66e305bd1b4f3e91ae4e7e549148509d0811672 (patch) | |
tree | 0c2d149ae94922d03c098d08e938d3f64ee01bb9 /libavcodec/mpegvideo.c | |
parent | 1c79b1625d4d257bfd01eccb84cc0ab355fb9a9e (diff) | |
download | ffmpeg-d66e305bd1b4f3e91ae4e7e549148509d0811672.tar.gz |
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.c | 25 |
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; |