-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
SwitchHistoryRule limits quality incorrectly #2115
Comments
Related to #1892. |
I'm not sure the issue is with the loop order. If I understood the code correctly, the SwitchRequestsRule behaviour is described by the following pseudocode:
Note that the rule only considers segment order when figuring out if a quality change is a drop, otherwise the segment order within the last eight segment download does not matter. In your example My suggestion is that if we used extra segments at some level (4 in the example) to satisfy condition b, then that should be the highest allowed level rather than the forbidden level. I think that can be achieved by changing one line: |
issue #2115 - do not disallow quality that did not cause drop
please can any one explain to me the SwitchHistoryRule ,please i didn't undrestrand it and i need it |
SwitchRequestHistory stores switch history for the last SWITCH_REQUEST_HISTORY_DEPTH=8 switchRequests. If a switchRequest changes the quality from oldValue to newValue such that newValue is a lower quality than oldValue, then it counts as a drop. Otherwise it counts as a noDrop. switchRequests[i] contains a sum of the drop and noDrop counts for each swithRequest in the last 8 for which oldValue was i. SwitchHistoryRule starts from the lowest quality 0 counting up. Let us say we are counting up and reached quality 2. If there are at least SAMPLE_SIZE=6 samples for oldValues between 0 and 2 inclusive, and drop/noDrop > 0.075 for those 6+ samples, then SwitchHistoryRule returns a maximum quality of 2-1 = 1. The point is to avoid downloading at quality 2 because recent history suggests it is likely to have to drop back to quality 1 or 0 causing excessive switches. Note that since the history depth is 8, just 1 drop is sufficient to block a quality because drop/noDrop is always going to be larger than 0.075 if drop is 1. However, recall that this is always subject to having a minimum of 6 samples. |
SWITCH_REQUEST_HISTORY_DEPTH=8 |
The check
drops + noDrops >= SAMPLE_SIZE
is placed incorrectly.If quality starts at level 1, drops to lvl 0 and then rises to lvl 4 and stays there, quality will sometimes we limited to lvl 3, which makes no sense.
In the for loop there is in this order:
The text was updated successfully, but these errors were encountered: