aom_dsp.cmake 21.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
##
## Copyright (c) 2017, Alliance for Open Media. All rights reserved
##
## This source code is subject to the terms of the BSD 2 Clause License and
## the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
## was not distributed with this source code in the LICENSE file, you can
## obtain it at www.aomedia.org/license/software. If the Alliance for Open
## Media Patent License 1.0 was not distributed with this source code in the
## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
##
11 12 13
if (NOT AOM_AOM_DSP_AOM_DSP_CMAKE_)
set(AOM_AOM_DSP_AOM_DSP_CMAKE_ 1)

14 15 16 17 18 19 20 21 22 23 24 25
set(AOM_DSP_COMMON_SOURCES
    "${AOM_ROOT}/aom_dsp/aom_convolve.c"
    "${AOM_ROOT}/aom_dsp/aom_convolve.h"
    "${AOM_ROOT}/aom_dsp/aom_dsp_common.h"
    "${AOM_ROOT}/aom_dsp/aom_filter.h"
    "${AOM_ROOT}/aom_dsp/aom_simd.h"
    "${AOM_ROOT}/aom_dsp/aom_simd_inline.h"
    "${AOM_ROOT}/aom_dsp/blend.h"
    "${AOM_ROOT}/aom_dsp/blend_a64_hmask.c"
    "${AOM_ROOT}/aom_dsp/blend_a64_mask.c"
    "${AOM_ROOT}/aom_dsp/blend_a64_vmask.c"
    "${AOM_ROOT}/aom_dsp/intrapred.c"
26
    "${AOM_ROOT}/aom_dsp/intrapred_common.h"
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
    "${AOM_ROOT}/aom_dsp/loopfilter.c"
    "${AOM_ROOT}/aom_dsp/prob.h"
    "${AOM_ROOT}/aom_dsp/simd/v128_intrinsics.h"
    "${AOM_ROOT}/aom_dsp/simd/v128_intrinsics_c.h"
    "${AOM_ROOT}/aom_dsp/simd/v256_intrinsics.h"
    "${AOM_ROOT}/aom_dsp/simd/v256_intrinsics_c.h"
    "${AOM_ROOT}/aom_dsp/simd/v64_intrinsics.h"
    "${AOM_ROOT}/aom_dsp/simd/v64_intrinsics_c.h"
    "${AOM_ROOT}/aom_dsp/subtract.c"
    "${AOM_ROOT}/aom_dsp/txfm_common.h"
    "${AOM_ROOT}/aom_dsp/x86/txfm_common_intrin.h")

set(AOM_DSP_COMMON_ASM_SSE2
    "${AOM_ROOT}/aom_dsp/x86/aom_convolve_copy_sse2.asm"
    "${AOM_ROOT}/aom_dsp/x86/aom_subpixel_8t_sse2.asm"
    "${AOM_ROOT}/aom_dsp/x86/aom_subpixel_bilinear_sse2.asm"
    "${AOM_ROOT}/aom_dsp/x86/intrapred_sse2.asm")

set(AOM_DSP_COMMON_INTRIN_SSE2
    "${AOM_ROOT}/aom_dsp/x86/aom_asm_stubs.c"
    "${AOM_ROOT}/aom_dsp/x86/convolve.h"
48
    "${AOM_ROOT}/aom_dsp/x86/intrapred_sse2.c"
49
    "${AOM_ROOT}/aom_dsp/x86/loopfilter_sse2.c"
Yi Luo's avatar
Yi Luo committed
50
    "${AOM_ROOT}/aom_dsp/x86/lpf_common_sse2.h"
51 52
    "${AOM_ROOT}/aom_dsp/x86/mem_sse2.h"
    "${AOM_ROOT}/aom_dsp/x86/txfm_common_sse2.h")
53 54 55 56 57 58 59

set(AOM_DSP_COMMON_ASM_SSSE3
    "${AOM_ROOT}/aom_dsp/x86/aom_subpixel_8t_ssse3.asm"
    "${AOM_ROOT}/aom_dsp/x86/aom_subpixel_bilinear_ssse3.asm"
    "${AOM_ROOT}/aom_dsp/x86/intrapred_ssse3.asm")

set(AOM_DSP_COMMON_INTRIN_SSSE3
Tom Finegan's avatar
Tom Finegan committed
60
    "${AOM_ROOT}/aom_dsp/x86/aom_subpixel_8t_intrin_ssse3.c"
61
    "${AOM_ROOT}/aom_dsp/x86/intrapred_ssse3.c"
62 63 64 65 66
    "${AOM_ROOT}/aom_dsp/x86/inv_txfm_ssse3.c")

if (CONFIG_JNT_COMP)
  set(AOM_DSP_COMMON_INTRIN_SSSE3
      ${AOM_DSP_COMMON_INTRIN_SSSE3}
67
      "${AOM_ROOT}/aom_dsp/x86/jnt_variance_ssse3.c")
68 69 70 71

  set(AOM_DSP_COMMON_INTRIN_SSSE3
      ${AOM_DSP_COMMON_INTRIN_SSSE3}
      "${AOM_ROOT}/aom_dsp/x86/jnt_sad_ssse3.c")
