r8brain-free-src
High-quality pro audio sample rate converter library
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Functions
r8bbase.h File Reference

The "base" inclusion file with basic classes and functions. More...

#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <math.h>
#include "r8bconf.h"
#include <pthread.h>

Go to the source code of this file.

Classes

class  r8b::CFixedBuffer< T >
 Templated memory buffer class for element buffers of fixed capacity. More...
 
class  r8b::CPtrKeeper< T >
 Pointer-to-object "keeper" class with automatic deletion. More...
 
class  r8b::CSineGen
 Sine signal generator class. More...
 
class  r8b::CStdClassAllocator
 The default base class for objects created on heap. More...
 
class  r8b::CStdMemAllocator
 The default base class for objects that allocate blocks of memory. More...
 
class  r8b::CSyncKeeper
 A "keeper" class for CSyncObject-based synchronization. More...
 
class  r8b::CSyncObject
 Multi-threaded synchronization object class. More...
 

Namespaces

namespace  r8b
 The "r8brain-free-src" library namespace.
 

Macros

#define R8B_2PI   6.28318530717958648
 
#define R8B_3PI   9.42477796076937972
 
#define R8B_PI   3.14159265358979324
 
#define R8B_PId2   1.57079632679489662
 
#define R8B_VERSION   "6.5"
 
#define R8BNOCTOR(ClassName)
 
#define R8BSYNC(SyncObject)   R8BSYNC_( SyncObject, __LINE__ )
 
#define R8BSYNC_(SyncObject, id)   R8BSYNC__( SyncObject, id )
 
#define R8BSYNC__(SyncObject, id)   CSyncKeeper SyncKeeper##id( SyncObject )
 

Functions

template<typename T >
T * r8b::alignptr (T *const ptr, const uintptr_t align)
 
double r8b::asinh (const double v)
 
double r8b::besselI0 (const double x)
 
double r8b::calcFIRFilterGroupDelay (const double *const flt, const int fltlen, const double th)
 
void r8b::calcFIRFilterResponse (const double *flt, int fltlen, const double th, double &re0, double &im0, const int fltlat=0)
 
void r8b::calcSpline2p8Coeffs (double *const c, const double xm3, const double xm2, const double xm1, const double x0, const double x1, const double x2, const double x3, const double x4)
 
void r8b::calcSpline3p4Coeffs (double *const c, const double *const y)
 
void r8b::calcSpline3p6Coeffs (double *const c, const double *const y)
 
void r8b::calcSpline3p8Coeffs (double *const c, const double xm3, const double xm2, const double xm1, const double x0, const double x1, const double x2, const double x3, const double x4)
 
double r8b::clampr (const double Value, const double minv, const double maxv)
 
double r8b::gauss (const double v)
 
int r8b::getBitOccupancy (const int v)
 
template<typename T >
r8b::max (const T &v1, const T &v2)
 
template<typename T >
r8b::min (const T &v1, const T &v2)
 
void r8b::normalizeFIRFilter (double *const p, const int l, const double DCGain, const int pstep=1)
 
double r8b::pow_a (const double v, const double p)
 
double r8b::sqr (const double x)
 

Detailed Description

The "base" inclusion file with basic classes and functions.

This is the "base" inclusion file for the "r8brain-free-src" sample rate converter. This inclusion file contains implementations of several small utility classes and functions used by the library.

Macro Definition Documentation

◆ R8B_2PI

#define R8B_2PI   6.28318530717958648

The R8B_2PI macro equals to "2 * pi" constant, fits 53-bit floating point mantissa.

◆ R8B_3PI

#define R8B_3PI   9.42477796076937972

The R8B_3PI macro equals to "3 * pi" constant, fits 53-bit floating point mantissa.

◆ R8B_PI

#define R8B_PI   3.14159265358979324

The macro equals to "pi" constant, fits 53-bit floating point mantissa.

◆ R8B_PId2

#define R8B_PId2   1.57079632679489662

The R8B_PId2 macro equals to "pi divided by 2" constant, fits 53-bit floating point mantissa.

◆ R8B_VERSION

#define R8B_VERSION   "6.5"

Macro defines r8brain-free-src version string.

◆ R8BNOCTOR

#define R8BNOCTOR (   ClassName)
Value:
private: \
ClassName( const ClassName& ) { } \
ClassName& operator = ( const ClassName& ) { return( *this ); }

A special macro that defines empty copy-constructor and copy operator with the "private:" prefix. This macro should be used in classes that cannot be copied in a standard C++ way. It is also assumed that objects of such classes are non-relocatable.

This macro does not need to be defined in classes derived from a class where such macro was already used.

Parameters
ClassNameThe name of the class which uses this macro.

◆ R8BSYNC

#define R8BSYNC (   SyncObject)    R8BSYNC_( SyncObject, __LINE__ )

The synchronization macro. The R8BSYNC( obj ) macro, which creates and object of the r8b::CSyncKeeper class on stack, should be put before sections of the code that may potentially change data asynchronously with other threads at the same time. The R8BSYNC( obj ) macro "acquires" the synchronization object thus blocking execution of other threads that also use the same R8BSYNC( obj ) macro. The blocked section begins with the R8BSYNC( obj ) macro and finishes at the end of the current C++ code block. Multiple R8BSYNC() macros can be defined within the same code block.

Parameters
SyncObjectAn object of the CSyncObject type that is used for synchronization.