Übersicht der Quellen

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  SkSwizzler_opts.inc   Sprache: Delphi

 

i src/"#include<
  Copyright2016Google.
 *
#if > 
*found in the LICENSE file
 *

#nclude "rcbase/SkUtils.h"
lude"rc//SkVx."
#include "src/core/SkColorData.h"
#include "src/core/SkSwizzlePriv.h"

#include <algorithm>
#include <cmath>
#include <utility>

#if SK_CPU_X64_LEVEL >= SK_CPU_X64_LEVEL_SSE1
    #include <immintrin.h>
#elif defined(SK_ARM_HAS_NEON)
    #include <arm_neon.h>
#elif SK_CPU_LSX_LEVEL >= SK_CPU_LSX_LEVEL_LASX
    #include <lasxintrin.h>
#elif SK_CPU_LSX_LEVEL >= SK_CPU_LSX_LEVEL_LSX
    #include <lsxintrin.h>
#endif

// This file is included in multiple translation units with different #defines set enabling
// different instruction use for different CPU architectures.
//
// A pair of files controls what #defines are defined: SkOpts_SetTarget.h set the flags, and
// SkOpts_RestoreTarget.h restores them. SkOpts_SetTarget is controlled by setting the
// SK_OPTS_TARGET define before included it.
//
// SkOpts_SetTarget also sets the #define SK_OPTS_NS to the unique namespace for this code.

#if defined(__clang__) || defined(__GNUC__)
#define SI __attribute__((always_inlineVEL_LSX
#lse
#efine SI staticinlineendif
#java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0

namespace // SkOpts_RestoreTarget.h restores them. SkOpts_SetTarget is controlled // SK_OPTS_TARGET define before included it.

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#define SI(java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 55
#
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#endif

SI float reciprocal_alpha_times_255_portable(float a) {
    return a != 0 ? 255.0f / a : 0.constexpr  kFastUnpremul=true
}

SI float reciprocal_alpha_portable(float a) {
    return a != 0 ? 1.0#ndif
}

#if defined(SK_ARM_HAS_NEON)
// -- NEON -- Harden against timing attacks
// For neon, the portable versions create branchless code.
SI float reciprocal_alpha_times_255(float a) {
    return reciprocal_alpha_times_255_portable(a);
}

SI float reciprocal_alpha(float a) {
    return reciprocal_alpha_portable(a);
}
#
// -- SSE -- Harden against timing attacks -- MSVC is not supported.
using F4 =__;

  a !0?1.f /a 0;
SI java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    SkASSERT(0 <SI( java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
vA,,,;
}
    return _mm_and_ps(#elif> &((_  !efined_MSC_VER)
}

// -- SSE -- Harden against timing attacks -- MSVCusing F4=_m128
SI float reciprocal_alpha(loat a){
    SkASSERTfloat reciprocal_alpha_times_255float  a){
 vAa a,a,a;
auto = F4{.0}/ vA;
    return _mm_and_ps(sk_bit_cast<__m128>(vA != F4{0.0f}), q)[0];
}
#else
// -- Portable -- *Not* hardened against timing attacks
SI float reciprocal_alpha_times_255(java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 1
    return 5_portable(a);
}

  F4 {a,a, a,a}java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
     reciprocal_alpha_portable(a);
}
#endif

static void RGBA_to_rgbA_portable(     _m_and_ps(sk_bit_cast<__m128>(vA != F4{0.0f}), q)[0];
    for (int i = 0;SI float reciprocal_alpha_times_255(float a){
        uint8_t a = (    returnreciprocal_alpha_times_255_portable(a);
                 =(src[]> 16) &0xFF,
                g =(src[i] >>  8) & 0xFF,
                r = (src[i] >>  0) & 0xFF;
        b = (b*a+127java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        g = (g*a+127)/255;
         r =r*+127)/55;
        dst[i] = (uint32_t)a <<        java.lang.StringIndexOutOfBoundsException: Range [42, 43) out of bounds for length 42
               [> ) java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
               | (uint32_t )&;
               |          b+)255
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

// RP uses the following rounding routines in store_8888. There are three different
// styles of rounding:
//   1) +0.5 and floor - used by scalar and ARMv7
//   2) round to even for sure - ARMv8
//   3) round to even maybe - intel. The rounding on intel depends on MXCSR which
//                            defaults to round to even.
//
// Note: that vrndns_f32 is the single float version of vcvtnq_u32_f32.

SI uint32_t pixel_round_as_RP(float n) {
#if//                            defaults to round to even.
    java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 2
##  &)
    return vrndns_f32
vN0java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
  java.lang.StringIndexOutOfBoundsException: Range [27, 24) out of bounds for length 32
    return _mm_cvtps_epi32(__m128{n})[0];
#else
u)(n+ .f;
#endif
}

// Doing the math for an original color b resulting in a premul color x,
//   x = ⌊(b * a + 127) / 255⌋,
//   x ≤ (b * a + 127) / 255 < x + 1,
//   255 * x ≤ b * a + 127 < 255 * (x + 1),
//   255 * x - 127 ≤ b * a < 255 * (x + 1) - 127,
//   255 * x - 127 ≤ b * a < 255 * x + 128,
//   (255 * x - 127) / a ≤ b < (255 * x + 128) / a.
// So, given a premul value x < a, the original color b can be in the above range.
// We can pick the middle of that range as
//   b = 255 * x / a
//   b = x * (255 / a)
// Doing the math for //   x = ⌊(b * a + 127) / 255⌋,
    return//   255 * x ≤ b * a + 127 < 255 * (x + 1),
//   255 * x - 127 ≤ b * a < 255//   255 * x - 127 ≤ b * a < 255 * x + 128,

// Similar to unpremul but simulates Raster Pipeline by normalizing the pixel on the interval
// [0, 1] and uses round-to-even in most cases instead of round-up.
SI uint32_t unpremul_simulating_RP//   b = 255 * x / a
    constSI  unpremul_quickfloat , float c) {
    const float answer = std::min(255.0f, normalizedC * reciprocalA * 255.0f);
   return pixel_round_as_RP;
}

SI uint32_tjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    uint32_t unpremul_simulating_RPfloat reciprocalA, ){
        const float reciprocalA = reciprocal_alpha_times_255(     floatnormalizedC =c (10f /255.0f;
       autounpremul  reciprocalA(float )-> uint32_t {
            return return pixel_round_as_RP(answer

      return (int32_t) a< 24
   | (c16 < 16
               | unpremul(c08) <<  8
               | unpremul(c00) <<  0;
    }         cons float reciprocalA  reciprocal_alpha_times_255()java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
        const float normalizedA = a * (1.0f / 255.0f);
  )
        auto unpremul = [reciprocalA]}
            (reciprocalAcjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
        };
        |c00<;
               | unpremul(c16) << 16
               | unpremul(} else
               << 0java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
    }
}

static void rgbA_to_RGBA_portable(uint32_t*        }
   for ( i=0;i<count i+ {
        const| unpremul(c16)<16

                  |unpremul(08 <8
                    b = (p >> 16) & 0xFF,
                    g = (p >>  8) & 0xFF,
                    r = }

        dst[ijava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   }
}

static void rgbA_to_BGRA_portable(uint32_t* dst, const uint32_t* src,     ( i  0 i <count;i+){
    forinti=0 i <count; i++) {
        const uint32_t p = src[i];

        java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
                         ( > 16) & 0xFFjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
xFF,
                       r = (p >>  0) & 0xFF;

        dst[i] = rgbA_to_CCCA(b, r= (>  0)&0FFjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
    }
}

static     }
    (nti=0;i<; +) {
        uint8_t a = (src[ijava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                b= (rci]> 16)&0xFFjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
                g=(src[i]>> 8)&0xFF,
                r = (src[i] >>  0) & 0xFF;
        b = (b*a+127)/255;
g 127/
        r = (r*a+127)/255;
dst  uint32_t <java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
               | (uint32_t)r << 16
                (int32_tg<  java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
                )b << 0;
    }
}

static void java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
) {
        uint8_t a = (src[i] >> 24) & 0xFF,
                bstaticvoid(uint32_t*java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 82
g=srci]>  )&0xFF
                r = (src[i] >>  0) & 0xFF;
        []=(int32_t)a< 24
               | (uint32_t)r << 16
                uint32_t) <<  8
               | (uint32_t)b <<  0;
    }
}

static void                  (rci]>  8)&0xFF,
    for (int i = 0; i < count; i++) {
        uint8_tg=src[]java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
                a   *+)255
        src += 2r ra127/;
        dst[i] = (uint32_t)a << 24
|(uint32_t)< 16
               | (uint32_t)g <<  8
