Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Anton Khirnov <anton@khirnov.net>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 4/9] lavc: add generic-decode-layer private data
Date: Mon, 03 Jul 2023 21:24:16 +0200
Message-ID: <168841225609.542.11783738741726137438@lain.khirnov.net> (raw)
In-Reply-To: =?utf-8?q?=3CGV1P250MB0737A11936371A3FDCA7CE6E8F20A=40GV1P250MB?= =?utf-8?q?0737=2EEURP250=2EPROD=2EOUTLOOK=2ECOM=3E?=

Quoting Andreas Rheinhardt (2023-06-24 21:34:58)
> > diff --git a/libavcodec/internal.h b/libavcodec/internal.h
> > index dceae182c0..b672092ac4 100644
> > --- a/libavcodec/internal.h
> > +++ b/libavcodec/internal.h
> > @@ -49,7 +49,14 @@
> >  #   define STRIDE_ALIGN 8
> >  #endif
> >  
> > +typedef struct DecodeContext DecodeContext;
> > +
> >  typedef struct AVCodecInternal {
> > +    /**
> > +     * Generic decoding private data.
> > +     */
> > +    DecodeContext *d;
> 
> This approach has the downside of adding unnecessary indirecations; it
> furthermore adds pointers to DecodeContext and EncodeContext to
> AVCodecInternal, as if both could be valid at the same time.
> 
> The above could be overcome by using the typical approach to access
> these extra fields, as is used for FFStream etc.
> 
> Furthermore, I do not really think that is worth it: The number of
> fields affected by it are just so small. Has encoder code ever tried to
> set nb_draining_errors?

True, for decoding there are currently very few fields. But there are
many more that are encoding-only - I am not handling more of them in
this set because some of them are not trivial and I did not want to make
this patchset overly large, as its point is fixing the FATE test in 9/9.

And I belive there is a strong case for hiding generic-layer private
state from individual decoders/encoders, as it is prone to being
misunderstood and misused (e.g. AVCodecInternal.draining is currently
used in ways it most likely should not be).

Since the overhead of having a private decode context in addition to a
private encode context is very small, I prefer adding it now, at least
for consistency. Otherwise I'd have to add a shared encode-decode
context, which would be about the same amount of code.

-- 
Anton Khirnov
_______________________________________________
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".

  parent reply	other threads:[~2023-07-03 19:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20 14:16 [FFmpeg-devel] [PATCH 1/9] lavc: add a header for internal generic-layer APIs Anton Khirnov
2023-06-20 14:16 ` [FFmpeg-devel] [PATCH 2/9] lavc/avcodec: split flushing into decode- and encode-specific functions Anton Khirnov
2023-06-24 18:53   ` Andreas Rheinhardt
2023-06-20 14:16 ` [FFmpeg-devel] [PATCH 3/9] lavc: reindent after previous commit Anton Khirnov
2023-06-20 14:16 ` [FFmpeg-devel] [PATCH 4/9] lavc: add generic-decode-layer private data Anton Khirnov
2023-06-24 19:34   ` Andreas Rheinhardt
2023-07-03 19:24   ` Anton Khirnov [this message]
2023-06-20 14:16 ` [FFmpeg-devel] [PATCH 5/9] lavc: add generic-encode-layer " Anton Khirnov
2023-06-20 14:16 ` [FFmpeg-devel] [PATCH 6/9] lavc: move AVCodecInternal.last_audio_frame to EncodeContext Anton Khirnov
2023-06-20 14:16 ` [FFmpeg-devel] [PATCH 7/9] lavc/decode: track whether the caller started draining with a separate flag Anton Khirnov
2023-06-20 14:16 ` [FFmpeg-devel] [PATCH 8/9] lavc/decode: move submitting input packets to bitstream filters Anton Khirnov
2023-06-20 17:48   ` James Almer
2023-06-20 14:16 ` [FFmpeg-devel] [PATCH 9/9] lavc/decode: do not perform decoding when sending draining packets Anton Khirnov

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=168841225609.542.11783738741726137438@lain.khirnov.net \
    --to=anton@khirnov.net \
    --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