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

Issue 2370453003: 12-bit vp9 video support (Closed)

Created:
4 years, 3 months ago by hubbe
Modified:
4 years, 2 months ago
CC:
Aaron Boodman, abarth-chromium, alokp+watch_chromium.org, cc-bugs_chromium.org, chromium-reviews, darin (slow to review), darin-cc_chromium.org, feature-media-reviews_chromium.org, jam, Johann, posciak+watch_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add support for 12 bit 420, 422 and 444 YUV video frames. Make sure that we can detect then properly when they come out of libvpx and that we can convert them to half-floats properly when we send them to the compositor. BUG=445071 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel Committed: https://crrev.com/6cf2c09cb064b8530a1ac9dfa79a946410973d83 Cr-Commit-Position: refs/heads/master@{#421610}

Patch Set 1 #

Total comments: 4

Patch Set 2 : avoid fall-through #

Patch Set 3 : vpx doesn't support 9-bit + magic float->half-float function #

Patch Set 4 : typO #

Patch Set 5 : half-float conversion accuracy test added #

Patch Set 6 : merged #

Total comments: 12

Patch Set 7 : comments addressed + comment added #

Total comments: 10

Patch Set 8 : comments addressed #

Patch Set 9 : build fix #

Total comments: 13

Patch Set 10 : comments addressed + histograms.xml fix #

Total comments: 4

Patch Set 11 : typO #

