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

Issue 2444463002: Change half-float conversion to use 1.0 multiplier (Closed)

Created:
4 years, 2 months ago by hubbe
Modified:
4 years, 2 months ago
Reviewers:
fbarchard, fbarchard1, piman
CC:
chromium-reviews, posciak+watch_chromium.org, cc-bugs_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Change half-float conversion to use 1.0 multiplier Half-float conversion is more efficient on some platforms if the multiplier used is 1.0. Also clean up the half-float conversion code and extend testing up to 16 bits. BUG=657627 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel Committed: https://crrev.com/98626da3db8d1dec43d259d93f54b5adc9c500c2 Cr-Commit-Position: refs/heads/master@{#426885}

Patch Set 1 #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+127 lines, -67 lines) Patch
M cc/resources/video_resource_updater.h View 1 chunk +22 lines, -8 lines 2 comments Download
M cc/resources/video_resource_updater.cc View 4 chunks +90 lines, -52 lines 6 comments Download
M cc/resources/video_resource_updater_unittest.cc View 1 chunk +15 lines, -7 lines 0 comments Download

Messages

Total messages: 15 (8 generated)
hubbe
4 years, 2 months ago (2016-10-21 19:23:26 UTC) #4
piman
lgtm
4 years, 2 months ago (2016-10-21 20:28:14 UTC) #6
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/2444463002/1
4 years, 2 months ago (2016-10-21 20:34:59 UTC) #9
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 2 months ago (2016-10-21 20:59:11 UTC) #10
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/98626da3db8d1dec43d259d93f54b5adc9c500c2 Cr-Commit-Position: refs/heads/master@{#426885}
4 years, 2 months ago (2016-10-21 21:03:21 UTC) #12
fbarchard1
need to pass the multiplier to shader? https://codereview.chromium.org/2444463002/diff/1/cc/resources/video_resource_updater.cc File cc/resources/video_resource_updater.cc (right): https://codereview.chromium.org/2444463002/diff/1/cc/resources/video_resource_updater.cc#newcode329 cc/resources/video_resource_updater.cc:329: dst[i] = ...
4 years, 2 months ago (2016-10-21 22:46:06 UTC) #14
hubbe
4 years, 2 months ago (2016-10-21 22:55:04 UTC) #15
Message was sent while issue was closed.
https://codereview.chromium.org/2444463002/diff/1/cc/resources/video_resource...
File cc/resources/video_resource_updater.cc (right):

https://codereview.chromium.org/2444463002/diff/1/cc/resources/video_resource...
cc/resources/video_resource_updater.cc:329: dst[i] = src[i] | 0x3800;
On 2016/10/21 22:46:06, fbarchard1 wrote:
> this will be slow for compilers that dont vectorize, or if you allow
'official'
> build to use -Os.

Can we get rid of this code and move the decision of how to convert the floats
into half-floats into libyuv? Libyuv could just return the resource multiplier
and offset.

https://codereview.chromium.org/2444463002/diff/1/cc/resources/video_resource...
cc/resources/video_resource_updater.cc:349: libyuv_multiplier_ = 1.0f / 4096.0f;
On 2016/10/21 22:46:06, fbarchard1 wrote:
> have you tested using 1.0?
> values near 65535 will potentially become inf as a halffloat?  but we should
> test this to see what really happens?
> even with /4096 you can get denormals, which are value but hurt performance
> dramatically on intel.
> 
> 


I have not tested the inf case.

The smallest possible normal value is 2^-14, 1/4096 is 4 times larger, so how
can you get subnormal values?

https://codereview.chromium.org/2444463002/diff/1/cc/resources/video_resource...
cc/resources/video_resource_updater.cc:619:
half_float_maker->MakeHalfFloats(src, bytes_per_row / 2, dst);
On 2016/10/21 22:46:06, fbarchard1 wrote:
> libyuv:HalfFloatPlane has some overhead to detect cpu/alignment.  Suggest
> calling it once per plane with width, height and stride.
> If the stride == width * 2 it will row coalesce into a single call.

Seems reasonable, but I would prefer to fix that after we move the
offset/multiplier decisions into libyuv.

https://codereview.chromium.org/2444463002/diff/1/cc/resources/video_resource...
File cc/resources/video_resource_updater.h (right):

https://codereview.chromium.org/2444463002/diff/1/cc/resources/video_resource...
cc/resources/video_resource_updater.h:90: // The numbers stored in |dst| will be
half floats in range 0.0..1.0
On 2016/10/21 22:46:06, fbarchard1 wrote:
> This comment needs update?

Will fix in separate cl (Since this one is checked in now)

Powered by Google App Engine
This is Rietveld 408576698