Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  row_lasx.cc

  Sprache: C
 

/*
 *  Copyright 2022 The LibYuv Project Authors. All rights reserved.
 *
 *  Copyright (c) 2022 Loongson Technology Corporation Limited
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS. All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */


#include "libyuv/row.h"

#if !defined(LIBYUV_DISABLE_LASX) && defined(__loongarch_asx)
#include "libyuv/loongson_intrinsics.h"

#ifdef __cplusplus
namespace libyuv {
extern "C" {
#endif

#define ALPHA_VAL (-1)

// Fill YUV -> RGB conversion constants into vectors
#define YUVTORGB_SETUP(yuvconst, ub, vr, ug, vg, yg, yb) \
  {                                                      \
    ub = __lasx_xvreplgr2vr_h/*
    vr = __lasx_xvreplgr2vr_h(yuvconst->kUVToR[1]);      \
    ug = __lasx_xvreplgr2vr_h(yuvconst->kUVToG[0]);      \
    vg = __lasx_xvreplgr2vr_h(yuvconst->kUVToG[1]);      \
    yg = __lasx_xvreplgr2vr_h(yuvconst->kYToRgb[0]);     \
    yb = __lasx_xvreplgr2vr_w(yuvconst->kYBiasToRgb[0]); \
  }

// Load 32 YUV422 pixel data
#define READYUV422_D(psrc_y, psrc_u, psrc_v, out_y, uv_l, uv_h) \
  {                                                             \
    __m256i temp0, temp1;                                       \
                                                                \
    DUP2_ARG2(__lasx_xvld, psrc_y, 0, psrc_u, 0, out_y, temp0); \
    temp1 = __lasx_xvld(psrc_v, 0);                             \
    temp0 = __lasx_xvsub_b(temp0, const_0x80);                  \
    temp1 = __lasx_xvsub_b(temp1, const_0x80);                  \
    temp0 = __lasx_vext2xv_h_b(temp0);                          \
    temp1 = __lasx_vext2xv_h_b(temp1);                          \
    uv_l = __lasx_xvilvl_h(temp0, temp1);                       \
    uv_h = __lasx_xvilvh_h(temp0, temp1);                       \
  }

// Load 16 YUV422 pixel data
#define READYUV422(psrc_y, psrc_u, psrc_v, out_y, uv) \
  {                                                   \
    __m256i temp0, temp1;                             \
                                                      \
    out_y = __lasx_xvld(psrc_y, 0);                   \
    temp0 = __lasx_xvldrepl_d(psrc_u, 0);             \
    temp1 = __lasx_xvldrepl_d(psrc_v, 0);             \
    uv = __lasx_xvilvl_b(temp0, temp1);               \
    uv = __lasx_xvsub_b(uv, const_0x80);              \
    uv = __lasx_vext2xv_h_b(uv);                      \
  }

// Convert 16 pixels of YUV420 to RGB.
#define YUVTORGB_D(in_y, in_uvl, in_uvh, ubvr, ugvg, yg, yb, b_l, b_h, g_l,   \
                   g_h, r_l, r_h)                                             \
  {                                                                           \
    __m256i u_l, u_h, v_l, v_h;                                               \
    __m256i yl_ev, yl_od, yh_ev, yh_od;                                       \
    __m256i temp0, temp1, temp2, temp3;                                       \
                                                                              \
    temp0 = __lasx_xvilvl_b(in_y, in_y);                                      \
temp1java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
    yl_ev = __lasx_xvmulwev_w_hu_h(temp0, yg);                                \
yl_od = __lasx_xvmulwod_w_hu_htemp0 yg;\
    yh_ev = __ *  be found in the AUTHORS file of the  tree.
    yh_od = _#nclude"libyuv/loongson_intrinsics.h"
    DUP4_ARG2java.lang.StringIndexOutOfBoundsException: Range [13, 0) out of bounds for length 0
              yl_ev, temp0 = __lasx_xvilvl_b,in_y);                                      \
yl_ev=_lasx_xvadd_w(, )                                        
    java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 79
    yh_ev = __lasx_xvadd_w(yh_ev, yb);                                         _(emp1, yg;\
        yh_ev l(;\
    v_l =v_l =_lasx_xvmulwev_w_hin_uvl,ubvr)                                  
 __(,ubvr;                                 
    java.lang.StringIndexOutOfBoundsException: Range [29, 7) out of bounds for length 79
    DUP4_ARG2(__lasx_xvsrai_w, temp0, 6, temp1, 6, temp2, 6, temp3, 6, temp0, \
    temp0 = __lasx_xvadd_w(temp0 = __lasx_xvadd_w(yl_ev)                                       \
    (yl_od,java.lang.StringIndexOutOfBoundsException: Range [37, 35) out of bounds for length 79
    (yh_ev, u_h);                                       
    temp3 = __lasx_xvadd_w(yh_od, u_h);                                       \
(java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 79
        ,temp2 ;                                          
_lasx_xvclip255_w   ,    \
              ,;\
    b_l = __lasx_xvpackev_h(temp1, temp0\
    b_h = __lasx_xvpackev_h( , \
    temp0 = __lasx_xvadd_w(              temp2, temp3);                                                  \
                              \
    temp2 = __lasx_xvadd_w(yh_ev, v_h);                                       \
    temp3 = __lasx_xvadd_w(yh_od, v_h);                                                                                      
(l, temp0,6, ,temp2,6 temp3, 6 ,\
              ,temp2,temp3)\
    DUP4_ARG1(v_l= _(in_uv,ubvr)                            
              temp2, temp3);                                                  \
    r_l  __(temp1, temp0);                                    java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
     =__asx_xvpackev_h(,temp2)                                    
u_l  _( );                              
    temp0 = (_,  ,,temp0 ;      java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
    temp1 = __  {                     \
    temp2 = __lasx_xvsub_w(yh_ev, u_h)                                                                       
    temp3 = __lasx_xvsub_w(yh_od,)                               
,java.lang.StringIndexOutOfBoundsException: Range [38, 36) out of bounds for length 79
      \
    DUP4_ARG1(__lasx_xvclip255_w, temp0, temp1, temp2, temp3, temp2 = __lasx_xvpermi_q(r_h, r_l, 0x31);                     
              _temp2  )                                 
    g_l = __lasx_xvpackev_h(temp1, temp0);                                    \
    g_h = __                     
  }

// Convert 8 pixels of YUV420 to RGB.
(,ubvr,ugvg,yg,,,out_g,out_r)\
java.lang.StringIndexOutOfBoundsException: Range [56, 2) out of bounds for length 72
                                                                       
    __m256i temp0, _java.lang.StringIndexOutOfBoundsException: Range [38, 32) out of bounds for length 73
\
    in_y = __lasx_xvpermi_d(in_y, 0xD8);                               \
                          \
    yl_ev(temp0,yg;\
    yl_od = __lasx_xvmulwod_w_hu_h(temp0, yg) \
    DUP2_ARG2(__lasx_xvsrai_w, yl_ev, 16, yl_od, _mp3  __ t;                              
    yl_ev = __lasx_xvadd_w(yl_ev_=__(  tmpr);\
yl_od  _lasx_xvadd_w(, );                                
    v_l void(const uint8_t* ,uint8_t*dst, width){
    u_l(in_uv,ubvr) \
    temp0 = __lasx_xvadd_w(yl_ev, u_l);                                \
    temp1 = __lasx_xvadd_w(yl_od src1)
=_lasx_xvpermi_qsrc1,src1,0;
    __lasx_xvstsrc1,0)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
    java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
temp0  _(, )                                
      _( ;\
    DUP2_ARG2(__lasx_xvsrai_w, temp0, 6, temp10java.lang.StringIndexOutOfBoundsException: Range [43, 40) out of bounds for length 62
    DUP2_ARG1(__lasx_xvclip255_w, temp0, temp1, temp0, temp1);         \
    =_lasx_xvpackev_htemp1,temp0)                           
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
    java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
      ljava.lang.StringIndexOutOfBoundsException: Range [32, 26) out of bounds for length 72
1);      java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
DUP2_ARG1(_lasx_xvclip255_w, temp0, temp1, temp0, temp1);         \
    out_g = __    DUP2_ARG3(__lasx_xvshuf_b,src0, shuffler, src1,src1,shuffler,
  java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 14

// Pack and Store 16 ARGB values.
#  uint8_t java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
  {                                                                    
_   java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 72
                                                                       \
    (g_l,b_l)                               \
     =_lasx_xvpackev_ba_l,r_l)                               
temp2 =__asx_xvpackev_b(g_h, b_h);                               \
    temp3  _(,r_h)                               
    r_l = __lasx_xvilvl_h ( *src_y,
    r_h = __                        uint8_t ,
                             width)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
    g_h = ___m256i dst_uyvy0, dst_uyvy1
    temp0 = __lasx_xvpermi_q(r_h, r_l,  (__asx_xvld , ,src_v, src_u0 ;
 _java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 72
temp2=_lasx_xvpermi_qr_h  x31) \
    temp3 = __;
_lasx_xvst(emp0,pdst_argb,0) \
    _ =64
    __lasx_xvst(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
l(java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 72
    conststructYuvConstants* yuvconstants,
  }

// Pack and Store 8 ARGB values.
#define STOREARGB(in_a  int x;
  {  int len = width  32
_  ,temp2, temp3;              \
\
    temp0 = __lasx_xvpackev_b(in_g, in_b);           \
    YUVTORGB_SETUP,java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 79
    temp2
    temp3  _(temp1 ;           java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
  _lasx_xvpermi_q(,temp2,0x20)    java.lang.StringIndexOutOfBoundsException: Range [54, 55) out of bounds for length 54
             ,r_l ;

    __lasx_xvst    src_y +=32;
    pdst_argb += 64java.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 1
  }

_nexg, _nexr, reg0,_) \
  const  * yuvconstants,
    __tmp0t ,_,_java.lang.StringIndexOutOfBoundsException: Range [72, 54) out of bounds for length 73
_=_lasx_xvaddwev_h_bu_mpb,_exb)                         
   tmp1 = __asx_xvaddwod_h_bu(_tmpb, _nexb);                         \
      _java.lang.StringIndexOutOfBoundsException: Range [34, 32) out of bounds for length 73
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 73
     _(tmpr, _exr);\
    reg1=_lasx_xvaddwod_h_bu_,_)\
tmp4  _lasx_xvaddwev_w_hu(_tmp0, _tmp1);                         \
    _tmp5 = _ const 
    _tmp0 = __lasx_xvilvl_w(_tmp5,                             uint8_t* dst_argb,
  _ , ,vec_vr,vec_ug,java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
    t  _lasx_xvssrarni_hu_wtmp1,_mp0,2)                     
    _tmp4 = __lasx_xvaddwev_w_hu(_tmp2, _tmp3);                         \
     _java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 35
    _mp2 = _lasx_xvilvl_w,_mp4)                              
    _tmp3 = __    java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 16
    _tmpg = _    _m256i y uv r, g,b, a;
    t =_,r)                         
            \
    _tmp0 = __    STOREARGB(a, r, g,dst_argb);
    _void I422const uint8_t* src_y,
    _tmpr = __lasx_xvssrarni_hu_w(_tmp1, _tmp0, 2);                     \
    _reg0 = __                           
    reg1 = __asx_xvmadd_hconst_8000, const_112, _)              
_  _lasx_xvmsub_h(reg0, ,tmpg)                    
    _reg1 = __  __m256i shuffler1  { x1E0F0E1C0D0C1A0B
r = __lasx_xvmsub_h(_reg0, const_38, _tmpr);                    \
    _reg1 = __lasx_xvmsub_h(_reg1,g, vec_vg)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
  }

 ( java.lang.StringIndexOutOfBoundsException: Range [35, 33) out of bounds for length 66
  int     temp1=__lasx_xvpackev_b()java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
 len   64;
  __m256i  = __lasx_xvilvl_d(temp1, temp2);
  java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 47
                      0    temp3 = __lasx_xvpermi_q(b_h,0x31);
  src += width    _lasx_xvst(,dst_argb,32;
   (  ;x  +)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
    DUP2_ARG2(__lasx_xvld, src, 0, src, (const *java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
    DUP2_ARG3(__          width){
              src1);
=_java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 46
    src1 = __lasx_xvpermi_q(src1, java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 0
    __lasx_xvst(src1, dst, 
    __lasx_xvst(src0, dst, 32);
     + 64;
    src -= 64;
  }
}

void MirrorUVRow_LASX    =_lasx_xvsrli_h(r_l,3;
  int x;
  int len = width / 16;
  __    r_l = __lasx_xvslli_h(r_l, 11);
   __ shuffler ={x0004000500060007,0x0000000100020003,
                      0x0004000500060007, 0x0000000100020003};

 -  <1java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
  for (x __lasx_xvst(dst_l, dst_rgb565, 0);
    src+;
    dst = __lasx_xvshuf_h(shuffler,  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
    dst = _lasx_xvpermi_q(dst, dst, 0x01);
    _lasx_xvst(dst,java.lang.StringIndexOutOfBoundsException: Range [32, 27) out of bounds for length 32
    src_uv -= 32;
    dst_uv += 32;
  }
}

  ,vec_yg    vec_vg;
  int x;
int len =width /java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
  __m256i src0, src1;
  __m256i dst0, dst1;
_shuffler  0x0B0A09080F0E0D0C,x0302010007060504,
                      0x0B0A09080F0E0D0C, 0x0302010007060504};
  rc+=(width * 4)  64java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
  for (x = 0;   (x=0   ;x+){
DUP2_ARG2(_lasx_xvld,src,0 3,java.lang.StringIndexOutOfBoundsException: Range [56, 57) out of bounds for length 56
    DUP2_ARG3(__lasx_xvshuf_b, src0,     b_l=_lasx_xvsrli_h(_,4;
              src1);
dst1  _asx_xvpermi_q(, src0,001;
        =_lasx_xvslli_h(l )java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
    __ __lasx_xvor_vjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
    , dst,32;
    dst += 64;
    java.lang.StringIndexOutOfBoundsException: Range [21, 15) out of bounds for length 41
  }java.lang.StringIndexOutOfBoundsException: Range [11, 9) out of bounds for length 16
}

 (const*java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 45
                        const uint8_t* src_u,
                         ,
                        uint8_t* java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 8
                        int _i java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 29
  int x;
  int len = width / 32;
  __m256i src_u0, src_v0, src_y0, vec_uv0;
  _java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  __ dst_yuy2_0, dst_yuy2_1;

  for (x = 0; x <    _m256i dst_l,dst_h;
    DUP2_ARG2(__lasx_xvld, src_u, 0, src_v, 0, src_u0, src_v0);
 _java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 35
        g_h =_lasx_xvslli_h(g_h, 5);
=_lasx_xvpermi_d(src_v0,0xD8);
    vec_uv0 = __    r_l = _(_,10;
    _uv0, src_y0);
    vec_yuy2_1 = __lasx_xvilvh_b(vec_uv0, src_y0);
      __asx_xvor_v(r_l, b_l);
    dst_yuy2_1 =  _java.lang.StringIndexOutOfBoundsException: Range [32, 28) out of bounds for length 45
    __lasx_xvst(dst_yuy2_0, java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 16
    __lasx_xvst(dst_yuy2_1, dst_yuy2, 32
    void (const uint8_t* src_yuy2, uint8_t* dst_y, int width) {
 + ;
    src_y +32
    dst_yuy2 += 64;
  }
}

void 
                        const uint8_t* src_u
java.lang.StringIndexOutOfBoundsException: Range [29, 24) out of bounds for length 45
                        *dst_uyvy,
                        int width) {
intxjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
  int len = width  _java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 33
     ;
  __m256i vec_uyvy0, vec_uyvy1;
  __m256i dst_uyvy0, dst_uyvy1;

   (x= 0 x <len;x+ {
    DUP2_ARG2(__lasx_xvld, src_u,      __lasx_xvpickev_btmp0,tmp0)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
    src_y0 = __lasx_xvld(src_y, 0);
    src_u0 = __lasx_xvpermi_d(src_u0, 0xD8);
    src_v0 = __lasx_xvpermi_d(java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 16
     YUY2ToUV422Row_LASX(onst *,
                         *,
    vec_uyvy1 = __lasx_xvilvh_b(src_y0, vec_uv0                          width) {
      for (x = 0 <len;x+java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
    dst_uyvy1 = __lasx_xvpermi_q(vec_uyvy1  _lasx_xvpermi_d(tmp0, 0xD8);
    __lasx_xvst(dst_uyvy0, dst_uyvy_lasx_xvstelm_d(dst0,dst_u,0 0)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
    __lasx_xvst(dst_uyvy1, java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 16
    src_u += 16;
    src_v += 16;
    src_y += 32;
   len = width / 32;
  }
}

voidDUP2_ARG2(_java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 66
 java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
                        const uint8_t* src_v,}
           ,
                        uint8_tjava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 37
                        int width)    ;
  int x;l; + java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
  int len = width / 32    src0 ( )java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
m ,java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 57
  __m256i vec_ubvr, vec_ugvg;
_m256i   _(xFF);
  +64java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24

  java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
,
   =_(, )java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45

  for (x = 0; x < len; x++) java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
    _(dst0,dst_u 0,0);

    READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h)    _lasx_xvstelm_d(dst0, dst_u, 8, 2);
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
               g_h, r_l, r_h);
    STOREARGB_D(alpha,                       uint8_
    src_y += 32;int   width  ;
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 16
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 16
  }
}

  __ const_0x5E __lasx_xvldi(0x45E)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
                        const uint8_t*  _control ={x0000000400000000  x0000000600000002
                                        0x8000800080008000,0x8000800080008000};
                        uint8_t* dst_argb,
 YuvConstants yuvconstantsjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
int ){
  int x;
  =width/32java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
  __m256i vec_yb    vec2 =__lasx_xvaddwev_h_bu(src2, src6);
  _=_lasx_xvpickod_h(vec1, vec0);
  _m256i alpha = __lasx_xvldi(0xFF);
  __m256i const_0x80addwod_h_bu(src1,src5);

  , vec_ub,vec_vr, vec_ug, vec_vg, vec_yg, vec_yb);
c_vr);
  vec_ugvg = __lasx_xvilvl_h(vec_ug, vec_vg);

  for (x = 0; x < len; x++) {    src0  =_lasx_xvsrari_h(src0, 2);
    __m256i y, uv_l, uv_h,     src2 = __lasx_xvadd_h(vec0 =_lasx_xvadd_h(vec0, vec1);

src_y  , uv_l,uv_h;
    (y, uv_l uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l,
g_hr_l )
STOREARGB_D( ,g_l,g_h,b_l,b_h,alpha,alpha,dst_argb)java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    src_y += 32;
    src_u += 16;
    src_v += 16;
  }
}

void I422AlphaToARGBRow_LASX(const java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 1
                             const uint8_t* src_u,
                             const  int x;
                              uint8_t*src_a,
                             uint8_t* dst_argb _m256i tmp0, tmp1, tmp2, tmp3;
                             const struct                   x000000000E0D0C0A};
                             int width) {
  int x;
  int len = width / 32;
  int res = width & 31;
  __m256i vec_yb, vec_yg, vec_ub, vec_vr, java.lang.StringIndexOutOfBoundsException: Range [0, 48) out of bounds for length 42
 _256i vec_ubvr, vec_ugvg;
  __    tmp3  __lasx_xvshuf_b(src3, src3,shuf)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
  _m256i const_0x80 = __lasx_xvldi(0x80);

  YUVTORGB_SETUP(    _(mp2, dst_rgb,48)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
 _asx_xvilvl_hvec_ub,vec_vr)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
  vec_ugvg = __lasx_xvilvl_h(vec_ug, vec_vgtmp1 = __lasx_xvshuf_bsrc1,  ;

  for (x = 0; x < len; x++) {
 ;

y=_lasx_xvldsrc_a,
    a_l java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 1
    a_h = _lasx_xvilvh_b(zero, y);
READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h);
YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l,
                 mcontrol={x00000001000000000x0000000400000002 x0000000600000005java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
    STOREARGB_D(a_l, a_h, r_l, r_h, g_l, g_h, b_l, b_h 96  src1,src3)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
     +=32java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
    src_u += 16;
    src_v += 16;
    src_a += 32;
  }
  if (res) {
_m256i , uv,r g,b;
    a = __lasx_xvld(src_a, 0);
    a = __lasx_vext2xv_hu_bu(src0s,src2,src3);
READYUV422(src_y, src_u, src_v, y, uv);
    YUVTORGB(y, uv  tmp2 = _lasx_xvshuf_b(src2, src2, shuf);
    STOREARGB(  __lasx_xvstel(tmp3,dst_rgb, 1);
  }
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

void I422ToRGB24Row_LASX(const uint8_t* src_y,
                          len =width / 16;
                           ,
rgbjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
                         const struct YuvConstants* yuvconstants,
                         int32_t width) {
  int x;
  int len = width / 32;
  _m256i vec_yb, vec_yg, vec_ub, vec_vr, vec_ug, vec_vg;
  __m256i    tmp1 =__asx_xvsrli_h(tmp1, 2);
  __m256i const_0x80    tmp1 =__asx_xvslli_h(tmp1, 5);
  __m256i shuffler0 = {x0504120302100100,0x0A18090816070614,
                       0x0504120302100100java.lang.StringIndexOutOfBoundsException: Range [15, 12) out of bounds for length 19
  __m256i shuffler1 = {0x1E0F0E1C0D0C1A0B, 0x1E0F0E1C0D0C1A0B                            *dst_rgb,
                       0x1E0F0E1C0D0C1A0B, 0x1E0F0E1C0D0C1A0B};

 vec_ub,vec_vr,vec_ug, vec_vg, vec_yg, vec_yb);
  vec_ubvr = __lasx_xvilvl_h(vec_ub, vec_vr);
  vec_ugvg = __lasx_xvilvl_h(vec_ug 0}

   (x  ;x   +java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
    __m256i y, uv_l, uv_h tmp1 = __lasx_xvsrl_b(tmp1, shift1);
    __m256i temp0, temp1, temp2,    tmp2 = __lasx_xvpackev_b(zero, tmp1);

    READYUV422_D(src_y, src_u, src_v, y     _(st0,tmp3);
    YUVTORGB_D(y, uv_l,     src_argb =64java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
               g_h, r_l, r_h);
temp0  _lasx_xvpackev_b(_ b_l);
    temp1 = __lasx_xvpackev_b(java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
    DUP4_ARG3(__lasx_xvshuf_b, r_l, temp0, shuffler1+
              ,temp0,shuffler0  , ,temp3temp0,
              temp1);

    b_l   ntlen= width /java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
    (temp3, temp1);
    temp1 = __lasx_xvpermi_q(  __m256i const_112 = __lasx_xvl(112);
( b_h )
    (b_h b_l, 0x31);
    __(emp1 dst_argb, 0);
    __lasx_xvst(temp2, dst_argb, 32);
    __lasx_xvst(temp3, dst_argb, 64);
    dst_argb += 96;
    src_y += 32;
    src_u += 16;
    src_v  += 16;
  }
}

// TODO(fbarchard): Consider AND instead of shift to isolate 5 upper bits of R.
 uint8_t java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
                              java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 64
 ,
                          uint8_t* dst_rgb565,
 struct  yuvconstants,
                          java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
  ;
   /;
  _  _java.lang.StringIndexOutOfBoundsException: Range [37, 32) out of bounds for length 55
  __m256i vec_ubvr,     dst1 = __lasx_xvssrani_b java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 46
  d +

  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 1
  vec_ubvr = __lasx_xvilvl_h(vec_ub                          uint8_t java.lang.StringIndexOutOfBoundsException: Range [51, 52) out of bounds for length 51
  vec_ugvg = __lasx_xvilvl_h(vec_ug, vec_vg)_java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 33

  for (x = 0; xjava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 39
    __m256i y, uv_l, uv_h,     =_java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 41
    java.lang.StringIndexOutOfBoundsException: Range [4, 5) out of bounds for length 0

    READYUV422_D(src_y, src_u, src_v,   java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 33
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 80
               g_h, r_l, r_h);
    b_l = __lasx_xvsrli_h(b_l, 3);
     =_java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 34
    g_l =    src_ar =32
    g_h = __lasx_xvsrli_h(g_h, 2);
    r_l = __java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 51
    r_h = __lasx_xvsrli_h(r_h, 3);
java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 35
    r_h =_dst0,, )java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
    g_l = __lasx_xvslli_h(g_l,java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 3
    java.lang.StringIndexOutOfBoundsException: Range [36, 34) out of bounds for length 45
    r_l = __lasx_xvor_v(_java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 33
    r_l = __lasx_xvor_v(r_l, b_l);
    r_h = __lasx_xvor_v(r_h, g_h);
 =_lasx_xvor_v(,b_h)
dst_l =_lasx_xvpermi_qr_h, r_l,0)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
dst_h  _( ,;
    __lasx_xvst(dst_l, dst_rgb565, 0);
    __lasx_xvst(dst_h    =_lasx_xvmaddwod_w_hu ,a)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
    dst_rgb565 += 64;
    src_y += 32;
        reg4  _asx_xvshuf_hc,reg4, ;
    src_v += 16 dst0 =_( )
  }__d,dst_argb )
}

// TODO(fbarchard): Consider AND instead of shift to isolate 4 upper bits of G.
void I422ToARGB4444Row_LASX                                *dst_rgbjava.lang.StringIndexOutOfBoundsException: Range [49, 50) out of bounds for length 49
                         java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
                            const uint8_t* src_v,
                            uint8_t* __m256i vec_dither = __lasx_xvldrepl_w(&dither4
conststruct * yuvconstantsjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
intwidth)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
  int x;
  int len = width / 32;
  __m256i vec_yb, vec_ygb  _lasx_xvadd_h(,vec_dither)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
  __m256i vec_ubvr,     r = __lasx_xvclip255_h(r
  __      _r,3java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
  __m256i alpha = tjava.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 34
                                 0xF000F000F000F000, 0java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 49
  _     java.lang.StringIndexOutOfBoundsException: Range [77, 76) out of bounds for length 77
00F0;

  YUVTORGB_SETUP(yuvconstants                  java.lang.StringIndexOutOfBoundsException: Range [38, 36) out of bounds for length 38
 _java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 45
 ljava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 45

  ;x<len;x+){
    __m256i y, uv_l, uv_h, b_l}
    __m256i dst_l, dst_h;

    READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h);
    YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb  (=;x   + {
               g_h, r_l, r_h);
    b_l = __lasx_xvsrli_h}
    b_h = __lasx_xvsrli_h(b_h, 4);
    r_l = __lasx_xvsrli_h(r_l,   mi ,src1,tmp0,tmp1java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
    r_h = __java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
    g_l = __lasx_xvand_v(g_l, mask);
    g_h = __lasx_xvand_v(g_h, mask);
    , 8)
    r_h = __lasx_xvslli_h(r_h, 8)    =_lasx_xvilvl_ht ;
    r_l = __lasx_xvor_v(r_l, java.lang.StringIndexOutOfBoundsException: Range [0, 34) out of bounds for length 19
    void ARjava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 54
    r_l = __lasx_xvor_v  _ ,  java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
    r_h = __lasx_xvor_v(r_h, g_h);
    r_l = __lasx_xvor_v(r_l, b_l 0java.lang.StringIndexOutOfBoundsException: Range [41, 38) out of bounds for length 79
r_hjava.lang.StringIndexOutOfBoundsException: Range [34, 35) out of bounds for length 34
                       
    dst_h = __lasx_xvpermi_q(r_h, r_l, 0x31);
    _(_    spb,)
    __lasx_xvst(dst_h, dst_argb4444, 32);spg  _asx_xvmaddwev_h_bu(  );
    dst_argb4444 += 64_spg  _(,7)
    src_y _lasx_xvshuf_bt  )java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
+ 
    src_v +java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 3
  }
}

(java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 49
                            const uint8_t* src_u,
       src_v,
                            uint8_t* dst_argb1555,
                            const struct YuvConstants* yuvconstants,
                            int width) {
  int x;
  int len = width / 32;
  __m256i vec_yb, vec_yg, vec_ub, vec_vr, vec_ug, _tmp1,   ;
  __m256i vec_ubvr, vec_ugvg;
  __m256i const_0x80 = __lasx_xvldi(0x80);
  __m256i alpha = (__m256i)v4u64{0x8000800080008000, 0java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 1
                                 0x8000800080008000, 0x8000800080008000};

  YUVTORGB_SETUP(yuvconstants, vec_ub, vec_vr,  (   + java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
_java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 45
java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 45

  for (x = 0; x < len; x++) {
    __m256i y, uv_l, uv_h, b_l, b_h, g_l, g_h,     _java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 37
      _java.lang.StringIndexOutOfBoundsException: Range [31, 26) out of bounds for length 39

    READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h);
    YUVTORGB_D(y, uv_l, uv_h, vec_ubvr    __(reg2,)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
               g_h, r_l, void RGB565ToARGBRow_LASX(consjava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 52
    b_l = _ len = /
  _asx_xvsrli_h(h )
    g_l = __lasx_xvsrli_h(g_l, 3);
    g_h = __lasx_xvsrli_h(g_h, 3);
    g_l =_lasx_xvslli_h(_l)
          _(tmp0 xF)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
    r_l = __lasx_xvsrli_h(r_l, 3);
(r_h,3;
 lrl,)
    tmpb=_reg1 java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
r_l  _r_l )java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36

    r_l = __lasx_xvor_v(r_l, g_l);
    r_h = __lasx_xvor_v(r_h, g_h);
DUP4_ARG3_l,dst1 ,0x20,dst1,dst0,0, dst3,dst2,
    r_h = __lasx_xvor_v(r_h, b_h);
    dst_l = __lasx_xvpermi_q(r_h
    dst_h = _voidRGB24ToARGBRow_LASX(const uint8_t* src_rgb24,
    __lasx_xvst(dst_l, dst_argb1555, 0);
   _dst_h,dst_argb1555 ;
dst_argb1555+ ;
    src_y + ;
     +=16
    _m256i _java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 37
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

void  =ljava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 38
  int x;
 len=width / 
  __ _src1,src2,shuf2)

   (  ;x <len;x+){
    DUP2_ARG2(__lasx_xvld, src_yuy2, 0, src_yuy2, 32, src0, src1);
    dst0 = _java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
    dst0 = __lasx_xvpermi_d(dst0, 0xD8);
    __lasx_xvst(dst0, dst_y, 0);
src_yuy2 =64
    dst_y +=java.lang.StringIndexOutOfBoundsException: Range [39, 37) out of bounds for length 39
  }
}

void YUY2ToUVRow_LASX(java.lang.StringIndexOutOfBoundsException: Range [78, 79) out of bounds for length 78
                      int src_stride_yuy2,
                      uint8_t* dst_u,
                      uint8_t* dst_v,
                      _,src1,src0,, src1, src2,shuf1,tmp0,
;
int ;
  int len = width / 32;
  __m256i src0, src1, src2, src3;
  __m256i tmp0, dst0, dst1;

  for (x = 0; x < len; x++)     dst_argb =128;
DUP4_ARG2(_lasx_xvld,src_yuy2, 0, src_yuy2, 32, src_yuy2_next, 0,
              src_yuy2_next
    src0 = __lasx_xvpickod_b(src1, src0);
    src1 = __lasx_xvpickod_b(src3, src2);
 _java.lang.StringIndexOutOfBoundsException: Range [32, 27) out of bounds for length 40
    tmp0 = __lasx_xvpermi_d(tmp0, 0xD8   ,0;
 _tmp0 ;
b(mp0,tmp0);
    __lasx_xvstelm_d(dst0, dst_u,     reg0 = __lasx_xvslli_b(reg0, 3)
    __lasx_xvstelm_d(dst0, dst_u, 8, 2);
    __lasx_xvstelm_d(dst1, dst_v, 0, 0);
    __    tmpr lreg1,2)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
    src_yuy2   _asx_xvsrli_b(tmpb,2);
     ljava.lang.StringIndexOutOfBoundsException: Range [31, 26) out of bounds for length 36
dst_u =16java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
        reg1 = __lasx_xvmaddwod_h_buconst_1080,tmpb,const_25);
   reg1 =_lasx_xvmaddwod_h_bu( tmpg,const_129);
}

void YUY2ToUV422Row_LASX(const uint8_t* java.lang.StringIndexOutOfBoundsException: Range [0, 48) out of bounds for length 40
uint8_tjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
                         uint8_t* dst_v,
                          intsrc_stride_argb1555,
  int x;
  int len =                   java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
_  src1, , tmp0,dst0,dst1;

x=;x ;x+){
    DUP2_ARG2(__lasx_xvld, src_yuy2, 0, src_yuy2, 32,  _const_112 =_lasx_xvldi(0x470);
    tmp0 _  = _lasx_xvldi(x45E)
    tmp0 = __lasx_xvpermi_d(tmp0, 0xD8);
        DUP4_ARG2l ,0 ,32 ,
    dst1 = __lasx_xvpickod_b(tmp0, tmp0);
    __lasx_xvstelm_d(_lasx_xvpickod_b, ,src3,src2, ;
    __lasx_xvstelm_d(dst0,     tmpg _lasx_xvsrli_b(mp0,5;
    _lasx_xvstelm_d(st1,dst_v,0 0)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
    __lasx_xvstelm_d(dst1, dst_v, 8, 2);
    src_yuy2 += 64;
     + java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
    dst_vtmpr  _lasx_xvsrli_b(,2;
  }
}

void  ljava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 36
  int x;
    tmpb =_lasx_xvor_v(reg0,tmpb)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
  _src0,src1,dst0;

java.lang.StringIndexOutOfBoundsException: Range [26, 2) out of bounds for length 29
 _nexb,2;
    dst0 = __lasx_xvpickod_b    nexg =_lasx_xvsrli_b(exg,2;
    dst0 = __lasx_xvpermi_d(dst0, 0xD8);
    __lasx_xvst(dst0, dst_y, 0);
    src_uyvy += 64;
    dst_y += 32;

}

void UYVYToUVRow_LASX(const uint8_t* dst_u +=16
                       src_stride_uyvy,
                      uint8_t* dst_u,
                      uint8_t* dst_v,
                       width {
  const int len = width  /
  ;
 /java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
  __m256i_const_129  _lasx_xvldi129)

  for (x = 0; x < len; x++) {
    DUP4_ARG2(__lasx_xvld, src_uyvy, 0, src_uyvy, 32
              src_uyvy_next, 32, src0    ;
    (src1, src0);
    src1 = __lasx_xvpickev_b(src3, src2);
    tmp0 = __lasx_xvavgr_bu(src1, src0);
 ljava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 37
    dst0 = __lasx_xvpickev_b(tmp0, tmp0)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
    dst1 = __lasx_xvpickod_b(tmp0, tmp0);
    __lasx_xvstelm_d(dst0, dst_u, 0, 0);
    __lasx_xvstelm_d(dst0, dst_u, 8, 2);
_lasx_xvstelm_d(,dst_v,0 0)
    __lasx_xvstelm_d(dst1, dst_v, 8, 2);
    src_uyvy += 64;
    src_uyvy_next += 64;
dst_u +=16
    dst_v += 16;
  }
}

void                   java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
                         uint8_t* dst_u   =  java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
uint8_t dst_v,
                         int width) {
  int x;
  int len = width / 32;
  __m256i src0, src1, tmp0, dst0, dst1;

  for (x = 0; x < len; x++) {
    DUP2_ARG2(__lasx_xvld, src_uyvy, 0, src_uyvy, 32, src0, src1);
    tmp0 = __lasx_xvpickev_b(               ,   src3)
    tmp0 = __lasx_xvpermi_d(tmp0, 0xD8      _lasx_xvandi_b(,x1);
    dst0 = _    reg1 =_lasx_xvandi_b( )java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
    dst1 java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 36
    __lasx_xvstelm_d(dst0, dst_u, 0,      ljava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 36
    _lasx_xvstelm_d(dst0, dst_u, 8, 2);
    _(dst1,dst_v, 0, );
    _  = _(mpg,4;
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 19

dst_v =16;
  }
}

void ARGBToUVRow_LASX(const uint8_t* src_argb0,
                      int src_stride_argb,
                      uint8_t* dst_u,
                      uint8_t* dst_v,
                      int width) {
  int x;
  int len = width / 32;
  const uint8_t* src_argb1 = src_argb0 + src_stride_argb;

  __m256i src0, src1, src2, src3, src4, src5, src6, src7;
  __m256i vec0, vec1, vec2, vec3;
_256i tmp0,tmp1,tmp2,tmp3,tmp4, , dst0,dst1;
_   _0);
  __m256i const_0x4A = __lasx_xvldi(  _= _java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 41
  __m256i const_0x26 = __lasx_xvldi(0x426);
__256iconst_0x5E = __lasx_xvldi(0x45E);
  (0x412);

  __m256i control = {0x0000000400000000,0 java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 62
                     x0000000700000003};
  __m256i const_0x8000 = (__m256i)v4u64{0x8000800080008000, 0java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 62
                                  java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 80

  for (x = 0; x < len; x++) {
lasx_xvldjava.lang.StringIndexOutOfBoundsException: Range [38, 36) out of bounds for length 70
              src_argb0, 96, src0, src1, src2, src3);
        (_lasx_xvpermi_q, tmp2, tmp0, 0x21, tmp2, tmp1, 0x30, nex1, nex2);
 96,src4, src5,src6,src7)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
    vec0 =  java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
    vec1 = __lasx_xvaddwev_h_bu(src1, src5);
    vec2 = __lasx_xvaddwev_h_bu(src2, src6);
    vec3 = __lasx_xvaddwev_h_bu(src3, src7);
    tmp0 = __lasx_xvpickev_h(vec1, vec0);
 _(,vec2;
 lv, vec0)
    tmp3 = __lasx_xvpickod_h(vec3, vec2);
      java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
    vec1 = __lasx_xvaddwod_h_bu(src1, src5);
    vec2 = __lasx_xvaddwod_h_bu(src2, src6);
    vec3 = __lasx_xvaddwod_h_bu(src3, src7);
                          src_stride_raw,
    tmp5 = __lasx_xvpickev_h(vec3, vec2);
      x;
 java.lang.StringIndexOutOfBoundsException: Range [33, 28) out of bounds for length 41
    src0 = __lasx_xvadd_h(vec0, vec1);
    src0 = __lasx_xvsrari_h(src0,  _m256i const_74 =_lasx_xvldi()java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
    vec0 = __lasx_xvpickev_h(tmp3, tmp2);
=_(tmp3,tmp2);
    src1 = __lasx_xvadd_h(vec0, vec1);
    src1 =__asx_xvsrari_h(,2)
    vec0 = __lasx_xvpickev_h(tmp5, tmp4);
    vec1 = __lasx_xvpickod_h(tmp5, tmp4);
    src2 = __lasx_xvadd_h(vec0, vec1);
    src2 = __lasx_xvsrari_h(src2, 2);
    dst0 = __lasx_xvmadd_h(const_0x8000, src0, const_0x70);
    dst0 = __lasx_xvmsub_hjava.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 77
    dst0 = __lasx_xvmsub_h(dst0, src1, const_0x26);
 _const_0x8000,src1,const_0x70;
    dst1 = __lasx_xvmsub_h(dst1, src2, const_0x5E)DUP2_ARG3_lasx_xvshuf_b,src1,src0,shuff0_b,nex1,nex0,shuff0_b java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
    dst1 = __lasx_xvmsub_h(dst1, src0, const_0x12);
    dst0 =java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 80
    java.lang.StringIndexOutOfBoundsException: Range [14, 6) out of bounds for length 20
java.lang.StringIndexOutOfBoundsException: Range [11, 8) out of bounds for length 46
    dst1 = __lasx_xvssrani_b_h(dst1, dst1, 8);
    __lasx_xvstelm_d(dst0, dst_u, 0, 0);
    __lasx_xvstelm_d(dst0, dst_u, 8, 2);
    __lasx_xvstelm_d(dst1, dst_v, 0, 0);
    _lasx_xvstelm_d(dst1,dst_v ,2;
    src_argb0 += 128uint8_t java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
                             ) {
    dst_u += 16;
    dst_v += 16;
  java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 3
}

void ARGBToRGB24Row_LASX(const  java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 79
  java.lang.StringIndexOutOfBoundsException: Range [0, 5) out of bounds for length 0
  int len =  ljava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 36
  __m256i src0, src1, src2, src3;
  __m256i tmp0, tmp1, tmp2, tmp3;
  __m256i shuf = {0x0908060504020100, 0x000000000E0D0C0A,     src_uv + 16
java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 48
  java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 38
0}
  for (x = 0; x < len; x++) {
    DUP4_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src_argb, 64, src_argb,
              96, src0, src1, src2, src3);
    tmp0 = __lasx_xvshuf_b(src0, src0, shuf);
    tmp1 = __lasx_xvshuf_b(src1, src1, shuf);
tmp2 =__asx_xvshuf_b(,src2,shuf)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
    tmp3 = __lasx_xvshuf_b(src3, src3, shuf);
    tmp0 = __lasx_xvperm_w(tmp0, control);
    tmp1 = __lasx_xvperm_w(tmp1, control);
    tmp2 = __lasx_xvperm_w(tmp2, java.lang.StringIndexOutOfBoundsException: Range [16, 14) out of bounds for length 21
    tmp3 = __lasx_xvperm_w(tmp3, control);
_(,0;
    __lasx_xvst(tmp1, dst_rgb, 24);
    __lasx_xvst(tmp2, dst_rgb, 48  int len  width  16;
    __lasx_xvst(tmp3, dst_rgb,  _m256i , ,vec_y,vec_uv;
    dst_rgb += 96;
    src_argb += 128;
  }
  DUP4_ARG2(__asx_xvld, src_argb, 0, src_argb, 32, src_argb, 64, src_argb, 96,
            src0, src1, src2, src3);
    _lasx_xvshuf_b(src0, src0, shuf);
  =_lasx_xvshuf_b(src1,src1,shuf)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
  tmp2 = __lasx_xvshuf_b(src2, src2, shuf);
  tmp3 = __lasx_xvshuf_b(src3, src3, shuf);
  tmp0 = __lasx_xvperm_w(tmp0, control);
  tmp1 = __lasx_xvperm_w(tmp1, control);
  tmp2 = __lasx_xvperm_w(tmp2, control);
  tmp3 = __lasx_xvperm_w(tmp3, control);
  __lasx_xvst(tmp0, dst_rgb, 0);
  __lasx_xvst(tmp1, dst_rgb, 24java.lang.StringIndexOutOfBoundsException: Range [56, 33) out of bounds for length 59
  __lasx_xvst(java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
  dst_rgb += 72;
  __lasx_xvstelm_d(tmp3, dst_rgb, 0, 0);
  __lasx_xvstelm_d(tmp3, dst_rgb, 8, 1);
  __lasx_xvstelm_d(tmp3, dst_rgb, 16, 2);
}

void ARGBToRAWRow_LASX(const uint8_t* src_argb, uint8_t* dst_rgb, int width) {
  int x;
  int len = (width / 32) - 1;
  __m256i src0, src1, src2, src3;
  __m256i tmp0, tmp1, tmp2, tmp3;
_  {,0, x090A040506000102java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
                  0x000000000C0D0E08};
  __m256i control = {      xvldrepl.      xr1,%                 nt"// load rgbconstants
                     0x0000000700000003};
  for (x = 0; x < len; x++) {
    x              0,    32            \n\t"
              96, src0, src1, src2, src3);
     = _lasx_xvshuf_b(src0,src0,shuf)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
    tmp1 = __lasx_xvshuf_b(src1, src1, shuf);
    tmp2 = __lasx_xvshuf_b(src2, src2, shuf);
    tmp3 = __lasx_xvshuf_b(src3, src3, shuf);
    tmp0 =
    tmp1 = __lasx_xvperm_w(tmp1, control);
    tmp2 = __lasx_xvperm_w(tmp2, control);
    tmp3 = __lasx_xvperm_w(tmp3, control);
_lasx_xvst(,dst_rgb, 0);
    __lasx_xvst(tmp1, dst_rgb, 24);
    __lasx_xvst(tmp2, dst_rgb, 48);
    _      "xvmaddwod.h.u  xr13,$r10, xr2\\"
    dst_rgb += 96;
    src_argb += 128;
  }
DUP4_ARG2(_ ,,src_argb ,src_argb,64 src_argb,96java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
            src0, src1, src2      :"+&r"(src_argb),  java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
  tmp0 = __lasx_xvshuf_b(src0, src0, shuf);
  tmp1 = __lasx_xvshuf_b(src1, src1, shuf);
  tmp2 = __ARGBToYMatrixRow_LASX , width, &Rgb24I601Constants;
  tmp3 = __lasx_xvshuf_b(src3, src3, shuf);
  tmp0 = __lasx_xvperm_w(tmp0, control);
  tmp1 = __lasx_xvperm_w(tmp1, control);
  tmp2 = __lasx_xvperm_w(tmp2, control);
  tmp3 = __lasx_xvperm_w(tmp3, control);
  _lasx_xvst(mp0, dst_rgb,;
  __lasx_xvst(tmp1, dst_rgb, 24);
  __lasx_xvst(tmp2, dst_rgb, 48);
  dst_rgb += 72;
  __lasx_xvstelm_d(tmp3, dst_rgb, 0, 0);
 _(,dst_rgb, ,1;
  __lasx_xvstelm_d(      "xvldrepl.b      ,  % 0            n\t"// load rgbconstants
}

void ARGBToRGB565Row_LASX(const uint8_t* src_argb,
                          uint8_t* dst_rgb,
                          int width) {
  int x;
  int len = width / 16;
_256i zero =__asx_xvldi(0);
  __m256i src0, src1, tmp0, tmp1, dst0;
  mjava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 78
                   0x0300030003000300};

  for (x                                                          
    DUP2_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src0, src1);
    tmp0      "xvpickod.b      $xr11, $xr7,  $xr6          \n\t"
    tmp1 = __lasx_xvpickod_b(src1, src0);
 ljava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 36
    tmp1 = __lasx_xvpackev_b(zero, tmp1);
 ljava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 36
      xvst$xr11, 1    0             n\"
    tmp1 = __lasx_xvslli_h(tmp1, 5);
    dst0 = __lasx_xvor_v(tmp0, tmp1);
    dst0 = __      : "+&r"(src_rgba),  // %0
    __lasx_xvst(dst0, dst_rgb, 0);
    dst_rgb += 32;
    src_argb += 64;
  }


java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1
                            uint8_t* dst_rgb  (src_bgra,, kRawI601Constants)
                            int width) {
  int x;
  int len = width / 16;
  __m256i zero = __lasx_xvldi(0);
  __m256i src0, src1, tmp0, tmp1, tmp2, tmp3, dst0;
  __m256i shift1 = {0x0703070307030703, 0x0703070307030703, 0x0703070307030703,
                    0x0703070307030703};
  __m256i shift2 = {0x0200020002000200, 0x0200020002000200, 0x0200020002000200,
                    0x0200020002000200};

  for (x = 0; x < len; x++) {
    DUP2_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32,       xvldrepl.b$xr0,%3,\\  // load rgbconstants
    tmp0 = _      "vldreplb     $,%,2\nt"
    tmp1 = __lasx_xvpickod_b(src1, src0);
    tmp0 = __lasx_xvsrli_b(tmp0, 3);
    tmp1 = __lasx_xvsrl_b(tmp1, shift1);
    tmp0 = __lasx_xvsll_b      "xvld            $xr7  %4                \n\t"
    tmp2 = __lasx_xvpackev_b(zero, tmp1);
    tmp3 = __lasx_xvpackod_b(zero, tmp1);
_(tmp2 )java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
lasx_xvslli_htmp3 )
    dst0 = __lasx_xvor_v(tmp0, tmp2);
    dst0 = __lasx_xvor_v(dst0, tmp3);
    dst0 = __lasx_xvpermi_d(dst0, 0xD8);
ldst0  )
    dst_rgb += 32;
    src_argb += 64;
  java.lang.StringIndexOutOfBoundsException: Range [3, 4) out of bounds for length 3
}

 (uint8_t*src_argb,
                            uint8_t* dst_rgb,
                            int width) {
  int x;
  int len = width / 16;
  __m256i src0, src1, tmp0, tmp1, dst0;

(=    +{
    DUP2_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src0, src1);
    tmp0 = __lasx_xvpickev_b(src1, src0);
    tmp1 = __lasx_xvpickod_b(src1, src0);
    tmp1 = __java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
    tmp0 = __lasx_xvsrli_b(tmp0, 4);
    dst0 =   (   )java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
     _dst0, 0xD8)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
    __lasx_xvst(dst0, dst_rgb, 0);
    + java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
    src_argb += 64;
  }
}

void ARGBToUV444Row_LASX(const uint8_t* src_argb,
                         uint8_t* dst_u,
                         uint8_t* dst_v,
                         int32_t width) {
  int x;
  int len = width / 32;
_src0,  java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
  __m256i tmp0, tmp1, tmp2, tmp3;
  _     java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
  __m256i const_112 = __lasx_xvldi(112);
  __m256i const_74 = __lasx_xvldi(74);
  _const_38  _38);
  __m256i const_94 = __lasx_xvldi(94);
  __m256i const_18 = __lasx_xvldi(18);
  __m256i const_0x8000 = (__m256i)v4u64{0x8000800080008000, 0x8000800080008000,
                                        0x8000800080008000, 0x8000800080008000};
i  0 java.lang.StringIndexOutOfBoundsException: Range [61, 59) out of bounds for length 80
               }
  for (x = 0; x  java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 41
    java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 77
              96, src0, src1, src2,     tmp3 = __lasx_xvaddwod_h_bu(tmpg, nexgjava.lang.StringIndexOutOfBoundsException: Range [38, 31) out of bounds for length 44
    tmp0 = __    tmp0 = __lasx_xvilvl_w(t;
   java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 41
    tmp2 = __lasx_xvpickev_h(src3, src2);
    tmp3 =_java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 39
    reg0 = __lasx_xvmaddwev_h_bu(const_0x8000, tmp0, const_112);
    reg1  =_java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 48
    reg2 = __dst0 = __lasx_xvshuf_b(tmp1)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
    reg3 = __lasx_xvmulwod_h_bu(    __lasx_xvstelm_d(dst0, dst_u, 8,
    reg2 = __java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 16
    reg3 = __lasx_xvmaddwev_h_bu(reg3,java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    reg0 = __lasx_xvsub_h(reg0, reg2);
    reg1 = __lasx_xvsub_h(reg1, reg3);
    dst0 = __lasx_xvssrani_b_h(reg1, reg0, 8);
    dst0 = __lasx_xvperm_w(dst0, }/java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
    reg0 = __lasx_xvmaddwev_h_bu(const_0x8000, tmp1, const_112);
    reg1 = __lasx_xvmaddwev_h_bu(const_0x8000, tmp3, const_112);
    reg2 = __lasx_xvmulwev_h_bu(tmp0, const_18);
    reg3 = __lasx_xvmulwev_h_bu(tmp2, const_18);
    reg2 = __lasx_xvmaddwod_h_bu(reg2, tmp0, const_94);
    reg3 = __lasx_xvmaddwod_h_bu(reg3, tmp2, const_94);
    reg0 = __lasx_xvsub_h(reg0, reg2);
    reg1 = __lasx_xvsub_h(reg1, reg3);
    dst1 = __lasx_xvssrani_b_h(reg1, reg0, 8);
    dst1 = __lasx_xvperm_w(dst1, control);
    __lasx_xvst(dst0, dst_u, 0);
    __lasx_xvst(dst1, dst_v, 0);
    dst_u += 32;
    dst_v += 32;
    src_argb += 128;
  }
}

void ARGBMultiplyRow_LASX(const uint8_t* src_argb0,
                          const uint8_t* src_argb1,
                          uint8_t* dst_argb,
                          int width) {
  int x;
  int len = width / 8;
  __m256i zero = __lasx_xvldi(0);
  __m256i src0, src1, dst0, dst1;
  __m256i tmp0, tmp1, tmp2, tmp3;

  for (x = 0; x < len; x++) {
    DUP2_ARG2(__lasx_xvld, src_argb0, 0, src_argb1, 0, src0, src1);
    tmp0 = __lasx_xvilvl_b(src0, src0);
    tmp1 = __lasx_xvilvh_b(src0, src0);
    tmp2 = __lasx_xvilvl_b(zero, src1);
    tmp3 = __lasx_xvilvh_b(zero, src1);
    dst0 = __lasx_xvmuh_hu(tmp0, tmp2);
    dst1 = __lasx_xvmuh_hu(tmp1, tmp3);
    dst0 = __lasx_xvpickev_b(dst1, dst0);
    __lasx_xvst(dst0, dst_argb, 0);
    src_argb0 += 32;
    src_argb1 += 32;
    dst_argb += 32;
  }
}

void ARGBAddRow_LASX(const uint8_t* src_argb0,
                     const uint8_t* src_argb1,
                     uint8_t* dst_argb,
                     int width) {
  int x;
  int len = width / 8;
  __m256i src0, src1, dst0;

  for (x = 0; x < len; x++) {
    DUP2_ARG2(__lasx_xvld, src_argb0, 0, src_argb1, 0, src0, src1);
    dst0 = __lasx_xvsadd_bu(src0, src1);
    __lasx_xvst(dst0, dst_argb, 0);
    src_argb0 += 32;
    src_argb1 += 32;
    dst_argb += 32;
  }
}

void ARGBSubtractRow_LASX(const uint8_t* src_argb0,
                          const uint8_t* src_argb1,
                          uint8_t* dst_argb,
                          int width) {
  int x;
  int len = width / 8;
  __m256i src0, src1, dst0;

  for (x = 0; x < len; x++) {
    DUP2_ARG2(__lasx_xvld, src_argb0, 0, src_argb1, 0, src0, src1);
    dst0 = __lasx_xvssub_bu(src0, src1);
    __lasx_xvst(dst0, dst_argb, 0);
    src_argb0 += 32;
    src_argb1 += 32;
    dst_argb += 32;
  }
}

void ARGBAttenuateRow_LASX(const uint8_t* src_argb,
                           uint8_t* dst_argb,
                           int width) {
  int x;
  int len = width / 16;
  __m256i src0, src1, tmp0, tmp1;
  __m256i reg0, reg1, reg2, reg3, reg4, reg5;
  __m256i b, g, r, a, dst0, dst1;
  __m256i control = {0x0005000100040000, 0x0007000300060002, 0x0005000100040000,
                     0x0007000300060002};
  __m256i zero = __lasx_xvldi(0);
  __m256i const_add = __lasx_xvldi(0x8ff);

  for (x = 0; x < len; x++) {
    DUP2_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src0, src1);
    tmp0 = __lasx_xvpickev_b(src1, src0);
    tmp1 = __lasx_xvpickod_b(src1, src0);
    b = __lasx_xvpackev_b(zero, tmp0);
    r = __lasx_xvpackod_b(zero, tmp0);
    g = __lasx_xvpackev_b(zero, tmp1);
    a = __lasx_xvpackod_b(zero, tmp1);
    reg0 = __lasx_xvmaddwev_w_hu(const_add, b, a);
    reg1 = __lasx_xvmaddwod_w_hu(const_add, b, a);
    reg2 = __lasx_xvmaddwev_w_hu(const_add, r, a);
    reg3 = __lasx_xvmaddwod_w_hu(const_add, r, a);
    reg4 = __lasx_xvmaddwev_w_hu(const_add, g, a);
    reg5 = __lasx_xvmaddwod_w_hu(const_add, g, a);
    reg0 = __lasx_xvssrani_h_w(reg1, reg0, 8);
    reg2 = __lasx_xvssrani_h_w(reg3, reg2, 8);
    reg4 = __lasx_xvssrani_h_w(reg5, reg4, 8);
    reg0 = __lasx_xvshuf_h(control, reg0, reg0);
    reg2 = __lasx_xvshuf_h(control, reg2, reg2);
    reg4 = __lasx_xvshuf_h(control, reg4, reg4);
    tmp0 = __lasx_xvpackev_b(reg4, reg0);
    tmp1 = __lasx_xvpackev_b(a, reg2);
    dst0 = __lasx_xvilvl_h(tmp1, tmp0);
    dst1 = __lasx_xvilvh_h(tmp1, tmp0);
    __lasx_xvst(dst0, dst_argb, 0);
    __lasx_xvst(dst1, dst_argb, 32);
    dst_argb += 64;
    src_argb += 64;
  }
}

void ARGBToRGB565DitherRow_LASX(const uint8_t* src_argb,
                                uint8_t* dst_rgb,
                                uint32_t dither4,
                                int width) {
  int x;
  int len = width / 16;
  __m256i src0, src1, tmp0, tmp1, dst0;
  __m256i b, g, r;
  __m256i zero = __lasx_xvldi(0);
  __m256i vec_dither = __lasx_xvldrepl_w(&dither4, 0);

  vec_dither = __lasx_xvilvl_b(zero, vec_dither);
  for (x = 0; x < len; x++) {
    DUP2_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src0, src1);
    tmp0 = __lasx_xvpickev_b(src1, src0);
    tmp1 = __lasx_xvpickod_b(src1, src0);
    b = __lasx_xvpackev_b(zero, tmp0);
    r = __lasx_xvpackod_b(zero, tmp0);
    g = __lasx_xvpackev_b(zero, tmp1);
    b = __lasx_xvadd_h(b, vec_dither);
    g = __lasx_xvadd_h(g, vec_dither);
    r = __lasx_xvadd_h(r, vec_dither);
    DUP2_ARG1(__lasx_xvclip255_h, b, g, b, g);
    r = __lasx_xvclip255_h(r);
    b = __lasx_xvsrai_h(b, 3);
    g = __lasx_xvsrai_h(g, 2);
    r = __lasx_xvsrai_h(r, 3);
    g = __lasx_xvslli_h(g, 5);
    r = __lasx_xvslli_h(r, 11);
    dst0 = __lasx_xvor_v(b, g);
    dst0 = __lasx_xvor_v(dst0, r);
    dst0 = __lasx_xvpermi_d(dst0, 0xD8);
    __lasx_xvst(dst0, dst_rgb, 0);
    src_argb += 64;
    dst_rgb += 32;
  }
}

void ARGBShuffleRow_LASX(const uint8_t* src_argb,
                         uint8_t* dst_argb,
                         const uint8_t* shuffler,
                         int width) {
  int x;
  int len = width / 16;
  __m256i src0, src1, dst0, dst1;
  __m256i shuf = {0x0404040400000000, 0x0C0C0C0C08080808, 0x0404040400000000,
                  0x0C0C0C0C08080808};
  __m256i temp = __lasx_xvldrepl_w(shuffler, 0);

  shuf = __lasx_xvadd_b(shuf, temp);
  for (x = 0; x < len; x++) {
    DUP2_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src0, src1);
    dst0 = __lasx_xvshuf_b(src0, src0, shuf);
    dst1 = __lasx_xvshuf_b(src1, src1, shuf);
    __lasx_xvst(dst0, dst_argb, 0);
    __lasx_xvst(dst1, dst_argb, 32);
    src_argb += 64;
    dst_argb += 64;
  }
}

void ARGBShadeRow_LASX(const uint8_t* src_argb,
                       uint8_t* dst_argb,
                       int width,
                       uint32_t value) {
  int x;
  int len = width / 8;
  __m256i src0, dst0, tmp0, tmp1;
  __m256i vec_value = __lasx_xvreplgr2vr_w(value);

  vec_value = __lasx_xvilvl_b(vec_value, vec_value);
  for (x = 0; x < len; x++) {
    src0 = __lasx_xvld(src_argb, 0);
    tmp0 = __lasx_xvilvl_b(src0, src0);
    tmp1 = __lasx_xvilvh_b(src0, src0);
    tmp0 = __lasx_xvmuh_hu(tmp0, vec_value);
    tmp1 = __lasx_xvmuh_hu(tmp1, vec_value);
    dst0 = __lasx_xvpickod_b(tmp1, tmp0);
    __lasx_xvst(dst0, dst_argb, 0);
    src_argb += 32;
    dst_argb += 32;
  }
}

void ARGBGrayRow_LASX(const uint8_t* src_argb, uint8_t* dst_argb, int width) {
  int x;
  int len = width / 16;
  __m256i src0, src1, tmp0, tmp1;
  __m256i reg0, reg1, reg2, dst0, dst1;
  __m256i const_128 = __lasx_xvldi(0x480);
  __m256i const_150 = __lasx_xvldi(0x96);
  __m256i const_br = {0x4D1D4D1D4D1D4D1D, 0x4D1D4D1D4D1D4D1D,
                      0x4D1D4D1D4D1D4D1D, 0x4D1D4D1D4D1D4D1D};

  for (x = 0; x < len; x++) {
    DUP2_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src0, src1);
    tmp0 = __lasx_xvpickev_b(src1, src0);
    tmp1 = __lasx_xvpickod_b(src1, src0);
    reg0 = __lasx_xvdp2_h_bu(tmp0, const_br);
    reg1 = __lasx_xvmaddwev_h_bu(const_128, tmp1, const_150);
    reg2 = __lasx_xvadd_h(reg0, reg1);
    tmp0 = __lasx_xvpackod_b(reg2, reg2);
    tmp1 = __lasx_xvpackod_b(tmp1, reg2);
    dst0 = __lasx_xvilvl_h(tmp1, tmp0);
    dst1 = __lasx_xvilvh_h(tmp1, tmp0);
    __lasx_xvst(dst0, dst_argb, 0);
    __lasx_xvst(dst1, dst_argb, 32);
    src_argb += 64;
    dst_argb += 64;
  }
}

void ARGBSepiaRow_LASX(uint8_t* dst_argb, int width) {
  int x;
  int len = width / 16;
  __m256i src0, src1, tmp0, tmp1;
  __m256i reg0, reg1, spb, spg, spr;
  __m256i dst0, dst1;
  __m256i spb_g = __lasx_xvldi(68);
  __m256i spg_g = __lasx_xvldi(88);
  __m256i spr_g = __lasx_xvldi(98);
  __m256i spb_br = {0x2311231123112311, 0x2311231123112311, 0x2311231123112311,
                    0x2311231123112311};
  __m256i spg_br = {0x2D162D162D162D16, 0x2D162D162D162D16, 0x2D162D162D162D16,
                    0x2D162D162D162D16};
  __m256i spr_br = {0x3218321832183218, 0x3218321832183218, 0x3218321832183218,
                    0x3218321832183218};
  __m256i shuff = {0x1706150413021100, 0x1F0E1D0C1B0A1908, 0x1706150413021100,
                   0x1F0E1D0C1B0A1908};

  for (x = 0; x < len; x++) {
    DUP2_ARG2(__lasx_xvld, dst_argb, 0, dst_argb, 32, src0, src1);
    tmp0 = __lasx_xvpickev_b(src1, src0);
    tmp1 = __lasx_xvpickod_b(src1, src0);
    DUP2_ARG2(__lasx_xvdp2_h_bu, tmp0, spb_br, tmp0, spg_br, spb, spg);
    spr = __lasx_xvdp2_h_bu(tmp0, spr_br);
    spb = __lasx_xvmaddwev_h_bu(spb, tmp1, spb_g);
    spg = __lasx_xvmaddwev_h_bu(spg, tmp1, spg_g);
    spr = __lasx_xvmaddwev_h_bu(spr, tmp1, spr_g);
    spb = __lasx_xvsrli_h(spb, 7);
    spg = __lasx_xvsrli_h(spg, 7);
    spr = __lasx_xvsrli_h(spr, 7);
    spg = __lasx_xvsat_hu(spg, 7);
    spr = __lasx_xvsat_hu(spr, 7);
    reg0 = __lasx_xvpackev_b(spg, spb);
    reg1 = __lasx_xvshuf_b(tmp1, spr, shuff);
    dst0 = __lasx_xvilvl_h(reg1, reg0);
    dst1 = __lasx_xvilvh_h(reg1, reg0);
    __lasx_xvst(dst0, dst_argb, 0);
    __lasx_xvst(dst1, dst_argb, 32);
    dst_argb += 64;
  }
}

void ARGB4444ToARGBRow_LASX(const uint8_t* src_argb4444,
                            uint8_t* dst_argb,
                            int width) {
  int x;
  int len = width / 32;
  __m256i src0, src1;
  __m256i tmp0, tmp1, tmp2, tmp3;
  __m256i reg0, reg1, reg2, reg3;
  __m256i dst0, dst1, dst2, dst3;

  for (x = 0; x < len; x++) {
    src0 = __lasx_xvld(src_argb4444, 0);
    src1 = __lasx_xvld(src_argb4444, 32);
    DUP4_ARG2(__lasx_xvandi_b, src0, 0x0F, src0, 0xF0, src1, 0x0F, src1, 0xF0,
              tmp0, tmp1, tmp2, tmp3);
    DUP2_ARG2(__lasx_xvslli_b, tmp0, 4, tmp2, 4, reg0, reg2);
    DUP2_ARG2(__lasx_xvsrli_b, tmp1, 4, tmp3, 4, reg1, reg3);
    DUP4_ARG2(__lasx_xvor_v, tmp0, reg0, tmp1, reg1, tmp2, reg2, tmp3, reg3,
              tmp0, tmp1, tmp2, tmp3);
    DUP2_ARG2(__lasx_xvilvl_b, tmp1, tmp0, tmp3, tmp2, reg0, reg2);
    DUP2_ARG2(__lasx_xvilvh_b, tmp1, tmp0, tmp3, tmp2, reg1, reg3);
    DUP4_ARG3(__lasx_xvpermi_q, reg1, reg0, 0x20, reg1, reg0, 0x31, reg3, reg2,
              0x20, reg3, reg2, 0x31, dst0, dst1, dst2, dst3);
    __lasx_xvst(dst0, dst_argb, 0);
    __lasx_xvst(dst1, dst_argb, 32);
    __lasx_xvst(dst2, dst_argb, 64);
    __lasx_xvst(dst3, dst_argb, 96);
    src_argb4444 += 64;
    dst_argb += 128;
  }
}

void ARGB1555ToARGBRow_LASX(const uint8_t* src_argb1555,
                            uint8_t* dst_argb,
                            int width) {
  int x;
  int len = width / 32;
  __m256i src0, src1;
  __m256i tmp0, tmp1, tmpb, tmpg, tmpr, tmpa;
  __m256i reg0, reg1, reg2, reg3;
  __m256i dst0, dst1, dst2, dst3;

  for (x = 0; x < len; x++) {
    src0 = __lasx_xvld(src_argb1555, 0);
    src1 = __lasx_xvld(src_argb1555, 32);
    tmp0 = __lasx_xvpickev_b(src1, src0);
    tmp1 = __lasx_xvpickod_b(src1, src0);
    tmpb = __lasx_xvandi_b(tmp0, 0x1F);
    tmpg = __lasx_xvsrli_b(tmp0, 5);
    reg0 = __lasx_xvandi_b(tmp1, 0x03);
    reg0 = __lasx_xvslli_b(reg0, 3);
    tmpg = __lasx_xvor_v(tmpg, reg0);
    reg1 = __lasx_xvandi_b(tmp1, 0x7C);
    tmpr = __lasx_xvsrli_b(reg1, 2);
    tmpa = __lasx_xvsrli_b(tmp1, 7);
    tmpa = __lasx_xvneg_b(tmpa);
    reg0 = __lasx_xvslli_b(tmpb, 3);
    reg1 = __lasx_xvslli_b(tmpg, 3);
    reg2 = __lasx_xvslli_b(tmpr, 3);
    tmpb = __lasx_xvsrli_b(tmpb, 2);
    tmpg = __lasx_xvsrli_b(tmpg, 2);
    tmpr = __lasx_xvsrli_b(tmpr, 2);
    tmpb = __lasx_xvor_v(reg0, tmpb);
    tmpg = __lasx_xvor_v(reg1, tmpg);
    tmpr = __lasx_xvor_v(reg2, tmpr);
    DUP2_ARG2(__lasx_xvilvl_b, tmpg, tmpb, tmpa, tmpr, reg0, reg1);
    DUP2_ARG2(__lasx_xvilvh_b, tmpg, tmpb, tmpa, tmpr, reg2, reg3);
    dst0 = __lasx_xvilvl_h(reg1, reg0);
    dst1 = __lasx_xvilvh_h(reg1, reg0);
    dst2 = __lasx_xvilvl_h(reg3, reg2);
    dst3 = __lasx_xvilvh_h(reg3, reg2);
    DUP4_ARG3(__lasx_xvpermi_q, dst1, dst0, 0x20, dst1, dst0, 0x31, dst3, dst2,
              0x20, dst3, dst2, 0x31, reg0, reg1, reg2, reg3);
    __lasx_xvst(reg0, dst_argb, 0);
    __lasx_xvst(reg1, dst_argb, 32);
    __lasx_xvst(reg2, dst_argb, 64);
    __lasx_xvst(reg3, dst_argb, 96);
    src_argb1555 += 64;
    dst_argb += 128;
  }
}

void RGB565ToARGBRow_LASX(const uint8_t* src_rgb565,
                          uint8_t* dst_argb,
                          int width) {
  int x;
  int len = width / 32;
  __m256i src0, src1;
  __m256i tmp0, tmp1, tmpb, tmpg, tmpr;
  __m256i reg0, reg1, reg2, reg3, dst0, dst1, dst2, dst3;
  __m256i alpha = __lasx_xvldi(0xFF);

  for (x = 0; x < len; x++) {
    src0 = __lasx_xvld(src_rgb565, 0);
    src1 = __lasx_xvld(src_rgb565, 32);
    tmp0 = __lasx_xvpickev_b(src1, src0);
    tmp1 = __lasx_xvpickod_b(src1, src0);
    tmpb = __lasx_xvandi_b(tmp0, 0x1F);
    tmpr = __lasx_xvandi_b(tmp1, 0xF8);
    reg1 = __lasx_xvandi_b(tmp1, 0x07);
    reg0 = __lasx_xvsrli_b(tmp0, 5);
    reg1 = __lasx_xvslli_b(reg1, 3);
    tmpg = __lasx_xvor_v(reg1, reg0);
    reg0 = __lasx_xvslli_b(tmpb, 3);
    reg1 = __lasx_xvsrli_b(tmpb, 2);
    tmpb = __lasx_xvor_v(reg1, reg0);
    reg0 = __lasx_xvslli_b(tmpg, 2);
    reg1 = __lasx_xvsrli_b(tmpg, 4);
    tmpg = __lasx_xvor_v(reg1, reg0);
    reg0 = __lasx_xvsrli_b(tmpr, 5);
    tmpr = __lasx_xvor_v(tmpr, reg0);
    DUP2_ARG2(__lasx_xvilvl_b, tmpg, tmpb, alpha, tmpr, reg0, reg1);
    dst0 = __lasx_xvilvl_h(reg1, reg0);
    dst1 = __lasx_xvilvh_h(reg1, reg0);
    DUP2_ARG2(__lasx_xvilvh_b, tmpg, tmpb, alpha, tmpr, reg0, reg1);
    dst2 = __lasx_xvilvl_h(reg1, reg0);
    dst3 = __lasx_xvilvh_h(reg1, reg0);
    DUP4_ARG3(__lasx_xvpermi_q, dst1, dst0, 0x20, dst1, dst0, 0x31, dst3, dst2,
              0x20, dst3, dst2, 0x31, reg0, reg1, reg2, reg3);
    __lasx_xvst(reg0, dst_argb, 0);
    __lasx_xvst(reg1, dst_argb, 32);
    __lasx_xvst(reg2, dst_argb, 64);
    __lasx_xvst(reg3, dst_argb, 96);
    src_rgb565 += 64;
    dst_argb += 128;
  }
}

void RGB24ToARGBRow_LASX(const uint8_t* src_rgb24,
                         uint8_t* dst_argb,
                         int width) {
  int x;
  int len = width / 32;
  __m256i src0, src1, src2;
  __m256i tmp0, tmp1, tmp2;
  __m256i dst0, dst1, dst2, dst3;
  __m256i reg0, reg1, reg2, reg3;
  __m256i alpha = __lasx_xvldi(0xFF);
  __m256i shuf0 = {0x131211100F0E0D0C, 0x1B1A191817161514, 0x131211100F0E0D0C,
                   0x1B1A191817161514};
  __m256i shuf1 = {0x1F1E1D1C1B1A1918, 0x0706050403020100, 0x1F1E1D1C1B1A1918,
                   0x0706050403020100};
  __m256i shuf2 = {0x0B0A090807060504, 0x131211100F0E0D0C, 0x0B0A090807060504,
                   0x131211100F0E0D0C};
  __m256i shuf3 = {0x1005040310020100, 0x100B0A0910080706, 0x1005040310020100,
                   0x100B0A0910080706};

  for (x = 0; x < len; x++) {
    reg0 = __lasx_xvld(src_rgb24, 0);
    reg1 = __lasx_xvld(src_rgb24, 32);
    reg2 = __lasx_xvld(src_rgb24, 64);
    src0 = __lasx_xvpermi_q(reg1, reg0, 0x30);
    src1 = __lasx_xvpermi_q(reg2, reg0, 0x21);
    src2 = __lasx_xvpermi_q(reg2, reg1, 0x30);
    DUP2_ARG3(__lasx_xvshuf_b, src1, src0, shuf0, src1, src2, shuf1, tmp0,
              tmp1);
    tmp2 = __lasx_xvshuf_b(src1, src2, shuf2);
    DUP4_ARG3(__lasx_xvshuf_b, alpha, src0, shuf3, alpha, tmp0, shuf3, alpha,
              tmp1, shuf3, alpha, tmp2, shuf3, reg0, reg1, reg2, reg3);
    DUP4_ARG3(__lasx_xvpermi_q, reg1, reg0, 0x20, reg3, reg2, 0x20, reg1, reg0,
              0x31, reg3, reg2, 0x31, dst0, dst1, dst2, dst3);
    __lasx_xvst(dst0, dst_argb, 0);
    __lasx_xvst(dst1, dst_argb, 32);
    __lasx_xvst(dst2, dst_argb, 64);
    __lasx_xvst(dst3, dst_argb, 96);
    src_rgb24 += 96;
    dst_argb += 128;
  }
}

void RAWToARGBRow_LASX(const uint8_t* src_raw, uint8_t* dst_argb, int width) {
  int x;
  int len = width / 32;
  __m256i src0, src1, src2;
  __m256i tmp0, tmp1, tmp2, reg0, reg1, reg2, reg3;
  __m256i dst0, dst1, dst2, dst3;
  __m256i alpha = __lasx_xvldi(0xFF);
  __m256i shuf0 = {0x131211100F0E0D0C, 0x1B1A191817161514, 0x131211100F0E0D0C,
                   0x1B1A191817161514};
  __m256i shuf1 = {0x1F1E1D1C1B1A1918, 0x0706050403020100, 0x1F1E1D1C1B1A1918,
                   0x0706050403020100};
  __m256i shuf2 = {0x0B0A090807060504, 0x131211100F0E0D0C, 0x0B0A090807060504,
                   0x131211100F0E0D0C};
  __m256i shuf3 = {0x1003040510000102, 0x10090A0B10060708, 0x1003040510000102,
                   0x10090A0B10060708};

  for (x = 0; x < len; x++) {
    reg0 = __lasx_xvld(src_raw, 0);
    reg1 = __lasx_xvld(src_raw, 32);
    reg2 = __lasx_xvld(src_raw, 64);
    src0 = __lasx_xvpermi_q(reg1, reg0, 0x30);
    src1 = __lasx_xvpermi_q(reg2, reg0, 0x21);
    src2 = __lasx_xvpermi_q(reg2, reg1, 0x30);
    DUP2_ARG3(__lasx_xvshuf_b, src1, src0, shuf0, src1, src2, shuf1, tmp0,
              tmp1);
    tmp2 = __lasx_xvshuf_b(src1, src2, shuf2);
    DUP4_ARG3(__lasx_xvshuf_b, alpha, src0, shuf3, alpha, tmp0, shuf3, alpha,
              tmp1, shuf3, alpha, tmp2, shuf3, reg0, reg1, reg2, reg3);
    DUP4_ARG3(__lasx_xvpermi_q, reg1, reg0, 0x20, reg3, reg2, 0x20, reg1, reg0,
              0x31, reg3, reg2, 0x31, dst0, dst1, dst2, dst3);
    __lasx_xvst(dst0, dst_argb, 0);
    __lasx_xvst(dst1, dst_argb, 32);
    __lasx_xvst(dst2, dst_argb, 64);
    __lasx_xvst(dst3, dst_argb, 96);
    src_raw += 96;
    dst_argb += 128;
  }
}

void ARGB1555ToYRow_LASX(const uint8_t* src_argb1555,
                         uint8_t* dst_y,
                         int width) {
  int x;
  int len = width / 32;
  __m256i src0, src1;
  __m256i tmp0, tmp1, tmpb, tmpg, tmpr;
  __m256i reg0, reg1, reg2, dst0;
  __m256i const_66 = __lasx_xvldi(66);
  __m256i const_129 = __lasx_xvldi(129);
  __m256i const_25 = __lasx_xvldi(25);
  __m256i const_1080 = {0x1080108010801080, 0x1080108010801080,
                        0x1080108010801080, 0x1080108010801080};

  for (x = 0; x < len; x++) {
    src0 = __lasx_xvld(src_argb1555, 0);
    src1 = __lasx_xvld(src_argb1555, 32);
    tmp0 = __lasx_xvpickev_b(src1, src0);
    tmp1 = __lasx_xvpickod_b(src1, src0);
    tmpb = __lasx_xvandi_b(tmp0, 0x1F);
    tmpg = __lasx_xvsrli_b(tmp0, 5);
    reg0 = __lasx_xvandi_b(tmp1, 0x03);
    reg0 = __lasx_xvslli_b(reg0, 3);
    tmpg = __lasx_xvor_v(tmpg, reg0);
    reg1 = __lasx_xvandi_b(tmp1, 0x7C);
    tmpr = __lasx_xvsrli_b(reg1, 2);
    reg0 = __lasx_xvslli_b(tmpb, 3);
    reg1 = __lasx_xvslli_b(tmpg, 3);
    reg2 = __lasx_xvslli_b(tmpr, 3);
    tmpb = __lasx_xvsrli_b(tmpb, 2);
    tmpg = __lasx_xvsrli_b(tmpg, 2);
    tmpr = __lasx_xvsrli_b(tmpr, 2);
    tmpb = __lasx_xvor_v(reg0, tmpb);
    tmpg = __lasx_xvor_v(reg1, tmpg);
    tmpr = __lasx_xvor_v(reg2, tmpr);
    reg0 = __lasx_xvmaddwev_h_bu(const_1080, tmpb, const_25);
    reg1 = __lasx_xvmaddwod_h_bu(const_1080, tmpb, const_25);
    reg0 = __lasx_xvmaddwev_h_bu(reg0, tmpg, const_129);
    reg1 = __lasx_xvmaddwod_h_bu(reg1, tmpg, const_129);
    reg0 = __lasx_xvmaddwev_h_bu(reg0, tmpr, const_66);
    reg1 = __lasx_xvmaddwod_h_bu(reg1, tmpr, const_66);
    dst0 = __lasx_xvpackod_b(reg1, reg0);
    dst0 = __lasx_xvpermi_d(dst0, 0xD8);
    __lasx_xvst(dst0, dst_y, 0);
    src_argb1555 += 64;
    dst_y += 32;
  }
}

void ARGB1555ToUVRow_LASX(const uint8_t* src_argb1555,
                          int src_stride_argb1555,
                          uint8_t* dst_u,
                          uint8_t* dst_v,
                          int width) {
  int x;
  int len = width / 32;
  const uint8_t* next_argb1555 = src_argb1555 + src_stride_argb1555;
  __m256i src0, src1, src2, src3;
  __m256i tmp0, tmp1, tmp2, tmp3;
  __m256i tmpb, tmpg, tmpr, nexb, nexg, nexr;
  __m256i reg0, reg1, reg2, reg3, dst0;
  __m256i const_112 = __lasx_xvldi(0x470);
  __m256i const_74 = __lasx_xvldi(0x44A);
  __m256i const_38 = __lasx_xvldi(0x426);
  __m256i const_94 = __lasx_xvldi(0x45E);
  __m256i const_18 = __lasx_xvldi(0x412);
  __m256i const_8000 = (__m256i)v4u64{0x8000800080008000, 0x8000800080008000,
                                      0x8000800080008000, 0x8000800080008000};

  for (x = 0; x < len; x++) {
    DUP4_ARG2(__lasx_xvld, src_argb1555, 0, src_argb1555, 32, next_argb1555, 0,
              next_argb1555, 32, src0, src1, src2, src3);
    DUP2_ARG2(__lasx_xvpickev_b, src1, src0, src3, src2, tmp0, tmp2);
    DUP2_ARG2(__lasx_xvpickod_b, src1, src0, src3, src2, tmp1, tmp3);
    tmpb = __lasx_xvandi_b(tmp0, 0x1F);
    nexb = __lasx_xvandi_b(tmp2, 0x1F);
    tmpg = __lasx_xvsrli_b(tmp0, 5);
    nexg = __lasx_xvsrli_b(tmp2, 5);
    reg0 = __lasx_xvandi_b(tmp1, 0x03);
    reg2 = __lasx_xvandi_b(tmp3, 0x03);
    reg0 = __lasx_xvslli_b(reg0, 3);
    reg2 = __lasx_xvslli_b(reg2, 3);
    tmpg = __lasx_xvor_v(tmpg, reg0);
    nexg = __lasx_xvor_v(nexg, reg2);
    reg1 = __lasx_xvandi_b(tmp1, 0x7C);
    reg3 = __lasx_xvandi_b(tmp3, 0x7C);
    tmpr = __lasx_xvsrli_b(reg1, 2);
    nexr = __lasx_xvsrli_b(reg3, 2);
    reg0 = __lasx_xvslli_b(tmpb, 3);
    reg1 = __lasx_xvslli_b(tmpg, 3);
    reg2 = __lasx_xvslli_b(tmpr, 3);
    tmpb = __lasx_xvsrli_b(tmpb, 2);
    tmpg = __lasx_xvsrli_b(tmpg, 2);
    tmpr = __lasx_xvsrli_b(tmpr, 2);
    tmpb = __lasx_xvor_v(reg0, tmpb);
    tmpg = __lasx_xvor_v(reg1, tmpg);
    tmpr = __lasx_xvor_v(reg2, tmpr);
    reg0 = __lasx_xvslli_b(nexb, 3);
    reg1 = __lasx_xvslli_b(nexg, 3);
    reg2 = __lasx_xvslli_b(nexr, 3);
    nexb = __lasx_xvsrli_b(nexb, 2);
    nexg = __lasx_xvsrli_b(nexg, 2);
    nexr = __lasx_xvsrli_b(nexr, 2);
    nexb = __lasx_xvor_v(reg0, nexb);
    nexg = __lasx_xvor_v(reg1, nexg);
    nexr = __lasx_xvor_v(reg2, nexr);
    RGBTOUV(tmpb, tmpg, tmpr, nexb, nexg, nexr, reg0, reg1);
    reg0 = __lasx_xvpermi_d(reg0, 0xD8);
    reg1 = __lasx_xvpermi_d(reg1, 0xD8);
    dst0 = __lasx_xvpickod_b(reg1, reg0);
    __lasx_xvstelm_d(dst0, dst_u, 0, 0);
    __lasx_xvstelm_d(dst0, dst_v, 0, 1);
    __lasx_xvstelm_d(dst0, dst_u, 8, 2);
    __lasx_xvstelm_d(dst0, dst_v, 8, 3);
    src_argb1555 += 64;
    next_argb1555 += 64;
    dst_u += 16;
    dst_v += 16;
  }
}

void RGB565ToYRow_LASX(const uint8_t* src_rgb565, uint8_t* dst_y, int width) {
  int x;
  int len = width / 32;
  __m256i src0, src1;
  __m256i tmp0, tmp1, tmpb, tmpg, tmpr;
  __m256i reg0, reg1, dst0;
  __m256i const_66 = __lasx_xvldi(66);
  __m256i const_129 = __lasx_xvldi(129);
  __m256i const_25 = __lasx_xvldi(25);
  __m256i const_1080 = {0x1080108010801080, 0x1080108010801080,
                        0x1080108010801080, 0x1080108010801080};

  for (x = 0; x < len; x++) {
    src0 = __lasx_xvld(src_rgb565, 0);
    src1 = __lasx_xvld(src_rgb565, 32);
    tmp0 = __lasx_xvpickev_b(src1, src0);
    tmp1 = __lasx_xvpickod_b(src1, src0);
    tmpb = __lasx_xvandi_b(tmp0, 0x1F);
    tmpr = __lasx_xvandi_b(tmp1, 0xF8);
    reg1 = __lasx_xvandi_b(tmp1, 0x07);
    reg0 = __lasx_xvsrli_b(tmp0, 5);
    reg1 = __lasx_xvslli_b(reg1, 3);
    tmpg = __lasx_xvor_v(reg1, reg0);
    reg0 = __lasx_xvslli_b(tmpb, 3);
    reg1 = __lasx_xvsrli_b(tmpb, 2);
    tmpb = __lasx_xvor_v(reg1, reg0);
    reg0 = __lasx_xvslli_b(tmpg, 2);
    reg1 = __lasx_xvsrli_b(tmpg, 4);
    tmpg = __lasx_xvor_v(reg1, reg0);
    reg0 = __lasx_xvsrli_b(tmpr, 5);
    tmpr = __lasx_xvor_v(tmpr, reg0);
    reg0 = __lasx_xvmaddwev_h_bu(const_1080, tmpb, const_25);
    reg1 = __lasx_xvmaddwod_h_bu(const_1080, tmpb, const_25);
    reg0 = __lasx_xvmaddwev_h_bu(reg0, tmpg, const_129);
    reg1 = __lasx_xvmaddwod_h_bu(reg1, tmpg, const_129);
    reg0 = __lasx_xvmaddwev_h_bu(reg0, tmpr, const_66);
    reg1 = __lasx_xvmaddwod_h_bu(reg1, tmpr, const_66);
    dst0 = __lasx_xvpackod_b(reg1, reg0);
    dst0 = __lasx_xvpermi_d(dst0, 0xD8);
    __lasx_xvst(dst0, dst_y, 0);
    dst_y += 32;
    src_rgb565 += 64;
  }
}

void RGB565ToUVRow_LASX(const uint8_t* src_rgb565,
                        int src_stride_rgb565,
                        uint8_t* dst_u,
                        uint8_t* dst_v,
                        int width) {
  int x;
  int len = width / 32;
  const uint8_t* next_rgb565 = src_rgb565 + src_stride_rgb565;
  __m256i src0, src1, src2, src3;
  __m256i tmp0, tmp1, tmp2, tmp3;
  __m256i tmpb, tmpg, tmpr, nexb, nexg, nexr;
  __m256i reg0, reg1, reg2, reg3, dst0;
  __m256i const_112 = __lasx_xvldi(0x470);
  __m256i const_74 = __lasx_xvldi(0x44A);
  __m256i const_38 = __lasx_xvldi(0x426);
  __m256i const_94 = __lasx_xvldi(0x45E);
  __m256i const_18 = __lasx_xvldi(0x412);
  __m256i const_8000 = (__m256i)v4u64{0x8000800080008000, 0x8000800080008000,
                                      0x8000800080008000, 0x8000800080008000};

  for (x = 0; x < len; x++) {
    DUP4_ARG2(__lasx_xvld, src_rgb565, 0, src_rgb565, 32, next_rgb565, 0,
              next_rgb565, 32, src0, src1, src2, src3);
    DUP2_ARG2(__lasx_xvpickev_b, src1, src0, src3, src2, tmp0, tmp2);
    DUP2_ARG2(__lasx_xvpickod_b, src1, src0, src3, src2, tmp1, tmp3);
    tmpb = __lasx_xvandi_b(tmp0, 0x1F);
    tmpr = __lasx_xvandi_b(tmp1, 0xF8);
    nexb = __lasx_xvandi_b(tmp2, 0x1F);
    nexr = __lasx_xvandi_b(tmp3, 0xF8);
    reg1 = __lasx_xvandi_b(tmp1, 0x07);
    reg3 = __lasx_xvandi_b(tmp3, 0x07);
    reg0 = __lasx_xvsrli_b(tmp0, 5);
    reg1 = __lasx_xvslli_b(reg1, 3);
    reg2 = __lasx_xvsrli_b(tmp2, 5);
    reg3 = __lasx_xvslli_b(reg3, 3);
    tmpg = __lasx_xvor_v(reg1, reg0);
    nexg = __lasx_xvor_v(reg2, reg3);
    reg0 = __lasx_xvslli_b(tmpb, 3);
    reg1 = __lasx_xvsrli_b(tmpb, 2);
    reg2 = __lasx_xvslli_b(nexb, 3);
    reg3 = __lasx_xvsrli_b(nexb, 2);
    tmpb = __lasx_xvor_v(reg1, reg0);
    nexb = __lasx_xvor_v(reg2, reg3);
    reg0 = __lasx_xvslli_b(tmpg, 2);
    reg1 = __lasx_xvsrli_b(tmpg, 4);
    reg2 = __lasx_xvslli_b(nexg, 2);
    reg3 = __lasx_xvsrli_b(nexg, 4);
    tmpg = __lasx_xvor_v(reg1, reg0);
    nexg = __lasx_xvor_v(reg2, reg3);
    reg0 = __lasx_xvsrli_b(tmpr, 5);
    reg2 = __lasx_xvsrli_b(nexr, 5);
    tmpr = __lasx_xvor_v(tmpr, reg0);
    nexr = __lasx_xvor_v(nexr, reg2);
    RGBTOUV(tmpb, tmpg, tmpr, nexb, nexg, nexr, reg0, reg1);
    reg0 = __lasx_xvpermi_d(reg0, 0xD8);
    reg1 = __lasx_xvpermi_d(reg1, 0xD8);
    dst0 = __lasx_xvpickod_b(reg1, reg0);
    __lasx_xvstelm_d(dst0, dst_u, 0, 0);
    __lasx_xvstelm_d(dst0, dst_v, 0, 1);
    __lasx_xvstelm_d(dst0, dst_u, 8, 2);
    __lasx_xvstelm_d(dst0, dst_v, 8, 3);
    dst_u += 16;
    dst_v += 16;
    src_rgb565 += 64;
    next_rgb565 += 64;
  }
}

void RGB24ToUVRow_LASX(const uint8_t* src_rgb24,
                       int src_stride_rgb24,
                       uint8_t* dst_u,
                       uint8_t* dst_v,
                       int width) {
  int x;
  const uint8_t* next_rgb24 = src_rgb24 + src_stride_rgb24;
  int len = width / 32;
  __m256i src0, src1, src2, reg0, reg1, reg2;
  __m256i nex0, nex1, nex2, dst0, tmp0, tmp1, tmp2;
  __m256i tmpb, tmpg, tmpr, nexb, nexg, nexr;
  __m256i const_112 = __lasx_xvldi(0x470);
  __m256i const_74 = __lasx_xvldi(0x44A);
  __m256i const_38 = __lasx_xvldi(0x426);
  __m256i const_94 = __lasx_xvldi(0x45E);
  __m256i const_18 = __lasx_xvldi(0x412);
  __m256i const_8000 = (__m256i)v4u64{0x8000800080008000, 0x8000800080008000,
                                      0x8000800080008000, 0x8000800080008000};
  __m256i shuff0_b = {0x15120F0C09060300, 0x00000000001E1B18,
                      0x15120F0C09060300, 0x00000000001E1B18};
  __m256i shuff1_b = {0x0706050403020100, 0x1D1A1714110A0908,
                      0x0706050403020100, 0x1D1A1714110A0908};
  __m256i shuff0_g = {0x1613100D0A070401, 0x00000000001F1C19,
                      0x1613100D0A070401, 0x00000000001F1C19};
  __m256i shuff1_g = {0x0706050403020100, 0x1E1B1815120A0908,
                      0x0706050403020100, 0x1E1B1815120A0908};
  __m256i shuff0_r = {0x1714110E0B080502, 0x0000000000001D1A,
                      0x1714110E0B080502, 0x0000000000001D1A};
  __m256i shuff1_r = {0x0706050403020100, 0x1F1C191613100908,
                      0x0706050403020100, 0x1F1C191613100908};

  for (x = 0; x < len; x++) {
    DUP4_ARG2(__lasx_xvld, src_rgb24, 0, src_rgb24, 32, src_rgb24, 64,
              next_rgb24, 0, reg0, reg1, reg2, tmp0);
    DUP2_ARG2(__lasx_xvld, next_rgb24, 32, next_rgb24, 64, tmp1, tmp2);
    DUP4_ARG3(__lasx_xvpermi_q, reg1, reg0, 0x30, reg2, reg0, 0x21, reg2, reg1,
              0x30, tmp1, tmp0, 0x30, src0, src1, src2, nex0);
    DUP2_ARG3(__lasx_xvpermi_q, tmp2, tmp0, 0x21, tmp2, tmp1, 0x30, nex1, nex2);
    DUP2_ARG3(__lasx_xvshuf_b, src1, src0, shuff0_b, nex1, nex0, shuff0_b, tmpb,
              nexb);
    DUP2_ARG3(__lasx_xvshuf_b, src1, src0, shuff0_g, nex1, nex0, shuff0_g, tmpg,
              nexg);
    DUP2_ARG3(__lasx_xvshuf_b, src1, src0, shuff0_r, nex1, nex0, shuff0_r, tmpr,
              nexr);
    DUP2_ARG3(__lasx_xvshuf_b, src2, tmpb, shuff1_b, nex2, nexb, shuff1_b, tmpb,
              nexb);
    DUP2_ARG3(__lasx_xvshuf_b, src2, tmpg, shuff1_g, nex2, nexg, shuff1_g, tmpg,
              nexg);
    DUP2_ARG3(__lasx_xvshuf_b, src2, tmpr, shuff1_r, nex2, nexr, shuff1_r, tmpr,
              nexr);
    RGBTOUV(tmpb, tmpg, tmpr, nexb, nexg, nexr, reg0, reg1);
    dst0 = __lasx_xvpickod_b(reg1, reg0);
    __lasx_xvstelm_d(dst0, dst_u, 0, 0);
    __lasx_xvstelm_d(dst0, dst_v, 0, 1);
    __lasx_xvstelm_d(dst0, dst_u, 8, 2);
    __lasx_xvstelm_d(dst0, dst_v, 8, 3);
    src_rgb24 += 96;
    next_rgb24 += 96;
    dst_u += 16;
    dst_v += 16;
  }
}

void RAWToUVRow_LASX(const uint8_t* src_raw,
                     int src_stride_raw,
                     uint8_t* dst_u,
                     uint8_t* dst_v,
                     int width) {
  int x;
  const uint8_t* next_raw = src_raw + src_stride_raw;
  int len = width / 32;
  __m256i src0, src1, src2, reg0, reg1, reg2;
  __m256i nex0, nex1, nex2, dst0, tmp0, tmp1, tmp2;
  __m256i tmpb, tmpg, tmpr, nexb, nexg, nexr;
  __m256i const_112 = __lasx_xvldi(0x470);
  __m256i const_74 = __lasx_xvldi(0x44A);
  __m256i const_38 = __lasx_xvldi(0x426);
  __m256i const_94 = __lasx_xvldi(0x45E);
  __m256i const_18 = __lasx_xvldi(0x412);
  __m256i const_8000 = (__m256i)v4u64{0x8000800080008000, 0x8000800080008000,
                                      0x8000800080008000, 0x8000800080008000};
  __m256i shuff0_r = {0x15120F0C09060300, 0x00000000001E1B18,
                      0x15120F0C09060300, 0x00000000001E1B18};
  __m256i shuff1_r = {0x0706050403020100, 0x1D1A1714110A0908,
                      0x0706050403020100, 0x1D1A1714110A0908};
  __m256i shuff0_g = {0x1613100D0A070401, 0x00000000001F1C19,
                      0x1613100D0A070401, 0x00000000001F1C19};
  __m256i shuff1_g = {0x0706050403020100, 0x1E1B1815120A0908,
                      0x0706050403020100, 0x1E1B1815120A0908};
  __m256i shuff0_b = {0x1714110E0B080502, 0x0000000000001D1A,
                      0x1714110E0B080502, 0x0000000000001D1A};
  __m256i shuff1_b = {0x0706050403020100, 0x1F1C191613100908,
                      0x0706050403020100, 0x1F1C191613100908};

  for (x = 0; x < len; x++) {
    DUP4_ARG2(__lasx_xvld, src_raw, 0, src_raw, 32, src_raw, 64, next_raw, 0,
              reg0, reg1, reg2, tmp0);
    DUP2_ARG2(__lasx_xvld, next_raw, 32, next_raw, 64, tmp1, tmp2);
    DUP4_ARG3(__lasx_xvpermi_q, reg1, reg0, 0x30, reg2, reg0, 0x21, reg2, reg1,
              0x30, tmp1, tmp0, 0x30, src0, src1, src2, nex0);
    DUP2_ARG3(__lasx_xvpermi_q, tmp2, tmp0, 0x21, tmp2, tmp1, 0x30, nex1, nex2);
    DUP2_ARG3(__lasx_xvshuf_b, src1, src0, shuff0_b, nex1, nex0, shuff0_b, tmpb,
              nexb);
    DUP2_ARG3(__lasx_xvshuf_b, src1, src0, shuff0_g, nex1, nex0, shuff0_g, tmpg,
              nexg);
    DUP2_ARG3(__lasx_xvshuf_b, src1, src0, shuff0_r, nex1, nex0, shuff0_r, tmpr,
              nexr);
    DUP2_ARG3(__lasx_xvshuf_b, src2, tmpb, shuff1_b, nex2, nexb, shuff1_b, tmpb,
              nexb);
    DUP2_ARG3(__lasx_xvshuf_b, src2, tmpg, shuff1_g, nex2, nexg, shuff1_g, tmpg,
              nexg);
    DUP2_ARG3(__lasx_xvshuf_b, src2, tmpr, shuff1_r, nex2, nexr, shuff1_r, tmpr,
              nexr);
    RGBTOUV(tmpb, tmpg, tmpr, nexb, nexg, nexr, reg0, reg1);
    dst0 = __lasx_xvpickod_b(reg1, reg0);
    __lasx_xvstelm_d(dst0, dst_u, 0, 0);
    __lasx_xvstelm_d(dst0, dst_v, 0, 1);
    __lasx_xvstelm_d(dst0, dst_u, 8, 2);
    __lasx_xvstelm_d(dst0, dst_v, 8, 3);
    src_raw += 96;
    next_raw += 96;
    dst_u += 16;
    dst_v += 16;
  }
}

void NV12ToARGBRow_LASX(const uint8_t* src_y,
                        const uint8_t* src_uv,
                        uint8_t* dst_argb,
                        const struct YuvConstants* yuvconstants,
                        int width) {
  int x;
  int len = width / 16;
  __m256i vec_yg, vec_yb, vec_ub, vec_vr, vec_ug, vec_vg;
  __m256i vec_vrub, vec_vgug, vec_y, vec_vu;
  __m256i out_b, out_g, out_r;
  __m256i const_0x80 = __lasx_xvldi(0x80);
  __m256i alpha = __lasx_xvldi(0xFF);

  YUVTORGB_SETUP(yuvconstants, vec_ub, vec_vr, vec_ug, vec_vg, vec_yg, vec_yb);
  vec_vrub = __lasx_xvilvl_h(vec_vr, vec_ub);
  vec_vgug = __lasx_xvilvl_h(vec_vg, vec_ug);

  for (x = 0; x < len; x++) {
    vec_y = __lasx_xvld(src_y, 0);
    vec_vu = __lasx_xvld(src_uv, 0);
    vec_vu = __lasx_xvsub_b(vec_vu, const_0x80);
    vec_vu = __lasx_vext2xv_h_b(vec_vu);
    YUVTORGB(vec_y, vec_vu, vec_vrub, vec_vgug, vec_yg, vec_yb, out_r, out_g,
             out_b);
    STOREARGB(alpha, out_r, out_g, out_b, dst_argb);
    src_y += 16;
    src_uv += 16;
  }
}

void NV12ToRGB565Row_LASX(const uint8_t* src_y,
                          const uint8_t* src_uv,
                          uint8_t* dst_rgb565,
                          const struct YuvConstants* yuvconstants,
                          int width) {
  int x;
  int len = width / 16;
  __m256i vec_yg, vec_yb, vec_ub, vec_vr, vec_ug, vec_vg;
  __m256i vec_vrub, vec_vgug, vec_y, vec_vu;
  __m256i out_b, out_g, out_r;
  __m256i const_0x80 = __lasx_xvldi(0x80);

  YUVTORGB_SETUP(yuvconstants, vec_ub, vec_vr, vec_ug, vec_vg, vec_yg, vec_yb);
  vec_vrub = __lasx_xvilvl_h(vec_vr, vec_ub);
  vec_vgug = __lasx_xvilvl_h(vec_vg, vec_ug);

  for (x = 0; x < len; x++) {
    vec_y = __lasx_xvld(src_y, 0);
    vec_vu = __lasx_xvld(src_uv, 0);
    vec_vu = __lasx_xvsub_b(vec_vu, const_0x80);
    vec_vu = __lasx_vext2xv_h_b(vec_vu);
    YUVTORGB(vec_y, vec_vu, vec_vrub, vec_vgug, vec_yg, vec_yb, out_r, out_g,
             out_b);
    out_b = __lasx_xvsrli_h(out_b, 3);
    out_g = __lasx_xvsrli_h(out_g, 2);
    out_r = __lasx_xvsrli_h(out_r, 3);
    out_g = __lasx_xvslli_h(out_g, 5);
    out_r = __lasx_xvslli_h(out_r, 11);
    out_r = __lasx_xvor_v(out_r, out_g);
    out_r = __lasx_xvor_v(out_r, out_b);
    __lasx_xvst(out_r, dst_rgb565, 0);
    src_y += 16;
    src_uv += 16;
    dst_rgb565 += 32;
  }
}

void NV21ToARGBRow_LASX(const uint8_t* src_y,
                        const uint8_t* src_uv,
                        uint8_t* dst_argb,
                        const struct YuvConstants* yuvconstants,
                        int width) {
  int x;
  int len = width / 16;
  __m256i vec_yg, vec_yb, vec_ub, vec_vr, vec_ug, vec_vg;
  __m256i vec_ubvr, vec_ugvg, vec_y, vec_uv;
  __m256i out_b, out_g, out_r;
  __m256i const_0x80 = __lasx_xvldi(0x80);
  __m256i alpha = __lasx_xvldi(0xFF);

  YUVTORGB_SETUP(yuvconstants, vec_ub, vec_vr, vec_ug, vec_vg, vec_yg, vec_yb);
  vec_ubvr = __lasx_xvilvl_h(vec_ub, vec_vr);
  vec_ugvg = __lasx_xvilvl_h(vec_ug, vec_vg);

  for (x = 0; x < len; x++) {
    vec_y = __lasx_xvld(src_y, 0);
    vec_uv = __lasx_xvld(src_uv, 0);
    vec_uv = __lasx_xvsub_b(vec_uv, const_0x80);
    vec_uv = __lasx_vext2xv_h_b(vec_uv);
    YUVTORGB(vec_y, vec_uv, vec_ubvr, vec_ugvg, vec_yg, vec_yb, out_b, out_g,
             out_r);
    STOREARGB(alpha, out_r, out_g, out_b, dst_argb);
    src_y += 16;
    src_uv += 16;
  }
}

#ifndef RgbConstants
struct RgbConstants {
  uint8_t kRGBToY[4];
  uint16_t kAddY;
  uint16_t pad;
};
#define RgbConstants RgbConstants

// RGB to JPeg coefficients
// B * 0.1140 coefficient = 29
// G * 0.5870 coefficient = 150
// R * 0.2990 coefficient = 77
// Add 0.5 = 0x80
static const struct RgbConstants kRgb24JPEGConstants = {{29, 150, 77, 0},
                                                        128,
                                                        0};

static const struct RgbConstants kRawJPEGConstants = {{77, 150, 29, 0}, 128, 0};

// RGB to BT.601 coefficients
// B * 0.1016 coefficient = 25
// G * 0.5078 coefficient = 129
// R * 0.2578 coefficient = 66
// Add 16.5 = 0x1080

static const struct RgbConstants kRgb24I601Constants = {{25, 129, 66, 0},
                                                        0x1080,
                                                        0};

static const struct RgbConstants kRawI601Constants = {{66, 129, 25, 0},
                                                      0x1080,
                                                      0};
#endif  // RgbConstants

// ARGB expects first 3 values to contain RGB and 4th value is ignored.
static void ARGBToYMatrixRow_LASX(const uint8_t* src_argb,
                                  uint8_t* dst_y,
                                  int width,
                                  const struct RgbConstants* rgbconstants) {
  int32_t shuff[8] = {0, 4, 1, 5, 2, 6, 3, 7};
  asm volatile(
      "xvldrepl.b      $xr0,  %3,    0             \n\t"  // load rgbconstants
      "xvldrepl.b      $xr1,  %3,    1             \n\t"  // load rgbconstants
      "xvldrepl.b      $xr2,  %3,    2             \n\t"  // load rgbconstants
      "xvldrepl.h      $xr3,  %3,    4             \n\t"  // load rgbconstants
      "xvld            $xr20, %4,    0             \n\t"  // load shuff
      "1:                                          \n\t"
      "xvld            $xr4,  %0,    0             \n\t"
      "xvld            $xr5,  %0,    32            \n\t"
      "xvld            $xr6,  %0,    64            \n\t"
      "xvld            $xr7,  %0,    96            \n\t"  // load 32 pixels of
                                                          // ARGB
      "xvor.v          $xr12, $xr3,  $xr3          \n\t"
      "xvor.v          $xr13, $xr3,  $xr3          \n\t"
      "addi.d          %2,    %2,    -32           \n\t"  // 32 processed per
                                                          // loop.
      "xvpickev.b      $xr8,  $xr5,  $xr4          \n\t"  // BR
      "xvpickev.b      $xr10, $xr7,  $xr6          \n\t"
      "xvpickod.b      $xr9,  $xr5,  $xr4          \n\t"  // GA
      "xvpickod.b      $xr11, $xr7,  $xr6          \n\t"
      "xvmaddwev.h.bu  $xr12, $xr8,  $xr0          \n\t"  // B
      "xvmaddwev.h.bu  $xr13, $xr10, $xr0          \n\t"
      "xvmaddwev.h.bu  $xr12, $xr9,  $xr1          \n\t"  // G
      "xvmaddwev.h.bu  $xr13, $xr11, $xr1          \n\t"
      "xvmaddwod.h.bu  $xr12, $xr8,  $xr2          \n\t"  // R
      "xvmaddwod.h.bu  $xr13, $xr10, $xr2          \n\t"
      "addi.d          %0,    %0,    128           \n\t"
      "xvpickod.b      $xr10, $xr13, $xr12         \n\t"
      "xvperm.w        $xr11, $xr10, $xr20         \n\t"
      "xvst            $xr11, %1,    0             \n\t"
      "addi.d          %1,    %1,    32            \n\t"
      "bnez            %2,    1b                   \n\t"
      : "+&r"(src_argb),  // %0
        "+&r"(dst_y),     // %1
        "+&r"(width)      // %2
      : "r"(rgbconstants), "r"(shuff)
      : "memory");
}

void ARGBToYRow_LASX(const uint8_t* src_argb, uint8_t* dst_y, int width) {
  ARGBToYMatrixRow_LASX(src_argb, dst_y, width, &kRgb24I601Constants);
}

void ARGBToYJRow_LASX(const uint8_t* src_argb, uint8_t* dst_yj, int width) {
  ARGBToYMatrixRow_LASX(src_argb, dst_yj, width, &kRgb24JPEGConstants);
}

void ABGRToYRow_LASX(const uint8_t* src_abgr, uint8_t* dst_y, int width) {
  ARGBToYMatrixRow_LASX(src_abgr, dst_y, width, &kRawI601Constants);
}

void ABGRToYJRow_LASX(const uint8_t* src_abgr, uint8_t* dst_yj, int width) {
  ARGBToYMatrixRow_LASX(src_abgr, dst_yj, width, &kRawJPEGConstants);
}

// RGBA expects first value to be A and ignored, then 3 values to contain RGB.
// Same code as ARGB, except the LD4
static void RGBAToYMatrixRow_LASX(const uint8_t* src_rgba,
                                  uint8_t* dst_y,
                                  int width,
                                  const struct RgbConstants* rgbconstants) {
  int32_t shuff[8] = {0, 4, 1, 5, 2, 6, 3, 7};
  asm volatile(
      "xvldrepl.b      $xr0,  %3,    0             \n\t"  // load rgbconstants
      "xvldrepl.b      $xr1,  %3,    1             \n\t"  // load rgbconstants
      "xvldrepl.b      $xr2,  %3,    2             \n\t"  // load rgbconstants
      "xvldrepl.h      $xr3,  %3,    4             \n\t"  // load rgbconstants
      "xvld            $xr20, %4,    0             \n\t"  // load shuff
      "1:                                          \n\t"
      "xvld            $xr4,  %0,    0             \n\t"
      "xvld            $xr5,  %0,    32            \n\t"
      "xvld            $xr6,  %0,    64            \n\t"
      "xvld            $xr7,  %0,    96            \n\t"  // load 32 pixels of
                                                          // RGBA
      "xvor.v          $xr12, $xr3,  $xr3          \n\t"
      "xvor.v          $xr13, $xr3,  $xr3          \n\t"
      "addi.d          %2,    %2,    -32           \n\t"  // 32 processed per
                                                          // loop.
      "xvpickev.b      $xr8,  $xr5,  $xr4          \n\t"  // AG
      "xvpickev.b      $xr10, $xr7,  $xr6          \n\t"
      "xvpickod.b      $xr9,  $xr5,  $xr4          \n\t"  // BR
      "xvpickod.b      $xr11, $xr7,  $xr6          \n\t"
      "xvmaddwev.h.bu  $xr12, $xr9,  $xr0          \n\t"  // B
      "xvmaddwev.h.bu  $xr13, $xr11, $xr0          \n\t"
      "xvmaddwod.h.bu  $xr12, $xr8,  $xr1          \n\t"  // G
      "xvmaddwod.h.bu  $xr13, $xr10, $xr1          \n\t"
      "xvmaddwod.h.bu  $xr12, $xr9,  $xr2          \n\t"  // R
      "xvmaddwod.h.bu  $xr13, $xr11, $xr2          \n\t"
      "addi.d          %0,    %0,    128           \n\t"
      "xvpickod.b      $xr10, $xr13, $xr12         \n\t"
      "xvperm.w        $xr11, $xr10, $xr20         \n\t"
      "xvst            $xr11, %1,    0             \n\t"
      "addi.d          %1,    %1,    32            \n\t"
      "bnez            %2,    1b                   \n\t"
      : "+&r"(src_rgba),  // %0
        "+&r"(dst_y),     // %1
        "+&r"(width)      // %2
      : "r"(rgbconstants), "r"(shuff)
      : "memory");
}

void RGBAToYRow_LASX(const uint8_t* src_rgba, uint8_t* dst_y, int width) {
  RGBAToYMatrixRow_LASX(src_rgba, dst_y, width, &kRgb24I601Constants);
}

void RGBAToYJRow_LASX(const uint8_t* src_rgba, uint8_t* dst_yj, int width) {
  RGBAToYMatrixRow_LASX(src_rgba, dst_yj, width, &kRgb24JPEGConstants);
}

void BGRAToYRow_LASX(const uint8_t* src_bgra, uint8_t* dst_y, int width) {
  RGBAToYMatrixRow_LASX(src_bgra, dst_y, width, &kRawI601Constants);
}

static void RGBToYMatrixRow_LASX(const uint8_t* src_rgba,
                                 uint8_t* dst_y,
                                 int width,
                                 const struct RgbConstants* rgbconstants) {
  int8_t shuff[128] = {
      0,  2,  3,  5,  6,  8, 9,  11, 12, 14, 15, 17, 18, 20, 21, 23,
      0,  2,  3,  5,  6,  8, 9,  11, 12, 14, 15, 17, 18, 20, 21, 23,
      24, 26, 27, 29, 30, 0, 1,  3,  4,  6,  7,  9,  10, 12, 13, 15,
      24, 26, 27, 29, 30, 0, 1,  3,  4,  6,  7,  9,  10, 12, 13, 15,
      1,  0,  4,  0,  7,  0, 10, 0,  13, 0,  16, 0,  19, 0,  22, 0,
      1,  0,  4,  0,  7,  0, 10, 0,  13, 0,  16, 0,  19, 0,  22, 0,
      25, 0,  28, 0,  31, 0, 2,  0,  5,  0,  8,  0,  11, 0,  14, 0,
      25, 0,  28, 0,  31, 0, 2,  0,  5,  0,  8,  0,  11, 0,  14, 0};
  asm volatile(
      "xvldrepl.b      $xr0,  %3,    0             \n\t"  // load rgbconstants
      "xvldrepl.b      $xr1,  %3,    1             \n\t"  // load rgbconstants
      "xvldrepl.b      $xr2,  %3,    2             \n\t"  // load rgbconstants
      "xvldrepl.h      $xr3,  %3,    4             \n\t"  // load rgbconstants
      "xvld            $xr4,  %4,    0             \n\t"  // load shuff
      "xvld            $xr5,  %4,    32            \n\t"
      "xvld            $xr6,  %4,    64            \n\t"
      "xvld            $xr7,  %4,    96            \n\t"
      "1:                                          \n\t"
      "xvld            $xr8,  %0,    0             \n\t"
      "xvld            $xr9,  %0,    32            \n\t"
      "xvld            $xr10, %0,    64            \n\t"  // load 32 pixels of
                                                          // RGB
      "xvor.v          $xr12, $xr3,  $xr3          \n\t"
      "xvor.v          $xr13, $xr3,  $xr3          \n\t"
      "xvor.v          $xr11, $xr9,  $xr9          \n\t"
      "addi.d          %2,    %2,    -32           \n\t"  // 32 processed per
                                                          // loop.
      "xvpermi.q       $xr9,  $xr8,  0x30          \n\t"  // src0
      "xvpermi.q       $xr8,  $xr10, 0x03          \n\t"  // src1
      "xvpermi.q       $xr10, $xr11, 0x30          \n\t"  // src2
      "xvshuf.b        $xr14, $xr8,  $xr9,  $xr4   \n\t"
      "xvshuf.b        $xr15, $xr8,  $xr10, $xr5   \n\t"
      "xvshuf.b        $xr16, $xr8,  $xr9,  $xr6   \n\t"
      "xvshuf.b        $xr17, $xr8,  $xr10, $xr7   \n\t"
      "xvmaddwev.h.bu  $xr12, $xr16, $xr1          \n\t"  // G
      "xvmaddwev.h.bu  $xr13, $xr17, $xr1          \n\t"
      "xvmaddwev.h.bu  $xr12, $xr14, $xr0          \n\t"  // B
      "xvmaddwev.h.bu  $xr13, $xr15, $xr0          \n\t"
      "xvmaddwod.h.bu  $xr12, $xr14, $xr2          \n\t"  // R
      "xvmaddwod.h.bu  $xr13, $xr15, $xr2          \n\t"
      "addi.d          %0,    %0,    96            \n\t"
      "xvpickod.b      $xr10, $xr13, $xr12         \n\t"
      "xvst            $xr10, %1,    0             \n\t"
      "addi.d          %1,    %1,    32            \n\t"
      "bnez            %2,    1b                   \n\t"
      : "+&r"(src_rgba),    // %0
        "+&r"(dst_y),       // %1
        "+&r"(width)        // %2
      : "r"(rgbconstants),  // %3
        "r"(shuff)          // %4
      : "memory");
}

void RGB24ToYJRow_LASX(const uint8_t* src_rgb24, uint8_t* dst_yj, int width) {
  RGBToYMatrixRow_LASX(src_rgb24, dst_yj, width, &kRgb24JPEGConstants);
}

void RAWToYJRow_LASX(const uint8_t* src_raw, uint8_t* dst_yj, int width) {
  RGBToYMatrixRow_LASX(src_raw, dst_yj, width, &kRawJPEGConstants);
}

void RGB24ToYRow_LASX(const uint8_t* src_rgb24, uint8_t* dst_y, int width) {
  RGBToYMatrixRow_LASX(src_rgb24, dst_y, width, &kRgb24I601Constants);
}

void RAWToYRow_LASX(const uint8_t* src_raw, uint8_t* dst_y, int width) {
  RGBToYMatrixRow_LASX(src_raw, dst_y, width, &kRawI601Constants);
}

void ARGBToUVJRow_LASX(const uint8_t* src_argb,
                       int src_stride_argb,
                       uint8_t* dst_u,
                       uint8_t* dst_v,
                       int width) {
  int x;
  const uint8_t* next_argb = src_argb + src_stride_argb;
  int len = width / 32;
  __m256i src0, src1, src2, src3;
  __m256i nex0, nex1, nex2, nex3;
  __m256i tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;
  __m256i reg0, reg1, dst0;
  __m256i tmpb, tmpg, tmpr, nexb, nexg, nexr;
  __m256i const_128 = __lasx_xvldi(0x480);
  __m256i const_85 = __lasx_xvldi(0x455);
  __m256i const_43 = __lasx_xvldi(0x42B);
  __m256i const_107 = __lasx_xvldi(0x46B);
  __m256i const_21 = __lasx_xvldi(0x415);
  __m256i const_8000 = (__m256i)v4u64{0x8000800080008000, 0x8000800080008000,
                                      0x8000800080008000, 0x8000800080008000};
  __m256i shuff = {0x1614060412100200, 0x1E1C0E0C1A180A08, 0x1715070513110301,
                   0x1F1D0F0D1B190B09};

  for (x = 0; x < len; x++) {
    DUP4_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src_argb, 64, src_argb,
              96, src0, src1, src2, src3);
    DUP4_ARG2(__lasx_xvld, next_argb, 0, next_argb, 32, next_argb, 64,
              next_argb, 96, nex0, nex1, nex2, nex3);
    tmp0 = __lasx_xvpickev_b(src1, src0);
    tmp1 = __lasx_xvpickod_b(src1, src0);
    tmp2 = __lasx_xvpickev_b(src3, src2);
    tmp3 = __lasx_xvpickod_b(src3, src2);
    tmpr = __lasx_xvpickod_b(tmp2, tmp0);
    tmpb = __lasx_xvpickev_b(tmp2, tmp0);
    tmpg = __lasx_xvpickev_b(tmp3, tmp1);
    tmp0 = __lasx_xvpickev_b(nex1, nex0);
    tmp1 = __lasx_xvpickod_b(nex1, nex0);
    tmp2 = __lasx_xvpickev_b(nex3, nex2);
    tmp3 = __lasx_xvpickod_b(nex3, nex2);
    nexr = __lasx_xvpickod_b(tmp2, tmp0);
    nexb = __lasx_xvpickev_b(tmp2, tmp0);
    nexg = __lasx_xvpickev_b(tmp3, tmp1);
    tmp0 = __lasx_xvaddwev_h_bu(tmpb, nexb);
    tmp1 = __lasx_xvaddwod_h_bu(tmpb, nexb);
    tmp2 = __lasx_xvaddwev_h_bu(tmpg, nexg);
    tmp3 = __lasx_xvaddwod_h_bu(tmpg, nexg);
    reg0 = __lasx_xvaddwev_h_bu(tmpr, nexr);
    reg1 = __lasx_xvaddwod_h_bu(tmpr, nexr);
    tmp4 = __lasx_xvaddwev_w_hu(tmp0, tmp1);
    tmp5 = __lasx_xvaddwod_w_hu(tmp0, tmp1);
    tmp0 = __lasx_xvilvl_w(tmp5, tmp4);
    tmp1 = __lasx_xvilvh_w(tmp5, tmp4);
    tmpb = __lasx_xvssrarni_hu_w(tmp1, tmp0, 2);
    tmp4 = __lasx_xvaddwev_w_hu(tmp2, tmp3);
    tmp5 = __lasx_xvaddwod_w_hu(tmp2, tmp3);
    tmp2 = __lasx_xvilvl_w(tmp5, tmp4);
    tmp3 = __lasx_xvilvh_w(tmp5, tmp4);
    tmpg = __lasx_xvssrarni_hu_w(tmp3, tmp2, 2);
    tmp4 = __lasx_xvaddwev_w_hu(reg0, reg1);
    tmp5 = __lasx_xvaddwod_w_hu(reg0, reg1);
    tmp0 = __lasx_xvilvl_w(tmp5, tmp4);
    tmp1 = __lasx_xvilvh_w(tmp5, tmp4);
    tmpr = __lasx_xvssrarni_hu_w(tmp1, tmp0, 2);
    reg0 = __lasx_xvmadd_h(const_8000, const_128, tmpb);
    reg1 = __lasx_xvmadd_h(const_8000, const_128, tmpr);
    reg0 = __lasx_xvmsub_h(reg0, const_85, tmpg);
    reg1 = __lasx_xvmsub_h(reg1, const_107, tmpg);
    reg0 = __lasx_xvmsub_h(reg0, const_43, tmpr);
    reg1 = __lasx_xvmsub_h(reg1, const_21, tmpb);
    dst0 = __lasx_xvpackod_b(reg1, reg0);
    tmp0 = __lasx_xvpermi_d(dst0, 0x44);
    tmp1 = __lasx_xvpermi_d(dst0, 0xEE);
    dst0 = __lasx_xvshuf_b(tmp1, tmp0, shuff);
    __lasx_xvstelm_d(dst0, dst_u, 0, 0);
    __lasx_xvstelm_d(dst0, dst_v, 0, 2);
    __lasx_xvstelm_d(dst0, dst_u, 8, 1);
    __lasx_xvstelm_d(dst0, dst_v, 8, 3);
    dst_u += 16;
    dst_v += 16;
    src_argb += 128;
    next_argb += 128;
  }
}

// undef for unified sources build
#undef ALPHA_VAL
#undef YUVTORGB_SETUP
#undef READYUV422_D
#undef READYUV422
#undef YUVTORGB_D
#undef YUVTORGB
#undef STOREARGB_D
#undef STOREARGB
#undef RGBTOUV

#ifdef __cplusplus
}  // extern "C"
}  // namespace libyuv
#endif

#endif  // !defined(LIBYUV_DISABLE_LASX) && defined(__loongarch_asx)

Messung V0.5 in Prozent
C=83 H=75 G=78

¤ Dauer der Verarbeitung: 0.156 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=277311
#Domains=752002