remove a bad assert on cpuinfo struct
authorJosh Coalson <jcoalson@users.sourceforce.net>
Wed, 18 Jul 2001 00:25:52 +0000 (00:25 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Wed, 18 Jul 2001 00:25:52 +0000 (00:25 +0000)
src/libFLAC/stream_decoder.c
src/libFLAC/stream_encoder.c

index 0d7bd0f..bf49cc8 100644 (file)
@@ -218,20 +218,21 @@ FLAC__StreamDecoderState FLAC__stream_decoder_init(FLAC__StreamDecoder *decoder)
        decoder->private->local_lpc_restore_signal_16bit = FLAC__lpc_restore_signal;
        /* now override with asm where appropriate */
 #ifndef FLAC__NO_ASM
-       FLAC__ASSERT(decoder->private->cpuinfo.use_asm);
+       if(decoder->private->cpuinfo.use_asm) {
 #ifdef FLAC__CPU_IA32
-       FLAC__ASSERT(decoder->private->cpuinfo.type == FLAC__CPUINFO_TYPE_IA32);
+               FLAC__ASSERT(decoder->private->cpuinfo.type == FLAC__CPUINFO_TYPE_IA32);
 #ifdef FLAC__HAS_NASM
-       if(decoder->private->cpuinfo.data.ia32.mmx) {
-               decoder->private->local_lpc_restore_signal = FLAC__lpc_restore_signal_asm_ia32;
-               decoder->private->local_lpc_restore_signal_16bit = FLAC__lpc_restore_signal_asm_ia32_mmx;
-       }
-       else {
-               decoder->private->local_lpc_restore_signal = FLAC__lpc_restore_signal_asm_ia32;
-               decoder->private->local_lpc_restore_signal_16bit = FLAC__lpc_restore_signal_asm_ia32;
-       }
+               if(decoder->private->cpuinfo.data.ia32.mmx) {
+                       decoder->private->local_lpc_restore_signal = FLAC__lpc_restore_signal_asm_ia32;
+                       decoder->private->local_lpc_restore_signal_16bit = FLAC__lpc_restore_signal_asm_ia32_mmx;
+               }
+               else {
+                       decoder->private->local_lpc_restore_signal = FLAC__lpc_restore_signal_asm_ia32;
+                       decoder->private->local_lpc_restore_signal_16bit = FLAC__lpc_restore_signal_asm_ia32;
+               }
 #endif
 #endif
+       }
 #endif
 
        return decoder->protected->state;
index c6178a1..c7ab948 100644 (file)
@@ -371,36 +371,37 @@ FLAC__StreamEncoderState FLAC__stream_encoder_init(FLAC__StreamEncoder *encoder)
        encoder->private->local_lpc_compute_residual_from_qlp_coefficients_16bit = FLAC__lpc_compute_residual_from_qlp_coefficients;
        /* now override with asm where appropriate */
 #ifndef FLAC__NO_ASM
-       FLAC__ASSERT(encoder->private->cpuinfo.use_asm);
+       if(encoder->private->cpuinfo.use_asm) {
 #ifdef FLAC__CPU_IA32
-       FLAC__ASSERT(encoder->private->cpuinfo.type == FLAC__CPUINFO_TYPE_IA32);
+               FLAC__ASSERT(encoder->private->cpuinfo.type == FLAC__CPUINFO_TYPE_IA32);
 #ifdef FLAC__HAS_NASM
-       if(0 && encoder->private->cpuinfo.data.ia32.sse) { /*@@@ SSE version lacks necessary resolution, plus SSE flag doesn't check for OS support */
-               if(encoder->protected->max_lpc_order < 4)
-                       encoder->private->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_4;
-               else if(encoder->protected->max_lpc_order < 8)
-                       encoder->private->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_8;
-               else if(encoder->protected->max_lpc_order < 12)
-                       encoder->private->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_12;
+               if(0 && encoder->private->cpuinfo.data.ia32.sse) {
+                       if(encoder->protected->max_lpc_order < 4)
+                               encoder->private->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_4;
+                       else if(encoder->protected->max_lpc_order < 8)
+                               encoder->private->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_8;
+                       else if(encoder->protected->max_lpc_order < 12)
+                               encoder->private->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_12;
+                       else
+                               encoder->private->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia32;
+               }
+               else if(0 && encoder->private->cpuinfo.data.ia32._3dnow) /*@@@ turn back on in first beta after 1.0 */
+                       encoder->private->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia32_3dnow;
                else
                        encoder->private->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia32;
-       }
-       else if(0 && encoder->private->cpuinfo.data.ia32._3dnow) /*@@@ turn back on in first beta after 1.0 */
-               encoder->private->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia32_3dnow;
-       else
-               encoder->private->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia32;
-       if(encoder->private->cpuinfo.data.ia32.mmx && encoder->private->cpuinfo.data.ia32.cmov)
-               encoder->private->local_fixed_compute_best_predictor = FLAC__fixed_compute_best_predictor_asm_ia32_mmx_cmov;
-       if(encoder->private->cpuinfo.data.ia32.mmx) {
-               encoder->private->local_lpc_compute_residual_from_qlp_coefficients = FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32;
-               encoder->private->local_lpc_compute_residual_from_qlp_coefficients_16bit = FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32_mmx;
-       }
-       else {
-               encoder->private->local_lpc_compute_residual_from_qlp_coefficients = FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32;
-               encoder->private->local_lpc_compute_residual_from_qlp_coefficients_16bit = FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32;
-       }
+               if(encoder->private->cpuinfo.data.ia32.mmx && encoder->private->cpuinfo.data.ia32.cmov)
+                       encoder->private->local_fixed_compute_best_predictor = FLAC__fixed_compute_best_predictor_asm_ia32_mmx_cmov;
+               if(encoder->private->cpuinfo.data.ia32.mmx) {
+                       encoder->private->local_lpc_compute_residual_from_qlp_coefficients = FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32;
+                       encoder->private->local_lpc_compute_residual_from_qlp_coefficients_16bit = FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32_mmx;
+               }
+               else {
+                       encoder->private->local_lpc_compute_residual_from_qlp_coefficients = FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32;
+                       encoder->private->local_lpc_compute_residual_from_qlp_coefficients_16bit = FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32;
+               }
 #endif
 #endif
+       }
 #endif
        /* finally override based on wide-ness if necessary */
        if(encoder->private->use_wide_by_block) {