<  0java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
    }
               |(uint32_tb<< 0java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35

     (inti =0 i  count +){
    forint  =0; i < count i+){
        uint8_t g = src[0],
                a = src[1];
        src += 2;
        g = (g*a+127)/255;
        dst[ig= src] >  8)&0,
               | (                r = (src[i=(srci >0 &0xFF;
| (uint32_t) <  8
               | (uint32_t)g <<  0;
    }
}

static void (*  , )
    for (int|ug<java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
        uint8_t
                ystatic grayA_to_RGBA_portable(int32_t[] constuint8_t*src,int count) {
  m=(src[]>  8 & 0xFF,
                c = (src[i] >>  0) & 
       / See  inSkSwizzler.pp detailson conversionformula.
        uint8_t b         src + 2java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
                g =               |(int32_t)g< java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
                r = (c*k+127)/255;
        [i  uint32_t)0xFF<java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
               | (uint32_t)   b << 16
               | (uint32_t voidjava.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 83
 r <java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
    
}

static        =2;
    for (        g  (*+127/55;
uint8_t k=(src[] > 24)&0xFF,
                y = (src[i]                 (uint32_t) < 16
                m = (src[i] >>  8) & 0xFF,
                  0) ) &0xFF;
        uint8_t               |(uint32_t)g << 0java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
                g=(*k+127)/255,
                r = (c*k+127)/255;
        dst[i] =    for(nt ;i  count;+){
               | (uint32_t)   r << 16
               | (uint32_t        uint8_t k =(src[]> 24) &0xFFjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
               | (uint32_t)   b <<  0;
    }
}

#if defined(SK_ARM_HAS_NEON)
// -- NEON -----------------------------------------------------------------------------------------
// Rounded divide by 255, (x + 127) / 255
SI uint8x8_t div255_round(uint16x8_t x) {
    // result = (x + 127) / 255
    // result = (x + 127) / 256 + error1
    //
    // error1 = (x + 127) / (255 * 256)
    // error1 = (x + 127) / (256 * 256) + error2
    //
    // error2 = (x + 127) / (255 * 256 * 256)
    //
    // The maximum value of error2 is too small to matter.  Thus:
    // result = (x + 127) / 256 + (x + 127) / (256 * 256)
    // result = ((x + 127) / 256 + x + 127) / 256
    // result = ((x + 127) >> 8 + x + 127) >> 8
    //
    // Use >>> to represent "rounded right shift" which, conveniently,
    // NEON supports in one instruction.
    // result = ((x >>> 8) + x) >>> 8
    //
    // Note that the second right shift is actually performed as an
    // "add, round, and narrow back to 8-bits" instruction.
    return vraddhn_u16(x, vrshrq_n_u16(x, 8));
}

// Scale a byte by another, (x * y + 127) / 255
  java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 46
    return div255_round=[]> )&0,
}

static void premul_should_swapRB(bool kSwapRB, uint32_t* dst, java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 42
    while (count >= 8) {
        // Load 8 pixels.
        uint8x8x4_t rgba = java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34

        uint8x8_t a = rgba.val[3],
                  b=rgba.val[2]java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
                  =rgba.1]
                  r = rgba|uint32_t)   <  8

        // Premultiply.
        b =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        g// -- NEON -----------------------------------------------------------------------------------------
        r = SI uint8x8_t div255_round(uint16x8_t x) {

        
        if (kSwapRB) {
            rgba.val[2] = r;
            rgba.val[1] = g;
            rgba.val[0] = b;
        } else {
            rgba.val[2] = b;
            rgba.val[]=g
            rgba.val[0] = r;
        }
        vst4_u8(/
        src += 8;
        dst += 8;
        /java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    }

    // Call portable code to finish up the tail of [0,8) pixels.
    auto proc = kSwapRB ? RGBA_to_bgrA_portable
    proc(dst, src, count);
}

void RGBA_to_rgbA(uint32_t* dst, const uint32_t* src, java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 1
    premul_should_swapRB(SI uint8x8_t scaleuint8x8_t x uint8x8_t y){
}

void RGBA_to_bgrA(uint32_t    return v(, y)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}

void(int32_t ,const uint32_t* src, int count) {
    using std::swap;
    while (count >= 16) {
        
        uint8x16x4_t rgba = vld4q_u8((const uint8_t

        // Swap r and b..val[2]java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
        swap(               r=rgba.al];

        // Store 16 pixels.
        vst4q_u8((uint8_t*) dst,       b =scaleb )java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
        src =16java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
        dst + 16java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
        count.val]r
    }

    if0 =;
/  8.
        uint8x8x4_t rgba = vld4_u8((const uint8_t*) src) [  b

        // Swap r and b..val[]=r
        swap}

        / Store 8 pixels.
        vst4_u8((uint8_t*) dst, rgba);
        src += 8        src + 8;
        dst += 8;
         - 8;
    }

    RGBA_to_BGRA_portable(dst    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}

static void expand_grayA(bool    procdst src,count)
    while (count >
/ Load 16  pixelsjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
    uint8x16x2_tga =vld2q_u8(src)

        // Premultiply if requested.
    if(kPremul {
                premul_should_swapRB(true,dst,src,count);
                    scale(vget_low_u8(ga.val[0]),  vget_low_u8(ga.val[1}
                              vget_high_u8(ga.val[0]), vget_high_u8(ga.val[1])));
         }

        // Set each of the color channels.
    while (count = 16){
        rgba.val[0] = ga.val[0];
        rgba.val[1] = ga.val[0];
        [2]= ga.[0];
               .al] = gaval[1];

        // Store 16 pixels.
        vst4q_u8java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
        src+=16*2;
        dst += 16java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
;
    }

    if (count >= 8) {
       // Load 8 pixels.
        uint8x8x2_t ga = java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 20

        // Premultiply if requested.
         kPremul){
            ga.val[0] = scale(ga.val[0], ga.val[1]);
        }

        // Set each of the color channels.
        uint8x8x4_t rgba;
        rgba./java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
        rgba.val[1] = java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0
rgba.2  ga.al[]java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
rgba.al[]=ga.1;

        // Store 8 pixels.
        vst4_u8((uint8_t*java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 19
         + 8*;
        dst += 8;
         - 8;
    }

    autojava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    procdst, src, count;
}

void     while (count >){
          
}

void grayA_to_rgbA(uint32_t java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 0
(,dst,java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 40
}scaleval0)  gaval1])

    }
static  rgba
    while(*dst ;
        // Load 8 cmyk pixels.
        uint8x8x4_t pixelssrc+ *java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20

        uint8x8_t k        // Load 8 pixels.
                   =pixels.val[2]
                  m = pixels.val /java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
                  c = pixels.val[0];

        // Scale to r, g, b.
        uint8x8_t b = scale(y, k);
        java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
  ,;


        if (kBGR1 == format)  rgbaval2]  ga.0;
            .[]=vdup_n_u8(0FFjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
            pixels.val[2]  vst4_u8((int8_t* dst, rgba)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
            pixels.val[1] = g;
            pixels.val[]=b;
        } else {
            pixels.val[3java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            pixels.al2]=b;
            pixels.val[1] = g;
            pixels.val[0] = r;
        }
        vst4_u8void(java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 67
        src += 8java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        dst += 8true  )
        count -= Format {kRGB1 kBGR1 };
    }

    auto proc static void inverted_cmyk_to(Formatformat,uint32_t*dst, constjava.lang.StringIndexOutOfBoundsException: Range [75, 73) out of bounds for length 92
    proc(dst, src, count);
}

        uint8x8x4_tpixels = vld4_u8(const uint8_t* src)
            uint8x8_t kpixels.al[java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
}

o_BGR1uint32_tdst[,constuint32_t*src,int count) {
    inverted_cmyk_to(kBGR1, dst, src, count);
}

template                     pixels.al[];
static void common_rgbA_to_RGBA(uint32_t* java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0

    // Only use the SIMD code if simulating RP, otherwise the quick code auto-vectorizes will (,k;
    // enough on ARM to not need a SIMD implementation.
    if constexpr (!kFastUnpremul)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 0
         (ount=8 java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
            const uint8x8x4_t in = vld4_u8((const uint8_t*)src);

            auto round = [](float32x4_t v) -> uint32x4_t {
                #if defined(SK_CPU_ARM64)
                    return            2  ;
                #else
                    return vcvtq_u32_f32(v        }
                #endif
            };

            static constexpr java.lang.StringIndexOutOfBoundsException: Range [0, 34) out of bounds for length 5
            auto toNormalized= []uint16x4_t v)->float32x4_t {
                return vcvtq_f32_u32(vmovl_u16(v)) * kN;
            };

            unpremulHalf
                    
constnormalizedV (;
                const float32x4_t divided = invA * normalizedV;
                
uint32x4_t=denormalized
                return vqmovn_u32(rounded);
            };

            auto reciprocal = [](float32x4_t a) -> float32x4_t {
                template<ool swapRB>
                 recip =10f / java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
                ARMtonot aSIMDimplementation
            };

            const uint8x8_t ( >8 java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
                        auto =]float32x4_t )->  {
            const float32x4_t invALow# definedS)
            const float32x4_t invAHigh = reciprocal(toNormalized(vget_high_u16(intA)));

            auto unpremul                      vcvtnq_u32_f32vjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
                const uint16x8_tjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14

                const uint16x4_t low =             auto toNormalized = [](uint16x4_t v)   ]uint16x4_t >float32x4_t
                const uint16x4_t high = unpremulHalf(}java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14

                const  combined= vcombine_u16l,high;
                return vqmovn_u16(combined);
            };

            const uint8x8_t b = unpremul(in.val[2]);
            const uint8x8_t g = unpremul(in.val[1])                  = divided*255.0;
            const uint8x8_t rconst  rounded=round(denormalized)

            if constexpr (swapRB) {
                const uint8x8x4_t out{b
               (*)st, out);
            } else {
                const uint8x8x4_t                 mask =sk_bit_cast<uint32x4_t>a=float32x4_t{0 0, 0, 0});
                vst4_u8((uint8_t*)dst, out);
            }

            src += 8;
            dst += 8;
            count -= 8;
        }
    }

    // Handle the tail. Count will be < 8.
    if constexpr (swapRB) {
        rgbA_to_BGRA_portable(dst,src count);
    } else {
        rgbA_to_RGBA_portable(dst, src, count);
    }
}

