Commit 8765a34f authored by ManojBonda's avatar ManojBonda

Add HEVC Main 10/12 and HEVC Main 444 10/12 decode support in VDPAU API

Add new profiles present in Range Extension profiles.

A.3.5 in Annexures of HEVC draft mentions of various profiles
Main 12,
Main 444,
Main 444 10/12,
Main 422 10/12,
etc.
under format range extension profiles. All these profiles have single
profile_idc value 4 These are distinguished by additional flags present
in the bistream specified in Table A.2 of HEVC draft.

FFmpeg skips parsing the additional flags and maintains single profile
for all the format range extension profiles. However since various GPU
generations support various features we are adding all the profiles
separately so that support can be specified accurately.

This Change adds the new HEVC profiles in VDPAU.h

Add new VdpPictureInfoHEVCRangeExt picture parameter structure.
As HEVC444 profile falls under RangeExtension profiles, Due to
similarities between Range Extensions profiles, the picture parameter
structure is re-used.


Also Adding new VdpChromaTypes for 16bit.

For 10/12 bit HEVC decoding, the output memory layout will be P010/P012
respectivley which are similar to P016 format i.e. each component is of
2 Byte width (16bit) with MSBs as valid bits as per the format.

Hence adding 16bit surfaces which can accommodate both P010 and P012
formats and can be used for both 10/12 bit decoding.

