aom_dsp.cmake 21.4 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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
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"
    "${AOM_ROOT}/aom_dsp/loopfilter.c"
    "${AOM_ROOT}/aom_dsp/prob.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/txfm_common_sse2.h"
Yi Luo's avatar
Yi Luo committed
50
    "${AOM_ROOT}/aom_dsp/x86/lpf_common_sse2.h"
51 52 53 54 55 56 57 58
    "${AOM_ROOT}/aom_dsp/x86/loopfilter_sse2.c")

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
59
    "${AOM_ROOT}/aom_dsp/x86/aom_subpixel_8t_intrin_ssse3.c"
60
    "${AOM_ROOT}/aom_dsp/x86/intrapred_ssse3.c"
Tom Finegan's avatar
Tom Finegan committed
61
    "${AOM_ROOT}/aom_dsp/x86/inv_txfm_ssse3.c")
62 63 64 65 66 67

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")

68
set(AOM_DSP_COMMON_INTRIN_AVX2
69
    "${AOM_ROOT}/aom_dsp/x86/aom_subpixel_8t_intrin_avx2.c"
70
    "${AOM_ROOT}/aom_dsp/x86/intrapred_avx2.c"
Yi Luo's avatar
Yi Luo committed
71
    "${AOM_ROOT}/aom_dsp/x86/inv_txfm_avx2.c"
Yi Luo's avatar
Yi Luo committed
72
    "${AOM_ROOT}/aom_dsp/x86/common_avx2.h"
Yi Luo's avatar
Yi Luo committed
73 74
    "${AOM_ROOT}/aom_dsp/x86/inv_txfm_common_avx2.h"
    "${AOM_ROOT}/aom_dsp/x86/txfm_common_avx2.h")
75

76 77 78 79 80 81
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 ()

82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
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"
    "${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")

98 99 100 101 102 103 104 105 106
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 ()

107 108 109 110 111 112 113 114 115 116 117 118 119
set(AOM_DSP_COMMON_INTRIN_NEON
    "${AOM_ROOT}/aom_dsp/arm/aom_convolve_neon.c"
    "${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")

120 121 122 123 124 125
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 ()

126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
if ("${AOM_TARGET_CPU}" STREQUAL "arm64")
  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"
      "${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"
141 142 143 144 145 146 147 148 149
      "${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 ()
150 151
endif ()

152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
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"
169 170 171 172 173 174 175 176 177 178 179 180 181
    "${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 ()
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204

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")

205 206 207 208 209 210 211 212 213
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 ()

214
if (CONFIG_HIGHBITDEPTH)
215 216
  set(AOM_DSP_COMMON_ASM_SSE2
      ${AOM_DSP_COMMON_ASM_SSE2}
217 218
      "${AOM_ROOT}/aom_dsp/x86/aom_high_subpixel_8t_sse2.asm"
      "${AOM_ROOT}/aom_dsp/x86/aom_high_subpixel_bilinear_sse2.asm"
219 220 221 222
      "${AOM_ROOT}/aom_dsp/x86/highbd_intrapred_sse2.asm")

  set(AOM_DSP_COMMON_INTRIN_SSE2
      ${AOM_DSP_COMMON_INTRIN_SSE2}
223
      "${AOM_ROOT}/aom_dsp/x86/highbd_intrapred_sse2.c"
224
      "${AOM_ROOT}/aom_dsp/x86/highbd_loopfilter_sse2.c")
225 226 227

  set(AOM_DSP_COMMON_INTRIN_AVX2
      ${AOM_DSP_COMMON_INTRIN_AVX2}
Yi Luo's avatar
Yi Luo committed
228 229
      "${AOM_ROOT}/aom_dsp/x86/highbd_convolve_avx2.c"
      "${AOM_ROOT}/aom_dsp/x86/highbd_loopfilter_avx2.c")
230 231 232 233 234 235 236 237
else ()
  set(AOM_DSP_COMMON_INTRIN_DSPR2
      ${AOM_DSP_COMMON_INTRIN_DSPR2}
      "${AOM_ROOT}/aom_dsp/mips/itrans16_dspr2.c"
      "${AOM_ROOT}/aom_dsp/mips/itrans32_cols_dspr2.c"
      "${AOM_ROOT}/aom_dsp/mips/itrans32_dspr2.c"
      "${AOM_ROOT}/aom_dsp/mips/itrans4_dspr2.c"
      "${AOM_ROOT}/aom_dsp/mips/itrans8_dspr2.c")
238 239 240 241 242 243
endif ()

if (CONFIG_ANS)
  set(AOM_DSP_COMMON_SOURCES
      ${AOM_DSP_COMMON_SOURCES}
      "${AOM_ROOT}/aom_dsp/ans.h")
244
else ()
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266
  set(AOM_DSP_COMMON_SOURCES
      ${AOM_DSP_COMMON_SOURCES}
      "${AOM_ROOT}/aom_dsp/entcode.c"
      "${AOM_ROOT}/aom_dsp/entcode.h")
endif ()

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 ()

