TwiceAsNice  2019-02-18
Classes | Macros | Functions | Variables
jpegutils.c File Reference
#include "jpegutils.h"
#include <jpeglib.h>
#include <jerror.h>
#include <assert.h>
#include <setjmp.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for jpegutils.c:

Classes

struct  my_error_mgr
 

Macros

#define MAX_LUMA_WIDTH   4096
 
#define MAX_CHROMA_WIDTH   2048
 

Functions

static void jpeg_buffer_src (j_decompress_ptr cinfo, unsigned char *buffer, long num)
 
static void jpeg_buffer_dest (j_compress_ptr cinfo, unsigned char *buffer, long len)
 
static void jpeg_skip_ff (j_decompress_ptr cinfo)
 
static void init_source (j_decompress_ptr cinfo)
 
static boolean fill_input_buffer (j_decompress_ptr cinfo)
 
static void skip_input_data (j_decompress_ptr cinfo, long num_bytes)
 
static void term_source (j_decompress_ptr cinfo)
 
static void init_destination (j_compress_ptr cinfo)
 
static boolean empty_output_buffer (j_compress_ptr cinfo)
 
static void term_destination (j_compress_ptr cinfo)
 
static void my_error_exit (j_common_ptr cinfo)
 
static void my_emit_message (j_common_ptr cinfo, int msg_level)
 
static void add_huff_table (j_decompress_ptr dinfo, JHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)
 
static void std_huff_tables (j_decompress_ptr dinfo)
 
static void guarantee_huff_tables (j_decompress_ptr dinfo)
 
int decode_jpeg_raw (unsigned char *jpeg_data, int len, int itype, int ctype, unsigned int width, unsigned int height, unsigned char *raw0, unsigned char *raw1, unsigned char *raw2)
 decode JPEG buffer More...
 
int decode_jpeg_gray_raw (unsigned char *jpeg_data, int len, int itype, int ctype, unsigned int width, unsigned int height, unsigned char *raw0, unsigned char *raw1, unsigned char *raw2)
 decode JPEG raw gray buffer More...
 
int encode_jpeg_raw (unsigned char *jpeg_data, int len, int quality, int itype, int ctype, unsigned int width, unsigned int height, unsigned char *raw0, unsigned char *raw1, unsigned char *raw2)
 encode raw JPEG buffer More...
 
int decode_jpeg_rgb (unsigned char *inBuffer, unsigned long inSize, uint8_t **memptr, size_t *memsize, int *naxis, int *w, int *h)
 decode_jpeg_rgb Read jpeg in memory buffer and produce RGB image More...
 

Variables

static uint8_t EOI_data [2] = { 0xFF, 0xD9 }
 
static unsigned char buf0 [16][MAX_LUMA_WIDTH]
 
static unsigned char buf1 [8][MAX_CHROMA_WIDTH]
 
static unsigned char buf2 [8][MAX_CHROMA_WIDTH]
 
static unsigned char chr1 [8][MAX_CHROMA_WIDTH]
 
static unsigned char chr2 [8][MAX_CHROMA_WIDTH]
 

Macro Definition Documentation

◆ MAX_CHROMA_WIDTH

#define MAX_CHROMA_WIDTH   2048

◆ MAX_LUMA_WIDTH

#define MAX_LUMA_WIDTH   4096

Function Documentation

◆ add_huff_table()

static void add_huff_table ( j_decompress_ptr  dinfo,
JHUFF_TBL **  htblptr,
const UINT8 *  bits,
const UINT8 *  val 
)
static

◆ empty_output_buffer()

static boolean empty_output_buffer ( j_compress_ptr  cinfo)
static

◆ fill_input_buffer()

static boolean fill_input_buffer ( j_decompress_ptr  cinfo)
static

◆ guarantee_huff_tables()

static void guarantee_huff_tables ( j_decompress_ptr  dinfo)
static

◆ init_destination()

static void init_destination ( j_compress_ptr  cinfo)
static

◆ init_source()

static void init_source ( j_decompress_ptr  cinfo)
static

◆ jpeg_buffer_dest()

static void jpeg_buffer_dest ( j_compress_ptr  cinfo,
unsigned char *  buffer,
long  len 
)
static

◆ jpeg_buffer_src()

static void jpeg_buffer_src ( j_decompress_ptr  cinfo,
unsigned char *  buffer,
long  num 
)
static

◆ jpeg_skip_ff()

static void jpeg_skip_ff ( j_decompress_ptr  cinfo)
static

◆ my_emit_message()

static void my_emit_message ( j_common_ptr  cinfo,
int  msg_level 
)
static

◆ my_error_exit()

static void my_error_exit ( j_common_ptr  cinfo)
static

◆ skip_input_data()

static void skip_input_data ( j_decompress_ptr  cinfo,
long  num_bytes 
)
static

◆ std_huff_tables()

static void std_huff_tables ( j_decompress_ptr  dinfo)
static

◆ term_destination()

static void term_destination ( j_compress_ptr  cinfo)
static

◆ term_source()

static void term_source ( j_decompress_ptr  cinfo)
static

Variable Documentation

◆ buf0

unsigned char buf0[16][MAX_LUMA_WIDTH]
static

◆ buf1

unsigned char buf1[8][MAX_CHROMA_WIDTH]
static

◆ buf2

unsigned char buf2[8][MAX_CHROMA_WIDTH]
static

◆ chr1

unsigned char chr1[8][MAX_CHROMA_WIDTH]
static

◆ chr2

unsigned char chr2[8][MAX_CHROMA_WIDTH]
static

◆ EOI_data

uint8_t EOI_data[2] = { 0xFF, 0xD9 }
static