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

Issue 2630333002: Drop frames until specified bitrate is achieved. (Closed)

Created:
3 years, 11 months ago by kthelgason
Modified:
3 years, 10 months ago
CC:
webrtc-reviews_webrtc.org, video-team_agora.io, yujie_mao (webrtc), zhengzhonghou_agora.io, stefan-webrtc, tterriberry_mozilla.com, the sun, mflodman, magjed_webrtc
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

Drop frames until specified bitrate is achieved. This CL fixes a regression introduced with the new quality scaler where the video would no longer start in a scaled mode. This CL adds code that compares incoming captured frames to the target bitrate, and if they are found to be too large, they are dropped and sinkWants set to a lower resolution. The number of dropped frames should be low (0-4 in most cases) and should not introduce a noticeable delay, or at least should be preferrable to having the first 2-4 seconds of video have very low quality. BUG=webrtc:6953 Review-Url: https://codereview.webrtc.org/2630333002 Cr-Commit-Position: refs/heads/master@{#16391} Committed: https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f

Patch Set 1 #

Patch Set 2 : keep initial start bitrate at 0 #

Total comments: 5

Patch Set 3 : Initialize |initial_rampup_| in ctor #

Total comments: 14

Patch Set 4 : Add more thorough tests and limit max framedrops. #

Patch Set 5 : cleanup #

Patch Set 6 : unsign things #

Patch Set 7 : rebase #

Total comments: 19

Patch Set 8 : code review #

Total comments: 9

Patch Set 9 : Only drop frames at beginning of call #

Total comments: 14

Patch Set 10 : configure quality scaler also on SetSource #

Patch Set 11 : Disable scaling in unit tests #

Patch Set 12 #

Patch Set 13 : Turn off quality scaling for screensharing in tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+169 lines, -43 lines) Patch
M webrtc/api/video/video_frame.h View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M webrtc/api/video/video_frame.cc View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M webrtc/media/engine/webrtcvideoengine2_unittest.cc View 1 2 3 4 5 6 7 8 9 10 15 chunks +24 lines, -17 lines 0 comments Download
M webrtc/modules/video_coding/utility/default_video_bitrate_allocator.cc View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M webrtc/video/video_quality_test.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M webrtc/video/video_quality_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +16 lines, -11 lines 0 comments Download
M webrtc/video/vie_encoder.h View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -0 lines 0 comments Download
M webrtc/video/vie_encoder.cc View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +36 lines, -4 lines 0 comments Download
M webrtc/video/vie_encoder_unittest.cc View 1 2 3 4 5 6 7 10 chunks +81 lines, -9 lines 0 comments Download

Messages

