• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_ITU_SLIST_A_HEVC,
56     CLIP_ITU_SLIST_B_HEVC,
57     CLIP_NONE_HEVC,
58 
59     CLIP_BASIC_8,
60     CLIP_ALLINTRA_8,
61     CLIP_ALLINTRA_INTRABC_8,
62     CLIP_CDFUPDATE_8,
63     CLIP_GLOBALMOTION_8,
64     CLIP_FILMGRAIN_8,
65     CLIP_SVCL1T2_8,
66     CLIP_SUPERRES_8,
67     CLIP_SIZEUP_8,
68     CLIP_ARGON_SEQCHANGE_AFFINE_8,
69 
70     CLIP_BASIC_10,
71     CLIP_ORDERHINT_10,
72     CLIP_FORWARDKEYFRAME_10,
73     CLIP_LOSSLESS_10,
74     CLIP_LOOPFILTER_10,
75     CLIP_CDEF_10,
76     CLIP_ARGON_FILMGRAIN_10,
77     CLIP_ARGON_TEST_787,
78 
79     CLIP_LAST,
80 };
81 struct VideoProfileInfo
82 {
83     VkVideoCodecOperationFlagBitsKHR codecOperation;
84     VkVideoChromaSubsamplingFlagBitsKHR subsamplingFlags;
85     VkVideoComponentBitDepthFlagBitsKHR lumaBitDepth;
86     VkVideoComponentBitDepthFlagBitsKHR chromaBitDepth;
87     int profileIDC;
88 
VideoProfileInfovkt::video::VideoProfileInfo89     VideoProfileInfo(VkVideoCodecOperationFlagBitsKHR codecOp,
90                      VkVideoChromaSubsamplingFlagBitsKHR subsampleFlags = VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR,
91                      VkVideoComponentBitDepthFlagBitsKHR lumaDepth      = VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR,
92                      VkVideoComponentBitDepthFlagBitsKHR chromaDepth    = VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR,
93                      int profile                                        = 0)
94         : codecOperation(codecOp)
95         , subsamplingFlags(subsampleFlags)
96         , lumaBitDepth(lumaDepth)
97         , chromaBitDepth(chromaDepth)
98         , profileIDC(profile)
99     {
100     }
101 };
102 
103 struct ClipInfo
104 {
105     ClipName name;
106     const char *filename;
107     std::vector<VideoProfileInfo> sessionProfiles;
108     ElementaryStreamFraming framing{ElementaryStreamFraming::UNKNOWN};
109     uint32_t frameWidth{0};
110     uint32_t frameHeight{0};
111     uint32_t frameRate{0};
112     int totalFrames{0};
113     uint32_t framesInGOP{0};
114     const char **frameChecksums{nullptr};
115 };
116 
117 const ClipInfo *clipInfo(ClipName c);
118 const char *checksumForClipFrame(const ClipInfo *cinfo, int frameNumber);
119 
120 } // namespace video
121 } // namespace vkt
122 #endif // _VKTVIDEOCLIPINFO_HPP
123