shithub: openh264

Download patch

ref: d2e5769dced4f85e45b9a21257da2943435129ea
parent: 202a4fb0b26cb3ec361832659de31faa20969389
parent: a01c926b158ed2d1903888c6a6ebb2ae06b09394
author: ruil2 <[email protected]>
date: Mon Jan 8 04:04:08 EST 2018

Merge pull request #2887 from sijchen/master

[UT] test case for “LosslessLink = 0 && EnableLongTermReference=1 & sc…

--- a/test/api/encode_options_test.cpp
+++ b/test/api/encode_options_test.cpp
@@ -2163,3 +2163,34 @@
   ASSERT_TRUE (iRet == cmResultSuccess) << "rv = " << iRet;
 
 }
+
+TEST_F (EncodeDecodeTestAPI,  ScreenContent_LosslessLink0_EnableLongTermReference) {
+  int iWidth       = 2882;
+  int iHeight      = 1808;
+  float fFrameRate = rand() % 30 + 0.5f;
+  int iSliceNum    = 1;
+  int iRet;
+
+  SEncParamExt sParam;
+  encoder_->GetDefaultParams (&sParam);
+  prepareParamDefault (1, iSliceNum, iWidth, iHeight, fFrameRate, &sParam);
+  sParam.iUsageType = SCREEN_CONTENT_REAL_TIME;
+  sParam.bEnableLongTermReference = 1;
+  sParam.bIsLosslessLink = 0;
+  //int TraceLevel = WELS_LOG_INFO;
+  //encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &TraceLevel);
+  iRet = encoder_->InitializeExt (&sParam);
+  ASSERT_TRUE (iRet == cmResultSuccess) << "InitializeExt: iRet = " << iRet << " at " << sParam.iPicWidth << "x" <<
+                                        sParam.iPicHeight;
+
+
+  ASSERT_TRUE (InitialEncDec (iWidth, iHeight));
+
+  iRet = encoder_->EncodeFrame (&EncPic, &info);
+
+  ASSERT_TRUE (iRet == cmResultSuccess) << "rv = " << iRet;
+
+  iRet = encoder_->Uninitialize();
+  ASSERT_TRUE (iRet == cmResultSuccess) << "rv = " << iRet;
+
+}