fix bug with locale-specific -A defaults for -0..-8 (SF#1608883: https://sourceforge...
authorJosh Coalson <jcoalson@users.sourceforce.net>
Tue, 5 Dec 2006 01:36:46 +0000 (01:36 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Tue, 5 Dec 2006 01:36:46 +0000 (01:36 +0000)
doc/html/changelog.html
src/libFLAC/stream_encoder.c

index f3f41df..4faea60 100644 (file)
 
                <br />
 
+<!--
+               <a name="flac_1_1_4"><b>FLAC 1.1.4</b></a>
+
+               <br />
+
+               <ul>
+                       <li>
+                               General:
+                               <ul>
+                                       <li>(none)</li>
+                               </ul>
+                       </li>
+                       <li>
+                               FLAC format:
+                               <ul>
+                                       <li>(none)</li>
+                               </ul>
+                       </li>
+                       <li>
+                               Ogg FLAC format:
+                               <ul>
+                                       <li>(none)</li>
+                               </ul>
+                       </li>
+                       <li>
+                               flac:
+                               <ul>
+                                       <li>Fixed a bug that caused suboptimal default compression settings in some locales (<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1608883&amp;group_id=13478&amp;atid=113478">SF #1608883</a>).</li>
+                               </ul>
+                       </li>
+                       <li>
+                               metaflac:
+                               <ul>
+                                       <li>(none)</li>
+                               </ul>
+                       </li>
+                       <li>
+                               plugins:
+                               <ul>
+                                       <li>(none)</li>
+                               </ul>
+                       </li>
+                       <li>
+                               build system:
+                               <ul>
+                                       <li>(none)</li>
+                               </ul>
+                       </li>
+                       <li>
+                               libraries:
+                               <ul>
+                                       <li>Fixed a bug with default apodization settings that were erroneous in some locales (<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1608883&amp;group_id=13478&amp;atid=113478">SF #1608883</a>).</li>
+                               </ul>
+                       </li>
+                       <li>
+                               Interface changes (see also the <a href="http://flac.sourceforge.net/api/group__porting__1__1__3__to__1__1__4.html">porting guide</a> for specific instructions on porting to FLAC 1.1.4):
+                               <ul>
+                                       <li>
+                                               all libraries;
+                                               <ul>
+                                                       <li>(none)</li>
+                                               </ul>
+                                       </li>
+                                       <li>
+                                               libFLAC:
+                                               <ul>
+                                                       <li>(none)</li>
+                                               </ul>
+                                       </li>
+                                       <li>
+                                               libFLAC++:
+                                               <ul>
+                                                       <li>(none)</li>
+                                               </ul>
+                                       </li>
+                               </ul>
+                       </li>
+               </ul>
+
+               <br />
+
+-->
                <a name="flac_1_1_3"><b>FLAC 1.1.3</b></a>
 
                <br />
index a8382b1..164723e 100644 (file)
@@ -102,7 +102,6 @@ typedef enum {
 static struct CompressionLevels {
        FLAC__bool do_mid_side_stereo;
        FLAC__bool loose_mid_side_stereo;
-       const char *apodization;
        unsigned max_lpc_order;
        unsigned qlp_coeff_precision;
        FLAC__bool do_qlp_coeff_prec_search;
@@ -112,15 +111,15 @@ static struct CompressionLevels {
        unsigned max_residual_partition_order;
        unsigned rice_parameter_search_dist;
 } compression_levels_[] = {
-       { false, false, "tukey(0.5)",  0, 0, false, false, false, 2, 2, 0 },
-       { true , true , "tukey(0.5)",  0, 0, false, false, false, 2, 2, 0 },
-       { true , false, "tukey(0.5)",  0, 0, false, false, false, 0, 3, 0 },
-       { false, false, "tukey(0.5)",  6, 0, false, false, false, 3, 3, 0 },
-       { true , true , "tukey(0.5)",  8, 0, false, false, false, 3, 3, 0 },
-       { true , false, "tukey(0.5)",  8, 0, false, false, false, 3, 3, 0 },
-       { true , false, "tukey(0.5)",  8, 0, false, false, false, 0, 4, 0 },
-       { true , false, "tukey(0.5)",  8, 0, false, false, true , 0, 6, 0 },
-       { true , false, "tukey(0.5)", 12, 0, false, false, true , 0, 6, 0 }
+       { false, false,  0, 0, false, false, false, 2, 2, 0 },
+       { true , true ,  0, 0, false, false, false, 2, 2, 0 },
+       { true , false,  0, 0, false, false, false, 0, 3, 0 },
+       { false, false,  6, 0, false, false, false, 3, 3, 0 },
+       { true , true ,  8, 0, false, false, false, 3, 3, 0 },
+       { true , false,  8, 0, false, false, false, 3, 3, 0 },
+       { true , false,  8, 0, false, false, false, 0, 4, 0 },
+       { true , false,  8, 0, false, false, true , 0, 6, 0 },
+       { true , false, 12, 0, false, false, true , 0, 6, 0 }
 };
 
 
@@ -1517,7 +1516,15 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_compression_level(FLAC__StreamEncod
                value = sizeof(compression_levels_)/sizeof(compression_levels_[0]) - 1;
        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);
+#if 0
+       /* was: */
        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
+       encoder->protected_->num_apodizations = 1;
+       encoder->protected_->apodizations[0].type = FLAC__APODIZATION_TUKEY;
+       encoder->protected_->apodizations[0].parameters.tukey.p = 0.5;
+#endif
        ok &= FLAC__stream_encoder_set_max_lpc_order               (encoder, compression_levels_[value].max_lpc_order);
        ok &= FLAC__stream_encoder_set_qlp_coeff_precision         (encoder, compression_levels_[value].qlp_coeff_precision);
        ok &= FLAC__stream_encoder_set_do_qlp_coeff_prec_search    (encoder, compression_levels_[value].do_qlp_coeff_prec_search);