|
|
Chromium Code Reviews|
Created:
4 years, 10 months ago by wuchengli Modified:
4 years, 10 months ago CC:
cc-bugs_chromium.org, chromium-reviews, DaleCurtis, feature-media-reviews_chromium.org, Pawel Osciak Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionVideoLayerImpl: subtract 1 from visible size when calculating tex stretch.
The video texture only has "visible rect" valid and we're sampling
outside of that visible rect and into garbage texture space due to
bilinear filtering. The fix is to stretch the video such that it will
always have an extra set of texels to sample from. Subtract one from
the visible size when calculating the tex stretch x and y scale.
BUG=575587
TEST=Test youtube.com/watch?v=CoOFjXk4xLY on nyan_big and peach_pi.
Run cc_unittests.
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Committed: https://crrev.com/64647caadd62fc639f6a3bb194557d8447f6d419
Cr-Commit-Position: refs/heads/master@{#373478}
Patch Set 1 #
Total comments: 1
Patch Set 2 : check visible rect > 1,1 #
Total comments: 5
Patch Set 3 : rebase #Patch Set 4 : also stretch the video for YUV_RESOURCE #
Total comments: 1
Patch Set 5 : do not stretch visible_rect of IO_SURFACE #Messages
Total messages: 31 (13 generated)
Description was changed from ========== VideoLayerImpl: subtract 1 from visible size when calculating tex stretch. The video texture only has "visible rect" valid and we're sampling outside of that visible rect and into garbage texture space due to bilinear filtering. The fix is to stretch the video such that it will always have an extra set of texels to sample from. Subtract one from the visible size when calculating the tex stretch x and y scale. BUG=575587 TEST=Will test nyan next Monday. ========== to ========== VideoLayerImpl: subtract 1 from visible size when calculating tex stretch. The video texture only has "visible rect" valid and we're sampling outside of that visible rect and into garbage texture space due to bilinear filtering. The fix is to stretch the video such that it will always have an extra set of texels to sample from. Subtract one from the visible size when calculating the tex stretch x and y scale. BUG=575587 TEST=Will test nyan next Monday. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel ==========
wuchengli@chromium.org changed reviewers: + danakj@chromium.org, enne@chromium.org
PTAL
posciak@chromium.org changed reviewers: + posciak@chromium.org
https://codereview.chromium.org/1645353003/diff/1/cc/layers/video_layer_impl.cc File cc/layers/video_layer_impl.cc (right): https://codereview.chromium.org/1645353003/diff/1/cc/layers/video_layer_impl.... cc/layers/video_layer_impl.cc:189: static_cast<float>(visible_rect.width() - 1) / coded_size.width(); I'm wondering if we should be checking for 0,0 (and perhaps 1,1) visible rect before subtracting?
Description was changed from ========== VideoLayerImpl: subtract 1 from visible size when calculating tex stretch. The video texture only has "visible rect" valid and we're sampling outside of that visible rect and into garbage texture space due to bilinear filtering. The fix is to stretch the video such that it will always have an extra set of texels to sample from. Subtract one from the visible size when calculating the tex stretch x and y scale. BUG=575587 TEST=Will test nyan next Monday. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel ========== to ========== VideoLayerImpl: subtract 1 from visible size when calculating tex stretch. The video texture only has "visible rect" valid and we're sampling outside of that visible rect and into garbage texture space due to bilinear filtering. The fix is to stretch the video such that it will always have an extra set of texels to sample from. Subtract one from the visible size when calculating the tex stretch x and y scale. BUG=575587 TEST=Test youtube.com/watch?v=CoOFjXk4xLY on nyan-big device. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel ==========
On 2016/02/01 00:40:58, Pawel Osciak wrote: > https://codereview.chromium.org/1645353003/diff/1/cc/layers/video_layer_impl.cc > File cc/layers/video_layer_impl.cc (right): > > https://codereview.chromium.org/1645353003/diff/1/cc/layers/video_layer_impl.... > cc/layers/video_layer_impl.cc:189: static_cast<float>(visible_rect.width() - 1) > / coded_size.width(); > I'm wondering if we should be checking for 0,0 (and perhaps 1,1) visible rect > before subtracting? Good point. Added the checking.
Tested on nyan-big and it worked. PTAL.
The CQ bit was checked by wuchengli@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1645353003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1645353003/20001
https://codereview.chromium.org/1645353003/diff/20001/cc/layers/video_layer_i... File cc/layers/video_layer_impl.cc (right): https://codereview.chromium.org/1645353003/diff/20001/cc/layers/video_layer_i... cc/layers/video_layer_impl.cc:192: visible_width -= 1.f; Do we want this for RGB_RESOURCE only or for all frame resource type?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== VideoLayerImpl: subtract 1 from visible size when calculating tex stretch. The video texture only has "visible rect" valid and we're sampling outside of that visible rect and into garbage texture space due to bilinear filtering. The fix is to stretch the video such that it will always have an extra set of texels to sample from. Subtract one from the visible size when calculating the tex stretch x and y scale. BUG=575587 TEST=Test youtube.com/watch?v=CoOFjXk4xLY on nyan-big device. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel ========== to ========== VideoLayerImpl: subtract 1 from visible size when calculating tex stretch. The video texture only has "visible rect" valid and we're sampling outside of that visible rect and into garbage texture space due to bilinear filtering. The fix is to stretch the video such that it will always have an extra set of texels to sample from. Subtract one from the visible size when calculating the tex stretch x and y scale. BUG=575587 TEST=Test youtube.com/watch?v=CoOFjXk4xLY on nyan_big and veyron_jerry. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel ==========
I tested this CL on veyron_jerry, which used STREAM_TEXTURE_RESOURCE.
Can you write a renderer pixel test, with a video frame that is green inside the visible rect and red outside, and make sure that the final output is all green? There are some examples of YUV video tests in renderer_pixeltest.cc, and there's already a green.png output, if that's helpful. https://codereview.chromium.org/1645353003/diff/20001/cc/layers/video_layer_i... File cc/layers/video_layer_impl.cc (right): https://codereview.chromium.org/1645353003/diff/20001/cc/layers/video_layer_i... cc/layers/video_layer_impl.cc:188: float visible_width = static_cast<float>(visible_rect.width()); Please leave these as ints and put the static cast down on tex_width_scale. https://codereview.chromium.org/1645353003/diff/20001/cc/layers/video_layer_i... cc/layers/video_layer_impl.cc:192: visible_width -= 1.f; On 2016/02/01 at 03:29:51, wuchengli wrote: > Do we want this for RGB_RESOURCE only or for all frame resource type? If you do this here, it will be for all formats but YUV (just because of how the code works). You might want to fix that as well? If it's the case that textures outside of the visible rect are garbage, then it probably should be scaled for all formats in this case.
PTAL. I discussed with enne@ yesterday. I'll try if I can write a test today. If I cannot figure it out, Adrienne can help write a test. It seems I need to add a VideoGLRendererPixelTest. https://codereview.chromium.org/1645353003/diff/20001/cc/layers/video_layer_i... File cc/layers/video_layer_impl.cc (right): https://codereview.chromium.org/1645353003/diff/20001/cc/layers/video_layer_i... cc/layers/video_layer_impl.cc:188: float visible_width = static_cast<float>(visible_rect.width()); On 2016/02/01 21:00:03, enne wrote: > Please leave these as ints and put the static cast down on tex_width_scale. Done. https://codereview.chromium.org/1645353003/diff/20001/cc/layers/video_layer_i... cc/layers/video_layer_impl.cc:192: visible_width -= 1.f; On 2016/02/01 21:00:03, enne wrote: > On 2016/02/01 at 03:29:51, wuchengli wrote: > > Do we want this for RGB_RESOURCE only or for all frame resource type? > > If you do this here, it will be for all formats but YUV (just because of how the > code works). You might want to fix that as well? > > If it's the case that textures outside of the visible rect are garbage, then it > probably should be scaled for all formats in this case. Done.
By the way, since the issue only happens when scaling up, not scaling down. Do we want to subtract one only when scaling up? If yes, how do I do it? Check if |visible_rect| is smaller than |visible_quad_rect|? Or for simplicity, we always subtract one no matter it's scaling up or down? https://codereview.chromium.org/1645353003/diff/60001/cc/layers/video_layer_i... File cc/layers/video_layer_impl.cc (right): https://codereview.chromium.org/1645353003/diff/60001/cc/layers/video_layer_i... cc/layers/video_layer_impl.cc:330: visible_quad_rect, visible_rect.size(), |visible_rect| is also used here. Is it correct?
I didn't have enough time to write the test today. I'll try writing it tomorrow. Please review video_layer_impl.cc first and see my questions.
PTAL. I looked at renderer_pixeltest.cc. I think the tests don't call into VideoLayerImpl::AppendQuads at all. The role of CreateTestYUVVideoDrawQuad_FromVideoFrame is similar to case YUV_RESOURCE in VideoLayerImpl::AppendQuads, which is to create a YUVVideoDrawQuad. If I understand correctly, the test needs a big change to test VideoLayerImpl::AppendQuads (e.g. create a VideoLayerImpl). Adrienne. Can you review this CL and help write a test in a separate CL?
lgtm
The CQ bit was checked by wuchengli@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1645353003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1645353003/80001
Description was changed from ========== VideoLayerImpl: subtract 1 from visible size when calculating tex stretch. The video texture only has "visible rect" valid and we're sampling outside of that visible rect and into garbage texture space due to bilinear filtering. The fix is to stretch the video such that it will always have an extra set of texels to sample from. Subtract one from the visible size when calculating the tex stretch x and y scale. BUG=575587 TEST=Test youtube.com/watch?v=CoOFjXk4xLY on nyan_big and veyron_jerry. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel ========== to ========== VideoLayerImpl: subtract 1 from visible size when calculating tex stretch. The video texture only has "visible rect" valid and we're sampling outside of that visible rect and into garbage texture space due to bilinear filtering. The fix is to stretch the video such that it will always have an extra set of texels to sample from. Subtract one from the visible size when calculating the tex stretch x and y scale. BUG=575587 TEST=Test youtube.com/watch?v=CoOFjXk4xLY on nyan_big and peach_pi. Run cc_unittests. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel ==========
The CQ bit was unchecked by wuchengli@chromium.org
The CQ bit was checked by wuchengli@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1645353003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1645353003/80001
Message was sent while issue was closed.
Description was changed from ========== VideoLayerImpl: subtract 1 from visible size when calculating tex stretch. The video texture only has "visible rect" valid and we're sampling outside of that visible rect and into garbage texture space due to bilinear filtering. The fix is to stretch the video such that it will always have an extra set of texels to sample from. Subtract one from the visible size when calculating the tex stretch x and y scale. BUG=575587 TEST=Test youtube.com/watch?v=CoOFjXk4xLY on nyan_big and peach_pi. Run cc_unittests. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel ========== to ========== VideoLayerImpl: subtract 1 from visible size when calculating tex stretch. The video texture only has "visible rect" valid and we're sampling outside of that visible rect and into garbage texture space due to bilinear filtering. The fix is to stretch the video such that it will always have an extra set of texels to sample from. Subtract one from the visible size when calculating the tex stretch x and y scale. BUG=575587 TEST=Test youtube.com/watch?v=CoOFjXk4xLY on nyan_big and peach_pi. Run cc_unittests. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel ==========
Message was sent while issue was closed.
Committed patchset #5 (id:80001)
Message was sent while issue was closed.
Description was changed from ========== VideoLayerImpl: subtract 1 from visible size when calculating tex stretch. The video texture only has "visible rect" valid and we're sampling outside of that visible rect and into garbage texture space due to bilinear filtering. The fix is to stretch the video such that it will always have an extra set of texels to sample from. Subtract one from the visible size when calculating the tex stretch x and y scale. BUG=575587 TEST=Test youtube.com/watch?v=CoOFjXk4xLY on nyan_big and peach_pi. Run cc_unittests. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel ========== to ========== VideoLayerImpl: subtract 1 from visible size when calculating tex stretch. The video texture only has "visible rect" valid and we're sampling outside of that visible rect and into garbage texture space due to bilinear filtering. The fix is to stretch the video such that it will always have an extra set of texels to sample from. Subtract one from the visible size when calculating the tex stretch x and y scale. BUG=575587 TEST=Test youtube.com/watch?v=CoOFjXk4xLY on nyan_big and peach_pi. Run cc_unittests. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Committed: https://crrev.com/64647caadd62fc639f6a3bb194557d8447f6d419 Cr-Commit-Position: refs/heads/master@{#373478} ==========
Message was sent while issue was closed.
Patchset 5 (id:??) landed as https://crrev.com/64647caadd62fc639f6a3bb194557d8447f6d419 Cr-Commit-Position: refs/heads/master@{#373478} |
