Skip to content

Encode test data as base64, fix Base64Dec(), add video GOP decode test - #225

Merged
flipflip8952 merged 5 commits into
mainfrom
test-data-base64
Oct 28, 2026
Merged

flipflip8952 merged 5 commits into
mainfrom
test-data-base64

Conversation

@flipflip8952

@flipflip8952 flipflip8952 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
  • Fix Base64Dec() output size, which dropped or added one byte unless base64 string ended in exactly one "="
  • Added testcases for that
  • Encode test data as base64 string literals (~1.35 instead of ~6 source chars per byte, i.e. ~4.5x smaller)
  • Add VideoTest.DecodeGop
  • Fix PixelFmt::GBRP docs

flipflip8952 and others added 5 commits October 28, 2026 16:35
Base64Dec() always removed one byte from the decoded_size() upper bound, which is only correct for input with a
single '=' padding. Input without padding lost its last byte, input with '==' padding got an extra garbage byte.
Use the number of bytes actually written by decode() instead, and test all padding variants.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The xxd generated { 0x00, 0x01, ... } initializer lists use ~6 source chars per byte. Generate base64 string
literals instead (~1.35 chars per byte), decoded at static init using Base64Dec(). This makes the generated files
~4.5x smaller and faster to compile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Add test data with one GOP (I frame + 9 P frames) of H.265 1024x768 video
- Decode all frames using software decoding to Y8, RGB24 and GBRP, check that RGB24 and GBRP are the same pixels
- Fix PixelFmt::GBRP docu, the plane order is G, B, R (as in FFmpeg), not R, G, B

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rings)

Adjacent string literals are concatenated by the compiler, which for hevc_gop.cpp results in a 1.3 MB literal,
exceeding the 65536 chars that C++ compilers are required to support (clang -pedantic -Werror fails). Put the
base64 lines into an array of separate literals and join them at static init instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@flipflip8952
flipflip8952 merged commit 68fed2e into main Oct 28, 2026
7 checks passed
@flipflip8952
flipflip8952 deleted the test-data-base64 branch October 28, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant