[x265] Compiling x265 and its Altivec code branch on Big Endian ppc64

Michael Lackner michael.lackner at unileoben.ac.at
Wed Jun 18 07:00:12 UTC 2025


Dear x265 developers and users,

I've been using x265 for cross-platform benchmarking purposes for a while now, and quite 
recently an acquaintance of mine gave me SSH access to quite an interesting box: A 
watercooled Apple PowerMac G5 Quad 2,5 GHz, running Debian 13 Linux with GCC 14.2.0 using 
PowerPC CPUs. Both the kernel and the userland are ppc64, so 64-bit Big Endian.

I am aware that x265 does feature some highly optimized code for the PowerPC "Altivec" 
instruction set extension, seemingly targeting the POWER8 architecture. Now here I am, 
trying to compile x265 on what essentially is a POWER4 architecture, and a Big Endian one 
no less (which I guess means lots of trouble).

I found that the Altivec codepath is several tens of thousands of lines long...

When building, the compiler throws tons of errors, here are some random examples:

"
src/build/x265/source/common/ppc/pixel_altivec.cpp:3577:33: error: 
‘__builtin_vsx_lxvw4x_v16qi’ requires the ‘-mvsx’ option
  3577 |     pix1v = vec_u8_to_s16(vec_xl(0, pix1));

src/build/x265/source/common/ppc/pixel_altivec.cpp:4307:30: error: no matches converting 
function ‘sa8d_8x8_altivec’ to type ‘x265::pixelcmp_t’ {aka ‘int (*)(const short unsigned 
int*, long int, const short unsigned int*, long int)’}
  4307 |     p.cu[BLOCK_8x8].sa8d   = sa8d_8x8_altivec;//sa8d_8x8;

src/build/x265/source/common/ppc/pixel_altivec.cpp:4312:52: error: no matches converting 
function ‘sa8d_8x8_altivec’ to type ‘x265::pixelcmp_t’ {aka ‘int (*)(const short unsigned 
int*, long int, const short unsigned int*, long int)’}
  4312 |     p.chroma[X265_CSP_I420].cu[BLOCK_16x16].sa8d = sa8d_8x8_altivec;//sa8d8<8, 8>;
       |                                                    ^~~~~~~~~~~~~~~~
"

I attempted to switch Altivec support off in CMakeLists.txt, and indeed, after doing so 
x265 compiled and ran just fine, when built purely from C/C++ code with no Altivec 
optimizations enabled.


So here comes my question: Is there a reasonably easy way to make that optimized Altivec 
codepath compile and work on a set of old Big Endian POWER4 chips like these? 
Additionally, it has to be 64-bit, because my benchmark has x265 configured in such a way 
that it requires almost 16 GiB of RAM when run (encoding 8K content, parameterised with a 
focus on parallelisation).

I guess I shouldn't get my hopes up here, because this is a niche of niches, but if 
possible, I'd love to include yet another microarchitecture into the list of systems that 
my x265-based benchmark supports out-of-the-box. :)

It appears that the development of that codebranch started by adapting source code from 
x264. x264 does actually compile and run with Altivec support on that machine, so that's 
my silver lining on the horizon here.

If it's too hard (and/or too expensive), I guess I'll still support the platform, but 
sadly with Altivec support disabled.

Thank you all!

Best regards,
Michael

--
____________________________________________________________________________________

Michael Lackner
Lehrstuhl für Informationstechnologie     | Chair of Information Technology
Montanuniversität Leoben                  | Technical University of Leoben

Roseggerstraße 11, A-8700 Leoben          | Roseggerstraße 11, A-8700 Leoben
Telefon: +43 3842 402 1505                | Phone : +43 3842 402 1505
E-Mail : michael.lackner at unileoben.ac.at  | E-Mail: michael.lackner at unileoben.ac.at
Web    : https://infotech.unileoben.ac.at | Web   : https://infotech.unileoben.ac.at
____________________________________________________________________________________

VERSETZ' BERGE | MOVE MOUNTAINS


More information about the x265-devel mailing list