1 /* 2 * Copyright (c) 2023, Alliance for Open Media. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef AOM_AOM_DSP_ARM_REINTERPRET_NEON_H_ 12 #define AOM_AOM_DSP_ARM_REINTERPRET_NEON_H_ 13 14 #include <arm_neon.h> 15 16 #include "aom/aom_integer.h" // For AOM_FORCE_INLINE. 17 #include "config/aom_config.h" 18 19 #define REINTERPRET_NEON(u, to_sz, to_count, from_sz, from_count, n, q) \ 20 static AOM_FORCE_INLINE u##int##to_sz##x##to_count##x##n##_t \ 21 aom_reinterpret##q##_##u##to_sz##_##u##from_sz##_x##n( \ 22 const u##int##from_sz##x##from_count##x##n##_t src) { \ 23 u##int##to_sz##x##to_count##x##n##_t ret; \ 24 for (int i = 0; i < (n); ++i) { \ 25 ret.val[i] = vreinterpret##q##_##u##to_sz##_##u##from_sz(src.val[i]); \ 26 } \ 27 return ret; \ 28 } 29 30 REINTERPRET_NEON(u, 8, 8, 16, 4, 2, ) // uint8x8x2_t from uint16x4x2_t 31 REINTERPRET_NEON(u, 8, 16, 16, 8, 2, q) // uint8x16x2_t from uint16x8x2_t 32 33 #endif // AOM_AOM_DSP_ARM_REINTERPRET_NEON_H_ 34