#include <stdint.h>#include <stdlib.h>#include <hpm_jpeg_drv.h>#include <hpm_l1c_drv.h>#include "hpm_jpeg.h"#include "hpm_interrupt.h"Data Structures | |
| struct | hpm_jpeg_core_htab |
| struct | hpm_jpeg_core_qtab |
| struct | hpm_jpeg_sof0_info |
| struct | hpm_jpeg_sos_info |
| struct | hpm_jpeg_jpeg_info |
| struct | hpm_jpeg_sampling_tab |
| struct | hpm_jpeg_std_tab |
| struct | hpm_jpeg_buf |
| struct | jpeg_list |
| struct | hpm_jpeg_context |
| struct | hpm_jpeg_base_job |
| struct | hpm_jpeg_decode_job |
| struct | hpm_jpeg_encode_job |
Macros | |
| #define | HPM_JPEG_CACHE_LINE hpm_jpeg_cache_line_size() |
| #define | HPM_JPEG_ROUNDUP(x, y) ((((x) + ((y) - 1)) / (y)) * y) |
| #define | HPM_JPEG_ROUNDDOWN(x, y) ((x) - ((x) % (y))) |
| #define | JPEG_MARKER_SOI 0xd8 |
| #define | JPEG_MARKER_APP0 0xe0 |
| #define | JPEG_MARKER_SOF0 0xc0 |
| #define | JPEG_MARKER_DHT 0xc4 |
| #define | JPEG_MARKER_SOS 0xda |
| #define | JPEG_MARKER_DQT 0xdb |
| #define | JPEG_MARKER_EOI 0xd9 |
| #define | jpeg_list_for_each(node, head) for (jpeg_list_t *node = (head)->nxt; node != (head); node = node->nxt) |
| #define | JPEG_INFO_DUMP() |
Typedefs | |
| typedef struct hpm_jpeg_core_htab | hpm_jpeg_core_htab_t |
| typedef struct hpm_jpeg_core_qtab | hpm_jpeg_core_qtab_t |
| typedef enum hpm_jpeg_codec_type | hpm_jpeg_codec_type_t |
| typedef struct hpm_jpeg_sof0_info | hpm_jpeg_sof0_info_t |
| typedef struct hpm_jpeg_sos_info | hpm_jpeg_sos_info_t |
| typedef struct hpm_jpeg_jpeg_info | hpm_jpeg_jpeg_info_t |
| typedef struct hpm_jpeg_sampling_tab | hpm_jpeg_sampling_tab_t |
| typedef struct hpm_jpeg_std_tab | hpm_jpeg_std_tab_t |
| typedef struct hpm_jpeg_buf | hpm_jpeg_buf_t |
| typedef struct jpeg_list | jpeg_list_t |
| typedef struct hpm_jpeg_context | hpm_jpeg_context_t |
| typedef struct hpm_jpeg_base_job | hpm_jpeg_base_job_t |
| typedef struct hpm_jpeg_decode_job | hpm_jpeg_decode_job_t |
| typedef struct hpm_jpeg_encode_job | hpm_jpeg_encode_job_t |
Enumerations | |
| enum | hpm_jpeg_codec_type { HPM_JPEG_CODEC_DECODE , HPM_JPEG_CODEC_ENCODE } |
Variables | |
| static hpm_jpeg_context_t | hpm_jpeg_context |
| static const uint16_t | qlook [256] |
| static const hpm_jpeg_sampling_tab_t | sampling_tabs [] |
| static const uint8_t | std_app0 [] |
| static const uint8_t | jpeg_std_htab_ac0 [] |
| static const uint8_t | jpeg_std_htab_ac1 [] |
| static const uint8_t | jpeg_std_htab_dc0 [] |
| static const uint8_t | jpeg_std_htab_dc1 [] |
| static const uint8_t | std_luminance_qtab [64] |
| static const uint8_t | std_chrominance_qtab [64] |
| #define HPM_JPEG_CACHE_LINE hpm_jpeg_cache_line_size() |
| #define HPM_JPEG_ROUNDDOWN | ( | x, | |
| y | |||
| ) | ((x) - ((x) % (y))) |
| #define HPM_JPEG_ROUNDUP | ( | x, | |
| y | |||
| ) | ((((x) + ((y) - 1)) / (y)) * y) |
| #define JPEG_INFO_DUMP | ( | ) |
| #define jpeg_list_for_each | ( | node, | |
| head | |||
| ) | for (jpeg_list_t *node = (head)->nxt; node != (head); node = node->nxt) |
| #define JPEG_MARKER_APP0 0xe0 |
| #define JPEG_MARKER_DHT 0xc4 |
| #define JPEG_MARKER_DQT 0xdb |
| #define JPEG_MARKER_EOI 0xd9 |
| #define JPEG_MARKER_SOF0 0xc0 |
| #define JPEG_MARKER_SOI 0xd8 |
| #define JPEG_MARKER_SOS 0xda |
| typedef struct hpm_jpeg_base_job hpm_jpeg_base_job_t |
| typedef struct hpm_jpeg_buf hpm_jpeg_buf_t |
| typedef enum hpm_jpeg_codec_type hpm_jpeg_codec_type_t |
| typedef struct hpm_jpeg_context hpm_jpeg_context_t |
| typedef struct hpm_jpeg_core_htab hpm_jpeg_core_htab_t |
| typedef struct hpm_jpeg_core_qtab hpm_jpeg_core_qtab_t |
| typedef struct hpm_jpeg_decode_job hpm_jpeg_decode_job_t |
| typedef struct hpm_jpeg_encode_job hpm_jpeg_encode_job_t |
| typedef struct hpm_jpeg_jpeg_info hpm_jpeg_jpeg_info_t |
| typedef struct hpm_jpeg_sampling_tab hpm_jpeg_sampling_tab_t |
| typedef struct hpm_jpeg_sof0_info hpm_jpeg_sof0_info_t |
| typedef struct hpm_jpeg_sos_info hpm_jpeg_sos_info_t |
| typedef struct hpm_jpeg_std_tab hpm_jpeg_std_tab_t |
| typedef struct jpeg_list jpeg_list_t |
| enum hpm_jpeg_codec_type |
|
static |
|
inlinestatic |
|
static |
| int hpm_jpeg_create_htab_for_core | ( | hpm_jpeg_core_htab_t * | htab_core, |
| void * | dht_ac0, | ||
| void * | dht_ac1, | ||
| void * | dht_dc0, | ||
| void * | dht_dc1 | ||
| ) |
|
static |
|
static |
|
static |
|
static |
|
static |
| 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.
|
static |
|
static |
|
static |
|
static |
| 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 |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| void hpm_jpeg_hexdump | ( | void * | str, |
| const void * | data, | ||
| uint32_t | data_len | ||
| ) |
| int hpm_jpeg_init | ( | hpm_jpeg_cfg_t * | cfg | ) |
Initializte hpm_jpeg component.
| [in] | cfg | hpm_jpeg configuration pointer |
|
static |
|
static |
|
static |
| 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 |
|
inlinestatic |
|
static |
|
static |
|
static |
|
static |
|
inlinestatic |
|
static |
|
static |
|
static |
|
static |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |