| 1 |
/* |
| 2 |
** Copyright (c) 2019-2020 The Khronos Group Inc. |
| 3 |
** |
| 4 |
** SPDX-License-Identifier: Apache-2.0 |
| 5 |
*/ |
| 6 |
|
| 7 |
#ifndef VULKAN_VIDEO_CODEC_H264STD_DECODE_H_ |
| 8 |
#define VULKAN_VIDEO_CODEC_H264STD_DECODE_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 Decode related parameters: |
| 18 |
// ************************************************* |
| 19 |
|
| 20 |
typedef struct StdVideoDecodeH264PictureInfoFlags { |
| 21 |
uint32_t field_pic_flag:1; // Is field picture |
| 22 |
uint32_t is_intra:1; // Is intra picture |
| 23 |
uint32_t bottom_field_flag:1; // bottom (true) or top (false) field if field_pic_flag is set. |
| 24 |
uint32_t is_reference:1; // This only applies to picture info, and not to the DPB lists. |
| 25 |
uint32_t complementary_field_pair:1; // complementary field pair, complementary non-reference field pair, complementary reference field pair |
| 26 |
} StdVideoDecodeH264PictureInfoFlags; |
| 27 |
|
| 28 |
typedef struct StdVideoDecodeH264PictureInfo { |
| 29 |
uint8_t seq_parameter_set_id; // Selecting SPS from the Picture Parameters |
| 30 |
uint8_t pic_parameter_set_id; // Selecting PPS from the Picture Parameters and the SPS |
| 31 |
uint16_t reserved; // for structure members 32-bit packing/alignment |
| 32 |
uint16_t frame_num; // 7.4.3 Slice header semantics |
| 33 |
uint16_t idr_pic_id; // 7.4.3 Slice header semantics |
| 34 |
// PicOrderCnt is based on TopFieldOrderCnt and BottomFieldOrderCnt. See 8.2.1 Decoding process for picture order count type 0 - 2 |
| 35 |
int32_t PicOrderCnt[2]; // TopFieldOrderCnt and BottomFieldOrderCnt fields. |
| 36 |
StdVideoDecodeH264PictureInfoFlags flags; |
| 37 |
} StdVideoDecodeH264PictureInfo; |
| 38 |
|
| 39 |
typedef struct StdVideoDecodeH264ReferenceInfoFlags { |
| 40 |
uint32_t top_field_flag:1; // Reference is used for top field reference. |
| 41 |
uint32_t bottom_field_flag:1; // Reference is used for bottom field reference. |
| 42 |
uint32_t is_long_term:1; // this is a long term reference |
| 43 |
uint32_t is_non_existing:1; // Must be handled in accordance with 8.2.5.2: Decoding process for gaps in frame_num |
| 44 |
} StdVideoDecodeH264ReferenceInfoFlags; |
| 45 |
|
| 46 |
typedef struct StdVideoDecodeH264ReferenceInfo { |
| 47 |
// FrameNum = is_long_term ? long_term_frame_idx : frame_num |
| 48 |
uint16_t FrameNum; // 7.4.3.3 Decoded reference picture marking semantics |
| 49 |
uint16_t reserved; // for structure members 32-bit packing/alignment |
| 50 |
int32_t PicOrderCnt[2]; // TopFieldOrderCnt and BottomFieldOrderCnt fields. |
| 51 |
StdVideoDecodeH264ReferenceInfoFlags flags; |
| 52 |
} StdVideoDecodeH264ReferenceInfo; |
| 53 |
|
| 54 |
typedef struct StdVideoDecodeH264MvcElementFlags { |
| 55 |
uint32_t non_idr:1; |
| 56 |
uint32_t anchor_pic:1; |
| 57 |
uint32_t inter_view:1; |
| 58 |
} StdVideoDecodeH264MvcElementFlags; |
| 59 |
|
| 60 |
typedef struct StdVideoDecodeH264MvcElement { |
| 61 |
StdVideoDecodeH264MvcElementFlags flags; |
| 62 |
uint16_t viewOrderIndex; |
| 63 |
uint16_t viewId; |
| 64 |
uint16_t temporalId; // move out? |
| 65 |
uint16_t priorityId; // move out? |
| 66 |
uint16_t numOfAnchorRefsInL0; |
| 67 |
uint16_t viewIdOfAnchorRefsInL0[15]; |
| 68 |
uint16_t numOfAnchorRefsInL1; |
| 69 |
uint16_t viewIdOfAnchorRefsInL1[15]; |
| 70 |
uint16_t numOfNonAnchorRefsInL0; |
| 71 |
uint16_t viewIdOfNonAnchorRefsInL0[15]; |
| 72 |
uint16_t numOfNonAnchorRefsInL1; |
| 73 |
uint16_t viewIdOfNonAnchorRefsInL1[15]; |
| 74 |
} StdVideoDecodeH264MvcElement; |
| 75 |
|
| 76 |
typedef struct StdVideoDecodeH264Mvc { |
| 77 |
uint32_t viewId0; |
| 78 |
uint32_t mvcElementCount; |
| 79 |
StdVideoDecodeH264MvcElement* pMvcElements; |
| 80 |
} StdVideoDecodeH264Mvc; |
| 81 |
|
| 82 |
|
| 83 |
#ifdef __cplusplus |
| 84 |
} |
| 85 |
#endif |
| 86 |
|
| 87 |
#endif // VULKAN_VIDEO_CODEC_H264STD_DECODE_H_ |