Expose Brotli quality parameter #29

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
@bramstein

This adds the Brotli quality parameter (for controlling speed/compression) to the ConvertTTFToWOFF2 method. The existing ConvertTTFToWOFF2 method signature is preserved so any library depending on the method signature will continue to compile (and use the default quality settings). At Typekit we use this to generate WOFF2 files on the fly (where the default quality settings are to slow to be usable).

If there is interest, I can do another pull request that adds this as a command line option.

Expose Brotli quality parameter
This adds the Brotli quality parameter (for controlling speed/compression) to
the `ConvertTTFToWOFF2` method. The existing `ConvertTTFToWOFF2` method
signature is preserved so any library depending on the signature will
continue to compile (and use the default quality settings).
@kennethormandy

This comment has been minimized.

Show comment
Hide comment
@kennethormandy

kennethormandy Jul 11, 2015

I would use the CLI option! Thanks for working on this too, Bram, you are awesome. 🍰

I would use the CLI option! Thanks for working on this too, Bram, you are awesome. 🍰

@rsheeter

This comment has been minimized.

Show comment
Hide comment
@rsheeter

rsheeter Jul 13, 2015

Contributor

Thanks @bramstein. In the next update from the internal copy (coming today hopefully) we'll be moving to:

struct WOFF2Params {
  WOFF2Params() : extended_metadata(""), brotli_quality(11) {}

  string extended_metadata;
  int brotli_quality;
};

 bool ConvertTTFToWOFF2(const uint8_t *data, size_t length,
                        uint8_t *result, size_t *result_length,
                       const WOFF2Params& params);

I think that fulfills the need to use alternate quality for online conversion (we use 8 for online IIRC), albeit slightly differently than this PR.

Will that work for you?

Contributor

rsheeter commented Jul 13, 2015

Thanks @bramstein. In the next update from the internal copy (coming today hopefully) we'll be moving to:

struct WOFF2Params {
  WOFF2Params() : extended_metadata(""), brotli_quality(11) {}

  string extended_metadata;
  int brotli_quality;
};

 bool ConvertTTFToWOFF2(const uint8_t *data, size_t length,
                        uint8_t *result, size_t *result_length,
                       const WOFF2Params& params);

I think that fulfills the need to use alternate quality for online conversion (we use 8 for online IIRC), albeit slightly differently than this PR.

Will that work for you?

@rsheeter

This comment has been minimized.

Show comment
Hide comment
@rsheeter

rsheeter Jul 13, 2015

Contributor

I have now pushed ea4c87a, which adds some branch prediction improvements the compression team has been working on and provides for setting quality. Closing this for now but please reopen if this doesn't work for you.

Contributor

rsheeter commented Jul 13, 2015

I have now pushed ea4c87a, which adds some branch prediction improvements the compression team has been working on and provides for setting quality. Closing this for now but please reopen if this doesn't work for you.

@rsheeter rsheeter closed this Jul 13, 2015

@bramstein

This comment has been minimized.

Show comment
Hide comment
@bramstein

bramstein Jul 13, 2015

@rsheeter That's perfect. Looking forward to the performance improvements. I've settled on quality 5 before them, hope to get up to 8 for online as well. Thanks!

@rsheeter That's perfect. Looking forward to the performance improvements. I've settled on quality 5 before them, hope to get up to 8 for online as well. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment