[FFmpeg-devel] [PATCH] vc2enc_dwt: use 32 bit coefficients by default

Christophe Gisquet christophe.gisquet at gmail.com
Sat May 7 19:55:58 CEST 2016


2016-05-07 19:12 GMT+02:00 Rostislav Pehlivanov <atomnuker at gmail.com>:
> The problem is that with particularly complex images and especially at
> high bit depths and 5-level transforms the coefficients would overflow

I guess it also depends on the transform type, so that counts also for
the last comment.

> causing huge artifacts to appear. This was discovered thanks to the fate
> tests, which will have to be redone as this fixes a multitude of
> problems and increases PSNR.

I admit I saw strange numbers, but as they sometime include color
transform forth and back, I didn't really pay attention.
Was there a risk it produced incorrect output in "valid" decoders?

> There is a slight performance drop associated with this change, making
> the encoder slower by 1.15 times, however this is necessary in order to
> avoid undefined behavior and overflows.

This means no asm has been written yet. Is the performance drop mostly
in transforms, or rather any coefficient manipulation (like rate
evaluation etc), or memory bandwidth?
In the former case, it might be less critical in the future.

> It would be worth to template the transforms to keep the performance for
> 8 bit images as 32 bit coefficients are unnecessary for that case, but
> the primary use of the encoder is to encode video at 10 bits.

I don't know what that entails, but indeed, there are several
parameters affecting what's possible, and the current change is the
simplest/fastest/safest at the moment.

-- 
Christophe


More information about the ffmpeg-devel mailing list