ref: de275b3b0a062f8eb62df50e797cde941a17e4f3
parent: 560a16afc20710cfd91a714b08402c9a64e07a12
author: Huade Shi (huashi) <huashi@cisco.com>
date: Fri Mar 10 05:50:52 EST 2017
UT RC check logic keep the same with encoder side
--- a/test/encoder/EncUT_EncoderExt.cpp
+++ b/test/encoder/EncUT_EncoderExt.cpp
@@ -220,7 +220,7 @@
sInfo.iLayer = SPATIAL_LAYER_0;
iResult = pPtrEnc->SetOption (eOptionId, &sInfo);
pPtrEnc->GetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, pParamExt);
- if (sInfo.iBitrate <= 0 || pParamExt->sSpatialLayers[sInfo.iLayer].iSpatialBitrate <= (int) (fFrameRate + 0.5f))
+ if (sInfo.iBitrate <= 0 || (static_cast<float> (pParamExt->sSpatialLayers[sInfo.iLayer].iSpatialBitrate) <= fFrameRate))
EXPECT_EQ (iResult, static_cast<int> (cmInitParaError));
else if (pParamExt->sSpatialLayers[sInfo.iLayer].iSpatialBitrate >
pParamExt->sSpatialLayers[sInfo.iLayer].iMaxSpatialBitrate) {
@@ -242,7 +242,7 @@
sInfo.iLayer = SPATIAL_LAYER_0;
iResult = pPtrEnc->SetOption (eOptionId, &sInfo);
pPtrEnc->GetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, pParamExt);
- if (sInfo.iBitrate <= 0 || pParamExt->sSpatialLayers[sInfo.iLayer].iSpatialBitrate <= (int) (fFrameRate + 0.5f))
+ if (sInfo.iBitrate <= 0 || (static_cast<float> (pParamExt->sSpatialLayers[sInfo.iLayer].iSpatialBitrate) <= fFrameRate))
EXPECT_EQ (iResult, static_cast<int> (cmInitParaError));
else if (pParamExt->sSpatialLayers[sInfo.iLayer].iSpatialBitrate >
pParamExt->sSpatialLayers[sInfo.iLayer].iMaxSpatialBitrate) {