Bounded LOOM feature validation and exact binary EXIF transport. More...

Go to the source code of this file.
Functions | |
| static uint32_t | feature_u32 (const uint8_t *data) |
| Read four checked little-endian bytes without an unaligned cast. | |
| static uint32_t | feature_extent (const uint8_t *record, uint32_t dimension) |
| Read a bounded shape extent from one driver tensor record. | |
| bool | loom_features_valid (const float *values, size_t count, const uint8_t *information, size_t information_size) |
| Validate finite features against the shared IMX500 shape metadata. | |
| size_t | loom_features_size (size_t count) |
| Required bytes for 1..4096 floats, or zero for unsupported counts. | |
| static void | feature_put (unsigned char *data, uint64_t value, size_t bytes) |
| Encode one little-endian field in a LOOM evidence record. | |
| bool | loom_features_pack (unsigned char *record, size_t capacity, const float *values, size_t count, const uint8_t *information, size_t information_size, uint64_t sequence, uint64_t sensor_timestamp_ns) |
| Pack validated same-exposure shapes, exact uint64 identities and float bits. | |
| bool | loom_features_unpack (const unsigned char *record, size_t size, float *values, size_t capacity, uint8_t *information, size_t information_size, size_t *count, uint64_t *sequence, uint64_t *sensor_timestamp_ns) |
| Validate and decode an exact-sized binary record into bounded output. | |
Detailed Description
Bounded LOOM feature validation and exact binary EXIF transport.
The capture owner supplies immutable same-exposure buffers; this core neither acquires a camera nor decides whether a navigation match exists.
Definition in file loom_features.c.
Function Documentation
◆ feature_extent()
|
static |
Read a bounded shape extent from one driver tensor record.
- Parameters
-
record Full accessible tensor-info record. dimension Validated zero-based dimension below the rank limit.
- Returns
- The little-endian unsigned 16-bit extent, widened for checked arithmetic.
Definition at line 41 of file loom_features.c.
◆ feature_put()
|
static |
Encode one little-endian field in a LOOM evidence record.
- Parameters
-
[out] data Storage validated by the caller for bytesoctets.value Unsigned bits to write. bytes Field width, at most eight.
Pack explicit bytes so persisted data does not depend on host byte order or alignment.
Definition at line 111 of file loom_features.c.
◆ feature_u32()
|
static |
Read four checked little-endian bytes without an unaligned cast.
- Parameters
-
data At least four bytes inside validated tensor metadata.
- Returns
- Unsigned component value in host representation.
Definition at line 31 of file loom_features.c.
◆ loom_features_pack()
| bool loom_features_pack | ( | unsigned char * | record, |
| size_t | capacity, | ||
| const float * | values, | ||
| size_t | count, | ||
| const uint8_t * | information, | ||
| size_t | information_size, | ||
| uint64_t | sequence, | ||
| uint64_t | sensor_timestamp_ns ) |
Pack validated same-exposure shapes, exact uint64 identities and float bits.
- Precondition
- Inputs remain immutable and do not overlap the destination.
Writes the LOOMNN02 format described in docs/exif.md. Invalid inputs leave output unchanged. The caller reserves this value in the JPEG's EXIF document; there is no filesystem access or feature-sized allocation here.
Definition at line 116 of file loom_features.c.
◆ loom_features_size()
| size_t loom_features_size | ( | size_t | count | ) |
Required bytes for 1..4096 floats, or zero for unsupported counts.
Definition at line 100 of file loom_features.c.
◆ loom_features_unpack()
| bool loom_features_unpack | ( | const unsigned char * | record, |
| size_t | size, | ||
| float * | values, | ||
| size_t | capacity, | ||
| uint8_t * | information, | ||
| size_t | information_size, | ||
| size_t * | count, | ||
| uint64_t * | sequence, | ||
| uint64_t * | sensor_timestamp_ns ) |
Validate and decode an exact-sized binary record into bounded output.
- Precondition
- Inputs and writable outputs do not overlap; capacity is a float count.
On failure count is zero; other outputs must be discarded. Structural validity is not a model match. Check identity against the JPEG capture record before consuming features. No buffer is retained or allocated.
Definition at line 136 of file loom_features.c.
◆ loom_features_valid()
| bool loom_features_valid | ( | const float * | values, |
| size_t | count, | ||
| const uint8_t * | information, | ||
| size_t | information_size ) |
Validate finite features against the shared IMX500 shape metadata.
- Parameters
-
values Borrowed immutable float array for one exposure. count Accessible float count. information Borrowed tensor-info bytes from that same exposure. information_size Accessible metadata bytes.
- Returns
- True for bounded, consistent shapes and finite values; false otherwise.
Check shape products and cumulative length before reading values; rank/count limits bound both work and metadata access. No buffer is retained.
- Note
- This does not validate model semantics, feature similarity or a route.
Definition at line 47 of file loom_features.c.