We use gfxPackedPixel to expand from RGB to BGRA in the image decoders. Isolated testing of algorithms I've written using SSSE3 and AVX2 suggests it is 6x to 11x faster than plain old C per-pixel copying. This is similar in native to gfx/2d/Swizzle-*.cpp methods, although if we slot it into that infrastructure, it would be better if we expose methods to get a function pointer designed for row by row conversion like how imagelib does decoding (and avoid setup overhead/branches in SwizzleData on every row).
Bug 1551088 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
We use gfxPackedPixel to expand from RGB to BGRA in the image decoders. Isolated testing of algorithms I've written using SSSE3 and AVX2 suggests it is 6x to 11x faster than plain old C per-pixel copying. This is similar in nature to gfx/2d/Swizzle-*.cpp methods, although if we slot it into that infrastructure, it would be better if we expose methods to get a function pointer designed for row by row conversion like how imagelib does decoding and avoid setup overhead/branches in SwizzleData on every row. These new methods should support both RGB to RGBA and RGB to BGRA to facilitate bug 1541900
We use gfxPackedPixel to expand from RGB to BGRA in the image decoders. Isolated testing of algorithms I've written using SSSE3 and AVX2 suggests it is 6x to 11x faster than plain old C per-pixel copying. This is similar in nature to gfx/2d/Swizzle-*.cpp methods, although if we slot it into that infrastructure, it would be better if we expose methods to get a function pointer designed for row by row conversion like how imagelib does decoding and avoid setup overhead/branches in SwizzleData on every row. These new methods should support both RGB to RGBA and RGB to BGRA to facilitate bug 1541900.