267
if (CONFIG_AV1_DECODER)
268
  set(AOM_DSP_DECODER_SOURCES
Tom Finegan's avatar
Tom Finegan committed
269 270
      "${AOM_ROOT}/aom_dsp/binary_codes_reader.c"
      "${AOM_ROOT}/aom_dsp/binary_codes_reader.h"
271 272 273 274 275 276 277 278
      "${AOM_ROOT}/aom_dsp/bitreader.h"
      "${AOM_ROOT}/aom_dsp/bitreader_buffer.c"
      "${AOM_ROOT}/aom_dsp/bitreader_buffer.h")

  if (CONFIG_ANS)
    set(AOM_DSP_DECODER_SOURCES
        ${AOM_DSP_DECODER_SOURCES}
        "${AOM_ROOT}/aom_dsp/ansreader.h")
279
  else ()
280 281 282 283 284 285 286 287 288
    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")
  endif ()
endif ()

289
if (CONFIG_AV1_ENCODER)
290
  set(AOM_DSP_ENCODER_SOURCES
Tom Finegan's avatar
Tom Finegan committed
291 292
      "${AOM_ROOT}/aom_dsp/binary_codes_writer.c"
      "${AOM_ROOT}/aom_dsp/binary_codes_writer.h"
293 294 295 296 297
      "${AOM_ROOT}/aom_dsp/bitwriter.h"
      "${AOM_ROOT}/aom_dsp/bitwriter_buffer.c"
      "${AOM_ROOT}/aom_dsp/bitwriter_buffer.h"
      "${AOM_ROOT}/aom_dsp/psnr.c"
      "${AOM_ROOT}/aom_dsp/psnr.h"
298
      "${AOM_ROOT}/aom_dsp/sad.c"
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322
      "${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")

323
  set(AOM_DSP_ENCODER_INTRIN_AVX2
Yi Luo's avatar
Yi Luo committed
324 325 326
      "${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"
327
      "${AOM_ROOT}/aom_dsp/x86/highbd_quantize_intrin_avx2.c"
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352
      "${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"
353
        "${AOM_ROOT}/aom_dsp/x86/highbd_quantize_intrin_sse2.c"
354 355 356 357 358 359 360 361 362 363 364 365
        "${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")

366 367 368 369 370 371
    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")

372 373 374 375 376
      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")

377
    if (CONFIG_HIGHBITDEPTH)
378 379 380 381 382 383
      set(AOM_DSP_ENCODER_INTRIN_SSE2
          ${AOM_DSP_ENCODER_INTRIN_SSE2}
          "${AOM_ROOT}/aom_dsp/x86/highbd_subtract_sse2.c")
    endif ()
  endif ()

384
  if (CONFIG_HIGHBITDEPTH)
385 386 387 388 389
    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"
390
        "${AOM_ROOT}/aom_dsp/x86/highbd_variance_impl_sse2.asm")
391 392 393 394 395 396 397 398 399

    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")

400 401
    set(AOM_DSP_ENCODER_INTRIN_AVX2
        ${AOM_DSP_ENCODER_INTRIN_AVX2}
402 403 404 405 406 407 408 409 410
        "${AOM_ROOT}/aom_dsp/x86/sad_highbd_avx2.c")
  endif ()

  if (CONFIG_ANS)
    set(AOM_DSP_ENCODER_SOURCES
        ${AOM_DSP_ENCODER_SOURCES}
        "${AOM_ROOT}/aom_dsp/answriter.h"
        "${AOM_ROOT}/aom_dsp/buf_ans.c"
        "${AOM_ROOT}/aom_dsp/buf_ans.h")
411
  else ()
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429
    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")
  endif ()

  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 ()

430 431 432 433 434 435 436 437 438 439 440 441
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")

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

442 443 444 445 446 447 448 449 450 451 452
if (CONFIG_MOTION_VAR)
  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")
endif ()

# 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})
453
  list(APPEND AOM_LIB_TARGETS aom_dsp_common)
454 455 456
  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>)
457 458 459 460 461
  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")
462

463
  if (CONFIG_AV1_DECODER)
464
    add_library(aom_dsp_decoder OBJECT ${AOM_DSP_DECODER_SOURCES})
465
    set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_dsp_decoder)
466
    target_sources(aom PRIVATE $<TARGET_OBJECTS:aom_dsp_decoder>)
467 468
  endif ()

469
  if (CONFIG_AV1_ENCODER)
470
    add_library(aom_dsp_encoder OBJECT ${AOM_DSP_ENCODER_SOURCES})
471
    set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_dsp_encoder)
472
    target_sources(aom PRIVATE $<TARGET_OBJECTS:aom_dsp_encoder>)
473 474 475
  endif ()

  if (HAVE_SSE2)
476
    add_asm_library("aom_dsp_common_sse2" "AOM_DSP_COMMON_ASM_SSE2" "aom")
477
    add_intrinsics_object_library("-msse2" "sse2" "aom_dsp_common"
478
                                   "AOM_DSP_COMMON_INTRIN_SSE2" "aom")
479

480
    if (CONFIG_AV1_ENCODER)
