History

1, fix a potential overflow 2, remove some unnecessary multiplier and add input check of spatial BR

Sijia Chen committed 11 years ago

Commit 57528881 parent a00dd567 files · +7810 −7737Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+4−3
@@ -71,9 +71,10 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 70 unmodified lines
7171
7272
7373 int32_t WelsBitRateVerification (SLogContext* pLogCtx, SSpatialLayerConfig* pLayerParam, int32_t iLayerId) {
74− if (pLayerParam->iSpatialBitrate <= 0) {
75− WelsLog (pLogCtx, WELS_LOG_ERROR, "Invalid bitrate settings in layer %d, bitrate= %d", iLayerId,
76− pLayerParam->iSpatialBitrate);
74+ if ((pLayerParam->iSpatialBitrate <= 0)
75+ || (static_cast<float> (pLayerParam->iSpatialBitrate) < pLayerParam->fFrameRate)) {
76+ WelsLog (pLogCtx, WELS_LOG_ERROR, "Invalid bitrate settings in layer %d, bitrate= %d at FrameRate(%f)", iLayerId,
77+ pLayerParam->iSpatialBitrate, pLayerParam->fFrameRate);
7778 return ENC_RETURN_UNSUPPORTED_PARA;
7879 }
7980

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