History

astyle all

huili2 committed 12 years ago

Commit dc3fae41 parent 101265385 files · +4906 −4701Browse files

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

Unified · Split

test/api/encoder_test.cpp+34−34
@@ -2,14 +2,14 @@ · 1 unmodified line
22 #include "utils/HashFunctions.h"
33 #include "BaseEncoderTest.h"
44
5−static void UpdateHashFromFrame(const SFrameBSInfo& info, SHA1Context* ctx) {
5+static void UpdateHashFromFrame (const SFrameBSInfo& info, SHA1Context* ctx) {
66 for (int i = 0; i < info.iLayerNum; ++i) {
77 const SLayerBSInfo& layerInfo = info.sLayerInfo[i];
88 int layerSize = 0;
99 for (int j = 0; j < layerInfo.iNalCount; ++j) {
1010 layerSize += layerInfo.pNalLengthInByte[j];
1111 }
12− SHA1Input(ctx, layerInfo.pBsBuf, layerSize);
12+ SHA1Input (ctx, layerInfo.pBsBuf, layerSize);
1313 }
1414 }
1515
@@ -23,7 +23,7 @@ class EncoderInitTest : public ::testing::Test, public BaseEncoderTest { · 7 unmodified lines
2323 }
2424 };
2525
26−TEST_F(EncoderInitTest, JustInit) {}
26+TEST_F (EncoderInitTest, JustInit) {}
2727
2828 struct EncodeFileParam {
2929 const char* fileName;
@@ -38,80 +38,80 @@ struct EncodeFileParam { · 8 unmodified lines
3838 };
3939
4040 class EncoderOutputTest : public ::testing::WithParamInterface<EncodeFileParam>,
41− public EncoderInitTest , public BaseEncoderTest::Callback {
41+ public EncoderInitTest , public BaseEncoderTest::Callback {
4242 public:
4343 virtual void SetUp() {
4444 EncoderInitTest::SetUp();
4545 if (HasFatalFailure()) {
4646 return;
4747 }
48− SHA1Reset(&ctx_);
48+ SHA1Reset (&ctx_);
4949 }
50− virtual void onEncodeFrame(const SFrameBSInfo& frameInfo) {
51− UpdateHashFromFrame(frameInfo, &ctx_);
50+ virtual void onEncodeFrame (const SFrameBSInfo& frameInfo) {
51+ UpdateHashFromFrame (frameInfo, &ctx_);
5252 }
5353 protected:
5454 SHA1Context ctx_;
5555 };
5656
5757
58−TEST_P(EncoderOutputTest, CompareOutput) {
58+TEST_P (EncoderOutputTest, CompareOutput) {
5959 EncodeFileParam p = GetParam();
60− EncodeFile(p.fileName, p.usageType ,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);
6161
6262 //will remove this after screen content algorithms are ready,
6363 //because the bitstream output will vary when the different algorithms are added.
64− if(p.usageType == SCREEN_CONTENT_REAL_TIME)
64+ if (p.usageType == SCREEN_CONTENT_REAL_TIME)
6565 return;
6666 unsigned char digest[SHA_DIGEST_LENGTH];
67− SHA1Result(&ctx_, digest);
67+ SHA1Result (&ctx_, digest);
6868 if (!HasFatalFailure()) {
69− CompareHash(digest, p.hashStr);
69+ CompareHash (digest, p.hashStr);
7070 }
7171 }
7272
7373 static const EncodeFileParam kFileParamArray[] = {
7474 {
75− "res/CiscoVT2people_320x192_12fps.yuv",
76− "0a36b75e423fc6b49f6adf7eee12c039a096f538", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, false, 1
75+ "res/CiscoVT2people_320x192_12fps.yuv",
76+ "0a36b75e423fc6b49f6adf7eee12c039a096f538", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, false, 1
7777 },
7878 {
79− "res/CiscoVT2people_160x96_6fps.yuv",
80− "73981e6ea5b62f7338212c538a7cc755e7c9c030", CAMERA_VIDEO_REAL_TIME, 160, 96, 6.0f, SM_SINGLE_SLICE, false, 1
79+ "res/CiscoVT2people_160x96_6fps.yuv",
80+ "73981e6ea5b62f7338212c538a7cc755e7c9c030", CAMERA_VIDEO_REAL_TIME, 160, 96, 6.0f, SM_SINGLE_SLICE, false, 1
8181 },
8282 {
83− "res/Static_152_100.yuv",
84− "83db4c0e3006bbe039bd327b6e78c57fbb05316f", CAMERA_VIDEO_REAL_TIME, 152, 100, 6.0f, SM_SINGLE_SLICE, false, 1
83+ "res/Static_152_100.yuv",
84+ "83db4c0e3006bbe039bd327b6e78c57fbb05316f", CAMERA_VIDEO_REAL_TIME, 152, 100, 6.0f, SM_SINGLE_SLICE, false, 1
8585 },
8686 {
87− "res/CiscoVT2people_320x192_12fps.yuv",
88− "c8b759bcec7ffa048f1d3ded594b8815bed0aead", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_ROWMB_SLICE, false, 1 // One slice per MB row
87+ "res/CiscoVT2people_320x192_12fps.yuv",
88+ "c8b759bcec7ffa048f1d3ded594b8815bed0aead", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_ROWMB_SLICE, false, 1 // One slice per MB row
8989 },
9090 {
91− "res/CiscoVT2people_320x192_12fps.yuv",
92− "e64ba75456c821ca35a949eda89f85bff8ee69fa", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, true, 1
91+ "res/CiscoVT2people_320x192_12fps.yuv",
92+ "e64ba75456c821ca35a949eda89f85bff8ee69fa", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, true, 1
9393 },
9494 {
95− "res/CiscoVT2people_320x192_12fps.yuv",
96− "684e6d141ada776892bdb01ee93efe475983ed36", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, false, 2
95+ "res/CiscoVT2people_320x192_12fps.yuv",
96+ "684e6d141ada776892bdb01ee93efe475983ed36", CAMERA_VIDEO_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, false, 2
9797 },
9898 {
99− "res/Cisco_Absolute_Power_1280x720_30fps.yuv",
100− "6df1ece77c0de63cdf8ab52ccef3a7d139022717", CAMERA_VIDEO_REAL_TIME, 1280, 720, 30.0f, SM_DYN_SLICE, false, 1
99+ "res/Cisco_Absolute_Power_1280x720_30fps.yuv",
100+ "6df1ece77c0de63cdf8ab52ccef3a7d139022717", CAMERA_VIDEO_REAL_TIME, 1280, 720, 30.0f, SM_DYN_SLICE, false, 1
101101 },
102102 {
103− "res/CiscoVT2people_320x192_12fps.yuv",
104− "", SCREEN_CONTENT_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, false, 1
103+ "res/CiscoVT2people_320x192_12fps.yuv",
104+ "", SCREEN_CONTENT_REAL_TIME, 320, 192, 12.0f, SM_SINGLE_SLICE, false, 1
105105 },
106106 {
107− "res/CiscoVT2people_160x96_6fps.yuv",
108− "", SCREEN_CONTENT_REAL_TIME, 160, 96, 6.0f, SM_SINGLE_SLICE, false, 1
107+ "res/CiscoVT2people_160x96_6fps.yuv",
108+ "", SCREEN_CONTENT_REAL_TIME, 160, 96, 6.0f, SM_SINGLE_SLICE, false, 1
109109 },
110110 {
111− "res/Static_152_100.yuv",
112− "", SCREEN_CONTENT_REAL_TIME, 152, 100, 6.0f, SM_SINGLE_SLICE, false, 1
111+ "res/Static_152_100.yuv",
112+ "", SCREEN_CONTENT_REAL_TIME, 152, 100, 6.0f, SM_SINGLE_SLICE, false, 1
113113 }
114114 };
115115
116−INSTANTIATE_TEST_CASE_P(EncodeFile, EncoderOutputTest,
117− ::testing::ValuesIn(kFileParamArray));
116+INSTANTIATE_TEST_CASE_P (EncodeFile, EncoderOutputTest,
117+ ::testing::ValuesIn (kFileParamArray));

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