ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_fmt_stream.h
Go to the documentation of this file.
1
19
20#pragma once
21
22#include <stddef.h>
23#include <stdint.h>
24
25#include "jof.h"
26#include "jof_audit.h"
27#include "ra8_err.h"
28
31typedef ra8_err_t (*ra8_fmt_source_validate_fn)(void* ctx, uint64_t expected_size);
32
40
42typedef ra8_err_t (*ra8_fmt_sink_write_fn)(void* ctx, const uint8_t* bytes, size_t len);
43
49
51typedef ra8_err_t (*ra8_fmt_spool_seal_fn)(void* ctx, uint64_t expected_size);
52
60
62typedef struct {
64 ra8_err_t (*commit)(void* ctx);
65 void (*abort)(void* ctx);
67
69typedef struct {
71 void* ctx;
73
75typedef struct {
76 uint16_t width;
77 uint16_t height;
78 uint16_t tile_width;
79 uint16_t tile_height;
80 uint32_t work_bytes;
81 uint32_t webp_work_bytes;
83
85typedef struct {
86 uint8_t* work;
87 uint32_t work_cap;
88 uint8_t* webp_work;
89 uint32_t webp_work_cap;
91
93typedef struct {
94 uint16_t width;
95 uint16_t height;
96 uint8_t bpp;
97 uint16_t band_height;
102 uint32_t scratch_bytes;
103 uint32_t row_bytes;
105
111typedef struct {
112 uint8_t* work;
113 uint32_t work_cap;
114 uint8_t* webp_work;
115 uint32_t webp_work_cap;
116 uint8_t* band_tile;
117 uint32_t band_tile_cap;
118 uint8_t* scratch;
119 uint32_t scratch_cap;
120 uint8_t* row;
121 uint32_t row_cap;
123
129typedef struct {
131 uint32_t record_cap;
132 uint8_t* tile;
133 uint32_t tile_cap;
134 uint8_t* scratch;
135 uint32_t scratch_cap;
137
139typedef struct {
140 uint64_t* table;
141 uint32_t table_cap;
142 uint8_t* compressed;
143 uint32_t compressed_cap;
144 uint8_t* chunk;
145 uint32_t chunk_cap;
146 uint8_t* scratch;
147 uint32_t scratch_cap;
149
160[[nodiscard]] ra8_err_t ra8_fmt_jof_inspect_stream(const ra8_fmt_source_t* source,
161 bool verbose,
162 const ra8_fmt_jof_inspect_workspace_t* workspace,
163 const ra8_fmt_sink_t* report);
164
178 bool verbose,
180 const ra8_fmt_sink_t* report);
181
202
224[[nodiscard]] ra8_err_t
226 const ra8_fmt_jof_convert_requirements_t* requirements,
227 const ra8_fmt_jof_convert_workspace_t* workspace,
228 ra8_fmt_transaction_t* transaction,
229 const ra8_fmt_sink_t* report,
230 const char* output_name);
231
245
278[[nodiscard]] ra8_err_t
279ra8_fmt_jof_verify_stream(const ra8_fmt_source_t* reference_source,
280 const ra8_fmt_source_t* banded_source,
281 const ra8_fmt_jof_verify_requirements_t* requirements,
283 ra8_fmt_spool_t* reference_spool,
284 ra8_fmt_spool_t* banded_spool,
286 const char* dump_name,
287 const ra8_fmt_sink_t* report);
JOF band-tile atlas: the display-native normalized image format (#231, shared with the longstrip scro...
ra8_err_t(* jof_pread_fn)(void *ctx, uint64_t offset, uint8_t *buf, size_t len, size_t *got)
Positioned-read seam over an atlas backing store (DIP).
Definition jof.h:241
No-heap, backing-agnostic structural audit for JOF atlases.
-proof
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
ra8_err_t ra8_fmt_jof_convert_requirements(const ra8_fmt_source_t *source, ra8_fmt_jof_convert_requirements_t *out)
Derive source geometry and exact JOF conversion workspace needs.
ra8_err_t ra8_fmt_jof_convert_stream(const ra8_fmt_source_t *source, const ra8_fmt_jof_convert_requirements_t *requirements, const ra8_fmt_jof_convert_workspace_t *workspace, ra8_fmt_transaction_t *transaction, const ra8_fmt_sink_t *report, const char *output_name)
Stream one encoded image into a durably published JOF artifact.
ra8_err_t ra8_fmt_jof_verify_requirements(const ra8_fmt_source_t *source, ra8_fmt_jof_verify_requirements_t *out)
Derive exact producer and comparison storage for bounded JOF verification.
ra8_err_t(* ra8_fmt_source_validate_fn)(void *ctx, uint64_t expected_size)
Revalidate one positioned source against its captured immutable view.
ra8_err_t ra8_fmt_rabook_inspect_stream(const ra8_fmt_source_t *source, bool verbose, ra8_fmt_rabook_inspect_workspace_t *workspace, const ra8_fmt_sink_t *report)
Strictly inspect one streamed RBKC container and its RABOOK1 payload.
ra8_err_t(* ra8_fmt_spool_seal_fn)(void *ctx, uint64_t expected_size)
Seal an exact scratch artifact for immutable positioned reads.
ra8_err_t ra8_fmt_jof_verify_stream(const ra8_fmt_source_t *reference_source, const ra8_fmt_source_t *banded_source, const ra8_fmt_jof_verify_requirements_t *requirements, ra8_fmt_jof_verify_workspace_t *workspace, ra8_fmt_spool_t *reference_spool, ra8_fmt_spool_t *banded_spool, ra8_fmt_transaction_t *dump, const char *dump_name, const ra8_fmt_sink_t *report)
Verify banded JOF pixels against an independently decoded row reference.
ra8_err_t ra8_fmt_jof_inspect_stream(const ra8_fmt_source_t *source, bool verbose, const ra8_fmt_jof_inspect_workspace_t *workspace, const ra8_fmt_sink_t *report)
Inspect one JOF source through callbacks and caller storage.
ra8_err_t(* ra8_fmt_sink_write_fn)(void *ctx, const uint8_t *bytes, size_t len)
Append text or binary bytes to a bounded backend.
One decoded tile's stored window and content evidence.
Definition jof_audit.h:38
Source geometry and exact arenas required by one JOF conversion.
uint16_t width
Declared source width in pixels.
uint32_t webp_work_bytes
Exact WebP whole-frame bytes, or zero.
uint16_t height
Declared source height in pixels.
uint16_t tile_height
Height selected for emitted tiles.
uint32_t work_bytes
Exact streaming-producer arena bytes.
uint16_t tile_width
Width selected for emitted tiles.
Caller-owned arenas supplied to the streaming JOF converter.
uint32_t work_cap
Bytes available at work.
uint8_t * webp_work
Optional WebP decode arena.
uint32_t webp_work_cap
Bytes at webp_work.
Exact caller-owned storage used by streaming JOF inspection.
uint32_t scratch_cap
Compressed staging capacity.
uint8_t * scratch
Compressed tile staging.
uint32_t tile_cap
Decoded tile capacity.
uint8_t * tile
Reusable decoded tile.
uint32_t record_cap
Record entries available.
jof_audit_record_t * records
Audit record array.
Exact phase-reused storage requirements for JOF verification.
uint32_t row_bytes
One decoded reference row.
uint8_t bpp
Decoder output bytes per pixel.
uint16_t band_height
Subject tile height under test.
uint32_t reference_work_bytes
One-row reference producer arena.
uint16_t width
Source width in pixels.
uint16_t height
Source height in pixels.
uint32_t band_tile_bytes
Largest decoded subject tile.
uint32_t scratch_bytes
Largest stored-tile staging buffer.
uint32_t webp_work_bytes
Whole-frame WebP arena, or zero.
uint32_t banded_work_bytes
Banded subject producer arena.
Caller-owned phase-overlaid arenas for one bounded JOF verification.
uint8_t * webp_work
Optional WebP whole-frame arena.
uint32_t webp_work_cap
Bytes at webp_work.
uint8_t * row
Decoded one-row reference tile.
uint8_t * band_tile
Decoded banded-subject tile.
uint32_t band_tile_cap
Bytes at band_tile.
uint8_t * scratch
Reusable stored-tile staging.
uint32_t row_cap
Bytes at row.
uint32_t scratch_cap
Bytes at scratch.
uint32_t work_cap
Bytes available at work.
Caller-owned storage for strict streamed RBKC/RABOOK1 inspection.
uint8_t * compressed
One compressed chunk.
uint32_t compressed_cap
Compressed chunk capacity.
uint64_t * table
Decoded RBKC offset entries.
uint32_t table_cap
Entries available at table.
uint8_t * scratch
Strict validator workspace.
uint8_t * chunk
One inflated chunk.
uint32_t chunk_cap
Inflated chunk capacity.
uint32_t scratch_cap
Validator workspace capacity.
Injected append-only sink.
void * ctx
Backend-owned context.
Immutable, randomly readable input object.
uint64_t size
Exact object byte length.
void * ctx
Backend-owned context.
ra8_fmt_source_validate_fn validate
Optional stability callback.
jof_pread_fn read_at
Positioned-read callback.
Caller-owned scratch artifact with append, seal, and read seams.
ra8_fmt_sink_write_fn append
Append before seal.
jof_pread_fn read_at
Positioned reader after seal.
ra8_fmt_spool_seal_fn seal
Seal exact produced bytes.
void * ctx
Backend-owned state.
Durable artifact-transaction operations.
ra8_err_t(* commit)(void *ctx)
Sync and atomically install.
ra8_fmt_sink_write_fn append
Append artifact bytes.
void(* abort)(void *ctx)
Discard owned staging data.
One caller-owned artifact transaction.
void * ctx
Backend-owned state.
const ra8_fmt_transaction_ops_t * ops
Transaction implementation.