diff mbox series

[FFmpeg-devel,3/3] lavc/vaapi: Declare support for decoding 8bit 4:4:4 content

Message ID 20220723185315.207081-4-philipl@overt.org
State New
Headers show
Series vaapi: Add support for decoding 8bit 4:4:4 content | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Philip Langdale July 23, 2022, 6:53 p.m. UTC
Now that we have a combination of capable hardware (new enough Intel)
and a mutually understood format ("AYUV"), we can declare support for
decoding 8bit 4:4:4 content via VAAPI.

This requires listing AYUV as a supported format, and then adding VAAPI
as a supported hwaccel for the relevant codecs (HEVC and VP9). I also
had to add VP9Profile1 to the set of supported profiles for VAAPI as it
was never relevant before.
---
 Changelog                 | 1 +
 libavcodec/hevcdec.c      | 3 +++
 libavcodec/vaapi_decode.c | 2 ++
 libavcodec/version.h      | 2 +-
 libavcodec/vp9.c          | 5 +++++
 5 files changed, 12 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/Changelog b/Changelog
index 92780c9953..a5539d5ec3 100644
--- a/Changelog
+++ b/Changelog
@@ -7,6 +7,7 @@  version <next>:
 - ffmpeg -shortest_buf_duration option
 - ffmpeg now requires threading to be built
 - ffmpeg now runs every muxer in a separate thread
+- VAAPI hwaccel for 8bit 444 HEVC and VP9
 
 
 version 5.1:
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 2d06d09b75..7070ed3f02 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -452,6 +452,9 @@  static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
 #endif
         break;
     case AV_PIX_FMT_YUV444P:
+#if CONFIG_HEVC_VAAPI_HWACCEL
+        *fmt++ = AV_PIX_FMT_VAAPI;
+#endif
 #if CONFIG_HEVC_VDPAU_HWACCEL
         *fmt++ = AV_PIX_FMT_VDPAU;
 #endif
diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index a7abddb06b..db48efc3ed 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -267,6 +267,7 @@  static const struct {
     MAP(422V, YUV440P),
     // 4:4:4
     MAP(444P, YUV444P),
+    MAP(AYUV, VUYA),
     // 4:2:0 10-bit
 #ifdef VA_FOURCC_P010
     MAP(P010, P010),
@@ -410,6 +411,7 @@  static const struct {
     MAP(VP9,         VP9_0,           VP9Profile0 ),
 #endif
 #if VA_CHECK_VERSION(0, 39, 0)
+    MAP(VP9,         VP9_1,           VP9Profile1 ),
     MAP(VP9,         VP9_2,           VP9Profile2 ),
 #endif
 #if VA_CHECK_VERSION(1, 8, 0)
diff --git a/libavcodec/version.h b/libavcodec/version.h
index f2f14eaed1..ecdbc51c74 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -30,7 +30,7 @@ 
 #include "version_major.h"
 
 #define LIBAVCODEC_VERSION_MINOR  39
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 12ec87992c..834fbebb01 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -231,6 +231,11 @@  static int update_size(AVCodecContext *avctx, int w, int h)
 #endif
 #if CONFIG_VP9_VDPAU_HWACCEL
             *fmtp++ = AV_PIX_FMT_VDPAU;
+#endif
+            break;
+        case AV_PIX_FMT_YUV444P:
+#if CONFIG_VP9_VAAPI_HWACCEL
+            *fmtp++ = AV_PIX_FMT_VAAPI;
 #endif
             break;
         }