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

Unified Diff: media/gpu/dxva_video_decode_accelerator_win.cc

Issue 2791023002: FP16 mode gamma fix (Closed)
Patch Set: bugfix Created 3 years, 9 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 | « no previous file | ui/gfx/color_space_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/dxva_video_decode_accelerator_win.cc
diff --git a/media/gpu/dxva_video_decode_accelerator_win.cc b/media/gpu/dxva_video_decode_accelerator_win.cc
index f54ec1c1f9c1cef1da371b4cd903125d86679253..e7ae23b2c79b32e5acd27d78b1caefa97f4f1d72 100644
--- a/media/gpu/dxva_video_decode_accelerator_win.cc
+++ b/media/gpu/dxva_video_decode_accelerator_win.cc
@@ -2832,8 +2832,13 @@ bool DXVAVideoDecodeAccelerator::InitializeID3D11VideoProcessor(
base::win::ScopedComPtr<ID3D11VideoContext1> video_context1;
HRESULT hr = video_context_.QueryInterface(video_context1.Receive());
if (SUCCEEDED(hr)) {
- if (use_fp16_ && base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableHDR)) {
+ if (use_fp16_ &&
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableHDR) &&
+ color_space.IsHDR()) {
+ // Note, we only use the SCRGBLinear output color space when
+ // the input is PQ, because nvidia drivers will not convert
+ // G22 to G10 for some reason.
dx11_converter_output_color_space_ =
gfx::ColorSpace::CreateSCRGBLinear();
}
@@ -2854,6 +2859,13 @@ bool DXVAVideoDecodeAccelerator::InitializeID3D11VideoProcessor(
DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020);
dx11_converter_output_color_space_ = color_space.GetAsFullRangeRGB();
} else {
+ DVLOG(2) << "input color space: " << color_space
+ << " DXGIColorSpace: "
+ << gfx::ColorSpaceWin::GetDXGIColorSpace(color_space);
+ DVLOG(2) << "output color space:"
+ << dx11_converter_output_color_space_ << " DXGIColorSpace: "
+ << gfx::ColorSpaceWin::GetDXGIColorSpace(
+ dx11_converter_output_color_space_);
video_context1->VideoProcessorSetStreamColorSpace1(
d3d11_processor_.get(), 0,
gfx::ColorSpaceWin::GetDXGIColorSpace(color_space));
« no previous file with comments | « no previous file | ui/gfx/color_space_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698