@@ -1308,6 +1308,7 @@ static const VAAPIEncodeRTFormat vaapi_encode_rt_formats[] = {
{ "YUV422_10", VA_RT_FORMAT_YUV422_10, 10, 3, 1, 0 },
#endif
{ "YUV444", VA_RT_FORMAT_YUV444, 8, 3, 0, 0 },
+ { "AYUV", VA_RT_FORMAT_YUV444, 8, 4, 0, 0 },
{ "YUV411", VA_RT_FORMAT_YUV411, 8, 3, 2, 0 },
#if VA_CHECK_VERSION(0, 38, 1)
{ "YUV420_10", VA_RT_FORMAT_YUV420_10BPP, 10, 3, 1, 1 },
@@ -1278,6 +1278,8 @@ static const VAAPIEncodeProfile vaapi_encode_h265_profiles[] = {
#if VA_CHECK_VERSION(1, 2, 0)
{ FF_PROFILE_HEVC_REXT, 8, 3, 1, 0, VAProfileHEVCMain422_10 },
{ FF_PROFILE_HEVC_REXT, 10, 3, 1, 0, VAProfileHEVCMain422_10 },
+ // Four channels because this uses the AYUV format which has Alpha
+ { FF_PROFILE_HEVC_REXT, 8, 4, 0, 0, VAProfileHEVCMain444 },
#endif
{ FF_PROFILE_UNKNOWN }
};
@@ -228,6 +228,8 @@ static av_cold int vaapi_encode_vp9_configure(AVCodecContext *avctx)
static const VAAPIEncodeProfile vaapi_encode_vp9_profiles[] = {
{ FF_PROFILE_VP9_0, 8, 3, 1, 1, VAProfileVP9Profile0 },
+ // Four channels because this uses the AYUV format which has Alpha
+ { FF_PROFILE_VP9_1, 8, 4, 0, 0, VAProfileVP9Profile1 },
{ FF_PROFILE_VP9_2, 10, 3, 1, 1, VAProfileVP9Profile2 },
{ FF_PROFILE_UNKNOWN }
};
Sufficiently recent Intel hardware is able to do encoding of 8bit 4:4:4 content in HEVC and VP9. The main requirement here is that the frames must be provided in the AYUV format. Enabling support is done by adding the appropriate encoding profiles and noting that AYUV is officially a four channel format with alpha so we must state that we expect all four channels. Also, there are currently very limited ways to get data into the right format. While our VUYA format exists, someone still has to write the swscale code to be able to convert to it. Without that, you're stuck only able to encode frames that came out of the vaapi decoder in the right format. Signed-off-by: Philip Langdale <philipl@overt.org> --- libavcodec/vaapi_encode.c | 1 + libavcodec/vaapi_encode_h265.c | 2 ++ libavcodec/vaapi_encode_vp9.c | 2 ++ 3 files changed, 5 insertions(+)