Skip to content

Calculate the Huffman codebook without MP_QSTRs #3298

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

Merged
merged 1 commit into from
Aug 18, 2020

Conversation

ciscorn
Copy link

@ciscorn ciscorn commented Aug 18, 2020

The Huffman codebooks for the translations are currently computed with the translated texts and MP_QSTRs. However, I don't think they are actually used for QSTRs.

We can decrease the entropy a bit by calculating the codebook based only on the translation texts.

BOARD=feather_m0_express TRANSLATION=ja

(before) // 9342 bytes worth of translations compressed
↓↓↓
(after)  // 9149 bytes worth of translations compressed

BOARD=feather_m0_express

  • en: 8398 bytes → 8239 bytes
  • es: 9617 bytes → 9561 bytes
  • ko: 8815 bytes → 8651 bytes

Copy link

@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent find, thank you !

@jepler jepler merged commit 6136ca3 into adafruit:main Aug 18, 2020
@tannewt
Copy link
Member

tannewt commented Aug 18, 2020

Thank you! I intended on compressing QSTRs too but never did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants