Conversation
| .all(|s| s.decode_timestamp == s.presentation_timestamp); | ||
|
|
||
| let mut biggest_pts_so_far = Time::MIN; | ||
| let has_sample_highest_pts_so_far = samples |
There was a problem hiding this comment.
I'm also a bit worried about how many times we're iterating over the samples here. I don't think LLVM will optimize this to one loop.
There was a problem hiding this comment.
tbh I'm not sure if it's better to combine everything to a single loop or to loop several times: individual loops might vectorize better
pure speculation until someone actually measures. Maybe I should. After all we might run this with a lot of samples!
There was a problem hiding this comment.
It optimizes a lot better than I thought: https://godbolt.org/z/n3Yvzff9e
There was a problem hiding this comment.
neither is in the mood for simd though. probably because everything is 64bit integer
There was a problem hiding this comment.
leaving it be as is for now
jprochazk
left a comment
There was a problem hiding this comment.
Other than nits above this LGTM
|
known issue on |
What
Our PTS -> sample search algorithm wasn't quite right. Fixed this here and added a unit test.
Unfortunately, I had to introduce a small auxiliary data structure to keep this snappy / not O(n) for n samples, but it's very simple and rather contained.
Tested on native & web. Web still suffers from
but on Chrome this works fine now!
Screen.Recording.2024-11-08.at.16.55.06.mov
Checklist
mainbuild: rerun.io/viewernightlybuild: rerun.io/viewerCHANGELOG.mdand the migration guideTo run all checks from
main, comment on the PR with@rerun-bot full-check.