| AAX SDK 2.6.1 Avid Audio Extensions Development Kit

- Welcome
- Manual
- Classes
- Files
- Lists
- Support

- File List
- File Members

Loading...
Searching...
No Matches
AAX_FastInterpolatedTableLookup.h
Go to the documentation of this file.
1/*================================================================================================*/
2/*
3 * Copyright 2013-2015, 2019, 2023 Avid Technology, Inc.
4 * All rights reserved.
5 *
6 * CONFIDENTIAL: this document contains confidential information of Avid. Do
7 * not disclose to any third party. Use of the information contained in this
8 * document is subject to an Avid SDK license.
9 */
10
18/*================================================================================================*/
19#pragma once
20
21#ifndef AAX_FASTINTERPOLATEDTABLELOOKUP_H
22#define AAX_FASTINTERPOLATEDTABLELOOKUP_H
23
24#include "AAX_Quantize.h"
25
26//==============================================================================
27//
28// NOTE:
29// Construtors and destructors are not call because state and coefficientrs blocks
30// are not allocated as classes
31//
32
33#include AAX_ALIGN_FILE_BEGIN
34#include AAX_ALIGN_FILE_ALG
35#include AAX_ALIGN_FILE_END
36
37 template<class TFLOAT, class DFLOAT>
38 class AAX_FastInterpolatedTableLookup
39{
40 public:
41
56 void SetParameters(int iTableSize, TFLOAT iMin=0.0, TFLOAT iMax=1.0, int iNumTables=1)
57 {
58 mTableSizeM1=(TFLOAT)(iTableSize-1);
59 mTableSize=(TFLOAT)iTableSize;
60 mIntTableSizeM1=iTableSize-1;
61 mMin=iMin;
62 mMax=iMax;
63 mMaxMinusMin=iMax-iMin;
64 mTableSizeM1DivMaxMinusMin=TFLOAT(iTableSize-1)/(iMax-iMin); //Two divides??
65 mTableSizeDivMaxMinusMin=TFLOAT(iTableSize)/(iMax-iMin);
66 mNumTables=iNumTables;
67 }
68
82 DFLOAT DoTableLookupExtraFast(const TFLOAT* const iTable, DFLOAT iValue) const;
83 void DoTableLookupExtraFastMulti(const TFLOAT* iTable, DFLOAT iValue, DFLOAT* oValues) const;
84
85 void DoTableLookupExtraFast(const TFLOAT* const iTable, const TFLOAT* const inpBuf, DFLOAT* const outBuf, int blockSize);
86
87 TFLOAT GetMin() { return mMin; };
88 TFLOAT GetMaxMinusMin() { return mMaxMinusMin; };
89
90 private:
91
92 TFLOAT mTableSizeM1;
93 int mIntTableSizeM1;
94 TFLOAT mTableSizeM1DivMaxMinusMin;
95 TFLOAT mMin;
96 TFLOAT mMax;
97 TFLOAT mMaxMinusMin;
98 TFLOAT mTableSize;
99 TFLOAT mTableSizeDivMaxMinusMin;
100 int mNumTables; //This is used for multi-element lookups
101};
102
103#include AAX_ALIGN_FILE_BEGIN
104#include AAX_ALIGN_FILE_RESET
105#include AAX_ALIGN_FILE_END
106
107// Template implementation
108#include "AAX_FastInterpolatedTableLookup.hpp"
109
110#endif // AAX_FASTINTERPOLATEDTABLELOOKUP_H
AAX_FastInterpolatedTableLookup.hpp
AAX_Quantize.h
Quantization utilities.
AAX_FastInterpolatedTableLookup
Definition: AAX_FastInterpolatedTableLookup.h:39
AAX_FastInterpolatedTableLookup::DoTableLookupExtraFastMulti
void DoTableLookupExtraFastMulti(const TFLOAT *iTable, DFLOAT iValue, DFLOAT *oValues) const
Definition: AAX_FastInterpolatedTableLookup.hpp:39
AAX_FastInterpolatedTableLookup::SetParameters
void SetParameters(int iTableSize, TFLOAT iMin=0.0, TFLOAT iMax=1.0, int iNumTables=1)
Set the table lookup parameters.
Definition: AAX_FastInterpolatedTableLookup.h:56
AAX_FastInterpolatedTableLookup::GetMaxMinusMin
TFLOAT GetMaxMinusMin()
Definition: AAX_FastInterpolatedTableLookup.h:88
AAX_FastInterpolatedTableLookup::DoTableLookupExtraFast
DFLOAT DoTableLookupExtraFast(const TFLOAT *const iTable, DFLOAT iValue) const
Perform an extra fast table lookup :)
Definition: AAX_FastInterpolatedTableLookup.hpp:20
AAX_FastInterpolatedTableLookup::GetMin
TFLOAT GetMin()
Definition: AAX_FastInterpolatedTableLookup.h:87