diff mbox series

[FFmpeg-devel,v2,09/13] lavc/vaapi_hevc: Add vaapi profile parse support for SCC

Message ID 20221205060929.2511871-9-fei.w.wang@intel.com
State New
Headers show
Series [FFmpeg-devel,v2,01/13] lavc/hevc_ps: remove profile limitation of pps_range_extensions() | 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

Wang, Fei W Dec. 5, 2022, 6:09 a.m. UTC
From: Linjie Fu <linjie.fu@intel.com>

Note that Screen-Extended Main 4:4:4 and 4:4:4 10 supports
chroma_format_idc from 0, 1 or 3, hence both 420 and 444 are
supported.

Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
---
 libavcodec/vaapi_decode.c |  4 +++-
 libavcodec/vaapi_hevc.c   | 14 ++++++++++++--
 libavcodec/vaapi_hevc.h   |  2 +-
 3 files changed, 16 insertions(+), 4 deletions(-)

Comments

Xiang, Haihao Jan. 3, 2023, 7:08 a.m. UTC | #1
On Ma, 2022-12-05 at 14:09 +0800, Fei Wang wrote:
> From: Linjie Fu <linjie.fu@intel.com>
> 
> Note that Screen-Extended Main 4:4:4 and 4:4:4 10 supports
> chroma_format_idc from 0, 1 or 3, hence both 420 and 444 are
> supported.
> 
> Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
> Signed-off-by: Fei Wang <fei.w.wang@intel.com>
> ---
>  libavcodec/vaapi_decode.c |  4 +++-
>  libavcodec/vaapi_hevc.c   | 14 ++++++++++++--
>  libavcodec/vaapi_hevc.h   |  2 +-
>  3 files changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
> index 134f10eca5..29ac439b36 100644
> --- a/libavcodec/vaapi_decode.c
> +++ b/libavcodec/vaapi_decode.c
> @@ -410,7 +410,9 @@ static const struct {
>  #endif
>  #if VA_CHECK_VERSION(1, 2, 0) && CONFIG_HEVC_VAAPI_HWACCEL
>      MAP(HEVC,        HEVC_REXT,       None,
> -                 ff_vaapi_parse_hevc_rext_profile ),
> +                 ff_vaapi_parse_hevc_profile ),
> +    MAP(HEVC,        HEVC_SCC,        None,
> +                 ff_vaapi_parse_hevc_profile ),
>  #endif
>      MAP(MJPEG,       MJPEG_HUFFMAN_BASELINE_DCT,
>                                        JPEGBaseline),
> diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c
> index 750738d36e..6ce1e17fa8 100644
> --- a/libavcodec/vaapi_hevc.c
> +++ b/libavcodec/vaapi_hevc.c
> @@ -586,9 +586,9 @@ static int ptl_convert(const PTLCommon *general_ptl,
> H265RawProfileTierLevel *h2
>  }
>  
>  /*
> - * Find exact va_profile for HEVC Range Extension
> + * Find exact va_profile for HEVC Range Extension and Screen Content Coding
> Extension
>   */
> -VAProfile ff_vaapi_parse_hevc_rext_profile(AVCodecContext *avctx)
> +VAProfile ff_vaapi_parse_hevc_profile(AVCodecContext *avctx)

It sounds to me the new function is for all hevc profiles, how about to use
ff_vaapi_parse_hevc_rext_scc_profile instead ? 

Thanks
Haihao


