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

Unified Diff: media/ffmpeg/ffmpeg_common.cc

Issue 591313008: Add support for Rec709 color space videos in software YUV convert path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
Index: media/ffmpeg/ffmpeg_common.cc
diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc
index 3b92d3db706728c61084a88bf284bb9e56d748f3..0bf9318601d091b7e2e125801797ef65b3f00483 100644
--- a/media/ffmpeg/ffmpeg_common.cc
+++ b/media/ffmpeg/ffmpeg_common.cc
@@ -407,6 +407,12 @@ void AVStreamToVideoDecoderConfig(
coded_size = visible_rect.size();
}
+ // YV12 frames may be in HD color space.
+ if (format == VideoFrame::YV12 &&
+ stream->codec->colorspace == AVCOL_SPC_BT709) {
+ format = VideoFrame::YV12HD;
+ }
+
// Pad out |coded_size| for subsampled YUV formats.
if (format != VideoFrame::YV24) {
coded_size.set_width((coded_size.width() + 1) / 2 * 2);
@@ -546,6 +552,7 @@ PixelFormat VideoFormatToPixelFormat(VideoFrame::Format video_format) {
case VideoFrame::YV16:
return PIX_FMT_YUV422P;
case VideoFrame::YV12:
+ case VideoFrame::YV12HD:
return PIX_FMT_YUV420P;
case VideoFrame::YV12J:
return PIX_FMT_YUVJ420P;

Powered by Google App Engine
This is Rietveld 408576698