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

Unified Diff: media/filters/vpx_video_decoder.cc

Issue 1221903003: Change the video color space default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 5 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
« no previous file with comments | « media/filters/ffmpeg_video_decoder_unittest.cc ('k') | media/formats/mp2t/es_adapter_video_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/vpx_video_decoder.cc
diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc
index 26b60fa55d749496b122c827963a07eb19cb3ca2..d0c57f5d7bb0ff3f024e2777d9201052f074ca72 100644
--- a/media/filters/vpx_video_decoder.cc
+++ b/media/filters/vpx_video_decoder.cc
@@ -462,7 +462,6 @@ void VpxVideoDecoder::CopyVpxImageTo(const vpx_image* vpx_image,
VideoFrame::Format codec_format = VideoFrame::YV12;
int uv_rows = (vpx_image->d_h + 1) / 2;
- VideoFrame::ColorSpace color_space = VideoFrame::COLOR_SPACE_UNSPECIFIED;
if (vpx_image->fmt == VPX_IMG_FMT_I444) {
CHECK(!vpx_codec_alpha_);
codec_format = VideoFrame::YV24;
@@ -470,8 +469,14 @@ void VpxVideoDecoder::CopyVpxImageTo(const vpx_image* vpx_image,
} else if (vpx_codec_alpha_) {
codec_format = VideoFrame::YV12A;
}
+
+ // Default to the color space from the config, but if the bistream specifies
+ // one, prefer that instead.
+ VideoFrame::ColorSpace color_space = config_.color_space();
if (vpx_image->cs == VPX_CS_BT_709)
color_space = VideoFrame::COLOR_SPACE_HD_REC709;
+ else if (vpx_image->cs == VPX_CS_BT_601)
+ color_space = VideoFrame::COLOR_SPACE_SD_REC601;
// The mixed |w|/|d_h| in |coded_size| is intentional. Setting the correct
// coded width is necessary to allow coalesced memory access, which may avoid
« no previous file with comments | « media/filters/ffmpeg_video_decoder_unittest.cc ('k') | media/formats/mp2t/es_adapter_video_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698