Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_dsp_invhardlimit (for fb2k 1.1+) (Read 11331 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_dsp_invhardlimit (for fb2k 1.1+)

DLL: [attachment=7024:foo_dsp_...ardlimit.zip]

Code:
Code: [Select]
#include "../SDK/foobar2000.h"
#include <boost\math\special_functions\atanh.hpp>

DECLARE_COMPONENT_VERSION("Hard Limiter Inversion", "0.0.1", "");

class dsp_invlimiter : public dsp_impl_base
{
public:
dsp_invlimiter() {}

static GUID g_get_guid() { // {C4688FBC-CCB3-4F35-8F13-E8F1760FBD32}
static const GUID guid = { 0xc4688fbc, 0xccb3, 0x4f35, { 0x8f, 0x13, 0xe8, 0xf1, 0x76, 0xf, 0xbd, 0x32 } };
return guid;
}

static void g_get_name(pfc::string_base & p_out) { p_out = "Invert HardLimiter"; }

static bool g_have_config_popup() { return false; }

virtual void on_endoftrack(abort_callback & p_abort) { }

virtual void on_endofplayback(abort_callback & p_abort) { }

virtual void flush() {}

virtual double get_latency() { return 0.0; }

virtual bool need_track_change_mark() { return false; }

virtual bool on_chunk(audio_chunk * chunk, abort_callback & p_abort)
{
static const float limiter_max = 0.9999f;
static const float limiter_max_05 = limiter_max - 0.5f;

audio_sample * ptr = chunk->get_data();
t_size n;
for(n = chunk->get_data_length(); n; --n)
{
double val = *ptr;

if (val < -0.5)
{
if (val < -limiter_max + DBL_EPSILON) val = -limiter_max + DBL_EPSILON;
val = (boost::math::atanh((val + 0.5) / limiter_max_05) * limiter_max_05 - 0.5);
}
else if (val > 0.5)
{
if (val > limiter_max - DBL_EPSILON) val = limiter_max - DBL_EPSILON;
val = (boost::math::atanh((val - 0.5) / limiter_max_05) * limiter_max_05 + 0.5);
}

*ptr = (audio_sample) val;
ptr++;
}
return true;
}
};

static dsp_factory_nopreset_t<dsp_invlimiter> foo_dsp_invlimiter;

The idea is to cancel the effect of a limiter in foo_dsp_winamp.

foo_dsp_invhardlimit (for fb2k 1.1+)

Reply #1
Instead of this , try to find the source of the foo_dsp_winamp and remove it from the real source.

foo_dsp_invhardlimit (for fb2k 1.1+)

Reply #2

foo_dsp_invhardlimit (for fb2k 1.1+)

Reply #3
No.

Re: foo_dsp_invhardlimit (for fb2k 1.1+)

Reply #4
Can you explain how it works?

 
SimplePortal 1.0.0 RC1 © 2008-2021