microsoft / microsoft/lepton_jpeg_rust

Idea: Shrink sign_counts array to fit into a single cache line.

Open
#86 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.