1 /*
2 * Copyright (c) 2022-2023, 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 #ifndef __VP_HAL_DDI_UTILS_H__
23 #define __VP_HAL_DDI_UTILS_H__
24 
25 #include "vp_common.h"
26 
27 class VpHalDDIUtils
28 {
29 public:
30     //!
31     //! \brief  Convert Vphal Surface to Mos Surface
32     //! \param  [in]  surface
33     //!         pointer to VPHAL SURFACE
34     //! \return MOS_SURFACE
35     //!
36     static MOS_SURFACE ConvertVphalSurfaceToMosSurface(
37         PVPHAL_SURFACE surface);
38 
39     //!
40     //! \brief    Get the color pack type of a surface
41     //! \details  Map mos surface format to color pack format and return.
42     //!           For unknown format return VPHAL_COLORPACK_UNKNOWN
43     //! \param    [in] format
44     //!           MOS_FORMAT of a surface
45     //! \return   VPHAL_COLORPACK
46     //!           Color pack type of the surface
47     //!
48     static VPHAL_COLORPACK GetSurfaceColorPack(
49         MOS_FORMAT format);
50 
51     //! \brief    Get the bit depth of a surface
52     //! \details  Get bit depth of input mos surface format and return.
53     //!           For unknown format return 0
54     //! \param    [in] format
55     //!           MOS_FORMAT of a surface
56     //! \return   uint32_t
57     //!           Bit depth of the surface
58     //!
59     static uint32_t GetSurfaceBitDepth(
60         MOS_FORMAT format);
61 
62 MEDIA_CLASS_DEFINE_END(VpHalDDIUtils)
63 };
64 
65 #endif // __VP_HAL_DDI_UTILS_H__
66