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 SAMPLE_H_ 34 #define SAMPLE_H_ 35 36 #include "typedefs.h" 37 #include "wels_func_ptr_def.h" 38 39 namespace WelsEnc { 40 41 //======================SATD======================// 42 int32_t WelsSampleSatd16x16_c (uint8_t*, int32_t, uint8_t*, int32_t); 43 int32_t WelsSampleSatd16x8_c (uint8_t*, int32_t, uint8_t*, int32_t); 44 int32_t WelsSampleSatd8x16_c (uint8_t*, int32_t, uint8_t*, int32_t); 45 int32_t WelsSampleSatd8x8_c (uint8_t*, int32_t, uint8_t*, int32_t); 46 //int32_t WelsSampleSatd8x4( uint8_t *, int32_t, uint8_t *, int32_t ); 47 //int32_t WelsSampleSatd4x8( uint8_t *, int32_t, uint8_t *, int32_t ); 48 int32_t WelsSampleSatd4x4_c (uint8_t*, int32_t, uint8_t*, int32_t); 49 50 int32_t WelsSampleSatdIntra4x4Combined3_c (uint8_t*, int32_t, uint8_t*, int32_t, uint8_t*, int32_t*, int32_t, int32_t, 51 int32_t); 52 int32_t WelsSampleSatdIntra16x16Combined3_c (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*); 53 int32_t WelsSampleSadIntra16x16Combined3_c (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*); 54 int32_t WelsSampleSatdIntra8x8Combined3_c (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*, 55 uint8_t*, uint8_t*); 56 int32_t WelsSampleSadIntra8x8Combined3_c (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*, 57 uint8_t*, uint8_t*); 58 59 #if defined(__cplusplus) 60 extern "C" { 61 #endif//__cplusplus 62 63 #if defined (X86_ASM) 64 65 66 int32_t WelsSampleSatd8x8_sse2 (uint8_t*, int32_t, uint8_t*, int32_t); 67 int32_t WelsSampleSatd16x8_sse2 (uint8_t*, int32_t, uint8_t*, int32_t); 68 int32_t WelsSampleSatd8x16_sse2 (uint8_t*, int32_t, uint8_t*, int32_t); 69 int32_t WelsSampleSatd16x16_sse2 (uint8_t*, int32_t, uint8_t*, int32_t); 70 int32_t WelsSampleSatd4x4_sse2 (uint8_t*, int32_t, uint8_t*, int32_t); 71 int32_t WelsSampleSatdThree4x4_sse2 (uint8_t*, int32_t, uint8_t*, int32_t, uint8_t*, int32_t*, int32_t, int32_t, 72 int32_t); 73 74 int32_t WelsSampleSatd8x8_sse41 (uint8_t*, int32_t, uint8_t*, int32_t); 75 int32_t WelsSampleSatd8x16_sse41 (uint8_t*, int32_t, uint8_t*, int32_t); 76 int32_t WelsSampleSatd16x8_sse41 (uint8_t*, int32_t, uint8_t*, int32_t); 77 int32_t WelsSampleSatd16x16_sse41 (uint8_t*, int32_t, uint8_t*, int32_t); 78 int32_t WelsSampleSatd4x4_sse41 (uint8_t*, int32_t, uint8_t*, int32_t); 79 80 int32_t WelsIntra16x16Combined3Satd_sse41 (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*); 81 int32_t WelsIntra16x16Combined3Sad_ssse3 (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*); 82 int32_t WelsIntraChroma8x8Combined3Satd_sse41 (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*, 83 uint8_t*, uint8_t*); 84 85 int32_t WelsSampleSatd8x8_avx2 (uint8_t*, int32_t, uint8_t*, int32_t); 86 int32_t WelsSampleSatd8x16_avx2 (uint8_t*, int32_t, uint8_t*, int32_t); 87 int32_t WelsSampleSatd16x8_avx2 (uint8_t*, int32_t, uint8_t*, int32_t); 88 int32_t WelsSampleSatd16x16_avx2 (uint8_t*, int32_t, uint8_t*, int32_t); 89 90 #endif//X86_ASM 91 92 #if defined (HAVE_NEON) 93 94 95 int32_t WelsSampleSatd8x8_neon (uint8_t*, int32_t, uint8_t*, int32_t); 96 int32_t WelsSampleSatd16x8_neon (uint8_t*, int32_t, uint8_t*, int32_t); 97 int32_t WelsSampleSatd8x16_neon (uint8_t*, int32_t, uint8_t*, int32_t); 98 int32_t WelsSampleSatd16x16_neon (uint8_t*, int32_t, uint8_t*, int32_t); 99 int32_t WelsSampleSatd4x4_neon (uint8_t*, int32_t, uint8_t*, int32_t); 100 101 int32_t WelsIntra16x16Combined3Satd_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*); 102 int32_t WelsIntra16x16Combined3Sad_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*); 103 int32_t WelsIntra8x8Combined3Satd_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*, uint8_t*, 104 uint8_t*); 105 int32_t WelsIntra8x8Combined3Sad_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*, uint8_t*, 106 uint8_t*); 107 int32_t WelsIntra4x4Combined3Satd_neon (uint8_t*, int32_t, uint8_t*, int32_t, uint8_t*, int32_t*, int32_t, int32_t, 108 int32_t); 109 110 #endif 111 112 #if defined (HAVE_NEON_AARCH64) 113 int32_t WelsSampleSatd4x4_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t); 114 int32_t WelsSampleSatd16x16_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t); 115 int32_t WelsSampleSatd16x8_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t); 116 int32_t WelsSampleSatd8x16_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t); 117 int32_t WelsSampleSatd8x8_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t); 118 int32_t WelsIntra16x16Combined3Satd_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*); 119 int32_t WelsIntra16x16Combined3Sad_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*); 120 int32_t WelsIntra8x8Combined3Satd_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*, uint8_t*, 121 uint8_t*); 122 int32_t WelsIntra8x8Combined3Sad_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*, uint8_t*, 123 uint8_t*); 124 int32_t WelsIntra4x4Combined3Satd_AArch64_neon (uint8_t*, int32_t, uint8_t*, int32_t, uint8_t*, int32_t*, int32_t, int32_t, 125 int32_t); 126 #endif 127 128 #if defined (HAVE_MMI) 129 int32_t WelsSampleSatd8x8_mmi (uint8_t*, int32_t, uint8_t*, int32_t); 130 int32_t WelsSampleSatd16x8_mmi (uint8_t*, int32_t, uint8_t*, int32_t); 131 int32_t WelsSampleSatd8x16_mmi (uint8_t*, int32_t, uint8_t*, int32_t); 132 int32_t WelsSampleSatd16x16_mmi (uint8_t*, int32_t, uint8_t*, int32_t); 133 int32_t WelsSampleSatd4x4_mmi (uint8_t*, int32_t, uint8_t*, int32_t); 134 #endif//HAVE_MMI 135 136 #if defined (HAVE_LASX) 137 int32_t WelsSampleSatd4x4_lasx (uint8_t*, int32_t, uint8_t*, int32_t); 138 int32_t WelsSampleSatd8x8_lasx (uint8_t*, int32_t, uint8_t*, int32_t); 139 int32_t WelsSampleSatd16x8_lasx (uint8_t*, int32_t, uint8_t*, int32_t); 140 int32_t WelsSampleSatd8x16_lasx (uint8_t*, int32_t, uint8_t*, int32_t); 141 int32_t WelsSampleSatd16x16_lasx (uint8_t*, int32_t, uint8_t*, int32_t); 142 #endif 143 144 #if defined(__cplusplus) 145 } 146 #endif//__cplusplus 147 148 void WelsInitSampleSadFunc (SWelsFuncPtrList* pFuncList, uint32_t uiCpuFlag); 149 150 } 151 152 #endif //SAMPLE_H_ 153