PDA

View Full Version : Fast, transparent, bitrate-inefficient, disposable x264 HD encodes


Morte66
12th October 2007, 13:32
So I entered the world of HD DVD. And I found it very good, except that I don't really like all that grain they went to so much trouble to retain. So I've been thinking about denoising, which means encoding since I can't run a good denoiser in real time. This is a slow process. Since I don't generally want to watch films more than once (or once per decade), I thought of making "disposable" encodes that I'd watch and delete. I'd give up compression to get speed whilst retaining quality. The ultimate answer would be HuffYUV, but that needs too much disc space. Xvid at q=2 is an option, but I never liked what Xvid's cooling/muting of colour. So I'm pondering x264 settings.

The fastest denoiser that seems worth it (fft3dgpu) does about 4fps. My normal DVD backup settings, which are meant for high quality and good compression, are --crf 18 --ref 3 --mixed-refs --no-fast-pskip --bframes 3 --b-pyramid --b-rdo --bime --weightb --subme 6 --trellis 1 --analyse all --8x8dct --threads auto --thread-input --progress --no-dct-decimate --no-psnr --no-ssim and they give me about 2fps encoding with a ~9kbps result that plays back on 55% CPU. I'd ideally like to get x264 to 2-4x times that encoding speed by expending bitrate, but not push the bitrate so high it interferes with smooth decoding.

I have no idea where to start, it's completely outside my normal experience. Presumably I'd go to --ref 1. Turning off --mixed-refs is a lot faster AFAIR. And I imagine I'd reduce --subme, but I'm not sure how far. But what about the b-frames? Do I turn them off, or just cut the quantity and features? Any other suggestions?

I expect I'll do a lot of fiddling, but I'd appreciate a few pointers on where to start.

Dark Shikari
12th October 2007, 15:42
Here are the settings I came up with for optimal quality-per-speed a few weeks ago. Note that the top "insane quality" levels require some custom patches (which aren't in the SVN yet) but that doesn't matter since you're not looking for ultra-low speed :p

Q100 --bframe 16 --me tes --merange 24 --subme 7 --no-fast-pskip --partitions all --8x8dct --bime --ref 16 --trellis 2 --mixed-refs --weightb --me-prepass --b-rdo
Q95 --bframe 16 --me esa --merange 20 --subme 7 --no-fast-pskip --partitions all --8x8dct --bime --ref 10 --trellis 2 --mixed-refs --weightb --me-prepass --b-rdo
Q90 --bframe 16 --me umh --merange 16 --subme 7 --no-fast-pskip --partitions all --8x8dct --bime --ref 6 --trellis 2 --mixed-refs --weightb --me-prepass --b-rdo
Q85 --bframe 16 --me umh --merange 16 --subme 7 --no-fast-pskip --partitions all --8x8dct --bime --ref 6 --trellis 2 --mixed-refs --weightb --me-prepass --b-rdo
Q80 --bframe 16 --me umh --merange 16 --subme 7 --partitions all --8x8dct --bime --ref 6 --trellis 1 --mixed-refs --weightb --me-prepass --b-rdo
Q75 --bframe 16 --me umh --merange 12 --subme 7 --partitions all --8x8dct --bime --ref 5 --trellis 1 --mixed-refs --weightb --b-rdo
Q70 --bframe 16 --me umh --merange 12 --subme 6 --partitions all --8x8dct --bime --ref 5 --trellis 1 --mixed-refs --weightb
Q65 --bframe 16 --me umh --merange 8 --subme 5 --partitions i8x8,b8x8,p8x8,i4x4 --8x8dct --bime --ref 5 --trellis 1 --mixed-refs --weightb
Q60 --bframe 16 --me hex --subme 4 --partitions i8x8,b8x8,p8x8,i4x4 --8x8dct --bime --ref 5 --trellis 1 --mixed-refs --weightb
Q55 --bframe 16 --me hex --subme 4 --partitions i8x8,b8x8,p8x8,i4x4 --8x8dct --bime --ref 4 --mixed-refs --weightb
Q50 --bframe 16 --me hex --subme 3 --partitions i8x8,b8x8,p8x8 --8x8dct --bime --ref 4 --mixed-refs --weightb
Q45 --bframe 16 --me hex --subme 3 --partitions i8x8,b8x8,p8x8 --8x8dct --ref 3 --mixed-refs --weightb
Q40 --bframe 16 --me hex --subme 3 --partitions i8x8,b8x8,p8x8 --8x8dct --ref 2 --mixed-refs --weightb
Q35 --bframe 16 --me dia --subme 3 --partitions i8x8,b8x8,p8x8 --8x8dct --weightb
Q30 --bframe 16 --me hex --subme 3 --partitions i8x8,b8x8 --8x8dct --weightb
Q25 --bframe 16 --me dia --subme 3 --partitions i8x8,b8x8 --8x8dct --weightb
Q20 --bframe 16 --me hex --subme 3 --partitions b8x8 --weightb
Q15 --bframe 16 --me hex --subme 3 --partitions none --weightb
Q10 --bframe 16 --me hex --subme 2 --partitions none --weightb
Q5 --bframe 16 --me dia --merange 12 --subme 2 --partitions none
Q0 --bframe 16 --me dia --merange 8 --subme 1 --partitions none


Q50 is surprisingly fast yet looks quite fine IMO.