summaryrefslogtreecommitdiff
path: root/libavfilter/af_compensationdelay.c
diff options
context:
space:
mode:
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>2016-01-04 18:40:19 -0800
committerGanesh Ajjanagadde <gajjanagadde@gmail.com>2016-01-05 19:07:19 -0800
commitfc703f53cf3b0ca3806ecbf20d456f36b04249af (patch)
treebdeaad3e27ddda6722a0ee3c5614a408df20fb58 /libavfilter/af_compensationdelay.c
parenta956840cbcf89d709c4bd5980808ac0b5c8aeedf (diff)
downloadffmpeg-fc703f53cf3b0ca3806ecbf20d456f36b04249af.tar.gz
lavfi/af_compensationdelay: replace pow(x,0.5) by sqrt(x)
sqrt is faster, and is sometimes more accurate depending on the libm. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Diffstat (limited to 'libavfilter/af_compensationdelay.c')
-rw-r--r--libavfilter/af_compensationdelay.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/af_compensationdelay.c b/libavfilter/af_compensationdelay.c
index 33ee7e4996..d5a3484317 100644
--- a/libavfilter/af_compensationdelay.c
+++ b/libavfilter/af_compensationdelay.c
@@ -57,7 +57,7 @@ AVFILTER_DEFINE_CLASS(compensationdelay);
// The maximum distance for options
#define COMP_DELAY_MAX_DISTANCE (100.0 * 100.0 + 100.0 * 1.0 + 1.0)
// The actual speed of sound in normal conditions
-#define COMP_DELAY_SOUND_SPEED_KM_H(temp) 1.85325 * (643.95 * pow(((temp + 273.15) / 273.15), 0.5))
+#define COMP_DELAY_SOUND_SPEED_KM_H(temp) 1.85325 * (643.95 * sqrt(((temp + 273.15) / 273.15)))
#define COMP_DELAY_SOUND_SPEED_CM_S(temp) (COMP_DELAY_SOUND_SPEED_KM_H(temp) * (1000.0 * 100.0) /* cm/km */ / (60.0 * 60.0) /* s/h */)
#define COMP_DELAY_SOUND_FRONT_DELAY(temp) (1.0 / COMP_DELAY_SOUND_SPEED_CM_S(temp))
// The maximum delay may be reached by this filter