Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Encode images with the use of the JPEG encoding. More...
#include "jpeg.h"
Go to the source code of this file.
Data Structures | |
struct | JPEG_ENCODER_STRUCTURE |
Macros | |
#define | JPEG_BLOCK_SIZE 64 |
#define | PUTBITS |
Typedefs | |
typedef struct JPEG_ENCODER_STRUCTURE | JPEG_ENCODER_STRUCTURE |
Functions | |
static unsigned char | svs_size_code (int w) |
int | jpeg_create_svs_header (unsigned char *jpegbuf, int32_t size, int w) |
static void | jpeg_initialization (JPEG_ENCODER_STRUCTURE *, uint32_t, uint32_t, uint32_t) |
static uint8_t * | jpeg_write_markers (uint8_t *, uint32_t, uint32_t, uint32_t) |
static void | jpeg_read_400_format (JPEG_ENCODER_STRUCTURE *, uint8_t *) |
static void | jpeg_read_422_format (JPEG_ENCODER_STRUCTURE *, uint8_t *) |
static uint8_t * | jpeg_encodeMCU (JPEG_ENCODER_STRUCTURE *, uint32_t, uint8_t *) |
static void | jpeg_levelshift (int16_t *) |
static void | jpeg_DCT (int16_t *) |
static void | jpeg_quantization (int16_t *, uint16_t *) |
static uint8_t * | jpeg_huffman (JPEG_ENCODER_STRUCTURE *, uint16_t, uint8_t *) |
static uint8_t * | jpeg_close_bitstream (uint8_t *) |
void | MakeTables (int q) |
void | jpeg_encode_image (struct image_t *in, struct image_t *out, uint32_t quality_factor, bool_t add_dri_header) |
Encode an YUV422 image. More... | |
Encode images with the use of the JPEG encoding.
Definition in file jpeg.c.
struct JPEG_ENCODER_STRUCTURE |
Data Fields | ||
---|---|---|
uint16_t | cols | |
uint16_t | cols_in_right_mcus | |
uint16_t | horizontal_mcus | |
uint16_t | incr | |
int16_t | ldc1 | |
int16_t | ldc2 | |
int16_t | ldc3 | |
uint16_t | length_minus_mcu_width | |
uint16_t | length_minus_width | |
uint16_t | mcu_height | |
uint16_t | mcu_width | |
uint16_t | mcu_width_size | |
uint16_t | offset | |
uint16_t | rows | |
uint16_t | rows_in_bottom_mcus | |
uint16_t | vertical_mcus |
#define PUTBITS |
typedef struct JPEG_ENCODER_STRUCTURE JPEG_ENCODER_STRUCTURE |
Definition at line 735 of file jpeg.c.
References bitindex, and lcode.
Referenced by jpeg_encode_image().
int jpeg_create_svs_header | ( | unsigned char * | jpegbuf, |
int32_t | size, | ||
int | w | ||
) |
Definition at line 44 of file jpeg.c.
References p, and svs_size_code().
|
static |
void jpeg_encode_image | ( | struct image_t * | in, |
struct image_t * | out, | ||
uint32_t | quality_factor, | ||
bool_t | add_dri_header | ||
) |
Encode an YUV422 image.
[in] | *in | The input image |
[out] | *out | The output JPEG image |
[in] | quality_factor | Quality factor of the encoding (0-99) |
[in] | add_dri_header | Add the DRI header (needed for full JPEG) |
Definition at line 425 of file jpeg.c.
References image_t::buf, image_t::buf_size, JPEG_ENCODER_STRUCTURE::cols, JPEG_ENCODER_STRUCTURE::cols_in_right_mcus, FOUR_TWO_TWO, FOUR_ZERO_ZERO, image_t::h, JPEG_ENCODER_STRUCTURE::horizontal_mcus, IMAGE_GRAYSCALE, IMAGE_YUV422, JPEG_ENCODER_STRUCTURE::incr, jpeg_close_bitstream(), jpeg_encodeMCU(), jpeg_initialization(), jpeg_write_markers(), JPEG_ENCODER_STRUCTURE::length_minus_mcu_width, JPEG_ENCODER_STRUCTURE::length_minus_width, MakeTables(), JPEG_ENCODER_STRUCTURE::mcu_height, JPEG_ENCODER_STRUCTURE::mcu_width, JPEG_ENCODER_STRUCTURE::mcu_width_size, JPEG_ENCODER_STRUCTURE::offset, read_format, JPEG_ENCODER_STRUCTURE::rows, JPEG_ENCODER_STRUCTURE::rows_in_bottom_mcus, image_t::type, JPEG_ENCODER_STRUCTURE::vertical_mcus, and image_t::w.
Referenced by bebop_front_camera_save_shot(), bebop_front_camera_thread(), opticflow_module_calc(), video_thread_save_shot(), and viewvideo_function().
|
static |
Definition at line 489 of file jpeg.c.
References CB, CR, FOUR_TWO_TWO, ICqt, ILqt, jpeg_DCT(), jpeg_huffman(), jpeg_levelshift(), jpeg_quantization(), Y1, and Y2.
Referenced by jpeg_encode_image().
|
static |
Definition at line 638 of file jpeg.c.
References bitsize, chrominance_ac_code_table, chrominance_ac_size_table, chrominance_dc_code_table, chrominance_dc_size_table, JPEG_ENCODER_STRUCTURE::ldc1, JPEG_ENCODER_STRUCTURE::ldc2, JPEG_ENCODER_STRUCTURE::ldc3, luminance_ac_code_table, luminance_ac_size_table, luminance_dc_code_table, luminance_dc_size_table, PUTBITS, and Temp.
Referenced by jpeg_encodeMCU().
|
static |
Definition at line 309 of file jpeg.c.
References bitindex, JPEG_ENCODER_STRUCTURE::cols_in_right_mcus, FOUR_ZERO_ZERO, JPEG_ENCODER_STRUCTURE::horizontal_mcus, jpeg_read_400_format(), jpeg_read_422_format(), lcode, JPEG_ENCODER_STRUCTURE::ldc1, JPEG_ENCODER_STRUCTURE::ldc2, JPEG_ENCODER_STRUCTURE::ldc3, JPEG_ENCODER_STRUCTURE::length_minus_mcu_width, JPEG_ENCODER_STRUCTURE::length_minus_width, JPEG_ENCODER_STRUCTURE::mcu_height, JPEG_ENCODER_STRUCTURE::mcu_width, JPEG_ENCODER_STRUCTURE::mcu_width_size, JPEG_ENCODER_STRUCTURE::offset, read_format, JPEG_ENCODER_STRUCTURE::rows_in_bottom_mcus, and JPEG_ENCODER_STRUCTURE::vertical_mcus.
Referenced by jpeg_encode_image().
|
static |
Definition at line 516 of file jpeg.c.
Referenced by jpeg_encodeMCU().
Definition at line 949 of file jpeg.c.
References Temp, value, and zigzag_table.
Referenced by jpeg_encodeMCU().
|
static |
Definition at line 962 of file jpeg.c.
References JPEG_ENCODER_STRUCTURE::cols, JPEG_ENCODER_STRUCTURE::incr, JPEG_ENCODER_STRUCTURE::rows, and Y1.
Referenced by jpeg_initialization().
|
static |
Definition at line 992 of file jpeg.c.
References CB, JPEG_ENCODER_STRUCTURE::cols, CR, JPEG_ENCODER_STRUCTURE::incr, JPEG_ENCODER_STRUCTURE::rows, Y1, and Y2.
Referenced by jpeg_initialization().
|
static |
Definition at line 761 of file jpeg.c.
References Cqt, FOUR_TWO_TWO, FOUR_ZERO_ZERO, Lqt, and markerdata.
Referenced by jpeg_encode_image().
void MakeTables | ( | int | q | ) |
Definition at line 386 of file jpeg.c.
References Cqt, ICqt, ILqt, jpeg_chroma_quantizer, jpeg_luma_quantizer, and Lqt.
Referenced by jpeg_encode_image().
|
inlinestatic |
Definition at line 23 of file jpeg.c.
Referenced by jpeg_create_svs_header().
|
static |
Definition at line 304 of file jpeg.c.
Referenced by jpeg_close_bitstream(), and jpeg_initialization().
|
static |
Definition at line 212 of file jpeg.c.
Referenced by jpeg_huffman().
|
static |
Definition at line 300 of file jpeg.c.
Referenced by jpeg_encodeMCU(), and jpeg_read_422_format().
|
static |
Definition at line 170 of file jpeg.c.
Referenced by jpeg_huffman().
|
static |
Definition at line 191 of file jpeg.c.
Referenced by jpeg_huffman().
|
static |
Definition at line 118 of file jpeg.c.
Referenced by jpeg_huffman().
|
static |
Definition at line 123 of file jpeg.c.
Referenced by jpeg_huffman().
|
static |
Definition at line 292 of file jpeg.c.
Referenced by jpeg_write_markers(), and MakeTables().
|
static |
Definition at line 301 of file jpeg.c.
Referenced by jpeg_encodeMCU(), and jpeg_read_422_format().
|
static |
Definition at line 294 of file jpeg.c.
Referenced by jpeg_encodeMCU(), and MakeTables().
|
static |
Definition at line 293 of file jpeg.c.
Referenced by jpeg_encodeMCU(), and MakeTables().
|
static |
Definition at line 371 of file jpeg.c.
Referenced by MakeTables().
|
static |
Definition at line 357 of file jpeg.c.
Referenced by MakeTables().
|
static |
Definition at line 303 of file jpeg.c.
Referenced by jpeg_close_bitstream(), and jpeg_initialization().
|
static |
Definition at line 291 of file jpeg.c.
Referenced by jpeg_write_markers(), and MakeTables().
|
static |
Definition at line 128 of file jpeg.c.
Referenced by jpeg_huffman().
|
static |
Definition at line 149 of file jpeg.c.
Referenced by jpeg_huffman().
|
static |
Definition at line 108 of file jpeg.c.
Referenced by jpeg_huffman().
|
static |
Definition at line 113 of file jpeg.c.
Referenced by jpeg_huffman().
|
static |
Definition at line 247 of file jpeg.c.
Referenced by jpeg_write_markers().
void(* read_format)(JPEG_ENCODER_STRUCTURE *jpeg_encoder_structure, uint8_t *input_ptr) |
Definition at line 307 of file jpeg.c.
Referenced by jpeg_encode_image(), and jpeg_initialization().
|
static |
Definition at line 302 of file jpeg.c.
Referenced by jpeg_huffman(), and jpeg_quantization().
|
static |
Definition at line 296 of file jpeg.c.
Referenced by jpeg_encodeMCU(), jpeg_read_400_format(), and jpeg_read_422_format().
|
static |
Definition at line 297 of file jpeg.c.
Referenced by jpeg_encodeMCU(), and jpeg_read_422_format().
|
static |
Definition at line 258 of file jpeg.c.
Referenced by jpeg_quantization().