@@ -199,7 +199,7 @@ bool AdaptiveLoopFilter::isClipOrCrossedByVirtualBoundaries( const CodingStructu
199
199
const CodingUnit* prevCtu = cs.getCU ( prevCtuPos, CHANNEL_TYPE_LUMA );
200
200
if ( !CU::isAvailable ( *currCtu,
201
201
*prevCtu,
202
- !loopFilterAcrossTilesEnabledFlag ,
202
+ !loopFilterAcrossSlicesEnabledFlag ,
203
203
!loopFilterAcrossTilesEnabledFlag,
204
204
!loopFilterAcrossSubPicEnabledFlag ) )
205
205
{
@@ -214,8 +214,8 @@ bool AdaptiveLoopFilter::isClipOrCrossedByVirtualBoundaries( const CodingStructu
214
214
const CodingUnit* nextCtu = cs.getCU ( nextCtuPos, CHANNEL_TYPE_LUMA );
215
215
if ( !CU::isAvailable ( *currCtu,
216
216
*nextCtu,
217
- !pps-> getLoopFilterAcrossSlicesEnabledFlag () ,
218
- !pps-> getLoopFilterAcrossTilesEnabledFlag () ,
217
+ !loopFilterAcrossSlicesEnabledFlag ,
218
+ !loopFilterAcrossTilesEnabledFlag ,
219
219
!loopFilterAcrossSubPicEnabledFlag ) )
220
220
{
221
221
clipBottom = true ;
@@ -229,8 +229,8 @@ bool AdaptiveLoopFilter::isClipOrCrossedByVirtualBoundaries( const CodingStructu
229
229
const CodingUnit* prevCtu = cs.getCU ( prevCtuPos, CHANNEL_TYPE_LUMA );
230
230
if ( !CU::isAvailable ( *currCtu,
231
231
*prevCtu,
232
- !pps-> getLoopFilterAcrossSlicesEnabledFlag () ,
233
- !pps-> getLoopFilterAcrossTilesEnabledFlag () ,
232
+ !loopFilterAcrossSlicesEnabledFlag ,
233
+ !loopFilterAcrossTilesEnabledFlag ,
234
234
!loopFilterAcrossSubPicEnabledFlag ) )
235
235
{
236
236
clipLeft = true ;
@@ -245,8 +245,8 @@ bool AdaptiveLoopFilter::isClipOrCrossedByVirtualBoundaries( const CodingStructu
245
245
246
246
if ( !CU::isAvailable ( *currCtu,
247
247
*nextCtu,
248
- !pps-> getLoopFilterAcrossSlicesEnabledFlag () ,
249
- !pps-> getLoopFilterAcrossTilesEnabledFlag () ,
248
+ !loopFilterAcrossSlicesEnabledFlag ,
249
+ !loopFilterAcrossTilesEnabledFlag ,
250
250
!loopFilterAcrossSubPicEnabledFlag ) )
251
251
{
252
252
clipRight = true ;
@@ -261,21 +261,21 @@ bool AdaptiveLoopFilter::isClipOrCrossedByVirtualBoundaries( const CodingStructu
261
261
{
262
262
const Position prevCtuPos ( area.x - ctuSize, area.y - ctuSize );
263
263
const CodingUnit *prevCtu = cs.getCU ( prevCtuPos, CHANNEL_TYPE_LUMA );
264
- if ( !pps-> getLoopFilterAcrossSlicesEnabledFlag () && !CU::isSameSlice ( *currCtu, *prevCtu ) )
264
+ if ( !loopFilterAcrossSlicesEnabledFlag && !CU::isSameSlice ( *currCtu, *prevCtu ) )
265
265
{
266
266
rasterSliceAlfPad = 1 ;
267
267
}
268
268
}
269
269
}
270
270
271
- if ( !clipBottom && !clipRight && restrictSlices )
271
+ if ( !clipBottom && !clipRight && restrictSlices )
272
272
{
273
273
// bottom-right CTU
274
274
if ( area.x + ctuSize < cs.pcv ->lumaWidth && area.y + ctuSize < cs.pcv ->lumaHeight )
275
275
{
276
276
const Position nextCtuPos ( area.x + ctuSize, area.y + ctuSize );
277
277
const CodingUnit *nextCtu = cs.getCU ( nextCtuPos, CHANNEL_TYPE_LUMA );
278
- if ( !pps-> getLoopFilterAcrossSlicesEnabledFlag () && !CU::isSameSlice ( *currCtu, *nextCtu ) )
278
+ if ( !loopFilterAcrossSlicesEnabledFlag && !CU::isSameSlice ( *currCtu, *nextCtu ) )
279
279
{
280
280
rasterSliceAlfPad += 2 ;
281
281
}
@@ -460,16 +460,17 @@ void AdaptiveLoopFilter::prepareCTU( CodingStructure &cs, unsigned col, unsigned
460
460
void AdaptiveLoopFilter::processCTU ( CodingStructure & cs, unsigned col, unsigned line, int tid, const ChannelType chType )
461
461
{
462
462
PROFILER_SCOPE_AND_STAGE_EXT ( 1 , g_timeProfiler, P_ALF, cs, CH_L );
463
- PelUnitBuf recYuv = cs.getRecoBuf ();
464
463
465
464
const UnitArea ctuArea ( getCtuArea ( cs, col, line, true ) );
465
+ CPelUnitBuf recYuv = cs.getRecoBuf ().subBuf ( ctuArea );
466
+ PelUnitBuf dstYuv = m_alfBuf.subBuf ( ctuArea );
466
467
467
468
const unsigned ctuIdx = line * cs.pcv ->widthInCtus + col;
468
469
CtuAlfData currAlfData = cs.getCtuData ( col, line ).alfParam ;
469
470
currAlfData.alfCtuEnableFlag [1 ] += currAlfData.ccAlfFilterControl [0 ] > 0 ? 2 : 0 ;
470
471
currAlfData.alfCtuEnableFlag [2 ] += currAlfData.ccAlfFilterControl [1 ] > 0 ? 2 : 0 ;
471
472
472
- filterCTU ( recYuv. subBuf ( ctuArea ), m_alfBuf. subBuf ( ctuArea ) , currAlfData, cs.picture ->slices [0 ]->getClpRngs (), chType, cs, ctuIdx, ctuArea.lumaPos (), tid );
473
+ filterCTU ( recYuv, dstYuv , currAlfData, cs.picture ->slices [0 ]->getClpRngs (), chType, cs, ctuIdx, ctuArea.lumaPos (), tid );
473
474
}
474
475
475
476
bool AdaptiveLoopFilter::getAlfSkipPic ( const CodingStructure & cs )
@@ -489,7 +490,7 @@ bool AdaptiveLoopFilter::getAlfSkipPic( const CodingStructure & cs )
489
490
}
490
491
491
492
void AdaptiveLoopFilter::filterAreaLuma ( const CPelUnitBuf& srcBuf,
492
- const PelUnitBuf& dstBuf,
493
+ PelUnitBuf& dstBuf,
493
494
const Area& blk,
494
495
const Slice* slice,
495
496
const APS* const * aps,
@@ -535,7 +536,7 @@ void AdaptiveLoopFilter::filterAreaLuma( const CPelUnitBuf& srcBuf,
535
536
}
536
537
537
538
void AdaptiveLoopFilter::filterAreaChroma ( const CPelUnitBuf& srcBuf,
538
- const PelUnitBuf& dstBuf,
539
+ PelUnitBuf& dstBuf,
539
540
const Area& blkChroma,
540
541
const ComponentID compID,
541
542
const Slice* slice,
@@ -575,7 +576,7 @@ void AdaptiveLoopFilter::filterAreaChroma( const CPelUnitBuf& srcBuf,
575
576
}
576
577
577
578
void AdaptiveLoopFilter::filterAreaChromaCc ( const CPelUnitBuf& srcBuf,
578
- const PelUnitBuf& dstBuf,
579
+ PelUnitBuf& dstBuf,
579
580
const Area& blkLuma,
580
581
const Area& blkChroma,
581
582
const ComponentID compID,
@@ -601,7 +602,7 @@ void AdaptiveLoopFilter::filterAreaChromaCc( const CPelUnitBuf& srcBuf,
601
602
}
602
603
603
604
void AdaptiveLoopFilter::filterAreaChromaBothCc ( const CPelUnitBuf& srcBuf,
604
- const PelUnitBuf& dstBuf,
605
+ PelUnitBuf& dstBuf,
605
606
const Area& blkLuma,
606
607
const Area& blkChroma,
607
608
const Slice* slice,
@@ -653,7 +654,7 @@ void AdaptiveLoopFilter::filterAreaChromaBothCc( const CPelUnitBuf& srcBuf,
653
654
}
654
655
655
656
void AdaptiveLoopFilter::filterCTU ( const CPelUnitBuf& srcBuf,
656
- const PelUnitBuf& dstBuf,
657
+ PelUnitBuf& dstBuf,
657
658
const CtuAlfData& ctuAlfData,
658
659
const ClpRngs& clpRngs,
659
660
const ChannelType chType,
0 commit comments