• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_DECODE_SLICE_H__
34 #define WELS_DECODE_SLICE_H__
35 
36 #include "decoder_context.h"
37 
38 namespace WelsDec {
39 
40 int32_t WelsActualDecodeMbCavlcISlice (PWelsDecoderContext pCtx);
41 int32_t WelsDecodeMbCavlcISlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t& uiEosFlag);
42 
43 int32_t WelsActualDecodeMbCavlcPSlice (PWelsDecoderContext pCtx);
44 int32_t WelsDecodeMbCavlcPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t& uiEosFlag);
45 
46 int32_t WelsActualDecodeMbCavlcBSlice (PWelsDecoderContext pCtx);
47 int32_t WelsDecodeMbCavlcBSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t& uiEosFlag);
48 
49 typedef int32_t (*PWelsDecMbFunc) (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t& uiEosFlag);
50 
51 int32_t WelsDecodeMbCabacISlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t& uiEosFlag);
52 int32_t WelsDecodeMbCabacPSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t& uiEosFlag);
53 int32_t WelsDecodeMbCabacBSlice (PWelsDecoderContext pCtx, PNalUnit pNalCur, uint32_t& uiEosFlag);
54 int32_t WelsDecodeMbCabacISliceBaseMode0 (PWelsDecoderContext pCtx, uint32_t& uiEosFlag);
55 int32_t WelsDecodeMbCabacPSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail, uint32_t& uiEosFlag);
56 int32_t WelsDecodeMbCabacBSliceBaseMode0 (PWelsDecoderContext pCtx, PWelsNeighAvail pNeighAvail, uint32_t& uiEosFlag);
57 
58 int32_t WelsTargetSliceConstruction (PWelsDecoderContext pCtx); //construction based on slice
59 
60 int32_t WelsDecodeSlice (PWelsDecoderContext pCtx, bool bFirstSliceInLayer, PNalUnit pNalCur);
61 int32_t WelsDecodeAndConstructSlice (PWelsDecoderContext pCtx);
62 
63 int32_t WelsTargetMbConstruction (PWelsDecoderContext pCtx);
64 
65 int32_t WelsMbIntraPredictionConstruction (PWelsDecoderContext pCtx, PDqLayer pCurDqLayer, bool bOutput);
66 int32_t WelsMbInterSampleConstruction (PWelsDecoderContext pCtx, PDqLayer pCurDqLayer,
67                                        uint8_t* pDstY, uint8_t* pDstU, uint8_t* pDstV, int32_t iStrideL, int32_t iStrideC);
68 int32_t WelsMbInterConstruction (PWelsDecoderContext pCtx, PDqLayer pCurDqLayer);
69 void WelsLumaDcDequantIdct (int16_t* pBlock, int32_t iQp, PWelsDecoderContext pCtx);
70 int32_t WelsMbInterPrediction (PWelsDecoderContext pCtx, PDqLayer pCurDqLayer);
71 void WelsChromaDcIdct (int16_t* pBlock);
72 bool ComputeColocatedTemporalScaling (PWelsDecoderContext pCtx);
73 
74 #ifdef __cplusplus
75 extern "C" {
76 #endif//__cplusplus
77 
78 #if defined(X86_ASM)
79 void WelsBlockZero16x16_sse2 (int16_t* block, int32_t stride);
80 void WelsBlockZero8x8_sse2 (int16_t* block, int32_t stride);
81 #endif
82 
83 #if defined(HAVE_NEON)
84 void WelsBlockZero16x16_neon (int16_t* block, int32_t stride);
85 void WelsBlockZero8x8_neon (int16_t* block, int32_t stride);
86 #endif
87 
88 #if defined(HAVE_NEON_AARCH64)
89 void WelsBlockZero16x16_AArch64_neon (int16_t* block, int32_t stride);
90 void WelsBlockZero8x8_AArch64_neon (int16_t* block, int32_t stride);
91 #endif
92 #ifdef __cplusplus
93 }
94 #endif//__cplusplus
95 
96 void WelsBlockFuncInit (SBlockFunc* pFunc,  int32_t iCpu);
97 void WelsBlockZero16x16_c (int16_t* block, int32_t stride);
98 void WelsBlockZero8x8_c (int16_t* block, int32_t stride);
99 
100 } // namespace WelsDec
101 
102 #endif //WELS_DECODE_SLICE_H__
103 
104 
105