| 276 | } |
| 277 | |
| 278 | int decompressVideo( PCCDecoderParameters& decoderParams, |
| 279 | const PCCMetricsParameters& metricsParams, |
| 280 | PCCConformanceParameters& conformanceParams, |
| 281 | StopwatchUserTime& clock ) { |
| 282 | PCCBitstream bitstream; |
| 283 | PCCBitstreamStat bitstreamStat; |
| 284 | PCCLogger logger; |
| 285 | logger.initilalize( removeFileExtension( decoderParams.compressedStreamPath_ ), false ); |
| 286 | #if defined( BITSTREAM_TRACE ) || defined( CONFORMANCE_TRACE ) |
| 287 | bitstream.setLogger( logger ); |
| 288 | bitstream.setTrace( true ); |
| 289 | #endif |
| 290 | if ( !bitstream.initialize( decoderParams.compressedStreamPath_ ) ) { return -1; } |
| 291 | bitstream.computeMD5(); |
| 292 | bitstreamStat.setHeader( bitstream.size() ); |
| 293 | size_t frameNumber = decoderParams.startFrameNumber_; |
| 294 | PCCMetrics metrics; |
| 295 | PCCChecksum checksum; |
| 296 | PCCConformance conformance; |
| 297 | metrics.setParameters( metricsParams ); |
| 298 | checksum.setParameters( metricsParams ); |
| 299 | if ( metricsParams.computeChecksum_ ) { checksum.read( decoderParams.compressedStreamPath_ ); } |
| 300 | PCCDecoder decoder; |
| 301 | decoder.setLogger( logger ); |
| 302 | decoder.setParameters( decoderParams ); |
| 303 | |
| 304 | SampleStreamV3CUnit ssvu; |
| 305 | size_t headerSize = pcc::PCCBitstreamReader::read( bitstream, ssvu ); |
| 306 | bitstreamStat.incrHeader( headerSize ); |
| 307 | bool bMoreData = true; |
| 308 | while ( bMoreData ) { |
| 309 | PCCGroupOfFrames reconstructs; |
| 310 | PCCContext context; |
| 311 | context.setBitstreamStat( bitstreamStat ); |
| 312 | clock.start(); |
| 313 | PCCBitstreamReader bitstreamReader; |
| 314 | #ifdef BITSTREAM_TRACE |
| 315 | bitstreamReader.setLogger( logger ); |
| 316 | #endif |
| 317 | if ( bitstreamReader.decode( ssvu, context ) == 0 ) { return 0; } |
| 318 | #if 1 |
| 319 | if ( context.checkProfile() != 0 ) { |
| 320 | printf( "Profile not correct... \n" ); |
| 321 | return 0; |
| 322 | } |
| 323 | decoderParams.setReconstructionParameters( context.getVps().getProfileTierLevel().getProfileReconstructionIdc() ); |
| 324 | decoder.setReconstructionParameters( decoderParams ); |
| 325 | #endif |
| 326 | |
| 327 | // allocate atlas structure |
| 328 | context.resizeAtlas( context.getVps().getAtlasCountMinus1() + 1 ); |
| 329 | for ( uint32_t atlId = 0; atlId < context.getVps().getAtlasCountMinus1() + 1; atlId++ ) { |
| 330 | context.getAtlas( atlId ).allocateVideoFrames( context, 0 ); |
| 331 | // first allocating the structures, frames will be added as the V3C |
| 332 | // units are being decoded ??? |
| 333 | context.setAtlasIndex( atlId ); |
| 334 | int retDecoding = decoder.decode( context, reconstructs, atlId ); |
| 335 | clock.stop(); |
no test coverage detected