vkvideoencodeh26x: tests: set constant qp

Set constant qp to 26 in between 0 and 51, the qp range
for h264 and h265.

minQp in case of ANV is 10 for h265

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8407>
This commit is contained in:
Stéphane Cerveau 2025-02-04 16:10:38 +01:00 committed by GStreamer Marge Bot
parent fbf698cc0b
commit bd62300d22
2 changed files with 10 additions and 1 deletions

View File

@ -514,8 +514,11 @@ encode_frame (GstVulkanEncoder * enc, GstVulkanH264EncodeFrame * frame,
.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_NALU_SLICE_INFO_KHR,
.pNext = NULL,
.pStdSliceHeader = &frame->slice_hdr,
.constantQp = 26,
};
fail_unless (frame->slice_info.constantQp >= enc_caps.encoder.codec.h264.minQp);
frame->rc_info = (VkVideoEncodeH264RateControlInfoKHR) {
.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_INFO_KHR,
};

View File

@ -439,6 +439,7 @@ 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;
@ -448,7 +449,9 @@ encode_frame (GstVulkanEncoder * enc, GstVulkanH265EncodeFrame * frame,
GST_DEBUG ("Encoding frame num: %d", frame_num);
gst_vulkan_encoder_set_callbacks (enc, &cb, NULL, NULL);
fail_unless (gst_vulkan_encoder_caps (enc, &enc_caps));
gst_vulkan_encoder_set_callbacks (enc, &cb, &enc_caps, NULL);
ref_pics_num = list0_num + list1_num;
@ -580,8 +583,11 @@ encode_frame (GstVulkanEncoder * enc, GstVulkanH265EncodeFrame * frame,
.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_NALU_SLICE_SEGMENT_INFO_KHR,
.pNext = NULL,
.pStdSliceSegmentHeader = &frame->slice_hdr,
.constantQp = 26,
};
fail_unless(frame->slice_info.constantQp >= enc_caps.encoder.codec.h265.minQp);
frame->rc_info = (VkVideoEncodeH265RateControlInfoKHR) {
.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_INFO_KHR,
};