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

Issue 2476693002: WebGL & 16-bit video stream: upload to FLOAT texture. (Closed)

Created:
4 years, 1 month ago by aleksandar.stojiljkovic
Modified:
4 years ago
CC:
blink-reviews, blink-reviews-api_chromium.org, blink-reviews-html_chromium.org, chromium-reviews, darin-cc_chromium.org, dglazkov+blink, ehmaldonado_chromium, eric.carlson_apple.com, feature-media-reviews_chromium.org, haraken, jam, mcasas+watch+vc_chromium.org, mlamouri+watch-content_chromium.org, mlamouri+watch-blink_chromium.org, posciak+watch_chromium.org, srirama.m
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Lossless access to 16-bit video stream using WebGL GL_FLOAT texture. If using canvas.getImageData or GL textures of UNSIGNED_BYTE type, 16-bit depth stream data is available only through 8-bit* API, so there is a precision loss. Here, we add no-precision-loss** JavaScript access through WebGL float texture. RGBA32F usage here enables lossless access to 16-bit depth information via WebGL1. In related work, the same code path is used to upload 16-bit data to other WebGL2 supported formats; e.g. with GL_R16UI there is no conversion needed in SkCanvasVideoRenderer::TexImageImpl. * 8-bit access refers to JS ImageData and WebGL UNSIGNED_BYTE where 16-bit depth data is now available as luminance (all 3 color channels contains upper 8 bits of 16bit value). ** Float is used for no-precision-loss access to 16-bit data normalized to [0-1.0] range using formula value_float = value_16bit/65535.0. This patch also adds UNSIGNED_BYTE WebGL test which was earlier tested through testVideoToImageBitmap since UNSIGNED_BYTE and canvas rendering still share the same path through SkCanvasVideoRenderer::Paint. BUG=369849, 624436 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Committed: https://crrev.com/d851a930e44e902d0d30c1fea879831bb6edeef7 Cr-Commit-Position: refs/heads/master@{#436221}

Patch Set 1 : Lossless access to 16-bit video stream using WebGL GL_FLOAT texture. #

Total comments: 20

Patch Set 2 : Fixes. phoglung@, hubbe@, thanks. #

Total comments: 4

Patch Set 3 : Nits. Thanks phoglund@. #

Total comments: 2

Patch Set 4 : rebase #

Total comments: 12

Patch Set 5 : Run WebGL-related on GPU bots. #64 fixes. Thanks kbr@. #

Patch Set 6 : Rebase after crrev.com/2527343002 land. #

Total comments: 8

Patch Set 7 : Nits. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+1925 lines, -129 lines) Patch
M chrome/test/BUILD.gn View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
M content/renderer/media/webmediaplayer_ms.h View 1 2 3 4 1 chunk +13 lines, -0 lines 0 comments Download
M content/renderer/media/webmediaplayer_ms.cc View 1 2 3 4 5 6 1 chunk +35 lines, -0 lines 0 comments Download
M content/test/data/media/depth_stream_test_utilities.js View 1 2 1 chunk +31 lines, -67 lines 0 comments Download
M content/test/data/media/getusermedia-depth-capture.html View 1 2 3 4 4 chunks +263 lines, -4 lines 0 comments Download
M content/test/gpu/generate_buildbot_json.py View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
A content/test/gpu/gpu_tests/depth_capture_expectations.py View 1 2 3 4 1 chunk +14 lines, -0 lines 0 comments Download
A content/test/gpu/gpu_tests/depth_capture_integration_test.py View 1 2 3 4 1 chunk +94 lines, -0 lines 0 comments Download
M media/renderers/skcanvas_video_renderer.h View 1 2 3 4 5 1 chunk +31 lines, -0 lines 0 comments Download
M media/renderers/skcanvas_video_renderer.cc View 1 2 3 4 5 6 4 chunks +126 lines, -16 lines 0 comments Download
M media/renderers/skcanvas_video_renderer_unittest.cc View 1 4 chunks +108 lines, -14 lines 0 comments Download
M testing/buildbot/chromium.gpu.json View 1 2 3 4 8 chunks +186 lines, -0 lines 0 comments Download
M testing/buildbot/chromium.gpu.fyi.json View 1 2 3 4 38 chunks +895 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLVideoElement.h View 1 1 chunk +14 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLVideoElement.cpp View 1 1 chunk +20 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp View 1 2 3 4 5 10 chunks +48 lines, -18 lines 0 comments Download
M third_party/WebKit/public/platform/WebMediaPlayer.h View 1 2 3 4 2 chunks +32 lines, -0 lines 2 comments Download

