Skip to content
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

Use LUT for linear to sRGB conversion #18

Merged
merged 1 commit into from
Jul 23, 2024

Commits on Jul 22, 2024

  1. Use LUT for linear to sRGB conversion

    Using a LUT for the linear to sRGB conversion improves decoding
    performance for the decode_into benchmark:
    
    ```
    decode_into LGF5]+Yk^6#M@-5c,1J5@[or[Q6./200
        time:   [766.58 µs 769.86 µs 776.05 µs]
        change: [-62.967% -62.784% -62.602%] (p = 0.00 < 0.05)
        Performance has improved.
    ```
    
    However, the size of the LUT is 8.192 u8. The `fast-linear-to-srgb`
    feature flag was added, which is enabled by default. In cases where
    binary size is more important than performance, the feature can be
    disabled.
    
    Another note in the implementation: using a lookup table reduces the
    accuracy of the conversion, compared to the original implementation.
    But all current tests pass. Higher accuracy can be achieved by
    increasing the LUT size.
    thvdveld committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    0997060 View commit details
    Browse the repository at this point in the history