1 /*! 2 * \copy 3 * Copyright (c) 2013, Cisco Systems 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 10 * * Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 13 * * Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in 15 * the documentation and/or other materials provided with the 16 * distribution. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 21 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 22 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 24 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 28 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * POSSIBILITY OF SUCH DAMAGE. 30 * 31 */ 32 33 #ifndef WELS_SAD_COMMON_H_ 34 #define WELS_SAD_COMMON_H_ 35 36 #include "typedefs.h" 37 38 39 //===================SAD=====================// 40 int32_t WelsSampleSad16x16_c (uint8_t*, int32_t, uint8_t*, int32_t); 41 int32_t WelsSampleSad16x8_c (uint8_t*, int32_t, uint8_t*, int32_t); 42 int32_t WelsSampleSad8x16_c (uint8_t*, int32_t, uint8_t*, int32_t); 43 int32_t WelsSampleSad8x8_c (uint8_t*, int32_t, uint8_t*, int32_t); 44 int32_t WelsSampleSad8x4_c( uint8_t *, int32_t, uint8_t *, int32_t ); 45 int32_t WelsSampleSad4x8_c( uint8_t *, int32_t, uint8_t *, int32_t ); 46 int32_t WelsSampleSad4x4_c (uint8_t*, int32_t, uint8_t*, int32_t); 47 48 49 50 void WelsSampleSadFour16x16_c (uint8_t* iSample1, int32_t iStride1, uint8_t* iSample2, int32_t iStride2, int32_t* pSad); 51 void WelsSampleSadFour16x8_c (uint8_t* iSample1, int32_t iStride1, uint8_t* iSample2, int32_t iStride2, int32_t* pSad); 52 void WelsSampleSadFour8x16_c (uint8_t* iSample1, int32_t iStride1, uint8_t* iSample2, int32_t iStride2, int32_t* pSad); 53 void WelsSampleSadFour8x8_c (uint8_t* iSample1, int32_t iStride1, uint8_t* iSample2, int32_t iStride2, int32_t* pSad); 54 void WelsSampleSadFour4x4_c (uint8_t* iSample1, int32_t iStride1, uint8_t* iSample2, int32_t iStride2, int32_t* pSad); 55 void WelsSampleSadFour8x4_c (uint8_t* iSample1, int32_t iStride1, uint8_t* iSample2, int32_t iStride2, int32_t* pSad); 56 void WelsSampleSadFour4x8_c (uint8_t* iSample1, int32_t iStride1, uint8_t* iSample2, int32_t iStride2, int32_t* pSad); 57 58 #if defined(__cplusplus) 59 extern "C" { 60 #endif//__cplusplus 61 62 #if defined (X86_ASM) 63 64 int32_t WelsSampleSad4x4_mmx (uint8_t*, int32_t, uint8_t*, int32_t); 65 int32_t WelsSampleSad16x16_sse2 (uint8_t*, int32_t, uint8_t*, int32_t); 66 int32_t WelsSampleSad16x8_sse2 (uint8_t*, int32_t, uint8_t*, int32_t); 67 int32_t WelsSampleSad8x16_sse2 (uint8_t*, int32_t, uint8_t*, int32_t); 68 int32_t WelsSampleSad8x8_sse21 (uint8_t*, int32_t, uint8_t*, int32_t); 69 70 void WelsSampleSadFour16x16_sse2 (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 71 void WelsSampleSadFour16x8_sse2 (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 72 void WelsSampleSadFour8x16_sse2 (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 73 void WelsSampleSadFour8x8_sse2 (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 74 void WelsSampleSadFour4x4_sse2 (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 75 76 #endif//X86_ASM 77 78 #if defined (HAVE_NEON) 79 80 int32_t WelsSampleSad4x4_neon (uint8_t*, int32_t, uint8_t*, int32_t); 81 int32_t WelsSampleSad16x16_neon (uint8_t*, int32_t, uint8_t*, int32_t); 82 int32_t WelsSampleSad16x8_neon (uint8_t*, int32_t, uint8_t*, int32_t); 83 int32_t WelsSampleSad8x16_neon (uint8_t*, int32_t, uint8_t*, int32_t); 84 int32_t WelsSampleSad8x8_neon (uint8_t*, int32_t, uint8_t*, int32_t); 85 86 void WelsSampleSadFour16x16_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 87 void WelsSampleSadFour16x8_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 88 void WelsSampleSadFour8x16_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 89 void WelsSampleSadFour8x8_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 90 void WelsSampleSadFour4x4_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 91 92 #endif 93 94 #if defined (HAVE_NEON_AARCH64) 95 int32_t WelsSampleSad4x4_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t); 96 int32_t WelsSampleSad16x16_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t); 97 int32_t WelsSampleSad16x8_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t); 98 int32_t WelsSampleSad8x16_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t); 99 int32_t WelsSampleSad8x8_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t); 100 101 void WelsSampleSadFour16x16_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 102 void WelsSampleSadFour16x8_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 103 void WelsSampleSadFour8x16_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 104 void WelsSampleSadFour8x8_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 105 void WelsSampleSadFour4x4_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 106 #endif 107 108 #if defined (HAVE_MMI) 109 int32_t WelsSampleSad4x4_mmi (uint8_t*, int32_t, uint8_t*, int32_t); 110 int32_t WelsSampleSad16x16_mmi (uint8_t*, int32_t, uint8_t*, int32_t); 111 int32_t WelsSampleSad16x8_mmi (uint8_t*, int32_t, uint8_t*, int32_t); 112 int32_t WelsSampleSad8x16_mmi (uint8_t*, int32_t, uint8_t*, int32_t); 113 int32_t WelsSampleSad8x8_mmi (uint8_t*, int32_t, uint8_t*, int32_t); 114 115 void WelsSampleSadFour16x16_mmi (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 116 void WelsSampleSadFour16x8_mmi (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 117 void WelsSampleSadFour8x16_mmi (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 118 void WelsSampleSadFour8x8_mmi (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 119 #endif//HAVE_MMI 120 121 #if defined (HAVE_LASX) 122 int32_t WelsSampleSad4x4_lasx (uint8_t*, int32_t, uint8_t*, int32_t); 123 int32_t WelsSampleSad8x8_lasx (uint8_t*, int32_t, uint8_t*, int32_t); 124 int32_t WelsSampleSad8x16_lasx (uint8_t*, int32_t, uint8_t*, int32_t); 125 int32_t WelsSampleSad16x8_lasx (uint8_t*, int32_t, uint8_t*, int32_t); 126 int32_t WelsSampleSad16x16_lasx (uint8_t*, int32_t, uint8_t*, int32_t); 127 128 void WelsSampleSadFour4x4_lasx (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 129 void WelsSampleSadFour8x8_lasx (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 130 void WelsSampleSadFour8x16_lasx (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 131 void WelsSampleSadFour16x8_lasx (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 132 void WelsSampleSadFour16x16_lasx (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*); 133 #endif 134 135 #if defined(__cplusplus) 136 } 137 #endif//__cplusplus 138 139 #endif //SAMPLE_H_ 140