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

Unified Diff: media/filters/vpx_video_decoder.cc

Issue 1230593005: Reland: Change the video color space default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: big 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 f0dc03234093705cb8878a16f9485ea6333d305c..dc1d21d24268bf5aa8b2f584ab78f6c88932f71e 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,
VideoPixelFormat codec_format = PIXEL_FORMAT_YV12;
int uv_rows = (vpx_image->d_h + 1) / 2;
- ColorSpace color_space = COLOR_SPACE_UNSPECIFIED;
if (vpx_image->fmt == VPX_IMG_FMT_I444) {
CHECK(!vpx_codec_alpha_);
codec_format = PIXEL_FORMAT_YV24;
@@ -470,8 +469,14 @@ void VpxVideoDecoder::CopyVpxImageTo(const vpx_image* vpx_image,
} else if (vpx_codec_alpha_) {
codec_format = PIXEL_FORMAT_YV12A;
}
+
+ // Default to the color space from the config, but if the bistream specifies
+ // one, prefer that instead.
+ ColorSpace color_space = config_.color_space();
if (vpx_image->cs == VPX_CS_BT_709)
color_space = COLOR_SPACE_HD_REC709;
+ else if (vpx_image->cs == VPX_CS_BT_601)
+ color_space = 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