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.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 31st May 2008, 19:04   #1  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,690
Psy RDO: Official testing thread (version 0.6 out!)

Psychovisually optimized rate-distortion optimization

Experimental Patch: Psy RD 0.6 (updated for r950)
Build: r937, version 0.6

Version 0.6 changes:

1. Psy trellis (adjustable separately on commandline) included and on by default.
2. Automatically adjust chroma QP offset to compensate for the higher quants psy RD/trellis result in.
3. Psy trellis allows trellis=1 now.

Version 0.3-0.5 changes:

1. Much faster, by caching half the SATDs that need to be done.
2. Warn the user if trellis 1 is enabled--and disable trellis--if psy RD is on.
3. Psy RD strength is now a decimal value with default 1.0. Don't touch it unless you have good reason.
4. Psy RD strength now automatically scales based on quantizer. This is done internally--the "strength" is a multiplier to this internal value.

How to use it:

Its on by default. Adjust the strength with --psy-rd. That's it.

How it works (simply): the human eye doesn't just want the image to look similar to the original, it wants the image to have similar complexity. Therefore, we would rather see a somewhat distorted but still detailed block than a non-distorted but completely blurred block. The result is a bias towards a detailed and/or grainy output image, a bit like xvid except that its actual detail rather than ugly blocking.

How it works (full explanation): read the comment in the patch.

Last edited by Dark Shikari; 27th August 2008 at 02:56.
Dark Shikari is offline   Reply With Quote
Old 31st May 2008, 19:21   #2  |  Link
gav1577
Registered User
 
gav1577's Avatar
 
Join Date: Sep 2004
Location: Wales UK
Posts: 228
Quote:
Originally Posted by Dark Shikari View Post
If it isn't obvious already, this is going to destroy your PSNR and SSIM.
Great work Dark Shikari is the above anything to worry about ? i am a noob when it comes x264
gav1577 is offline   Reply With Quote
Old 31st May 2008, 19:22   #3  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,690
Quote:
Originally Posted by gav1577 View Post
Great work Dark Shikari is the above anything to worry about ? i am a noob when it comes x264
It only matters if you think that numbers are more important than how the video actually looks.
Dark Shikari is offline   Reply With Quote
Old 31st May 2008, 19:30   #4  |  Link
gav1577
Registered User
 
gav1577's Avatar
 
Join Date: Sep 2004
Location: Wales UK
Posts: 228
Ha ha the picture is more important IMHO. is there any cmd switch
for this patch or is automatically activated with certain settings ?
Thanks nevermind you just edited and answered my question thanks

Last edited by gav1577; 31st May 2008 at 19:33.
gav1577 is offline   Reply With Quote
Old 31st May 2008, 19:32   #5  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,690
Quote:
Originally Posted by gav1577 View Post
Ha ha the picture is more important IMHO. is there any cmd switch
for this patch or is automatically activated with certain settings ?
Thanks
Its on by default any time you're using RDO. As such this is a patch for testing purposes and not for something to apply to every modified build out there, since you can't turn it off
Quote:
Originally Posted by Sagittaire View Post
Only 84 lines for the patch ... ?
Yup, and a large portion is comments

As you can tell the code is heavily macroed to reduce duplication; unwrapped it'd be another dozen lines or two. But overall the patch isn't too complicated; I'm only changing how x264 views "distortion" in RDO.
Dark Shikari is offline   Reply With Quote
Old 31st May 2008, 19:44   #6  |  Link
guada2
Registered User
 
Join Date: Jun 2005
Location: Lyon
Posts: 194
"Dark is a photoshop fgox264 .
Very god job.

Some questions:

- at what bitrate is it useful?
- is it compatible with grain opt on quickly scene?
guada2 is offline   Reply With Quote
Old 31st May 2008, 22:12   #7  |  Link
TheRyuu
warpsharpened
 