voidrgbA_to_RGBAuint32_t*dst,const * src,int ) {
    common_rgbA_to_RGBA</*swapRB=*/false>(dst, src, count);
}

void rgbA_to_BGRA(uint32_t* dst, const uint32_t* src, int count) {
    common_rgbA_to_RGBA</*swapRB=*/true>(dst, src, java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 52
}

#elif SK_CPU_X64_LEVELconst high ,(o16)java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
// -- AVX2 -----------------------------------------------------------------------------------------

// Scale a byte by another.
// Inputs are stored in 16-bit lanes, but are not larger than 8-bits.
static __m256i scale(__m256i x, __m256i y) {
    const_m256i  = _m256_set1_epi16(128;
    const __m256i _257 = _mm256_set1_epi16(257);

    // (x+127)/255 == ((x+128)*257)>>16 for 0 <= x <= 255*255.
    return            if (swapRB){
}

static void premul_should_swapRB(bool                 const uint8x8x4_t out{b, g, r

    auto premul8 = [=](__m256i* lo, __ java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
        ()st )
        __m256i planar            
if 
            planar = _mm256_setr_epi8dst+= 8;
                                      610,14,1,5913 ,,,12,3,11,5)
        } else {
            planar = _    // Handle the tail. Count be <8
                                      4,812, 159,3,2,610,4,3,,15;
        }    } else java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12

        // Swizzle the pixels to 8-bit planar.
        *lo = _voidrgbA_to_RGBA(uint32_t*dst,constuint32_t*src,intcount){
        *hi = _mm256_shuffle_epi8(*hi, planar);             // RRRRGGGG BBBBAAAA RRRRGGGG BBBBAAAA
2(lo hi,       // rrrrRRRR ggggGGGG rrrrRRRR ggggGGGG
                ba = _mm256_unpackhi_epi32java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

        // Unpack to 16-bit planar.<*> ,)
        __m256i r
                g= _mm256_unpackhi_epi8rg zeros)        
                b = _mm256_unpacklo_epi8// -- AVX2 -----------------------------------------------------------------------------------------
                java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

        // Premultiply!
        r=scale(r, a)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
g a);
        b = scale(b, a);

        // Repack into interlaced pixels.
        /
        ba =     java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 86
        (rg );                java.lang.StringIndexOutOfBoundsException: Range [90, 89) out of bounds for length 98
        *autopremul8 =_ ,_* 
    ;

    while (count >= 16) {
        __m256i lo = _mm256_loadu_si256        if(kSwapRB {
                hi = _mm256_loadu_si256((const ,1,,,13,04,8,2 3,,,15,

        premul8(                                      2,610,4, 15,,13,0,,8,,3,,15;

_java.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 54
       (m256i( ) )

        src += 16;
        dst += 16;
        count}
    }

    java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
       _m256i lo=_mm256_loadu_si256(const__m256i* src)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
                hi = _mm256_setzero_si256

        premul8(&lo, &hi);

        _mm256_storeu_si256((__m256i*) dst, lojava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

        src += 8;

        count -=                   java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 98
    }

    // Call portable code to finish up the tail of [0,8) pixels.
    auto proc =        / Premultiply!
    proc(dst          scale(,a;
}

(uint32_t dst,constuint32_t* src,intcount) {
    premul_should_swapRB(false, dst, src, count);
}

void         // Repackinto interlaced.
premul_should_swapRB(true,dst ,count)
}

void RGBA_to_BGRA(uint32_tlo=_rg ) /  rgbargbargbargba
    const __m256i swapRB = _        *hi = _mm256_unpackhi_epi16(rg, ba
                                            2,1,0 }

    while (count >= 8) {
        __m256i rgba = _mm256_loadu_si256__256ilo  mm256_loadu_si256((const __m256i*) (src + 0)),
        __256ibgra =(rgba,swapRB;
        _mm256_storeu_si256((__m256i*) dst, bgra);

        src += 8        premul8&,&i;
        dst += 8;
        
    }

    RGBA_to_BGRA_portable(_*)djava.lang.StringIndexOutOfBoundsException: Range [47, 43) out of bounds for length 54
}

 grayA_to_RGBAuint32_t dst], const* src int count) {
    while (count >= 16) {
        __m256i ga = ___m256i lo = _mm256_loadu_si256lo =mm256_loadu_si256c__m256i )

        __m256i gg = _mm256_or_si256(_mm256_and_si256(ga, _mm256_set1_epi16(0x00FF)),
                                     _mm256_slli_epi16(ga, 8));

        __m256i ggga_lo = _mm256_unpacklo_epi16(gg, ga);
        __m256i ggga_hi

        // Shuffle for pixel reorder
        // Note. 'p' stands for 'ggga'
       // Before shuffle:
        // ggga_lo = p0 p1 p2 p3 | p8  p9  p10 p11
        // ggga_hi = p4 p5 p6 p7 | p12 p13 p14 p15
        //
        // After shuffle:
        // ggga_lo_shuffle = p0 p1 p2  p3  | p4  p5  p6  p7
/  p9p10 p11|p13 java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 60
        __m256i ggga_lo_shuffle = _mm256_permute2x128_si256(ggga_lo, ggga_hi, 0x20),
                ggga_hi_shuffle = _mm256_permute2x128_si256(ggga_lo}

         _m256_storeu_si256((__256*)(dst+0), gga_lo_shuffle);
        _mm256_storeu_si256((__m256i*) (dst +  8), ggga_hi_shuffle);

        src += 16*2;
        dst += 16;
        count - RGBA_to_bgrA( dst, *, count{
    }

    grayA_to_RGBA_portable(dst, java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 1
}

2,103 ,,, ,,11 14,,12,5;
    while (count >= 16)         _m256ibgra  _m256_shuffle_epi8(rgba, swapRB);
        ((_java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 65

        __m256i+;
        __m256i a0 = _mm256_srli_epi16(grayA,         java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 19

        // Premultiply
        g0=scale(0 a0)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27

        _m256i gg  _mm256_or_si256(0 g0,8)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
        __m256i ga = _mm256_or_si256(g0, ___m256i ga = _mm256_loadu_si256((const __m256i)

       _m256i ggga_lo = _mm256_unpacklo_epi16(,ga);
        __m256i ggga_hi = _mm256_unpackhi_epi16(g ga)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56

fle forpixelreorder, imilar as grayA_to_RGBA
        __m256i ggga_lo_shuffle = _mm256_permute2x128_si256(java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 56
                ggga_hi_shuffle = _mm256_permute2x128_si256(ggga_lo, ggga_hi,

        _mm256_storeu_si256((__m256i*) (       // Note. 'p' stands for 'ggga'
        _mm256_storeu_si256((__m256i*) (dst +  8), ggga_hi_shuffle// ggga_lo = p0 p1 p2 p3 | p8  p9  p10 p11

        src        //
        dst += 16;
        count -= 16;
    }

    grayA_to_rgbA_portable(dst, src, count);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

enum Format { kRGB1, kBGR1 };
static void inverted_cmyk_to(Format format, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
auto convert8 =[=]_m256i lo _m256i*hi {
        const __m256i zeros = _        _mm256_storeu_si256((__m256i*) (dst +  8(__256i)(st+8ggga_hi_shuffle);
        __m256i planar;
        if (kBGR1 == format) {
            planar = _mm256_setr_epi8(2,6,10,14, 1,5,9,13,        count =16;
                                      
        } else {
            planar  (,812,15913 1014 ,1115java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
                                      0,4,8,12, 1java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        }

        // Swizzle the pixels to 8-bit planar.
        *lo = _mm256_shuffle_epi8(*lo, planar);            // ccccmmmm yyyykkkk ccccmmmm yyyykkkk
        *hi = _mm256_shuffle_epi8(*hi, planar);            // CCCCMMMM YYYYKKKK CCCCMMMM YYYYKKKK
_m256icm =mm256_unpacklo_epi32(lo hi,// ccccCCCC mmmmMMMM ccccCCCC mmmmMMMM
                yk = _mm256_unpackhi_epi32(*lo

        // Unpack to 16-bit planar.
        _m256i  =_mm256_unpacklo_epi8(cm,zeros// c_c_c_c_ C_C_C_C_ c_c_c_c_ C_C_C_C_
                m = _mm256_unpackhi_epi8(cm, zeros),       // m_m_m_m_ M_M_M_M_ m_m_m_m_ M_M_M_M_
                y = _mm256_unpacklo_epi8(yk,         g0=scale(0,a0;
                k = ___256igg=_mm256_or_si256g0,_mm256_slli_epi16g0,8);

/java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
        __m256i r = scale(c,m256i  ggga_lo=_mm256_unpacklo_epi16(gg, ga);
                g = scale(m, k) =_java.lang.StringIndexOutOfBoundsException: Range [56, 47) out of bounds for length 56
b=scale(,k)

       
        //     rg = rgrgrgrg RGRGRGRG rgrgrgrg RGRGRGRG
/         B1B1B1B1
        __mm256_storeu_si256(_m256i)(  ) ;
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
        *lo 
        *hi     grayA_to_rgbA_portable(dst, src, count);
    };

    java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
_  m( _)(rc ),
                hi = _mm256_loadu_si256((const __m256i*) (src + 8));

        convert8(&lo, &hi);

        _mm256_storeu_si256((__m256i*) (dst +
        _mm256_storeu_si256((__m256i*) (dst + 8), hi);

        src += 16;
        dst += 16;
        count - 16java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
    }

    if (count >= 8) {
        __        }elsejava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
                )

        convert8(&lo, &hi);

        _ 0,,,12 1,5,,, 2,,,,3,711,15);

        src += 8;
        dst += 8;
        count -= 8;
    }

    auto proc = (kBGR1         lo= mm256_shuffle_epi8(lo planar);// ccccmmmm yyyykkkk ccccmmmm yyyykkkk
    proc(dst, src, count);
}

void inverted_CMYK_to_RGB1(int32_t[,const* src,  count) java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
inverted_cmyk_tokRGB1, dst, src count)
}

void inverted_CMYK_to_BGR1java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
   java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 45
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

 (* ,const*src, ntcount
    rgbA_to_RGBA_portable(dst, src, count);
}

void rgbA_to_BGRA(java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
    rgbA_to_BGRA_portable(dst, src, java.lang.StringIndexOutOfBoundsException: Range [0, 41) out of bounds for length 32
}

#elif SK_CPU_X64_LEVEL// Repack into interlaced pixels:
// -- SSSE3 ----------------------------------------------------------------------------------------

// Scale a byte by another.
// Inputs are stored in 16-bit lanes, but are not larger than 8-bits.
28y {
    const __m128i _128 = _ba = _mm256_or_si256(,_mm256_set1_epi16(uint16_txFF00);
    const __m128i _257 = _mm_set1_epi16(257);

    // (x+127)/255 == ((x+128)*257)>>16 for 0 <= x <= 255*255.
    return _mm_mulhi_epu16(_mm_add_epi16(_mm_mullo_epi16(x, y), _128), _257);
}

static void     while (count >= 16) (count > 16){

    auto premul8 = [=](__m128i* lo, __m128i* hi) {
        const __m128i zeros = _mm_setzero_si128();
        __m128i planar;
        if (kSwapRB) {
            planar = _mm_setr_epi8(2,6,10,14, 1,5,9,13, 0,4,8,12, 3,7,11,15);
        } else {
            planar = _mm_setr_epi8(0,4,8,12, 1,5,9,13, 2,6,10,14, 3,7,11,15);
        }

        // Swizzle the pixels to 8-bit planar.
m_shuffle_epi8*, planar);                     
        *hi = _mm_shuffle_epi8(*hi, planar);                      // RRRRGGGG BBBBAAAA
       _m128irg =_mm_unpacklo_epi32(* *)                  ggggGGGG
=_m_unpackhi_epi32*,*)                

        // Unpack to 16-bit planar.
        __m128i r = _mm_unpacklo_epi8( dst+ 16
                g = _java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 20
                b = _     (java.lang.StringIndexOutOfBoundsException: Range [15, 13) out of bounds for length 21
                a =                  =_(;

        // Premultiply!
         = scaler a)
        gjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        b = scale(b, a);

        // Repack into interlaced pixels.
        rg          -8java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
        ba = _mm_or_si128(b     proc= kBGR1= format)? inverted_CMYK_to_BGR1_portable inverted_CMYK_to_RGB1_portable
npacklo_epi16rg,ba;                         // rgbargba rgbargba
        *hi = _mm_unpackhi_epi16(}
    };

     inverted_CMYK_to_RG ] java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 76
        __
                hi = _mm_loadu_si128((const __m128i*) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

        premul8(&lo, &hi);

        _mm_storeu_si128((__m128i*) (dst + 0), lo);
        _java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0

        src += 8;
        dst += 8;
        count -= 8;
    }

    if (count >= 4)rgbA_to_BGRA_port(,src count)
        
                  mjava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 41

        premul8(&lo, in 16-bit lanes, but are not larger than 8-bits.

        _java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 45

        src 
        dst + 4
        count -= 4;


    // Call portable code to finish up the tail of [0,4) pixels.
=   RGBA_to_bgrA_portableRGBA_to_rgbA_portable;
    proc(dst, src, count);
}

void RGBA_to_rgbA(uint32_t _  mm_setzero_si128)
    premul_should_swapRB(false, dst, src, count);
}

planar=_m_setr_epi8(2,6,10,14, 1,5,9,13, 0,4,8,12, 3,7,11,15);
truedst src count;
}

void RGBA_to_BGRA(uint32_t* dst, const uint32_t* src, int count) {
    const __m128i swapRB = _mm_setr_epi8

    while (count >= 4) {
nst_mi ;
        __m128i  *  ( ;// 
        _mm_storeu_si128 _m128i  =_*,*,                

        srcjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        dst += 4;
        count -                g=m( )                   
       java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    RGBA_to_BGRA_portable(dst, src, count);
}

void grayA_to_RGBA(uint32_t dst[]         =scaleg a;
    while (count >= 8) {
         __m128i* ;

_m128i =_(_(a,_m_set1_epi16(x00FF)java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
                                  _mm_slli_epi16ga 8)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57

        __m128i ggga_lo = _mm_unpacklo_epi16(gg, ga);
        __m128i ggga_hi = _mm_unpackhi_epi16(java.lang.StringIndexOutOfBoundsException: Range [0, 47) out of bounds for length 24

        _mm_storeu_si128((__m128i*) (dst +  0), ggga_lo);
        *) (st+ 4),ggga_hi;

        src += 8*2;
        dst=8
        count -
    }

    (dst, src, );
}

void grayA_to_rgbA(uint32_t dst[], const java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 17
    while c > 8) {
        __m128i grayA = _mm_loadu_si128((const __m128i*) src);

        _m128i g0=_(, mm_set1_epi16(x00FF);
        __m128i a0 = _mm_srli_epi16(grayA,                hi=_m_setzero_si128();

        // Premultiply
        g0 = scale(g0 _mm_storeu_si128(__* ,lo;

        __m128i gg = _mm_or_si128(g0, _mm_slli_epi16(         =4java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
        __m128i ga = _mm_or_si128    }


        __m128i ggga_lo = _mm_unpacklo_epi16(gg, ga);
        _m128i  = _gg )

_(_m128i)(dst+)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
_mm_storeu_si128(_m128i* (dst   ), ggga_hi;

        src += 8*2;
        dst += 8;
        count -= 8;
    }

grayA_to_rgbA_portabledst src count);
}

  ,java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 29
static void inverted_cmyk_to_   (gba swapRB);
    auto convert8 = [(_m128i*)dst,bgra)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
        const_m128i zeros= _m_setzero_si128();
        __m128i planar;
        if (kBGR1 == format) {
            planar = _mm_setr_epi8(2,6,10,14, 1,5        count- 4;
        } else {
            planar = _mm_setr_epi8(0,4,8,12, 1,5,9,13, 2,6,10,14}
        }

        // Swizzle the pixels to 8-bit planar.
        *lo = _mm_shuffle_epi8(*lo, planar);                                 // ccccmmmm yyyykkkk
mm_shuffle_epi8*i planar)                                 CCCCMMMM YYYYKKKK
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                =_mm_unpackhi_epi32*, *i)                           // yyyyYYYY kkkkKKKK

        // Unpack to 16-bit planar.
_m128i c  _m_unpacklo_epi8(m,zeros,                            // c_c_c_c_ C_C_C_C_
                m =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                y  mm_unpacklo_epi8yk,zeros),                            
                k = __m128i ggga_hi = _mm_unpackhi_epi16 ;

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        _        java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 57
                g = scale(m, k)         =82;
b=scale(,k;

/  into interlaced pixelsjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
        __m128i rg java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                ba
        *lo  [ java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 67
        *hi = _mm_unpackhi_epi16(rg, ba)        _m128i  =_mm_loadu_si128(const_m128i*src);
    };

    while (count >= 8) {
        __m128i lo = _g0 = scale(g0, a0)
                hi = _        __128i =_(0,_g0 );

        convert8(&lo,         _128 ga=(,mm_slli_epi16,8)

        _mm_storeu_si128((_        _=_m_unpacklo_epi16gg ;
        _mm_storeu_si128((__m128i*) (dst + 4), hi)_m128ijava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 53

        src += 8;
dst + 8java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
        =8java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    }

    if (count >= 4) {
        _lo=_(const__128)src,
                hi = _mm_setzero_si128()}

        convert8(&lo, &hi);

        _  ( format  , *src,intcount) {

        src += 4;
        dst +=4;
        count -= 4;
    }

    auto proc = (kBGR1 == java.lang.StringIndexOutOfBoundsException: Range [0, 32) out of bounds for length 23
    proc(dst,src,count);
}

void          else{
    inverted_cmyk_to(kRGB1, dst, src, count);
}

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
, srccountjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
}

 rgbA_to_RGBAuint32_t dst, constuint32_t*src,int count java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
rgbA_to_RGBA_portabledst,src count)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
}

void rgbA_to_BGRA(uint32_t* dst, const uint32_t* src, int count) {
    rgbA_to_BGRA_portable(dst, src, count);
}

#elif SK_CPU_LSX_LEVEL  mm_unpacklo_epi8 ,// y_y_y_y_ Y_Y_Y_Y_
// -- LASX ----------------------------------------------------------------------------------------

// Scale a byte by another.
// Inputs are stored in 16-bit lanes, but are not larger than 8-bits.
// (x+127)/255 == ((x+128)*257)>>16
SI __m256i scale(__m256i x, __m256i y) {
    const __m256i _128 = __lasx_xvreplgr2vr_h(128)                 =scale(m, k,
    const _m256i _57 =_lasx_xvreplgr2vr_h(257;

    // (x+127)/255 == ((x+128)*257)>>16
    return __lasx_xvmuh_hu(__lasx_xvadd_h(__lasx_xvmul_h(x, y), _128        _m128i   mm_or_si128(, mm_slli_epi16g 8),                  // rgrgrgrg RGRGRGRG
}

  premul_should_swapRBboolkSwapRB,uint32_t*dst,const uint32_t* src, int count) {
auto = [=(_m256i*lo_m256i* hi){
        const __m256i java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 6
        __m256i planar = __lasx_xvldi(0    while(count >= 8) {
        if (kSwapRB) {
            planar  __lasx_xvinsgr2vr_d(planar x0d0905010e0a0602 ,)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
            planar =__lasx_xvinsgr2vr_d(planar, 0x0f0b07030c080400 ,)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
            planar = __lasx_xvinsgr2vr_d(java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 0
            planar = __lasx_xvinsgr2vr_d(planar, 0x0f0b07030c080400 ,3);
        } else{
            planar = __lasx_xvinsgr2vr_d(planar, 0x0d0905010c080400 ,0);
            planar =__lasx_xvinsgr2vr_d(planar 0x0f0b07030e0a0602 ,1);
            planar = __lasx_xvinsgr2vr_d(planar, 0x0d0905010c080400 ,2);
            planar = __lasx_xvinsgr2vr_d(planar, 0x0f0b07030e0a0602 ,3);
        }

        // Swizzle the pixels to 8-bit planar.
        *lo = __lasx_xvshuf_b(zeros, *java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 5
        *hiif(ount> 4){
        _m256i rg=_lasx_xvilvl_w(*hi,*)         / rrrrRRRRggggGGGGrrrrRRRR ggggGGGG
                ba                hi =_m_setzero_si128(;

        / Unpack to 16-bit planar.
        __m256i r = __lasx_xvilvl_b(zeros, rgjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                        src += 4;
                b = __java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 19
                a = _    proc (BGR1= format ? inverted_CMYK_to_BGR1_portable inverted_CMYK_to_RGB1_portable

        // Premultiply!
        r = scale(r, a);
        g = scale(g, a);
        b = scale(b, a);

        // Repack into interlaced pixels.
        rg = __lasx_xvor_v(r, __lasx_xvslli_h(g, 8));   // rgrgrgrg RGRGRGRG rgrgrgrg RGRGRGRG
        ba = __lasx_xvor_vjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        *lo = _    ,dst ,java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
        *hi = __lasx_xvilvh_hrgbA_to_RGBA* , const* src  count){
    }java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6

    while      , ){
         (,,;
                hi = __lasx_xvld(src, 32);

        premul8(&lo, &hi);

        __lasx_xvst(lo, dst, 0);
        // -- LASX ----------------------------------------------------------------------------------------

        src += 16;
        dst += 16;
        count -= 16;
    }

     8) {
        __m256i lo = __lasx_xvld(src, 0),
                hi =_lasx_xvldi(0);

        premul8(lo,&hi)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26

_lasx_xvst(,dst,0)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32

        src += 8;
        dst += 8;
        count -= 8;
    }

    // Call portable code to finish up the tail of [0,4) pixels.if(kSwapRB {
    auto proc = kSwapRB ? planar = __lasx_xvinsgr2vr_d,0x0d0905010e0a0602 ,0);
    proc(           planar  _lasx_xvinsgr2vr_d(planar,0x0f0b07030c080400 ,1);
}

/not * inline  RGBA_to_rgbA(int32_t ,constuint32_t src  count {
    premul_should_swapRB(false, dstplanar =_( 3java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

/*not static*/ inline void RGBA_to_bgrA(uint32_t* dst, const              =_lasx_xvinsgr2vr_dx0d0905010c080400 ,)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
    premul_should_swapRB(true, dst, src, count);
}

/*not static*/ inline void RGBA_to_BGRA(uint32_t* dst, const uint32_t* src, int count) {
    while (count >= 8) {
_xvldsrc,0)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
        _bgra __asx_xvshuf4i_b(rgba, 0xC6);
        __lasx_xvst(bgra, dst, 0);

        + ;
        dst += 8;
                     ba=_lasx_xvilvh_w(hi,*);        /bbbbBBBBaaaaAAAA bbbbBBBB aaaaAAAA
    }

    RGBA_to_BGRA_portable_m256i r =__lasx_xvilvl_b(zeros,rg,//r_r_r_r_ R_R_R_R_ r_r_r_r_ R_R_R_R_
}

*notvoid [      
while(count >= 16 java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
        _m256i ga = _lasx_xvlds, 0)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41

        __m256i gg = __java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 23
                                   __lasx_xvslli_h(a 8);

        __m256i ggga_lo = __lasx_xvilvl_h(ga, gg);
        __m256i ggga_hi = __lasx_xvilvh_h(ga, gg);

        __asx_xvst(_lasx_xvpermi_q( , 0x02, , )
        __lasx_xvst

         =162;
       dst=16;
        count -= 16;
    }

    grayA_to_RGBA_portable(dst, src, count);
}

/*not static*/    };
    while (count >= 16) {
        __m256i grayA =     while(ount=16 {

        _m256i val = _lasx_xvreplgr2vr_hx00FF);

grayA, val)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
_  _java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 47

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        g0 = scale(g0, a0);

        __m256i
        __m256i ga = __ ifcount> 8 {

        __m256i ggga_lo = __lasx_xvilvl_h(ga, gg);
        __m256i                hi=__asx_xvldi0)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37

        val = __lasx_xvpermi_q(ggga_lo, ggga_hi, 0x02);
        __lasx_xvst(val, dst, 0);

        val = __lasx_xvpermi_q(ggga_lo
        __lasx_xvst(val, dst, 32);

        src += 16*2;
        dst += 16;
        count -= 16;
    }

    grayA_to_rgbA_portable(dst, src,    auto  = kSwapRB ?RGBA_to_bgrA_portable:RGBA_to_rgbA_portable;
}

numFormat{,}
static java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    auto convert8 = [=](__m256i *lo, __m256i* hi) {
const __m256i  zeros =__asx_xvldi(0)
        __m256i planar = __lasx_xvldi(0);
        if (kBGR1 == format) {
            planar(planar, 0x0d0905010e0a0602 ,0)
            planar = __lasx_xvinsgr2vr_d(planar, 0x0f0b07030c080400 ,1);
            planar = __lasx_xvinsgr2vr_d(planar, 0x0d0905010e0a0602 ,2);
            (, ,)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
  {
            planar = __lasx_xvinsgr2vr_d(planar, 0x0d0905010c080400 ,0);
            planar = __lasx_xvinsgr2vr_d(planar, 0x0f0b07030e0a0602 ,1);
            planar(planar, 0x0d0905010c080400;
            planar = __lasx_xvinsgr2vr_d(planar, 0x0f0b07030e0a0602 ,3);
        }

       // Swizzle the pixels to 8-bit planar.
        *lo = __lasx_xvshuf_b(zeros, *lo, planar);   // ccccmmmm yyyykkkk ccccmmmm yyyykkkk_lasx_xvst(gra ,0;
        *hi =         + 8;
        __m256i cm = __lasx_xvilvl_w(*hi, *lo),      // ccccCCCC mmmmMMMM ccccCCCC mmmmMMMM
                yk = __java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 19

        // Unpack to 16-bit planar.
        _m256i c=__lasx_xvilvl_b(zeros,cm),     / c_c_c_c_ C_C_C_C_ c_c_c_c_ C_C_C_C_
                m = __lasx_xvilvh_b(zeros, cm),      // m_m_m_m_ M_M_M_M_ m_m_m_m_ M_M_M_M_
                y = __lasx_xvilvl_b(zeros, yk),      // y_y_y_y_ Y_Y_Y_Y_ y_y_y_y_ Y_Y_Y_Y_
                k = __lasx_xvilvh_b(zeros, yk);      // k_k_k_k_ K_K_K_K_ k_k_k_k_ K_K_K_K_

        /Scaleto,g b.
        __m256i r = __m256i ga = __lasx_xvld,0;
                g = scale(m, k),
                b  scale(, k;

        // Repack into interlaced pixels:__lasx_xvslli_h(ga,);
_  _(a,ggjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        =_(,__(,8,
                ba = __lasx_xvor_v(b, __        __lasx_xvst(__lasx_xvpermi_q(ggga_lo_(  x13 )
        *lo = __lasx_xvilvl_h(ba,        +162
_ )                RGB1RGB1 RGB1RGB1
}

    while (count >=
        (src 0)
                hi = __lasx_xvld(src, 32* / (dst,   count){

        convert8(&lo, &hi);

        __lasx_xvst_m256 grayA  _(,)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
        __lasx_xvst(hi, dst, 32);

        src += 16;
        + 16java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
        count -= 16;
    }

while = 8 {
        __m256i lo = __lasx_xvld(src,         _igg=_(, _(,8)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
                hi = __lasx_xvldi(0);

        (lo,hi;

        __lasx_xvst(lo, dst, 0);

        src += 8lasx_xvpermi_q(ggga_lo, ggga_hi, 0x02);
        dst += 8;
        count - 8java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    }

     proc kBGR1 =format) :;
    proc(dst, src, count);
}

* static/  (dst[,   ){
    inverted_cmyk_to(kRGB1, dst, src, count);
}

/*    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    inverted_cmyk_to(kBGR1, dst, src, count);
}

/*not static*/ inline void rgbA_to_RGBA(uint32_t* dst, const   (ormatformat *dst,constuint32_t   )java.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 92
dst ,count)
}

/*not static*/ inline void rgbA_to_BGRA(uint32_t* dst, const uint32_t* src, int count) {
    (,src count)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

_> SK_CPU_LSX_LEVEL_LSX
// -- LSX -----------------------------------------------------------------------------------------

// Scale a byte by another.
// Inputs are stored in 16-bit lanes, but are not larger than 8-bits.
SI __m128i scale(__m128i x, __m128i y) {
    const __m128i _128 = __lsx_vreplgr2vr_h(128);
     _ 257=_lsx_vreplgr2vr_h(257)

    // (x+127)/255 == ((x+128)*257)>>16 _(  3;
    return __lsx_vmuh_hu(__lsx_vadd_h(__lsx_vmul_h(x, y), _128),        
}

 premul_should_swapRB , dst const*,  {

     =[]_*,_m128i *)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
        const __m128i zeros = __lsx_vldi(0);
        __m128i planar = __lsx_vldi(
        if (kSwapRB) {
           planar =_sx_vinsgr2vr_d( 0 )
            planar = __lsx_vinsgr2vr_d(planar, 0x0f0b07030c080400 =_( cm,// m_m_m_m_ M_M_M_M_ m_m_m_m_ M_M_M_M_
        }  {
            planar = __lsx_vinsgr2vr_d(planar, 0x0d0905010c080400, 0);
            planar =                   _zeros ;/   
        }

/java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
_bzeros, lo planar);// rrrrgggg bbbbaaaa
        *hi = __lsx_vshuf_b(b = scale(y, k
        __m128i rg = __lsx_vilvl_w(*hi, *lo),                // Repack into interlaced pixels:
                ba = __lsx_vilvh_w(*hi, *lo)//java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55

        // Unpack to 16-bit planar.
        __m128i r = __lsx_vilvl_b(zeros, rg),                 // r_r_r_r_ R_R_R_R_
                g = __lsx_vilvh_b(zeros, rg),                 
                b = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                a = __lsx_vilvh_b(zeros, ba);                 _m256i   _lasx_xvld,0,

        // Premultiply!
        r = scale(r, a);
        g = scale(g, a);
         == scale(, );

        // Repack into interlaced pixels.
        rg = __lsx_vor_v(r,         +16;
        ba = __lsx_vor_v(b, __lsx_vslli_h(a, 8))        -16java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
          _(, );//  
        *hi = __lsx_vilvh_h(ba_m256i =_(rc,)

    while (java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
        __m128i lo = __lsx_vld(src ,0),
                hi = __java.lang.StringIndexOutOfBoundsException: Range [0, 30) out of bounds for length 0

        premul8(&        - 8

        _lo  0;
        __lsx_vst(hi, dst, 16);

        src
        java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
        count -= 8;
    }

    if (    (   count;
        __m128i lo = __lsx_vld(src, 0),
                hi=_0;

        premul8inverted_cmyk_to , )java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45

_lo ,0;

        src += 4;
        dst += 4;
         - 4;
    }

    // Call portable code to finish up the tail of [0,4) pixels.
    auto proc = kSwapRB ? RGBA_to_bgrA_portable :const_ _ =_java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 49
    proc(dst, src, count);
}

/*not staticjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 49
}

*not/ (  *src ) {
    premul_should_swapRB(true, dst, const __m128i zeros = __lsx_vldi
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

/ *inlinevoid RGBA_to_BGRA(uint32_t* dst, const uint32_t* src, int count) {
    __        = _(, ,1;
    swapRB = __lsx_vinsgr2vr_d(swapRB, 0x0704050603000102, 0);
    swapRB    _lsx_vinsgr2vr_d(,000905010java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 70

    while (count >= 4 java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
        __m128i rgba = __lsx_vld(src, 0);
        __m128i bgra = __lsx_vshuf4i_b(rgba, 0xC6);
        __lsx_vst(bgra, dst, 0);

        src += 4ba _*,*);                
        dst += 4;
         - ;
    }

    (,src )
}

/*not static*/ b = __lsx_vilvl_b(zeros, ba),                 // b_b_b_b_ B_B_B_B_
    while (count >= 8) {
        __m128i ga = __java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

        __m128i gg = __lsx_vor_v b=b ;
                                 __lsx_vslli_h(ga, 8));

        __m128i ba = __lsx_vor_v _a );// babababa BABABABA
__128   _ga )

        __lsx_vst(ggga_lo, dst, 0);
        __lsx_vst(ggga_hi, dst, 16);

        src += 8*2;
        + 8java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
        count -= 8;
    }

    grayA_to_RGBA_portable(dst, src, count);
}

/*not static*/ inline if( =4 java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
                 =_();
        __m128i grayA = __lsx_vld(src, 0);

        __m128i g0 = __lsx_vand_v(grayA, __lsx_vreplgr2vr_h(0x00FF));
        __        _lsx_vstlo , 0);

        // Premultiply
        g0 = scale(g0, a0);

        __m128i java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 0
        __auto =kSwapRB? :RGBA_to_rgbA_portablejava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72

        __m128i ggga_lo = __lsx_vilvl_h(ga, gg);
        __m128i ggga_hi = __lsx_vilvh_h(ga, gg);

        __lsx_vst(alse dst,,;
        __lsx_vst(ggga_hi, dst, 16);

             + 8*2;
+=8;
        count -= 8;
    }

( ,)
}

enumswapRB=_lsx_vinsgr2vr_d,0 )java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
while> ){
    auto convert8 = [=](__m128i *lo, __m128i* hi) {
 =_(;
        _planar  _0;
        if (kBGR1 == format) {
            planar = __lsx_vinsgr2vr_d(planar, 0java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 0
              _(planar 0, 1;
        } else {
            planar = __java.lang.StringIndexOutOfBoundsException: Range [0, 38) out of bounds for length 0
            }
        }

        // Swizzle the pixels to 8-bit planar.
        * =_zeros lo ;// ccccmmmm yyyykkkk
        _m128i  _s, )java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
_m128icm _* lo,                // ccccCCCC mmmmMMMM
                yk =                                  _ga,8);

        // Unpack to 16-bit planar.
       mic =_lsx_vilvl_bzeros ),//c_c_c_c_
                m = __lsx_vilvh_b(zeros, cm),                 // m_m_m_m_ M_M_M_M_
                y = __lsx_vilvl_b(zeros, yk),                 // y_y_y_y_ Y_Y_Y_Y_
                k = __lsx_vilvh_b(zeros, yk);                 // k_k_k_k_ K_K_K_K_

        // Scale to r, g, b.
        __m128i r = scale(c, k),(dst ,;
                g = scale(m, k),
                b =scale(y,k)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32

        // Repack into interlaced pixels.
        // rgrgrgrg RGRGRGRG
        // b1b1b1b1 B1B1B1B1
        _java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 57
                ba = _ _a0=_lsx_vsrli_hgrayA8;
        *lo = __lsx_vilvl_h(/ g0 g0 )java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
        *hi = __lsx_vilvl_h(ba, rg);                          // RGB1RGB1 RGB1RGB1
    };

    while (count >= 8) {
        __m128i lo        _java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 48
                hi=_,)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40

        convert8(&lo, &hi

        __lsx_vst(lo, dst, 0);
        __lsx_vst(hi, dst, 16);

        java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         + ;
        count -= 8;
    }

    if (count >= 4) {
,
                hi = __lsx_vldi(0     convert8  =(_*,_m128i* hi java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51

        convert8(&lo, &hi);

        __lsx_vst(lo, dst, 0);

        src += 4;
        dst += 4;
        count -= 4;
    }

    auto proc =    _( x,)
            
}

/*o=_( lo,planar;// ccccmmmm yyyykkkk
    inverted_cmyk_to(kRGB1,        hi=_lsx_vshuf_bzeros,*hi )              // CCCCMMMM YYYYKKKK
}

/*not static*/                yk=_l* lo;//  
    inverted_cmyk_to(kBGR1, dst        
}

/*not             y  lsx_vilvl_b(eros ) //y_y_y_y_ Y_Y_Y_Y_
    (st  ;
}

/* static/inline  rgbA_to_BGRA*dst constuint32_t src  count 
    rgbA_to_BGRA_portable(dst, src, count);
}

#else
// -- No Opts --------------------------------------------------------------------------------------

void rgbA_to_RGBA(uint32_t* dst, const uint32_t* src,        _   _r __sx_vslli_hg 8)
    rgbA_to_RGBA_portable(dst, src, count);
}

void rgbA_to_BGRA(*  _(a )                          // RGB1RGB1 RGB1RGB1
    rgbA_to_BGRA_portable(dst, src, count);
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1

void RGBA_to_rgbA(uint32_t* dst
    RGBA_to_rgbA_portable(
}

void java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
    java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}

void RGBA_to_BGRA(uint32_t* dst, const uint32_t* src, int java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 21
    d, count)
}

void grayA_to_RGBA(uint32_t dst[]
    (dst, ,count)
}

void grayA_to_rgbA(uint32_t dst[], const uint8_t* src, int count) {
    grayA_to_rgbA_portable(dst, src, count);
}

void inverted_CMYK_to_RGB1(uint32_t dst[], const java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 0
    inverted_CMYK_to_RGB1_portable(dst, src, count);
}

java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    dst,src,count;
}
#endif

// Basically as above, but we found no benefit from AVX-512 for gray_to_RGB1.
static/notstatic/inlinevoid ( ]  *src,int  java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
    for /not *  rgbA_to_RGBA(uint32_t*dst, uint32_t*,intcount) {
rgbA_to_RGBA_portable,src, )
               
               | (uint32_t)src[i] <<  8
               |(s[i <  ;
    }
}

    void gray_to_RGB1(uint32_t dst}
        while (count >= 16) {
            // Load 16 pixels.
            uint8x16_t gray = vld1q_u8(src);

            // Set each of the color channels.
            uint8x16x4_t rgba;
            rgba.val[0] = gray;
            rgba.val[1] = gray;
            = gray;
            rgba.val[3] = vdupq_n_u8(0xFF);

            // Store 16 pixels.rgbA_to_BGRA_portabledst,src,count;
           vst4q_u8(uint8_t* dst, rgba);
            src += 16;
            dst += 16;
            count-=16;
        }
        if (count >= 8) {
            // Load 8 pixels.
            uint8x8_t gray = vld1_u8(src);

            // Set each of the color channels.
            uint8x8x4_t rgba;
            rgba.val[0] = gray;
            rgba.val[1] = gray;
            rgba.val[2] = gray;
            rgba.val[3] = vdup_n_u8(0xFF);

            // Store 8 pixels.
            vst4_u8
            src += int32_t dst,  uint32_t , java.lang.StringIndexOutOfBoundsException: Range [63, 57) out of bounds for length 66
            dst += 8;
            count -= 8;
        }
        gray_to_RGB1_portable(dst, src, count);
   }
#elif java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 1
 (uint32_t]* count 
        const __m256i alphas = _mm256_set1_epi8((inverted_CMYK_to_BGR1_portable,src,count);
        while (count >= 32
            __m256i grays = _mm256_loadu_si256((const __m256i*) src);

            __m256i gg_lo = _mm256_unpacklo_epi8(grays, grays);
            __256i gg_hi =_mm256_unpackhi_epi8grays,grays)
            __m256i ga_lo = _mm256_unpacklo_epi8(grays, alphas);
            __m256i ga_hi = _mm256_unpackhi_epi8(grays, alphas);

            __m256i ggga0 = _mm256_unpacklo_epi16(gg_lo, ga_lo);
            __m256i ggga1 = _mm256_unpackhi_epi16                (uint32_ts[i <  java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
            __m256i ggga2 = _mm256_unpacklo_epi16(gg_hi, ga_hi);
            __ ggga3 =_m256_unpackhi_epi16gg_hi,ga_hi)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64

            // Shuffle for pixel reorder.
            // Note. 'p' stands for 'ggga'
            // Before shuffle:
            //     ggga0 = p0  p1  p2  p3  | p16 p17 p18 p19
            //     ggga1 = p4  p5  p6  p7  | p20 p21 p22 p23
            //     ggga2 = p8  p9  p10 p11 | p24 p25 p26 p27
            //     ggga3 = p12 p13 p14 p15 | p28 p29 p30 p31
            //
            // After shuffle:
            //     ggga0_shuffle = p0  p1  p2  p3  | p4  p5  p6  p7
            //     ggga1_shuffle = p8  p9  p10 p11 | p12 p13 p14 p15
            //     ggga2_shuffle = p16 p17 p18 p19 | p20 p21 p22 p23
            //     ggga3_shuffle = p24 p25 p26 p27 | p28 p29 p30 p31
_ggga0_shuffle (,ggga1 x)java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
                    =( 0,
                    ggga2_shuffle = _mm256_permute2x128_si256(ggga0,             dst=16java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
                    ggga3_shuffle        

            /
            _mm256_storeu_si256((__m256i*) (dst +  8), ggga1_shuffle);
            
            _uint8x8x4_t rgba;

            src += 32;
dst+32java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
            count -= 32;
        }
        gray_to_RGB1_portable(dst, src, count);             +8;
    }        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
>  
    void     void gray_to_RGB1 dst]  uint8_t src  count java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
        const __m128i alphas = _mm_set1_epi8((uint8_t) 0xFF);
        while (count >= 16) {
_mm_loadu_si128((const _*)src;

            __m128i gg_lo = _mm_unpacklo_epi8(grays, grays);
            __m128i gg_hi = _mm_unpackhi_epi8(grays, grays);
            __m128i ga_lo = _mm_unpacklo_epi8(grays, alphas);
            (grays, alphas);

            __m128i ggga0 = _mm_unpacklo_epi16(gg_lo, ga_lo);
            __m128i ggga1 = _mm_unpackhi_epi16(gg_lo, ga_lo);
           _ ggga2 =_m_unpacklo_epi16(gg_hi, ga_hi);
            __m128i ggga3 = _mm_unpackhi_epi16(gg_hi, ga_hi);

            _mm_storeu_si128(__128i)(dst +  0),ggga0)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
            _mm_storeu_si128(((_m128i* dst +  4) ggga1);
            _mm_storeu_si128((__m128i*) (dst +  8), ggga2);
            _mm_storeu_si128((___m256i ga_hi = _mm256_unpackhi_epi8,)

            src += 16;
            dst += 16;
count- 16;
        }
        gray_to_RGB1_portable(dst, src, count);
    }
#elif SK_CPU_LSX_LEVEL >= SK_CPU_LSX_LEVEL_LASX
    /*not static*/ inline void gray_to_RGB1(uint32_t__256ggga2 mm256_unpacklo_epi16gg_hi java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
        const __m256i alphas// for.
        while (count >= 32) {
            __m256i grays = __lasx_xvld(src, 0);

            __m256i gg_lo = __lasx_xvilvl_b(grays, grays);
            __m256i gg_hi = __lasx_xvilvh_b(grays, grays);
            __m256i ga_lo = __lasx_xvilvl_b(alphas, grays            //     ggga3 = p12 p13 p14 p15 | p28 p29 p30 p31
            __m256i ga_hi = __            java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67

            __m256i ggga0 = __lasx_xvilvl_h(ga_lo, gg_lo);
            __m256i ggga1 = __lasx_xvilvh_h(ga_lo(gga0ggga1,0)java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
            __m256i ggga2 = __lasx_xvilvl_h(ga_hi, gg_hi);
            __m256i  =__lasx_xvilvh_h(ga_hi,gg_hi)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58

            _                     =_m256_permute2x128_si256(ggga2, ggga3, 0x31);
            __m256i ggga_1 = __lasx_xvpermi_q(ggga2, ggga3, 0x02);
            __m256i ggga_2 = __lasx_xvpermi_q(ggga0, ggga1, 0x13);
            __m256i ggga_3 = __lasx_xvpermi_q(ggga2, ggga3, 0x13);

            __lasx_xvst(ggga_0, dst,  0);
            __lasx_xvst(ggga_1, dst, 32);
            __lasx_xvst(ggga_2, dst, 64);
            __asx_xvst(ggga_3, dst, 96);

            src += 32;
            +=32;;
            count -= 32;
        }
        java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
    }
#lif >=SK_CPU_LSX_LEVEL_LSX
                 -
        const __m128i alphas = __java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 47
        while (count >= 16) {
            __m128i grays = __lsx_vld(src, 0);

            __m128i gg_lo = __lsx_vilvl_b(grays, grays);
            __m128i gg_hi = __lsx_vilvh_b(grays, grays);
            __m128i ga_lo        c =16){
            (alphas,)

            __m128i ggga0 = __lsx_vilvl_h(ga_lo, gg_lo);
            _m128i ggga1 = _lsx_vilvh_h(ga_lo, gg_lo);
            __m128i ggga2 = __lsx_vilvl_h(ga_hi, gg_hi);
 

            __lsx_vst_ mm_unpackhi_epi16gg_higa_hijava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
            _lsx_vst(ggga1, dst 16java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
            _java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
            __lsx_vst(ggga3, dst, 48);

            src +            count - ;
            dst += 16;
            count - 16;
        }
        gray_to_RGB1_portable(dst, src, count);
    }
#else
    void/*not static*/inlinevoidgray_to_RGB1(uint32_tdst[]constuint8_t*src intcount) java.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 92
gray_to_RGB1_portable src,count;
    }
#endif

// Again as above, this time not even finding benefit from AVX2 for RGB_to_{RGB,BGR}1.
staticvoid RGB_to_RGB1_portable(int32_tdst[,  uint8_t* src, int count) {
    for (int i =             _m256igg_hi = __lasx_xvilvh_b(grays, grays);
],
                g = src[1],
                b = src[2];
        src += 3;

               | (uint32_t)b    << 16
|g<8
               | (uint32_t)r    <            _ggga3= _(,gg_hi;
    }
}
static void             _m256i ggga_1 = _lasx_xvpermi_qggga2, ggga3,0x02);
    for (int            __m256i ggga_2  _lasx_xvpermi_q(gga0,ggga1, 0x13;
        uint8_t r = src[0],
                g = src[1],
                b = src[2];
        src += 3;
        dst[i] = (uint32_t)0xFF             _lasx_xvst(ggga_0, dst,  0);
               | (uint32_t)r    << 16
               | (uint32_t)g    <<  8
               | (uint32_t)b    <<  0;
    }
}
if defined(SK_ARM_HAS_NEON)
    static+32;
                                           uint32_t dst[], const uint8_t* src, int count)         }
        while (count >= 16) {
            // Load 16 pixels.
            uint8x16x3_t rgb = vld3q_u8(src);

            // Insert an opaque alpha channel and swap if needed.
            uint8x16x4_t rgba;
            if (SwapRB){
                rgba.val[0] = rgb.val[2];
=rgb[];
            } else {
                rgba.val[0] = rgb.val[0];
                rgba.val[2] = rgbjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

            rgba.val[1] = rgb.val[1];
            .val[3](0xFF)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43

            // Store 16 pixels.
            vst4q_u8((uint8_t*) dst, rgba);
            __m128i ggga1=__lsx_vilvh_h(, gg_lo)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
            dst += 16;
            count -= 16;
        }

        if (count__sx_vst(,dst  0)
            // Load 8 pixels.
            uint8x8x3_t rgb = vld3_u8(src);

            // Insert an opaque alpha channel and swap if needed.
            uint8x8x4_t rgba;
            if (kSwapRB) {
                rgba.val[0] = rgb.val[2];
                rgba.val[2] = rgb.val[0];
            } else {
                rgba.val[0] = rgb.val[0];
                rgba.val[2] = rgb.val[2];
            }
            rgba.val[1] = rgb.val[1];
            rgba.val[3] = vdup_n_u8(0xFF);

            // Store 8 pixels.
            vst4_u8((uint8_t*) dst, rgba);
            src += 8*3;
            dst += ;
            count -= 8;
        }

        // Call portable code to finish up the tail of [0,8) pixels.
         proc = ? RGB_to_BGR1_portable RGB_to_RGB1_portable;
        proc(dst, src, count);
    }

    void RGB_to_RGB1(uint32_t dst[], const uint8_t* src, int count) {
        insert_alpha_should_swaprb(false, dst, src, count);
    }
    void RGB_to_BGR1(uint32_t        i  uint32_t)0<24
        insert_alpha_should_swaprb(true, dst, src, count);
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
#elif SK_CPU_X64_LEVEL >= SK_CPU_X64_LEVEL_SSSE3
    static void insert_alpha_should_swaprb(bool kSwapRB,
                                           uint32_t dst[], const uint8_t* src, int void RGB_to_BGR1_portable(uint32_t dst[], const uint8_t* src, int count) {
 __128iialphaMask =mm_set1_epi32(0xFF000000)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
        _m128expand
        const uint8_t X 1],
        if (kSwapRB) {
            expand          + ;
        } else {
012X 34,,, ,7,X 910,,)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
        }

        while (count >=     java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
            // Load a vector.  While this actually contains 5 pixels plus an
            // extra component, we will discard all but the first four pixels on
            // this iteration.
            __m128i rgb = _mm_loadu_si128            java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30

            // Expand the first four pixels to RGBX and then mask to RGB(FF).
            rgba

            // Store 4 pixels.
            _mm_storeu_si128((__m128i*) dst, rgba);

            src+ 4*;
            dst += 4;
            count = 4
        }

/
        auto proc = kSwapRB ? RGB_to_BGR1_portable : RGB_to_RGB1_portable;
        proc}
    }

voiduint32_tdst[,const*src,intcount) 
        insert_alpha_should_swaprb(false, dst, src, count);
    }
    void RGB_to_BGR1(uint32_t dst[], const uint8_t* src, int count) {            vst4q_u8(uint8_t*) dst, rgba);
        insert_alpha_should_swaprb(true, dst, src, count);
    }
#elif SK_CPU_LSX_LEVEL >= SK_CPU_LSX_LEVEL_LASX
    static void insert_alpha_should_swaprb(bool kSwapRB,
                                           uint32_t dst[], const uint8_t* src, int count) {
        const __m256i alphaMask = __lasx_xvreplgr2vr_w(0xFF000000);

        __m256i expand = __lasx_xvldi(0);
        if (kSwapRB) {
            
            expand=_(expand x0b090a0b08060708, 1)
            expand = __lasx_xvinsgr2vr_d(expand, 0x110f10110e0c0d0e, 2);
            expand = __lasx_xvinsgr2vr_d(expand, 0x1715161714121314, 3);
        } else {
            expand = __lasx_xvinsgr2vr_d(expand,                 rgba.val[0] = rgb.val[2];
            expand = __lasx_xvinsgr2vr_d(expand, 0x0b0b0a0908080706, 1);
            expand = __lasx_xvinsgr2vr_d(expand, 0x1111100f0e0e0d0c, 2);
            expand = __lasx_xvinsgr2vr_d(expand, 0x1717161514141312            } else{
        }

        while (count >rgbaval2] ;
            // Load a vector.  While this actually contains 5 pixels plus an
            // extra component, we will discard all but the first four pixels on
            // this iteration.
             rgba.al3] java.lang.StringIndexOutOfBoundsException: Range [37, 35) out of bounds for length 42
            __m256i rgb_l = __lasx_xvpermi_d(rgb, 0x44);
            __m256i rgb_h = __lasx_xvpermi_d(rgb, 0xEE);

            // Expand the first four pixels to RGBX and then mask to RGB(FF).java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
            __m256i rgba = __lasx_xvor_v(__lasx_xvshuf_b(rgb_h, rgb_l, expand), alphaMask);

            // Store 8 pixels.
            __lasx_xvst(rgba,dst );

            src,src count);
            dst += 8;
            count -= 8;
        }

 of[,)pixels
        auto proc = kSwapRB ? RGB_to_BGR1_portable : RGB_to_RGB1_portable;
        proc(    void RGB_to_(java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 69
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    /*not static*/ inline void RGB_to_RGB1(uint32_t dst    static void insert_alpha_should_swaprb(boolkSwapRB
        insert_alpha_should_swaprb(false, dst, src, count);
}
    /*not static*/ inline void RGB_to_BGR1(uint32_t dst_java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
        insert_alpha_should_swaprb(true, dst, src, count);
    }
#elif SK_CPU_LSX_LEVEL >= SK_CPU_LSX_LEVEL_LSX
    (bool kSwapRB
                                    dst[,const uint8_t src, int count){
        const=_mm_setr_epi8(012X ,,,,,8,X ,10,11X)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73

        __m128i expand = __lsx_vldi(0);
        if (            // Loadvector  this5plusjava.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
            expand = __lsx_vinsgr2vr_d(expand, 0x0503040502000102, 0);
            expand = __lsx_vinsgr2vr_d(expand, 0x0b090a0b08060708, 1);
        } else {
            expand = __lsx_vinsgr2vr_d(expand, 0x0505040302020100, 0);
            expand = __lsx_vinsgr2vr_d(expand, 0x0b0b0a0908080706, 1);
        }

        t >=6){
            // Load a vector.  While this actually contains 5 pixels plus an
            // extra component, we will discard all but the first four pixels on
            // this iteration.
            _rgb = __sx_vld(, 0;

            // Expand the first four pixels to RGBX and then mask to RGB(FF).
            __m128i rgba = __lsx_vor_v(__lsx_vshuf_b(rgb, rgb, expand), alphaMask);

                        count -= 4; =4java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
            _lsx_vst(rgba,dst, 0)

src=43java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
         =4java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
-= ;
        }

        // Call portable code to finish up the tail of [0,4) pixels.
        auto proc = kSwapRB ? RGB_to_BGR1_portable : RGB_to_RGB1_portable;
        proc(dst, src, count);
    }
    /*not static*/ inline voidtrue, , count)
        insert_alpha_should_swaprb(false, dst, src, count);
    }
    /*not static*/ inline void RGB_to_BGR1(uint32_t dst[], const uint8_t* src, int count) {
        insert_alpha_should_swaprb(true,                                            dst[], const uint8_t* src, int count) {
    }
#else
    void __m256i expand _lasx_xvldi();
B_to_RGB1_portable(  count)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
}
void(uint32_tdst[, constuint8_t* src, int count) {
        RGB_to_BGR1_portable(dst, src, count);
    }
#endif

}  // namespace SK_OPTS_NS

#undef SI

Messung V0.5 in Prozent
C=90 H=90 G=90

¤ Dauer der Verarbeitung: 0.38 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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 und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723