History

Convert tabs to spaces before comments

Martin Storsjö committed 11 years ago

Commit 78e0ec61 parent 3052b7a57 files · +278 −278Browse files

Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 57 files). Show all

Unified · Split

codec/encoder/plus/src/welsEncoderExt.cpp+27−27
@@ -38,7 +38,7 @@ · 37 unmodified lines
3838 #include "utils.h"
3939 #include "macros.h"
4040 #include "version.h"
41−#include "crt_util_safe_x.h" // Safe CRT routines like util for cross platforms
41+#include "crt_util_safe_x.h" // Safe CRT routines like util for cross platforms
4242 #include "ref_list_mgr_svc.h"
4343 #include "codec_ver.h"
4444
@@ -654,12 +654,12 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 609 unmodified lines
654654 }
655655
656656 switch (eOptionId) {
657− case ENCODER_OPTION_INTER_SPATIAL_PRED: { // Inter spatial layer prediction flag
657+ case ENCODER_OPTION_INTER_SPATIAL_PRED: { // Inter spatial layer prediction flag
658658 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
659659 "ENCODER_OPTION_INTER_SPATIAL_PRED, this feature not supported at present.");
660660 }
661661 break;
662− case ENCODER_OPTION_DATAFORMAT: { // Input color space
662+ case ENCODER_OPTION_DATAFORMAT: { // Input color space
663663 int32_t iValue = * ((int32_t*)pOption);
664664 int32_t iColorspace = iValue;
665665 if (iColorspace == 0) {
@@ -689,7 +689,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 23 unmodified lines
689689 int32_t iTargetWidth = 0;
690690 int32_t iTargetHeight = 0;
691691
692− memcpy (&sEncodingParam, pOption, sizeof (SEncParamBase)); // confirmed_safe_unsafe_usage
692+ memcpy (&sEncodingParam, pOption, sizeof (SEncParamBase)); // confirmed_safe_unsafe_usage
693693 if (sConfig.ParamBaseTranscode (sEncodingParam)) {
694694 return cmInitParaError;
695695 }
@@ -721,7 +721,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 25 unmodified lines
721721 int32_t iTargetWidth = 0;
722722 int32_t iTargetHeight = 0;
723723
724− memcpy (&sEncodingParam, pOption, sizeof (SEncParamExt)); // confirmed_safe_unsafe_usage
724+ memcpy (&sEncodingParam, pOption, sizeof (SEncParamExt)); // confirmed_safe_unsafe_usage
725725 TraceParamInfo (&sEncodingParam);
726726 #ifdef OUTPUT_BIT_STREAM
727727 if (sEncodingParam.sSpatialLayers[sEncodingParam.iSpatialLayerNum - 1].iVideoWidth !=
@@ -731,7 +731,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 3 unmodified lines
731731 }
732732 #endif//OUTPUT_BIT_STREAM
733733 if (sEncodingParam.iSpatialLayerNum < 1
734− || sEncodingParam.iSpatialLayerNum > MAX_SPATIAL_LAYER_NUM) { // verify number of spatial layer
734+ || sEncodingParam.iSpatialLayerNum > MAX_SPATIAL_LAYER_NUM) { // verify number of spatial layer
735735 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
736736 "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, iSpatialLayerNum(%d) failed!",
737737 sEncodingParam.iSpatialLayerNum);
@@ -782,7 +782,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 44 unmodified lines
782782 m_pEncContext->pSvcParam->fMaxFrameRate);
783783 }
784784 break;
785− case ENCODER_OPTION_BITRATE: { // Target bit-rate
785+ case ENCODER_OPTION_BITRATE: { // Target bit-rate
786786 SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption));
787787 int32_t iBitrate = pInfo->iBitrate;
788788 if (iBitrate <= 0) {
@@ -828,7 +828,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 39 unmodified lines
828828
829829 }
830830 break;
831− case ENCODER_OPTION_MAX_BITRATE: { // Target bit-rate
831+ case ENCODER_OPTION_MAX_BITRATE: { // Target bit-rate
832832 SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption));
833833 int32_t iBitrate = pInfo->iBitrate;
834834 if (iBitrate <= 0) {
@@ -873,7 +873,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 38 unmodified lines
873873 }
874874 }
875875 break;
876− case ENCODER_OPTION_RC_MODE: { // 0:quality mode;1:bit-rate mode;2:bitrate limited mode
876+ case ENCODER_OPTION_RC_MODE: { // 0:quality mode;1:bit-rate mode;2:bitrate limited mode
877877 int32_t iValue = * ((int32_t*)pOption);
878878 m_pEncContext->pSvcParam->iRCMode = (RC_MODES) iValue;
879879 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
@@ -881,7 +881,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 1 unmodified line
881881 iValue);
882882 }
883883 break;
884− case ENCODER_PADDING_PADDING: { // 0:disable padding;1:padding
884+ case ENCODER_PADDING_PADDING: { // 0:disable padding;1:padding
885885 int32_t iValue = * ((int32_t*)pOption);
886886 m_pEncContext->pSvcParam->iPaddingFlag = iValue;
887887 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
@@ -1106,45 +1106,45 @@ int CWelsH264SVCEncoder::GetOption (ENCODER_OPTION eOptionId, void* pOption) { · 218 unmodified lines
11061106 }
11071107
11081108 switch (eOptionId) {
1109− case ENCODER_OPTION_INTER_SPATIAL_PRED: { // Inter spatial layer prediction flag
1109+ case ENCODER_OPTION_INTER_SPATIAL_PRED: { // Inter spatial layer prediction flag
11101110 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
11111111 "ENCODER_OPTION_INTER_SPATIAL_PRED, this feature not supported at present.");
11121112 }
11131113 break;
1114− case ENCODER_OPTION_DATAFORMAT: { // Input color space
1114+ case ENCODER_OPTION_DATAFORMAT: { // Input color space
11151115 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
11161116 "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_DATAFORMAT, m_iCspInternal= 0x%x", m_iCspInternal);
11171117 * ((int32_t*)pOption) = m_iCspInternal;
11181118 }
11191119 break;
1120− case ENCODER_OPTION_IDR_INTERVAL: { // IDR Interval
1120+ case ENCODER_OPTION_IDR_INTERVAL: { // IDR Interval
11211121 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
11221122 "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_IDR_INTERVAL, uiIntraPeriod= %d",
11231123 m_pEncContext->pSvcParam->uiIntraPeriod);
11241124 * ((int32_t*)pOption) = m_pEncContext->pSvcParam->uiIntraPeriod;
11251125 }
11261126 break;
1127− case ENCODER_OPTION_SVC_ENCODE_PARAM_EXT: { // SVC Encoding Parameter
1127+ case ENCODER_OPTION_SVC_ENCODE_PARAM_EXT: { // SVC Encoding Parameter
11281128 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
11291129 "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT");
1130− memcpy (pOption, m_pEncContext->pSvcParam, sizeof (SEncParamExt)); // confirmed_safe_unsafe_usage
1130+ memcpy (pOption, m_pEncContext->pSvcParam, sizeof (SEncParamExt)); // confirmed_safe_unsafe_usage
11311131 }
11321132 break;
1133− case ENCODER_OPTION_SVC_ENCODE_PARAM_BASE: { // SVC Encoding Parameter
1133+ case ENCODER_OPTION_SVC_ENCODE_PARAM_BASE: { // SVC Encoding Parameter
11341134 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
11351135 "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_BASE");
11361136 m_pEncContext->pSvcParam->GetBaseParams ((SEncParamBase*) pOption);
11371137 }
11381138 break;
11391139
1140− case ENCODER_OPTION_FRAME_RATE: { // Maximal input frame rate
1140+ case ENCODER_OPTION_FRAME_RATE: { // Maximal input frame rate
11411141 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
11421142 "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_FRAME_RATE, fMaxFrameRate = %.6ff",
11431143 m_pEncContext->pSvcParam->fMaxFrameRate);
11441144 * ((float*)pOption) = m_pEncContext->pSvcParam->fMaxFrameRate;
11451145 }
11461146 break;
1147− case ENCODER_OPTION_BITRATE: { // Target bit-rate
1147+ case ENCODER_OPTION_BITRATE: { // Target bit-rate
11481148
11491149 SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption));
11501150 if ((pInfo->iLayer != SPATIAL_LAYER_ALL) && (pInfo->iLayer != SPATIAL_LAYER_0) && (pInfo->iLayer != SPATIAL_LAYER_1)
@@ -1160,7 +1160,7 @@ int CWelsH264SVCEncoder::GetOption (ENCODER_OPTION eOptionId, void* pOption) { · 9 unmodified lines
11601160 pInfo->iLayer, pInfo->iBitrate);
11611161 }
11621162 break;
1163− case ENCODER_OPTION_MAX_BITRATE: { // Target bit-rate
1163+ case ENCODER_OPTION_MAX_BITRATE: { // Target bit-rate
11641164 SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption));
11651165 if ((pInfo->iLayer != SPATIAL_LAYER_ALL) && (pInfo->iLayer != SPATIAL_LAYER_0) && (pInfo->iLayer != SPATIAL_LAYER_1)
11661166 && (pInfo->iLayer != SPATIAL_LAYER_2) && (pInfo->iLayer != SPATIAL_LAYER_3))
@@ -1216,20 +1216,20 @@ void CWelsH264SVCEncoder::DumpSrcPicture (const uint8_t* pSrc) { · 49 unmodified lines
12161216 char strFileName[256] = {0};
12171217 const int32_t iDataLength = m_iMaxPicWidth * m_iMaxPicHeight;
12181218
1219− WelsStrncpy (strFileName, 256, "pic_in_"); // confirmed_safe_unsafe_usage
1219+ WelsStrncpy (strFileName, 256, "pic_in_"); // confirmed_safe_unsafe_usage
12201220
12211221 if (m_iMaxPicWidth == 640) {
1222− WelsStrcat (strFileName, 256, "360p."); // confirmed_safe_unsafe_usage
1222+ WelsStrcat (strFileName, 256, "360p."); // confirmed_safe_unsafe_usage
12231223 } else if (m_iMaxPicWidth == 320) {
1224− WelsStrcat (strFileName, 256, "180p."); // confirmed_safe_unsafe_usage
1224+ WelsStrcat (strFileName, 256, "180p."); // confirmed_safe_unsafe_usage
12251225 } else if (m_iMaxPicWidth == 160) {
1226− WelsStrcat (strFileName, 256, "90p."); // confirmed_safe_unsafe_usage
1226+ WelsStrcat (strFileName, 256, "90p."); // confirmed_safe_unsafe_usage
12271227 }
12281228
12291229 switch (m_iCspInternal) {
12301230 case videoFormatI420:
12311231 case videoFormatYV12:
1232− WelsStrcat (strFileName, 256, "yuv"); // confirmed_safe_unsafe_usage
1232+ WelsStrcat (strFileName, 256, "yuv"); // confirmed_safe_unsafe_usage
12331233 pFile = WelsFopen (strFileName, "ab+");
12341234 // WelsLog( &m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "WELS_CSP_I420, m_iCspInternal= 0x%x", m_iCspInternal);
12351235 if (NULL != pFile) {
@@ -1239,7 +1239,7 @@ void CWelsH264SVCEncoder::DumpSrcPicture (const uint8_t* pSrc) { · 3 unmodified lines
12391239 }
12401240 break;
12411241 case videoFormatRGB:
1242− WelsStrcat (strFileName, 256, "rgb"); // confirmed_safe_unsafe_usage
1242+ WelsStrcat (strFileName, 256, "rgb"); // confirmed_safe_unsafe_usage
12431243 pFile = WelsFopen (strFileName, "ab+");
12441244 if (NULL != pFile) {
12451245 fwrite (pSrc, sizeof (uint8_t), iDataLength * 3, pFile);
@@ -1247,7 +1247,7 @@ void CWelsH264SVCEncoder::DumpSrcPicture (const uint8_t* pSrc) { · 1 unmodified line
12471247 fclose (pFile);
12481248 }
12491249 case videoFormatBGR:
1250− WelsStrcat (strFileName, 256, "bgr"); // confirmed_safe_unsafe_usage
1250+ WelsStrcat (strFileName, 256, "bgr"); // confirmed_safe_unsafe_usage
12511251 pFile = WelsFopen (strFileName, "ab+");
12521252 // WelsLog( &m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "WELS_CSP_BGR, m_iCspInternal= 0x%x", m_iCspInternal);
12531253 if (NULL != pFile) {
@@ -1257,7 +1257,7 @@ void CWelsH264SVCEncoder::DumpSrcPicture (const uint8_t* pSrc) { · 3 unmodified lines
12571257 }
12581258 break;
12591259 case videoFormatYUY2:
1260− WelsStrcat (strFileName, 256, "yuy2"); // confirmed_safe_unsafe_usage
1260+ WelsStrcat (strFileName, 256, "yuy2"); // confirmed_safe_unsafe_usage
12611261 pFile = WelsFopen (strFileName, "ab+");
12621262 if (NULL != pFile) {
12631263 fwrite (pSrc, sizeof (uint8_t), (CALC_BI_STRIDE (m_iMaxPicWidth, 16)) * m_iMaxPicHeight, pFile);

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