avcodec/defs: Add AV_PROFILE_* defines, deprecate FF_PROFILE_* defines

These defines are also used in other contexts than just AVCodecContext
ones, e.g. in libavformat. Furthermore, given that these defines are
public, the AV-prefix is the right one, so deprecate (and not just move)
the FF-macros.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2023-09-02 14:57:41 +02:00
parent 0c6e5f321b
commit 8238bc0b5e
93 changed files with 879 additions and 727 deletions

View file

@ -78,17 +78,17 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
if (img->bit_depth == 8) {
avctx->pix_fmt = img->monochrome ?
AV_PIX_FMT_GRAY8 : AV_PIX_FMT_YUV420P;
avctx->profile = FF_PROFILE_AV1_MAIN;
avctx->profile = AV_PROFILE_AV1_MAIN;
return 0;
} else if (img->bit_depth == 10) {
avctx->pix_fmt = img->monochrome ?
AV_PIX_FMT_GRAY10 : AV_PIX_FMT_YUV420P10;
avctx->profile = FF_PROFILE_AV1_MAIN;
avctx->profile = AV_PROFILE_AV1_MAIN;
return 0;
} else if (img->bit_depth == 12) {
avctx->pix_fmt = img->monochrome ?
AV_PIX_FMT_GRAY12 : AV_PIX_FMT_YUV420P12;
avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
return 0;
} else {
return AVERROR_INVALIDDATA;
@ -97,15 +97,15 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
case AOM_IMG_FMT_I42216:
if (img->bit_depth == 8) {
avctx->pix_fmt = AV_PIX_FMT_YUV422P;
avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
return 0;
} else if (img->bit_depth == 10) {
avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
return 0;
} else if (img->bit_depth == 12) {
avctx->pix_fmt = AV_PIX_FMT_YUV422P12;
avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
return 0;
} else {
return AVERROR_INVALIDDATA;
@ -115,18 +115,18 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
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;
avctx->profile = AV_PROFILE_AV1_HIGH;
return 0;
} else if (img->bit_depth == 10) {
avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
AV_PIX_FMT_GBRP10 : AV_PIX_FMT_YUV444P10;
avctx->profile = FF_PROFILE_AV1_HIGH;
avctx->profile = AV_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;
avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
return 0;
} else {
return AVERROR_INVALIDDATA;