72
endif ()
73 74 75 76 77 78

set(AOM_DSP_COMMON_INTRIN_SSE4_1
    "${AOM_ROOT}/aom_dsp/x86/blend_a64_hmask_sse4.c"
    "${AOM_ROOT}/aom_dsp/x86/blend_a64_mask_sse4.c"
    "${AOM_ROOT}/aom_dsp/x86/blend_a64_vmask_sse4.c")

79
set(AOM_DSP_COMMON_INTRIN_AVX2
80
    "${AOM_ROOT}/aom_dsp/x86/aom_subpixel_8t_intrin_avx2.c"
81
    "${AOM_ROOT}/aom_dsp/x86/intrapred_avx2.c"
Yi Luo's avatar
Yi Luo committed
82
    "${AOM_ROOT}/aom_dsp/x86/inv_txfm_avx2.c"
Yi Luo's avatar
Yi Luo committed
83
    "${AOM_ROOT}/aom_dsp/x86/common_avx2.h"
Yi Luo's avatar
Yi Luo committed
84 85
    "${AOM_ROOT}/aom_dsp/x86/inv_txfm_common_avx2.h"
    "${AOM_ROOT}/aom_dsp/x86/txfm_common_avx2.h")
86

87 88 89 90 91 92
if (NOT CONFIG_PARALLEL_DEBLOCKING)
  set(AOM_DSP_COMMON_INTRIN_AVX2
      ${AOM_DSP_COMMON_INTRIN_AVX2}
      "${AOM_ROOT}/aom_dsp/x86/loopfilter_avx2.c")
endif ()

93 94 95 96 97 98 99 100
if (NOT CONFIG_EXT_PARTITION)
  set(AOM_DSP_COMMON_ASM_NEON
      "${AOM_ROOT}/aom_dsp/arm/aom_convolve8_avg_neon_asm.asm"
      "${AOM_ROOT}/aom_dsp/arm/aom_convolve8_neon_asm.asm"
      "${AOM_ROOT}/aom_dsp/arm/aom_convolve_avg_neon_asm.asm"
      "${AOM_ROOT}/aom_dsp/arm/aom_convolve_copy_neon_asm.asm")
endif ()

101
set(AOM_DSP_COMMON_ASM_NEON
102
    ${AOM_DSP_COMMON_ASM_NEON}
103 104 105 106 107 108 109 110 111 112 113
    "${AOM_ROOT}/aom_dsp/arm/idct16x16_1_add_neon.asm"
    "${AOM_ROOT}/aom_dsp/arm/idct16x16_add_neon.asm"
    "${AOM_ROOT}/aom_dsp/arm/idct32x32_1_add_neon.asm"
    "${AOM_ROOT}/aom_dsp/arm/idct32x32_add_neon.asm"
    "${AOM_ROOT}/aom_dsp/arm/idct4x4_1_add_neon.asm"
    "${AOM_ROOT}/aom_dsp/arm/idct4x4_add_neon.asm"
    "${AOM_ROOT}/aom_dsp/arm/idct8x8_1_add_neon.asm"
    "${AOM_ROOT}/aom_dsp/arm/idct8x8_add_neon.asm"
    "${AOM_ROOT}/aom_dsp/arm/intrapred_neon_asm.asm"
    "${AOM_ROOT}/aom_dsp/arm/save_reg_neon.asm")

114 115 116 117 118 119 120 121 122
if (NOT CONFIG_PARALLEL_DEBLOCKING)
  set(AOM_DSP_COMMON_ASM_NEON
      ${AOM_DSP_COMMON_ASM_NEON}
      "${AOM_ROOT}/aom_dsp/arm/loopfilter_16_neon.asm"
      "${AOM_ROOT}/aom_dsp/arm/loopfilter_4_neon.asm"
      "${AOM_ROOT}/aom_dsp/arm/loopfilter_8_neon.asm"
      "${AOM_ROOT}/aom_dsp/arm/loopfilter_mb_neon.asm")
endif ()

123 124 125 126 127
if (NOT CONFIG_EXT_PARTITION)
  set(AOM_DSP_COMMON_INTRIN_NEON
      "${AOM_ROOT}/aom_dsp/arm/aom_convolve_neon.c")
endif ()

128
set(AOM_DSP_COMMON_INTRIN_NEON
129
    ${AOM_DSP_COMMON_INTRIN_NEON}
130 131 132 133 134 135 136 137 138 139 140
    "${AOM_ROOT}/aom_dsp/arm/avg_neon.c"
    "${AOM_ROOT}/aom_dsp/arm/fwd_txfm_neon.c"
    "${AOM_ROOT}/aom_dsp/arm/hadamard_neon.c"
    "${AOM_ROOT}/aom_dsp/arm/idct16x16_neon.c"
    "${AOM_ROOT}/aom_dsp/arm/intrapred_neon.c"
    "${AOM_ROOT}/aom_dsp/arm/sad4d_neon.c"
    "${AOM_ROOT}/aom_dsp/arm/sad_neon.c"
    "${AOM_ROOT}/aom_dsp/arm/subpel_variance_neon.c"
    "${AOM_ROOT}/aom_dsp/arm/subtract_neon.c"
    "${AOM_ROOT}/aom_dsp/arm/variance_neon.c")