Messages

Total messages: 124 (73 generated)
aleksandar.stojiljkovic
kbr@chromium.org: Please review changes in third_party/WebKit/Source/* chrishtr@chromium.org: Please review changes in third_party/WebKit/public/platform/WebMediaPlayer.h phoglund@chromium.org: Please review ...
4 years, 1 month ago (2016-11-06 10:29:35 UTC) #32
phoglund_chromium
Looks nice, but I'm concerned you're covering what looks like an enormous amount of functionality ...
4 years, 1 month ago (2016-11-07 09:20:00 UTC) #33
aleksandar.stojiljkovic
xhwang_OOO_11_07/dalecurtis@chromium.org: PTAL media/renderers/skcanvas_video_renderer.* media/renderers/skcanvas_video_renderer_unittest.* Thanks.
4 years, 1 month ago (2016-11-07 21:59:45 UTC) #35
DaleCurtis
=>hubbe who's done the other reviews.
4 years, 1 month ago (2016-11-07 22:00:53 UTC) #37
hubbe
https://codereview.chromium.org/2476693002/diff/100001/media/renderers/skcanvas_video_renderer.cc File media/renderers/skcanvas_video_renderer.cc (right): https://codereview.chromium.org/2476693002/diff/100001/media/renderers/skcanvas_video_renderer.cc#newcode527 media/renderers/skcanvas_video_renderer.cc:527: void FlipAndConvertY16(const VideoFrame* video_frame, Add comment. https://codereview.chromium.org/2476693002/diff/100001/media/renderers/skcanvas_video_renderer.cc#newcode819 media/renderers/skcanvas_video_renderer.cc:819: unsigned ...
4 years, 1 month ago (2016-11-07 22:16:55 UTC) #38
Ken Russell (switch to Gerrit)
I'd like to defer review until phoglund's concerns about the tests have been addressed. The ...
4 years, 1 month ago (2016-11-09 00:57:55 UTC) #39
aleksandar.stojiljkovic
On 2016/11/09 00:57:55, Ken Russell wrote: > I'd like to defer review until phoglund's concerns ...
4 years, 1 month ago (2016-11-16 20:00:24 UTC) #40
aleksandar.stojiljkovic
Patch set #2: Fixes. phoglung@, hubbe@, thanks. PTAL. https://codereview.chromium.org/2476693002/diff/100001/content/test/data/media/getusermedia-depth-capture.html File content/test/data/media/getusermedia-depth-capture.html (right): https://codereview.chromium.org/2476693002/diff/100001/content/test/data/media/getusermedia-depth-capture.html#newcode64 content/test/data/media/getusermedia-depth-capture.html:64: { ...
4 years, 1 month ago (2016-11-16 20:01:24 UTC) #41
phoglund_chromium
All right. Your tests are still big, but I understand it's hard because of the ...
4 years, 1 month ago (2016-11-17 10:11:25 UTC) #42
aleksandar.stojiljkovic
Patsh set #3: Nits. Thanks phoglund@. On 2016/11/17 10:11:25, phoglund_chrome wrote: > All right. Your ...
4 years, 1 month ago (2016-11-17 16:03:17 UTC) #43
aleksandar.stojiljkovic
+xhwang@ media/renderers/skcanvas_video_renderer.* media/renderers/skcanvas_video_renderer_unittest.* PTAL. hubbe@ already started review on this (comments processed) but adding xhwang@ ...
4 years, 1 month ago (2016-11-17 19:49:21 UTC) #46
hubbe
https://codereview.chromium.org/2476693002/diff/160001/media/renderers/skcanvas_video_renderer.cc File media/renderers/skcanvas_video_renderer.cc (right): https://codereview.chromium.org/2476693002/diff/160001/media/renderers/skcanvas_video_renderer.cc#newcode582 media/renderers/skcanvas_video_renderer.cc:582: switch (frame->format()) { Wouldn't it be simpler to just ...
4 years, 1 month ago (2016-11-17 20:08:31 UTC) #47
aleksandar.stojiljkovic
https://codereview.chromium.org/2476693002/diff/160001/media/renderers/skcanvas_video_renderer.cc File media/renderers/skcanvas_video_renderer.cc (right): https://codereview.chromium.org/2476693002/diff/160001/media/renderers/skcanvas_video_renderer.cc#newcode582 media/renderers/skcanvas_video_renderer.cc:582: switch (frame->format()) { On 2016/11/17 20:08:31, hubbe wrote: > ...
4 years, 1 month ago (2016-11-17 20:16:10 UTC) #48
hubbe
media/* LGTM
4 years, 1 month ago (2016-11-17 20:20:09 UTC) #49
phoglund_chromium
> I did, of course. Also run it on different bots with errors. From error ...
4 years, 1 month ago (2016-11-18 09:06:30 UTC) #50
aleksandar.stojiljkovic
kbr@chromium.org: Please review changes in third_party/WebKit/Source/* chrishtr@chromium.org: Please review changes in third_party/WebKit/public/platform/WebMediaPlayer.h mcasas@chromium.org: Please review ...
4 years, 1 month ago (2016-11-18 14:38:42 UTC) #56
aleksandar.stojiljkovic
Adding reviewers as kbr@ and chrishtr@ seem busy. dpranke@, PTAL at third_party/WebKit/*, bajones@, PTAL at ...
4 years, 1 month ago (2016-11-22 08:41:03 UTC) #58
Dirk Pranke
I'm not the right reviewer for this. If kbr@ is unavailable, maybe try pdr@ or ...
4 years, 1 month ago (2016-11-22 17:51:32 UTC) #60
pdr.
I'm afraid I am not the best reviewer either. Small (optional, feel free to skip) ...
4 years, 1 month ago (2016-11-22 19:16:01 UTC) #61
aleksandar.stojiljkovic
pdr@, dpranke@, Thanks guys. kbr@ is OoO until 28.11, so I will ask for review ...
4 years ago (2016-11-22 22:44:00 UTC) #63
Ken Russell (switch to Gerrit)
Thanks Alex for putting this together. On which bots are the new tests going to ...
4 years ago (2016-11-22 22:47:45 UTC) #64
aleksandar.stojiljkovic
On 2016/11/22 22:47:45, Ken Russell OOO-till-Nov-28 wrote: > Thanks Alex for putting this together. > ...
4 years ago (2016-11-22 23:21:07 UTC) #65
aleksandar.stojiljkovic
Patch Set 5 : Run WebGL-related tests are the GPU bots. #64 fixes. Thanks kbr@. ...
4 years ago (2016-11-27 20:44:00 UTC) #68
aleksandar.stojiljkovic
Patch Set 6 : Rebase after crrev.com/2527343002 land. On 2016/11/27 20:44:00, aleksandar.stojiljkovic wrote: > Patch ...
4 years ago (2016-11-29 11:59:54 UTC) #77
Ken Russell (switch to Gerrit)
Alex, outstanding work on the new tests. A+ job. These greatly improve my confidence in ...
4 years ago (2016-12-01 08:39:34 UTC) #84
aleksandar.stojiljkovic
On 2016/12/01 08:39:34, Ken Russell wrote: > Alex, outstanding work on the new tests. A+ ...
4 years ago (2016-12-01 12:02:32 UTC) #85
mcasas
emircan@ can you please have a look at webmediaplayer_ms changes? (moving myself to bcc@)
4 years ago (2016-12-01 17:34:53 UTC) #87
emircan
https://codereview.chromium.org/2476693002/diff/220001/content/renderer/media/webmediaplayer_ms.cc File content/renderer/media/webmediaplayer_ms.cc (right): https://codereview.chromium.org/2476693002/diff/220001/content/renderer/media/webmediaplayer_ms.cc#newcode622 content/renderer/media/webmediaplayer_ms.cc:622: media::VideoFrame::NumPlanes(video_frame->format()) != 1) { Should you just check for ...
4 years ago (2016-12-01 23:23:37 UTC) #88
aleksandar.stojiljkovic
https://codereview.chromium.org/2476693002/diff/220001/content/renderer/media/webmediaplayer_ms.cc File content/renderer/media/webmediaplayer_ms.cc (right): https://codereview.chromium.org/2476693002/diff/220001/content/renderer/media/webmediaplayer_ms.cc#newcode622 content/renderer/media/webmediaplayer_ms.cc:622: media::VideoFrame::NumPlanes(video_frame->format()) != 1) { On 2016/12/01 23:23:37, emircan wrote: ...
4 years ago (2016-12-02 20:23:42 UTC) #90
aleksandar.stojiljkovic
4 years ago (2016-12-02 20:24:52 UTC) #92
emircan
lgtm https://codereview.chromium.org/2476693002/diff/220001/content/renderer/media/webmediaplayer_ms.cc File content/renderer/media/webmediaplayer_ms.cc (right): https://codereview.chromium.org/2476693002/diff/220001/content/renderer/media/webmediaplayer_ms.cc#newcode622 content/renderer/media/webmediaplayer_ms.cc:622: media::VideoFrame::NumPlanes(video_frame->format()) != 1) { On 2016/12/02 20:23:41, aleksandar.stojiljkovic ...
4 years ago (2016-12-02 20:33:35 UTC) #93
mcasas
On 2016/12/02 20:33:35, emircan wrote: > lgtm > > https://codereview.chromium.org/2476693002/diff/220001/content/renderer/media/webmediaplayer_ms.cc > File content/renderer/media/webmediaplayer_ms.cc (right): > ...
4 years ago (2016-12-02 20:34:58 UTC) #94
aleksandar.stojiljkovic
pdr@chromium.org, owner's review needed for third_party/WebKit/public/platform/WebMediaPlayer.h. PTAL. Thanks.
4 years ago (2016-12-02 20:45:13 UTC) #95
pdr.
https://codereview.chromium.org/2476693002/diff/240001/third_party/WebKit/public/platform/WebMediaPlayer.h File third_party/WebKit/public/platform/WebMediaPlayer.h (right): https://codereview.chromium.org/2476693002/diff/240001/third_party/WebKit/public/platform/WebMediaPlayer.h#newcode228 third_party/WebKit/public/platform/WebMediaPlayer.h:228: virtual bool texImageImpl(TexImageFunctionID functionID, Does this need to be ...
4 years ago (2016-12-02 21:17:07 UTC) #96
aleksandar.stojiljkovic
https://codereview.chromium.org/2476693002/diff/240001/third_party/WebKit/public/platform/WebMediaPlayer.h File third_party/WebKit/public/platform/WebMediaPlayer.h (right): https://codereview.chromium.org/2476693002/diff/240001/third_party/WebKit/public/platform/WebMediaPlayer.h#newcode228 third_party/WebKit/public/platform/WebMediaPlayer.h:228: virtual bool texImageImpl(TexImageFunctionID functionID, On 2016/12/02 21:17:07, pdr. wrote: ...
4 years ago (2016-12-02 21:28:51 UTC) #97
pdr.
On 2016/12/02 at 21:28:51, aleksandar.stojiljkovic wrote: > https://codereview.chromium.org/2476693002/diff/240001/third_party/WebKit/public/platform/WebMediaPlayer.h > File third_party/WebKit/public/platform/WebMediaPlayer.h (right): > > https://codereview.chromium.org/2476693002/diff/240001/third_party/WebKit/public/platform/WebMediaPlayer.h#newcode228 ...
4 years ago (2016-12-02 21:31:05 UTC) #98
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2476693002/240001
4 years ago (2016-12-04 08:56:41 UTC) #101
commit-bot: I haz the power
Try jobs failed on following builders: win_optional_gpu_tests_rel on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_optional_gpu_tests_rel/builds/5728)
4 years ago (2016-12-04 09:29:46 UTC) #103
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2476693002/240001
4 years ago (2016-12-04 18:02:05 UTC) #105
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/343546)
4 years ago (2016-12-04 21:29:14 UTC) #107
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2476693002/240001
4 years ago (2016-12-04 21:32:12 UTC) #109
Ken Russell (switch to Gerrit)
On 2016/12/04 21:29:14, commit-bot: I haz the power wrote: > Try jobs failed on following ...
4 years ago (2016-12-04 23:51:36 UTC) #110
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/343569)
4 years ago (2016-12-05 01:11:52 UTC) #112
Ken Russell (switch to Gerrit)
On 2016/12/05 01:11:52, commit-bot: I haz the power wrote: > Try jobs failed on following ...
4 years ago (2016-12-05 01:28:15 UTC) #113
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2476693002/240001
4 years ago (2016-12-05 01:28:36 UTC) #115
commit-bot: I haz the power
Committed patchset #7 (id:240001)
4 years ago (2016-12-05 03:09:30 UTC) #118
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/d851a930e44e902d0d30c1fea879831bb6edeef7 Cr-Commit-Position: refs/heads/master@{#436221}
4 years ago (2016-12-05 03:11:43 UTC) #120
hbos_chromium
On 2016/12/05 03:11:43, commit-bot: I haz the power wrote: > Patchset 7 (id:??) landed as ...
4 years ago (2016-12-05 16:56:09 UTC) #121
aleksandar.stojiljkovic
On 2016/12/05 16:56:09, hbos_chromium wrote: > On 2016/12/05 03:11:43, commit-bot: I haz the power wrote: ...
4 years ago (2016-12-05 17:09:03 UTC) #122
aleksandar.stojiljkovic
On 2016/12/05 01:28:15, Ken Russell wrote: > On 2016/12/05 01:11:52, commit-bot: I haz the power ...
4 years ago (2016-12-05 17:49:46 UTC) #123
aleksandar.stojiljkovic
4 years ago (2016-12-09 23:43:24 UTC) #124
Message was sent while issue was closed.
On 2016/12/01 12:02:32, aleksandar.stojiljkovic wrote:
> On 2016/12/01 08:39:34, Ken Russell wrote:
> > Alex, outstanding work on the new tests. A+ job. These greatly improve my
> > confidence in this work. Thank you for persevering with it. LGTM with one
> small
> > change.
> 
> Thanks and thanks for help.
> 
> > 
> >
>
https://codereview.chromium.org/2476693002/diff/220001/media/renderers/skcanv...
> > File media/renderers/skcanvas_video_renderer.cc (right):
> > 
> >
>
https://codereview.chromium.org/2476693002/diff/220001/media/renderers/skcanv...
> > media/renderers/skcanvas_video_renderer.cc:538: uint8_t* out_row_head =
flip_y
> ?
> > out + output_row_bytes * (height - i - 1)
> > Perhaps add a TODO about adding SIMD or similar optimization for this
> > conversion?
> 
> Planning to submit WebGL2 patch using R16UI (and R32F) for review after this
> one. R16UI would require no conversion.
> Then, the benchmarks before GPU buffer support and SIMD optimizations so we
that
> could compare.
kbr@
R16UI approach seems not possible anymore:
https://bugs.chromium.org/p/chromium/issues/detail?id=624436#c51

Also, started with a measurement on the size of potential optimization with SIMD
but need to get the data on all of the platforms. I'll continue on 624436 page.
Thanks.

Powered by Google App Engine
This is Rietveld 408576698