MCPcopy Create free account
hub / github.com/MPEGGroup/mpeg-pcc-tmc2 / decode

Method decode

source/lib/PccLibDecoder/source/PCCDecoder.cpp:69–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69int PCCDecoder::decode( PCCContext& context, PCCGroupOfFrames& reconstructs, int32_t atlasIndex = 0 ) {
70#if defined( ENABLE_TBB )
71 if ( params_.nbThread_ > 0 ) { tbb::task_scheduler_init init( static_cast<int>( params_.nbThread_ ) ); }
72#endif
73 createPatchFrameDataStructure( context );
74
75 PCCVideoDecoder videoDecoder;
76 videoDecoder.setLogger( *logger_ );
77 std::stringstream path;
78 auto& sps = context.getVps();
79 auto& ai = sps.getAttributeInformation( atlasIndex );
80 auto& oi = sps.getOccupancyInformation( atlasIndex );
81 auto& gi = sps.getGeometryInformation( atlasIndex );
82 auto& asps = context.getAtlasSequenceParameterSet( 0 );
83 size_t frameCount = context.size();
84 auto& plt = sps.getProfileTierLevel();
85 const size_t mapCount = sps.getMapCountMinus1( atlasIndex ) + 1;
86 int geometryBitDepth = gi.getGeometry2dBitdepthMinus1() + 1;
87 setConsitantFourCCCode( context, 0 ); //
88 auto occupancyCodecId = getCodedCodecId( context, oi.getOccupancyCodecId(), params_.videoDecoderOccupancyPath_ );
89 auto geometryCodecId = getCodedCodecId( context, gi.getGeometryCodecId(), params_.videoDecoderGeometryPath_ );
90 path << removeFileExtension( params_.compressedStreamPath_ ) << "_dec_GOF" << sps.getV3CParameterSetId() << "_";
91
92 printf( "CodecCodecId: ProfileCodecGroupIdc = %u occupancyCodecId = %u geometry = %u auxGeo = %u \n",
93 plt.getProfileCodecGroupIdc(), oi.getOccupancyCodecId(), gi.getGeometryCodecId(),
94 gi.getAuxiliaryGeometryCodecId() );
95 printf( "=> Video decoder : occupancy = %d geometry = %d \n", (int)occupancyCodecId, (int)geometryCodecId );
96 printf( " Decode 0 size = %zu \n", context.getVideoBitstream( VIDEO_OCCUPANCY ).size() );
97 fflush( stdout );
98 TRACE_PICTURE( "Occupancy\n" );
99 TRACE_PICTURE( "MapIdx = 0, AuxiliaryVideoFlag = 0\n" );
100 videoDecoder.decompress( context.getVideoOccupancyMap(), // video
101 context, // contexts
102 path.str(), // path
103 context.getVideoBitstream( VIDEO_OCCUPANCY ), // bitstream
104 params_.byteStreamVideoCoderOccupancy_, // byte stream video coder
105 occupancyCodecId, // codecId
106 params_.videoDecoderOccupancyPath_, // decoder path
107 8, // output bit depth
108 params_.keepIntermediateFiles_ ); // keep intermediate files
109
110 // converting the decoded bitdepth to the nominal bitdepth
111 context.getVideoOccupancyMap().convertBitdepth( 8, oi.getOccupancy2DBitdepthMinus1() + 1,
112 oi.getOccupancyMSBAlignFlag() );
113
114 if ( sps.getMultipleMapStreamsPresentFlag( atlasIndex ) ) {
115 context.getVideoGeometryMultiple().resize( sps.getMapCountMinus1( atlasIndex ) + 1 );
116 size_t totalGeoSize = 0;
117 for ( uint32_t mapIndex = 0; mapIndex < sps.getMapCountMinus1( atlasIndex ) + 1; mapIndex++ ) {
118 TRACE_PICTURE( "Geometry\n" );
119 TRACE_PICTURE( "MapIdx = %d, AuxiliaryVideoFlag = 0\n", mapIndex );
120 std::cout << "*******Video Decoding: Geometry[" << mapIndex << "] ********" << std::endl;
121 auto geometryIndex = static_cast<PCCVideoType>( VIDEO_GEOMETRY_D0 + mapIndex );
122 auto& videoBitstream = context.getVideoBitstream( geometryIndex );
123 videoDecoder.decompress( context.getVideoGeometryMultiple( mapIndex ), // video
124 context, // contexts
125 path.str(), // path
126 videoBitstream, // bitstream

Callers 4

decompressMethod · 0.45
decompressVideoFunction · 0.45
mainFunction · 0.45
parserPccBinFunction · 0.45

Tested by

no test coverage detected