The DCT module comprises a heavily optimised DCT function that needs to run in a thread of its own (since it uses all registers of the processor). The DCT function operates in place on 8x8 blocks of 2D data. A block of data is to be stored in memory, the address is to be passed to the function, and on completion the pointer is returned. Between outputting the address, and getting it back, the buffer is owned by the DCT-thread, and shall not be used by any other thread. A common scheme would use a triple buffering scheme, where one buffer is filled with new data, whilst a second buffer is transformed by the DCT thread, whilst the third buffer is compressed using the huffman module.
This function performs zero or more DCT operations, and quantises the result.
Each block address is sent to the DCT process over the channel, and when done the address is sent out over the channel. It is streaming so that a block can always be waiting in the channel. This function should be running inside a thread, and is interfaced to through the streaming channel.
The quant array should have been preprocessed using the quantDCT function.
The functions doDCT and endDCT can be used to interact with the forwardDCT function; if full parallelism is required, then a block address should be sent over the channel, and subsequently a block address should be input for every block address that is output. Some form of double buffering is required to make sure that forwardDCT() “owns” the buffer that it operates on.
This function does not return until it receives an ‘END’ control token over its channel.
Parameters: |
|
---|
This is an Interface function to synchronously perform a DCT operation on a single datablock.
Parameters: |
|
---|
This interface function terminates the forwardDCT function.
Parameters: |
|
---|
This function preprocesses the quantisation table for use by forwardDCT.
Note that the preprocessed table is one word longer than the input table.
Parameters: |
|
---|
}
}
int quant2[65]; quantDCT(quant2, quant);
}
}