[−][src]Function flac_sys::FLAC__stream_encoder_set_compression_level
pub unsafe extern "C" fn FLAC__stream_encoder_set_compression_level(
encoder: *mut FLAC__StreamEncoder,
value: c_uint
) -> FLAC__bool
Set the compression level
The compression level is roughly proportional to the amount of effort the encoder expends to compress the file. A higher level usually means more computation but higher compression. The default level is suitable for most applications.
Currently the levels range from \c 0 (fastest, least compression) to \c 8 (slowest, most compression). A value larger than \c 8 will be treated as \c 8.
This function automatically calls the following other \c set functions with appropriate values, so the client does not need to unless it specifically wants to override them:
- FLAC__stream_encoder_set_do_mid_side_stereo()
- FLAC__stream_encoder_set_loose_mid_side_stereo()
- FLAC__stream_encoder_set_apodization()
- FLAC__stream_encoder_set_max_lpc_order()
- FLAC__stream_encoder_set_qlp_coeff_precision()
- FLAC__stream_encoder_set_do_qlp_coeff_prec_search()
- FLAC__stream_encoder_set_do_escape_coding()
- FLAC__stream_encoder_set_do_exhaustive_model_search()
- FLAC__stream_encoder_set_min_residual_partition_order()
- FLAC__stream_encoder_set_max_residual_partition_order()
- FLAC__stream_encoder_set_rice_parameter_search_dist()
The actual values set for each level are:
level | do mid-side stereo | loose mid-side stereo | apodization | max lpc order | qlp coeff precision | qlp coeff prec search | escape coding | exhaustive model search | min residual partition order | max residual partition order | rice parameter search dist | |
0 | false | false | tukey(0.5) | 0 | 0 | false | false | false | 0 | 3 | 0 | |
1 | true | true | tukey(0.5) | 0 | 0 | false | false | false | 0 | 3 | 0 | |
2 | true | false | tukey(0.5) | 0 | 0 | false | false | false | 0 | 3 | 0 | |
3 | false | false | tukey(0.5) | 6 | 0 | false | false | false | 0 | 4 | 0 | |
4 | true | true | tukey(0.5) | 8 | 0 | false | false | false | 0 | 4 | 0 | |
5 | true | false | tukey(0.5) | 8 | 0 | false | false | false | 0 | 5 | 0 | |
6 | true | false | tukey(0.5);partial_tukey(2) | 8 | 0 | false | false | false | 0 | 6 | 0 | |
7 | true | false | tukey(0.5);partial_tukey(2) | 12 | 0 | false | false | false | 0 | 6 | 0 | |
8 | true | false | tukey(0.5);partial_tukey(2);punchout_tukey(3) | 12 | 0 | false | false | false | 0 | 6 | 0 |
\default \c 5 \param encoder An encoder instance to set. \param value See above. \assert \code encoder != NULL \endcode \retval FLAC__bool \c false if the encoder is already initialized, else \c true.