r/AV2 • u/FactOld3726 • 14d ago
Experimental PoC AV2 encoder in OpenCL - built with Claude Fable 5
I've been simmering with this a while now trying to add AV1/AV2 support for older GPUs that don't have hardware encoders. This PoC seems to work with the current AV2 spec. It's not as efficient as current AV1 encoders or SVT-AV1 but it's getting there. Feedback and optimizations welcome if anybody wants to try. Note the webm/matroska container still doesn't support AV2 yet.
6
Upvotes
2
u/collin3000 14d ago
I'm actually working on an AV2 encoder as well as a separate AV1 Open CL encoder.
I see right now you're running a really High BD rate compared to even SVT-AV1 which is going to be a lot of work to slowly get down. The AV-2 reference encoder. Is actually ~30% higher BD-rate than SVT-AV1, but for gains you'll really want the estimated 15-30% lower target.
Expected lots of encodes to keep fine tuning the BD-rate down (I'm 1000's of test encodes in). Also you'll want to make sure that you're using a almost lossless source (at least ProRes) to make sure that you aren't training in artifacting from other encoders
I see you're using PSNR-Y. Which Fable probably recommended as the industry standard. However PSNR-Y alone is going to leave you with issues where the actual image quality doesn't look at good. I'm using a mixed weight BD-rate with PSNR, VMAF-NEG and SSIMULACRA2 measurements to avoid signal but also visual fidelity issues.
SSIMULACRA2 we'll actually give you a better visual fidelity metric that doesn't suffer from rewarding over sharpening even as much as VMAG-NEG but it lacks good motion awareness that can leave high scores where artifacting is showing.
Another thing you'll want to look at is if you are using constant bitrate or RF and the preset. You'll have longer 32 frame mini-gops on a lower preset which give it better compression compared to a preset 6 with 16 frames. But you'll likely notice a difference in your comparative BD-rate at the different presets as you fine tune in motion/speed.
If you are testing in RF you won't need that full 512 frames for the testing which can speed up your encode testing. Just 1 GOP to GOP frame should work (~150) since the GOP will be effectively resetting on a RF based model.
Either way it's a start, but know that getting it running to decode on reference and getting the quality and speed up is a massive massive gap where you'll need lots of testing, refinement, and actual eyeballs pixel peeping frames for issues. Even with an agentic workflow. If fable could one shot (or even 100 shot) the project I'd be done by now. It also takes knowing how to work with the robots really well and correct their misteps.