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

Issue 2434073003: Extract bitrate allocation of spatial/temporal layers out of codec impl. (Closed)

Created:
4 years, 2 months ago by sprang_webrtc
Modified:
4 years, 1 month ago
CC:
webrtc-reviews_webrtc.org, interface-changes_webrtc.org, video-team_agora.io, yujie_mao (webrtc), zhengzhonghou_agora.io, stefan-webrtc, tterriberry_mozilla.com, qiang.lu, niklas.enbom, peah-webrtc, mflodman
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Extract bitrate allocation of spatial/temporal layers out of codec impl. This CL makes a number of intervowen changes: * Add BitrateAllocation struct, that contains a codec independent view of how the target bitrate is distributed over spatial and temporal layers. * Adds the BitrateAllocator interface, which takes a bitrate and frame rate and produces a BitrateAllocation. * A default (non layered) implementation is added, and SimulcastRateAllocator is extended to fully handle VP8 allocation. This includes capturing TemporalLayer instances created by the encoder. * ViEEncoder now owns both the bitrate allocator and the temporal layer factories for VP8. This allows allocation to happen fully outside of the encoder implementation. This refactoring will make it possible for ViEEncoder to signal the full picture of target bitrates to the RTCP module. BUG=webrtc:6301 Committed: https://crrev.com/8f46c679d24a05b3f08e02c6d91ec9637f34e24f Cr-Commit-Position: refs/heads/master@{#14998}

Patch Set 1 #

Patch Set 2 : Updated tl listener registration. Fixed tests. #

Total comments: 34

Patch Set 3 : Address comments, deprecate SetRates, many test fixes #

Patch Set 4 : Fixed sign mismatch #

Total comments: 10

Patch Set 5 : Addressed comments. Moved VideoCodec creation to factory class. #

Total comments: 83

Patch Set 6 : Addressed comments #

Patch Set 7 : vp8_impl set sending false on rate 0 #

Patch Set 8 : New rebase #

Patch Set 9 : just tidying #

Patch Set 10 : ViEEncoder updates target bitrate when reconfiguring codec #

Patch Set 11 : Changes to init sequence and test #

Patch Set 12 : Fixed test #

Total comments: 3

Patch Set 13 : uint64_t as temp type in BitrateAllocation sum verification #

Patch Set 14 : Fixed unit for preferred bitrate, rate allocation in VideoCodingModuleImpl #

Patch Set 15 : Test case for preferred bitrate stats, incl bugfix #

Patch Set 16 : VideoCodecImpl fix #

Total comments: 5

Patch Set 17 : Addressed comments #

