Log in

View Full Version : CUDA H.264 vs x264 Speed and Image Quality Benchmarks, discussion


Pages : 1 [2] 3 4 5

Selur
11th July 2009, 07:28
@St Devious: your x264 and your CUDA Screenshot link to the same picture,... (CUDA should be: http://www.picturepush.com/public/1958118)

RunningSkittle
11th July 2009, 08:17
Levels are different in the x264 image as well.

St Devious
11th July 2009, 14:04
@St Devious: your x264 and your CUDA Screenshot link to the same picture,... (CUDA should be: http://www.picturepush.com/public/1958118)


thanks, corrected it now.

Levels are different in the x264 image as well.

what do you mean ?

LoRd_MuldeR
11th July 2009, 14:20
what do you mean ?

He talks about luminance levels, I think!

http://forum.doom9.org/showthread.php?t=143689

But I'm not so sure whether this is a level problem, because the "black" intensity looks identical in both screenshots.
Typically you would get "black" vs. "dark gray" when comparing pictures of different luminance levels, but that's not the case here.
Looks more like something is wrong with the color intensities. Look at the red shirt and the cyan bag!

buba king
11th July 2009, 14:21
what do you mean ?

The colors are different in the x264 screen shot... probably a bad color conversion somewhere.

St Devious
11th July 2009, 14:26
MeGUI had me add ConvertToYV12() at the end of script, is that a problem ?

LoRd_MuldeR
11th July 2009, 14:54
MeGUI had me add ConvertToYV12() at the end of script, is that a problem ?

Nope. That's because x264 doesn't accept anything but YV12() data. But you should use the very same source script for both encoders ;)

St Devious
11th July 2009, 15:12
Nope. That's because x264 doesn't accept anything but YV12() data. But you should use the very same source script for both encoders ;)

hmm.. didn't think that way. Guess that may have invalidated the above images.

Will encode with an avisynth script when i get home tomm.

btw what about Stan's suggestion of using Mediacoder to encode with both CUDA and x264 ? that wa decoders should be the same.

LoRd_MuldeR
11th July 2009, 15:23
btw what about Stan's suggestion of using Mediacoder to encode with both CUDA and x264 ? that wa decoders should be the same.

Given that MediaCoder really uses the same decoders, processing and colorspace conversion for both encoders ;)

I'd go with Avisynth to be 100% sure that the source data is identical for both encoders!

The less steps there are between your source and the encoder, the less things can corrupt your results.

Directly feeding the source into the encoder from Avisynth (using the identical script) is the most reliable method.

St Devious
11th July 2009, 15:30
Given that MediaCoder really uses the same decoders, processing and colorspace conversion for both encoders ;)

I'd go with Avisynth to be 100% sure that the source data is identical for both encoders!

The less steps are between your source and the encoder, the less things can influence/corrupt your results.

Directly feeding the source into the encoder from Avisynth (using the identical script) is the most reliable method...

thanks.

How does the decoding happen ?

Like what will Mediacoder and MeGUI use to decode the avisynth file ?

And how does the avisynth file decode the .ts source file ?

LoRd_MuldeR
11th July 2009, 15:38
Like what will Mediacoder and MeGUI use to decode the avisynth file ?

If you use Avisynth input, they won't decode anything! They'll receive uncompressed video data from Avisynth ;)

Which doesn't exclude that MediaCoder applies color conversions or other processing on that data...


And how does the avisynth file decode the .ts source file ?

Depends on your Avisynth script. What XYZSource() filter did you use in your script?

St Devious
11th July 2009, 16:08
Depends on your Avisynth script. What XYZSource() filter did you use in your script?

don't remember atm, but whatever MeGUI Avisynth Script creator uses when you feed .d2v to it

LoRd_MuldeR
11th July 2009, 16:15
don't remember atm, but whatever MeGUI Avisynth Script creator uses when you feed .d2v to it

MPEG2Source() respectively DGDecode :D

St Devious
11th July 2009, 16:24
MPEG2Source() respectively DGDecode :D

alright, so avisynth decodes the MPEG2 Source, and then feeds uncompressed data to any encoder and that way it eliminates any change in color or anything.

Learned something new today ! :D

How the resource usage by the decoding ? like some were saying earlier in the thread that decoding might have caused encoding to slow down.

