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 28th December 2008, 16:22   #21  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by vucloutr View Post
no --subme 9 for Slowest ?
typo or is there actually something to it ?
No B-frames, so it isn't as if there's any difference between 8 and 9...
Dark Shikari is offline   Reply With Quote
Old 28th December 2008, 20:34   #22  |  Link
Daiz
Registered User
 
Join Date: Jan 2008
Location: Finland
Posts: 68
I've made some of my own tests regarding various lossless video formats, and found out that not only does lossless H.264 compress the best, it also provides the fastest playback speeds.

In the test I made a while back, I encoded the same 2000-frame clip from a DVD source to various lossless formats and then made a 2-pass encode with x264 from the various lossless files using simple AviSynth inputs. Processor used was Intel C2Q Q6600 @ 2.4 GHz.

These were the x264 encoding settings used for the lossless -> lossy encode:
Code:
x264.exe --pass 1 --stats ".stats" --progress -B 768 -b 16 -r 1 --me dia --progress --subme 1 --no-dct-decimate --partitions none --threads 6
x264.exe --pass 2 --stats ".stats" --progress -B 768 -b 16 -r 6 --mixed-refs --b-pyramid --weightb --me umh --subme 7 --merange 24 --bime --b-rdo -A all --8x8dct --threads 6 --trellis 2 --aq-strength 1.0
And these were the results:
Quote:
Lossless H.264 (encoded with --no-cabac) - average 47.587 fps - DSS2() with CoreAVC
1st pass: 143.07 fps, 790.41 kb/s
2nd pass: 28.54 fps, 778.01 kb/s

Lossless H.264 (encoded with --no-cabac) - average 47.014 fps - DSS2() with CCCP 2008-01-24's ffdshow
1st pass: 136.90 fps, 790.41 kb/s
2nd pass: 28.38 fps, 778.01 kb/s

Lossless H.264 (encoded with --no-cabac) - average 45.901 fps - FFMPEGSource()
1st pass: 133.39 fps, 790.41 kb/s
2nd pass: 27.72 fps, 778.01 kb/s

Lossless H.264 (encoded with --no-cabac) - average 45.250 fps - DirectShowSource() with CoreAVC
1st pass: 128.94 fps, 790.41 kb/s
2nd pass: 27.44 fps, 778.01 kb/s

FFVHuffy - average 42.722 fps - AVISource()
1st pass: 109.81 fps, 789.82 kb/s
2nd pass: 26.52 fps, 777.78 kb/s

Lossless H.264 - average 40.713 fps - DirectShowSource() with CoreAVC
1st pass: 92.26 fps, 793.68 kb/s
2nd pass: 26.12 fps, 778.26 kb/s

HuffYUV - average 27.449 fps - AVISource()
1st pass: 35.19 fps, 792.69 kb/s
2nd pass: 22.50 fps, 779.06 kb/s

Lagarith - average 15.130 fps - AVISource()
1st pass: 12.61 fps, 792.69 kb/s
2nd pass: 18.91 fps, 779.06 kb/s
I've been using x264 for my lossless needs ever since

Edit: Fixed the averages.
__________________
Where did neuron1 go? | Doom10

