![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|
#include <assert.h>#include <ctype.h>#include <stdlib.h>#include <string.h>#include "debug.h"#include "utils/jpeg_reader.h"
Go to the source code of this file.
Macros | |
| #define | MOD_NAME "[JPEG reader] " |
| #define | read_2byte(image) |
| #define | read_byte(image) |
Functions | |
| static bool | arr_eq3 (const int *a1, const int *a2) |
| static bool | check_huff_tables (const struct jpeg_info *param) |
| static bool | check_rtp_compatibility (const struct jpeg_info *info) |
| bool | jpeg_get_rtp_hdr_data (uint8_t *jpeg_data, int len, struct jpeg_rtp_data *hdr_data) |
| static const char * | jpeg_marker_name (enum jpeg_marker_code code) |
| int | jpeg_read_info (uint8_t *image, int len, struct jpeg_info *info) |
| static int | read_adobe_app14 (struct jpeg_info *param, uint8_t **image) |
| static int | read_com (struct jpeg_info *param, uint8_t **image) |
| static int | read_dht (struct jpeg_info *param, uint8_t **image) |
| static int | read_dqt (struct jpeg_info *param, uint8_t **image) |
| static int | read_dri (struct jpeg_info *param, uint8_t **image) |
| static int | read_marker (uint8_t **image) |
| static int | read_sof0 (struct jpeg_info *param, uint8_t **image) |
| static int | read_sos (struct jpeg_info *param, uint8_t **image) |
| static void | skip_marker_content (uint8_t **image) |
Variables | |
| static const uint8_t | chm_ac_codelens [] |
| static const uint8_t | chm_ac_symbols [] |
| static const uint8_t | chm_dc_codelens [] |
| static const uint8_t | chm_dc_symbols [] |
| const struct huffman_table | default_huffman_tables [4] |
| static const uint8_t | lum_ac_codelens [] |
| static const uint8_t | lum_ac_symbols [] |
| static const uint8_t | lum_dc_codelens [] |
| static const uint8_t | lum_dc_symbols [] |
The JPEG parsing code is taken from mostly from GPUJPEG reader.
Definition in file jpeg_reader.c.
| #define MOD_NAME "[JPEG reader] " |
Definition at line 50 of file jpeg_reader.c.
| #define read_2byte | ( | image | ) |
Definition at line 269 of file jpeg_reader.c.
Referenced by read_adobe_app14(), read_com(), read_dht(), read_dqt(), read_dri(), read_sof0(), read_sos(), and skip_marker_content().
| #define read_byte | ( | image | ) |
Definition at line 266 of file jpeg_reader.c.
Referenced by read_adobe_app14(), read_com(), read_dht(), read_dqt(), read_marker(), read_sof0(), and read_sos().
| enum jpeg_marker_code |
Definition at line 132 of file jpeg_reader.c.
|
static |
Definition at line 734 of file jpeg_reader.c.
Referenced by jpeg_get_rtp_hdr_data().
|
static |
Definition at line 687 of file jpeg_reader.c.
References chm_ac_codelens, chm_ac_symbols, chm_dc_codelens, chm_dc_symbols, lum_ac_codelens, lum_ac_symbols, lum_dc_codelens, lum_dc_symbols, and param.
Referenced by check_rtp_compatibility().
|
static |
Definition at line 737 of file jpeg_reader.c.
References check_huff_tables(), JPEG_COLOR_SPEC_YCBCR, LOG_LEVEL_ERROR, log_msg(), and MSG.
Referenced by jpeg_get_rtp_hdr_data().

| bool jpeg_get_rtp_hdr_data | ( | uint8_t * | jpeg_data, |
| int | len, | ||
| struct jpeg_rtp_data * | hdr_data ) |
Definition at line 775 of file jpeg_reader.c.
References arr_eq3(), check_rtp_compatibility(), jpeg_info::com, jpeg_info::comp_table_quantization_map, jpeg_info::data, jpeg_rtp_data::data, jpeg_info::height, jpeg_rtp_data::height, jpeg_read_info(), len, LOG_LEVEL_ERROR, log_msg(), MSG, jpeg_rtp_data::q, jpeg_info::quantization_tables, jpeg_rtp_data::quantization_tables, jpeg_info::restart_interval, jpeg_rtp_data::restart_interval, jpeg_info::sampling_factor_h, jpeg_info::sampling_factor_v, jpeg_rtp_data::type, jpeg_info::width, and jpeg_rtp_data::width.
Referenced by tx_send_jpeg().

|
static |
Definition at line 200 of file jpeg_reader.c.
References JPEG_MARKER_APP0, JPEG_MARKER_APP1, JPEG_MARKER_APP10, JPEG_MARKER_APP11, JPEG_MARKER_APP12, JPEG_MARKER_APP13, JPEG_MARKER_APP14, JPEG_MARKER_APP15, JPEG_MARKER_APP2, JPEG_MARKER_APP3, JPEG_MARKER_APP4, JPEG_MARKER_APP5, JPEG_MARKER_APP6, JPEG_MARKER_APP7, JPEG_MARKER_APP8, JPEG_MARKER_APP9, JPEG_MARKER_COM, JPEG_MARKER_DAC, JPEG_MARKER_DHP, JPEG_MARKER_DHT, JPEG_MARKER_DNL, JPEG_MARKER_DQT, JPEG_MARKER_DRI, JPEG_MARKER_EOI, JPEG_MARKER_ERROR, JPEG_MARKER_EXP, JPEG_MARKER_JPG, JPEG_MARKER_JPG0, JPEG_MARKER_JPG13, JPEG_MARKER_RST0, JPEG_MARKER_RST1, JPEG_MARKER_RST2, JPEG_MARKER_RST3, JPEG_MARKER_RST4, JPEG_MARKER_RST5, JPEG_MARKER_RST6, JPEG_MARKER_RST7, JPEG_MARKER_SOF0, JPEG_MARKER_SOF1, JPEG_MARKER_SOF10, JPEG_MARKER_SOF11, JPEG_MARKER_SOF13, JPEG_MARKER_SOF14, JPEG_MARKER_SOF15, JPEG_MARKER_SOF2, JPEG_MARKER_SOF3, JPEG_MARKER_SOF5, JPEG_MARKER_SOF6, JPEG_MARKER_SOF7, JPEG_MARKER_SOF9, JPEG_MARKER_SOI, JPEG_MARKER_SOS, and JPEG_MARKER_TEM.
Referenced by jpeg_read_info().
| int jpeg_read_info | ( | uint8_t * | image, |
| int | len, | ||
| struct jpeg_info * | info ) |
This function reads values from JPEG file.
| 0 | ok |
| -1 | general error |
| -2 | incomplete file (required markers missing) |
Definition at line 551 of file jpeg_reader.c.
References JPEG_COLOR_SPEC_CMYK, JPEG_COLOR_SPEC_RGB, JPEG_COLOR_SPEC_YCBCR, JPEG_MARKER_APP14, JPEG_MARKER_COM, JPEG_MARKER_DHT, JPEG_MARKER_DQT, JPEG_MARKER_DRI, JPEG_MARKER_EOI, jpeg_marker_name(), JPEG_MARKER_RST0, JPEG_MARKER_RST1, JPEG_MARKER_RST2, JPEG_MARKER_RST3, JPEG_MARKER_RST4, JPEG_MARKER_RST5, JPEG_MARKER_RST6, JPEG_MARKER_RST7, JPEG_MARKER_SOF0, JPEG_MARKER_SOI, JPEG_MARKER_SOS, len, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_WARNING, log_msg(), read_adobe_app14(), read_com(), read_dht(), read_dqt(), read_dri(), read_marker(), read_sof0(), read_sos(), and skip_marker_content().
Referenced by jpeg_get_rtp_hdr_data().

|
static |
Definition at line 508 of file jpeg_reader.c.
References __attribute__(), JPEG_COLOR_SPEC_CMYK, JPEG_COLOR_SPEC_YCBCR, JPEG_COLOR_SPEC_YCCK, LOG_LEVEL_ERROR, log_msg(), param, read_2byte, and read_byte.
Referenced by jpeg_read_info().

|
static |
Definition at line 445 of file jpeg_reader.c.
References param, read_2byte, and read_byte.
Referenced by jpeg_read_info().
|
static |
Definition at line 354 of file jpeg_reader.c.
References count, LOG_LEVEL_ERROR, log_msg(), param, read_2byte, and read_byte.
Referenced by jpeg_read_info().

|
static |
Definition at line 409 of file jpeg_reader.c.
References JPEG_MAX_COMPONENT_COUNT, LOG_LEVEL_ERROR, log_msg(), MSG, param, read_2byte, and read_byte.
Referenced by jpeg_read_info().

|
static |
Definition at line 342 of file jpeg_reader.c.
References LOG_LEVEL_ERROR, log_msg(), param, and read_2byte.
Referenced by jpeg_read_info().

|
static |
Definition at line 273 of file jpeg_reader.c.
References read_byte.
Referenced by jpeg_read_info().
|
static |
Definition at line 290 of file jpeg_reader.c.
References LOG_LEVEL_ERROR, LOG_LEVEL_WARNING, log_msg(), MSG, param, read_2byte, and read_byte.
Referenced by jpeg_read_info().

|
static |
Definition at line 459 of file jpeg_reader.c.
References __attribute__(), LOG_LEVEL_ERROR, log_msg(), param, read_2byte, and read_byte.
Referenced by jpeg_read_info().

|
static |
Definition at line 283 of file jpeg_reader.c.
References read_2byte.
Referenced by jpeg_read_info().
|
static |
Definition at line 97 of file jpeg_reader.c.
Referenced by check_huff_tables().
|
static |
Definition at line 101 of file jpeg_reader.c.
Referenced by check_huff_tables().
|
static |
Definition at line 89 of file jpeg_reader.c.
Referenced by check_huff_tables().
|
static |
Definition at line 93 of file jpeg_reader.c.
Referenced by check_huff_tables().
| const struct huffman_table default_huffman_tables[4] |
Definition at line 125 of file jpeg_reader.c.
Referenced by jpeg_writer_write_dhts().
|
static |
Definition at line 61 of file jpeg_reader.c.
Referenced by check_huff_tables().
|
static |
Definition at line 65 of file jpeg_reader.c.
Referenced by check_huff_tables().
|
static |
Definition at line 53 of file jpeg_reader.c.
Referenced by check_huff_tables().
|
static |
Definition at line 57 of file jpeg_reader.c.
Referenced by check_huff_tables().