From 9ac5a47fcc293497e28d97db412cf5aef1d6ba45 Mon Sep 17 00:00:00 2001 From: Karsten Suehring <karsten.suehring@hhi.fraunhofer.de> Date: Fri, 4 Jan 2019 12:55:39 +0100 Subject: [PATCH] Tile coding fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix coding for HEVC style tiles - Re-enable tiles Original patch by: Rickard Sjöberg <rickard.sjoberg@ericsson.com> --- source/Lib/CommonLib/TypeDef.h | 2 +- source/Lib/DecoderLib/CABACReader.cpp | 4 ++-- source/Lib/DecoderLib/DecSlice.cpp | 4 ---- source/Lib/EncoderLib/CABACWriter.cpp | 4 ++-- source/Lib/EncoderLib/EncCu.cpp | 9 +++++++++ 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 448e59a6af..d4541761e8 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -220,9 +220,9 @@ #define HEVC_TILES_WPP 1 #else #define HEVC_USE_SIGN_HIDING 1 +#define HEVC_TILES_WPP 1 #endif - #define KEEP_PRED_AND_RESI_SIGNALS 0 diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp index b4af456d7e..ec4955ccf2 100644 --- a/source/Lib/DecoderLib/CABACReader.cpp +++ b/source/Lib/DecoderLib/CABACReader.cpp @@ -160,8 +160,8 @@ bool CABACReader::coding_tree_unit( CodingStructure& cs, const UnitArea& area, i const uint32_t curSliceIdx = cs.slice->getIndependentSliceIdx(); #if HEVC_TILES_WPP const uint32_t curTileIdx = cs.picture->tileMap->getTileIdxMap( pos ); - bool leftMergeAvail = cs.getCURestricted( pos.offset( -(int)pcv.maxCUWidth, 0 ), curSliceIdx, curTileIdx, CH_L ) ? true : false; - bool aboveMergeAvail = cs.getCURestricted( pos.offset( 0, -(int)pcv.maxCUHeight ), curSliceIdx, curTileIdx, CH_L ) ? true : false; + bool leftAvail = cs.getCURestricted( pos.offset( -(int)pcv.maxCUWidth, 0 ), curSliceIdx, curTileIdx, CH_L ) ? true : false; + bool aboveAvail = cs.getCURestricted( pos.offset( 0, -(int)pcv.maxCUHeight ), curSliceIdx, curTileIdx, CH_L ) ? true : false; #else bool leftAvail = cs.getCURestricted( pos.offset( -(int)pcv.maxCUWidth, 0 ), curSliceIdx, CH_L ) ? true : false; bool aboveAvail = cs.getCURestricted( pos.offset( 0, -(int)pcv.maxCUHeight ), curSliceIdx, CH_L ) ? true : false; diff --git a/source/Lib/DecoderLib/DecSlice.cpp b/source/Lib/DecoderLib/DecSlice.cpp index 523619d8c9..7db3e17a03 100644 --- a/source/Lib/DecoderLib/DecSlice.cpp +++ b/source/Lib/DecoderLib/DecSlice.cpp @@ -112,12 +112,8 @@ void DecSlice::decompressSlice( Slice* slice, InputBitstream* bitstream ) #else const int startCtuTsAddr = slice->getSliceCurStartCtuTsAddr(); #endif -#if HEVC_TILES_WPP - const int startCtuRsAddr = tileMap.getCtuTsToRsAddrMap(startCtuTsAddr); -#else #if HEVC_DEPENDENT_SLICES const int startCtuRsAddr = startCtuTsAddr; -#endif #endif const unsigned numCtusInFrame = cs.pcv->sizeInCtus; const unsigned widthInCtus = cs.pcv->widthInCtus; diff --git a/source/Lib/EncoderLib/CABACWriter.cpp b/source/Lib/EncoderLib/CABACWriter.cpp index e8906d4011..e4114bc2b2 100644 --- a/source/Lib/EncoderLib/CABACWriter.cpp +++ b/source/Lib/EncoderLib/CABACWriter.cpp @@ -2822,8 +2822,8 @@ void CABACWriter::codeAlfCtuEnableFlag( CodingStructure& cs, uint32_t ctuRsAddr, const uint32_t curSliceIdx = cs.slice->getIndependentSliceIdx(); #if HEVC_TILES_WPP const uint32_t curTileIdx = cs.picture->tileMap->getTileIdxMap( pos ); - bool leftMergeAvail = cs.getCURestricted( pos.offset( -(int)pcv.maxCUWidth, 0 ), curSliceIdx, curTileIdx, CH_L ) ? true : false; - bool aboveMergeAvail = cs.getCURestricted( pos.offset( 0, -(int)pcv.maxCUHeight ), curSliceIdx, curTileIdx, CH_L ) ? true : false; + bool leftAvail = cs.getCURestricted( pos.offset( -(int)pcv.maxCUWidth, 0 ), curSliceIdx, curTileIdx, CH_L ) ? true : false; + bool aboveAvail = cs.getCURestricted( pos.offset( 0, -(int)pcv.maxCUHeight ), curSliceIdx, curTileIdx, CH_L ) ? true : false; #else bool leftAvail = cs.getCURestricted( pos.offset( -(int)pcv.maxCUWidth, 0 ), curSliceIdx, CH_L ) ? true : false; bool aboveAvail = cs.getCURestricted( pos.offset( 0, -(int)pcv.maxCUHeight ), curSliceIdx, CH_L ) ? true : false; diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp index 608bb5a59c..391488be59 100644 --- a/source/Lib/EncoderLib/EncCu.cpp +++ b/source/Lib/EncoderLib/EncCu.cpp @@ -2525,6 +2525,9 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru cu.cs = tempCS; cu.predMode = MODE_INTER; cu.slice = tempCS->slice; +#if HEVC_TILES_WPP + cu.tileIdx = tempCS->picture->tileMap->getTileIdxMap( tempCS->area.lumaPos() ); +#endif cu.triangle = true; #if JVET_L0054_MMVD cu.mmvdSkip = false; @@ -2564,6 +2567,9 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru partitioner.setCUData( cu ); cu.slice = tempCS->slice; +#if HEVC_TILES_WPP + cu.tileIdx = tempCS->picture->tileMap->getTileIdxMap( tempCS->area.lumaPos() ); +#endif cu.skip = false; cu.predMode = MODE_INTER; cu.transQuantBypass = encTestMode.lossless; @@ -2669,6 +2675,9 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru partitioner.setCUData(cu); cu.slice = tempCS->slice; +#if HEVC_TILES_WPP + cu.tileIdx = tempCS->picture->tileMap->getTileIdxMap( tempCS->area.lumaPos() ); +#endif cu.skip = false; cu.predMode = MODE_INTER; cu.transQuantBypass = encTestMode.lossless; -- GitLab