diff mbox series

[FFmpeg-devel,09/16] lavc/hevcdec: support all color formats in videotoolbox hwaccel

Message ID 20211122205330.43546-9-rcombs@rcombs.me
State New
Headers show
Series [FFmpeg-devel,01/16] ffmpeg: remove ffmpeg_videotoolbox
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

rcombs Nov. 22, 2021, 8:53 p.m. UTC
---
 libavcodec/hevcdec.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

James Almer Nov. 22, 2021, 9:04 p.m. UTC | #1
On 11/22/2021 5:53 PM, rcombs wrote:
> ---
>   libavcodec/hevcdec.c | 10 ++++------
>   1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
> index 3e19f4ebed..47c551237f 100644
> --- a/libavcodec/hevcdec.c
> +++ b/libavcodec/hevcdec.c
> @@ -401,6 +401,10 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
>                        CONFIG_HEVC_VDPAU_HWACCEL)
>       enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts;
>   
> +#if CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL
> +        *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;

Same, I'd rather keep the lines below and add one per new supported 
bitdepth.

> +#endif
> +
>       switch (sps->pix_fmt) {
>       case AV_PIX_FMT_YUV420P:
>       case AV_PIX_FMT_YUVJ420P:
> @@ -419,9 +423,6 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
>   #endif
>   #if CONFIG_HEVC_NVDEC_HWACCEL
>           *fmt++ = AV_PIX_FMT_CUDA;
> -#endif
> -#if CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL
> -        *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
>   #endif
>           break;
>       case AV_PIX_FMT_YUV420P10:
> @@ -435,9 +436,6 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
>   #if CONFIG_HEVC_VAAPI_HWACCEL
>           *fmt++ = AV_PIX_FMT_VAAPI;
>   #endif
> -#if CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL
> -        *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
> -#endif
>   #if CONFIG_HEVC_VDPAU_HWACCEL
>           *fmt++ = AV_PIX_FMT_VDPAU;
>   #endif
>
diff mbox series

Patch

diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 3e19f4ebed..47c551237f 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -401,6 +401,10 @@  static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
                      CONFIG_HEVC_VDPAU_HWACCEL)
     enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts;
 
+#if CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL
+        *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
+#endif
+
     switch (sps->pix_fmt) {
     case AV_PIX_FMT_YUV420P:
     case AV_PIX_FMT_YUVJ420P:
@@ -419,9 +423,6 @@  static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
 #endif
 #if CONFIG_HEVC_NVDEC_HWACCEL
         *fmt++ = AV_PIX_FMT_CUDA;
-#endif
-#if CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL
-        *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
 #endif
         break;
     case AV_PIX_FMT_YUV420P10:
@@ -435,9 +436,6 @@  static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
 #if CONFIG_HEVC_VAAPI_HWACCEL
         *fmt++ = AV_PIX_FMT_VAAPI;
 #endif
-#if CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL
-        *fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
-#endif
 #if CONFIG_HEVC_VDPAU_HWACCEL
         *fmt++ = AV_PIX_FMT_VDPAU;
 #endif