![]() |
Synergy Software Package User's Manual
|
Driver for the JPEG CODEC. More...
Data Structures | |
| struct | jpeg_encode_instance_ctrl_t |
Macros | |
| #define | JPEG_ENCODE_CODE_VERSION_MAJOR (2U) |
Functions | |
| ssp_err_t | R_JPEG_Encode_Open (jpeg_encode_ctrl_t *const p_api_ctrl, jpeg_encode_cfg_t const *const p_cfg) |
| Initialize the JPEG Codec module. This function configures the JPEG Codec for encoding operation, sets up the registers for data format, pixel format, vertical and horizontal resolution stride based on user-supplied configuration parameters. More... | |
| ssp_err_t | R_JPEG_Encode_OutputBufferSet (jpeg_encode_ctrl_t *p_api_ctrl, void *p_output_buffer) |
| Assign output buffer to the JPEG Codec for storing output data. More... | |
| ssp_err_t | R_JPEG_Encode_InputBufferSet (jpeg_encode_ctrl_t *const p_api_ctrl, void *p_data_buffer, uint32_t data_buffer_size) |
| Assign input data buffer to JPEG codec for processing. More... | |
| ssp_err_t | R_JPEG_Encode_ImageParameterSet (jpeg_encode_ctrl_t *const p_api_ctrl, jpeg_encode_raw_image_parameters *p_image_parameters) |
| Setup the image parameters to JPEG Codec device. More... | |
| ssp_err_t | R_JPEG_Encode_StatusGet (jpeg_encode_ctrl_t *p_api_ctrl, volatile jpeg_encode_status_t *p_status) |
| Get the status of the JPEG codec. This function can also be used to poll the device. More... | |
| ssp_err_t | R_JPEG_Encode_Close (jpeg_encode_ctrl_t *p_api_ctrl) |
| Cancel an outstanding JPEG codec operation and close the device. More... | |
| ssp_err_t | R_JPEG_Encode_VersionGet (ssp_version_t *p_version) |
| Get version of the display interface and GLCD HAL code. More... | |
Driver for the JPEG CODEC.
| #define JPEG_ENCODE_CODE_VERSION_MAJOR (2U) |
Configuration for this module
| ssp_err_t R_JPEG_Encode_Close | ( | jpeg_encode_ctrl_t * | p_api_ctrl | ) |
Cancel an outstanding JPEG codec operation and close the device.
| SSP_SUCCESS | The input data buffer is properly assigned to JPEG Codec device. |
| SSP_ERR_ASSERTION | Pointer to the control block is NULL. |
| SSP_ERR_NOT_OPEN | JPEG not opened. |
Clear JPEG JINTE0 interrupt and JINTE1 interrupt.
Disable JEDI and JDTI at NVIC
Power off the JPEG codec.
Reset the jpeg status flag in the driver.
Unlock module at BSP level.
| ssp_err_t R_JPEG_Encode_ImageParameterSet | ( | jpeg_encode_ctrl_t *const | p_api_ctrl, |
| jpeg_encode_raw_image_parameters * | p_image_parameters | ||
| ) |
Setup the image parameters to JPEG Codec device.
| SSP_SUCCESS | Image parameter is properly assigned to JPEG Codec device. |
| SSP_ERR_ASSERTION | Pointer to the control block is NULL, |
| SSP_ERR_INVALID_ALIGNMENT | Horizontal stride is not 8-byte aligned. |
| SSP_ERR_INVALID_ARGUMENT | Horizontal and Vertical resolution is invalid or zero. |
| SSP_ERR_NOT_OPEN | JPEG not opened. |
| SSP_ERR_INVALID_CALL | An invalid call has been made. |
Do not change the JPEG Codec image setting while JPEG Codec is in progress
Record the horizontal stride and vertical size value in the control block
Set the horizontal stride.
Set the image horizontal and vertical size.
| ssp_err_t R_JPEG_Encode_InputBufferSet | ( | jpeg_encode_ctrl_t *const | p_api_ctrl, |
| void * | p_data_buffer, | ||
| uint32_t | data_buffer_size | ||
| ) |
Assign input data buffer to JPEG codec for processing.
The JPEG encoding operation automatically starts after setting the input buffer.
| SSP_SUCCESS | The input data buffer is properly assigned to JPEG Codec device. |
| SSP_ERR_ASSERTION | Pointer to the control block is NULL, or the pointer to the p_data_buffer is NULL. |
| SSP_ERR_INVALID_ALIGNMENT | Buffer starting address or image line to encode or size of buffer is not 8-byte aligned. |
| SSP_ERR_NOT_OPEN | JPEG not opened. |
| SSP_ERR_INVALID_CALL | An invalid call has been made, set output buffer first |
| SSP_ERR_JPEG_IMAGE_SIZE_ERROR | Image size is not supported by JPEG Codec |
Validate the the size : JPEG Codec can process minimum up to 8 lines by 16 pixel for YCbCr422 meaning 8x16x2 = 256
Calculate the number of lines to be encode
JPEG Codec required Lines to be byte aligned
Check, If output image buffer is set or not
Configure the input buffer address.
if JPEG is just opened or completed one image, make DONE and IDLE status flag zero to encode next image
Remove the Done and IDLE status flag
Set the driver status to JPEG_ENCODE_STATUS_RUNNING.
Start the encoder
JPEG is PAUSE for next chunk of image
Clear internal status information.
Set RUNNING status
Resume the count mode
JPEG is running Notify the user, return error
| ssp_err_t R_JPEG_Encode_Open | ( | jpeg_encode_ctrl_t *const | p_api_ctrl, |
| jpeg_encode_cfg_t const *const | p_cfg | ||
| ) |
Initialize the JPEG Codec module. This function configures the JPEG Codec for encoding operation, sets up the registers for data format, pixel format, vertical and horizontal resolution stride based on user-supplied configuration parameters.
| SSP_SUCCESS | JPEG Codec module is properly configured and is ready to take input data. |
| SSP_ERR_IN_USE | JPEG Codec is already in use. |
| SSP_ERR_ASSERTION | Pointer to the control block or the configuration structure is NULL. |
| SSP_ERR_HW_LOCKED | JPEG Codec resource is locked. |
| SSP_ERR_INVALID_ARGUMENT | Invalid parameter is passed. |
| SSP_ERR_INVALID_ALIGNMENT | Horizontal stride is not 8-byte aligned. |
Verify JPEG Codec is not already used.
Update the common control parameter with the control and JDEI and JDTI callback handler for JPEG encode, the handlers will be called from r_jpeg_common, which implements JPEG JDTI and JDEI ISR for r_jpeg_decode and r_jpeg_encode driver.
Get the JDTI event information from FMI
Get the vector table information of JDTI event
Record the JPEG Encoder ctrl and internal ISR callback handler to JDTI event vector table
Get the JEDI event information from FMI
Get the vector table information of JEDI event
Record the JPEG Encoder ctrl and internal ISR callback handler to JEDI event vector table
Provide power to the JPEG module.
Perform bus reset
Reset the destination buffer address.
Reset the source buffer address.
Set the horizontal stride.
Set the image horizontal and vertical size.
Configure the JPEG module for encode operation.
Set the output data format.
Set input pixel format for JPEG Encoder NOTE : only ycbcr422 is valid for encoder
Quantization table setting NOTE: Table 0(zero) is used for Luminance and Table 1(one) is used for Chrominance - Cr and Cb component
Upload Luminance and Chrominance table to JPEG Codec
Huffman table setting
Upload the Huffman table to JPEG Codec
Reset Marker setting
Record image parameters to ctrl
Set the driver status.
Record the user context information
Record user supplied callback routine.
Enabled JPEG Compression data transfer complete interrupt and Count mode Interrupt
Enable the JDTI and JDEI interrupts
All done. Return success.
| ssp_err_t R_JPEG_Encode_OutputBufferSet | ( | jpeg_encode_ctrl_t * | p_api_ctrl, |
| void * | p_output_buffer | ||
| ) |
Assign output buffer to the JPEG Codec for storing output data.
| SSP_SUCCESS | The output buffer is properly assigned to JPEG codec device. |
| SSP_ERR_ASSERTION | Pointer to the control block is NULL, or the pointer to the output_buffer. is NULL, or the output_buffer_size is 0. |
| SSP_ERR_INVALID_ALIGNMENT | Buffer starting address is not 8-byte aligned. |
| SSP_ERR_NOT_OPEN | JPEG not opened. |
| SSP_ERR_INVALID_CALL | An invalid call has been made, Codec output buffer address is attempted to changed during codec operation |
Output buffer cannot be change during codec operation
Set the encoding destination address.
| ssp_err_t R_JPEG_Encode_StatusGet | ( | jpeg_encode_ctrl_t * | p_api_ctrl, |
| volatile jpeg_encode_status_t * | p_status | ||
| ) |
Get the status of the JPEG codec. This function can also be used to poll the device.
| SSP_SUCCESS | The status information is successfully retrieved. |
| SSP_ERR_ASSERTION | Pointer to the control block is NULL. |
HW does not report error. Return internal status information.
| ssp_err_t R_JPEG_Encode_VersionGet | ( | ssp_version_t * | p_version | ) |
Get version of the display interface and GLCD HAL code.
| SSP_SUCCESS | Version number |
| SSP_ERR_ASSERTION | The parameter p_version is NULL. |