Patch Set 18 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1682 lines, -844 lines) Patch
M webrtc/api/android/jni/androidmediaencoder_jni.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +6 lines, -4 lines 0 comments Download
M webrtc/common_types.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +35 lines, -1 line 0 comments Download
M webrtc/common_types.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +87 lines, -0 lines 0 comments Download
M webrtc/common_video/BUILD.gn View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/common_video/common_video.gyp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A webrtc/common_video/include/video_bitrate_allocator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +30 lines, -0 lines 0 comments Download
M webrtc/media/engine/fakewebrtcvideoengine.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +12 lines, -11 lines 0 comments Download
M webrtc/modules/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/modules/video_coding/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +4 lines, -0 lines 0 comments Download
M webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -3 lines 0 comments Download
M webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +14 lines, -4 lines 0 comments Download
M webrtc/modules/video_coding/codecs/i420/include/i420.h View 1 2 2 chunks +1 line, -4 lines 0 comments Download
M webrtc/modules/video_coding/codecs/test/videoprocessor.h View 1 2 3 chunks +5 lines, -0 lines 0 comments Download
M webrtc/modules/video_coding/codecs/test/videoprocessor.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 12 chunks +40 lines, -23 lines 0 comments Download
M webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/default_temporal_layers.h View 1 2 3 4 5 5 chunks +13 lines, -7 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/default_temporal_layers.cc View 1 2 3 4 5 8 chunks +69 lines, -19 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/default_temporal_layers_unittest.cc View 4 chunks +8 lines, -4 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/realtime_temporal_layers.cc View 1 2 3 4 5 7 chunks +64 lines, -30 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/screenshare_layers.h View 1 2 3 4 5 4 chunks +12 lines, -13 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/screenshare_layers.cc View 1 2 3 4 5 4 chunks +55 lines, -42 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc View 1 2 3 4 5 4 chunks +28 lines, -9 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h View 1 2 2 chunks +2 lines, -3 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 6 chunks +54 lines, -58 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 13 chunks +32 lines, -18 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/simulcast_unittest.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 24 chunks +44 lines, -132 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/simulcast_unittest.cc View 1 2 1 chunk +0 lines, -5 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/temporal_layers.h View 1 2 3 4 5 3 chunks +36 lines, -12 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc View 1 2 3 4 4 chunks +9 lines, -1 line 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/vp8_impl.h View 1 2 3 4 5 3 chunks +2 lines, -3 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 8 chunks +81 lines, -103 lines 0 comments Download
M webrtc/modules/video_coding/codecs/vp9/vp9_impl.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +13 lines, -8 lines 0 comments Download
M webrtc/modules/video_coding/generic_encoder.h View 1 chunk +1 line, -1 line 0 comments Download
M webrtc/modules/video_coding/generic_encoder.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +17 lines, -5 lines 0 comments Download
M webrtc/modules/video_coding/include/mock/mock_video_codec_interface.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
A webrtc/modules/video_coding/include/video_codec_initializer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +59 lines, -0 lines 0 comments Download
M webrtc/modules/video_coding/include/video_coding.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A webrtc/modules/video_coding/utility/default_video_bitrate_allocator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +33 lines, -0 lines 0 comments Download
A webrtc/modules/video_coding/utility/default_video_bitrate_allocator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +47 lines, -0 lines 0 comments Download
A webrtc/modules/video_coding/utility/default_video_bitrate_allocator_unittest.cc View 1 chunk +80 lines, -0 lines 0 comments Download
M webrtc/modules/video_coding/utility/simulcast_rate_allocator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +17 lines, -5 lines 0 comments Download
M webrtc/modules/video_coding/utility/simulcast_rate_allocator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +115 lines, -49 lines 0 comments Download
M webrtc/modules/video_coding/utility/simulcast_rate_allocator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 13 chunks +51 lines, -32 lines 0 comments Download
M webrtc/modules/video_coding/utility/video_coding_utility.gyp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
A webrtc/modules/video_coding/video_codec_initializer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +227 lines, -0 lines 0 comments Download
M webrtc/modules/video_coding/video_coding.gypi View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M webrtc/modules/video_coding/video_coding_impl.h View 1 2 3 4 5 6 7 8 9 2 chunks +10 lines, -2 lines 0 comments Download
M webrtc/modules/video_coding/video_coding_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +22 lines, -1 line 0 comments Download
M webrtc/modules/video_coding/video_sender.cc View 1 2 3 4 5 6 7 8 9 6 chunks +37 lines, -10 lines 0 comments Download
M webrtc/modules/video_coding/video_sender_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 12 chunks +58 lines, -19 lines 0 comments Download
M webrtc/test/configurable_frame_size_encoder.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M webrtc/test/configurable_frame_size_encoder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +5 lines, -3 lines 0 comments Download
M webrtc/test/fake_encoder.h View 1 2 3 4 5 2 chunks +3 lines, -2 lines 0 comments Download
M webrtc/test/fake_encoder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +6 lines, -6 lines 0 comments Download
M webrtc/video/end_to_end_tests.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -3 lines 0 comments Download
M webrtc/video/video_encoder.cc View 1 2 3 4 5 3 chunks +13 lines, -7 lines 0 comments Download
M webrtc/video/video_encoder_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 6 chunks +26 lines, -4 lines 0 comments Download
M webrtc/video/video_send_stream_tests.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 6 chunks +21 lines, -14 lines 0 comments Download
M webrtc/video/vie_encoder.h View 1 2 3 4 5 10 2 chunks +2 lines, -5 lines 0 comments Download
M webrtc/video/vie_encoder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 7 chunks +20 lines, -153 lines 0 comments Download
M webrtc/video/vie_encoder_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +16 lines, -0 lines 0 comments Download
M webrtc/video_encoder.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +15 lines, -4 lines 0 comments Download

Messages

