From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] avcodec/internal: Move AVCodecInternal to a header of its own
Date: Wed, 2 Aug 2023 17:37:07 +0200
Message-ID: <GV1P250MB0737620102F95A7A8EFC91E98F0BA@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <168907039655.27367.6593832128550408622@lain.khirnov.net>
Anton Khirnov:
> Quoting Andreas Rheinhardt (2023-07-11 03:10:38)
>> This allows to avoid exposing AVCodecInternal to files that
>> don't need it and only include internal.h for something else
>> (like the avpriv functions which are of course included outside
>> of libavcodec where AVCodecInternal should never be visible).
>
> Actually looking at all those other things in internal.h it seems to me
> that (almost?) all of them belong somewhere else.
>
> Multiple functions are only used in one place, some others are
> encoding-only and belong in encode.h, etc.
>
I just sent some patches that moved some of those functions to their
only callers; there is one more, namely ff_alloc_timecode_sei(), but I
am unsure of how intentional it was to put it in utils.c.
ff_guess_coded_bitrate() could be moved to encode.h, but I am unsure
whether the implementation should not be moved to encode.c (or to a new
encode_utils.c?) in this case. Furthermore this function is only used by
encoders, but it is used to set a field (namely AVCodecContext.bit_rate)
which encoders are not allowed to set (for raw codecs the bitrate that
will be used is actually determined by other factors (like dimensions
fps, pixel/sample format), but normally bitrate is an input parameter
when encoding).
ff_add_cpb_side_data() is used by mostly encoders, but also used by
mpeg12dec.c, so there is currently no better place for this.
The two avpriv functions as well as ff_toupper4() (duplicated into lavf
for shared builds) can't be moved to their only callers, obviously.
ff_exp2fi() is only used by two places and could be moved to e.g.
mathops.h, but then this function would be included in so many places
where it is not used.
ff_match_2uint16() could be used to e.g. mpegutils.h, but that is just
based upon the current users and not about the function itself.
FF_SANE_NB_CHANNELS is used in several demuxers (which is the reason why
I want to separate AVCodecInternal out of internal.h).
So I conclude that one can't move everything except AVCodecInternal out
of internal.h into existing headers/callers. So either one adds a new
header misc.h or utils.h for the rest or one adds a new header for
AVCodecInternal. Or one leaves everything as it is.
- 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".
prev parent reply other threads:[~2023-08-02 15:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-11 1:10 Andreas Rheinhardt
2023-07-11 1:15 ` James Almer
2023-07-11 1:26 ` Andreas Rheinhardt
2023-07-11 1:32 ` James Almer
2023-07-11 10:13 ` Anton Khirnov
2023-08-02 15:37 ` Andreas Rheinhardt [this message]
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=GV1P250MB0737620102F95A7A8EFC91E98F0BA@GV1P250MB0737.EURP250.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