Changeset 1029 in SHVCSoftware for branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
- Timestamp:
- 26 Feb 2015, 00:21:54 (10 years ago)
- Location:
- branches/SHM-dev
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev
- Property svn:mergeinfo changed
-
branches/SHM-dev/source
- Property svn:mergeinfo changed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1011 r1029 42 42 #include <fcntl.h> 43 43 #include <assert.h> 44 #if !SVC_EXTENSION 45 #include <iomanip> 46 #endif 44 47 45 48 #include "TAppEncTop.h" … … 80 83 vps->setVpsPocLsbAlignedFlag(false); 81 84 #endif 82 vps->setMaxTLayers ( m_maxTempLayer );85 vps->setMaxTLayers ( m_maxTempLayer ); 83 86 if (m_maxTempLayer == 1) 84 87 { … … 87 90 for(Int i = 0; i < MAX_TLAYER; i++) 88 91 { 89 vps->setNumReorderPics ( m_numReorderPics[i], i );90 vps->setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i );92 vps->setNumReorderPics ( m_numReorderPics[i], i ); 93 vps->setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i ); 91 94 } 92 95 … … 107 110 #endif 108 111 #if O0194_DIFFERENT_BITDEPTH_EL_BL 109 && m_acLayerCfg[layer].m_internalBitDepth Y == m_acLayerCfg[idx].m_internalBitDepthY && m_acLayerCfg[layer].m_internalBitDepthC == m_acLayerCfg[idx].m_internalBitDepthC112 && m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA] == m_acLayerCfg[idx].m_internalBitDepth[CHANNEL_TYPE_LUMA] && m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA] == m_acLayerCfg[idx].m_internalBitDepth[CHANNEL_TYPE_CHROMA] 110 113 #endif 111 114 ) … … 150 153 } 151 154 152 vps->setVpsNumRepFormats ( maxRepFormatIdx + 1 );155 vps->setVpsNumRepFormats ( maxRepFormatIdx + 1 ); 153 156 154 157 #if Q0195_REP_FORMAT_CLEANUP 155 158 // When not present, the value of rep_format_idx_present_flag is inferred to be equal to 0 156 vps->setRepFormatIdxPresentFlag ( vps->getVpsNumRepFormats() > 1 ? true : false );157 #else 158 vps->setRepFormatIdxPresentFlag ( true );159 vps->setRepFormatIdxPresentFlag ( vps->getVpsNumRepFormats() > 1 ? true : false ); 160 #else 161 vps->setRepFormatIdxPresentFlag ( true ); 159 162 #endif 160 163 … … 163 166 RepFormat *repFormat = vps->getVpsRepFormat( idx ); 164 167 #if REPN_FORMAT_CONTROL_FLAG 165 repFormat->setChromaAndBitDepthVpsPresentFlag ( true );168 repFormat->setChromaAndBitDepthVpsPresentFlag ( true ); 166 169 if (idx==0) 167 170 { … … 169 172 } 170 173 #endif 171 repFormat->setPicWidthVpsInLumaSamples ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceWidth() );172 repFormat->setPicHeightVpsInLumaSamples ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceHeight() );174 repFormat->setPicWidthVpsInLumaSamples ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceWidth() ); 175 repFormat->setPicHeightVpsInLumaSamples ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceHeight() ); 173 176 #if AUXILIARY_PICTURES 174 repFormat->setChromaFormatVpsIdc ( m_acLayerCfg[mapIdxToLayer[idx]].getChromaFormatIDC() );175 #else 176 repFormat->setChromaFormatVpsIdc ( 1); // Need modification to change for each layer - corresponds to 420177 #endif 178 repFormat->setSeparateColourPlaneVpsFlag ( 0); // Need modification to change for each layer177 repFormat->setChromaFormatVpsIdc ( m_acLayerCfg[mapIdxToLayer[idx]].getChromaFormatIDC() ); 178 #else 179 repFormat->setChromaFormatVpsIdc ( 1 ); // Need modification to change for each layer - corresponds to 420 180 #endif 181 repFormat->setSeparateColourPlaneVpsFlag ( 0 ); // Need modification to change for each layer 179 182 #if O0194_DIFFERENT_BITDEPTH_EL_BL 180 repFormat->setBitDepthVpsLuma ( getInternalBitDepthY(mapIdxToLayer[idx]) ); // Need modification to change for each layer181 repFormat->setBitDepthVpsChroma ( getInternalBitDepthC(mapIdxToLayer[idx])); // Need modification to change for each layer182 #else 183 repFormat->setBitDepthVpsLuma ( getInternalBitDepthY() ); // Need modification to change for each layer184 repFormat->setBitDepthVpsChroma ( getInternalBitDepthC()); // Need modification to change for each layer183 repFormat->setBitDepthVpsLuma ( getInternalBitDepth(mapIdxToLayer[idx], CHANNEL_TYPE_LUMA) ); // Need modification to change for each layer 184 repFormat->setBitDepthVpsChroma ( getInternalBitDepth(mapIdxToLayer[idx], CHANNEL_TYPE_CHROMA) ); // Need modification to change for each layer 185 #else 186 repFormat->setBitDepthVpsLuma ( getInternalBitDepth(CHANNEL_TYPE_LUMA) ); // Need modification to change for each layer 187 repFormat->setBitDepthVpsChroma ( getInternalBitDepth(CHANNEL_TYPE_CHROMA) ); // Need modification to change for each layer 185 188 #endif 186 189 187 190 #if R0156_CONF_WINDOW_IN_REP_FORMAT 188 repFormat->getConformanceWindowVps().setWindow( 189 m_acLayerCfg[mapIdxToLayer[idx]].m_confWinLeft, 190 m_acLayerCfg[mapIdxToLayer[idx]].m_confWinRight, 191 m_acLayerCfg[mapIdxToLayer[idx]].m_confWinTop, 192 m_acLayerCfg[mapIdxToLayer[idx]].m_confWinBottom ); 191 repFormat->getConformanceWindowVps().setWindow ( m_acLayerCfg[mapIdxToLayer[idx]].m_confWinLeft, 192 m_acLayerCfg[mapIdxToLayer[idx]].m_confWinRight, 193 m_acLayerCfg[mapIdxToLayer[idx]].m_confWinTop, 194 m_acLayerCfg[mapIdxToLayer[idx]].m_confWinBottom ); 193 195 #endif 194 196 195 197 #if HIGHER_LAYER_IRAP_SKIP_FLAG 196 m_acTEncTop[mapIdxToLayer[idx]].setSkipPictureAtArcSwitch ( m_skipPictureAtArcSwitch );198 m_acTEncTop[mapIdxToLayer[idx]].setSkipPictureAtArcSwitch ( m_skipPictureAtArcSwitch ); 197 199 #endif 198 200 } … … 203 205 //Populate PTL in VPS 204 206 TComVPS *pVPS = m_acTEncTop[0].getVPS(); 205 for (int ii = 0; ii < m_numPTLInfo; ii++)207 for( Int ii = 0; ii < m_numPTLInfo; ii++ ) 206 208 { 207 209 pVPS->getPTL(ii)->getGeneralPTL()->setLevelIdc(m_levelList[ii]); … … 221 223 { 222 224 myvector = m_listOfLayerPTLofOlss[ii]; 225 223 226 for (std::vector<int>::iterator it = myvector.begin() ; it != myvector.end(); ++it) 224 227 { … … 226 229 } 227 230 } 228 229 //pVPS->setProfileLevelTierIdx(230 231 #endif 231 232 … … 236 237 #if O0194_DIFFERENT_BITDEPTH_EL_BL 237 238 //1 238 g_bitDepth Y = m_acLayerCfg[layer].m_internalBitDepthY;239 g_bitDepth C = m_acLayerCfg[layer].m_internalBitDepthC;240 241 g_ uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;242 g_ uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;239 g_bitDepth[CHANNEL_TYPE_LUMA] = m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA]; 240 g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]; 241 242 g_PCMBitDepth[CHANNEL_TYPE_LUMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepth[CHANNEL_TYPE_LUMA] : m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA]; 243 g_PCMBitDepth[CHANNEL_TYPE_CHROMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepth[CHANNEL_TYPE_CHROMA] : m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]; 243 244 244 245 // Set this to be used in Upsampling filter in function "TComUpsampleFilter::upsampleBasePic" 245 g_bitDepth YLayer[layer] = g_bitDepthY;246 g_bitDepth CLayer[layer] = g_bitDepthC;246 g_bitDepthLayer[CHANNEL_TYPE_LUMA][layer] = g_bitDepth[CHANNEL_TYPE_LUMA]; 247 g_bitDepthLayer[CHANNEL_TYPE_CHROMA][layer] = g_bitDepth[CHANNEL_TYPE_CHROMA]; 247 248 248 249 #if O0194_WEIGHTED_PREDICTION_CGS 249 m_acTEncTop[layer].setInterLayerWeightedPredFlag( m_useInterLayerWeightedPred ); 250 #endif 251 #endif 252 //m_acTEncTop[layer].setVPS(&vps); 253 m_acTEncTop[layer].setFrameRate ( m_acLayerCfg[layer].getFrameRate() ); 254 m_acTEncTop[layer].setFrameSkip ( m_FrameSkip ); 255 m_acTEncTop[layer].setSourceWidth ( m_acLayerCfg[layer].getSourceWidth() ); 256 m_acTEncTop[layer].setSourceHeight ( m_acLayerCfg[layer].getSourceHeight() ); 257 m_acTEncTop[layer].setConformanceWindow ( m_acLayerCfg[layer].m_confWinLeft, m_acLayerCfg[layer].m_confWinRight, m_acLayerCfg[layer].m_confWinTop, m_acLayerCfg[layer].m_confWinBottom ); 258 m_acTEncTop[layer].setFramesToBeEncoded ( m_framesToBeEncoded ); 259 260 #if SVC_EXTENSION && MULTIPLE_PTL_SUPPORT 261 m_acTEncTop[layer].setProfile(m_profileList[m_layerPTLIdx[layer]]); 262 m_acTEncTop[layer].setLevel(m_levelTierList[m_layerPTLIdx[layer]], m_levelList[m_layerPTLIdx[layer]]); 263 m_acTEncTop[layer].setProgressiveSourceFlag(m_progressiveSourceFlagList[m_layerPTLIdx[layer]]); 264 m_acTEncTop[layer].setInterlacedSourceFlag(m_interlacedSourceFlagList[m_layerPTLIdx[layer]]); 265 m_acTEncTop[layer].setNonPackedConstraintFlag(m_nonPackedConstraintFlagList[m_layerPTLIdx[layer]]); 266 m_acTEncTop[layer].setFrameOnlyConstraintFlag(m_frameOnlyConstraintFlagList[m_layerPTLIdx[layer]]); 267 #else 268 m_acTEncTop[layer].setProfile(m_profile); 269 m_acTEncTop[layer].setLevel(m_levelTier, m_level); 270 m_acTEncTop[layer].setProgressiveSourceFlag(m_progressiveSourceFlag); 271 m_acTEncTop[layer].setInterlacedSourceFlag(m_interlacedSourceFlag); 272 m_acTEncTop[layer].setNonPackedConstraintFlag(m_nonPackedConstraintFlag); 273 m_acTEncTop[layer].setFrameOnlyConstraintFlag(m_frameOnlyConstraintFlag); 274 #endif 250 m_acTEncTop[layer].setInterLayerWeightedPredFlag ( m_useInterLayerWeightedPred ); 251 #endif 252 #endif 253 254 #if MULTIPLE_PTL_SUPPORT 255 Int layerPTLIdx = m_acLayerCfg[layer].m_layerPTLIdx; 256 m_acTEncTop[layer].setProfile ( m_profileList[layerPTLIdx] ); 257 m_acTEncTop[layer].setLevel ( m_levelTierList[layerPTLIdx], m_levelList[layerPTLIdx] ); 258 m_acTEncTop[layer].setProgressiveSourceFlag ( m_progressiveSourceFlagList[layerPTLIdx] ); 259 m_acTEncTop[layer].setInterlacedSourceFlag ( m_interlacedSourceFlagList[layerPTLIdx] ); 260 m_acTEncTop[layer].setNonPackedConstraintFlag ( m_nonPackedConstraintFlagList[layerPTLIdx] ); 261 m_acTEncTop[layer].setFrameOnlyConstraintFlag ( m_frameOnlyConstraintFlagList[layerPTLIdx] ); 262 m_acTEncTop[layer].setBitDepthConstraintValue ( m_acLayerCfg[layer].m_bitDepthConstraint ); 263 m_acTEncTop[layer].setChromaFormatConstraintValue ( m_acLayerCfg[layer].m_chromaFormatConstraint ); 264 m_acTEncTop[layer].setIntraConstraintFlag ( m_acLayerCfg[layer].m_intraConstraintFlag ); 265 m_acTEncTop[layer].setLowerBitRateConstraintFlag ( m_acLayerCfg[layer].m_lowerBitRateConstraintFlag ); 266 #else 267 m_acTEncTop[layer].setProfile ( m_profile ); 268 m_acTEncTop[layer].setLevel ( m_levelTier, m_level ); 269 m_acTEncTop[layer].setProgressiveSourceFlag ( m_progressiveSourceFlag ); 270 m_acTEncTop[layer].setInterlacedSourceFlag ( m_interlacedSourceFlag ); 271 m_acTEncTop[layer].setNonPackedConstraintFlag ( m_nonPackedConstraintFlag ); 272 m_acTEncTop[layer].setFrameOnlyConstraintFlag ( m_frameOnlyConstraintFlag ); 273 m_acTEncTop[layer].setBitDepthConstraintValue ( m_bitDepthConstraint ); 274 m_acTEncTop[layer].setChromaFormatConstraintValue ( m_acLayerCfg[layer].m_chromaFormatConstraint ); 275 m_acTEncTop[layer].setIntraConstraintFlag ( m_intraConstraintFlag ); 276 m_acTEncTop[layer].setLowerBitRateConstraintFlag ( m_lowerBitRateConstraintFlag ); 277 #endif 278 279 m_acTEncTop[layer].setPrintMSEBasedSequencePSNR ( m_printMSEBasedSequencePSNR); 280 m_acTEncTop[layer].setPrintFrameMSE ( m_printFrameMSE); 281 m_acTEncTop[layer].setPrintSequenceMSE ( m_printSequenceMSE); 282 m_acTEncTop[layer].setCabacZeroWordPaddingEnabled ( m_cabacZeroWordPaddingEnabled ); 283 284 m_acTEncTop[layer].setFrameRate ( m_acLayerCfg[layer].getFrameRate() ); 285 m_acTEncTop[layer].setFrameSkip ( m_FrameSkip ); 286 m_acTEncTop[layer].setSourceWidth ( m_acLayerCfg[layer].getSourceWidth() ); 287 m_acTEncTop[layer].setSourceHeight ( m_acLayerCfg[layer].getSourceHeight() ); 288 m_acTEncTop[layer].setConformanceWindow ( m_acLayerCfg[layer].m_confWinLeft, m_acLayerCfg[layer].m_confWinRight, m_acLayerCfg[layer].m_confWinTop, m_acLayerCfg[layer].m_confWinBottom ); 289 m_acTEncTop[layer].setFramesToBeEncoded ( m_framesToBeEncoded ); 275 290 276 291 #if REF_IDX_MFM 277 292 #if AVC_BASE 278 293 #if VPS_AVC_BL_FLAG_REMOVAL 279 m_acTEncTop[layer].setMFMEnabledFlag (layer == 0 ? false : ( m_nonHEVCBaseLayerFlag ? false : true ) && m_acLayerCfg[layer].getNumMotionPredRefLayers());280 #else 281 m_acTEncTop[layer].setMFMEnabledFlag (layer == 0 ? false : ( m_avcBaseLayerFlag ? false : true ) && m_acLayerCfg[layer].getNumMotionPredRefLayers());282 #endif 283 #else 284 m_acTEncTop[layer].setMFMEnabledFlag (layer == 0 ? false : ( m_acLayerCfg[layer].getNumMotionPredRefLayers() > 0 ) );294 m_acTEncTop[layer].setMFMEnabledFlag (layer == 0 ? false : ( m_nonHEVCBaseLayerFlag ? false : true ) && m_acLayerCfg[layer].getNumMotionPredRefLayers()); 295 #else 296 m_acTEncTop[layer].setMFMEnabledFlag (layer == 0 ? false : ( m_avcBaseLayerFlag ? false : true ) && m_acLayerCfg[layer].getNumMotionPredRefLayers()); 297 #endif 298 #else 299 m_acTEncTop[layer].setMFMEnabledFlag (layer == 0 ? false : ( m_acLayerCfg[layer].getNumMotionPredRefLayers() > 0 ) ); 285 300 #endif 286 301 #endif … … 291 306 292 307 //====== Coding Structure ======== 293 m_acTEncTop[layer].setIntraPeriod ( m_acLayerCfg[layer].m_iIntraPeriod );294 m_acTEncTop[layer].setDecodingRefreshType ( m_iDecodingRefreshType );295 m_acTEncTop[layer].setGOPSize ( m_iGOPSize );308 m_acTEncTop[layer].setIntraPeriod ( m_acLayerCfg[layer].m_iIntraPeriod ); 309 m_acTEncTop[layer].setDecodingRefreshType ( m_iDecodingRefreshType ); 310 m_acTEncTop[layer].setGOPSize ( m_iGOPSize ); 296 311 #if Q0108_TSA_STSA 297 m_acTEncTop[layer].setGopList ( layer ? m_EhGOPList[layer] : m_GOPList );298 #else 299 m_acTEncTop[layer].setGopList ( m_GOPList );312 m_acTEncTop[layer].setGopList ( layer ? m_EhGOPList[layer] : m_GOPList ); 313 #else 314 m_acTEncTop[layer].setGopList ( m_GOPList ); 300 315 #endif 301 316 302 317 #if !Q0108_TSA_STSA 303 m_acTEncTop[layer].setExtraRPSs ( m_extraRPSs );304 #else 305 m_acTEncTop[layer].setExtraRPSs ( m_extraRPSs[layer] );318 m_acTEncTop[layer].setExtraRPSs ( m_extraRPSs ); 319 #else 320 m_acTEncTop[layer].setExtraRPSs ( m_extraRPSs[layer] ); 306 321 #endif 307 322 for(Int i = 0; i < MAX_TLAYER; i++) 308 323 { 309 m_acTEncTop[layer].setNumReorderPics ( m_numReorderPics[i], i );310 m_acTEncTop[layer].setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i );324 m_acTEncTop[layer].setNumReorderPics ( m_numReorderPics[i], i ); 325 m_acTEncTop[layer].setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i ); 311 326 } 312 327 for( UInt uiLoop = 0; uiLoop < MAX_TLAYER; ++uiLoop ) 313 328 { 314 m_acTEncTop[layer].setLambdaModifier ( uiLoop, m_adLambdaModifier[ uiLoop ] );315 } 316 m_acTEncTop[layer].setQP ( m_acLayerCfg[layer].getIntQP() );317 318 m_acTEncTop[layer].setPad ( m_acLayerCfg[layer].getPad() );329 m_acTEncTop[layer].setLambdaModifier ( uiLoop, m_adLambdaModifier[ uiLoop ] ); 330 } 331 m_acTEncTop[layer].setQP ( m_acLayerCfg[layer].getIntQP() ); 332 333 m_acTEncTop[layer].setPad ( m_acLayerCfg[layer].getPad() ); 319 334 #if !Q0108_TSA_STSA 320 m_acTEncTop[layer].setMaxTempLayer ( m_maxTempLayer );335 m_acTEncTop[layer].setMaxTempLayer ( m_maxTempLayer ); 321 336 #else 322 337 if (layer== 0) 323 338 { 324 m_acTEncTop[layer].setMaxTempLayer ( m_maxTempLayer );339 m_acTEncTop[layer].setMaxTempLayer ( m_maxTempLayer ); 325 340 } 326 341 else 327 342 { 328 m_acTEncTop[layer].setMaxTempLayer ( m_EhMaxTempLayer[layer] );343 m_acTEncTop[layer].setMaxTempLayer ( m_EhMaxTempLayer[layer] ); 329 344 } 330 345 #endif … … 333 348 if( layer < m_numLayers - 1 ) 334 349 { 335 m_acTEncTop[layer].setMaxTidIlRefPicsPlus1 ( m_acLayerCfg[layer].getMaxTidIlRefPicsPlus1());350 m_acTEncTop[layer].setMaxTidIlRefPicsPlus1 ( m_acLayerCfg[layer].getMaxTidIlRefPicsPlus1()); 336 351 } 337 352 … … 341 356 for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++) 342 357 { 343 m_acTEncTop[layer].setSamplePredEnabledFlag (i, false);344 m_acTEncTop[layer].setMotionPredEnabledFlag (i, false);358 m_acTEncTop[layer].setSamplePredEnabledFlag (i, false); 359 m_acTEncTop[layer].setMotionPredEnabledFlag (i, false); 345 360 } 346 361 if(m_acLayerCfg[layer].getNumSamplePredRefLayers() == -1) 347 362 { 348 363 // Not included in the configuration file; assume that each layer depends on previous layer 349 m_acTEncTop[layer].setNumSamplePredRefLayers (1); // One sample pred ref. layer350 m_acTEncTop[layer].setSamplePredRefLayerId (0, layer - 1); // Previous layer351 m_acTEncTop[layer].setSamplePredEnabledFlag (layer - 1, true);364 m_acTEncTop[layer].setNumSamplePredRefLayers (1); // One sample pred ref. layer 365 m_acTEncTop[layer].setSamplePredRefLayerId (0, layer - 1); // Previous layer 366 m_acTEncTop[layer].setSamplePredEnabledFlag (layer - 1, true); 352 367 } 353 368 else 354 369 { 355 m_acTEncTop[layer].setNumSamplePredRefLayers ( m_acLayerCfg[layer].getNumSamplePredRefLayers() );370 m_acTEncTop[layer].setNumSamplePredRefLayers ( m_acLayerCfg[layer].getNumSamplePredRefLayers() ); 356 371 for(Int i = 0; i < m_acTEncTop[layer].getNumSamplePredRefLayers(); i++) 357 372 { 358 m_acTEncTop[layer].setSamplePredRefLayerId ( i, m_acLayerCfg[layer].getSamplePredRefLayerId(i));359 m_acTEncTop[layer].setSamplePredEnabledFlag (m_acLayerCfg[layer].getSamplePredRefLayerId(i), true);373 m_acTEncTop[layer].setSamplePredRefLayerId ( i, m_acLayerCfg[layer].getSamplePredRefLayerId(i)); 374 m_acTEncTop[layer].setSamplePredEnabledFlag (m_acLayerCfg[layer].getSamplePredRefLayerId(i), true); 360 375 } 361 376 } … … 363 378 { 364 379 // Not included in the configuration file; assume that each layer depends on previous layer 365 m_acTEncTop[layer].setNumMotionPredRefLayers (1); // One motion pred ref. layer366 m_acTEncTop[layer].setMotionPredRefLayerId (0, layer - 1); // Previous layer367 m_acTEncTop[layer].setMotionPredEnabledFlag (layer - 1, true);380 m_acTEncTop[layer].setNumMotionPredRefLayers (1); // One motion pred ref. layer 381 m_acTEncTop[layer].setMotionPredRefLayerId (0, layer - 1); // Previous layer 382 m_acTEncTop[layer].setMotionPredEnabledFlag (layer - 1, true); 368 383 } 369 384 else 370 385 { 371 m_acTEncTop[layer].setNumMotionPredRefLayers ( m_acLayerCfg[layer].getNumMotionPredRefLayers() );386 m_acTEncTop[layer].setNumMotionPredRefLayers ( m_acLayerCfg[layer].getNumMotionPredRefLayers() ); 372 387 for(Int i = 0; i < m_acTEncTop[layer].getNumMotionPredRefLayers(); i++) 373 388 { 374 m_acTEncTop[layer].setMotionPredRefLayerId ( i, m_acLayerCfg[layer].getMotionPredRefLayerId(i));375 m_acTEncTop[layer].setMotionPredEnabledFlag (m_acLayerCfg[layer].getMotionPredRefLayerId(i), true);389 m_acTEncTop[layer].setMotionPredRefLayerId ( i, m_acLayerCfg[layer].getMotionPredRefLayerId(i)); 390 m_acTEncTop[layer].setMotionPredEnabledFlag (m_acLayerCfg[layer].getMotionPredRefLayerId(i), true); 376 391 } 377 392 } … … 384 399 if (m_acTEncTop[layer].getSamplePredEnabledFlag(i) || m_acTEncTop[layer].getMotionPredEnabledFlag(i)) 385 400 { 386 m_acTEncTop[layer].setRefLayerId (numDirectRefLayers, i);401 m_acTEncTop[layer].setRefLayerId (numDirectRefLayers, i); 387 402 numDirectRefLayers++; 388 403 } 389 404 } 390 m_acTEncTop[layer].setNumDirectRefLayers (numDirectRefLayers);405 m_acTEncTop[layer].setNumDirectRefLayers (numDirectRefLayers); 391 406 392 407 if(m_acLayerCfg[layer].getNumActiveRefLayers() == -1) 393 408 { 394 m_acTEncTop[layer].setNumActiveRefLayers ( m_acTEncTop[layer].getNumDirectRefLayers() );409 m_acTEncTop[layer].setNumActiveRefLayers ( m_acTEncTop[layer].getNumDirectRefLayers() ); 395 410 for( Int i = 0; i < m_acTEncTop[layer].getNumActiveRefLayers(); i++ ) 396 411 { … … 400 415 else 401 416 { 402 m_acTEncTop[layer].setNumActiveRefLayers ( m_acLayerCfg[layer].getNumActiveRefLayers() );417 m_acTEncTop[layer].setNumActiveRefLayers ( m_acLayerCfg[layer].getNumActiveRefLayers() ); 403 418 for(Int i = 0; i < m_acTEncTop[layer].getNumActiveRefLayers(); i++) 404 419 { 405 m_acTEncTop[layer].setPredLayerId ( i, m_acLayerCfg[layer].getPredLayerId(i));420 m_acTEncTop[layer].setPredLayerId ( i, m_acLayerCfg[layer].getPredLayerId(i)); 406 421 } 407 422 } … … 417 432 Int rlSubHeightC = 2; 418 433 #endif 419 m_acTEncTop[layer].setRefRegionOffsetPresentFlag ( i, m_acLayerCfg[layer].m_refRegionOffsetPresentFlag[i] );420 m_acTEncTop[layer].getRefLayerWindow(i).setWindow ( rlSubWidthC * m_acLayerCfg[layer].m_refRegionLeftOffset[i], rlSubWidthC * m_acLayerCfg[layer].m_refRegionRightOffset[i],421 rlSubHeightC * m_acLayerCfg[layer].m_refRegionTopOffset[i], rlSubHeightC * m_acLayerCfg[layer].m_refRegionBottomOffset[i]);434 m_acTEncTop[layer].setRefRegionOffsetPresentFlag ( i, m_acLayerCfg[layer].m_refRegionOffsetPresentFlag[i] ); 435 m_acTEncTop[layer].getRefLayerWindow(i).setWindow ( rlSubWidthC * m_acLayerCfg[layer].m_refRegionLeftOffset[i], rlSubWidthC * m_acLayerCfg[layer].m_refRegionRightOffset[i], 436 rlSubHeightC * m_acLayerCfg[layer].m_refRegionTopOffset[i], rlSubHeightC * m_acLayerCfg[layer].m_refRegionBottomOffset[i]); 422 437 } 423 438 #endif … … 432 447 433 448 //====== Loop/Deblock Filter ======== 434 m_acTEncTop[layer].setLoopFilterDisable ( m_bLoopFilterDisable );435 m_acTEncTop[layer].setLoopFilterOffsetInPPS ( m_loopFilterOffsetInPPS );436 m_acTEncTop[layer].setLoopFilterBetaOffset ( m_loopFilterBetaOffsetDiv2 );437 m_acTEncTop[layer].setLoopFilterTcOffset ( m_loopFilterTcOffsetDiv2 );438 m_acTEncTop[layer].setDeblockingFilterControlPresent ( m_DeblockingFilterControlPresent);439 m_acTEncTop[layer].setDeblockingFilterMetric ( m_DeblockingFilterMetric );449 m_acTEncTop[layer].setLoopFilterDisable ( m_bLoopFilterDisable ); 450 m_acTEncTop[layer].setLoopFilterOffsetInPPS ( m_loopFilterOffsetInPPS ); 451 m_acTEncTop[layer].setLoopFilterBetaOffset ( m_loopFilterBetaOffsetDiv2 ); 452 m_acTEncTop[layer].setLoopFilterTcOffset ( m_loopFilterTcOffsetDiv2 ); 453 m_acTEncTop[layer].setDeblockingFilterControlPresent ( m_DeblockingFilterControlPresent); 454 m_acTEncTop[layer].setDeblockingFilterMetric ( m_DeblockingFilterMetric ); 440 455 441 456 //====== Motion search ======== 442 m_acTEncTop[layer].setFastSearch ( m_iFastSearch );443 m_acTEncTop[layer].setSearchRange ( m_iSearchRange );444 m_acTEncTop[layer].setBipredSearchRange ( m_bipredSearchRange );457 m_acTEncTop[layer].setFastSearch ( m_iFastSearch ); 458 m_acTEncTop[layer].setSearchRange ( m_iSearchRange ); 459 m_acTEncTop[layer].setBipredSearchRange ( m_bipredSearchRange ); 445 460 446 461 //====== Quality control ======== 447 m_acTEncTop[layer].setMaxDeltaQP ( m_iMaxDeltaQP ); 448 m_acTEncTop[layer].setMaxCuDQPDepth ( m_iMaxCuDQPDepth ); 449 450 m_acTEncTop[layer].setChromaCbQpOffset ( m_cbQpOffset ); 451 m_acTEncTop[layer].setChromaCrQpOffset ( m_crQpOffset ); 462 m_acTEncTop[layer].setMaxDeltaQP ( m_iMaxDeltaQP ); 463 m_acTEncTop[layer].setMaxCuDQPDepth ( m_iMaxCuDQPDepth ); 464 m_acTEncTop[layer].setMaxCUChromaQpAdjustmentDepth ( m_maxCUChromaQpAdjustmentDepth ); 465 m_acTEncTop[layer].setChromaCbQpOffset ( m_cbQpOffset ); 466 m_acTEncTop[layer].setChromaCrQpOffset ( m_crQpOffset ); 467 468 m_acTEncTop[layer].setChromaFormatIdc ( m_acLayerCfg[layer].m_chromaFormatIDC ); 452 469 453 470 #if ADAPTIVE_QP_SELECTION 454 m_acTEncTop[layer].setUseAdaptQpSelect ( m_bUseAdaptQpSelect );471 m_acTEncTop[layer].setUseAdaptQpSelect ( m_bUseAdaptQpSelect ); 455 472 #endif 456 473 457 m_acTEncTop[layer].setUseAdaptiveQP ( m_bUseAdaptiveQP ); 458 m_acTEncTop[layer].setQPAdaptationRange ( m_iQPAdaptationRange ); 474 m_acTEncTop[layer].setUseAdaptiveQP ( m_bUseAdaptiveQP ); 475 m_acTEncTop[layer].setQPAdaptationRange ( m_iQPAdaptationRange ); 476 m_acTEncTop[layer].setUseExtendedPrecision ( m_acLayerCfg[layer].m_useExtendedPrecision ); 477 m_acTEncTop[layer].setUseHighPrecisionPredictionWeighting ( m_acLayerCfg[layer].m_useHighPrecisionPredictionWeighting ); 459 478 460 479 //====== Tool list ======== 461 m_acTEncTop[layer].setDeltaQpRD ( m_uiDeltaQpRD );462 m_acTEncTop[layer].setUseASR ( m_bUseASR );463 m_acTEncTop[layer].setUseHADME ( m_bUseHADME );464 m_acTEncTop[layer].setdQPs ( m_acLayerCfg[layer].getdQPs() );465 m_acTEncTop[layer].setUseRDOQ ( m_useRDOQ );466 m_acTEncTop[layer].setUseRDOQTS ( m_useRDOQTS );467 m_acTEncTop[layer].setRDpenalty ( m_rdPenalty );480 m_acTEncTop[layer].setDeltaQpRD ( m_uiDeltaQpRD ); 481 m_acTEncTop[layer].setUseASR ( m_bUseASR ); 482 m_acTEncTop[layer].setUseHADME ( m_bUseHADME ); 483 m_acTEncTop[layer].setdQPs ( m_acLayerCfg[layer].getdQPs() ); 484 m_acTEncTop[layer].setUseRDOQ ( m_useRDOQ ); 485 m_acTEncTop[layer].setUseRDOQTS ( m_useRDOQTS ); 486 m_acTEncTop[layer].setRDpenalty ( m_rdPenalty ); 468 487 #if LAYER_CTB 469 m_acTEncTop[layer].setQuadtreeTULog2MaxSize ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MaxSize ); 470 m_acTEncTop[layer].setQuadtreeTULog2MinSize ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MinSize ); 471 m_acTEncTop[layer].setQuadtreeTUMaxDepthInter ( m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthInter ); 472 m_acTEncTop[layer].setQuadtreeTUMaxDepthIntra ( m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthIntra ); 473 #else 474 m_acTEncTop[layer].setQuadtreeTULog2MaxSize ( m_uiQuadtreeTULog2MaxSize ); 475 m_acTEncTop[layer].setQuadtreeTULog2MinSize ( m_uiQuadtreeTULog2MinSize ); 476 m_acTEncTop[layer].setQuadtreeTUMaxDepthInter ( m_uiQuadtreeTUMaxDepthInter ); 477 m_acTEncTop[layer].setQuadtreeTUMaxDepthIntra ( m_uiQuadtreeTUMaxDepthIntra ); 478 #endif 479 m_acTEncTop[layer].setUseFastEnc ( m_bUseFastEnc ); 480 m_acTEncTop[layer].setUseEarlyCU ( m_bUseEarlyCU ); 481 m_acTEncTop[layer].setUseFastDecisionForMerge ( m_useFastDecisionForMerge ); 482 m_acTEncTop[layer].setUseCbfFastMode ( m_bUseCbfFastMode ); 483 m_acTEncTop[layer].setUseEarlySkipDetection ( m_useEarlySkipDetection ); 488 m_acTEncTop[layer].setQuadtreeTULog2MaxSize ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MaxSize ); 489 m_acTEncTop[layer].setQuadtreeTULog2MinSize ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MinSize ); 490 m_acTEncTop[layer].setQuadtreeTUMaxDepthInter ( m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthInter ); 491 m_acTEncTop[layer].setQuadtreeTUMaxDepthIntra ( m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthIntra ); 492 #else 493 m_acTEncTop[layer].setQuadtreeTULog2MaxSize ( m_uiQuadtreeTULog2MaxSize ); 494 m_acTEncTop[layer].setQuadtreeTULog2MinSize ( m_uiQuadtreeTULog2MinSize ); 495 m_acTEncTop[layer].setQuadtreeTUMaxDepthInter ( m_uiQuadtreeTUMaxDepthInter ); 496 m_acTEncTop[layer].setQuadtreeTUMaxDepthIntra ( m_uiQuadtreeTUMaxDepthIntra ); 497 #endif 498 m_acTEncTop[layer].setUseFastEnc ( m_bUseFastEnc ); 499 m_acTEncTop[layer].setUseEarlyCU ( m_bUseEarlyCU ); 500 m_acTEncTop[layer].setUseFastDecisionForMerge ( m_useFastDecisionForMerge ); 501 m_acTEncTop[layer].setUseCbfFastMode ( m_bUseCbfFastMode ); 502 m_acTEncTop[layer].setUseEarlySkipDetection ( m_useEarlySkipDetection ); 503 m_acTEncTop[layer].setUseCrossComponentPrediction ( m_useCrossComponentPrediction ); 504 m_acTEncTop[layer].setUseReconBasedCrossCPredictionEstimate ( m_reconBasedCrossCPredictionEstimate ); 505 m_acTEncTop[layer].setSaoOffsetBitShift ( CHANNEL_TYPE_LUMA , m_saoOffsetBitShift[CHANNEL_TYPE_LUMA] ); 506 m_acTEncTop[layer].setSaoOffsetBitShift ( CHANNEL_TYPE_CHROMA, m_saoOffsetBitShift[CHANNEL_TYPE_CHROMA] ); 507 m_acTEncTop[layer].setUseTransformSkip ( m_useTransformSkip ); 508 m_acTEncTop[layer].setUseTransformSkipFast ( m_useTransformSkipFast ); 509 m_acTEncTop[layer].setUseResidualRotation ( m_useResidualRotation ); 510 m_acTEncTop[layer].setUseSingleSignificanceMapContext ( m_useSingleSignificanceMapContext ); 511 m_acTEncTop[layer].setUseGolombRiceParameterAdaptation ( m_useGolombRiceParameterAdaptation ); 512 m_acTEncTop[layer].setAlignCABACBeforeBypass ( m_alignCABACBeforeBypass ); 513 m_acTEncTop[layer].setTransformSkipLog2MaxSize ( m_transformSkipLog2MaxSize ); 514 for (UInt signallingModeIndex = 0; signallingModeIndex < NUMBER_OF_RDPCM_SIGNALLING_MODES; signallingModeIndex++) 515 { 516 m_acTEncTop[layer].setUseResidualDPCM ( RDPCMSignallingMode(signallingModeIndex), m_useResidualDPCM[signallingModeIndex]); 517 } 518 m_acTEncTop[layer].setUseConstrainedIntraPred ( m_bUseConstrainedIntraPred ); 519 m_acTEncTop[layer].setPCMLog2MinSize ( m_uiPCMLog2MinSize); 520 m_acTEncTop[layer].setUsePCM ( m_usePCM ); 521 m_acTEncTop[layer].setPCMLog2MaxSize ( m_pcmLog2MaxSize); 522 m_acTEncTop[layer].setMaxNumMergeCand ( m_maxNumMergeCand ); 523 524 525 //====== Weighted Prediction ======== 526 m_acTEncTop[layer].setUseWP ( m_useWeightedPred ); 527 m_acTEncTop[layer].setWPBiPred ( m_useWeightedBiPred ); 484 528 #if FAST_INTRA_SHVC 485 m_acTEncTop[layer].setUseFastIntraScalable ( m_useFastIntraScalable ); 486 #endif 487 488 m_acTEncTop[layer].setUseTransformSkip ( m_useTransformSkip ); 489 m_acTEncTop[layer].setUseTransformSkipFast ( m_useTransformSkipFast ); 490 m_acTEncTop[layer].setUseConstrainedIntraPred ( m_bUseConstrainedIntraPred ); 491 m_acTEncTop[layer].setPCMLog2MinSize ( m_uiPCMLog2MinSize); 492 m_acTEncTop[layer].setUsePCM ( m_usePCM ); 493 m_acTEncTop[layer].setPCMLog2MaxSize ( m_pcmLog2MaxSize); 494 m_acTEncTop[layer].setMaxNumMergeCand ( m_maxNumMergeCand ); 495 496 497 //====== Weighted Prediction ======== 498 m_acTEncTop[layer].setUseWP ( m_useWeightedPred ); 499 m_acTEncTop[layer].setWPBiPred ( m_useWeightedBiPred ); 529 m_acTEncTop[layer].setUseFastIntraScalable ( m_useFastIntraScalable ); 530 #endif 500 531 #if O0194_WEIGHTED_PREDICTION_CGS 501 532 if( layer != 0 && m_useInterLayerWeightedPred ) 502 533 { 503 534 // Enable weighted prediction for enhancement layer 504 m_acTEncTop[layer].setUseWP ( true );505 m_acTEncTop[layer].setWPBiPred ( true );535 m_acTEncTop[layer].setUseWP ( true ); 536 m_acTEncTop[layer].setWPBiPred ( true ); 506 537 } 507 538 #endif 508 539 //====== Parallel Merge Estimation ======== 509 m_acTEncTop[layer].setLog2ParallelMergeLevelMinus2 ( m_log2ParallelMergeLevel - 2 );540 m_acTEncTop[layer].setLog2ParallelMergeLevelMinus2 ( m_log2ParallelMergeLevel - 2 ); 510 541 511 542 //====== Slice ======== 512 m_acTEncTop[layer].setSliceMode ( m_sliceMode);513 m_acTEncTop[layer].setSliceArgument ( m_sliceArgument );543 m_acTEncTop[layer].setSliceMode ( (SliceConstraint) m_sliceMode ); 544 m_acTEncTop[layer].setSliceArgument ( m_sliceArgument ); 514 545 515 546 //====== Dependent Slice ======== 516 m_acTEncTop[layer].setSliceSegmentMode ( m_sliceSegmentMode ); 517 m_acTEncTop[layer].setSliceSegmentArgument ( m_sliceSegmentArgument ); 518 #if LAYER_CTB 519 Int iNumPartInCU = 1<<(m_acLayerCfg[layer].m_uiMaxCUDepth<<1); 520 #else 521 Int iNumPartInCU = 1<<(m_uiMaxCUDepth<<1); 522 #endif 523 if(m_sliceSegmentMode==FIXED_NUMBER_OF_LCU) 524 { 525 m_acTEncTop[layer].setSliceSegmentArgument ( m_sliceSegmentArgument * iNumPartInCU ); 526 } 527 if(m_sliceMode==FIXED_NUMBER_OF_LCU) 528 { 529 m_acTEncTop[layer].setSliceArgument ( m_sliceArgument * iNumPartInCU ); 530 } 531 if(m_sliceMode==FIXED_NUMBER_OF_TILES) 532 { 533 m_acTEncTop[layer].setSliceArgument ( m_sliceArgument ); 534 } 535 536 if(m_sliceMode == 0 ) 547 m_acTEncTop[layer].setSliceSegmentMode ( (SliceConstraint) m_sliceSegmentMode ); 548 m_acTEncTop[layer].setSliceSegmentArgument ( m_sliceSegmentArgument ); 549 550 if(m_sliceMode == NO_SLICES ) 537 551 { 538 552 m_bLFCrossSliceBoundaryFlag = true; 539 553 } 540 m_acTEncTop[layer].setLFCrossSliceBoundaryFlag( m_bLFCrossSliceBoundaryFlag ); 541 m_acTEncTop[layer].setUseSAO ( m_bUseSAO ); 542 m_acTEncTop[layer].setMaxNumOffsetsPerPic (m_maxNumOffsetsPerPic); 543 544 m_acTEncTop[layer].setSaoLcuBoundary (m_saoLcuBoundary); 545 m_acTEncTop[layer].setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 546 m_acTEncTop[layer].setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); 547 548 m_acTEncTop[layer].setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); 549 m_acTEncTop[layer].setRecoveryPointSEIEnabled( m_recoveryPointSEIEnabled ); 550 m_acTEncTop[layer].setBufferingPeriodSEIEnabled( m_bufferingPeriodSEIEnabled ); 551 m_acTEncTop[layer].setPictureTimingSEIEnabled( m_pictureTimingSEIEnabled ); 552 m_acTEncTop[layer].setToneMappingInfoSEIEnabled ( m_toneMappingInfoSEIEnabled ); 553 m_acTEncTop[layer].setTMISEIToneMapId ( m_toneMapId ); 554 m_acTEncTop[layer].setTMISEIToneMapCancelFlag ( m_toneMapCancelFlag ); 555 m_acTEncTop[layer].setTMISEIToneMapPersistenceFlag ( m_toneMapPersistenceFlag ); 556 m_acTEncTop[layer].setTMISEICodedDataBitDepth ( m_toneMapCodedDataBitDepth ); 557 m_acTEncTop[layer].setTMISEITargetBitDepth ( m_toneMapTargetBitDepth ); 558 m_acTEncTop[layer].setTMISEIModelID ( m_toneMapModelId ); 559 m_acTEncTop[layer].setTMISEIMinValue ( m_toneMapMinValue ); 560 m_acTEncTop[layer].setTMISEIMaxValue ( m_toneMapMaxValue ); 561 m_acTEncTop[layer].setTMISEISigmoidMidpoint ( m_sigmoidMidpoint ); 562 m_acTEncTop[layer].setTMISEISigmoidWidth ( m_sigmoidWidth ); 563 m_acTEncTop[layer].setTMISEIStartOfCodedInterva ( m_startOfCodedInterval ); 564 m_acTEncTop[layer].setTMISEINumPivots ( m_numPivots ); 565 m_acTEncTop[layer].setTMISEICodedPivotValue ( m_codedPivotValue ); 566 m_acTEncTop[layer].setTMISEITargetPivotValue ( m_targetPivotValue ); 567 m_acTEncTop[layer].setTMISEICameraIsoSpeedIdc ( m_cameraIsoSpeedIdc ); 568 m_acTEncTop[layer].setTMISEICameraIsoSpeedValue ( m_cameraIsoSpeedValue ); 569 m_acTEncTop[layer].setTMISEIExposureCompensationValueSignFlag ( m_exposureCompensationValueSignFlag ); 570 m_acTEncTop[layer].setTMISEIExposureCompensationValueNumerator ( m_exposureCompensationValueNumerator ); 571 m_acTEncTop[layer].setTMISEIExposureCompensationValueDenomIdc ( m_exposureCompensationValueDenomIdc ); 572 m_acTEncTop[layer].setTMISEIRefScreenLuminanceWhite ( m_refScreenLuminanceWhite ); 573 m_acTEncTop[layer].setTMISEIExtendedRangeWhiteLevel ( m_extendedRangeWhiteLevel ); 574 m_acTEncTop[layer].setTMISEINominalBlackLevelLumaCodeValue ( m_nominalBlackLevelLumaCodeValue ); 575 m_acTEncTop[layer].setTMISEINominalWhiteLevelLumaCodeValue ( m_nominalWhiteLevelLumaCodeValue ); 576 m_acTEncTop[layer].setTMISEIExtendedWhiteLevelLumaCodeValue ( m_extendedWhiteLevelLumaCodeValue ); 577 #if P0050_KNEE_FUNCTION_SEI 578 m_acTEncTop[layer].setKneeSEIEnabled ( m_kneeSEIEnabled ); 579 m_acTEncTop[layer].setKneeSEIId ( m_kneeSEIId ); 580 m_acTEncTop[layer].setKneeSEICancelFlag ( m_kneeSEICancelFlag ); 581 m_acTEncTop[layer].setKneeSEIPersistenceFlag ( m_kneeSEIPersistenceFlag ); 582 m_acTEncTop[layer].setKneeSEIMappingFlag ( m_kneeSEIMappingFlag ); 583 m_acTEncTop[layer].setKneeSEIInputDrange ( m_kneeSEIInputDrange ); 584 m_acTEncTop[layer].setKneeSEIInputDispLuminance ( m_kneeSEIInputDispLuminance ); 585 m_acTEncTop[layer].setKneeSEIOutputDrange ( m_kneeSEIOutputDrange ); 586 m_acTEncTop[layer].setKneeSEIOutputDispLuminance ( m_kneeSEIOutputDispLuminance ); 587 m_acTEncTop[layer].setKneeSEINumKneePointsMinus1 ( m_kneeSEINumKneePointsMinus1 ); 588 m_acTEncTop[layer].setKneeSEIInputKneePoint ( m_kneeSEIInputKneePoint ); 589 m_acTEncTop[layer].setKneeSEIOutputKneePoint ( m_kneeSEIOutputKneePoint ); 590 #endif 554 555 m_acTEncTop[layer].setLFCrossSliceBoundaryFlag ( m_bLFCrossSliceBoundaryFlag ); 556 m_acTEncTop[layer].setUseSAO ( m_bUseSAO ); 557 m_acTEncTop[layer].setMaxNumOffsetsPerPic ( m_maxNumOffsetsPerPic ); 558 559 m_acTEncTop[layer].setSaoCtuBoundary ( m_saoCtuBoundary ); 560 m_acTEncTop[layer].setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 561 m_acTEncTop[layer].setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); 562 563 m_acTEncTop[layer].setDisableIntraReferenceSmoothing (!m_enableIntraReferenceSmoothing ); 564 m_acTEncTop[layer].setDecodedPictureHashSEIEnabled ( m_decodedPictureHashSEIEnabled ); 565 m_acTEncTop[layer].setRecoveryPointSEIEnabled ( m_recoveryPointSEIEnabled ); 566 m_acTEncTop[layer].setBufferingPeriodSEIEnabled ( m_bufferingPeriodSEIEnabled ); 567 m_acTEncTop[layer].setPictureTimingSEIEnabled ( m_pictureTimingSEIEnabled ); 568 m_acTEncTop[layer].setToneMappingInfoSEIEnabled ( m_toneMappingInfoSEIEnabled ); 569 m_acTEncTop[layer].setTMISEIToneMapId ( m_toneMapId ); 570 m_acTEncTop[layer].setTMISEIToneMapCancelFlag ( m_toneMapCancelFlag ); 571 m_acTEncTop[layer].setTMISEIToneMapPersistenceFlag ( m_toneMapPersistenceFlag ); 572 m_acTEncTop[layer].setTMISEICodedDataBitDepth ( m_toneMapCodedDataBitDepth ); 573 m_acTEncTop[layer].setTMISEITargetBitDepth ( m_toneMapTargetBitDepth ); 574 m_acTEncTop[layer].setTMISEIModelID ( m_toneMapModelId ); 575 m_acTEncTop[layer].setTMISEIMinValue ( m_toneMapMinValue ); 576 m_acTEncTop[layer].setTMISEIMaxValue ( m_toneMapMaxValue ); 577 m_acTEncTop[layer].setTMISEISigmoidMidpoint ( m_sigmoidMidpoint ); 578 m_acTEncTop[layer].setTMISEISigmoidWidth ( m_sigmoidWidth ); 579 m_acTEncTop[layer].setTMISEIStartOfCodedInterva ( m_startOfCodedInterval ); 580 m_acTEncTop[layer].setTMISEINumPivots ( m_numPivots ); 581 m_acTEncTop[layer].setTMISEICodedPivotValue ( m_codedPivotValue ); 582 m_acTEncTop[layer].setTMISEITargetPivotValue ( m_targetPivotValue ); 583 m_acTEncTop[layer].setTMISEICameraIsoSpeedIdc ( m_cameraIsoSpeedIdc ); 584 m_acTEncTop[layer].setTMISEICameraIsoSpeedValue ( m_cameraIsoSpeedValue ); 585 m_acTEncTop[layer].setTMISEIExposureIndexIdc ( m_exposureIndexIdc ); 586 m_acTEncTop[layer].setTMISEIExposureIndexValue ( m_exposureIndexValue ); 587 m_acTEncTop[layer].setTMISEIExposureCompensationValueSignFlag ( m_exposureCompensationValueSignFlag ); 588 m_acTEncTop[layer].setTMISEIExposureCompensationValueNumerator ( m_exposureCompensationValueNumerator ); 589 m_acTEncTop[layer].setTMISEIExposureCompensationValueDenomIdc ( m_exposureCompensationValueDenomIdc ); 590 m_acTEncTop[layer].setTMISEIRefScreenLuminanceWhite ( m_refScreenLuminanceWhite ); 591 m_acTEncTop[layer].setTMISEIExtendedRangeWhiteLevel ( m_extendedRangeWhiteLevel ); 592 m_acTEncTop[layer].setTMISEINominalBlackLevelLumaCodeValue ( m_nominalBlackLevelLumaCodeValue ); 593 m_acTEncTop[layer].setTMISEINominalWhiteLevelLumaCodeValue ( m_nominalWhiteLevelLumaCodeValue ); 594 m_acTEncTop[layer].setTMISEIExtendedWhiteLevelLumaCodeValue ( m_extendedWhiteLevelLumaCodeValue ); 595 m_acTEncTop[layer].setChromaSamplingFilterHintEnabled ( m_chromaSamplingFilterSEIenabled ); 596 m_acTEncTop[layer].setChromaSamplingHorFilterIdc ( m_chromaSamplingHorFilterIdc ); 597 m_acTEncTop[layer].setChromaSamplingVerFilterIdc ( m_chromaSamplingVerFilterIdc ); 598 m_acTEncTop[layer].setFramePackingArrangementSEIEnabled ( m_framePackingSEIEnabled ); 599 m_acTEncTop[layer].setFramePackingArrangementSEIType ( m_framePackingSEIType ); 600 m_acTEncTop[layer].setFramePackingArrangementSEIId ( m_framePackingSEIId ); 601 m_acTEncTop[layer].setFramePackingArrangementSEIQuincunx ( m_framePackingSEIQuincunx ); 602 m_acTEncTop[layer].setFramePackingArrangementSEIInterpretation ( m_framePackingSEIInterpretation ); 603 m_acTEncTop[layer].setSegmentedRectFramePackingArrangementSEIEnabled ( m_segmentedRectFramePackingSEIEnabled ); 604 m_acTEncTop[layer].setSegmentedRectFramePackingArrangementSEICancel ( m_segmentedRectFramePackingSEICancel ); 605 m_acTEncTop[layer].setSegmentedRectFramePackingArrangementSEIType ( m_segmentedRectFramePackingSEIType ); 606 m_acTEncTop[layer].setSegmentedRectFramePackingArrangementSEIPersistence( m_segmentedRectFramePackingSEIPersistence ); 607 m_acTEncTop[layer].setDisplayOrientationSEIAngle ( m_displayOrientationSEIAngle ); 608 m_acTEncTop[layer].setTemporalLevel0IndexSEIEnabled ( m_temporalLevel0IndexSEIEnabled ); 609 m_acTEncTop[layer].setGradualDecodingRefreshInfoEnabled ( m_gradualDecodingRefreshInfoEnabled ); 610 m_acTEncTop[layer].setNoDisplaySEITLayer ( m_noDisplaySEITLayer ); 611 m_acTEncTop[layer].setDecodingUnitInfoSEIEnabled ( m_decodingUnitInfoSEIEnabled ); 612 m_acTEncTop[layer].setSOPDescriptionSEIEnabled ( m_SOPDescriptionSEIEnabled ); 613 m_acTEncTop[layer].setScalableNestingSEIEnabled ( m_scalableNestingSEIEnabled ); 614 m_acTEncTop[layer].setTMCTSSEIEnabled ( m_tmctsSEIEnabled ); 615 m_acTEncTop[layer].setTimeCodeSEIEnabled ( m_timeCodeSEIEnabled ); 616 m_acTEncTop[layer].setNumberOfTimeSets ( m_timeCodeSEINumTs ); 617 for(Int i = 0; i < m_timeCodeSEINumTs; i++) { m_acTEncTop[layer].setTimeSet(m_timeSetArray[i], i); } 618 m_acTEncTop[layer].setKneeSEIEnabled ( m_kneeSEIEnabled ); 619 m_acTEncTop[layer].setKneeSEIId ( m_kneeSEIId ); 620 m_acTEncTop[layer].setKneeSEICancelFlag ( m_kneeSEICancelFlag ); 621 m_acTEncTop[layer].setKneeSEIPersistenceFlag ( m_kneeSEIPersistenceFlag ); 622 m_acTEncTop[layer].setKneeSEIInputDrange ( m_kneeSEIInputDrange ); 623 m_acTEncTop[layer].setKneeSEIInputDispLuminance ( m_kneeSEIInputDispLuminance ); 624 m_acTEncTop[layer].setKneeSEIOutputDrange ( m_kneeSEIOutputDrange ); 625 m_acTEncTop[layer].setKneeSEIOutputDispLuminance ( m_kneeSEIOutputDispLuminance ); 626 m_acTEncTop[layer].setKneeSEINumKneePointsMinus1 ( m_kneeSEINumKneePointsMinus1 ); 627 m_acTEncTop[layer].setKneeSEIInputKneePoint ( m_kneeSEIInputKneePoint ); 628 m_acTEncTop[layer].setKneeSEIOutputKneePoint ( m_kneeSEIOutputKneePoint ); 629 m_acTEncTop[layer].setMasteringDisplaySEI ( m_masteringDisplay ); 591 630 #if Q0096_OVERLAY_SEI 592 m_acTEncTop[layer].setOverlaySEIEnabled ( m_overlaySEIEnabled );593 m_acTEncTop[layer].setOverlaySEICancelFlag ( m_overlayInfoCancelFlag );594 m_acTEncTop[layer].setOverlaySEIContentAuxIdMinus128 ( m_overlayContentAuxIdMinus128 );595 m_acTEncTop[layer].setOverlaySEILabelAuxIdMinus128 ( m_overlayLabelAuxIdMinus128 );596 m_acTEncTop[layer].setOverlaySEIAlphaAuxIdMinus128 ( m_overlayAlphaAuxIdMinus128 );597 m_acTEncTop[layer].setOverlaySEIElementLabelValueLengthMinus8 ( m_overlayElementLabelValueLengthMinus8 );598 m_acTEncTop[layer].setOverlaySEINumOverlaysMinus1 ( m_numOverlaysMinus1 );599 m_acTEncTop[layer].setOverlaySEIIdx ( m_overlayIdx );600 m_acTEncTop[layer].setOverlaySEILanguagePresentFlag ( m_overlayLanguagePresentFlag );601 m_acTEncTop[layer].setOverlaySEIContentLayerId ( m_overlayContentLayerId );602 m_acTEncTop[layer].setOverlaySEILabelPresentFlag ( m_overlayLabelPresentFlag );603 m_acTEncTop[layer].setOverlaySEILabelLayerId ( m_overlayLabelLayerId );604 m_acTEncTop[layer].setOverlaySEIAlphaPresentFlag ( m_overlayAlphaPresentFlag );605 m_acTEncTop[layer].setOverlaySEIAlphaLayerId ( m_overlayAlphaLayerId );606 m_acTEncTop[layer].setOverlaySEINumElementsMinus1 ( m_numOverlayElementsMinus1 );607 m_acTEncTop[layer].setOverlaySEIElementLabelMin ( m_overlayElementLabelMin );608 m_acTEncTop[layer].setOverlaySEIElementLabelMax ( m_overlayElementLabelMax );609 m_acTEncTop[layer].setOverlaySEILanguage ( m_overlayLanguage );610 m_acTEncTop[layer].setOverlaySEIName ( m_overlayName );611 m_acTEncTop[layer].setOverlaySEIElementName ( m_overlayElementName );612 m_acTEncTop[layer].setOverlaySEIPersistenceFlag ( m_overlayInfoPersistenceFlag );631 m_acTEncTop[layer].setOverlaySEIEnabled ( m_overlaySEIEnabled ); 632 m_acTEncTop[layer].setOverlaySEICancelFlag ( m_overlayInfoCancelFlag ); 633 m_acTEncTop[layer].setOverlaySEIContentAuxIdMinus128 ( m_overlayContentAuxIdMinus128 ); 634 m_acTEncTop[layer].setOverlaySEILabelAuxIdMinus128 ( m_overlayLabelAuxIdMinus128 ); 635 m_acTEncTop[layer].setOverlaySEIAlphaAuxIdMinus128 ( m_overlayAlphaAuxIdMinus128 ); 636 m_acTEncTop[layer].setOverlaySEIElementLabelValueLengthMinus8 ( m_overlayElementLabelValueLengthMinus8 ); 637 m_acTEncTop[layer].setOverlaySEINumOverlaysMinus1 ( m_numOverlaysMinus1 ); 638 m_acTEncTop[layer].setOverlaySEIIdx ( m_overlayIdx ); 639 m_acTEncTop[layer].setOverlaySEILanguagePresentFlag ( m_overlayLanguagePresentFlag ); 640 m_acTEncTop[layer].setOverlaySEIContentLayerId ( m_overlayContentLayerId ); 641 m_acTEncTop[layer].setOverlaySEILabelPresentFlag ( m_overlayLabelPresentFlag ); 642 m_acTEncTop[layer].setOverlaySEILabelLayerId ( m_overlayLabelLayerId ); 643 m_acTEncTop[layer].setOverlaySEIAlphaPresentFlag ( m_overlayAlphaPresentFlag ); 644 m_acTEncTop[layer].setOverlaySEIAlphaLayerId ( m_overlayAlphaLayerId ); 645 m_acTEncTop[layer].setOverlaySEINumElementsMinus1 ( m_numOverlayElementsMinus1 ); 646 m_acTEncTop[layer].setOverlaySEIElementLabelMin ( m_overlayElementLabelMin ); 647 m_acTEncTop[layer].setOverlaySEIElementLabelMax ( m_overlayElementLabelMax ); 648 m_acTEncTop[layer].setOverlaySEILanguage ( m_overlayLanguage ); 649 m_acTEncTop[layer].setOverlaySEIName ( m_overlayName ); 650 m_acTEncTop[layer].setOverlaySEIElementName ( m_overlayElementName ); 651 m_acTEncTop[layer].setOverlaySEIPersistenceFlag ( m_overlayInfoPersistenceFlag ); 613 652 #endif 614 653 #if Q0074_COLOUR_REMAPPING_SEI 615 m_acTEncTop[layer].setCRISEIFile ( const_cast<Char*>(m_acLayerCfg[layer].m_colourRemapSEIFile.c_str()) ); 616 m_acTEncTop[layer].setCRISEIId ( m_acLayerCfg[layer].m_colourRemapSEIId ); 617 m_acTEncTop[layer].setCRISEICancelFlag ( m_acLayerCfg[layer].m_colourRemapSEICancelFlag ); 618 m_acTEncTop[layer].setCRISEIPersistenceFlag ( m_acLayerCfg[layer].m_colourRemapSEIPersistenceFlag ); 619 m_acTEncTop[layer].setCRISEIVideoSignalInfoPresentFlag ( m_acLayerCfg[layer].m_colourRemapSEIVideoSignalInfoPresentFlag ); 620 m_acTEncTop[layer].setCRISEIFullRangeFlag ( m_acLayerCfg[layer].m_colourRemapSEIFullRangeFlag ); 621 m_acTEncTop[layer].setCRISEIPrimaries ( m_acLayerCfg[layer].m_colourRemapSEIPrimaries ); 622 m_acTEncTop[layer].setCRISEITransferFunction ( m_acLayerCfg[layer].m_colourRemapSEITransferFunction ); 623 m_acTEncTop[layer].setCRISEIMatrixCoefficients ( m_acLayerCfg[layer].m_colourRemapSEIMatrixCoefficients ); 624 m_acTEncTop[layer].setCRISEIInputBitDepth ( m_acLayerCfg[layer].m_colourRemapSEIInputBitDepth ); 625 m_acTEncTop[layer].setCRISEIBitDepth ( m_acLayerCfg[layer].m_colourRemapSEIBitDepth ); 626 m_acTEncTop[layer].setCRISEIPreLutNumValMinus1 ( m_acLayerCfg[layer].m_colourRemapSEIPreLutNumValMinus1 ); 627 m_acTEncTop[layer].setCRISEIPreLutCodedValue ( m_acLayerCfg[layer].m_colourRemapSEIPreLutCodedValue ); 628 m_acTEncTop[layer].setCRISEIPreLutTargetValue ( m_acLayerCfg[layer].m_colourRemapSEIPreLutTargetValue ); 629 m_acTEncTop[layer].setCRISEIMatrixPresentFlag ( m_acLayerCfg[layer].m_colourRemapSEIMatrixPresentFlag ); 630 m_acTEncTop[layer].setCRISEILog2MatrixDenom ( m_acLayerCfg[layer].m_colourRemapSEILog2MatrixDenom ); 631 m_acTEncTop[layer].setCRISEICoeffs ( m_acLayerCfg[layer].m_colourRemapSEICoeffs ); 632 m_acTEncTop[layer].setCRISEIPostLutNumValMinus1 ( m_acLayerCfg[layer].m_colourRemapSEIPostLutNumValMinus1 ); 633 m_acTEncTop[layer].setCRISEIPostLutCodedValue ( m_acLayerCfg[layer]. m_colourRemapSEIPostLutCodedValue ); 634 m_acTEncTop[layer].setCRISEIPostLutTargetValue ( m_acLayerCfg[layer].m_colourRemapSEIPostLutTargetValue ); 635 #endif 636 m_acTEncTop[layer].setFramePackingArrangementSEIEnabled( m_framePackingSEIEnabled ); 637 m_acTEncTop[layer].setFramePackingArrangementSEIType( m_framePackingSEIType ); 638 m_acTEncTop[layer].setFramePackingArrangementSEIId( m_framePackingSEIId ); 639 m_acTEncTop[layer].setFramePackingArrangementSEIQuincunx( m_framePackingSEIQuincunx ); 640 m_acTEncTop[layer].setFramePackingArrangementSEIInterpretation( m_framePackingSEIInterpretation ); 641 m_acTEncTop[layer].setDisplayOrientationSEIAngle( m_displayOrientationSEIAngle ); 642 m_acTEncTop[layer].setTemporalLevel0IndexSEIEnabled( m_temporalLevel0IndexSEIEnabled ); 643 m_acTEncTop[layer].setGradualDecodingRefreshInfoEnabled( m_gradualDecodingRefreshInfoEnabled ); 644 m_acTEncTop[layer].setDecodingUnitInfoSEIEnabled( m_decodingUnitInfoSEIEnabled ); 654 m_acTEncTop[layer].setCRISEIFile ( const_cast<Char*>(m_acLayerCfg[layer].m_colourRemapSEIFile.c_str()) ); 655 m_acTEncTop[layer].setCRISEIId ( m_acLayerCfg[layer].m_colourRemapSEIId ); 656 m_acTEncTop[layer].setCRISEICancelFlag ( m_acLayerCfg[layer].m_colourRemapSEICancelFlag ); 657 m_acTEncTop[layer].setCRISEIPersistenceFlag ( m_acLayerCfg[layer].m_colourRemapSEIPersistenceFlag ); 658 m_acTEncTop[layer].setCRISEIVideoSignalInfoPresentFlag ( m_acLayerCfg[layer].m_colourRemapSEIVideoSignalInfoPresentFlag ); 659 m_acTEncTop[layer].setCRISEIFullRangeFlag ( m_acLayerCfg[layer].m_colourRemapSEIFullRangeFlag ); 660 m_acTEncTop[layer].setCRISEIPrimaries ( m_acLayerCfg[layer].m_colourRemapSEIPrimaries ); 661 m_acTEncTop[layer].setCRISEITransferFunction ( m_acLayerCfg[layer].m_colourRemapSEITransferFunction ); 662 m_acTEncTop[layer].setCRISEIMatrixCoefficients ( m_acLayerCfg[layer].m_colourRemapSEIMatrixCoefficients ); 663 m_acTEncTop[layer].setCRISEIInputBitDepth ( m_acLayerCfg[layer].m_colourRemapSEIInputBitDepth ); 664 m_acTEncTop[layer].setCRISEIBitDepth ( m_acLayerCfg[layer].m_colourRemapSEIBitDepth ); 665 m_acTEncTop[layer].setCRISEIPreLutNumValMinus1 ( m_acLayerCfg[layer].m_colourRemapSEIPreLutNumValMinus1 ); 666 m_acTEncTop[layer].setCRISEIPreLutCodedValue ( m_acLayerCfg[layer].m_colourRemapSEIPreLutCodedValue ); 667 m_acTEncTop[layer].setCRISEIPreLutTargetValue ( m_acLayerCfg[layer].m_colourRemapSEIPreLutTargetValue ); 668 m_acTEncTop[layer].setCRISEIMatrixPresentFlag ( m_acLayerCfg[layer].m_colourRemapSEIMatrixPresentFlag ); 669 m_acTEncTop[layer].setCRISEILog2MatrixDenom ( m_acLayerCfg[layer].m_colourRemapSEILog2MatrixDenom ); 670 m_acTEncTop[layer].setCRISEICoeffs ( m_acLayerCfg[layer].m_colourRemapSEICoeffs ); 671 m_acTEncTop[layer].setCRISEIPostLutNumValMinus1 ( m_acLayerCfg[layer].m_colourRemapSEIPostLutNumValMinus1 ); 672 m_acTEncTop[layer].setCRISEIPostLutCodedValue ( m_acLayerCfg[layer]. m_colourRemapSEIPostLutCodedValue ); 673 m_acTEncTop[layer].setCRISEIPostLutTargetValue ( m_acLayerCfg[layer].m_colourRemapSEIPostLutTargetValue ); 674 #endif 645 675 #if LAYERS_NOT_PRESENT_SEI 646 m_acTEncTop[layer].setLayersNotPresentSEIEnabled( m_layersNotPresentSEIEnabled ); 647 #endif 648 m_acTEncTop[layer].setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled ); 649 m_acTEncTop[layer].setScalableNestingSEIEnabled( m_scalableNestingSEIEnabled ); 676 m_acTEncTop[layer].setLayersNotPresentSEIEnabled ( m_layersNotPresentSEIEnabled ); 677 #endif 650 678 #if Q0189_TMVP_CONSTRAINTS 651 m_acTEncTop[layer].setTMVPConstraintsSEIEnabled ( m_TMVPConstraintsSEIEnabled);679 m_acTEncTop[layer].setTMVPConstraintsSEIEnabled ( m_TMVPConstraintsSEIEnabled); 652 680 #endif 653 681 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 654 682 m_acTEncTop[layer].setInterLayerConstrainedTileSetsSEIEnabled( m_interLayerConstrainedTileSetsSEIEnabled ); 655 m_acTEncTop[layer].setIlNumSetsInMessage ( m_ilNumSetsInMessage );656 m_acTEncTop[layer].setSkippedTileSetPresentFlag ( m_skippedTileSetPresentFlag );657 m_acTEncTop[layer].setTopLeftTileIndex ( m_topLeftTileIndex );658 m_acTEncTop[layer].setBottomRightTileIndex ( m_bottomRightTileIndex );659 m_acTEncTop[layer].setIlcIdc ( m_ilcIdc );660 #endif 661 m_acTEncTop[layer].setTileUniformSpacingFlag ( m_tileUniformSpacingFlag );662 m_acTEncTop[layer].setNumColumnsMinus1 ( m_numTileColumnsMinus1 );663 m_acTEncTop[layer].setNumRowsMinus1 ( m_numTileRowsMinus1 );683 m_acTEncTop[layer].setIlNumSetsInMessage ( m_ilNumSetsInMessage ); 684 m_acTEncTop[layer].setSkippedTileSetPresentFlag ( m_skippedTileSetPresentFlag ); 685 m_acTEncTop[layer].setTopLeftTileIndex ( m_topLeftTileIndex ); 686 m_acTEncTop[layer].setBottomRightTileIndex ( m_bottomRightTileIndex ); 687 m_acTEncTop[layer].setIlcIdc ( m_ilcIdc ); 688 #endif 689 m_acTEncTop[layer].setTileUniformSpacingFlag ( m_tileUniformSpacingFlag ); 690 m_acTEncTop[layer].setNumColumnsMinus1 ( m_numTileColumnsMinus1 ); 691 m_acTEncTop[layer].setNumRowsMinus1 ( m_numTileRowsMinus1 ); 664 692 if(!m_tileUniformSpacingFlag) 665 693 { 666 m_acTEncTop[layer].setColumnWidth ( m_tileColumnWidth );667 m_acTEncTop[layer].setRowHeight ( m_tileRowHeight );694 m_acTEncTop[layer].setColumnWidth ( m_tileColumnWidth ); 695 m_acTEncTop[layer].setRowHeight ( m_tileRowHeight ); 668 696 } 669 697 m_acTEncTop[layer].xCheckGSParameters(); … … 673 701 m_bLFCrossTileBoundaryFlag = true; 674 702 } 675 m_acTEncTop[layer].setLFCrossTileBoundaryFlag ( m_bLFCrossTileBoundaryFlag );676 m_acTEncTop[layer].setWaveFrontSynchro ( m_acLayerCfg[layer].m_waveFrontSynchro );677 m_acTEncTop[layer].setWaveFrontSubstreams ( m_acLayerCfg[layer].m_iWaveFrontSubstreams );678 m_acTEncTop[layer].setTMVPModeId ( m_TMVPModeId );679 m_acTEncTop[layer].setUseScalingListId ( m_useScalingListId );680 m_acTEncTop[layer].setScalingListFile ( m_scalingListFile );681 m_acTEncTop[layer].setSignHideFlag (m_signHideFlag);703 m_acTEncTop[layer].setLFCrossTileBoundaryFlag ( m_bLFCrossTileBoundaryFlag ); 704 m_acTEncTop[layer].setWaveFrontSynchro ( m_acLayerCfg[layer].m_waveFrontSynchro ); 705 m_acTEncTop[layer].setWaveFrontSubstreams ( m_acLayerCfg[layer].m_iWaveFrontSubstreams ); 706 m_acTEncTop[layer].setTMVPModeId ( m_TMVPModeId ); 707 m_acTEncTop[layer].setUseScalingListId ( m_useScalingListId ); 708 m_acTEncTop[layer].setScalingListFile ( m_scalingListFile ); 709 m_acTEncTop[layer].setSignHideFlag ( m_signHideFlag ); 682 710 #if RC_SHVC_HARMONIZATION 683 m_acTEncTop[layer].setUseRateCtrl (m_acLayerCfg[layer].getRCEnableRateControl()); 684 m_acTEncTop[layer].setTargetBitrate (m_acLayerCfg[layer].getRCTargetBitrate()); 685 m_acTEncTop[layer].setKeepHierBit (m_acLayerCfg[layer].getRCKeepHierarchicalBit()); 686 m_acTEncTop[layer].setLCULevelRC (m_acLayerCfg[layer].getRCLCULevelRC()); 687 m_acTEncTop[layer].setUseLCUSeparateModel (m_acLayerCfg[layer].getRCUseLCUSeparateModel()); 688 m_acTEncTop[layer].setInitialQP (m_acLayerCfg[layer].getRCInitialQP()); 689 m_acTEncTop[layer].setForceIntraQP (m_acLayerCfg[layer].getRCForceIntraQP()); 690 #else 691 m_acTEncTop[layer].setUseRateCtrl ( m_RCEnableRateControl ); 692 m_acTEncTop[layer].setTargetBitrate ( m_RCTargetBitrate ); 693 m_acTEncTop[layer].setKeepHierBit ( m_RCKeepHierarchicalBit ); 694 m_acTEncTop[layer].setLCULevelRC ( m_RCLCULevelRC ); 695 m_acTEncTop[layer].setUseLCUSeparateModel ( m_RCUseLCUSeparateModel ); 696 m_acTEncTop[layer].setInitialQP ( m_RCInitialQP ); 697 m_acTEncTop[layer].setForceIntraQP ( m_RCForceIntraQP ); 698 #endif 699 m_acTEncTop[layer].setTransquantBypassEnableFlag(m_TransquantBypassEnableFlag); 700 m_acTEncTop[layer].setCUTransquantBypassFlagForceValue(m_CUTransquantBypassFlagForce); 701 m_acTEncTop[layer].setUseRecalculateQPAccordingToLambda( m_recalculateQPAccordingToLambda ); 702 m_acTEncTop[layer].setUseStrongIntraSmoothing( m_useStrongIntraSmoothing ); 703 m_acTEncTop[layer].setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 704 m_acTEncTop[layer].setVuiParametersPresentFlag( m_vuiParametersPresentFlag ); 705 m_acTEncTop[layer].setAspectRatioInfoPresentFlag( m_aspectRatioInfoPresentFlag); 706 m_acTEncTop[layer].setAspectRatioIdc( m_aspectRatioIdc ); 707 m_acTEncTop[layer].setSarWidth( m_sarWidth ); 708 m_acTEncTop[layer].setSarHeight( m_sarHeight ); 709 m_acTEncTop[layer].setOverscanInfoPresentFlag( m_overscanInfoPresentFlag ); 710 m_acTEncTop[layer].setOverscanAppropriateFlag( m_overscanAppropriateFlag ); 711 m_acTEncTop[layer].setVideoSignalTypePresentFlag( m_videoSignalTypePresentFlag ); 712 m_acTEncTop[layer].setVideoFormat( m_videoFormat ); 713 m_acTEncTop[layer].setVideoFullRangeFlag( m_videoFullRangeFlag ); 714 m_acTEncTop[layer].setColourDescriptionPresentFlag( m_colourDescriptionPresentFlag ); 715 m_acTEncTop[layer].setColourPrimaries( m_colourPrimaries ); 716 m_acTEncTop[layer].setTransferCharacteristics( m_transferCharacteristics ); 717 m_acTEncTop[layer].setMatrixCoefficients( m_matrixCoefficients ); 718 m_acTEncTop[layer].setChromaLocInfoPresentFlag( m_chromaLocInfoPresentFlag ); 719 m_acTEncTop[layer].setChromaSampleLocTypeTopField( m_chromaSampleLocTypeTopField ); 720 m_acTEncTop[layer].setChromaSampleLocTypeBottomField( m_chromaSampleLocTypeBottomField ); 721 m_acTEncTop[layer].setNeutralChromaIndicationFlag( m_neutralChromaIndicationFlag ); 722 m_acTEncTop[layer].setDefaultDisplayWindow( m_defDispWinLeftOffset, m_defDispWinRightOffset, m_defDispWinTopOffset, m_defDispWinBottomOffset ); 723 m_acTEncTop[layer].setFrameFieldInfoPresentFlag( m_frameFieldInfoPresentFlag ); 724 m_acTEncTop[layer].setPocProportionalToTimingFlag( m_pocProportionalToTimingFlag ); 725 m_acTEncTop[layer].setNumTicksPocDiffOneMinus1 ( m_numTicksPocDiffOneMinus1 ); 726 m_acTEncTop[layer].setBitstreamRestrictionFlag( m_bitstreamRestrictionFlag ); 727 m_acTEncTop[layer].setTilesFixedStructureFlag( m_tilesFixedStructureFlag ); 728 m_acTEncTop[layer].setMotionVectorsOverPicBoundariesFlag( m_motionVectorsOverPicBoundariesFlag ); 729 m_acTEncTop[layer].setMinSpatialSegmentationIdc( m_minSpatialSegmentationIdc ); 730 m_acTEncTop[layer].setMaxBytesPerPicDenom( m_maxBytesPerPicDenom ); 731 m_acTEncTop[layer].setMaxBitsPerMinCuDenom( m_maxBitsPerMinCuDenom ); 732 m_acTEncTop[layer].setLog2MaxMvLengthHorizontal( m_log2MaxMvLengthHorizontal ); 733 m_acTEncTop[layer].setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical ); 734 m_acTEncTop[layer].setElRapSliceTypeB(layer == 0? 0 : m_elRapSliceBEnabled); 711 m_acTEncTop[layer].setUseRateCtrl ( m_acLayerCfg[layer].getRCEnableRateControl() ); 712 m_acTEncTop[layer].setTargetBitrate ( m_acLayerCfg[layer].getRCTargetBitrate() ); 713 m_acTEncTop[layer].setKeepHierBit ( m_acLayerCfg[layer].getRCKeepHierarchicalBit() ); 714 m_acTEncTop[layer].setLCULevelRC ( m_acLayerCfg[layer].getRCLCULevelRC() ); 715 m_acTEncTop[layer].setUseLCUSeparateModel ( m_acLayerCfg[layer].getRCUseLCUSeparateModel() ); 716 m_acTEncTop[layer].setInitialQP ( m_acLayerCfg[layer].getRCInitialQP() ); 717 m_acTEncTop[layer].setForceIntraQP ( m_acLayerCfg[layer].getRCForceIntraQP() ); 718 #else 719 m_acTEncTop[layer].setUseRateCtrl ( m_RCEnableRateControl ); 720 m_acTEncTop[layer].setTargetBitrate ( m_RCTargetBitrate ); 721 m_acTEncTop[layer].setKeepHierBit ( m_RCKeepHierarchicalBit ); 722 m_acTEncTop[layer].setLCULevelRC ( m_RCLCULevelRC ); 723 m_acTEncTop[layer].setUseLCUSeparateModel ( m_RCUseLCUSeparateModel ); 724 m_acTEncTop[layer].setInitialQP ( m_RCInitialQP ); 725 m_acTEncTop[layer].setForceIntraQP ( m_RCForceIntraQP ); 726 #endif 727 m_acTEncTop[layer].setTransquantBypassEnableFlag ( m_TransquantBypassEnableFlag ); 728 m_acTEncTop[layer].setCUTransquantBypassFlagForceValue ( m_CUTransquantBypassFlagForce ); 729 m_acTEncTop[layer].setCostMode ( m_costMode ); 730 m_acTEncTop[layer].setUseRecalculateQPAccordingToLambda ( m_recalculateQPAccordingToLambda ); 731 m_acTEncTop[layer].setUseStrongIntraSmoothing ( m_useStrongIntraSmoothing ); 732 m_acTEncTop[layer].setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 733 m_acTEncTop[layer].setVuiParametersPresentFlag ( m_vuiParametersPresentFlag ); 734 m_acTEncTop[layer].setAspectRatioInfoPresentFlag ( m_aspectRatioInfoPresentFlag); 735 m_acTEncTop[layer].setAspectRatioIdc ( m_aspectRatioIdc ); 736 m_acTEncTop[layer].setSarWidth ( m_sarWidth ); 737 m_acTEncTop[layer].setSarHeight ( m_sarHeight ); 738 m_acTEncTop[layer].setOverscanInfoPresentFlag ( m_overscanInfoPresentFlag ); 739 m_acTEncTop[layer].setOverscanAppropriateFlag ( m_overscanAppropriateFlag ); 740 m_acTEncTop[layer].setVideoSignalTypePresentFlag ( m_videoSignalTypePresentFlag ); 741 m_acTEncTop[layer].setVideoFormat ( m_videoFormat ); 742 m_acTEncTop[layer].setVideoFullRangeFlag ( m_videoFullRangeFlag ); 743 m_acTEncTop[layer].setColourDescriptionPresentFlag ( m_colourDescriptionPresentFlag ); 744 m_acTEncTop[layer].setColourPrimaries ( m_colourPrimaries ); 745 m_acTEncTop[layer].setTransferCharacteristics ( m_transferCharacteristics ); 746 m_acTEncTop[layer].setMatrixCoefficients ( m_matrixCoefficients ); 747 m_acTEncTop[layer].setChromaLocInfoPresentFlag ( m_chromaLocInfoPresentFlag ); 748 m_acTEncTop[layer].setChromaSampleLocTypeTopField ( m_chromaSampleLocTypeTopField ); 749 m_acTEncTop[layer].setChromaSampleLocTypeBottomField ( m_chromaSampleLocTypeBottomField ); 750 m_acTEncTop[layer].setNeutralChromaIndicationFlag ( m_neutralChromaIndicationFlag ); 751 m_acTEncTop[layer].setDefaultDisplayWindow ( m_defDispWinLeftOffset, m_defDispWinRightOffset, m_defDispWinTopOffset, m_defDispWinBottomOffset ); 752 m_acTEncTop[layer].setFrameFieldInfoPresentFlag ( m_frameFieldInfoPresentFlag ); 753 m_acTEncTop[layer].setPocProportionalToTimingFlag ( m_pocProportionalToTimingFlag ); 754 m_acTEncTop[layer].setNumTicksPocDiffOneMinus1 ( m_numTicksPocDiffOneMinus1 ); 755 m_acTEncTop[layer].setBitstreamRestrictionFlag ( m_bitstreamRestrictionFlag ); 756 m_acTEncTop[layer].setTilesFixedStructureFlag ( m_tilesFixedStructureFlag ); 757 m_acTEncTop[layer].setMotionVectorsOverPicBoundariesFlag ( m_motionVectorsOverPicBoundariesFlag ); 758 m_acTEncTop[layer].setMinSpatialSegmentationIdc ( m_minSpatialSegmentationIdc ); 759 m_acTEncTop[layer].setMaxBytesPerPicDenom ( m_maxBytesPerPicDenom ); 760 m_acTEncTop[layer].setMaxBitsPerMinCuDenom ( m_maxBitsPerMinCuDenom ); 761 m_acTEncTop[layer].setLog2MaxMvLengthHorizontal ( m_log2MaxMvLengthHorizontal ); 762 m_acTEncTop[layer].setLog2MaxMvLengthVertical ( m_log2MaxMvLengthVertical ); 763 m_acTEncTop[layer].setElRapSliceTypeB (layer == 0? 0 : m_elRapSliceBEnabled); 735 764 if( layer > 0 ) 736 765 { … … 745 774 #endif 746 775 #endif 747 m_acTEncTop[layer].setNumScaledRefLayerOffsets ( m_acLayerCfg[layer].m_numScaledRefLayerOffsets );776 m_acTEncTop[layer].setNumScaledRefLayerOffsets ( m_acLayerCfg[layer].m_numScaledRefLayerOffsets ); 748 777 for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) 749 778 { 750 779 #if O0098_SCALED_REF_LAYER_ID 751 m_acTEncTop[layer].setScaledRefLayerId (i, m_acLayerCfg[layer].m_scaledRefLayerId[i]);780 m_acTEncTop[layer].setScaledRefLayerId (i, m_acLayerCfg[layer].m_scaledRefLayerId[i]); 752 781 #endif 753 782 #if REF_REGION_OFFSET 754 m_acTEncTop[layer].setScaledRefLayerOffsetPresentFlag ( i, m_acLayerCfg[layer].m_scaledRefLayerOffsetPresentFlag[i] );755 m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow ( subWidthC * m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], subWidthC * m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i],756 subHeightC * m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], subHeightC * m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]);783 m_acTEncTop[layer].setScaledRefLayerOffsetPresentFlag ( i, m_acLayerCfg[layer].m_scaledRefLayerOffsetPresentFlag[i] ); 784 m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow ( subWidthC * m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], subWidthC * m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i], 785 subHeightC * m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], subHeightC * m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]); 757 786 #else 758 787 #if P0312_VERT_PHASE_ADJ 759 m_acTEncTop[layer].setVertPhasePositionEnableFlag ( i, m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i] );760 m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow ( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i],761 2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i], m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i] );762 #else 763 m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow ( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i],764 2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]);788 m_acTEncTop[layer].setVertPhasePositionEnableFlag ( i, m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i] ); 789 m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow ( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i], 790 2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i], m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i] ); 791 #else 792 m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow ( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i], 793 2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]); 765 794 #endif 766 795 #endif 767 796 #if R0209_GENERIC_PHASE 768 m_acTEncTop[layer].setResamplePhaseSetPresentFlag ( i, m_acLayerCfg[layer].m_resamplePhaseSetPresentFlag[i] );769 m_acTEncTop[layer].setPhaseHorLuma ( i, m_acLayerCfg[layer].m_phaseHorLuma[i] );770 m_acTEncTop[layer].setPhaseVerLuma ( i, m_acLayerCfg[layer].m_phaseVerLuma[i] );771 m_acTEncTop[layer].setPhaseHorChroma ( i, m_acLayerCfg[layer].m_phaseHorChroma[i] );772 m_acTEncTop[layer].setPhaseVerChroma ( i, m_acLayerCfg[layer].m_phaseVerChroma[i] );797 m_acTEncTop[layer].setResamplePhaseSetPresentFlag ( i, m_acLayerCfg[layer].m_resamplePhaseSetPresentFlag[i] ); 798 m_acTEncTop[layer].setPhaseHorLuma ( i, m_acLayerCfg[layer].m_phaseHorLuma[i] ); 799 m_acTEncTop[layer].setPhaseVerLuma ( i, m_acLayerCfg[layer].m_phaseVerLuma[i] ); 800 m_acTEncTop[layer].setPhaseHorChroma ( i, m_acLayerCfg[layer].m_phaseHorChroma[i] ); 801 m_acTEncTop[layer].setPhaseVerChroma ( i, m_acLayerCfg[layer].m_phaseVerChroma[i] ); 773 802 #endif 774 803 } 775 804 } 776 805 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 777 m_acTEncTop[layer].setAdaptiveResolutionChange ( m_adaptiveResolutionChange );806 m_acTEncTop[layer].setAdaptiveResolutionChange ( m_adaptiveResolutionChange ); 778 807 #endif 779 808 #if R0071_IRAP_EOS_CROSS_LAYER_IMPACTS 780 m_acTEncTop[layer].setLayerSwitchOffBegin (m_acLayerCfg[layer].m_layerSwitchOffBegin);781 m_acTEncTop[layer].setLayerSwitchOffEnd (m_acLayerCfg[layer].m_layerSwitchOffEnd);809 m_acTEncTop[layer].setLayerSwitchOffBegin (m_acLayerCfg[layer].m_layerSwitchOffBegin); 810 m_acTEncTop[layer].setLayerSwitchOffEnd (m_acLayerCfg[layer].m_layerSwitchOffEnd); 782 811 #endif 783 812 #if AUXILIARY_PICTURES 784 m_acTEncTop[layer].setChromaFormatIDC ( m_acLayerCfg[layer].m_chromaFormatIDC );813 m_acTEncTop[layer].setChromaFormatIDC ( m_acLayerCfg[layer].m_chromaFormatIDC ); 785 814 #endif 786 815 #if O0153_ALT_OUTPUT_LAYER_FLAG 787 m_acTEncTop[layer].setAltOuputLayerFlag ( m_altOutputLayerFlag );816 m_acTEncTop[layer].setAltOuputLayerFlag ( m_altOutputLayerFlag ); 788 817 #endif 789 818 #if O0149_CROSS_LAYER_BLA_FLAG 790 m_acTEncTop[layer].setCrossLayerBLAFlag ( m_crossLayerBLAFlag );819 m_acTEncTop[layer].setCrossLayerBLAFlag ( m_crossLayerBLAFlag ); 791 820 #endif 792 821 #if Q0048_CGS_3D_ASYMLUT 793 m_acTEncTop[layer].setCGSFlag ( layer == 0 ? 0 : m_nCGSFlag );794 m_acTEncTop[layer].setCGSMaxOctantDepth ( m_nCGSMaxOctantDepth );795 m_acTEncTop[layer].setCGSMaxYPartNumLog2 ( m_nCGSMaxYPartNumLog2 );796 m_acTEncTop[layer].setCGSLUTBit ( m_nCGSLUTBit );822 m_acTEncTop[layer].setCGSFlag ( layer == 0 ? 0 : m_nCGSFlag ); 823 m_acTEncTop[layer].setCGSMaxOctantDepth ( m_nCGSMaxOctantDepth ); 824 m_acTEncTop[layer].setCGSMaxYPartNumLog2 ( m_nCGSMaxYPartNumLog2 ); 825 m_acTEncTop[layer].setCGSLUTBit ( m_nCGSLUTBit ); 797 826 #if R0151_CGS_3D_ASYMLUT_IMPROVE 798 m_acTEncTop[layer].setCGSAdaptChroma ( m_nCGSAdaptiveChroma );827 m_acTEncTop[layer].setCGSAdaptChroma ( m_nCGSAdaptiveChroma ); 799 828 #endif 800 829 #if R0179_ENC_OPT_3DLUT_SIZE 801 m_acTEncTop[layer].setCGSLutSizeRDO ( m_nCGSLutSizeRDO );830 m_acTEncTop[layer].setCGSLutSizeRDO ( m_nCGSLutSizeRDO ); 802 831 #endif 803 832 #endif 804 833 #if Q0078_ADD_LAYER_SETS 805 m_acTEncTop[layer].setNumAddLayerSets ( m_numAddLayerSets );834 m_acTEncTop[layer].setNumAddLayerSets ( m_numAddLayerSets ); 806 835 #endif 807 836 } … … 812 841 TComVPS vps; 813 842 814 vps.setMaxTLayers ( m_maxTempLayer );843 vps.setMaxTLayers ( m_maxTempLayer ); 815 844 if (m_maxTempLayer == 1) 816 845 { 817 846 vps.setTemporalNestingFlag(true); 818 847 } 819 vps.setMaxLayers ( 1 );848 vps.setMaxLayers ( 1 ); 820 849 for(Int i = 0; i < MAX_TLAYER; i++) 821 850 { 822 vps.setNumReorderPics ( m_numReorderPics[i], i );823 vps.setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i );851 vps.setNumReorderPics ( m_numReorderPics[i], i ); 852 vps.setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i ); 824 853 } 825 854 m_cTEncTop.setVPS(&vps); 826 855 827 m_cTEncTop.setProfile(m_profile); 828 m_cTEncTop.setLevel(m_levelTier, m_level); 829 m_cTEncTop.setProgressiveSourceFlag(m_progressiveSourceFlag); 830 m_cTEncTop.setInterlacedSourceFlag(m_interlacedSourceFlag); 831 m_cTEncTop.setNonPackedConstraintFlag(m_nonPackedConstraintFlag); 832 m_cTEncTop.setFrameOnlyConstraintFlag(m_frameOnlyConstraintFlag); 833 834 m_cTEncTop.setFrameRate ( m_iFrameRate ); 835 m_cTEncTop.setFrameSkip ( m_FrameSkip ); 836 m_cTEncTop.setSourceWidth ( m_iSourceWidth ); 837 m_cTEncTop.setSourceHeight ( m_iSourceHeight ); 838 m_cTEncTop.setConformanceWindow ( m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom ); 839 m_cTEncTop.setFramesToBeEncoded ( m_framesToBeEncoded ); 856 m_cTEncTop.setProfile ( m_profile); 857 m_cTEncTop.setLevel ( m_levelTier, m_level); 858 m_cTEncTop.setProgressiveSourceFlag ( m_progressiveSourceFlag); 859 m_cTEncTop.setInterlacedSourceFlag ( m_interlacedSourceFlag); 860 m_cTEncTop.setNonPackedConstraintFlag ( m_nonPackedConstraintFlag); 861 m_cTEncTop.setFrameOnlyConstraintFlag ( m_frameOnlyConstraintFlag); 862 m_cTEncTop.setBitDepthConstraintValue ( m_bitDepthConstraint ); 863 m_cTEncTop.setChromaFormatConstraintValue ( m_chromaFormatConstraint ); 864 m_cTEncTop.setIntraConstraintFlag ( m_intraConstraintFlag ); 865 m_cTEncTop.setLowerBitRateConstraintFlag ( m_lowerBitRateConstraintFlag ); 866 867 m_cTEncTop.setPrintMSEBasedSequencePSNR ( m_printMSEBasedSequencePSNR); 868 m_cTEncTop.setPrintFrameMSE ( m_printFrameMSE); 869 m_cTEncTop.setPrintSequenceMSE ( m_printSequenceMSE); 870 m_cTEncTop.setCabacZeroWordPaddingEnabled ( m_cabacZeroWordPaddingEnabled ); 871 872 m_cTEncTop.setFrameRate ( m_iFrameRate ); 873 m_cTEncTop.setFrameSkip ( m_FrameSkip ); 874 m_cTEncTop.setSourceWidth ( m_iSourceWidth ); 875 m_cTEncTop.setSourceHeight ( m_iSourceHeight ); 876 m_cTEncTop.setConformanceWindow ( m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom ); 877 m_cTEncTop.setFramesToBeEncoded ( m_framesToBeEncoded ); 840 878 841 879 //====== Coding Structure ======== 842 m_cTEncTop.setIntraPeriod ( m_iIntraPeriod );843 m_cTEncTop.setDecodingRefreshType ( m_iDecodingRefreshType );844 m_cTEncTop.setGOPSize ( m_iGOPSize );845 m_cTEncTop.setGopList ( m_GOPList );846 m_cTEncTop.setExtraRPSs ( m_extraRPSs );880 m_cTEncTop.setIntraPeriod ( m_iIntraPeriod ); 881 m_cTEncTop.setDecodingRefreshType ( m_iDecodingRefreshType ); 882 m_cTEncTop.setGOPSize ( m_iGOPSize ); 883 m_cTEncTop.setGopList ( m_GOPList ); 884 m_cTEncTop.setExtraRPSs ( m_extraRPSs ); 847 885 for(Int i = 0; i < MAX_TLAYER; i++) 848 886 { 849 m_cTEncTop.setNumReorderPics ( m_numReorderPics[i], i );850 m_cTEncTop.setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i );887 m_cTEncTop.setNumReorderPics ( m_numReorderPics[i], i ); 888 m_cTEncTop.setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i ); 851 889 } 852 890 for( UInt uiLoop = 0; uiLoop < MAX_TLAYER; ++uiLoop ) 853 891 { 854 m_cTEncTop.setLambdaModifier ( uiLoop, m_adLambdaModifier[ uiLoop ] );855 } 856 m_cTEncTop.setQP ( m_iQP );857 858 m_cTEncTop.setPad ( m_aiPad );859 860 m_cTEncTop.setMaxTempLayer ( m_maxTempLayer );892 m_cTEncTop.setLambdaModifier ( uiLoop, m_adLambdaModifier[ uiLoop ] ); 893 } 894 m_cTEncTop.setQP ( m_iQP ); 895 896 m_cTEncTop.setPad ( m_aiPad ); 897 898 m_cTEncTop.setMaxTempLayer ( m_maxTempLayer ); 861 899 m_cTEncTop.setUseAMP( m_enableAMP ); 862 900 … … 864 902 865 903 //====== Loop/Deblock Filter ======== 866 m_cTEncTop.setLoopFilterDisable ( m_bLoopFilterDisable );867 m_cTEncTop.setLoopFilterOffsetInPPS ( m_loopFilterOffsetInPPS );868 m_cTEncTop.setLoopFilterBetaOffset ( m_loopFilterBetaOffsetDiv2 );869 m_cTEncTop.setLoopFilterTcOffset ( m_loopFilterTcOffsetDiv2 );870 m_cTEncTop.setDeblockingFilterControlPresent ( m_DeblockingFilterControlPresent);871 m_cTEncTop.setDeblockingFilterMetric ( m_DeblockingFilterMetric );904 m_cTEncTop.setLoopFilterDisable ( m_bLoopFilterDisable ); 905 m_cTEncTop.setLoopFilterOffsetInPPS ( m_loopFilterOffsetInPPS ); 906 m_cTEncTop.setLoopFilterBetaOffset ( m_loopFilterBetaOffsetDiv2 ); 907 m_cTEncTop.setLoopFilterTcOffset ( m_loopFilterTcOffsetDiv2 ); 908 m_cTEncTop.setDeblockingFilterControlPresent ( m_DeblockingFilterControlPresent); 909 m_cTEncTop.setDeblockingFilterMetric ( m_DeblockingFilterMetric ); 872 910 873 911 //====== Motion search ======== 874 m_cTEncTop.setFastSearch ( m_iFastSearch );875 m_cTEncTop.setSearchRange ( m_iSearchRange );876 m_cTEncTop.setBipredSearchRange ( m_bipredSearchRange );912 m_cTEncTop.setFastSearch ( m_iFastSearch ); 913 m_cTEncTop.setSearchRange ( m_iSearchRange ); 914 m_cTEncTop.setBipredSearchRange ( m_bipredSearchRange ); 877 915 878 916 //====== Quality control ======== 879 m_cTEncTop.setMaxDeltaQP ( m_iMaxDeltaQP ); 880 m_cTEncTop.setMaxCuDQPDepth ( m_iMaxCuDQPDepth ); 881 882 m_cTEncTop.setChromaCbQpOffset ( m_cbQpOffset ); 883 m_cTEncTop.setChromaCrQpOffset ( m_crQpOffset ); 917 m_cTEncTop.setMaxDeltaQP ( m_iMaxDeltaQP ); 918 m_cTEncTop.setMaxCuDQPDepth ( m_iMaxCuDQPDepth ); 919 m_cTEncTop.setMaxCUChromaQpAdjustmentDepth ( m_maxCUChromaQpAdjustmentDepth ); 920 m_cTEncTop.setChromaCbQpOffset ( m_cbQpOffset ); 921 m_cTEncTop.setChromaCrQpOffset ( m_crQpOffset ); 922 923 m_cTEncTop.setChromaFormatIdc ( m_chromaFormatIDC ); 884 924 885 925 #if ADAPTIVE_QP_SELECTION 886 m_cTEncTop.setUseAdaptQpSelect ( m_bUseAdaptQpSelect ); 887 #endif 888 889 m_cTEncTop.setUseAdaptiveQP ( m_bUseAdaptiveQP ); 890 m_cTEncTop.setQPAdaptationRange ( m_iQPAdaptationRange ); 891 926 m_cTEncTop.setUseAdaptQpSelect ( m_bUseAdaptQpSelect ); 927 #endif 928 929 m_cTEncTop.setUseAdaptiveQP ( m_bUseAdaptiveQP ); 930 m_cTEncTop.setQPAdaptationRange ( m_iQPAdaptationRange ); 931 m_cTEncTop.setUseExtendedPrecision ( m_useExtendedPrecision ); 932 m_cTEncTop.setUseHighPrecisionPredictionWeighting ( m_useHighPrecisionPredictionWeighting ); 892 933 //====== Tool list ======== 893 m_cTEncTop.setDeltaQpRD ( m_uiDeltaQpRD );894 m_cTEncTop.setUseASR ( m_bUseASR );895 m_cTEncTop.setUseHADME ( m_bUseHADME );896 m_cTEncTop.setdQPs ( m_aidQP );897 m_cTEncTop.setUseRDOQ ( m_useRDOQ );898 m_cTEncTop.setUseRDOQTS ( m_useRDOQTS );899 m_cTEncTop.setRDpenalty ( m_rdPenalty );900 m_cTEncTop.setQuadtreeTULog2MaxSize ( m_uiQuadtreeTULog2MaxSize );901 m_cTEncTop.setQuadtreeTULog2MinSize ( m_uiQuadtreeTULog2MinSize );902 m_cTEncTop.setQuadtreeTUMaxDepthInter ( m_uiQuadtreeTUMaxDepthInter );903 m_cTEncTop.setQuadtreeTUMaxDepthIntra ( m_uiQuadtreeTUMaxDepthIntra );904 m_cTEncTop.setUseFastEnc ( m_bUseFastEnc );905 m_cTEncTop.setUseEarlyCU ( m_bUseEarlyCU );906 m_cTEncTop.setUseFastDecisionForMerge ( m_useFastDecisionForMerge );907 m_cTEncTop.setUseCbfFastMode ( m_bUseCbfFastMode );908 m_cTEncTop.setUseEarlySkipDetection ( m_useEarlySkipDetection );934 m_cTEncTop.setDeltaQpRD ( m_uiDeltaQpRD ); 935 m_cTEncTop.setUseASR ( m_bUseASR ); 936 m_cTEncTop.setUseHADME ( m_bUseHADME ); 937 m_cTEncTop.setdQPs ( m_aidQP ); 938 m_cTEncTop.setUseRDOQ ( m_useRDOQ ); 939 m_cTEncTop.setUseRDOQTS ( m_useRDOQTS ); 940 m_cTEncTop.setRDpenalty ( m_rdPenalty ); 941 m_cTEncTop.setQuadtreeTULog2MaxSize ( m_uiQuadtreeTULog2MaxSize ); 942 m_cTEncTop.setQuadtreeTULog2MinSize ( m_uiQuadtreeTULog2MinSize ); 943 m_cTEncTop.setQuadtreeTUMaxDepthInter ( m_uiQuadtreeTUMaxDepthInter ); 944 m_cTEncTop.setQuadtreeTUMaxDepthIntra ( m_uiQuadtreeTUMaxDepthIntra ); 945 m_cTEncTop.setUseFastEnc ( m_bUseFastEnc ); 946 m_cTEncTop.setUseEarlyCU ( m_bUseEarlyCU ); 947 m_cTEncTop.setUseFastDecisionForMerge ( m_useFastDecisionForMerge ); 948 m_cTEncTop.setUseCbfFastMode ( m_bUseCbfFastMode ); 949 m_cTEncTop.setUseEarlySkipDetection ( m_useEarlySkipDetection ); 909 950 #if FAST_INTRA_SHVC 910 m_cTEncTop.setUseFastIntraScalable ( m_useFastIntraScalable ); 911 #endif 912 913 m_cTEncTop.setUseTransformSkip ( m_useTransformSkip ); 914 m_cTEncTop.setUseTransformSkipFast ( m_useTransformSkipFast ); 915 m_cTEncTop.setUseConstrainedIntraPred ( m_bUseConstrainedIntraPred ); 916 m_cTEncTop.setPCMLog2MinSize ( m_uiPCMLog2MinSize); 917 m_cTEncTop.setUsePCM ( m_usePCM ); 918 m_cTEncTop.setPCMLog2MaxSize ( m_pcmLog2MaxSize); 919 m_cTEncTop.setMaxNumMergeCand ( m_maxNumMergeCand ); 951 m_cTEncTop.setUseFastIntraScalable ( m_useFastIntraScalable ); 952 #endif 953 m_cTEncTop.setUseCrossComponentPrediction ( m_useCrossComponentPrediction ); 954 m_cTEncTop.setUseReconBasedCrossCPredictionEstimate ( m_reconBasedCrossCPredictionEstimate ); 955 m_cTEncTop.setSaoOffsetBitShift ( CHANNEL_TYPE_LUMA , m_saoOffsetBitShift[CHANNEL_TYPE_LUMA] ); 956 m_cTEncTop.setSaoOffsetBitShift ( CHANNEL_TYPE_CHROMA, m_saoOffsetBitShift[CHANNEL_TYPE_CHROMA] ); 957 m_cTEncTop.setUseTransformSkip ( m_useTransformSkip ); 958 m_cTEncTop.setUseTransformSkipFast ( m_useTransformSkipFast ); 959 m_cTEncTop.setUseResidualRotation ( m_useResidualRotation ); 960 m_cTEncTop.setUseSingleSignificanceMapContext ( m_useSingleSignificanceMapContext ); 961 m_cTEncTop.setUseGolombRiceParameterAdaptation ( m_useGolombRiceParameterAdaptation ); 962 m_cTEncTop.setAlignCABACBeforeBypass ( m_alignCABACBeforeBypass ); 963 m_cTEncTop.setTransformSkipLog2MaxSize ( m_transformSkipLog2MaxSize ); 964 for (UInt signallingModeIndex = 0; signallingModeIndex < NUMBER_OF_RDPCM_SIGNALLING_MODES; signallingModeIndex++) 965 { 966 m_cTEncTop.setUseResidualDPCM ( RDPCMSignallingMode(signallingModeIndex), m_useResidualDPCM[signallingModeIndex]); 967 } 968 m_cTEncTop.setUseConstrainedIntraPred ( m_bUseConstrainedIntraPred ); 969 m_cTEncTop.setPCMLog2MinSize ( m_uiPCMLog2MinSize); 970 m_cTEncTop.setUsePCM ( m_usePCM ); 971 m_cTEncTop.setPCMLog2MaxSize ( m_pcmLog2MaxSize); 972 m_cTEncTop.setMaxNumMergeCand ( m_maxNumMergeCand ); 920 973 921 974 922 975 //====== Weighted Prediction ======== 923 m_cTEncTop.setUseWP ( m_useWeightedPred );924 m_cTEncTop.setWPBiPred ( m_useWeightedBiPred );976 m_cTEncTop.setUseWP ( m_useWeightedPred ); 977 m_cTEncTop.setWPBiPred ( m_useWeightedBiPred ); 925 978 //====== Parallel Merge Estimation ======== 926 m_cTEncTop.setLog2ParallelMergeLevelMinus2 ( m_log2ParallelMergeLevel - 2 );979 m_cTEncTop.setLog2ParallelMergeLevelMinus2 ( m_log2ParallelMergeLevel - 2 ); 927 980 928 981 //====== Slice ======== 929 m_cTEncTop.setSliceMode ( m_sliceMode);930 m_cTEncTop.setSliceArgument ( m_sliceArgument );982 m_cTEncTop.setSliceMode ( (SliceConstraint) m_sliceMode ); 983 m_cTEncTop.setSliceArgument ( m_sliceArgument ); 931 984 932 985 //====== Dependent Slice ======== 933 m_cTEncTop.setSliceSegmentMode ( m_sliceSegmentMode ); 934 m_cTEncTop.setSliceSegmentArgument ( m_sliceSegmentArgument ); 935 Int iNumPartInCU = 1<<(m_uiMaxCUDepth<<1); 936 if(m_sliceSegmentMode==FIXED_NUMBER_OF_LCU) 937 { 938 m_cTEncTop.setSliceSegmentArgument ( m_sliceSegmentArgument * iNumPartInCU ); 939 } 940 if(m_sliceMode==FIXED_NUMBER_OF_LCU) 941 { 942 m_cTEncTop.setSliceArgument ( m_sliceArgument * iNumPartInCU ); 943 } 944 if(m_sliceMode==FIXED_NUMBER_OF_TILES) 945 { 946 m_cTEncTop.setSliceArgument ( m_sliceArgument ); 947 } 948 949 if(m_sliceMode == 0 ) 986 m_cTEncTop.setSliceSegmentMode ( (SliceConstraint) m_sliceSegmentMode ); 987 m_cTEncTop.setSliceSegmentArgument ( m_sliceSegmentArgument ); 988 989 if(m_sliceMode == NO_SLICES ) 950 990 { 951 991 m_bLFCrossSliceBoundaryFlag = true; 952 992 } 953 m_cTEncTop.setLFCrossSliceBoundaryFlag( m_bLFCrossSliceBoundaryFlag ); 954 m_cTEncTop.setUseSAO ( m_bUseSAO ); 955 m_cTEncTop.setMaxNumOffsetsPerPic (m_maxNumOffsetsPerPic); 956 957 m_cTEncTop.setSaoLcuBoundary (m_saoLcuBoundary); 958 m_cTEncTop.setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 959 m_cTEncTop.setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); 960 961 m_cTEncTop.setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); 962 m_cTEncTop.setRecoveryPointSEIEnabled( m_recoveryPointSEIEnabled ); 963 m_cTEncTop.setBufferingPeriodSEIEnabled( m_bufferingPeriodSEIEnabled ); 964 m_cTEncTop.setPictureTimingSEIEnabled( m_pictureTimingSEIEnabled ); 965 m_cTEncTop.setToneMappingInfoSEIEnabled ( m_toneMappingInfoSEIEnabled ); 966 m_cTEncTop.setTMISEIToneMapId ( m_toneMapId ); 967 m_cTEncTop.setTMISEIToneMapCancelFlag ( m_toneMapCancelFlag ); 968 m_cTEncTop.setTMISEIToneMapPersistenceFlag ( m_toneMapPersistenceFlag ); 969 m_cTEncTop.setTMISEICodedDataBitDepth ( m_toneMapCodedDataBitDepth ); 970 m_cTEncTop.setTMISEITargetBitDepth ( m_toneMapTargetBitDepth ); 971 m_cTEncTop.setTMISEIModelID ( m_toneMapModelId ); 972 m_cTEncTop.setTMISEIMinValue ( m_toneMapMinValue ); 973 m_cTEncTop.setTMISEIMaxValue ( m_toneMapMaxValue ); 974 m_cTEncTop.setTMISEISigmoidMidpoint ( m_sigmoidMidpoint ); 975 m_cTEncTop.setTMISEISigmoidWidth ( m_sigmoidWidth ); 976 m_cTEncTop.setTMISEIStartOfCodedInterva ( m_startOfCodedInterval ); 977 m_cTEncTop.setTMISEINumPivots ( m_numPivots ); 978 m_cTEncTop.setTMISEICodedPivotValue ( m_codedPivotValue ); 979 m_cTEncTop.setTMISEITargetPivotValue ( m_targetPivotValue ); 980 m_cTEncTop.setTMISEICameraIsoSpeedIdc ( m_cameraIsoSpeedIdc ); 981 m_cTEncTop.setTMISEICameraIsoSpeedValue ( m_cameraIsoSpeedValue ); 982 m_cTEncTop.setTMISEIExposureIndexIdc ( m_exposureIndexIdc ); 983 m_cTEncTop.setTMISEIExposureIndexValue ( m_exposureIndexValue ); 984 m_cTEncTop.setTMISEIExposureCompensationValueSignFlag ( m_exposureCompensationValueSignFlag ); 985 m_cTEncTop.setTMISEIExposureCompensationValueNumerator ( m_exposureCompensationValueNumerator ); 986 m_cTEncTop.setTMISEIExposureCompensationValueDenomIdc ( m_exposureCompensationValueDenomIdc ); 987 m_cTEncTop.setTMISEIRefScreenLuminanceWhite ( m_refScreenLuminanceWhite ); 988 m_cTEncTop.setTMISEIExtendedRangeWhiteLevel ( m_extendedRangeWhiteLevel ); 989 m_cTEncTop.setTMISEINominalBlackLevelLumaCodeValue ( m_nominalBlackLevelLumaCodeValue ); 990 m_cTEncTop.setTMISEINominalWhiteLevelLumaCodeValue ( m_nominalWhiteLevelLumaCodeValue ); 991 m_cTEncTop.setTMISEIExtendedWhiteLevelLumaCodeValue ( m_extendedWhiteLevelLumaCodeValue ); 992 #if P0050_KNEE_FUNCTION_SEI 993 m_cTEncTop.setKneeSEIEnabled ( m_kneeSEIEnabled ); 994 m_cTEncTop.setKneeSEIId ( m_kneeSEIId ); 995 m_cTEncTop.setKneeSEICancelFlag ( m_kneeSEICancelFlag ); 996 m_cTEncTop.setKneeSEIPersistenceFlag ( m_kneeSEIPersistenceFlag ); 997 m_cTEncTop.setKneeSEIMappingFlag ( m_kneeSEIMappingFlag ); 998 m_cTEncTop.setKneeSEIInputDrange ( m_kneeSEIInputDrange ); 999 m_cTEncTop.setKneeSEIInputDispLuminance ( m_kneeSEIInputDispLuminance ); 1000 m_cTEncTop.setKneeSEIOutputDrange ( m_kneeSEIOutputDrange ); 1001 m_cTEncTop.setKneeSEIOutputDispLuminance ( m_kneeSEIOutputDispLuminance ); 1002 m_cTEncTop.setKneeSEINumKneePointsMinus1 ( m_kneeSEINumKneePointsMinus1 ); 1003 m_cTEncTop.setKneeSEIInputKneePoint ( m_kneeSEIInputKneePoint ); 1004 m_cTEncTop.setKneeSEIOutputKneePoint ( m_kneeSEIOutputKneePoint ); 1005 #endif 993 m_cTEncTop.setLFCrossSliceBoundaryFlag ( m_bLFCrossSliceBoundaryFlag ); 994 m_cTEncTop.setUseSAO ( m_bUseSAO ); 995 m_cTEncTop.setMaxNumOffsetsPerPic ( m_maxNumOffsetsPerPic); 996 997 m_cTEncTop.setSaoCtuBoundary ( m_saoCtuBoundary); 998 m_cTEncTop.setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 999 m_cTEncTop.setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); 1000 1001 m_cTEncTop.setDisableIntraReferenceSmoothing (!m_enableIntraReferenceSmoothing ); 1002 m_cTEncTop.setDecodedPictureHashSEIEnabled ( m_decodedPictureHashSEIEnabled ); 1003 m_cTEncTop.setRecoveryPointSEIEnabled ( m_recoveryPointSEIEnabled ); 1004 m_cTEncTop.setBufferingPeriodSEIEnabled ( m_bufferingPeriodSEIEnabled ); 1005 m_cTEncTop.setPictureTimingSEIEnabled ( m_pictureTimingSEIEnabled ); 1006 m_cTEncTop.setToneMappingInfoSEIEnabled ( m_toneMappingInfoSEIEnabled ); 1007 m_cTEncTop.setTMISEIToneMapId ( m_toneMapId ); 1008 m_cTEncTop.setTMISEIToneMapCancelFlag ( m_toneMapCancelFlag ); 1009 m_cTEncTop.setTMISEIToneMapPersistenceFlag ( m_toneMapPersistenceFlag ); 1010 m_cTEncTop.setTMISEICodedDataBitDepth ( m_toneMapCodedDataBitDepth ); 1011 m_cTEncTop.setTMISEITargetBitDepth ( m_toneMapTargetBitDepth ); 1012 m_cTEncTop.setTMISEIModelID ( m_toneMapModelId ); 1013 m_cTEncTop.setTMISEIMinValue ( m_toneMapMinValue ); 1014 m_cTEncTop.setTMISEIMaxValue ( m_toneMapMaxValue ); 1015 m_cTEncTop.setTMISEISigmoidMidpoint ( m_sigmoidMidpoint ); 1016 m_cTEncTop.setTMISEISigmoidWidth ( m_sigmoidWidth ); 1017 m_cTEncTop.setTMISEIStartOfCodedInterva ( m_startOfCodedInterval ); 1018 m_cTEncTop.setTMISEINumPivots ( m_numPivots ); 1019 m_cTEncTop.setTMISEICodedPivotValue ( m_codedPivotValue ); 1020 m_cTEncTop.setTMISEITargetPivotValue ( m_targetPivotValue ); 1021 m_cTEncTop.setTMISEICameraIsoSpeedIdc ( m_cameraIsoSpeedIdc ); 1022 m_cTEncTop.setTMISEICameraIsoSpeedValue ( m_cameraIsoSpeedValue ); 1023 m_cTEncTop.setTMISEIExposureIndexIdc ( m_exposureIndexIdc ); 1024 m_cTEncTop.setTMISEIExposureIndexValue ( m_exposureIndexValue ); 1025 m_cTEncTop.setTMISEIExposureCompensationValueSignFlag ( m_exposureCompensationValueSignFlag ); 1026 m_cTEncTop.setTMISEIExposureCompensationValueNumerator ( m_exposureCompensationValueNumerator ); 1027 m_cTEncTop.setTMISEIExposureCompensationValueDenomIdc ( m_exposureCompensationValueDenomIdc ); 1028 m_cTEncTop.setTMISEIRefScreenLuminanceWhite ( m_refScreenLuminanceWhite ); 1029 m_cTEncTop.setTMISEIExtendedRangeWhiteLevel ( m_extendedRangeWhiteLevel ); 1030 m_cTEncTop.setTMISEINominalBlackLevelLumaCodeValue ( m_nominalBlackLevelLumaCodeValue ); 1031 m_cTEncTop.setTMISEINominalWhiteLevelLumaCodeValue ( m_nominalWhiteLevelLumaCodeValue ); 1032 m_cTEncTop.setTMISEIExtendedWhiteLevelLumaCodeValue ( m_extendedWhiteLevelLumaCodeValue ); 1033 m_cTEncTop.setChromaSamplingFilterHintEnabled ( m_chromaSamplingFilterSEIenabled ); 1034 m_cTEncTop.setChromaSamplingHorFilterIdc ( m_chromaSamplingHorFilterIdc ); 1035 m_cTEncTop.setChromaSamplingVerFilterIdc ( m_chromaSamplingVerFilterIdc ); 1036 m_cTEncTop.setFramePackingArrangementSEIEnabled ( m_framePackingSEIEnabled ); 1037 m_cTEncTop.setFramePackingArrangementSEIType ( m_framePackingSEIType ); 1038 m_cTEncTop.setFramePackingArrangementSEIId ( m_framePackingSEIId ); 1039 m_cTEncTop.setFramePackingArrangementSEIQuincunx ( m_framePackingSEIQuincunx ); 1040 m_cTEncTop.setFramePackingArrangementSEIInterpretation ( m_framePackingSEIInterpretation ); 1041 m_cTEncTop.setSegmentedRectFramePackingArrangementSEIEnabled ( m_segmentedRectFramePackingSEIEnabled ); 1042 m_cTEncTop.setSegmentedRectFramePackingArrangementSEICancel ( m_segmentedRectFramePackingSEICancel ); 1043 m_cTEncTop.setSegmentedRectFramePackingArrangementSEIType ( m_segmentedRectFramePackingSEIType ); 1044 m_cTEncTop.setSegmentedRectFramePackingArrangementSEIPersistence( m_segmentedRectFramePackingSEIPersistence ); 1045 m_cTEncTop.setDisplayOrientationSEIAngle ( m_displayOrientationSEIAngle ); 1046 m_cTEncTop.setTemporalLevel0IndexSEIEnabled ( m_temporalLevel0IndexSEIEnabled ); 1047 m_cTEncTop.setGradualDecodingRefreshInfoEnabled ( m_gradualDecodingRefreshInfoEnabled ); 1048 m_cTEncTop.setNoDisplaySEITLayer ( m_noDisplaySEITLayer ); 1049 m_cTEncTop.setDecodingUnitInfoSEIEnabled ( m_decodingUnitInfoSEIEnabled ); 1050 m_cTEncTop.setSOPDescriptionSEIEnabled ( m_SOPDescriptionSEIEnabled ); 1051 m_cTEncTop.setScalableNestingSEIEnabled ( m_scalableNestingSEIEnabled ); 1052 m_cTEncTop.setTMCTSSEIEnabled ( m_tmctsSEIEnabled ); 1053 m_cTEncTop.setTimeCodeSEIEnabled ( m_timeCodeSEIEnabled ); 1054 m_cTEncTop.setNumberOfTimeSets ( m_timeCodeSEINumTs ); 1055 for(Int i = 0; i < m_timeCodeSEINumTs; i++) { m_cTEncTop.setTimeSet(m_timeSetArray[i], i); } 1056 m_cTEncTop.setKneeSEIEnabled ( m_kneeSEIEnabled ); 1057 m_cTEncTop.setKneeSEIId ( m_kneeSEIId ); 1058 m_cTEncTop.setKneeSEICancelFlag ( m_kneeSEICancelFlag ); 1059 m_cTEncTop.setKneeSEIPersistenceFlag ( m_kneeSEIPersistenceFlag ); 1060 m_cTEncTop.setKneeSEIInputDrange ( m_kneeSEIInputDrange ); 1061 m_cTEncTop.setKneeSEIInputDispLuminance ( m_kneeSEIInputDispLuminance ); 1062 m_cTEncTop.setKneeSEIOutputDrange ( m_kneeSEIOutputDrange ); 1063 m_cTEncTop.setKneeSEIOutputDispLuminance ( m_kneeSEIOutputDispLuminance ); 1064 m_cTEncTop.setKneeSEINumKneePointsMinus1 ( m_kneeSEINumKneePointsMinus1 ); 1065 m_cTEncTop.setKneeSEIInputKneePoint ( m_kneeSEIInputKneePoint ); 1066 m_cTEncTop.setKneeSEIOutputKneePoint ( m_kneeSEIOutputKneePoint ); 1067 m_cTEncTop.setMasteringDisplaySEI ( m_masteringDisplay ); 1006 1068 #if Q0074_COLOUR_REMAPPING_SEI 1007 m_cTEncTop.setCRISEIFile ( const_cast<Char*>(m_colourRemapSEIFile.c_str()));1069 m_cTEncTop.setCRISEIFile ( m_colourRemapSEIFile ); 1008 1070 m_cTEncTop.setCRISEIId ( m_colourRemapSEIId ); 1009 1071 m_cTEncTop.setCRISEICancelFlag ( m_colourRemapSEICancelFlag ); … … 1026 1088 m_cTEncTop.setCRISEIPostLutTargetValue ( m_colourRemapSEIPostLutTargetValue ); 1027 1089 #endif 1028 m_cTEncTop.setFramePackingArrangementSEIEnabled( m_framePackingSEIEnabled );1029 m_cTEncTop.setFramePackingArrangementSEIType( m_framePackingSEIType );1030 m_cTEncTop.setFramePackingArrangementSEIId( m_framePackingSEIId );1031 m_cTEncTop.setFramePackingArrangementSEIQuincunx( m_framePackingSEIQuincunx );1032 m_cTEncTop.setFramePackingArrangementSEIInterpretation( m_framePackingSEIInterpretation );1033 m_cTEncTop.setDisplayOrientationSEIAngle( m_displayOrientationSEIAngle );1034 m_cTEncTop.setTemporalLevel0IndexSEIEnabled( m_temporalLevel0IndexSEIEnabled );1035 m_cTEncTop.setGradualDecodingRefreshInfoEnabled( m_gradualDecodingRefreshInfoEnabled );1036 m_cTEncTop.setDecodingUnitInfoSEIEnabled( m_decodingUnitInfoSEIEnabled );1037 1090 #if LAYERS_NOT_PRESENT_SEI 1038 1091 m_cTEncTop.setLayersNotPresentSEIEnabled( m_layersNotPresentSEIEnabled ); 1039 1092 #endif 1040 m_cTEncTop.setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled ); 1041 m_cTEncTop.setScalableNestingSEIEnabled( m_scalableNestingSEIEnabled ); 1042 m_cTEncTop.setTileUniformSpacingFlag ( m_tileUniformSpacingFlag ); 1043 m_cTEncTop.setNumColumnsMinus1 ( m_numTileColumnsMinus1 ); 1044 m_cTEncTop.setNumRowsMinus1 ( m_numTileRowsMinus1 ); 1093 m_cTEncTop.setTileUniformSpacingFlag ( m_tileUniformSpacingFlag ); 1094 m_cTEncTop.setNumColumnsMinus1 ( m_numTileColumnsMinus1 ); 1095 m_cTEncTop.setNumRowsMinus1 ( m_numTileRowsMinus1 ); 1045 1096 if(!m_tileUniformSpacingFlag) 1046 1097 { 1047 m_cTEncTop.setColumnWidth ( m_tileColumnWidth );1048 m_cTEncTop.setRowHeight ( m_tileRowHeight );1098 m_cTEncTop.setColumnWidth ( m_tileColumnWidth ); 1099 m_cTEncTop.setRowHeight ( m_tileRowHeight ); 1049 1100 } 1050 1101 m_cTEncTop.xCheckGSParameters(); 1051 Int uiTilesCount 1102 Int uiTilesCount = (m_numTileRowsMinus1+1) * (m_numTileColumnsMinus1+1); 1052 1103 if(uiTilesCount == 1) 1053 1104 { 1054 1105 m_bLFCrossTileBoundaryFlag = true; 1055 1106 } 1056 m_cTEncTop.setLFCrossTileBoundaryFlag( m_bLFCrossTileBoundaryFlag ); 1057 m_cTEncTop.setWaveFrontSynchro ( m_iWaveFrontSynchro ); 1058 m_cTEncTop.setWaveFrontSubstreams ( m_iWaveFrontSubstreams ); 1059 m_cTEncTop.setTMVPModeId ( m_TMVPModeId ); 1060 m_cTEncTop.setUseScalingListId ( m_useScalingListId ); 1061 m_cTEncTop.setScalingListFile ( m_scalingListFile ); 1062 m_cTEncTop.setSignHideFlag(m_signHideFlag); 1063 m_cTEncTop.setUseRateCtrl ( m_RCEnableRateControl ); 1064 m_cTEncTop.setTargetBitrate ( m_RCTargetBitrate ); 1065 m_cTEncTop.setKeepHierBit ( m_RCKeepHierarchicalBit ); 1066 m_cTEncTop.setLCULevelRC ( m_RCLCULevelRC ); 1067 m_cTEncTop.setUseLCUSeparateModel ( m_RCUseLCUSeparateModel ); 1068 m_cTEncTop.setInitialQP ( m_RCInitialQP ); 1069 m_cTEncTop.setForceIntraQP ( m_RCForceIntraQP ); 1070 m_cTEncTop.setTransquantBypassEnableFlag(m_TransquantBypassEnableFlag); 1071 m_cTEncTop.setCUTransquantBypassFlagForceValue(m_CUTransquantBypassFlagForce); 1072 m_cTEncTop.setUseRecalculateQPAccordingToLambda( m_recalculateQPAccordingToLambda ); 1073 m_cTEncTop.setUseStrongIntraSmoothing( m_useStrongIntraSmoothing ); 1074 m_cTEncTop.setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 1075 m_cTEncTop.setVuiParametersPresentFlag( m_vuiParametersPresentFlag ); 1076 m_cTEncTop.setAspectRatioInfoPresentFlag( m_aspectRatioInfoPresentFlag); 1077 m_cTEncTop.setAspectRatioIdc( m_aspectRatioIdc ); 1078 m_cTEncTop.setSarWidth( m_sarWidth ); 1079 m_cTEncTop.setSarHeight( m_sarHeight ); 1080 m_cTEncTop.setOverscanInfoPresentFlag( m_overscanInfoPresentFlag ); 1081 m_cTEncTop.setOverscanAppropriateFlag( m_overscanAppropriateFlag ); 1082 m_cTEncTop.setVideoSignalTypePresentFlag( m_videoSignalTypePresentFlag ); 1083 m_cTEncTop.setVideoFormat( m_videoFormat ); 1084 m_cTEncTop.setVideoFullRangeFlag( m_videoFullRangeFlag ); 1085 m_cTEncTop.setColourDescriptionPresentFlag( m_colourDescriptionPresentFlag ); 1086 m_cTEncTop.setColourPrimaries( m_colourPrimaries ); 1087 m_cTEncTop.setTransferCharacteristics( m_transferCharacteristics ); 1088 m_cTEncTop.setMatrixCoefficients( m_matrixCoefficients ); 1089 m_cTEncTop.setChromaLocInfoPresentFlag( m_chromaLocInfoPresentFlag ); 1090 m_cTEncTop.setChromaSampleLocTypeTopField( m_chromaSampleLocTypeTopField ); 1091 m_cTEncTop.setChromaSampleLocTypeBottomField( m_chromaSampleLocTypeBottomField ); 1092 m_cTEncTop.setNeutralChromaIndicationFlag( m_neutralChromaIndicationFlag ); 1093 m_cTEncTop.setDefaultDisplayWindow( m_defDispWinLeftOffset, m_defDispWinRightOffset, m_defDispWinTopOffset, m_defDispWinBottomOffset ); 1094 m_cTEncTop.setFrameFieldInfoPresentFlag( m_frameFieldInfoPresentFlag ); 1095 m_cTEncTop.setPocProportionalToTimingFlag( m_pocProportionalToTimingFlag ); 1096 m_cTEncTop.setNumTicksPocDiffOneMinus1 ( m_numTicksPocDiffOneMinus1 ); 1097 m_cTEncTop.setBitstreamRestrictionFlag( m_bitstreamRestrictionFlag ); 1098 m_cTEncTop.setTilesFixedStructureFlag( m_tilesFixedStructureFlag ); 1099 m_cTEncTop.setMotionVectorsOverPicBoundariesFlag( m_motionVectorsOverPicBoundariesFlag ); 1100 m_cTEncTop.setMinSpatialSegmentationIdc( m_minSpatialSegmentationIdc ); 1101 m_cTEncTop.setMaxBytesPerPicDenom( m_maxBytesPerPicDenom ); 1102 m_cTEncTop.setMaxBitsPerMinCuDenom( m_maxBitsPerMinCuDenom ); 1103 m_cTEncTop.setLog2MaxMvLengthHorizontal( m_log2MaxMvLengthHorizontal ); 1104 m_cTEncTop.setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical ); 1107 m_cTEncTop.setLFCrossTileBoundaryFlag ( m_bLFCrossTileBoundaryFlag ); 1108 m_cTEncTop.setWaveFrontSynchro ( m_iWaveFrontSynchro ); 1109 m_cTEncTop.setWaveFrontSubstreams ( m_iWaveFrontSubstreams ); 1110 m_cTEncTop.setTMVPModeId ( m_TMVPModeId ); 1111 m_cTEncTop.setUseScalingListId ( m_useScalingListId ); 1112 m_cTEncTop.setScalingListFile ( m_scalingListFile ); 1113 m_cTEncTop.setSignHideFlag ( m_signHideFlag); 1114 m_cTEncTop.setUseRateCtrl ( m_RCEnableRateControl ); 1115 m_cTEncTop.setTargetBitrate ( m_RCTargetBitrate ); 1116 m_cTEncTop.setKeepHierBit ( m_RCKeepHierarchicalBit ); 1117 m_cTEncTop.setLCULevelRC ( m_RCLCULevelRC ); 1118 m_cTEncTop.setUseLCUSeparateModel ( m_RCUseLCUSeparateModel ); 1119 m_cTEncTop.setInitialQP ( m_RCInitialQP ); 1120 m_cTEncTop.setForceIntraQP ( m_RCForceIntraQP ); 1121 m_cTEncTop.setTransquantBypassEnableFlag ( m_TransquantBypassEnableFlag ); 1122 m_cTEncTop.setCUTransquantBypassFlagForceValue ( m_CUTransquantBypassFlagForce ); 1123 m_cTEncTop.setCostMode ( m_costMode ); 1124 m_cTEncTop.setUseRecalculateQPAccordingToLambda ( m_recalculateQPAccordingToLambda ); 1125 m_cTEncTop.setUseStrongIntraSmoothing ( m_useStrongIntraSmoothing ); 1126 m_cTEncTop.setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 1127 m_cTEncTop.setVuiParametersPresentFlag ( m_vuiParametersPresentFlag ); 1128 m_cTEncTop.setAspectRatioInfoPresentFlag ( m_aspectRatioInfoPresentFlag); 1129 m_cTEncTop.setAspectRatioIdc ( m_aspectRatioIdc ); 1130 m_cTEncTop.setSarWidth ( m_sarWidth ); 1131 m_cTEncTop.setSarHeight ( m_sarHeight ); 1132 m_cTEncTop.setOverscanInfoPresentFlag ( m_overscanInfoPresentFlag ); 1133 m_cTEncTop.setOverscanAppropriateFlag ( m_overscanAppropriateFlag ); 1134 m_cTEncTop.setVideoSignalTypePresentFlag ( m_videoSignalTypePresentFlag ); 1135 m_cTEncTop.setVideoFormat ( m_videoFormat ); 1136 m_cTEncTop.setVideoFullRangeFlag ( m_videoFullRangeFlag ); 1137 m_cTEncTop.setColourDescriptionPresentFlag ( m_colourDescriptionPresentFlag ); 1138 m_cTEncTop.setColourPrimaries ( m_colourPrimaries ); 1139 m_cTEncTop.setTransferCharacteristics ( m_transferCharacteristics ); 1140 m_cTEncTop.setMatrixCoefficients ( m_matrixCoefficients ); 1141 m_cTEncTop.setChromaLocInfoPresentFlag ( m_chromaLocInfoPresentFlag ); 1142 m_cTEncTop.setChromaSampleLocTypeTopField ( m_chromaSampleLocTypeTopField ); 1143 m_cTEncTop.setChromaSampleLocTypeBottomField ( m_chromaSampleLocTypeBottomField ); 1144 m_cTEncTop.setNeutralChromaIndicationFlag ( m_neutralChromaIndicationFlag ); 1145 m_cTEncTop.setDefaultDisplayWindow ( m_defDispWinLeftOffset, m_defDispWinRightOffset, m_defDispWinTopOffset, m_defDispWinBottomOffset ); 1146 m_cTEncTop.setFrameFieldInfoPresentFlag ( m_frameFieldInfoPresentFlag ); 1147 m_cTEncTop.setPocProportionalToTimingFlag ( m_pocProportionalToTimingFlag ); 1148 m_cTEncTop.setNumTicksPocDiffOneMinus1 ( m_numTicksPocDiffOneMinus1 ); 1149 m_cTEncTop.setBitstreamRestrictionFlag ( m_bitstreamRestrictionFlag ); 1150 m_cTEncTop.setTilesFixedStructureFlag ( m_tilesFixedStructureFlag ); 1151 m_cTEncTop.setMotionVectorsOverPicBoundariesFlag ( m_motionVectorsOverPicBoundariesFlag ); 1152 m_cTEncTop.setMinSpatialSegmentationIdc ( m_minSpatialSegmentationIdc ); 1153 m_cTEncTop.setMaxBytesPerPicDenom ( m_maxBytesPerPicDenom ); 1154 m_cTEncTop.setMaxBitsPerMinCuDenom ( m_maxBitsPerMinCuDenom ); 1155 m_cTEncTop.setLog2MaxMvLengthHorizontal ( m_log2MaxMvLengthHorizontal ); 1156 m_cTEncTop.setLog2MaxMvLengthVertical ( m_log2MaxMvLengthVertical ); 1105 1157 } 1106 1158 #endif //SVC_EXTENSION … … 1117 1169 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1118 1170 //2 1119 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;1120 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;1121 1122 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;1123 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;1171 for( UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++) 1172 { 1173 g_bitDepth[channelTypeIndex] = m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex]; 1174 g_PCMBitDepth[channelTypeIndex] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepth[channelTypeIndex] : m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex]; 1175 } 1124 1176 #endif 1125 1177 #if LAYER_CTB … … 1129 1181 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 1130 1182 #endif 1183 // Video I/O 1131 1184 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1132 m_acTVideoIOYuvInputFile[layer].open( (Char *)m_acLayerCfg[layer].getInputFile().c_str(), false, m_acLayerCfg[layer].m_inputBitDepth Y, m_acLayerCfg[layer].m_inputBitDepthC, m_acLayerCfg[layer].m_internalBitDepthY, m_acLayerCfg[layer].m_internalBitDepthC); // read mode1133 #else 1134 m_acTVideoIOYuvInputFile[layer].open( (Char *)m_acLayerCfg[layer].getInputFile().c_str(), false, m_inputBitDepth Y, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC); // read mode1135 #endif 1136 m_acTVideoIOYuvInputFile[layer].skipFrames(m_FrameSkip, m_acLayerCfg[layer].getSourceWidth() - m_acLayerCfg[layer].getPad()[0], m_acLayerCfg[layer].getSourceHeight() - m_acLayerCfg[layer].getPad()[1] );1185 m_acTVideoIOYuvInputFile[layer].open( (Char *)m_acLayerCfg[layer].getInputFile().c_str(), false, m_acLayerCfg[layer].m_inputBitDepth, m_acLayerCfg[layer].m_MSBExtendedBitDepth, m_acLayerCfg[layer].m_internalBitDepth ); // read mode 1186 #else 1187 m_acTVideoIOYuvInputFile[layer].open( (Char *)m_acLayerCfg[layer].getInputFile().c_str(), false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth ); // read mode 1188 #endif 1189 m_acTVideoIOYuvInputFile[layer].skipFrames(m_FrameSkip, m_acLayerCfg[layer].getSourceWidth() - m_acLayerCfg[layer].getPad()[0], m_acLayerCfg[layer].getSourceHeight() - m_acLayerCfg[layer].getPad()[1], m_acLayerCfg[layer].m_InputChromaFormatIDC); 1137 1190 1138 1191 if (!m_acLayerCfg[layer].getReconFile().empty()) 1139 1192 { 1140 1193 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1141 m_acTVideoIOYuvReconFile[layer].open((Char *)m_acLayerCfg[layer].getReconFile().c_str(), true, m_acLayerCfg[layer].m_outputBitDepthY, m_acLayerCfg[layer].m_outputBitDepthC, m_acLayerCfg[layer].m_internalBitDepthY, m_acLayerCfg[layer].m_internalBitDepthC ); // write mode 1142 #else 1143 m_acTVideoIOYuvReconFile[layer].open((Char *)m_acLayerCfg[layer].getReconFile().c_str(), true, m_outputBitDepthY, m_outputBitDepthC, m_internalBitDepthY, m_internalBitDepthC ); // write mode 1144 #endif 1145 } 1146 1194 m_acTVideoIOYuvReconFile[layer].open((Char *)m_acLayerCfg[layer].getReconFile().c_str(), true, m_acLayerCfg[layer].m_outputBitDepth, m_acLayerCfg[layer].m_MSBExtendedBitDepth, m_acLayerCfg[layer].m_internalBitDepth ); // write mode 1195 #else 1196 m_acTVideoIOYuvReconFile[layer].open((Char *)m_acLayerCfg[layer].getReconFile().c_str(), true, m_outputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth ); // write mode 1197 #endif 1198 } 1199 1200 // Neo Decoder 1147 1201 m_acTEncTop[layer].create(); 1148 1202 } 1149 1203 #else //SVC_EXTENSION 1150 m_cTVideoIOYuvInputFile.open( m_pchInputFile, false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC ); // read mode 1151 m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1]); 1204 // Video I/O 1205 m_cTVideoIOYuvInputFile.open( m_pchInputFile, false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth ); // read mode 1206 m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1], m_InputChromaFormatIDC); 1152 1207 1153 1208 if (m_pchReconFile) 1154 m_cTVideoIOYuvReconFile.open(m_pchReconFile, true, m_outputBitDepthY, m_outputBitDepthC, m_internalBitDepthY, m_internalBitDepthC); // write mode 1209 { 1210 m_cTVideoIOYuvReconFile.open(m_pchReconFile, true, m_outputBitDepth, m_outputBitDepth, m_internalBitDepth); // write mode 1211 } 1155 1212 1156 1213 // Neo Decoder … … 1216 1273 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1217 1274 //3 1218 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;1219 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;1220 1221 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;1222 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;1275 for (UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++) 1276 { 1277 g_bitDepth[channelTypeIndex] = m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex]; 1278 g_PCMBitDepth[channelTypeIndex] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepth[channelTypeIndex] : m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex]; 1279 } 1223 1280 #endif 1224 1281 #if LAYER_CTB … … 1258 1315 } 1259 1316 } 1260 for ( Int setId = 1; setId < vps->getNumLayerSets(); setId++)1317 for (Int setId = 1; setId < vps->getNumLayerSets(); setId++) 1261 1318 { 1262 1319 #if OUTPUT_LAYER_SETS_CONFIG … … 1271 1328 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1272 1329 //4 1273 g_bitDepth Y = m_acLayerCfg[layerId].m_internalBitDepthY;1274 g_bitDepth C = m_acLayerCfg[layerId].m_internalBitDepthC;1275 1276 g_ uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthY : m_acLayerCfg[layerId].m_internalBitDepthY;1277 g_ uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthC : m_acLayerCfg[layerId].m_internalBitDepthC;1330 g_bitDepth[CHANNEL_TYPE_LUMA] = m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_LUMA]; 1331 g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_CHROMA]; 1332 1333 g_PCMBitDepth[CHANNEL_TYPE_LUMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepth[CHANNEL_TYPE_LUMA] : m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_LUMA]; 1334 g_PCMBitDepth[CHANNEL_TYPE_CHROMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepth[CHANNEL_TYPE_CHROMA] : m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_CHROMA]; 1278 1335 #endif 1279 1336 … … 1293 1350 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1294 1351 //4 1295 g_bitDepth Y = m_acLayerCfg[layerId].m_internalBitDepthY;1296 g_bitDepth C = m_acLayerCfg[layerId].m_internalBitDepthC;1297 1298 g_ uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthY : m_acLayerCfg[layerId].m_internalBitDepthY;1299 g_ uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthC : m_acLayerCfg[layerId].m_internalBitDepthC;1352 g_bitDepth[CHANNEL_TYPE_LUMA] = m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_LUMA]; 1353 g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_CHROMA]; 1354 1355 g_PCMBitDepth[CHANNEL_TYPE_LUMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepth[CHANNEL_TYPE_LUMA] : m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_LUMA]; 1356 g_PCMBitDepth[CHANNEL_TYPE_CHROMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepth[CHANNEL_TYPE_CHROMA] : m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_CHROMA]; 1300 1357 #endif 1301 1358 if (layerId <= setId) … … 1611 1668 #endif 1612 1669 vps->setOutputLayerFlag( 0, 0, 1 ); 1670 1613 1671 // derive OutputLayerFlag[i][j] 1614 1672 #if !OUTPUT_LAYER_SETS_CONFIG … … 2016 2074 Bool bEos = false; 2017 2075 2076 const InputColourSpaceConversion ipCSC = m_inputColourSpaceConvert; 2077 const InputColourSpaceConversion snrCSC = (!m_snrInternalColourSpace) ? m_inputColourSpaceConvert : IPCOLOURSPACE_UNCHANGED; 2078 2018 2079 list<AccessUnit> outputAccessUnits; ///< list of access units to write out. is populated by the encoding process 2080 2081 TComPicYuv acPicYuvTrueOrg[MAX_LAYERS]; 2019 2082 2020 2083 for(UInt layer=0; layer<m_numLayers; layer++) … … 2022 2085 #if O0194_DIFFERENT_BITDEPTH_EL_BL 2023 2086 //5 2024 g_bitDepth Y = m_acLayerCfg[layer].m_internalBitDepthY;2025 g_bitDepth C = m_acLayerCfg[layer].m_internalBitDepthC;2026 2027 g_ uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;2028 g_ uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;2087 g_bitDepth[CHANNEL_TYPE_LUMA] = m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA]; 2088 g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]; 2089 2090 g_PCMBitDepth[CHANNEL_TYPE_LUMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepth[CHANNEL_TYPE_LUMA] : m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_LUMA]; 2091 g_PCMBitDepth[CHANNEL_TYPE_CHROMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepth[CHANNEL_TYPE_CHROMA] : m_acLayerCfg[layer].m_internalBitDepth[CHANNEL_TYPE_CHROMA]; 2029 2092 #endif 2030 2093 // allocate original YUV buffer … … 2032 2095 if( m_isField ) 2033 2096 { 2034 #if SVC_EXTENSION2035 2097 #if LAYER_CTB 2036 #if AUXILIARY_PICTURES2037 2098 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 2038 #else 2039 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 2040 #endif 2041 #else 2042 #if AUXILIARY_PICTURES 2099 acPicYuvTrueOrg[layer].create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 2100 #else 2043 2101 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].getChromaFormatIDC(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 2044 #else 2045 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 2046 #endif 2047 #endif 2048 #else 2049 pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 2102 acPicYuvTrueOrg[layer].create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].getChromaFormatIDC(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 2050 2103 #endif 2051 2104 } 2052 2105 else 2053 2106 { 2054 #if SVC_EXTENSION2055 2107 #if LAYER_CTB 2056 #if AUXILIARY_PICTURES2057 2108 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 2058 #else 2059 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 2060 #endif 2061 #else 2062 #if AUXILIARY_PICTURES 2109 acPicYuvTrueOrg[layer].create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 2110 #else 2063 2111 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 2064 #else 2065 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 2066 #endif 2067 #endif 2068 #else 2069 pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 2112 acPicYuvTrueOrg[layer].create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 2070 2113 #endif 2071 2114 } … … 2083 2126 #if O0194_DIFFERENT_BITDEPTH_EL_BL 2084 2127 //6 2085 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;2086 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;2087 2088 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;2089 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;2128 for (UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++) 2129 { 2130 g_bitDepth[channelTypeIndex] = m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex]; 2131 g_PCMBitDepth[channelTypeIndex] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepth[channelTypeIndex] : m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex]; 2132 } 2090 2133 #endif 2091 2134 #if LAYER_CTB … … 2100 2143 2101 2144 // read input YUV file 2102 m_acTVideoIOYuvInputFile[layer].read( pcPicYuvOrg[layer], m_acLayerCfg[layer].getPad() );2145 m_acTVideoIOYuvInputFile[layer].read( pcPicYuvOrg[layer], &acPicYuvTrueOrg[layer], ipCSC, m_acLayerCfg[layer].getPad(), m_acLayerCfg[layer].getInputChromaFormat() ); 2103 2146 2104 2147 #if AUXILIARY_PICTURES … … 2124 2167 if ( m_isField ) 2125 2168 { 2126 m_acTEncTop[layer].encodePrep( pcPicYuvOrg[layer], m_isTopFieldFirst );2169 m_acTEncTop[layer].encodePrep( pcPicYuvOrg[layer], &acPicYuvTrueOrg[layer], m_isTopFieldFirst ); 2127 2170 } 2128 2171 else 2129 2172 { 2130 m_acTEncTop[layer].encodePrep( pcPicYuvOrg[layer] );2173 m_acTEncTop[layer].encodePrep( pcPicYuvOrg[layer], &acPicYuvTrueOrg[layer] ); 2131 2174 } 2132 2175 } … … 2177 2220 #if O0194_DIFFERENT_BITDEPTH_EL_BL 2178 2221 //7 2179 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;2180 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;2181 2182 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;2183 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;2222 for (UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++) 2223 { 2224 g_bitDepth[channelTypeIndex] = m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex]; 2225 g_PCMBitDepth[channelTypeIndex] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepth[channelTypeIndex] : m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex]; 2226 } 2184 2227 #endif 2185 2228 #if LAYER_CTB … … 2195 2238 #endif 2196 2239 // call encoding function for one frame 2197 if ( m_isField ) 2198 { 2199 m_acTEncTop[layer].encode( flush ? 0 : pcPicYuvOrg[layer], m_acListPicYuvRec[layer], outputAccessUnits, iPicIdInGOP, m_isTopFieldFirst ); 2200 } 2201 else 2202 { 2203 m_acTEncTop[layer].encode( flush ? 0 : pcPicYuvOrg[layer], m_acListPicYuvRec[layer], outputAccessUnits, iPicIdInGOP ); 2204 } 2240 if ( m_isField ) m_acTEncTop[layer].encode( flush ? 0 : pcPicYuvOrg[layer], snrCSC, m_acListPicYuvRec[layer], outputAccessUnits, iPicIdInGOP, m_isTopFieldFirst ); 2241 else m_acTEncTop[layer].encode( flush ? 0 : pcPicYuvOrg[layer], snrCSC, m_acListPicYuvRec[layer], outputAccessUnits, iPicIdInGOP ); 2205 2242 } 2206 2243 } … … 2209 2246 { 2210 2247 list<AccessUnit>::iterator first_au = outputAccessUnits.begin(); 2248 if( m_nonHEVCBaseLayerFlag ) 2249 { 2250 first_au++; 2251 } 2211 2252 AccessUnit::iterator it_sps; 2212 2253 for (it_sps = first_au->begin(); it_sps != first_au->end(); it_sps++) … … 2248 2289 #if O0194_DIFFERENT_BITDEPTH_EL_BL 2249 2290 //8 2250 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY;2251 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC;2252 2253 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY;2254 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC;2291 for (UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++) 2292 { 2293 g_bitDepth[channelTypeIndex] = m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex]; 2294 g_PCMBitDepth[channelTypeIndex] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepth[channelTypeIndex] : m_acLayerCfg[layer].m_internalBitDepth[channelTypeIndex]; 2295 } 2255 2296 #endif 2256 2297 // write bistream to file if necessary … … 2289 2330 if (bEos) 2290 2331 { 2291 printOutSummary(m_isTopFieldFirst );2332 printOutSummary(m_isTopFieldFirst, m_printMSEBasedSequencePSNR, m_printSequenceMSE); 2292 2333 } 2293 2334 … … 2303 2344 // delete used buffers in encoder class 2304 2345 m_acTEncTop[layer].deletePicBuffer(); 2346 acPicYuvTrueOrg[layer].destroy(); 2305 2347 } 2306 2348 … … 2314 2356 } 2315 2357 2316 Void TAppEncTop::printOutSummary(Bool isField )2358 Void TAppEncTop::printOutSummary(Bool isField, const Bool printMSEBasedSNR, const Bool printSequenceMSE) 2317 2359 { 2318 2360 UInt layer; … … 2339 2381 //-- all 2340 2382 printf( "\n\nSUMMARY --------------------------------------------------------\n" ); 2341 printf( "\tTotal Frames | " "Bitrate " "Y-PSNR " "U-PSNR " "V-PSNR \n" );2342 2383 for(layer = 0; layer < m_numLayers; layer++) 2343 2384 { 2344 m_gcAnalyzeAll[layer].printOut('a', layer);2385 m_gcAnalyzeAll[layer].printOut('a', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, layer); 2345 2386 } 2346 2387 2347 2388 printf( "\n\nI Slices--------------------------------------------------------\n" ); 2348 printf( "\tTotal Frames | " "Bitrate " "Y-PSNR " "U-PSNR " "V-PSNR \n" );2349 2389 for(layer = 0; layer < m_numLayers; layer++) 2350 2390 { 2351 m_gcAnalyzeI[layer].printOut('i', layer);2391 m_gcAnalyzeI[layer].printOut('i', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, layer); 2352 2392 } 2353 2393 2354 2394 printf( "\n\nP Slices--------------------------------------------------------\n" ); 2355 printf( "\tTotal Frames | " "Bitrate " "Y-PSNR " "U-PSNR " "V-PSNR \n" );2356 2395 for(layer = 0; layer < m_numLayers; layer++) 2357 2396 { 2358 m_gcAnalyzeP[layer].printOut('p', layer);2397 m_gcAnalyzeP[layer].printOut('p', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, layer); 2359 2398 } 2360 2399 2361 2400 printf( "\n\nB Slices--------------------------------------------------------\n" ); 2362 printf( "\tTotal Frames | " "Bitrate " "Y-PSNR " "U-PSNR " "V-PSNR \n" );2363 2401 for(layer = 0; layer < m_numLayers; layer++) 2364 2402 { 2365 m_gcAnalyzeB[layer].printOut('b', layer);2403 m_gcAnalyzeB[layer].printOut('b', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, layer); 2366 2404 } 2367 2405 … … 2372 2410 //-- interlaced summary 2373 2411 m_gcAnalyzeAll_in.setFrmRate( m_acLayerCfg[layer].getFrameRate()); 2412 m_gcAnalyzeAll_in.setBits(m_gcAnalyzeB[layer].getBits()); 2413 // prior to the above statement, the interlace analyser does not contain the correct total number of bits. 2414 2374 2415 printf( "\n\nSUMMARY INTERLACED ---------------------------------------------\n" ); 2375 m_gcAnalyzeAll_in.printOut Interlaced('a', m_gcAnalyzeAll[layer].getBits());2416 m_gcAnalyzeAll_in.printOut('a', m_acLayerCfg[layer].getChromaFormatIDC(), printMSEBasedSNR, printSequenceMSE, layer); 2376 2417 2377 2418 #if _SUMMARY_OUT_ … … 2380 2421 } 2381 2422 } 2423 2424 printf("\n"); 2425 //printf("\nRVM: %.3lf\n" , xCalculateRVM()); 2382 2426 } 2383 2427 2384 2428 #else 2429 // ==================================================================================================================== 2430 // Public member functions 2431 // ==================================================================================================================== 2432 2433 /** 2434 - create internal class 2435 - initialize internal variable 2436 - until the end of input YUV file, call encoding function in TEncTop class 2437 - delete allocated buffers 2438 - destroy internal class 2439 . 2440 */ 2385 2441 Void TAppEncTop::encode() 2386 2442 { … … 2400 2456 xInitLib(m_isField); 2401 2457 2458 printChromaFormat(); 2459 2402 2460 // main encoder loop 2403 2461 Int iNumEncoded = 0; 2404 2462 Bool bEos = false; 2405 2463 2464 const InputColourSpaceConversion ipCSC = m_inputColourSpaceConvert; 2465 const InputColourSpaceConversion snrCSC = (!m_snrInternalColourSpace) ? m_inputColourSpaceConvert : IPCOLOURSPACE_UNCHANGED; 2466 2406 2467 list<AccessUnit> outputAccessUnits; ///< list of access units to write out. is populated by the encoding process 2468 2469 TComPicYuv cPicYuvTrueOrg; 2407 2470 2408 2471 // allocate original YUV buffer 2409 2472 if( m_isField ) 2410 2473 { 2411 pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeightOrg, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 2474 pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeightOrg, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 2475 cPicYuvTrueOrg.create(m_iSourceWidth, m_iSourceHeightOrg, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth); 2412 2476 } 2413 2477 else 2414 2478 { 2415 pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 2479 pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 2480 cPicYuvTrueOrg.create(m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth); 2416 2481 } 2417 2482 … … 2422 2487 2423 2488 // read input YUV file 2424 m_cTVideoIOYuvInputFile.read( pcPicYuvOrg, m_aiPad);2489 m_cTVideoIOYuvInputFile.read( pcPicYuvOrg, &cPicYuvTrueOrg, ipCSC, m_aiPad, m_InputChromaFormatIDC ); 2425 2490 2426 2491 // increase number of received frames … … 2428 2493 2429 2494 bEos = (m_isField && (m_iFrameRcvd == (m_framesToBeEncoded >> 1) )) || ( !m_isField && (m_iFrameRcvd == m_framesToBeEncoded) ); 2495 2430 2496 Bool flush = 0; 2431 2497 // if end of file (which is only detected on a read failure) flush the encoder of any queued pictures … … 2439 2505 2440 2506 // call encoding function for one frame 2441 if ( m_isField ) 2442 { 2443 m_cTEncTop.encode( bEos, flush ? 0 : pcPicYuvOrg, m_cListPicYuvRec, outputAccessUnits, iNumEncoded, m_isTopFieldFirst); 2444 } 2445 else 2446 { 2447 m_cTEncTop.encode( bEos, flush ? 0 : pcPicYuvOrg, m_cListPicYuvRec, outputAccessUnits, iNumEncoded ); 2448 } 2507 if ( m_isField ) m_cTEncTop.encode( bEos, flush ? 0 : pcPicYuvOrg, flush ? 0 : &cPicYuvTrueOrg, snrCSC, m_cListPicYuvRec, outputAccessUnits, iNumEncoded, m_isTopFieldFirst ); 2508 else m_cTEncTop.encode( bEos, flush ? 0 : pcPicYuvOrg, flush ? 0 : &cPicYuvTrueOrg, snrCSC, m_cListPicYuvRec, outputAccessUnits, iNumEncoded ); 2449 2509 2450 2510 // write bistream to file if necessary … … 2465 2525 // delete used buffers in encoder class 2466 2526 m_cTEncTop.deletePicBuffer(); 2527 cPicYuvTrueOrg.destroy(); 2467 2528 2468 2529 // delete buffers & classes … … 2492 2553 2493 2554 // org. buffer 2494 if ( m_acListPicYuvRec[layer].size() == (UInt)m_iGOPSize )2555 if ( m_acListPicYuvRec[layer].size() >= (UInt)m_iGOPSize ) // buffer will be 1 element longer when using field coding, to maintain first field whilst processing second. 2495 2556 { 2496 2557 rpcPicYuvRec = m_acListPicYuvRec[layer].popFront(); … … 2502 2563 2503 2564 #if LAYER_CTB 2504 #if AUXILIARY_PICTURES2505 2565 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 2506 2566 #else 2507 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL );2508 #endif2509 #else2510 #if AUXILIARY_PICTURES2511 2567 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].getChromaFormatIDC(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 2512 #else2513 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL );2514 #endif2515 2568 #endif 2516 2569 … … 2544 2597 #endif 2545 2598 2599 const InputColourSpaceConversion ipCSC = (!m_outputInternalColourSpace) ? m_inputColourSpaceConvert : IPCOLOURSPACE_UNCHANGED; 2600 2546 2601 if (m_isField) 2547 2602 { … … 2567 2622 { 2568 2623 #if REPN_FORMAT_IN_VPS 2569 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConfWinLeft() * xScal, m_acLayerCfg[layer].getConfWinRight() * xScal,2570 m_acLayerCfg[layer].getConfWinTop() * yScal, m_acLayerCfg[layer].getConfWinBottom() * yScal, m_isTopFieldFirst );2571 #else 2572 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConfWinLeft(), m_acLayerCfg[layer].getConfWinRight(), m_acLayerCfg[layer].getConfWinTop(), m_acLayerCfg[layer].getConfWinBottom(), m_isTopFieldFirst );2624 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, ipCSC, m_acLayerCfg[layer].getConfWinLeft() * xScal, m_acLayerCfg[layer].getConfWinRight() * xScal, 2625 m_acLayerCfg[layer].getConfWinTop() * yScal, m_acLayerCfg[layer].getConfWinBottom() * yScal, NUM_CHROMA_FORMAT, m_isTopFieldFirst ); 2626 #else 2627 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, ipCSC, m_acLayerCfg[layer].getConfWinLeft(), m_acLayerCfg[layer].getConfWinRight(), m_acLayerCfg[layer].getConfWinTop(), m_acLayerCfg[layer].getConfWinBottom(), NUM_CHROMA_FORMAT, m_isTopFieldFirst ); 2573 2628 #endif 2574 2629 } … … 2596 2651 { 2597 2652 #if REPN_FORMAT_IN_VPS 2598 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfWinLeft() * xScal, m_acLayerCfg[layer].getConfWinRight() * xScal,2653 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, ipCSC, m_acLayerCfg[layer].getConfWinLeft() * xScal, m_acLayerCfg[layer].getConfWinRight() * xScal, 2599 2654 m_acLayerCfg[layer].getConfWinTop() * yScal, m_acLayerCfg[layer].getConfWinBottom() * yScal ); 2600 2655 #else 2601 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfWinLeft(), m_acLayerCfg[layer].getConfWinRight(),2656 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, ipCSC, m_acLayerCfg[layer].getConfWinLeft(), m_acLayerCfg[layer].getConfWinRight(), 2602 2657 m_acLayerCfg[layer].getConfWinTop(), m_acLayerCfg[layer].getConfWinBottom() ); 2603 2658 #endif … … 2655 2710 2656 2711 // org. buffer 2657 if ( m_cListPicYuvRec.size() == (UInt)m_iGOPSize )2712 if ( m_cListPicYuvRec.size() >= (UInt)m_iGOPSize ) // buffer will be 1 element longer when using field coding, to maintain first field whilst processing second. 2658 2713 { 2659 2714 rpcPicYuvRec = m_cListPicYuvRec.popFront(); … … 2664 2719 rpcPicYuvRec = new TComPicYuv; 2665 2720 2666 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_ uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );2721 rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 2667 2722 2668 2723 } … … 2689 2744 Void TAppEncTop::xWriteOutput(std::ostream& bitstreamFile, Int iNumEncoded, const std::list<AccessUnit>& accessUnits) 2690 2745 { 2746 const InputColourSpaceConversion ipCSC = (!m_outputInternalColourSpace) ? m_inputColourSpaceConvert : IPCOLOURSPACE_UNCHANGED; 2747 2691 2748 if (m_isField) 2692 2749 { … … 2708 2765 if (m_pchReconFile) 2709 2766 { 2710 m_cTVideoIOYuvReconFile.write( pcPicYuvRecTop, pcPicYuvRecBottom, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom, m_isTopFieldFirst );2767 m_cTVideoIOYuvReconFile.write( pcPicYuvRecTop, pcPicYuvRecBottom, ipCSC, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom, NUM_CHROMA_FORMAT, m_isTopFieldFirst ); 2711 2768 } 2712 2769 … … 2723 2780 { 2724 2781 Int i; 2782 2725 2783 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.end(); 2726 2784 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); … … 2736 2794 if (m_pchReconFile) 2737 2795 { 2738 m_cTVideoIOYuvReconFile.write( pcPicYuvRec, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom );2796 m_cTVideoIOYuvReconFile.write( pcPicYuvRec, ipCSC, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom ); 2739 2797 } 2740 2798 … … 2750 2808 * 2751 2809 */ 2752 void TAppEncTop::rateStatsAccum(const AccessUnit& au, const std::vector<UInt>& annexBsizes)2810 Void TAppEncTop::rateStatsAccum(const AccessUnit& au, const std::vector<UInt>& annexBsizes) 2753 2811 { 2754 2812 AccessUnit::const_iterator it_au = au.begin(); … … 2788 2846 } 2789 2847 2790 void TAppEncTop::printRateSummary()2848 Void TAppEncTop::printRateSummary() 2791 2849 { 2792 2850 #if SVC_EXTENSION … … 2801 2859 } 2802 2860 2861 #if !SVC_EXTENSION 2862 Void TAppEncTop::printChromaFormat() 2863 { 2864 std::cout << std::setw(43) << "Input ChromaFormatIDC = "; 2865 switch (m_InputChromaFormatIDC) 2866 { 2867 case CHROMA_400: std::cout << " 4:0:0"; break; 2868 case CHROMA_420: std::cout << " 4:2:0"; break; 2869 case CHROMA_422: std::cout << " 4:2:2"; break; 2870 case CHROMA_444: std::cout << " 4:4:4"; break; 2871 default: 2872 std::cerr << "Invalid"; 2873 exit(1); 2874 } 2875 std::cout << std::endl; 2876 2877 std::cout << std::setw(43) << "Output (internal) ChromaFormatIDC = "; 2878 switch (m_cTEncTop.getChromaFormatIdc()) 2879 { 2880 case CHROMA_400: std::cout << " 4:0:0"; break; 2881 case CHROMA_420: std::cout << " 4:2:0"; break; 2882 case CHROMA_422: std::cout << " 4:2:2"; break; 2883 case CHROMA_444: std::cout << " 4:4:4"; break; 2884 default: 2885 std::cerr << "Invalid"; 2886 exit(1); 2887 } 2888 std::cout << "\n" << std::endl; 2889 } 2890 #endif 2891 2803 2892 //! \}
Note: See TracChangeset for help on using the changeset viewer.