summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2014-02-01 20:34:51 +1100
committerErik de Castro Lopo <erikd@mega-nerd.com>2014-02-01 20:34:55 +1100
commitd163ef456797ef4807138b0ecb5da9ff05e147e2 (patch)
tree8c4165818bbe27d08220ddc7d09d0e6a777bb4e9 /src
parent48133110318a7a067ebb70d732e9364fdc255d3e (diff)
downloadflac-d163ef456797ef4807138b0ecb5da9ff05e147e2.tar.gz
libFLAC/stream_encoder.c : Fall back to intrinsics if NASM is not available.
Patch-from: lvqcl <lvqcl.mail@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/libFLAC/stream_encoder.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c
index 1cd123fc..343da4d2 100644
--- a/src/libFLAC/stream_encoder.c
+++ b/src/libFLAC/stream_encoder.c
@@ -920,6 +920,18 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_(
encoder->private_->local_fixed_compute_best_predictor = FLAC__fixed_compute_best_predictor_asm_ia32_mmx_cmov;
# endif /* FLAC__HAS_NASM */
# ifdef FLAC__HAS_X86INTRIN
+# if defined FLAC__SSE_SUPPORTED && !defined FLAC__HAS_NASM
+ if(encoder->private_->cpuinfo.ia32.sse) {
+ if(encoder->protected_->max_lpc_order < 4)
+ encoder->private_->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_intrin_sse_lag_4;
+ else if(encoder->protected_->max_lpc_order < 8)
+ encoder->private_->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_intrin_sse_lag_8;
+ else if(encoder->protected_->max_lpc_order < 12)
+ encoder->private_->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_intrin_sse_lag_12;
+ else if(encoder->protected_->max_lpc_order < 16)
+ encoder->private_->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_intrin_sse_lag_16;
+ }
+# endif
# ifdef FLAC__SSE2_SUPPORTED
if(encoder->private_->cpuinfo.ia32.sse2) {
encoder->private_->local_lpc_compute_residual_from_qlp_coefficients = FLAC__lpc_compute_residual_from_qlp_coefficients_intrin_sse2;