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

Unified Diff: media/base/video_frame.cc

Issue 10765015: Reintroduce kFramePadBytes in frame allocation. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_frame.cc
===================================================================
--- media/base/video_frame.cc (revision 145702)
+++ media/base/video_frame.cc (working copy)
@@ -99,6 +99,8 @@
}
static const int kFrameSizeAlignment = 16;
+// Allows faster SIMD YUV convert. Also, FFmpeg overreads/-writes occasionally.
+static const int kFramePadBytes = 15;
void VideoFrame::AllocateRGB(size_t bytes_per_pixel) {
// Round up to align at least at a 16-byte boundary for each row.
@@ -110,7 +112,7 @@
// TODO(dalecurtis): use DataAligned or so, so this #ifdef hackery
// doesn't need to be repeated in every single user of aligned data.
data_[VideoFrame::kRGBPlane] = reinterpret_cast<uint8*>(
- av_malloc(bytes_per_row * aligned_height));
+ av_malloc(bytes_per_row * aligned_height + kFramePadBytes));
DaleCurtis 2012/07/09 23:25:51 FF_INPUT_BUFFER_PADDING_SIZE instead ?
#else
data_[VideoFrame::kRGBPlane] = new uint8_t[bytes_per_row * aligned_height];
#endif
@@ -142,7 +144,7 @@
// TODO(dalecurtis): use DataAligned or so, so this #ifdef hackery
// doesn't need to be repeated in every single user of aligned data.
uint8* data = reinterpret_cast<uint8*>(
- av_malloc(y_bytes + (uv_bytes * 2)));
+ av_malloc(y_bytes + (uv_bytes * 2) + kFramePadBytes));
#else
uint8* data = new uint8_t[y_bytes + (uv_bytes * 2)];
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698