encodercodingparameter.h

来自「JVT-S203 contains the JSVM 6 reference s」· C头文件 代码 · 共 1,119 行 · 第 1/4 页

H
1,119
字号
      ROTS( NULL == argv[n  ] );
      ROTS( NULL == argv[n+1] );
      UInt    uiLayer = atoi( argv[n  ] );
      Double  dResQp  = atof( argv[n+1] );
      CodingParameter::getLayerParameters( uiLayer ).setBaseQpResidual( dResQp );
      printf("\n********** layer %1d - rqp = %f **********\n\n",uiLayer,dResQp);
      n += 1;
      continue;      
    }
    if( equals( pcCom, "-mqp", 4 ) )
    {
      ROTS( NULL == argv[n  ] );
      ROTS( NULL == argv[n+1] );
      ROTS( NULL == argv[n+2] );
      UInt    uiLayer = atoi( argv[n  ] );
      UInt    uiStage = atoi( argv[n+1] );
      Double  dMotQp  = atof( argv[n+2] );
      CodingParameter::getLayerParameters( uiLayer ).setQpModeDecision( uiStage, dMotQp );
      n += 2;
      continue;      
    }
    if( equals( pcCom, "-lqp", 4 ) )
    {
      ROTS( NULL == argv[n  ] );
      ROTS( NULL == argv[n+1] );
      UInt    uiLayer = atoi( argv[n  ] );
      Double  dQp     = atof( argv[n+1] );
      CodingParameter::getLayerParameters( uiLayer ).setBaseQpResidual( dQp );
      for( UInt uiStage = 0; uiStage < MAX_DSTAGES; uiStage++ )
      {
        CodingParameter::getLayerParameters( uiLayer ).setQpModeDecision( uiStage, dQp );
      }
      CodingParameter::getLayerParameters( uiLayer ).setQpModeDecisionLP( dQp );
      n += 1;
      continue;      
    }
    if( equals( pcCom, "-ilpred", 7 ) )
    {
      ROTS( NULL == argv[n  ] );
      ROTS( NULL == argv[n+1] );
      UInt    uiLayer = atoi( argv[n  ] );
      UInt    uiBLRes = atoi( argv[n+1] );
      CodingParameter::getLayerParameters( uiLayer ).setInterLayerPredictionMode( uiBLRes );
      n += 1;
      continue;
    }
    if( equals( pcCom, "-mfile", 6 ) )
    {
      ROTS( NULL == argv[n  ] );
      ROTS( NULL == argv[n+1] );
      ROTS( NULL == argv[n+2] );
      UInt    uiLayer = atoi( argv[n  ] );
      UInt    uiMode  = atoi( argv[n+1] );
      CodingParameter::getLayerParameters( uiLayer ).setMotionInfoMode( uiMode );
      CodingParameter::getLayerParameters( uiLayer ).setMotionInfoFilename( argv[n+2] );
      n += 2;
      continue;
    }
    if( equals( pcCom, "-frms", 5 ) )
    {
      ROTS( NULL == argv[n] ); 
      UInt uiFrms = atoi( argv[n] );
      CodingParameter::setTotalFrames( uiFrms );
      continue;
    }
    if( equals( pcCom, "-bcip", 5 ) )
    {
      n--;
      ROTS( NULL == argv[n] );
      CodingParameter::getLayerParameters(0).setContrainedIntraForLP();
      continue;
    }
    if( equals( pcCom, "-cl", 3 ) )
    {
      ROTS( NULL == argv[n] );
      ROTS( NULL == argv[n+1] );
      UInt uiLayer = atoi( argv[n] );
      UInt uiCLoop = atoi( argv[n+1] );
      CodingParameter::getLayerParameters( uiLayer ).setClosedLoop( uiCLoop );
      n += 1;
      continue;
    }
    if( equals( pcCom, "-ref", 4 ) )
    {
      ROTS( NULL == argv[n] );
      Double dLowPassEnhRef = atof( argv[n] );
      CodingParameter::setLowPassEnhRef( dLowPassEnhRef );
      continue;
    }
    if( equals( pcCom, "-ar", 3 ) )
    {
      ROTS( NULL == argv[n] );
      ROTS( NULL == argv[n + 1] );
      UInt uiBaseRefWeightZeroBlock = atoi( argv[n] );
      UInt uiBaseRefWeightZeroCoeff = atoi( argv[n + 1] );
      CodingParameter::setAdaptiveRefFGSWeights( uiBaseRefWeightZeroBlock, uiBaseRefWeightZeroCoeff );
      // skip two
      n += 1;
      continue;
    }
    if( equals( pcCom, "-fs", 3 ) )
    {
      ROTS( NULL == argv[n] );
      UInt flag = atoi( argv[n] );
      CodingParameter::setFgsEncStructureFlag( flag );
      continue;
    }
    if( equals( pcCom, "-pf", 3) )
    {
      ROTS( NULL == argv[n] );
      std::string cFilename = argv[n];
      RNOKS( xReadFromFile( cFilename, rcBitstreamFile ) );  
      continue;
    }
    //JVT-P031
    if( equals( pcCom, "-ds", 3) )
    {
     ROTS( NULL == argv[n] );
     ROTS( NULL == argv[n+1] );
     UInt uiLayer = atoi(argv[n]);
     CodingParameter::getLayerParameters(uiLayer).setUseDiscardable(true);
     Double dRate = atof(argv[n+1]);
     CodingParameter::getLayerParameters(uiLayer).setPredFGSRate(dRate);
     n+=1;
     continue;
    }
    //~JVT-P031
	
	//S051{
	if( equals( pcCom, "-encsip", 7 ) )
    {
		ROTS( NULL == argv[n  ] );
		ROTS( NULL == argv[n+1] );
		
		UInt    uiLayer = atoi( argv[n  ] );
		CodingParameter::getLayerParameters( uiLayer ).setEncSIP(true);
		CodingParameter::getLayerParameters( uiLayer ).setInSIPFileName(argv[n+1]);
		n += 1;
		continue;
    }
	if( equals( pcCom, "-anasip", 7 ) )
    {
		ROTS( NULL == argv[n  ] );
		ROTS( NULL == argv[n+1] );
		ROTS( NULL == argv[n+2] );
		
		UInt    uiLayer = atoi( argv[n  ] );
		UInt	uiMode = atoi( argv[n+1] );
		
		if(uiMode!=0)
			CodingParameter::getLayerParameters( uiLayer ).setAnaSIP(2);
		else
			CodingParameter::getLayerParameters( uiLayer ).setAnaSIP(1);
		
		CodingParameter::getLayerParameters( uiLayer ).setOutSIPFileName(argv[n+2]);
		n += 2;
		continue;
    }
	//S051}
	
    if( equals( pcCom, "-fgsmot", 7 ) )
    {
      ROTS( NULL == argv[n  ] );
      ROTS( NULL == argv[n+1] );
      UInt uiLayer         = atoi( argv[n  ] );
      UInt uiFGSMotionMode = atoi( argv[n+1] );
      CodingParameter::getLayerParameters( uiLayer ).setFGSMotionMode( uiFGSMotionMode );
      n += 1;
      continue;
    }

