Changeset 804 in SHVCSoftware for branches/SHM-6-dev/source/Lib/TLibEncoder
- Timestamp:
- 15 Jun 2014, 20:13:14 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-6-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r798 r804 609 609 TEncSbac* pcSbacCoders = NULL; 610 610 TComOutputBitstream* pcSubstreamsOut = NULL; 611 #if Q0108_TSA_STSA 612 Int b_TSTA_flag = 0; 613 #endif 611 614 612 615 xInitGOP( iPOCLast, iNumPicRcvd, rcListPic, rcListPicYuvRecOut, isField ); … … 1388 1391 if(pcSlice->isTemporalLayerSwitchingPoint(rcListPic) || pcSlice->getSPS()->getTemporalIdNestingFlag()) 1389 1392 { 1390 #if SVC_EXTENSION 1391 // Alignment of TSA pictures across AU 1393 #if !Q0108_TSA_STSA 1392 1394 if( pcSlice->getLayerId() > 0 ) 1393 1395 { … … 1445 1447 } 1446 1448 } 1447 #else //SVC_EXTENSION1449 #else 1448 1450 if(pcSlice->getTemporalLayerNonReferenceFlag()) 1449 1451 { … … 1454 1456 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_TSA_R); 1455 1457 } 1456 #endif //SVC_EXTENSION1458 #endif 1457 1459 } 1458 1460 else if(pcSlice->isStepwiseTemporalLayerSwitchingPointCandidate(rcListPic)) … … 1488 1490 if(isSTSA==true) 1489 1491 { 1490 #if SVC_EXTENSION 1491 // Alignment of STSA pictures across AU 1492 #if !Q0108_TSA_STSA 1492 1493 if( pcSlice->getLayerId() > 0 ) 1493 1494 { … … 1545 1546 } 1546 1547 } 1547 #else //SVC_EXTENSION1548 #else 1548 1549 if(pcSlice->getTemporalLayerNonReferenceFlag()) 1549 1550 { … … 1554 1555 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_R); 1555 1556 } 1556 #endif //SVC_EXTENSION 1557 } 1558 } 1559 } 1557 #endif 1558 } 1559 } 1560 } 1561 #if Q0108_TSA_STSA 1562 else if( ( pcSlice->getTLayer() == 0 && pcSlice->getLayerId() > 0) // only for enhancement layer and with temporal layer 0 1563 && !( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N 1564 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R 1565 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N 1566 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R 1567 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL 1568 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP 1569 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA 1570 ) 1571 ) 1572 { 1573 Bool isSTSA=true; 1574 for(Int ii=iGOPid+1;(ii<m_pcCfg->getGOPSize() && isSTSA==true);ii++) 1575 { 1576 Int lTid= m_pcCfg->getGOPEntry(ii).m_temporalId; 1577 if(lTid==pcSlice->getTLayer()) 1578 { 1579 TComReferencePictureSet* nRPS = pcSlice->getSPS()->getRPSList()->getReferencePictureSet(ii); 1580 for(Int jj=0;jj<nRPS->getNumberOfPictures();jj++) 1581 { 1582 if(nRPS->getUsed(jj)) 1583 { 1584 Int tPoc=m_pcCfg->getGOPEntry(ii).m_POC+nRPS->getDeltaPOC(jj); 1585 Int kk=0; 1586 for(kk=0;kk<m_pcCfg->getGOPSize();kk++) 1587 { 1588 if(m_pcCfg->getGOPEntry(kk).m_POC==tPoc) 1589 break; 1590 } 1591 Int tTid=m_pcCfg->getGOPEntry(kk).m_temporalId; 1592 if(tTid >= pcSlice->getTLayer()) 1593 { 1594 isSTSA=false; 1595 break; 1596 } 1597 } 1598 } 1599 } 1600 } 1601 if(isSTSA==true) 1602 { 1603 #if !Q0108_TSA_STSA 1604 if( pcSlice->getLayerId() > 0 ) 1605 { 1606 Bool oneRefLayerSTSA = false, oneRefLayerNotSTSA = false; 1607 for( Int i = 0; i < pcSlice->getLayerId(); i++) 1608 { 1609 TComList<TComPic *> *cListPic = m_ppcTEncTop[i]->getListPic(); 1610 TComPic *lowerLayerPic = pcSlice->getRefPic(*cListPic, pcSlice->getPOC()); 1611 if( lowerLayerPic && pcSlice->getVPS()->getDirectDependencyFlag(pcSlice->getLayerId(), i) ) 1612 { 1613 if( ( lowerLayerPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N ) || 1614 ( lowerLayerPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_R ) 1615 ) 1616 { 1617 if(pcSlice->getTemporalLayerNonReferenceFlag() ) 1618 { 1619 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_N); 1620 } 1621 else 1622 { 1623 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_R ); 1624 } 1625 oneRefLayerSTSA = true; 1626 } 1627 else 1628 { 1629 oneRefLayerNotSTSA = true; 1630 } 1631 } 1632 } 1633 assert( !( oneRefLayerNotSTSA && oneRefLayerSTSA ) ); // Only one variable should be true - failure of this assert means 1634 // that two independent reference layers that are not dependent on 1635 // each other, but are reference for current layer have inconsistency 1636 if( oneRefLayerNotSTSA /*&& !oneRefLayerSTSA*/ ) // No reference layer is STSA - set current as TRAIL 1637 { 1638 if(pcSlice->getTemporalLayerNonReferenceFlag() ) 1639 { 1640 pcSlice->setNalUnitType( NAL_UNIT_CODED_SLICE_TRAIL_N ); 1641 } 1642 else 1643 { 1644 pcSlice->setNalUnitType( NAL_UNIT_CODED_SLICE_TRAIL_R ); 1645 } 1646 } 1647 else // This means there is no reference layer picture for current picture in this AU 1648 { 1649 if(pcSlice->getTemporalLayerNonReferenceFlag() ) 1650 { 1651 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_N); 1652 } 1653 else 1654 { 1655 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_R ); 1656 } 1657 } 1658 } 1659 #else 1660 if(pcSlice->getTemporalLayerNonReferenceFlag()) 1661 { 1662 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_N); 1663 b_TSTA_flag = 1; 1664 } 1665 else 1666 { 1667 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_R); 1668 b_TSTA_flag = 1; 1669 } 1670 #endif 1671 } 1672 } 1673 #endif 1674 1560 1675 arrangeLongtermPicturesInRPS(pcSlice, rcListPic); 1561 1676 TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification(); … … 1577 1692 pcSlice->setInterLayerPredEnabledFlag(0); 1578 1693 } 1579 if( pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA ) 1694 #if Q0108_TSA_STSA 1695 if( (pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA ) || b_TSTA_flag == 1) 1696 #else 1697 if( pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA ) 1698 #endif 1580 1699 { 1581 1700 pcSlice->setNumRefIdx(REF_PIC_LIST_0, pcSlice->getActiveNumILRRefIdx());
Note: See TracChangeset for help on using the changeset viewer.