141 142 143 144 145 146
if (NOT CONFIG_PARALLEL_DEBLOCKING)
  set(AOM_DSP_COMMON_INTRIN_NEON
      ${AOM_DSP_COMMON_INTRIN_NEON}
      "${AOM_ROOT}/aom_dsp/arm/loopfilter_neon.c")
endif ()

147
if ("${AOM_TARGET_CPU}" STREQUAL "arm64")
148 149 150 151 152 153 154 155 156
  if (NOT CONFIG_EXT_PARTITION)
    set(AOM_DSP_COMMON_INTRIN_NEON
        ${AOM_DSP_COMMON_INTRIN_NEON}
        "${AOM_ROOT}/aom_dsp/arm/aom_convolve8_avg_neon.c"
        "${AOM_ROOT}/aom_dsp/arm/aom_convolve8_neon.c"
        "${AOM_ROOT}/aom_dsp/arm/aom_convolve_avg_neon.c"
        "${AOM_ROOT}/aom_dsp/arm/aom_convolve_copy_neon.c")
  endif ()

157 158 159 160 161 162 163 164 165 166
  set(AOM_DSP_COMMON_INTRIN_NEON
      ${AOM_DSP_COMMON_INTRIN_NEON}
      "${AOM_ROOT}/aom_dsp/arm/idct16x16_1_add_neon.c"
      "${AOM_ROOT}/aom_dsp/arm/idct16x16_add_neon.c"
      "${AOM_ROOT}/aom_dsp/arm/idct32x32_1_add_neon.c"
      "${AOM_ROOT}/aom_dsp/arm/idct32x32_add_neon.c"
      "${AOM_ROOT}/aom_dsp/arm/idct4x4_1_add_neon.c"
      "${AOM_ROOT}/aom_dsp/arm/idct4x4_add_neon.c"
      "${AOM_ROOT}/aom_dsp/arm/idct8x8_1_add_neon.c"
      "${AOM_ROOT}/aom_dsp/arm/idct8x8_add_neon.c"
167 168 169 170 171 172 173 174 175
      "${AOM_ROOT}/aom_dsp/arm/intrapred_neon.c")

  if (NOT CONFIG_PARALLEL_DEBLOCKING)
    set(AOM_DSP_COMMON_INTRIN_NEON
        ${AOM_DSP_COMMON_INTRIN_NEON}
        "${AOM_ROOT}/aom_dsp/arm/loopfilter_16_neon.c"
        "${AOM_ROOT}/aom_dsp/arm/loopfilter_4_neon.c"
        "${AOM_ROOT}/aom_dsp/arm/loopfilter_8_neon.c")
  endif ()
176 177
endif ()

178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
set(AOM_DSP_COMMON_INTRIN_DSPR2
    "${AOM_ROOT}/aom_dsp/mips/common_dspr2.c"
    "${AOM_ROOT}/aom_dsp/mips/common_dspr2.h"
    "${AOM_ROOT}/aom_dsp/mips/convolve2_avg_dspr2.c"
    "${AOM_ROOT}/aom_dsp/mips/convolve2_avg_horiz_dspr2.c"
    "${AOM_ROOT}/aom_dsp/mips/convolve2_dspr2.c"
    "${AOM_ROOT}/aom_dsp/mips/convolve2_horiz_dspr2.c"
    "${AOM_ROOT}/aom_dsp/mips/convolve2_vert_dspr2.c"
    "${AOM_ROOT}/aom_dsp/mips/convolve8_avg_dspr2.c"
    "${AOM_ROOT}/aom_dsp/mips/convolve8_avg_horiz_dspr2.c"
    "${AOM_ROOT}/aom_dsp/mips/convolve8_dspr2.c"
    "${AOM_ROOT}/aom_dsp/mips/convolve8_horiz_dspr2.c"
    "${AOM_ROOT}/aom_dsp/mips/convolve8_vert_dspr2.c"
    "${AOM_ROOT}/aom_dsp/mips/convolve_common_dspr2.h"
    "${AOM_ROOT}/aom_dsp/mips/intrapred16_dspr2.c"
    "${AOM_ROOT}/aom_dsp/mips/intrapred4_dspr2.c"
    "${AOM_ROOT}/aom_dsp/mips/intrapred8_dspr2.c"
195 196 197 198 199 200 201 202 203 204 205 206 207
    "${AOM_ROOT}/aom_dsp/mips/inv_txfm_dspr2.h")

if (NOT CONFIG_PARALLEL_DEBLOCKING)
  set(AOM_DSP_COMMON_INTRIN_DSPR2
      ${AOM_DSP_COMMON_INTRIN_DSPR2}
      "${AOM_ROOT}/aom_dsp/mips/loopfilter_filters_dspr2.c"
      "${AOM_ROOT}/aom_dsp/mips/loopfilter_filters_dspr2.h"
      "${AOM_ROOT}/aom_dsp/mips/loopfilter_macros_dspr2.h"
      "${AOM_ROOT}/aom_dsp/mips/loopfilter_masks_dspr2.h"
      "${AOM_ROOT}/aom_dsp/mips/loopfilter_mb_dspr2.c"
      "${AOM_ROOT}/aom_dsp/mips/loopfilter_mb_horiz_dspr2.c"
      "${AOM_ROOT}/aom_dsp/mips/loopfilter_mb_vert_dspr2.c")
