Compile issue for high bit rate on Apple ARM64 and potentally Linux aarch64 from master

Issue #608 new
vargolsoft created an issue

I’ve just downloaded a fresh clone of master and currently it is not compiling for high bit rate compiles.I’ve metioned this in Issue #604 but though I should raise a seperate issue as it appears that the main issue for Issue #604 may have been resolved at some point and didn’t want this issue missed.

Documents/Source/ffmpeg/build-ffmpeg/x265/x265_git/source/common/aarch64/asm-primitives.cpp:113:19: error: use of undeclared identifier 'x265_12bit_quant_neon'; did you mean 'x265_quant_neon'?
p.quant = PFX(quant_neon);
^~~~~~~~~~~~~~~
x265_quant_neon

Documents/Source/ffmpeg/build-ffmpeg/x265/x265_git/source/common/cpu.h:32:28: note: expanded from macro 'PFX'
#define PFX(name) PFX2(X265_NS, name)
^
Documents/Source/ffmpeg/build-ffmpeg/x265/x265_git/source/common/cpu.h:31:28: note: expanded from macro 'PFX2'
#define PFX2(prefix, name) PFX3(prefix, name)
^
Documents/Source/ffmpeg/build-ffmpeg/x265/x265_git/source/common/cpu.h:30:28: note: expanded from macro 'PFX3'
#define PFX3(prefix, name) prefix ## _ ## name
^
<scratch space>:159:1: note: expanded from here
x265_12bit_quant_neon
^
Documents/Source/ffmpeg/build-ffmpeg/x265/x265_git/source/common/aarch64/pixel-util.h:37:10: note: 'x265_quant_neon' declared here
uint32_t x265_quant_neon(const int16_t *coef, const int32_t *quantCoeff, int32_t *deltaU, int16_t *qCoef, int qBits,
^
1 error generated.
make[2]: *** [common/CMakeFiles/common.dir/aarch64/asm-primitives.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....

I believe this is due to the PFX macro not being accounted for in the ARM64 assembler code, which is all hard coded to x265_<func> with a macro to add the leading underscore if required.

The simple fix to get it compiling is to move the p.quant = PFX(quant_neon); line into the !HIGH_BIT_DEPTH code as
then PFX will also end up with the x265_<func> and he high bit rate will default to the ‘C' version . I’ve attached a sample patch. I don’t really know enough about the code to say if this is actually the right thing to do though.

Comments (2)

  1. 季由

    Hi @vargolsoft

    This patch works for me, although I need to create one from my local.

    It seems the developer team may not pay too much attention on this issue tracker forum. Would you mind sending an email to the maillist https://mailman.videolan.org/listinfo/x265-devel, I feel that will increase the visibility of issue #608 and #604, and hopefully they may take a chance to fix this issue.

    Thanks.

  2. Log in to comment