Log in

View Full Version : Encoded files with avisynth degrain filters bigger than without?


Wishbringer
22nd December 2006, 08:13
Because I'm encoding with x264 I post in this forum. Don't know if it is the right one, so please move when I am worng.

I tried to encode a file for my PSP with "PD-PSP"-profile, only changed to -crf 18.

--crf 18 --level 2.1 --ref 2 --mixed-refs --bframes 3 --b-rdo --bime --weightb --subme 6 --trellis 1 --analyse p8x8,b8x8,i4x4,p4x4 --vbv-maxrate 4000 --me umh --threads 2 --thread-input --progress --no-psnr --no-ssim

avis [info]: 368x208 @ 25.00 fps (179727 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2 3DNow!
x264 [warning]: VBV maxrate specified, but no bufsize.
mp4 [info]: initial delay 1 (scale 25)
x264 [info]: slice I:1873 Avg QP:17.47 size: 17110
x264 [info]: slice P:82083 Avg QP:19.56 size: 4460
x264 [info]: slice B:95771 Avg QP:20.91 size: 680
x264 [info]: mb I I16..4: 29.4% 0.0% 70.6%
x264 [info]: mb P I16..4: 4.4% 0.0% 4.9% P16..4: 43.1% 13.5% 13.1% 2.4% 1.8% skip:16.8%
x264 [info]: mb B I16..4: 0.1% 0.0% 0.2% B16..8: 24.9% 1.6% 5.1% direct: 2.2% skip:65.8%
x264 [info]: ref P 77.8% 22.2%
x264 [info]: ref B 84.3% 15.7%
x264 [info]: kb/s:515.5

encoded 179727 frames, 23.74 fps, 515.59 kb/s

desired video bitrate of this job: 18 kbit/s - obtained video bitrate (approximate): 517 kbit/s

and got a 454 MB file with nice quality.
So i thought, applying some filters like:

FFT3dFilter()
DeGrainMedian()

would reduce the filesize further.

Used same commandline and got:


avis [info]: 368x208 @ 25.00 fps (179727 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2 3DNow!
x264 [warning]: VBV maxrate specified, but no bufsize.
mp4 [info]: initial delay 1 (scale 25)
x264 [info]: slice I:1867 Avg QP:16.58 size: 16901
x264 [info]: slice P:101842 Avg QP:18.50 size: 4175
x264 [info]: slice B:76018 Avg QP:20.27 size: 833
x264 [info]: mb I I16..4: 25.8% 0.0% 74.2%
x264 [info]: mb P I16..4: 3.8% 0.0% 4.2% P16..4: 46.0% 12.0% 11.3% 2.0% 1.6% skip:19.2%
x264 [info]: mb B I16..4: 0.2% 0.0% 0.3% B16..8: 23.5% 1.9% 6.1% direct: 2.7% skip:65.3%
x264 [info]: ref P 83.5% 16.5%
x264 [info]: ref B 87.5% 12.5%
x264 [info]: kb/s:578.7

encoded 179727 frames, 10.69 fps, 578.77 kb/s

desired video bitrate of this job: 18 kbit/s - obtained video bitrate (approximate): 580 kbit/s

higher bitrate and filesize around 509 MB.

Till now I thought that Denoiser and frequenzy filter would reduce details, grain, interferences and so practically would reduce filesize.

Good that i kept my old encode. But am still wondering what happened.:confused:

imcold
22nd December 2006, 10:50
Nothing serious. The second file has lower quantizers (cca. -1.0) - resembles the original more. But lower quants = higher bitrate. CRF mode tries to keep the quantizers around specified QP; and with second encode it was closer to 18 than in first.

DarkZell666
22nd December 2006, 11:16
Which means that if you did a two-pass encoding wih the same target bitrate/filesize, the filtered version would look nicer than the non-filtered version, just as it should :p

R3Z
23rd December 2006, 11:36
Nothing serious. The second file has lower quantizers (cca. -1.0) - resembles the original more. But lower quants = higher bitrate. CRF mode tries to keep the quantizers around specified QP; and with second encode it was closer to 18 than in first.


But surely x264 would allocate higher quant to noisier footage ? This confuses me :confused:

I would have thought that a less detailed source (ie a denoised/grained) would = better compression.

Manao
23rd December 2006, 12:18
Which means that if you did a two-pass encoding wih the same target bitrate/filesize, the filtered version would look nicer than the non-filtered versionThough the conclusion is likely to be true, the reasoning is wrong. You get one encoding with an average quantizer of 19.5 which is smaller than an encoding with an average quantizer of 18.5. You can't conclude anything.But surely x264 would allocate higher quant to noisier footageThat's what it did, didn't it ?would have thought that a less detailed source (ie a denoised/grained) would = better compressionAnd you're right : CRF != constant quantizer.

In CRF, x264 distributes bits as in a 2 passes encoding. And that means high complexity ( or noised ) scenes will get a higher bitrate than low complexity one. But they'll also get a higher quantizer. In that case, the denoised version is simpler, so it gets a lower quantizer. And the bitrate is higher, because it seems the denoising didn't reduced that much the coding complexity.