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

Side by Side Diff: media/filters/vpx_video_decoder.cc

Issue 2165043003: Correctly handle VPX videos in SMPTE.170 colorspace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/filters/vpx_video_decoder.h" 5 #include "media/filters/vpx_video_decoder.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 (*video_frame)->visible_rect().height()); 573 (*video_frame)->visible_rect().height());
574 } 574 }
575 575
576 (*video_frame)->set_timestamp(base::TimeDelta::FromMicroseconds(timestamp)); 576 (*video_frame)->set_timestamp(base::TimeDelta::FromMicroseconds(timestamp));
577 577
578 // Default to the color space from the config, but if the bistream specifies 578 // Default to the color space from the config, but if the bistream specifies
579 // one, prefer that instead. 579 // one, prefer that instead.
580 ColorSpace color_space = config_.color_space(); 580 ColorSpace color_space = config_.color_space();
581 if (vpx_image->cs == VPX_CS_BT_709) 581 if (vpx_image->cs == VPX_CS_BT_709)
582 color_space = COLOR_SPACE_HD_REC709; 582 color_space = COLOR_SPACE_HD_REC709;
583 else if (vpx_image->cs == VPX_CS_BT_601) 583 else if (vpx_image->cs == VPX_CS_BT_601 || vpx_image->cs == VPX_CS_SMPTE_170)
584 color_space = COLOR_SPACE_SD_REC601; 584 color_space = COLOR_SPACE_SD_REC601;
585 (*video_frame) 585 (*video_frame)
586 ->metadata() 586 ->metadata()
587 ->SetInteger(VideoFrameMetadata::COLOR_SPACE, color_space); 587 ->SetInteger(VideoFrameMetadata::COLOR_SPACE, color_space);
588 return true; 588 return true;
589 } 589 }
590 590
591 VpxVideoDecoder::AlphaDecodeStatus VpxVideoDecoder::DecodeAlphaPlane( 591 VpxVideoDecoder::AlphaDecodeStatus VpxVideoDecoder::DecodeAlphaPlane(
592 const struct vpx_image* vpx_image, 592 const struct vpx_image* vpx_image,
593 const struct vpx_image** vpx_image_alpha, 593 const struct vpx_image** vpx_image_alpha,
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 (*video_frame)->visible_data(VideoFrame::kUPlane), 731 (*video_frame)->visible_data(VideoFrame::kUPlane),
732 (*video_frame)->stride(VideoFrame::kUPlane), 732 (*video_frame)->stride(VideoFrame::kUPlane),
733 (*video_frame)->visible_data(VideoFrame::kVPlane), 733 (*video_frame)->visible_data(VideoFrame::kVPlane),
734 (*video_frame)->stride(VideoFrame::kVPlane), coded_size.width(), 734 (*video_frame)->stride(VideoFrame::kVPlane), coded_size.width(),
735 coded_size.height()); 735 coded_size.height());
736 736
737 return true; 737 return true;
738 } 738 }
739 739
740 } // namespace media 740 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698