39 bool doPrepare(
int nrthreads);
43 void computeEnergyMute();
62 template <
class T>
inline 73 template <
class T>
inline 78 template <
class T>
inline 83 template <
class T>
inline 88 template <
class T>
inline 93 template <
class T>
inline 98 template <
class T>
inline 119 template <
class T>
inline 128 if ( sample<0 || sample>=
size_ )
138 template <
class T>
inline 141 for (
int idx=0; idx<=stop; idx++ )
143 const T value =
input_->value(idx);
172 for (
int idx=
mCast(
int,start); idx<=stop; idx++ )
180 if ( energyidx<0 || energyidx>=
size_ )
191 if ( nrenergies ) energysum /= nrenergies;
196 const T inpval =
input_->value(idx);
197 outputval =
mIsUdf( inpval )
201 output_->setValue( idx, outputval );
#define mIsUdf(val)
Use mIsUdf to check for undefinedness of simple types.
Definition: undefval.h:285
Is an object that faciliates many threads to wait for something to happen.
Definition: thread.h:108
void computeEnergyMute()
Definition: agc.h:120
float getMuteFraction() const
Definition: agc.h:37
void sortFor(T *arr, I sz, I itarget)
Definition: sorting.h:236
od_int64 nrIterations() const
Definition: agc.h:46
#define mIsZero(x, eps)
Definition: commondefs.h:55
#define mCast(tp, v)
Definition: commondefs.h:120
#define od_int64
Definition: plftypes.h:34
void setMuteFraction(float lvmf)
The lowest fraction will be muted.
Definition: agc.h:35
int threadsinenergycalc_
Definition: agc.h:56
bool doWork(od_int64, od_int64, int)
Definition: agc.h:139
TypeSet< T > energies_
Definition: agc.h:53
T energymute_
Definition: agc.h:54
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:64
float mutefraction_
Definition: agc.h:52
Threads::ConditionVar * lock_
Definition: agc.h:57
void setSampleGate(const Interval< int > &)
Definition: agc.h:89
AGC()
Definition: agc.h:63
Set of (small) copyable elements.
Definition: commontypes.h:26
ValueSeries< T > * output_
Definition: agc.h:50
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:270
void setInput(const ValueSeries< T > &, int sz)
Definition: agc.h:79
const Interval< int > & getSampleGate() const
Definition: agc.h:94
Interface to a series of values.
Definition: odmemory.h:15
#define mNINT64(x)
Definition: commondefs.h:49
const ValueSeries< T > * input_
Definition: agc.h:48
bool doPrepare(int nrthreads)
Definition: agc.h:99
void setOutput(ValueSeries< T > &)
Output can be the same as input.
Definition: agc.h:84
T stop
Definition: ranges.h:91
Computes an AGC over a ValueSeries.
Definition: agc.h:23
#define mAllocLargeVarLenArr(type, varnm, __size)
Definition: varlenarray.h:29
T start
Definition: ranges.h:90
~AGC()
Definition: agc.h:74
int minThreadSize() const
Definition: agc.h:45
#define mClass(module)
Definition: commondefs.h:161
od_int64 size_
Definition: agc.h:49
Interval< int > samplerg_
Definition: agc.h:51