diff mbox series

[FFmpeg-devel,v5,1/2] vaapi: support VAProfileH264High10 decoding

Message ID 20230331115406.279001-1-jianfeng.zheng@mthreads.com
State Accepted
Commit 1cd5a383d49f94b05699b234b0d3c98f2969b810
Headers show
Series [FFmpeg-devel,v5,1/2] vaapi: support VAProfileH264High10 decoding | expand

Checks

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

Commit Message

Jianfeng Zheng March 31, 2023, 11:54 a.m. UTC
see https://github.com/intel/libva/pull/664

Signed-off-by: jianfeng.zheng <jianfeng.zheng@mthreads.com>
---
 libavcodec/h264_slice.c   | 9 ++++++++-
 libavcodec/vaapi_decode.c | 5 +++++
 2 files changed, 13 insertions(+), 1 deletion(-)

Comments

Xiang, Haihao April 6, 2023, 7:06 a.m. UTC | #1
On Vr, 2023-03-31 at 19:54 +0800, jianfeng.zheng wrote:
> see https://github.com/intel/libva/pull/664
> 
> Signed-off-by: jianfeng.zheng <jianfeng.zheng@mthreads.com>
> ---
>  libavcodec/h264_slice.c   | 9 ++++++++-
>  libavcodec/vaapi_decode.c | 5 +++++
>  2 files changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
> index 7767e16cf1..d05b83a121 100644
> --- a/libavcodec/h264_slice.c
> +++ b/libavcodec/h264_slice.c
> @@ -809,8 +809,15 @@ static enum AVPixelFormat get_pixel_format(H264Context
> *h, int force_callback)
>                  *fmt++ = AV_PIX_FMT_YUV444P10;
>          } else if (CHROMA422(h))
>              *fmt++ = AV_PIX_FMT_YUV422P10;
> -        else
> +        else {
> +#if CONFIG_H264_VAAPI_HWACCEL
> +            // Just add as candidate. Whether VAProfileH264High10 usable or
> +            // not is decided by vaapi_decode_make_config() defined in FFmpeg
> +            // and vaQueryCodingProfile() defined in libva.
> +            *fmt++ = AV_PIX_FMT_VAAPI;
> +#endif
>              *fmt++ = AV_PIX_FMT_YUV420P10;
> +        }
>          break;
>      case 12:
>          if (CHROMA444(h)) {
> diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
> index ab8c12e364..dd55cbd6f1 100644
> --- a/libavcodec/vaapi_decode.c
> +++ b/libavcodec/vaapi_decode.c
> @@ -398,6 +398,11 @@ static const struct {
>      MAP(MPEG4,       MPEG4_ADVANCED_SIMPLE,
>                                 MPEG4AdvancedSimple),
>      MAP(MPEG4,       MPEG4_MAIN,      MPEG4Main   ),
> +#if VA_CHECK_VERSION(1, 18, 0)
> +    MAP(H264,        H264_HIGH_10_INTRA,
> +                                      H264High10  ),
> +    MAP(H264,        H264_HIGH_10,    H264High10  ),
> +#endif
>      MAP(H264,        H264_CONSTRAINED_BASELINE,
>                             H264ConstrainedBaseline),
>      MAP(H264,        H264_MAIN,       H264Main    ),

Pathset LGTM, but I wonder high 10 and high 10 intra are supported for decoding
however only high 10 is supported for encoding. does high 10 intra not work as
expected for encoding ? 

Thanks
Haihao
Jianfeng Zheng April 6, 2023, 7:26 a.m. UTC | #2
Hi Haihao,

I think high10 intra encoding would also be supported as well. But I
havn't made strict
test. It could be opened as well in an additional patch after some more test.

Thanks
Jianfeng

Xiang, Haihao <haihao.xiang-at-intel.com@ffmpeg.org> 于2023年4月6日周四 15:12写道:
>
> On Vr, 2023-03-31 at 19:54 +0800, jianfeng.zheng wrote:
> > see https://github.com/intel/libva/pull/664
> >
> > Signed-off-by: jianfeng.zheng <jianfeng.zheng@mthreads.com>
> > ---
> >  libavcodec/h264_slice.c   | 9 ++++++++-
> >  libavcodec/vaapi_decode.c | 5 +++++
> >  2 files changed, 13 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
> > index 7767e16cf1..d05b83a121 100644
> > --- a/libavcodec/h264_slice.c
> > +++ b/libavcodec/h264_slice.c
> > @@ -809,8 +809,15 @@ static enum AVPixelFormat get_pixel_format(H264Context
> > *h, int force_callback)
> >                  *fmt++ = AV_PIX_FMT_YUV444P10;
> >          } else if (CHROMA422(h))
> >              *fmt++ = AV_PIX_FMT_YUV422P10;
> > -        else
> > +        else {
> > +#if CONFIG_H264_VAAPI_HWACCEL
> > +            // Just add as candidate. Whether VAProfileH264High10 usable or
> > +            // not is decided by vaapi_decode_make_config() defined in FFmpeg
> > +            // and vaQueryCodingProfile() defined in libva.
> > +            *fmt++ = AV_PIX_FMT_VAAPI;
> > +#endif
> >              *fmt++ = AV_PIX_FMT_YUV420P10;
> > +        }
> >          break;
> >      case 12:
> >          if (CHROMA444(h)) {
> > diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
> > index ab8c12e364..dd55cbd6f1 100644
> > --- a/libavcodec/vaapi_decode.c
> > +++ b/libavcodec/vaapi_decode.c
> > @@ -398,6 +398,11 @@ static const struct {
> >      MAP(MPEG4,       MPEG4_ADVANCED_SIMPLE,
> >                                 MPEG4AdvancedSimple),
> >      MAP(MPEG4,       MPEG4_MAIN,      MPEG4Main   ),
> > +#if VA_CHECK_VERSION(1, 18, 0)
> > +    MAP(H264,        H264_HIGH_10_INTRA,
> > +                                      H264High10  ),
> > +    MAP(H264,        H264_HIGH_10,    H264High10  ),
> > +#endif
> >      MAP(H264,        H264_CONSTRAINED_BASELINE,
> >                             H264ConstrainedBaseline),
> >      MAP(H264,        H264_MAIN,       H264Main    ),
>
> Pathset LGTM, but I wonder high 10 and high 10 intra are supported for decoding
> however only high 10 is supported for encoding. does high 10 intra not work as
> expected for encoding ?
>
> Thanks
> Haihao
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Xiang, Haihao April 12, 2023, 3:08 a.m. UTC | #3
On Do, 2023-04-06 at 15:26 +0800, Jianfeng Zheng wrote:
> Hi Haihao,
> 
> I think high10 intra encoding would also be supported as well. But I
> havn't made strict
> test. It could be opened as well in an additional patch after some more test.

It is fine for me. I'll push this patchset if no more comments.

Thanks
Haihao

> 
> Thanks
> Jianfeng
> 
> Xiang, Haihao <haihao.xiang-at-intel.com@ffmpeg.org> 于2023年4月6日周四 15:12写道:
> > 
> > On Vr, 2023-03-31 at 19:54 +0800, jianfeng.zheng wrote:
> > > see https://github.com/intel/libva/pull/664
> > > 
> > > Signed-off-by: jianfeng.zheng <jianfeng.zheng@mthreads.com>
> > > ---
> > >  libavcodec/h264_slice.c   | 9 ++++++++-
> > >  libavcodec/vaapi_decode.c | 5 +++++
> > >  2 files changed, 13 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
> > > index 7767e16cf1..d05b83a121 100644
> > > --- a/libavcodec/h264_slice.c
> > > +++ b/libavcodec/h264_slice.c
> > > @@ -809,8 +809,15 @@ static enum AVPixelFormat
> > > get_pixel_format(H264Context
> > > *h, int force_callback)
> > >                  *fmt++ = AV_PIX_FMT_YUV444P10;
> > >          } else if (CHROMA422(h))
> > >              *fmt++ = AV_PIX_FMT_YUV422P10;
> > > -        else
> > > +        else {
> > > +#if CONFIG_H264_VAAPI_HWACCEL
> > > +            // Just add as candidate. Whether VAProfileH264High10 usable
> > > or
> > > +            // not is decided by vaapi_decode_make_config() defined in
> > > FFmpeg
> > > +            // and vaQueryCodingProfile() defined in libva.
> > > +            *fmt++ = AV_PIX_FMT_VAAPI;
> > > +#endif
> > >              *fmt++ = AV_PIX_FMT_YUV420P10;
> > > +        }
> > >          break;
> > >      case 12:
> > >          if (CHROMA444(h)) {
> > > diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
> > > index ab8c12e364..dd55cbd6f1 100644
> > > --- a/libavcodec/vaapi_decode.c
> > > +++ b/libavcodec/vaapi_decode.c
> > > @@ -398,6 +398,11 @@ static const struct {
> > >      MAP(MPEG4,       MPEG4_ADVANCED_SIMPLE,
> > >                                 MPEG4AdvancedSimple),
> > >      MAP(MPEG4,       MPEG4_MAIN,      MPEG4Main   ),
> > > +#if VA_CHECK_VERSION(1, 18, 0)
> > > +    MAP(H264,        H264_HIGH_10_INTRA,
> > > +                                      H264High10  ),
> > > +    MAP(H264,        H264_HIGH_10,    H264High10  ),
> > > +#endif
> > >      MAP(H264,        H264_CONSTRAINED_BASELINE,
> > >                             H264ConstrainedBaseline),
> > >      MAP(H264,        H264_MAIN,       H264Main    ),
> > 
> > Pathset LGTM, but I wonder high 10 and high 10 intra are supported for
> > decoding
> > however only high 10 is supported for encoding. does high 10 intra not work
> > as
> > expected for encoding ?
> > 
> > Thanks
> > Haihao
> > 
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > 
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Xiang, Haihao April 17, 2023, 7:12 a.m. UTC | #4
On Wo, 2023-04-12 at 03:08 +0000, Xiang, Haihao wrote:
> On Do, 2023-04-06 at 15:26 +0800, Jianfeng Zheng wrote:
> > Hi Haihao,
> > 
> > I think high10 intra encoding would also be supported as well. But I
> > havn't made strict
> > test. It could be opened as well in an additional patch after some more
> > test.
> 
> It is fine for me. I'll push this patchset if no more comments.
> 

Pushed, thx

- Haihao


> 
> > 
> > Thanks
> > Jianfeng
> > 
> > Xiang, Haihao <haihao.xiang-at-intel.com@ffmpeg.org> 于2023年4月6日周四 15:12写道:
> > > 
> > > On Vr, 2023-03-31 at 19:54 +0800, jianfeng.zheng wrote:
> > > > see https://github.com/intel/libva/pull/664
> > > > 
> > > > Signed-off-by: jianfeng.zheng <jianfeng.zheng@mthreads.com>
> > > > ---
> > > >  libavcodec/h264_slice.c   | 9 ++++++++-
> > > >  libavcodec/vaapi_decode.c | 5 +++++
> > > >  2 files changed, 13 insertions(+), 1 deletion(-)
> > > > 
> > > > diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
> > > > index 7767e16cf1..d05b83a121 100644
> > > > --- a/libavcodec/h264_slice.c
> > > > +++ b/libavcodec/h264_slice.c
> > > > @@ -809,8 +809,15 @@ static enum AVPixelFormat
> > > > get_pixel_format(H264Context
> > > > *h, int force_callback)
> > > >                  *fmt++ = AV_PIX_FMT_YUV444P10;
> > > >          } else if (CHROMA422(h))
> > > >              *fmt++ = AV_PIX_FMT_YUV422P10;
> > > > -        else
> > > > +        else {
> > > > +#if CONFIG_H264_VAAPI_HWACCEL
> > > > +            // Just add as candidate. Whether VAProfileH264High10
> > > > usable
> > > > or
> > > > +            // not is decided by vaapi_decode_make_config() defined in
> > > > FFmpeg
> > > > +            // and vaQueryCodingProfile() defined in libva.
> > > > +            *fmt++ = AV_PIX_FMT_VAAPI;
> > > > +#endif
> > > >              *fmt++ = AV_PIX_FMT_YUV420P10;
> > > > +        }
> > > >          break;
> > > >      case 12:
> > > >          if (CHROMA444(h)) {
> > > > diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
> > > > index ab8c12e364..dd55cbd6f1 100644
> > > > --- a/libavcodec/vaapi_decode.c
> > > > +++ b/libavcodec/vaapi_decode.c
> > > > @@ -398,6 +398,11 @@ static const struct {
> > > >      MAP(MPEG4,       MPEG4_ADVANCED_SIMPLE,
> > > >                                 MPEG4AdvancedSimple),
> > > >      MAP(MPEG4,       MPEG4_MAIN,      MPEG4Main   ),
> > > > +#if VA_CHECK_VERSION(1, 18, 0)
> > > > +    MAP(H264,        H264_HIGH_10_INTRA,
> > > > +                                      H264High10  ),
> > > > +    MAP(H264,        H264_HIGH_10,    H264High10  ),
> > > > +#endif
> > > >      MAP(H264,        H264_CONSTRAINED_BASELINE,
> > > >                             H264ConstrainedBaseline),
> > > >      MAP(H264,        H264_MAIN,       H264Main    ),
> > > 
> > > Pathset LGTM, but I wonder high 10 and high 10 intra are supported for
> > > decoding
> > > however only high 10 is supported for encoding. does high 10 intra not
> > > work
> > > as
> > > expected for encoding ?
> > > 
> > > Thanks
> > > Haihao
> > > 
> > > _______________________________________________
> > > ffmpeg-devel mailing list
> > > ffmpeg-devel@ffmpeg.org
> > > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > > 
> > > To unsubscribe, visit link above, or email
> > > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > 
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 7767e16cf1..d05b83a121 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -809,8 +809,15 @@  static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback)
                 *fmt++ = AV_PIX_FMT_YUV444P10;
         } else if (CHROMA422(h))
             *fmt++ = AV_PIX_FMT_YUV422P10;
-        else
+        else {
+#if CONFIG_H264_VAAPI_HWACCEL
+            // Just add as candidate. Whether VAProfileH264High10 usable or
+            // not is decided by vaapi_decode_make_config() defined in FFmpeg
+            // and vaQueryCodingProfile() defined in libva.
+            *fmt++ = AV_PIX_FMT_VAAPI;
+#endif
             *fmt++ = AV_PIX_FMT_YUV420P10;
+        }
         break;
     case 12:
         if (CHROMA444(h)) {
diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index ab8c12e364..dd55cbd6f1 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -398,6 +398,11 @@  static const struct {
     MAP(MPEG4,       MPEG4_ADVANCED_SIMPLE,
                                MPEG4AdvancedSimple),
     MAP(MPEG4,       MPEG4_MAIN,      MPEG4Main   ),
+#if VA_CHECK_VERSION(1, 18, 0)
+    MAP(H264,        H264_HIGH_10_INTRA,
+                                      H264High10  ),
+    MAP(H264,        H264_HIGH_10,    H264High10  ),
+#endif
     MAP(H264,        H264_CONSTRAINED_BASELINE,
                            H264ConstrainedBaseline),
     MAP(H264,        H264_MAIN,       H264Main    ),