Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
22nd April 2008, 18:44 | #1 | Link |
x264 developer
Join Date: Sep 2005
Posts: 8,666
|
x264: Film Grain Optimization
example:
with, without fprofiled win32 build patch (updated to work on latest revision and on 64-bit) explanation (how it works, etc) usage: --fgo, see --help for more info. Requires RDO, i.e. --subme 6 or higher and --b-rdo. Obviously doesn't work well on non-grainy sources. Last edited by Dark Shikari; 3rd May 2008 at 10:50. |
22nd April 2008, 21:15 | #9 | Link |
Derek Prestegard IRL
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,989
|
<3!!!!
I've been waiting for this one for a long time!! I was under the impression that FGM had to be supported decoder side as well? ~misfit
__________________
These are all my personal statements, not those of my employer :) |
22nd April 2008, 21:19 | #10 | Link | |
x264 developer
Join Date: Sep 2005
Posts: 8,666
|
Quote:
FGO uses NSSD instead. NSSD consists of two components: 1) SSD as before. 2) abs( Noise(Reference Block) - Noise(Coded Block) ) * Weight, where "weight" is the --fgo parameter (this parameter also controls a few other things in FGO). The resulting score is SSD + ND (Noise Difference). Noise is measured as follows: If X(i,j) is a pixel in a block, the noise score for that pixel is abs(X(i,j) - X(i+1,j) - X(i,j+1) + X(i+1,j+1)). This is summed up over all pixels in the block. In other words, NSSD rewards modes which have a similar amount of noise and approximate the source reasonably well. This noise need not be exactly like the source's noise; it merely needs to be good enough. This isn't FGM, its FGO. |
|
22nd April 2008, 21:36 | #13 | Link | |
x264 developer
Join Date: Sep 2005
Posts: 8,666
|
Quote:
In incredibly simple terms: it measures only that the amount of noise in a candidate block is the same as it should be, not that its the same noise as in the source. |
|
22nd April 2008, 22:18 | #16 | Link |
x264 Tester
Join Date: Dec 2005
Location: Austria, near Vienna
Posts: 223
|
OMG Dark Shikari, you just wrote the XviD-KILLER!!!
everything that was better with xvid is GONE! with FGO i simply got the best encode of the BlackPearl-Sample. looks like 60 mb, at only 32 mb!!! and forget about matrices, who needs matrices now? if you don't believe it, here are some screens Left AQ (29,4 MB), Right AQ + FGO (32,1 MB) and the most amazing image-pair: commandline: Code:
--crf 20.0 --level 4.1 --keyint 100 --min-keyint 1 --ref 3 --mixed-refs --no-fast-pskip --bframes 2 --b-pyramid --b-rdo --bime --weightb --filter -2,-2 --subme 6 --trellis 1 --analyse p8x8,b8x8,i4x4,i8x8 --8x8dct --vbv-bufsize 9781 --vbv-maxrate 29400 --threads auto --thread-input --progress --no-dct-decimate --output "output" "input" --fgo 10 |
22nd April 2008, 22:48 | #17 | Link |
Testeur de codecs
Join Date: May 2003
Location: France
Posts: 2,484
|
Perhaps SSD problem here (with non-grainy source certainely that ND ~ 0). Why not choose other metric like SAD/SATD if ND ~ 0 or if ND < Threshold. Why not SAD + ND or SATD + ND too.
__________________
Le Sagittaire ... ;-) 1- Ateme AVC or x264 2- VP7 or RV10 only for anime 3- XviD, DivX or WMV9 |
23rd April 2008, 00:16 | #19 | Link |
Turkey Machine
Join Date: Jan 2005
Location: Lowestoft, UK (but visit lots of places with bribes [beer])
Posts: 1,953
|
Wow, Dark Shikari with another wonder-patch that'll surely make it's way to SVN within a matter of weeks!
How optimised is it? And do I now have to re-encode most of my movies to fit?
__________________
On Discworld it is clearly recognized that million-to-one chances happen 9 times out of 10. If the hero did not overcome huge odds, what would be the point? Terry Pratchett - The Science Of Discworld |
23rd April 2008, 00:34 | #20 | Link | |
x264 developer
Join Date: Sep 2005
Posts: 8,666
|
Quote:
Its probably erring on the side of caution in the disabling of certain RD thresholds; I'm guessing I might want to reinstate them, just at a higher level than normal. The "noise" operation is SIMD-optimized but its not nearly as optimized as it could be; it can definitely get faster. |
|
|
|