avcodec/codec_internal: Add inlined version of av_codec_is_(de|en)coder

These functions check whether the AVCodec* is NULL, but this
has already been checked at a lot of places in our codebase,
so that it boils down to checking the is_decoder flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-03-10 17:00:36 +01:00
parent 47d7c6cd15
commit c8be309719
6 changed files with 40 additions and 20 deletions

View File

@@ -1013,12 +1013,12 @@ static const AVCodec *find_codec(enum AVCodecID id, int (*x)(const AVCodec *))
const AVCodec *avcodec_find_encoder(enum AVCodecID id)
{
return find_codec(id, av_codec_is_encoder);
return find_codec(id, ff_codec_is_encoder);
}
const AVCodec *avcodec_find_decoder(enum AVCodecID id)
{
return find_codec(id, av_codec_is_decoder);
return find_codec(id, ff_codec_is_decoder);
}
static const AVCodec *find_codec_by_name(const char *name, int (*x)(const AVCodec *))
@@ -1041,10 +1041,10 @@ static const AVCodec *find_codec_by_name(const char *name, int (*x)(const AVCode
const AVCodec *avcodec_find_encoder_by_name(const char *name)
{
return find_codec_by_name(name, av_codec_is_encoder);
return find_codec_by_name(name, ff_codec_is_encoder);
}
const AVCodec *avcodec_find_decoder_by_name(const char *name)
{
return find_codec_by_name(name, av_codec_is_decoder);
return find_codec_by_name(name, ff_codec_is_decoder);
}