Commit ea3320bb authored by James Almer's avatar James Almer

libaomenc: fix profile setting

Main Profile is yuv420p 8 and 10 bit
High Profile is yuv444p 8 and 10 bit
Professional Profile is yuv422p 8, 10, and 12 bit, plus every other pixfmt at 12 bit
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent f6171471
...@@ -301,13 +301,13 @@ static av_cold int aom_init(AVCodecContext *avctx) ...@@ -301,13 +301,13 @@ static av_cold int aom_init(AVCodecContext *avctx)
* quality. */ * quality. */
if (avctx->profile != FF_PROFILE_UNKNOWN) if (avctx->profile != FF_PROFILE_UNKNOWN)
enccfg.g_profile = avctx->profile; enccfg.g_profile = avctx->profile;
else if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) else if (avctx->pix_fmt == AV_PIX_FMT_YUV420P ||
avctx->pix_fmt == AV_PIX_FMT_YUV420P10)
avctx->profile = enccfg.g_profile = FF_PROFILE_AV1_MAIN; avctx->profile = enccfg.g_profile = FF_PROFILE_AV1_MAIN;
else { else if (avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); avctx->pix_fmt == AV_PIX_FMT_YUV444P10)
if (desc->comp[0].depth < 12)
avctx->profile = enccfg.g_profile = FF_PROFILE_AV1_HIGH; avctx->profile = enccfg.g_profile = FF_PROFILE_AV1_HIGH;
else else {
avctx->profile = enccfg.g_profile = FF_PROFILE_AV1_PROFESSIONAL; avctx->profile = enccfg.g_profile = FF_PROFILE_AV1_PROFESSIONAL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment