![]() |
Synergy Software Package User's Manual
|
Driver for the JPEG CODEC. More...
Data Structures | |
| struct | jpeg_decode_instance_ctrl_t |
Functions | |
| ssp_err_t | R_JPEG_Decode_Open (jpeg_decode_ctrl_t *const p_api_ctrl, jpeg_decode_cfg_t const *const p_cfg) |
| Initialize the JPEG Codec module. This function configures the JPEG Codec for decoding operation, sets up the registers for data format and pixel format based on user-supplied configuration parameters. Interrupts are enabled to support image size read operation and callback functions. More... | |
| ssp_err_t | R_JPEG_Decode_OutputBufferSet (jpeg_decode_ctrl_t *p_api_ctrl, void *p_output_buffer, uint32_t output_buffer_size) |
| Assign output buffer to the JPEG Codec for storing output data. More... | |
| ssp_err_t | R_JPEG_Decode_LinesDecodedGet (jpeg_decode_ctrl_t *p_api_ctrl, uint32_t *p_lines) |
| Returns the number of lines decoded into the output buffer. More... | |
| ssp_err_t | R_JPEG_Decode_InputBufferSet (jpeg_decode_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_Decode_ImageSubsampleSet (jpeg_decode_ctrl_t *const p_api_ctrl, jpeg_decode_subsample_t horizontal_subsample, jpeg_decode_subsample_t vertical_subsample) |
| Configure horizontal and vertical subsample. More... | |
| ssp_err_t | R_JPEG_Decode_HorizontalStrideSet (jpeg_decode_ctrl_t *p_api_ctrl, uint32_t horizontal_stride) |
| Configure horizontal stride setting. More... | |
| ssp_err_t | R_JPEG_Decode_Close (jpeg_decode_ctrl_t *p_api_ctrl) |
| Cancel an outstanding JPEG codec operation and close the device. More... | |
| ssp_err_t | R_JPEG_Decode_ImageSizeGet (jpeg_decode_ctrl_t *p_api_ctrl, uint16_t *p_horizontal_size, uint16_t *p_vertical_size) |
| Obtain the size of the image. This operation is valid during JPEG decoding operation. More... | |
| ssp_err_t | R_JPEG_Decode_StatusGet (jpeg_decode_ctrl_t *p_api_ctrl, jpeg_decode_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_Decode_PixelFormatGet (jpeg_decode_ctrl_t *p_api_ctrl, jpeg_decode_color_space_t *p_color_space) |
| Get the input pixel format. More... | |
| ssp_err_t | R_JPEG_Decode_VersionGet (ssp_version_t *p_version) |
| Get version of the display interface and GLCD HAL code. More... | |
Driver for the JPEG CODEC.
| ssp_err_t R_JPEG_Decode_Close | ( | jpeg_decode_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_Decode_HorizontalStrideSet | ( | jpeg_decode_ctrl_t * | p_api_ctrl, |
| uint32_t | horizontal_stride | ||
| ) |
Configure horizontal stride setting.
| SSP_SUCCESS | Horizontal Stride value is properly configured. |
| SSP_ERR_ASSERTION | Pointer to the control block is NULL. |
| SSP_ERR_INVALID_ALIGNMENT | Horizontal stride is zero or not 8-byte aligned. |
| SSP_ERR_NOT_OPEN | JPEG not opened. |
Record the horizontal stride value in the control block
Set the horizontal stride.
If the parameters all are set, resume the core to decode.
For the given buffer size, compute number of lines to decode.
| ssp_err_t R_JPEG_Decode_ImageSizeGet | ( | jpeg_decode_ctrl_t * | p_api_ctrl, |
| uint16_t * | p_horizontal_size, | ||
| uint16_t * | p_vertical_size | ||
| ) |
Obtain the size of the image. This operation is valid during JPEG decoding operation.
| SSP_SUCCESS | The image size is available and the horizontal and vertical values are stored in the memory pointed to by p_horizontal_size and p_vertical_size. |
| SSP_ERR_ASSERTION | Pointer to the control block is NULL. |
| SSP_ERR_IMAGE_SIZE_UNKNOWN | The image size is unknown. More input data may be needed. |
| SSP_ERR_INVALID_MODE | JPEG Codec module is not decoding. |
| SSP_ERR_NOT_OPEN | JPEG is not opened. |
| ssp_err_t R_JPEG_Decode_ImageSubsampleSet | ( | jpeg_decode_ctrl_t *const | p_api_ctrl, |
| jpeg_decode_subsample_t | horizontal_subsample, | ||
| jpeg_decode_subsample_t | vertical_subsample | ||
| ) |
Configure horizontal and vertical subsample.
| SSP_SUCCESS | Horizontal Stride value is properly configured. |
| SSP_ERR_ASSERTION | Pointer to the control block is NULL. |
| SSP_ERR_INVALID_ARGUMENT | Sub-sample setting is invalid. |
| SSP_ERR_NOT_OPEN | JPEG not opened. |
Update horizontal sub-sample setting.
| ssp_err_t R_JPEG_Decode_InputBufferSet | ( | jpeg_decode_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 decoding operation automatically starts after both the input buffer and the output buffer are set, and the output buffer is big enough to hold at least one line of decoded image data.
| 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 input_buffer is NULL, or the input_buffer_size is 0. |
| SSP_ERR_INVALID_ALIGNMENT | Buffer starting address is not 8-byte aligned. |
| SSP_ERR_NOT_OPEN | JPEG not opened. |
Configure the input buffer address.
If the system is idle, start the JPEG engine. This allows the system to obtain image information (image size and input pixel format). This information is needed to drive the decode process later on.
Based on buffer size, detect the in count mode setting. The driver is able to read input data in chunks. However the size of each chunk is limited to BUFFER_MAX_SIZE. Therefore, if the input data size is larger than BUFFER_MAX_SIZE, the driver assumes the entire input data is present, and can be decoded without additional input data. Otherwise, the driver enables input stream feature. This works even if the entire input size is smaller than BUFFER_MAX_SIZE.
| ssp_err_t R_JPEG_Decode_LinesDecodedGet | ( | jpeg_decode_ctrl_t * | p_api_ctrl, |
| uint32_t * | p_lines | ||
| ) |
Returns the number of lines decoded into the output buffer.
| 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_NOT_OPEN | JPEG not opened. |
| ssp_err_t R_JPEG_Decode_Open | ( | jpeg_decode_ctrl_t *const | p_api_ctrl, |
| jpeg_decode_cfg_t const *const | p_cfg | ||
| ) |
Initialize the JPEG Codec module. This function configures the JPEG Codec for decoding operation, sets up the registers for data format and pixel format based on user-supplied configuration parameters. Interrupts are enabled to support image size read operation and callback functions.
| 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. |
Verify JPEG Codec is not already used.
Update the common control parameter with the control and JEDI and JDTI callback handler for JPEG decode, the handlers will be called from r_jpeg_common, which implements JPEG JDTI and JEDI ISR for r_jpeg_decode and r_jpeg_encode driver.
Record the configuration settings.
Initialize horizontal stride value.
Initialize output buffer size.
Initialize total_lines_decoded
Initialize horizontal sub-sample setting.
Provide power to the JPEG module.
Clear the image horizontal and vertical size, before starting the JPEG decode
Perform bus reset
Reset the destination buffer address.
Reset the source buffer address.
Reset the horizontal stride.
Configure the JPEG module for decode operation.
Set image format for the decoded image.
If the output pixel format is ARGB8888, also configure the alpha value.
Set the alpha value for the decoded image.
Set the output data format.
The following interrupts are enabled: Interrupt on all errors Interrupt on Image Size
Record user supplied callback routine.
Set the driver status.
All done. Return success.
| ssp_err_t R_JPEG_Decode_OutputBufferSet | ( | jpeg_decode_ctrl_t * | p_api_ctrl, |
| void * | p_output_buffer, | ||
| uint32_t | output_buffer_size | ||
| ) |
Assign output buffer to the JPEG Codec for storing output data.
The JPEG decoding operation automatically starts after both the input buffer and the output buffer are set, and the output buffer is big enough to hold at least eight lines of decoded image 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_JPEG_BUFFERSIZE_NOT_ENOUGH | Invalid buffer size |
Set the decoding destination address.
Record the size of the output buffer.
If the image size is not ready yet, the driver does not know the input pixel format. Without that information, the driver is unable to compute the number of lines of image to decode. In this case, the driver would record the output buffer size. Once all the information is ready, the driver would attempt to start the decoding process.
For a given buffer size, compute number of lines to decode if the image size acquisition is known.
If the driver status is IMAGE_SIZE_READY with no other flags, that means the driver just received IMAGE_SIZE. It has not started the decoding process yet.
If Input buffer is set, output buffer is set, and horizontal stride is set, the driver is able to determine the number of lines to decode, and start the decoding operation.
If the current status is OUTPUT_PAUSE, the driver needs to resume the operation.
| ssp_err_t R_JPEG_Decode_PixelFormatGet | ( | jpeg_decode_ctrl_t * | p_api_ctrl, |
| jpeg_decode_color_space_t * | p_color_space | ||
| ) |
Get the input pixel format.
| SSP_SUCCESS | The status information is successfully retrieved. |
| SSP_ERR_ASSERTION | Pointer to the control block is NULL. |
| SSP_ERR_NOT_OPEN | JPEG is not opened. |
HW does not report error. Return internal status information.
| ssp_err_t R_JPEG_Decode_StatusGet | ( | jpeg_decode_ctrl_t * | p_api_ctrl, |
| jpeg_decode_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. |
| SSP_ERR_NOT_OPEN | JPEG is not opened. |
HW does not report error. Return internal status information.
| ssp_err_t R_JPEG_Decode_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. |