You are not logged in.

#1 2011-03-24 10:03:11

mariusmeyer
Member
From: Norway
Registered: 2009-04-25
Posts: 244

[SOLVED] Recompiling HandBrake for better performance...?

Hey all!

I recently tried to recompile HandBrake from /community to optimize encoding performance. I have an AMD Phenom II X4 965, and using -march=native should give me (among a bunch of other things) -march=amdfam10 and -mtune=amdfam10. I was hoping that this would improve the time it takes to encode something. So first I timed how long it took to encode a particular clip with the HandBrake from the repos, and got 3m4s. Then I replaced -march=x86_64 and -mtune=generic in makepkg.conf with -march=native (keeping -O2 -pipe), got the PKGBUILD from abs, compiled and installed. Then I went on to encode the same clip under the same system conditions. Time: 2m57s.

My question is: should the difference be this small? I read most places that things like encoding are what benefits most from CPU optimizations. Do I need to rebuild the libraries that HandBrake uses as well?

Cheers ^^

Last edited by mariusmeyer (2011-03-24 10:28:34)

Offline

#2 2011-03-24 10:19:08

Wintershade
Member
From: Croatia
Registered: 2008-02-18
Posts: 175
Website

Re: [SOLVED] Recompiling HandBrake for better performance...?

mariusmeyer wrote:

My question is: should the difference be this small?

In short, yes.
Handbrake is just a frontend, not an encoder itself. It uses x264 for encoding, of which a large part is written in Assembler, so there are no further optimisations for your architecture (or any other specific architecture). If it was written in C or C++ it would have been even slower, and you would get some performance gain - and that would still be far slower than what it currently is.

There are other video/audio encoders which benefit from architecture optimisations, although most of this benefit will be seen when comparing 32-bit to 64-bit architecture, nothing more specific (again, there might be a little more performance gain). Such encoders would - IIRC - be LAME and Ogg Vorbis for audio, Theora for video, et al.

edit: also, without any offence to anyone, AMD is really bad at mincing lots of data, compared to Intel. Seriously, if you want better encoding time, the first thing you need is a better CPU, preferrably Intel since they specialise in such stuff. Server-type processors, such as the Xeon family, excel in this particular field.

HTH smile

Last edited by Wintershade (2011-03-24 10:25:07)


Only the best is good enough.

Offline

#3 2011-03-24 10:28:00

mariusmeyer
Member
From: Norway
Registered: 2009-04-25
Posts: 244

Re: [SOLVED] Recompiling HandBrake for better performance...?

Thanks for the explanation big_smile Didn't know that about x264.

Solved ^^

Offline

#4 2011-03-24 10:30:38

Wintershade
Member
From: Croatia
Registered: 2008-02-18
Posts: 175
Website

Re: [SOLVED] Recompiling HandBrake for better performance...?

You're welcome. smile


Only the best is good enough.

Offline

Board footer

Powered by FluxBB