6.4.4 DCTIP
Description
DCTIP computes the Discrete Cosine Transform of a source vector in place.
Prototype
fractcomplex* DCTIP (int log2N, fractcomplex* srcCV, fractcomplex* cosFactors, fractcomplex* twidFactors);
Arguments
|
Parameters |
Description |
|---|---|
|
log2N |
Base 2 logarithm of N (number of complex elements in source vector) |
|
srcCV |
Pointer to the source vector |
|
cosFactors |
Pointer to the cosine factors |
|
twidFactors |
Pointer to the twiddle factors |
Return
Pointer to the base address of the destination sample.
Remarks
N must be an integer power of 2.
This function expects that the source vector has been zero padded to length 2N.
The srcCV vector must be allocated in the Y-Data space with address alignment to a modulo of N.
The results of computation are stored in the first N elements of the source vector.
To avoid saturation (overflow) during computation, the values of the source vector should be in the range [-0.5, 0.5].
Only the first N/2 cosine factors are needed.
Only the first N/2 twiddle factors are needed.
The twiddle factors must be initialized with conjFlag set to a value different than zero.
Output is scaled by the factor of N.
Source File
- dct_aa.s
Function Profile
|
Program Words |
PIC32A |
|
64 |
|
Cycle count |
Transform Size |
PIC32A | |
|
Cycles if Twiddle Factors in X-mem |
Cycles if Twiddle Factors in P-mem | ||
|
32 |
2,468 |
3,556 | |
|
64 |
5,350 |
7,926 | |
|
128 |
11,668 |
17,636 | |
|
256 |
25,478 |
39,062 | |
|
512 |
55,364 |
85,844 | |
|
1024 |
119,798 |
187,398 | |
|
2048 |
257,812 |
406,308 | |
System resource usage
- W0…W7 - used, not restored
- W8…W11 - saved, used, restored
- ACCA - used, not restored
- CORCON - saved, used, restored
- REPEAT instruction(s) usage – 1
