Skip to content
Permalink
Browse files

hevcenc: add hevc encoding support

1. Support I/P/B frames

2. Let cu_size equal to 32, to support level 5.1

3. libva driver requred pic_width_in_luma_samples 16 aligned, not ctb
aligned

Signed-off-by: Zhong Li <zhong.li@intel.com>
  • Loading branch information
lizhong1008 committed Sep 16, 2015
1 parent d9759e4 commit bb75c8d35ded275b7511d70913683f77b83278d2
@@ -204,6 +204,12 @@ AC_DEFINE([__BUILD_GET_MV__], [1], [Defined to 1 if --enable-getmv="yes" ])
fi
AM_CONDITIONAL(BUILD_GET_MV, test "x$enable_getmv" = "xyes")

dnl hevc encoder
AC_ARG_ENABLE(hevcenc,
[AC_HELP_STRING([--enable-hevcenc], [build with hevc encoder support @<:@default=no@:>@])],
[], [enable_h264enc="no"])
AM_CONDITIONAL(BUILD_HEVC_ENCODER, test "x$enable_hevcenc" = "xyes")

# dnl Doxygen
AC_ARG_ENABLE(docs,
[AC_HELP_STRING([--enable-docs], [build with doxygen support @<:@default=yes@:>@])],
@@ -22,6 +22,11 @@ endif
if BUILD_VP8_ENCODER
libyami_encoder_source_c += vaapiencoder_vp8.cpp
endif

if BUILD_HEVC_ENCODER
libyami_encoder_source_c += vaapiencoder_hevc.cpp
endif

libyami_encoder_source_h = \
../interface/VideoCommonDefs.h \
../interface/VideoEncoderDefs.h \
@@ -46,6 +51,12 @@ endif
if BUILD_VP8_ENCODER
libyami_encoder_source_h_priv += vaapiencoder_vp8.h
endif

if BUILD_HEVC_ENCODER
libyami_encoder_source_h_priv += vaapiencoder_hevc.h
endif


libyami_encoder_la_LIBADD = \
$(top_builddir)/common/libyami_common.la \
$(top_builddir)/vaapi/libyami_vaapi.la \
@@ -51,6 +51,7 @@ VaapiEncoderBase::VaapiEncoderBase():
m_videoParamCommon.frameRate.frameRateNum = 30;
m_videoParamCommon.frameRate.frameRateDenom = 1;
m_videoParamCommon.intraPeriod = 15;
m_videoParamCommon.ipPeriod = 1;
m_videoParamCommon.rcMode = RATE_CONTROL_CQP;
m_videoParamCommon.rcParams.initQP = 26;
m_videoParamCommon.rcParams.minQP = 1;
@@ -388,6 +389,8 @@ const ProfileMapItem g_profileMap[] =
{VAAPI_PROFILE_H264_MAIN, VAProfileH264Main},
{VAAPI_PROFILE_H264_HIGH,VAProfileH264High},
{VAAPI_PROFILE_JPEG_BASELINE,VAProfileJPEGBaseline},
{VAAPI_PROFILE_HEVC_MAIN, VAProfileHEVCMain},
{VAAPI_PROFILE_HEVC_MAIN10, VAProfileHEVCMain10},

This comment has been minimized.

Copy link
@fritsch

fritsch Sep 27, 2015

Which libva version out there does support this?

This comment has been minimized.

Copy link
@lizhong1008

lizhong1008 Sep 28, 2015

Author Contributor

Hi fristch:
You can get libva-1.6.1 and libva-intel-driver 1.6.1 to support VAProfileHEVCMain.

This comment has been minimized.

Copy link
@lizhong1008

lizhong1008 Sep 28, 2015

Author Contributor

Yami encoder can't support VAProfileHEVCMain10 right now.

This comment has been minimized.

Copy link
@fritsch

fritsch Sep 28, 2015

Thank you very much. That basically was my question as I did not see any VAProfileHEVCMain10 encoder nor decoder in the wild. My Braswell Board also does not show the VAProfileHEVCMain encoder capability - only the decoding capability, which works nicely for 8 bit HEVC already only.

So it seems all the HEVC encoding capabilities are not yet in the OSS driver, right? Does that mean HEVCMain enc caps will be coming to the OSS driver soon? Are there any plans to support Main10 HEVC in the future or is this some intel media-sdk special driver which is needed?

Edit: Encode seems SKL only from reading the code.

This comment has been minimized.

Copy link
@lizhong1008

lizhong1008 Sep 28, 2015

Author Contributor

Hi Fritsch:
Braswell can support HEVC 8-bits decoding but don't support HEVC encoding. HEVC encoding can be support from gen9 GPU(that means Skylake). That's HW limitation instead of driver issue.
Additionally, both BSW and SKL can't support VAProfileHEVCMain10.

This comment has been minimized.

Copy link
@fritsch

fritsch Sep 28, 2015

Thanks much for your reply.

Any chance to see something like "GPU assisted decoding" as we currently have on windows (for 10 bit that is)?

This comment has been minimized.

Copy link
@lizhong1008

lizhong1008 Sep 28, 2015

Author Contributor

Sorry, can you specify what does "something like GPU assisted decoding" mean?

This comment has been minimized.

Copy link
@fritsch

fritsch Sep 28, 2015

On windows there exists some blob / code that helps e.g. Broadwell, HSW with no hw unit for hevc decoding to decode hevc 8 bit material. It also helps the architectures including BDW (Broadwell) and newer with 10 bit decoding - it is called GPU assisted something - I cannot find the marketing slides currently, see here: https://communities.intel.com/message/273816#273816

This comment has been minimized.

Copy link
@lizhong1008

lizhong1008 Sep 28, 2015

Author Contributor

For detail HW information, you can refer: https://01.org/zh/linuxgraphics/documentation/hardware-specification-prms?langredirect=1
Generally speaking, decoder spec put on charpter Media VDBOX.
Hope this can answer your question.

This comment has been minimized.

Copy link
@fritsch

fritsch Sep 28, 2015

Thanks again for your reply, VDBox pdf does not have any information concerning HEVC, only mpeg-2, avc, vc1. This pdf: https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-chv-bsw-vol10-hevc.pdf talks about 10 bit decoding and howto setup the pipeline (page 13) now I am confused I think :-)

