mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
[PR #226] [CLOSED] Binary search in Log2Floor #815
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/google/brotli/pull/226
Author: @Nicoshev11
Created: 10/13/2015
Status: ❌ Closed
Base:
master← Head:master📝 Commits (1)
5e59adf[decode.c] use binary search in Log2Floor📊 Changes
1 file changed (+25 additions, -1 deletions)
View changed files
📝
dec/decode.c(+25 -1)📄 Description
[decode.c] use binary search in Log2Floor
Log2Floor implementation uses lineal search to find the floor of the log2, doing a binary search is slightly faster.
Because Log2Floor is only called from ReadHuffmanCode and the parameter passed is always less than 1024, l16_Log2Floor does a binary search in the lower 16 bits of the number, thus, in only 3 loops it gets the result
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.