Changeset 823 in SHVCSoftware for branches/SHM-dev/source/App/TAppEncoder
- Timestamp:
- 9 Jul 2014, 03:42:42 (10 years ago)
- Location:
- branches/SHM-dev/source/App/TAppEncoder
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r820 r823 70 70 #endif 71 71 , m_maxTidRefPresentFlag(1) 72 , m_pColumnWidth()73 , m_pRowHeight()74 72 , m_scalingListFile() 75 73 , m_elRapSliceBEnabled(0) … … 87 85 , m_pchReconFile() 88 86 , m_pchdQPFile() 89 , m_pColumnWidth()90 , m_pRowHeight()91 87 , m_scalingListFile() 92 88 { … … 129 125 free(m_pchdQPFile); 130 126 #endif 131 free(m_pColumnWidth);132 free(m_pRowHeight);133 127 free(m_scalingListFile); 134 128 } … … 519 513 string cfg_dQPFile; 520 514 #endif //SVC_EXTENSION 521 string cfg _ColumnWidth;522 string cfg _RowHeight;515 string cfgColumnWidth; 516 string cfgRowHeight; 523 517 string cfg_ScalingListFile; 524 518 string cfg_startOfCodedInterval; … … 648 642 ("ChromaFormatIDC,-cf", tmpChromaFormat, 0, "ChromaFormatIDC (400|420|422|444 or set 0 (default) for same as InputChromaFormat)") 649 643 #endif 650 ("ConformanceMode", m_conformanceMode, 0, "Window conformance mode (0: no window, 1:automatic padding, 2:padding, 3:conformance") 651 ("HorizontalPadding,-pdx",m_aiPad[0], 0, "Horizontal source padding for conformance window mode 2") 652 ("VerticalPadding,-pdy", m_aiPad[1], 0, "Vertical source padding for conformance window mode 2") 653 ("ConfLeft", m_confLeft, 0, "Left offset for window conformance mode 3") 654 ("ConfRight", m_confRight, 0, "Right offset for window conformance mode 3") 655 ("ConfTop", m_confTop, 0, "Top offset for window conformance mode 3") 656 ("ConfBottom", m_confBottom, 0, "Bottom offset for window conformance mode 3") 644 ("ConformanceMode", m_conformanceWindowMode, 0, "Deprecated alias of ConformanceWindowMode") 645 ("ConformanceWindowMode", m_conformanceWindowMode, 0, "Window conformance mode (0: no window, 1:automatic padding, 2:padding, 3:conformance") 646 ("HorizontalPadding,-pdx",m_aiPad[0], 0, "Horizontal source padding for conformance window mode 2") 647 ("VerticalPadding,-pdy", m_aiPad[1], 0, "Vertical source padding for conformance window mode 2") 648 ("ConfLeft", m_confWinLeft, 0, "Deprecated alias of ConfWinLeft") 649 ("ConfRight", m_confWinRight, 0, "Deprecated alias of ConfWinRight") 650 ("ConfTop", m_confWinTop, 0, "Deprecated alias of ConfWinTop") 651 ("ConfBottom", m_confWinBottom, 0, "Deprecated alias of ConfWinBottom") 652 ("ConfWinLeft", m_confWinLeft, 0, "Left offset for window conformance mode 3") 653 ("ConfWinRight", m_confWinRight, 0, "Right offset for window conformance mode 3") 654 ("ConfWinTop", m_confWinTop, 0, "Top offset for window conformance mode 3") 655 ("ConfWinBottom", m_confWinBottom, 0, "Bottom offset for window conformance mode 3") 657 656 ("FrameRate,-fr", m_iFrameRate, 0, "Frame rate") 658 657 #endif //SVC_EXTENSION … … 815 814 ("WeightedPredB,-wpB", m_useWeightedBiPred, false, "Use weighted (bidirectional) prediction in B slices") 816 815 ("Log2ParallelMergeLevel", m_log2ParallelMergeLevel, 2u, "Parallel merge estimation region") 817 ("UniformSpacingIdc", m_iUniformSpacingIdr, 0, "Indicates if the column and row boundaries are distributed uniformly") 818 ("NumTileColumnsMinus1", m_iNumColumnsMinus1, 0, "Number of columns in a picture minus 1") 819 ("ColumnWidthArray", cfg_ColumnWidth, string(""), "Array containing ColumnWidth values in units of LCU") 820 ("NumTileRowsMinus1", m_iNumRowsMinus1, 0, "Number of rows in a picture minus 1") 821 ("RowHeightArray", cfg_RowHeight, string(""), "Array containing RowHeight values in units of LCU") 816 817 //deprecated copies of renamed tile parameters 818 ("UniformSpacingIdc", m_tileUniformSpacingFlag, false, "deprecated alias of TileUniformSpacing") 819 ("ColumnWidthArray", cfgColumnWidth, string(""), "deprecated alias of TileColumnWidthArray") 820 ("RowHeightArray", cfgRowHeight, string(""), "deprecated alias of TileRowHeightArray") 821 822 ("TileUniformSpacing", m_tileUniformSpacingFlag, false, "Indicates that tile columns and rows are distributed uniformly") 823 ("NumTileColumnsMinus1", m_numTileColumnsMinus1, 0, "Number of tile columns in a picture minus 1") 824 ("NumTileRowsMinus1", m_numTileRowsMinus1, 0, "Number of rows in a picture minus 1") 825 ("TileColumnWidthArray", cfgColumnWidth, string(""), "Array containing tile column width values in units of LCU") 826 ("TileRowHeightArray", cfgRowHeight, string(""), "Array containing tile row height values in units of LCU") 822 827 ("LFCrossTileBoundaryFlag", m_bLFCrossTileBoundaryFlag, true, "1: cross-tile-boundary loop filtering. 0:non-cross-tile-boundary loop filtering") 823 828 ("WaveFrontSynchro", m_iWaveFrontSynchro, 0, "0: no synchro; 1 synchro with TR; 2 TRR etc") … … 878 883 ("ColourDescriptionPresent", m_colourDescriptionPresentFlag, false, "Signals whether colour_primaries, transfer_characteristics and matrix_coefficients are present") 879 884 ("ColourPrimaries", m_colourPrimaries, 2, "Indicates chromaticity coordinates of the source primaries") 880 ("TransferChara teristics",m_transferCharacteristics, 2, "Indicates the opto-electronic transfer characteristics of the source")885 ("TransferCharacteristics", m_transferCharacteristics, 2, "Indicates the opto-electronic transfer characteristics of the source") 881 886 ("MatrixCoefficients", m_matrixCoefficients, 2, "Describes the matrix coefficients used in deriving luma and chroma from RGB primaries") 882 887 ("ChromaLocInfoPresent", m_chromaLocInfoPresentFlag, false, "Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present") … … 1096 1101 #endif //SVC_EXTENSION 1097 1102 1098 Char* pColumnWidth = cfg_ColumnWidth.empty() ? NULL: strdup(cfg_ColumnWidth.c_str()); 1099 Char* pRowHeight = cfg_RowHeight.empty() ? NULL : strdup(cfg_RowHeight.c_str()); 1100 if( m_iUniformSpacingIdr == 0 && m_iNumColumnsMinus1 > 0 ) 1101 { 1102 char *columnWidth; 1103 Char* pColumnWidth = cfgColumnWidth.empty() ? NULL: strdup(cfgColumnWidth.c_str()); 1104 Char* pRowHeight = cfgRowHeight.empty() ? NULL : strdup(cfgRowHeight.c_str()); 1105 1106 if( !m_tileUniformSpacingFlag && m_numTileColumnsMinus1 > 0 ) 1107 { 1108 char *str; 1103 1109 int i=0; 1104 m_ pColumnWidth = new UInt[m_iNumColumnsMinus1];1105 columnWidth= strtok(pColumnWidth, " ,-");1106 while( columnWidth!=NULL)1107 { 1108 if( i >=m_iNumColumnsMinus1 )1110 m_tileColumnWidth.resize( m_numTileColumnsMinus1 ); 1111 str = strtok(pColumnWidth, " ,-"); 1112 while(str!=NULL) 1113 { 1114 if( i >= m_numTileColumnsMinus1 ) 1109 1115 { 1110 1116 printf( "The number of columns whose width are defined is larger than the allowed number of columns.\n" ); 1111 1117 exit( EXIT_FAILURE ); 1112 1118 } 1113 *( m_pColumnWidth + i ) = atoi( columnWidth);1114 columnWidth= strtok(NULL, " ,-");1119 m_tileColumnWidth[i] = atoi( str ); 1120 str = strtok(NULL, " ,-"); 1115 1121 i++; 1116 1122 } 1117 if( i <m_iNumColumnsMinus1 )1123 if( i < m_numTileColumnsMinus1 ) 1118 1124 { 1119 1125 printf( "The width of some columns is not defined.\n" ); … … 1123 1129 else 1124 1130 { 1125 m_ pColumnWidth = NULL;1126 } 1127 1128 if( m_iUniformSpacingIdr == 0 && m_iNumRowsMinus1 > 0 )1129 { 1130 char * rowHeight;1131 m_tileColumnWidth.clear(); 1132 } 1133 1134 if( !m_tileUniformSpacingFlag && m_numTileRowsMinus1 > 0 ) 1135 { 1136 char *str; 1131 1137 int i=0; 1132 m_ pRowHeight = new UInt[m_iNumRowsMinus1];1133 rowHeight= strtok(pRowHeight, " ,-");1134 while( rowHeight!=NULL)1135 { 1136 if( i>=m_ iNumRowsMinus1 )1138 m_tileRowHeight.resize(m_numTileRowsMinus1); 1139 str = strtok(pRowHeight, " ,-"); 1140 while(str!=NULL) 1141 { 1142 if( i>=m_numTileRowsMinus1 ) 1137 1143 { 1138 1144 printf( "The number of rows whose height are defined is larger than the allowed number of rows.\n" ); 1139 1145 exit( EXIT_FAILURE ); 1140 1146 } 1141 *( m_pRowHeight + i ) = atoi( rowHeight);1142 rowHeight= strtok(NULL, " ,-");1147 m_tileRowHeight[i] = atoi( str ); 1148 str = strtok(NULL, " ,-"); 1143 1149 i++; 1144 1150 } 1145 if( i <m_iNumRowsMinus1 )1151 if( i < m_numTileRowsMinus1 ) 1146 1152 { 1147 1153 printf( "The height of some rows is not defined.\n" ); … … 1151 1157 else 1152 1158 { 1153 m_ pRowHeight = NULL;1159 m_tileRowHeight.clear(); 1154 1160 } 1155 1161 #if SVC_EXTENSION … … 1433 1439 #if !SVC_EXTENSION 1434 1440 // TODO:ChromaFmt assumes 4:2:0 below 1435 switch (m_conformance Mode)1441 switch (m_conformanceWindowMode) 1436 1442 { 1437 1443 case 0: 1438 1444 { 1439 1445 // no conformance or padding 1440 m_conf Left = m_confRight = m_confTop = m_confBottom = 0;1446 m_confWinLeft = m_confWinRight = m_confWinTop = m_confWinBottom = 0; 1441 1447 m_aiPad[1] = m_aiPad[0] = 0; 1442 1448 break; … … 1448 1454 if (m_iSourceWidth % minCuSize) 1449 1455 { 1450 m_aiPad[0] = m_conf Right = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth;1451 m_iSourceWidth += m_conf Right;1456 m_aiPad[0] = m_confWinRight = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth; 1457 m_iSourceWidth += m_confWinRight; 1452 1458 } 1453 1459 if (m_iSourceHeight % minCuSize) 1454 1460 { 1455 m_aiPad[1] = m_conf Bottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight;1456 m_iSourceHeight += m_conf Bottom;1461 m_aiPad[1] = m_confWinBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight; 1462 m_iSourceHeight += m_confWinBottom; 1457 1463 if ( m_isField ) 1458 1464 { 1459 m_iSourceHeightOrg += m_conf Bottom << 1;1460 m_aiPad[1] = m_conf Bottom << 1;1465 m_iSourceHeightOrg += m_confWinBottom << 1; 1466 m_aiPad[1] = m_confWinBottom << 1; 1461 1467 } 1462 1468 } … … 1478 1484 m_iSourceWidth += m_aiPad[0]; 1479 1485 m_iSourceHeight += m_aiPad[1]; 1480 m_conf Right = m_aiPad[0];1481 m_conf Bottom = m_aiPad[1];1486 m_confWinRight = m_aiPad[0]; 1487 m_confWinBottom = m_aiPad[1]; 1482 1488 break; 1483 1489 } … … 1485 1491 { 1486 1492 // conformance 1487 if ((m_conf Left == 0) && (m_confRight == 0) && (m_confTop == 0) && (m_confBottom == 0))1493 if ((m_confWinLeft == 0) && (m_confWinRight == 0) && (m_confWinTop == 0) && (m_confWinBottom == 0)) 1488 1494 { 1489 1495 fprintf(stderr, "Warning: Conformance window enabled, but all conformance window parameters set to zero\n"); … … 1623 1629 if (m_interLayerConstrainedTileSetsSEIEnabled) 1624 1630 { 1625 if (m_ iNumColumnsMinus1 == 0 && m_iNumRowsMinus1 == 0)1631 if (m_numTileColumnsMinus1 == 0 && m_numTileRowsMinus1 == 0) 1626 1632 { 1627 1633 printf( "Tiles are not defined (needed for inter-layer comnstrained tile sets SEI).\n" ); … … 1828 1834 } 1829 1835 1830 Bool tileFlag = (m_ iNumColumnsMinus1 > 0 || m_iNumRowsMinus1 > 0 );1836 Bool tileFlag = (m_numTileColumnsMinus1 > 0 || m_numTileRowsMinus1 > 0 ); 1831 1837 xConfirmPara( tileFlag && m_iWaveFrontSynchro, "Tile and Wavefront can not be applied together"); 1832 1838 … … 1839 1845 xConfirmPara( m_aiPad[1] % TComSPS::getWinUnitY(CHROMA_420) != 0, "Vertical padding must be an integer multiple of the specified chroma subsampling"); 1840 1846 1841 xConfirmPara( m_confLeft % TComSPS::getWinUnitX(CHROMA_420) != 0, "Left conformance window offset must be an integer multiple of the specified chroma subsampling"); 1842 xConfirmPara( m_confRight % TComSPS::getWinUnitX(CHROMA_420) != 0, "Right conformance window offset must be an integer multiple of the specified chroma subsampling"); 1843 xConfirmPara( m_confTop % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling"); 1844 xConfirmPara( m_confBottom % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling"); 1847 xConfirmPara( m_confWinLeft % TComSPS::getWinUnitX(CHROMA_420) != 0, "Left conformance window offset must be an integer multiple of the specified chroma subsampling"); 1848 xConfirmPara( m_confWinRight % TComSPS::getWinUnitX(CHROMA_420) != 0, "Right conformance window offset must be an integer multiple of the specified chroma subsampling"); 1849 xConfirmPara( m_confWinTop % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling"); 1850 xConfirmPara( m_confWinBottom % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling"); 1851 1852 xConfirmPara( m_defaultDisplayWindowFlag && !m_vuiParametersPresentFlag, "VUI needs to be enabled for default display window"); 1853 1854 if (m_defaultDisplayWindowFlag) 1855 { 1856 xConfirmPara( m_defDispWinLeftOffset % TComSPS::getWinUnitX(CHROMA_420) != 0, "Left default display window offset must be an integer multiple of the specified chroma subsampling"); 1857 xConfirmPara( m_defDispWinRightOffset % TComSPS::getWinUnitX(CHROMA_420) != 0, "Right default display window offset must be an integer multiple of the specified chroma subsampling"); 1858 xConfirmPara( m_defDispWinTopOffset % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top default display window offset must be an integer multiple of the specified chroma subsampling"); 1859 xConfirmPara( m_defDispWinBottomOffset % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom default display window offset must be an integer multiple of the specified chroma subsampling"); 1860 } 1845 1861 #endif 1846 1862 … … 2594 2610 Int widthInCU = (m_iSourceWidth % m_uiMaxCUWidth) ? m_iSourceWidth/m_uiMaxCUWidth + 1: m_iSourceWidth/m_uiMaxCUWidth; 2595 2611 Int heightInCU = (m_iSourceHeight % m_uiMaxCUHeight) ? m_iSourceHeight/m_uiMaxCUHeight + 1: m_iSourceHeight/m_uiMaxCUHeight; 2596 if(m_ iUniformSpacingIdr)2597 { 2598 maxTileWidth = m_uiMaxCUWidth*((widthInCU+m_ iNumColumnsMinus1)/(m_iNumColumnsMinus1+1));2599 maxTileHeight = m_uiMaxCUHeight*((heightInCU+m_ iNumRowsMinus1)/(m_iNumRowsMinus1+1));2612 if(m_tileUniformSpacingFlag) 2613 { 2614 maxTileWidth = m_uiMaxCUWidth*((widthInCU+m_numTileColumnsMinus1)/(m_numTileColumnsMinus1+1)); 2615 maxTileHeight = m_uiMaxCUHeight*((heightInCU+m_numTileRowsMinus1)/(m_numTileRowsMinus1+1)); 2600 2616 // if only the last tile-row is one treeblock higher than the others 2601 2617 // the maxTileHeight becomes smaller if the last row of treeblocks has lower height than the others 2602 if(!((heightInCU-1)%(m_ iNumRowsMinus1+1)))2618 if(!((heightInCU-1)%(m_numTileRowsMinus1+1))) 2603 2619 { 2604 2620 maxTileHeight = maxTileHeight - m_uiMaxCUHeight + (m_iSourceHeight % m_uiMaxCUHeight); … … 2606 2622 // if only the last tile-column is one treeblock wider than the others 2607 2623 // the maxTileWidth becomes smaller if the last column of treeblocks has lower width than the others 2608 if(!((widthInCU-1)%(m_ iNumColumnsMinus1+1)))2624 if(!((widthInCU-1)%(m_numTileColumnsMinus1+1))) 2609 2625 { 2610 2626 maxTileWidth = maxTileWidth - m_uiMaxCUWidth + (m_iSourceWidth % m_uiMaxCUWidth); … … 2613 2629 else // not uniform spacing 2614 2630 { 2615 if(m_ iNumColumnsMinus1<1)2631 if(m_numTileColumnsMinus1<1) 2616 2632 { 2617 2633 maxTileWidth = m_iSourceWidth; … … 2620 2636 { 2621 2637 Int accColumnWidth = 0; 2622 for(Int col=0; col<(m_ iNumColumnsMinus1); col++)2638 for(Int col=0; col<(m_numTileColumnsMinus1); col++) 2623 2639 { 2624 maxTileWidth = m_ pColumnWidth[col]>maxTileWidth ? m_pColumnWidth[col]:maxTileWidth;2625 accColumnWidth += m_ pColumnWidth[col];2640 maxTileWidth = m_tileColumnWidth[col]>maxTileWidth ? m_tileColumnWidth[col]:maxTileWidth; 2641 accColumnWidth += m_tileColumnWidth[col]; 2626 2642 } 2627 2643 maxTileWidth = (widthInCU-accColumnWidth)>maxTileWidth ? m_uiMaxCUWidth*(widthInCU-accColumnWidth):m_uiMaxCUWidth*maxTileWidth; 2628 2644 } 2629 if(m_ iNumRowsMinus1<1)2645 if(m_numTileRowsMinus1<1) 2630 2646 { 2631 2647 maxTileHeight = m_iSourceHeight; … … 2634 2650 { 2635 2651 Int accRowHeight = 0; 2636 for(Int row=0; row<(m_ iNumRowsMinus1); row++)2652 for(Int row=0; row<(m_numTileRowsMinus1); row++) 2637 2653 { 2638 maxTileHeight = m_ pRowHeight[row]>maxTileHeight ? m_pRowHeight[row]:maxTileHeight;2639 accRowHeight += m_ pRowHeight[row];2654 maxTileHeight = m_tileRowHeight[row]>maxTileHeight ? m_tileRowHeight[row]:maxTileHeight; 2655 accRowHeight += m_tileRowHeight[row]; 2640 2656 } 2641 2657 maxTileHeight = (heightInCU-accRowHeight)>maxTileHeight ? m_uiMaxCUHeight*(heightInCU-accRowHeight):m_uiMaxCUHeight*maxTileHeight; … … 2933 2949 printf("Bitstream File : %s\n", m_pchBitstreamFile ); 2934 2950 printf("Reconstruction File : %s\n", m_pchReconFile ); 2935 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_conf Left - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate );2951 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_confWinLeft - m_confWinRight, m_iSourceHeight - m_confWinTop - m_confWinBottom, m_iFrameRate ); 2936 2952 printf("Internal Format : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate ); 2937 2953 #endif //SVC_EXTENSION -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
r820 r823 46 46 #endif 47 47 #include <sstream> 48 #include <vector> 48 49 //! \ingroup TAppEncoder 49 50 //! \{ … … 93 94 94 95 95 Int m_conformance Mode;96 Int m_conf Left;97 Int m_conf Right;98 Int m_conf Top;99 Int m_conf Bottom;96 Int m_conformanceWindowMode; 97 Int m_confWinLeft; 98 Int m_confWinRight; 99 Int m_confWinTop; 100 Int m_confWinBottom; 100 101 Int m_framesToBeEncoded; ///< number of encoded frames 101 102 Int m_aiPad[2]; ///< number of padded pixels for width and height … … 240 241 Bool m_bLFCrossSliceBoundaryFlag; ///< 1: filter across slice boundaries 0: do not filter across slice boundaries 241 242 Bool m_bLFCrossTileBoundaryFlag; ///< 1: filter across tile boundaries 0: do not filter across tile boundaries 242 Int m_iUniformSpacingIdr; 243 Int m_iNumColumnsMinus1; 244 Char* m_pchColumnWidth; 245 Int m_iNumRowsMinus1; 246 Char* m_pchRowHeight; 247 UInt* m_pColumnWidth; 248 UInt* m_pRowHeight; 243 Bool m_tileUniformSpacingFlag; 244 Int m_numTileColumnsMinus1; 245 Int m_numTileRowsMinus1; 246 std::vector<Int> m_tileColumnWidth; 247 std::vector<Int> m_tileRowHeight; 249 248 Int m_iWaveFrontSynchro; //< 0: no WPP. >= 1: WPP is enabled, the "Top right" from which inheritance occurs is this LCU offset in the line above the current. 250 249 #if !SVC_EXTENSION -
branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r820 r823 50 50 #endif 51 51 { 52 m_conf Left = m_confRight = m_confTop = m_confBottom = 0;52 m_confWinLeft = m_confWinRight = m_confWinTop = m_confWinBottom = 0; 53 53 m_aiPad[1] = m_aiPad[0] = 0; 54 54 m_numScaledRefLayerOffsets = 0; … … 114 114 ("ChromaFormatIDC", tmpChromaFormat, 420, "ChromaFormatIDC (400|420|422|444 or set 0 (default) for same as InputChromaFormat)") 115 115 #endif 116 ("CropLeft", m_confLeft, 0, "Left cropping/padding for cropping mode 3") 117 ("CropRight", m_confRight, 0, "Right cropping/padding for cropping mode 3") 118 ("CropTop", m_confTop, 0, "Top cropping/padding for cropping mode 3") 119 ("CropBottom", m_confBottom, 0, "Bottom cropping/padding for cropping mode 3") 116 ("ConfLeft", m_confWinLeft, 0, "Deprecated alias of ConfWinLeft") 117 ("ConfRight", m_confWinRight, 0, "Deprecated alias of ConfWinRight") 118 ("ConfTop", m_confWinTop, 0, "Deprecated alias of ConfWinTop") 119 ("ConfBottom", m_confWinBottom, 0, "Deprecated alias of ConfWinBottom") 120 ("ConfWinLeft", m_confWinLeft, 0, "Left offset for window conformance mode 3") 121 ("ConfWinRight", m_confWinRight, 0, "Right offset for window conformance mode 3") 122 ("ConfWinTop", m_confWinTop, 0, "Top offset for window conformance mode 3") 123 ("ConfWinBottom", m_confWinBottom, 0, "Bottom offset for window conformance mode 3") 120 124 ("HorizontalPadding,-pdx",m_aiPad[0], 0, "horizontal source padding for cropping mode 2") 121 125 ("VerticalPadding,-pdy", m_aiPad[1], 0, "vertical source padding for cropping mode 2") … … 162 166 printf("Reconstruction File : %s\n", m_cReconFile.c_str() ); 163 167 #if REPN_FORMAT_IN_VPS 164 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - ( m_conf Left + m_confRight ) * TComSPS::getWinUnitX( m_chromaFormatIDC ), m_iSourceHeight - ( m_confTop + m_confBottom ) * TComSPS::getWinUnitY( m_chromaFormatIDC ), m_iFrameRate );168 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - ( m_confWinLeft + m_confWinRight ) * TComSPS::getWinUnitX( m_chromaFormatIDC ), m_iSourceHeight - ( m_confWinTop + m_confWinBottom ) * TComSPS::getWinUnitY( m_chromaFormatIDC ), m_iFrameRate ); 165 169 #else 166 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_conf Left - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate );170 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_confWinLeft - m_confWinRight, m_iSourceHeight - m_confWinTop - m_confWinBottom, m_iFrameRate ); 167 171 #endif 168 172 printf("Internal Format : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate ); … … 207 211 { 208 212 // no cropping or padding 209 m_conf Left = m_confRight = m_confTop = m_confBottom = 0;213 m_confWinLeft = m_confWinRight = m_confWinTop = m_confWinBottom = 0; 210 214 m_aiPad[1] = m_aiPad[0] = 0; 211 215 break; … … 221 225 if (m_iSourceWidth % minCuSize) 222 226 { 223 m_aiPad[0] = m_conf Right = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth;224 m_iSourceWidth += m_conf Right;225 #if REPN_FORMAT_IN_VPS 226 m_conf Right /= TComSPS::getWinUnitX( m_chromaFormatIDC );227 m_aiPad[0] = m_confWinRight = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth; 228 m_iSourceWidth += m_confWinRight; 229 #if REPN_FORMAT_IN_VPS 230 m_confWinRight /= TComSPS::getWinUnitX( m_chromaFormatIDC ); 227 231 #endif 228 232 } 229 233 if (m_iSourceHeight % minCuSize) 230 234 { 231 m_aiPad[1] = m_conf Bottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight;232 m_iSourceHeight += m_conf Bottom;235 m_aiPad[1] = m_confWinBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight; 236 m_iSourceHeight += m_confWinBottom; 233 237 if ( isField ) 234 238 { 235 m_iSourceHeightOrg += m_conf Bottom << 1;236 m_aiPad[1] = m_conf Bottom << 1;239 m_iSourceHeightOrg += m_confWinBottom << 1; 240 m_aiPad[1] = m_confWinBottom << 1; 237 241 } 238 242 #if REPN_FORMAT_IN_VPS 239 m_conf Bottom /= TComSPS::getWinUnitY( m_chromaFormatIDC );243 m_confWinBottom /= TComSPS::getWinUnitY( m_chromaFormatIDC ); 240 244 #endif 241 245 } … … 247 251 m_iSourceWidth += m_aiPad[0]; 248 252 m_iSourceHeight += m_aiPad[1]; 249 m_conf Right = m_aiPad[0];250 m_conf Bottom = m_aiPad[1];251 #if REPN_FORMAT_IN_VPS 252 m_conf Right /= TComSPS::getWinUnitX( m_chromaFormatIDC );253 m_conf Bottom /= TComSPS::getWinUnitY( m_chromaFormatIDC );253 m_confWinRight = m_aiPad[0]; 254 m_confWinBottom = m_aiPad[1]; 255 #if REPN_FORMAT_IN_VPS 256 m_confWinRight /= TComSPS::getWinUnitX( m_chromaFormatIDC ); 257 m_confWinBottom /= TComSPS::getWinUnitY( m_chromaFormatIDC ); 254 258 #endif 255 259 break; … … 258 262 { 259 263 // conformance 260 if ((m_conf Left == 0) && (m_confRight == 0) && (m_confTop == 0) && (m_confBottom == 0))264 if ((m_confWinLeft == 0) && (m_confWinRight == 0) && (m_confWinTop == 0) && (m_confWinBottom == 0)) 261 265 { 262 266 fprintf(stderr, "Warning: Cropping enabled, but all cropping parameters set to zero\n"); -
branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
r820 r823 35 35 Int m_iSourceHeightOrg; ///< original source height in pixel (when interlaced = frame height) 36 36 Int m_conformanceMode; 37 Int m_conf Left;38 Int m_conf Right;39 Int m_conf Top;40 Int m_conf Bottom;37 Int m_confWinLeft; 38 Int m_confWinRight; 39 Int m_confWinTop; 40 Int m_confWinBottom; 41 41 Int m_aiPad[2]; ///< number of padded pixels for width and height 42 42 Int m_iIntraPeriod; ///< period of I-slice (random access period) … … 136 136 Int* getPad() {return m_aiPad; } 137 137 Double getFloatQP() {return m_fQP; } 138 Int getConf Left() {return m_confLeft; }139 Int getConf Right() {return m_confRight; }140 Int getConf Top() {return m_confTop; }141 Int getConf Bottom() {return m_confBottom; }138 Int getConfWinLeft() {return m_confWinLeft; } 139 Int getConfWinRight() {return m_confWinRight; } 140 Int getConfWinTop() {return m_confWinTop; } 141 Int getConfWinBottom() {return m_confWinBottom; } 142 142 #if AUXILIARY_PICTURES 143 143 ChromaFormat getInputChromaFormat() {return m_InputChromaFormat;} -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r820 r823 213 213 m_acTEncTop[layer].setSourceWidth ( m_acLayerCfg[layer].getSourceWidth() ); 214 214 m_acTEncTop[layer].setSourceHeight ( m_acLayerCfg[layer].getSourceHeight() ); 215 m_acTEncTop[layer].setConformanceMode ( m_acLayerCfg[layer].getConformanceMode() ); 216 m_acTEncTop[layer].setConformanceWindow ( m_acLayerCfg[layer].m_confLeft, m_acLayerCfg[layer].m_confRight, m_acLayerCfg[layer].m_confTop, m_acLayerCfg[layer].m_confBottom ); 215 m_acTEncTop[layer].setConformanceWindow ( m_acLayerCfg[layer].m_confWinLeft, m_acLayerCfg[layer].m_confWinRight, m_acLayerCfg[layer].m_confWinTop, m_acLayerCfg[layer].m_confWinBottom ); 217 216 m_acTEncTop[layer].setFramesToBeEncoded ( m_framesToBeEncoded ); 218 217 … … 542 541 m_acTEncTop[layer].setIlcIdc( m_ilcIdc ); 543 542 #endif 544 m_acTEncTop[layer].set UniformSpacingIdr ( m_iUniformSpacingIdr);545 m_acTEncTop[layer].setNumColumnsMinus1 ( m_ iNumColumnsMinus1 );546 m_acTEncTop[layer].setNumRowsMinus1 ( m_ iNumRowsMinus1 );547 if( m_iUniformSpacingIdr==0)548 { 549 m_acTEncTop[layer].setColumnWidth ( m_ pColumnWidth );550 m_acTEncTop[layer].setRowHeight ( m_ pRowHeight );543 m_acTEncTop[layer].setTileUniformSpacingFlag ( m_tileUniformSpacingFlag ); 544 m_acTEncTop[layer].setNumColumnsMinus1 ( m_numTileColumnsMinus1 ); 545 m_acTEncTop[layer].setNumRowsMinus1 ( m_numTileRowsMinus1 ); 546 if(!m_tileUniformSpacingFlag) 547 { 548 m_acTEncTop[layer].setColumnWidth ( m_tileColumnWidth ); 549 m_acTEncTop[layer].setRowHeight ( m_tileRowHeight ); 551 550 } 552 551 m_acTEncTop[layer].xCheckGSParameters(); 553 Int uiTilesCount = (m_iNumRowsMinus1+1) * (m_iNumColumnsMinus1+1);552 Int uiTilesCount = (m_numTileRowsMinus1+1) * (m_numTileColumnsMinus1+1); 554 553 if(uiTilesCount == 1) 555 554 { … … 586 585 m_acTEncTop[layer].setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 587 586 m_acTEncTop[layer].setVuiParametersPresentFlag( m_vuiParametersPresentFlag ); 587 m_acTEncTop[layer].setAspectRatioInfoPresentFlag( m_aspectRatioInfoPresentFlag); 588 588 m_acTEncTop[layer].setAspectRatioIdc( m_aspectRatioIdc ); 589 589 m_acTEncTop[layer].setSarWidth( m_sarWidth ); … … 685 685 m_cTEncTop.setSourceWidth ( m_iSourceWidth ); 686 686 m_cTEncTop.setSourceHeight ( m_iSourceHeight ); 687 m_cTEncTop.setConformanceWindow ( m_conf Left, m_confRight, m_confTop, m_confBottom );687 m_cTEncTop.setConformanceWindow ( m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom ); 688 688 m_cTEncTop.setFramesToBeEncoded ( m_framesToBeEncoded ); 689 689 … … 870 870 m_cTEncTop.setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled ); 871 871 m_cTEncTop.setScalableNestingSEIEnabled( m_scalableNestingSEIEnabled ); 872 m_cTEncTop.set UniformSpacingIdr ( m_iUniformSpacingIdr);873 m_cTEncTop.setNumColumnsMinus1 ( m_ iNumColumnsMinus1 );874 m_cTEncTop.setNumRowsMinus1 ( m_ iNumRowsMinus1 );875 if( m_iUniformSpacingIdr==0)876 { 877 m_cTEncTop.setColumnWidth ( m_ pColumnWidth );878 m_cTEncTop.setRowHeight ( m_ pRowHeight );872 m_cTEncTop.setTileUniformSpacingFlag ( m_tileUniformSpacingFlag ); 873 m_cTEncTop.setNumColumnsMinus1 ( m_numTileColumnsMinus1 ); 874 m_cTEncTop.setNumRowsMinus1 ( m_numTileRowsMinus1 ); 875 if(!m_tileUniformSpacingFlag) 876 { 877 m_cTEncTop.setColumnWidth ( m_tileColumnWidth ); 878 m_cTEncTop.setRowHeight ( m_tileRowHeight ); 879 879 } 880 880 m_cTEncTop.xCheckGSParameters(); 881 Int uiTilesCount = (m_ iNumRowsMinus1+1) * (m_iNumColumnsMinus1+1);881 Int uiTilesCount = (m_numTileRowsMinus1+1) * (m_numTileColumnsMinus1+1); 882 882 if(uiTilesCount == 1) 883 883 { … … 904 904 m_cTEncTop.setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 905 905 m_cTEncTop.setVuiParametersPresentFlag( m_vuiParametersPresentFlag ); 906 m_cTEncTop.setAspectRatioInfoPresentFlag( m_aspectRatioInfoPresentFlag); 906 907 m_cTEncTop.setAspectRatioIdc( m_aspectRatioIdc ); 907 908 m_cTEncTop.setSarWidth( m_sarWidth ); … … 2128 2129 { 2129 2130 #if REPN_FORMAT_IN_VPS 2130 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConf Left() * xScal, m_acLayerCfg[layer].getConfRight() * xScal,2131 m_acLayerCfg[layer].getConf Top() * yScal, m_acLayerCfg[layer].getConfBottom() * yScal, m_isTopFieldFirst );2132 #else 2133 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConf Left(), m_acLayerCfg[layer].getConfRight(), m_acLayerCfg[layer].getConfTop(), m_acLayerCfg[layer].getConfBottom(), m_isTopFieldFirst );2131 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConfWinLeft() * xScal, m_acLayerCfg[layer].getConfWinRight() * xScal, 2132 m_acLayerCfg[layer].getConfWinTop() * yScal, m_acLayerCfg[layer].getConfWinBottom() * yScal, m_isTopFieldFirst ); 2133 #else 2134 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConfWinLeft(), m_acLayerCfg[layer].getConfWinRight(), m_acLayerCfg[layer].getConfWinTop(), m_acLayerCfg[layer].getConfWinBottom(), m_isTopFieldFirst ); 2134 2135 #endif 2135 2136 } … … 2157 2158 { 2158 2159 #if REPN_FORMAT_IN_VPS 2159 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConf Left() * xScal, m_acLayerCfg[layer].getConfRight() * xScal,2160 m_acLayerCfg[layer].getConf Top() * yScal, m_acLayerCfg[layer].getConfBottom() * yScal );2161 #else 2162 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConf Left(), m_acLayerCfg[layer].getConfRight(),2163 m_acLayerCfg[layer].getConf Top(), m_acLayerCfg[layer].getConfBottom() );2160 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfWinLeft() * xScal, m_acLayerCfg[layer].getConfWinRight() * xScal, 2161 m_acLayerCfg[layer].getConfWinTop() * yScal, m_acLayerCfg[layer].getConfWinBottom() * yScal ); 2162 #else 2163 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfWinLeft(), m_acLayerCfg[layer].getConfWinRight(), 2164 m_acLayerCfg[layer].getConfWinTop(), m_acLayerCfg[layer].getConfWinBottom() ); 2164 2165 #endif 2165 2166 } … … 2269 2270 if (m_pchReconFile) 2270 2271 { 2271 m_cTVideoIOYuvReconFile.write( pcPicYuvRecTop, pcPicYuvRecBottom, m_conf Left, m_confRight, m_confTop, m_confBottom, m_isTopFieldFirst );2272 m_cTVideoIOYuvReconFile.write( pcPicYuvRecTop, pcPicYuvRecBottom, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom, m_isTopFieldFirst ); 2272 2273 } 2273 2274 … … 2284 2285 { 2285 2286 Int i; 2286 2287 2287 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.end(); 2288 2288 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); … … 2298 2298 if (m_pchReconFile) 2299 2299 { 2300 m_cTVideoIOYuvReconFile.write( pcPicYuvRec, m_conf Left, m_confRight, m_confTop, m_confBottom );2300 m_cTVideoIOYuvReconFile.write( pcPicYuvRec, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom ); 2301 2301 } 2302 2302
Note: See TracChangeset for help on using the changeset viewer.