mirror of https://github.com/FFmpeg/FFmpeg.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.7 KiB
61 lines
1.7 KiB
11 years ago
|
/*
|
||
11 years ago
|
* This file is part of FFmpeg.
|
||
11 years ago
|
*
|
||
11 years ago
|
* FFmpeg is free software; you can redistribute it and/or
|
||
11 years ago
|
* modify it under the terms of the GNU Lesser General Public
|
||
|
* License as published by the Free Software Foundation; either
|
||
|
* version 2.1 of the License, or (at your option) any later version.
|
||
|
*
|
||
11 years ago
|
* FFmpeg is distributed in the hope that it will be useful,
|
||
11 years ago
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
* Lesser General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU Lesser General Public
|
||
11 years ago
|
* License along with FFmpeg; if not, write to the Free Software
|
||
11 years ago
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||
|
*/
|
||
|
|
||
|
#include "error_resilience.h"
|
||
|
#include "mpegvideo.h"
|
||
|
#include "mpeg_er.h"
|
||
|
|
||
|
static void set_erpic(ERPicture *dst, Picture *src)
|
||
|
{
|
||
|
int i;
|
||
|
|
||
11 years ago
|
memset(dst, 0, sizeof(*dst));
|
||
11 years ago
|
if (!src) {
|
||
|
dst->f = NULL;
|
||
|
dst->tf = NULL;
|
||
|
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;
|
||
|
|
||
|
set_erpic(&er->cur_pic, s->current_picture_ptr);
|
||
|
set_erpic(&er->next_pic, s->next_picture_ptr);
|
||
|
set_erpic(&er->last_pic, s->last_picture_ptr);
|
||
|
|
||
|
er->pp_time = s->pp_time;
|
||
|
er->pb_time = s->pb_time;
|
||
|
er->quarter_sample = s->quarter_sample;
|
||
|
er->partitioned_frame = s->partitioned_frame;
|
||
|
|
||
|
ff_er_frame_start(er);
|
||
|
}
|