Total messages: 67 (45 generated)
kthelgason
PTAL.
3 years, 11 months ago (2017-01-16 13:03:02 UTC) #8
sprang_webrtc
https://codereview.webrtc.org/2630333002/diff/20001/webrtc/video/vie_encoder.h File webrtc/video/vie_encoder.h (right): https://codereview.webrtc.org/2630333002/diff/20001/webrtc/video/vie_encoder.h#newcode120 webrtc/video/vie_encoder.h:120: bool initial_rampup_ = false; Please initialize in ctor instead. ...
3 years, 11 months ago (2017-01-16 13:45:23 UTC) #9
kthelgason
https://codereview.webrtc.org/2630333002/diff/20001/webrtc/video/vie_encoder.h File webrtc/video/vie_encoder.h (right): https://codereview.webrtc.org/2630333002/diff/20001/webrtc/video/vie_encoder.h#newcode120 webrtc/video/vie_encoder.h:120: bool initial_rampup_ = false; On 2017/01/16 13:45:23, språng wrote: ...
3 years, 11 months ago (2017-01-16 14:08:45 UTC) #10
sprang_webrtc
lgtm, given that you verify that this won't cause any bot flakiness https://codereview.webrtc.org/2630333002/diff/20001/webrtc/video/vie_encoder_unittest.cc File webrtc/video/vie_encoder_unittest.cc ...
3 years, 11 months ago (2017-01-16 16:48:35 UTC) #11
perkj_webrtc
https://codereview.webrtc.org/2630333002/diff/40001/webrtc/api/video/video_frame.h File webrtc/api/video/video_frame.h (right): https://codereview.webrtc.org/2630333002/diff/40001/webrtc/api/video/video_frame.h#newcode53 webrtc/api/video/video_frame.h:53: // Get frame size in pixels. nit: empty line ...
3 years, 11 months ago (2017-01-17 08:53:10 UTC) #12
perkj_webrtc
https://codereview.webrtc.org/2630333002/diff/40001/webrtc/video/vie_encoder.cc File webrtc/video/vie_encoder.cc (right): https://codereview.webrtc.org/2630333002/diff/40001/webrtc/video/vie_encoder.cc#newcode577 webrtc/video/vie_encoder.cc:577: int expected_pixel_count = oh, we should probably do this ...
3 years, 11 months ago (2017-01-17 10:30:02 UTC) #13
kthelgason
https://codereview.webrtc.org/2630333002/diff/40001/webrtc/api/video/video_frame.h File webrtc/api/video/video_frame.h (right): https://codereview.webrtc.org/2630333002/diff/40001/webrtc/api/video/video_frame.h#newcode53 webrtc/api/video/video_frame.h:53: // Get frame size in pixels. On 2017/01/17 08:53:10, ...
3 years, 11 months ago (2017-01-18 09:16:16 UTC) #14
kthelgason
https://codereview.webrtc.org/2630333002/diff/120001/webrtc/modules/video_coding/utility/default_video_bitrate_allocator.cc File webrtc/modules/video_coding/utility/default_video_bitrate_allocator.cc (left): https://codereview.webrtc.org/2630333002/diff/120001/webrtc/modules/video_coding/utility/default_video_bitrate_allocator.cc#oldcode38 webrtc/modules/video_coding/utility/default_video_bitrate_allocator.cc:38: This snuck in by accident, sorry about that.
3 years, 11 months ago (2017-01-18 12:20:22 UTC) #21
perkj_webrtc
Tests looks much better. I wonder if you should talk to stefan about this as ...
3 years, 11 months ago (2017-01-23 08:54:22 UTC) #24
kthelgason
Thanks for the review perkj. Can you take another look? I changed it to work ...
3 years, 11 months ago (2017-01-23 12:39:06 UTC) #26
perkj_webrtc
I think you should add a test for the behavior you wanted that frames are ...
3 years, 11 months ago (2017-01-24 09:06:16 UTC) #29
kthelgason
The main change in this patchset is that we don't reset |initial_rampup_| on encoder reconfiguration. ...
3 years, 11 months ago (2017-01-24 10:53:10 UTC) #32
perkj_webrtc
https://codereview.webrtc.org/2630333002/diff/180001/webrtc/video/vie_encoder.cc File webrtc/video/vie_encoder.cc (right): https://codereview.webrtc.org/2630333002/diff/180001/webrtc/video/vie_encoder.cc#newcode358 webrtc/video/vie_encoder.cc:358: scaling_enabled_ = (degradation_preference != Changing the source change scaling_enabled_ ...
3 years, 10 months ago (2017-01-24 12:58:23 UTC) #37
kthelgason
I tried moving the initialization of the quality scaler in to ViEEncoder::SetSource but that won't ...
3 years, 10 months ago (2017-01-25 10:01:58 UTC) #42
kthelgason
I tried moving the initialization of the quality scaler in to ViEEncoder::SetSource but that won't ...
3 years, 10 months ago (2017-01-25 10:02:01 UTC) #43
perkj_webrtc
looks good to me but you need to fix the failing tests. Note that you ...
3 years, 10 months ago (2017-01-25 10:26:22 UTC) #49
kthelgason
Please take a look. I have not moved anything into the quality scaler, as when ...
3 years, 10 months ago (2017-01-26 13:08:32 UTC) #58
kthelgason
Ping stefan, perkj
3 years, 10 months ago (2017-01-30 09:18:14 UTC) #59
perkj_webrtc
lgtm
3 years, 10 months ago (2017-01-30 12:03:34 UTC) #60
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/2630333002/240001
3 years, 10 months ago (2017-02-01 08:51:02 UTC) #63
commit-bot: I haz the power
Committed patchset #12 (id:240001) as https://chromium.googlesource.com/external/webrtc/+/83399caec5762d2dad038b8e9d86163e92c18c9f
3 years, 10 months ago (2017-02-01 09:31:58 UTC) #66
minyue-webrtc
3 years, 10 months ago (2017-02-01 11:13:03 UTC) #67
Message was sent while issue was closed.
A revert of this CL (patchset #12 id:240001) has been created in
https://codereview.webrtc.org/2666303002/ by minyue@webrtc.org.

The reason for reverting is: due to failures on perf tests (not on perf stats,
but fails running due to dcheck failures), see e.g.,
https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20....

Powered by Google App Engine
This is Rietveld 408576698