(RJPEG) reorder structs, alignment
This commit is contained in:
parent
ff42f3348a
commit
3d2efdd2ef
|
@ -141,17 +141,15 @@ struct rjpeg
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint32_t img_x;
|
|
||||||
uint32_t img_y;
|
|
||||||
int img_n;
|
|
||||||
int img_out_n;
|
|
||||||
|
|
||||||
int buflen;
|
|
||||||
uint8_t buffer_start[128];
|
|
||||||
|
|
||||||
uint8_t *img_buffer;
|
uint8_t *img_buffer;
|
||||||
uint8_t *img_buffer_end;
|
uint8_t *img_buffer_end;
|
||||||
uint8_t *img_buffer_original;
|
uint8_t *img_buffer_original;
|
||||||
|
int img_n;
|
||||||
|
int img_out_n;
|
||||||
|
int buflen;
|
||||||
|
uint32_t img_x;
|
||||||
|
uint32_t img_y;
|
||||||
|
uint8_t buffer_start[128];
|
||||||
} rjpeg_context;
|
} rjpeg_context;
|
||||||
|
|
||||||
static INLINE uint8_t rjpeg_get8(rjpeg_context *s)
|
static INLINE uint8_t rjpeg_get8(rjpeg_context *s)
|
||||||
|
@ -171,31 +169,32 @@ static INLINE uint8_t rjpeg_get8(rjpeg_context *s)
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint8_t fast[1 << FAST_BITS];
|
|
||||||
/* weirdly, repacking this into AoS is a 10% speed loss, instead of a win */
|
|
||||||
uint16_t code[256];
|
|
||||||
uint8_t values[256];
|
|
||||||
uint8_t size[257];
|
|
||||||
unsigned int maxcode[18];
|
unsigned int maxcode[18];
|
||||||
int delta[17]; /* old 'firstsymbol' - old 'firstcode' */
|
int delta[17]; /* old 'firstsymbol' - old 'firstcode' */
|
||||||
|
/* weirdly, repacking this into AoS is a 10% speed loss, instead of a win */
|
||||||
|
uint16_t code[256];
|
||||||
|
uint8_t fast[1 << FAST_BITS];
|
||||||
|
uint8_t values[256];
|
||||||
|
uint8_t size[257];
|
||||||
} rjpeg_huffman;
|
} rjpeg_huffman;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
rjpeg_context *s;
|
rjpeg_context *s;
|
||||||
rjpeg_huffman huff_dc[4];
|
/* kernels */
|
||||||
rjpeg_huffman huff_ac[4];
|
void (*idct_block_kernel)(uint8_t *out, int out_stride, short data[64]);
|
||||||
uint8_t dequant[4][64];
|
void (*YCbCr_to_RGB_kernel)(uint8_t *out, const uint8_t *y, const uint8_t *pcb,
|
||||||
int16_t fast_ac[4][1 << FAST_BITS];
|
const uint8_t *pcr, int count, int step);
|
||||||
|
uint8_t *(*resample_row_hv_2_kernel)(uint8_t *out, uint8_t *in_near,
|
||||||
/* sizes for components, interleaved MCUs */
|
uint8_t *in_far, int w, int hs);
|
||||||
int img_h_max, img_v_max;
|
|
||||||
int img_mcu_x, img_mcu_y;
|
|
||||||
int img_mcu_w, img_mcu_h;
|
|
||||||
|
|
||||||
/* definition of jpeg image component */
|
/* definition of jpeg image component */
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
uint8_t *data;
|
||||||
|
void *raw_data, *raw_coeff;
|
||||||
|
uint8_t *linebuf;
|
||||||
|
short *coeff; /* progressive only */
|
||||||
int id;
|
int id;
|
||||||
int h,v;
|
int h,v;
|
||||||
int tq;
|
int tq;
|
||||||
|
@ -203,35 +202,31 @@ typedef struct
|
||||||
int dc_pred;
|
int dc_pred;
|
||||||
|
|
||||||
int x,y,w2,h2;
|
int x,y,w2,h2;
|
||||||
uint8_t *data;
|
|
||||||
void *raw_data, *raw_coeff;
|
|
||||||
uint8_t *linebuf;
|
|
||||||
short *coeff; /* progressive only */
|
|
||||||
int coeff_w; /* number of 8x8 coefficient blocks */
|
int coeff_w; /* number of 8x8 coefficient blocks */
|
||||||
int coeff_h; /* number of 8x8 coefficient blocks */
|
int coeff_h; /* number of 8x8 coefficient blocks */
|
||||||
} img_comp[4];
|
} img_comp[4];
|
||||||
|
|
||||||
uint32_t code_buffer; /* jpeg entropy-coded buffer */
|
/* sizes for components, interleaved MCUs */
|
||||||
int code_bits; /* number of valid bits */
|
int img_h_max, img_v_max;
|
||||||
unsigned char marker; /* marker seen while filling entropy buffer */
|
int img_mcu_x, img_mcu_y;
|
||||||
int nomore; /* flag if we saw a marker so must stop */
|
int img_mcu_w, img_mcu_h;
|
||||||
|
|
||||||
|
int code_bits; /* number of valid bits */
|
||||||
|
int nomore; /* flag if we saw a marker so must stop */
|
||||||
int progressive;
|
int progressive;
|
||||||
int spec_start;
|
int spec_start;
|
||||||
int spec_end;
|
int spec_end;
|
||||||
int succ_high;
|
int succ_high;
|
||||||
int succ_low;
|
int succ_low;
|
||||||
int eob_run;
|
int eob_run;
|
||||||
|
|
||||||
int scan_n, order[4];
|
int scan_n, order[4];
|
||||||
int restart_interval, todo;
|
int restart_interval, todo;
|
||||||
|
uint32_t code_buffer; /* jpeg entropy-coded buffer */
|
||||||
/* kernels */
|
rjpeg_huffman huff_dc[4]; /* unsigned int alignment */
|
||||||
void (*idct_block_kernel)(uint8_t *out, int out_stride, short data[64]);
|
rjpeg_huffman huff_ac[4]; /* unsigned int alignment */
|
||||||
void (*YCbCr_to_RGB_kernel)(uint8_t *out, const uint8_t *y, const uint8_t *pcb,
|
int16_t fast_ac[4][1 << FAST_BITS];
|
||||||
const uint8_t *pcr, int count, int step);
|
unsigned char marker; /* marker seen while filling entropy buffer */
|
||||||
uint8_t *(*resample_row_hv_2_kernel)(uint8_t *out, uint8_t *in_near,
|
uint8_t dequant[4][64];
|
||||||
uint8_t *in_far, int w, int hs);
|
|
||||||
} rjpeg_jpeg;
|
} rjpeg_jpeg;
|
||||||
|
|
||||||
#define RJPEG_F2F(x) ((int) (((x) * 4096 + 0.5)))
|
#define RJPEG_F2F(x) ((int) (((x) * 4096 + 0.5)))
|
||||||
|
|
Loading…
Reference in New Issue