Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: source/libvpx/test/user_priv_test.cc

Issue 554673004: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « source/libvpx/test/tile_independence_test.cc ('k') | source/libvpx/test/variance_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 29 matching lines...) Expand all
40 40
41 // Decodes |filename|. Passes in user_priv data when calling DecodeFrame and 41 // Decodes |filename|. Passes in user_priv data when calling DecodeFrame and
42 // compares the user_priv from return img with the original user_priv to see if 42 // compares the user_priv from return img with the original user_priv to see if
43 // they match. Both the pointer values and the values inside the addresses 43 // they match. Both the pointer values and the values inside the addresses
44 // should match. 44 // should match.
45 string DecodeFile(const string &filename) { 45 string DecodeFile(const string &filename) {
46 ACMRandom rnd(ACMRandom::DeterministicSeed()); 46 ACMRandom rnd(ACMRandom::DeterministicSeed());
47 libvpx_test::WebMVideoSource video(filename); 47 libvpx_test::WebMVideoSource video(filename);
48 video.Init(); 48 video.Init();
49 49
50 vpx_codec_dec_cfg_t cfg = {0}; 50 vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t();
51 libvpx_test::VP9Decoder decoder(cfg, 0); 51 libvpx_test::VP9Decoder decoder(cfg, 0);
52 52
53 libvpx_test::MD5 md5; 53 libvpx_test::MD5 md5;
54 int frame_num = 0; 54 int frame_num = 0;
55 for (video.Begin(); !::testing::Test::HasFailure() && video.cxdata(); 55 for (video.Begin(); !::testing::Test::HasFailure() && video.cxdata();
56 video.Next()) { 56 video.Next()) {
57 void *user_priv = reinterpret_cast<void *>(&frame_num); 57 void *user_priv = reinterpret_cast<void *>(&frame_num);
58 const vpx_codec_err_t res = 58 const vpx_codec_err_t res =
59 decoder.DecodeFrame(video.cxdata(), video.frame_size(), 59 decoder.DecodeFrame(video.cxdata(), video.frame_size(),
60 (frame_num == 0) ? NULL : user_priv); 60 (frame_num == 0) ? NULL : user_priv);
(...skipping 30 matching lines...) Expand all
91 TEST(UserPrivTest, VideoDecode) { 91 TEST(UserPrivTest, VideoDecode) {
92 // no tiles or frame parallel; this exercises the decoding to test the 92 // no tiles or frame parallel; this exercises the decoding to test the
93 // user_priv. 93 // user_priv.
94 EXPECT_STREQ("b35a1b707b28e82be025d960aba039bc", 94 EXPECT_STREQ("b35a1b707b28e82be025d960aba039bc",
95 DecodeFile("vp90-2-03-size-226x226.webm").c_str()); 95 DecodeFile("vp90-2-03-size-226x226.webm").c_str());
96 } 96 }
97 97
98 #endif // CONFIG_WEBM_IO 98 #endif // CONFIG_WEBM_IO
99 99
100 } // namespace 100 } // namespace
OLDNEW
« no previous file with comments | « source/libvpx/test/tile_independence_test.cc ('k') | source/libvpx/test/variance_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698