AV module

FPSCounter

FPS counter based on the simple moving average (SMA) algorithm.

#include <icy/av/fpscounter.h>

class FPSCounter

Defined in src/av/include/icy/av/fpscounter.h:27

Public Attributes

ReturnNameDescription
doublefps
int64_tframes

fps

double fps

Defined in src/av/include/icy/av/fpscounter.h:48


frames

int64_t frames

Defined in src/av/include/icy/av/fpscounter.h:49

Public Methods

ReturnNameDescription
FPSCounter inlineInitialise the counter with all zeroes.
voidreset inlineReset all counters and the SMA window to zero.
voidtick inlineRecord a new frame and update the FPS estimate. Must be called once per frame. Updates fps and increments frames.

FPSCounter

inline

inline FPSCounter()

Defined in src/av/include/icy/av/fpscounter.h:52

Initialise the counter with all zeroes.


reset

inline

inline void reset()

Defined in src/av/include/icy/av/fpscounter.h:55

Reset all counters and the SMA window to zero.


tick

inline

inline void tick()

Defined in src/av/include/icy/av/fpscounter.h:68

Record a new frame and update the FPS estimate. Must be called once per frame. Updates fps and increments frames.

Private Attributes

ReturnNameDescription
inttickIndex
clock_tprevTick
clock_ttickSum
clock_ttickList

tickIndex

int tickIndex

Defined in src/av/include/icy/av/fpscounter.h:32


prevTick

clock_t prevTick

Defined in src/av/include/icy/av/fpscounter.h:33


tickSum

clock_t tickSum

Defined in src/av/include/icy/av/fpscounter.h:34


tickList

clock_t tickList[MAX]

Defined in src/av/include/icy/av/fpscounter.h:35

Private Methods

ReturnNameDescription
doubleupdateAvg inline

updateAvg

inline

inline double updateAvg(clock_t newTick)

Defined in src/av/include/icy/av/fpscounter.h:37

Private Static Attributes

ReturnNameDescription
const intMAX static

MAX

static

const int MAX = 100

Defined in src/av/include/icy/av/fpscounter.h:30