libjpeg-turbo not compiling with NEON on iOS?

106 views
Skip to first unread message

Werner Sharp

unread,
Feb 2, 2021, 12:25:37 PM2/2/21
to skia-discuss
When doing some profiling with m87 Skia (the current version we are using), I noticed that JPEG decoding using libjpeg-turbo is not using NEON at all. 

It appears (from long ago) that the NEON source files were disabled on iOS probably from compiler compatibility issues...



} else if (current_cpu == "arm64" && !is_mac && !is_ios && !is_win) {

sources += [

"../externals/libjpeg-turbo/simd/arm/arm64/jsimd.c",

"../externals/libjpeg-turbo/simd/arm/arm64/jsimd_neon.S",

"../externals/libjpeg-turbo/simd/arm/common/jcsample-neon.c",

"../externals/libjpeg-turbo/simd/arm/common/jdcolor-neon.c",

"../externals/libjpeg-turbo/simd/arm/common/jdmerge-neon.c",

"../externals/libjpeg-turbo/simd/arm/common/jdsample-neon.c",

"../externals/libjpeg-turbo/simd/arm/common/jidctfst-neon.c",

"../externals/libjpeg-turbo/simd/arm/common/jidctint-neon.c",

"../externals/libjpeg-turbo/simd/arm/common/jidctred-neon.c",

]

}

Removing the "!is_ios" check still compiles fine and JPEG decoding is about 2x faster on my test case and shows NEON usage. in the profiler.

Is this a change that can be made in Skia please?

Thank you.



Mike Klein

unread,
Feb 2, 2021, 12:31:51 PM2/2/21
to skia-discuss
We generally don't suggest using things in third_party/externals for reasons like this.  It's kind of just what we happen to be testing against.

But yeah, might as well...

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/7b2e9e6c-9618-41d2-b5cd-bb4da011988en%40googlegroups.com.

Mike Klein

unread,
Feb 2, 2021, 1:46:31 PM2/2/21
to skia-discuss
I've got this going at https://skia-review.googlesource.com/c/skia/+/364498, and it's looking promising.

(We turned this off in https://skia-review.googlesource.com/c/skia/+/4755/ ~4 years ago when it wouldn't compile.)

Werner Sharp

unread,
Feb 2, 2021, 4:15:50 PM2/2/21
to skia-discuss
Thanks for trying this out so quick!

Mike Klein

unread,
Feb 3, 2021, 9:12:26 AM2/3/21
to skia-discuss
Oh you bet.

That change landed, and the CI tree looks pretty happy about it, so I think it's likely to stick.

Reply all
Reply to author
Forward
0 new messages