Unified diffs Side-by-side diffs Delta from patch set Stats (+238 lines, -46 lines) Patch
M cc/resources/video_resource_updater.h View 1 2 3 4 5 6 7 8 9 1 chunk +9 lines, -0 lines 0 comments Download
M cc/resources/video_resource_updater.cc View 1 2 3 4 5 6 7 8 9 6 chunks +66 lines, -32 lines 0 comments Download
M cc/resources/video_resource_updater_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +49 lines, -0 lines 0 comments Download
M content/browser/media/media_browsertest.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M media/base/video_frame.cc View 5 chunks +10 lines, -1 line 0 comments Download
M media/base/video_types.h View 1 chunk +5 lines, -1 line 0 comments Download
M media/base/video_types.cc View 3 chunks +12 lines, -0 lines 0 comments Download
M media/ffmpeg/ffmpeg_common.cc View 2 chunks +12 lines, -0 lines 0 comments Download
M media/filters/ffmpeg_video_decoder.cc View 1 chunk +2 lines, -1 line 0 comments Download
M media/filters/vpx_video_decoder.cc View 1 2 3 chunks +9 lines, -9 lines 0 comments Download
M media/mojo/common/media_type_converters.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M media/mojo/interfaces/media_types.mojom View 1 chunk +4 lines, -1 line 0 comments Download
M media/renderers/skcanvas_video_renderer.cc View 1 2 chunks +33 lines, -1 line 0 comments Download
A media/test/data/bear-320x180-hi12p-vp9.webm View Binary file 0 comments Download
M media/test/pipeline_integration_test.cc View 1 chunk +8 lines, -0 lines 0 comments Download
M media/video/gpu_memory_buffer_video_frame_pool.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 69 (43 generated)
hubbe
4 years, 3 months ago (2016-09-23 23:28:53 UTC) #5
DaleCurtis
https://codereview.chromium.org/2370453003/diff/1/media/renderers/skcanvas_video_renderer.cc File media/renderers/skcanvas_video_renderer.cc (right): https://codereview.chromium.org/2370453003/diff/1/media/renderers/skcanvas_video_renderer.cc#newcode457 media/renderers/skcanvas_video_renderer.cc:457: shift++; Why the change?
4 years, 3 months ago (2016-09-23 23:42:24 UTC) #6
hubbe
https://codereview.chromium.org/2370453003/diff/1/media/renderers/skcanvas_video_renderer.cc File media/renderers/skcanvas_video_renderer.cc (right): https://codereview.chromium.org/2370453003/diff/1/media/renderers/skcanvas_video_renderer.cc#newcode457 media/renderers/skcanvas_video_renderer.cc:457: shift++; On 2016/09/23 23:42:24, DaleCurtis wrote: > Why the ...
4 years, 3 months ago (2016-09-23 23:43:06 UTC) #7
DaleCurtis
https://codereview.chromium.org/2370453003/diff/1/media/renderers/skcanvas_video_renderer.cc File media/renderers/skcanvas_video_renderer.cc (right): https://codereview.chromium.org/2370453003/diff/1/media/renderers/skcanvas_video_renderer.cc#newcode457 media/renderers/skcanvas_video_renderer.cc:457: shift++; On 2016/09/23 at 23:43:06, hubbe wrote: > On ...
4 years, 3 months ago (2016-09-23 23:45:42 UTC) #8
hubbe
https://codereview.chromium.org/2370453003/diff/1/media/renderers/skcanvas_video_renderer.cc File media/renderers/skcanvas_video_renderer.cc (right): https://codereview.chromium.org/2370453003/diff/1/media/renderers/skcanvas_video_renderer.cc#newcode457 media/renderers/skcanvas_video_renderer.cc:457: shift++; On 2016/09/23 23:45:42, DaleCurtis wrote: > On 2016/09/23 ...
4 years, 3 months ago (2016-09-23 23:49:49 UTC) #11
DaleCurtis
media/ lgtm
4 years, 3 months ago (2016-09-23 23:51:05 UTC) #12
danakj
https://codereview.chromium.org/2370453003/diff/100001/cc/resources/video_resource_updater.cc File cc/resources/video_resource_updater.cc (right): https://codereview.chromium.org/2370453003/diff/100001/cc/resources/video_resource_updater.cc#newcode510 cc/resources/video_resource_updater.cc:510: // Note that the current method of converting integers ...
4 years, 2 months ago (2016-09-26 20:35:04 UTC) #27
hubbe
All comments addressed. Also added a comment that explains how MakeHalfFloats work. https://codereview.chromium.org/2370453003/diff/100001/cc/resources/video_resource_updater.cc File cc/resources/video_resource_updater.cc ...
4 years, 2 months ago (2016-09-26 21:19:37 UTC) #30
danakj
https://codereview.chromium.org/2370453003/diff/100001/cc/resources/video_resource_updater.cc File cc/resources/video_resource_updater.cc (right): https://codereview.chromium.org/2370453003/diff/100001/cc/resources/video_resource_updater.cc#newcode573 cc/resources/video_resource_updater.cc:573: bits_per_channel <= 10) { On 2016/09/26 21:19:36, hubbe wrote: ...
4 years, 2 months ago (2016-09-26 22:10:39 UTC) #31
hubbe
https://codereview.chromium.org/2370453003/diff/100001/cc/resources/video_resource_updater.cc File cc/resources/video_resource_updater.cc (right): https://codereview.chromium.org/2370453003/diff/100001/cc/resources/video_resource_updater.cc#newcode573 cc/resources/video_resource_updater.cc:573: bits_per_channel <= 10) { On 2016/09/26 22:10:39, danakj wrote: ...
4 years, 2 months ago (2016-09-27 00:03:25 UTC) #36
danakj
https://codereview.chromium.org/2370453003/diff/120001/cc/resources/video_resource_updater_unittest.cc File cc/resources/video_resource_updater_unittest.cc (right): https://codereview.chromium.org/2370453003/diff/120001/cc/resources/video_resource_updater_unittest.cc#newcode536 cc/resources/video_resource_updater_unittest.cc:536: float mult = 1.0f / (num_values - 1); On ...
4 years, 2 months ago (2016-09-27 00:15:58 UTC) #37
hubbe
https://codereview.chromium.org/2370453003/diff/120001/cc/resources/video_resource_updater_unittest.cc File cc/resources/video_resource_updater_unittest.cc (right): https://codereview.chromium.org/2370453003/diff/120001/cc/resources/video_resource_updater_unittest.cc#newcode536 cc/resources/video_resource_updater_unittest.cc:536: float mult = 1.0f / (num_values - 1); On ...
4 years, 2 months ago (2016-09-27 00:31:24 UTC) #38
danakj
Thanks for your changes things are reading much more clearly IMO. cc LGTM with a ...
4 years, 2 months ago (2016-09-27 20:49:11 UTC) #45
danakj
> 12-bit video support Can you write more in the CL description about this? It's ...
4 years, 2 months ago (2016-09-27 20:49:48 UTC) #46
hubbe
https://codereview.chromium.org/2370453003/diff/160001/cc/resources/video_resource_updater.cc File cc/resources/video_resource_updater.cc (right): https://codereview.chromium.org/2370453003/diff/160001/cc/resources/video_resource_updater.cc#newcode576 cc/resources/video_resource_updater.cc:576: if (plane_resource.resource_format() == LUMINANCE_F16 && On 2016/09/27 20:49:11, danakj ...
4 years, 2 months ago (2016-09-27 22:27:36 UTC) #50
danakj
https://codereview.chromium.org/2370453003/diff/160001/cc/resources/video_resource_updater.cc File cc/resources/video_resource_updater.cc (right): https://codereview.chromium.org/2370453003/diff/160001/cc/resources/video_resource_updater.cc#newcode576 cc/resources/video_resource_updater.cc:576: if (plane_resource.resource_format() == LUMINANCE_F16 && On 2016/09/27 22:27:36, hubbe ...
4 years, 2 months ago (2016-09-27 22:37:51 UTC) #51
hubbe
+tsepez for mojo files +rkaplow for histograms.xml
4 years, 2 months ago (2016-09-27 23:09:31 UTC) #53
Tom Sepez
mojo LGTM
4 years, 2 months ago (2016-09-27 23:15:00 UTC) #54
rkaplow
lgtm lg % typo in xml https://codereview.chromium.org/2370453003/diff/180001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/2370453003/diff/180001/tools/metrics/histograms/histograms.xml#newcode99512 tools/metrics/histograms/histograms.xml:99512: + <int value="22" ...
4 years, 2 months ago (2016-09-28 14:13:40 UTC) #57
hubbe
https://codereview.chromium.org/2370453003/diff/180001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/2370453003/diff/180001/tools/metrics/histograms/histograms.xml#newcode99512 tools/metrics/histograms/histograms.xml:99512: + <int value="22" label="YUV420P129"/> On 2016/09/28 14:13:40, rkaplow wrote: ...
4 years, 2 months ago (2016-09-28 18:06:20 UTC) #58
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/2370453003/200001
4 years, 2 months ago (2016-09-28 18:07:50 UTC) #61
commit-bot: I haz the power
Committed patchset #11 (id:200001)
4 years, 2 months ago (2016-09-28 19:47:40 UTC) #63
commit-bot: I haz the power
Patchset 11 (id:??) landed as https://crrev.com/6cf2c09cb064b8530a1ac9dfa79a946410973d83 Cr-Commit-Position: refs/heads/master@{#421610}
4 years, 2 months ago (2016-09-28 19:49:08 UTC) #65
dshwang
hubbe@, great. How did you produce bear-320x180-hi12p-vp9.webm ?
4 years, 2 months ago (2016-09-29 11:27:14 UTC) #66
hubbe
On 2016/09/29 11:27:14, dshwang wrote: > hubbe@, great. How did you produce bear-320x180-hi12p-vp9.webm ? /usr/local/hi10p/bin/ffmpeg ...
4 years, 2 months ago (2016-09-29 17:28:34 UTC) #67
fbarchard1
4 years, 2 months ago (2016-09-29 22:44:36 UTC) #69
Message was sent while issue was closed.
https://codereview.chromium.org/2370453003/diff/180001/cc/resources/video_res...
File cc/resources/video_resource_updater.cc (right):

https://codereview.chromium.org/2370453003/diff/180001/cc/resources/video_res...
cc/resources/video_resource_updater.cc:295: void
VideoResourceUpdater::MakeHalfFloats(const uint16_t* src,
libyuv:HalfFloatPlane() implements this function in AVX2, if you'd like to call
that instead.  The 'bits_per_channel' parameter is replaced with a float
multiplier, which is 1.0f / ((1 << bits_per_channel) - 1) for your use case.

https://codereview.chromium.org/2370453003/diff/180001/cc/resources/video_res...
cc/resources/video_resource_updater.cc:310: dst[i] = (*(uint32_t*)&value) >> 13;
When used on 12 bit, the half float will store only 10 bits of mantissa and this
shift by 13 will loose bits, rounding with 'truncation'
Is truncation acceptable?

VCVTPS2PH supports rounding or truncation.
http://www.felixcloutier.com/x86/VCVTPS2PH.html

If you want to mimic rounding, you could add 0.5 effectively, after the multiply
but before the shift.

Powered by Google App Engine
This is Rietveld 408576698