endif ()
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230

set(AOM_DSP_COMMON_INTRIN_MSA
    "${AOM_ROOT}/aom_dsp/mips/aom_convolve8_avg_horiz_msa.c"
    "${AOM_ROOT}/aom_dsp/mips/aom_convolve8_avg_msa.c"
    "${AOM_ROOT}/aom_dsp/mips/aom_convolve8_avg_vert_msa.c"
    "${AOM_ROOT}/aom_dsp/mips/aom_convolve8_horiz_msa.c"
    "${AOM_ROOT}/aom_dsp/mips/aom_convolve8_msa.c"
    "${AOM_ROOT}/aom_dsp/mips/aom_convolve8_vert_msa.c"
    "${AOM_ROOT}/aom_dsp/mips/aom_convolve_avg_msa.c"
    "${AOM_ROOT}/aom_dsp/mips/aom_convolve_copy_msa.c"
    "${AOM_ROOT}/aom_dsp/mips/aom_convolve_msa.h"
    "${AOM_ROOT}/aom_dsp/mips/fwd_dct32x32_msa.c"
    "${AOM_ROOT}/aom_dsp/mips/fwd_txfm_msa.c"
    "${AOM_ROOT}/aom_dsp/mips/fwd_txfm_msa.h"
    "${AOM_ROOT}/aom_dsp/mips/idct16x16_msa.c"
    "${AOM_ROOT}/aom_dsp/mips/idct32x32_msa.c"
    "${AOM_ROOT}/aom_dsp/mips/idct4x4_msa.c"
    "${AOM_ROOT}/aom_dsp/mips/idct8x8_msa.c"
    "${AOM_ROOT}/aom_dsp/mips/intrapred_msa.c"
    "${AOM_ROOT}/aom_dsp/mips/inv_txfm_msa.h"
    "${AOM_ROOT}/aom_dsp/mips/macros_msa.h"
    "${AOM_ROOT}/aom_dsp/mips/txfm_macros_msa.h")

231 232 233 234 235 236 237 238 239
if (NOT CONFIG_PARALLEL_DEBLOCKING)
  set(AOM_DSP_COMMON_INTRIN_MSA
      ${AOM_DSP_COMMON_INTRIN_MSA}
      "${AOM_ROOT}/aom_dsp/mips/loopfilter_16_msa.c"
      "${AOM_ROOT}/aom_dsp/mips/loopfilter_4_msa.c"
      "${AOM_ROOT}/aom_dsp/mips/loopfilter_8_msa.c"
      "${AOM_ROOT}/aom_dsp/mips/loopfilter_msa.h")
endif ()

240 241
  set(AOM_DSP_COMMON_ASM_SSE2
      ${AOM_DSP_COMMON_ASM_SSE2}
242 243
      "${AOM_ROOT}/aom_dsp/x86/aom_high_subpixel_8t_sse2.asm"
      "${AOM_ROOT}/aom_dsp/x86/aom_high_subpixel_bilinear_sse2.asm"
244 245 246 247
      "${AOM_ROOT}/aom_dsp/x86/highbd_intrapred_sse2.asm")

  set(AOM_DSP_COMMON_INTRIN_SSE2
      ${AOM_DSP_COMMON_INTRIN_SSE2}
248
      "${AOM_ROOT}/aom_dsp/x86/highbd_intrapred_sse2.c"
249
      "${AOM_ROOT}/aom_dsp/x86/highbd_loopfilter_sse2.c")
250

251 252 253 254
  set(AOM_DSP_COMMON_INTRIN_SSSE3
      ${AOM_DSP_COMMON_INTRIN_SSSE3}
      "${AOM_ROOT}/aom_dsp/x86/highbd_intrapred_ssse3.c")

255 256
  set(AOM_DSP_COMMON_INTRIN_AVX2
      ${AOM_DSP_COMMON_INTRIN_AVX2}
Yi Luo's avatar
Yi Luo committed
257
      "${AOM_ROOT}/aom_dsp/x86/highbd_convolve_avx2.c"
258
      "${AOM_ROOT}/aom_dsp/x86/highbd_intrapred_avx2.c"
Yi Luo's avatar
Yi Luo committed
259
      "${AOM_ROOT}/aom_dsp/x86/highbd_loopfilter_avx2.c")
260

Sebastien Alaiwan's avatar
Sebastien Alaiwan committed
261 262 263 264
set(AOM_DSP_COMMON_SOURCES
    ${AOM_DSP_COMMON_SOURCES}
    "${AOM_ROOT}/aom_dsp/entcode.c"
    "${AOM_ROOT}/aom_dsp/entcode.h")
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281

