History

Add framerate & spatialbitrate comparison for encoder UT

Haibo Zhu committed 11 years ago

Commit 61b82d21 parent 55a52721 file · +6 −6Browse files

Showing the changes to test/encoder/EncUT_EncoderExt.cpp (1 of 1 file). Show all

Unified · Split

test/encoder/EncUT_EncoderExt.cpp+6−6
@@ -150,7 +150,7 @@ void EncoderInterfaceTest::InitializeParamExt() { · 149 unmodified lines
150150
151151 TEST_F (EncoderInterfaceTest, EncoderOptionSetTest) {
152152 int iResult, iValue, iReturn;
153− float fValue, fReturn;
153+ float fFrameRate, fReturn;
154154 int uiTraceLevel = WELS_LOG_QUIET;
155155
156156 pPtrEnc->SetOption (ENCODER_OPTION_TRACE_LEVEL, &uiTraceLevel);
@@ -195,17 +195,17 @@ TEST_F (EncoderInterfaceTest, EncoderOptionSetTest) { · 38 unmodified lines
195195 pSrcPic->uiTimeStamp += 30;
196196
197197 eOptionId = ENCODER_OPTION_FRAME_RATE;
198− fValue = static_cast<float> (rand() % 100 - 5);
199− iResult = pPtrEnc->SetOption (eOptionId, &fValue);
198+ fFrameRate = static_cast<float> (rand() % 100 - 5);
199+ iResult = pPtrEnc->SetOption (eOptionId, &fFrameRate);
200200
201− if (fValue <= 0)
201+ if (fFrameRate <= 0)
202202 EXPECT_EQ (iResult, static_cast<int> (cmInitParaError));
203203 else {
204204 EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
205205
206206 iResult = pPtrEnc->GetOption (eOptionId, &fReturn);
207207 EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
208− EXPECT_EQ (WELS_CLIP3 (fValue, 1, 60), fReturn);
208+ EXPECT_EQ (WELS_CLIP3 (fFrameRate, 1, 60), fReturn);
209209 }
210210 PrepareOneSrcFrame();
211211 iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi);
@@ -240,7 +240,7 @@ TEST_F (EncoderInterfaceTest, EncoderOptionSetTest) { · 28 unmodified lines
240240 sInfo.iLayer = SPATIAL_LAYER_0;
241241 iResult = pPtrEnc->SetOption (eOptionId, &sInfo);
242242 pPtrEnc->GetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, pParamExt);
243− if (sInfo.iBitrate <= 0)
243+ if (sInfo.iBitrate <= 0 || pParamExt->sSpatialLayers[sInfo.iLayer].iSpatialBitrate <= (int) (fFrameRate + 0.5f))
244244 EXPECT_EQ (iResult, static_cast<int> (cmInitParaError));
245245 else if (pParamExt->sSpatialLayers[sInfo.iLayer].iSpatialBitrate >
246246 pParamExt->sSpatialLayers[sInfo.iLayer].iMaxSpatialBitrate) {

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