| AAX SDK 2.8.0 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-2024 Avid Technology, Inc.
4 * All rights reserved.
5 *
6 * This file is part of the Avid AAX SDK.
7 *
8 * The AAX SDK is subject to commercial or open-source licensing.
9 *
10 * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License
11 * Agreement and Avid Privacy Policy.
12 *
13 * AAX SDK License: https://developer.avid.com/aax
14 * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement
15 *
16 * Or: You may also use this code under the terms of the GPL v3 (see
17 * www.gnu.org/licenses).
18 *
19 * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 * DISCLAIMED.
22 */
23
31/*================================================================================================*/
32#pragma once
33
34#ifndef AAX_FASTINTERPOLATEDTABLELOOKUP_H
35#define AAX_FASTINTERPOLATEDTABLELOOKUP_H
36
37#include "AAX_Quantize.h"
38
39//==============================================================================
40//
41// NOTE:
42// Construtors and destructors are not call because state and coefficientrs blocks
43// are not allocated as classes
44//
45
46#include AAX_ALIGN_FILE_BEGIN
47#include AAX_ALIGN_FILE_ALG
48#include AAX_ALIGN_FILE_END
49
50 template<class TFLOAT, class DFLOAT>
51 class AAX_FastInterpolatedTableLookup
52{
53 public:
54
69 void SetParameters(int iTableSize, TFLOAT iMin=0.0, TFLOAT iMax=1.0, int iNumTables=1)
70 {
71 mTableSizeM1=(TFLOAT)(iTableSize-1);
72 mTableSize=(TFLOAT)iTableSize;
73 mIntTableSizeM1=iTableSize-1;
74 mMin=iMin;
75 mMax=iMax;
76 mMaxMinusMin=iMax-iMin;
77 mTableSizeM1DivMaxMinusMin=TFLOAT(iTableSize-1)/(iMax-iMin); //Two divides??
78 mTableSizeDivMaxMinusMin=TFLOAT(iTableSize)/(iMax-iMin);
79 mNumTables=iNumTables;
80 }
81
95 DFLOAT DoTableLookupExtraFast(const TFLOAT* const iTable, DFLOAT iValue) const;
96 void DoTableLookupExtraFastMulti(const TFLOAT* iTable, DFLOAT iValue, DFLOAT* oValues) const;
97
98 void DoTableLookupExtraFast(const TFLOAT* const iTable, const TFLOAT* const inpBuf, DFLOAT* const outBuf, int blockSize);
99
100 TFLOAT GetMin() { return mMin; };
101 TFLOAT GetMaxMinusMin() { return mMaxMinusMin; };
102
103 private:
104
105 TFLOAT mTableSizeM1;
106 int mIntTableSizeM1;
107 TFLOAT mTableSizeM1DivMaxMinusMin;
108 TFLOAT mMin;
109 TFLOAT mMax;
110 TFLOAT mMaxMinusMin;
111 TFLOAT mTableSize;
112 TFLOAT mTableSizeDivMaxMinusMin;
113 int mNumTables; //This is used for multi-element lookups
114};
115
116#include AAX_ALIGN_FILE_BEGIN
117#include AAX_ALIGN_FILE_RESET
118#include AAX_ALIGN_FILE_END
119
120// Template implementation
121#include "AAX_FastInterpolatedTableLookup.hpp"
122
123#endif // AAX_FASTINTERPOLATEDTABLELOOKUP_H
AAX_FastInterpolatedTableLookup.hpp
AAX_Quantize.h
Quantization utilities.
AAX_FastInterpolatedTableLookup
Definition: AAX_FastInterpolatedTableLookup.h:52
AAX_FastInterpolatedTableLookup::DoTableLookupExtraFastMulti
void DoTableLookupExtraFastMulti(const TFLOAT *iTable, DFLOAT iValue, DFLOAT *oValues) const
Definition: AAX_FastInterpolatedTableLookup.hpp:52
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:69
AAX_FastInterpolatedTableLookup::GetMaxMinusMin
TFLOAT GetMaxMinusMin()
Definition: AAX_FastInterpolatedTableLookup.h:101
AAX_FastInterpolatedTableLookup::DoTableLookupExtraFast
DFLOAT DoTableLookupExtraFast(const TFLOAT *const iTable, DFLOAT iValue) const
Perform an extra fast table lookup :)
Definition: AAX_FastInterpolatedTableLookup.hpp:33
AAX_FastInterpolatedTableLookup::GetMin
TFLOAT GetMin()
Definition: AAX_FastInterpolatedTableLookup.h:100