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
529 return ENC_RETURN_UNSUPPORTED_PARA;529 return ENC_RETURN_UNSUPPORTED_PARA;
530 }530 }
531 531
532 if (pCodingParam->uiMaxNalSize <= NAL_HEADER_ADD_0X30BYTES) {532 if (pCodingParam->uiMaxNalSize <= (NAL_HEADER_ADD_0X30BYTES + MAX_MACROBLOCK_SIZE_IN_BYTE)) {
533 WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiMaxNalSize (%d) settings!",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);534 pCodingParam->uiMaxNalSize, (NAL_HEADER_ADD_0X30BYTES + MAX_MACROBLOCK_SIZE_IN_BYTE));
535 return ENC_RETURN_UNSUPPORTED_PARA;535 return ENC_RETURN_UNSUPPORTED_PARA;
536 }536 }
537 537
@@ -1740,7 +1740,7 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx, SExistingParasetList* pExistingPa · 1202 unmodified lines
1740 fCompressRatioThr = COMPRESS_RATIO_THR;1740 fCompressRatioThr = COMPRESS_RATIO_THR;
1741 1741
1742 iLayerBsSize = WELS_ROUND (((3 * fDlp->iVideoWidth * fDlp->iVideoHeight) >> 1) * fCompressRatioThr) +1742 iLayerBsSize = WELS_ROUND (((3 * fDlp->iVideoWidth * fDlp->iVideoHeight) >> 1) * fCompressRatioThr) +
1743 MAX_MACROBLOCK_SIZE_IN_BYTE;1743 MAX_MACROBLOCK_SIZE_IN_BYTE_x2;
1744 iLayerBsSize = WELS_ALIGN (iLayerBsSize, 4); // 4 bytes alinged1744 iLayerBsSize = WELS_ALIGN (iLayerBsSize, 4); // 4 bytes alinged
1745 iVclLayersBsSizeCount += iLayerBsSize;1745 iVclLayersBsSizeCount += iLayerBsSize;
1746 ++ iIndex;1746 ++ 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