/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
template <bool aSwapRB> void UnpackRowRGB24_AVX2(const uint8_t* aSrc, uint8_t* aDst, int32_t aLength) { // Because this implementation will read an additional 8 bytes of data that // is ignored and masked over, we cannot use the accelerated version for the // last 1-10 pixels (3-30 bytes remaining) to guarantee we don't access memory // outside the buffer (we read in 32 byte chunks). if (aLength < 11) {
UnpackRowRGB24_SSSE3<aSwapRB>(aSrc, aDst, aLength); return;
}
// Because we are expanding, we can only process the data back to front in // case we are performing this in place.
int32_t alignedRow = (aLength - 4) & ~7;
int32_t remainder = aLength - alignedRow;
// Handle any 3-10 remaining pixels.
UnpackRowRGB24_SSSE3<aSwapRB>(src, dst, remainder);
// Used to shuffle the two final 32-bit words which we ignore into the last // 32-bit word of each 128-bit lane, such that // RGBR GBRG BRGB RGBR GBRG BRGB RGBR GBRG // BRGB RGBR GBRG BRGB ZZZZ ZZZZ ZZZZ ZZZZ // becomes // RGBR GBRG BRGB RGBR GBRG BRGB ZZZZ ZZZZ // RGBR GBRG BRGB RGBR GBRG BRGB ZZZZ ZZZZ const __m256i discardMask = _mm256_set_epi32(7, 5, 4, 3, 6, 2, 1, 0);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.