1 | /* The copyright in this software is being made available under the BSD |
---|
2 | * License, included below. This software may be subject to other third party |
---|
3 | * and contributor rights, including patent rights, and no such rights are |
---|
4 | * granted under this license. |
---|
5 | * |
---|
6 | * Copyright (c) 2010-2016, ITU/ISO/IEC |
---|
7 | * All rights reserved. |
---|
8 | * |
---|
9 | * Redistribution and use in source and binary forms, with or without |
---|
10 | * modification, are permitted provided that the following conditions are met: |
---|
11 | * |
---|
12 | * * Redistributions of source code must retain the above copyright notice, |
---|
13 | * this list of conditions and the following disclaimer. |
---|
14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
15 | * this list of conditions and the following disclaimer in the documentation |
---|
16 | * and/or other materials provided with the distribution. |
---|
17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
18 | * be used to endorse or promote products derived from this software without |
---|
19 | * specific prior written permission. |
---|
20 | * |
---|
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
32 | */ |
---|
33 | |
---|
34 | /** \file TComPicSym.cpp |
---|
35 | \brief picture symbol class |
---|
36 | */ |
---|
37 | |
---|
38 | #include "TComPicSym.h" |
---|
39 | #include "TComSampleAdaptiveOffset.h" |
---|
40 | #include "TComSlice.h" |
---|
41 | |
---|
42 | //! \ingroup TLibCommon |
---|
43 | //! \{ |
---|
44 | |
---|
45 | // ==================================================================================================================== |
---|
46 | // Constructor / destructor / create / destroy |
---|
47 | // ==================================================================================================================== |
---|
48 | |
---|
49 | TComPicSym::TComPicSym() |
---|
50 | :m_frameWidthInCtus(0) |
---|
51 | ,m_frameHeightInCtus(0) |
---|
52 | ,m_uiMinCUWidth(0) |
---|
53 | ,m_uiMinCUHeight(0) |
---|
54 | ,m_uhTotalDepth(0) |
---|
55 | ,m_numPartitionsInCtu(0) |
---|
56 | ,m_numPartInCtuWidth(0) |
---|
57 | ,m_numPartInCtuHeight(0) |
---|
58 | ,m_numCtusInFrame(0) |
---|
59 | ,m_apSlices() |
---|
60 | ,m_pictureCtuArray(NULL) |
---|
61 | ,m_numTileColumnsMinus1(0) |
---|
62 | ,m_numTileRowsMinus1(0) |
---|
63 | ,m_ctuTsToRsAddrMap(NULL) |
---|
64 | ,m_puiTileIdxMap(NULL) |
---|
65 | ,m_ctuRsToTsAddrMap(NULL) |
---|
66 | ,m_saoBlkParams(NULL) |
---|
67 | #if ADAPTIVE_QP_SELECTION |
---|
68 | ,m_pParentARLBuffer(NULL) |
---|
69 | #endif |
---|
70 | {} |
---|
71 | |
---|
72 | |
---|
73 | Void TComPicSym::create ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth ) |
---|
74 | { |
---|
75 | UInt i; |
---|
76 | m_sps = sps; |
---|
77 | m_pps = pps; |
---|
78 | |
---|
79 | const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc(); |
---|
80 | const Int iPicWidth = sps.getPicWidthInLumaSamples(); |
---|
81 | const Int iPicHeight = sps.getPicHeightInLumaSamples(); |
---|
82 | const UInt uiMaxCuWidth = sps.getMaxCUWidth(); |
---|
83 | const UInt uiMaxCuHeight = sps.getMaxCUHeight(); |
---|
84 | |
---|
85 | m_uhTotalDepth = uiMaxDepth; |
---|
86 | m_numPartitionsInCtu = 1<<(m_uhTotalDepth<<1); |
---|
87 | |
---|
88 | m_uiMinCUWidth = uiMaxCuWidth >> m_uhTotalDepth; |
---|
89 | m_uiMinCUHeight = uiMaxCuHeight >> m_uhTotalDepth; |
---|
90 | |
---|
91 | m_numPartInCtuWidth = uiMaxCuWidth / m_uiMinCUWidth; // equivalent to 1<<m_uhTotalDepth |
---|
92 | m_numPartInCtuHeight = uiMaxCuHeight / m_uiMinCUHeight; // equivalent to 1<<m_uhTotalDepth |
---|
93 | |
---|
94 | m_frameWidthInCtus = ( iPicWidth %uiMaxCuWidth ) ? iPicWidth /uiMaxCuWidth + 1 : iPicWidth /uiMaxCuWidth; |
---|
95 | m_frameHeightInCtus = ( iPicHeight%uiMaxCuHeight ) ? iPicHeight/uiMaxCuHeight + 1 : iPicHeight/uiMaxCuHeight; |
---|
96 | |
---|
97 | m_numCtusInFrame = m_frameWidthInCtus * m_frameHeightInCtus; |
---|
98 | m_pictureCtuArray = new TComDataCU*[m_numCtusInFrame]; |
---|
99 | |
---|
100 | clearSliceBuffer(); |
---|
101 | allocateNewSlice(); |
---|
102 | |
---|
103 | #if ADAPTIVE_QP_SELECTION |
---|
104 | if (m_pParentARLBuffer == NULL) |
---|
105 | { |
---|
106 | m_pParentARLBuffer = new TCoeff[uiMaxCuWidth*uiMaxCuHeight*MAX_NUM_COMPONENT]; |
---|
107 | } |
---|
108 | #endif |
---|
109 | |
---|
110 | for ( i=0; i<m_numCtusInFrame ; i++ ) |
---|
111 | { |
---|
112 | m_pictureCtuArray[i] = new TComDataCU; |
---|
113 | m_pictureCtuArray[i]->create( chromaFormatIDC, m_numPartitionsInCtu, uiMaxCuWidth, uiMaxCuHeight, false, uiMaxCuWidth >> m_uhTotalDepth |
---|
114 | #if ADAPTIVE_QP_SELECTION |
---|
115 | , m_pParentARLBuffer |
---|
116 | #endif |
---|
117 | ); |
---|
118 | } |
---|
119 | |
---|
120 | m_ctuTsToRsAddrMap = new UInt[m_numCtusInFrame+1]; |
---|
121 | m_puiTileIdxMap = new UInt[m_numCtusInFrame]; |
---|
122 | m_ctuRsToTsAddrMap = new UInt[m_numCtusInFrame+1]; |
---|
123 | |
---|
124 | for( i=0; i<m_numCtusInFrame; i++ ) |
---|
125 | { |
---|
126 | m_ctuTsToRsAddrMap[i] = i; |
---|
127 | m_ctuRsToTsAddrMap[i] = i; |
---|
128 | } |
---|
129 | |
---|
130 | m_saoBlkParams = new SAOBlkParam[m_numCtusInFrame]; |
---|
131 | |
---|
132 | |
---|
133 | xInitTiles(); |
---|
134 | xInitCtuTsRsAddrMaps(); |
---|
135 | |
---|
136 | } |
---|
137 | |
---|
138 | Void TComPicSym::destroy() |
---|
139 | { |
---|
140 | clearSliceBuffer(); |
---|
141 | |
---|
142 | if (m_pictureCtuArray) |
---|
143 | { |
---|
144 | for (Int i = 0; i < m_numCtusInFrame; i++) |
---|
145 | { |
---|
146 | if (m_pictureCtuArray[i]) |
---|
147 | { |
---|
148 | m_pictureCtuArray[i]->destroy(); |
---|
149 | delete m_pictureCtuArray[i]; |
---|
150 | m_pictureCtuArray[i] = NULL; |
---|
151 | } |
---|
152 | } |
---|
153 | delete [] m_pictureCtuArray; |
---|
154 | m_pictureCtuArray = NULL; |
---|
155 | } |
---|
156 | |
---|
157 | delete [] m_ctuTsToRsAddrMap; |
---|
158 | m_ctuTsToRsAddrMap = NULL; |
---|
159 | |
---|
160 | delete [] m_puiTileIdxMap; |
---|
161 | m_puiTileIdxMap = NULL; |
---|
162 | |
---|
163 | delete [] m_ctuRsToTsAddrMap; |
---|
164 | m_ctuRsToTsAddrMap = NULL; |
---|
165 | |
---|
166 | if(m_saoBlkParams) |
---|
167 | { |
---|
168 | delete[] m_saoBlkParams; m_saoBlkParams = NULL; |
---|
169 | } |
---|
170 | |
---|
171 | #if ADAPTIVE_QP_SELECTION |
---|
172 | delete [] m_pParentARLBuffer; |
---|
173 | m_pParentARLBuffer = NULL; |
---|
174 | #endif |
---|
175 | } |
---|
176 | |
---|
177 | Void TComPicSym::allocateNewSlice() |
---|
178 | { |
---|
179 | m_apSlices.push_back(new TComSlice); |
---|
180 | m_apSlices.back()->setPPS(&m_pps); |
---|
181 | m_apSlices.back()->setSPS(&m_sps); |
---|
182 | if (m_apSlices.size()>=2) |
---|
183 | { |
---|
184 | m_apSlices.back()->copySliceInfo( m_apSlices[m_apSlices.size()-2] ); |
---|
185 | m_apSlices.back()->initSlice(); |
---|
186 | } |
---|
187 | } |
---|
188 | |
---|
189 | Void TComPicSym::clearSliceBuffer() |
---|
190 | { |
---|
191 | for (UInt i = 0; i < UInt(m_apSlices.size()); i++) |
---|
192 | { |
---|
193 | delete m_apSlices[i]; |
---|
194 | } |
---|
195 | m_apSlices.clear(); |
---|
196 | } |
---|
197 | |
---|
198 | Void TComPicSym::xInitCtuTsRsAddrMaps() |
---|
199 | { |
---|
200 | //generate the Coding Order Map and Inverse Coding Order Map |
---|
201 | for(Int ctuTsAddr=0, ctuRsAddr=0; ctuTsAddr<getNumberOfCtusInFrame(); ctuTsAddr++, ctuRsAddr = xCalculateNextCtuRSAddr(ctuRsAddr)) |
---|
202 | { |
---|
203 | setCtuTsToRsAddrMap(ctuTsAddr, ctuRsAddr); |
---|
204 | setCtuRsToTsAddrMap(ctuRsAddr, ctuTsAddr); |
---|
205 | } |
---|
206 | setCtuTsToRsAddrMap(getNumberOfCtusInFrame(), getNumberOfCtusInFrame()); |
---|
207 | setCtuRsToTsAddrMap(getNumberOfCtusInFrame(), getNumberOfCtusInFrame()); |
---|
208 | } |
---|
209 | |
---|
210 | Void TComPicSym::xInitTiles() |
---|
211 | { |
---|
212 | //set NumColumnsMinus1 and NumRowsMinus1 |
---|
213 | setNumTileColumnsMinus1( m_pps.getNumTileColumnsMinus1() ); |
---|
214 | setNumTileRowsMinus1( m_pps.getNumTileRowsMinus1() ); |
---|
215 | |
---|
216 | const Int numCols = m_pps.getNumTileColumnsMinus1() + 1; |
---|
217 | const Int numRows = m_pps.getNumTileRowsMinus1() + 1; |
---|
218 | const Int numTiles = numRows * numCols; |
---|
219 | |
---|
220 | // allocate memory for tile parameters |
---|
221 | m_tileParameters.resize(numTiles); |
---|
222 | |
---|
223 | if( m_pps.getTileUniformSpacingFlag() ) |
---|
224 | { |
---|
225 | //set width and height for each (uniform) tile |
---|
226 | for(Int row=0; row < numRows; row++) |
---|
227 | { |
---|
228 | for(Int col=0; col < numCols; col++) |
---|
229 | { |
---|
230 | const Int tileIdx = row * numCols + col; |
---|
231 | m_tileParameters[tileIdx].setTileWidthInCtus( (col+1)*getFrameWidthInCtus( )/numCols - (col*getFrameWidthInCtus( ))/numCols ); |
---|
232 | m_tileParameters[tileIdx].setTileHeightInCtus( (row+1)*getFrameHeightInCtus()/numRows - (row*getFrameHeightInCtus())/numRows ); |
---|
233 | } |
---|
234 | } |
---|
235 | } |
---|
236 | else |
---|
237 | { |
---|
238 | //set the width for each tile |
---|
239 | for(Int row=0; row < numRows; row++) |
---|
240 | { |
---|
241 | Int cumulativeTileWidth = 0; |
---|
242 | for(Int col=0; col < getNumTileColumnsMinus1(); col++) |
---|
243 | { |
---|
244 | m_tileParameters[row * numCols + col].setTileWidthInCtus( m_pps.getTileColumnWidth(col) ); |
---|
245 | cumulativeTileWidth += m_pps.getTileColumnWidth(col); |
---|
246 | } |
---|
247 | m_tileParameters[row * numCols + getNumTileColumnsMinus1()].setTileWidthInCtus( getFrameWidthInCtus()-cumulativeTileWidth ); |
---|
248 | } |
---|
249 | |
---|
250 | //set the height for each tile |
---|
251 | for(Int col=0; col < numCols; col++) |
---|
252 | { |
---|
253 | Int cumulativeTileHeight = 0; |
---|
254 | for(Int row=0; row < getNumTileRowsMinus1(); row++) |
---|
255 | { |
---|
256 | m_tileParameters[row * numCols + col].setTileHeightInCtus( m_pps.getTileRowHeight(row) ); |
---|
257 | cumulativeTileHeight += m_pps.getTileRowHeight(row); |
---|
258 | } |
---|
259 | m_tileParameters[getNumTileRowsMinus1() * numCols + col].setTileHeightInCtus( getFrameHeightInCtus()-cumulativeTileHeight ); |
---|
260 | } |
---|
261 | } |
---|
262 | |
---|
263 | // Tile size check |
---|
264 | Int minWidth = 1; |
---|
265 | Int minHeight = 1; |
---|
266 | const Int profileIdc = m_sps.getPTL()->getGeneralPTL()->getProfileIdc(); |
---|
267 | if ( profileIdc == Profile::MAIN || profileIdc == Profile::MAIN10) //TODO: add more profiles to the tile-size check... |
---|
268 | { |
---|
269 | if (m_pps.getTilesEnabledFlag()) |
---|
270 | { |
---|
271 | minHeight = 64 / m_sps.getMaxCUHeight(); |
---|
272 | minWidth = 256 / m_sps.getMaxCUWidth(); |
---|
273 | } |
---|
274 | } |
---|
275 | for(Int row=0; row < numRows; row++) |
---|
276 | { |
---|
277 | for(Int col=0; col < numCols; col++) |
---|
278 | { |
---|
279 | const Int tileIdx = row * numCols + col; |
---|
280 | assert (m_tileParameters[tileIdx].getTileWidthInCtus() >= minWidth); |
---|
281 | assert (m_tileParameters[tileIdx].getTileHeightInCtus() >= minHeight); |
---|
282 | } |
---|
283 | } |
---|
284 | |
---|
285 | //initialize each tile of the current picture |
---|
286 | for( Int row=0; row < numRows; row++ ) |
---|
287 | { |
---|
288 | for( Int col=0; col < numCols; col++ ) |
---|
289 | { |
---|
290 | const Int tileIdx = row * numCols + col; |
---|
291 | |
---|
292 | //initialize the RightEdgePosInCU for each tile |
---|
293 | Int rightEdgePosInCTU = 0; |
---|
294 | for( Int i=0; i <= col; i++ ) |
---|
295 | { |
---|
296 | rightEdgePosInCTU += m_tileParameters[row * numCols + i].getTileWidthInCtus(); |
---|
297 | } |
---|
298 | m_tileParameters[tileIdx].setRightEdgePosInCtus(rightEdgePosInCTU-1); |
---|
299 | |
---|
300 | //initialize the BottomEdgePosInCU for each tile |
---|
301 | Int bottomEdgePosInCTU = 0; |
---|
302 | for( Int i=0; i <= row; i++ ) |
---|
303 | { |
---|
304 | bottomEdgePosInCTU += m_tileParameters[i * numCols + col].getTileHeightInCtus(); |
---|
305 | } |
---|
306 | m_tileParameters[tileIdx].setBottomEdgePosInCtus(bottomEdgePosInCTU-1); |
---|
307 | |
---|
308 | //initialize the FirstCUAddr for each tile |
---|
309 | m_tileParameters[tileIdx].setFirstCtuRsAddr( (m_tileParameters[tileIdx].getBottomEdgePosInCtus() - m_tileParameters[tileIdx].getTileHeightInCtus() + 1) * getFrameWidthInCtus() + |
---|
310 | m_tileParameters[tileIdx].getRightEdgePosInCtus() - m_tileParameters[tileIdx].getTileWidthInCtus() + 1); |
---|
311 | } |
---|
312 | } |
---|
313 | |
---|
314 | Int columnIdx = 0; |
---|
315 | Int rowIdx = 0; |
---|
316 | |
---|
317 | //initialize the TileIdxMap |
---|
318 | for( Int i=0; i<m_numCtusInFrame; i++) |
---|
319 | { |
---|
320 | for( Int col=0; col < numCols; col++) |
---|
321 | { |
---|
322 | if(i % getFrameWidthInCtus() <= m_tileParameters[col].getRightEdgePosInCtus()) |
---|
323 | { |
---|
324 | columnIdx = col; |
---|
325 | break; |
---|
326 | } |
---|
327 | } |
---|
328 | for(Int row=0; row < numRows; row++) |
---|
329 | { |
---|
330 | if(i / getFrameWidthInCtus() <= m_tileParameters[row*numCols].getBottomEdgePosInCtus()) |
---|
331 | { |
---|
332 | rowIdx = row; |
---|
333 | break; |
---|
334 | } |
---|
335 | } |
---|
336 | m_puiTileIdxMap[i] = rowIdx * numCols + columnIdx; |
---|
337 | } |
---|
338 | } |
---|
339 | UInt TComPicSym::xCalculateNextCtuRSAddr( UInt currCtuRsAddr ) |
---|
340 | { |
---|
341 | UInt nextCtuRsAddr; |
---|
342 | |
---|
343 | //get the tile index for the current CTU |
---|
344 | const UInt uiTileIdx = getTileIdxMap(currCtuRsAddr); |
---|
345 | |
---|
346 | //get the raster scan address for the next CTU |
---|
347 | if( currCtuRsAddr % m_frameWidthInCtus == getTComTile(uiTileIdx)->getRightEdgePosInCtus() && currCtuRsAddr / m_frameWidthInCtus == getTComTile(uiTileIdx)->getBottomEdgePosInCtus() ) |
---|
348 | //the current CTU is the last CTU of the tile |
---|
349 | { |
---|
350 | if(uiTileIdx+1 == getNumTiles()) |
---|
351 | { |
---|
352 | nextCtuRsAddr = m_numCtusInFrame; |
---|
353 | } |
---|
354 | else |
---|
355 | { |
---|
356 | nextCtuRsAddr = getTComTile(uiTileIdx+1)->getFirstCtuRsAddr(); |
---|
357 | } |
---|
358 | } |
---|
359 | else //the current CTU is not the last CTU of the tile |
---|
360 | { |
---|
361 | if( currCtuRsAddr % m_frameWidthInCtus == getTComTile(uiTileIdx)->getRightEdgePosInCtus() ) //the current CTU is on the rightmost edge of the tile |
---|
362 | { |
---|
363 | nextCtuRsAddr = currCtuRsAddr + m_frameWidthInCtus - getTComTile(uiTileIdx)->getTileWidthInCtus() + 1; |
---|
364 | } |
---|
365 | else |
---|
366 | { |
---|
367 | nextCtuRsAddr = currCtuRsAddr + 1; |
---|
368 | } |
---|
369 | } |
---|
370 | |
---|
371 | return nextCtuRsAddr; |
---|
372 | } |
---|
373 | |
---|
374 | Void TComPicSym::deriveLoopFilterBoundaryAvailibility(Int ctuRsAddr, |
---|
375 | Bool& isLeftAvail, |
---|
376 | Bool& isRightAvail, |
---|
377 | Bool& isAboveAvail, |
---|
378 | Bool& isBelowAvail, |
---|
379 | Bool& isAboveLeftAvail, |
---|
380 | Bool& isAboveRightAvail, |
---|
381 | Bool& isBelowLeftAvail, |
---|
382 | Bool& isBelowRightAvail |
---|
383 | ) |
---|
384 | { |
---|
385 | |
---|
386 | isLeftAvail = (ctuRsAddr % m_frameWidthInCtus != 0); |
---|
387 | isRightAvail = (ctuRsAddr % m_frameWidthInCtus != m_frameWidthInCtus-1); |
---|
388 | isAboveAvail = (ctuRsAddr >= m_frameWidthInCtus ); |
---|
389 | isBelowAvail = (ctuRsAddr < m_numCtusInFrame - m_frameWidthInCtus); |
---|
390 | isAboveLeftAvail = (isAboveAvail && isLeftAvail); |
---|
391 | isAboveRightAvail= (isAboveAvail && isRightAvail); |
---|
392 | isBelowLeftAvail = (isBelowAvail && isLeftAvail); |
---|
393 | isBelowRightAvail= (isBelowAvail && isRightAvail); |
---|
394 | |
---|
395 | Bool isLoopFiltAcrossTilePPS = getCtu(ctuRsAddr)->getSlice()->getPPS()->getLoopFilterAcrossTilesEnabledFlag(); |
---|
396 | |
---|
397 | { |
---|
398 | TComDataCU* ctuCurr = getCtu(ctuRsAddr); |
---|
399 | TComDataCU* ctuLeft = isLeftAvail ?getCtu(ctuRsAddr-1):NULL; |
---|
400 | TComDataCU* ctuRight = isRightAvail?getCtu(ctuRsAddr+1):NULL; |
---|
401 | TComDataCU* ctuAbove = isAboveAvail?getCtu(ctuRsAddr-m_frameWidthInCtus):NULL; |
---|
402 | TComDataCU* ctuBelow = isBelowAvail?getCtu(ctuRsAddr+m_frameWidthInCtus):NULL; |
---|
403 | TComDataCU* ctuAboveLeft = isAboveLeftAvail ? getCtu(ctuRsAddr-m_frameWidthInCtus-1):NULL; |
---|
404 | TComDataCU* ctuAboveRight = isAboveRightAvail? getCtu(ctuRsAddr-m_frameWidthInCtus+1):NULL; |
---|
405 | TComDataCU* ctuBelowLeft = isBelowLeftAvail ? getCtu(ctuRsAddr+m_frameWidthInCtus-1):NULL; |
---|
406 | TComDataCU* ctuBelowRight = isBelowRightAvail? getCtu(ctuRsAddr+m_frameWidthInCtus+1):NULL; |
---|
407 | |
---|
408 | { |
---|
409 | //left |
---|
410 | if(ctuLeft != NULL) |
---|
411 | { |
---|
412 | isLeftAvail = (ctuCurr->getSlice()->getSliceCurStartCtuTsAddr() != ctuLeft->getSlice()->getSliceCurStartCtuTsAddr())?ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag():true; |
---|
413 | } |
---|
414 | //above |
---|
415 | if(ctuAbove != NULL) |
---|
416 | { |
---|
417 | isAboveAvail = (ctuCurr->getSlice()->getSliceCurStartCtuTsAddr() != ctuAbove->getSlice()->getSliceCurStartCtuTsAddr())?ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag():true; |
---|
418 | } |
---|
419 | //right |
---|
420 | if(ctuRight != NULL) |
---|
421 | { |
---|
422 | isRightAvail = (ctuCurr->getSlice()->getSliceCurStartCtuTsAddr() != ctuRight->getSlice()->getSliceCurStartCtuTsAddr())?ctuRight->getSlice()->getLFCrossSliceBoundaryFlag():true; |
---|
423 | } |
---|
424 | //below |
---|
425 | if(ctuBelow != NULL) |
---|
426 | { |
---|
427 | isBelowAvail = (ctuCurr->getSlice()->getSliceCurStartCtuTsAddr() != ctuBelow->getSlice()->getSliceCurStartCtuTsAddr())?ctuBelow->getSlice()->getLFCrossSliceBoundaryFlag():true; |
---|
428 | } |
---|
429 | //above-left |
---|
430 | if(ctuAboveLeft != NULL) |
---|
431 | { |
---|
432 | isAboveLeftAvail = (ctuCurr->getSlice()->getSliceCurStartCtuTsAddr() != ctuAboveLeft->getSlice()->getSliceCurStartCtuTsAddr())?ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag():true; |
---|
433 | } |
---|
434 | //below-right |
---|
435 | if(ctuBelowRight != NULL) |
---|
436 | { |
---|
437 | isBelowRightAvail = (ctuCurr->getSlice()->getSliceCurStartCtuTsAddr() != ctuBelowRight->getSlice()->getSliceCurStartCtuTsAddr())?ctuBelowRight->getSlice()->getLFCrossSliceBoundaryFlag():true; |
---|
438 | } |
---|
439 | |
---|
440 | //above-right |
---|
441 | if(ctuAboveRight != NULL) |
---|
442 | { |
---|
443 | Int curSliceStartTsAddr = ctuCurr->getSlice()->getSliceCurStartCtuTsAddr(); |
---|
444 | Int aboveRightSliceStartTsAddr = ctuAboveRight->getSlice()->getSliceCurStartCtuTsAddr(); |
---|
445 | |
---|
446 | isAboveRightAvail = (curSliceStartTsAddr == aboveRightSliceStartTsAddr)?(true): |
---|
447 | ( |
---|
448 | (curSliceStartTsAddr > aboveRightSliceStartTsAddr)?(ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag()) |
---|
449 | :(ctuAboveRight->getSlice()->getLFCrossSliceBoundaryFlag()) |
---|
450 | ); |
---|
451 | } |
---|
452 | //below-left |
---|
453 | if(ctuBelowLeft != NULL) |
---|
454 | { |
---|
455 | Int curSliceStartTsAddr = ctuCurr->getSlice()->getSliceCurStartCtuTsAddr(); |
---|
456 | Int belowLeftSliceStartTsAddr = ctuBelowLeft->getSlice()->getSliceCurStartCtuTsAddr(); |
---|
457 | |
---|
458 | isBelowLeftAvail = (curSliceStartTsAddr == belowLeftSliceStartTsAddr)?(true): |
---|
459 | ( |
---|
460 | (curSliceStartTsAddr > belowLeftSliceStartTsAddr)?(ctuCurr->getSlice()->getLFCrossSliceBoundaryFlag()) |
---|
461 | :(ctuBelowLeft->getSlice()->getLFCrossSliceBoundaryFlag()) |
---|
462 | ); |
---|
463 | } |
---|
464 | } |
---|
465 | |
---|
466 | if(!isLoopFiltAcrossTilePPS) |
---|
467 | { |
---|
468 | isLeftAvail = (!isLeftAvail ) ?false:(getTileIdxMap( ctuLeft->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr )); |
---|
469 | isAboveAvail = (!isAboveAvail ) ?false:(getTileIdxMap( ctuAbove->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr )); |
---|
470 | isRightAvail = (!isRightAvail ) ?false:(getTileIdxMap( ctuRight->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr )); |
---|
471 | isBelowAvail = (!isBelowAvail ) ?false:(getTileIdxMap( ctuBelow->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr )); |
---|
472 | isAboveLeftAvail = (!isAboveLeftAvail ) ?false:(getTileIdxMap( ctuAboveLeft->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr )); |
---|
473 | isAboveRightAvail= (!isAboveRightAvail) ?false:(getTileIdxMap( ctuAboveRight->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr )); |
---|
474 | isBelowLeftAvail = (!isBelowLeftAvail ) ?false:(getTileIdxMap( ctuBelowLeft->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr )); |
---|
475 | isBelowRightAvail= (!isBelowRightAvail) ?false:(getTileIdxMap( ctuBelowRight->getCtuRsAddr() ) == getTileIdxMap( ctuRsAddr )); |
---|
476 | } |
---|
477 | } |
---|
478 | |
---|
479 | } |
---|
480 | |
---|
481 | |
---|
482 | TComTile::TComTile() |
---|
483 | : m_tileWidthInCtus (0) |
---|
484 | , m_tileHeightInCtus (0) |
---|
485 | , m_rightEdgePosInCtus (0) |
---|
486 | , m_bottomEdgePosInCtus (0) |
---|
487 | , m_firstCtuRsAddr (0) |
---|
488 | { |
---|
489 | } |
---|
490 | |
---|
491 | TComTile::~TComTile() |
---|
492 | { |
---|
493 | } |
---|
494 | //! \} |
---|