Join Date: Feb 2007
Posts: 787
Quote:
Originally Posted by guada2 View Post
- at what bitrate is it useful?
- is it compatible with grain opt on quickly scene?
1.) Any
2.) It is intended to replace fgo or at least 'should' replace it. (hope that answers your question since I do not understand it fully)
TheRyuu is offline   Reply With Quote
Old 31st May 2008, 19:28   #8  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,413
Only 84 lines for the patch ... ?
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9
Sagittaire is offline   Reply With Quote
Old 31st May 2008, 19:58   #9  |  Link
desta
Registered User
 
Join Date: Jan 2006
Posts: 220
Me and my "2pass encode" questions again.... Would there be a worthwhile benefit in enabling this for both passes, or would just the 2nd pass suffice?
desta is offline   Reply With Quote
Old 31st May 2008, 20:06   #10  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,413
Quote:
Originally Posted by desta View Post
Me and my "2pass encode" questions again.... Would there be a worthwhile benefit in enabling this for both passes, or would just the 2nd pass suffice?
And as always ... no. Because first pass is just a statistical reference for 2nd pass Rate Control. Very fine first pass (crf mode with same setting with close bitrate) will produce marginal better overall quality (it's just Rate Control optimisation).
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9
Sagittaire is offline   Reply With Quote
Old 31st May 2008, 21:26   #11  |  Link
desta
Registered User
 
Join Date: Jan 2006
Posts: 220
Quote:
Originally Posted by Sagittaire View Post
And as always ... no. Because first pass is just a statistical reference for 2nd pass Rate Control. Very fine first pass (crf mode with same setting with close bitrate) will produce marginal better overall quality (it's just Rate Control optimisation).
It wasn't exactly a ridiculous question though either. We know AQ needs to be the same for both passes to work, and other settings need to be similar or the same to do their job properly. I have also had instances where using similar settings in both passes have made for a better encode, especially when using FGO, which this patch is to replace....

http://forum.doom9.org/showthread.ph...77#post1143777
desta is offline   Reply With Quote
Old 31st May 2008, 22:05   #12  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,685
Damn DS!! You rule!! Keep the awesome quality patches coming!!
__________________
FAQs:Bond's AVC/H.264 FAQ
Site:Adubvideo
Adub is offline   Reply With Quote
Old 31st May 2008, 23:03   #13  |  Link
Gabriel_Bouvigne
L.A.M.E. developer
 
Gabriel_Bouvigne's Avatar
 
Join Date: Dec 2001
Location: Paris - France
Posts: 276
Nitpicking: this is not really similar to "perceptual entropy", but quite similar to the "dropout prevention" used by several encoders (exemple: 3gpp HE-AACv2 reference encoder).
Gabriel_Bouvigne is offline   Reply With Quote
Old 31st May 2008, 23:14   #14  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,690
Quote:
Originally Posted by Gabriel_Bouvigne View Post
Nitpicking: this is not really similar to "perceptual entropy", but quite similar to the "dropout prevention" used by several encoders (exemple: 3gpp HE-AACv2 reference encoder).
Explain?
Dark Shikari is offline   Reply With Quote
Old 1st June 2008, 00:05   #15  |  Link
techouse
Strictly Rhythm
 
techouse's Avatar
 
Join Date: Jul 2007
Location: Ljubljana, Slovenia
Posts: 166
I <3 Dark
techouse is offline   Reply With Quote
Old 1st June 2008, 00:09   #16  |  Link
Gabriel_Bouvigne
L.A.M.E. developer
 
Gabriel_Bouvigne's Avatar
 
Join Date: Dec 2001
Location: Paris - France
Posts: 276
PE is a kind of rough complexity estimation of the frame done at early stage, and is usually done on a less granular scale. It is usually (PE is mainly a concept rather than a specific metric) not used within the RD/quantization stage. On the other hand, dropout prevention is something (usually enabled at low bitrates) that tries to preserve power per subband, even if the individual frequency bins are different, in order to avoid holes within the spectrum.

A simple dropout prevention scheme is described there:
http://www.3gpp.org/ftp/Specs/archiv.../26403-700.zip
section 5.6.1.1.2 "Avoidance of spectral holes"
Gabriel_Bouvigne is offline   Reply With Quote
Old 1st June 2008, 00:33   #17  |  Link
techouse
Strictly Rhythm
 
techouse's Avatar
 
Join Date: Jul 2007
Location: Ljubljana, Slovenia
Posts: 166
http://techouse.project357.com/build...do_techouse.7z

Quote:
Source: x264 r859 GIT (git://git.videolan.org/x264.git)

Applied patches (current versions):

x264_2pass_vbv.9.diff

x264_fix_win_stdin.diff

x264.gaussian.cplxblur.01.diff

x264_hrd_pulldown.04_interlace.diff

x264_me-prepass_DeathTheSheep.diff

x264_progress.diff

x264_psy_rdo.diff (this patch is STILL IN TESTING but it pretty much replaces FGO; please test how it compares to FGO using my older build "x264_x86_r859_progress_techouse")

x264_rd-optimze_DeathTheSheep.diff


Please check http://forum.doom9.org/showthread.php?t=130364 and http://git.videolan.org/gitweb.cgi?p...git;a=shortlog for more info

Compiled by techouse on June 1st 2008, 01:21:49 CEST with GCC-4.3.0 on Windows Vista Business SP-1 32-bit.

Commandline used: ./configure&&make

Platform: X86
System: MINGW
avis input: yes
mp4 output: yes
pthread: yes
gtk: no
debug: no
gprof: no
PIC: no
shared: no
visualize: no

Last edited by techouse; 1st June 2008 at 00:47.
techouse is offline   Reply With Quote
Old 1st June 2008, 08:53   #18  |  Link
IgorC
Registered User
 
Join Date: Apr 2004
Posts: 1,243
Some undesirable results:

With psy RDO
http://rapidshare.com/files/11924617...o_RDO.mp4.html

Without psy RDO
http://rapidshare.com/files/11924713...NoRDO.mp4.html

Settings for 3 passes:
Code:
x264.exe --threads 3 --pass 3 --progress --stats "x264_stat.log" --qcomp 0.75 --bframes 3 --bime --weightb --subme 7 --keyint 500 --ref 16 --trellis 2 --mixed-refs --8x8dct --partitions all --b-rdo --direct auto --b-pyramid --bitrate 800 --no-fast-pskip --me umh --merange 16 --deblock -1:-1 --me-prepass -o 3xrdo.mp4 Ma.avs
If source is needed I can upload it later.
IgorC is offline   Reply With Quote
Old 1st June 2008, 09:03   #19  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,690
Quote:
Originally Posted by IgorC View Post
Some undesirable results:

With psy RDO
http://rapidshare.com/files/11924617...o_RDO.mp4.html

Without psy RDO
http://rapidshare.com/files/11924713...NoRDO.mp4.html

Settings for 3 passes:
Code:
x264.exe --threads 3 --pass 3 --progress --stats "x264_stat.log" --qcomp 0.75 --bframes 3 --bime --weightb --subme 7 --keyint 500 --ref 16 --trellis 2 --mixed-refs --8x8dct --partitions all --b-rdo --direct auto --b-pyramid --bitrate 800 --no-fast-pskip --me umh --merange 16 --deblock -1:-1 --me-prepass -o 3xrdo.mp4 Ma.avs
If source is needed I can upload it later.
Undesirable? The psy-RDO version looks a hell of a lot better (overall) to me. There's a little bit of increased ringing but the overall detail retention is an order of magnitude better.

A random example:





Notice the vastly decreased blocking on the chest and the increased graininess in the background--plus of course the obvious, the face.

Last edited by Dark Shikari; 1st June 2008 at 09:10.
Dark Shikari is offline   Reply With Quote
Old 1st June 2008, 09:05   #20  |  Link
IgorC
Registered User
 
Join Date: Apr 2004
Posts: 1,243
Too much ringing and artifacts for my eyes
IgorC is offline   Reply With Quote
Reply

Tags
psy-rd, psyrdo

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:29.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.