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

Issue 1979443004: Add H264 bitstream rewriting to limit frame reordering marker in header (Closed)

Created:
4 years, 7 months ago by sprang_webrtc
Modified:
4 years, 6 months ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, zhuangzesen_agora.io, danilchap, stefan-webrtc, mflodman, pbos-webrtc
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Add H264 bitstream rewriting to limit frame reordering marker in header The VUI part an SPS may specify max_num_reorder_frames and max_dec_frame_buffering. These may cause a decoder to buffer a number of frame prior allowing decode, leading to delays, even if no frames using such references (ie B-frames) are sent. Because of this we update any SPS block emitted by the encoder. Also, a bunch of refactoring of H264-related code to reduce code duplication. BUG= Committed: https://crrev.com/52033d6ea119223179cc0813f95ff31a21c3ac72 Cr-Commit-Position: refs/heads/master@{#13010}

Patch Set 1 #

Patch Set 2 : Incorrect nal offset used #

Patch Set 3 : Android fix #

Patch Set 4 : Proper android fix #

Patch Set 5 : Rewriting on the receiver side as well #

Total comments: 31

Patch Set 6 : Too many changes to list! #

Patch Set 7 : Fixed compiler warning on win #

Total comments: 39

Patch Set 8 : Addressed comments #

Patch Set 9 : Extended test, histograms #

Patch Set 10 : Added tests, fixed memory ownership issue #

Total comments: 9

Patch Set 11 : Rebase and move to common_video #

Patch Set 12 : Addressed comments #

Patch Set 13 : Fixed Android include conflict #

Patch Set 14 : GN #

Total comments: 3

Patch Set 15 : Comments #

Total comments: 10

Patch Set 16 : Addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2088 lines, -1179 lines) Patch
M webrtc/base/bitbuffer.h View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M webrtc/base/bitbuffer.cc View 1 2 3 4 5 6 7 8 1 chunk +14 lines, -0 lines 0 comments Download
M webrtc/base/buffer.h View 1 2 3 4 5 1 chunk +7 lines, -0 lines 0 comments Download
M webrtc/common_video/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 1 chunk +8 lines, -0 lines 0 comments Download
M webrtc/common_video/common_video.gyp View 1 2 3 4 5 6 7 8 9 10 1 chunk +8 lines, -0 lines 0 comments Download
M webrtc/common_video/common_video_unittests.gyp View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
A webrtc/common_video/h264/h264_common.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +89 lines, -0 lines 0 comments Download
A webrtc/common_video/h264/h264_common.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +106 lines, -0 lines 0 comments Download
A webrtc/common_video/h264/pps_parser.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +49 lines, -0 lines 0 comments Download
A webrtc/common_video/h264/pps_parser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +148 lines, -0 lines 0 comments Download
A webrtc/common_video/h264/pps_parser_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +201 lines, -0 lines 0 comments Download
A webrtc/common_video/h264/sps_parser.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +53 lines, -0 lines 0 comments Download
A + webrtc/common_video/h264/sps_parser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +81 lines, -94 lines 0 comments Download
A + webrtc/common_video/h264/sps_parser_unittest.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +45 lines, -48 lines 0 comments Download
A webrtc/common_video/h264/sps_vui_rewriter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +54 lines, -0 lines 0 comments Download
A webrtc/common_video/h264/sps_vui_rewriter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +359 lines, -0 lines 0 comments Download
A webrtc/common_video/h264/sps_vui_rewriter_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +195 lines, -0 lines 0 comments Download
M webrtc/modules/modules.gyp View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -1 line 0 comments Download
M webrtc/modules/rtp_rtcp/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +1 line, -2 lines 0 comments Download
M webrtc/modules/rtp_rtcp/rtp_rtcp.gypi View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -3 lines 0 comments Download
D webrtc/modules/rtp_rtcp/source/h264_sps_parser.h View 1 chunk +0 lines, -37 lines 0 comments Download
D webrtc/modules/rtp_rtcp/source/h264_sps_parser.cc View 1 chunk +0 lines, -232 lines 0 comments Download
D webrtc/modules/rtp_rtcp/source/h264_sps_parser_unittest.cc View 1 chunk +0 lines, -173 lines 0 comments Download
M webrtc/modules/rtp_rtcp/source/rtp_format.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -0 lines 0 comments Download
M webrtc/modules/rtp_rtcp/source/rtp_format_h264.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +42 lines, -21 lines 0 comments Download
M webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +340 lines, -189 lines 0 comments Download
M webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +195 lines, -6 lines 0 comments Download
M webrtc/modules/video_coding/utility/h264_bitstream_parser.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +12 lines, -33 lines 0 comments Download
M webrtc/modules/video_coding/utility/h264_bitstream_parser.cc View 1 2 3 4 5 6 7 8 9 10 7 chunks +68 lines, -340 lines 0 comments Download

