1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-05 11:13:16 +01:00
Files
audacity/lib-src/sbsms/src/dBTable.h

27 lines
412 B
C++

// -*- mode: c++ -*-
#ifndef DBTABLE_H
#define DBTABLE_H
#include "real.h"
namespace _sbsms_ {
enum { dBTableSize = 4096, dBTableScale = dBTableSize - 1 };
extern float dBTable[dBTableSize];
inline float dBApprox(float x, float y)
{
if(x < y) {
return dBTable[lrintf(x/y*dBTableScale)];
} else if(x == 0.0f) {
return 0;
} else {
return dBTable[lrintf(y/x*dBTableScale)];
}
}
}
#endif