avcodec/codec_desc: add a codec prop to signal enhancement layers

Some video codecs are not meant to output frames on their own but to be applied
on top of frames generated by other codecs, as is the case of LCEVC, Dolby Vision,
etc. Add a codec prop to signal this kind of codec, so that library users may know
to not expect a standalone decoder for them to be present.

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2026-03-06 10:24:28 -03:00
parent 2f9d3ce5a2
commit c23d56b173
4 changed files with 16 additions and 1 deletions

View File

@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2025-03-28
API changes, most recent first:
2026-03-07 - xxxxxxxxxx - lavc 62.26.100 - codec_desc.h
Add AV_CODEC_PROP_ENHANCEMENT.
2026-03-07 - xxxxxxxxxx - lavc 62.25.100 - avcodec.h
Deprecate AVCodecContext.intra_dc_precision.

View File

@@ -28,11 +28,13 @@
#include <string.h>
#include "config.h"
#include "libavutil/avassert.h"
#include "libavutil/thread.h"
#include "avcodec.h"
#include "codec.h"
#include "codec_id.h"
#include "codec_internal.h"
#include "codec_desc.h"
extern const FFCodec ff_a64multi_encoder;
extern const FFCodec ff_a64multi5_encoder;
@@ -1018,6 +1020,7 @@ static enum AVCodecID remap_deprecated_codec_id(enum AVCodecID id)
static const AVCodec *find_codec(enum AVCodecID id, int (*x)(const AVCodec *))
{
const AVCodec *p, *experimental = NULL;
av_unused const AVCodecDescriptor *desc = avcodec_descriptor_get(id);
void *i = 0;
id = remap_deprecated_codec_id(id);
@@ -1026,6 +1029,7 @@ static const AVCodec *find_codec(enum AVCodecID id, int (*x)(const AVCodec *))
if (!x(p))
continue;
if (p->id == id) {
av_assert1(!desc || !(desc->props & AV_CODEC_PROP_ENHANCEMENT));
if (p->capabilities & AV_CODEC_CAP_EXPERIMENTAL && !experimental) {
experimental = p;
} else

View File

@@ -96,6 +96,14 @@ typedef struct AVCodecDescriptor {
*/
#define AV_CODEC_PROP_FIELDS (1 << 4)
/**
* Video codec contains enhancement information meant to be applied to other
* existing frames, and can't generate usable image data on its own.
* A standalone decoder is unlikely to be available for it and should not
* be expected.
*/
#define AV_CODEC_PROP_ENHANCEMENT (1 << 5)
/**
* Subtitle codec is bitmap based
* Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field.

View File

@@ -29,7 +29,7 @@
#include "version_major.h"
#define LIBAVCODEC_VERSION_MINOR 25
#define LIBAVCODEC_VERSION_MINOR 26
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \