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 DECODE_MB_AUX_H
34 #define DECODE_MB_AUX_H
35 
36 #include "typedefs.h"
37 #include "macros.h"
38 #include "wels_func_ptr_def.h"
39 
40 namespace WelsEnc {
41 void WelsDequantLumaDc4x4 (int16_t* pRes, const int32_t kiQp);
42 void WelsIHadamard4x4Dc (int16_t* pRes);
43 
44 void WelsInitReconstructionFuncs (SWelsFuncPtrList* pList, uint32_t  iCpuFlags);
45 void WelsGetEncBlockStrideOffset (int32_t* pBlock, const int32_t kiStrideY, const int32_t kiStrideUV);
46 
47 void WelsDequantFour4x4_c (int16_t* pRes, const uint16_t* kpQpTable);
48 void WelsDequant4x4_c (int16_t* pRes, const uint16_t* kpQpTable);
49 void WelsDequantIHadamard4x4_c (int16_t* pRes, const uint16_t kuiMF);
50 void WelsDequantIHadamard2x2Dc (int16_t* pDct, const uint16_t kuiMF);
51 
52 void WelsIDctT4RecOnMb (uint8_t* pDst, int32_t iDstStride, uint8_t* pPred, int32_t iPredStride, int16_t* pDct,
53                         PIDctFunc pfIDctFourT4);
54 void WelsIDctT4Rec_c (uint8_t* pRec, int32_t iStride, uint8_t* pPred, int32_t iPredStride, int16_t* pDct);
55 void WelsIDctFourT4Rec_c (uint8_t* pRec, int32_t iStride, uint8_t* pPred, int32_t iPredStride, int16_t* pDct);
56 void WelsIDctRecI16x16Dc_c (uint8_t* pRec, int32_t iStride, uint8_t* pPred, int32_t iPredStride, int16_t* pDctDc);
57 
58 #if defined(__cplusplus)
59 extern "C" {
60 #endif//__cplusplus
61 
62 #if defined(X86_ASM)
63 void WelsDequant4x4_sse2 (int16_t* pDct, const uint16_t* kpMF);
64 void WelsDequantFour4x4_sse2 (int16_t* pDct, const uint16_t* kpMF);
65 void WelsDequantIHadamard4x4_sse2 (int16_t* pRes, const uint16_t kuiMF);
66 
67 void WelsIDctT4Rec_mmx (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride, int16_t* pDct);
68 void WelsIDctT4Rec_sse2 (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride, int16_t* pDct);
69 void WelsIDctFourT4Rec_sse2 (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride, int16_t* pDct);
70 void WelsIDctRecI16x16Dc_sse2 (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride,
71                                int16_t* pDctDc);
72 void WelsIDctT4Rec_avx2 (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride, int16_t* pDct);
73 void WelsIDctFourT4Rec_avx2 (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride, int16_t* pDct);
74 #endif//X86_ASM
75 
76 #ifdef HAVE_NEON
77 void WelsDequantFour4x4_neon (int16_t* pDct, const uint16_t* kpMF);
78 void WelsDequant4x4_neon (int16_t* pDct, const uint16_t* kpMF);
79 void WelsDequantIHadamard4x4_neon (int16_t* pRes, const uint16_t kuiMF);
80 
81 void WelsIDctT4Rec_neon (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride, int16_t* pDct);
82 void WelsIDctFourT4Rec_neon (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride, int16_t* pDct);
83 void WelsIDctRecI16x16Dc_neon (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride,
84                                int16_t* pDctDc);
85 #endif
86 
87 #ifdef HAVE_NEON_AARCH64
88 void WelsDequantFour4x4_AArch64_neon (int16_t* pDct, const uint16_t* kpMF);
89 void WelsDequant4x4_AArch64_neon (int16_t* pDct, const uint16_t* kpMF);
90 void WelsDequantIHadamard4x4_AArch64_neon (int16_t* pRes, const uint16_t kuiMF);
91 
92 void WelsIDctT4Rec_AArch64_neon (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride, int16_t* pDct);
93 void WelsIDctFourT4Rec_AArch64_neon (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride, int16_t* pDct);
94 void WelsIDctRecI16x16Dc_AArch64_neon (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride,
95                                  int16_t* pDctDc);
96 #endif
97 
98 #if defined(HAVE_MMI)
99 void WelsIDctT4Rec_mmi (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride, int16_t* pDct);
100 void WelsIDctFourT4Rec_mmi (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride, int16_t* pDct);
101 void WelsIDctRecI16x16Dc_mmi (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride, int16_t* pDctDc);
102 #endif//HAVE_MMI
103 #if defined(__cplusplus)
104 }
105 #endif//__cplusplus
106 }
107 #endif
108