I think I need an easier to understand answer here: Will we see hevc 10 bit decoding support on linux for Broadwell, e.g. Braodwell, Braswell, Skylake like in the windows driver?

This comment has been minimized.

Copy link
@lizhong1008

lizhong1008 Sep 28, 2015

Author Contributor

No, because all released platforms(including Broadwell, Braswell and Skylake) can't support VAProfileHEVCMain10 slice level HW decoding as I know. That's HW limitation. For further discussion, would better send mail to libva@lists.freedesktop.org, otc libva-driver team may give more professional answer.

This comment has been minimized.

Copy link
@fritsch

fritsch Sep 28, 2015

Okay - thanks again. I knew that there is no real hw to do the decoding, I just thought - there is a possibility to use the same gpu supported assisted decoding or whatever it is called - just like it is done in windows.

This comment has been minimized.

Copy link
@lizhong1008

lizhong1008 Sep 28, 2015

Author Contributor

Yeah, there is a solution called hybrid decoding/encoding, splitting some tasks gpu Fix Function can't do and give them to cpu or EU. However, right now there is no high priority to use a hybrid solution support 10 bits hevc decoding on Braswell for otc libva-intel-driver team as I know.

This comment has been minimized.

Copy link
@fritsch

fritsch Sep 28, 2015

That is what I am after. Cause as you see from my github profile I am one of the authors of kodi's VAAPI implementation. We got HEVC 8 bit implemented recently and now try to get a working "driver / hybrid solution" to also do 10 bit HEVC which will be used as DVB-S / DVB-C future content and also as the default format for UHD content.

We are already in contact with Sean of your (?) team and hope to find a solution here. When I saw that you already used HEVC10 in your libyami code I thought a new driver release will be upcoming.

Thanks much again
Peter

};

VaapiProfile VaapiEncoderBase::profile() const
@@ -122,6 +122,9 @@ class VaapiEncoderBase : public IVideoEncoder {
uint32_t intraPeriod() const {
return m_videoParamCommon.intraPeriod;
}
uint32_t ipPeriod() const {
return m_videoParamCommon.ipPeriod;
}
uint32_t frameRateDenom() const {
return m_videoParamCommon.frameRate.frameRateDenom;
}

0 comments on commit bb75c8d

Please sign in to comment.