Sharktooth
11th July 2009, 16:30
DGDecode uses a single threaded reference MPEG2 decoder... so, for better results, i'd suggest to use DGNVTools... or at least DGMpegDecNV...

St Devious
11th July 2009, 16:47
DGDecode uses a single threaded reference MPEG2 decoder... so, for better results, i'd suggest to use DGNVTools... or at least DGMpegDecNV...

do you mean instead of using MPEG2Source() in the avisynth script, I use DGMpegDecNV ?

Haven't used it before. Isn't that neuron's software and you have to pay to use it ?

Sharktooth
11th July 2009, 16:48
yep it is. but if you own and nvidia card it is a MUST.

St Devious
11th July 2009, 17:00
yep it is. but if you own and nvidia card it is a MUST.

I could do that, but my worry is that people might not be able to reproduce my results, since everyone wouldn't be able to buy that software.

LoRd_MuldeR
11th July 2009, 17:06
I could do that, but my worry is that people might not be able to reproduce my results, since everyone wouldn't be able to buy that software.

If people can't use DGMpegDecNV, they can't use NVIDIA's CUDA encoder anyway :p

But be aware that DG's NV tools are payware...

St Devious
11th July 2009, 17:25
If people can't use DGMpegDecNV, they can't use NVIDIA's CUDA encoder anyway :p

But be aware that DG's NV tools are payware...

That's what I meant, they can't use it because it's payware.

Sagekilla
11th July 2009, 17:34
@LoRd_MuldeR: Would using the GPU for decoding then using it for encoding create any noticeable impact or is it essentially "free" decoding?

St Devious
11th July 2009, 17:36
@LoRd_MuldeR: Would using the GPU for decoding then using it for encoding create any noticeable impact or is it essentially "free" decoding?

I think it should be free decoding, since the encoding part is not using 100% GPU, at least that's what I have found on ATI Radeons. But I imagine nvidia's CUDA can't be that efficient at this stage to be able to use 100% of GPU.

LoRd_MuldeR
11th July 2009, 17:48
@LoRd_MuldeR: Would using the GPU for decoding then using it for encoding create any noticeable impact or is it essentially "free" decoding?

Isn't the decoding happening on a specialized chip (e.g. VP2) anyway? So the actual GPU shouldn't be involved at all.

But I imagine nvidia's CUDA can't be that efficient at this stage to be able to use 100% of GPU.

It's more a question whether your CUDA application (kernel) is able to keep all the multiprocessors of the GPU busy all the time ;)

Most applications simply don't scale well enough (because the tasks aren't independent/parallelizable) or they suffer from memory bottlenecks (bank conflicts).

CUDA simply isn't the perfect platform for video encoding. Or in other words: Video encoding isn't the perfect application for CUDA.

If CUDA was as good for video encoding as they try to make us believe, we would have seen a competitive CUDA encoder until now. But there is none...

CruNcher
11th July 2009, 17:50
The Decoding doesn't utilize the GPU in anyway VP2 is it's own processor inside the GPU that runs with 400 Mhz and is ARM based (it is it's own logic) same as with UVD (ATI) :)
doing anything on it wont slowdown the GPU part of the encoding as that is done via CUDA

You can watch a Blu-Ray Movie and @ the side of it Play Crysis it wont impact the game alot :P (also energy wise the Playback part would roughly take 3-5 Watts the Game part alot more like 100 watts depends on the GPU and Game Settings)

Think of it like your Standalone Player integrated inside the GPU fully independent of the rest (only the actuall bus transfer could make problems Playing Crysis and a Blu-Ray + AACS Decryption @ the same time ;))

What this makes possible Nvidia showed in a Hard test on the ION platform doing multiple tasks at once without majorly slowing down anything :) (Encoding,Playback,Editing) @ the same time.

Though for this to work properly you need a OS (and driver Model) that is optimized for a GPU that is where Windows XP lacks it was not designed to manage GPU resources (when utilized by multiple tasks) very efficiently and where Vista and Win7 Shines :)

St Devious
11th July 2009, 18:00
Isn't the decoding happening on a specialized chip (e.g. VP2) anyway? So the actual GPU shouldn't be involved at all.


