Skip to content

Optimizations and x86/amd64 SIMD for ubuf_pic_blit#1206

Open
JDarnley wants to merge 7 commits into
Upipe:masterfrom
JDarnley:ubuf_pic_blit_opt
Open

Optimizations and x86/amd64 SIMD for ubuf_pic_blit#1206
JDarnley wants to merge 7 commits into
Upipe:masterfrom
JDarnley:ubuf_pic_blit_opt

Conversation

@JDarnley

Copy link
Copy Markdown
Contributor

Draft waiting for #1205 and some comments

Moves the blit code out of the header and in to libupipe. That was done so I could add code for x86 without it sort of "polluting" everything that includes ubuf_pic.h. That means the code doesn't get inlined in places like upipe_blit. That might not be desirable.

The simd is intrinsics because I pictured it being inlined like previous work I have done for ubuf_pic_plane_set_color but gcc doesn't/can't inline functions built with different options. Different options given by function attributes are needed for the compiler (gcc) to be able to generate some instructions otherwise it causes a build error. At that point I wonder whether I should use external assembly to make that easier except the tails would still need to be scalar to avoid overwrites.

Also added a primitive benchmark for yuv422p and yuv422p10le 1920x1080 blits to see difference for the couple of cases I care about: threshold alpha copy. Speed up with avx2 is over 20 times for 8-bit and almost 10 times for 10-bit. I tried some avx512 code but it wasn't any faster on any of the cpus I had available so it is left out here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant