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

Unified Diff: cc/resources/video_resource_updater.cc

Issue 2969223002: [media]: Replace LUMINANCE_F16 by R16 for 9/10-bit h264 videos.
Patch Set: Fix in resource_format_utils Created 3 years, 4 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 | « cc/resources/video_resource_updater.h ('k') | cc/resources/video_resource_updater_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/video_resource_updater.cc
diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc
index f27a011b7da6eda78e49f2daaaa7104dcd11f435..e4134f360ae63ea50972d2f24ebbfb35269f3b6e 100644
--- a/cc/resources/video_resource_updater.cc
+++ b/cc/resources/video_resource_updater.cc
@@ -472,6 +472,13 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes(
external_resources.multiplier = half_float_maker->Multiplier();
}
+ if (resource_provider_->YuvResourceFormat(bits_per_channel) == viz::R16_EXT) {
+ int shift = 16 - bits_per_channel;
+ external_resources.multiplier =
+ (1 << shift) + 1.0 / (1 << (bits_per_channel - shift));
+ external_resources.offset = 0;
+ }
+
for (size_t i = 0; i < plane_resources.size(); ++i) {
PlaneResource& plane_resource = *plane_resources[i];
// Update each plane's resource id with its content.
@@ -504,6 +511,9 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes(
// step.
if (plane_resource.resource_format() == viz::LUMINANCE_F16) {
needs_conversion = true;
+ } else if (plane_resource.resource_format() == viz::R16_EXT) {
+ // R16_EXT can represent 16-bit int, so we don't need a conversion step.
+ needs_conversion = false;
} else if (bits_per_channel > 8) {
// If bits_per_channel > 8 and we can't use viz::LUMINANCE_F16, we need
// to shift the data down and create an 8-bit texture.
« no previous file with comments | « cc/resources/video_resource_updater.h ('k') | cc/resources/video_resource_updater_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698