diff options
author | magjed <magjed@chromium.org> | 2015-03-27 02:11:08 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-27 09:11:45 +0000 |
commit | 7364ff94a2bd814dd198f609f8d5bacabe1d563b (patch) | |
tree | 5dbc3187940087cf98113685698cfa26e8b15710 /cc/quads/yuv_video_draw_quad.h | |
parent | da4c3f4269fbac2fe1b31e41a29d27bec8d5ec9d (diff) | |
download | chromium_src-7364ff94a2bd814dd198f609f8d5bacabe1d563b.zip chromium_src-7364ff94a2bd814dd198f609f8d5bacabe1d563b.tar.gz chromium_src-7364ff94a2bd814dd198f609f8d5bacabe1d563b.tar.bz2 |
Increase YUV video clamping
The current clamping is not enough to avoid bleeding issues. This is
exposed when changing the background color in CreateEdgeBleedPass from
black to gray. The reason it works now is because interpolating U/V
textures from black (YUV = 0, 0, 0) to green (YUV = 149, 43, 21) will
still result in saturated green pixels (RGB = 0, 255, 0). All YUV values
in the range (149, 0-43, 0-21) will end up as RGB = (0, 255, 0).
The current clamping is not enough, because the calculation
'0.5f / quad->tex_size.width()' is using the Y texture size, the highest
resolution plane, but the U/V texture size is only half of that. This CL
adds individual sizes for the Y/A and U/V textures.
BUG=429640,467283
Committed: https://crrev.com/4be817dd606efdba1614d32608ddd6e16bfa687d
Cr-Commit-Position: refs/heads/master@{#320567}
Review URL: https://codereview.chromium.org/1008493002
Cr-Commit-Position: refs/heads/master@{#322541}
Diffstat (limited to 'cc/quads/yuv_video_draw_quad.h')
-rw-r--r-- | cc/quads/yuv_video_draw_quad.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cc/quads/yuv_video_draw_quad.h b/cc/quads/yuv_video_draw_quad.h index 15bce98..03276eb 100644 --- a/cc/quads/yuv_video_draw_quad.h +++ b/cc/quads/yuv_video_draw_quad.h @@ -30,7 +30,8 @@ class CC_EXPORT YUVVideoDrawQuad : public DrawQuad { const gfx::Rect& opaque_rect, const gfx::Rect& visible_rect, const gfx::RectF& tex_coord_rect, - const gfx::Size& tex_size, + const gfx::Size& ya_tex_size, + const gfx::Size& uv_tex_size, unsigned y_plane_resource_id, unsigned u_plane_resource_id, unsigned v_plane_resource_id, @@ -43,7 +44,8 @@ class CC_EXPORT YUVVideoDrawQuad : public DrawQuad { const gfx::Rect& visible_rect, bool needs_blending, const gfx::RectF& tex_coord_rect, - const gfx::Size& tex_size, + const gfx::Size& ya_tex_size, + const gfx::Size& uv_tex_size, unsigned y_plane_resource_id, unsigned u_plane_resource_id, unsigned v_plane_resource_id, @@ -52,7 +54,8 @@ class CC_EXPORT YUVVideoDrawQuad : public DrawQuad { gfx::RectF tex_coord_rect; // Empty texture size implies no clamping of texture coordinates. - gfx::Size tex_size; + gfx::Size ya_tex_size; + gfx::Size uv_tex_size; unsigned y_plane_resource_id; unsigned u_plane_resource_id; unsigned v_plane_resource_id; |