The Decoding doesn't utilize the GPU in anyway VP2 is it's own processor inside the GPU that runs with 400 Mhz and is ARM based (it is it's own logic) same as with UVD (ATI) :)
doing anything on it wont slowdown the GPU part of the encoding as that is done via CUDA

You can watch a Blu-Ray Movie and @ the side of it Play Crysis it wont impact the game alot :P (also energy wise the Playback part would roughly take 5 Watts the Game part alot more like 100 watts depends on the GPU and Game Settings)

Think of it like your Standalone Player integrated inside the GPU fully independent of the rest (only the actuall bus transfer could make problems Playing Crysis and a Blu-Ray + AACS Decryption @ the same time ;))

What this makes possible Nvidia showed in a Hard test on the ION platform doing multiple tasks at once without majorly slowing down anything :) (Encoding,Playback,Editing) @ the same time.

Thanks, got it !

STaRGaZeR
11th July 2009, 20:57
The Decoding doesn't utilize the GPU in anyway VP2 is it's own processor inside the GPU that runs with 400 Mhz and is ARM based (it is it's own logic) same as with UVD (ATI) :)

UVD runs at core frequency in ATI cards.

blubberbirne
11th July 2009, 22:09
MediaCoder Cuda H264 Encoder don't work with H264 TS Source Files for me.
I encodet a 45.2sec TS Stream. The Result is a 1min 40sec clip. Frame Rate is in Source and Encoded File 25fps

stanleyhuang
12th July 2009, 04:09
Our next step is to use hardware for H.264 decoding, possible by using API of VP2.

stanleyhuang
12th July 2009, 04:10
MediaCoder Cuda H264 Encoder don't work with H264 TS Source Files for me.
I encodet a 45.2sec TS Stream. The Result is a 1min 40sec clip. Frame Rate is in Source and Encoded File 25fps

Have you set a deinterlancer?
You can discuss this on mediacoder forum.

blubberbirne
12th July 2009, 08:50
Sorry, no deinterlacer set.

CiNcH
12th July 2009, 09:35
The Decoding doesn't utilize the GPU in anyway VP2 is it's own processor inside the GPU that runs with 400 Mhz and is ARM based (it is it's own logic) same as with UVD (ATI)
H.264 HD should be decodeable in software on a 400 MHz ARM? Is there some special hardware on the ARM?

CruNcher
12th July 2009, 11:29
It seems so look @ Tegra what that little thing is capable off soon first devices will start the era of mobile 1080p it works since the G92 was released soon it's market time (devices where already announced for end of 2008 but seems the crisis killed those plans) :) now most probably Microsoft will be the first to release it to market in form of the Zune HD Mobile Device.


The most interesting Videos about it (though this is compared to the decoder logic only like in the G92 a whole ARM CPU)


http://www.youtube.com/watch?v=AXinHWiat2s
http://www.youtube.com/watch?v=2QJ-ETt3kMk (shows a workaround to in browser Flash Hardware Decoding they don't get it running in the browser yet (see Adobe announcement) ;) )
http://www.youtube.com/watch?v=f5sEIf5-FJs
http://www.youtube.com/watch?v=qWqlKBp9qQ0
http://www.youtube.com/watch?v=lTEaWfTO-zE
http://www.youtube.com/watch?v=RChFjrcBsx4 (Future Roadmap of Tegra)

708145
12th July 2009, 12:57
H.264 HD should be decodeable in software on a 400 MHz ARM? Is there some special hardware on the ARM?

The ARM is just controlling the special purpose hardware blocks used for bitstream processing (BSP), decoding and "image enhancements" (VP2/3).

bis besser,
T0B1A5

stanleyhuang
12th July 2009, 13:03
H.264 HD should be decodeable in software on a 400 MHz ARM? Is there some special hardware on the ARM?

Quite likely with DSP extension.

St Devious
12th July 2009, 16:32
can sombody help me tune the CUDA encoder for best quality

http://i26.tinypic.com/2gv1vsl.jpg

ChronoCross
12th July 2009, 17:35
Doesn't MediaCoder Violate the GPL? While not relevant to the discussion here in this thread I figure I'd mention it as no one should be using software that violates a license, it's much like how we don't discuss pirated material.

http://roundup.ffmpeg.org/roundup/ffmpeg/issue1162

RunningSkittle
12th July 2009, 21:32
Doesn't MediaCoder Violate the GPL? While not relevant to the discussion here in this thread I figure I'd mention it as no one should be using software that violates a license, it's much like how we don't discuss pirated material.

http://roundup.ffmpeg.org/roundup/ffmpeg/issue1162

The encoder is re-added (since 0.7.1.4470) now after we signed a formal license with nvidia. We are currently working on our own cuda-based video filtering features including down-scaling, de-interlacing, 3D-denoising and pull-up.

ChronoCross
13th July 2009, 03:18
Originally Posted by stanleyhuang
The encoder is re-added (since 0.7.1.4470) now after we signed a formal license with nvidia. We are currently working on our own cuda-based video filtering features including down-scaling, de-interlacing, 3D-denoising and pull-up.


yeah they fixed the nvidia issue however they still violate the GPL and LGPL. Not to mention the donation button and the ads on the site which is quite shameful.....

St Devious
13th July 2009, 04:13
Here's another comparison. This time both x264 and CUDA were encoded from the same avisynth script.

Avisynth Script as made by MeGUI AVISynth Script Creator
DGDecode_mpeg2source("D:\Videos\1080p25.d2v", info=3)
ColorMatrix(hints=true, threads=0)
#deinterlace
#crop
#resize
#denoise


Tried to use best quality settings for x264. Used the Unrestricted 2 pass Extra Quality profile in MeGUI. Changed keyframe interval size to 50 to match the CUDA encoder.

Click on Images for 1920x1080 size image

x264 6Mbps - 1007s
http://www1.picturepush.com/photo/a/1968734/1024/Picture-Box/x264-6Mbps.png (http://www.picturepush.com/public/1968734)

CUDA 6 Mbps - 93s
http://www4.picturepush.com/photo/a/1968732/1024/Picture-Box/CUDA-6Mbps.png (http://www.picturepush.com/public/1968732)

Source
http://www5.picturepush.com/photo/a/1968733/1024/Picture-Box/Source.png (http://www.picturepush.com/public/1968733)

x264 Mediainfo
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L5.0
Format settings, CABAC : Yes
Format settings, ReFrames : 8 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 2mn 7s
Bit rate mode : Variable
Bit rate : 6 000 Kbps
Maximum bit rate : 16.4 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16/9
Frame rate mode : Constant
Frame rate : 25.000 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.116
Stream size : 91.0 MiB (100%)
Writing library : x264 core 68 r1181M 49bf767
Encoding settings : cabac=1 / ref=8 / deblock=1:-1:-1 / analyse=0x3:0x133 / me=umh / subme=8 /
psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 /
trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 /
chroma_qp_offset=-2 / threads=6 / nr=0 / decimate=1 / mbaff=0
/ bframes=3 / b_pyramid=1 / b_adapt=2 / b_bias=0 / direct=3 /
wpredb=1 / keyint=50 / keyint_min=25 / scenecut=40 /
rc=2pass / bitrate=6000 / ratetol=1.0 / qcomp=0.60 / qpmin=10
/ qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 /
ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00

Mediainfo on CUDA file
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L5.1
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 2mn 7s
Bit rate mode : Variable
Bit rate : 6 043 Kbps
Maximum bit rate : 44.3 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 4/3
Frame rate mode : Constant
Frame rate : 25.000 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.117
Stream size : 91.6 MiB (100%)

CUDA Settings
http://i25.tinypic.com/2vubtpi.jpg

Here's more from above files

x264 6Mbps
http://www1.picturepush.com/photo/a/1968739/220/1968739.png (http://www.picturepush.com/public/1968739)

CUDA 6Mbps
http://www4.picturepush.com/photo/a/1968737/220/1968737.png (http://www.picturepush.com/public/1968737)

Source
http://www5.picturepush.com/photo/a/1968738/220/1968738.png (http://www.picturepush.com/public/1968738)

roozhou
13th July 2009, 04:22
Tried to use best quality settings for x264. Used the Unrestricted 2 pass Extra Quality profile in MeGUI. Changed keyframe interval size to 50 to match the CUDA encoder.


Your comparison is meaningless because x264 w/ best quality settings will beat CUDA encoder undoubtfully. Everyone here knows that.

St Devious
13th July 2009, 04:26
Your comparison is meaningless because x264 w/ best quality settings will beat CUDA encoder undoubtfully. Everyone here knows that.

By how much ?

Take a look at the second set of pics. I'm a little surprised that there is not much difference. The difference that there is, might not be noticeable when the video is in motion.

6Mbps might have made a difference here, will do a 4Mbps encode now.

Anther round of images. CUDA loses badly here, look at the far trees

CUDA 6Mbps
http://www5.picturepush.com/photo/a/1968743/220/1968743.png (http://www.picturepush.com/public/1968743)

x264 6Mbps
http://www1.picturepush.com/photo/a/1968744/220/1968744.png (http://www.picturepush.com/public/1968744)

Source
http://www2.picturepush.com/photo/a/1968745/220/1968745.png (http://www.picturepush.com/public/1968745)

roozhou
13th July 2009, 04:42
By how much ?
Take a look at the second set of pics. I'm a little surprised that there is not much difference. The difference that there is, might not be noticeable when the video is in motion.
[/IMG][/URL]

Why not upload your encoded clip? A video is more convincing than a single screenshot.

St Devious
13th July 2009, 04:48
Why not upload your encoded clip? A video is more convincing than a single screenshot.

ok, doing that.

In the meantime here's some more images

CUDA 6 Mbps
http://www1.picturepush.com/photo/a/1968749/220/1968749.png (http://www.picturepush.com/public/1968749)

x264 6Mbps
http://www2.picturepush.com/photo/a/1968750/220/1968750.png (http://www.picturepush.com/public/1968750)

Source
http://www3.picturepush.com/photo/a/1968751/220/1968751.png (http://www.picturepush.com/public/1968751)

stanleyhuang
13th July 2009, 04:56
Doesn't MediaCoder Violate the GPL? While not relevant to the discussion here in this thread I figure I'd mention it as no one should be using software that violates a license, it's much like how we don't discuss pirated material.

http://roundup.ffmpeg.org/roundup/ffmpeg/issue1162

Dude, please DO NOT mess this any longer. MediaCoder is not GPLed and it does not contain any GPL code and don't wag your tongue too freely.

stanleyhuang
13th July 2009, 05:02
Your comparison is meaningless because x264 w/ best quality settings will beat CUDA encoder undoubtfully. Everyone here knows that.

But some people still care about the balance between speed and quality in some cases. I think these comparison is a good work from some aspect.

stanleyhuang
13th July 2009, 05:09
can sombody help me tune the CUDA encoder for best quality

http://i26.tinypic.com/2gv1vsl.jpg

The defaults are almost the settings with the best quality. You can still tune-up number of b-frames and peak bitrate options.

stanleyhuang
13th July 2009, 05:13
yeah they fixed the nvidia issue however they still violate the GPL and LGPL. Not to mention the donation button and the ads on the site which is quite shameful.....

So you think only GPLed software can have a donation button and have ads on the software's website right? Lots and lots of freewares as well as free softwares in this world are supported by Google Adsense now.

St Devious
13th July 2009, 05:20
Anybod who wants to download the latest files from the encode mentioned in post #89 http://forum.doom9.org/showpost.php?p=1304901&postcount=89

CUDA 6Mbps
http://www.mediafire.com/file/vxjhznimklz/1080p25 CUDA 6Mbps.mp4

x264 6Mbps
http://www.mediafire.com/file/dzmmzynz2lz/1080p25 x264 6 Mbps.mp4

Word to the wise: You might have to mess around with frame numbers in AvsP in order to get same frame on both the files. Don't know why that is happening.

stanleyhuang
13th July 2009, 05:22
Word to the wise: Mediacoder messes up on the AR. Don't know if its a problem with the CUDA encoder or mediacoder in general.

Have you tried manually setting an aspect ratio for output?

roozhou
13th July 2009, 05:24
Dude, please DO NOT mess this any longer. MediaCoder is not GPLed and it does not contain any GPL code and don't wag your tongue too freely.

MC bundles MODIFIED version of GPLed software, e.g. mplayer/mencoder and x264. But we cannot find the source codes or related patches anywhere. This is a violation of GPL.