move db_to_gain to retro_miscellaneous.h

This commit is contained in:
twinaphex 2015-11-24 00:35:14 +01:00
parent 73fcbe3786
commit d1b9dbe7dc
2 changed files with 13 additions and 13 deletions

View File

@ -129,19 +129,6 @@ extern struct defaults g_defaults;
}
#endif
/**
* db_to_gain:
* @db : Decibels.
*
* Converts decibels to voltage gain.
*
* Returns: voltage gain value.
**/
static INLINE float db_to_gain(float db)
{
return powf(10.0f, db / 20.0f);
}
/**
* retro_fail:
* @error_code : Error code.

View File

@ -141,6 +141,19 @@ static INLINE uint32_t prev_pow2(uint32_t v)
return v - (v >> 1);
}
/**
* db_to_gain:
* @db : Decibels.
*
* Converts decibels to voltage gain.
*
* Returns: voltage gain value.
**/
static INLINE float db_to_gain(float db)
{
return powf(10.0f, db / 20.0f);
}
/* Helper macros and struct to keep track of many booleans.
* To check for multiple bits, use &&, not &.
* For OR, | can be used. */