Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bandwidth estimator improvements #226

Closed
wants to merge 9 commits into from
Closed

Bandwidth estimator improvements #226

wants to merge 9 commits into from

Conversation

alexpokotilo
Copy link

Description

calculate fmax for Kalman filter as stated in standard.
Kalman filter stats returning sensitive estimate and we don't need to multiply it with 60.
Kalman gain should not fall lower than minimal value or filter become very insensitive to z(i).
Set Kalman chi to chi to make it more sensitive to input and react faster.
Fix exponentialMovingAverage variance calculation for rate controller.
Reset latestDecreaseRate for rate controller as standard states.
Reset latestDecreaseRate if last decrease was more than a minute ago. In this case latestDecreaseRate in inaccurate in anyway.
Merge #221 to prevent bandwidth decrease in increase state in last decrease was recently.
Removed not used 'type estimatorFunc'

There are not fixed tests exists. If my work appreciated and tend to be accepted I will fix all tests as well. I need to know whether anybody want to review these changes.
Right now I was able to fix everything I was able to find.
@mengelbart, @Sean-Der please take a look or point me to somebody I can review this work.
I spend several weeks trying to understand and fix this BWE. I'm not sure I understand everything but enough to pay attention to this effort. Please let me know if gcc in Pion is important, supported component

Reference issue

Fixes #...

This was referenced Jan 25, 2024
mengelbart and others added 9 commits January 26, 2024 16:56
When the controller decides to increase the rate, it should not
decrease, even if the measured transmission rate was low. The rate could
be lower because there was not enough data to send.
Variance calculation for exponentialMovingAverage was incorrect
Reset exponentialMovingAverage if last decrease was 1 minute ago or
If R_hat(i) increases above three standard deviations of the average
max bitrate
Standard says we need to use either 3*sqrt(var_v_hat) or z(i)
[1] https://c3lab.poliba.it/images/6/65/Gcc-analysis.pdf
[2] https://datatracker.ietf.org/doc/html/draft-ietf-rmcat-gcc-02
Now alpha is almost 1, since (1−0,001)^(30÷(1000×5×1000000)) == 1
And this makes var_v_hat(i) always have initial value and k.gain
to be a constant after convergence and hence current version of
Kalman filter works as exponential moving average with A ~= 0.3.
To make it more Kalman we need to calculate var_v_hat(i) corretly.
Maybe we need to calculate alpha in different way, but not just
set it to 1 for sure.
See [1] and [2](section 5.3. Arrival-time filter) for more details
I was not able to find a reason why current implementation multiplied
output from Kalman filter to up to 60.
Standard states fmax should highest bitrate among K packets.
I set K to 10 and use interarrival delta from slope filter as
T(i)-T(i-1)
This these params Kalmain gain recovered from bandwidth decreases
faster that with lower chi.
Set Kcount to track longer frames queue to calculate fmax
Golint and test cases fixed according to new filter values
@alexpokotilo
Copy link
Author

Fixed tests and golint checks

@alexpokotilo
Copy link
Author

@mengelbart, @Sean-Der tests are fixed. Could you please re-run tests to start review ?

@alexpokotilo alexpokotilo closed this by deleting the head repository Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants