microsoft / microsoft/lepton_jpeg_rust
Idea: Shrink sign_counts array to fit into a single cache line.
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 182
- Forks
- 17
- Avg merge
- 19h 46m
- Merged PRs (30d)
- 1
Description
Only part of the array is used in VP8 decoding:
- [0][0] - in 7x7 AC (1 element),
- [0][calc_sign_index(uncertainty2) + 1] - in DC (3 elements),
- [calc_sign_index(best_prior as i16)][best_prior_bit_len] - in edge AC (2 * 10 for sign_index=1,2 and best_prior_bit_len in [1,10], 1 additional for sign_index=0: [0][0] for 0 prior, and [0][10] for 0 (prior as i16) but prior != 0)
It gives 25 2-byte branches used instead of 36 in current array.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the VP8 decoding implementation and all references to sign_counts, calc_sign_index, uncertainty2, best_prior, and best_prior_bit_len. Compare the current indexing with the access patterns listed in the issue; done means the used entries remain available in a reduced array that fits one cache line without changing decoding behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100