From 99378f137fc352fe8ff0b94197ceb56966e99984 Mon Sep 17 00:00:00 2001 From: Exverge Date: Sat, 25 Jan 2025 20:46:31 -0500 Subject: [PATCH] fix compiling on x64 --- .../armv8/ih264_intra_pred_chroma_av8.s | 4 +- .../armv8/ih264_intra_pred_luma_16x16_av8.s | 2 +- .../armv8/ih264_intra_pred_luma_8x8_av8.s | 2 +- .../ih264d/common/ih264_inter_pred_filters.h | 16 +++++++ .../ih264d/common/ih264_intra_pred_filters.h | 10 +++- dependencies/ih264d/common/ih264_padding.h | 4 ++ .../common/ih264_trans_quant_itrans_iquant.h | 48 ++++++++++++++++++- .../ih264d/common/ih264_weighted_pred.h | 12 +++++ 8 files changed, 91 insertions(+), 7 deletions(-) diff --git a/dependencies/ih264d/common/armv8/ih264_intra_pred_chroma_av8.s b/dependencies/ih264d/common/armv8/ih264_intra_pred_chroma_av8.s index c0d9cf99..cee1b7e3 100644 --- a/dependencies/ih264d/common/armv8/ih264_intra_pred_chroma_av8.s +++ b/dependencies/ih264d/common/armv8/ih264_intra_pred_chroma_av8.s @@ -429,7 +429,7 @@ ih264_intra_pred_chroma_8x8_mode_plane_av8: rev64 v7.4h, v2.4h ld1 {v3.2s}, [x10] sub x5, x3, #8 -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__aarch64__) adrp x12, _ih264_gai1_intrapred_chroma_plane_coeffs1@GOTPAGE ldr x12, [x12, _ih264_gai1_intrapred_chroma_plane_coeffs1@GOTPAGEOFF] #else @@ -489,7 +489,7 @@ ih264_intra_pred_chroma_8x8_mode_plane_av8: zip1 v1.8h, v0.8h, v2.8h zip2 v2.8h, v0.8h, v2.8h mov v0.16b, v1.16b -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__aarch64__) adrp x12, _ih264_gai1_intrapred_chroma_plane_coeffs2@GOTPAGE ldr x12, [x12, _ih264_gai1_intrapred_chroma_plane_coeffs2@GOTPAGEOFF] #else diff --git a/dependencies/ih264d/common/armv8/ih264_intra_pred_luma_16x16_av8.s b/dependencies/ih264d/common/armv8/ih264_intra_pred_luma_16x16_av8.s index e564b334..99a95a13 100644 --- a/dependencies/ih264d/common/armv8/ih264_intra_pred_luma_16x16_av8.s +++ b/dependencies/ih264d/common/armv8/ih264_intra_pred_luma_16x16_av8.s @@ -431,7 +431,7 @@ ih264_intra_pred_luma_16x16_mode_plane_av8: mov x10, x1 //top_left mov x4, #-1 ld1 {v2.2s}, [x1], x8 -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__aarch64__) adrp x7, _ih264_gai1_intrapred_luma_plane_coeffs@GOTPAGE ldr x7, [x7, #_ih264_gai1_intrapred_luma_plane_coeffs@GOTPAGEOFF] #else diff --git a/dependencies/ih264d/common/armv8/ih264_intra_pred_luma_8x8_av8.s b/dependencies/ih264d/common/armv8/ih264_intra_pred_luma_8x8_av8.s index 956ee0b1..d320ccb0 100644 --- a/dependencies/ih264d/common/armv8/ih264_intra_pred_luma_8x8_av8.s +++ b/dependencies/ih264d/common/armv8/ih264_intra_pred_luma_8x8_av8.s @@ -1030,7 +1030,7 @@ ih264_intra_pred_luma_8x8_mode_horz_u_av8: ext v4.16b, v2.16b , v2.16b , #1 mov v5.d[0], v4.d[1] -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__aarch64__) adrp x12, _ih264_gai1_intrapred_luma_8x8_horz_u@GOTPAGE ldr x12, [x12, _ih264_gai1_intrapred_luma_8x8_horz_u@GOTPAGEOFF] #else diff --git a/dependencies/ih264d/common/ih264_inter_pred_filters.h b/dependencies/ih264d/common/ih264_inter_pred_filters.h index b4777445..a727345b 100644 --- a/dependencies/ih264d/common/ih264_inter_pred_filters.h +++ b/dependencies/ih264d/common/ih264_inter_pred_filters.h @@ -109,7 +109,11 @@ typedef void _ih264_inter_pred_luma_ft(UWORD8 *pu1_src, UWORD8* pu1_tmp, WORD32 dydx); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_inter_pred_luma_ft(arg) _ih264_inter_pred_luma_ft arg __asm__(#arg); +#else +#define ih264_inter_pred_luma_ft(arg) _ih264_inter_pred_luma_ft arg; +#endif typedef void _ih264_interleave_copy_ft(UWORD8 *pu1_src, UWORD8 *pu1_dst, @@ -118,7 +122,11 @@ typedef void _ih264_interleave_copy_ft(UWORD8 *pu1_src, WORD32 ht, WORD32 wd); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_interleave_copy_ft(arg) _ih264_interleave_copy_ft arg __asm__(#arg); +#else +#define ih264_interleave_copy_ft(arg) _ih264_interleave_copy_ft arg; +#endif typedef void _ih264_inter_pred_luma_bilinear_ft(UWORD8 *pu1_src1, UWORD8 *pu1_src2, @@ -129,7 +137,11 @@ typedef void _ih264_inter_pred_luma_bilinear_ft(UWORD8 *pu1_src1, WORD32 height, WORD32 width); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_inter_pred_luma_bilinear_ft(arg) _ih264_inter_pred_luma_bilinear_ft arg __asm__(#arg); +#else +#define ih264_inter_pred_luma_bilinear_ft(arg) _ih264_inter_pred_luma_bilinear_ft arg; +#endif typedef void _ih264_inter_pred_chroma_ft(UWORD8 *pu1_src, UWORD8 *pu1_dst, @@ -140,7 +152,11 @@ typedef void _ih264_inter_pred_chroma_ft(UWORD8 *pu1_src, WORD32 ht, WORD32 wd); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_inter_pred_chroma_ft(arg) _ih264_inter_pred_chroma_ft arg __asm__(#arg); +#else +#define ih264_inter_pred_chroma_ft(arg) _ih264_inter_pred_chroma_ft arg; +#endif /* No NEON Declarations */ diff --git a/dependencies/ih264d/common/ih264_intra_pred_filters.h b/dependencies/ih264d/common/ih264_intra_pred_filters.h index 33e68489..31096bfa 100644 --- a/dependencies/ih264d/common/ih264_intra_pred_filters.h +++ b/dependencies/ih264d/common/ih264_intra_pred_filters.h @@ -68,7 +68,11 @@ typedef void _ih264_intra_pred_ref_filtering_ft(UWORD8 *pu1_left, WORD32 left_strd, WORD32 ngbr_avail); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_intra_pred_ref_filtering_ft(arg) _ih264_intra_pred_ref_filtering_ft arg __asm__(#arg); +#else +#define ih264_intra_pred_ref_filtering_ft(arg) _ih264_intra_pred_ref_filtering_ft arg __asm__(#arg); +#endif typedef void _ih264_intra_pred_luma_ft(UWORD8 *pu1_src, UWORD8 *pu1_dst, @@ -76,7 +80,11 @@ typedef void _ih264_intra_pred_luma_ft(UWORD8 *pu1_src, WORD32 dst_strd, WORD32 ngbr_avail); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_intra_pred_luma_ft(arg) _ih264_intra_pred_luma_ft arg __asm__(#arg); +#else +#define ih264_intra_pred_luma_ft(arg) _ih264_intra_pred_luma_ft arg; +#endif /* No Neon Definitions */ @@ -133,7 +141,7 @@ ih264_intra_pred_luma_ft(ih264_intra_pred_luma_16x16_mode_plane); /* Chroma 8x8 Intra pred filters */ typedef _ih264_intra_pred_luma_ft _ih264_intra_pred_chroma_ft; -#define ih264_intra_pred_chroma_ft(arg) _ih264_intra_pred_chroma_ft arg __asm__(#arg); +#define ih264_intra_pred_chroma_ft(arg) ih264_intra_pred_luma_ft(arg); ih264_intra_pred_chroma_ft(ih264_intra_pred_chroma_8x8_mode_dc); diff --git a/dependencies/ih264d/common/ih264_padding.h b/dependencies/ih264d/common/ih264_padding.h index 320b3eaf..4151279b 100644 --- a/dependencies/ih264d/common/ih264_padding.h +++ b/dependencies/ih264d/common/ih264_padding.h @@ -42,7 +42,11 @@ /*****************************************************************************/ typedef void _ih264_pad(UWORD8 *, WORD32, WORD32, WORD32); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_pad(arg) _ih264_pad arg __asm__(#arg); +#else +#define ih264_pad(arg) _ih264_pad arg; +#endif /* C function declarations */ ih264_pad(ih264_pad_top); diff --git a/dependencies/ih264d/common/ih264_trans_quant_itrans_iquant.h b/dependencies/ih264d/common/ih264_trans_quant_itrans_iquant.h index fad92eca..e5004a64 100644 --- a/dependencies/ih264d/common/ih264_trans_quant_itrans_iquant.h +++ b/dependencies/ih264d/common/ih264_trans_quant_itrans_iquant.h @@ -53,7 +53,11 @@ typedef void _ih264_resi_trans_dctrans_quant_ft(UWORD8*pu1_src, UWORD32 u4_round_fact, UWORD8 *pu1_nnz); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_resi_trans_dctrans_quant_ft(arg) _ih264_resi_trans_dctrans_quant_ft arg __asm__(#arg); +#else +#define ih264_resi_trans_dctrans_quant_ft(arg) _ih264_resi_trans_dctrans_quant_ft arg; +#endif typedef void _ih264_idctrans_iquant_itrans_recon_ft(WORD16 *pi2_src, UWORD8 *pu1_pred, @@ -67,11 +71,15 @@ typedef void _ih264_idctrans_iquant_itrans_recon_ft(WORD16 *pi2_src, UWORD32 pi4_cntrl, WORD32 *pi4_tmp); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_idctrans_iquant_itrans_recon_ft(arg) _ih264_pad arg __asm__(#arg); +#else +#define ih264_idctrans_iquant_itrans_recon_ft(arg) _ih264_pad arg; +#endif /*Function prototype declarations*/ -typedef void ih264_resi_trans_quant_ft(UWORD8*pu1_src, +typedef void _ih264_resi_trans_quant_ft(UWORD8*pu1_src, UWORD8 *pu1_pred, WORD16 *pi2_out, WORD32 src_strd, @@ -83,7 +91,11 @@ typedef void ih264_resi_trans_quant_ft(UWORD8*pu1_src, UWORD8 *pu1_nnz, WORD16 *pi2_alt_dc_addr); -#define ih264_pad(arg) _ih264_pad arg __asm__(#arg); +#if defined(__APPLE__) && defined(__aarch64__) +#define ih264_resi_trans_quant_ft(arg) _ih264_resi_trans_quant_ft arg __asm__(#arg); +#else +#define ih264_resi_trans_quant_ft(arg) _ih264_resi_trans_quant_ft arg; +#endif typedef void _ih264_luma_16x16_resi_trans_dctrans_quant_ft(UWORD8 *pu1_src, UWORD8 *pu1_pred, @@ -98,7 +110,11 @@ typedef void _ih264_luma_16x16_resi_trans_dctrans_quant_ft(UWORD8 *pu1_src, UWORD8 *pu1_nnz, UWORD32 u4_dc_flag); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_luma_16x16_resi_trans_dctrans_quant_ft(arg) _ih264_luma_16x16_resi_trans_dctrans_quant_ft arg __asm__(#arg); +#else +#define ih264_luma_16x16_resi_trans_dctrans_quant_ft(arg) _ih264_luma_16x16_resi_trans_dctrans_quant_ft arg; +#endif typedef void _ih264_chroma_8x8_resi_trans_dctrans_quant_ft(UWORD8 *pu1_src, UWORD8 *pu1_pred, @@ -112,7 +128,11 @@ typedef void _ih264_chroma_8x8_resi_trans_dctrans_quant_ft(UWORD8 *pu1_src, UWORD32 u4_round_factor, UWORD8 *pu1_nnz); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_chroma_8x8_resi_trans_dctrans_quant_ft(arg) _ih264_chroma_8x8_resi_trans_dctrans_quant_ft arg __asm__(#arg); +#else +#define ih264_chroma_8x8_resi_trans_dctrans_quant_ft(arg) _ih264_chroma_8x8_resi_trans_dctrans_quant_ft arg; +#endif typedef void _ih264_iquant_itrans_recon_ft(WORD16 *pi2_src, UWORD8 *pu1_pred, @@ -126,7 +146,11 @@ typedef void _ih264_iquant_itrans_recon_ft(WORD16 *pi2_src, WORD32 iq_start_idx, WORD16 *pi2_dc_ld_addr); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_iquant_itrans_recon_ft(arg) _ih264_iquant_itrans_recon_ft arg __asm__(#arg); +#else +#define ih264_iquant_itrans_recon_ft(arg) _ih264_iquant_itrans_recon_ft arg; +#endif typedef void _ih264_iquant_itrans_recon_chroma_ft(WORD16 *pi2_src, @@ -140,7 +164,11 @@ typedef void _ih264_iquant_itrans_recon_chroma_ft(WORD16 *pi2_src, WORD16 *pi2_tmp, WORD16 *pi2_dc_src); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_iquant_itrans_recon_chroma_ft(arg) _ih264_iquant_itrans_recon_chroma_ft arg __asm__(#arg); +#else +#define ih264_iquant_itrans_recon_chroma_ft(arg) _ih264_iquant_itrans_recon_chroma_ft arg; +#endif typedef void _ih264_luma_16x16_idctrans_iquant_itrans_recon_ft(WORD16 *pi2_src, @@ -156,7 +184,11 @@ typedef void _ih264_luma_16x16_idctrans_iquant_itrans_recon_ft(WORD16 *pi2_src, UWORD32 u4_dc_trans_flag, WORD32 *pi4_tmp); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_luma_16x16_idctrans_iquant_itrans_recon_ft(arg) _ih264_luma_16x16_idctrans_iquant_itrans_recon_ft arg __asm__(#arg); +#else +#define ih264_luma_16x16_idctrans_iquant_itrans_recon_ft(arg) _ih264_luma_16x16_idctrans_iquant_itrans_recon_ft arg; +#endif typedef void _ih264_chroma_8x8_idctrans_iquant_itrans_recon_ft(WORD16 *pi2_src, UWORD8 *pu1_pred, @@ -170,7 +202,11 @@ typedef void _ih264_chroma_8x8_idctrans_iquant_itrans_recon_ft(WORD16 *pi2_src, UWORD32 pi4_cntrl, WORD32 *pi4_tmp); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_chroma_8x8_idctrans_iquant_itrans_recon_ft(arg) _ih264_chroma_8x8_idctrans_iquant_itrans_recon_ft arg __asm__(#arg); +#else +#define ih264_chroma_8x8_idctrans_iquant_itrans_recon_ft(arg) _ih264_chroma_8x8_idctrans_iquant_itrans_recon_ft arg; +#endif typedef void _ih264_ihadamard_scaling_ft(WORD16* pi2_src, WORD16* pi2_out, @@ -179,14 +215,22 @@ typedef void _ih264_ihadamard_scaling_ft(WORD16* pi2_src, UWORD32 u4_qp_div_6, WORD32* pi4_tmp); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_ihadamard_scaling_ft(arg) _ih264_ihadamard_scaling_ft arg __asm__(#arg); +#else +#define ih264_ihadamard_scaling_ft(arg) _ih264_ihadamard_scaling_ft arg; +#endif typedef void _ih264_hadamard_quant_ft(WORD16 *pi2_src, WORD16 *pi2_dst, const UWORD16 *pu2_scale_matrix, const UWORD16 *pu2_threshold_matrix, UWORD32 u4_qbits, UWORD32 u4_round_factor,UWORD8 *pu1_nnz); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_hadamard_quant_ft(arg) _ih264_hadamard_quant_ft arg __asm__(#arg); +#else +#define ih264_hadamard_quant_ft(arg) _ih264_hadamard_quant_ft arg; +#endif ih264_resi_trans_quant_ft(ih264_resi_trans_quant_4x4); ih264_resi_trans_quant_ft(ih264_resi_trans_quant_chroma_4x4); diff --git a/dependencies/ih264d/common/ih264_weighted_pred.h b/dependencies/ih264d/common/ih264_weighted_pred.h index 990b60b8..785744f8 100644 --- a/dependencies/ih264d/common/ih264_weighted_pred.h +++ b/dependencies/ih264d/common/ih264_weighted_pred.h @@ -77,7 +77,11 @@ typedef void _ih264_default_weighted_pred_ft(UWORD8 *puc_src1, WORD32 ht, WORD32 wd); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_default_weighted_pred_ft(arg) _ih264_default_weighted_pred_ft arg __asm__(#arg); +#else +#define ih264_default_weighted_pred_ft(arg) _ih264_default_weighted_pred_ft arg; +#endif typedef void _ih264_weighted_pred_ft(UWORD8 *puc_src, UWORD8 *puc_dst, @@ -89,7 +93,11 @@ typedef void _ih264_weighted_pred_ft(UWORD8 *puc_src, WORD32 ht, WORD32 wd); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_weighted_pred_ft(arg) _ih264_weighted_pred_ft arg __asm__(#arg); +#else +#define ih264_weighted_pred_ft(arg) _ih264_weighted_pred_ft arg; +#endif typedef void _ih264_weighted_bi_pred_ft(UWORD8 *puc_src1, UWORD8 *puc_src2, @@ -105,7 +113,11 @@ typedef void _ih264_weighted_bi_pred_ft(UWORD8 *puc_src1, WORD32 ht, WORD32 wd); +#if defined(__APPLE__) && defined(__aarch64__) #define ih264_weighted_bi_pred_ft(arg) _ih264_weighted_bi_pred_ft arg __asm__(#arg); +#else +#define ih264_weighted_bi_pred_ft(arg) _ih264_weighted_bi_pred_ft arg; +#endif /* No NEON Declarations */