diff options
author | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-22 18:39:27 +0000 |
---|---|---|
committer | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-22 18:39:27 +0000 |
commit | a990a65c2e484f5875f670f08993649897e9d863 (patch) | |
tree | 030594a19b2c870e0a93fdfd74d783ce2965df00 /media | |
parent | d9fbb4ab86ff1c2574305417e5545253d7c176cd (diff) | |
download | chromium_src-a990a65c2e484f5875f670f08993649897e9d863.zip chromium_src-a990a65c2e484f5875f670f08993649897e9d863.tar.gz chromium_src-a990a65c2e484f5875f670f08993649897e9d863.tar.bz2 |
Reduce ffmpeg alignment requirement from 4x2 to 2x1.
The multiple of 4 restriction on width is unnecessary and prevents some valid movies from playing.
Height being any size does not cause any problems for YV12, which is half height on chroma, as long as you round up in any calcs, and in YV16 there should be no height constraint.
Use uluh.mov in debug mode to test.
Review URL: http://codereview.chromium.org/93008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14215 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/filters/ffmpeg_video_decoder.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc index 85b74ba..d65a692 100644 --- a/media/filters/ffmpeg_video_decoder.cc +++ b/media/filters/ffmpeg_video_decoder.cc @@ -140,8 +140,7 @@ bool FFmpegVideoDecoder::EnqueueVideoFrame(VideoSurface::Format surface_format, void FFmpegVideoDecoder::CopyPlane(size_t plane, const VideoSurface& surface, const AVFrame* frame) { - DCHECK(surface.width % 4 == 0); - DCHECK(surface.height % 2 == 0); + DCHECK(surface.width % 2 == 0); const uint8* source = frame->data[plane]; const size_t source_stride = frame->linesize[plane]; uint8* dest = surface.data[plane]; @@ -151,7 +150,7 @@ void FFmpegVideoDecoder::CopyPlane(size_t plane, if (plane != VideoSurface::kYPlane) { bytes_per_line /= 2; if (surface.format == VideoSurface::YV12) { - copy_lines /= 2; + copy_lines = (copy_lines + 1) / 2; } } DCHECK(bytes_per_line <= source_stride && bytes_per_line <= dest_stride); |