1 | |
---|
2 | |
---|
3 | /** \file TComLoopFilter.h |
---|
4 | \brief deblocking filter (header) |
---|
5 | */ |
---|
6 | |
---|
7 | #ifndef __TCOMLOOPFILTER__ |
---|
8 | #define __TCOMLOOPFILTER__ |
---|
9 | |
---|
10 | #include "CommonDef.h" |
---|
11 | #include "TComPic.h" |
---|
12 | |
---|
13 | #define DEBLOCK_SMALLEST_BLOCK 8 |
---|
14 | |
---|
15 | // ==================================================================================================================== |
---|
16 | // Class definition |
---|
17 | // ==================================================================================================================== |
---|
18 | |
---|
19 | /// deblocking filter class |
---|
20 | class TComLoopFilter |
---|
21 | { |
---|
22 | private: |
---|
23 | UInt m_uiDisableDeblockingFilterIdc; ///< deblocking filter idc |
---|
24 | UInt m_uiNumPartitions; |
---|
25 | UChar* m_aapucBS[2][3]; ///< Bs for [Ver/Hor][Y/U/V][Blk_Idx] |
---|
26 | Bool* m_aapbEdgeFilter[2][3]; |
---|
27 | LFCUParam m_stLFCUParam; ///< status structure |
---|
28 | |
---|
29 | #if (PARALLEL_DEBLK_DECISION && !PARALLEL_MERGED_DEBLK) |
---|
30 | UInt m_decisions_D [MAX_CU_SIZE/DEBLOCK_SMALLEST_BLOCK][MAX_CU_SIZE/DEBLOCK_SMALLEST_BLOCK]; |
---|
31 | UInt m_decisions_Sample[MAX_CU_SIZE/DEBLOCK_SMALLEST_BLOCK][MAX_CU_SIZE]; |
---|
32 | #endif |
---|
33 | |
---|
34 | protected: |
---|
35 | /// CU-level deblocking function |
---|
36 | #if PARALLEL_MERGED_DEBLK |
---|
37 | Void xDeblockCU ( TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth, Int Edge ); |
---|
38 | #else |
---|
39 | Void xDeblockCU ( TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth ); |
---|
40 | #endif |
---|
41 | |
---|
42 | // set / get functions |
---|
43 | Void xSetLoopfilterParam ( TComDataCU* pcCU, UInt uiAbsZorderIdx ); |
---|
44 | // filtering functions |
---|
45 | Void xSetEdgefilterTU ( TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth ); |
---|
46 | Void xSetEdgefilterPU ( TComDataCU* pcCU, UInt uiAbsZorderIdx ); |
---|
47 | Void xGetBoundaryStrengthSingle ( TComDataCU* pcCU, UInt uiAbsZorderIdx, Int iDir, UInt uiPartIdx ); |
---|
48 | UInt xCalcBsIdx ( TComDataCU* pcCU, UInt uiAbsZorderIdx, Int iDir, Int iEdgeIdx, Int iBaseUnitIdx ) |
---|
49 | { |
---|
50 | TComPic* const pcPic = pcCU->getPic(); |
---|
51 | const UInt uiLCUWidthInBaseUnits = pcPic->getNumPartInWidth(); |
---|
52 | if( iDir == 0 ) |
---|
53 | return g_auiRasterToZscan[g_auiZscanToRaster[uiAbsZorderIdx] + iBaseUnitIdx * uiLCUWidthInBaseUnits + iEdgeIdx ]; |
---|
54 | else |
---|
55 | return g_auiRasterToZscan[g_auiZscanToRaster[uiAbsZorderIdx] + iEdgeIdx * uiLCUWidthInBaseUnits + iBaseUnitIdx ]; |
---|
56 | } |
---|
57 | Void xSetEdgefilterMultiple( TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth, Int iDir, Int iEdgeIdx, Bool bValue ); |
---|
58 | |
---|
59 | #if (PARALLEL_DEBLK_DECISION && !PARALLEL_MERGED_DEBLK) |
---|
60 | Void xEdgeFilterLuma ( TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth, Int iDir, Int iEdge, Int iDecideExecute); |
---|
61 | #else |
---|
62 | Void xEdgeFilterLuma ( TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth, Int iDir, Int iEdge ); |
---|
63 | #endif |
---|
64 | Void xEdgeFilterChroma ( TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth, Int iDir, Int iEdge ); |
---|
65 | |
---|
66 | #if (PARALLEL_DEBLK_DECISION && !PARALLEL_MERGED_DEBLK) |
---|
67 | __inline Void xPelFilterLumaStrong ( Pel* piSrc, Int iOffset, Pel m0, Pel m1, Pel m2, Pel m3, Pel m4, Pel m5, Pel m6, Pel m7); |
---|
68 | __inline Void xPelFilterLumaWeak ( Pel* piSrc, Int iOffset, Int tc, Pel m1, Pel m2, Pel m3, Pel m4, Pel m5, Pel m6); |
---|
69 | __inline Void xPelFilterLumaExecution ( Pel* piSrc, Int iOffset, Int tc, Int strongFilter); |
---|
70 | __inline Int xPelFilterLumaDecision ( Pel* piSrc, Int iOffset, Int d, Int beta, Int tc); |
---|
71 | #endif |
---|
72 | |
---|
73 | #if PARALLEL_MERGED_DEBLK |
---|
74 | __inline Void xPelFilterLuma( Pel* piSrc, Int iOffset, Int d, Int beta, Int tc , Pel* piSrcJudge); |
---|
75 | #else |
---|
76 | __inline Void xPelFilterLuma( Pel* piSrc, Int iOffset, Int d, Int beta, Int tc ); |
---|
77 | #endif |
---|
78 | __inline Void xPelFilterChroma( Pel* piSrc, Int iOffset, Int tc ); |
---|
79 | __inline Int xCalcD( Pel* piSrc, Int iOffset); |
---|
80 | |
---|
81 | public: |
---|
82 | TComLoopFilter(); |
---|
83 | virtual ~TComLoopFilter(); |
---|
84 | |
---|
85 | Void create ( UInt uiMaxCUDepth ); |
---|
86 | Void destroy (); |
---|
87 | |
---|
88 | /// set configuration |
---|
89 | Void setCfg( UInt uiDisableDblkIdc, Int iAlphaOffset, Int iBetaOffset ); |
---|
90 | |
---|
91 | /// picture-level deblocking filter |
---|
92 | Void loopFilterPic( TComPic* pcPic ); |
---|
93 | }; |
---|
94 | |
---|
95 | #endif |
---|
96 | |
---|