mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 06:16:36 +00:00
vulkan: store in GstVulkanVideoCapabilities encoder and decoder caps
The structure already stored the generic video capabilities and the specific codec capabilities both for encoding an decoding. The generic decoder capabilities weren't stored because it was only used internally in the decoder helper object. Nonetheless, for the encoder, the elements will need the generic encoder capabilities to configure the encoding. That's why it's required to expose it as part of GstVulkanVideoCapabilities. And the generic decoder is included for the sake of symmetry. While updating the API vkvideoencodeh265 test got some code-style fixes. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8007>
This commit is contained in:
parent
cf9cc5ec1b
commit
1df99ec0d4
6 changed files with 119 additions and 103 deletions
|
@ -5924,25 +5924,40 @@ signalled and freed.</doc>
|
|||
<field name="caps" introspectable="0" readable="0" private="1">
|
||||
<type c:type="VkVideoCapabilitiesKHR"/>
|
||||
</field>
|
||||
<union name="codec" c:type="codec">
|
||||
<union>
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h"/>
|
||||
<field name="base" writable="1">
|
||||
<type name="Vulkan.BaseInStructure" c:type="VkBaseInStructure"/>
|
||||
</field>
|
||||
<field name="h264dec" introspectable="0" writable="1">
|
||||
<type c:type="VkVideoDecodeH264CapabilitiesKHR"/>
|
||||
</field>
|
||||
<field name="h265dec" introspectable="0" writable="1">
|
||||
<type c:type="VkVideoDecodeH265CapabilitiesKHR"/>
|
||||
</field>
|
||||
<field name="h264enc" introspectable="0" writable="1">
|
||||
<type c:type="VkVideoEncodeH264CapabilitiesKHR"/>
|
||||
</field>
|
||||
<field name="h265enc" introspectable="0" writable="1">
|
||||
<type c:type="VkVideoEncodeH265CapabilitiesKHR"/>
|
||||
</field>
|
||||
<record name="decoder" c:type="decoder">
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h"/>
|
||||
<field name="caps" introspectable="0" readable="0" private="1">
|
||||
<type c:type="VkVideoDecodeCapabilitiesKHR"/>
|
||||
</field>
|
||||
<union name="codec" c:type="codec">
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h"/>
|
||||
<field name="h264" introspectable="0" readable="0" private="1">
|
||||
<type c:type="VkVideoDecodeH264CapabilitiesKHR"/>
|
||||
</field>
|
||||
<field name="h265" introspectable="0" readable="0" private="1">
|
||||
<type c:type="VkVideoDecodeH265CapabilitiesKHR"/>
|
||||
</field>
|
||||
</union>
|
||||
</record>
|
||||
<record name="encoder" c:type="encoder">
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h"/>
|
||||
<field name="caps" introspectable="0" readable="0" private="1">
|
||||
<type c:type="VkVideoEncodeCapabilitiesKHR"/>
|
||||
</field>
|
||||
<union name="codec" c:type="codec">
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkvideoutils.h"/>
|
||||
<field name="h264" introspectable="0" readable="0" private="1">
|
||||
<type c:type="VkVideoEncodeH264CapabilitiesKHR"/>
|
||||
</field>
|
||||
<field name="h265" introspectable="0" readable="0" private="1">
|
||||
<type c:type="VkVideoEncodeH265CapabilitiesKHR"/>
|
||||
</field>
|
||||
</union>
|
||||
</record>
|
||||
</union>
|
||||
<field name="_reserved" writable="1">
|
||||
<field name="_reserved" readable="0" private="1">
|
||||
<array zero-terminated="0" fixed-size="4">
|
||||
<type name="gpointer" c:type="gpointer"/>
|
||||
</array>
|
||||
|
|
|
@ -136,7 +136,6 @@ gst_vulkan_decoder_start (GstVulkanDecoder * self,
|
|||
GstVulkanDecoderPrivate *priv;
|
||||
VkPhysicalDevice gpu;
|
||||
VkResult res;
|
||||
VkVideoDecodeCapabilitiesKHR dec_caps;
|
||||
VkVideoFormatPropertiesKHR *fmts = NULL;
|
||||
VkVideoProfileListInfoKHR profile_list = {
|
||||
.sType = VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR,
|
||||
|
@ -191,7 +190,7 @@ gst_vulkan_decoder_start (GstVulkanDecoder * self,
|
|||
switch (self->codec) {
|
||||
case VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR:
|
||||
/* *INDENT-OFF* */
|
||||
priv->caps.codec.h264dec = (VkVideoDecodeH264CapabilitiesKHR) {
|
||||
priv->caps.decoder.codec.h264 = (VkVideoDecodeH264CapabilitiesKHR) {
|
||||
.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_KHR,
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
@ -199,7 +198,7 @@ gst_vulkan_decoder_start (GstVulkanDecoder * self,
|
|||
break;
|
||||
case VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR:
|
||||
/* *INDENT-OFF* */
|
||||
priv->caps.codec.h265dec = (VkVideoDecodeH265CapabilitiesKHR) {
|
||||
priv->caps.decoder.codec.h265 = (VkVideoDecodeH265CapabilitiesKHR) {
|
||||
.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR,
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
@ -210,13 +209,13 @@ gst_vulkan_decoder_start (GstVulkanDecoder * self,
|
|||
}
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
dec_caps = (VkVideoDecodeCapabilitiesKHR) {
|
||||
priv->caps.decoder.caps = (VkVideoDecodeCapabilitiesKHR) {
|
||||
.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_CAPABILITIES_KHR,
|
||||
.pNext = &priv->caps.codec,
|
||||
.pNext = &priv->caps.decoder.codec,
|
||||
};
|
||||
priv->caps.caps = (VkVideoCapabilitiesKHR) {
|
||||
.sType = VK_STRUCTURE_TYPE_VIDEO_CAPABILITIES_KHR,
|
||||
.pNext = &dec_caps,
|
||||
.pNext = &priv->caps.decoder.caps,
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
||||
|
@ -229,10 +228,10 @@ gst_vulkan_decoder_start (GstVulkanDecoder * self,
|
|||
|
||||
switch (self->codec) {
|
||||
case VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR:
|
||||
maxlevel = priv->caps.codec.h264dec.maxLevelIdc;
|
||||
maxlevel = priv->caps.decoder.codec.h264.maxLevelIdc;
|
||||
break;
|
||||
case VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR:
|
||||
maxlevel = priv->caps.codec.h265dec.maxLevelIdc;
|
||||
maxlevel = priv->caps.decoder.codec.h265.maxLevelIdc;
|
||||
break;
|
||||
default:
|
||||
maxlevel = 0;
|
||||
|
@ -273,11 +272,11 @@ gst_vulkan_decoder_start (GstVulkanDecoder * self,
|
|||
GST_STR_NULL (priv->caps.caps.stdHeaderVersion.extensionName),
|
||||
VK_CODEC_VERSION (priv->caps.caps.stdHeaderVersion.specVersion),
|
||||
VK_CODEC_VERSION (_vk_codec_extensions[codec_idx].specVersion),
|
||||
dec_caps.flags ? "" : " invalid",
|
||||
dec_caps.flags &
|
||||
priv->caps.decoder.caps.flags ? "" : " invalid",
|
||||
priv->caps.decoder.caps.flags &
|
||||
VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR ?
|
||||
" reuse_output_DPB" : "",
|
||||
dec_caps.flags &
|
||||
priv->caps.decoder.caps.flags &
|
||||
VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR ?
|
||||
" dedicated_DPB" : "");
|
||||
|
||||
|
@ -288,7 +287,7 @@ gst_vulkan_decoder_start (GstVulkanDecoder * self,
|
|||
* VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR - reports the
|
||||
* implementation supports using distinct Video Picture Resources for decode
|
||||
* DPB and decode output. */
|
||||
self->dedicated_dpb = ((dec_caps.flags &
|
||||
self->dedicated_dpb = ((priv->caps.decoder.caps.flags &
|
||||
VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR) == 0);
|
||||
|
||||
/* The DPB or Reconstructed Video Picture Resources for the video session may
|
||||
|
@ -828,7 +827,8 @@ gst_vulkan_decoder_caps (GstVulkanDecoder * self,
|
|||
|
||||
if (caps) {
|
||||
*caps = priv->caps;
|
||||
caps->caps.pNext = &caps->codec;
|
||||
caps->caps.pNext = &caps->decoder.caps;
|
||||
caps->decoder.caps.pNext = &caps->decoder.codec;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -54,7 +54,6 @@ struct _GstVulkanEncoderPrivate
|
|||
GstVulkanVideoSession session;
|
||||
GstVulkanVideoCapabilities caps;
|
||||
VkVideoFormatPropertiesKHR format;
|
||||
VkVideoEncodeCapabilitiesKHR enc_caps;
|
||||
VkVideoEncodeRateControlInfoKHR rate_control_info;
|
||||
|
||||
GstVulkanVideoProfile profile;
|
||||
|
@ -492,7 +491,8 @@ gst_vulkan_encoder_caps (GstVulkanEncoder * self,
|
|||
|
||||
if (caps) {
|
||||
*caps = priv->caps;
|
||||
caps->caps.pNext = &caps->codec;
|
||||
caps->caps.pNext = &caps->encoder.caps;
|
||||
caps->encoder.caps.pNext = &caps->encoder.codec;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -607,7 +607,7 @@ gst_vulkan_encoder_start (GstVulkanEncoder * self,
|
|||
"Invalid profile");
|
||||
return FALSE;
|
||||
}
|
||||
priv->caps.codec.h264enc = (VkVideoEncodeH264CapabilitiesKHR) {
|
||||
priv->caps.encoder.codec.h264 = (VkVideoEncodeH264CapabilitiesKHR) {
|
||||
/* *INDENT-OFF* */
|
||||
.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_KHR,
|
||||
/* *INDENT-ON* */
|
||||
|
@ -620,7 +620,7 @@ gst_vulkan_encoder_start (GstVulkanEncoder * self,
|
|||
"Invalid profile");
|
||||
return FALSE;
|
||||
}
|
||||
priv->caps.codec.h265enc = (VkVideoEncodeH265CapabilitiesKHR) {
|
||||
priv->caps.encoder.codec.h265 = (VkVideoEncodeH265CapabilitiesKHR) {
|
||||
/* *INDENT-OFF* */
|
||||
.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_CAPABILITIES_KHR,
|
||||
/* *INDENT-ON* */
|
||||
|
@ -640,13 +640,13 @@ gst_vulkan_encoder_start (GstVulkanEncoder * self,
|
|||
priv->profile.profile.pNext = &priv->profile.usage.encode;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
priv->enc_caps = (VkVideoEncodeCapabilitiesKHR) {
|
||||
priv->caps.encoder.caps = (VkVideoEncodeCapabilitiesKHR) {
|
||||
.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR,
|
||||
.pNext = &priv->caps.codec,
|
||||
.pNext = &priv->caps.encoder.codec,
|
||||
};
|
||||
priv->caps.caps = (VkVideoCapabilitiesKHR) {
|
||||
.sType = VK_STRUCTURE_TYPE_VIDEO_CAPABILITIES_KHR,
|
||||
.pNext = &priv->enc_caps,
|
||||
.pNext = &priv->caps.encoder.caps,
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
||||
|
@ -677,29 +677,29 @@ gst_vulkan_encoder_start (GstVulkanEncoder * self,
|
|||
|
||||
GST_OBJECT_LOCK (self);
|
||||
if ((priv->prop.rate_control != VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DEFAULT_KHR)
|
||||
&& !(priv->prop.rate_control & priv->enc_caps.rateControlModes)) {
|
||||
&& !(priv->prop.rate_control & priv->caps.encoder.caps.rateControlModes)) {
|
||||
g_set_error (error, GST_VULKAN_ERROR, VK_ERROR_INITIALIZATION_FAILED,
|
||||
"The driver does not support the rate control requested %d, driver caps: %d",
|
||||
priv->prop.rate_control, priv->enc_caps.rateControlModes);
|
||||
priv->prop.rate_control, priv->caps.encoder.caps.rateControlModes);
|
||||
GST_OBJECT_UNLOCK (self);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (priv->enc_caps.maxQualityLevels
|
||||
&& priv->prop.quality_level >= priv->enc_caps.maxQualityLevels) {
|
||||
if (priv->caps.encoder.caps.maxQualityLevels
|
||||
&& priv->prop.quality_level >= priv->caps.encoder.caps.maxQualityLevels) {
|
||||
g_set_error (error, GST_VULKAN_ERROR, VK_ERROR_INITIALIZATION_FAILED,
|
||||
"The driver does not support the quality level requested %d, driver caps: %d",
|
||||
priv->prop.quality_level, priv->enc_caps.maxQualityLevels);
|
||||
priv->prop.quality_level, priv->caps.encoder.caps.maxQualityLevels);
|
||||
GST_OBJECT_UNLOCK (self);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (priv->enc_caps.maxBitrate
|
||||
&& priv->prop.average_bitrate >= priv->enc_caps.maxBitrate) {
|
||||
if (priv->caps.encoder.caps.maxBitrate
|
||||
&& priv->prop.average_bitrate >= priv->caps.encoder.caps.maxBitrate) {
|
||||
g_set_error (error, GST_VULKAN_ERROR, VK_ERROR_INITIALIZATION_FAILED,
|
||||
"The driver does not support the average bitrate requested %d, driver caps: %"
|
||||
G_GUINT64_FORMAT, priv->prop.average_bitrate,
|
||||
priv->enc_caps.maxBitrate);
|
||||
priv->caps.encoder.caps.maxBitrate);
|
||||
GST_OBJECT_UNLOCK (self);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -723,7 +723,7 @@ gst_vulkan_encoder_start (GstVulkanEncoder * self,
|
|||
query_create = (VkQueryPoolVideoEncodeFeedbackCreateInfoKHR) {
|
||||
.sType = VK_STRUCTURE_TYPE_QUERY_POOL_VIDEO_ENCODE_FEEDBACK_CREATE_INFO_KHR,
|
||||
.pNext = &profile->profile,
|
||||
.encodeFeedbackFlags = priv->enc_caps.supportedEncodeFeedbackFlags &
|
||||
.encodeFeedbackFlags = priv->caps.encoder.caps.supportedEncodeFeedbackFlags &
|
||||
(~VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_HAS_OVERRIDES_BIT_KHR),
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
@ -750,7 +750,7 @@ gst_vulkan_encoder_start (GstVulkanEncoder * self,
|
|||
priv->caps.caps.maxCodedExtent.width,
|
||||
priv->caps.caps.minCodedExtent.height,
|
||||
priv->caps.caps.maxCodedExtent.height,
|
||||
priv->enc_caps.maxBitrate,
|
||||
priv->caps.encoder.caps.maxBitrate,
|
||||
priv->caps.caps.flags &
|
||||
VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR ?
|
||||
" separate_references" : "");
|
||||
|
@ -759,7 +759,6 @@ gst_vulkan_encoder_start (GstVulkanEncoder * self,
|
|||
!(priv->caps.
|
||||
caps.flags & VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR);
|
||||
|
||||
priv->caps.caps.pNext = NULL;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
session_create = (VkVideoSessionCreateInfoKHR) {
|
||||
|
@ -1091,7 +1090,7 @@ gst_vulkan_encoder_encode (GstVulkanEncoder * self,
|
|||
.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_LAYER_INFO_KHR,
|
||||
.pNext = pic->codec_rc_layer_info,
|
||||
.averageBitrate = priv->prop.average_bitrate,
|
||||
.maxBitrate = priv->enc_caps.maxBitrate,
|
||||
.maxBitrate = priv->caps.encoder.caps.maxBitrate,
|
||||
.frameRateNumerator = pic->fps_n,
|
||||
.frameRateDenominator = pic->fps_d,
|
||||
};
|
||||
|
@ -1184,7 +1183,8 @@ gst_vulkan_encoder_encode (GstVulkanEncoder * self,
|
|||
priv->vk.CmdControlVideoCoding (cmd_buf->cmd, &coding_ctrl);
|
||||
|
||||
if (priv->prop.quality_level
|
||||
&& priv->prop.quality_level <= priv->enc_caps.maxQualityLevels) {
|
||||
&& priv->prop.quality_level <=
|
||||
priv->caps.encoder.caps.maxQualityLevels) {
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
quality_level_info = (VkVideoEncodeQualityLevelInfoKHR) {
|
||||
|
|
|
@ -80,23 +80,31 @@ struct _GstVulkanVideoCapabilities
|
|||
VkVideoCapabilitiesKHR caps;
|
||||
union
|
||||
{
|
||||
VkBaseInStructure base;
|
||||
VkVideoDecodeH264CapabilitiesKHR h264dec;
|
||||
VkVideoDecodeH265CapabilitiesKHR h265dec;
|
||||
/**
|
||||
* GstVulkanVideoCapabilities.codec.h264enc:
|
||||
*
|
||||
* Since: 1.26
|
||||
*/
|
||||
VkVideoEncodeH264CapabilitiesKHR h264enc;
|
||||
/**
|
||||
* GstVulkanVideoCapabilities.codec.h265enc:
|
||||
*
|
||||
* Since: 1.26
|
||||
*/
|
||||
VkVideoEncodeH265CapabilitiesKHR h265enc;
|
||||
} codec;
|
||||
struct
|
||||
{
|
||||
/*< private >*/
|
||||
VkVideoDecodeCapabilitiesKHR caps;
|
||||
union
|
||||
{
|
||||
/*< private >*/
|
||||
VkVideoDecodeH264CapabilitiesKHR h264;
|
||||
VkVideoDecodeH265CapabilitiesKHR h265;
|
||||
} codec;
|
||||
} decoder;
|
||||
struct
|
||||
{
|
||||
/*< private >*/
|
||||
VkVideoEncodeCapabilitiesKHR caps;
|
||||
union
|
||||
{
|
||||
/*< private >*/
|
||||
VkVideoEncodeH264CapabilitiesKHR h264;
|
||||
VkVideoEncodeH265CapabilitiesKHR h265;
|
||||
} codec;
|
||||
} encoder;
|
||||
};
|
||||
#endif
|
||||
/*< private >*/
|
||||
gpointer _reserved[GST_PADDING];
|
||||
};
|
||||
|
||||
|
|
|
@ -503,7 +503,8 @@ encode_frame (GstVulkanEncoder * enc, GstVulkanH264EncodeFrame * frame,
|
|||
.naluSliceEntryCount = 1,
|
||||
.pNaluSliceEntries = &frame->slice_info,
|
||||
.pStdPictureInfo = &frame->pic_info,
|
||||
.generatePrefixNalu = (enc_caps.codec.h264enc.flags & VK_VIDEO_ENCODE_H264_CAPABILITY_GENERATE_PREFIX_NALU_BIT_KHR),
|
||||
.generatePrefixNalu = (enc_caps.encoder.codec.h264.flags
|
||||
& VK_VIDEO_ENCODE_H264_CAPABILITY_GENERATE_PREFIX_NALU_BIT_KHR),
|
||||
/* *INDENT-ON* */
|
||||
};
|
||||
|
||||
|
@ -891,7 +892,7 @@ GST_START_TEST (test_encoder_h264_i_p_b)
|
|||
|
||||
fail_unless (gst_vulkan_encoder_caps (enc, &enc_caps));
|
||||
|
||||
if (!enc_caps.codec.h264enc.maxL1ReferenceCount) {
|
||||
if (!enc_caps.encoder.codec.h264.maxL1ReferenceCount) {
|
||||
GST_WARNING ("Driver does not support B frames");
|
||||
goto beach;
|
||||
}
|
||||
|
|
|
@ -388,7 +388,6 @@ encode_frame (GstVulkanEncoder * enc, GstVulkanH265EncodeFrame * frame,
|
|||
GstVulkanH265EncodeFrame ** list1, gint list1_num, gint vps_id, gint sps_id,
|
||||
gint pps_id)
|
||||
{
|
||||
GstVulkanVideoCapabilities enc_caps;
|
||||
int i, ref_pics_num = 0;
|
||||
GstVulkanEncoderPicture *ref_pics[16] = { NULL, };
|
||||
gint16 delta_poc_s0_minus1 = 0, delta_poc_s1_minus1 = 0;
|
||||
|
@ -400,8 +399,6 @@ encode_frame (GstVulkanEncoder * enc, GstVulkanH265EncodeFrame * frame,
|
|||
|
||||
GST_DEBUG ("Encoding frame num: %d", frame_num);
|
||||
|
||||
fail_unless (gst_vulkan_encoder_caps (enc, &enc_caps));
|
||||
|
||||
frame->slice_wt = (StdVideoEncodeH265WeightTable) {
|
||||
/* *INDENT-OFF* */
|
||||
.flags = (StdVideoEncodeH265WeightTableFlags) {
|
||||
|
@ -806,52 +803,45 @@ setup_h265_encoder (uint32_t width, uint32_t height, gint vps_id,
|
|||
fail_unless (gst_vulkan_encoder_caps (enc, &enc_caps));
|
||||
|
||||
|
||||
if (enc_caps.codec.h265enc.
|
||||
ctbSizes & VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_KHR) {
|
||||
if (enc_caps.encoder.codec.h265.ctbSizes
|
||||
& VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_KHR)
|
||||
max_ctb_size = 64;
|
||||
} else if (enc_caps.codec.h265enc.
|
||||
ctbSizes & VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_KHR) {
|
||||
else if (enc_caps.encoder.codec.h265.ctbSizes
|
||||
& VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_KHR)
|
||||
max_ctb_size = 32;
|
||||
}
|
||||
|
||||
if (enc_caps.codec.h265enc.
|
||||
ctbSizes & VK_VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_KHR) {
|
||||
else if (enc_caps.encoder.codec.h265.ctbSizes
|
||||
& VK_VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_KHR)
|
||||
min_ctb_size = 16;
|
||||
} else if (enc_caps.codec.h265enc.
|
||||
ctbSizes & VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_KHR) {
|
||||
min_ctb_size = 32;
|
||||
}
|
||||
|
||||
if (enc_caps.codec.h265enc.transformBlockSizes &
|
||||
if (enc_caps.encoder.codec.h265.transformBlockSizes &
|
||||
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_4_BIT_KHR)
|
||||
min_tb_size = 4;
|
||||
else if (enc_caps.codec.h265enc.transformBlockSizes &
|
||||
else if (enc_caps.encoder.codec.h265.transformBlockSizes &
|
||||
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_8_BIT_KHR)
|
||||
min_tb_size = 8;
|
||||
else if (enc_caps.codec.h265enc.transformBlockSizes &
|
||||
else if (enc_caps.encoder.codec.h265.transformBlockSizes &
|
||||
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_16_BIT_KHR)
|
||||
min_tb_size = 16;
|
||||
else if (enc_caps.codec.h265enc.transformBlockSizes &
|
||||
else if (enc_caps.encoder.codec.h265.transformBlockSizes &
|
||||
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_32_BIT_KHR)
|
||||
min_tb_size = 32;
|
||||
|
||||
if (enc_caps.codec.h265enc.transformBlockSizes &
|
||||
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_32_BIT_KHR)
|
||||
if (enc_caps.encoder.codec.h265.transformBlockSizes
|
||||
& VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_32_BIT_KHR)
|
||||
max_tb_size = 32;
|
||||
else if (enc_caps.codec.h265enc.transformBlockSizes &
|
||||
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_16_BIT_KHR)
|
||||
else if (enc_caps.encoder.codec.h265.transformBlockSizes
|
||||
& VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_16_BIT_KHR)
|
||||
max_tb_size = 16;
|
||||
else if (enc_caps.codec.h265enc.transformBlockSizes &
|
||||
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_8_BIT_KHR)
|
||||
else if (enc_caps.encoder.codec.h265.transformBlockSizes
|
||||
& VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_8_BIT_KHR)
|
||||
max_tb_size = 8;
|
||||
else if (enc_caps.codec.h265enc.transformBlockSizes &
|
||||
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_4_BIT_KHR)
|
||||
else if (enc_caps.encoder.codec.h265.transformBlockSizes
|
||||
& VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_4_BIT_KHR)
|
||||
max_tb_size = 4;
|
||||
|
||||
max_transform_hierarchy =
|
||||
gst_util_ceil_log2 (max_ctb_size) - gst_util_ceil_log2 (min_tb_size);
|
||||
|
||||
|
||||
h265_std_ptl.general_profile_idc = profile_idc;
|
||||
h265_std_vps.vps_video_parameter_set_id = vps_id;
|
||||
|
||||
|
@ -878,14 +868,16 @@ setup_h265_encoder (uint32_t width, uint32_t height, gint vps_id,
|
|||
h265_std_sps.conf_win_bottom_offset = 0;
|
||||
|
||||
h265_std_pps.flags.transform_skip_enabled_flag =
|
||||
enc_caps.codec.h265enc.stdSyntaxFlags &
|
||||
VK_VIDEO_ENCODE_H265_STD_TRANSFORM_SKIP_ENABLED_FLAG_SET_BIT_KHR ? 1 : 0;
|
||||
enc_caps.encoder.codec.h265.stdSyntaxFlags
|
||||
& VK_VIDEO_ENCODE_H265_STD_TRANSFORM_SKIP_ENABLED_FLAG_SET_BIT_KHR
|
||||
? 1 : 0;
|
||||
h265_std_pps.flags.weighted_pred_flag =
|
||||
enc_caps.codec.h265enc.stdSyntaxFlags &
|
||||
VK_VIDEO_ENCODE_H265_STD_WEIGHTED_PRED_FLAG_SET_BIT_KHR ? 1 : 0;
|
||||
enc_caps.encoder.codec.h265.stdSyntaxFlags
|
||||
& VK_VIDEO_ENCODE_H265_STD_WEIGHTED_PRED_FLAG_SET_BIT_KHR ? 1 : 0;
|
||||
h265_std_pps.flags.entropy_coding_sync_enabled_flag =
|
||||
(enc_caps.codec.h265enc.maxTiles.width > 1
|
||||
|| enc_caps.codec.h265enc.maxTiles.height > 1) ? 1 : 0;
|
||||
(enc_caps.encoder.codec.h265.maxTiles.width > 1
|
||||
|| enc_caps.encoder.codec.h265.maxTiles.height > 1)
|
||||
? 1 : 0;
|
||||
h265_std_pps.sps_video_parameter_set_id = vps_id;
|
||||
h265_std_pps.pps_seq_parameter_set_id = sps_id;
|
||||
h265_std_pps.pps_pic_parameter_set_id = pps_id;
|
||||
|
@ -1075,7 +1067,7 @@ GST_START_TEST (test_encoder_h265_i_p_b)
|
|||
|
||||
fail_unless (gst_vulkan_encoder_caps (enc, &enc_caps));
|
||||
|
||||
if (!enc_caps.codec.h265enc.maxL1ReferenceCount) {
|
||||
if (!enc_caps.encoder.codec.h265.maxL1ReferenceCount) {
|
||||
GST_WARNING ("Driver does not support B frames");
|
||||
goto beach;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue