Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 2 files). Show all
Unified · Split
| @@ -396,10 +396,16 @@ int CWelsH264SVCEncoder::EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSIn · 395 unmodified lines | |||
| 396 | 396 | ||
| 397 | 397 | ||
| 398 | int CWelsH264SVCEncoder ::EncodeFrameInternal (const SSourcePicture* pSrcPic, SFrameBSInfo* pBsInfo) { | 398 | int CWelsH264SVCEncoder ::EncodeFrameInternal (const SSourcePicture* pSrcPic, SFrameBSInfo* pBsInfo) { |
| 399 | |||
| 400 | if ((pSrcPic->iPicWidth < 16) || ((pSrcPic->iPicHeight < 16))) { | ||
| 401 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "Don't support width(%d) or height(%d) which is less than 16!", | ||
| 402 | pSrcPic->iPicWidth, pSrcPic->iPicHeight); | ||
| 403 | return cmUnsupportedData; | ||
| 404 | } | ||
| 405 | |||
| 399 | const int64_t kiBeforeFrameUs = WelsTime(); | 406 | const int64_t kiBeforeFrameUs = WelsTime(); |
| 400 | const int32_t kiEncoderReturn = WelsEncoderEncodeExt (m_pEncContext, pBsInfo, pSrcPic); | 407 | const int32_t kiEncoderReturn = WelsEncoderEncodeExt (m_pEncContext, pBsInfo, pSrcPic); |
| 401 | const int64_t kiCurrentFrameMs = (WelsTime() - kiBeforeFrameUs) / 1000; | 408 | const int64_t kiCurrentFrameMs = (WelsTime() - kiBeforeFrameUs) / 1000; |
| 402 | |||
| 403 | if ((kiEncoderReturn == ENC_RETURN_MEMALLOCERR) || (kiEncoderReturn == ENC_RETURN_MEMOVERFLOWFOUND) | 409 | if ((kiEncoderReturn == ENC_RETURN_MEMALLOCERR) || (kiEncoderReturn == ENC_RETURN_MEMOVERFLOWFOUND) |
| 404 | || (kiEncoderReturn == ENC_RETURN_VLCOVERFLOWFOUND)) { | 410 | || (kiEncoderReturn == ENC_RETURN_VLCOVERFLOWFOUND)) { |
| 405 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_DEBUG, "CWelsH264SVCEncoder::EncodeFrame() not succeed, err=%d", | 411 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_DEBUG, "CWelsH264SVCEncoder::EncodeFrame() not succeed, err=%d", |
| @@ -735,7 +741,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 329 unmodified lines | |||
| 735 | if ((sEncodingParam.iPicWidth != m_pEncContext->pSvcParam->sDependencyLayers[m_pEncContext->pSvcParam->iSpatialLayerNum | 741 | if ((sEncodingParam.iPicWidth != m_pEncContext->pSvcParam->sDependencyLayers[m_pEncContext->pSvcParam->iSpatialLayerNum |
| 736 | - 1].iActualWidth) || | 742 | - 1].iActualWidth) || |
| 737 | (sEncodingParam.iPicHeight != m_pEncContext->pSvcParam->sDependencyLayers[m_pEncContext->pSvcParam->iSpatialLayerNum - | 743 | (sEncodingParam.iPicHeight != m_pEncContext->pSvcParam->sDependencyLayers[m_pEncContext->pSvcParam->iSpatialLayerNum - |
| 738 | 1].iActualHeight)) { | 744 | 1].iActualHeight)) { |
| 739 | ++m_iSwitchTimes; | 745 | ++m_iSwitchTimes; |
| 740 | m_bSwitch = true; | 746 | m_bSwitch = true; |
| 741 | } | 747 | } |