finetune avifenc to keep grain
- User
finetune avifenc to keep grain
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
finetune avifenc to keep grain
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
To preserve grain when encoding with avifenc, you'll need to adjust several parameters that affect how the encoder handles fine details and noise:
Disable denoising:
--denoise-noise-level=0
Use film grain synthesis (if you want to preserve grain characteristics):
--enable-fgs=1
--fgs-table-filename=grain.tbl
Adjust quantization and rate control:
--min-q=10 --max-q=35 # Lower max Q to prevent excessive grain loss
--cq-level=20 # For constant quality mode, lower values preserve more detail
--enable-qm=0 # Disable quantization matrices that might smooth grain
Tune for grain preservation:
--tune=0 # PSNR tuning (less aggressive filtering)
--sharpness=0 # Disable sharpening filters
Disable or reduce filtering:
--enable-cdef=0 # Disable Constrained Directional Enhancement Filter
--enable-restoration=0 # Disable loop restoration filters
Here's a complete example that prioritizes grain retention:
avifenc input.png output.avif \
--min 10 --max 30 \
--minalpha 10 --maxalpha 30 \
--cq-level=18 \
--denoise-noise-level=0 \
--tune=0 \
--enable-cdef=0 \
--enable-restoration=0 \
--sharpness=0
AV1's film grain synthesis can analyze and model the grain, then remove it during encoding and re-apply it during playback. This can preserve the grain appearance while keeping file sizes smaller:
--enable-fgs=1 --denoise-noise-level=10
This approach models the grain characteristics and stores them as metadata, allowing efficient compression while maintaining the grainy look during playback.