summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-03-29 13:03:04 -0300
committerJames Almer <jamrial@gmail.com>2018-03-29 13:06:38 -0300
commitea3320bb828553182fb34e164826f95df5743522 (patch)
tree285a2cbc296ef880c20e7300729cd07ffbda6cd3
parentf6171471e6cfbd472f7ab71c12aa87510a07d4fd (diff)
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: James Almer <jamrial@gmail.com>
-rw-r--r--libavcodec/libaomenc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
index a2a2c3994b..9807bd5adb 100644
--- a/libavcodec/libaomenc.c
+++ b/libavcodec/libaomenc.c
@@ -301,14 +301,14 @@ static av_cold int aom_init(AVCodecContext *avctx)
* quality. */
if (avctx->profile != FF_PROFILE_UNKNOWN)
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;
+ else if (avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
+ avctx->pix_fmt == AV_PIX_FMT_YUV444P10)
+ avctx->profile = enccfg.g_profile = FF_PROFILE_AV1_HIGH;
else {
- const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
- if (desc->comp[0].depth < 12)
- avctx->profile = enccfg.g_profile = FF_PROFILE_AV1_HIGH;
- else
- avctx->profile = enccfg.g_profile = FF_PROFILE_AV1_PROFESSIONAL;
+ avctx->profile = enccfg.g_profile = FF_PROFILE_AV1_PROFESSIONAL;
}