Total messages: 37 (13 generated)
sprang_webrtc
I did "a perkj" and created a massive refactoring cl. ptal :)
4 years, 2 months ago (2016-10-21 07:22:19 UTC) #2
perkj_webrtc
Its large but make sense as one cl I think. https://codereview.chromium.org/2434073003/diff/20001/webrtc/common_types.h File webrtc/common_types.h (right): https://codereview.chromium.org/2434073003/diff/20001/webrtc/common_types.h#newcode625 ...
4 years, 2 months ago (2016-10-21 08:24:29 UTC) #3
sprang_webrtc
Deprecated SetRates() and fixed many test cases that broke because of that. ptal https://codereview.webrtc.org/2434073003/diff/20001/webrtc/common_types.h File ...
4 years, 1 month ago (2016-10-25 10:44:26 UTC) #4
perkj_webrtc
I have not looked at anything but ViEEncoder but that looks good. Just one suggestion/question. ...
4 years, 1 month ago (2016-10-25 11:02:27 UTC) #5
sprang_webrtc
https://codereview.webrtc.org/2434073003/diff/60001/webrtc/video/vie_encoder.cc File webrtc/video/vie_encoder.cc (right): https://codereview.webrtc.org/2434073003/diff/60001/webrtc/video/vie_encoder.cc#newcode443 webrtc/video/vie_encoder.cc:443: rate_allocator_ = VideoBitrateAllocatorFactory::GetBitrateAllocator(&codec); On 2016/10/25 11:02:27, perkj_webrtc wrote: > ...
4 years, 1 month ago (2016-10-25 11:43:03 UTC) #6
sprang_webrtc
ping?
4 years, 1 month ago (2016-10-26 13:43:00 UTC) #7
perkj_webrtc
I think Stefan should take a look as well. https://codereview.webrtc.org/2434073003/diff/60001/webrtc/common_types.h File webrtc/common_types.h (right): https://codereview.webrtc.org/2434073003/diff/60001/webrtc/common_types.h#newcode627 webrtc/common_types.h:627: ...
4 years, 1 month ago (2016-10-27 12:57:32 UTC) #8
sprang_webrtc
Updated how VideoCodec is created, ptal. https://codereview.webrtc.org/2434073003/diff/60001/webrtc/common_types.h File webrtc/common_types.h (right): https://codereview.webrtc.org/2434073003/diff/60001/webrtc/common_types.h#newcode627 webrtc/common_types.h:627: static constexpr size_t ...
4 years, 1 month ago (2016-11-01 18:03:16 UTC) #9
perkj_webrtc
lgtm with the comments addressed. I have not looked in detail on the video_coding changes ...
4 years, 1 month ago (2016-11-01 18:40:10 UTC) #10
stefan-webrtc
https://codereview.webrtc.org/2434073003/diff/80001/webrtc/common_types.cc File webrtc/common_types.cc (right): https://codereview.webrtc.org/2434073003/diff/80001/webrtc/common_types.cc#newcode14 webrtc/common_types.cc:14: #include "webrtc/base/checks.h" Included twice. https://codereview.webrtc.org/2434073003/diff/80001/webrtc/common_types.cc#newcode151 webrtc/common_types.cc:151: if (bitrate_bps > ...
4 years, 1 month ago (2016-11-02 10:26:36 UTC) #11
sprang_webrtc
Addressed comments and rebased. https://codereview.webrtc.org/2434073003/diff/80001/webrtc/common_types.cc File webrtc/common_types.cc (right): https://codereview.webrtc.org/2434073003/diff/80001/webrtc/common_types.cc#newcode14 webrtc/common_types.cc:14: #include "webrtc/base/checks.h" On 2016/11/02 10:26:34, ...
4 years, 1 month ago (2016-11-02 13:28:34 UTC) #12
sprang_webrtc
Found an interesting race when I DCHECK'ed (rather than just return en error coder) in ...
4 years, 1 month ago (2016-11-03 09:19:28 UTC) #13
stefan-webrtc
https://codereview.webrtc.org/2434073003/diff/80001/webrtc/common_types.h File webrtc/common_types.h (right): https://codereview.webrtc.org/2434073003/diff/80001/webrtc/common_types.h#newcode661 webrtc/common_types.h:661: uint32_t get_sum_kbps() const { return (sum_ + 500) / ...
4 years, 1 month ago (2016-11-03 13:34:58 UTC) #14
sprang_webrtc
https://codereview.webrtc.org/2434073003/diff/80001/webrtc/modules/video_coding/video_sender.cc File webrtc/modules/video_coding/video_sender.cc (right): https://codereview.webrtc.org/2434073003/diff/80001/webrtc/modules/video_coding/video_sender.cc#newcode199 webrtc/modules/video_coding/video_sender.cc:199: VideoBitrateAllocator* bitrate_allocator) { On 2016/11/03 13:34:58, stefan-webrtc (holmer) wrote: ...
4 years, 1 month ago (2016-11-03 14:36:59 UTC) #15
stefan-webrtc
lgtm https://codereview.webrtc.org/2434073003/diff/80001/webrtc/modules/video_coding/video_sender.cc File webrtc/modules/video_coding/video_sender.cc (right): https://codereview.webrtc.org/2434073003/diff/80001/webrtc/modules/video_coding/video_sender.cc#newcode199 webrtc/modules/video_coding/video_sender.cc:199: VideoBitrateAllocator* bitrate_allocator) { On 2016/11/03 14:36:59, språng wrote: ...
4 years, 1 month ago (2016-11-03 15:32:08 UTC) #16
sprang_webrtc
+mflodman for webrtc/common*
4 years, 1 month ago (2016-11-07 15:55:21 UTC) #18
stefan-webrtc
https://codereview.webrtc.org/2434073003/diff/300001/webrtc/modules/video_coding/video_codec_initializer.cc File webrtc/modules/video_coding/video_codec_initializer.cc (right): https://codereview.webrtc.org/2434073003/diff/300001/webrtc/modules/video_coding/video_codec_initializer.cc#newcode77 webrtc/modules/video_coding/video_codec_initializer.cc:77: VideoCodecInitializer::GetBitrateAllocator( I think this method should be called CreateBitrateAllocator ...
4 years, 1 month ago (2016-11-09 11:58:12 UTC) #27
sprang_webrtc
https://codereview.webrtc.org/2434073003/diff/300001/webrtc/modules/video_coding/video_codec_initializer.cc File webrtc/modules/video_coding/video_codec_initializer.cc (right): https://codereview.webrtc.org/2434073003/diff/300001/webrtc/modules/video_coding/video_codec_initializer.cc#newcode77 webrtc/modules/video_coding/video_codec_initializer.cc:77: VideoCodecInitializer::GetBitrateAllocator( On 2016/11/09 11:58:12, stefan-webrtc (holmer) wrote: > I ...
4 years, 1 month ago (2016-11-09 12:26:19 UTC) #28
stefan-webrtc
https://codereview.webrtc.org/2434073003/diff/300001/webrtc/modules/video_coding/video_coding_impl.cc File webrtc/modules/video_coding/video_coding_impl.cc (right): https://codereview.webrtc.org/2434073003/diff/300001/webrtc/modules/video_coding/video_coding_impl.cc#newcode119 webrtc/modules/video_coding/video_coding_impl.cc:119: maxPayloadSize); On 2016/11/09 12:26:18, språng wrote: > On 2016/11/09 ...
4 years, 1 month ago (2016-11-09 12:40:26 UTC) #29
stefan-webrtc
lgtm after offline discussion
4 years, 1 month ago (2016-11-09 12:43:08 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2434073003/320001
4 years, 1 month ago (2016-11-09 12:44:48 UTC) #33
commit-bot: I haz the power
Committed patchset #17 (id:320001)
4 years, 1 month ago (2016-11-09 13:09:12 UTC) #34
commit-bot: I haz the power
Patchset 17 (id:??) landed as https://crrev.com/8f46c679d24a05b3f08e02c6d91ec9637f34e24f Cr-Commit-Position: refs/heads/master@{#14998}
4 years, 1 month ago (2016-11-09 13:09:17 UTC) #36
sprang_webrtc
4 years, 1 month ago (2016-11-09 14:14:29 UTC) #37
Message was sent while issue was closed.
A revert of this CL (patchset #17 id:320001) has been created in
https://codereview.webrtc.org/2489843002/ by sprang@webrtc.org.

The reason for reverting is: Breaks perf tests..

Powered by Google App Engine
This is Rietveld 408576698