From bd62300d22fa00f313b5263216a8d0ce528c77be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Tue, 4 Feb 2025 16:10:38 +0100 Subject: [PATCH] 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: --- .../gst-plugins-bad/tests/check/libs/vkvideoencodeh264.c | 3 +++ .../gst-plugins-bad/tests/check/libs/vkvideoencodeh265.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/tests/check/libs/vkvideoencodeh264.c b/subprojects/gst-plugins-bad/tests/check/libs/vkvideoencodeh264.c index 6786c01890..b78bd26243 100644 --- a/subprojects/gst-plugins-bad/tests/check/libs/vkvideoencodeh264.c +++ b/subprojects/gst-plugins-bad/tests/check/libs/vkvideoencodeh264.c @@ -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, }; diff --git a/subprojects/gst-plugins-bad/tests/check/libs/vkvideoencodeh265.c b/subprojects/gst-plugins-bad/tests/check/libs/vkvideoencodeh265.c index b3a377d5f3..d0d9ad119f 100644 --- a/subprojects/gst-plugins-bad/tests/check/libs/vkvideoencodeh265.c +++ b/subprojects/gst-plugins-bad/tests/check/libs/vkvideoencodeh265.c @@ -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, };