This Change also adds VDP_YCBCR_FORMAT_P016, VDP_YCBCR_FORMAT_P010 YCrCb
formats to be used by get/put bits functions(transfer functions) to
access the 16Bit Decoded Surface.
parent 7f993038
Pipeline #108798 passed with stages
in 1 minute and 35 seconds
......@@ -897,6 +897,65 @@ typedef uint32_t VdpChromaType;
* interoped with OpenGL if the matching field/frame structure is
* specified in the OpenGL API */
#define VDP_CHROMA_TYPE_444_FRAME ((VdpChromaType)8)
/** \hideinitializer \brief 4:2:0 chroma format. Undefined field/frame based
* Video surfaces allocated with this chroma type have undefined
* field/frame structure. The implementation is free to internally morph
* the surface between frame/field as required by VdpVideoDecoder operation.
* Interop with OpenGL allows registration of these surfaces for either
* field- or frame-based interop. But, an implicit field/frame structure
* conversion may be performed.
*/
#define VDP_CHROMA_TYPE_420_16 ((VdpChromaType)9)
/** \hideinitializer \brief 4:2:2 chroma format. Undefined field/frame based
* Video surfaces allocated with this chroma type have undefined
* field/frame structure. The implementation is free to internally morph
* the surface between frame/field as required by VdpVideoDecoder operation.
* Interop with OpenGL allows registration of these surfaces for either
* field- or frame-based interop. But, an implicit field/frame structure
* conversion may be performed.
*/
#define VDP_CHROMA_TYPE_422_16 ((VdpChromaType)10)
/** \hideinitializer \brief 4:4:4 chroma format. Undefined field/frame based
* Video surfaces allocated with this chroma type have undefined
* field/frame structure. The implementation is free to internally morph
* the surface between frame/field as required by VdpVideoDecoder operation.
* Interop with OpenGL allows registration of these surfaces for either
* field- or frame-based interop. But, an implicit field/frame structure
* conversion may be performed.
*/
#define VDP_CHROMA_TYPE_444_16 ((VdpChromaType)11)
/** \hideinitializer \brief 4:2:0 chroma format. Field based.
* Video surfaces allocated with this chroma type can only be
* interoped with OpenGL if the matching field/frame structure is
* specified in the OpenGL API */
#define VDP_CHROMA_TYPE_420_FIELD_16 ((VdpChromaType)12)
/** \hideinitializer \brief 4:2:2 chroma format. Field based.
* Video surfaces allocated with this chroma type can only be
* interoped with OpenGL if the matching field/frame structure is
* specified in the OpenGL API */
#define VDP_CHROMA_TYPE_422_FIELD_16 ((VdpChromaType)13)
/** \hideinitializer \brief 4:4:4 chroma format. Field based.
* Video surfaces allocated with this chroma type can only be
* interoped with OpenGL if the matching field/frame structure is
* specified in the OpenGL API */
#define VDP_CHROMA_TYPE_444_FIELD_16 ((VdpChromaType)14)
/** \hideinitializer \brief 4:2:0 chroma format. Frame based.
* Video surfaces allocated with this chroma type can only be
* interoped with OpenGL if the matching field/frame structure is
* specified in the OpenGL API */
#define VDP_CHROMA_TYPE_420_FRAME_16 ((VdpChromaType)15)
/** \hideinitializer \brief 4:2:2 chroma format. Frame based.
* Video surfaces allocated with this chroma type can only be
* interoped with OpenGL if the matching field/frame structure is
* specified in the OpenGL API */
#define VDP_CHROMA_TYPE_422_FRAME_16 ((VdpChromaType)16)
/** \hideinitializer \brief 4:4:4 chroma format. Frame based.
* Video surfaces allocated with this chroma type can only be
* interoped with OpenGL if the matching field/frame structure is
* specified in the OpenGL API */
#define VDP_CHROMA_TYPE_444_FRAME_16 ((VdpChromaType)17)
/**
* \brief The set of all known YCbCr surface formats.
......@@ -1009,6 +1068,50 @@ typedef uint32_t VdpYCbCrFormat;
* Applications should access this data via a uint8_t pointer.
*/
#define VDP_YCBCR_FORMAT_Y_U_V_444 ((VdpYCbCrFormat)7)
/**
* \hideinitializer
* \brief The P010 surface format.
*
* This format has two planes, a Y plane and a UV plane.
*
* The Y plane is an array of two byte sized Y components.
* Applications should access this data via a uint16_t pointer.
*
* The UV plane is an array of interleaved two byte sized U and V
* components, in the order U, V, U, V. Applications should
* access this data via a uint8_t pointer.
*
* Note that the P010 surface format has an identical memory
* layout as the P016 surface format, with bits 0 through 5
* set to zero.
*/
#define VDP_YCBCR_FORMAT_P010 ((VdpYCbCrFormat)8)
/**
* \hideinitializer
* \brief The P016 surface format.
*
* This format has two planes, a Y plane and a UV plane.
*
* The Y plane is an array of two byte sized Y components.
* Applications should access this data via a uint16_t pointer.
*
* The UV plane is an array of interleaved two byte sized U and V
* components, in the order U, V, U, V. Applications should
* access this data via a uint8_t pointer.
*/
#define VDP_YCBCR_FORMAT_P016 ((VdpYCbCrFormat)9)
/**
* \hideinitializer
* \brief The "Y_U_V_444_16" YCbCr surface format.
*
* This format has three planes, a Y plane, a V plane, and a U
* plane.
*
* Each of the planes is an array of two byte-sized components.
*
* Applications should access this data via a uint16_t pointer.
*/
#define VDP_YCBCR_FORMAT_Y_U_V_444_16 ((VdpYCbCrFormat)11)
/**
* \brief The set of all known RGB surface formats.
......@@ -2578,6 +2681,10 @@ typedef uint32_t VdpDecoderProfile;
#define VDP_DECODER_PROFILE_HEVC_MAIN_12 ((VdpDecoderProfile)103)
/** \hideinitializer */
#define VDP_DECODER_PROFILE_HEVC_MAIN_444 ((VdpDecoderProfile)104)
/** \hideinitializer */
#define VDP_DECODER_PROFILE_HEVC_MAIN_444_10 ((VdpDecoderProfile)105)
/** \hideinitializer */
#define VDP_DECODER_PROFILE_HEVC_MAIN_444_12 ((VdpDecoderProfile)106)
/** \hideinitializer */
#define VDP_DECODER_LEVEL_MPEG1_NA 0
......@@ -3545,6 +3652,16 @@ typedef struct {
} VdpPictureInfoHEVC444;
/**
* \brief Picture parameter information for HEVC FormatRangeExtensions picture.
*
* HEVC Main 444 Profile is part of Format Range Extensions profiles,
* Due to similarities between Format Range Extensions profiles, the picture
* parameter structure is re-used for Format Range Extensions profiles
* supported.
*/
typedef VdpPictureInfoHEVC444 VdpPictureInfoHEVCRangeExt;
/**
* \brief Decode a compressed field/frame and render the result
* into a \ref VdpVideoSurface "VdpVideoSurface".
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment