• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2017, Intel Corporation
2#
3# Permission is hereby granted, free of charge, to any person obtaining a
4# copy of this software and associated documentation files (the "Software"),
5# to deal in the Software without restriction, including without limitation
6# the rights to use, copy, modify, merge, publish, distribute, sublicense,
7# and/or sell copies of the Software, and to permit persons to whom the
8# Software is furnished to do so, subject to the following conditions:
9#
10# The above copyright notice and this permission notice shall be included
11# in all copies or substantial portions of the Software.
12#
13# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
17# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19# OTHER DEALINGS IN THE SOFTWARE.
20
21# global flag for encode AVC_VME/HEVC_VME/MPEG2/VP8
22bs_set_if_undefined(Encode_VME_Supported "yes")
23# global flag for encode AVC_VDENC/HEVC_VDENC/VP9_VDENC/JPEG
24bs_set_if_undefined(Encode_VDEnc_Supported "yes")
25
26# Some features can't be supported if shaders (kernels) are not
27# available. So, we switch such features off explicitly. That's
28# possible either if user requested a build entirely without
29# shaders or a build with free only shaders. The list of switched
30# off features correspnds to the free kernels case, but we can
31# reuse the full list for enable kernels as well.
32if(NOT ENABLE_KERNELS OR NOT ENABLE_NONFREE_KERNELS)
33    # full-open-source
34    bs_set_if_undefined(AVC_Encode_VME_Supported "no")
35    bs_set_if_undefined(HEVC_Encode_VME_Supported "no")
36    bs_set_if_undefined(MPEG2_Encode_VME_Supported "no")
37    bs_set_if_undefined(CMRT_HEVC_ENC_FEI_Supported "no")
38    bs_set_if_undefined(MMC_Supported "no")
39    bs_set_if_undefined(VC1_Decode_Supported "no")
40    bs_set_if_undefined(Decode_Processing_Supported "no")
41    bs_set_if_undefined(Kernel_Auto_Denoise_Supported "no")
42    bs_set_if_undefined(VP8_Encode_Supported "no")
43else()
44    # full-feature
45    bs_set_if_undefined(AVC_Encode_VME_Supported "${Encode_VME_Supported}")
46    bs_set_if_undefined(HEVC_Encode_VME_Supported "${Encode_VME_Supported}")
47    bs_set_if_undefined(MPEG2_Encode_VME_Supported "${Encode_VME_Supported}")
48    bs_set_if_undefined(CMRT_HEVC_ENC_FEI_Supported "yes")
49    bs_set_if_undefined(MMC_Supported "yes")
50    bs_set_if_undefined(VC1_Decode_Supported "yes")
51    bs_set_if_undefined(Decode_Processing_Supported "yes")
52    bs_set_if_undefined(Kernel_Auto_Denoise_Supported "yes")
53    bs_set_if_undefined(VP8_Encode_Supported "${Encode_VME_Supported}")
54endif()
55
56# features are always able to open
57bs_set_if_undefined(VVC_Decode_Supported "yes")
58bs_set_if_undefined(AV1_Decode_Supported "yes")
59bs_set_if_undefined(AVC_Decode_Supported "yes")
60bs_set_if_undefined(HEVC_Decode_Supported "yes")
61bs_set_if_undefined(JPEG_Decode_Supported "yes")
62bs_set_if_undefined(MPEG2_Decode_Supported "yes")
63bs_set_if_undefined(VP8_Decode_Supported "yes")
64bs_set_if_undefined(VP9_Decode_Supported "yes")
65bs_set_if_undefined(VP_SFC_Supported "yes")
66bs_set_if_undefined(Common_Encode_Supported "yes")
67bs_set_if_undefined(Media_Scalability_Supported "yes")
68
69# features controlled by global flag Encode_VDEnc_Supported
70bs_set_if_undefined(AVC_Encode_VDEnc_Supported "${Encode_VDEnc_Supported}")
71bs_set_if_undefined(HEVC_Encode_VDEnc_Supported "${Encode_VDEnc_Supported}")
72bs_set_if_undefined(VP9_Encode_VDEnc_Supported "${Encode_VDEnc_Supported}")
73bs_set_if_undefined(JPEG_Encode_Supported "${Encode_VDEnc_Supported}")
74
75if(${Common_Encode_Supported} STREQUAL "yes")
76    add_definitions(-D_COMMON_ENCODE_SUPPORTED)
77endif()
78
79if(${AVC_Encode_VME_Supported} STREQUAL "yes")
80    add_definitions(-D_AVC_ENCODE_VME_SUPPORTED)
81endif()
82
83if(${AVC_Encode_VDEnc_Supported} STREQUAL "yes")
84    add_definitions(-D_AVC_ENCODE_VDENC_SUPPORTED)
85endif()
86
87if(${AVC_Decode_Supported} STREQUAL "yes")
88    add_definitions(-D_AVC_DECODE_SUPPORTED)
89endif()
90
91if (${HEVC_Encode_VME_Supported} STREQUAL "yes")
92    add_definitions (-D_HEVC_ENCODE_VME_SUPPORTED)
93endif()
94
95if (${HEVC_Encode_VDEnc_Supported} STREQUAL "yes")
96    add_definitions(-D_HEVC_ENCODE_VDENC_SUPPORTED)
97endif ()
98
99if(${HEVC_Decode_Supported} STREQUAL "yes")
100    add_definitions(-D_HEVC_DECODE_SUPPORTED)
101endif()
102
103if(${JPEG_Encode_Supported} STREQUAL "yes")
104    add_definitions(-D_JPEG_ENCODE_SUPPORTED)
105endif()
106
107if(${JPEG_Decode_Supported} STREQUAL "yes")
108    add_definitions(-D_JPEG_DECODE_SUPPORTED)
109endif()
110
111if(${MPEG2_Encode_VME_Supported} STREQUAL "yes")
112    add_definitions(-D_MPEG2_ENCODE_VME_SUPPORTED)
113endif()
114
115if(${MPEG2_Decode_Supported} STREQUAL "yes")
116    add_definitions(-D_MPEG2_DECODE_SUPPORTED)
117endif()
118
119if(${VC1_Decode_Supported} STREQUAL "yes")
120    add_definitions(-D_VC1_DECODE_SUPPORTED)
121endif()
122
123if(${VP8_Decode_Supported} STREQUAL "yes")
124    add_definitions(-D_VP8_DECODE_SUPPORTED)
125endif()
126
127if(${VP8_Encode_Supported} STREQUAL "yes")
128    add_definitions(-D_VP8_ENCODE_SUPPORTED)
129endif()
130
131if(${VP9_Encode_VDEnc_Supported} STREQUAL "yes")
132    add_definitions(-D_VP9_ENCODE_VDENC_SUPPORTED)
133endif()
134
135if(${VP9_Decode_Supported} STREQUAL "yes")
136    add_definitions(-D_VP9_DECODE_SUPPORTED)
137endif()
138
139if(${AV1_Decode_Supported} STREQUAL "yes")
140    add_definitions(-D_AV1_DECODE_SUPPORTED)
141endif()
142
143if(${VVC_Decode_Supported} STREQUAL "yes")
144    add_definitions(-D_VVC_DECODE_SUPPORTED)
145endif()
146
147if(${CMRT_HEVC_ENC_FEI_Supported} STREQUAL "yes")
148    add_definitions(-DHEVC_FEI_ENABLE_CMRT)
149endif()
150
151if(${Decode_Processing_Supported} STREQUAL "yes")
152    add_definitions(-D_DECODE_PROCESSING_SUPPORTED)
153endif()
154
155if(${MMC_Supported} STREQUAL "yes")
156    add_definitions(-D_MMC_SUPPORTED)
157endif()
158
159if(${Kernel_Auto_Denoise_Supported} STREQUAL "yes")
160    add_definitions(-DVEBOX_AUTO_DENOISE_SUPPORTED=1)
161else()
162    add_definitions(-DVEBOX_AUTO_DENOISE_SUPPORTED=0)
163endif()
164
165if(${VP_SFC_Supported} STREQUAL "yes")
166    add_definitions(-D__VPHAL_SFC_SUPPORTED=1)
167else()
168    add_definitions(-D__VPHAL_SFC_SUPPORTED=0)
169endif()
170
171bs_set_if_undefined(CLASS_TRACE 0)
172add_definitions(-DCLASS_TRACE=${CLASS_TRACE})
173
174if(ENABLE_KERNELS)
175    add_definitions(-DENABLE_KERNELS)
176endif()
177
178if(NOT ENABLE_NONFREE_KERNELS)
179    add_definitions(-D_FULL_OPEN_SOURCE)
180endif()
181
182include(${MEDIA_SOFTLET_EXT_CMAKE}/linux/media_feature_flags_linux_ext.cmake OPTIONAL)
183