> @@ -627,6 +627,16 @@ VAProfile ff_vaapi_parse_hevc_rext_profile(AVCodecContext
> *avctx)
>      else if (!strcmp(profile->name, "Main 4:4:4 12") ||
>               !strcmp(profile->name, "Main 4:4:4 12 Intra"))
>          return VAProfileHEVCMain444_12;
> +    else if (!strcmp(profile->name, "Screen-Extended Main"))
> +        return VAProfileHEVCSccMain;
> +    else if (!strcmp(profile->name, "Screen-Extended Main 10"))
> +        return VAProfileHEVCSccMain10;
> +    else if (!strcmp(profile->name, "Screen-Extended Main 4:4:4"))
> +        return VAProfileHEVCSccMain444;
> +#if VA_CHECK_VERSION(1, 8, 0)
> +    else if (!strcmp(profile->name, "Screen-Extended Main 4:4:4 10"))
> +        return VAProfileHEVCSccMain444_10;
> +#endif
>  #else
>      av_log(avctx, AV_LOG_WARNING, "HEVC profile %s is "
>             "not supported with this VA version.\n", profile->name);
> diff --git a/libavcodec/vaapi_hevc.h b/libavcodec/vaapi_hevc.h
> index b3b0e6fc1e..7662dca510 100644
> --- a/libavcodec/vaapi_hevc.h
> +++ b/libavcodec/vaapi_hevc.h
> @@ -22,6 +22,6 @@
>  #include <va/va.h>
>  #include "avcodec.h"
>  
> -VAProfile ff_vaapi_parse_hevc_rext_profile(AVCodecContext *avctx);
> +VAProfile ff_vaapi_parse_hevc_profile(AVCodecContext *avctx);
>  
>  #endif /* AVCODEC_VAAPI_HEVC_H */
Wang, Fei W Jan. 3, 2023, 1:01 p.m. UTC | #2
On Tue, 2023-01-03 at 07:08 +0000, Xiang, Haihao wrote:
> On Ma, 2022-12-05 at 14:09 +0800, Fei Wang wrote:
> > From: Linjie Fu <linjie.fu@intel.com>
> > 
> > Note that Screen-Extended Main 4:4:4 and 4:4:4 10 supports
> > chroma_format_idc from 0, 1 or 3, hence both 420 and 444 are
> > supported.
> > 
> > Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
> > Signed-off-by: Fei Wang <fei.w.wang@intel.com>
> > ---
> >  libavcodec/vaapi_decode.c |  4 +++-
> >  libavcodec/vaapi_hevc.c   | 14 ++++++++++++--
> >  libavcodec/vaapi_hevc.h   |  2 +-
> >  3 files changed, 16 insertions(+), 4 deletions(-)
> > 
> > diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
> > index 134f10eca5..29ac439b36 100644
> > --- a/libavcodec/vaapi_decode.c
> > +++ b/libavcodec/vaapi_decode.c
> > @@ -410,7 +410,9 @@ static const struct {
> >  #endif
> >  #if VA_CHECK_VERSION(1, 2, 0) && CONFIG_HEVC_VAAPI_HWACCEL
> >      MAP(HEVC,        HEVC_REXT,       None,
> > -                 ff_vaapi_parse_hevc_rext_profile ),
> > +                 ff_vaapi_parse_hevc_profile ),
> > +    MAP(HEVC,        HEVC_SCC,        None,
> > +                 ff_vaapi_parse_hevc_profile ),
> >  #endif
> >      MAP(MJPEG,       MJPEG_HUFFMAN_BASELINE_DCT,
> >                                        JPEGBaseline),
> > diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c
> > index 750738d36e..6ce1e17fa8 100644
> > --- a/libavcodec/vaapi_hevc.c
> > +++ b/libavcodec/vaapi_hevc.c
> > @@ -586,9 +586,9 @@ static int ptl_convert(const PTLCommon
> > *general_ptl,
> > H265RawProfileTierLevel *h2
> >  }
> >  
> >  /*
> > - * Find exact va_profile for HEVC Range Extension
> > + * Find exact va_profile for HEVC Range Extension and Screen
> > Content Coding
> > Extension
> >   */
> > -VAProfile ff_vaapi_parse_hevc_rext_profile(AVCodecContext *avctx)
> > +VAProfile ff_vaapi_parse_hevc_profile(AVCodecContext *avctx)
> 
> It sounds to me the new function is for all hevc profiles, how about
> to use
> ff_vaapi_parse_hevc_rext_scc_profile instead ? 

Fixed in V3. Thanks.

Fei

