Ticket #554: tile_idx_minus_1_patch.patch
File tile_idx_minus_1_patch.patch, 8.4 KB (added by ChristianFeldmann, 11 years ago) |
---|
-
source/Lib/TLibDecoder/TDecGop.cpp
294 294 } 295 295 296 296 m_pcSbacDecoders[0].load(m_pcSbacDecoder); 297 m_pcSliceDecoder->decompressSlice( pcBitstream, ppcSubstreams, rpcPic, m_pcSbacDecoder, m_pcSbacDecoders );297 m_pcSliceDecoder->decompressSlice( pcBitstream, ppcSubstreams, rpcPic, m_pcSbacDecoder, m_pcSbacDecoders, m_pcCavlcDecoder ); 298 298 m_pcEntropyDecoder->setBitstream( ppcSubstreams[uiNumSubstreams-1] ); 299 299 // deallocate all created substreams, including internal buffers. 300 300 for (UInt ui = 0; ui < uiNumSubstreams; ui++) -
source/Lib/TLibDecoder/TDecSbac.cpp
188 188 } 189 189 #endif 190 190 m_pcBitstream->readOutTrailingBits(); 191 m_cCUSplitFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SPLIT_FLAG );192 m_cCUSkipFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG );193 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT );194 m_cCUMergeIdxExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT );195 m_cCUAlfCtrlFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ALF_CTRL_FLAG );196 m_cCUPartSizeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_PART_SIZE );197 m_cCUAMPSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CU_AMP_POS );198 m_cCUPredModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_PRED_MODE );199 m_cCUIntraPredSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTRA_PRED_MODE );200 m_cCUChromaPredSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CHROMA_PRED_MODE );201 m_cCUInterDirSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_DIR );202 m_cCUMvdSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MVD );203 m_cCURefPicSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_REF_PIC );204 m_cCUDeltaQpSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DQP );205 m_cCUQtCbfSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_QT_CBF );206 m_cCUQtRootCbfSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_QT_ROOT_CBF );207 m_cCUSigCoeffGroupSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SIG_CG_FLAG );208 m_cCUSigSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SIG_FLAG );209 m_cCuCtxLastX.initBuffer ( eSliceType, iQp, (UChar*)INIT_LAST );210 m_cCuCtxLastY.initBuffer ( eSliceType, iQp, (UChar*)INIT_LAST );211 m_cCUOneSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ONE_FLAG );212 m_cCUAbsSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ABS_FLAG );213 m_cMVPIdxSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MVP_IDX );214 m_cALFFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ALF_FLAG );215 m_cALFUvlcSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ALF_UVLC );216 m_cALFSvlcSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ALF_SVLC );217 m_cSaoFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_FLAG );218 m_cSaoUvlcSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_UVLC );219 #if !(SAO_OFFSET_MAG_SIGN_SPLIT && SAO_RDO_FIX)220 m_cSaoSvlcSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_SVLC );221 #endif222 m_cSaoMergeLeftSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_MERGE_LEFT_FLAG );223 m_cSaoMergeUpSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_MERGE_UP_FLAG );224 m_cSaoTypeIdxSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_TYPE_IDX );225 m_cCUTransSubdivFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_TRANS_SUBDIV_FLAG );226 #if INTRA_TRANSFORMSKIP227 m_cTransformSkipSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_TRANSFORMSKIP_FLAG );228 #endif229 m_pcTDecBinIf->start();230 191 } 231 192 232 193 Void TDecSbac::readTileMarker( UInt& uiTileIdx, UInt uiBitsUsed ) 233 194 { 234 UInt uiSymbol; 235 uiTileIdx = 0; 236 for (Int iShift=uiBitsUsed-1; iShift>=0; iShift--) 237 { 238 m_pcTDecBinIf->decodeBinEP ( uiSymbol ); 239 if (uiSymbol) 240 { 241 uiTileIdx |= (1<<iShift); 242 } 243 } 195 assert(0); 244 196 } 245 197 246 198 Void TDecSbac::parseTerminatingBit( UInt& ruiBit ) -
source/Lib/TLibDecoder/TDecSlice.cpp
90 90 m_pcCuDecoder = pcCuDecoder; 91 91 } 92 92 93 Void TDecSlice::decompressSlice(TComInputBitstream* pcBitstream, TComInputBitstream** ppcSubstreams, TComPic*& rpcPic, TDecSbac* pcSbacDecoder, TDecSbac* pcSbacDecoders )93 Void TDecSlice::decompressSlice(TComInputBitstream* pcBitstream, TComInputBitstream** ppcSubstreams, TComPic*& rpcPic, TDecSbac* pcSbacDecoder, TDecSbac* pcSbacDecoders, TDecCavlc* pcCavlcDecoder) 94 94 { 95 95 TComDataCU* pcCU; 96 96 UInt uiIsLast = 0; … … 251 251 252 252 for (UInt uiIdx=0; uiIdx<pcTmpPtr->getTileMarkerLocationCount(); uiIdx++) 253 253 { 254 if ( pcTmpPtr->getByteLocation() == (pcTmpPtr->getTileMarkerLocation( uiIdx ) +2) )254 if ( pcTmpPtr->getByteLocation() == (pcTmpPtr->getTileMarkerLocation( uiIdx )) ) 255 255 { 256 256 bTileMarkerFoundFlag = true; 257 257 break; … … 262 262 { 263 263 UInt uiTileIdx; 264 264 // Read tile index 265 m_pcEntropyDecoder->setEntropyDecoder( pcCavlcDecoder ); 266 m_pcEntropyDecoder->setBitstream( ppcSubstreams[uiSubStrm] ); 265 267 m_pcEntropyDecoder->readTileMarker( uiTileIdx, rpcPic->getPicSym()->getBitsUsedByTileIdx() ); 268 m_pcEntropyDecoder->setEntropyDecoder( pcSbacDecoder ); 266 269 } 270 m_pcEntropyDecoder->resetEntropy( pcSlice ); 267 271 } 268 272 269 273 #if ENC_DEC_TRACE -
source/Lib/TLibDecoder/TDecSlice.h
48 48 #include "TDecEntropy.h" 49 49 #include "TDecCu.h" 50 50 #include "TDecSbac.h" 51 #include "TDecCAVLC.h" 51 52 #include "TDecBinCoderCABAC.h" 52 53 53 54 //! \ingroup TLibDecoder … … 79 80 Void create ( TComSlice* pcSlice, Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth ); 80 81 Void destroy (); 81 82 82 Void decompressSlice ( TComInputBitstream* pcBitstream, TComInputBitstream** ppcSubstreams, TComPic*& rpcPic, TDecSbac* pcSbacDecoder, TDecSbac* pcSbacDecoders);83 Void decompressSlice ( TComInputBitstream* pcBitstream, TComInputBitstream** ppcSubstreams, TComPic*& rpcPic, TDecSbac* pcSbacDecoder, TDecSbac* pcSbacDecoders, TDecCavlc* pcCavlcDecoder ); 83 84 }; 84 85 85 86 -
source/Lib/TLibEncoder/TEncSbac.cpp
292 292 293 293 Void TEncSbac::writeTileMarker( UInt uiTileIdx, UInt uiBitsUsed ) 294 294 { 295 for (Int iShift=uiBitsUsed-1; iShift>=0; iShift--) 296 { 297 m_pcBinIf->encodeBinEP ( (uiTileIdx & (1 << iShift)) >> iShift ); 298 } 295 assert(0); 299 296 } 300 297 301 298 void TEncSbac::codeSEI(const SEI&) -
source/Lib/TLibEncoder/TEncSlice.cpp
1099 1099 UInt uiMarkerCount = pcSubstreams[uiSubStrm].getTileMarkerLocationCount(); 1100 1100 pcSubstreams[uiSubStrm].setTileMarkerLocation ( uiMarkerCount, pcSubstreams[uiSubStrm].getNumberOfWrittenBits() >> 3 ); 1101 1101 pcSubstreams[uiSubStrm].setTileMarkerLocationCount( uiMarkerCount + 1 ); 1102 1102 1103 // Write tile index 1104 m_pcEntropyCoder->setEntropyCoder( m_pcCavlcCoder, pcSlice ); 1105 m_pcEntropyCoder->setBitstream( &pcSubstreams[uiSubStrm] ); 1103 1106 m_pcEntropyCoder->writeTileMarker(iTileIdx, rpcPic->getPicSym()->getBitsUsedByTileIdx()); // Tile index 1107 m_pcEntropyCoder->setEntropyCoder( m_pcSbacCoder, pcSlice ); 1104 1108 } 1105 1109 1106 1110