Skip to content
Snippets Groups Projects
EncAppCfg.cpp 203 KiB
Newer Older
  • Learn to ignore specific revisions
  •   if (m_profile == Profile::MAINREXT)
      {
        ExtendedProfileName validProfileName;
        if (m_onePictureOnlyConstraintFlag)
        {
          validProfileName = m_bitDepthConstraint == 8 ? MAIN_444_STILL_PICTURE : (m_bitDepthConstraint == 16 ? MAIN_444_16_STILL_PICTURE : NONE);
        }
        else
        {
          const uint32_t intraIdx = m_intraConstraintFlag ? 1:0;
          const uint32_t bitDepthIdx = (m_bitDepthConstraint == 8 ? 0 : (m_bitDepthConstraint ==10 ? 1 : (m_bitDepthConstraint == 12 ? 2 : (m_bitDepthConstraint == 16 ? 3 : 4 ))));
          const uint32_t chromaFormatIdx = uint32_t(m_chromaFormatConstraint);
          validProfileName = (bitDepthIdx > 3 || chromaFormatIdx>3) ? NONE : validRExtProfileNames[intraIdx][bitDepthIdx][chromaFormatIdx];
        }
        std::string rextSubProfile;
        if (validProfileName!=NONE)
        {
          rextSubProfile=enumToString(strToExtendedProfile, sizeof(strToExtendedProfile)/sizeof(*strToExtendedProfile), validProfileName);
        }
        if (rextSubProfile == "main_444_16")
        {
          rextSubProfile="main_444_16 [NON STANDARD]";
        }
        msg( DETAILS, "Profile                                : %s (%s)\n", profileToString(m_profile), (rextSubProfile.empty())?"INVALID REXT PROFILE":rextSubProfile.c_str() );
      }
      else
      {
        msg( DETAILS, "Profile                                : %s\n", profileToString(m_profile) );
      }
      msg( DETAILS, "CU size / depth / total-depth          : %d / %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth, m_uiMaxCodingDepth );
      msg( DETAILS, "RQT trans. size (min / max)            : %d / %d\n", 1 << m_quadtreeTULog2MinSize, 1 << m_quadtreeTULog2MaxSize );
      msg( DETAILS, "Max RQT depth inter                    : %d\n", m_uiQuadtreeTUMaxDepthInter);
      msg( DETAILS, "Max RQT depth intra                    : %d\n", m_uiQuadtreeTUMaxDepthIntra);
      msg( DETAILS, "Min PCM size                           : %d\n", 1 << m_uiPCMLog2MinSize);
      msg( DETAILS, "Motion search range                    : %d\n", m_iSearchRange );
      msg( DETAILS, "Intra period                           : %d\n", m_iIntraPeriod );
      msg( DETAILS, "Decoding refresh type                  : %d\n", m_iDecodingRefreshType );
    #if QP_SWITCHING_FOR_PARALLEL
      if (m_qpIncrementAtSourceFrame.bPresent)
      {
        msg( DETAILS, "QP                                     : %d (incrementing internal QP at source frame %d)\n", m_iQP, m_qpIncrementAtSourceFrame.value);
      }
      else
      {
        msg( DETAILS, "QP                                     : %d\n", m_iQP);
      }
    #else
      msg( DETAILS, "QP                                     : %5.2f\n", m_fQP );
    #endif
      msg( DETAILS, "Max dQP signaling depth                : %d\n", m_iMaxCuDQPDepth);
    
      msg( DETAILS, "Cb QP Offset (dual tree)               : %d (%d)\n", m_cbQpOffset, m_cbQpOffsetDualTree);
      msg( DETAILS, "Cr QP Offset (dual tree)               : %d (%d)\n", m_crQpOffset, m_crQpOffsetDualTree);
      msg( DETAILS, "QP adaptation                          : %d (range=%d)\n", m_bUseAdaptiveQP, (m_bUseAdaptiveQP ? m_iQPAdaptationRange : 0) );
      msg( DETAILS, "GOP size                               : %d\n", m_iGOPSize );
      msg( DETAILS, "Input bit depth                        : (Y:%d, C:%d)\n", m_inputBitDepth[CHANNEL_TYPE_LUMA], m_inputBitDepth[CHANNEL_TYPE_CHROMA] );
      msg( DETAILS, "MSB-extended bit depth                 : (Y:%d, C:%d)\n", m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA], m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] );
      msg( DETAILS, "Internal bit depth                     : (Y:%d, C:%d)\n", m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA] );
      msg( DETAILS, "PCM sample bit depth                   : (Y:%d, C:%d)\n", m_bPCMInputBitDepthFlag ? m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA] : m_internalBitDepth[CHANNEL_TYPE_LUMA],
                                                                        m_bPCMInputBitDepthFlag ? m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] : m_internalBitDepth[CHANNEL_TYPE_CHROMA] );
      msg( DETAILS, "Intra reference smoothing              : %s\n", (m_enableIntraReferenceSmoothing           ? "Enabled" : "Disabled") );
      msg( DETAILS, "diff_cu_chroma_qp_offset_depth         : %d\n", m_diffCuChromaQpOffsetDepth);
      msg( DETAILS, "extended_precision_processing_flag     : %s\n", (m_extendedPrecisionProcessingFlag         ? "Enabled" : "Disabled") );
      msg( DETAILS, "implicit_rdpcm_enabled_flag            : %s\n", (m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT] ? "Enabled" : "Disabled") );
      msg( DETAILS, "explicit_rdpcm_enabled_flag            : %s\n", (m_rdpcmEnabledFlag[RDPCM_SIGNAL_EXPLICIT] ? "Enabled" : "Disabled") );
      msg( DETAILS, "transform_skip_rotation_enabled_flag   : %s\n", (m_transformSkipRotationEnabledFlag        ? "Enabled" : "Disabled") );
      msg( DETAILS, "transform_skip_context_enabled_flag    : %s\n", (m_transformSkipContextEnabledFlag         ? "Enabled" : "Disabled") );
      msg( DETAILS, "cross_component_prediction_enabled_flag: %s\n", (m_crossComponentPredictionEnabledFlag     ? (m_reconBasedCrossCPredictionEstimate ? "Enabled (reconstructed-residual-based estimate)" : "Enabled (encoder-side-residual-based estimate)") : "Disabled") );
      msg( DETAILS, "high_precision_offsets_enabled_flag    : %s\n", (m_highPrecisionOffsetsEnabledFlag         ? "Enabled" : "Disabled") );
      msg( DETAILS, "persistent_rice_adaptation_enabled_flag: %s\n", (m_persistentRiceAdaptationEnabledFlag     ? "Enabled" : "Disabled") );
      msg( DETAILS, "cabac_bypass_alignment_enabled_flag    : %s\n", (m_cabacBypassAlignmentEnabledFlag         ? "Enabled" : "Disabled") );
      if (m_bUseSAO)
      {
        msg( DETAILS, "log2_sao_offset_scale_luma             : %d\n", m_log2SaoOffsetScale[CHANNEL_TYPE_LUMA] );
        msg( DETAILS, "log2_sao_offset_scale_chroma           : %d\n", m_log2SaoOffsetScale[CHANNEL_TYPE_CHROMA] );
      }
    
      switch (m_costMode)
      {
        case COST_STANDARD_LOSSY:               msg( DETAILS, "Cost function:                         : Lossy coding (default)\n"); break;
        case COST_SEQUENCE_LEVEL_LOSSLESS:      msg( DETAILS, "Cost function:                         : Sequence_level_lossless coding\n"); break;
        case COST_LOSSLESS_CODING:              msg( DETAILS, "Cost function:                         : Lossless coding with fixed QP of %d\n", LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP); break;
        case COST_MIXED_LOSSLESS_LOSSY_CODING:  msg( DETAILS, "Cost function:                         : Mixed_lossless_lossy coding with QP'=%d for lossless evaluation\n", LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME); break;
        default:                                msg( DETAILS, "Cost function:                         : Unknown\n"); break;
      }
    
      msg( DETAILS, "RateControl                            : %d\n", m_RCEnableRateControl );
      msg( DETAILS, "WPMethod                               : %d\n", int(m_weightedPredictionMethod));
    
      if(m_RCEnableRateControl)
      {
        msg( DETAILS, "TargetBitrate                          : %d\n", m_RCTargetBitrate );
        msg( DETAILS, "KeepHierarchicalBit                    : %d\n", m_RCKeepHierarchicalBit );
        msg( DETAILS, "LCULevelRC                             : %d\n", m_RCLCULevelRC );
        msg( DETAILS, "UseLCUSeparateModel                    : %d\n", m_RCUseLCUSeparateModel );
        msg( DETAILS, "InitialQP                              : %d\n", m_RCInitialQP );
        msg( DETAILS, "ForceIntraQP                           : %d\n", m_RCForceIntraQP );
    #if U0132_TARGET_BITS_SATURATION
        msg( DETAILS, "CpbSaturation                          : %d\n", m_RCCpbSaturationEnabled );
        if (m_RCCpbSaturationEnabled)
        {
          msg( DETAILS, "CpbSize                                : %d\n", m_RCCpbSize);
          msg( DETAILS, "InitalCpbFullness                      : %.2f\n", m_RCInitialCpbFullness);
        }
    #endif
      }
    
      msg( DETAILS, "Max Num Merge Candidates               : %d\n", m_maxNumMergeCand );
    
      msg( DETAILS, "Max Num Affine Merge Candidates        : %d\n", m_maxNumAffineMergeCand );
    
      msg( DETAILS, "\n");
    
      msg( VERBOSE, "TOOL CFG: ");
      msg( VERBOSE, "IBD:%d ", ((m_internalBitDepth[CHANNEL_TYPE_LUMA] > m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA]) || (m_internalBitDepth[CHANNEL_TYPE_CHROMA] > m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA])));
      msg( VERBOSE, "HAD:%d ", m_bUseHADME                          );
      msg( VERBOSE, "RDQ:%d ", m_useRDOQ                            );
      msg( VERBOSE, "RDQTS:%d ", m_useRDOQTS                        );
      msg( VERBOSE, "RDpenalty:%d ", m_rdPenalty                    );
    #if SHARP_LUMA_DELTA_QP
      msg( VERBOSE, "LQP:%d ", m_lumaLevelToDeltaQPMapping.mode     );
    #endif
      msg( VERBOSE, "SQP:%d ", m_uiDeltaQpRD                        );
      msg( VERBOSE, "ASR:%d ", m_bUseASR                            );
      msg( VERBOSE, "MinSearchWindow:%d ", m_minSearchWindow        );
      msg( VERBOSE, "RestrictMESampling:%d ", m_bRestrictMESampling );
      msg( VERBOSE, "FEN:%d ", int(m_fastInterSearchMode)           );
      msg( VERBOSE, "ECU:%d ", m_bUseEarlyCU                        );
      msg( VERBOSE, "FDM:%d ", m_useFastDecisionForMerge            );
      msg( VERBOSE, "CFM:%d ", m_bUseCbfFastMode                    );
      msg( VERBOSE, "ESD:%d ", m_useEarlySkipDetection              );
      msg( VERBOSE, "TransformSkip:%d ",     m_useTransformSkip     );
      msg( VERBOSE, "TransformSkipFast:%d ", m_useTransformSkipFast );
      msg( VERBOSE, "TransformSkipLog2MaxSize:%d ", m_log2MaxTransformSkipBlockSize);
      msg( VERBOSE, "Slice: M=%d ", int(m_sliceMode));
      if (m_sliceMode!=NO_SLICES)
      {
        msg( VERBOSE, "A=%d ", m_sliceArgument);
      }
    #if HEVC_DEPENDENT_SLICES
      msg( VERBOSE, "SliceSegment: M=%d ",m_sliceSegmentMode);
      if (m_sliceSegmentMode!=NO_SLICES)
      {
        msg( VERBOSE, "A=%d ", m_sliceSegmentArgument);
      }
    #endif
      msg( VERBOSE, "CIP:%d ", m_bUseConstrainedIntraPred);
      msg( VERBOSE, "SAO:%d ", (m_bUseSAO)?(1):(0));
      msg( VERBOSE, "ALF:%d ", m_alf ? 1 : 0 );
      msg( VERBOSE, "PCM:%d ", (m_usePCM && (1<<m_uiPCMLog2MinSize) <= m_uiMaxCUWidth)? 1 : 0);
    
      if (m_TransquantBypassEnabledFlag && m_CUTransquantBypassFlagForce)
      {
        msg( VERBOSE, "TransQuantBypassEnabled: =1");
      }
      else
      {
        msg( VERBOSE, "TransQuantBypassEnabled:%d ", (m_TransquantBypassEnabledFlag)? 1:0 );
      }
    
      msg( VERBOSE, "WPP:%d ", (int)m_useWeightedPred);
      msg( VERBOSE, "WPB:%d ", (int)m_useWeightedBiPred);
      msg( VERBOSE, "PME:%d ", m_log2ParallelMergeLevel);
    #if HEVC_TILES_WPP
      const int iWaveFrontSubstreams = m_entropyCodingSyncEnabledFlag ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1;
      msg( VERBOSE, " WaveFrontSynchro:%d WaveFrontSubstreams:%d", m_entropyCodingSyncEnabledFlag?1:0, iWaveFrontSubstreams);
    #endif
    #if HEVC_USE_SCALING_LISTS
      msg( VERBOSE, " ScalingList:%d ", m_useScalingListId );
    #endif
      msg( VERBOSE, "TMVPMode:%d ", m_TMVPModeId     );
    
      msg( VERBOSE, " DQ:%d ", m_depQuantEnabledFlag);
    #if HEVC_USE_SIGN_HIDING
      msg( VERBOSE, " SignBitHidingFlag:%d ", m_signDataHidingEnabledFlag);
    #endif
      msg( VERBOSE, "RecalQP:%d ", m_recalculateQPAccordingToLambda ? 1 : 0 );
    
      if( m_profile == Profile::NEXT )
      {
        msg( VERBOSE, "\nNEXT TOOL CFG: " );
        msg( VERBOSE, "Affine:%d ", m_Affine );
        if ( m_Affine )
        {
          msg( VERBOSE, "AffineType:%d ", m_AffineType );
        }
        msg(VERBOSE, "SubPuMvp:%d+%d ", m_SubPuMvpMode & 1, (m_SubPuMvpMode & 2) == 2);
    
    Karsten Suehring's avatar
    Karsten Suehring committed
        msg( VERBOSE, "DualITree:%d ", m_dualTree );
    
        msg( VERBOSE, "LargeCTU:%d ", m_LargeCTU );
        msg( VERBOSE, "IMV:%d ", m_ImvMode );
    
        msg( VERBOSE, "BIO:%d ", m_BIO );
    
        msg( VERBOSE, "DisMDC:%d ", m_DisableMotionCompression );
        msg( VERBOSE, "MTT:%d ", m_MTT );
    #if ENABLE_WPP_PARALLELISM
        msg( VERBOSE, "AltDQPCoding:%d ", m_AltDQPCoding );
    #endif
        msg( VERBOSE, "LMChroma:%d ", m_LMChroma );
    
    Philippe Hanhart's avatar
    Philippe Hanhart committed
    #if JVET_M0142_CCLM_COLLOCATED_CHROMA
        if( m_LMChroma && m_chromaFormatIDC == CHROMA_420 )
        {
          msg( VERBOSE, "CclmCollocatedChroma:%d ", m_cclmCollocatedChromaFlag );
        }
    #endif
    
    Tung Nguyen's avatar
    Tung Nguyen committed
    #if JVET_M0464_UNI_MTS
        msg( VERBOSE, "MTS: %1d(intra) %1d(inter) ", m_MTS & 1, ( m_MTS >> 1 ) & 1 );
    #else
    
        msg( VERBOSE, "EMT: %1d(intra) %1d(inter) ", m_EMT & 1, ( m_EMT >> 1 ) & 1 );
    
    #endif
    #if JVET_M0140_SBT
        msg( VERBOSE, "SBT:%d ", m_SBT );
    
    Tung Nguyen's avatar
    Tung Nguyen committed
    #endif
        msg( VERBOSE, "CompositeLTReference:%d ", m_compositeRefEnabled);
    
        msg( VERBOSE, "GBi:%d ", m_GBi );
        msg( VERBOSE, "GBiFast:%d ", m_GBiFast );
    
    #if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
        msg( VERBOSE, "LADF:%d ", m_LadfEnabed );
    
    #endif
        msg(VERBOSE, "MHIntra:%d ", m_MHIntra);
    
        msg( VERBOSE, "Triangle:%d ", m_Triangle );
    
    #if JVET_M0255_FRACMMVD_SWITCH
        msg( VERBOSE, "AllowDisFracMMVD:%d ", m_allowDisFracMMVD );
    
    #endif
    #if JVET_M0246_AFFINE_AMVR
        msg( VERBOSE, "AffineAmvr:%d ", m_AffineAmvr );
    
    #endif
    #if JVET_M0247_AFFINE_AMVR_ENCOPT
        m_AffineAmvrEncOpt = m_AffineAmvr ? m_AffineAmvrEncOpt : false;
        msg( VERBOSE, "AffineAmvrEncOpt:%d ", m_AffineAmvrEncOpt );
    
    #endif
    #if JVET_M0147_DMVR
        msg(VERBOSE, "DMVR:%d ", m_DMVR);
    
    Yu Han's avatar
    Yu Han committed
        msg(VERBOSE, "IBC:%d ", m_IBCMode);
    
    #if JVET_M0253_HASH_ME
      msg( VERBOSE, "HashME:%d ", m_HashME );
    #endif
    
      msg( VERBOSE, "WrapAround:%d ", m_wrapAround);
      if( m_wrapAround )
    
    Philippe Hanhart's avatar
    Philippe Hanhart committed
      {
    
        msg( VERBOSE, "WrapAroundOffset:%d ", m_wrapAroundOffset );
    
    Philippe Hanhart's avatar
    Philippe Hanhart committed
      }
    
      // ADD_NEW_TOOL (add some output indicating the usage of tools)
    
    Taoran Lu's avatar
    Taoran Lu committed
    #if JVET_M0427_INLOOP_RESHAPER
    
    Taoran Lu's avatar
    Taoran Lu committed
        msg(VERBOSE, "Reshape:%d ", m_lumaReshapeEnable);
        if (m_lumaReshapeEnable)
    
    Taoran Lu's avatar
    Taoran Lu committed
          msg(VERBOSE, "(Sigal:%s ", m_reshapeSignalType==0? "SDR" : "HDR-PQ");
    
    Taoran Lu's avatar
    Taoran Lu committed
          msg(VERBOSE, ") ");
        }
    #endif
    
      msg( VERBOSE, "\nFAST TOOL CFG: " );
      if( m_LargeCTU )
      {
        msg( VERBOSE, "LCTUFast:%d ", m_useFastLCTU );
      }
      msg( VERBOSE, "FastMrg:%d ", m_useFastMrg );
      msg( VERBOSE, "PBIntraFast:%d ", m_usePbIntraFast );
      if( m_ImvMode == 2 ) msg( VERBOSE, "IMV4PelFast:%d ", m_Imv4PelFast );
    
    Tung Nguyen's avatar
    Tung Nguyen committed
    #if JVET_M0464_UNI_MTS
      if( m_MTS ) msg( VERBOSE, "MTSMaxCand: %1d(intra) %1d(inter) ", m_MTSIntraMaxCand, m_MTSInterMaxCand );
    #else
    
      if( m_EMT ) msg( VERBOSE, "EMTFast: %1d(intra) %1d(inter) ", ( m_FastEMT & m_EMT & 1 ), ( m_FastEMT >> 1 ) & ( m_EMT >> 1 ) & 1 );
    
    Tung Nguyen's avatar
    Tung Nguyen committed
    #endif
    
    Karsten Suehring's avatar
    Karsten Suehring committed
      msg( VERBOSE, "AMaxBT:%d ", m_useAMaxBT );
      msg( VERBOSE, "E0023FastEnc:%d ", m_e0023FastEnc );
      msg( VERBOSE, "ContentBasedFastQtbt:%d ", m_contentBasedFastQtbt );
    
    
      msg( VERBOSE, "NumSplitThreads:%d ", m_numSplitThreads );
      if( m_numSplitThreads > 1 )
      {
        msg( VERBOSE, "ForceSingleSplitThread:%d ", m_forceSplitSequential );
      }
      msg( VERBOSE, "NumWppThreads:%d+%d ", m_numWppThreads, m_numWppExtraLines );
      msg( VERBOSE, "EnsureWppBitEqual:%d ", m_ensureWppBitEqual );
    
    #if EXTENSION_360_VIDEO
      m_ext360.outputConfigurationSummary();
    #endif
    
      msg( VERBOSE, "\n\n");
    
      msg( NOTICE, "\n");
    
      fflush( stdout );
    }
    
    bool confirmPara(bool bflag, const char* message)
    {
      if (!bflag)
      {
        return false;
      }
    
      msg( ERROR, "Error: %s\n",message);
      return true;
    }
    
    //! \}