summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorfbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-06 21:22:15 +0000
committerfbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-06 21:22:15 +0000
commitb62b752c86847826f3fd20b9aaf09a409ebac61d (patch)
tree77f3375f1a7375184b98483501dff0fbbd2c6c80 /media
parent6d8924d8cc89c3129e51e2067e7911b960a7a7d8 (diff)
downloadchromium_src-b62b752c86847826f3fd20b9aaf09a409ebac61d.zip
chromium_src-b62b752c86847826f3fd20b9aaf09a409ebac61d.tar.gz
chromium_src-b62b752c86847826f3fd20b9aaf09a409ebac61d.tar.bz2
Add jpeg varients of YV12 and YV16. In practice, these come up for motion jpeg.
For memory calculation purposes, these are identical to their regular counterparts, but the YUV calculation should be done differently. A jpeg uses full range 0 to 255, whereas mpeg uses 16 to 240. Ignoring this distinction, means that jpeg will be slightly darker and brighter than it should be. Since jpeg is not a focus for us, and other decoders do this the same way, I suggest we treat them as the same for now. Review URL: http://codereview.chromium.org/62062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13194 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/filters/ffmpeg_video_decoder.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc
index f5d87bc..8b54eab 100644
--- a/media/filters/ffmpeg_video_decoder.cc
+++ b/media/filters/ffmpeg_video_decoder.cc
@@ -80,12 +80,18 @@ void FFmpegVideoDecoder::OnDecode(Buffer* buffer) {
return;
}
+ // J (Motion JPEG) versions of YUV are full range 0..255.
+ // Regular (MPEG) YUV is 16..240.
+ // For now we will ignore the distinction and treat them the same.
+
VideoSurface::Format surface_format;
switch (codec_context_->pix_fmt) {
case PIX_FMT_YUV420P:
+ case PIX_FMT_YUVJ420P:
surface_format = VideoSurface::YV12;
break;
case PIX_FMT_YUV422P:
+ case PIX_FMT_YUVJ422P:
surface_format = VideoSurface::YV16;
break;
default: