echo -n "Decoding $NUM_FILES AVIF files to PNG... "
start_time=$EPOCHREALTIME
for ((i=1; i<=NUM_FILES; i++)); do
avifdec "_png_$i.avif" "_png_${i}_from_avif.png" >/dev/null 2>&1
done
end_time=$EPOCHREALTIME
avif_dec_time=$((end_time - start_time))
printf "Done! (%.3fs)\n" $avif_dec_time
printf "JXL Total Encode Time: %8.3f s\n" $jxl_enc_time
printf "AVIF Total Encode Time: %8.3f s\n" $avif_enc_time
echo "--------------------------------------"
printf "JXL Total Decode Time: %8.3f s\n" $jxl_dec_time
printf "AVIF Total Decode Time: %8.3f s\n" $avif_dec_time
echo "======================================"
./avif-vs-jxl.sh
======================================
Image Encoding/Decoding Benchmark
======================================
Target files: _png_1.png to _png_17.png
JXL args: cjxl -d 1.0
AVIF args: avifenc -q 80 -s 6
======================================
Encoding 17 files to JXL... Done! (6.859s)
Encoding 17 files to AVIF... Done! (4.221s)
Decoding 17 JXL files to PNG... Done! (3.648s)
Decoding 17 AVIF files to PNG... Done! (12.774s)
======================================
Benchmark Results Summary
======================================
JXL Total Encode Time: 6.859 s
AVIF Total Encode Time: 4.221 s
--------------------------------------
JXL Total Decode Time: 3.648 s
AVIF Total Decode Time: 12.774 s
======================================
>almost 400% decoding time, ie what matters in practice
your move telavif