Changeset 438 in 3DVCSoftware for branches/HTM-DEV-0.2-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
- Timestamp:
- 23 May 2013, 15:40:36 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.2-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r401 r438 285 285 WRITE_FLAG(pcVUI->getNeutralChromaIndicationFlag(), "neutral_chroma_indication_flag"); 286 286 WRITE_FLAG(pcVUI->getFieldSeqFlag(), "field_seq_flag"); 287 assert(pcVUI->getFieldSeqFlag() == 0); // not currently supported 287 288 WRITE_FLAG(pcVUI->getFrameFieldInfoPresentFlag(), "frame_field_info_present_flag"); 288 289 … … 473 474 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++) 474 475 { 475 #if L0323_DPB476 WRITE_UVLC( pcSPS->getMaxDecPicBuffering(i) - 1, "sps_max_dec_pic_buffering_minus1[i]" );477 #else478 476 WRITE_UVLC( pcSPS->getMaxDecPicBuffering(i), "sps_max_dec_pic_buffering[i]" ); 479 #endif480 477 WRITE_UVLC( pcSPS->getNumReorderPics(i), "sps_num_reorder_pics[i]" ); 481 478 WRITE_UVLC( pcSPS->getMaxLatencyIncrease(i), "sps_max_latency_increase[i]" ); … … 487 484 assert( pcSPS->getMaxCUWidth() == pcSPS->getMaxCUHeight() ); 488 485 489 WRITE_UVLC( pcSPS->getLog2MinCodingBlockSize() - 3, "log2_min_coding_block_size_minus3" ); 490 WRITE_UVLC( pcSPS->getLog2DiffMaxMinCodingBlockSize(), "log2_diff_max_min_coding_block_size" ); 486 UInt MinCUSize = pcSPS->getMaxCUWidth() >> ( pcSPS->getMaxCUDepth()-g_uiAddCUDepth ); 487 UInt log2MinCUSize = 0; 488 while(MinCUSize > 1) 489 { 490 MinCUSize >>= 1; 491 log2MinCUSize++; 492 } 493 494 WRITE_UVLC( log2MinCUSize - 3, "log2_min_coding_block_size_minus3" ); 495 WRITE_UVLC( pcSPS->getMaxCUDepth()-g_uiAddCUDepth, "log2_diff_max_min_coding_block_size" ); 491 496 WRITE_UVLC( pcSPS->getQuadtreeTULog2MinSize() - 2, "log2_min_transform_block_size_minus2" ); 492 497 WRITE_UVLC( pcSPS->getQuadtreeTULog2MaxSize() - pcSPS->getQuadtreeTULog2MinSize(), "log2_diff_max_min_transform_block_size" ); … … 549 554 } 550 555 551 #if H_MV552 WRITE_FLAG( 1, "sps_extension_flag" );553 554 WRITE_FLAG( pcSPS->getInterViewMvVertConstraintFlag() ? 1 : 0, "inter_view_mv_vert_constraint_flag" );555 #else556 556 WRITE_FLAG( 0, "sps_extension_flag" ); 557 #endif558 557 } 559 558 … … 570 569 WRITE_FLAG( pcVPS->getTemporalNestingFlag(), "vps_temporal_id_nesting_flag" ); 571 570 assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag()); 572 #if H_MV573 571 WRITE_CODE( 0xffff, 16, "vps_extension_offset" ); 574 #else575 WRITE_CODE( 0xffff, 16, "vps_reserved_ffff_16bits" );576 #endif577 572 codePTL( pcVPS->getPTL(), true, pcVPS->getMaxTLayers() - 1 ); 578 573 #if SIGNAL_BITRATE_PICRATE_IN_VPS … … 583 578 for(UInt i=0; i <= pcVPS->getMaxTLayers()-1; i++) 584 579 { 585 #if L0323_DPB586 WRITE_UVLC( pcVPS->getMaxDecPicBuffering(i) - 1, "vps_max_dec_pic_buffering_minus1[i]" );587 #else588 580 WRITE_UVLC( pcVPS->getMaxDecPicBuffering(i), "vps_max_dec_pic_buffering[i]" ); 589 #endif590 581 WRITE_UVLC( pcVPS->getNumReorderPics(i), "vps_num_reorder_pics[i]" ); 591 582 WRITE_UVLC( pcVPS->getMaxLatencyIncrease(i), "vps_max_latency_increase[i]" ); … … 654 645 } 655 646 #endif 647 656 648 #if H_MV 657 649 WRITE_FLAG( 1, "vps_extension_flag" ); … … 792 784 WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb"); 793 785 TComReferencePictureSet* rps = pcSlice->getRPS(); 794 795 #if FIX1071796 // Deal with bitstream restriction stating that:797 // – If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.798 // Ideally this process should not be repeated for each slice in a picture799 TComReferencePictureSet altRps;800 Bool useAltRps = false;801 #if H_MV802 if (pcSlice->getRapPicFlag() && ( pcSlice->getLayerId() == 0 ) )803 #else804 if (pcSlice->getRapPicFlag())805 #endif806 {807 for (Int picIdx = 0; !useAltRps && picIdx < rps->getNumberOfPictures(); picIdx++)808 {809 useAltRps = rps->getUsed(picIdx);810 }811 if (useAltRps)812 {813 memcpy(&altRps, rps, sizeof(TComReferencePictureSet));814 rps = &altRps;815 for (Int picIdx = 0; picIdx < rps->getNumberOfPictures(); picIdx++)816 {817 rps->setUsed(picIdx, false);818 }819 }820 }821 822 if(pcSlice->getRPSidx() < 0 || useAltRps)823 #else824 786 if(pcSlice->getRPSidx() < 0) 825 #endif826 787 { 827 788 WRITE_FLAG( 0, "short_term_ref_pic_set_sps_flag"); … … 1406 1367 // ==================================================================================================================== 1407 1368 1369 1370 /** Write PCM alignment bits. 1371 * \returns Void 1372 */ 1373 Void TEncCavlc::xWritePCMAlignZero () 1374 { 1375 m_pcBitIf->writeAlignZero(); 1376 } 1377 1378 Void TEncCavlc::xWriteUnaryMaxSymbol( UInt uiSymbol, UInt uiMaxSymbol ) 1379 { 1380 if (uiMaxSymbol == 0) 1381 { 1382 return; 1383 } 1384 xWriteFlag( uiSymbol ? 1 : 0 ); 1385 if ( uiSymbol == 0 ) 1386 { 1387 return; 1388 } 1389 1390 Bool bCodeLast = ( uiMaxSymbol > uiSymbol ); 1391 1392 while( --uiSymbol ) 1393 { 1394 xWriteFlag( 1 ); 1395 } 1396 if( bCodeLast ) 1397 { 1398 xWriteFlag( 0 ); 1399 } 1400 return; 1401 } 1402 1403 Void TEncCavlc::xWriteExGolombLevel( UInt uiSymbol ) 1404 { 1405 if( uiSymbol ) 1406 { 1407 xWriteFlag( 1 ); 1408 UInt uiCount = 0; 1409 Bool bNoExGo = (uiSymbol < 13); 1410 1411 while( --uiSymbol && ++uiCount < 13 ) 1412 { 1413 xWriteFlag( 1 ); 1414 } 1415 if( bNoExGo ) 1416 { 1417 xWriteFlag( 0 ); 1418 } 1419 else 1420 { 1421 xWriteEpExGolomb( uiSymbol, 0 ); 1422 } 1423 } 1424 else 1425 { 1426 xWriteFlag( 0 ); 1427 } 1428 return; 1429 } 1430 1431 Void TEncCavlc::xWriteEpExGolomb( UInt uiSymbol, UInt uiCount ) 1432 { 1433 while( uiSymbol >= (UInt)(1<<uiCount) ) 1434 { 1435 xWriteFlag( 1 ); 1436 uiSymbol -= 1<<uiCount; 1437 uiCount ++; 1438 } 1439 xWriteFlag( 0 ); 1440 while( uiCount-- ) 1441 { 1442 xWriteFlag( (uiSymbol>>uiCount) & 1 ); 1443 } 1444 return; 1445 } 1446 1408 1447 /** code explicit wp tables 1409 1448 * \param TComSlice* pcSlice
Note: See TracChangeset for help on using the changeset viewer.