• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 ** Copyright (c) 2019-2021 The Khronos Group Inc.
3 **
4 ** SPDX-License-Identifier: Apache-2.0
5 */
6 
7 #ifndef VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_
8 #define VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_ 1
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 #include "vk_video/vulkan_video_codec_h264std.h"
15 
16 // *************************************************
17 // Video H.264 Encode related parameters:
18 // *************************************************
19 
20 typedef struct StdVideoEncodeH264SliceHeaderFlags {
21     uint32_t idr_flag : 1;
22     uint32_t is_reference_flag : 1;
23     uint32_t num_ref_idx_active_override_flag : 1;
24     uint32_t no_output_of_prior_pics_flag : 1;
25     uint32_t long_term_reference_flag : 1;
26     uint32_t adaptive_ref_pic_marking_mode_flag : 1;
27     uint32_t no_prior_references_available_flag : 1;
28 } StdVideoEncodeH264SliceHeaderFlags;
29 
30 typedef struct StdVideoEncodeH264PictureInfoFlags {
31     uint32_t idr_flag : 1;
32     uint32_t is_reference_flag : 1;
33     uint32_t long_term_reference_flag : 1;
34 } StdVideoEncodeH264PictureInfoFlags;
35 
36 typedef struct StdVideoEncodeH264RefMgmtFlags {
37     uint32_t ref_pic_list_modification_l0_flag : 1;
38     uint32_t ref_pic_list_modification_l1_flag : 1;
39 } StdVideoEncodeH264RefMgmtFlags;
40 
41 typedef struct StdVideoEncodeH264RefListModEntry {
42     StdVideoH264ModificationOfPicNumsIdc modification_of_pic_nums_idc;
43     uint16_t                             abs_diff_pic_num_minus1;
44     uint16_t                             long_term_pic_num;
45 } StdVideoEncodeH264RefListModEntry;
46 
47 typedef struct StdVideoEncodeH264RefPicMarkingEntry {
48     StdVideoH264MemMgmtControlOp  operation;
49     uint16_t                      difference_of_pic_nums_minus1;
50     uint16_t                      long_term_pic_num;
51     uint16_t                      long_term_frame_idx;
52     uint16_t                      max_long_term_frame_idx_plus1;
53 } StdVideoEncodeH264RefPicMarkingEntry;
54 
55 typedef struct StdVideoEncodeH264RefMemMgmtCtrlOperations {
56     StdVideoEncodeH264RefMgmtFlags        flags;
57     uint8_t                               refList0ModOpCount;
58     StdVideoEncodeH264RefListModEntry*    pRefList0ModOperations;
59     uint8_t                               refList1ModOpCount;
60     StdVideoEncodeH264RefListModEntry*    pRefList1ModOperations;
61     uint8_t                               refPicMarkingOpCount;
62     StdVideoEncodeH264RefPicMarkingEntry* pRefPicMarkingOperations;
63 } StdVideoEncodeH264RefMemMgmtCtrlOperations;
64 
65 typedef struct StdVideoEncodeH264PictureInfo {
66     StdVideoEncodeH264PictureInfoFlags   flags;
67     StdVideoH264PictureType              pictureType;
68     uint32_t                             frameNum;
69     uint32_t                             pictureOrderCount;
70     uint16_t                             long_term_pic_num;
71     uint16_t                             long_term_frame_idx;
72 } StdVideoEncodeH264PictureInfo;
73 
74 typedef struct StdVideoEncodeH264SliceHeader {
75     StdVideoEncodeH264SliceHeaderFlags          flags;
76     StdVideoH264SliceType                       slice_type;
77     uint8_t                                     seq_parameter_set_id;
78     uint8_t                                     pic_parameter_set_id;
79     uint16_t                                    idr_pic_id;
80     uint8_t                                     num_ref_idx_l0_active_minus1;
81     uint8_t                                     num_ref_idx_l1_active_minus1;
82     StdVideoH264CabacInitIdc                    cabac_init_idc;
83     StdVideoH264DisableDeblockingFilterIdc      disable_deblocking_filter_idc;
84     int8_t                                      slice_alpha_c0_offset_div2;
85     int8_t                                      slice_beta_offset_div2;
86     StdVideoEncodeH264RefMemMgmtCtrlOperations* pMemMgmtCtrlOperations;
87 } StdVideoEncodeH264SliceHeader;
88 
89 
90 #ifdef __cplusplus
91 }
92 #endif
93 
94 #endif // VULKAN_VIDEO_CODEC_H264STD_ENCODE_H_
95