Skip to content

Commit 109515e

Browse files
committed
lavc/vaapi_encode: enable 8bit 4:4:4 encoding for HEVC and VP9
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.
1 parent 737298b commit 109515e

File tree

5 files changed

+7
-2
lines changed

5 files changed

+7
-2
lines changed

Changelog

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ version <next>:
88
- ffmpeg now requires threading to be built
99
- ffmpeg now runs every muxer in a separate thread
1010
- Add new mode to cropdetect filter to detect crop-area based on motion vectors and edges
11-
- VAAPI hwaccel for 8bit 444 HEVC and VP9
11+
- VAAPI decoding and encoding for 8bit 444 HEVC and VP9
1212
- WBMP (Wireless Application Protocol Bitmap) image format
1313

1414

libavcodec/vaapi_encode.c

+1
Original file line numberDiff line numberDiff line change
@@ -1308,6 +1308,7 @@ static const VAAPIEncodeRTFormat vaapi_encode_rt_formats[] = {
13081308
{ "YUV422_10", VA_RT_FORMAT_YUV422_10, 10, 3, 1, 0 },
13091309
#endif
13101310
{ "YUV444", VA_RT_FORMAT_YUV444, 8, 3, 0, 0 },
1311+
{ "AYUV", VA_RT_FORMAT_YUV444, 8, 4, 0, 0 },
13111312
{ "YUV411", VA_RT_FORMAT_YUV411, 8, 3, 2, 0 },
13121313
#if VA_CHECK_VERSION(0, 38, 1)
13131314
{ "YUV420_10", VA_RT_FORMAT_YUV420_10BPP, 10, 3, 1, 1 },

libavcodec/vaapi_encode_h265.c

+2
Original file line numberDiff line numberDiff line change
@@ -1278,6 +1278,8 @@ static const VAAPIEncodeProfile vaapi_encode_h265_profiles[] = {
12781278
#if VA_CHECK_VERSION(1, 2, 0)
12791279
{ FF_PROFILE_HEVC_REXT, 8, 3, 1, 0, VAProfileHEVCMain422_10 },
12801280
{ FF_PROFILE_HEVC_REXT, 10, 3, 1, 0, VAProfileHEVCMain422_10 },
1281+
// Four channels because this uses the AYUV format which has Alpha
1282+
{ FF_PROFILE_HEVC_REXT, 8, 4, 0, 0, VAProfileHEVCMain444 },
12811283
#endif
12821284
{ FF_PROFILE_UNKNOWN }
12831285
};

libavcodec/vaapi_encode_vp9.c

+2
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ static av_cold int vaapi_encode_vp9_configure(AVCodecContext *avctx)
228228

229229
static const VAAPIEncodeProfile vaapi_encode_vp9_profiles[] = {
230230
{ FF_PROFILE_VP9_0, 8, 3, 1, 1, VAProfileVP9Profile0 },
231+
// Four channels because this uses the AYUV format which has Alpha
232+
{ FF_PROFILE_VP9_1, 8, 4, 0, 0, VAProfileVP9Profile1 },
231233
{ FF_PROFILE_VP9_2, 10, 3, 1, 1, VAProfileVP9Profile2 },
232234
{ FF_PROFILE_UNKNOWN }
233235
};

libavcodec/version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "version_major.h"
3131

3232
#define LIBAVCODEC_VERSION_MINOR 42
33-
#define LIBAVCODEC_VERSION_MICRO 100
33+
#define LIBAVCODEC_VERSION_MICRO 101
3434

3535
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
3636
LIBAVCODEC_VERSION_MINOR, \

0 commit comments

Comments
 (0)