if (CONFIG_AV1)
  set(AOM_DSP_COMMON_SOURCES
      ${AOM_DSP_COMMON_SOURCES}
      "${AOM_ROOT}/aom_dsp/inv_txfm.c"
      "${AOM_ROOT}/aom_dsp/inv_txfm.h")

  set(AOM_DSP_COMMON_ASM_SSE2
      ${AOM_DSP_COMMON_ASM_SSE2}
      "${AOM_ROOT}/aom_dsp/x86/inv_wht_sse2.asm")

  set(AOM_DSP_COMMON_INTRIN_SSE2
      ${AOM_DSP_COMMON_INTRIN_SSE2}
      "${AOM_ROOT}/aom_dsp/x86/inv_txfm_sse2.c"
      "${AOM_ROOT}/aom_dsp/x86/inv_txfm_sse2.h")
endif ()

282
if (CONFIG_AV1_DECODER)
283
  set(AOM_DSP_DECODER_SOURCES
Tom Finegan's avatar
Tom Finegan committed
284 285
      "${AOM_ROOT}/aom_dsp/binary_codes_reader.c"
      "${AOM_ROOT}/aom_dsp/binary_codes_reader.h"
286 287 288 289
      "${AOM_ROOT}/aom_dsp/bitreader.h"
      "${AOM_ROOT}/aom_dsp/bitreader_buffer.c"
      "${AOM_ROOT}/aom_dsp/bitreader_buffer.h")

Sebastien Alaiwan's avatar
Sebastien Alaiwan committed
290 291 292 293 294 295
  set(AOM_DSP_DECODER_SOURCES
      ${AOM_DSP_DECODER_SOURCES}
      "${AOM_ROOT}/aom_dsp/daalaboolreader.c"
      "${AOM_ROOT}/aom_dsp/daalaboolreader.h"
      "${AOM_ROOT}/aom_dsp/entdec.c"
      "${AOM_ROOT}/aom_dsp/entdec.h")
Andrey Norkin's avatar
Andrey Norkin committed
296 297 298 299 300 301

  set(AOM_DSP_DECODER_SOURCES
      ${AOM_DSP_DECODER_SOURCES}
      "${AOM_ROOT}/aom_dsp/grain_synthesis.c"
      "${AOM_ROOT}/aom_dsp/grain_synthesis.h")

302 303
endif ()

304
if (CONFIG_AV1_ENCODER)
305
  set(AOM_DSP_ENCODER_SOURCES
Tom Finegan's avatar
Tom Finegan committed
306 307
      "${AOM_ROOT}/aom_dsp/binary_codes_writer.c"
      "${AOM_ROOT}/aom_dsp/binary_codes_writer.h"
308 309 310
      "${AOM_ROOT}/aom_dsp/bitwriter.h"
      "${AOM_ROOT}/aom_dsp/bitwriter_buffer.c"
      "${AOM_ROOT}/aom_dsp/bitwriter_buffer.h"
311 312 313 314
      "${AOM_ROOT}/aom_dsp/noise_util.h"
      "${AOM_ROOT}/aom_dsp/noise_util.c"
      "${AOM_ROOT}/aom_dsp/noise_model.c"
      "${AOM_ROOT}/aom_dsp/noise_model.c"
315 316
      "${AOM_ROOT}/aom_dsp/psnr.c"
      "${AOM_ROOT}/aom_dsp/psnr.h"
317
      "${AOM_ROOT}/aom_dsp/sad.c"
Sebastien Alaiwan's avatar
Sebastien Alaiwan committed
318
      "${AOM_ROOT}/aom_dsp/sad_av1.c"
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342
      "${AOM_ROOT}/aom_dsp/variance.c"
      "${AOM_ROOT}/aom_dsp/variance.h")

  set(AOM_DSP_ENCODER_ASM_SSE2
      ${AOM_DSP_ENCODER_ASM_SSE2}
      "${AOM_ROOT}/aom_dsp/x86/halfpix_variance_impl_sse2.asm"
      "${AOM_ROOT}/aom_dsp/x86/sad4d_sse2.asm"
      "${AOM_ROOT}/aom_dsp/x86/sad_sse2.asm"
      "${AOM_ROOT}/aom_dsp/x86/subtract_sse2.asm"
      "${AOM_ROOT}/aom_dsp/x86/subpel_variance_sse2.asm")

  set(AOM_DSP_ENCODER_INTRIN_SSE2
      "${AOM_ROOT}/aom_dsp/x86/quantize_sse2.c")

  set(AOM_DSP_ENCODER_ASM_SSSE3
      "${AOM_ROOT}/aom_dsp/x86/sad_ssse3.asm")

  set(AOM_DSP_ENCODER_ASM_SSSE3_X86_64
      "${AOM_ROOT}/aom_dsp/x86/fwd_txfm_ssse3_x86_64.asm"
      "${AOM_ROOT}/aom_dsp/x86/ssim_opt_x86_64.asm")

  set(AOM_DSP_ENCODER_INTRIN_SSE3 "${AOM_ROOT}/aom_dsp/x86/sad_sse3.asm")
  set(AOM_DSP_ENCODER_ASM_SSE4_1 "${AOM_ROOT}/aom_dsp/x86/sad_sse4.asm")

