ITANUPartitioningScheme.h 1.83 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
#ifndef IW_ITA_NUPC_PARTITIONING_SCHEME
#define IW_ITA_NUPC_PARTITIONING_SCHEME

#include <string>
#include <vector>

// Data class for parameters of non-uniform segments
class CUPartition
{
public:
	int iOffset;		//!< Offset in overall impulse response at which this segment begins
	int iPartLength;	//!< Part length in number of filter coefficients
	int iMultiplicity;	//!< Multiplicity in number of filter coefficients
	int iLength;		//!< Overall length in number of filter coefficients
	int iLevel;			//!< Index of segment in non-uniform segmentation

	/*
	 *  Spielraum der Berechnungszeit in Anzahl Blocklngen, d.h. die Zeitspanne
	 *  vom frhstmglichen Zeitpunkt der Berechnung der Stufe, bis zum sptest
	 *  mglichen. Wichtiges Feld! Wird zur Bestimmung der Deadlines von Tasks genutzt.
	 *  iClearance = 0 -> Task muss sofort nach seiner Erzeugung gerechnet werden,
	 *                    da er im nchstfolgenden Zyklus bereits Teil der Ausgabe ist.
	 */
	int iClearance;

	inline CUPartition()
		: iOffset( 0 )
		, iPartLength( 0 )
		, iMultiplicity( 0 )
		, iClearance( 0 )
		, iLevel( 0 )
	{};

	inline CUPartition( const int iOffset, const int iPartLength, const int iMultiplicity )
		: iOffset( iOffset )
		, iPartLength( iPartLength )
		, iMultiplicity( iMultiplicity )
		, iClearance( -1 )
		, iLevel( 0 )
	{
		iLength = iPartLength*iMultiplicity;
		
		//@todo: define clearence
	};
};

// Non-uniform partition
class NUPartition
{
public:
	int iLength;		//!< Overall length in number of filter coefficients
	int iNumSegments;		//!< Number of segment
	std::vector< CUPartition > voSegments;	//!< Segment list

	//! Creates a non-uniform partitioned filter with given parts and length
	/**
	  * Groups subsequent parts.
	  */
	NUPartition( const std::vector< int >& vParts );

	std::string ToString() const;
};

#endif // IW_ITA_NUPC_PARTITIONING_SCHEME