User:XyKyWyKy/sandbox

Tables
(this is a workaround for missing table editor @ avisynth.nl wiki)

Math
(this is a workaround for missing Math @ avisynth.nl wiki)

Formulas for avisynth:Layer
 * RGB: $$base=base+((overlay-base)*(alpha*level+1)/256)/256$$
 * YUY2: $$base=base+((overlay-base)*level)/256$$

This mode shows the audiolevels for each channel in decibels (multichannel is supported). More accurately it determines:


 * the root mean square value of the samples belonging to each frame (let's say n samples) and converts this value to decibels using the following formula:

$$ RMS = 20 \cdot log_{10}( 1/32768 \cdot \sqrt{ 1/n \cdot \sum_{j=1}^{n} sample(j)^{2}} ) $$ # for each channel


 * the maximum volume of the samples belonging to each frame and converts this value to decibels using the following formula:

$$ max = 20 \cdot log_{10}(max_{j} (sample(j)) / 32768) $$ # for each channel

The bars corresponding to the root mean square value are green, and to the maximum are blue. The filter is available in planar mode and the audio is converted to 16 bit. Note that for 16 bit audio, the maximal volume could be

$$ 20 \cdot log_{10}(32768/32768) = 0 \ dB $$ (since 2^16/2 = 32768)

and the minimal volume

$$ 20 \cdot log_{10}(1/32768) = - 90.31 \ dB $$

PSNR is measured in decibels. It's defined as

$$PSNR(I,K) = 20 \cdot \log_{10}{(\frac{255}{\sqrt{MSE(I,K)}})}$$

with

$$MSE(I,K) = \frac{1}{M} \cdot \sum_{j=0}^{width-1} \sum_{k=0}^{height-1} | I(j,k) - K(j,k) |^{2}$$

where M = width $$\cdot$$ height is the number of pixels in a frame and width, height are the width and height of the frame, respectively, in pixels.

The double-sum term states that (j,k) runs over all pixels of the frame, summing the absolute value of the difference of I, K functions raised to the power of 2.

For more details see: http://en.wikipedia.org/wiki/PSNR.