avcodec/mpegvideo: Move closed_gop to Mpeg1Context

Only used there and only by the main thread.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-12-12 20:36:05 +01:00
parent dd94912479
commit 81c6b8ffe8
3 changed files with 5 additions and 5 deletions

View File

@ -69,6 +69,7 @@ typedef struct Mpeg1Context {
int rc_buffer_size;
AVRational frame_rate_ext; /* MPEG-2 specific framerate modificator */
int sync; /* Did we reach a sync point like a GOP/SEQ/KEYFrame? */
int closed_gop;
int tmpgexs;
int first_slice;
int extradata_decoded;
@ -2449,7 +2450,7 @@ static void mpeg_decode_gop(AVCodecContext *avctx,
tc = s-> timecode_frame_start = get_bits(&s->gb, 25);
s->closed_gop = get_bits1(&s->gb);
s1->closed_gop = get_bits1(&s->gb);
/* broken_link indicates that after editing the
* reference frames of the first B-Frames after GOP I-Frame
* are missing (open gop) */
@ -2460,7 +2461,7 @@ static void mpeg_decode_gop(AVCodecContext *avctx,
av_timecode_make_mpeg_tc_string(tcbuf, tc);
av_log(s->avctx, AV_LOG_DEBUG,
"GOP (%s) closed_gop=%d broken_link=%d\n",
tcbuf, s->closed_gop, broken_link);
tcbuf, s1->closed_gop, broken_link);
}
}
@ -2694,7 +2695,7 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
/* Skip B-frames if we do not have reference frames and
* GOP is not closed. */
if (s2->pict_type == AV_PICTURE_TYPE_B) {
if (!s2->closed_gop) {
if (!s->closed_gop) {
skip_frame = 1;
av_log(s2->avctx, AV_LOG_DEBUG,
"Skipping B slice due to open GOP\n");
@ -2882,6 +2883,7 @@ static void flush(AVCodecContext *avctx)
Mpeg1Context *s = avctx->priv_data;
s->sync = 0;
s->closed_gop = 0;
ff_mpeg_flush(avctx);
}

View File

@ -2317,7 +2317,6 @@ void ff_mpeg_flush(AVCodecContext *avctx){
ff_mpeg_unref_picture(s->avctx, &s->next_picture);
s->mb_x= s->mb_y= 0;
s->closed_gop= 0;
#if FF_API_FLAG_TRUNCATED
s->parse_context.state= -1;

View File

@ -198,7 +198,6 @@ typedef struct MpegEncContext {
int *lambda_table;
int adaptive_quant; ///< use adaptive quantization
int dquant; ///< qscale difference to prev qscale
int closed_gop; ///< MPEG1/2 GOP is closed
int pict_type; ///< AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
int vbv_delay;
int last_pict_type; //FIXME removes