AOMediaCodec / libavif

libavif - Library for encoding and decoding .avif files
Other
1.58k stars 207 forks source link

“--progressive” file is too large #1667

Open sommio opened 1 year ago

sommio commented 1 year ago

Although “--progressive” generates larger but better quality avif files, this does not seem to be the expected behavior.

Information aom 3.7.0-1.1 (via ALHP) libavif 1.0.1-1.1 (via ALHP)

Reproduction

avifenc -s 3 -j 3 -d 10 --min 0 --max 63 --minalpha 0 --maxalpha 63 \
-a end-usage=q -a sharpness=1 -a enable-chroma-deltaq=1 -a tune=psnr \
-a qm-min=0 -a deltaq-mode=3 -a aq-mode=1 -a enable-dnl-denoising=0 \
-a denoise-noise-level=5 -a cq-level=18 image.png image.avif
avifenc -s 3 -j 3 -d 10 --min 0 --max 63 --minalpha 0 --maxalpha 63 \
-a end-usage=q -a sharpness=1 -a enable-chroma-deltaq=1 -a tune=psnr \
-a qm-min=0 -a deltaq-mode=3 -a aq-mode=1 -a enable-dnl-denoising=0 \
-a denoise-noise-level=5 -a cq-level=18 --progressive image.png image_p.avif
55k   6 Oct 22:26 image.avif
414k  6 Oct 22:28 image_p.avif
2.2M  2 Oct 20:40 image.png

image.png

vrabaud commented 1 year ago

Hi, --progressive is still experimental and indeed needs more parameter tuning. BTW, I cannot access the data at the given URL. Please attach them as normal images.

sommio commented 1 year ago

Sorry, I have re-uploaded it.

tongyuantongyu commented 1 year ago

Currently when encoding progressive images, AOM does not respect quality settings very well other than in CBR mode. Encode with following commands

avifenc -s 3 -j 3 -d 10 -a sharpness=1 -a enable-chroma-deltaq=1 -a tune=psnr \
 -a qm-min=0 -a deltaq-mode=3 -a aq-mode=1 -a enable-dnl-denoising=0 \
 -a denoise-noise-level=5 -a end-usage=cbr -q 71 image.png image_cbr.avif

avifenc -s 3 -j 3 -d 10 -a sharpness=1 -a enable-chroma-deltaq=1 -a tune=psnr \
-a qm-min=0 -a deltaq-mode=3 -a aq-mode=1 -a enable-dnl-denoising=0 \
-a denoise-noise-level=5 -a end-usage=cbr --progressive -q 71 image.png image_cbr_p.avif

yields

43K Oct 10 22:48  image_cbr.avif
46K Oct 10 22:49  image_cbr_p.avif

which should be closer to your expectation.