Lines Matching defs:options
422 is_options_valid(const lzma_options_lzma *options)
424 // Validate some of the options. LZ encoder validates nice_len too
426 return is_lclppb_valid(options)
427 && options->nice_len >= MATCH_LEN_MIN
428 && options->nice_len <= MATCH_LEN_MAX
429 && (options->mode == LZMA_MODE_FAST
430 || options->mode == LZMA_MODE_NORMAL);
435 set_lz_options(lzma_lz_options *lz_options, const lzma_options_lzma *options)
440 lz_options->dict_size = options->dict_size;
443 lz_options->nice_len = options->nice_len;
444 lz_options->match_finder = options->mf;
445 lz_options->depth = options->depth;
446 lz_options->preset_dict = options->preset_dict;
447 lz_options->preset_dict_size = options->preset_dict_size;
476 lzma_lzma_encoder_reset(lzma_coder *coder, const lzma_options_lzma *options)
478 if (!is_options_valid(options))
481 coder->pos_mask = (1U << options->pb) - 1;
482 coder->literal_context_bits = options->lc;
483 coder->literal_pos_mask = (1U << options->lp) - 1;
493 literal_init(coder->literal, options->lc, options->lp);
519 1U << options->pb, coder->fast_mode);
522 1U << options->pb, coder->fast_mode);
549 const lzma_options_lzma *options, lzma_lz_options *lz_options)
560 // Set compression mode. We haven't validates the options yet,
562 // options in the code below, and they will get rejected by
564 switch (options->mode) {
575 while ((UINT32_C(1) << log_size) < options->dict_size)
582 = options->nice_len + 1 - MATCH_LEN_MIN;
584 = options->nice_len + 1 - MATCH_LEN_MIN;
596 coder->is_initialized = options->preset_dict != NULL
597 && options->preset_dict_size > 0;
600 set_lz_options(lz_options, options);
602 return lzma_lzma_encoder_reset(coder, options);
608 const void *options, lzma_lz_options *lz_options)
612 &lz->coder, allocator, options, lz_options);
626 lzma_lzma_encoder_memusage(const void *options)
628 if (!is_options_valid(options))
632 set_lz_options(&lz_options, options);
643 lzma_lzma_lclppb_encode(const lzma_options_lzma *options, uint8_t *byte)
645 if (!is_lclppb_valid(options))
648 *byte = (options->pb * 5 + options->lp) * 9 + options->lc;
657 lzma_lzma_props_encode(const void *options, uint8_t *out)
659 const lzma_options_lzma *const opt = options;