Browse Source

lavc/vaapi: Declare support for decoding 8bit 4:4:4 content

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.
Philip Langdale 2 years ago
parent
commit
d3f48e68b3
5 changed files with 12 additions and 1 deletions
  1. 1 0
      Changelog
  2. 3 0
      libavcodec/hevcdec.c
  3. 2 0
      libavcodec/vaapi_decode.c
  4. 1 1
      libavcodec/version.h
  5. 5 0
      libavcodec/vp9.c

+ 1 - 0
Changelog

@@ -8,6 +8,7 @@ version <next>:
 - ffmpeg now requires threading to be built
 - ffmpeg now requires threading to be built
 - ffmpeg now runs every muxer in a separate thread
 - ffmpeg now runs every muxer in a separate thread
 - Add new mode to cropdetect filter to detect crop-area based on motion vectors and edges
 - Add new mode to cropdetect filter to detect crop-area based on motion vectors and edges
+- VAAPI hwaccel for 8bit 444 HEVC and VP9
 
 
 
 
 version 5.1:
 version 5.1:

+ 3 - 0
libavcodec/hevcdec.c

@@ -453,6 +453,9 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
 #endif
 #endif
         break;
         break;
     case AV_PIX_FMT_YUV444P:
     case AV_PIX_FMT_YUV444P:
+#if CONFIG_HEVC_VAAPI_HWACCEL
+        *fmt++ = AV_PIX_FMT_VAAPI;
+#endif
 #if CONFIG_HEVC_VDPAU_HWACCEL
 #if CONFIG_HEVC_VDPAU_HWACCEL
         *fmt++ = AV_PIX_FMT_VDPAU;
         *fmt++ = AV_PIX_FMT_VDPAU;
 #endif
 #endif

+ 2 - 0
libavcodec/vaapi_decode.c

@@ -267,6 +267,7 @@ static const struct {
     MAP(422V, YUV440P),
     MAP(422V, YUV440P),
     // 4:4:4
     // 4:4:4
     MAP(444P, YUV444P),
     MAP(444P, YUV444P),
+    MAP(AYUV, VUYA),
     // 4:2:0 10-bit
     // 4:2:0 10-bit
 #ifdef VA_FOURCC_P010
 #ifdef VA_FOURCC_P010
     MAP(P010, P010),
     MAP(P010, P010),
@@ -410,6 +411,7 @@ static const struct {
     MAP(VP9,         VP9_0,           VP9Profile0 ),
     MAP(VP9,         VP9_0,           VP9Profile0 ),
 #endif
 #endif
 #if VA_CHECK_VERSION(0, 39, 0)
 #if VA_CHECK_VERSION(0, 39, 0)
+    MAP(VP9,         VP9_1,           VP9Profile1 ),
     MAP(VP9,         VP9_2,           VP9Profile2 ),
     MAP(VP9,         VP9_2,           VP9Profile2 ),
 #endif
 #endif
 #if VA_CHECK_VERSION(1, 8, 0)
 #if VA_CHECK_VERSION(1, 8, 0)

+ 1 - 1
libavcodec/version.h

@@ -30,7 +30,7 @@
 #include "version_major.h"
 #include "version_major.h"
 
 
 #define LIBAVCODEC_VERSION_MINOR  41
 #define LIBAVCODEC_VERSION_MINOR  41
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
 
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \
                                                LIBAVCODEC_VERSION_MINOR, \

+ 5 - 0
libavcodec/vp9.c

@@ -232,6 +232,11 @@ static int update_size(AVCodecContext *avctx, int w, int h)
 #endif
 #endif
 #if CONFIG_VP9_VDPAU_HWACCEL
 #if CONFIG_VP9_VDPAU_HWACCEL
             *fmtp++ = AV_PIX_FMT_VDPAU;
             *fmtp++ = AV_PIX_FMT_VDPAU;
+#endif
+            break;
+        case AV_PIX_FMT_YUV444P:
+#if CONFIG_VP9_VAAPI_HWACCEL
+            *fmtp++ = AV_PIX_FMT_VAAPI;
 #endif
 #endif
             break;
             break;
         }
         }