343
  set(AOM_DSP_ENCODER_INTRIN_AVX2
Yi Luo's avatar
Yi Luo committed
344 345 346
      "${AOM_ROOT}/aom_dsp/x86/fwd_dct32x32_impl_avx2.h"
      "${AOM_ROOT}/aom_dsp/x86/fwd_txfm_avx2.c"
      "${AOM_ROOT}/aom_dsp/x86/fwd_txfm_avx2.h"
347
      "${AOM_ROOT}/aom_dsp/x86/highbd_quantize_intrin_avx2.c"
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372
      "${AOM_ROOT}/aom_dsp/x86/sad4d_avx2.c"
      "${AOM_ROOT}/aom_dsp/x86/sad_avx2.c"
      "${AOM_ROOT}/aom_dsp/x86/sad_impl_avx2.c"
      "${AOM_ROOT}/aom_dsp/x86/variance_avx2.c"
      "${AOM_ROOT}/aom_dsp/x86/variance_impl_avx2.c")

  if (CONFIG_AV1_ENCODER)
    set(AOM_DSP_ENCODER_SOURCES
        ${AOM_DSP_ENCODER_SOURCES}
        "${AOM_ROOT}/aom_dsp/avg.c"
        "${AOM_ROOT}/aom_dsp/fwd_txfm.c"
        "${AOM_ROOT}/aom_dsp/fwd_txfm.h"
        "${AOM_ROOT}/aom_dsp/quantize.c"
        "${AOM_ROOT}/aom_dsp/quantize.h"
        "${AOM_ROOT}/aom_dsp/sum_squares.c")

    set(AOM_DSP_ENCODER_INTRIN_SSE2
        ${AOM_DSP_ENCODER_INTRIN_SSE2}
        "${AOM_ROOT}/aom_dsp/x86/avg_intrin_sse2.c"
        "${AOM_ROOT}/aom_dsp/x86/fwd_dct32_8cols_sse2.c"
        "${AOM_ROOT}/aom_dsp/x86/fwd_dct32x32_impl_sse2.h"
        "${AOM_ROOT}/aom_dsp/x86/fwd_txfm_impl_sse2.h"
        "${AOM_ROOT}/aom_dsp/x86/fwd_txfm_sse2.c"
        "${AOM_ROOT}/aom_dsp/x86/fwd_txfm_sse2.h"
        "${AOM_ROOT}/aom_dsp/x86/halfpix_variance_sse2.c"
373
        "${AOM_ROOT}/aom_dsp/x86/highbd_quantize_intrin_sse2.c"
374 375 376 377 378 379 380 381 382 383 384 385
        "${AOM_ROOT}/aom_dsp/x86/variance_sse2.c"
        "${AOM_ROOT}/aom_dsp/x86/sum_squares_sse2.c")

    set(AOM_DSP_ENCODER_ASM_SSSE3_X86_64
        ${AOM_DSP_ENCODER_ASM_SSSE3_X86_64}
        "${AOM_ROOT}/aom_dsp/x86/avg_ssse3_x86_64.asm"
        "${AOM_ROOT}/aom_dsp/x86/quantize_ssse3_x86_64.asm")

    set(AOM_DSP_ENCODER_AVX_ASM_X86_64
        ${AOM_DSP_ENCODER_AVX_ASM_X86_64}
        "${AOM_ROOT}/aom_dsp/x86/quantize_avx_x86_64.asm")

386 387 388 389 390 391
    set(AOM_DSP_ENCODER_INTRIN_MSA
        "${AOM_ROOT}/aom_dsp/mips/sad_msa.c"
        "${AOM_ROOT}/aom_dsp/mips/subtract_msa.c"
        "${AOM_ROOT}/aom_dsp/mips/variance_msa.c"
        "${AOM_ROOT}/aom_dsp/mips/sub_pixel_variance_msa.c")

392 393 394 395 396
      set(AOM_DSP_ENCODER_INTRIN_SSSE3
          ${AOM_DSP_ENCODER_INTRIN_SSSE3}
          "${AOM_ROOT}/aom_dsp/x86/masked_sad_intrin_ssse3.c"
          "${AOM_ROOT}/aom_dsp/x86/masked_variance_intrin_ssse3.c")

397 398 399 400 401 402 403 404 405 406
      set(AOM_DSP_ENCODER_INTRIN_SSE2
          ${AOM_DSP_ENCODER_INTRIN_SSE2}
          "${AOM_ROOT}/aom_dsp/x86/highbd_subtract_sse2.c")
  endif ()

    set(AOM_DSP_ENCODER_ASM_SSE2
        ${AOM_DSP_ENCODER_ASM_SSE2}
        "${AOM_ROOT}/aom_dsp/x86/highbd_sad4d_sse2.asm"
        "${AOM_ROOT}/aom_dsp/x86/highbd_sad_sse2.asm"
        "${AOM_ROOT}/aom_dsp/x86/highbd_subpel_variance_impl_sse2.asm"
407
        "${AOM_ROOT}/aom_dsp/x86/highbd_variance_impl_sse2.asm")