> 
> Thanks
> Haihao
> 
> 
> > @@ -627,6 +627,16 @@ VAProfile
> > ff_vaapi_parse_hevc_rext_profile(AVCodecContext
> > *avctx)
> >      else if (!strcmp(profile->name, "Main 4:4:4 12") ||
> >               !strcmp(profile->name, "Main 4:4:4 12 Intra"))
> >          return VAProfileHEVCMain444_12;
> > +    else if (!strcmp(profile->name, "Screen-Extended Main"))
> > +        return VAProfileHEVCSccMain;
> > +    else if (!strcmp(profile->name, "Screen-Extended Main 10"))
> > +        return VAProfileHEVCSccMain10;
> > +    else if (!strcmp(profile->name, "Screen-Extended Main 4:4:4"))
> > +        return VAProfileHEVCSccMain444;
> > +#if VA_CHECK_VERSION(1, 8, 0)
> > +    else if (!strcmp(profile->name, "Screen-Extended Main 4:4:4
> > 10"))
> > +        return VAProfileHEVCSccMain444_10;
> > +#endif
> >  #else
> >      av_log(avctx, AV_LOG_WARNING, "HEVC profile %s is "
> >             "not supported with this VA version.\n", profile-
> > >name);
> > diff --git a/libavcodec/vaapi_hevc.h b/libavcodec/vaapi_hevc.h
> > index b3b0e6fc1e..7662dca510 100644
> > --- a/libavcodec/vaapi_hevc.h
> > +++ b/libavcodec/vaapi_hevc.h
> > @@ -22,6 +22,6 @@
> >  #include <va/va.h>
> >  #include "avcodec.h"
> >  
> > -VAProfile ff_vaapi_parse_hevc_rext_profile(AVCodecContext *avctx);
> > +VAProfile ff_vaapi_parse_hevc_profile(AVCodecContext *avctx);
> >  
> >  #endif /* AVCODEC_VAAPI_HEVC_H */
diff mbox series

Patch

diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index 134f10eca5..29ac439b36 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -410,7 +410,9 @@  static const struct {
 #endif
 #if VA_CHECK_VERSION(1, 2, 0) && CONFIG_HEVC_VAAPI_HWACCEL
     MAP(HEVC,        HEVC_REXT,       None,
-                 ff_vaapi_parse_hevc_rext_profile ),
+                 ff_vaapi_parse_hevc_profile ),
+    MAP(HEVC,        HEVC_SCC,        None,
+                 ff_vaapi_parse_hevc_profile ),
 #endif
     MAP(MJPEG,       MJPEG_HUFFMAN_BASELINE_DCT,
                                       JPEGBaseline),
diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c
index 750738d36e..6ce1e17fa8 100644
--- a/libavcodec/vaapi_hevc.c
+++ b/libavcodec/vaapi_hevc.c
@@ -586,9 +586,9 @@  static int ptl_convert(const PTLCommon *general_ptl, H265RawProfileTierLevel *h2
 }
 
 /*
- * Find exact va_profile for HEVC Range Extension
+ * Find exact va_profile for HEVC Range Extension and Screen Content Coding Extension
  */
-VAProfile ff_vaapi_parse_hevc_rext_profile(AVCodecContext *avctx)
+VAProfile ff_vaapi_parse_hevc_profile(AVCodecContext *avctx)
 {
     const HEVCContext *h = avctx->priv_data;
     const HEVCSPS *sps = h->ps.sps;
@@ -627,6 +627,16 @@  VAProfile ff_vaapi_parse_hevc_rext_profile(AVCodecContext *avctx)
     else if (!strcmp(profile->name, "Main 4:4:4 12") ||
              !strcmp(profile->name, "Main 4:4:4 12 Intra"))
         return VAProfileHEVCMain444_12;
+    else if (!strcmp(profile->name, "Screen-Extended Main"))
+        return VAProfileHEVCSccMain;
+    else if (!strcmp(profile->name, "Screen-Extended Main 10"))
+        return VAProfileHEVCSccMain10;
+    else if (!strcmp(profile->name, "Screen-Extended Main 4:4:4"))
+        return VAProfileHEVCSccMain444;
+#if VA_CHECK_VERSION(1, 8, 0)
+    else if (!strcmp(profile->name, "Screen-Extended Main 4:4:4 10"))
+        return VAProfileHEVCSccMain444_10;
+#endif
 #else
     av_log(avctx, AV_LOG_WARNING, "HEVC profile %s is "
            "not supported with this VA version.\n", profile->name);
diff --git a/libavcodec/vaapi_hevc.h b/libavcodec/vaapi_hevc.h
index b3b0e6fc1e..7662dca510 100644
--- a/libavcodec/vaapi_hevc.h
+++ b/libavcodec/vaapi_hevc.h
@@ -22,6 +22,6 @@ 
 #include <va/va.h>
 #include "avcodec.h"
 
-VAProfile ff_vaapi_parse_hevc_rext_profile(AVCodecContext *avctx);
+VAProfile ff_vaapi_parse_hevc_profile(AVCodecContext *avctx);
 
 #endif /* AVCODEC_VAAPI_HEVC_H */