THD_DELAY_MAX
if (thd_delay > THD_DELAY_MAX)
thd_delay = THD_DELAY_MAX;
return (THD_DELAY_MAX - thd_delay);