481
      add_asm_library("aom_dsp_encoder_sse2" "AOM_DSP_ENCODER_ASM_SSE2"
482
                      "aom")
483
      add_intrinsics_object_library("-msse2" "sse2" "aom_dsp_encoder"
484
                                    "AOM_DSP_ENCODER_INTRIN_SSE2" "aom")
485 486 487
    endif()
  endif ()

488
  if (HAVE_SSE3 AND CONFIG_AV1_ENCODER)
489
    add_asm_library("aom_dsp_encoder_sse3" "AOM_DSP_ENCODER_INTRIN_SSE3" "aom")
490 491 492
  endif ()

  if (HAVE_SSSE3)
493
    add_asm_library("aom_dsp_common_ssse3" "AOM_DSP_COMMON_ASM_SSSE3" "aom")
494
    add_intrinsics_object_library("-mssse3" "ssse3" "aom_dsp_common"
495
                                  "AOM_DSP_COMMON_INTRIN_SSSE3" "aom")
496

497
    if (CONFIG_AV1_ENCODER)
498 499 500 501
      if ("${AOM_TARGET_CPU}" STREQUAL "x86_64")
        list(APPEND AOM_DSP_ENCODER_ASM_SSSE3
             ${AOM_DSP_ENCODER_ASM_SSSE3_X86_64})
      endif ()
502
      add_asm_library("aom_dsp_encoder_ssse3" "AOM_DSP_ENCODER_ASM_SSSE3" "aom")
503 504
      if (AOM_DSP_ENCODER_INTRIN_SSSE3)
        add_intrinsics_object_library("-mssse3" "ssse3" "aom_dsp_encoder"
505
                                      "AOM_DSP_ENCODER_INTRIN_SSSE3" "aom")
506
      endif ()
507 508 509 510 511
    endif ()
  endif ()

  if (HAVE_SSE4_1)
    add_intrinsics_object_library("-msse4.1" "sse4_1" "aom_dsp_common"
512
                                  "AOM_DSP_COMMON_INTRIN_SSE4_1" "aom")
513
    if (CONFIG_AV1_ENCODER)
514 515
      if (AOM_DSP_ENCODER_INTRIN_SSE4_1)
        add_intrinsics_object_library("-msse4.1" "sse4_1" "aom_dsp_encoder"
516
                                      "AOM_DSP_ENCODER_INTRIN_SSE4_1" "aom")
517 518
      endif ()
      add_asm_library("aom_dsp_encoder_sse4_1" "AOM_DSP_ENCODER_ASM_SSE4_1"
519
                      "aom")
520 521 522 523
    endif ()
  endif ()

  if (HAVE_AVX AND "${AOM_TARGET_CPU}" STREQUAL "x86_64")
524 525
    if (CONFIG_AV1_ENCODER)
      add_asm_library("aom_dsp_encoder_avx" "AOM_DSP_ENCODER_AVX_ASM_X86_64"
526
                      "aom")
527
    endif ()
528 529 530 531
  endif ()

  if (HAVE_AVX2)
    add_intrinsics_object_library("-mavx2" "avx2" "aom_dsp_common"
532
                                  "AOM_DSP_COMMON_INTRIN_AVX2" "aom")
533
    if (CONFIG_AV1_ENCODER)
534
      add_intrinsics_object_library("-mavx2" "avx2" "aom_dsp_encoder"
535
                                    "AOM_DSP_ENCODER_INTRIN_AVX2" "aom")
536 537 538
    endif ()
  endif ()

539 540
  if (HAVE_NEON_ASM)
    if (AOM_ADS2GAS_REQUIRED)
541
      add_gas_asm_library("aom_dsp_common_neon" "AOM_DSP_COMMON_ASM_NEON" "aom")
542
    else ()
543
      add_asm_library("aom_dsp_common_neon" "AOM_DSP_COMMON_ASM_NEON" "aom")
544 545 546 547 548
    endif ()
  endif ()

  if (HAVE_NEON)
    add_intrinsics_object_library("${AOM_NEON_INTRIN_FLAG}" "neon"
549
                                  "aom_dsp_common" "AOM_DSP_COMMON_INTRIN_NEON"
550
                                  "aom")
551
  endif ()
552 553 554

  if (HAVE_DSPR2)
    add_intrinsics_object_library("" "dspr2" "aom_dsp_common"
555
                                  "AOM_DSP_COMMON_INTRIN_DSPR2" "aom")
556 557 558 559
  endif ()

  if (HAVE_MSA)
    add_intrinsics_object_library("" "msa" "aom_dsp_common"
560
                                  "AOM_DSP_COMMON_INTRIN_MSA" "aom")
561
    if (CONFIG_AV1_ENCODER)
562
      add_intrinsics_object_library("" "msa" "aom_dsp_encoder"
563
                                    "AOM_DSP_ENCODER_INTRIN_MSA" "aom")
564 565 566
    endif ()
  endif ()

567 568 569 570
  # 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 ()
571 572

endif ()  # AOM_AOM_DSP_AOM_DSP_CMAKE_