9 Commits

Author SHA1 Message Date
Philipp Hancke
acfd279a14 av1: make packetization generate more evenly sized packets
Implements a two-pass approach to packetization which creates
packets of an even size similar to RtpPacketizer::SplitAboutEqually.
This improves the bandwidth estimation.

The algorithm does a first pass with the existing packetizer, then
iterates through the resulting packet sizes and sums up the bytes left unused in each packet.
It then calculates a new maximum packet length as
  configured_max_packet_len - ((unused_bytes - packets + 1) / packets)
adjusts for the overhead and re-runs the packetization algorithm.

For example, a list of OBUs with sizes
  {1206, 1476, 1431}
currently gets packetized greedily as payload sizes
  {1200, 1200, 1200, 523}
With this change, it gets packetized as
  {1032, 1032, 1032, 1028}

This change is guarded by the field trial
  WebRTC-Video-AV1EvenPayloadSizes
which is acting as a rollout flag.

BUG=webrtc:15927

Co-authored-by: Shyam Sadhwani <shyamsadhwani@meta.com>
Change-Id: I4f0b3c27de6f06104908dd769c4dd1f34115712c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/348100
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42203}
2024-04-30 15:46:06 +00:00
Harald Alvestrand
572502c2ab Deprecate char* functions on ByteBufferReader
Bug: webrtc:15661, webrtc:15665
Change-Id: Ia35b0092c219a89b5eba08d2e1a91be6e47dc746
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/328000
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41210}
2023-11-22 11:46:25 +00:00
Danil Chapovalov
e6b3f48a06 Reland "Move leb128 helper functions into own build target"
This is a reland of commit fa962ffc698bda5bc7306ac5c3fd626eef737775

Original change's description:
> Move leb128 helper functions into own build target
>
> to remove duplicated implementation of these functions between av1 packetizer, av1 depacketizer and video allocation rtp header extension
>
> Bug: None
> Change-Id: I30049f31c289bdb9e0aad6520f5145d1f999e635
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290731
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39069}

Bug: None
Change-Id: I091276868599a6716407db2972457507ddd46a8c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290961
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39135}
2023-01-18 12:44:46 +00:00
Danil Chapovalov
6a9af57a24 Revert "Move leb128 helper functions into own build target"
This reverts commit fa962ffc698bda5bc7306ac5c3fd626eef737775.

Reason for revert: introduces use-of-uninitialized-value in rtp packet parsing

Original change's description:
> Move leb128 helper functions into own build target
>
> to remove duplicated implementation of these functions between av1 packetizer, av1 depacketizer and video allocation rtp header extension
>
> Bug: None
> Change-Id: I30049f31c289bdb9e0aad6520f5145d1f999e635
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290731
> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Philip Eliasson <philipel@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39069}

Bug: chromium:1407045
Change-Id: I6b04b567e698db7ddcf1e91161075aeaa0c5988c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290960
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39099}
2023-01-13 11:04:42 +00:00
Danil Chapovalov
fa962ffc69 Move leb128 helper functions into own build target
to remove duplicated implementation of these functions between av1 packetizer, av1 depacketizer and video allocation rtp header extension

Bug: None
Change-Id: I30049f31c289bdb9e0aad6520f5145d1f999e635
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290731
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39069}
2023-01-11 11:55:11 +00:00
Byoungchan Lee
8c725f368c Fix several UBsan issues with memcpy
Most of the changes are trivial.

Bug: webrtc:14432
Change-Id: I0444527bf57c72c8d65f69754b4a4a1c1d7b2e92
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275340
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Victor Boivie <boivie@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38074}
2022-09-14 09:35:39 +00:00
Artem Titov
913cfa76ec Use backticks not vertical bars to denote variables in comments for /modules/rtp_rtcp
Bug: webrtc:12338
Change-Id: I52eb3b6675c4705e22f51b70799ed6139a3b46bc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227164
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34686}
2021-08-09 15:51:03 +00:00
Danil Chapovalov
62a9a32937 In Av1 packetizer set marker bit with respect of end_of_picture flag
Bug: webrtc:12167
Change-Id: If14fdd7144951c7aa7e48efd390637dd66201bf7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/192791
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32612}
2020-11-16 11:08:48 +00:00
Danil Chapovalov
096a46f38f Implement AV1 RtpPacketizer class
Bug: webrtc:11042
Change-Id: Id1fc0acfa87a4520344f2636f50cb4d4e7284829
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160416
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29947}
2019-11-28 14:39:02 +00:00