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-requ...@ffmpeg.org with subject "unsubscribe".