1 /* 2 * 3 * Copyright 2017 Samsung Electronics S.LSI Co. LTD 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 /* 19 * @file VendorVideoAPI.h 20 * @author TaeHwan Kim (t_h_kim@samsung.com) 21 * ByungGwan Kang (bk0917.kang@samsung.com) 22 * @version 1.0 23 * @history 24 * 2017.06.02 : Create 25 */ 26 27 #ifndef VENDOR_VIDEO_API_H_ 28 #define VENDOR_VIDEO_API_H_ 29 30 #include <stdio.h> 31 32 #ifdef __cplusplus 33 extern "C" { 34 #endif 35 #define MAX_HDR10PLUS_SIZE 1024 36 37 typedef enum _ExynosVideoInfoType { 38 VIDEO_INFO_TYPE_INVALID = 0, 39 VIDEO_INFO_TYPE_HDR_STATIC = 0x1 << 0, 40 VIDEO_INFO_TYPE_COLOR_ASPECTS = 0x1 << 1, 41 VIDEO_INFO_TYPE_INTERLACED = 0x1 << 2, 42 VIDEO_INFO_TYPE_YSUM_DATA = 0x1 << 3, 43 VIDEO_INFO_TYPE_HDR_DYNAMIC = 0x1 << 4, 44 VIDEO_INFO_TYPE_CHECK_PIXEL_FORMAT = 0x1 << 5, 45 VIDEO_INFO_TYPE_ROI_INFO = 0x1 << 7, 46 VIDEO_INFO_TYPE_CROP_INFO = 0x1 << 8, 47 } ExynosVideoInfoType; 48 49 typedef struct _ExynosVideoYSUMData { 50 unsigned int high; 51 unsigned int low; 52 } ExynosVideoYSUMData; 53 54 typedef struct _ExynosColorAspects { 55 int mRange; 56 int mPrimaries; 57 int mTransfer; 58 int mMatrixCoeffs; 59 } ExynosColorAspects; 60 61 typedef struct _ExynosPrimaries { 62 unsigned int x; 63 unsigned int y; 64 } ExynosPrimaries; 65 66 typedef struct _ExynosType1 { 67 ExynosPrimaries mR; 68 ExynosPrimaries mG; 69 ExynosPrimaries mB; 70 ExynosPrimaries mW; 71 unsigned int mMaxDisplayLuminance; 72 unsigned int mMinDisplayLuminance; 73 unsigned int mMaxContentLightLevel; 74 unsigned int mMaxFrameAverageLightLevel; 75 } ExynosType1; 76 77 typedef struct _ExynosHdrStaticInfo { 78 int mID; 79 union { 80 ExynosType1 sType1; 81 }; 82 } ExynosHdrStaticInfo; 83 84 typedef struct _ExynosHdrDynamicInfo { 85 unsigned int valid; 86 87 struct { 88 unsigned char country_code; 89 unsigned short provider_code; 90 unsigned short provider_oriented_code; 91 92 unsigned char application_identifier; 93 unsigned short application_version; 94 95 unsigned int display_maximum_luminance; 96 97 unsigned int maxscl[3]; 98 99 unsigned char num_maxrgb_percentiles; 100 unsigned char maxrgb_percentages[15]; 101 unsigned int maxrgb_percentiles[15]; 102 103 struct { 104 unsigned short tone_mapping_flag; 105 unsigned short knee_point_x; 106 unsigned short knee_point_y; 107 unsigned short num_bezier_curve_anchors; 108 unsigned short bezier_curve_anchors[15]; 109 } tone_mapping; 110 } data; 111 112 unsigned int reserved[42]; 113 } ExynosHdrDynamicInfo; 114 115 typedef struct _ExynosVideoCrop { 116 int left; 117 int top; 118 int width; 119 int height; 120 } ExynosVideoCrop; 121 122 #define MAX_ROIINFO_SIZE 32400 123 typedef struct _ExynosVideoROIData { 124 int nUpperQpOffset; 125 int nLowerQpOffset; 126 int bUseRoiInfo; 127 int nRoiMBInfoSize; 128 char pRoiMBInfo[MAX_ROIINFO_SIZE]; 129 } ExynosVideoROIData; 130 131 typedef struct _ExynosVideoDecData { 132 int nInterlacedType; 133 } ExynosVideoDecData; 134 135 typedef struct _ExynosVideoEncData { 136 ExynosVideoYSUMData sYsumData; 137 unsigned long long pRoiData; /* for fixing byte alignment on 64x32 problem */ 138 } ExynosVideoEncData; 139 140 typedef struct _ExynosVideoMeta { 141 ExynosVideoInfoType eType; 142 143 ExynosHdrStaticInfo sHdrStaticInfo; 144 ExynosColorAspects sColorAspects; 145 146 union { 147 ExynosVideoDecData dec; 148 ExynosVideoEncData enc; 149 } data; 150 151 ExynosHdrDynamicInfo sHdrDynamicInfo; 152 153 int nPixelFormat; 154 ExynosVideoCrop crop; 155 } ExynosVideoMeta; 156 157 int Exynos_parsing_user_data_registered_itu_t_t35(ExynosHdrDynamicInfo *dest, void *src, int size); 158 int Exynos_dynamic_meta_to_itu_t_t35(ExynosHdrDynamicInfo *src, char *dst); 159 160 #ifdef __cplusplus 161 } 162 #endif 163 164 #endif /* VENDOR_VIDEO_API_H_ */ 165