1052 lines · 38.5 KB · C++
RawDownload
 int CWelsH264SVCEncoder::EncodeParameterSets (SFrameBSInfo* pBsInfo) {  return WelsEncoderEncodeParameterSets (m_pEncContext, pBsInfo);} /* * return: 0 - success; otherwise - failed; */int CWelsH264SVCEncoder::PauseFrame (const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo) {  int32_t  iReturn = 1;   ForceIntraFrame (true);   if (EncodeFrameInternal (kpSrcPic, pBsInfo) != videoFrameTypeInvalid) {    iReturn = 0;  }    // to avoid pause frame bitstream and  // normal bitstream use different video channel.  ForceIntraFrame (true);   return (int)iReturn;}  /* *	Force key frame */int CWelsH264SVCEncoder::ForceIntraFrame (bool bIDR) {  if (! (m_pEncContext && m_bInitialFlag)) {    return 1;  } #ifdef REC_FRAME_COUNT  WelsLog (m_pEncContext, WELS_LOG_INFO,           "CWelsH264SVCEncoder::ForceIntraFrame(), bIDR= %d, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", bIDR,           m_uiCountFrameNum, m_iCspInternal);#endif//REC_FRAME_COUNT   ForceCodingIDR (m_pEncContext);   return 0;} /************************************************************************* InDataFormat, IDRInterval, SVC Encode Param, Frame Rate, Bitrate,..************************************************************************/int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) {  if (NULL == pOption) {    return cmInitParaError;  }   if (NULL == m_pEncContext || false == m_bInitialFlag) {    return cmInitExpected;  }   switch (eOptionId) {  case ENCODER_OPTION_INTER_SPATIAL_PRED: {	// Inter spatial layer prediction flag    WelsLog (m_pEncContext, WELS_LOG_INFO, "ENCODER_OPTION_INTER_SPATIAL_PRED, this feature not supported at present.\n");  }  break;  case ENCODER_OPTION_DATAFORMAT: {	// Input color space    int32_t iValue = * ((int32_t*)pOption);    int32_t iColorspace = iValue;    if (iColorspace == 0) {      return cmInitParaError;    } #ifdef REC_FRAME_COUNT    WelsLog (m_pEncContext, WELS_LOG_INFO,             "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_DATAFORMAT, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %d\n",             m_uiCountFrameNum, m_iCspInternal, iValue);#endif//REC_FRAME_COUNT     m_iCspInternal = iColorspace;#ifdef REC_FRAME_COUNT    WelsLog (m_pEncContext, WELS_LOG_INFO,             "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_DATAFORMAT, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n",             m_uiCountFrameNum, m_iCspInternal);#endif//REC_FRAME_COUNT  }  break;  case ENCODER_OPTION_IDR_INTERVAL: {	// IDR Interval    int32_t iValue	= * ((int32_t*)pOption);#ifdef REC_FRAME_COUNT    WelsLog (m_pEncContext, WELS_LOG_INFO,             "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_IDR_INTERVAL, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %d\n",             m_uiCountFrameNum, m_iCspInternal, iValue);#endif//REC_FRAME_COUNT     if (iValue < -1 || iValue == 0)      iValue = 1;    if (iValue == (int32_t)m_pEncContext->pSvcParam->uiIntraPeriod) {      return cmResultSuccess;    }      m_pEncContext->pSvcParam->uiIntraPeriod	= (uint32_t)iValue;  }  break;  case ENCODER_OPTION_SVC_ENCODE_PARAM_EXT: {	// SVC Encoding Parameter    SEncParamExt		sEncodingParam;    SWelsSvcCodingParam	sConfig;    int32_t iInputColorspace = 0;    int32_t iTargetWidth = 0;    int32_t iTargetHeight = 0;     memcpy (&sEncodingParam, pOption, sizeof (SEncParamExt));	// confirmed_safe_unsafe_usage    WelsLog (m_pEncContext, WELS_LOG_INFO, "ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, sEncodingParam.iInputCsp= 0x%x\n",             sEncodingParam.iInputCsp);    WelsLog (m_pEncContext, WELS_LOG_INFO,             "coding_param->iPicWidth= %d;coding_param->iPicHeight= %d;coding_param->iTargetBitrate= %d;coding_param->iRCMode= %d;coding_param->iPaddingFlag= %d;coding_param->iTemporalLayerNum= %d;coding_param->iSpatialLayerNum= %d;coding_param->fFrameRate= %.6ff;coding_param->iInputCsp= %d;coding_param->uiIntraPeriod= %d;coding_param->bEnableSpsPpsIdAddition = %d;coding_param->bPrefixNalAddingCtrl = %d;coding_param->bEnableDenoise= %d;coding_param->bEnableBackgroundDetection= %d;coding_param->bEnableAdaptiveQuant= %d;coding_param->bEnableAdaptiveQuant= %d;coding_param->bEnableLongTermReference= %d;coding_param->iLtrMarkPeriod= %d;\n",             sEncodingParam.iPicWidth,             sEncodingParam.iPicHeight,             sEncodingParam.iTargetBitrate,             sEncodingParam.iRCMode,             sEncodingParam.iPaddingFlag,             sEncodingParam.iTemporalLayerNum,             sEncodingParam.iSpatialLayerNum,             sEncodingParam.fMaxFrameRate,             sEncodingParam.iInputCsp,             sEncodingParam.uiIntraPeriod,             sEncodingParam.bEnableSpsPpsIdAddition,             sEncodingParam.bPrefixNalAddingCtrl,             sEncodingParam.bEnableDenoise,             sEncodingParam.bEnableBackgroundDetection,             sEncodingParam.bEnableAdaptiveQuant,             sEncodingParam.bEnableFrameSkip,             sEncodingParam.bEnableLongTermReference,             sEncodingParam.iLtrMarkPeriod);    int32_t i = 0;    while (i < sEncodingParam.iSpatialLayerNum) {      SSpatialLayerConfig* pSpatialCfg = &sEncodingParam.sSpatialLayers[i];      WelsLog (m_pEncContext, WELS_LOG_INFO,               "coding_param->sSpatialLayers[%d]: .iVideoWidth= %d; .iVideoHeight= %d; .fFrameRate= %.6ff; .iSpatialBitrate= %d; .sSliceCfg.uiSliceMode= %d; .sSliceCfg.sSliceArgument.iSliceNum= %d; .sSliceCfg.sSliceArgument.uiSliceSizeConstraint= %d;\n",               i, pSpatialCfg->iVideoWidth,               pSpatialCfg->iVideoHeight,               pSpatialCfg->fFrameRate,               pSpatialCfg->iSpatialBitrate,               pSpatialCfg->sSliceCfg.uiSliceMode,               pSpatialCfg->sSliceCfg.sSliceArgument.uiSliceNum,               pSpatialCfg->sSliceCfg.sSliceArgument.uiSliceSizeConstraint              );      ++ i;    }#ifdef OUTPUT_BIT_STREAM    if (sEncodingParam.sSpatialLayers[sEncodingParam.iSpatialLayerNum - 1].iVideoWidth !=        m_pEncContext->pSvcParam->sDependencyLayers[m_pEncContext->pSvcParam->iSpatialLayerNum - 1].iFrameWidth) {      ++ m_iSwitchTimes;      m_bSwitch = true;    }#endif//OUTPUT_BIT_STREAM    if (sEncodingParam.iSpatialLayerNum < 1        || sEncodingParam.iSpatialLayerNum > MAX_SPATIAL_LAYER_NUM) {	// verify number of spatial layer      return cmInitParaError;    }     iInputColorspace	= sEncodingParam.iInputCsp;    if (sConfig.ParamTranscode (sEncodingParam)) {      return cmInitParaError;    }    if (sConfig.iSpatialLayerNum < 1) {      return cmInitParaError;    }    iTargetWidth	= sConfig.iPicWidth;    iTargetHeight	= sConfig.iPicHeight;    if (m_iCspInternal != iInputColorspace || m_iMaxPicWidth != iTargetWidth        || m_iMaxPicHeight != iTargetHeight) {	// for color space due to changed      m_iMaxPicWidth	= iTargetWidth;      m_iMaxPicHeight	= iTargetHeight;      m_iCspInternal	= iInputColorspace;    }#ifdef REC_FRAME_COUNT    WelsLog (m_pEncContext, WELS_LOG_INFO,             "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n",             m_uiCountFrameNum, m_iCspInternal);#endif//REC_FRAME_COUNT     /* New configuration available here */    sConfig.iInputCsp	= m_iCspInternal;	// I420 in default designed for presentation in encoder used internal    sConfig.DetermineTemporalSettings();     /* Check every field whether there is new request for memory block changed or else, Oct. 24, 2008 */    WelsEncoderParamAdjust (&m_pEncContext, &sConfig);  }  break;  case ENCODER_OPTION_FRAME_RATE: {	// Maximal input frame rate    float iValue	= * ((float*)pOption);#ifdef REC_FRAME_COUNT    WelsLog (m_pEncContext, WELS_LOG_INFO,             "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_FRAME_RATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %f\n",             m_uiCountFrameNum, m_iCspInternal, iValue);#endif//REC_FRAME_COUNT    if (iValue <= 0) {      return cmInitParaError;    }    //adjust to valid range    m_pEncContext->pSvcParam->fMaxFrameRate = WELS_CLIP3 (iValue, MIN_FRAME_RATE, MAX_FRAME_RATE);    WelsEncoderApplyFrameRate (m_pEncContext->pSvcParam);  }  break;  case ENCODER_OPTION_BITRATE: {	// Target bit-rate    SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption));    int32_t iBitrate = pInfo->iBitrate;#ifdef REC_FRAME_COUNT    WelsLog (m_pEncContext, WELS_LOG_INFO,             "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %d\n",             m_uiCountFrameNum, m_iCspInternal, iValue);#endif//REC_FRAME_COUNT    if (iBitrate <= 0) {      WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE,iBitrate = %d\n",               iBitrate);      return cmInitParaError;    }    iBitrate	= WELS_CLIP3 (iBitrate, MIN_BIT_RATE, MAX_BIT_RATE);    switch (pInfo->iLayer) {    case SPATIAL_LAYER_ALL:      m_pEncContext->pSvcParam->iTargetBitrate = iBitrate;      break;    case SPATIAL_LAYER_0:      m_pEncContext->pSvcParam->sSpatialLayers[0].iSpatialBitrate = iBitrate;      break;    case SPATIAL_LAYER_1:      m_pEncContext->pSvcParam->sSpatialLayers[1].iSpatialBitrate = iBitrate;      break;    case SPATIAL_LAYER_2:      m_pEncContext->pSvcParam->sSpatialLayers[2].iSpatialBitrate = iBitrate;      break;    case SPATIAL_LAYER_3:      m_pEncContext->pSvcParam->sSpatialLayers[3].iSpatialBitrate = iBitrate;      break;    default:      WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE,iLayer = %d\n",               pInfo->iLayer);      return cmInitParaError;      break;    }    //adjust to valid range    WelsEncoderApplyBitRate (m_pEncContext->pSvcParam, pInfo->iLayer);  }  break;  case ENCODER_OPTION_MAX_BITRATE: {	// Target bit-rate    SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption));    int32_t iBitrate = pInfo->iBitrate; #ifdef REC_FRAME_COUNT    WelsLog (m_pEncContext, WELS_LOG_INFO,             "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %d\n",             m_uiCountFrameNum, m_iCspInternal, iValue);#endif//REC_FRAME_COUNT    if (iBitrate <= 0) {      WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_MAX_BITRATE,iBitrate = %d\n",               iBitrate);      return cmInitParaError;    }    iBitrate	= WELS_CLIP3 (iBitrate, MIN_BIT_RATE, MAX_BIT_RATE);    switch (pInfo->iLayer) {    case SPATIAL_LAYER_ALL:      m_pEncContext->pSvcParam->iMaxBitrate = iBitrate;      break;    case SPATIAL_LAYER_0:      m_pEncContext->pSvcParam->sSpatialLayers[0].iMaxSpatialBitrate = iBitrate;      break;    case SPATIAL_LAYER_1:      m_pEncContext->pSvcParam->sSpatialLayers[1].iMaxSpatialBitrate = iBitrate;      break;    case SPATIAL_LAYER_2:      m_pEncContext->pSvcParam->sSpatialLayers[2].iMaxSpatialBitrate = iBitrate;      break;    case SPATIAL_LAYER_3:      m_pEncContext->pSvcParam->sSpatialLayers[3].iMaxSpatialBitrate = iBitrate;      break;    default:      WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_MAX_BITRATE,iLayer = %d\n",               pInfo->iLayer);      return cmInitParaError;      break;    }    //adjust to valid range    WelsEncoderApplyBitRate (m_pEncContext->pSvcParam, pInfo->iLayer);  }  break;  case ENCODER_OPTION_RC_MODE: {	// 0:quality mode;1:bit-rate mode;2:bitrate limited mode    int32_t iValue = * ((int32_t*)pOption);    m_pEncContext->pSvcParam->iRCMode	= (RC_MODES) iValue;  }  break;  case ENCODER_PADDING_PADDING: {	// 0:disable padding;1:padding    int32_t iValue = * ((int32_t*)pOption);    m_pEncContext->pSvcParam->iPaddingFlag	= iValue;  }  break;  case ENCODER_LTR_RECOVERY_REQUEST: {    SLTRRecoverRequest* pLTR_Recover_Request = (SLTRRecoverRequest*) (pOption);    FilterLTRRecoveryRequest (m_pEncContext, pLTR_Recover_Request);  }  break;  case ENCODER_LTR_MARKING_FEEDBACK: {    SLTRMarkingFeedback* fb = (SLTRMarkingFeedback*) (pOption);    FilterLTRMarkingFeedback (m_pEncContext, fb);  }  break;  case ENCOCER_LTR_MARKING_PERIOD: {    uint32_t iValue = * ((uint32_t*) (pOption));    m_pEncContext->pSvcParam->iLtrMarkPeriod = iValue;  }  break;  case ENCODER_OPTION_LTR: {    uint32_t iValue = * ((uint32_t*) (pOption));    m_pEncContext->pSvcParam->bEnableLongTermReference = iValue ? true : false;    WelsLog (m_pEncContext, WELS_LOG_WARNING, " CWelsH264SVCEncoder::SetOption enable LTR = %d",             m_pEncContext->pSvcParam->bEnableLongTermReference);  }  break;  case ENCODER_OPTION_ENABLE_SSEI: {    bool iValue = * ((bool*)pOption);    m_pEncContext->pSvcParam->bEnableSSEI = iValue;    WelsLog (m_pEncContext, WELS_LOG_INFO, " CWelsH264SVCEncoder::SetOption enable SSEI = %d \n",             m_pEncContext->pSvcParam->bEnableSSEI);  }  break;  case ENCODER_OPTION_ENABLE_PREFIX_NAL_ADDING: {    bool iValue = * ((bool*)pOption);    m_pEncContext->pSvcParam->bPrefixNalAddingCtrl = iValue;    WelsLog (m_pEncContext, WELS_LOG_INFO, " CWelsH264SVCEncoder::SetOption bPrefixNalAddingCtrl = %d \n",             m_pEncContext->pSvcParam->bPrefixNalAddingCtrl);  }  break;  case ENCODER_OPTION_ENABLE_SPS_PPS_ID_ADDITION: {    bool iValue = * ((bool*)pOption);     m_pEncContext->pSvcParam->bEnableSpsPpsIdAddition = iValue;    WelsLog (m_pEncContext, WELS_LOG_INFO, " CWelsH264SVCEncoder::SetOption enable SPS/PPS ID = %d \n",             m_pEncContext->pSvcParam->bEnableSpsPpsIdAddition);  }  break;  case ENCODER_OPTION_CURRENT_PATH: {    if (m_pEncContext->pSvcParam != NULL) {      char* path = static_cast<char*> (pOption);      m_pEncContext->pSvcParam->pCurPath = path;    }  }  break;  case ENCODER_OPTION_DUMP_FILE: {#ifdef ENABLE_FRAME_DUMP    if (m_pEncContext->pSvcParam != NULL) {      SDumpLayer* pDump = (static_cast<SDumpLayer*> (pOption));      WelsStrncpy (m_pEncContext->pSvcParam->sDependencyLayers[pDump->iLayer].sRecFileName,                   sizeof (m_pEncContext->pSvcParam->sDependencyLayers[pDump->iLayer].sRecFileName), pDump->pFileName);    }#endif  }  break;  case ENCODER_OPTION_TRACE_LEVEL: {    if (m_pWelsTrace) {      uint32_t level = * ((uint32_t*)pOption);      m_pWelsTrace->SetTraceLevel (level);    }  }  break;  default:    return cmInitParaError;  }   return 0;} int CWelsH264SVCEncoder::GetOption (ENCODER_OPTION eOptionId, void* pOption) {  if (NULL == pOption) {    return cmInitParaError;  }  if (NULL == m_pEncContext || false == m_bInitialFlag) {    return cmInitExpected;  }   switch (eOptionId) {  case ENCODER_OPTION_INTER_SPATIAL_PRED: {	// Inter spatial layer prediction flag    WelsLog (m_pEncContext, WELS_LOG_INFO, "ENCODER_OPTION_INTER_SPATIAL_PRED, this feature not supported at present.\n");  }  break;  case ENCODER_OPTION_DATAFORMAT: {	// Input color space#ifdef REC_FRAME_COUNT    WelsLog (m_pEncContext, WELS_LOG_INFO,             "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_DATAFORMAT, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n",             m_uiCountFrameNum, m_iCspInternal);#endif//REC_FRAME_COUNT     * ((int32_t*)pOption)	= m_iCspInternal;  }  break;  case ENCODER_OPTION_IDR_INTERVAL: {	// IDR Interval#ifdef REC_FRAME_COUNT    WelsLog (m_pEncContext, WELS_LOG_INFO,             "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_IDR_INTERVAL, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n",             m_uiCountFrameNum, m_iCspInternal);#endif//REC_FRAME_COUNT    * ((int32_t*)pOption) = m_pEncContext->pSvcParam->uiIntraPeriod;  }  break;  case ENCODER_OPTION_SVC_ENCODE_PARAM_EXT: {	// SVC Encoding Parameter#ifdef REC_FRAME_COUNT    WelsLog (m_pEncContext, WELS_LOG_INFO,             "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n",             m_uiCountFrameNum, m_iCspInternal);#endif//REC_FRAME_COUNT    memcpy (pOption, m_pEncContext->pSvcParam, sizeof (SEncParamExt));	// confirmed_safe_unsafe_usage  }  break;  case ENCODER_OPTION_SVC_ENCODE_PARAM_BASE: {	// SVC Encoding Parameter#ifdef REC_FRAME_COUNT    WelsLog (m_pEncContext, WELS_LOG_INFO,             "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_BASE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n",             m_uiCountFrameNum, m_iCspInternal);#endif//REC_FRAME_COUNT    m_pEncContext->pSvcParam->GetBaseParams ((SEncParamBase*) pOption);  }  break;   case ENCODER_OPTION_FRAME_RATE: {	// Maximal input frame rate#ifdef REC_FRAME_COUNT    WelsLog (m_pEncContext, WELS_LOG_INFO,             "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_FRAME_RATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n",             m_uiCountFrameNum, m_iCspInternal);#endif//REC_FRAME_COUNT    * ((float*)pOption)	= m_pEncContext->pSvcParam->fMaxFrameRate;  }  break;  case ENCODER_OPTION_BITRATE: {	// Target bit-rate#ifdef REC_FRAME_COUNT    WelsLog (m_pEncContext, WELS_LOG_INFO,             "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n",             m_uiCountFrameNum, m_iCspInternal);#endif//REC_FRAME_COUNT    SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption));    if ((pInfo->iLayer != SPATIAL_LAYER_ALL) && (pInfo->iLayer != SPATIAL_LAYER_0) && (pInfo->iLayer != SPATIAL_LAYER_1)        && (pInfo->iLayer != SPATIAL_LAYER_2) && (pInfo->iLayer != SPATIAL_LAYER_3))      return cmInitParaError;    if (pInfo->iLayer == SPATIAL_LAYER_ALL) {      pInfo->iBitrate = m_pEncContext->pSvcParam->iTargetBitrate;    } else {      pInfo->iBitrate = m_pEncContext->pSvcParam->sSpatialLayers[pInfo->iLayer].iSpatialBitrate;    }  }  break;  case ENCODER_OPTION_MAX_BITRATE: {	// Target bit-rate#ifdef REC_FRAME_COUNT    WelsLog (m_pEncContext, WELS_LOG_INFO,             "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_MAX_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n",             m_uiCountFrameNum, m_iCspInternal);#endif//REC_FRAME_COUNT    SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption));    if ((pInfo->iLayer != SPATIAL_LAYER_ALL) && (pInfo->iLayer != SPATIAL_LAYER_0) && (pInfo->iLayer != SPATIAL_LAYER_1)        && (pInfo->iLayer != SPATIAL_LAYER_2) && (pInfo->iLayer != SPATIAL_LAYER_3))      return cmInitParaError;    if (pInfo->iLayer == SPATIAL_LAYER_ALL) {      pInfo->iBitrate = m_pEncContext->pSvcParam->iMaxBitrate;    } else {      pInfo->iBitrate = m_pEncContext->pSvcParam->sSpatialLayers[pInfo->iLayer].iMaxSpatialBitrate;    }  }  break;  default:    return cmInitParaError;  }   return 0;} void CWelsH264SVCEncoder::DumpSrcPicture (const uint8_t* pSrc) {#ifdef DUMP_SRC_PICTURE  FILE* pFile = NULL;  char strFileName[256] = {0};  const int32_t iDataLength = m_iMaxPicWidth * m_iMaxPicHeight;   WelsStrncpy (strFileName, 256, "pic_in_");	// confirmed_safe_unsafe_usage   if (m_iMaxPicWidth == 640) {    WelsStrcat (strFileName, 256, "360p.");	// confirmed_safe_unsafe_usage  } else if (m_iMaxPicWidth == 320) {    WelsStrcat (strFileName, 256, "180p.");	// confirmed_safe_unsafe_usage  } else if (m_iMaxPicWidth == 160) {    WelsStrcat (strFileName, 256, "90p.");	// confirmed_safe_unsafe_usage  }   switch (m_iCspInternal) {  case videoFormatI420:  case videoFormatYV12:    WelsStrcat (strFileName, 256, "yuv");	// confirmed_safe_unsafe_usage    pFile = WelsFopen (strFileName, "ab+");    //				WelsLog( m_pEncContext, WELS_LOG_INFO, "WELS_CSP_I420, m_iCspInternal= 0x%x\n", m_iCspInternal);    if (NULL != pFile) {      fwrite (pSrc, sizeof (uint8_t), (iDataLength * 3) >> 1, pFile);      fflush (pFile);      fclose (pFile);    }    break;  case videoFormatRGB:    WelsStrcat (strFileName, 256, "rgb");	// confirmed_safe_unsafe_usage    pFile = WelsFopen (strFileName, "ab+");

Lines 501–1000 of 1052. Previous lines

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t