Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH 1/7] avcodec/mpegvideo: Move closed_gop to Mpeg1Context
Date: Thu, 16 Dec 2021 12:18:09 +0100
Message-ID: <AM7PR03MB6660BDB9FC38F9F04732EB098F779@AM7PR03MB6660.eurprd03.prod.outlook.com> (raw)
In-Reply-To: <AM7PR03MB6660A91D28B0C164800070948F749@AM7PR03MB6660.eurprd03.prod.outlook.com>

Andreas Rheinhardt:
> Only used there and only by the main thread.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/mpeg12dec.c | 8 +++++---
>  libavcodec/mpegvideo.c | 1 -
>  libavcodec/mpegvideo.h | 1 -
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
> index 09b2902bca..672031b6db 100644
> --- a/libavcodec/mpeg12dec.c
> +++ b/libavcodec/mpeg12dec.c
> @@ -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);
>  }
> diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
> index ba5b51955e..55399a7478 100644
> --- a/libavcodec/mpegvideo.c
> +++ b/libavcodec/mpegvideo.c
> @@ -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;
> diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
> index e90669b776..85f02b1355 100644
> --- a/libavcodec/mpegvideo.h
> +++ b/libavcodec/mpegvideo.h
> @@ -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
> 

Will apply this patchset tonight unless there are objections.

- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

           reply	other threads:[~2021-12-16 11:18 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <AM7PR03MB6660A91D28B0C164800070948F749@AM7PR03MB6660.eurprd03.prod.outlook.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM7PR03MB6660BDB9FC38F9F04732EB098F779@AM7PR03MB6660.eurprd03.prod.outlook.com \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git