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

Unified Diff: webrtc/common_video/include/i420_buffer_pool.h

Issue 1645543003: H264: Improve FFmpeg decoder performance by using I420BufferPool. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added comments about why we zero-initialize Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/common_video/include/i420_buffer_pool.h
diff --git a/webrtc/common_video/include/i420_buffer_pool.h b/webrtc/common_video/include/i420_buffer_pool.h
index 5ab1510689b265b086be62df19bea4d71c925004..5ea7abdf67903701960b13526cc8de6bb9617673 100644
--- a/webrtc/common_video/include/i420_buffer_pool.h
+++ b/webrtc/common_video/include/i420_buffer_pool.h
@@ -25,7 +25,9 @@ namespace webrtc {
// changes, old buffers will be purged from the pool.
class I420BufferPool {
public:
- I420BufferPool();
+ I420BufferPool() : I420BufferPool(false) {}
+ explicit I420BufferPool(bool zero_initialize);
+
// Returns a buffer from the pool, or creates a new buffer if no suitable
// buffer exists in the pool.
rtc::scoped_refptr<VideoFrameBuffer> CreateBuffer(int width, int height);
@@ -36,6 +38,10 @@ class I420BufferPool {
private:
rtc::ThreadChecker thread_checker_;
std::list<rtc::scoped_refptr<I420Buffer>> buffers_;
+ // If true, newly allocated buffers are zero-initialized. Note that recycled
+ // buffers are not zero'd before reuse. (This is required of buffers used by
stefan-webrtc 2016/02/01 14:02:08 Maybe mention why rezeroing isn't needed?
hbos 2016/02/02 16:13:03 Done.
+ // FFmpeg according to http://crbug.com/390941).
+ bool zero_initialize_;
};
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698