From 4b90c1c50aa2a0c166532d20a516e449b71f42c9 Mon Sep 17 00:00:00 2001 From: vsariola <5684185+vsariola@users.noreply.github.com> Date: Sun, 21 Mar 2021 12:14:28 +0200 Subject: [PATCH] optimize(templates): don't call compressor_mono if only using stereo compressor --- templates/amd64-386/effects.asm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/amd64-386/effects.asm b/templates/amd64-386/effects.asm index dad845e..bece80a 100644 --- a/templates/amd64-386/effects.asm +++ b/templates/amd64-386/effects.asm @@ -363,10 +363,12 @@ su_op_delay_loop: fst st3 ; y x^2 l r fmul st0, st0 ; y^2 x^2 l r faddp st1, st0 ; y^2+x^2 l r +{{- if .StereoAndMono "compressor"}} call su_op_compressor_mono ; So, for stereo, we square both left & right and add them up fld st0 ; and return the computed gain two times, ready for MULP STEREO ret su_op_compressor_mono: +{{- end}} {{- end}} fld dword [{{.WRK}}] ; l x^2 x fucomi st0, st1 @@ -393,5 +395,8 @@ su_op_compressor_mono: ; if ratio is at minimum => p=0 => 1 x ; if ratio is at maximum => p=0.5 => t/x => t/x*x=t fdiv dword [{{.Input "compressor" "invgain"}}]; this used to be pregain but that ran into problems with getting back up to 0 dB so postgain should be better at that +{{- if and (.Stereo "compressor") (not (.Mono "compressor"))}} + fld st0 ; and return the computed gain two times, ready for MULP STEREO +{{- end}} ret {{- end}}