The American album loader calls a real embedded JPEG implementation through relocated wrapper 02235628. This is no longer an unresolved external decoder boundary. The connected path reaches metadata scanning, entropy decoding, integer IDCT, native pixel emission, canvas resizing and thumbnail caching. European counterparts have independently matched instruction bodies and selected pixel executions. The same exact family was not found in Japanese V2; that does not prove it has no different decoder. [1]
| Operation | US V2 | EU V2 |
|---|---|---|
| Metadata scan | 020CE9D4 | 020CFA8C |
| Pixel decode | 020CEB34 | 020CFBEC |
| Coefficient block | 020CF560 | 020D0618 |
| IDCT preparation | 020CF704 | 020D07BC |
| Integer IDCT | 020CF780 | 020D0838 |
| RGB555 emission | 020D00B4 | 020D116C |
| Facade | 020D068C | 020D1744 |
| TIFF directories | 020D0BBC | 020D1C74 |
| APP1 entry | 020D1340 | 020D23F8 |
Wrapper arguments and results
The six arguments are mutable JPEG bytes, byte length, pixel destination, initial width bound, initial height bound and mode. The last two are stack arguments. Lengths at least 204,800 are rejected. A metadata-only call with flag 0x10 must find property 0x1001 with at least eight bytes before real decoding. Width/height are read and written through signed halfwords; the backend returns actual dimensions. [1]
| Return | Meaning |
|---|---|
| 0 | Successful decode with actual dimensions 640 × 480 or 160 × 120 |
| 18 | Real decoding returned false |
| 19 | Initial metadata scan returned false |
| 20 | Length, metadata or final dimensions failed admission |
Accepted dimensions are not tied to mode: a 160 × 120 image fits full-photo bounds and is accepted. A 320 × 240 image can write its tightly packed pixels and then fail final admission; the wrapper does not clear that partial result. A 640 × 480 image with thumbnail bounds fails before output. The outer loader owns destination cleanup. [1]
Exif and borrowed properties
The scan recognises SOI, marker lengths and APP1. TIFF parsing checks Exif followed by two NUL bytes and recognises II/MM endianness, although this execution set covers little-endian only. It expects the camera's directory layout, including a first directory at offset eight and data offsets relative to JPEG byte twelve; it is not a general TIFF parser. [1]
| Tag | Use |
|---|---|
| 0131 | Software marker and parsed length |
| 0132 | Twenty-byte date/time copy |
| 8769 | Exif directory |
| 927C | MakerNote directory |
| A005 | Additional directory |
| 0201 | Embedded JPEG thumbnail offset when mode bit zero is set |
| 1000 | Expected first vendor entry: type seven, count twenty-eight |
| 1001 | First exposed vendor property; admission needs at least eight bytes |
| 1002 | Second vendor property |
The semantic contents of vendor properties are unresolved. Their pointers refer into the input JPEG rather than owned copies. Metadata at 022312B8 stores lengths at +0/+2/+4, policy at +8 and property 1002/1001 pointers at +0x0C/+0x10. Handling APP1 resets those exposed fields; the top-level metadata-only scan does not reset them otherwise. A subsequent JPEG without APP1 can therefore retain a preceding image's property state. The connected cases cover empty, accepted and short-property state, not a bypass of a genuine camera signature. [1]
Validation policy
The wrapper checks system word +436 at base 02FFE000, bit ten. When clear, real decode selects policy zero; when set, software-marker bytes affect policy. Policy one additionally follows Exif/MakerNote, temporarily removes a twenty-eight-byte field, calls relocated validation routines and restores it. Genuine signed camera data and those validation callees remain unverified. The previous codec policy is restored after real decoding, even on failure. [1]
Pixel format and sampling
pixel16 = 0x8000 | (red >> 3)
| ((green >> 3) << 5) | ((blue >> 3) << 10)
Pixels are little-endian, rows use actual width, and the decoder packs width/height into the low/high halves of its return. Zero means failure. The inspected branch handles frame markers C0/C1 and first-component sampling 11, 21, 12 or 22. Its 4:2:0 emitter reuses chroma per 2 × 2 luma group rather than interpolating it. Solid black, white, red and blue controls match an independent RGB555 decoder exactly. AC-bearing images do not all match. [1]
| Fixture | Sampling | Different pixels | RGB5 difference ranges |
|---|---|---|---|
| 16 × 16 grey | 4:4:4 | 85 / 256 | All −1…+1 |
| 16 × 16 colour | 4:4:4 | 165 / 256 | All −1…+1 |
| 16 × 16 colour | 4:2:0 | 232 / 256 | R −7…+6, G −4…+4, B −9…+8 |
| 17 × 13 grey | 4:4:4 | 70 / 221 | All −5…+26 |
| 19 × 11 colour | 4:2:0 | 190 / 209 | R −9…+16, G −10…+12, B −14…+21 |
| 160 × 120 pattern | 4:2:0 | 14163 / 19200 | R −9…+7, G −6…+5, B −13…+15 |
| 640 × 480 pattern | 4:2:0 | 230568 / 307200 | R −9…+8, G −6…+5, B −13…+15 |
These differences are retained, not converted into equality by a tolerance. The aligned 4:4:4 results are consistent with integer precision differences, but a complete independent IDCT/conversion derivation is unfinished. At a partial right-hand block, one emitter advances the decoded index only for pixels written. A one-column edge consumes indices zero through seven rather than zero, eight, sixteen and so on. Independent emitter controls isolate this from JPEG arithmetic. Normal admitted album sizes are block-aligned, so it is not a demonstrated normal album-screen defect. [1]
Connected full/thumbnail loader checks now execute the real decoder, resize and cache with file/scratch inputs supplied explicitly. They retain the thumbnail's 1,152 cleared corner pixels. Remaining questions include policy-one signatures, big-endian execution, additional marker families, complete album discovery/reset and physical timing/cache behaviour. [1]
The photo album is validated before image selection
Relocated American V2 ARM9i loader 022358E8 receives an album object, two buffers and their sizes, plus an optional error-word pointer. It clears both buffers before looking up photo:/private/ds/app/484E494A/pit.bin. Expected length comes from the caller; the checked 8,032-byte fixture has a 32-byte header and five hundred sixteen-byte records, not a proven universal allocation size. [2]
Validator 02235550 requires word 50495430, whose little-endian bytes are 30 54 49 50, record count five hundred at decimal offset eight and zero at ten. Offset twenty-two supplies the record-array offset. 02235888 temporarily clears the CRC halfword at twenty, computes over the supplied length, restores the field and compares it. Original SDK routines 020BCAE0/020BCB24 agree with an independent reflected CRC16 using polynomial A001 and initial zero. [2]
02235790 ignores inactive records with bit zero clear. Active records require the field from bits one–ten below 900, bits eleven–seventeen below 100 and bits twenty-two–twenty-three below three. Two intervening two-bit fields are extracted and compared with four. This path does not introduce a further rejection for reserved high bits. Values 899, 99 and two pass; their next boundaries fail with a recomputed valid CRC. [2]
| Failure | Loader result |
|---|---|
| Missing path | 12 |
| Directory instead of file | 13 |
| Open | 1 |
| Unexpected size | 4 |
| Incorrect read count, including negative | 5 |
| Header, CRC or active-record validation | 13 |
| Close after opening | 2, replacing a prior read/validation result |
Open failure copies the last filesystem error; read/close failures copy the file object's error word. Early stat/size failures do not invent an error-word value. Eighteen comparisons check full buffers, CRC restoration, errors and call order. Filesystem services and the final directory/slot stage remain boundaries; this is not a physical camera or successful scene-entry test. [2]
