Changeset 431 in SHVCSoftware for branches/SHM-3.1-dev/source/App/TAppEncoder
- Timestamp:
- 11 Oct 2013, 05:54:02 (12 years ago)
- Location:
- branches/SHM-3.1-dev/source/App/TAppEncoder
- Files:
-
- 6 edited
-
TAppEncCfg.cpp (modified) (7 diffs)
-
TAppEncCfg.h (modified) (2 diffs)
-
TAppEncLayerCfg.cpp (modified) (2 diffs)
-
TAppEncLayerCfg.h (modified) (3 diffs)
-
TAppEncTop.cpp (modified) (19 diffs)
-
TAppEncTop.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r405 r431 348 348 349 349 #if SVC_EXTENSION 350 string cfg_LayerCfgFile [MAX_LAYERS];350 string cfg_LayerCfgFile [MAX_LAYERS]; 351 351 string cfg_BitstreamFile; 352 string* cfg_InputFile [MAX_LAYERS];353 string* cfg_ReconFile [MAX_LAYERS];354 Double* cfg_fQP [MAX_LAYERS];352 string* cfg_InputFile [MAX_LAYERS]; 353 string* cfg_ReconFile [MAX_LAYERS]; 354 Double* cfg_fQP [MAX_LAYERS]; 355 355 356 356 #if REPN_FORMAT_IN_VPS … … 565 565 ("FrameRate,-fr", m_iFrameRate, 0, "Frame rate") 566 566 #endif 567 568 //Field coding parameters 569 ("FieldCoding", m_isField, false, "Signals if it's a field based coding") 570 ("TopFieldFirst, Tff", m_isTopFieldFirst, false, "In case of field based coding, signals whether if it's a top field first or not") 567 571 ("FrameSkip,-fs", m_FrameSkip, 0u, "Number of frames to skip at start of input YUV") 568 572 ("FramesToBeEncoded,f", m_framesToBeEncoded, 0, "Number of frames to be encoded (default=all)") … … 862 866 const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv); 863 867 868 if(m_isField) 869 { 870 #if SVC_EXTENSION 871 for(Int layer = 0; layer < MAX_LAYERS; layer++) 872 { 873 //Frame height 874 m_acLayerCfg[layer].m_iSourceHeightOrg = m_acLayerCfg[layer].m_iSourceHeight; 875 //Field height 876 m_acLayerCfg[layer].m_iSourceHeight = m_acLayerCfg[layer].m_iSourceHeight >> 1; 877 } 878 #else 879 //Frame height 880 m_iSourceHeightOrg = m_iSourceHeight; 881 //Field height 882 m_iSourceHeight = m_iSourceHeight >> 1; 883 #endif 884 //number of fields to encode 885 m_framesToBeEncoded *= 2; 886 } 887 864 888 for (list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++) 865 889 { … … 1193 1217 m_aiPad[1] = m_confBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight; 1194 1218 m_iSourceHeight += m_confBottom; 1219 if ( m_isField ) 1220 { 1221 m_iSourceHeightOrg += m_confBottom << 1; 1222 m_aiPad[1] = m_confBottom << 1; 1223 } 1195 1224 } 1196 1225 if (m_aiPad[0] % TComSPS::getWinUnitX(CHROMA_420) != 0) … … 1515 1544 #if EXTERNAL_USEDBYCURR_N0082|| !FINAL_RPL_CHANGE_N0082 1516 1545 Int checkGOP=1; 1517 Int numRefs = 1;1546 Int numRefs = m_isField ? 2 : 1; 1518 1547 #endif 1519 1548 Int refList[MAX_NUM_REF_PICS+1]; 1520 1549 refList[0]=0; 1550 if(m_isField) 1551 { 1552 refList[1] = 1; 1553 } 1521 1554 Bool isOK[MAX_GOP]; 1522 1555 for(Int i=0; i<MAX_GOP; i++) … … 1546 1579 for(UInt layer=0; layer<m_numLayers; layer++) 1547 1580 { 1548 if(m_acLayerCfg[layer].xCheckParameter( ))1581 if(m_acLayerCfg[layer].xCheckParameter(m_isField)) 1549 1582 { 1550 1583 printf("\nError: invalid configuration parameter found in layer %d \n", layer); … … 2181 2214 printf("Internal Format : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate ); 2182 2215 #endif 2183 printf("Frame index : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); 2216 if (m_isField) 2217 { 2218 printf("Frame/Field : Field based coding\n"); 2219 printf("Field index : %u - %d (%d fields)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); 2220 if (m_isTopFieldFirst) 2221 { 2222 printf("Field Order : Top field first\n"); 2223 } 2224 else 2225 { 2226 printf("Field Order : Bottom field first\n"); 2227 } 2228 } 2229 else 2230 { 2231 printf("Frame/Field : Frame based coding\n"); 2232 printf("Frame index : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); 2233 } 2184 2234 printf("CU size / depth : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth ); 2185 2235 printf("RQT trans. size (min / max) : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize ); -
branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncCfg.h
r402 r431 88 88 UInt m_FrameSkip; ///< number of skipped frames from the beginning 89 89 Int m_iSourceWidth; ///< source width in pixel 90 Int m_iSourceHeight; ///< source height in pixel 90 Int m_iSourceHeight; ///< source height in pixel (when interlaced = field height) 91 92 Int m_iSourceHeightOrg; ///< original source height in pixel (when interlaced = frame height) 93 94 91 95 Int m_conformanceMode; 92 96 Int m_confLeft; … … 97 101 Int m_aiPad[2]; ///< number of padded pixels for width and height 98 102 #endif 103 104 Bool m_isField; ///< enable field coding 105 Bool m_isTopFieldFirst; 99 106 100 107 // profile/level -
branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r389 r431 161 161 Bool confirmPara(Bool bflag, const char* message); 162 162 163 Bool TAppEncLayerCfg::xCheckParameter( )163 Bool TAppEncLayerCfg::xCheckParameter( Bool isField ) 164 164 { 165 165 switch (m_conformanceMode) … … 185 185 m_aiPad[1] = m_confBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight; 186 186 m_iSourceHeight += m_confBottom; 187 if ( isField ) 188 { 189 m_iSourceHeightOrg += m_confBottom << 1; 190 m_aiPad[1] = m_confBottom << 1; 191 } 187 192 } 188 193 break; -
branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
r403 r431 33 33 Int m_iFrameRate; ///< source frame-rates (Hz) 34 34 Int m_iSourceWidth; ///< source width in pixel 35 Int m_iSourceHeight; ///< source height in pixel 35 Int m_iSourceHeight; ///< source height in pixel (when interlaced = field height) 36 Int m_iSourceHeightOrg; ///< original source height in pixel (when interlaced = frame height) 36 37 Int m_conformanceMode; 37 38 Int m_confLeft; … … 104 105 Void xPrintParameter(); 105 106 #endif 106 Bool xCheckParameter( );107 Bool xCheckParameter( Bool isField ); 107 108 108 109 Void setAppEncCfg(TAppEncCfg* p) {m_cAppEncCfg = p; } … … 113 114 Int getSourceWidth() {return m_iSourceWidth; } 114 115 Int getSourceHeight() {return m_iSourceHeight; } 116 Int getSourceHeightOrg() {return m_iSourceHeightOrg; } 115 117 Int getConformanceMode() { return m_conformanceMode; } 116 118 Int* getPad() {return m_aiPad; } -
branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncTop.cpp
r427 r431 888 888 } 889 889 890 Void TAppEncTop::xInitLib( )890 Void TAppEncTop::xInitLib(Bool isFieldCoding) 891 891 { 892 892 #if SVC_EXTENSION 893 893 for(UInt layer=0; layer<m_numLayers; layer++) 894 894 { 895 m_acTEncTop[layer].init( );895 m_acTEncTop[layer].init(isFieldCoding); 896 896 } 897 897 #if VPS_RENAME … … 1091 1091 vps->setExtensionOffset( 0xffff ); 1092 1092 #endif 1093 #else 1094 m_cTEncTop.init( );1095 #endif 1093 #else //SVC_EXTENSION 1094 m_cTEncTop.init(isFieldCoding); 1095 #endif //SVC_EXTENSION 1096 1096 } 1097 1097 … … 1124 1124 xInitLibCfg(); 1125 1125 xCreateLib(); 1126 xInitLib( );1126 xInitLib(m_isField); 1127 1127 1128 1128 // main encoder loop … … 1136 1136 // allocate original YUV buffer 1137 1137 pcPicYuvOrg[layer] = new TComPicYuv; 1138 if( m_isField ) 1139 { 1138 1140 #if SVC_UPSAMPLING 1139 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1140 #else 1141 pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 1142 #endif 1141 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1142 #else 1143 pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 1144 #endif 1145 } 1146 else 1147 { 1148 #if SVC_UPSAMPLING 1149 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1150 #else 1151 pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 1152 #endif 1153 } 1143 1154 } 1144 1155 … … 1182 1193 m_iFrameRcvd++; 1183 1194 // check end of file 1184 bEos = (m_i FrameRcvd == m_framesToBeEncoded);1195 bEos = (m_isField && (m_iFrameRcvd == (m_framesToBeEncoded >> 1) )) || ( !m_isField && (m_iFrameRcvd == m_framesToBeEncoded) ); 1185 1196 } 1186 1197 1187 m_acTEncTop[layer].encodePrep( pcPicYuvOrg[layer] ); 1198 if ( m_isField ) 1199 { 1200 m_acTEncTop[layer].encodePrep( pcPicYuvOrg[layer], m_isTopFieldFirst ); 1201 } 1202 else 1203 { 1204 m_acTEncTop[layer].encodePrep( pcPicYuvOrg[layer] ); 1205 } 1188 1206 } 1189 1207 … … 1232 1250 { 1233 1251 // call encoding function for one frame 1234 m_acTEncTop[layer].encode( flush ? 0 : pcPicYuvOrg[layer], m_acListPicYuvRec[layer], outputAccessUnits, iPicIdInGOP ); 1252 if ( m_isField ) 1253 { 1254 m_acTEncTop[layer].encode( flush ? 0 : pcPicYuvOrg[layer], m_acListPicYuvRec[layer], outputAccessUnits, iPicIdInGOP, m_isTopFieldFirst ); 1255 } 1256 else 1257 { 1258 m_acTEncTop[layer].encode( flush ? 0 : pcPicYuvOrg[layer], m_acListPicYuvRec[layer], outputAccessUnits, iPicIdInGOP ); 1259 } 1235 1260 } 1236 1261 } … … 1269 1294 if (bEos) 1270 1295 { 1271 printOutSummary( );1296 printOutSummary(m_isTopFieldFirst); 1272 1297 } 1273 1298 … … 1301 1326 } 1302 1327 1303 Void TAppEncTop::printOutSummary( )1328 Void TAppEncTop::printOutSummary(Bool isField) 1304 1329 { 1305 1330 UInt layer; … … 1308 1333 for(layer = 0; layer < m_numLayers; layer++) 1309 1334 { 1310 m_gcAnalyzeAll[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate()); 1311 m_gcAnalyzeI[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() ); 1312 m_gcAnalyzeP[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() ); 1313 m_gcAnalyzeB[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() ); 1335 if(isField) 1336 { 1337 m_gcAnalyzeAll[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate()); 1338 m_gcAnalyzeI[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() ); 1339 m_gcAnalyzeP[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() ); 1340 m_gcAnalyzeB[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() ); 1341 } 1342 else 1343 { 1344 m_gcAnalyzeAll[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() * 2); 1345 m_gcAnalyzeI[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() * 2 ); 1346 m_gcAnalyzeP[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() * 2 ); 1347 m_gcAnalyzeB[layer].setFrmRate( m_acLayerCfg[layer].getFrameRate() * 2 ); 1348 } 1314 1349 } 1315 1350 … … 1342 1377 m_gcAnalyzeB[layer].printOut('b', layer); 1343 1378 } 1379 1380 if(isField) 1381 { 1382 for(layer = 0; layer < m_numLayers; layer++) 1383 { 1384 //-- interlaced summary 1385 m_gcAnalyzeAll_in.setFrmRate( m_acLayerCfg[layer].getFrameRate()); 1386 printf( "\n\nSUMMARY INTERLACED ---------------------------------------------\n" ); 1387 m_gcAnalyzeAll_in.printOutInterlaced('a', m_gcAnalyzeAll[layer].getBits()); 1388 1389 #if _SUMMARY_OUT_ 1390 m_gcAnalyzeAll_in.printSummaryOutInterlaced(); 1391 #endif 1392 } 1393 } 1344 1394 } 1345 1395 … … 1360 1410 xInitLibCfg(); 1361 1411 xCreateLib(); 1362 xInitLib( );1412 xInitLib(m_isField); 1363 1413 1364 1414 // main encoder loop … … 1369 1419 1370 1420 // allocate original YUV buffer 1371 pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 1421 if( m_isField ) 1422 { 1423 pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeightOrg, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 1424 } 1425 else 1426 { 1427 pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 1428 } 1372 1429 1373 1430 while ( !bEos ) … … 1382 1439 m_iFrameRcvd++; 1383 1440 1384 bEos = (m_iFrameRcvd == m_framesToBeEncoded); 1385 1441 bEos = (m_isField && (m_iFrameRcvd == (m_framesToBeEncoded >> 1) )) || ( !m_isField && (m_iFrameRcvd == m_framesToBeEncoded) ); 1386 1442 Bool flush = 0; 1387 1443 // if end of file (which is only detected on a read failure) flush the encoder of any queued pictures … … 1395 1451 1396 1452 // call encoding function for one frame 1453 if ( m_isField ) 1454 { 1455 m_cTEncTop.encode( bEos, flush ? 0 : pcPicYuvOrg, m_cListPicYuvRec, outputAccessUnits, iNumEncoded, m_isTopFieldFirst); 1456 } 1457 else 1458 { 1397 1459 m_cTEncTop.encode( bEos, flush ? 0 : pcPicYuvOrg, m_cListPicYuvRec, outputAccessUnits, iNumEncoded ); 1460 } 1398 1461 1399 1462 // write bistream to file if necessary … … 1405 1468 } 1406 1469 1407 m_cTEncTop.printSummary( );1470 m_cTEncTop.printSummary(m_isField); 1408 1471 1409 1472 // delete original YUV buffer … … 1479 1542 Void TAppEncTop::xWriteRecon(UInt layer, Int iNumEncoded) 1480 1543 { 1481 Int i; 1482 1483 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_acListPicYuvRec[layer].end(); 1484 1485 for ( i = 0; i < iNumEncoded; i++ ) 1486 { 1487 --iterPicYuvRec; 1488 } 1489 1490 for ( i = 0; i < iNumEncoded; i++ ) 1491 { 1492 TComPicYuv* pcPicYuvRec = *(iterPicYuvRec++); 1544 if (m_isField) 1545 { 1546 //Reinterlace fields 1547 Int i; 1548 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_acListPicYuvRec[layer].end(); 1549 1550 for ( i = 0; i < iNumEncoded; i++ ) 1551 { 1552 --iterPicYuvRec; 1553 } 1554 1555 for ( i = 0; i < iNumEncoded/2; i++ ) 1556 { 1557 TComPicYuv* pcPicYuvRecTop = *(iterPicYuvRec++); 1558 TComPicYuv* pcPicYuvRecBottom = *(iterPicYuvRec++); 1559 1493 1560 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1494 if (!m_acLayerCfg[layer].getReconFile().empty() && pcPicYuvRec->isReconstructed()) 1495 #else 1496 if (!m_acLayerCfg[layer].getReconFile().empty()) 1497 #endif 1498 { 1499 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(), 1500 m_acLayerCfg[layer].getConfTop(), m_acLayerCfg[layer].getConfBottom() ); 1561 if (!m_acLayerCfg[layer].getReconFile().empty() && pcPicYuvRecTop->isReconstructed() && pcPicYuvRecBottom->isReconstructed()) 1562 #else 1563 if (!m_acLayerCfg[layer].getReconFile().empty()) 1564 #endif 1565 { 1566 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(), m_acLayerCfg[layer].getConfTop(), m_acLayerCfg[layer].getConfBottom(), m_isTopFieldFirst ); 1567 } 1568 } 1569 } 1570 else 1571 { 1572 Int i; 1573 1574 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_acListPicYuvRec[layer].end(); 1575 1576 for ( i = 0; i < iNumEncoded; i++ ) 1577 { 1578 --iterPicYuvRec; 1579 } 1580 1581 for ( i = 0; i < iNumEncoded; i++ ) 1582 { 1583 TComPicYuv* pcPicYuvRec = *(iterPicYuvRec++); 1584 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1585 if (!m_acLayerCfg[layer].getReconFile().empty() && pcPicYuvRec->isReconstructed()) 1586 #else 1587 if (!m_acLayerCfg[layer].getReconFile().empty()) 1588 #endif 1589 { 1590 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(), 1591 m_acLayerCfg[layer].getConfTop(), m_acLayerCfg[layer].getConfBottom() ); 1592 } 1501 1593 } 1502 1594 } … … 1505 1597 Void TAppEncTop::xWriteStream(std::ostream& bitstreamFile, Int iNumEncoded, const std::list<AccessUnit>& accessUnits) 1506 1598 { 1507 Int i; 1508 1509 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); 1599 if (m_isField) 1600 { 1601 //Reinterlace fields 1602 Int i; 1603 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); 1510 1604 1511 1605 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1512 for ( i = 0; i < iNumEncoded && iterBitstream != accessUnits.end(); i++ ) 1513 #else 1514 for ( i = 0; i < iNumEncoded; i++ ) 1515 #endif 1516 { 1517 const AccessUnit& au = *(iterBitstream++); 1518 const vector<UInt>& stats = writeAnnexB(bitstreamFile, au); 1519 rateStatsAccum(au, stats); 1606 for ( i = 0; i < iNumEncoded/2 && iterBitstream != accessUnits.end(); i++ ) 1607 #else 1608 for ( i = 0; i < iNumEncoded/2; i++ ) 1609 #endif 1610 { 1611 const AccessUnit& auTop = *(iterBitstream++); 1612 const vector<UInt>& statsTop = writeAnnexB(bitstreamFile, auTop); 1613 rateStatsAccum(auTop, statsTop); 1614 1615 const AccessUnit& auBottom = *(iterBitstream++); 1616 const vector<UInt>& statsBottom = writeAnnexB(bitstreamFile, auBottom); 1617 rateStatsAccum(auBottom, statsBottom); 1618 } 1619 } 1620 else 1621 { 1622 Int i; 1623 1624 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); 1625 1626 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1627 for ( i = 0; i < iNumEncoded && iterBitstream != accessUnits.end(); i++ ) 1628 #else 1629 for ( i = 0; i < iNumEncoded; i++ ) 1630 #endif 1631 { 1632 const AccessUnit& au = *(iterBitstream++); 1633 const vector<UInt>& stats = writeAnnexB(bitstreamFile, au); 1634 rateStatsAccum(au, stats); 1635 } 1520 1636 } 1521 1637 } … … 1561 1677 Void TAppEncTop::xWriteOutput(std::ostream& bitstreamFile, Int iNumEncoded, const std::list<AccessUnit>& accessUnits) 1562 1678 { 1563 Int i; 1564 1565 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.end(); 1566 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); 1567 1568 for ( i = 0; i < iNumEncoded; i++ ) 1569 { 1570 --iterPicYuvRec; 1571 } 1572 1573 for ( i = 0; i < iNumEncoded; i++ ) 1574 { 1575 TComPicYuv* pcPicYuvRec = *(iterPicYuvRec++); 1576 if (m_pchReconFile) 1577 { 1679 if (m_isField) 1680 { 1681 //Reinterlace fields 1682 Int i; 1683 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.end(); 1684 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); 1685 1686 for ( i = 0; i < iNumEncoded; i++ ) 1687 { 1688 --iterPicYuvRec; 1689 } 1690 1691 for ( i = 0; i < iNumEncoded/2; i++ ) 1692 { 1693 TComPicYuv* pcPicYuvRecTop = *(iterPicYuvRec++); 1694 TComPicYuv* pcPicYuvRecBottom = *(iterPicYuvRec++); 1695 1696 if (m_pchReconFile) 1697 { 1698 m_cTVideoIOYuvReconFile.write( pcPicYuvRecTop, pcPicYuvRecBottom, m_confLeft, m_confRight, m_confTop, m_confBottom, m_isTopFieldFirst ); 1699 } 1700 1701 const AccessUnit& auTop = *(iterBitstream++); 1702 const vector<UInt>& statsTop = writeAnnexB(bitstreamFile, auTop); 1703 rateStatsAccum(auTop, statsTop); 1704 1705 const AccessUnit& auBottom = *(iterBitstream++); 1706 const vector<UInt>& statsBottom = writeAnnexB(bitstreamFile, auBottom); 1707 rateStatsAccum(auBottom, statsBottom); 1708 } 1709 } 1710 else 1711 { 1712 Int i; 1713 1714 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.end(); 1715 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); 1716 1717 for ( i = 0; i < iNumEncoded; i++ ) 1718 { 1719 --iterPicYuvRec; 1720 } 1721 1722 for ( i = 0; i < iNumEncoded; i++ ) 1723 { 1724 TComPicYuv* pcPicYuvRec = *(iterPicYuvRec++); 1725 if (m_pchReconFile) 1726 { 1578 1727 #if SYNTAX_OUTPUT 1579 m_cTVideoIOYuvReconFile.write( pcPicYuvRec, m_confLeft, m_confRight, m_confTop, m_confBottom ); 1580 #endif 1581 } 1582 1583 const AccessUnit& au = *(iterBitstream++); 1584 const vector<UInt>& stats = writeAnnexB(bitstreamFile, au); 1585 rateStatsAccum(au, stats); 1728 m_cTVideoIOYuvReconFile.write( pcPicYuvRec, m_confLeft, m_confRight, m_confTop, m_confBottom ); 1729 #endif 1730 } 1731 1732 const AccessUnit& au = *(iterBitstream++); 1733 const vector<UInt>& stats = writeAnnexB(bitstreamFile, au); 1734 rateStatsAccum(au, stats); 1735 } 1586 1736 } 1587 1737 } … … 1602 1752 case NAL_UNIT_CODED_SLICE_TRAIL_R: 1603 1753 case NAL_UNIT_CODED_SLICE_TRAIL_N: 1604 case NAL_UNIT_CODED_SLICE_T SA_R:1754 case NAL_UNIT_CODED_SLICE_TLA_R: 1605 1755 case NAL_UNIT_CODED_SLICE_TSA_N: 1606 1756 case NAL_UNIT_CODED_SLICE_STSA_R: -
branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncTop.h
r313 r431 82 82 Void xCreateLib (); ///< create files & encoder class 83 83 Void xInitLibCfg (); ///< initialize internal variables 84 Void xInitLib ( );///< initialize encoder class84 Void xInitLib (Bool isFieldCoding); ///< initialize encoder class 85 85 Void xDestroyLib (); ///< destroy encoder class 86 86 … … 99 99 Void xWriteRecon(UInt layer, Int iNumEncoded); 100 100 Void xWriteStream(std::ostream& bitstreamFile, Int iNumEncoded, const std::list<AccessUnit>& accessUnits); 101 Void printOutSummary( );101 Void printOutSummary(Bool isField); 102 102 #else 103 103 Void xWriteOutput(std::ostream& bitstreamFile, Int iNumEncoded, const std::list<AccessUnit>& accessUnits); ///< write bitstream to file
Note: See TracChangeset for help on using the changeset viewer.