Commit 50c5a7e9 authored by Tom Finegan's avatar Tom Finegan

Add support for x86_64 assembly and intrinsics to the cmake build.

Darwin/Linux x86_64 only.

BUG=https://bugs.chromium.org/p/aomedia/issues/detail?id=76

Change-Id: I1500c085f26066ac0108017b5155aba0f003427c
parent 0d3aeda3
......@@ -14,12 +14,11 @@ project(AOM C CXX)
set(AOM_ROOT "${CMAKE_CURRENT_SOURCE_DIR}")
set(AOM_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}")
# TODO(tomfinegan): Host auto detect goes here when $AOM_TARGET is empty.
set(AOM_TARGET "generic")
include("${AOM_ROOT}/build/cmake/aom_configure.cmake")
include("${AOM_ROOT}/build/cmake/aom_optimization.cmake")
# TODO(tomfinegan): Use libwebm's cmake support directly.
set(AOM_LIBWEBM_SRCS
set(AOM_LIBWEBM_SOURCES
"${AOM_ROOT}/third_party/libwebm/common/hdr_util.cc"
"${AOM_ROOT}/third_party/libwebm/common/hdr_util.h"
"${AOM_ROOT}/third_party/libwebm/common/webmids.h"
......@@ -35,7 +34,7 @@ set(AOM_LIBWEBM_SRCS
"${AOM_ROOT}/third_party/libwebm/mkvparser/mkvreader.cc"
"${AOM_ROOT}/third_party/libwebm/mkvparser/mkvreader.h")
set(AOM_LIBYUV_SRCS
set(AOM_LIBYUV_SOURCES
"${AOM_ROOT}/third_party/libyuv/include/libyuv/basic_types.h"
"${AOM_ROOT}/third_party/libyuv/include/libyuv/convert.h"
"${AOM_ROOT}/third_party/libyuv/include/libyuv/convert_argb.h"
......@@ -64,7 +63,7 @@ set(AOM_LIBYUV_SRCS
"${AOM_ROOT}/third_party/libyuv/source/scale_neon64.cc"
"${AOM_ROOT}/third_party/libyuv/source/scale_win.cc")
set(AOM_SRCS
set(AOM_SOURCES
"${AOM_CONFIG_DIR}/aom_config.c"
"${AOM_CONFIG_DIR}/aom_config.h"
"${AOM_ROOT}/aom/aom.h"
......@@ -82,7 +81,7 @@ set(AOM_SRCS
"${AOM_ROOT}/aom/src/aom_encoder.c"
"${AOM_ROOT}/aom/src/aom_image.c")
set(AOM_DSP_SRCS
set(AOM_DSP_SOURCES
"${AOM_ROOT}/aom_dsp/aom_convolve.c"
"${AOM_ROOT}/aom_dsp/aom_convolve.h"
"${AOM_ROOT}/aom_dsp/aom_dsp_common.h"
......@@ -142,12 +141,12 @@ set(AOM_DSP_SRCS
"${AOM_ROOT}/aom_dsp/variance.h"
"${AOM_ROOT}/aom_dsp/x86/txfm_common_intrin.h")
set(AOM_MEM_SRCS
set(AOM_MEM_SOURCES
"${AOM_ROOT}/aom_mem/aom_mem.c"
"${AOM_ROOT}/aom_mem/aom_mem.h"
"${AOM_ROOT}/aom_mem/include/aom_mem_intrnl.h")
set(AOM_SCALE_SRCS
set(AOM_SCALE_SOURCES
"${AOM_ROOT}/aom_scale/aom_scale.h"
"${AOM_ROOT}/aom_scale/aom_scale_rtcd.c"
"${AOM_CONFIG_DIR}/aom_scale_rtcd.h"
......@@ -157,10 +156,7 @@ set(AOM_SCALE_SRCS
"${AOM_ROOT}/aom_scale/generic/yv12extend.c"
"${AOM_ROOT}/aom_scale/yv12config.h")
# TODO(tomfinegan): Extract aom_ports from aom_util if possible.
# TODO(tomfinegan): aom_ports has some target specific source files.
# aom_configure will need to set a var that gets picked up here.
set(AOM_UTIL_SRCS
set(AOM_UTIL_SOURCES
"${AOM_ROOT}/aom_ports/aom_once.h"
"${AOM_ROOT}/aom_ports/aom_timer.h"
"${AOM_ROOT}/aom_ports/bitops.h"
......@@ -174,7 +170,7 @@ set(AOM_UTIL_SRCS
"${AOM_ROOT}/aom_util/aom_thread.h"
"${AOM_ROOT}/aom_util/endian_inl.h")
set(AOM_AV1_COMMON_SRCS
set(AOM_AV1_COMMON_SOURCES
"${AOM_ROOT}/av1/av1_iface_common.h"
"${AOM_ROOT}/av1/common/alloccommon.c"
"${AOM_ROOT}/av1/common/alloccommon.h"
......@@ -237,7 +233,7 @@ set(AOM_AV1_COMMON_SRCS
"${AOM_ROOT}/av1/common/tile_common.c"
"${AOM_ROOT}/av1/common/tile_common.h")
set(AOM_AV1_DECODER_SRCS
set(AOM_AV1_DECODER_SOURCES
"${AOM_ROOT}/av1/av1_dx_iface.c"
"${AOM_ROOT}/av1/decoder/decodeframe.c"
"${AOM_ROOT}/av1/decoder/decodeframe.h"
......@@ -252,7 +248,7 @@ set(AOM_AV1_DECODER_SRCS
"${AOM_ROOT}/av1/decoder/dthread.c"
"${AOM_ROOT}/av1/decoder/dthread.h")
set(AOM_AV1_ENCODER_SRCS
set(AOM_AV1_ENCODER_SOURCES
"${AOM_ROOT}/av1/av1_cx_iface.c"
"${AOM_ROOT}/av1/encoder/aq_complexity.c"
"${AOM_ROOT}/av1/encoder/aq_complexity.h"
......@@ -361,6 +357,156 @@ set(AOM_WEBM_ENCODER_SOURCES
set(AOM_DECODE_PERF_TEST_SOURCES "${AOM_ROOT}/test/decode_perf_test.cc")
set(AOM_ENCODE_PERF_TEST_SOURCES "${AOM_ROOT}/test/encode_perf_test.cc")
set(AOM_UNIT_TEST_WEBM_SOURCES "${AOM_ROOT}/test/webm_video_source.h")
set(AOM_PORTS_ASM_X86 "${AOM_ROOT}/aom_ports/x86_abi_support.asm")
set(AOM_PORTS_ASM_MMX "${AOM_ROOT}/aom_ports/emms.asm")
set(AOM_DSP_ASM_SSE2
# Requires CONFIG_AOM_HIGHBITDEPTH
#"${AOM_ROOT}/aom_dsp/x86/highbd_intrapred_sse2.asm"
#"${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"
#"${AOM_ROOT}/aom_dsp/x86/highbd_variance_impl_sse2.asm"
#"${AOM_ROOT}/aom_dsp/x86/aom_high_subpixel_8t_sse2.asm"
#"${AOM_ROOT}/aom_dsp/x86/aom_high_subpixel_bilinear_sse2.asm"
"${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/halfpix_variance_impl_sse2.asm"
"${AOM_ROOT}/aom_dsp/x86/intrapred_sse2.asm"
"${AOM_ROOT}/aom_dsp/x86/inv_wht_sse2.asm"
"${AOM_ROOT}/aom_dsp/x86/sad4d_sse2.asm"
"${AOM_ROOT}/aom_dsp/x86/sad_sse2.asm"
"${AOM_ROOT}/aom_dsp/x86/subpel_variance_sse2.asm"
"${AOM_ROOT}/aom_dsp/x86/subtract_sse2.asm")
set(AOM_DSP_INTRIN_SSE2
# Requires CONFIG_AOM_HIGHBITDEPTH
#"${AOM_ROOT}/aom_dsp/x86/highbd_loopfilter_sse2.c"
#"${AOM_ROOT}/aom_dsp/x86/highbd_quantize_intrin_sse2.c"
#"${AOM_ROOT}/aom_dsp/x86/highbd_subtract_sse2.c"
#"${AOM_ROOT}/aom_dsp/x86/highbd_variance_sse2.c"
"${AOM_ROOT}/aom_dsp/x86/aom_asm_stubs.c"
"${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"
"${AOM_ROOT}/aom_dsp/x86/inv_txfm_sse2.c"
"${AOM_ROOT}/aom_dsp/x86/inv_txfm_sse2.h"
"${AOM_ROOT}/aom_dsp/x86/loopfilter_sse2.c"
"${AOM_ROOT}/aom_dsp/x86/quantize_sse2.c"
"${AOM_ROOT}/aom_dsp/x86/sum_squares_sse2.c"
"${AOM_ROOT}/aom_dsp/x86/txfm_common_sse2.h"
"${AOM_ROOT}/aom_dsp/x86/variance_sse2.c")
set(AOM_DSP_INTRIN_SSSE3
"${AOM_ROOT}/aom_dsp/x86/aom_subpixel_8t_intrin_ssse3.c"
"${AOM_ROOT}/aom_dsp/x86/masked_sad_intrin_ssse3.c"
"${AOM_ROOT}/aom_dsp/x86/masked_variance_intrin_ssse3.c")
set(AOM_DSP_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/fwd_txfm_ssse3_x86_64.asm"
"${AOM_ROOT}/aom_dsp/x86/intrapred_ssse3.asm"
"${AOM_ROOT}/aom_dsp/x86/sad_ssse3.asm")
set(AOM_DSP_ASM_SSSE3_X86_64
"${AOM_ROOT}/aom_dsp/x86/avg_ssse3_x86_64.asm"
"${AOM_ROOT}/aom_dsp/x86/inv_txfm_ssse3_x86_64.asm"
"${AOM_ROOT}/aom_dsp/x86/quantize_ssse3_x86_64.asm"
"${AOM_ROOT}/aom_dsp/x86/ssim_opt_x86_64.asm")
set(AOM_DSP_INTRIN_SSE3 "${AOM_ROOT}/aom_dsp/x86/sad_sse3.asm")
set(AOM_DSP_ASM_SSE4_1 "${AOM_ROOT}/aom_dsp/x86/sad_sse4.asm")
set(AOM_DSP_INTRIN_SSE4_1
# Requires CONFIG_AOM_HIGHBITDEPTH
#"${AOM_ROOT}/aom_dsp/x86/highbd_variance_sse4.c"
"${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"
"${AOM_ROOT}/aom_dsp/x86/obmc_sad_sse4.c"
"${AOM_ROOT}/aom_dsp/x86/obmc_variance_sse4.c")
set(AOM_DSP_AVX_ASM "${AOM_ROOT}/aom_dsp/x86/quantize_avx_x86_64.asm")
set(AOM_DSP_AVX2_INTRIN
# Requires CONFIG_AOM_HIGHBITDEPTH
#"${AOM_ROOT}/aom_dsp/x86/sad_highbd_avx2.c"
"${AOM_ROOT}/aom_dsp/x86/aom_subpixel_8t_intrin_avx2.c"
"${AOM_ROOT}/aom_dsp/x86/fwd_txfm_avx2.c"
"${AOM_ROOT}/aom_dsp/x86/loopfilter_avx2.c"
"${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")
set(AOM_AV1_COMMON_SSE2_INTRIN
# Requires CONFIG_CLPF
#"${AOM_ROOT}/av1/common/clpf_sse2.c"
# Requires CONFIG_GLOBAL_MOTION or CONFIG_WARPED_MOTION
#"${AOM_ROOT}/av1/common/x86/warp_plane_sse2.c"
"${AOM_ROOT}/av1/common/x86/idct_intrin_sse2.c")
set(AOM_AV1_COMMON_SSSE3_INTRIN
# Requires CONFIG_CLPF
#"${AOM_ROOT}/av1/common/clpf_ssse3.c"
"${AOM_ROOT}/av1/common/x86/av1_convolve_ssse3.c")
set(AOM_AV1_COMMON_SSE4_1_INTRIN
# Requires CONFIG_CLPF
#"${AOM_ROOT}/av1/common/clpf_sse4.c"
# Requires CONFIG_AOM_HIGHBITDEPTH
#"${AOM_ROOT}/av1/common/x86/av1_highbd_convolve_sse4.c"
# Requires CONFIG_FILTER_INTRA
#"${AOM_ROOT}/av1/common/x86/filterintra_sse4.c"
# Requires CONFIG_AOM_HIGHBITDEPTH
#"${AOM_ROOT}/av1/common/x86/highbd_inv_txfm_sse4.c"
# Requires CONFIG_DERING
#"${AOM_ROOT}/av1/common/x86/od_dering_sse4.c"
"${AOM_ROOT}/av1/common/x86/av1_fwd_txfm1d_sse4.c"
"${AOM_ROOT}/av1/common/x86/av1_fwd_txfm2d_sse4.c")
set(AOM_AV1_COMMON_AVX2_INTRIN
# Requires CONFIG_AOM_HIGHBITDEPTH
#"${AOM_ROOT}/av1/common/x86/highbd_inv_txfm_avx2.c"
"${AOM_ROOT}/av1/common/x86/hybrid_inv_txfm_avx2.c")
set(AOM_AV1_ENCODER_SSE2_ASM
"${AOM_ROOT}/av1/encoder/x86/dct_sse2.asm"
"${AOM_ROOT}/av1/encoder/x86/error_sse2.asm"
"${AOM_ROOT}/av1/encoder/x86/temporal_filter_apply_sse2.asm")
set(AOM_AV1_ENCODER_SSE2_INTRIN
# Requires CONFIG_CLPF
#"${AOM_ROOT}/av1/encoder/clpf_rdo_sse2.c"
# Requires CONFIG_EXT_INTER
#"${AOM_ROOT}/av1/encoder/x86/wedge_utils_sse2.c"
"${AOM_ROOT}/av1/encoder/x86/dct_intrin_sse2.c"
"${AOM_ROOT}/av1/encoder/x86/highbd_block_error_intrin_sse2.c"
"${AOM_ROOT}/av1/encoder/x86/quantize_sse2.c")
set(AOM_AV1_ENCODER_SSSE3_ASM
"${AOM_ROOT}/av1/encoder/x86/quantize_ssse3_x86_64.asm")
set(AOM_AV1_ENCODER_SSSE3_INTRIN
# Requires CONFIG_CLPF
#"${AOM_ROOT}/av1/encoder/clpf_rdo_ssse3.c"
"${AOM_ROOT}/av1/encoder/x86/dct_ssse3.c")
#set(AOM_SSE4_1_INTRIN
# Requires CONFIG_CLPF
#"${AOM_ROOT}/av1/encoder/clpf_rdo_sse4.c"
# Requires CONFIG_AOM_HIGHBITDEPTH
#"${AOM_ROOT}/av1/encoder/x86/av1_highbd_quantize_sse4.c"
# Requires CONFIG_AOM_HIGHBITDEPTH
#"${AOM_ROOT}/av1/encoder/x86/highbd_fwd_txfm_sse4.c")
set(AOM_AV1_ENCODER_AVX2_INTRIN
"${AOM_ROOT}/av1/encoder/x86/error_intrin_avx2.c"
"${AOM_ROOT}/av1/encoder/x86/hybrid_fwd_txfm_avx2.c")
# TODO(tomfinegan): split the test sources into lists that require decoder,
# encoder, and both.
......@@ -506,34 +652,33 @@ include_directories(${AOM_ROOT} ${AOM_CONFIG_DIR})
# Targets
# TODO(tomfinegan): Add support for enable/disable encoder/decoder.
add_library(aom_dsp OBJECT ${AOM_DSP_SRCS})
add_library(aom_dsp OBJECT ${AOM_DSP_SOURCES})
AomAddRtcdGenerationCommand(${AOM_ROOT}/aom_dsp/aom_dsp_rtcd_defs.pl
${AOM_CONFIG_DIR}/aom_dsp_rtcd.h
${AOM_CONFIG_DIR}/aom_dsp/aom_dsp_rtcd.c
aom_dsp_rtcd)
add_library(aom_encoder_stats OBJECT ${AOM_ENCODER_STATS_SOURCES})
add_library(aom_mem OBJECT ${AOM_MEM_SOURCES})
add_library(aom_mem OBJECT ${AOM_MEM_SRCS})
add_library(aom_scale OBJECT ${AOM_SCALE_SRCS})
add_library(aom_scale OBJECT ${AOM_SCALE_SOURCES})
AomAddRtcdGenerationCommand(${AOM_ROOT}/aom_scale/aom_scale_rtcd.pl
${AOM_CONFIG_DIR}/aom_scale_rtcd.h
${AOM_CONFIG_DIR}/aom_scale/aom_scale_rtcd.c
aom_scale_rtcd)
add_library(aom_util OBJECT ${AOM_UTIL_SRCS})
add_library(aom_util OBJECT ${AOM_UTIL_SOURCES})
add_library(aom_av1_common OBJECT ${AOM_AV1_COMMON_SRCS})
add_library(aom_av1_common OBJECT ${AOM_AV1_COMMON_SOURCES})
AomAddRtcdGenerationCommand(${AOM_ROOT}/av1/common/av1_rtcd_defs.pl
${AOM_CONFIG_DIR}/av1_rtcd.h
${AOM_CONFIG_DIR}/av1/common/av1_rtcd.c
aom_av1_rtcd)
add_library(aom_av1_decoder OBJECT ${AOM_AV1_DECODER_SRCS})
add_library(aom_av1_encoder OBJECT ${AOM_AV1_ENCODER_SRCS})
add_library(aom_av1_decoder OBJECT ${AOM_AV1_DECODER_SOURCES})
add_library(aom_av1_encoder OBJECT ${AOM_AV1_ENCODER_SOURCES})
add_library(aom
${AOM_SRCS}
${AOM_SOURCES}
$<TARGET_OBJECTS:aom_dsp>
$<TARGET_OBJECTS:aom_mem>
$<TARGET_OBJECTS:aom_scale>
......@@ -542,6 +687,70 @@ add_library(aom
$<TARGET_OBJECTS:aom_av1_decoder>
$<TARGET_OBJECTS:aom_av1_encoder>)
#
# Assembly and intrinsic targets.
#
if ("${AOM_TARGET_CPU}" STREQUAL "x86" OR "${AOM_TARGET_CPU}" STREQUAL "x86_64")
add_asm_build("aom_util" "AOM_PORTS_ASM_X86")
endif ()
if (HAVE_MMX)
add_asm_build("aom_util" "AOM_PORTS_ASM_MMX")
endif ()
if (HAVE_SSE2)
add_asm_build("aom_dsp" "AOM_DSP_ASM_SSE2")
add_asm_build("aom_av1_encoder" "AOM_AV1_ENCODER_SSE2_ASM")
require_flag("-msse2" NO)
add_intrinsics_object_library("-msse2" "sse2" "aom_dsp" "AOM_DSP_INTRIN_SSE2")
add_intrinsics_object_library("-msse2" "sse2" "aom_av1_common"
"AOM_AV1_COMMON_SSE2_INTRIN")
add_intrinsics_object_library("-msse2" "sse2" "aom_av1_encoder"
"AOM_AV1_ENCODER_SSE2_INTRIN")
endif ()
if (HAVE_SSE3)
add_asm_build("aom_dsp" "AOM_DSP_INTRIN_SSE3")
endif ()
if (HAVE_SSSE3)
if ("${AOM_TARGET_CPU}" STREQUAL "x86_64")
list(APPEND AOM_DSP_ASM_SSSE3 ${AOM_DSP_ASM_SSSE3_X86_64})
endif ()
add_asm_build("aom_dsp" "AOM_DSP_ASM_SSSE3")
add_asm_build("aom_av1_encoder" "AOM_AV1_ENCODER_SSSE3_ASM")
require_flag("-mssse3" NO)
add_intrinsics_object_library("-mssse3" "ssse3" "aom_dsp"
"AOM_DSP_INTRIN_SSSE3")
add_intrinsics_object_library("-mssse3" "ssse3" "aom_av1_common"
"AOM_AV1_COMMON_SSSE3_INTRIN")
add_intrinsics_object_library("-mssse3" "ssse3" "aom_av1_encoder"
"AOM_AV1_ENCODER_SSSE3_INTRIN")
endif ()
if (HAVE_SSE4_1)
add_asm_build("aom_dsp" "AOM_DSP_ASM_SSE4_1")
require_flag("-msse4.1" NO)
add_intrinsics_object_library("-msse4.1" "sse4_1" "aom_dsp"
"AOM_DSP_INTRIN_SSE4_1")
add_intrinsics_object_library("-msse4.1" "sse4" "aom_av1_common"
"AOM_AV1_COMMON_SSE4_1_INTRIN")
endif ()
if (HAVE_AVX)
add_asm_build("aom_dsp" "AOM_DSP_AVX_ASM")
endif ()
if (HAVE_AVX2)
require_flag("-mavx2" NO)
add_intrinsics_object_library("-mavx2" "avx2" "aom_dsp" "AOM_DSP_AVX2_INTRIN")
add_intrinsics_object_library("-mavx2" "avx2" "aom_av1_common"
"AOM_AV1_COMMON_AVX2_INTRIN")
add_intrinsics_object_library("-mavx2" "avx2" "aom_av1_encoder"
"AOM_AV1_ENCODER_AVX2_INTRIN")
endif ()
#
# Application and application support targets.
#
add_library(aom_common_app_util OBJECT ${AOM_COMMON_APP_UTIL_SOURCES})
add_library(aom_decoder_app_util OBJECT ${AOM_DECODER_APP_UTIL_SOURCES})
add_library(aom_encoder_app_util OBJECT ${AOM_ENCODER_APP_UTIL_SOURCES})
......@@ -608,7 +817,7 @@ add_executable(twopass_encoder
target_link_libraries(twopass_encoder PUBLIC aom)
if (CONFIG_LIBYUV)
add_library(yuv OBJECT ${AOM_LIBYUV_SRCS})
add_library(yuv OBJECT ${AOM_LIBYUV_SOURCES})
target_compile_options(yuv PRIVATE -Wno-unused-parameter)
include_directories("${AOM_ROOT}/third_party/libyuv/include")
......@@ -626,7 +835,7 @@ if (CONFIG_LIBYUV)
endif ()
if (CONFIG_WEBM_IO)
add_library(webm OBJECT ${AOM_LIBWEBM_SRCS})
add_library(webm OBJECT ${AOM_LIBWEBM_SOURCES})
include_directories("${AOM_ROOT}/third_party/libwebm")
target_compile_options(webm PRIVATE -Wno-shadow)
......
ARCH_ARM equ ${ARCH_ARM}
ARCH_MIPS equ ${ARCH_MIPS}
ARCH_X86 equ ${ARCH_X86}
ARCH_X86_64 equ ${ARCH_X86_64}
HAVE_EDSP equ ${HAVE_EDSP}
HAVE_MEDIA equ ${HAVE_MEDIA}
HAVE_NEON equ ${HAVE_NEON}
HAVE_NEON_ASM equ ${HAVE_NEON_ASM}
HAVE_MIPS32 equ ${HAVE_MIPS32}
HAVE_DSPR2 equ ${HAVE_DSPR2}
HAVE_MSA equ ${HAVE_MSA}
HAVE_MIPS64 equ ${HAVE_MIPS64}
HAVE_MMX equ ${HAVE_MMX}
HAVE_SSE equ ${HAVE_SSE}
HAVE_SSE2 equ ${HAVE_SSE2}
HAVE_SSE3 equ ${HAVE_SSE3}
HAVE_SSSE3 equ ${HAVE_SSSE3}
HAVE_SSE4_1 equ ${HAVE_SSE4_1}
HAVE_AVX equ ${HAVE_AVX}
HAVE_AVX2 equ ${HAVE_AVX2}
HAVE_AOM_PORTS equ ${HAVE_AOM_PORTS}
HAVE_PTHREAD_H equ ${HAVE_PTHREAD_H}
HAVE_UNISTD_H equ ${HAVE_UNISTD_H}
CONFIG_DEPENDENCY_TRACKING equ ${CONFIG_DEPENDENCY_TRACKING}
CONFIG_EXTERNAL_BUILD equ ${CONFIG_EXTERNAL_BUILD}
CONFIG_INSTALL_DOCS equ ${CONFIG_INSTALL_DOCS}
CONFIG_INSTALL_BINS equ ${CONFIG_INSTALL_BINS}
CONFIG_INSTALL_LIBS equ ${CONFIG_INSTALL_LIBS}
CONFIG_INSTALL_SRCS equ ${CONFIG_INSTALL_SRCS}
CONFIG_DEBUG equ ${CONFIG_DEBUG}
CONFIG_GPROF equ ${CONFIG_GPROF}
CONFIG_GCOV equ ${CONFIG_GCOV}
CONFIG_RVCT equ ${CONFIG_RVCT}
CONFIG_GCC equ ${CONFIG_GCC}
CONFIG_MSVS equ ${CONFIG_MSVS}
CONFIG_PIC equ ${CONFIG_PIC}
CONFIG_BIG_ENDIAN equ ${CONFIG_BIG_ENDIAN}
CONFIG_CODEC_SRCS equ ${CONFIG_CODEC_SRCS}
CONFIG_DEBUG_LIBS equ ${CONFIG_DEBUG_LIBS}
CONFIG_DEQUANT_TOKENS equ ${CONFIG_DEQUANT_TOKENS}
CONFIG_DC_RECON equ ${CONFIG_DC_RECON}
CONFIG_RUNTIME_CPU_DETECT equ ${CONFIG_RUNTIME_CPU_DETECT}
CONFIG_POSTPROC equ ${CONFIG_POSTPROC}
CONFIG_AV1_POSTPROC equ ${CONFIG_AV1_POSTPROC}
CONFIG_MULTITHREAD equ ${CONFIG_MULTITHREAD}
CONFIG_INTERNAL_STATS equ ${CONFIG_INTERNAL_STATS}
CONFIG_AV1_ENCODER equ ${CONFIG_AV1_ENCODER}
CONFIG_AV1_DECODER equ ${CONFIG_AV1_DECODER}
CONFIG_AV1 equ ${CONFIG_AV1}
CONFIG_ENCODERS equ ${CONFIG_ENCODERS}
CONFIG_DECODERS equ ${CONFIG_DECODERS}
CONFIG_STATIC_MSVCRT equ ${CONFIG_STATIC_MSVCRT}
CONFIG_SPATIAL_RESAMPLING equ ${CONFIG_SPATIAL_RESAMPLING}
CONFIG_REALTIME_ONLY equ ${CONFIG_REALTIME_ONLY}
CONFIG_ONTHEFLY_BITPACKING equ ${CONFIG_ONTHEFLY_BITPACKING}
CONFIG_ERROR_CONCEALMENT equ ${CONFIG_ERROR_CONCEALMENT}
CONFIG_SHARED equ ${CONFIG_SHARED}
CONFIG_STATIC equ ${CONFIG_STATIC}
CONFIG_SMALL equ ${CONFIG_SMALL}
CONFIG_POSTPROC_VISUALIZER equ ${CONFIG_POSTPROC_VISUALIZER}
CONFIG_OS_SUPPORT equ ${CONFIG_OS_SUPPORT}
CONFIG_UNIT_TESTS equ ${CONFIG_UNIT_TESTS}
CONFIG_WEBM_IO equ ${CONFIG_WEBM_IO}
CONFIG_LIBYUV equ ${CONFIG_LIBYUV}
CONFIG_ACCOUNTING equ ${CONFIG_ACCOUNTING}
CONFIG_DECODE_PERF_TESTS equ ${CONFIG_DECODE_PERF_TESTS}
CONFIG_ENCODE_PERF_TESTS equ ${CONFIG_ENCODE_PERF_TESTS}
CONFIG_MULTI_RES_ENCODING equ ${CONFIG_MULTI_RES_ENCODING}
CONFIG_TEMPORAL_DENOISING equ ${CONFIG_TEMPORAL_DENOISING}
CONFIG_AV1_TEMPORAL_DENOISING equ ${CONFIG_AV1_TEMPORAL_DENOISING}
CONFIG_COEFFICIENT_RANGE_CHECKING equ ${CONFIG_COEFFICIENT_RANGE_CHECKING}
CONFIG_AOM_HIGHBITDEPTH equ ${CONFIG_AOM_HIGHBITDEPTH}
CONFIG_BETTER_HW_COMPATIBILITY equ ${CONFIG_BETTER_HW_COMPATIBILITY}
CONFIG_EXPERIMENTAL equ ${CONFIG_EXPERIMENTAL}
CONFIG_SIZE_LIMIT equ ${CONFIG_SIZE_LIMIT}
CONFIG_AOM_QM equ ${CONFIG_AOM_QM}
CONFIG_FP_MB_STATS equ ${CONFIG_FP_MB_STATS}
CONFIG_EMULATE_HARDWARE equ ${CONFIG_EMULATE_HARDWARE}
CONFIG_CLPF equ ${CONFIG_CLPF}
CONFIG_DERING equ ${CONFIG_DERING}
CONFIG_VAR_TX equ ${CONFIG_VAR_TX}
CONFIG_RECT_TX equ ${CONFIG_RECT_TX}
CONFIG_REF_MV equ ${CONFIG_REF_MV}
CONFIG_DUAL_FILTER equ ${CONFIG_DUAL_FILTER}
CONFIG_EXT_TX equ ${CONFIG_EXT_TX}
CONFIG_TX64X64 equ ${CONFIG_TX64X64}
CONFIG_SUB8X8_MC equ ${CONFIG_SUB8X8_MC}
CONFIG_EXT_INTRA equ ${CONFIG_EXT_INTRA}
CONFIG_FILTER_INTRA equ ${CONFIG_FILTER_INTRA}
CONFIG_EXT_INTER equ ${CONFIG_EXT_INTER}
CONFIG_EXT_REFS equ ${CONFIG_EXT_REFS}
CONFIG_GLOBAL_MOTION equ ${CONFIG_GLOBAL_MOTION}
CONFIG_NEW_QUANT equ ${CONFIG_NEW_QUANT}
CONFIG_SUPERTX equ ${CONFIG_SUPERTX}
CONFIG_ANS equ ${CONFIG_ANS}
CONFIG_EC_MULTISYMBOL equ ${CONFIG_EC_MULTISYMBOL}
CONFIG_LOOP_RESTORATION equ ${CONFIG_LOOP_RESTORATION}
CONFIG_EXT_PARTITION equ ${CONFIG_EXT_PARTITION}
CONFIG_EXT_PARTITION_TYPES equ ${CONFIG_EXT_PARTITION_TYPES}
CONFIG_UNPOISON_PARTITION_CTX equ ${CONFIG_UNPOISON_PARTITION_CTX}
CONFIG_EXT_TILE equ ${CONFIG_EXT_TILE}
CONFIG_MOTION_VAR equ ${CONFIG_MOTION_VAR}
CONFIG_WARPED_MOTION equ ${CONFIG_WARPED_MOTION}
CONFIG_ENTROPY equ ${CONFIG_ENTROPY}
CONFIG_BIDIR_PRED equ ${CONFIG_BIDIR_PRED}
CONFIG_BITSTREAM_DEBUG equ ${CONFIG_BITSTREAM_DEBUG}
CONFIG_ALT_INTRA equ ${CONFIG_ALT_INTRA}
CONFIG_PALETTE equ ${CONFIG_PALETTE}
CONFIG_DAALA_EC equ ${CONFIG_DAALA_EC}
CONFIG_PVQ equ ${CONFIG_PVQ}
CONFIG_CB4X4 equ ${CONFIG_CB4X4}
CONFIG_FRAME_SIZE equ ${CONFIG_FRAME_SIZE}
CONFIG_DELTA_Q equ ${CONFIG_DELTA_Q}
CONFIG_ADAPT_SCAN equ ${CONFIG_ADAPT_SCAN}
CONFIG_FILTER_7BIT equ ${CONFIG_FILTER_7BIT}
CONFIG_PARALLEL_DEBLOCKING equ ${CONFIG_PARALLEL_DEBLOCKING}
CONFIG_TILE_GROUPS equ ${CONFIG_TILE_GROUPS}
CONFIG_EC_ADAPT equ ${CONFIG_EC_ADAPT}
CONFIG_SIMP_MV_PRED equ ${CONFIG_SIMP_MV_PRED}
CONFIG_RD_DEBUG equ ${CONFIG_RD_DEBUG}
CONFIG_REFERENCE_BUFFER equ ${CONFIG_REFERENCE_BUFFER}
CONFIG_COEF_INTERLEAVE equ ${CONFIG_COEF_INTERLEAVE}
CONFIG_ENTROPY_STATS equ ${CONFIG_ENTROPY_STATS}
CONFIG_MASKED_TX equ ${CONFIG_MASKED_TX}
CONFIG_DAALA_DIST equ ${CONFIG_DAALA_DIST}
......@@ -13,11 +13,27 @@ cmake_minimum_required(VERSION 3.2)
include("${AOM_ROOT}/build/cmake/aom_config_defaults.cmake")
include("${AOM_ROOT}/build/cmake/compiler_flags.cmake")
include("${AOM_ROOT}/build/cmake/compiler_tests.cmake")
include("${AOM_ROOT}/build/cmake/targets/${AOM_TARGET}.cmake")
# TODO(tomfinegan): For some ${AOM_TARGET} values a toolchain can be
# inferred, and we could include it here instead of forcing users to
# remember to explicitly specify ${AOM_TARGET} and the cmake toolchain.
# Detect target CPU.
if (NOT AOM_TARGET_CPU)
# TODO(tomfinegan): This will not work for a cross compile. Target CPU and
# system will have to come from a toolchain file or the cmake command line.
set(AOM_TARGET_CPU ${CMAKE_SYSTEM_PROCESSOR})
set(AOM_TARGET_SYSTEM ${CMAKE_SYSTEM_NAME})
if (NOT EXISTS "${AOM_ROOT}/build/cmake/targets/${AOM_TARGET_CPU}.cmake")
message("No RTCD template for ${AOM_TARGET_CPU}, using generic.")
set(AOM_TARGET_CPU "generic")
endif ()
if (NOT AOM_TARGET_CPU STREQUAL "generic")
find_program(YASM_EXECUTABLE yasm $ENV{YASM_PATH})
if (NOT YASM_EXECUTABLE)
message(WARNING "Unable to find yasm, using generic as target CPU.")
set(AOM_TARGET_CPU "generic")
endif ()
endif ()
endif ()
include("${AOM_ROOT}/build/cmake/targets/${AOM_TARGET_CPU}.cmake")
include(FindGit)
include(FindPerl)
......@@ -76,6 +92,8 @@ endif ()
# values require special casing).
configure_file("${AOM_ROOT}/build/cmake/aom_config.h.cmake"
"${AOM_CONFIG_DIR}/aom_config.h")
configure_file("${AOM_ROOT}/build/cmake/aom_config.asm.cmake"
"${AOM_CONFIG_DIR}/aom_config.asm")
# Read the current git hash.
find_package(Git)
......@@ -145,10 +163,11 @@ endforeach()
macro(AomAddRtcdGenerationCommand config output source symbol)
add_custom_command(OUTPUT ${output}
COMMAND ${PERL_EXECUTABLE} "${AOM_ROOT}/build/make/rtcd.pl"
--arch=${AOM_ARCH} --sym=${symbol}
--config=${AOM_CONFIG_DIR}/${AOM_ARCH}.rtcd
${config} > ${output}
COMMAND ${PERL_EXECUTABLE}
ARGS "${AOM_ROOT}/build/make/rtcd.pl"
--arch=${AOM_ARCH} --sym=${symbol}
--config=${AOM_CONFIG_DIR}/${AOM_ARCH}.rtcd
${config} > ${output}
DEPENDS ${config}
COMMENT "Generating ${output}"
WORKING_DIRECTORY ${AOM_CONFIG_DIR}
......
##
## 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.
##
# Adds an object library target. Terminates generation if $flag is not supported
# by the current compiler. $flag is the intrinsics flag required by the current
# compiler, and is added to the compile flags for all sources in $sources.
# $opt_name is used to name the target. $target_to_update is made
# dependent upon the created target.
#
# Note: the libaom target is always updated because OBJECT libraries have rules
# that disallow the direct addition of .o files to them as dependencies. Static
# libraries do not have this limitation.
function (add_intrinsics_object_library flag opt_name target_to_update sources)
if (MSVC)
message(FATAL_ERROR "MSVC instrinics support not implemented.")
endif ()
set(target_name ${target_to_update}_${opt_name}_intrinsics)
add_library(${target_name} OBJECT ${${sources}})
target_compile_options(${target_name} PUBLIC ${flag})
target_sources(aom PUBLIC $<TARGET_OBJECTS:${target_name}>)
endfunction ()
# Adds build commands for ASM files in $sources and uses $asm_build_name to
# build an output directory path. Adds ASM objects to libaom directly. $sources
# must be the name of a variable containing a list of sources.
#
# Note: the libaom target is always updated because OBJECT libraries have rules
# that disallow the direct addition of .o files to them as dependencies. Static
# libraries do not have this limitation.
function (add_asm_build asm_build_name sources)
set(AOM_ASM_OBJECTS_DIR "${AOM_CONFIG_DIR}/asm_objects/${asm_build_name}")
if (NOT EXISTS "${AOM_ASM_OBJECTS_DIR}")
file(MAKE_DIRECTORY "${AOM_ASM_OBJECTS_DIR}")
endif ()
# TODO(tomfinegan): This might get rather lengthy; probably best to move it
# out into its own function or macro.
if ("${AOM_TARGET_CPU}" STREQUAL "x86_64" AND
"${AOM_TARGET_SYSTEM}" STREQUAL "Darwin")
set(objformat "macho64")
elseif ("${AOM_TARGET_CPU}" STREQUAL "x86_64" AND
"${AOM_TARGET_SYSTEM}" STREQUAL "Linux")
set(objformat "elf64")
else ()
message(FATAL_ERROR
"Unknown obj format: ${AOM_TARGET_CPU}-${AOM_TARGET_SYSTEM}")
endif ()
foreach (asm_source ${${sources}})
get_filename_component(asm_source_name "${asm_source}" NAME)
set(asm_object "${AOM_ASM_OBJECTS_DIR}/${asm_source_name}.o")
add_custom_command(OUTPUT "${asm_object}"
COMMAND ${YASM_EXECUTABLE}
ARGS -f ${objformat}
-I${AOM_ROOT} -I${AOM_CONFIG_DIR}