From b62b752c86847826f3fd20b9aaf09a409ebac61d Mon Sep 17 00:00:00 2001 From: "fbarchard@chromium.org" Date: Mon, 6 Apr 2009 21:22:15 +0000 Subject: 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 --- media/filters/ffmpeg_video_decoder.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'media') 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: -- cgit v1.1