Changeset 608 in 3DVCSoftware for trunk/source/App/TAppDecoder
- Timestamp:
- 1 Sep 2013, 22:47:26 (12 years ago)
- Location:
- trunk/source/App/TAppDecoder
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/App/TAppDecoder/TAppDecCfg.cpp
r121 r608 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 42 42 #include "TAppCommon/program_options_lite.h" 43 43 44 #if H_MV 45 #include <cassert> 46 #endif 44 47 #ifdef WIN32 45 48 #define strdup _strdup … … 61 64 Bool TAppDecCfg::parseCfg( Int argc, Char* argv[] ) 62 65 { 63 bool do_help = false;66 Bool do_help = false; 64 67 string cfg_BitstreamFile; 65 68 string cfg_ReconFile; 69 string cfg_TargetDecLayerIdSetFile; 70 #if H_3D 66 71 string cfg_ScaleOffsetFile; 72 #endif 67 73 68 74 po::Options opts; … … 72 78 ("ReconFile,o", cfg_ReconFile, string(""), "reconstructed YUV output file name\n" 73 79 "YUV writing is skipped if omitted") 80 #if H_3D 74 81 ("ScaleOffsetFile,p", cfg_ScaleOffsetFile, string(""), "file with coded scales and offsets") 82 #endif 75 83 ("SkipFrames,s", m_iSkipFrame, 0, "number of frames to skip before random access") 76 ("OutputBitDepth,d", m_outputBitDepth, 0u, "bit depth of YUV output file (use 0 for native depth)") 84 ("OutputBitDepth,d", m_outputBitDepthY, 0, "bit depth of YUV output luma component (default: use 0 for native depth)") 85 ("OutputBitDepthC,d", m_outputBitDepthC, 0, "bit depth of YUV output chroma component (default: use 0 for native depth)") 86 #if H_MV 87 ("MaxLayerId,-ls", m_maxLayerId, MAX_NUM_LAYER_IDS-1, "Maximum LayerId to be decoded.") 88 #endif 77 89 ("MaxTemporalLayer,t", m_iMaxTemporalLayer, -1, "Maximum Temporal Layer to be decoded. -1 to decode all layers") 78 ("SEIpictureDigest", m_pictureDigestEnabled, true, "Control handling of picture_digest SEI messages\n" 79 "\t1: check\n" 80 "\t0: ignore") 90 ("SEIDecodedPictureHash", m_decodedPictureHashSEIEnabled, 1, "Control handling of decoded picture hash SEI messages\n" 91 "\t1: check hash in SEI messages if available in the bitstream\n" 92 "\t0: ignore SEI message") 93 ("SEIpictureDigest", m_decodedPictureHashSEIEnabled, 1, "deprecated alias for SEIDecodedPictureHash") 94 ("TarDecLayerIdSetFile,l", cfg_TargetDecLayerIdSetFile, string(""), "targetDecLayerIdSet file name. The file should include white space separated LayerId values to be decoded. Omitting the option or a value of -1 in the file decodes all layers.") 95 ("RespectDefDispWindow,w", m_respectDefDispWindow, 0, "Only output content inside the default display window\n") 81 96 ; 97 po::setDefaults(opts); 98 const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv); 82 99 83 po::setDefaults(opts); 84 const list<const char*>& argv_unhandled = po::scanArgv(opts, argc, (const char**) argv); 85 86 for (list<const char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++) 100 for (list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++) 87 101 { 88 102 fprintf(stderr, "Unhandled argument ignored: `%s'\n", *it); … … 98 112 m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str()); 99 113 m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str()); 114 115 #if H_3D 100 116 m_pchScaleOffsetFile = cfg_ScaleOffsetFile.empty() ? NULL : strdup(cfg_ScaleOffsetFile.c_str()); 101 102 117 #endif 103 118 if (!m_pchBitstreamFile) 104 119 { 105 fprintf(stderr, "No input file specif ied, aborting\n");120 fprintf(stderr, "No input file specifed, aborting\n"); 106 121 return false; 107 122 } 123 124 if ( !cfg_TargetDecLayerIdSetFile.empty() ) 125 { 126 FILE* targetDecLayerIdSetFile = fopen ( cfg_TargetDecLayerIdSetFile.c_str(), "r" ); 127 if ( targetDecLayerIdSetFile ) 128 { 129 Bool isLayerIdZeroIncluded = false; 130 while ( !feof(targetDecLayerIdSetFile) ) 131 { 132 Int layerIdParsed = 0; 133 if ( fscanf( targetDecLayerIdSetFile, "%d ", &layerIdParsed ) != 1 ) 134 { 135 if ( m_targetDecLayerIdSet.size() == 0 ) 136 { 137 fprintf(stderr, "No LayerId could be parsed in file %s. Decoding all LayerIds as default.\n", cfg_TargetDecLayerIdSetFile.c_str() ); 138 } 139 break; 140 } 141 if ( layerIdParsed == -1 ) // The file includes a -1, which means all LayerIds are to be decoded. 142 { 143 m_targetDecLayerIdSet.clear(); // Empty set means decoding all layers. 144 break; 145 } 146 if ( layerIdParsed < 0 || layerIdParsed >= MAX_NUM_LAYER_IDS ) 147 { 148 fprintf(stderr, "Warning! Parsed LayerId %d is not withing allowed range [0,%d]. Ignoring this value.\n", layerIdParsed, MAX_NUM_LAYER_IDS-1 ); 149 } 150 else 151 { 152 isLayerIdZeroIncluded = layerIdParsed == 0 ? true : isLayerIdZeroIncluded; 153 m_targetDecLayerIdSet.push_back ( layerIdParsed ); 154 } 155 } 156 fclose (targetDecLayerIdSetFile); 157 if ( m_targetDecLayerIdSet.size() > 0 && !isLayerIdZeroIncluded ) 158 { 159 fprintf(stderr, "TargetDecLayerIdSet must contain LayerId=0, aborting" ); 160 return false; 161 } 162 } 163 else 164 { 165 fprintf(stderr, "File %s could not be opened. Using all LayerIds as default.\n", cfg_TargetDecLayerIdSetFile.c_str() ); 166 } 167 } 168 #if H_MV 169 else 170 { 171 for ( Int curLayerId = 0; curLayerId <= m_maxLayerId; curLayerId++ ) 172 { 173 m_targetDecLayerIdSet.push_back( curLayerId ); 174 } 175 } 176 #endif 108 177 109 178 return true; 110 179 } 111 180 181 #if H_MV 112 182 Void TAppDecCfg::xAppendToFileNameEnd( Char* pchInputFileName, const Char* pchStringToAppend, Char*& rpchOutputFileName) 113 183 { … … 125 195 rpchOutputFileName[iInLength+iAppendLength] = '\0'; 126 196 } 127 197 #endif 128 198 //! \} -
trunk/source/App/TAppDecoder/TAppDecCfg.h
r56 r608 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 44 44 45 45 #include "TLibCommon/CommonDef.h" 46 #include <vector> 46 47 47 48 //! \ingroup TAppDecoder … … 56 57 { 57 58 protected: 58 char* m_pchBitstreamFile; ///< input bitstream file name 59 char* m_pchReconFile; ///< output reconstruction file name 60 char* m_pchScaleOffsetFile; ///< output coded scale and offset parameters 59 Char* m_pchBitstreamFile; ///< input bitstream file name 60 #if H_MV 61 Int m_maxLayerId; ///< maximum nuh_layer_id decoded 62 std::vector<Char*> m_pchReconFiles; ///< array of output reconstruction file name create from output reconstruction file name 63 #endif 64 Char* m_pchReconFile; ///< output reconstruction file name 65 #if H_3D 66 Char* m_pchScaleOffsetFile; ///< output coded scale and offset parameters 67 #endif 61 68 Int m_iSkipFrame; ///< counter for frames prior to the random access point to skip 62 UInt m_outputBitDepth; ///< bit depth used for writing output 69 Int m_outputBitDepthY; ///< bit depth used for writing output (luma) 70 Int m_outputBitDepthC; ///< bit depth used for writing output (chroma)t 63 71 64 72 Int m_iMaxTemporalLayer; ///< maximum temporal layer to be decoded 65 bool m_pictureDigestEnabled; ///< enable(1)/disable(0) acting on SEI picture_digest message 73 Int m_decodedPictureHashSEIEnabled; ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message 74 75 std::vector<Int> m_targetDecLayerIdSet; ///< set of LayerIds to be included in the sub-bitstream extraction process. 76 Int m_respectDefDispWindow; ///< Only output content inside the default display window 77 78 #if H_MV 66 79 Void xAppendToFileNameEnd( Char* pchInputFileName, const Char* pchStringToAppend, Char*& rpchOutputFileName); ///< create filenames 67 80 #endif 68 81 public: 69 TAppDecCfg() {} 82 TAppDecCfg() 83 : m_pchBitstreamFile(NULL) 84 #if H_MV 85 , m_maxLayerId(0) 86 #endif 87 , m_pchReconFile(NULL) 88 , m_iSkipFrame(0) 89 , m_outputBitDepthY(0) 90 , m_outputBitDepthC(0) 91 , m_iMaxTemporalLayer(-1) 92 , m_decodedPictureHashSEIEnabled(0) 93 , m_respectDefDispWindow(0) 94 {} 70 95 virtual ~TAppDecCfg() {} 71 96 -
trunk/source/App/TAppDecoder/TAppDecTop.cpp
r443 r608 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 54 54 55 55 TAppDecTop::TAppDecTop() 56 #if !H_MV 57 : m_iPOCLastDisplay(-MAX_INT) 58 #else 59 : m_numDecoders( 0 ) 60 #endif 56 61 { 57 62 ::memset (m_abDecFlag, 0, sizeof (m_abDecFlag)); 58 m_useDepth = false; 59 m_pScaleOffsetFile = 0; 63 #if H_MV 64 for (Int i = 0; i < MAX_NUM_LAYER_IDS; i++) m_layerIdToDecIdx[i] = -1; 65 #endif 66 #if H_3D 67 m_pScaleOffsetFile = 0; 68 #endif 60 69 } 61 70 … … 66 75 Void TAppDecTop::destroy() 67 76 { 77 if (m_pchBitstreamFile) 78 { 79 free (m_pchBitstreamFile); 80 m_pchBitstreamFile = NULL; 81 } 82 #if H_MV 83 for (Int decIdx = 0; decIdx < m_numDecoders; decIdx++) 84 { 85 if (m_pchReconFiles[decIdx]) 86 { 87 free (m_pchReconFiles[decIdx]); 88 m_pchReconFiles[decIdx] = NULL; 89 } 90 } 91 #endif 92 if (m_pchReconFile) 93 { 94 free (m_pchReconFile); 95 m_pchReconFile = NULL; 96 } 97 #if H_3D 98 if (m_pchScaleOffsetFile) 99 { 100 free (m_pchScaleOffsetFile); 101 m_pchScaleOffsetFile = NULL; 102 } 103 #endif 68 104 } 69 105 … … 82 118 Void TAppDecTop::decode() 83 119 { 84 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 85 increaseNumberOfViews( 0, 0, 0 ); 86 #else 87 increaseNumberOfViews( 1 ); 88 #endif 89 90 #if FLEX_CODING_ORDER_M23723 91 Int iDepthViewIdx = 0; 92 Int iTextureViewIdx=0; 93 Bool firstFrame=1; 94 Bool viewIdZero=true; 95 Int fcoIndex=0; //when the current frame is not first frame,use FCO_index stand for viewDepth. 96 #endif 97 98 Int viewDepthId = 0; 99 Int previousViewDepthId = 0; 100 UInt uiPOC[MAX_VIEW_NUM*2]; 101 TComList<TComPic*>* pcListPic[MAX_VIEW_NUM*2]; 102 Bool newPicture[MAX_VIEW_NUM*2]; 103 Bool previousPictureDecoded = false; 104 for( Int i = 0; i < MAX_VIEW_NUM*2; i++ ) 105 { 106 uiPOC[i] = 0; 107 pcListPic[i] = NULL; 108 newPicture[i] = false; 109 #if FLEX_CODING_ORDER_M23723 110 m_fcoOrder[i] = ' '; 111 #endif 112 113 } 120 Int poc; 121 #if H_MV 122 poc = -1; 123 #endif 124 TComList<TComPic*>* pcListPic = NULL; 114 125 115 126 ifstream bitstreamFile(m_pchBitstreamFile, ifstream::in | ifstream::binary); … … 120 131 } 121 132 133 #if H_3D 122 134 if( m_pchScaleOffsetFile ) 123 135 { … … 126 138 } 127 139 m_cCamParsCollector.init( m_pScaleOffsetFile ); 128 140 #endif 129 141 InputByteStream bytestream(bitstreamFile); 130 142 143 // create & initialize internal classes 144 xCreateDecLib(); 145 xInitDecLib (); 146 #if !H_MV 147 m_iPOCLastDisplay += m_iSkipFrame; // set the last displayed POC correctly for skip forward. 148 149 // main decoder loop 150 Bool recon_opened = false; // reconstruction file not yet opened. (must be performed after SPS is seen) 151 #else 152 #if H_3D 153 Int pocCurrPic = -MAX_INT; 154 Int pocLastPic = -MAX_INT; 155 #endif 156 157 Int layerIdCurrPic = 0; 158 159 Int decIdxLastPic = 0; 160 Int decIdxCurrPic = 0; 161 162 Bool firstSlice = true; 163 #endif 164 131 165 while (!!bitstreamFile) 132 166 { … … 136 170 * nal unit. */ 137 171 streampos location = bitstreamFile.tellg(); 172 #if H_MV 173 #if ENC_DEC_TRACE 174 Int64 symCount = g_nSymbolCounter; 175 #endif 176 #endif 138 177 AnnexBStats stats = AnnexBStats(); 178 #if !H_MV 179 Bool bPreviousPictureDecoded = false; 180 #endif 181 139 182 vector<uint8_t> nalUnit; 140 183 InputNALUnit nalu; … … 142 185 143 186 // call actual decoding function 187 Bool bNewPicture = false; 188 #if H_MV 189 Bool newSliceDiffPoc = false; 190 Bool newSliceDiffLayer = false; 191 #if H_3D 192 Bool allLayersDecoded = false; 193 #endif 194 #endif 144 195 if (nalUnit.empty()) 145 196 { … … 154 205 { 155 206 read(nalu, nalUnit); 156 #if QC_MVHEVC_B0046 157 viewDepthId = nalu.m_layerId; 158 Int depth = 0; 159 Int viewId = viewDepthId; 160 #else 161 #if VIDYO_VPS_INTEGRATION 162 Int viewId = 0; 163 Int depth = 0; 207 #if H_MV 208 Int decIdx = xGetDecoderIdx( nalu.m_layerId , true ); 164 209 165 if(nalu.m_nalUnitType != NAL_UNIT_VPS || nalu.m_layerId) 166 { 167 // code assumes that the first nal unit is VPS 168 // currently, this is a hack that requires non-first VPSs have non-zero layer_id 169 viewId = getVPSAccess()->getActiveVPS()->getViewId(nalu.m_layerId); 170 depth = getVPSAccess()->getActiveVPS()->getDepthFlag(nalu.m_layerId); 171 } 172 #if FLEX_CODING_ORDER_M23723 173 if (viewId>0) 174 { 175 viewIdZero=false; 176 } 177 if (viewIdZero==false&&viewId==0) 178 { 179 firstFrame=0; //if viewId has been more than zero and now it set to zero again, we can see that it is not the first view 180 } 181 if (firstFrame) 182 { // if the current view is first frame, we set the viewDepthId as texture plus depth and get the FCO order 183 viewDepthId = iDepthViewIdx+iTextureViewIdx; 184 m_fcoViewDepthId=viewDepthId; 210 if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) ) 211 { 212 bNewPicture = false; 185 213 } 186 214 else 187 {//if current view is not first frame, we set the viewDepthId depended on the FCO order 188 viewDepthId=0; 189 if (depth) 215 { 216 newSliceDiffLayer = nalu.isSlice() && ( nalu.m_layerId != layerIdCurrPic ) && !firstSlice; 217 newSliceDiffPoc = m_tDecTop[decIdx]->decode(nalu, m_iSkipFrame, m_pocLastDisplay[decIdx], newSliceDiffLayer ); 218 // decode function only returns true when all of the following conditions are true 219 // - poc in particular layer changes 220 // - nalu does not belong to first slice in layer 221 // - nalu.isSlice() == true 222 223 bNewPicture = newSliceDiffLayer || newSliceDiffPoc; 224 225 if ( nalu.isSlice() && firstSlice ) 190 226 { 191 for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ ) 192 { 193 if (m_fcoOrder[fcoIndex]=='D') 194 { 195 if (viewId==viewDepthId) 196 break; 197 else 198 viewDepthId++; 199 } 200 } 227 layerIdCurrPic = nalu.m_layerId; 228 #if H_3D 229 pocCurrPic = m_tDecTop[decIdx]->getCurrPoc(); 230 #endif 231 decIdxCurrPic = decIdx; 232 firstSlice = false; 233 } 234 235 if ( bNewPicture || !bitstreamFile ) 236 { 237 layerIdCurrPic = nalu.m_layerId; 238 #if H_3D 239 pocLastPic = pocCurrPic; 240 pocCurrPic = m_tDecTop[decIdx]->getCurrPoc(); 241 #endif 242 decIdxLastPic = decIdxCurrPic; 243 decIdxCurrPic = decIdx; 244 #if H_3D 245 allLayersDecoded = ( pocCurrPic != pocLastPic ); 246 #endif 247 } 248 249 250 #else 251 if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) ) 252 { 253 if(bPreviousPictureDecoded) 254 { 255 bNewPicture = true; 256 bPreviousPictureDecoded = false; 201 257 } 202 258 else 203 259 { 204 for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ ) 205 { 206 if (m_fcoOrder[fcoIndex]=='T') 207 { 208 if (viewId==viewDepthId) 209 break; 210 else 211 viewDepthId++; 212 } 213 } 260 bNewPicture = false; 214 261 } 215 216 viewDepthId=fcoIndex;217 218 }219 220 221 #else222 viewDepthId = nalu.m_layerId; // coding order T0D0T1D1T2D2223 #endif224 225 #else226 Int viewId = nalu.m_viewId;227 Int depth = nalu.m_isDepth ? 1 : 0;228 #if FLEX_CODING_ORDER_M23723229 if (viewId>0)230 {231 viewIdZero=false;232 }233 if (viewIdZero==false&&viewId==0)234 {235 firstFrame=0;236 }237 if (firstFrame)238 {239 viewDepthId = iDepthViewIdx+iTextureViewIdx;240 m_fcoViewDepthId=viewDepthId;241 262 } 242 263 else 243 264 { 244 viewDepthId=0; 245 if (depth) 246 { 247 for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ ) 248 { 249 if (m_fcoOrder[fcoIndex]=='D') 250 { 251 if (viewId==viewDepthId) 252 break; 253 else 254 viewDepthId++; 255 } 256 } 257 } 258 else 259 { 260 for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ ) 261 { 262 if (m_fcoOrder[fcoIndex]=='T') 263 { 264 if (viewId==viewDepthId) 265 break; 266 else 267 viewDepthId++; 268 } 269 } 270 } 271 viewDepthId=fcoIndex; 272 } 273 #else 274 viewDepthId = viewId * 2 + depth; // coding order T0D0T1D1T2D2 275 #endif 276 #endif 277 #endif 278 newPicture[viewDepthId] = false; 279 if( viewDepthId >= m_tDecTop.size() ) 280 { 281 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 282 increaseNumberOfViews( viewDepthId, viewId, depth ); 283 #else 284 increaseNumberOfViews( viewDepthId +1 ); 285 #endif 286 } 287 if(m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) 288 { 289 previousPictureDecoded = false; 290 } 291 if(m_tDecTop.size() > 1 && (viewDepthId != previousViewDepthId) && previousPictureDecoded ) 292 { 293 m_tDecTop[previousViewDepthId]->executeDeblockAndAlf(uiPOC[previousViewDepthId], pcListPic[previousViewDepthId], m_iSkipFrame, m_pocLastDisplay[previousViewDepthId]); 294 } 295 if( ( viewDepthId == 0 && (viewDepthId != previousViewDepthId) ) || m_tDecTop.size() == 1 ) 296 { 297 #if H3D_IVRP 298 for( Int i = 0; i < m_tDecTop.size(); i++ ) 299 { 300 m_tDecTop[i]->deleteExtraPicBuffers( uiPOC[i] ); 301 } 302 #endif 303 for( Int i = 0; i < m_tDecTop.size(); i++ ) 304 { 305 m_tDecTop[i]->compressMotion( uiPOC[i] ); 306 } 307 } 308 if( !(m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) ) 309 { 310 #if QC_MVHEVC_B0046 311 if(viewDepthId && m_tDecTop[viewDepthId]->m_bFirstNal== false) 312 { 313 m_tDecTop[viewDepthId]->m_bFirstNal = true; 314 ParameterSetManagerDecoder* pDecV0 = m_tDecTop[0]->xGetParaSetDec(); 315 m_tDecTop[viewDepthId]->xCopyVPS(pDecV0->getPrefetchedVPS(0)); 316 m_tDecTop[viewDepthId]->xCopySPS(pDecV0->getPrefetchedSPS(0)); 317 m_tDecTop[viewDepthId]->xCopyPPS(pDecV0->getPrefetchedPPS(0)); 318 } 319 #endif 320 newPicture[viewDepthId] = m_tDecTop[viewDepthId]->decode(nalu, m_iSkipFrame, m_pocLastDisplay[viewDepthId]); 321 if (newPicture[viewDepthId]) 265 bNewPicture = m_cTDecTop.decode(nalu, m_iSkipFrame, m_iPOCLastDisplay); 266 #endif 267 if (bNewPicture) 322 268 { 323 269 bitstreamFile.clear(); … … 328 274 bitstreamFile.seekg(location-streamoff(3)); 329 275 bytestream.reset(); 276 #if ENC_DEC_TRACE 277 #if H_MV_ENC_DEC_TRAC 278 const Bool resetCounter = false; 279 if ( resetCounter ) 280 { 281 g_nSymbolCounter = symCount; // Only reset counter SH becomes traced twice 282 } 283 else 284 { 285 g_disableHLSTrace = true; // Trancing of second parsing of SH is not carried out 286 } 287 #else 288 g_nSymbolCounter = symCount; 289 #endif 290 #endif 330 291 } 331 if( nalu.isSlice() ) 332 { 333 previousPictureDecoded = true; 334 #if FLEX_CODING_ORDER_M23723 335 if (firstFrame) 336 { 337 if (depth) 338 { 339 iDepthViewIdx++; 340 m_fcoOrder[viewDepthId]='D'; 341 } 342 else 343 { 344 iTextureViewIdx++; 345 m_fcoOrder[viewDepthId]='T'; 346 } 347 } 348 349 #endif 350 } 351 } 352 } 353 if( ( (newPicture[viewDepthId] || !bitstreamFile) && m_tDecTop.size() == 1) || (!bitstreamFile && previousPictureDecoded == true) ) 354 { 355 m_tDecTop[viewDepthId]->executeDeblockAndAlf(uiPOC[viewDepthId], pcListPic[viewDepthId], m_iSkipFrame, m_pocLastDisplay[viewDepthId]); 356 } 357 if( pcListPic[viewDepthId] ) 358 { 359 #if QC_REM_IDV_B0046 360 Int iviewId = m_tDecTop[viewDepthId]->getViewId(); 361 if( newPicture[viewDepthId] && (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR || ((nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR && iviewId) && m_tDecTop[viewDepthId]->getNalUnitTypeBaseView() == NAL_UNIT_CODED_SLICE_IDR)) ) 362 #else 363 if( newPicture[viewDepthId] && (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR || (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDV && m_tDecTop[viewDepthId]->getNalUnitTypeBaseView() == NAL_UNIT_CODED_SLICE_IDR)) ) 364 #endif 365 { 366 xFlushOutput( pcListPic[viewDepthId], viewDepthId ); 292 #if !H_MV 293 bPreviousPictureDecoded = true; 294 #endif 295 } 296 } 297 if (bNewPicture || !bitstreamFile) 298 { 299 #if H_MV 300 assert( decIdxLastPic != -1 ); 301 m_tDecTop[decIdxLastPic]->endPicDecoding(poc, pcListPic, m_targetDecLayerIdSet ); 302 #else 303 m_cTDecTop.executeLoopFilters(poc, pcListPic); 304 #endif 305 } 306 #if H_3D 307 if ( allLayersDecoded || !bitstreamFile ) 308 { 309 for( Int dI = 0; dI < m_numDecoders; dI++ ) 310 { 311 TComPic* picLastCoded = m_ivPicLists.getPic( m_tDecTop[dI]->getLayerId(), pocLastPic ); 312 assert( picLastCoded != NULL ); 313 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170 314 picLastCoded->compressMotion(1); 315 #else 316 picLastCoded->compressMotion(); 317 #endif 318 } 319 } 320 #endif 321 322 if( pcListPic ) 323 { 324 #if H_MV 325 if ( m_pchReconFiles[decIdxLastPic] && !m_reconOpen[decIdxLastPic] ) 326 #else 327 if ( m_pchReconFile && !recon_opened ) 328 #endif 329 { 330 if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; } 331 if (!m_outputBitDepthC) { m_outputBitDepthC = g_bitDepthC; } 332 333 #if H_MV 334 m_tVideoIOYuvReconFile[decIdxLastPic]->open( m_pchReconFiles[decIdxLastPic], true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode 335 m_reconOpen[decIdxLastPic] = true; 336 } 337 if ( bNewPicture && newSliceDiffPoc && 338 #else 339 m_cTVideoIOYuvReconFile.open( m_pchReconFile, true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode 340 recon_opened = true; 341 } 342 if ( bNewPicture && 343 #endif 344 ( nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL 345 || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP 346 || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP 347 || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL 348 || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP ) ) 349 { 350 #if H_MV 351 xFlushOutput( pcListPic, decIdxLastPic ); 352 #else 353 xFlushOutput( pcListPic ); 354 #endif 367 355 } 368 356 // write reconstruction to file 369 if(newPicture[viewDepthId]) 370 { 371 xWriteOutput( pcListPic[viewDepthId], viewDepthId, nalu.m_temporalId ); 372 } 373 } 374 previousViewDepthId = viewDepthId; 375 } 357 if(bNewPicture) 358 { 359 #if H_MV 360 xWriteOutput( pcListPic, decIdxLastPic, nalu.m_temporalId ); 361 } 362 } 363 } 364 365 #if H_3D 376 366 if( m_cCamParsCollector.isInitialized() ) 377 367 { 378 368 m_cCamParsCollector.setSlice( 0 ); 379 369 } 380 // last frame 381 for( Int viewDepthIdx = 0; viewDepthIdx < m_tDecTop.size(); viewDepthIdx++ ) 382 { 383 xFlushOutput( pcListPic[viewDepthIdx], viewDepthIdx ); 384 } 370 #endif 371 for(UInt decIdx = 0; decIdx < m_numDecoders; decIdx++) 372 { 373 xFlushOutput( m_tDecTop[decIdx]->getListPic(), decIdx ); 374 } 375 #else 376 xWriteOutput( pcListPic, nalu.m_temporalId ); 377 } 378 } 379 } 380 381 xFlushOutput( pcListPic ); 382 // delete buffers 383 m_cTDecTop.deletePicBuffer(); 384 #endif 385 386 // destroy internal classes 385 387 xDestroyDecLib(); 386 388 } … … 390 392 // ==================================================================================================================== 391 393 394 Void TAppDecTop::xCreateDecLib() 395 { 396 #if H_MV 397 // initialize global variables 398 initROM(); 399 #if H_3D_DIM_DMM 400 initWedgeLists(); 401 #endif 402 #else 403 // create decoder class 404 m_cTDecTop.create(); 405 #endif 406 } 407 392 408 Void TAppDecTop::xDestroyDecLib() 393 409 { 394 395 for(Int viewDepthIdx=0; viewDepthIdx<m_tVideoIOYuvReconFile.size() ; viewDepthIdx++) 396 { 397 if( m_tVideoIOYuvReconFile[viewDepthIdx] ) 398 { 399 m_tVideoIOYuvReconFile[viewDepthIdx]->close(); 400 delete m_tVideoIOYuvReconFile[viewDepthIdx]; 401 m_tVideoIOYuvReconFile[viewDepthIdx] = NULL ; 402 } 403 } 404 405 for(Int viewDepthIdx=0; viewDepthIdx<m_tDecTop.size() ; viewDepthIdx++) 406 { 407 if( m_tDecTop[viewDepthIdx] ) 408 { 409 if( !m_useDepth && (viewDepthIdx % 2 == 1) ) 410 { 411 } 412 else 413 { 414 m_tDecTop[viewDepthIdx]->deletePicBuffer(); 415 m_tDecTop[viewDepthIdx]->destroy() ; 416 } 417 #if QC_MVHEVC_B0046 418 if(viewDepthIdx) 419 { 420 //Call clear function to remove the record, which has been freed during viewDepthIdx = 0 case. 421 m_tDecTop[viewDepthIdx]->xGetParaSetDec()->clearSPS(); 422 m_tDecTop[viewDepthIdx]->xGetParaSetDec()->clearVPS(); 423 m_tDecTop[viewDepthIdx]->xGetParaSetDec()->clearPPS(); 424 } 425 #endif 426 delete m_tDecTop[viewDepthIdx] ; 427 m_tDecTop[viewDepthIdx] = NULL ; 428 } 429 } 430 410 #if H_MV 411 // destroy ROM 412 destroyROM(); 413 414 for(Int decIdx = 0; decIdx < m_numDecoders ; decIdx++) 415 { 416 if( m_tVideoIOYuvReconFile[decIdx] ) 417 { 418 m_tVideoIOYuvReconFile[decIdx]->close(); 419 delete m_tVideoIOYuvReconFile[decIdx]; 420 m_tVideoIOYuvReconFile[decIdx] = NULL ; 421 } 422 423 if( m_tDecTop[decIdx] ) 424 { 425 m_tDecTop[decIdx]->deletePicBuffer(); 426 m_tDecTop[decIdx]->destroy() ; 427 } 428 delete m_tDecTop[decIdx] ; 429 m_tDecTop[decIdx] = NULL ; 430 } 431 #else 432 if ( m_pchReconFile ) 433 { 434 m_cTVideoIOYuvReconFile. close(); 435 } 436 437 // destroy decoder class 438 m_cTDecTop.destroy(); 439 #endif 440 #if H_3D 431 441 m_cCamParsCollector.uninit(); 432 442 if( m_pScaleOffsetFile ) … … 434 444 ::fclose( m_pScaleOffsetFile ); 435 445 } 436 } 437 438 Void TAppDecTop::xWriteOutput( TComList<TComPic*>* pcListPic, Int viewDepthId, UInt tId ) 446 #endif 447 } 448 449 Void TAppDecTop::xInitDecLib() 450 { 451 #if !H_MV 452 // initialize decoder class 453 m_cTDecTop.init(); 454 m_cTDecTop.setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); 455 #endif 456 } 457 458 /** \param pcListPic list of pictures to be written to file 459 \todo DYN_REF_FREE should be revised 460 */ 461 #if H_MV 462 Void TAppDecTop::xWriteOutput( TComList<TComPic*>* pcListPic, Int decIdx, Int tId ) 463 #else 464 Void TAppDecTop::xWriteOutput( TComList<TComPic*>* pcListPic, UInt tId ) 465 #endif 439 466 { 440 467 TComList<TComPic*>::iterator iterPic = pcListPic->begin(); … … 444 471 { 445 472 TComPic* pcPic = *(iterPic); 446 if(pcPic->getOutputMark() && pcPic->getPOC() > m_pocLastDisplay[viewDepthId]) 473 #if H_MV 474 if(pcPic->getOutputMark() && pcPic->getPOC() > m_pocLastDisplay[decIdx]) 475 #else 476 if(pcPic->getOutputMark() && pcPic->getPOC() > m_iPOCLastDisplay) 477 #endif 447 478 { 448 479 not_displayed++; … … 455 486 { 456 487 TComPic* pcPic = *(iterPic); 457 TComSPS *sps = pcPic->getSlice(0)->getSPS();458 488 459 if ( pcPic->getOutputMark() && (not_displayed > pcPic->getSlice(0)->getSPS()->getNumReorderPics(tId) && pcPic->getPOC() > m_pocLastDisplay[viewDepthId])) 489 #if H_MV 490 if ( pcPic->getOutputMark() && (not_displayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_pocLastDisplay[decIdx])) 491 #else 492 if ( pcPic->getOutputMark() && (not_displayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_iPOCLastDisplay)) 493 #endif 460 494 { 461 495 // write to file 462 496 not_displayed--; 497 #if H_MV 498 if ( m_pchReconFiles[decIdx] ) 499 #else 463 500 if ( m_pchReconFile ) 464 { 465 m_tVideoIOYuvReconFile[viewDepthId]->write( pcPic->getPicYuvRec(), sps->getPicCropLeftOffset(), sps->getPicCropRightOffset(), sps->getPicCropTopOffset(), sps->getPicCropBottomOffset() ); 501 #endif 502 { 503 const Window &conf = pcPic->getConformanceWindow(); 504 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 505 #if H_MV 506 m_tVideoIOYuvReconFile[decIdx]->write( pcPic->getPicYuvRec(), 507 #else 508 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 509 #endif 510 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 511 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 512 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 513 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 466 514 } 467 515 468 516 // update POC of display order 469 m_pocLastDisplay[viewDepthId] = pcPic->getPOC(); 517 #if H_MV 518 m_pocLastDisplay[decIdx] = pcPic->getPOC(); 519 #else 520 m_iPOCLastDisplay = pcPic->getPOC(); 521 #endif 470 522 471 523 // erase non-referenced picture in the reference picture list after display … … 495 547 \todo DYN_REF_FREE should be revised 496 548 */ 497 Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic, Int viewDepthId ) 549 #if H_MV 550 Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic, Int decIdx ) 551 #else 552 Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic ) 553 #endif 498 554 { 499 555 if(!pcListPic) … … 508 564 { 509 565 TComPic* pcPic = *(iterPic); 510 TComSPS *sps = pcPic->getSlice(0)->getSPS();511 566 512 567 if ( pcPic->getOutputMark() ) 513 568 { 514 569 // write to file 570 #if H_MV 571 if ( m_pchReconFiles[decIdx] ) 572 #else 515 573 if ( m_pchReconFile ) 516 { 517 m_tVideoIOYuvReconFile[viewDepthId]->write( pcPic->getPicYuvRec(), sps->getPicCropLeftOffset(), sps->getPicCropRightOffset(), sps->getPicCropTopOffset(), sps->getPicCropBottomOffset() ); 574 #endif 575 { 576 const Window &conf = pcPic->getConformanceWindow(); 577 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 578 #if H_MV 579 m_tVideoIOYuvReconFile[decIdx]->write( pcPic->getPicYuvRec(), 580 #else 581 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 582 #endif 583 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 584 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 585 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 586 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 518 587 } 519 588 520 589 // update POC of display order 521 m_pocLastDisplay[viewDepthId] = pcPic->getPOC(); 590 #if H_MV 591 m_pocLastDisplay[decIdx] = pcPic->getPOC(); 592 #else 593 m_iPOCLastDisplay = pcPic->getPOC(); 594 #endif 522 595 523 596 // erase non-referenced picture in the reference picture list after display … … 539 612 pcPic->setOutputMark(false); 540 613 } 541 614 #if !H_MV 615 #if !DYN_REF_FREE 616 if(pcPic) 617 { 618 pcPic->destroy(); 619 delete pcPic; 620 pcPic = NULL; 621 } 622 #endif 623 #endif 542 624 iterPic++; 543 625 } 626 #if H_MV 627 m_pocLastDisplay[decIdx] = -MAX_INT; 628 #else 544 629 pcListPic->clear(); 545 m_pocLastDisplay[viewDepthId] = -MAX_INT; 546 } 547 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 548 Void TAppDecTop::increaseNumberOfViews ( UInt layerId, UInt viewId, UInt isDepth ) 549 #else 550 Void TAppDecTop::increaseNumberOfViews ( Int newNumberOfViewDepth ) 551 #endif 552 { 553 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 554 Int newNumberOfViewDepth = layerId + 1; 555 #endif 556 if ( m_outputBitDepth == 0 ) 557 { 558 m_outputBitDepth = g_uiBitDepth + g_uiBitIncrement; 559 } 560 #if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046 561 Int viewId = (newNumberOfViewDepth-1)>>1; // coding order T0D0T1D1T2D2 562 Bool isDepth = ((newNumberOfViewDepth % 2) == 0); // coding order T0D0T1D1T2D2 563 #endif 564 if( isDepth ) 565 m_useDepth = true; 566 567 if ( m_pchReconFile ) 568 { 569 while( m_tVideoIOYuvReconFile.size() < newNumberOfViewDepth) 570 { 571 m_tVideoIOYuvReconFile.push_back(new TVideoIOYuv); 572 Char buffer[4]; 573 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 574 sprintf(buffer,"_%i", viewId ); 575 #else 576 sprintf(buffer,"_%i", (Int)(m_tVideoIOYuvReconFile.size()-1) / 2 ); 577 #endif 578 Char* nextFilename = NULL; 579 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 580 if( isDepth) 581 #else 582 if( (m_tVideoIOYuvReconFile.size() % 2) == 0 ) 583 #endif 584 { 585 Char* pchTempFilename = NULL; 586 xAppendToFileNameEnd( m_pchReconFile, "_depth", pchTempFilename); 587 xAppendToFileNameEnd( pchTempFilename, buffer, nextFilename); 588 free ( pchTempFilename ); 589 } 590 else 591 { 592 xAppendToFileNameEnd( m_pchReconFile, buffer, nextFilename); 593 } 594 #if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046 595 if( isDepth || ( !isDepth && (m_tVideoIOYuvReconFile.size() % 2) == 1 ) ) 596 #endif 597 { 598 m_tVideoIOYuvReconFile.back()->open( nextFilename, true, m_outputBitDepth, g_uiBitDepth + g_uiBitIncrement ); 599 } 600 free ( nextFilename ); 601 } 602 } 603 604 while( m_pocLastDisplay.size() < newNumberOfViewDepth ) 605 { 606 m_pocLastDisplay.push_back(-MAX_INT+m_iSkipFrame); 607 } 608 while( m_tDecTop.size() < newNumberOfViewDepth) 609 { 610 m_tDecTop.push_back(new TDecTop); 611 #if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046 612 if( isDepth || ( !isDepth && (m_tVideoIOYuvReconFile.size() % 2) == 1 ) ) 613 { 614 #endif 615 m_tDecTop.back()->create(); 616 m_tDecTop.back()->init( this, newNumberOfViewDepth == 1); 617 m_tDecTop.back()->setViewId( viewId ); 618 m_tDecTop.back()->setIsDepth( isDepth ); 619 m_tDecTop.back()->setPictureDigestEnabled(m_pictureDigestEnabled); 620 m_tDecTop.back()->setCamParsCollector( &m_cCamParsCollector ); 621 #if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046 622 } 623 #endif 624 } 625 } 626 627 TDecTop* TAppDecTop::getTDecTop( Int viewId, Bool isDepth ) 628 { 629 #if FLEX_CODING_ORDER_M23723 630 Int viewnumber=0; 631 Int i=0; 632 Bool fcoFlag=0; 633 if (viewId>m_fcoViewDepthId) 634 { 635 return NULL; 630 m_iPOCLastDisplay = -MAX_INT; 631 #endif 632 } 633 634 /** \param nalu Input nalu to check whether its LayerId is within targetDecLayerIdSet 635 */ 636 Bool TAppDecTop::isNaluWithinTargetDecLayerIdSet( InputNALUnit* nalu ) 637 { 638 if ( m_targetDecLayerIdSet.size() == 0 ) // By default, the set is empty, meaning all LayerIds are allowed 639 { 640 return true; 641 } 642 for (std::vector<Int>::iterator it = m_targetDecLayerIdSet.begin(); it != m_targetDecLayerIdSet.end(); it++) 643 { 644 #if H_MV 645 if ( nalu->m_layerId == (*it) ) 646 #else 647 if ( nalu->m_reservedZero6Bits == (*it) ) 648 #endif 649 { 650 return true; 651 } 652 } 653 return false; 654 } 655 656 #if H_MV 657 Int TAppDecTop::xGetDecoderIdx( Int layerId, Bool createFlag /*= false */ ) 658 { 659 Int decIdx = -1; 660 if ( m_layerIdToDecIdx[ layerId ] != -1 ) 661 { 662 decIdx = m_layerIdToDecIdx[ layerId ]; 636 663 } 637 664 else 638 { 639 if (isDepth) 640 { 641 for ( i=0; i<=m_fcoViewDepthId;i++) 642 { 643 if (m_fcoOrder[i]=='D') 644 { 645 if (viewnumber==viewId) 646 { 647 fcoFlag=1; 648 break; 649 } 650 else 651 viewnumber++; 652 } 653 } 654 } 655 else 656 { 657 for ( i=0; i<=m_fcoViewDepthId;i++) 658 { 659 if (m_fcoOrder[i]=='T') 660 { 661 if (viewnumber==viewId) 662 { 663 fcoFlag=1; 664 break; 665 } 666 else 667 viewnumber++; 668 } 669 } 670 } 671 if (fcoFlag) 672 { 673 return m_tDecTop[i]; 674 } 675 else 676 return NULL; 677 678 } 679 680 // coding order T0D0T1D1T2D2 681 #else 682 return m_tDecTop[(isDepth ? 1 : 0) + viewId * 2]; // coding order T0D0T1D1T2D2 683 #endif 684 685 } 686 687 std::vector<TComPic*> TAppDecTop::getInterViewRefPics( Int viewId, Int poc, Bool isDepth, TComSPS* sps ) 688 { 689 std::vector<TComPic*> apcRefPics( sps->getNumberOfUsableInterViewRefs(), (TComPic*)NULL ); 690 for( Int k = 0; k < sps->getNumberOfUsableInterViewRefs(); k++ ) 691 { 692 TComPic* pcRefPic = xGetPicFromView( sps->getUsableInterViewRef( k ) + viewId, poc, isDepth ); 693 assert( pcRefPic != NULL ); 694 apcRefPics[k] = pcRefPic; 695 } 696 return apcRefPics; 697 } 698 699 TComPic* TAppDecTop::xGetPicFromView( Int viewId, Int poc, Bool isDepth ) 700 { 701 assert( ( viewId >= 0 ) ); 702 703 #if FLEX_CODING_ORDER_M23723 704 if (getTDecTop(viewId,isDepth)) 705 { 706 TComList<TComPic*>* apcListPic = getTDecTop( viewId, isDepth )->getListPic(); 707 TComPic* pcPic = NULL; 708 for( TComList<TComPic*>::iterator it=apcListPic->begin(); it!=apcListPic->end(); it++ ) 709 { 710 if( (*it)->getPOC() == poc ) 711 { 712 pcPic = *it; 713 break; 714 } 715 } 716 return pcPic; 717 } 718 else 719 return NULL; 720 #else 721 722 TComList<TComPic*>* apcListPic = getTDecTop( viewId, isDepth )->getListPic(); 723 TComPic* pcPic = NULL; 724 for( TComList<TComPic*>::iterator it=apcListPic->begin(); it!=apcListPic->end(); it++ ) 725 { 726 if( (*it)->getPOC() == poc ) 727 { 728 pcPic = *it; 729 break; 730 } 731 } 732 return pcPic; 733 #endif 734 } 735 736 #if MERL_VSP_C0152 737 Void TAppDecTop::setBWVSPLUT( 738 #if MERL_VSP_NBDV_RefVId_Fix_D0166 739 Int iNeighborViewId, 740 #endif 741 TComSlice* pcSlice, Int iCodedViewIdx, Int iCurPoc) 742 743 { 744 //first view does not have VSP 745 if((iCodedViewIdx == 0)) return; 746 747 AOT( iCodedViewIdx <= 0); 748 //AOT( iCodedViewIdx >= m_iNumberOfViews ); 749 #if !MERL_VSP_NBDV_RefVId_Fix_D0166 750 Int iNeighborViewId = 0; 751 #endif 752 // Int* piShiftLUT = bRenderFromLeft ? m_cCamParsCollector.getBaseViewShiftLUTI()[iCodedViewIdx][iNeighborViewId][0] : m_cCamParsCollector.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx][0]; 753 Int* piShiftLUT = m_cCamParsCollector.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx][0]; 754 #if MERL_VSP_NBDV_RefVId_Fix_D0166 755 pcSlice->setBWVSPLUTParam(piShiftLUT, 2-LOG2_DISP_PREC_LUT, iNeighborViewId ); 756 #else 757 pcSlice->setBWVSPLUTParam(piShiftLUT, 2-LOG2_DISP_PREC_LUT ); 758 #endif 759 } 760 #endif 761 665 { 666 assert ( createFlag ); 667 assert( m_numDecoders < MAX_NUM_LAYERS ); 668 669 decIdx = m_numDecoders; 670 671 // Init decoder 672 m_tDecTop[ decIdx ] = new TDecTop; 673 m_tDecTop[ decIdx ]->create(); 674 m_tDecTop[ decIdx ]->init( ); 675 m_tDecTop[ decIdx ]->setLayerId( layerId ); 676 m_tDecTop[ decIdx ]->setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); 677 m_tDecTop[ decIdx ]->setIvPicLists( &m_ivPicLists ); 678 #if H_3D 679 m_tDecTop[ decIdx ]->setCamParsCollector( &m_cCamParsCollector ); 680 #endif 681 682 // append pic list of new decoder to PicLists 683 assert( m_ivPicLists.size() == m_numDecoders ); 684 m_ivPicLists.push_back( m_tDecTop[ decIdx ]->getListPic() ); 685 686 // create recon file related stuff 687 Char* pchTempFilename = NULL; 688 if ( m_pchReconFile ) 689 { 690 Char buffer[4]; 691 sprintf(buffer,"_%i", layerId ); 692 assert ( m_pchReconFile ); 693 xAppendToFileNameEnd( m_pchReconFile , buffer, pchTempFilename ); 694 assert( m_pchReconFiles.size() == m_numDecoders ); 695 } 696 697 m_pchReconFiles.push_back( pchTempFilename ); 698 699 m_tVideoIOYuvReconFile[ decIdx ] = new TVideoIOYuv; 700 m_reconOpen [ decIdx ] = false; 701 702 // set others 703 m_pocLastDisplay [ decIdx ] = -MAX_INT; 704 m_layerIdToDecIdx [ layerId ] = decIdx; 705 706 m_numDecoders++; 707 }; 708 return decIdx; 709 } 710 #endif 762 711 //! \} -
trunk/source/App/TAppDecoder/TAppDecTop.h
r443 r608 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 46 46 #include "TLibCommon/TComList.h" 47 47 #include "TLibCommon/TComPicYuv.h" 48 #include "TLibCommon/TComDepthMapGenerator.h"49 48 #include "TLibDecoder/TDecTop.h" 50 49 #include "TAppDecCfg.h" … … 62 61 private: 63 62 // class interface 64 std::vector<TDecTop*> m_tDecTop; ///< decoder classes 65 66 std::vector<TVideoIOYuv*> m_tVideoIOYuvReconFile; ///< reconstruction YUV class 67 68 // for output control 63 #if H_MV 64 TDecTop* m_tDecTop [ MAX_NUM_LAYERS ]; ///< decoder classes 65 TVideoIOYuv* m_tVideoIOYuvReconFile[ MAX_NUM_LAYERS ]; ///< reconstruction YUV class 66 Int m_layerIdToDecIdx [ MAX_NUM_LAYER_IDS ]; ///< maping from layer id to decoder index 67 Int m_numDecoders; ///< number of decoder instances 68 TComPicLists m_ivPicLists; ///< picture buffers of decoder instances 69 #else 70 TDecTop m_cTDecTop; ///< decoder class 71 TVideoIOYuv m_cTVideoIOYuvReconFile; ///< reconstruction YUV class 72 #endif 73 // for output control 69 74 Bool m_abDecFlag[ MAX_GOP ]; ///< decoded flag in one GOP 70 std::vector<Int> m_pocLastDisplay; ///< last POC in display order 71 Bool m_useDepth; 72 73 #if FLEX_CODING_ORDER_M23723 74 Int m_fcoViewDepthId; 75 Char m_fcoOrder[MAX_VIEW_NUM*2]; 75 #if H_MV 76 Int m_pocLastDisplay [ MAX_NUM_LAYERS ]; ///< last POC in display order 77 Bool m_reconOpen [ MAX_NUM_LAYERS ]; ///< reconstruction file opened 78 #else 79 Int m_iPOCLastDisplay; ///< last POC in display order 76 80 #endif 77 81 #if H_3D 78 82 FILE* m_pScaleOffsetFile; 79 83 CamParsCollector m_cCamParsCollector; 80 #if DEPTH_MAP_GENERATION81 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B004682 TComVPSAccess m_cVPSAccess;83 84 #endif 84 TComSPSAccess m_cSPSAccess;85 TComAUPicAccess m_cAUPicAccess;86 #endif87 88 85 public: 89 86 TAppDecTop(); … … 93 90 Void destroy (); ///< destroy internal members 94 91 Void decode (); ///< main decoding function 95 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B004696 Void increaseNumberOfViews (UInt layerId, UInt viewId, UInt isDepth);97 #else98 Void increaseNumberOfViews (Int newNumberOfViewDepth);99 #endif100 TDecTop* getTDecTop ( Int viewId, Bool isDepth );101 102 std::vector<TComPic*> getInterViewRefPics( Int viewId, Int poc, Bool isDepth, TComSPS* sps );103 TComPic* getPicFromView ( Int viewId, Int poc, bool isDepth ) { return xGetPicFromView( viewId, poc, isDepth ); }104 105 #if DEPTH_MAP_GENERATION106 #if VIDYO_VPS_INTEGRATION107 TComVPSAccess* getVPSAccess () { return &m_cVPSAccess; }108 #endif109 TComSPSAccess* getSPSAccess () { return &m_cSPSAccess; }110 TComAUPicAccess* getAUPicAccess() { return &m_cAUPicAccess; }111 TDecTop* getDecTop0 () { return m_tDecTop[0]; }112 #endif113 114 #if MERL_VSP_C0152115 #if MERL_VSP_NBDV_RefVId_Fix_D0166116 Void setBWVSPLUT( Int iNeighborViewId, TComSlice* pcSlice, Int iCodedViewIdx, Int iCurPoc );117 #else118 Void setBWVSPLUT( TComSlice* pcSlice, Int iCodedViewIdx, Int iCurPoc );119 #endif120 #endif121 92 122 93 protected: 123 //Void xCreateDecLib (); ///< create internal classes94 Void xCreateDecLib (); ///< create internal classes 124 95 Void xDestroyDecLib (); ///< destroy internal classes 125 // Void xInitDecLib (); ///< initialize decoder class 126 127 Void xWriteOutput ( TComList<TComPic*>* pcListPic, Int viewDepthId, UInt tId); ///< write YUV to file 128 Void xFlushOutput ( TComList<TComPic*>* pcListPic, Int viewDepthId ); ///< flush all remaining decoded pictures to file 96 Void xInitDecLib (); ///< initialize decoder class 129 97 130 TComPic* xGetPicFromView( Int viewId, Int poc, Bool isDepth ); 98 #if H_MV 99 Void xWriteOutput ( TComList<TComPic*>* pcListPic, Int layerId, Int tId ); ///< write YUV to file 100 Void xFlushOutput ( TComList<TComPic*>* pcListPic, Int layerId ); ///< flush all remaining decoded pictures to file 101 Int xGetDecoderIdx ( Int layerId, Bool createFlag = false ); 102 #else 103 Void xWriteOutput ( TComList<TComPic*>* pcListPic , UInt tId); ///< write YUV to file 104 Void xFlushOutput ( TComList<TComPic*>* pcListPic ); ///< flush all remaining decoded pictures to file 105 #endif 106 Bool isNaluWithinTargetDecLayerIdSet ( InputNALUnit* nalu ); ///< check whether given Nalu is within targetDecLayerIdSet 131 107 }; 132 108 133 109 //! \} 110 134 111 #endif 135 112 -
trunk/source/App/TAppDecoder/decmain.cpp
r56 r608 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 56 56 // print information 57 57 fprintf( stdout, "\n" ); 58 fprintf( stdout, "3D-HTM Software: Decoder Version [%s] based on HM Version [%s]", NV_VERSION, HM_VERSION ); 58 #if H_MV 59 fprintf( stdout, "3D-HTM Software: Decoder Version [%s] based on HM Version [%s]", NV_VERSION, HM_VERSION ); 60 #else 61 fprintf( stdout, "HM software: Decoder Version [%s]", NV_VERSION ); 62 #endif 59 63 fprintf( stdout, NVM_ONOS ); 60 64 fprintf( stdout, NVM_COMPILEDBY );
Note: See TracChangeset for help on using the changeset viewer.