Monday, September 7, 2026

stb_avif: a vibing effort with LLM

some months ago I was thinking about: can we have a minimal stb_image alike AVIF decoder?

I asked my friend @lenchan139 and he happily vibe me thing exactly what I asked for: https://github.com/lenchan139/stb_avif, but what is working is just HEIF container parsing with a dav1d backend and YUV-to-RGB conversion, and its internal AV1 decoder is a stub at all.

He did try to vibe internal AV1 decoder but everything is not working, maybe due to missing references and/or samples.

2 months later (which is 3 weeks before today), I finally have time to pick it up, trying to create a working version.

First, I asked ChatGPT to give me a set of headers for new internal AV1 decoder, after that free plan limit triggered (decoder started to produce some correct pixels at the time) and I switched to use opencode free models for later tasks.

First opencode free model is DeepSeek4 Flash free, which is quite decent. But in the time, the free period of DS4F ends and I have to use opencode's Big Pickle for a while to fix decoder bugs.

Then I tried other free models like nemotron 3 ultra and muse spark 1.2 but their output are not satisfying me.

After that opencode and openrouter giving out unlimited usage "Ox Alpha" for a short period of time and I used it a lot, which is quite satisfying and quite progressed.

Good times are short and Ox Alpha free period ended, and there is no alternatives that has same level as Ox Alpha, I went back to old path: pack my files and upload it to ChatGPT and ask questions. ChatGPT working for about 25 minutes and tried to give some answers, it may give out some bugfix patches or it give out intermediate answer without any patch.

After some more testings, I found that Mimo v2.5 free is better than Big Pickle and still available to use and I switched to it for my later vibing.

Later workflow is like a loop: adding non-working new sample files, tell LLM about that and it started testing and tracing the error. When opencode free usage is used up, switch to new IP and continue.

Vibed for 3 weeks and now stb_avif is quite usable with internal AV1 decoder.

My commits are pushed and I created a PR to upstream, as I posted upstream link to Hacker News in the past.

Conclusion: as a F2P(Free-to-Play) LLM user, you can still able to code(or say, vibe) something big.

No comments:

Post a Comment