408 409 410 411 412 413 414 415 416

    set(AOM_DSP_ENCODER_INTRIN_SSE2
        ${AOM_DSP_ENCODER_INTRIN_SSE2}
        "${AOM_ROOT}/aom_dsp/x86/highbd_variance_sse2.c")

    set(AOM_DSP_ENCODER_INTRIN_SSE4_1
        ${AOM_DSP_ENCODER_INTRIN_SSE4_1}
        "${AOM_ROOT}/aom_dsp/x86/highbd_variance_sse4.c")

417 418
    set(AOM_DSP_ENCODER_INTRIN_AVX2
        ${AOM_DSP_ENCODER_INTRIN_AVX2}
419 420
        "${AOM_ROOT}/aom_dsp/x86/sad_highbd_avx2.c")

Sebastien Alaiwan's avatar
Sebastien Alaiwan committed
421 422 423 424 425 426
  set(AOM_DSP_ENCODER_SOURCES
      ${AOM_DSP_ENCODER_SOURCES}
      "${AOM_ROOT}/aom_dsp/daalaboolwriter.c"
      "${AOM_ROOT}/aom_dsp/daalaboolwriter.h"
      "${AOM_ROOT}/aom_dsp/entenc.c"
      "${AOM_ROOT}/aom_dsp/entenc.h")
427 428 429 430 431 432 433 434 435 436 437

  if (CONFIG_INTERNAL_STATS)
    set(AOM_DSP_ENCODER_SOURCES
        ${AOM_DSP_ENCODER_SOURCES}
        "${AOM_ROOT}/aom_dsp/fastssim.c"
        "${AOM_ROOT}/aom_dsp/psnrhvs.c"
        "${AOM_ROOT}/aom_dsp/ssim.c"
        "${AOM_ROOT}/aom_dsp/ssim.h")
  endif ()
endif ()

438 439 440 441 442
if (CONFIG_LOOP_RESTORATION)
  set(AOM_DSP_COMMON_INTRIN_SSE2
      ${AOM_DSP_COMMON_INTRIN_SSE2}
      "${AOM_ROOT}/aom_dsp/x86/aom_convolve_hip_sse2.c")

443 444 445 446 447 448 449 450 451 452 453
  set(AOM_DSP_COMMON_INTRIN_AVX2
      ${AOM_DSP_COMMON_INTRIN_AVX2}
      "${AOM_ROOT}/aom_dsp/x86/aom_convolve_hip_avx2.c")

  set(AOM_DSP_COMMON_INTRIN_SSSE3
     ${AOM_DSP_COMMON_INTRIN_SSSE3}
     "${AOM_ROOT}/aom_dsp/x86/aom_highbd_convolve_hip_ssse3.c")

  set(AOM_DSP_COMMON_INTRIN_AVX2
      ${AOM_DSP_COMMON_INTRIN_AVX2}
      "${AOM_ROOT}/aom_dsp/x86/aom_highbd_convolve_hip_avx2.c")
454 455
endif ()

456 457 458 459
set(AOM_DSP_ENCODER_INTRIN_SSE4_1
    ${AOM_DSP_ENCODER_INTRIN_SSE4_1}
    "${AOM_ROOT}/aom_dsp/x86/obmc_sad_sse4.c"
    "${AOM_ROOT}/aom_dsp/x86/obmc_variance_sse4.c")
460 461 462 463 464

# Creates aom_dsp build targets. Must not be called until after libaom target
# has been created.
function (setup_aom_dsp_targets)
  add_library(aom_dsp_common OBJECT ${AOM_DSP_COMMON_SOURCES})
465
  list(APPEND AOM_LIB_TARGETS aom_dsp_common)
466 467 468
  create_dummy_source_file("aom_av1" "c" "dummy_source_file")
  add_library(aom_dsp OBJECT "${dummy_source_file}")
  target_sources(aom PRIVATE $<TARGET_OBJECTS:aom_dsp_common>)
469 470 471 472 473
  list(APPEND AOM_LIB_TARGETS aom_dsp)

  # Not all generators support libraries consisting only of object files. Add a
  # dummy source file to the aom_dsp target.
  add_dummy_source_file_to_target("aom_dsp" "c")
474

475
  if (CONFIG_AV1_DECODER)
476
    add_library(aom_dsp_decoder OBJECT ${AOM_DSP_DECODER_SOURCES})
477
    set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_dsp_decoder)
478
    target_sources(aom PRIVATE $<TARGET_OBJECTS:aom_dsp_decoder>)
479 480
  endif ()

481
  if (CONFIG_AV1_ENCODER)
482
    add_library(aom_dsp_encoder OBJECT ${AOM_DSP_ENCODER_SOURCES})
483
    set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_dsp_encoder)
484
    target_sources(aom PRIVATE $<TARGET_OBJECTS:aom_dsp_encoder>)
485 486 487
  endif ()

  if (HAVE_SSE2)
488
    add_asm_library("aom_dsp_common_sse2" "AOM_DSP_COMMON_ASM_SSE2" "aom")
489
    add_intrinsics_object_library("-msse2" "sse2" "aom_dsp_common"
490
                                   "AOM_DSP_COMMON_INTRIN_SSE2" "aom")
491

492
    if (CONFIG_AV1_ENCODER)
