diff --git a/test/BaseEncoderTest.cpp b/test/BaseEncoderTest.cpp index 0b378d41..6cc30f6b 100644 --- a/test/BaseEncoderTest.cpp +++ b/test/BaseEncoderTest.cpp @@ -6,8 +6,8 @@ #include "BaseEncoderTest.h" static int InitWithParam(ISVCEncoder* encoder, int width, - int height, float frameRate, bool slices) { - if (!slices) { + int height, float frameRate, SliceModeEnum sliceMode) { + if (SM_SINGLE_SLICE == sliceMode) { SEncParamBase param; memset (¶m, 0, sizeof(SEncParamBase)); @@ -33,7 +33,7 @@ static int InitWithParam(ISVCEncoder* encoder, int width, param.sSpatialLayers[0].fFrameRate = frameRate; param.sSpatialLayers[0].iSpatialBitrate = param.iTargetBitrate; - param.sSpatialLayers[0].sSliceCfg.uiSliceMode = SM_ROWMB_SLICE; + param.sSpatialLayers[0].sSliceCfg.uiSliceMode = sliceMode; return encoder->InitializeExt(¶m); } @@ -55,7 +55,7 @@ void BaseEncoderTest::TearDown() { } void BaseEncoderTest::EncodeStream(InputStream* in, int width, int height, - float frameRate, bool slices, Callback* cbk) { + float frameRate, SliceModeEnum slices, Callback* cbk) { int rv = InitWithParam(encoder_, width, height, frameRate, slices); ASSERT_TRUE(rv == cmResultSuccess); @@ -89,7 +89,7 @@ void BaseEncoderTest::EncodeStream(InputStream* in, int width, int height, } void BaseEncoderTest::EncodeFile(const char* fileName, int width, int height, - float frameRate, bool slices, Callback* cbk) { + float frameRate, SliceModeEnum slices, Callback* cbk) { FileInputStream fileStream; ASSERT_TRUE(fileStream.Open(fileName)); EncodeStream(&fileStream, width, height, frameRate, slices, cbk); diff --git a/test/BaseEncoderTest.h b/test/BaseEncoderTest.h index eaf740d2..02c187f2 100644 --- a/test/BaseEncoderTest.h +++ b/test/BaseEncoderTest.h @@ -14,8 +14,8 @@ class BaseEncoderTest { BaseEncoderTest(); void SetUp(); void TearDown(); - void EncodeFile(const char* fileName, int width, int height, float frameRate, bool slices, Callback* cbk); - void EncodeStream(InputStream* in, int width, int height, float frameRate, bool slices, Callback* cbk); + void EncodeFile(const char* fileName, int width, int height, float frameRate, SliceModeEnum slices, Callback* cbk); + void EncodeStream(InputStream* in, int width, int height, float frameRate, SliceModeEnum slices, Callback* cbk); private: ISVCEncoder* encoder_; diff --git a/test/decode_encode_test.cpp b/test/decode_encode_test.cpp index 01e4d90d..296506f5 100644 --- a/test/decode_encode_test.cpp +++ b/test/decode_encode_test.cpp @@ -95,7 +95,7 @@ TEST_P(DecodeEncodeTest, CompareOutput) { DecodeEncodeFileParam p = GetParam(); ASSERT_TRUE(Open(p.fileName)); - EncodeStream(this, p.width, p.height, p.frameRate, false, this); + EncodeStream(this, p.width, p.height, p.frameRate, SM_SINGLE_SLICE, this); unsigned char digest[SHA_DIGEST_LENGTH]; SHA1Result(&ctx_, digest); if (!HasFatalFailure()) { diff --git a/test/encoder_test.cpp b/test/encoder_test.cpp index ffa0352d..df777d70 100644 --- a/test/encoder_test.cpp +++ b/test/encoder_test.cpp @@ -31,7 +31,7 @@ struct EncodeFileParam { int width; int height; float frameRate; - bool slices; + SliceModeEnum slices; }; class EncoderOutputTest : public ::testing::WithParamInterface, @@ -66,19 +66,19 @@ TEST_P(EncoderOutputTest, CompareOutput) { static const EncodeFileParam kFileParamArray[] = { { "res/CiscoVT2people_320x192_12fps.yuv", - "06441376891cbc237a36e59b62131cd94ff9cb19", 320, 192, 12.0f, false + "06441376891cbc237a36e59b62131cd94ff9cb19", 320, 192, 12.0f, SM_SINGLE_SLICE }, { "res/CiscoVT2people_160x96_6fps.yuv", - "4f3759fc44125b27a179ebff158dbba9e431bd0b", 160, 96, 6.0f, false + "4f3759fc44125b27a179ebff158dbba9e431bd0b", 160, 96, 6.0f, SM_SINGLE_SLICE }, { "res/Static_152_100.yuv", - "af5c6a41b567ce1b2cb6fd427f4379473d3b829f", 152, 100, 6.0f, false + "af5c6a41b567ce1b2cb6fd427f4379473d3b829f", 152, 100, 6.0f, SM_SINGLE_SLICE }, { "res/CiscoVT2people_320x192_12fps.yuv", - "be0079b022b18fdce04570db24e4327ca26a0ecb", 320, 192, 12.0f, true + "be0079b022b18fdce04570db24e4327ca26a0ecb", 320, 192, 12.0f, SM_ROWMB_SLICE // One slice per MB row }, };