Changeset 443 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
- Timestamp:
- 26 May 2013, 15:41:34 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
r332 r443 54 54 if (pcSlice->getSPS()->getUseSAO()) 55 55 { 56 #if LGE_SAO_MIGRATION_D0091 57 if (pcSlice->getSPS()->getUseSAO()) 58 { 59 SAOParam *saoParam = pcSlice->getAPS()->getSaoParam(); 60 pcSlice->setSaoEnabledFlag (saoParam->bSaoFlag[0]); 61 { 62 pcSlice->setSaoEnabledFlagChroma (saoParam->bSaoFlag[1]); 63 } 64 } 65 #else 56 66 pcSlice->setSaoInterleavingFlag(pcSlice->getAPS()->getSaoInterleavingFlag()); 57 67 pcSlice->setSaoEnabledFlag (pcSlice->getAPS()->getSaoParam()->bSaoFlag[0]); … … 66 76 pcSlice->setSaoEnabledFlagCr (0); 67 77 } 78 #endif 68 79 } 69 80 … … 456 467 457 468 469 #if QC_ARP_D0177 470 Void TEncEntropy::encodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD, UInt uiDepth) 471 { 472 if( pcCU->getSlice()->getViewId() == 0 || pcCU->getSlice()->getIsDepth() == true || !pcCU->getSlice()->getARPStepNum() ) 473 { 474 return; 475 } 476 assert( pcCU->isIntra( uiAbsPartIdx ) == false ); 477 if( bRD ) 478 { 479 uiAbsPartIdx = 0; 480 } 481 bool bSignalflag[2] = {true, true}; 482 if (!(pcCU->getPartitionSize(uiAbsPartIdx)==SIZE_2Nx2N || pcCU->isSkipped(uiAbsPartIdx))) 483 { 484 assert(pcCU->getARPW (uiAbsPartIdx) == 0); 485 bSignalflag[0] = false; 486 bSignalflag[1] = false; 487 } 488 if (!(bSignalflag[0]|| bSignalflag[1])) 489 { 490 assert(pcCU->getARPW (uiAbsPartIdx) == 0); 491 if (uiDepth != -1) 492 pcCU->setARPWSubParts(0, uiAbsPartIdx, uiDepth); 493 } 494 else 495 m_pcEntropyCoderIf->codeARPW( pcCU, uiAbsPartIdx ); 496 497 } 498 #endif 458 499 /** parse the fixed length code (smaller than one max value) in ALF 459 500 * \param run: coded value … … 828 869 m_pcEntropyCoderIf->codePredMode( pcCU, uiAbsPartIdx ); 829 870 871 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 830 872 #if RWTH_SDC_DLT_B0036 831 873 // if B-Slice, code SDC flag later … … 835 877 encodeSDCFlag(pcCU, uiAbsPartIdx, bRD); 836 878 } 879 #endif 837 880 #endif 838 881 } … … 876 919 } 877 920 } 921 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 878 922 #if RWTH_SDC_DLT_B0036 879 923 if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx) ) … … 883 927 } 884 928 #endif 929 #endif 885 930 886 931 m_pcEntropyCoderIf->codePartSize( pcCU, uiAbsPartIdx, uiDepth ); 887 932 933 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 888 934 #if RWTH_SDC_DLT_B0036 889 935 // code SDC flag now! … … 899 945 } 900 946 } 947 #endif 901 948 #endif 902 949 } … … 1179 1226 1180 1227 // Intra direction for Luma 1181 Void TEncEntropy::encodeIntraDirModeLuma ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 1182 { 1183 m_pcEntropyCoderIf->codeIntraDirLumaAng( pcCU, uiAbsPartIdx ); 1228 Void TEncEntropy::encodeIntraDirModeLuma ( TComDataCU* pcCU, UInt uiAbsPartIdx 1229 #if PKU_QC_DEPTH_INTRA_UNI_D0195 1230 ,Bool bSdcRD 1231 #endif 1232 ) 1233 { 1234 m_pcEntropyCoderIf->codeIntraDirLumaAng( pcCU, uiAbsPartIdx 1235 #if PKU_QC_DEPTH_INTRA_UNI_D0195 1236 ,bSdcRD 1237 #endif 1238 ); 1184 1239 } 1185 1240 … … 1195 1250 } 1196 1251 1197 Void TEncEntropy::encodePredInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 1252 Void TEncEntropy::encodePredInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD 1253 #if PKU_QC_DEPTH_INTRA_UNI_D0195 1254 ,Bool bSdcRD 1255 #endif 1256 ) 1198 1257 { 1199 1258 if( bRD ) … … 1202 1261 } 1203 1262 1263 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 1204 1264 #if RWTH_SDC_DLT_B0036 1205 1265 if( pcCU->getSDCFlag(uiAbsPartIdx) ) … … 1208 1268 return; 1209 1269 } 1270 #endif 1210 1271 #endif 1211 1272 … … 1222 1283 encodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*2 ); 1223 1284 encodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*3 ); 1285 #if PKU_QC_DEPTH_INTRA_UNI_D0195 1286 if(!pcCU->getSDCFlag(uiAbsPartIdx)) 1287 #endif 1224 1288 encodeIntraDirModeChroma( pcCU, uiAbsPartIdx, bRD ); 1225 1289 } 1226 1290 else // if it is not NxN size, encode 1 intra directions 1227 1291 { 1228 encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx ); 1292 encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx 1293 #if PKU_QC_DEPTH_INTRA_UNI_D0195 1294 ,bSdcRD 1295 #endif 1296 ); 1297 #if PKU_QC_DEPTH_INTRA_UNI_D0195 1298 if(!pcCU->getSDCFlag(uiAbsPartIdx)) 1299 #endif 1229 1300 encodeIntraDirModeChroma( pcCU, uiAbsPartIdx, bRD ); 1230 1301 } … … 1233 1304 { 1234 1305 encodePUWise( pcCU, uiAbsPartIdx, bRD ); 1306 #if QC_ARP_D0177 1307 encodeARPW( pcCU , uiAbsPartIdx , bRD ); 1308 #endif 1235 1309 } 1236 1310 } … … 1351 1425 { 1352 1426 #if H3D_IVMP 1427 #if SEC_TWO_CANDIDATES_FOR_AMVP_D0122 1428 const Int iNumCands = AMVP_MAX_NUM_CANDS; 1429 #else 1353 1430 const Int iNumCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); 1431 #endif 1354 1432 m_pcEntropyCoderIf->codeMVPIdx( pcCU, uiAbsPartIdx, eRefList, iNumCands ); 1355 1433 #else … … 1417 1495 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 1418 1496 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 1419 1497 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 1420 1498 encodeSDCResidualData(pcCU, uiAbsPartIdx); 1499 #endif 1421 1500 return; 1422 1501 } … … 1495 1574 } 1496 1575 1576 #if LGE_SAO_MIGRATION_D0091 1577 Void TEncEntropy::encodeSaoOffset(SaoLcuParam* saoLcuParam, UInt compIdx) 1578 { 1579 UInt uiSymbol; 1580 Int i; 1581 1582 uiSymbol = saoLcuParam->typeIdx + 1; 1583 if (compIdx!=2) 1584 { 1585 m_pcEntropyCoderIf->codeSaoTypeIdx(uiSymbol); 1586 } 1587 1588 if (uiSymbol) 1589 { 1590 if (saoLcuParam->typeIdx < 4 && compIdx != 2) 1591 { 1592 saoLcuParam->subTypeIdx = saoLcuParam->typeIdx; 1593 } 1594 #if FULL_NBIT 1595 Int offsetTh = 1 << ( min((Int)(g_uiBitDepth + (g_uiBitDepth-8)-5),5) ); 1596 #else 1597 Int offsetTh = 1 << ( min((Int)(g_uiBitDepth + g_uiBitIncrement-5),5) ); 1598 #endif 1599 if( saoLcuParam->typeIdx == SAO_BO ) 1600 { 1601 for( i=0; i< saoLcuParam->length; i++) 1602 { 1603 UInt absOffset = ( (saoLcuParam->offset[i] < 0) ? -saoLcuParam->offset[i] : saoLcuParam->offset[i]); 1604 m_pcEntropyCoderIf->codeSaoMaxUvlc(absOffset, offsetTh-1); 1605 } 1606 for( i=0; i< saoLcuParam->length; i++) 1607 { 1608 if (saoLcuParam->offset[i] != 0) 1609 { 1610 UInt sign = (saoLcuParam->offset[i] < 0) ? 1 : 0 ; 1611 m_pcEntropyCoderIf->codeSAOSign(sign); 1612 } 1613 } 1614 uiSymbol = (UInt) (saoLcuParam->subTypeIdx); 1615 m_pcEntropyCoderIf->codeSaoUflc(5, uiSymbol); 1616 } 1617 else if( saoLcuParam->typeIdx < 4 ) 1618 { 1619 m_pcEntropyCoderIf->codeSaoMaxUvlc( saoLcuParam->offset[0], offsetTh-1); 1620 m_pcEntropyCoderIf->codeSaoMaxUvlc( saoLcuParam->offset[1], offsetTh-1); 1621 m_pcEntropyCoderIf->codeSaoMaxUvlc(-saoLcuParam->offset[2], offsetTh-1); 1622 m_pcEntropyCoderIf->codeSaoMaxUvlc(-saoLcuParam->offset[3], offsetTh-1); 1623 1624 if (compIdx!=2) 1625 { 1626 uiSymbol = (UInt) (saoLcuParam->subTypeIdx); 1627 m_pcEntropyCoderIf->codeSaoUflc(2, uiSymbol); 1628 } 1629 } 1630 } 1631 } 1632 1633 /** Encode SAO unit interleaving 1634 * \param rx 1635 * \param ry 1636 * \param pSaoParam 1637 * \param pcCU 1638 * \param iCUAddrInSlice 1639 * \param iCUAddrUpInSlice 1640 * \param bLFCrossSliceBoundaryFlag 1641 */ 1642 Void TEncEntropy::encodeSaoUnitInterleaving(Int compIdx, Bool saoFlag, Int rx, Int ry, SaoLcuParam* saoLcuParam, Int cuAddrInSlice, Int cuAddrUpInSlice, Int allowMergeLeft, Int allowMergeUp) 1643 { 1644 if (saoFlag) 1645 { 1646 if (rx>0 && cuAddrInSlice!=0 && allowMergeLeft) 1647 { 1648 m_pcEntropyCoderIf->codeSaoMerge(saoLcuParam->mergeLeftFlag); 1649 } 1650 else 1651 { 1652 saoLcuParam->mergeLeftFlag = 0; 1653 } 1654 1655 if (saoLcuParam->mergeLeftFlag == 0) 1656 { 1657 if ( (ry > 0) && (cuAddrUpInSlice>=0) && allowMergeUp ) 1658 { 1659 m_pcEntropyCoderIf->codeSaoMerge(saoLcuParam->mergeUpFlag); 1660 } 1661 else 1662 { 1663 saoLcuParam->mergeUpFlag = 0; 1664 } 1665 1666 if (!saoLcuParam->mergeUpFlag) 1667 { 1668 encodeSaoOffset(saoLcuParam, compIdx); 1669 } 1670 } 1671 } 1672 } 1673 #else 1497 1674 /** Encode SAO Offset 1498 1675 * \param saoLcuParam SAO LCU paramters … … 1682 1859 } 1683 1860 } 1861 #endif 1684 1862 1685 1863 Int TEncEntropy::countNonZeroCoeffs( TCoeff* pcCoef, UInt uiSize ) … … 1715 1893 1716 1894 #if RWTH_SDC_DLT_B0036 1895 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 1717 1896 Void TEncEntropy::encodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 1718 1897 { … … 1734 1913 m_pcEntropyCoderIf->codeSDCFlag(pcCU, uiAbsPartIdx); 1735 1914 } 1736 1915 #endif 1737 1916 Void TEncEntropy::encodeSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 1738 1917 {
Note: See TracChangeset for help on using the changeset viewer.