Log in

View Full Version : Help x264 development: x264 assembly test part 2


Dark Shikari
7th June 2008, 21:35
We're done here; the patch is committed and everything is complete. No more tests needed!

We're done with the analysis of the results and a patch is ready and finalized. All we need to check is that it detects certain CPUs correctly.

Download link: includes an old build and a patched build (http://www.mediafire.com/?1m8kwao5eih). Note the patched build has no threading support.

If you have one of the following CPUs, run with the patched build. You should get the following results in the "CPU capabilities" line:

Athlon 64: SSE2Slow should appear.
Pentium-M: SSE2 should not appear at all.
Core 1: SSE2 should not appear at all.
Phenom: SSE2Fast should appear.

(We don't need results from other CPUs)

For Pentium-M, we need to make sure this works with both versions of the P-M, the Dothan and Banias, so post your CPU-Z info or similar so we know which architecture you have. Also, post the "family/model/stepping" info printed on by the patched build; this will help us figure out what's wrong if you don't get expected results.

J_Darnley
7th June 2008, 22:31
For Athlon 64 X2 Manchester
x264 [info]: using cpu capabilities: MMX MMX2 SSE SSE2 SSE3 3DNow
into
x264 [info]: using cpu capabilities: MMX MMX2 SSE SSE2Slow SSE3

The patched build provided prints family, model and stepping to stdout when run.
[EDIT] I need to read the whole post.
Family 15, model 43, stepping 1

Processors Information
------------------------------------------------------------------------------------

Processor 1 (ID = 0)
Number of cores 2 (max 2)
Number of threads 2 (max 2)
Name AMD Athlon 64 X2 3800+
Codename Manchester
Specification AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
Package Socket 939
CPUID F.B.1
Extended CPUID F.2B
Brand ID 5
Core Stepping BH-E4
Technology 90 nm
Core Speed 2500.7 MHz (10.0 x 250.1 MHz)
HT Link speed 1000.3 MHz
Stock frequency 2000 MHz
Instructions sets MMX (+), 3DNow! (+), SSE, SSE2, SSE3, x86-64
L1 Data cache 2 x 64 KBytes, 2-way set associative, 64-byte line size
L1 Instruction cache 2 x 64 KBytes, 2-way set associative, 64-byte line size
L2 cache 2 x 512 KBytes, 16-way set associative, 64-byte line size
FID/VID Control yes
max FID 10.0x
VID range 1.100 V - 1.350 V
Features XD
K8 Thermal sensor yes
K8 Revision ID 4.1

I am full of mistakes tonight.

ajp_anton
7th June 2008, 22:53
Athlon 64 X2 Toledo (4400+, s949):
x264_old.exe - MMX MMX2 SSE SSE2 SSE3 3DNow
x264_improved_asm.exe - MMX MMX2 SSE SSE2Slow SSE3

What happened to 3DNow?

Dark Shikari
7th June 2008, 23:06
What happened to 3DNow?3DNow was never actually used for anything, since its floating-point only and flops are useless for video encoding. Rather, it was used as a way of detecting whether or not to use certain SSE2 functions which were slow on AMD chips.

But now that the Phenom is out, we can't use such a blanket method, and so we switched to the "SSE2Slow/SSE2/SSE2Fast" method.

lexor
8th June 2008, 00:51
Athlon64 (S754)
old:
x264 [info]: using cpu capabilities: MMX MMX2 SSE SSE2 3DNow
new:
x264 [info]: using cpu capabilities: MMX MMX2 SSE SSE2Slow

techouse
8th June 2008, 01:25
Intel Core Duo T2300 using Windows Vista Ultimate SP-1 32-bit

Processors Information
------------------------------------------------------------------------------------

Processor 1 (ID = 0)
Number of cores 2 (max 2)
Number of threads 2 (max 2)
Name Intel Core Duo T2300
Codename Yonah
Specification Genuine Intel(R) CPU T2300 @ 1.66GHz
Package Socket 479 mPGA (platform ID = 5h)
CPUID 6.E.8
Extended CPUID 6.E
Core Stepping C0
Technology 65 nm
Core Speed 997.5 MHz (6.0 x 166.3 MHz)
Rated Bus speed 665.0 MHz
Stock frequency 1666 MHz
Instructions sets MMX, SSE, SSE2, SSE3
L1 Data cache 2 x 32 KBytes, 8-way set associative, 64-byte line size
L1 Instruction cache 2 x 32 KBytes, 8-way set associative, 64-byte line size
L2 cache 2048 KBytes, 8-way set associative, 64-byte line size
FID/VID Control yes
FID range 6.0x - 10.0x
max VID 1.263 V
Features , VT

OLD:
x264 [info]: using cpu capabilities: MMX MMX2 SSE SSE2 SSE3 Cache64

IMPROVED_ASM:
x264 [info]: using cpu capabilities: MMX MMX2 SSE Cache64

MatMaul
8th June 2008, 02:58
intel pentium M Dothan :
x264_old.exe - MMX MMX2 SSE SSE2 Cache64
x264_improved_asm.exe - MMX MMX2 SSE Cache64

small question :
why do you remove SSE2 for pentium M ? MMX or SSE versions are faster on this arch ?

Dark Shikari
8th June 2008, 03:04
intel pentium M Dothan :
x264_old.exe - MMX MMX2 SSE SSE2 Cache64
x264_improved_asm.exe - MMX MMX2 SSE Cache64

small question :
why do you remove SSE2 for pentium M ? MMX or SSE versions are faster on this arch ?We don't actually have any SSE assembly (only SSE2+), since SSE is floating-point only, so we're actually going to remove the display of "SSE" too since its misleading.

The reason SSE2 was disabled on Core 1 and Pentium-M CPUs is because their SSE2 unit is so slow that in almost all cases, MMX functions are faster. There's like one very minor case out of dozens and dozens of functions where SSE2 is slightly faster, but we didn't feel like special-casing it, given that its slower for everything else.

Overall, you'll get a small speed boost (probably 2-5%) from the removal of SSE2 on those chips.

tre31
8th June 2008, 04:16
Opteron 165
x264 [info]: using cpu capabilities: MMX MMX2 SSE SSE2 SSE3 3DNow
x264 [info]: using cpu capabilities: MMX MMX2 SSE SSE2Slow SSE3

Nope the new patch is definately slower, but quite alot on this cpu, first pass is like 25fps slower (btw its not running at stock anymore).

And here's the test which kinda of throws your SSE2 theories for AMD Athlon's out the window.

SDTV source, Interlaced DXVA SD HQ MeGui profile.
Job commandline: "F:\Program Files\megui\tools\x264\x264.exe" --pass 1 --bitrate 1700 --stats "K:\test\Doctor.s01e01-Who-Rose-1min-test.stats" --level 3.1 --bframes 3 --b-pyramid --direct auto --filter -2,-1 --subme 1 --partitions none --me dia --threads auto --thread-input --sar 1:1 --progress --no-psnr --no-ssim --interlaced --output NUL "K:\test\Doctor.s01e01-Who-Rose-1min-test.avs"

1st pass new asm:
encoded 1501 frames, 26.33 fps, 1631.40 kb/s
2ns pass (didn't let finish - cos it was too sloooow):
settled down too 1.31fps

1st pass old:
encoded 1501 frames, 51.29 fps, 1635.24 kb/s
2nd pass old:
encoded 1501 frames, 3.32 fps, 1706.30 kb/s

I'll let you draw your own conclusions, but I think SSE2 definately helps ;)

Dark Shikari
8th June 2008, 04:22
Opteron 165
x264 [info]: using cpu capabilities: MMX MMX2 SSE SSE2 SSE3 3DNow
x264 [info]: using cpu capabilities: MMX MMX2 SSE SSE2Slow SSE3

Nope the new patch is definately slower, but quite alot on this cpu, first pass is like 25fps slower (btw its not running at stock anymore).Did you read where I said the patched build has no threading support?
I'll let you draw your own conclusions, but I think SSE2 definately helps ;)SSE2 does help on Athlons; in fact, more SSE2 functions are enabled in the patched build than in the non-patched build on Athlon 64s.

This is why I didn't tell people to run speed tests. :rolleyes:

tre31
8th June 2008, 04:43
Did you read where I said the patched build has no threading support?
SSE2 does help on Athlons; in fact, more SSE2 functions are enabled in the patched build than in the non-patched build on Athlon 64s.

This is why I didn't tell people to run speed tests. :rolleyes:

I did now (sorry), and yea if you double the results (in a perfect world), its a little bit faster.

Dark Shikari
8th June 2008, 04:47
I did now (sorry), and yea if you double the results (in a perfect world), its a little bit faster.It is; our tests showed that the boost was around 1.5%. Not much, but every bit helps.

Anyways, we've got all the information we need except one thing: we need results from a Pentium-M Banias. If anyone has one of these, check out the patched executable, and if it works as it should, this patch will be going in official git soon :p

Dark Shikari
8th June 2008, 06:13
We got the info we needed, the patch is valid, and official x264 git has been updated! :cool:

Great work everyone, and thanks for all the assistance; now reap the benefits of increased speed on Athlon 64, Pentium-M, Core 1, and Phenom! :)

cyberbeing
8th June 2008, 08:14
On my AMD X2 4800+ machine the new build was ~3% slower then the old build using 1 thread.

The source was a very high motion scene on a 720x480 Lagarith YV12 encode using the following x264 settings:

--crf 10.0 --keyint 240 --min-keyint 12 --deadzone-inter 6 --deadzone-intra 6 --ref 16 --mixed-refs --no-fast-pskip --bframes 3 --b-pyramid --b-rdo --bime --weightb --direct auto --filter -3,-3 --subme 6 --partitions all --8x8dct --qpmin 5 --me umh --merange 24 --threads 1 --thread-input --sar 32:27 --progress --no-dct-decimate --no-psnr --no-ssim

New Build
MMX MMX2 SSE SSE2Slow SSE3
family:15 model:35 stepping:2
Time: 7:28 (avg of 2 runs)
871 frames , 1.945fps (avg of 2 runs)

Old Build
MMX MMX2 SSE SSE2 SSE3 3DNow
Time: 7:15 (avg of 2 runs)
871 frames , 2.00fps (avg of 2 runs)


Processors Information
------------------------------------------------------------------------------------

Processor 1 (ID = 0)
Number of cores 2 (max 2)
Number of threads 2 (max 2)
Name AMD Athlon 64 X2 4800+
Codename Toledo
Specification AMD Athlon(tm) 64 X2 Dual Core Processor 4800+
Package Socket 939
CPUID F.3.2
Extended CPUID F.23
Brand ID 5
Core Stepping JH-E6
Technology 90 nm
Core Speed 2640.3 MHz (12.0 x 220.0 MHz)
HT Link speed 1100.1 MHz
Stock frequency 2400 MHz
Instructions sets MMX (+), 3DNow! (+), SSE, SSE2, SSE3, x86-64
L1 Data cache 2 x 64 KBytes, 2-way set associative, 64-byte line size
L1 Instruction cache 2 x 64 KBytes, 2-way set associative, 64-byte line size
L2 cache 2 x 1024 KBytes, 16-way set associative, 64-byte line size
FID/VID Control yes
max FID 12.0x
VID range 1.100 V - 1.400 V
Features XD
K8 Thermal sensor yes
K8 Revision ID 4.2

Edit: The new asm was faster. See Below.

Dark Shikari
8th June 2008, 08:17
On my AMD X2 4800+ machine the new build was ~3% slower then the old build using 1 thread.


New Build
MMX MMX2 SSE SSE2Slow SSE3
family:15 model:35 stepping:2
7:28 (avg of 2 runs)
871 frames , 1.945fps (avg of 2 runs)

Old Build
MMX MMX2 SSE SSE2 SSE3 3DNow
7:14
871 frames , 2.00fpsThe builds are with two different compilers with different compiler options and so forth, so they're not comparable speed-wise; we already did fair comparisons to judge speed before this :p

hklck516
8th June 2008, 08:31
I want to ask ....

When of the SSE4.1 or CUDA available on x264 ?

especially CUDA ......

cyberbeing
8th June 2008, 08:34
OK, I guess that would make sense.

I modified Tech ARP's x264 HD Benchmark Ver 2.0 to compare wizboy11's 877 and 871 build and the build with the new asm was about 0.33% faster which isn't much but at least it wasn't 3% slower like my first test.

Dark Shikari
8th June 2008, 08:35
I want to ask ....

When of the SSE4.1 or CUDA available on x264 ?

especially CUDA ......SSE4.1 isn't particularly useful; the only thing we've come up with is a possible slight improvement to the speed of --me esa. CUDA? That's a hell of a lot of work, and Avail has switched their focus to FPGAs... so probably not any time soon.

audyovydeo
8th June 2008, 09:36
Phenomenal : r877 yeilds a 1.90% speed improvement over r859 on my C2D (and 14.8% improvement since r745, when I started tracking formally).

A huge thanks, guys !

cheers
audyovydeo

techouse
8th June 2008, 10:32
Make speed tests if you want:

x264_x86_r871_techouse (http://techouse.project357.com/builds/x264_x86_r871_techouse.7z) vs. x264_x86_r877_techouse (http://techouse.project357.com/builds/x264_x86_r877_techouse.7z)

INFOS:
x264_x86_r871_techouse (http://techouse.project357.com/nfo/x264_x86_r871_techouse.txt)
x264_x86_r877_techouse (http://techouse.project357.com/nfo/x264_x86_r877_techouse.txt)

Inventive Software
9th June 2008, 01:26
Nice! Good going, will see if it improves over previous builds. :)

wiak
9th June 2008, 01:53
Phenomenal : r877 yeilds a 1.90% speed improvement over r859 on my C2D (and 14.8% improvement since r745, when I started tracking formally).

A huge thanks, guys !

cheers
audyovydeo
:stupid:
Its phenomenal on a AMD Phenom, heck i get 20% improvment on new vs old build, finaly some optimize for phenom :thanks:

g_aleph_r
13th June 2008, 15:58
That's a hell of a lot of work, and Avail has switched their focus to FPGAs... so probably not any time soon.
:angry::angry: too cheap? or too powerful? They don't know about Fastra?

Dark Shikari
13th June 2008, 16:03
:angry::angry: too cheap? or too powerful? They don't know about Fastra?Going by what we've done so far FPGAs may actually be cheaper and easier than CUDA.

Adub
13th June 2008, 18:34
NOOOOOO!!! I want my graphics card encoding!!

g_aleph_r
15th June 2008, 13:35
Going by what we've done so far FPGAs may actually be cheaper and easier than CUDA.
Sorry, maybe I'm a little ignorant on FPGAs pricing but CUDA is free for a gamer :) :cool: