summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2014-10-15 06:47:39 +1100
committerErik de Castro Lopo <erikd@mega-nerd.com>2014-10-16 08:25:33 +1100
commite0fbe7193569badcbcd72f33fd39e9e31b55ecf0 (patch)
tree66b8217eff352cc03018d2b9669d46189a697879
parentd2de3a1a19703fba8e1372224eb7c9b75ba89759 (diff)
downloadflac-e0fbe7193569badcbcd72f33fd39e9e31b55ecf0.tar.gz
stream_encoder.c : Add apodization field to CompressionLevels struct.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
-rw-r--r--src/libFLAC/stream_encoder.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c
index c0430def..3103fdf0 100644
--- a/src/libFLAC/stream_encoder.c
+++ b/src/libFLAC/stream_encoder.c
@@ -106,16 +106,18 @@ static struct CompressionLevels {
unsigned min_residual_partition_order;
unsigned max_residual_partition_order;
unsigned rice_parameter_search_dist;
+ const char *apodization;
} compression_levels_[] = {
- { false, false, 0, 0, false, false, false, 0, 3, 0 },
- { true , true , 0, 0, false, false, false, 0, 3, 0 },
- { true , false, 0, 0, false, false, false, 0, 3, 0 },
- { false, false, 6, 0, false, false, false, 0, 4, 0 },
- { true , true , 8, 0, false, false, false, 0, 4, 0 },
- { true , false, 8, 0, false, false, false, 0, 5, 0 },
- { true , false, 8, 0, false, false, false, 0, 6, 0 },
- { true , false, 8, 0, false, false, true , 0, 6, 0 },
- { true , false, 12, 0, false, false, true , 0, 6, 0 }
+ { false, false, 0, 0, false, false, false, 0, 3, 0, "tukey(5e-1)" },
+ { true , true , 0, 0, false, false, false, 0, 3, 0, "tukey(5e-1)" },
+ { true , false, 0, 0, false, false, false, 0, 3, 0, "tukey(5e-1)" },
+ { false, false, 6, 0, false, false, false, 0, 4, 0, "tukey(5e-1)" },
+ { true , true , 8, 0, false, false, false, 0, 4, 0, "tukey(5e-1)" },
+ { true , false, 8, 0, false, false, false, 0, 5, 0, "tukey(5e-1)" },
+ { true , false, 8, 0, false, false, false, 0, 6, 0, "tukey(5e-1)" },
+ { true , false, 8, 0, false, false, true , 0, 6, 0, "tukey(5e-1)" },
+ { true , false, 12, 0, false, false, true , 0, 6, 0, "tukey(5e-1)" }
+ /* here we use locale-independent 5e-1 instead of 0.5 or 0,5 */
};
@@ -1583,11 +1585,10 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_compression_level(FLAC__StreamEncod
ok &= FLAC__stream_encoder_set_do_mid_side_stereo (encoder, compression_levels_[value].do_mid_side_stereo);
ok &= FLAC__stream_encoder_set_loose_mid_side_stereo (encoder, compression_levels_[value].loose_mid_side_stereo);
#ifndef FLAC__INTEGER_ONLY_LIBRARY
-#if 0
- /* was: */
+#if 1
ok &= FLAC__stream_encoder_set_apodization (encoder, compression_levels_[value].apodization);
- /* but it's too hard to specify the string in a locale-specific way */
#else
+ /* equivalent to -A tukey(0.5) */
encoder->protected_->num_apodizations = 1;
encoder->protected_->apodizations[0].type = FLAC__APODIZATION_TUKEY;
encoder->protected_->apodizations[0].parameters.tukey.p = 0.5;