xref: /aosp_15_r20/external/deqp/external/vulkancts/modules/vulkan/video/vktVideoClipInfo.hpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1 #ifndef _VKTVIDEOCLIPINFO_HPP
2 #define _VKTVIDEOCLIPINFO_HPP
3 /*------------------------------------------------------------------------
4  * Vulkan Conformance Tests
5  * ------------------------
6  *
7  * Copyright (c) 2023 The Khronos Group Inc.
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  *//*!
22  * \file
23  * \brief Reference checksums for video decode validation
24  *
25  * See the <vulkan_data_dir>/vulkan/video/frame_checksums.py file for
26  * instructions on generating the checksums for new tests.
27  *--------------------------------------------------------------------*/
28 #include <array>
29 #include <vector>
30 #include <string>
31 #include <sstream>
32 
33 #include "deDefs.hpp"
34 #include "vktVideoTestUtils.hpp"
35 
36 #include "vktDemuxer.hpp"
37 
38 namespace vkt
39 {
40 namespace video
41 {
42 
43 enum ClipName
44 {
45     CLIP_A = 0,
46     CLIP_B,
47     CLIP_C,
48     CLIP_D,
49     CLIP_E,
50     CLIP_F,
51     CLIP_G,
52     CLIP_H,
53     CLIP_H264_4K_26_IBP_MAIN,
54     CLIP_JELLY_HEVC,
55     CLIP_NONE_HEVC,
56 
57     CLIP_BASIC_8,
58     CLIP_ALLINTRA_8,
59     CLIP_ALLINTRA_INTRABC_8,
60     CLIP_CDFUPDATE_8,
61     CLIP_GLOBALMOTION_8,
62     CLIP_FILMGRAIN_8,
63     CLIP_SVCL1T2_8,
64     CLIP_SUPERRES_8,
65     CLIP_SIZEUP_8,
66     CLIP_ARGON_SEQCHANGE_AFFINE_8,
67 
68     CLIP_BASIC_10,
69     CLIP_ORDERHINT_10,
70     CLIP_FORWARDKEYFRAME_10,
71     CLIP_LOSSLESS_10,
72     CLIP_LOOPFILTER_10,
73     CLIP_CDEF_10,
74     CLIP_ARGON_FILMGRAIN_10,
75     CLIP_ARGON_TEST_787,
76 
77     CLIP_LAST,
78 };
79 struct VideoProfileInfo
80 {
81     VkVideoCodecOperationFlagBitsKHR codecOperation;
82     VkVideoChromaSubsamplingFlagBitsKHR subsamplingFlags;
83     VkVideoComponentBitDepthFlagBitsKHR lumaBitDepth;
84     VkVideoComponentBitDepthFlagBitsKHR chromaBitDepth;
85     int profileIDC;
86 
VideoProfileInfovkt::video::VideoProfileInfo87     VideoProfileInfo(VkVideoCodecOperationFlagBitsKHR codecOp,
88                      VkVideoChromaSubsamplingFlagBitsKHR subsampleFlags = VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR,
89                      VkVideoComponentBitDepthFlagBitsKHR lumaDepth      = VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR,
90                      VkVideoComponentBitDepthFlagBitsKHR chromaDepth    = VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR,
91                      int profile                                        = 0)
92         : codecOperation(codecOp)
93         , subsamplingFlags(subsampleFlags)
94         , lumaBitDepth(lumaDepth)
95         , chromaBitDepth(chromaDepth)
96         , profileIDC(profile)
97     {
98     }
99 };
100 
101 struct ClipInfo
102 {
103     ClipName name;
104     const char *filename;
105     std::vector<VideoProfileInfo> sessionProfiles;
106     ElementaryStreamFraming framing{ElementaryStreamFraming::UNKNOWN};
107     uint32_t frameWidth{0};
108     uint32_t frameHeight{0};
109     uint32_t frameRate{0};
110     int totalFrames{0};
111     uint32_t framesInGOP{0};
112     const char **frameChecksums{nullptr};
113 };
114 
115 const ClipInfo *clipInfo(ClipName c);
116 const char *checksumForClipFrame(const ClipInfo *cinfo, int frameNumber);
117 
118 } // namespace video
119 } // namespace vkt
120 #endif // _VKTVIDEOCLIPINFO_HPP
121