493
      add_asm_library("aom_dsp_encoder_sse2" "AOM_DSP_ENCODER_ASM_SSE2"
494
                      "aom")
495
      add_intrinsics_object_library("-msse2" "sse2" "aom_dsp_encoder"
496
                                    "AOM_DSP_ENCODER_INTRIN_SSE2" "aom")
497 498 499
    endif()
  endif ()

500
  if (HAVE_SSE3 AND CONFIG_AV1_ENCODER)
501
    add_asm_library("aom_dsp_encoder_sse3" "AOM_DSP_ENCODER_INTRIN_SSE3" "aom")
502 503 504
  endif ()

  if (HAVE_SSSE3)
505
    add_asm_library("aom_dsp_common_ssse3" "AOM_DSP_COMMON_ASM_SSSE3" "aom")
506
    add_intrinsics_object_library("-mssse3" "ssse3" "aom_dsp_common"
507
                                  "AOM_DSP_COMMON_INTRIN_SSSE3" "aom")
508

509
    if (CONFIG_AV1_ENCODER)
510 511 512 513
      if ("${AOM_TARGET_CPU}" STREQUAL "x86_64")
        list(APPEND AOM_DSP_ENCODER_ASM_SSSE3
             ${AOM_DSP_ENCODER_ASM_SSSE3_X86_64})
      endif ()
514
      add_asm_library("aom_dsp_encoder_ssse3" "AOM_DSP_ENCODER_ASM_SSSE3" "aom")
515 516
      if (AOM_DSP_ENCODER_INTRIN_SSSE3)
        add_intrinsics_object_library("-mssse3" "ssse3" "aom_dsp_encoder"
517
                                      "AOM_DSP_ENCODER_INTRIN_SSSE3" "aom")
518
      endif ()
519 520 521 522 523
    endif ()
  endif ()

  if (HAVE_SSE4_1)
    add_intrinsics_object_library("-msse4.1" "sse4_1" "aom_dsp_common"
524
                                  "AOM_DSP_COMMON_INTRIN_SSE4_1" "aom")
525
    if (CONFIG_AV1_ENCODER)
526 527
      if (AOM_DSP_ENCODER_INTRIN_SSE4_1)
        add_intrinsics_object_library("-msse4.1" "sse4_1" "aom_dsp_encoder"
528
                                      "AOM_DSP_ENCODER_INTRIN_SSE4_1" "aom")
529 530
      endif ()
      add_asm_library("aom_dsp_encoder_sse4_1" "AOM_DSP_ENCODER_ASM_SSE4_1"
531
                      "aom")
532 533 534 535
    endif ()
  endif ()

  if (HAVE_AVX AND "${AOM_TARGET_CPU}" STREQUAL "x86_64")
536 537
    if (CONFIG_AV1_ENCODER)
      add_asm_library("aom_dsp_encoder_avx" "AOM_DSP_ENCODER_AVX_ASM_X86_64"
538
                      "aom")
539
    endif ()
540 541 542 543
  endif ()

  if (HAVE_AVX2)
    add_intrinsics_object_library("-mavx2" "avx2" "aom_dsp_common"
544
                                  "AOM_DSP_COMMON_INTRIN_AVX2" "aom")
545
    if (CONFIG_AV1_ENCODER)
546
      add_intrinsics_object_library("-mavx2" "avx2" "aom_dsp_encoder"
547
                                    "AOM_DSP_ENCODER_INTRIN_AVX2" "aom")
548 549 550
    endif ()
  endif ()

551 552
  if (HAVE_NEON_ASM)
    if (AOM_ADS2GAS_REQUIRED)
553
      add_gas_asm_library("aom_dsp_common_neon" "AOM_DSP_COMMON_ASM_NEON" "aom")
554
    else ()
555
      add_asm_library("aom_dsp_common_neon" "AOM_DSP_COMMON_ASM_NEON" "aom")
556 557 558 559 560
    endif ()
  endif ()

  if (HAVE_NEON)
    add_intrinsics_object_library("${AOM_NEON_INTRIN_FLAG}" "neon"
561
                                  "aom_dsp_common" "AOM_DSP_COMMON_INTRIN_NEON"
562
                                  "aom")
563
  endif ()
564 565 566

  if (HAVE_DSPR2)
    add_intrinsics_object_library("" "dspr2" "aom_dsp_common"
567
                                  "AOM_DSP_COMMON_INTRIN_DSPR2" "aom")
568 569 570 571
  endif ()

  if (HAVE_MSA)
    add_intrinsics_object_library("" "msa" "aom_dsp_common"
572
                                  "AOM_DSP_COMMON_INTRIN_MSA" "aom")
573
    if (CONFIG_AV1_ENCODER)
574
      add_intrinsics_object_library("" "msa" "aom_dsp_encoder"
575
                                    "AOM_DSP_ENCODER_INTRIN_MSA" "aom")
576 577 578
    endif ()
  endif ()

579 580 581 582
  # Pass the new lib targets up to the parent scope instance of
  # $AOM_LIB_TARGETS.
  set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} PARENT_SCOPE)
endfunction ()
583 584

endif ()  # AOM_AOM_DSP_AOM_DSP_CMAKE_