History

add a para check for max_nal_size

Sijia Chen committed 11 years ago

Commit 22113241 parent fba745f3 files · +8 −6Browse files

Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 3 files). Show all

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+4−4
@@ -529,9 +529,9 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa · 528 unmodified lines
529529 return ENC_RETURN_UNSUPPORTED_PARA;
530530 }
531531
532− if (pCodingParam->uiMaxNalSize <= NAL_HEADER_ADD_0X30BYTES) {
533− WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiMaxNalSize (%d) settings!",
534− pCodingParam->uiMaxNalSize);
532+ if (pCodingParam->uiMaxNalSize <= (NAL_HEADER_ADD_0X30BYTES + MAX_MACROBLOCK_SIZE_IN_BYTE)) {
533+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiMaxNalSize (%d) settings! should be larger than (NAL_HEADER_ADD_0X30BYTES + MAX_MACROBLOCK_SIZE_IN_BYTE)(%d)",
534+ pCodingParam->uiMaxNalSize, (NAL_HEADER_ADD_0X30BYTES + MAX_MACROBLOCK_SIZE_IN_BYTE));
535535 return ENC_RETURN_UNSUPPORTED_PARA;
536536 }
537537
@@ -1740,7 +1740,7 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx, SExistingParasetList* pExistingPa · 1202 unmodified lines
17401740 fCompressRatioThr = COMPRESS_RATIO_THR;
17411741
17421742 iLayerBsSize = WELS_ROUND (((3 * fDlp->iVideoWidth * fDlp->iVideoHeight) >> 1) * fCompressRatioThr) +
1743− MAX_MACROBLOCK_SIZE_IN_BYTE;
1743+ MAX_MACROBLOCK_SIZE_IN_BYTE_x2;
17441744 iLayerBsSize = WELS_ALIGN (iLayerBsSize, 4); // 4 bytes alinged
17451745 iVclLayersBsSizeCount += iLayerBsSize;
17461746 ++ iIndex;

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