#if INDEPENDENT_PARSING
    if( equals( pcCom, "-ipars", 6 ) )
    {
      ROTS( NULL == argv[n  ] );
      ROTS( NULL == argv[n+1] );
      UInt uiLayer      = atoi( argv[n  ] );
      UInt uiIndParsing = atoi( argv[n+1] );
      CodingParameter::getLayerParameters( uiLayer ).setIndependentParsing( uiIndParsing );
      continue;
    }
    if( equals( pcCom, "-aip", 4 ) )
    {
      n--;
      ROTS( NULL == argv[n] );
      for( UInt uiLayer = 0; uiLayer < MAX_LAYERS; uiLayer++ )
      {
        CodingParameter::getLayerParameters( uiLayer ).setIndependentParsing( true );
      }
      continue;
    }
#endif

    if( equals( pcCom, "-org", 4 ) )
    {
      ROTS( NULL == argv[n  ] );
      ROTS( NULL == argv[n+1] );
      UInt    uiLayer = atoi( argv[n  ] );
      ROF(    uiLayer < MAX_LAYERS );
      CodingParameter::getLayerParameters( uiLayer ).setInputFilename( argv[n+1] );
      n += 1;
      continue;      
    }
    if( equals( pcCom, "-rec", 4 ) )
    {
      ROTS( NULL == argv[n  ] );
      ROTS( NULL == argv[n+1] );
      UInt    uiLayer = atoi( argv[n  ] );
      ROF(    uiLayer < MAX_LAYERS );
      CodingParameter::getLayerParameters( uiLayer ).setOutputFilename( argv[n+1] );
      n += 1;
      continue;      
    }
    if( equals( pcCom, "-ec", 3 ) )
    {
      ROTS( NULL == argv[n  ] );
      ROTS( NULL == argv[n+1] );
      UInt    uiLayer  = atoi( argv[n  ] );
      ROF(    uiLayer < MAX_LAYERS );
      UInt    uiECmode = atoi( argv[n+1] );
      CodingParameter::getLayerParameters( uiLayer ).setEntropyCodingModeFlag( uiECmode != 0 );
      n += 1;
      continue;      
    }
    if( equals( pcCom, "-vlc", 4 ) )
    {
      n--;
      ROTS( NULL == argv[n] );
      for( UInt uiLayer = 0; uiLayer < MAX_LAYERS; uiLayer++ )
      {
        CodingParameter::getLayerParameters( uiLayer ).setEntropyCodingModeFlag( false );
      }
      continue;
    }
    if( equals( pcCom, "-cabac", 6 ) )
    {
      n--;
      ROTS( NULL == argv[n] );
      for( UInt uiLayer = 0; uiLayer < MAX_LAYERS; uiLayer++ )
      {
        CodingParameter::getLayerParameters( uiLayer ).setEntropyCodingModeFlag( true );
      }
      continue;
    }

    if( equals( pcCom, "-h", 2) )
    {
      printHelp();
      return Err::m_nOK;
    }
    //{{Adaptive GOP structure
	  // --ETRI & KHU
	  if (equals( pcCom, "-anaags", 7) )
	  {
	    m_uiWriteGOPMode	= atoi( argv[n] );
        continue;
	  }
	  //}}Adaptive GOP structure

    return Err::m_nERR;
  }


  RNOKS( check() );
  
  return Err::m_nOK;
}


Void EncoderCodingParameter::printHelp()
{
  printf("\n supported options:\n\n");
  printf("  -pf     Parameter File Name\n\n");

  printf("  -bf     BitStreamFile\n");
  printf("  -frms   Number of total frames\n");
  printf("  -numl   Number Of Layers\n");
  printf("  -cabac  CABAC for all layers as entropy coding mode\n");
  printf("  -vlc    VLC for all layers as entropy coding mode\n");
#if INDEPENDENT_PARSING

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?