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

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

Issue 592203002: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 2 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/dct32x32_test.cc ('k') | source/libvpx/test/fdct4x4_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) 2014 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // external frame buffer. Returns < 0 on an error. 64 // external frame buffer. Returns < 0 on an error.
65 int GetFreeFrameBuffer(size_t min_size, vpx_codec_frame_buffer_t *fb) { 65 int GetFreeFrameBuffer(size_t min_size, vpx_codec_frame_buffer_t *fb) {
66 EXPECT_TRUE(fb != NULL); 66 EXPECT_TRUE(fb != NULL);
67 const int idx = FindFreeBufferIndex(); 67 const int idx = FindFreeBufferIndex();
68 if (idx == num_buffers_) 68 if (idx == num_buffers_)
69 return -1; 69 return -1;
70 70
71 if (ext_fb_list_[idx].size < min_size) { 71 if (ext_fb_list_[idx].size < min_size) {
72 delete [] ext_fb_list_[idx].data; 72 delete [] ext_fb_list_[idx].data;
73 ext_fb_list_[idx].data = new uint8_t[min_size]; 73 ext_fb_list_[idx].data = new uint8_t[min_size];
74 memset(ext_fb_list_[idx].data, 0, min_size);
74 ext_fb_list_[idx].size = min_size; 75 ext_fb_list_[idx].size = min_size;
75 } 76 }
76 77
77 SetFrameBuffer(idx, fb); 78 SetFrameBuffer(idx, fb);
78 return 0; 79 return 0;
79 } 80 }
80 81
81 // Test function that will not allocate any data for the frame buffer. 82 // Test function that will not allocate any data for the frame buffer.
82 // Returns < 0 on an error. 83 // Returns < 0 on an error.
83 int GetZeroFrameBuffer(size_t min_size, vpx_codec_frame_buffer_t *fb) { 84 int GetZeroFrameBuffer(size_t min_size, vpx_codec_frame_buffer_t *fb) {
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 SetFrameBufferFunctions( 473 SetFrameBufferFunctions(
473 num_buffers, get_vp9_frame_buffer, release_vp9_frame_buffer)); 474 num_buffers, get_vp9_frame_buffer, release_vp9_frame_buffer));
474 } 475 }
475 #endif // CONFIG_WEBM_IO 476 #endif // CONFIG_WEBM_IO
476 477
477 VP9_INSTANTIATE_TEST_CASE(ExternalFrameBufferMD5Test, 478 VP9_INSTANTIATE_TEST_CASE(ExternalFrameBufferMD5Test,
478 ::testing::ValuesIn(libvpx_test::kVP9TestVectors, 479 ::testing::ValuesIn(libvpx_test::kVP9TestVectors,
479 libvpx_test::kVP9TestVectors + 480 libvpx_test::kVP9TestVectors +
480 libvpx_test::kNumVP9TestVectors)); 481 libvpx_test::kNumVP9TestVectors));
481 } // namespace 482 } // namespace
OLDNEW
« no previous file with comments | « source/libvpx/test/dct32x32_test.cc ('k') | source/libvpx/test/fdct4x4_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698