41 bool doPrepare(
int nrthreads);
45 void computeEnergyMute();
64 template <
class T>
inline 75 template <
class T>
inline 80 template <
class T>
inline 85 template <
class T>
inline 90 template <
class T>
inline 95 template <
class T>
inline 100 template <
class T>
inline 121 template <
class T>
inline 130 if ( sample<0 || sample>=
size_ )
140 template <
class T>
inline 143 for (
int idx=0; idx<=stop; idx++ )
145 const T value =
input_->value(idx);
174 for (
int idx=
mCast(
int,start); idx<=stop; idx++ )
182 if ( energyidx<0 || energyidx>=
size_ )
193 if ( nrenergies ) energysum /= nrenergies;
199 outputval =
mIsUdf( inpval )
203 output_->setValue( idx, outputval );
#define mIsUdf(val)
Use mIsUdf to check for undefinedness of simple types.
Definition: undefval.h:287
Is an object that faciliates many threads to wait for something to happen.
Definition: thread.h:108
void computeEnergyMute()
Definition: agc.h:122
float getMuteFraction() const
Definition: agc.h:39
void sortFor(T *arr, I sz, I itarget)
Definition: sorting.h:238
od_int64 nrIterations() const
Definition: agc.h:48
#define mIsZero(x, eps)
Definition: commondefs.h:53
#define mCast(tp, v)
Definition: commondefs.h:124
#define od_int64
Definition: plftypes.h:36
void setMuteFraction(float lvmf)
The lowest fraction will be muted.
Definition: agc.h:37
int threadsinenergycalc_
Definition: agc.h:58
bool doWork(od_int64, od_int64, int)
Definition: agc.h:141
TypeSet< T > energies_
Definition: agc.h:55
T energymute_
Definition: agc.h:56
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
const T inpval
Definition: arrayndalgo.h:1661
float mutefraction_
Definition: agc.h:54
Threads::ConditionVar * lock_
Definition: agc.h:59
void setSampleGate(const Interval< int > &)
Definition: agc.h:91
AGC()
Definition: agc.h:65
Set of (small) copyable elements.
Definition: commontypes.h:30
ValueSeries< T > * output_
Definition: agc.h:52
#define mUdf(type)
Use this macro to get the undefined for simple types.
Definition: undefval.h:272
void setInput(const ValueSeries< T > &, int sz)
Definition: agc.h:81
const Interval< int > & getSampleGate() const
Definition: agc.h:96
Interface to a series of values.
Definition: odmemory.h:17
#define mNINT64(x)
Definition: commondefs.h:46
const ValueSeries< T > * input_
Definition: agc.h:50
bool doPrepare(int nrthreads)
Definition: agc.h:101
void sysMemCopy(void *, const void *, int64_t)
void setOutput(ValueSeries< T > &)
Output can be the same as input.
Definition: agc.h:86
T stop
Definition: ranges.h:93
Computes an AGC over a ValueSeries.
Definition: agc.h:25
#define mAllocLargeVarLenArr(type, varnm, __size)
Definition: varlenarray.h:31
T start
Definition: ranges.h:92
~AGC()
Definition: agc.h:76
int minThreadSize() const
Definition: agc.h:47
#define mClass(module)
Definition: commondefs.h:164
od_int64 size_
Definition: agc.h:51
Interval< int > samplerg_
Definition: agc.h:53