#include "avcodec.h"
#include "internal.h"
+#include "profiles.h"
typedef struct AV1DecodeContext {
struct aom_codec_ctx decoder;
switch (img->fmt) {
case AOM_IMG_FMT_I420:
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
+ avctx->profile = FF_PROFILE_AV1_MAIN;
return 0;
case AOM_IMG_FMT_I422:
avctx->pix_fmt = AV_PIX_FMT_YUV422P;
+ avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
return 0;
case AOM_IMG_FMT_I444:
avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P;
+ avctx->profile = FF_PROFILE_AV1_HIGH;
return 0;
case AOM_IMG_FMT_I42016:
if (img->bit_depth == 8) {
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
+ avctx->profile = FF_PROFILE_AV1_MAIN;
return 0;
} else if (img->bit_depth == 10) {
avctx->pix_fmt = AV_PIX_FMT_YUV420P10;
+ avctx->profile = FF_PROFILE_AV1_MAIN;
return 0;
} else if (img->bit_depth == 12) {
avctx->pix_fmt = AV_PIX_FMT_YUV420P12;
+ avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
return 0;
} else {
return AVERROR_INVALIDDATA;
case AOM_IMG_FMT_I42216:
if (img->bit_depth == 8) {
avctx->pix_fmt = AV_PIX_FMT_YUV422P;
+ avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
return 0;
} else if (img->bit_depth == 10) {
avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
+ avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
return 0;
} else if (img->bit_depth == 12) {
avctx->pix_fmt = AV_PIX_FMT_YUV422P12;
+ avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
return 0;
} else {
return AVERROR_INVALIDDATA;
if (img->bit_depth == 8) {
avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P;
+ avctx->profile = FF_PROFILE_AV1_HIGH;
return 0;
} else if (img->bit_depth == 10) {
avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
AV_PIX_FMT_GBRP10 : AV_PIX_FMT_YUV444P10;
+ avctx->profile = FF_PROFILE_AV1_HIGH;
return 0;
} else if (img->bit_depth == 12) {
avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
AV_PIX_FMT_GBRP12 : AV_PIX_FMT_YUV444P12;
+ avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
return 0;
} else {
return AVERROR_INVALIDDATA;
.close = aom_free,
.decode = aom_decode,
.capabilities = AV_CODEC_CAP_AUTO_THREADS | AV_CODEC_CAP_DR1,
+ .profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles),
.wrapper_name = "libaom",
};
{ FF_PROFILE_UNKNOWN },
};
+const AVProfile ff_av1_profiles[] = {
+ { FF_PROFILE_AV1_MAIN, "Main" },
+ { FF_PROFILE_AV1_HIGH, "High" },
+ { FF_PROFILE_AV1_PROFESSIONAL, "Professional" },
+ { FF_PROFILE_UNKNOWN },
+};
+
const AVProfile ff_sbc_profiles[] = {
{ FF_PROFILE_SBC_MSBC, "mSBC" },
{ FF_PROFILE_UNKNOWN },