History

add usagetype parameter in encoder unit test to test screen content

ruil2 committed 12 years ago

Commit a15e6401 parent 9b032235 files · +37 −17Browse files

Showing the changes to test/api/encoder_test.cpp (1 of 5 files). Show all

Unified · Split

test/api/encoder_test.cpp+24−7
@@ -28,6 +28,7 @@ TEST_F(EncoderInitTest, JustInit) {} · 27 unmodified lines
28struct EncodeFileParam {28struct EncodeFileParam {
29 const char* fileName;29 const char* fileName;
30 const char* hashStr;30 const char* hashStr;
31 EUsageType usageType;
31 int width;32 int width;
32 int height;33 int height;
33 float frameRate;34 float frameRate;
@@ -56,8 +57,12 @@ class EncoderOutputTest : public ::testing::WithParamInterface<EncodeFileParam>, · 22 unmodified lines
56 57
57TEST_P(EncoderOutputTest, CompareOutput) {58TEST_P(EncoderOutputTest, CompareOutput) {
58 EncodeFileParam p = GetParam();59 EncodeFileParam p = GetParam();
59 EncodeFile(p.fileName, p.width, p.height, p.frameRate, p.slices, p.denoise, p.layers, this);60 EncodeFile(p.fileName, p.usageType ,p.width, p.height, p.frameRate, p.slices, p.denoise, p.layers, this);
60 61
62 //will remove this after screen content algorithms are ready,
63 //because the bitstream output will vary when the different algorithms are added.
64 if(p.usageType == SCREEN_CONTENT_REAL_TIME)
65 return;
61 unsigned char digest[SHA_DIGEST_LENGTH];66 unsigned char digest[SHA_DIGEST_LENGTH];
62 SHA1Result(&ctx_, digest);67 SHA1Result(&ctx_, digest);
63 if (!HasFatalFailure()) {68 if (!HasFatalFailure()) {
@@ -68,28 +73,40 @@ TEST_P(EncoderOutputTest, CompareOutput) { · 4 unmodified lines
68static const EncodeFileParam kFileParamArray[] = {73static const EncodeFileParam kFileParamArray[] = {
69 {74 {
70 "res/CiscoVT2people_320x192_12fps.yuv",75 "res/CiscoVT2people_320x192_12fps.yuv",
71 "8d4c87f48e8a679c1ccbf5fe1ee040fed4776b30", 320, 192, 12.0f, SM_SINGLE_SLICE, false, 176 "8d4c87f48e8a679c1ccbf5fe1ee040fed4776b30", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, false, 1
72 },77 },
73 {78 {
74 "res/CiscoVT2people_160x96_6fps.yuv",79 "res/CiscoVT2people_160x96_6fps.yuv",
75 "75334dc69d95b8ac2e0a52977bba0179df4f151f", 160, 96, 6.0f, SM_SINGLE_SLICE, false, 180 "75334dc69d95b8ac2e0a52977bba0179df4f151f", CAMERA_VIDEO_REAL_TIME, 160, 96, 6.0f, SM_SINGLE_SLICE, false, 1
76 },81 },
77 {82 {
78 "res/Static_152_100.yuv",83 "res/Static_152_100.yuv",
79 "3467201e18a934e7f8c50f3c8f3e05f4334ad12c", 152, 100, 6.0f, SM_SINGLE_SLICE, false, 184 "3467201e18a934e7f8c50f3c8f3e05f4334ad12c", CAMERA_VIDEO_REAL_TIME, 152, 100, 6.0f, SM_SINGLE_SLICE, false, 1
80 },85 },
81 {86 {
82 "res/CiscoVT2people_320x192_12fps.yuv",87 "res/CiscoVT2people_320x192_12fps.yuv",
83 "a57c7cc8a00ffe8d8ca5527a13af1683a41b5150", 320, 192, 12.0f, SM_ROWMB_SLICE, false, 1 // One slice per MB row88 "a57c7cc8a00ffe8d8ca5527a13af1683a41b5150", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_ROWMB_SLICE, false, 1 // One slice per MB row
84 },89 },
85 {90 {
86 "res/CiscoVT2people_320x192_12fps.yuv",91 "res/CiscoVT2people_320x192_12fps.yuv",
87 "bc9b203c1b031299df7981201c2af393994d876f", 320, 192, 12.0f, SM_SINGLE_SLICE, true, 192 "bc9b203c1b031299df7981201c2af393994d876f", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, true, 1
88 },93 },
89 {94 {
90 "res/CiscoVT2people_320x192_12fps.yuv",95 "res/CiscoVT2people_320x192_12fps.yuv",
91 "ba81a0f1a14214e6d3c7f1608991b3ac97789370", 320, 192, 12.0f, SM_SINGLE_SLICE, false, 296 "ba81a0f1a14214e6d3c7f1608991b3ac97789370", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, false, 2
92 },97 },
98 {
99 "res/CiscoVT2people_320x192_12fps.yuv",
100 "", SCREEN_CONTENT_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, false, 1
101 },
102 {
103 "res/CiscoVT2people_160x96_6fps.yuv",
104 "", SCREEN_CONTENT_REAL_TIME, 160, 96, 6.0f, SM_SINGLE_SLICE, false, 1
105 },
106 {
107 "res/Static_152_100.yuv",
108 "", SCREEN_CONTENT_REAL_TIME, 152, 100, 6.0f, SM_SINGLE_SLICE, false, 1
109 }
93};110};
94 111
95INSTANTIATE_TEST_CASE_P(EncodeFile, EncoderOutputTest,112INSTANTIATE_TEST_CASE_P(EncodeFile, EncoderOutputTest,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t