summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSreerenj Balachandran <sreerenj.balachandran@intel.com>2017-12-01 15:02:24 -0800
committerXiang, Haihao <haihao.xiang@intel.com>2018-01-10 14:34:35 +0800
commit4f919058f13e2c09e90d194b1b0588e85e71b7bd (patch)
tree8ccc5ec4368ad464cbdd84e863be15bdef667717 /test
parentffa22b4b4ac286043486ea21ff7c78c40aabc282 (diff)
downloadlibva-intel-driver-4f919058f13e2c09e90d194b1b0588e85e71b7bd.tar.gz
Stats/PreEnc: tests: Add VAEntryPointStats
Add the Stats entrypoint in test case scenarios. intel-vaapi-driver PR: https://github.com/01org/intel-vaapi-driver/pull/282 libva PR: https://github.com/01org/libva/pull/110 Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Diffstat (limited to 'test')
-rw-r--r--test/i965_avce_config_test.cpp48
-rw-r--r--test/i965_avce_context_test.cpp4
-rw-r--r--test/i965_avce_test_common.cpp7
3 files changed, 56 insertions, 3 deletions
diff --git a/test/i965_avce_config_test.cpp b/test/i965_avce_config_test.cpp
index f76d2422..235d769b 100644
--- a/test/i965_avce_config_test.cpp
+++ b/test/i965_avce_config_test.cpp
@@ -49,7 +49,8 @@ VAStatus H264NotSupported()
if (!HAS_H264_DECODING(i965)
&& !HAS_LP_H264_ENCODING(i965)
- && !HAS_FEI_H264_ENCODING(i965))
+ && !HAS_FEI_H264_ENCODING(i965)
+ && !HAS_H264_PREENC(i965))
return ProfileNotSupported();
return EntrypointNotSupported();
@@ -65,7 +66,8 @@ VAStatus H264LPNotSupported()
if (!HAS_H264_DECODING(i965)
&& !HAS_H264_ENCODING(i965)
- && !HAS_FEI_H264_ENCODING(i965))
+ && !HAS_FEI_H264_ENCODING(i965)
+ && !HAS_H264_PREENC(i965))
return ProfileNotSupported();
return EntrypointNotSupported();
@@ -81,12 +83,30 @@ VAStatus H264FEINotSupported()
if (!HAS_H264_DECODING(i965)
&& !HAS_H264_ENCODING(i965)
- && !HAS_LP_H264_ENCODING(i965))
+ && !HAS_LP_H264_ENCODING(i965)
+ && !HAS_H264_PREENC(i965))
return ProfileNotSupported();
return EntrypointNotSupported();
}
+VAStatus H264PreEncodeNotSupported()
+{
+ I965TestEnvironment *env(I965TestEnvironment::instance());
+ EXPECT_PTR(env);
+
+ struct i965_driver_data *i965(*env);
+ EXPECT_PTR(i965);
+
+ if (!HAS_H264_DECODING(i965)
+ && !HAS_H264_ENCODING(i965)
+ && !HAS_LP_H264_ENCODING(i965)
+ && !HAS_FEI_H264_ENCODING(i965))
+ return ProfileNotSupported();
+
+ return EntrypointNotSupported();
+}
+
VAStatus H264MVCNotSupported()
{
I965TestEnvironment *env(I965TestEnvironment::instance());
@@ -164,6 +184,23 @@ VAStatus HasFEIEncodeSupport()
return H264FEINotSupported();
}
+VAStatus HasPreEncodeSupport()
+{
+ I965TestEnvironment *env(I965TestEnvironment::instance());
+ EXPECT_PTR(env);
+
+ struct i965_driver_data *i965(*env);
+ EXPECT_PTR(i965);
+
+ if (IS_SKL(i965->intel.device_info))
+ return VA_STATUS_SUCCESS;
+
+ if (HAS_H264_PREENC(i965))
+ return VA_STATUS_SUCCESS;
+
+ return H264PreEncodeNotSupported();
+}
+
VAStatus HasMVCEncodeSupport()
{
I965TestEnvironment *env(I965TestEnvironment::instance());
@@ -197,26 +234,31 @@ static const std::vector<ConfigTestInput> inputs = {
{VAProfileH264ConstrainedBaseline, VAEntrypointEncSliceLP, &HasLPEncodeSupport},
{VAProfileH264ConstrainedBaseline, VAEntrypointEncPicture, &H264NotSupported},
{VAProfileH264ConstrainedBaseline, VAEntrypointFEI, &HasFEIEncodeSupport},
+ {VAProfileH264ConstrainedBaseline, VAEntrypointStats, &HasPreEncodeSupport},
{VAProfileH264Main, VAEntrypointEncSlice, &HasEncodeSupport},
{VAProfileH264Main, VAEntrypointEncSliceLP, &HasLPEncodeSupport},
{VAProfileH264Main, VAEntrypointEncPicture, &H264NotSupported},
{VAProfileH264Main, VAEntrypointFEI, &HasFEIEncodeSupport},
+ {VAProfileH264Main, VAEntrypointStats, &HasPreEncodeSupport},
{VAProfileH264High, VAEntrypointEncSlice, &HasEncodeSupport},
{VAProfileH264High, VAEntrypointEncSliceLP, &HasLPEncodeSupport},
{VAProfileH264High, VAEntrypointEncPicture, &H264NotSupported},
{VAProfileH264High, VAEntrypointFEI, &HasFEIEncodeSupport},
+ {VAProfileH264High, VAEntrypointStats, &HasPreEncodeSupport},
{VAProfileH264MultiviewHigh, VAEntrypointEncSlice, &HasMVCEncodeSupport},
{VAProfileH264MultiviewHigh, VAEntrypointEncSliceLP, &H264MVCNotSupported},
{VAProfileH264MultiviewHigh, VAEntrypointEncPicture, &H264MVCNotSupported},
{VAProfileH264MultiviewHigh, VAEntrypointFEI, &H264MVCNotSupported},
+ {VAProfileH264MultiviewHigh, VAEntrypointStats, &H264MVCNotSupported},
{VAProfileH264StereoHigh, VAEntrypointEncSlice, &HasStereoEncodeSupport},
{VAProfileH264StereoHigh, VAEntrypointEncSliceLP, &H264StereoNotSupported},
{VAProfileH264StereoHigh, VAEntrypointEncPicture, &H264StereoNotSupported},
{VAProfileH264StereoHigh, VAEntrypointFEI, &H264StereoNotSupported},
+ {VAProfileH264StereoHigh, VAEntrypointStats, &H264MVCNotSupported},
};
INSTANTIATE_TEST_CASE_P(
diff --git a/test/i965_avce_context_test.cpp b/test/i965_avce_context_test.cpp
index 6ad2793a..7be25673 100644
--- a/test/i965_avce_context_test.cpp
+++ b/test/i965_avce_context_test.cpp
@@ -99,6 +99,7 @@ TEST_P(AVCEContextTest, RateControl)
{VAEntrypointEncSlice, i965->codec_info->h264_brc_mode},
{VAEntrypointEncSliceLP, i965->codec_info->lp_h264_brc_mode},
{VAEntrypointFEI, VA_RC_CQP},
+ {VAEntrypointStats, VA_RC_NONE},
};
for (auto rc : rateControls) {
@@ -281,12 +282,15 @@ INSTANTIATE_TEST_CASE_P(
std::make_tuple(VAProfileH264ConstrainedBaseline, VAEntrypointEncSlice),
std::make_tuple(VAProfileH264ConstrainedBaseline, VAEntrypointEncSliceLP),
std::make_tuple(VAProfileH264ConstrainedBaseline, VAEntrypointFEI),
+ std::make_tuple(VAProfileH264ConstrainedBaseline, VAEntrypointStats),
std::make_tuple(VAProfileH264Main, VAEntrypointEncSlice),
std::make_tuple(VAProfileH264Main, VAEntrypointEncSliceLP),
std::make_tuple(VAProfileH264Main, VAEntrypointFEI),
+ std::make_tuple(VAProfileH264Main, VAEntrypointStats),
std::make_tuple(VAProfileH264High, VAEntrypointEncSlice),
std::make_tuple(VAProfileH264High, VAEntrypointEncSliceLP),
std::make_tuple(VAProfileH264High, VAEntrypointFEI),
+ std::make_tuple(VAProfileH264High, VAEntrypointStats),
std::make_tuple(VAProfileH264MultiviewHigh, VAEntrypointEncSlice),
std::make_tuple(VAProfileH264StereoHigh, VAEntrypointEncSlice)
)
diff --git a/test/i965_avce_test_common.cpp b/test/i965_avce_test_common.cpp
index c35adba3..3d1eec8e 100644
--- a/test/i965_avce_test_common.cpp
+++ b/test/i965_avce_test_common.cpp
@@ -63,6 +63,13 @@ VAStatus CheckSupported(VAProfile profile, VAEntrypoint entrypoint)
if (HAS_FEI_H264_ENCODING(i965)) {
return VA_STATUS_SUCCESS;
}
+ } else if (entrypoint == VAEntrypointStats) {
+ if (IS_SKL(i965->intel.device_info)) {
+ return VA_STATUS_SUCCESS;
+ }
+ if (HAS_H264_PREENC(i965)) {
+ return VA_STATUS_SUCCESS;
+ }
}
break;