#include <stdint.h>#include <string.h>#include <stdio.h>Go to the source code of this file.
Data Structures | |
| struct | hpm_jpeg_image |
| struct | hpm_jpeg_jpeg_file |
| struct | hpm_jpeg_decode_info |
| struct | hpm_jpeg_encode_info |
| struct | hpm_jpeg_decode_cfg |
| struct | hpm_jpeg_encode_cfg |
| struct | hpm_jpeg_cfg |
Macros | |
| #define | HPM_JPEG_LOG_LEVEL HPM_JPEG_LOG_LEVEL_WARN |
| #define | HPM_JPEG_LOG_LEVEL_DEBUG 4 |
| #define | HPM_JPEG_LOG_LEVEL_INFO 3 |
| #define | HPM_JPEG_LOG_LEVEL_WARN 2 |
| #define | HPM_JPEG_LOG_LEVEL_ERR 1 |
| #define | HPM_JPEG_PRINTF(fmt, ...) printf(fmt, ##__VA_ARGS__); |
| #define | HPM_JPEG_DLOG(fmt, ...) |
| #define | HPM_JPEG_ILOG(fmt, ...) |
| #define | HPM_JPEG_WLOG(fmt, ...) |
| #define | HPM_JPEG_ELOG(fmt, ...) |
| #define | HPM_JPEG_RET_OK 0 |
| #define | HPM_JPEG_RET_MALLOC_ERR -1 |
| #define | HPM_JPEG_RET_PARA_ERR -2 |
| #define | HPM_JPEG_RET_JPEG_FILE_ERROR -3 |
| #define | HPM_JPEG_RET_STATUS_ERR -4 |
| #define | HPM_JPEG_RET_MARKER_ERR -5 |
Typedefs | |
| typedef void | hpm_jpeg_job_t |
| typedef enum hpm_jpeg_sampling_format | hpm_jpeg_sampling_format_t |
| typedef enum hpm_jpeg_image_format | hpm_jpeg_image_format_t |
| typedef struct hpm_jpeg_image | hpm_jpeg_image_t |
| typedef struct hpm_jpeg_jpeg_file | hpm_jpeg_file_t |
| typedef enum hpm_jpeg_job_status | hpm_jpeg_job_status_t |
| typedef struct hpm_jpeg_decode_info | hpm_jpeg_decode_info_t |
| typedef struct hpm_jpeg_encode_info | hpm_jpeg_encode_info_t |
| typedef struct hpm_jpeg_decode_cfg | hpm_jpeg_decode_cfg_t |
| typedef struct hpm_jpeg_encode_cfg | hpm_jpeg_encode_cfg_t |
| typedef void(* | hpm_jpeg_job_state_cb_t) (hpm_jpeg_job_t *job) |
| Job't state info notice callback. More... | |
| typedef struct hpm_jpeg_cfg | hpm_jpeg_cfg_t |
| #define HPM_JPEG_DLOG | ( | fmt, | |
| ... | |||
| ) |
| #define HPM_JPEG_ELOG | ( | fmt, | |
| ... | |||
| ) |
| #define HPM_JPEG_ILOG | ( | fmt, | |
| ... | |||
| ) |
| #define HPM_JPEG_LOG_LEVEL HPM_JPEG_LOG_LEVEL_WARN |
| #define HPM_JPEG_LOG_LEVEL_DEBUG 4 |
| #define HPM_JPEG_LOG_LEVEL_ERR 1 |
| #define HPM_JPEG_LOG_LEVEL_INFO 3 |
| #define HPM_JPEG_LOG_LEVEL_WARN 2 |
| #define HPM_JPEG_PRINTF | ( | fmt, | |
| ... | |||
| ) | printf(fmt, ##__VA_ARGS__); |
| #define HPM_JPEG_RET_JPEG_FILE_ERROR -3 |
| #define HPM_JPEG_RET_MALLOC_ERR -1 |
| #define HPM_JPEG_RET_MARKER_ERR -5 |
| #define HPM_JPEG_RET_OK 0 |
| #define HPM_JPEG_RET_PARA_ERR -2 |
| #define HPM_JPEG_RET_STATUS_ERR -4 |
| #define HPM_JPEG_WLOG | ( | fmt, | |
| ... | |||
| ) |
| typedef struct hpm_jpeg_cfg hpm_jpeg_cfg_t |
| typedef struct hpm_jpeg_decode_cfg hpm_jpeg_decode_cfg_t |
| typedef struct hpm_jpeg_decode_info hpm_jpeg_decode_info_t |
| typedef struct hpm_jpeg_encode_cfg hpm_jpeg_encode_cfg_t |
| typedef struct hpm_jpeg_encode_info hpm_jpeg_encode_info_t |
| typedef struct hpm_jpeg_jpeg_file hpm_jpeg_file_t |
| typedef enum hpm_jpeg_image_format hpm_jpeg_image_format_t |
| typedef struct hpm_jpeg_image hpm_jpeg_image_t |
| typedef void(* hpm_jpeg_job_state_cb_t) (hpm_jpeg_job_t *job) |
Job't state info notice callback.
| [in] | job | hpm_jpeg job pointer |
Note: The function is called in isr, long-time or complex operation are not recommend.
| typedef enum hpm_jpeg_job_status hpm_jpeg_job_status_t |
| typedef void hpm_jpeg_job_t |
| typedef enum hpm_jpeg_sampling_format hpm_jpeg_sampling_format_t |
| enum hpm_jpeg_job_status |
| hpm_jpeg_job_t* hpm_jpeg_decode_job_alloc | ( | hpm_jpeg_decode_cfg_t * | cfg | ) |
Alloc a decode job.
| [in] | cfg | job configuration pointer |
| int hpm_jpeg_decode_job_fill_file | ( | hpm_jpeg_job_t * | job, |
| const hpm_jpeg_file_t * | file, | ||
| int | direct | ||
| ) |
Fill jpeg file to job.
| [in] | job | decode job pointer |
| [in] | file | jpeg file data |
| [in] | direct | 1: The buffer of file will be used by decoder. 0: Firstly, the buffer of file is copied to internal buffer and the internal buffer will be used. |
| int hpm_jpeg_decode_job_force_direct_image_buf | ( | hpm_jpeg_job_t * | job, |
| void * | buf, | ||
| uint32_t | len | ||
| ) |
Set a buffer that is used by decoder out image to job.
| [in] | job | decode job pointer |
| [in] | buf | Receive decode image data. the buf will be used decoder, so nocacheable buffer is recommend. |
| [in] | len | The buf length |
Note: Internal buffer will be used if the buf have not been set.
| int hpm_jpeg_decode_job_free | ( | hpm_jpeg_job_t * | job | ) |
Free decode job. All source of job will be free.
| [in] | job | decode job pointer |
| int hpm_jpeg_decode_job_get_info | ( | hpm_jpeg_job_t * | job, |
| hpm_jpeg_decode_info_t * | info | ||
| ) |
Get job work info.
| [in] | job | decode job pointer |
| [out] | info | job work info pointer |
| int hpm_jpeg_decode_job_start | ( | hpm_jpeg_job_t * | job, |
| hpm_jpeg_job_state_cb_t | cb | ||
| ) |
Start decode of the job.
| [in] | job | decode job pointer |
| [in] | cb | job state notice callback |
Note: The cb is called in isr, long-time or complex operation are not recommend.
| int hpm_jpeg_decode_job_stop | ( | hpm_jpeg_job_t * | job | ) |
Stop decode of the job.
| [in] | job | decode job pointer |
| int hpm_jpeg_deinit | ( | void | ) |
Deinitializte hpm_jpeg component and free source.
| hpm_jpeg_job_t* hpm_jpeg_encode_job_alloc | ( | hpm_jpeg_encode_cfg_t * | cfg | ) |
Alloc a encode job.
| [in] | cfg | job configuration pointer |
| int hpm_jpeg_encode_job_fill_image | ( | hpm_jpeg_job_t * | job, |
| const hpm_jpeg_image_t * | image, | ||
| int | direct | ||
| ) |
Fill image data to job.
| [in] | job | encode job pointer |
| [in] | image | image data for waiting encode |
| [in] | direct | 1: The buffer of file will be used by encoder. 0: Firstly, the buffer of image is copied to internal buffer and the internal buffer will be used. |
| int hpm_jpeg_encode_job_force_direct_file_buf | ( | hpm_jpeg_job_t * | job, |
| void * | buf, | ||
| uint32_t | len | ||
| ) |
Set a buffer that is used by encoder out jpeg file to job.
| [in] | job | encode job pointer |
| [in] | buf | Receive encode jpeg file data. the buf will be used encoder, so nocacheable buffer is recommend. |
| [in] | len | The buf length |
Note: Internal buffer will be used if the buf have not been set.
| int hpm_jpeg_encode_job_free | ( | hpm_jpeg_job_t * | job | ) |
Free encode job. All source of job will be free.
| [in] | job | encode job pointer |
| int hpm_jpeg_encode_job_get_info | ( | hpm_jpeg_job_t * | job, |
| hpm_jpeg_encode_info_t * | info | ||
| ) |
Get job work info.
| [in] | job | encode job pointer |
| [out] | info | job work info pointer |
| int hpm_jpeg_encode_job_start | ( | hpm_jpeg_job_t * | job, |
| hpm_jpeg_job_state_cb_t | cb | ||
| ) |
Start encode of the job.
| [in] | job | encode job pointer |
| [in] | cb | job state notice callback |
Note: The cb is called in isr, long-time or complex operation are not recommend.
| int hpm_jpeg_encode_job_stop | ( | hpm_jpeg_job_t * | job | ) |
Stop encode of the job.
| [in] | job | encode job pointer |
| int hpm_jpeg_init | ( | hpm_jpeg_cfg_t * | cfg | ) |
Initializte hpm_jpeg component.
| [in] | cfg | hpm_jpeg configuration pointer |
| void hpm_jpeg_isr | ( | void | ) |
jpeg ip interrupt service routine
| void* hpm_jpeg_job_get_user_data | ( | hpm_jpeg_job_t * | job | ) |
Get user data to job.
| [in] | job | job pointer |
| void hpm_jpeg_job_set_user_data | ( | hpm_jpeg_job_t * | job, |
| void * | user_data | ||
| ) |
Set user data to job.
| [in] | job | job pointer |
| [in] | user_data | user data pointer |