Sorry, I cannot edit the initial post to add a note:
- this issue happens for at least 20% of PNG files, but never when converting JPEG; based on a testing of about ~5000 JPEG and ~5000 PNG files
--
You received this message because you are subscribed to the Google Groups "AV1 Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to av1-discuss...@aomedia.org.
To view this discussion on the web visit https://groups.google.com/a/aomedia.org/d/msgid/av1-discuss/936a6a4b-1b1a-4b10-b77a-2f2ff070b59an%40aomedia.org.
To view this discussion on the web visit https://groups.google.com/a/aomedia.org/d/msgid/av1-discuss/a4d1c060-74ce-4dd0-bdc3-ae7bd2f6d02bn%40aomedia.org.
To view this discussion on the web visit https://groups.google.com/a/aomedia.org/d/msgid/av1-discuss/ca1d89e0-a956-4ea2-b0a3-34fbcba3c86bn%40aomedia.org.
Thank you very much Cheng for the guidance and useful info.
I ran the exact same CLI commands you provided and unfortunately, it confirms the issue I'm raising with libaom.Here's how you could confirm the invalid behavior in libaom:1. As you guided, convert PNG to YUV4Mpegffmpeg -i example.png -pix_fmt yuv420p example.y4m
2. And then convert Y4M to AVIF with libaom (sequentially to avoid possible issues with parallel processing):aomenc -p 1 -w 1534 -h 2000 --cpu-used=0 -o 0.avif example.y4m &&
aomenc -p 1 -w 1534 -h 2000 --cpu-used=1 -o 1.avif example.y4m &&
aomenc -p 1 -w 1534 -h 2000 --cpu-used=2 -o 2.avif example.y4m &&
aomenc -p 1 -w 1534 -h 2000 --cpu-used=3 -o 3.avif example.y4m &&
aomenc -p 1 -w 1534 -h 2000 --cpu-used=4 -o 4.avif example.y4m &&
aomenc -p 1 -w 1534 -h 2000 --cpu-used=5 -o 5.avif example.y4m &&
aomenc -p 1 -w 1534 -h 2000 --cpu-used=6 -o 6.avif example.y4m &&
aomenc -p 1 -w 1534 -h 2000 --cpu-used=7 -o 7.avif example.y4m &&
aomenc -p 1 -w 1534 -h 2000 --cpu-used=8 -o 8.avif example.y4m &&
aomenc -p 1 -w 1534 -h 2000 --cpu-used=9 -o 9.avif example.y4m3. Then, observe the bug (the quicker libaom processed, the smaller the files are):
To view this discussion on the web visit https://groups.google.com/a/aomedia.org/d/msgid/av1-discuss/4e7d45e0-b8f8-4d99-a0bb-697815db4f5fn%40aomedia.org.
Jing, the parameter we are discussing is called CPU USED.
--cpu-used has nothing to do in any programming dictionary with the encoding complexity.99% of developers would expect --cpu-used to affect only the speed of the process, not the resulting output.
This looks more like an encoder behavior than a real bug. With AVIF, a lower speed value does not always guarantee better compression, especially for lossless or near-lossless PNG sources. At quality=64, libaom may choose more complex partitions or prediction modes at slower speeds, which can actually increase the final file size instead of reducing it. This effect is more noticeable with: Flat or synthetic PNG images (UI, icons, charts), Already well-filtered PNG inputs, Certain libaom + libheif version combinations. Testing with different image types (photographic vs flat graphics) and adjusting quality or encoder parameters usually changes the outcome. AVIF tends to show its real advantage more clearly on photo-like content.
For quick comparisons and sanity checks, I’ve also found it useful to test AVIF to PNG conversions with online tools like:
https://www.reddit.com/r/AV1/comments/1aob3q9/png_to_avif/Results can vary quite a bit depending on the source image and encoder setting.