You are not logged in.

#1 2009-01-12 00:41:02

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

x264 package speed boost

x264 allows you to slightly improve (couple percent) its speed by dynamically optimizing at compile-time. Build using "make fprofiled VIDS="../foo/bar.yuv" to make use of this. Only a few hundred frames are necessary, but the source needs to be raw video or piped out as raw video from mplayer or ffmpeg. In the former case it might be wise to use "normal (gzip, etc.)" compression on the source, since raw video gets very big very fast.

I don't know how this might make its way into Arch packages, but it would definitely be nice smile A few percent is major when you consider multi-day encodes.

A good source for short, uncompressed videos is http://media.xiph.org/

Offline

#2 2009-01-12 01:11:26

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: x264 package speed boost

Is this going to work as a generic package? I know that profiling for something like a web browser can work somewhat in packages, but x264 has so many runtime, processor family specif optimizations.

--EDIT--

Although, x264 is going to be upgraded soon in the main Arch repos. Maybe you (we, us?) should ask Dark Shikari if this sort of thing is useful.

Offline

#3 2009-01-14 00:32:06

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: x264 package speed boost

Doom9, home of x264 devs, is where I get info from smile I was just building x264 with patches as I usually do, checked out the Arch PKGBUILD, and was surprised to see that the profiling was not enabled. x264 does indeed have a ridiculous amount of handwritten asm, but fprofiling can help - I'd say about 2% for a fairly recent CPU.

Considering a 2 hour video, at 23.976fps (film), if the encoding goes at 30fps (ballpark for a decent CPU with fairly high settings), the 2% boost nets us ~2 minutes faster of an encode.

So, yeah, not too much. I personally say why not, since it only needs to be done during the compile, which is short smile

Implementations could be:
1.) Add a YUV video to the sources for the PKGBUILD (I like Foreman: http://media.xiph.org/video/derf/y4m/foreman_cif.y4m). Probably mirroring it would be a good idea.
2.) First compress the YUV with bzip2, gzip, or LZMA, and first unzip it in the PKGBUILD. This is probably a better idea, as YUV uncompressed video gets real ridiculous, real fast.
3.) Use a lossless (or lossy) compressor, and add mplayer or ffmpeg to pipe the raw video in to x264 via a named pipe. Probably not nice.

Offline

Board footer

Powered by FluxBB