Last edited by Daiz; 28th December 2008 at 22:25.
Daiz is offline   Reply With Quote
Old 28th December 2008, 20:41   #23  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Note the proper way to average "20fps" and "100fps" is to do 2/(((1/20)+(1/100))), not just average the FPS (since the computer spends more time doing the 20fps encoding than the 100fps, so the average has to be weighted).
Dark Shikari is offline   Reply With Quote
Old 29th December 2008, 01:38   #24  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,344
Just to be on the save side I ask: (otherwise I know there would be a thread in a not to distant future where Dark Shikari writes something like: "How people come to such assumtions ..."

Are there any other options aside form b-frame related once and "-nr" that should be (need to be) disabled when aiming for a lossless encode?

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 29th December 2008, 01:39   #25  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by Selur View Post
Just to be on the save side I ask: (otherwise I know there would be a thread in a not to distant future where Dark Shikari writes something like: "How people come to such assumtions ..."

Are there any other options aside form b-frame related once and "-nr" that should be (need to be) disabled when aiming for a lossless encode?

Cu Selur
Noise reduction is forced off during lossless encoding, for obvious reasons.
Dark Shikari is offline   Reply With Quote
Old 29th December 2008, 03:12   #26  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,249
Quote:
Lossless H.264 (encoded with --no-cabac) - average 47.014 fps - DSS2() with CCCP 2008-01-24's ffdshow
1st pass: 136.90 fps, 790.41 kb/s
2nd pass: 28.38 fps, 778.01 kb/s
If you used such an old version of ffdshow to decode your lossless H.264 source, that source obviously was encoded was a very old version of x264

That's because x264 uses the "predictive lossless" profile for quite some time now. And decoding support for that profile was added to libavcdodec/ffdshow only recently!

So I recommend to repeat your test with up-to-date x264 and up-to-date ffdshow-tryout
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 29th December 2008, 04:56   #27  |  Link
Daiz
Registered User
 
Join Date: Jan 2008
Location: Finland
Posts: 68
Yeah, I made the test over 7 months ago. I doubt the situation has changed so that some other lossless format would beat lossless CAVLC H.264 though, which is the reason why I haven't bothered to redo the test yet.
__________________
Where did neuron1 go? | Doom10
Daiz is offline   Reply With Quote
Old 29th December 2008, 08:23   #28  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,344
Quote:
Noise reduction is forced off during lossless encoding, for obvious reasons.
What about custom quant matrices and zone options, will these be ignored automatically or too forced off ? (I assume both can mess up a lossless encode)

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 29th December 2008, 13:42   #29  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by Selur View Post
What about custom quant matrices and zone options, will these be ignored automatically or too forced off ? (I assume both can mess up a lossless encode)

Cu Selur
Zone options can be used, I don't see why not (though bitrate weighting won't do anything). CQMs are of course forced off.
Dark Shikari is offline   Reply With Quote
Old 29th December 2008, 15:03   #30  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,344
Thanks, good to know, just wanted to make sure since I previously believed that b-frame could also be used with lossless and or would be automatically disabled.
(Thinks like "No, because x264 isn't designed to protect you from your own stupidity." really can cause some scare about assumptions one has about x264. )

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 29th December 2008, 15:09   #31  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by Selur View Post
Thanks, good to know, just wanted to make sure since I previously believed that b-frame could also be used with lossless and or would be automatically disabled.
(Thinks like "No, because x264 isn't designed to protect you from your own stupidity." really can cause some scare about assumptions one has about x264. )

Cu Selur
Though it doesn't protect you from your own stupidity, x264 doesn't lie to you either (allow the use of options that would make lossless not lossless).
Dark Shikari is offline   Reply With Quote
Old 29th December 2008, 15:19   #32  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,344
Quote:
... x264 doesn't lie to you either (allow the use of options that would make lossless not lossless).
okay, reread the statements form above, so enabling b-frames would only hurt compression but not break losslessness.

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 29th December 2008, 19:05   #33  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,249
Quote:
Originally Posted by Daiz View Post
Yeah, I made the test over 7 months ago. I doubt the situation has changed so that some other lossless format would beat lossless CAVLC H.264 though, which is the reason why I haven't bothered to redo the test yet.
The situation has changed in a way that x264 now uses the "predictive lossless" profile, which significantly improves the compression in lossless mode.

I got no idea how that effects decoding speed though...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 29th December 2008, 19:20   #34  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by LoRd_MuldeR View Post
The situation has changed in a way that x264 now uses the "predictive lossless" profile, which significantly improves the compression in lossless mode.

I got no idea how that effects decoding speed though...
Better compression == faster decoding speed, at least with CABAC.
Dark Shikari is offline   Reply With Quote
Old 29th December 2008, 19:22   #35  |  Link
Sagekilla
x264aholic
 
Join Date: Jul 2007
Location: New York
Posts: 1,752
using prediction -may- be faster than not at all. To look at it one way, you'll end up with a smaller bitstream --> less to decode is always faster. Not sure if it'll offset the speed lost from doing MC etc.
__________________
You can't call your encoding speed slow until you start measuring in seconds per frame.
Sagekilla is offline   Reply With Quote
Old 29th December 2008, 23:54   #36  |  Link
Daiz
Registered User
 
Join Date: Jan 2008
Location: Finland
Posts: 68
Quote:
Originally Posted by LoRd_MuldeR View Post
The situation has changed in a way that x264 now uses the "predictive lossless" profile, which significantly improves the compression in lossless mode.

I got no idea how that effects decoding speed though...
I did say that the situation haven't changed in the sense that Lossless H.264 is still the fastest choice for lossless out there, which is why I haven't bothered to redo the test (as I doubt other lossless formats would have suddenly become a lot faster than lossless H.264, especially since lossless H.264 encoded with x264 is even faster than before).
__________________
Where did neuron1 go? | Doom10
Daiz is offline   Reply With Quote
Old 29th December 2008, 23:59   #37  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,249
Quote:
Originally Posted by Daiz View Post
I did say that the situation haven't changed in the sense that Lossless H.264 is still the fastest choice for lossless out there, which is why I haven't bothered to redo the test (as I doubt other lossless formats would have suddenly become a lot faster than lossless H.264, especially since lossless H.264 encoded with x264 is even faster than before).
I understood that part. However x264 lossless should compress even better and decode even faster now

So you may consider updating your numbers...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 30th December 2008 at 00:01.
LoRd_MuldeR is offline   Reply With Quote
Old 6th January 2009, 19:08   #38  |  Link
Aktan
Registered User
 
Join Date: Feb 2002
Posts: 303
B-Frames aren't lossless?

I did some lossless encodes with B-Frames for the heck of it and I've noticed that seemly the B-Frames aren't lossless. Maybe I'm doing something wrong.

Here is my source avs:

Code:
# Set DAR in encoder to 9113 : 5000. The following line is for automatic signalling
global MeGUI_darx = 9113
global MeGUI_dary = 5000
DGDecode_mpeg2source("C:\Temp DVD\VTS_01_PGC_01_1.d2v",info=3)
ColorMatrix(hints=true)
#deinterlace
#crop
#resize
#denoise
Here are my x264 settings according to MeGUI:

Code:
program --qp 0 --keyint 999999 --min-keyint 0 --ref 16 --mixed-refs --no-fast-pskip --bframes 16 --b-adapt 2 --b-pyramid --weightb --direct auto --nf --subme 9 --trellis 2 --partitions all  --8x8dct --me tesa --threads 2 --thread-input --aud --progress --no-psnr --no-ssim --output "output" "input"
here is my Compare script avs:

Code:
loadplugin("avss.dll")
Compare(DGDecode_mpeg2source("C:\Temp DVD\VTS_01_PGC_01_1.d2v",info=3).ColorMatrix(hints=true),dss2("VTS_01_3.mp4"))
The version of x264 I'm using according to MeGUI is: 1069 - Skystrife's patched build

I don't think it is my Compare script because if I turn off B-Frames, the compare script says it's lossless. With B-Frames on, seemly, though I have not confirmed, that the frames from the B-Frames are the lossy one.

Any ideas?
Aktan is offline   Reply With Quote
Old 6th January 2009, 19:14   #39  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Are we sure that this isn't a bug in the decoder?

Use --dump-yuv to dump x264's internal representation of the video and compare that with the decoded video. Also, try using CoreAVC instead of FFDshow (or vice versa).

Also, try one by one removing B-frame options (weightb, pyramid, direct auto, etc).
Dark Shikari is offline   Reply With Quote
Old 6th January 2009, 19:49   #40  |  Link
Aktan
Registered User
 
Join Date: Feb 2002
Posts: 303
I was using ffdshow tryouts revision 2583 built on Jan 4th 2009.

I'll try your suggesions Dark, thanks.
Aktan is offline   Reply With Quote
Reply

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 17:55.


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