ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_jpeg_sw_encode_internal.h
Go to the documentation of this file.
1
36
37#pragma once
38
39#include <stdint.h>
40
41#include "ra8_attributes.h"
42#include "ra8_err.h"
44
87
107
127RA8_PRIV void priv_jpeg_sw_enc_put_bits(ra8_jpeg_enc_ctx_t* e, uint32_t code, uint8_t n);
128
147
171 uint16_t* total_dc_l,
172 uint16_t* total_ac_l,
173 uint16_t* total_dc_c,
174 uint16_t* total_ac_c);
175
200 uint16_t w,
201 uint16_t h,
202 uint16_t total_dc_l,
203 uint16_t total_ac_l,
204 uint16_t total_dc_c,
205 uint16_t total_ac_c);
Annotation-attribute framework macros for ra8-firmware.
#define RA8_PRIV
Module-private helper: shared across TUs but only inside one library.
Error Code Definitions for ra8-firmware.
void priv_jpeg_sw_enc_put_bits(ra8_jpeg_enc_ctx_t *e, uint32_t code, uint8_t n)
Push n bits MSB-first into the entropy stream with stuffing.
void priv_jpeg_sw_enc_headers(ra8_jpeg_enc_ctx_t *e, uint16_t w, uint16_t h, uint16_t total_dc_l, uint16_t total_ac_l, uint16_t total_dc_c, uint16_t total_ac_c)
Emit the SOI/APP0/DQT/SOF0/DHT/SOS header segments.
void priv_jpeg_sw_enc_flush_bits(ra8_jpeg_enc_ctx_t *e)
Flush any partial byte at the end of a scan with 1-fill.
void priv_jpeg_sw_enc_build_huff(ra8_jpeg_enc_ctx_t *e, uint16_t *total_dc_l, uint16_t *total_ac_l, uint16_t *total_dc_c, uint16_t *total_ac_c)
Build the four Annex K.3.3 Huffman code/size LUTs.
void priv_jpeg_sw_enc_emit_u16(ra8_jpeg_enc_ctx_t *e, uint16_t v)
Append a 16-bit big-endian word to the JPEG byte stream.
Module-private declarations shared across the software JPEGcodec translation units.
@ k_ra8_jpeg_block_size
Coefficients per block.
@ k_ra8_jpeg_max_comps
YCbCr or grayscale only.
@ k_ra8_jpeg_huff_max
Max symbols per Huffman table.
Encoder state – buffer cursor, bit accumulator, scaled quant tables, Huffman LUTs and DC predictors.
int32_t dc_pred[k_ra8_jpeg_max_comps]
Per-component DC predictors.
bool overflow
Set on capacity exhaustion.
uint8_t size_ac_l[k_ra8_jpeg_huff_max]
Luma AC code lengths.
uint16_t code_dc_c[k_ra8_jpeg_huff_max]
Chroma DC Huffman codes.
uint8_t size_dc_l[k_ra8_jpeg_huff_max]
Luma DC code lengths.
uint8_t size_ac_c[k_ra8_jpeg_huff_max]
Chroma AC code lengths.
uint8_t * dst
Destination JPEG byte buffer.
uint32_t pos
Write cursor into dst.
uint32_t bit_buf
MSB-first entropy bit accumulator.
uint16_t code_ac_c[k_ra8_jpeg_huff_max]
Chroma AC Huffman codes.
uint16_t code_dc_l[k_ra8_jpeg_huff_max]
Luma DC Huffman codes.
uint8_t qy[k_ra8_jpeg_block_size]
Scaled luma quant table.
uint16_t code_ac_l[k_ra8_jpeg_huff_max]
Luma AC Huffman codes.
uint8_t bit_cnt
Bits currently valid in bit_buf.
uint8_t size_dc_c[k_ra8_jpeg_huff_max]
Chroma DC code lengths.
uint8_t qc[k_ra8_jpeg_block_size]
Scaled chroma quant table.
uint32_t cap
Capacity of dst in bytes.