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

Unified Diff: media/ffmpeg/ffmpeg_common.cc

Issue 1286623002: Update padding/alignment constants to match ffmpeg. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
« media/ffmpeg/ffmpeg_common.h ('K') | « media/ffmpeg/ffmpeg_common.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/ffmpeg/ffmpeg_common.cc
diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc
index 5b6ef7fe3c19c3df7b31ffb194240198bc3e6f81..ca82eadce55013bbb26e6f8ec4cf9f9573012f31 100644
--- a/media/ffmpeg/ffmpeg_common.cc
+++ b/media/ffmpeg/ffmpeg_common.cc
@@ -22,7 +22,7 @@ static_assert(DecoderBuffer::kPaddingSize >= FF_INPUT_BUFFER_PADDING_SIZE,
"DecoderBuffer padding size does not fit ffmpeg requirement");
// Alignment requirement by FFmpeg for input and output buffers. This need to
-// be updated to match FFmpeg when it changes.
+// be updated to match FFmpeg when it changes. See libavutil/mem.c.
#if defined(ARCH_CPU_ARM_FAMILY)
static const int kFFmpegBufferAddressAlignment = 16;
#else
@@ -35,18 +35,21 @@ static_assert(
DecoderBuffer::kAlignmentSize % kFFmpegBufferAddressAlignment == 0,
"DecoderBuffer alignment size does not fit ffmpeg requirement");
-// Allows faster SIMD YUV convert. Also, FFmpeg overreads/-writes occasionally.
-// See video_get_buffer() in libavcodec/utils.c.
-static const int kFFmpegOutputBufferPaddingSize = 16;
-
-static_assert(VideoFrame::kFrameSizePadding >= kFFmpegOutputBufferPaddingSize,
- "VideoFrame padding size does not fit ffmpeg requirement");
-
static_assert(
VideoFrame::kFrameAddressAlignment >= kFFmpegBufferAddressAlignment &&
VideoFrame::kFrameAddressAlignment % kFFmpegBufferAddressAlignment == 0,
"VideoFrame frame address alignment does not fit ffmpeg requirement");
+static_assert(
+ VideoFrame::kFrameSizeAlignment >= STRIDE_ALIGN &&
+ VideoFrame::kFrameSizeAlignment % STRIDE_ALIGN == 0,
+ "VideoFrame size alignment does not fit ffmpeg requirement");
+
+// Allows faster SIMD YUV convert. Also, FFmpeg overreads/-writes occasionally.
+// See video_get_buffer() and update_frame_pool() in libavcodec/utils.c
+static_assert(VideoFrame::kFrameSizePadding >= FRAME_PADDING,
+ "VideoFrame padding size does not fit ffmpeg requirement");
+
static const AVRational kMicrosBase = { 1, base::Time::kMicrosecondsPerSecond };
base::TimeDelta ConvertFromTimeBase(const AVRational& time_base,
« media/ffmpeg/ffmpeg_common.h ('K') | « media/ffmpeg/ffmpeg_common.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698