14 #ifndef HPM_JPEG_LOG_LEVEL
15 #define HPM_JPEG_LOG_LEVEL HPM_JPEG_LOG_LEVEL_WARN
18 #define HPM_JPEG_LOG_LEVEL_DEBUG 4
19 #define HPM_JPEG_LOG_LEVEL_INFO 3
20 #define HPM_JPEG_LOG_LEVEL_WARN 2
21 #define HPM_JPEG_LOG_LEVEL_ERR 1
23 #define HPM_JPEG_PRINTF(fmt, ...) printf(fmt, ##__VA_ARGS__);
25 #if HPM_JPEG_LOG_LEVEL >= HPM_JPEG_LOG_LEVEL_DEBUG
26 #define HPM_JPEG_DLOG(fmt, ...) ({\
27 printf("HPM_JPEG: [D: %s:%u]: ", __func__, __LINE__);\
28 printf(fmt, ##__VA_ARGS__);\
31 #define HPM_JPEG_DLOG(fmt, ...)
34 #if HPM_JPEG_LOG_LEVEL >= HPM_JPEG_LOG_LEVEL_INFO
35 #define HPM_JPEG_ILOG(fmt, ...) ({\
36 printf("HPM_JPEG: [I: %s:%u]: ", __func__, __LINE__);\
37 printf(fmt, ##__VA_ARGS__);\
40 #define HPM_JPEG_ILOG(fmt, ...)
43 #if HPM_JPEG_LOG_LEVEL >= HPM_JPEG_LOG_LEVEL_WARN
44 #define HPM_JPEG_WLOG(fmt, ...) ({\
45 printf("HPM_JPEG: [W: %s:%u]: ", __func__, __LINE__);\
46 printf(fmt, ##__VA_ARGS__);\
49 #define HPM_JPEG_WLOG(fmt, ...)
52 #if HPM_JPEG_LOG_LEVEL >= HPM_JPEG_LOG_LEVEL_ERR
53 #define HPM_JPEG_ELOG(fmt, ...) ({\
54 printf("HPM_JPEG: [E: %s:%u]: ", __func__, __LINE__);\
55 printf(fmt, ##__VA_ARGS__);\
58 #define HPM_JPEG_ELOG(fmt, ...)
61 #define HPM_JPEG_RET_OK 0
62 #define HPM_JPEG_RET_MALLOC_ERR -1
63 #define HPM_JPEG_RET_PARA_ERR -2
64 #define HPM_JPEG_RET_JPEG_FILE_ERROR -3
65 #define HPM_JPEG_RET_STATUS_ERR -4
66 #define HPM_JPEG_RET_MARKER_ERR -5
147 void * (*malloc)(uint32_t
size);
static void size
Definition: hpm_math.h:6938
struct hpm_jpeg_encode_info hpm_jpeg_encode_info_t
hpm_jpeg_job_t * hpm_jpeg_encode_job_alloc(hpm_jpeg_encode_cfg_t *cfg)
Alloc a encode job.
Definition: hpm_jpeg.c:1948
int hpm_jpeg_encode_job_stop(hpm_jpeg_job_t *job)
Stop encode of the job.
Definition: hpm_jpeg.c:2239
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.
Definition: hpm_jpeg.c:1781
enum hpm_jpeg_image_format hpm_jpeg_image_format_t
enum hpm_jpeg_sampling_format hpm_jpeg_sampling_format_t
int hpm_jpeg_encode_job_free(hpm_jpeg_job_t *job)
Free encode job. All source of job will be free.
Definition: hpm_jpeg.c:2269
struct hpm_jpeg_image hpm_jpeg_image_t
hpm_jpeg_image_format
Definition: hpm_jpeg.h:78
@ HPM_JPEG_IMAGE_FORMAT_BGRA8888
Definition: hpm_jpeg.h:81
@ HPM_JPEG_IMAGE_FORMAT_RGB565
Definition: hpm_jpeg.h:79
@ HPM_JPEG_IMAGE_FORMAT_YUYV422
Definition: hpm_jpeg.h:82
@ HPM_JPEG_IMAGE_FORMAT_ARGB8888
Definition: hpm_jpeg.h:80
@ HPM_JPEG_IMAGE_FORMAT_Y8
Definition: hpm_jpeg.h:84
@ HPM_JPEG_IMAGE_FORMAT_UYVY422
Definition: hpm_jpeg.h:83
struct hpm_jpeg_decode_info hpm_jpeg_decode_info_t
void hpm_jpeg_job_set_user_data(hpm_jpeg_job_t *job, void *user_data)
Set user data to job.
Definition: hpm_jpeg.c:2288
void hpm_jpeg_isr(void)
jpeg ip interrupt service routine
Definition: hpm_jpeg.c:2377
int hpm_jpeg_decode_job_get_info(hpm_jpeg_job_t *job, hpm_jpeg_decode_info_t *info)
Get job work info.
Definition: hpm_jpeg.c:1917
void(* hpm_jpeg_job_state_cb_t)(hpm_jpeg_job_t *job)
Job't state info notice callback.
Definition: hpm_jpeg.h:143
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.
Definition: hpm_jpeg.c:2116
struct hpm_jpeg_jpeg_file hpm_jpeg_file_t
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.
Definition: hpm_jpeg.c:1973
int hpm_jpeg_init(hpm_jpeg_cfg_t *cfg)
Initializte hpm_jpeg component.
Definition: hpm_jpeg.c:2302
int hpm_jpeg_encode_job_get_info(hpm_jpeg_job_t *job, hpm_jpeg_encode_info_t *info)
Get job work info.
Definition: hpm_jpeg.c:2257
int hpm_jpeg_decode_job_free(hpm_jpeg_job_t *job)
Free decode job. All source of job will be free.
Definition: hpm_jpeg.c:1929
void * hpm_jpeg_job_get_user_data(hpm_jpeg_job_t *job)
Get user data to job.
Definition: hpm_jpeg.c:2295
int hpm_jpeg_decode_job_start(hpm_jpeg_job_t *job, hpm_jpeg_job_state_cb_t cb)
Start decode of the job.
Definition: hpm_jpeg.c:1802
int hpm_jpeg_deinit(void)
Deinitializte hpm_jpeg component and free source.
Definition: hpm_jpeg.c:2325
int hpm_jpeg_decode_job_stop(hpm_jpeg_job_t *job)
Stop decode of the job.
Definition: hpm_jpeg.c:1899
struct hpm_jpeg_encode_cfg hpm_jpeg_encode_cfg_t
enum hpm_jpeg_job_status hpm_jpeg_job_status_t
hpm_jpeg_sampling_format
Definition: hpm_jpeg.h:70
@ HPM_JPEG_SAMPLING_FORMAT_400
Definition: hpm_jpeg.h:75
@ HPM_JPEG_SAMPLING_FORMAT_422V
Definition: hpm_jpeg.h:73
@ HPM_JPEG_SAMPLING_FORMAT_420
Definition: hpm_jpeg.h:71
@ HPM_JPEG_SAMPLING_FORMAT_444
Definition: hpm_jpeg.h:74
@ HPM_JPEG_SAMPLING_FORMAT_422H
Definition: hpm_jpeg.h:72
struct hpm_jpeg_cfg hpm_jpeg_cfg_t
int hpm_jpeg_encode_job_start(hpm_jpeg_job_t *job, hpm_jpeg_job_state_cb_t cb)
Start encode of the job.
Definition: hpm_jpeg.c:2137
void hpm_jpeg_job_t
Definition: hpm_jpeg.h:68
hpm_jpeg_job_t * hpm_jpeg_decode_job_alloc(hpm_jpeg_decode_cfg_t *cfg)
Alloc a decode job.
Definition: hpm_jpeg.c:1685
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.
Definition: hpm_jpeg.c:1708
hpm_jpeg_job_status
Definition: hpm_jpeg.h:100
@ HPM_JPEG_JOB_STATUS_FILL_FAILED
Definition: hpm_jpeg.h:103
@ HPM_JPEG_JOB_STATUS_FINISHED
Definition: hpm_jpeg.h:109
@ HPM_JPEG_JOB_STATUS_STOPPED
Definition: hpm_jpeg.h:110
@ HPM_JPEG_JOB_STATUS_ALLOCED
Definition: hpm_jpeg.h:101
@ HPM_JPEG_JOB_STATUS_FILLING
Definition: hpm_jpeg.h:102
@ HPM_JPEG_JOB_STATUS_PROCESSING
Definition: hpm_jpeg.h:108
@ HPM_JPEG_JOB_STATUS_START_FAILED
Definition: hpm_jpeg.h:106
@ HPM_JPEG_JOB_STATUS_STARTING
Definition: hpm_jpeg.h:105
@ HPM_JPEG_JOB_STATUS_ERROR
Definition: hpm_jpeg.h:111
@ HPM_JPEG_JOB_STATUS_FILLED
Definition: hpm_jpeg.h:104
@ HPM_JPEG_JOB_STATUS_WAITING
Definition: hpm_jpeg.h:107
struct hpm_jpeg_decode_cfg hpm_jpeg_decode_cfg_t
Definition: hpm_jpeg.h:145
void(* cache_invalidate)(void *start, uint32_t size)
Definition: hpm_jpeg.h:151
uint32_t cache_line_size
Definition: hpm_jpeg.h:149
void(* cache_writeback)(void *start, uint32_t size)
Definition: hpm_jpeg.h:150
void(* free)(void *p)
Definition: hpm_jpeg.h:148
void * jpeg_base
Definition: hpm_jpeg.h:146
Definition: hpm_jpeg.h:126
hpm_jpeg_image_format_t out_format
Definition: hpm_jpeg.h:127
uint32_t out_image_stride
Definition: hpm_jpeg.h:128
Definition: hpm_jpeg.h:114
const hpm_jpeg_image_t * image
Definition: hpm_jpeg.h:117
uint32_t hw_status
Definition: hpm_jpeg.h:115
hpm_jpeg_job_status_t status
Definition: hpm_jpeg.h:116
Definition: hpm_jpeg.h:131
uint32_t jpeg_quality
Definition: hpm_jpeg.h:133
hpm_jpeg_sampling_format_t jpeg_sampling
Definition: hpm_jpeg.h:132
Definition: hpm_jpeg.h:120
uint32_t hw_status
Definition: hpm_jpeg.h:121
hpm_jpeg_job_status_t status
Definition: hpm_jpeg.h:122
const hpm_jpeg_file_t * file
Definition: hpm_jpeg.h:123
Definition: hpm_jpeg.h:87
enum hpm_jpeg_image_format format
Definition: hpm_jpeg.h:89
uint32_t stride
Definition: hpm_jpeg.h:92
void * image_buf
Definition: hpm_jpeg.h:88
uint32_t height
Definition: hpm_jpeg.h:91
uint32_t width
Definition: hpm_jpeg.h:90
Definition: hpm_jpeg.h:95
uint32_t len
Definition: hpm_jpeg.h:97
void * jpeg_buf
Definition: hpm_jpeg.h:96