Messages

Total messages: 31 (7 generated)
sprang_webrtc
Please take an initial look. I've more tests and stats in the pipeline.
4 years, 7 months ago (2016-05-16 12:44:03 UTC) #2
sprang_webrtc
Noah, Peter tells me you looove h264. Do you wanna have a look? :)
4 years, 7 months ago (2016-05-17 13:06:59 UTC) #4
noahric
I don't think you can do this only on the encoder, because you can't guarantee ...
4 years, 7 months ago (2016-05-18 01:35:07 UTC) #5
sprang_webrtc
Changed a lot of parsing methods to statics, and number of bug fixes and improvements. ...
4 years, 7 months ago (2016-05-20 16:11:00 UTC) #7
stefan-webrtc
https://codereview.webrtc.org/1979443004/diff/110001/webrtc/modules/rtp_rtcp/source/h264/h264_common.h File webrtc/modules/rtp_rtcp/source/h264/h264_common.h (right): https://codereview.webrtc.org/1979443004/diff/110001/webrtc/modules/rtp_rtcp/source/h264/h264_common.h#newcode22 webrtc/modules/rtp_rtcp/source/h264/h264_common.h:22: class H264Common { Should this be a namespace instead, ...
4 years, 7 months ago (2016-05-22 23:11:50 UTC) #8
sprang_webrtc
https://codereview.webrtc.org/1979443004/diff/110001/webrtc/modules/rtp_rtcp/source/h264/h264_common.h File webrtc/modules/rtp_rtcp/source/h264/h264_common.h (right): https://codereview.webrtc.org/1979443004/diff/110001/webrtc/modules/rtp_rtcp/source/h264/h264_common.h#newcode22 webrtc/modules/rtp_rtcp/source/h264/h264_common.h:22: class H264Common { On 2016/05/22 23:11:50, stefan-webrtc (holmer) wrote: ...
4 years, 7 months ago (2016-05-25 09:06:03 UTC) #9
sprang_webrtc
Ping? I'd really like to get this landed before EOW...
4 years, 7 months ago (2016-05-26 15:07:48 UTC) #10
stefan-webrtc
https://codereview.webrtc.org/1979443004/diff/110001/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc File webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc (right): https://codereview.webrtc.org/1979443004/diff/110001/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc#newcode118 webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc:118: output_buffer->AppendData((*rbsp_buffer)[0]); Was this wrong? Covered by a test? https://codereview.webrtc.org/1979443004/diff/110001/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc#newcode160 ...
4 years, 7 months ago (2016-05-26 18:08:13 UTC) #11
noahric
https://codereview.webrtc.org/1979443004/diff/70001/webrtc/modules/rtp_rtcp/source/h264/h264_common.cc File webrtc/modules/rtp_rtcp/source/h264/h264_common.cc (right): https://codereview.webrtc.org/1979443004/diff/70001/webrtc/modules/rtp_rtcp/source/h264/h264_common.cc#newcode80 webrtc/modules/rtp_rtcp/source/h264/h264_common.cc:80: while (length > 0 && bytes[length - 1] == ...
4 years, 7 months ago (2016-05-26 18:56:52 UTC) #12
sprang_webrtc
https://codereview.webrtc.org/1979443004/diff/110001/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc File webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc (right): https://codereview.webrtc.org/1979443004/diff/110001/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc#newcode118 webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc:118: output_buffer->AppendData((*rbsp_buffer)[0]); On 2016/05/26 18:08:13, stefan-webrtc (holmer) wrote: > Was ...
4 years, 6 months ago (2016-05-27 13:12:22 UTC) #13
stefan-webrtc
https://codereview.webrtc.org/1979443004/diff/110001/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc File webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc (right): https://codereview.webrtc.org/1979443004/diff/110001/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc#newcode112 webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc:112: // decoding. On 2016/05/25 09:06:03, språng wrote: > On ...
4 years, 6 months ago (2016-05-27 20:57:00 UTC) #14
sprang_webrtc
https://codereview.webrtc.org/1979443004/diff/110001/webrtc/modules/rtp_rtcp/source/rtp_format_h264.h File webrtc/modules/rtp_rtcp/source/rtp_format_h264.h (right): https://codereview.webrtc.org/1979443004/diff/110001/webrtc/modules/rtp_rtcp/source/rtp_format_h264.h#newcode121 webrtc/modules/rtp_rtcp/source/rtp_format_h264.h:121: std::unique_ptr<rtc::Buffer> modified_buffer_; On 2016/05/27 20:56:59, stefan-webrtc (holmer) wrote: > ...
4 years, 6 months ago (2016-05-30 08:57:23 UTC) #15
stefan-webrtc
https://codereview.webrtc.org/1979443004/diff/110001/webrtc/modules/rtp_rtcp/source/rtp_format_h264.h File webrtc/modules/rtp_rtcp/source/rtp_format_h264.h (right): https://codereview.webrtc.org/1979443004/diff/110001/webrtc/modules/rtp_rtcp/source/rtp_format_h264.h#newcode121 webrtc/modules/rtp_rtcp/source/rtp_format_h264.h:121: std::unique_ptr<rtc::Buffer> modified_buffer_; On 2016/05/30 08:57:23, språng wrote: > On ...
4 years, 6 months ago (2016-05-30 11:00:55 UTC) #16
sprang_webrtc
https://codereview.webrtc.org/1979443004/diff/110001/webrtc/modules/rtp_rtcp/source/rtp_format_h264.h File webrtc/modules/rtp_rtcp/source/rtp_format_h264.h (right): https://codereview.webrtc.org/1979443004/diff/110001/webrtc/modules/rtp_rtcp/source/rtp_format_h264.h#newcode121 webrtc/modules/rtp_rtcp/source/rtp_format_h264.h:121: std::unique_ptr<rtc::Buffer> modified_buffer_; On 2016/05/30 11:00:55, stefan-webrtc (holmer) wrote: > ...
4 years, 6 months ago (2016-05-30 12:39:30 UTC) #17
danilchap
https://codereview.webrtc.org/1979443004/diff/110001/webrtc/modules/rtp_rtcp/source/rtp_format_h264.h File webrtc/modules/rtp_rtcp/source/rtp_format_h264.h (right): https://codereview.webrtc.org/1979443004/diff/110001/webrtc/modules/rtp_rtcp/source/rtp_format_h264.h#newcode121 webrtc/modules/rtp_rtcp/source/rtp_format_h264.h:121: std::unique_ptr<rtc::Buffer> modified_buffer_; On 2016/05/30 12:39:30, språng wrote: > On ...
4 years, 6 months ago (2016-05-30 12:55:59 UTC) #18
stefan-webrtc
lgtm after offline discussion.
4 years, 6 months ago (2016-05-30 12:56:35 UTC) #19
sprang_webrtc
+mflodman for webrtc/base
4 years, 6 months ago (2016-05-30 13:20:58 UTC) #21
mflodman
webrtc/base LGTM
4 years, 6 months ago (2016-05-31 07:52:44 UTC) #22
sprang_webrtc
Ping, Noah?
4 years, 6 months ago (2016-05-31 20:24:59 UTC) #23
noahric
LGTM % some little comments. https://codereview.webrtc.org/1979443004/diff/250001/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc File webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc (right): https://codereview.webrtc.org/1979443004/diff/250001/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc#newcode121 webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc:121: output_buffer->AppendData(buffer[0]); Ah, I see. ...
4 years, 6 months ago (2016-06-01 17:56:43 UTC) #24
sprang_webrtc
https://codereview.webrtc.org/1979443004/diff/270001/webrtc/common_video/h264/h264_common.cc File webrtc/common_video/h264/h264_common.cc (right): https://codereview.webrtc.org/1979443004/diff/270001/webrtc/common_video/h264/h264_common.cc#newcode86 webrtc/common_video/h264/h264_common.cc:86: // Writes bytes into RBSP, adding emulation (0x03) bytes ...
4 years, 6 months ago (2016-06-02 08:53:15 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1979443004/290001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1979443004/290001
4 years, 6 months ago (2016-06-02 09:41:31 UTC) #28
commit-bot: I haz the power
Committed patchset #16 (id:290001)
4 years, 6 months ago (2016-06-02 09:43:36 UTC) #29
commit-bot: I haz the power
4 years, 6 months ago (2016-06-02 09:43:48 UTC) #31
Message was sent while issue was closed.
Patchset 16 (id:??) landed as
https://crrev.com/52033d6ea119223179cc0813f95ff31a21c3ac72
Cr-Commit-Position: refs/heads/master@{#13010}

Powered by Google App Engine
This is Rietveld 408576698