Commit 46c00cfd authored by Dale Curtis's avatar Dale Curtis Committed by Commit Bot

Disable VP8 hardware decoding below 480p.

Per meet statistics, it's actually more expensive than software
decoding.

R=liberato

Bug: 1136495
Change-Id: I56e7e459c53b38a0fa65b8a7606e28ed27dcc300
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2463964Reviewed-by: default avatarFrank Liberato <liberato@chromium.org>
Commit-Queue: Frank Liberato <liberato@chromium.org>
Auto-Submit: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815848}
parent 823df592
...@@ -163,7 +163,8 @@ media::SupportedResolutionRange GetResolutionsForGUID( ...@@ -163,7 +163,8 @@ media::SupportedResolutionRange GetResolutionsForGUID(
ID3D11VideoDevice* video_device, ID3D11VideoDevice* video_device,
const GUID& decoder_guid, const GUID& decoder_guid,
const std::vector<gfx::Size>& resolutions_to_test, const std::vector<gfx::Size>& resolutions_to_test,
DXGI_FORMAT format = DXGI_FORMAT_NV12) { DXGI_FORMAT format = DXGI_FORMAT_NV12,
const gfx::Size& min_resolution = kMinResolution) {
media::SupportedResolutionRange result; media::SupportedResolutionRange result;
// Verify input is in ascending order by height. // Verify input is in ascending order by height.
...@@ -191,7 +192,7 @@ media::SupportedResolutionRange GetResolutionsForGUID( ...@@ -191,7 +192,7 @@ media::SupportedResolutionRange GetResolutionsForGUID(
} }
if (!result.max_landscape_resolution.IsEmpty()) if (!result.max_landscape_resolution.IsEmpty())
result.min_resolution = kMinResolution; result.min_resolution = min_resolution;
return result; return result;
} }
...@@ -299,10 +300,15 @@ SupportedResolutionRangeMap GetSupportedD3D11VideoDecoderResolutions( ...@@ -299,10 +300,15 @@ SupportedResolutionRangeMap GetSupportedD3D11VideoDecoderResolutions(
if (!workarounds.disable_accelerated_vp8_decode && if (!workarounds.disable_accelerated_vp8_decode &&
profile_id == D3D11_DECODER_PROFILE_VP8_VLD && profile_id == D3D11_DECODER_PROFILE_VP8_VLD &&
base::FeatureList::IsEnabled(kMediaFoundationVP8Decoding)) { base::FeatureList::IsEnabled(kMediaFoundationVP8Decoding)) {
supported_resolutions[VP8PROFILE_ANY] = // VP8 decoding is cheap on modern devices compared to other codecs, so
GetResolutionsForGUID(video_device.Get(), profile_id, // much so that hardware decoding performance is actually worse at low
{gfx::Size(4096, 2160), gfx::Size(4096, 2304), // resolutions than software decoding. See https://crbug.com/1136495.
gfx::Size(4096, 4096)}); constexpr gfx::Size kMinVp8Resolution = gfx::Size(640, 480);
supported_resolutions[VP8PROFILE_ANY] = GetResolutionsForGUID(
video_device.Get(), profile_id,
{gfx::Size(4096, 2160), gfx::Size(4096, 2304), gfx::Size(4096, 4096)},
DXGI_FORMAT_NV12, kMinVp8Resolution);
continue; continue;
} }
......
...@@ -219,7 +219,19 @@ TEST_F(SupportedResolutionResolverTest, VP8Supports4k) { ...@@ -219,7 +219,19 @@ TEST_F(SupportedResolutionResolverTest, VP8Supports4k) {
base::test::ScopedFeatureList scoped_feature_list; base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(kMediaFoundationVP8Decoding); scoped_feature_list.InitAndEnableFeature(kMediaFoundationVP8Decoding);
TestDecoderSupport(D3D11_DECODER_PROFILE_VP8_VLD, VP8PROFILE_ANY);
EnableDecoders({D3D11_DECODER_PROFILE_VP8_VLD});
SetMaxResolution(D3D11_DECODER_PROFILE_VP8_VLD, kSquare4k);
const auto supported_resolutions = GetSupportedD3D11VideoDecoderResolutions(
mock_d3d11_device_, gpu_workarounds_);
auto it = supported_resolutions.find(VP8PROFILE_ANY);
ASSERT_NE(it, supported_resolutions.end());
EXPECT_EQ(kSquare4k, it->second.max_landscape_resolution);
EXPECT_EQ(kSquare4k, it->second.max_portrait_resolution);
constexpr gfx::Size kMinVp8Resolution = gfx::Size(640, 480);
EXPECT_EQ(kMinVp8Resolution, it->second.min_resolution);
} }
TEST_F(SupportedResolutionResolverTest, VP9Profile0Supports8k) { TEST_F(SupportedResolutionResolverTest, VP9Profile0Supports8k) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment