[Encoder] adjust default profile and level setting
Showing the changes to test/api/encode_options_test.cpp (1 of 10 files). Show all
Unified · Split
| @@ -1956,8 +1956,8 @@ TEST_F (EncodeDecodeTestAPI, ProfileLevelSetting) { · 1955 unmodified lines | |||
| 1956 | sParam.iEntropyCodingModeFlag = rand() % 2; | 1956 | sParam.iEntropyCodingModeFlag = rand() % 2; |
| 1957 | sParam.sSpatialLayers[0].iSpatialBitrate = sParam.iTargetBitrate = 3000; | 1957 | sParam.sSpatialLayers[0].iSpatialBitrate = sParam.iTargetBitrate = 3000; |
| 1958 | 1958 | ||
| 1959 | //int TraceLevel = WELS_LOG_DEBUG; | 1959 | int TraceLevel = WELS_LOG_DEBUG; |
| 1960 | //encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &TraceLevel); | 1960 | encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &TraceLevel); |
| 1961 | //decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &TraceLevel); | 1961 | //decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &TraceLevel); |
| 1962 | iEncProfileIdc = profileList[rand() % 11]; | 1962 | iEncProfileIdc = profileList[rand() % 11]; |
| 1963 | iEncLevelIdc = levelList[rand() % 18]; | 1963 | iEncLevelIdc = levelList[rand() % 18]; |
| @@ -1971,11 +1971,15 @@ TEST_F (EncodeDecodeTestAPI, ProfileLevelSetting) { · 7 unmodified lines | |||
| 1971 | decoder_->GetOption (DECODER_OPTION_PROFILE, &iDecProfileIdc); | 1971 | decoder_->GetOption (DECODER_OPTION_PROFILE, &iDecProfileIdc); |
| 1972 | 1972 | ||
| 1973 | if ((iEncProfileIdc != PRO_BASELINE) && (iEncProfileIdc != PRO_MAIN) && (iEncProfileIdc != PRO_HIGH)) { | 1973 | if ((iEncProfileIdc != PRO_BASELINE) && (iEncProfileIdc != PRO_MAIN) && (iEncProfileIdc != PRO_HIGH)) { |
| 1974 | iEncProfileIdc = PRO_BASELINE; | 1974 | if (sParam.iEntropyCodingModeFlag) { |
| 1975 | iEncProfileIdc = PRO_HIGH; | ||
| 1976 | } else { | ||
| 1977 | iEncProfileIdc = PRO_BASELINE; | ||
| 1978 | } | ||
| 1975 | } | 1979 | } |
| 1976 | 1980 | ||
| 1977 | ASSERT_TRUE (iDecProfileIdc == iEncProfileIdc) << "enc_profile = " << iEncProfileIdc << " dec_profile = " << | 1981 | ASSERT_TRUE (iDecProfileIdc == iEncProfileIdc) << "enc_profile = " << iEncProfileIdc << " dec_profile = " << |
| 1978 | iDecProfileIdc; | 1982 | iDecProfileIdc; |
| 1979 | 1983 | ||
| 1980 | //check whether the level is changed according to level limitation | 1984 | //check whether the level is changed according to level limitation |
| 1981 | ELevelIdc uiLevel = LEVEL_UNKNOWN; | 1985 | ELevelIdc uiLevel = LEVEL_UNKNOWN; |
| @@ -1992,7 +1996,7 @@ TEST_F (EncodeDecodeTestAPI, ProfileLevelSetting) { · 10 unmodified lines | |||
| 1992 | decoder_->GetOption (DECODER_OPTION_LEVEL, &iDecLevelIdc); | 1996 | decoder_->GetOption (DECODER_OPTION_LEVEL, &iDecLevelIdc); |
| 1993 | 1997 | ||
| 1994 | if (iEncLevelIdc == LEVEL_UNKNOWN) | 1998 | if (iEncLevelIdc == LEVEL_UNKNOWN) |
| 1995 | ASSERT_TRUE (iDecLevelIdc == LEVEL_5_2) << "enc_level = " << iEncLevelIdc << " dec_level = " << iDecLevelIdc; | 1999 | ASSERT_TRUE (iDecLevelIdc != LEVEL_UNKNOWN) << "enc_level = " << iEncLevelIdc << " dec_level = " << iDecLevelIdc; |
| 1996 | else | 2000 | else |
| 1997 | ASSERT_TRUE (iDecLevelIdc == iEncLevelIdc) << "enc_level = " << iEncLevelIdc << " dec_level = " << iDecLevelIdc; | 2001 | ASSERT_TRUE (iDecLevelIdc == iEncLevelIdc) << "enc_level = " << iEncLevelIdc << " dec_level = " << iDecLevelIdc; |
| 1998 | 2002 | ||
| @@ -2031,7 +2035,11 @@ TEST_F (EncodeDecodeTestAPI, ProfileLevelSetting) { · 32 unmodified lines | |||
| 2031 | decoder_->GetOption (DECODER_OPTION_PROFILE, &iDecProfileIdc); | 2035 | decoder_->GetOption (DECODER_OPTION_PROFILE, &iDecProfileIdc); |
| 2032 | 2036 | ||
| 2033 | if ((iEncProfileIdc != PRO_BASELINE) && (iEncProfileIdc != PRO_MAIN) && (iEncProfileIdc != PRO_HIGH)) { | 2037 | if ((iEncProfileIdc != PRO_BASELINE) && (iEncProfileIdc != PRO_MAIN) && (iEncProfileIdc != PRO_HIGH)) { |
| 2034 | iEncProfileIdc = PRO_BASELINE; | 2038 | if (sParam.iEntropyCodingModeFlag) { |
| 2039 | iEncProfileIdc = PRO_HIGH; | ||
| 2040 | } else { | ||
| 2041 | iEncProfileIdc = PRO_BASELINE; | ||
| 2042 | } | ||
| 2035 | } | 2043 | } |
| 2036 | 2044 | ||
| 2037 | ASSERT_TRUE (iDecProfileIdc == iEncProfileIdc) << "enc_profile = " << iEncProfileIdc << " dec_profile = " << | 2045 | ASSERT_TRUE (iDecProfileIdc == iEncProfileIdc) << "enc_profile = " << iEncProfileIdc << " dec_profile = " << |
| @@ -2051,7 +2059,7 @@ TEST_F (EncodeDecodeTestAPI, ProfileLevelSetting) { · 13 unmodified lines | |||
| 2051 | decoder_->GetOption (DECODER_OPTION_LEVEL, &iDecLevelIdc); | 2059 | decoder_->GetOption (DECODER_OPTION_LEVEL, &iDecLevelIdc); |
| 2052 | 2060 | ||
| 2053 | if (iEncLevelIdc == LEVEL_UNKNOWN) | 2061 | if (iEncLevelIdc == LEVEL_UNKNOWN) |
| 2054 | ASSERT_TRUE (iDecLevelIdc == LEVEL_5_2) << "enc_level = " << iEncLevelIdc << " dec_level = " << iDecLevelIdc; | 2062 | ASSERT_TRUE (iDecLevelIdc != LEVEL_5_2) << "enc_level = " << iEncLevelIdc << " dec_level = " << iDecLevelIdc; |
| 2055 | else | 2063 | else |
| 2056 | ASSERT_TRUE (iDecLevelIdc == iEncLevelIdc) << "enc_level = " << iEncLevelIdc << " dec_level = " << iDecLevelIdc; | 2064 | ASSERT_TRUE (iDecLevelIdc == iEncLevelIdc) << "enc_level = " << iEncLevelIdc << " dec_level = " << iDecLevelIdc; |
| 2057 | 2065 | ||