| 1 | /* |
| 2 | * Copyright (c) 2022, Intel Corporation |
| 3 | * |
| 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 5 | * copy of this software and associated documentation files (the "Software"), |
| 6 | * to deal in the Software without restriction, including without limitation |
| 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 | * and/or sell copies of the Software, and to permit persons to whom the |
| 9 | * Software is furnished to do so, subject to the following conditions: |
| 10 | * |
| 11 | * The above copyright notice and this permission notice shall be included |
| 12 | * in all copies or substantial portions of the Software. |
| 13 | * |
| 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 15 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
| 18 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 20 | * OTHER DEALINGS IN THE SOFTWARE. |
| 21 | */ |
| 22 | //! |
| 23 | //! \file vphal_common_defs.h |
| 24 | //! \brief clarify common utilities for vphal |
| 25 | //! \details clarify common utilities for vphal including: |
| 26 | //! some marcro, enum, union, structure, function |
| 27 | //! |
| 28 | #ifndef __VPHAL_COMMON_DEFS_H__ |
| 29 | #define __VPHAL_COMMON_DEFS_H__ |
| 30 | |
| 31 | #include "vp_common.h" |
| 32 | |
| 33 | //! |
| 34 | //! \brief Vphal Output chroma configuration enum |
| 35 | //! |
| 36 | typedef enum _VPHAL_CHROMA_SUBSAMPLING |
| 37 | { |
| 38 | CHROMA_SUBSAMPLING_TOP_CENTER = 0, |
| 39 | CHROMA_SUBSAMPLING_CENTER_CENTER, |
| 40 | CHROMA_SUBSAMPLING_BOTTOM_CENTER, |
| 41 | CHROMA_SUBSAMPLING_TOP_LEFT, |
| 42 | CHROMA_SUBSAMPLING_CENTER_LEFT, |
| 43 | CHROMA_SUBSAMPLING_BOTTOM_LEFT |
| 44 | } VPHAL_CHROMA_SUBSAMPLING; |
| 45 | |
| 46 | //! |
| 47 | //! \brief Vphal Gamma Values configuration enum |
| 48 | //! |
| 49 | typedef enum _VPHAL_GAMMA_VALUE |
| 50 | { |
| 51 | GAMMA_1P0 = 0, |
| 52 | GAMMA_2P2, |
| 53 | GAMMA_2P6 |
| 54 | } VPHAL_GAMMA_VALUE; |
| 55 | |
| 56 | typedef enum _VPHAL_DP_ROTATION_MODE |
| 57 | { |
| 58 | VPHAL_DP_ROTATION_NV12_AVG = 0, //!< nv12 -> yuy2 by chroma average |
| 59 | VPHAL_DP_ROTATION_NV12_NV12 , //!< nv12 -> nv12 |
| 60 | VPHAL_DP_ROTATION_NV12_REP , //!< nv12 -> yuy2 by chroma repeat |
| 61 | VPHAL_DP_ROTATION_NV12_YUY2_NOT_SET //!< nv12 -> yuy2 by chroma average or repeat, decided by scaling mode |
| 62 | } VPHAL_DP_ROTATION_MODE; |
| 63 | |
| 64 | //! |
| 65 | //! Union VPHAL_HALF_PRECISION_FLOAT |
| 66 | //! \brief Vphal half precision float type |
| 67 | //! |
| 68 | typedef union _VPHAL_HALF_PRECISION_FLOAT |
| 69 | { |
| 70 | struct |
| 71 | { |
| 72 | uint16_t Mantissa : 10; |
| 73 | uint16_t Exponent : 5; |
| 74 | uint16_t Sign : 1; |
| 75 | }; |
| 76 | |
| 77 | uint16_t value; |
| 78 | } VPHAL_HALF_PRECISION_FLOAT, PVPHAL_HALF_PRECISION_FLOAT; |
| 79 | |
| 80 | |
| 81 | //! |
| 82 | //! \brief Vphal 3DLUT Channel Mapping enum |
| 83 | //! |
| 84 | typedef enum _VPHAL_3DLUT_CHANNEL_MAPPING |
| 85 | { |
| 86 | CHANNEL_MAPPING_RGB_RGB = 0, |
| 87 | CHANNEL_MAPPING_YUV_RGB = 1 << 0, |
| 88 | CHANNEL_MAPPING_VUY_RGB = 1 << 1, |
| 89 | } VPHAL_3DLUT_CHANNEL_MAPPING; |
| 90 | |
| 91 | |
| 92 | //! |
| 93 | //! Structure VPHAL_GAMUT_PARAMS |
| 94 | //! \brief IECP Gamut Mapping Parameters |
| 95 | //! |
| 96 | typedef struct _VPHAL_GAMUT_PARAMS |
| 97 | { |
| 98 | VPHAL_GAMUT_MODE GCompMode; |
| 99 | VPHAL_GAMUT_MODE GExpMode; |
| 100 | VPHAL_GAMMA_VALUE GammaValue; |
| 101 | uint32_t dwAttenuation; //!< U2.10 [0, 1024] 0 = No down scaling, 1024 = Full down scaling |
| 102 | float displayRGBW_x[4]; |
| 103 | float displayRGBW_y[4]; |
| 104 | } VPHAL_GAMUT_PARAMS, *PVPHAL_GAMUT_PARAMS; |
| 105 | |
| 106 | //! |
| 107 | //! Structure VPHAL_CONSTRICTION_PARAMS |
| 108 | //! \brief Constriction parameters |
| 109 | //! |
| 110 | typedef struct _VPHAL_CONSTRICTION_PARAMS |
| 111 | { |
| 112 | RECT rcConstriction; |
| 113 | } VPHAL_CONSTRICTION_PARAMS, *PVPHAL_CONSTRICTION_PARAMS; |
| 114 | |
| 115 | #endif // __VPHAL_COMMON_DEFS_H__ |