fix a spatial layer index error
Unified · Split
| @@ -143,7 +143,7 @@ void EncoderInterfaceTest::InitializeParamExt() { · 142 unmodified lines | |||
| 143 | pParamExt->sSpatialLayers[0].iSpatialBitrate = 50000; | 143 | pParamExt->sSpatialLayers[0].iSpatialBitrate = 50000; |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | TEST_F (EncoderInterfaceTest, EncoderAdditionalOptionSetTest) { | 146 | TEST_F (EncoderInterfaceTest, EncoderOptionSetTest) { |
| 147 | int iResult, iValue, iReturn; | 147 | int iResult, iValue, iReturn; |
| 148 | float fValue, fReturn; | 148 | float fValue, fReturn; |
| 149 | int uiTraceLevel = WELS_LOG_QUIET; | 149 | int uiTraceLevel = WELS_LOG_QUIET; |
| @@ -210,7 +210,7 @@ TEST_F (EncoderInterfaceTest, EncoderAdditionalOptionSetTest) { · 60 unmodified lines | |||
| 210 | eOptionId = ENCODER_OPTION_BITRATE; | 210 | eOptionId = ENCODER_OPTION_BITRATE; |
| 211 | SBitrateInfo sInfo, sReturn; | 211 | SBitrateInfo sInfo, sReturn; |
| 212 | sInfo.iBitrate = rand() % 100000 - 100; | 212 | sInfo.iBitrate = rand() % 100000 - 100; |
| 213 | sInfo.iLayer = static_cast<LAYER_NUM> (pParamExt->iSpatialLayerNum); | 213 | sInfo.iLayer = SPATIAL_LAYER_0; |
| 214 | iResult = pPtrEnc->SetOption (eOptionId, &sInfo); | 214 | iResult = pPtrEnc->SetOption (eOptionId, &sInfo); |
| 215 | pPtrEnc->GetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, pParamExt); | 215 | pPtrEnc->GetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, pParamExt); |
| 216 | if (sInfo.iBitrate <= 0) | 216 | if (sInfo.iBitrate <= 0) |
| @@ -220,7 +220,7 @@ TEST_F (EncoderInterfaceTest, EncoderAdditionalOptionSetTest) { · 3 unmodified lines | |||
| 220 | EXPECT_EQ (iResult, static_cast<int> (cmInitParaError)); | 220 | EXPECT_EQ (iResult, static_cast<int> (cmInitParaError)); |
| 221 | } else { | 221 | } else { |
| 222 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); | 222 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); |
| 223 | sReturn.iLayer = static_cast<LAYER_NUM> (pParamExt->iSpatialLayerNum); | 223 | sReturn.iLayer = SPATIAL_LAYER_0; |
| 224 | iResult = pPtrEnc->GetOption (eOptionId, &sReturn); | 224 | iResult = pPtrEnc->GetOption (eOptionId, &sReturn); |
| 225 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); | 225 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); |
| 226 | EXPECT_EQ (WELS_CLIP3 (sInfo.iBitrate, 1, 2147483647), sReturn.iBitrate); | 226 | EXPECT_EQ (WELS_CLIP3 (sInfo.iBitrate, 1, 2147483647), sReturn.iBitrate); |
| @@ -232,7 +232,7 @@ TEST_F (EncoderInterfaceTest, EncoderAdditionalOptionSetTest) { · 5 unmodified lines | |||
| 232 | 232 | ||
| 233 | eOptionId = ENCODER_OPTION_MAX_BITRATE; | 233 | eOptionId = ENCODER_OPTION_MAX_BITRATE; |
| 234 | sInfo.iBitrate = rand() % 100000 - 100; | 234 | sInfo.iBitrate = rand() % 100000 - 100; |
| 235 | sInfo.iLayer = static_cast<LAYER_NUM> (pParamExt->iSpatialLayerNum); | 235 | sInfo.iLayer = SPATIAL_LAYER_0; |
| 236 | iResult = pPtrEnc->SetOption (eOptionId, &sInfo); | 236 | iResult = pPtrEnc->SetOption (eOptionId, &sInfo); |
| 237 | pPtrEnc->GetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, pParamExt); | 237 | pPtrEnc->GetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, pParamExt); |
| 238 | if (sInfo.iBitrate <= 0) | 238 | if (sInfo.iBitrate <= 0) |
| @@ -242,7 +242,7 @@ TEST_F (EncoderInterfaceTest, EncoderAdditionalOptionSetTest) { · 3 unmodified lines | |||
| 242 | EXPECT_EQ (iResult, static_cast<int> (cmInitParaError)); | 242 | EXPECT_EQ (iResult, static_cast<int> (cmInitParaError)); |
| 243 | } else { | 243 | } else { |
| 244 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); | 244 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); |
| 245 | sReturn.iLayer = static_cast<LAYER_NUM> (pParamExt->iSpatialLayerNum); | 245 | sReturn.iLayer = SPATIAL_LAYER_0; |
| 246 | iResult = pPtrEnc->GetOption (eOptionId, &sReturn); | 246 | iResult = pPtrEnc->GetOption (eOptionId, &sReturn); |
| 247 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); | 247 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); |
| 248 | EXPECT_EQ (WELS_CLIP3 (sInfo.iBitrate, 1, 2147483647), sReturn.iBitrate); | 248 | EXPECT_EQ (WELS_CLIP3 (sInfo.iBitrate, 1, 2147483647), sReturn.iBitrate); |