Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 2 files). Show all
Unified · Split
| @@ -473,15 +473,15 @@ int CWelsH264SVCEncoder::EncodeParameterSets (SFrameBSInfo* pBsInfo) { · 472 unmodified lines | ||
| 473 | 473 | * Force key frame |
| 474 | 474 | */ |
| 475 | 475 | int CWelsH264SVCEncoder::ForceIntraFrame (bool bIDR, int iLayerId) { |
| 476 | − if ( bIDR ) { | |
| 476 | + if (bIDR) { | |
| 477 | 477 | if (! (m_pEncContext && m_bInitialFlag)) { |
| 478 | 478 | return 1; |
| 479 | 479 | } |
| 480 | 480 | |
| 481 | − ForceCodingIDR(m_pEncContext, iLayerId); | |
| 481 | + ForceCodingIDR (m_pEncContext, iLayerId); | |
| 482 | 482 | } else { |
| 483 | 483 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 484 | − "CWelsH264SVCEncoder::ForceIntraFrame(),nothing to do as bIDR set to false"); | |
| 484 | + "CWelsH264SVCEncoder::ForceIntraFrame(),nothing to do as bIDR set to false"); | |
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | return 0; |
| @@ -741,6 +741,11 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 253 unmodified lines | ||
| 741 | 741 | m_iMaxPicWidth = iTargetWidth; |
| 742 | 742 | m_iMaxPicHeight = iTargetHeight; |
| 743 | 743 | } |
| 744 | + if (sConfig.DetermineTemporalSettings()) { | |
| 745 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | |
| 746 | + "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_BASE, DetermineTemporalSettings failed!"); | |
| 747 | + return cmInitParaError; | |
| 748 | + } | |
| 744 | 749 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 745 | 750 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_BASE iUsageType = %d,iPicWidth= %d;iPicHeight= %d;iTargetBitrate= %d;fMaxFrameRate= %.6ff;iRCMode= %d", |
| 746 | 751 | sEncodingParam.iUsageType, |
| @@ -1278,7 +1283,8 @@ void CWelsH264SVCEncoder::DumpSrcPicture (const SSourcePicture* pSrcPic, const · 531 unmodified lines | ||
| 1278 | 1283 | char strFileName[256] = {0}; |
| 1279 | 1284 | const int32_t iDataLength = m_iMaxPicWidth * m_iMaxPicHeight; |
| 1280 | 1285 | |
| 1281 | − WelsSnprintf (strFileName, sizeof (strFileName), "pic_in_%dx%d.yuv", m_iMaxPicWidth, m_iMaxPicHeight);// confirmed_safe_unsafe_usage | |
| 1286 | + WelsSnprintf (strFileName, sizeof (strFileName), "pic_in_%dx%d.yuv", m_iMaxPicWidth, | |
| 1287 | + m_iMaxPicHeight);// confirmed_safe_unsafe_usage | |
| 1282 | 1288 | |
| 1283 | 1289 | switch (pSrcPic->iColorFormat) { |
| 1284 | 1290 | case videoFormatI420: |
| @@ -1287,8 +1293,8 @@ void CWelsH264SVCEncoder::DumpSrcPicture (const SSourcePicture* pSrcPic, const · 2 unmodified lines | ||
| 1287 | 1293 | |
| 1288 | 1294 | if (NULL != pFile) { |
| 1289 | 1295 | fwrite (pSrcPic->pData[0], sizeof (uint8_t), pSrcPic->iStride[0]*m_iMaxPicHeight, pFile); |
| 1290 | − fwrite (pSrcPic->pData[1], sizeof (uint8_t), pSrcPic->iStride[1]*(m_iMaxPicHeight >> 1), pFile); | |
| 1291 | − fwrite (pSrcPic->pData[2], sizeof (uint8_t), pSrcPic->iStride[2]*(m_iMaxPicHeight >> 1), pFile); | |
| 1296 | + fwrite (pSrcPic->pData[1], sizeof (uint8_t), pSrcPic->iStride[1] * (m_iMaxPicHeight >> 1), pFile); | |
| 1297 | + fwrite (pSrcPic->pData[2], sizeof (uint8_t), pSrcPic->iStride[2] * (m_iMaxPicHeight >> 1), pFile); | |
| 1292 | 1298 | fflush (pFile); |
| 1293 | 1299 | fclose (pFile); |
| 1294 | 1300 | } else { |