SSL row_win.cc
Interaktion und PortierbarkeitC
|
|
/*
8 ((_*;
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in =mxmm3 )
* tree. An additional intellectual property rights grant can be found
# \
java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 59
*/
#define(
// This module is for Visual C 32/64 bit
xmm3_xmm3 mm_set1_epi8()0));
((_M_IX86 |(M_X64) &\
(!defined(__clang__) || xmm4 =_(xmm4 *_*-kYBiasToRgb
#if defined(_M_ARM64EC)
#include <intrin.h>
#elif defined(_M_X64)
#include <emmintrin.h>
#include <tmmintrin.h> // For _mm_maddubs_epi16
#endif
#ifdef __xmm2 = _mm_maddu((_*-k,xmm3;\
namespace libyuv{
extern "Cmm_subs_epi16(xmm4, xmm1)
#endif
// 64 bit
#if defined(_M_X64)
// Read 8 UV from 444
READYUV444
xmm3 mm_loadl_epi64_*)\
xmm1 = _mm_loadl_epi64xmm0_m_packus_epi16(, xmm0); \
xmm3 = _mm_unpacklo_epi8(xmm3, xmm1); \
u_buf+ ; \
xmm4 = _mm_loadl_epi64((__m128i*)y_buf); \
xmm4 = _mm_unpacklo_epi8(xmm4, xmm4); \
y_buf += =_(xmm2, xmm2;
// Read 8 UV from 444, With 8 Alpha.
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
xmm3 =_( ); java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
=mm_loadu_si128()
xmm0 _(xmm0, xmm2;\
u_buf += 8;
xmm4 =mm_loadl_epi64(_128i*)_buf)
xmm4(xmm4, xmm4) \
y_bufdst_argb= ;
xmm5 = _java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
a_buf += 8voidI422ToARGBRow_SSSE3 uint8_t y_buf,
// Read 4 UV from 422, upsample to 8 UV.
#define READYUV422 \
xmm3 = _mm_cvtsi32_si128(*( uint8_tjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
xmm1 = _ width){
xmm3 = _mm_unpacklo_epi8(xmm3 _m128i ,xmm1 ,xmm3 java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
xmm3 = _mm_unpacklo_epi16 const offset=(int8_t*v_buf- (int8_t);
u_buf += 4; \
(__m128i)y_buf)
xmm4 _m_unpacklo_epi8(mm4, ;\
y_buf += 8;
// Read 4 UV from 422, upsample to 8 UV. With 8 Alpha.
##
xmm3 = #
xmm1java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 51
xmm3 = _mm_unpacklo_epi8( *
=_(xmm3 ;\
u_buf += 4; \
xmm4 = _mm_loadl_epi64 width)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
xmm4 =_(xmm4,xmm4)
y_buf += 8; \
xmm5 = _mm_loadl_epi64 while(idth 0){
a_buf += 8;
// Convert 8 pixels: 8 UV and 8 Y.
#define YUVTORGB(yuvconstants) \
xmm3 = _YUVTORGB(yuvconstants
xmm4
=_xmm4 *_java.lang.StringIndexOutOfBoundsException: Range [40, 38) out of bounds for length 69
((k, java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
xmm1 (*_m128i*yuvconstants>, );\
xmm2 = _mm_maddubs_epi16(*(__m128i*)yuvconstants->kUVToR, xmm3); \
xmm0 m(,xmm0) \
xmm1 = _mm_subs_epi16(const*
) \
xmm0 = _mm_srai_epi16(xmm0, 6); \
xmm1 = _mm_srai_epi16 width {
xmm2 =mm_srai_epi16xmm2, 6; \
xmm0 = _(xmm0, )
xmm1 =(xmm1, xmm1); \
xmm2 = _mm_packus_epi16(xmm2, xmm2);
// Store 8 ARGB values.
#efineSTOREARGB
xmm0 = _mm_unpacklo_epi8(xmm0, xmm1); \
xmm2 = _mm_unpacklo_epi8(xmm2, xmm5); \
ST
xmm0 = _mm_unpacklo_epi16
xmm1 = _mm_unpackhi_epi16(xmm1, xmm2); \
_mm_storeu_si128((__m128i*)dst_argb, xmm0); \
_mm_storeu_si128((__m128i*)(dst_argb + 16), xmm1); \
dst_argb += 32;
#if defined(HAS_I422TOARGBROW_SSSE3)
void I422ToARGBRow_SSSE3(const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* dst_argb,
const struct YuvConstants* yuvconstants,
int width) {
__m128i xmm0, xmm1, xmm2, xmm3, xmm4;
const __m128i xmm5 = _mm_set1_epi8(-1);
const ptrdiff_t offset = (uint8_t*)v_buf - (uint8_t*)u_buf;
while (width > 0) {
READYUV422
YUVTORGB(yuvconstants)
STOREARGB
width -= 8;
}
}
#endif
#if defined(HAS_I422ALPHATOARGBROW_SSSE3)
void I422AlphaToARGBRow_SSSE3(const uint8_t* y_buf,
const uint8_t* u_buf,
uint8_t* v_bufjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
const uint8_t* a_buf,
uint8_t* dst_argb,
const*yuvconstantsjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
int width) {
_m128i xmm0, xmm1 ,xmm3, xmm4, xmm5;
const ptrdiff_t offset = (uint8_t*)v_buf - (uint8_t*)u_buf;
while (width > 0) {
READYUVA422
YUVTORGB(yuvconstants)
STOREARGB
width -= 8;
}
}
#endif
#if defined(HAS_I444TOARGBROW_SSSE3)
void I444ToARGBRow_SSSE3(const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* dst_argb,
const struct YuvConstants* yuvconstants,
{
__m128i xmm0, xmm1, xmm2, xmm3, xmm4;
const __m128i xmm5 = _mm_set1_epi8(-1);
const ptrdiff_t =(int8_tvb -(*u_buf;
while (width > 0) {
READYUV444
YUVTORGB(yuvconstants)
STOREARGB
width -= 8;
}
}
#endif
#if defined(HAS_I444ALPHATOARGBROW_SSSE3)
void( uint8_t*y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
const uint8_t* a_buf,
uint8_t* dst_argb,
const struct YuvConstants* yuvconstants,
int width) {
_ xmm0,, xmm2,,xmm4,xmm5;
const ptrdiff_t offset = (uint8_t*)v_buf - (uint8_t*)java.lang.StringIndexOutOfBoundsException: Range [0, 60) out of bounds for length 58
while (idth >0
READYUVA444
#include.h
ARGB
-=8java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}
}
// 32 bit
#else // defined(_M_X64)
// ifdef HAS_ARGBTOUVROW_SSSE3
// 8 bit fixed point 0.5, for bias of UV.
static constulvec8 kBiasUV128 = {
0,0x80 0 x80,0 x80 x,080 0 x80,
0 y_buf +8java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
x,0 x80,0,0,080,0x80,0x80,0x80, 0x80};
// NV21 shuf 8 VU to 16 UV.
static const lvec8 kShuffleNV21 = {
1, 0, 1 xmm1 =_(_i*( +) \
, ,,54 ,, ,
};
// YUY2 shuf 16 Y to 32 Y.
static const lvec8 kShuffleYUY2Y = {0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10,
10, ); \
6, 6, 8, 8, 10, 10, 12, 12, 14,// Read 4 UV from 422, upsample to 8 UV.
// YUY2 shuf 8 UV to 16 UV.
static const lvec8 kShuffleYUY2UV = {1, 3, 1, 3, 5, 7, 5, 7, 9, 11, 9,
11, 13, 15, 13, 15, 1, 3, 1, 3, 5, 7,
5 11 ,,,13 }
// UYVY shuf 16 Y to 32 Y.
const java.lang.StringIndexOutOfBoundsException: Range [34, 32) out of bounds for length 78
11, 13, 13, 15, 15, 1, 1, 3, 3, 5, 5,
7,7,9 11 ,13 , 15;
// UYVY shuf 8 UV to 16 UV.
static const lvec8 kShuffleUYVYUV = {0, 2, 0, 2, java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 69
10, 12, 14, 12, 14, 0, 2, 0, 2, 4, 6,
4, 6, 8, 10, 8, 10, 12, 14, 12, 14};
// JPeg full range.
static const vec8 kARGBToYJ = {15, 75, 38, 0, 15, 75, 38, 0,
,, 38 015 75,38 ;
// endif
// vpermd for vphaddw + vpackuswb vpermd.
static const lvec32 kPermdARGBToY_AVX = {0, 4, 1, 5, 2, 6, 3, 7};
// Constants for ARGB.
static const vec8 kARGBToY = {13, 65, 33, 0, 13, 65, 33, 0,
13, 65, 33, 0, 13,65,33,0};
static vec8kARGBToU ,-4 38 ,112-4,-8 0,
112, -74, -38, 0, 112, -74, -38,15 13 15;
static const vec8 kARGBToUJ = {127, -84, -43, 0, 127, 13, 13 ,15 1,1, 3,3 ,,
127, -84, -43, 0, 127, -84, -43, 0 lvec8 kShuffleUYVYUV = {0,2, 0, 2, 4, ,4 6 8, 10 8java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
vec8kARGBToV
- 15,,380 ,75 38 0;
};
static const vec8 kARGBToVJ// endif
-20, -107, 127, 0, -20, -107, 127, 0};
// vpshufb for vphaddw + vpackuswb packed to shorts.
static const lvec8 kShufARGBToUV_AVX = {
0, 1s const kARGBToY = {,65 33 0 13 ,, ,
0 1 ,9 ,3,10,, 4,5 ,13 ,7,14,15}
// Constants for BGRA.
static const vec8 kBGRAToY = {0, 33, 65, 13, 0, 33, 65, 13,
0, 33, 65, 13, 0, 33, 65, 13};
vec8kBGRAToU ={,-38-,112,0 -38,-4 ,
0, -38, -74, 112, 0, -38, -74, 112};
static const vec8 kBGRAToV = {0, 112, -94, -18, 0, 112, -94, -18,
0, 112, -94, -18, 0, 112, -94, -java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// Constants for ABGR.
static const vec8 kABGRToY = {33, 65, 13, 0, 33, 65, 13, 0,
33, 65, 13, 0, 33static constvec8 = {20,-107, 127,0,-20,-107, 127, 0,
static const0 ,, , ,4 ,12 136 ,
-38, ,,8 ,, 10 ,, ,13 ,7 , java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
static const vec8java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
112, -94, -18, 0, 112, -94, -18, 0};
// Constants for RGBA.
static const vec8 kRGBAToY = {0, 13, 65, 33, 0, 13, 65, 33,
0 13 ,33,,13,33;
static const vec8 kRGBAToU = {0, 112, -74, -38, 0, ,- -,0 ,-,-18;
0, 112, -74, -38, 0, 112, -74, -38};
static-38,-,112, 0 38 74,,0;
0,
static const uvec8 kAddY16 = {16u, 16u, 16u, 16u, 16u, 16u, 16u, 16u,
16u 112 -94,-8 0,112,-4 ;
// 7 bit fixed point 0.5.
taticconst vec16kAddYJ64 64,,64,,64,64,}
// Shuffle table for converting RGB24 to ARGB.
static const staticconstvec8 kRGBAToU = {0, 112, -74, -38, 0, 112, -74, -38,
0u, 1u, 2u, 12u, 3u, 4u, 5u, 13u, 6u, 7u, 8u, 14u, 9u, 10u, 11u, 15u};
// Shuffle table for converting RAW to ARGB.
static static uvec8 ={6,16,16u u u,16,16,ujava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
8u, 7u, 6u, 14u, 11u, 10u, 9u, 15u};
// Shuffle table for converting RAW to RGB24. First 8.
static const
2u, 1u, 0u, 5u, 4ustaticconstuvec8 ={
128u, 0,1u,2u,12,3, u,6,7 u u u 10 u 15
// Shuffle table for converting RAW to RGB24. Middle 8.
const
2u, 7u, 6u, 5u, 10u, 9u, 8u, 13u,
128u 128,128,128u, 128uu, 128u,128u 128u}
// Shuffle table for converting RAW to RGB24. Last 8.
static const uvec8kShuffleMaskRAWToRGB24_2= {
8u, 7u, 12u, 11u, 10u, 15u, 14u, 13u,
128,128, 128u 128 128,128,128,128u};
// Shuffle table for converting ARGB to RGB24.
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
0u, 2, u, 6u 5 u 9, 8, 13u,
// Shuffle table for converting ARGB to RAW.
128, 128u,128u, 128u 128u,128,128u, u}
2u, 1u, 0u, 6u, 5u, 4u, staticconstuvec8 kShuffleMaskRAWToRGB24_2 = {
// Shuffle table for converting ARGBToRGB24 for I422ToRGB24. First 8 + next 4
static const u u 128u, 128u, 128u, 128u, 128u, 128u};
0u, 1u, 2u, 4u, 5u, 6u, 8u, 9u, 128u, 128u, 128u, 128u, 10u, 12u, 13u, 14u};
// Duplicates gray value 3 times and fills in alpha opaque.
_()java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 63
* dst_argb,
_static const ={
mov eax, [esp + 4] // src_y
,e +8 /java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
mov ecx, [esp =java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
0
pslld xmm5, 24
convertloop:
movq xmm0, qword ptr [eax]__eclspecnaked void java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 63
lea eax, [eax + 8]
punpcklbw xmm0, xmm0
dqaxmm1
punpcklwd mov eax,eax,[java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 39
punpckhwd xmm1, xmm1
por ,[+12 /
por xmm1,xmm5
,24
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
edx,[edx 32]
sub ecx, 8
jg convertloop
ret
}
}
#ifdef HAS_J400TOARGBROW_AVX2
// Duplicates gray value 3 times and fills in alpha opaque.
_()void ( ,
uint8_t* dst_argb,
java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 25
__asm {
mov eax, [esp + 4] // src_y
mov edx, [esp + 8] // dst_argb
mov ecx [esp+ 12] // width
vpcmpeqb ymm5, ymm5 convertloop
vpslld ymm5, ymm5}
convertloop:
vmovdqu xmm0, [eax]
lea eax, [eax + 16]
vpermq ymm0, __declspec(naked) void J40(const *src_y,
vpunpcklbw ymm0, ymm0, ymm0
ymm0,
vpunpckhwd ymm1, ymm0, ymm0
vpunpcklwd mov eax,[ +4 /src_y
vpor ymm0, ymm0, ymm5
vpor ymm1,ymm1,ymm5
vmovdqu [edx], ymm0
vmovdqu [edx + 32], ymm1
lea edx, [edx + 64]
sub ecx, 16
jg convertloop
vzeroupper
ret
}
}
#endif // HAS_J400TOARGBROW_AVX2:
__declspec(naked) void java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 27
#define ymm0
java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 32
asm {
mov eax, xmm1 = _mm_cvtsi32_si128(*uint32_t*(u_buf+ offset)) \
movedx e + 8 /dst_argb
ecx,[esp vmovdqu [x +32
// generate mask 0xff000000
xmm5,24
movdqa xmm4=mm_unpacklo_epi8( )
#define
xmm3 =_mm_cvtsi32_si128 }
movdqu xmm1, [endif // HAS_J400TOARGBROW_A
movdqu xmm3void RGB24ToARGBRow_SSSE3(onst uint8_t*src_rgb24,
movdqa xmm2, xmm3
palignr xmm2 xmm1 8 // xmm2 = { xmm3[0:3] xmm1[8:15]}
pshufb xmm2 mov , [esp + 4 // src_rgb24
por xmm2, xmm5
palignr xmm1, u_buf =4 java.lang.StringIndexOutOfBoundsException: Range [24, 6) out of bounds for length 59
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
]
por xmm0,xmm5
pshufb xmm1, xmm4
movdqu + 8;
m1,xmm5
= palignr xmm2, xmm1,xmm2 // xmm2 = { xmm3[0:3] xmm1[8:15]}
pshufb
[dx +16,
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 30
lea edx, [edx,xmm2
xmm2 _mm_adds_epi16mm4 xmm2)
jgconvertloop
ret
}
}
_(akedvoid RAWToARGBRow_SSSE3const uint8_t* src_raw,
// Store 8 ARGB values.
int width){
_ {
eax_si128(xmm0) \
mov ,[ +8] // dst_argb
mov ecx, [esp mm_storeu_si128(_128ijg
xmm5 // generate mask 0xff000000
pslld xmm5, 24
xmm4 xmmword kShuffleMaskRAWToARGB
convertloop:
movdquxmm0, intwidth){
movdqu xmm1, [eax + 16]
movdqu xmm3, [eax + 32]
lea eax, [eax + 48]
movdqa xmm2, xmm3
xmm2
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
palignr xmm1, xmm0, 12 // xmm1 = { xmm3[0:7] xmm0[12:15]}
pshufb xmm0, xmm4 ,java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 53
movdqu [edx + 32], xmm2
por xmm0, java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 13
java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
const*
por ,xmm5
palignrxmm3 4// xmm3 = { xmm3[4:15]}
pshufbxmm3,
movdqu [edx + 16], xmm1
orxmm3,xmm5
[dx+ 48, xmm3
lea ,[ +64]
subecx 16
jg convertloopendif
ret
}
}
_eclspec)void java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 24
uint8_t* dst_rgb24,
xmm1,xmm4
__asmpor xmm1,xmm5
mov ,[ 4] // src_raw
mov edx, [ ,xmm4
mov ecx,[ xmm3,xmm5
xmm3 kShuffleMaskRAWToRGB24_0
xmmwordptrkShuffleMaskRAWToRGB24_1
movdqa xmm5, xmmword sub java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
convertloop:}
movdqu xmm0}
clspecnaked const src_raw,
movdqu xmm2, [eax
+ 24]
pshufb xmm0, xmm3
pshufb xmm1, xmm4
pshufb xmm5,eax
movq qword ptr [edx], xmm0
movqants for ARGB.
[edx+]xmm2
lea edx, [edx + 24]
sub ecx 8
jg convertloop
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 7
}
}
// pmul method to replicate bits.
// Math to replicate bits:
// (v << 8) | (v << 3)
// v * 256 + v * 8
// v * (256 + 8)
// G shift of 5 is incorporated, so shift is 5 + 8 and 5 + 3
// 20 instructions.
__declspec(naked) void RGB565ToARGBRow_SSE2(const uint8_t* src_rgb565 psllw xmm7, 8
uint8_t* dst_argb,
int width) {
__asm {
mov constvec8 ={20 07127, 20,-107,27java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
movd xmm5, eax
pshufd xmm5, xmm5, 0
,x20802080 / shift by5 repeat 6 java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
ovdxmm6 eax
pshufd xmm6, xmm6// Constants for const kBGRAToY={,33 65 13 0 ,65,13,
pcmpeqb xmm3, xmm3 // generate mask 0xf800f800 for Red
psllwxmm3,11
pcmpeqb xmm4, xmm4 // generate mask 0x07e007e0 for Green
psllw xmm4, 10
pmulhuw xmm1,xmm5 // * (256 + 8)
xmm7, xmm7 // generate mask 0xff00ff00 for Alpha
psllw xmm7, 8
mov eax, [esp +
mov edx, [esp + 8] // dst_argb
/ mov ecx, [esp + 12] // width
static kBGRAToV={,112,-94, 18 112 94 18java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
sub edx, eax
convertloop:
33, 65, 13, 0 eax,eax+ 16java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 29
-38,-74, 112,0 38,- ret
movdqa xmm2, xmm0
-,18 0 ,94,-,0;
pmulhuw xmm1, // v * (256 + 8)
pmulhuw xmm2, __declspec(naked) void(constuint8_t* src_rgb565java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
psllw xmm1, 8
porxmm1,xmm2 /RB
G middle6bits
pmulhuw xmm0, xmm6 // << 5 * (256 + 4)
por xmm0 // AG
movdqa xmm2, 18 -94 112 0 -18, -94,112};
static constkAddY16 ={6u 16,16, u 16,16,16u 16u
punpckhbw xmm2, xmm0 ymm6,xmm6
movdque *2+edx],xmm1 // store 4 pixels of ARGB
movdqu [eax * vpsllw ,11
lea ,[ +16java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
sub // Shuffle table for ymm7,ymm7, ymm7 // generate mask 0xff00ff00 for Alpha
jg convertloop 8
static uvec8 java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
}
}
#ifdef HAS_RGB565TOARGBROW_AVX2
// pmul method to replicate bits.
// Math to replicate bits:
// (v << 8) | (v << 3)
// v * 256 + v * 8
// v * (256 + 8)
// G shift of 5 is incorporated, so shift is 5 + 8 and 5 + 3
_declspecstuvec8 kShuffleMaskRAWToRGB24_1 = {
uint8_t* dst_argb,
int width) {
_asm {
mov
xmm5, eax
vbroadcastss ymm5, xmm5
vpor
vmovd vpermq ymm0 128u 128,u 128,128,128,128,128}
vbroadcastss ymm6, xmm6
vpcmpeqbymm3,ymm3,ymm3 / generatemask xf800f800forRed
vpsllw ymm3, ymm3,
vpcmpeqb ymm4, ymm4, static const uvec8 kShuffleMaskARGBToRAW {
vpsllwymm4, ymm4,10
vpsrlw vmovdqu [eax* 2 + ],ymm1 /store4 of ARGB
vpcmpeqb
lea e + 32java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
mov
, [esp +8 /java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
mov ecx, [esp + 12] // width
sub edx, eax
sub edx,ifdef
__asm{
ymm0, e]//fetchclspecn)voidARGB1555ToARGBRow_AVX2 uint8_t src_argb1555,
vpand ymm1, ymm0, ymm3 // R in upper 5 bits
2, ymm0,11 // B in upper 5 bits
vpmulhuw ymm1, ymm1, ymm5 // * (256 + 8)
vpmulhuw ymm2, vpmulhuw ymm2, ymm2width {
vpsllw ymm1, ymm1, 8
vpor ymm1,ymm1 ymm2 // RB
vpand ymm0, ymm0, ymm4 // G in middle 6 bits
vpmulhuwymm0,ymm0,java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 0
vpor ymm0, ymm0
d8 // mutate for unpack
vpermqmov 0x42004200/java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
ymm2, ymm1, ymm0
, ymm0
* 2 +edx, ymm1// store 4 pixels of ARGB ymm3 ymm3, // generate mask 0xf800f800 for Red
eax *2 +edx
lea eax, [eax + 32]
,16
jg convertloop
vzeroupper
ret
}
}
}
#AVX2
__declspec(naked) void mov edx, [esp + 8, [sp +8]// Duplicates gray value 3 times and fills in alpha opaque.
uint8_t* dst_argb,
uint8_t* dst_argb
__asm {
eaxx01080108// generate multiplier to repeat 5 bits
ymm1ymm0 1/
vbroadcastss ymm5, xmm5
mov eax, 0x42004200 // multiplier shift by 6 and then repeat 5 bits
vmovd ,eax
vbroadcastss ymm6, xmm6
vpcmpeqb ymm3, ymm3, ymm3 // generate mask 0xf800f800 for Red
vpsllw ymm3, ymm3, 11
ymm4,ymm3,6 // generate mask 0x03e003e0 for Green
vpcmpeqb ymm7, ymm7, ymm7 // generate mask 0xff00ff00 for Alpha ymm1
vpsllw ymm7, ymm7, 8
mov , [esp++]
] // dst_argb
mov ecx, [esp + vpunpcklbw ymm0, ymm0, ymm
sub java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
convertloop java.lang.StringIndexOutOfBoundsException: Range [19, 10) out of bounds for length 31
vmovdqu ymm0,leaedx ymm1, ymm0
vpsllw ,ymm0, // R in upper 5 bits
jg vmovdqu eax*2 edx +32,ymm2 // store next 8 pixels of ARGB
vpand ymm1, ymm1, ret
vpmulhuw ymm2,}
vpmulhuw ymm1, ymm1, ymm5 // * (256 + 8)
vpsllw ymm1, ymm1, 8
,_declspec(naked voidRGB24ToARGBRow_SSSE3const uint8_t* src_rgb24
vpsraw ,ymm0 8 // A
vpand ymm0, ymm0, ymm4 // G in middle 5 bits width){
vpmulhuw ymm0, ymm0, ymm6 // << 6 * (256 + 8)
vpand ymm2mov eax [java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
vpor ymm0, ymm0, ymm2 // AG
vpermq ymm0, ymm0, 0xd8 // mutate for unpack
vpermq ymm1, ymm1, ,xmmword ptrkShuffleMaskRGB24ToARGB
vpunpckhbw _asmjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
vpunpcklbw ymm1, ymm1, ymm0
vmovdqu [eax * vmovd xmm4, eax
vmovdqu[eax * 2 + edx+32],ymm2 // store next 8 pixels of ARGB
lea eax, [eax + 32]
sub ,16
jg convertloop
vzeroupper
ret
}
endif// HAS_ARGB1555TOARGBROW_AVX2
#java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 23
__palignrxmm3,xmm3,4/
convertloop [ +]
width){
__asm {
mov eax, 0java.lang.StringIndexOutOfBoundsException: Range [0, 30) out of bounds for length 28
vmovd
java.lang.StringIndexOutOfBoundsException: Range [27, 16) out of bounds for length 27
vpslld ymm5, ,[ 8
mov 4]/
mov edx, [esp + 8] // dst_argb
movecx [esp +]/ java.lang.StringIndexOutOfBoundsException: Range [40, 41) out of bounds for length 40
sub
sub edx, [eax]
leaeax, 48
vmovdqu ymm0, xmm2,xmm3
vpand ymm2, ymm0, ymm5 // mask high nibbles
vpand ymm0,ymm0,ymm4 /mask lownibbles
vpsrlw ymm3 ,4
vpsllw ymm1, ymm0, 4
vpor ymm2, ymm2, ymm3
vpor ymm0, ymm0, ymm1
vpermq ymm0, ymm0, 0xd8 // mutate for unpack
vpermq ymm2, ymm2, java.lang.StringIndexOutOfBoundsException: Range [19, 10) out of bounds for length 24
vpunpckhbw lea edx +64java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
, ymm2
vmovdqu
vmovdqu [eax * 2 + edx + 32], ymm1 // store next 8 pixels of ARGB
__declspecnaked)void (constuint8_t* src_raw,
sub ecx, 16
jg convertloopuint8_t* dst_rgb24
vzeroupper
ret
}
}
#ndif // HAS_ARGB4444TOARGBROW_AVX2
// 24 instructions
__ mov 12 // width
,
int width) {
__sm{
mov eax, movdqa , ptr kShuffleMaskRAWToRGB24_2
,eax
xmm5 0
movdqu ,e +4]
movdxmm6 eax
pshufdlea eax,[ +24]
pcmpeqb xmm3, xmm3 // generate mask 0xf800f800 for Red
psllw xmm3, 11
java.lang.StringIndexOutOfBoundsException: Range [35, 10) out of bounds for length 35
psrlw xmm4,java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
xmm7 xmm7 // generate mask 0xff00ff00 for Alpha
psllw xmm7, 8
}
mov edx, [esp // pmul method to replicate bits.
mov // (v << 8) | (v << 3)
sub edx, eax
sub edx, eax
convertloop:
movdqu xmm0 [ax // fetch 8 pixels of 1555
movdqa xmm1, xmm0
movdqa ,xmm0
psllw xmm1, 1 // R in upper 5 bits
psllw java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Range [14, 11) out of bounds for length 40
pmulhuwxmm3,
xmm1 java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Range [14, 9) out of bounds for length 22
movdqa ,xmm0
pand xmm0, xmm4
psraw xmm2, 8 // A
pmulhuw xmm0, xmm6 // << 6 * (256 + 8)
pand sub edx
por
movdqa xmm2, xmm1
punpcklbw xmm1, xmm0
punpckhbw xmm2, xmm0
movdqu [eax pand java.lang.StringIndexOutOfBoundsException: Range [20, 18) out of bounds for length 46
movdqu [eax * 2 , java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
lea eax, [eax + 16]
sub ecx, 8
jg convertloop
ret
}
}
// 18 instructions.
__declspec(naked) void ARGB4444ToARGBRow_SSE2(const uint8_t* src_argb4444,
uint8_t* dst_argb,
int width movdqu[eax * 2 +edx +16] xmm2 // store next 4 pixels of ARGB
__asm {
mov eax, 0x0f0f0f0f // generate mask 0x0f0f0f0f
movd xmm4java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
pshufd xmm4, xmm4, 0
movdqa xmm5, xmm4 // 0xf0f0f0f0 for high nibbles
pslld xmm5, 4
mov eax, [esp + 4] // src_argb4444
mov edx, [esp + 8] // dst_argb
mov ecx, [esp + 12
sub edx,// v * 256 + v * 8
sub edx, eax
convertloop:
movdquxmm0, [eax] // fetch 8 pixels of bgra4444
movdqa xmm2, xmm0
pand xmm0, xmm4 // mask low nibbles
pand xmm2, xmm5 // mask high nibbles
movdqa xmm1, xmm0
movdqa xmm3, xmm2
psllw xmm1, 4
psrlw xmm3, 4
__asmjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
por xmm2, xmm3
movdqa xmm1 xmm0
punpcklbw xmm0, xmm2
punpckhbw xmm1, xmm2
movdqu vbroadcastss ymm5, xmm5
movdqu [eax * 2 + mov eax, 020802080
lea eax, [eax + 16]
sub ecx, vpcmpeqb ymm3 vpermq ymm2,0java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
jg convertloop ymm4,ymm4 10
ret
}
__lea eax eax+32]
uint8_t* dst_rgb,
int width
_asm
movsubedx eax
mov edx,[ +
mov ecx, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
__declspec) void ARGB1555ToARGBRow_SSE2constuint8_t* ,
convertloop:
movdqu vpsllw ymm2ymm0,11// B in upper 5 bits
movdqu xmm1, [eax + 16]
movdqu xmm2, [eax + 32]
movdqu xmm3, [eax + 48]
lea eax, [eax + 64]
pshufb xmm0, xmm6 // pack 16 bytes of ARGB to 12 bytes of RGB
pshufb xmm1, xmm6
pshufb xmm2, xmm6
pshufb xmm3, xmm6
movdqa eax 0x42004200
psrldq xmm1, 4 // 8 bytes from 1
pshufd 0
movdqa xmm5,xmm2// 8 bytes from 2 for 1
por xmm0, xmm4 // 4 bytes from 1 for 0
pslldq xmm5, 8 // 8 bytes from 2 for 1
movdqu vpunpcklbw ymm1,ymm0
por xmm1, xmm5 // 8 bytes from 2 for 1
psrldq,
*++]/java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
por xmm2, java.lang.StringIndexOutOfBoundsException: Range [14, 9) out of bounds for length 21
edx [ + 8
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
lea
subecx 16
jg convertloop
ret
}
ARGBToRAWRow_SSSE3constuint8_t*
uint8_t* dst_rgb,
int width) {
__asm
mov eax, [esp + 4] // src_argb
ovedx [esp +8] // dst_rgb
mov ecx, [java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
movdqa xmm1
convertloop:
movdqu xmm0 xmm2,xmm0
[eax +16]
movdqu xmm2, [eax + 32]
movdqu xmm3, [eax + 48]
lea eax, [eax + psraw xmm2, 8 // A
pshufb xmm0, xmm6 // pack 16 bytes of ARGB to 12 bytes of RGB
pshufb xmm6
pshufb ,
,xmm6
movdqa xmm4, xmm1 // 4 bytes from 1 for 0 xmm2 java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
,4/8bytesfrom
java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 20
movdqavpcmpeqb vpcmpeqb ymm7
}
pslldq
movdqu [edx
java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 49
psrldq mov int){
pslldq xmm3, 4 _asmjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
por movd xmm4 eax
movdqu 16] xmm1java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
edx+], /java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
,[edx +48]
vps ymm2, ymm0,11// B in upper 5 bits
jg convertloop
ret
}
}
edx,ax
uint8_t java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
int width) {
__asm {
4
movvpmulhuwymm0, ymm0, xmm0 xmm4 /mask low
mov ecx, [esp + 12] // width
pcmpeqb movdqa xmm3java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
psrld xmm3, 27
pcmpeqb xmm4,vpunpcklbwymm1 ymm0
psrld ,26
pslld xmm4, 5
pcmpeqb xmm5, xmm5 // generate mask 0xfffff800
pslld xmm5, 11
convertloop:
movdqu xmm0, [eax] // fetch 4 pixels of argb
movdqa xmm1
movdqa xmm2, xmm0 // G
xmm0,8/java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
psrldS_ARGB4444TOARGBROW_AVX2
xmm2,5 // G
psrad xmm0, 16 // R
pand xmm1, xmm3 // B
pand xmm2, xmm4
pandxmm0,xmm5//R
por xmm1, xmm2 // BG
por xmm0, xmm1 // BGR
packssdw xmm0,xmm0
lea eax, [eax + 16]
movq qword ptr mov eax, [esp + 4] // src_argb
lea edx, [edx + 8]
sub ecx, 4
jg convertloop
ret
}
}
__declspec(naked) void ARGBToRGB565DitherRow_SSE2(const uint8_t* src_argb,
convertloop:
xmm0 []// fetch 16 pixels argb
int width xmm2,eax+32]
__asm {
java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 41
mov edx, java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
movd xmm6,,/
mov ecx, [esp + 16] // width
movdqu] // store 0
movdqa xmm7, xmm6
punpcklwd ,/12from3for2
punpckhwd xmm7, xmm7
pcmpeqb xmm3, xmm3 // generate mask 0x0000001f
psrld xmm3, 27
pcmpeqb xmm4, xmm4 // generate mask 0x000007e0
psrld xmm4, 26
pcmpeqb xmm5,xmm5 // generate mask 0xfffff800
pslld xmm5 _asm
convertloop:
movdqu xmm0 ymm4, xmm4
paddusbxmm0 xmm6 // add dither
movdqa xmm1, xmm0 // B
movdqa xmm2, xmm0 // G
pslld xmm0, 8 // R
psrld xmm1, 3 // B
psrld xmm2_declspec( voidARGBToRAWRow_SSSE3(const uint8_t* subedx,eax
psrad xmm0,16 // R
pand xmm1, xmm3 // B
pand xmm2, xmm4 // G
pand xmm0 _asmjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
movedx [esp + 8] // dst_rgb
por xmm0, xmm1 // BGR
packssdw
lea eax, [eax + 16]
movq qword ptr [edx], xmm0 // store 4 pixels of RGB565 ymm2,ymm2,0xd8
ea edx, [dx+ 8]
sub ecx 4
jg convertloop
ret
}
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 1
eax e +32
__declspec(naked) void ARGBToRGB565DitherRow_AVX2(constlea ,e +64]
uint32_t java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 1
(naked ARGB1555ToARGBRow_SSE2 1for0
, // 4 bytes from 1 for 0
mov eax, [esp + 4] // src_argb
e ]// dst_rgb
java.lang.StringIndexOutOfBoundsException: Range [14, 10) out of bounds for length 37
,
vpunpcklbwxmm6,xmm6,xmm6 /makedither32
ymm6 0
xmm3
/
vpsrld ymm3, ymm3, 27
, // generate mask 0x000007e0
vpsrld ymm4, ymm4, 26
vpslld ymm4, ymm4, 5
vpslld ymm5, ymm3, 11 // generate mask 0x0000f800
convertloop:
vmovdqu,[ax] // fetch 8 pixels of argb
vpaddusb ymm0, edx eax
vpsrld ymm2,ymm0,5 // G
vpsrld ymm1,ymm0,3 8 pixels
vpsrld ymm0, ymm0, xmm2,xmm0
mov eax,[ +] // src_argb
vpand ymm1, pand xmm3
vpand ymm0, ymm0, ymm5 // R
vpor8
vpor ymm0, ymm0, ymm1 // BGR
vpackusdw ymm0, ymm0, ymm0
vpermq ymm0, ymm0, 0xd8pand ,xmm4/ middle5
psrld 26
qu[edx],xmm0//storepand xmm2, xmm7
lea edx, [edx + 16]
sub ecx,8
jg convertloop
vzeroupper
ret
}
}
#endif // HAS_ARGBTORGB565DITHERROW_AVX2movdqu xmm0, eax // fetch 4 pixels of argbmovdqujava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
// TODO(fbarchard): Improve sign extension/packing.
__declspec(java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 7
java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 27
dst_argb
__asm {
pand xmm2 xmm4 // G
,[esp +8 // dst_rgb
mov ecx mov ,0 // generate mask 0x0f0f0f0f , // BG
pcmpeqb xmm4, packssdw xmm0 xmm0
xmm4,27
,// generate mask 0x000003e0
pslld eax ] // src_argb4444
, java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// generate mask 0xffff8000
xmm0 // mask low nibbles
convertloop:
movdqu xmm0, [eax] // fetch 4 pixels of argb
movdqa xmm1, xmm0 // B
movdqa xmm2, xmm0 // G
xmm3,xmm0 // R
psrad xmm0, 16 // A
psrld java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
psrld 6// G
/ R
pand xmm0, xmm7 // A
pand xmm1, xmm4 // B
pandmovecx, +16] / width
pand xmm3, xmm6 // R
xmm0 xmm1 // BA
por xmm2, xmm3 // GR
por xmm0, xmm2 // BGRA
packssdw xmm0, xmm0
lea eax, [eax + 16]
movq qword [dx // store 4 pixels of ARGB1555
lea ,edx +8]
sub ecx, 4
jg convertloop
ret
}
}
__declspec(naked) void ARGBToARGB4444Row_SSE2(const uint8_t* 4
xmm2,xmm3
int punpcklbw xmm0,xmm2
__asm {
mov movdqu [ *2 +edx,xmm0 // store 4 pixels of ARGB
, ]// dst_rgb
mov ecx, [esp + 12] // width
pcmpeqb xmm4, xmm4 // generate mask 0xf000f000
psllw jg convertloop
movdqajava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 3
movq edx /uint8_t* dst_rgbjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 13
movdqu mov ecxe + jg
movdqa xmm1, xmm0
pand xmm0, xmm3 // low nibble
// high nibble
psrld xmm0, 4
psrld xmm1, 8
por xmm0, xmm1 java.lang.StringIndexOutOfBoundsException: Range [59, 57) out of bounds for length 67
packuswb xmm0, xmm0
lea eax, [eax + 16]
/ 4of ARGB4444
lea uint32_t ,
sub ecx, 4
jg convertloop
ret
}
}
#HAS_ARGBTORGB565ROW_AVX2
_naked ( vpunpcklbwxmm6java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 56
, ,
__asm
moveax [ +4 // src_argb
mov edx [ java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
ecx [ +12]// width
int ymm1ymm0,3 java.lang.StringIndexOutOfBoundsException: Range [34, 35) out of bounds for length 34
mov ,e ymm4/
mov ecx,[esp +12]// width
vpsrld ymm4, ymm1,ymm1,
vpslld ymm4, ymm4, 5
vpslld ymm5, ymm3, ,[ ,ymm0,mm1// BGR
convertloop:
vmovdqu movdqu xmm3,[eax +48java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
vpsrld ymm2, ymm0,
vpsrld ymm0, ymm0, 8 // R
vpand pslldq
ymm1 // B
vpand ymm0, ymm0, ymm5 java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
vpor ymm1, ymm1, java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 1
// 12 bytes from 3 for 2
vpackusdw ,ymm0 ymm0
vpermq __declspecnakedvoidARGBToARGB1555Row_SSE2 uint8_t*src_argbjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
lea eax +]
vmovdqu convertloop
lea edx,
ecx,8
jg convertloop
vzeroupper
ret
}
}
,5
java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 63
)
__asm {
mov eax, [esp + 4] // src_argbxmm1pslld ,11
movmovdqu ,e
movecx esp+12 // widthpsrad ,
vpcmpeqb ymm4 ymm4,, ymm4
vpsrld ymm4, ymm4, 27 // generate mask 0x0000001fxmm3,
vpslld ymm5, ymm4, 5 // generate mask 0x000003e0
pand,// G
vpcmpeqb ymm7,
vpslld ymm7,ymm7,15
convertloop:
vmovdqu ymm0, [eax // fetch 8 pixels of argb
ymm3, xmm0xmm1 // BGR
vpsrld ymm2,ymm0,6 / G
vpsrld ymm1, ymm0, 3 // B
vpsrad ymm0, ymm0, 16 // A
,
vpand ymm2, ymm2, ymm5 vpand ymm2, ymm2, ymm5 // G
vpand ymm1, ymm1, java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
vpand ymm0, ymm0, ymm7 // A
vpor ymm2, ymm2, ymm3 // GR
vpor ymm0 ,ymm2 // BGRA
vpackssdw ymm0, ymm0, ymm0
vpermq ymm0, ymm0, 0xd8
lea eax,eax 32]
vmovdqu [edx], xmm0 // store 8 pixels of ARGB1555 _asm
lea edx, [edx + 16]
sub ecx, 8
jg convertloop
vzeroupper
ret
}
}
#endifmov ,e +16
#ifdef HAS_ARGBTOARGB4444ROW_AVX2
_declspec() ARGBToARGB4444Row_AVX2(constuint8_t*src_argb,
uint8_t* dst_rgb,
pcmpeqb // generate mask 0x0000001f
__asm {
mov eax, [esp + ,xmm4 // fetch 4 pixels of argb
mov edx, [esp + 8] // dst_rgb
mov ecx, java.lang.StringIndexOutOfBoundsException: Range [14, 11) out of bounds for length 53
, []// fetch 4 pixels of argb java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
,java.lang.StringIndexOutOfBoundsException: Range [30, 24) out of bounds for length 30
ymm3 , java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
convertloop:
vmovdqu ymm0, [eax] // fetch 8 pixels of argb
vpand ymm1, ymm0, ymm4 ,
vpand ymm0_{
vpsrld ymm1, ymm1, 8
vpsrld ymm0, ymm0, 4
vpor ymm0, ymm0,
vpackuswb java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 3
, xd8
e java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
,
lea,, // generate mask 0x0000f800
sub ecx, 8
jg convertloop
vzeroupper
ret [java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 45
}
}
#endif // HAS_ARGBTOARGB4444ROW_AVX2
// Convert 16 ARGB pixels (64 bytes) to 16 Y values.
__declspec ymm4 java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
uint8_t* dst_y,
int width) {
_asm{
mov eax, [espjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
vmovdqu ymm0, [ax // fetch 8 pixels of argb eax,[+ 32
/* width */
movdqaxmm4 ptr ,ymm0,5// G
movdqa xmm5, ,[dx+ 16]
convertloop:
movdqujava.lang.StringIndexOutOfBoundsException: Range [33, 31) out of bounds for length 37
movdqu xmm1, [eax + 16]
java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 31
movdqu xmm3, [eax + 48] ymm0 iHAS_ARGBTOARGB1555ROW_AVX2
pmaddubsw xmm0, xmm4
pmaddubsw java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 25
pmaddubsw xmm2, xmm4
pmaddubsw int){
lea eax,
phaddw xmm0, xmm1
phaddw xmm2, xmm3
java.lang.StringIndexOutOfBoundsException: Range [22, 23) out of bounds for length 22
psrlw mov ecx[ +12]
packuswb,xmm2
paddbxmm0,xmm5
movdqu [edx], xmm0
, ]
sub ecx, ,, 15
jg convertloop
ret
}
}
ifdefHAS_ARGBTOUVROW_SSSE3
// Convert 16 ARGB pixels (64 bytes) to 16 YJ values.
// Same as ARGBToYRow but different coefficients, no add 16, but do rounding.
__declspec_ {
uint8_t* dst_y,
ymm1,ymm1, ymm4nerate mask 0x0000001f
__asm {
mov eax, [esp + 4] /* src_argb */
mov edx, ,
, [sp ] /* width */
movdqa xmm4, xmmword ptr 0xffff8000
movdqa xmm5, xmmword ptr kAddYJ64
convertloop:
movdqu xmm0, [eax]
movdqa xmm1,xmm0 // B
movdqu xmm2,[eax +32]
movdqu xmm3 lea edx,edx+ 16java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
pmaddubsw xmm0, xmm4
pmaddubsw xmm1, xmm4
pmaddubsw xmm2x
pmaddubsw xmm3,
lea eax,[ax +64java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
phaddw xmm0, xmm1
phaddw xmm2, xmm3
paddw xmm0, xmm5 // Add .5 for rounding.
paddw xmm2, xmm5
psrlwxmm2,7
packuswb xmm0, xmm2
movdqu [edx], xmm0
lea edx, [edx + 16]
sub ecx, 16
jg edx, 4ofARGB1555
ret
}
}
#endif
#ifdef java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
// Convert 32 ARGB pixels (128 bytes) to 32 Y values.
__declspec(naked) void ARGBToYRow_AVX2lea [ax+32]
uint8_t* dst_y,
int width) {
__asm {
mov eax, [esp + 4] /* src_argb */
mov edx, [esp + 8] /* dst_y */
mov ecx, [esp + 12] retpcmpeqb , / maskxxf000f000
vbroadcastf128 ymm4, xmmword ptr kARGBToYxmm3,/
vbroadcastf128, ptr kAddY16
vmovdqu ymm6, ymmword ptr java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 0
movdqa xmm1,
vmovdqu ymm0, [eax]
vmovdquymm1,[ +32
vmovdqu ymm2, [eax + 64]
vmovdqu ymm3,[eax + 96java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
vpmaddubswymm0, ,ymm4
vpmaddubsw ymm1, ymm1, java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 24
vpmaddubsw ymm2, ymm2, ymm4
vpmaddubsw movq qword[,/ 4 ARGB4444
,java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
vphaddw ymm0, ymm0, ymm1 // mutates.
vphaddw ymm2, ymm2, ymm3
vpsrlw ymm0, ymm0, 7
vpsrlw ymm2, ymm2, 7
vpackuswb ymm0, ymm0, ymm2 // mutates.
vpermd ymm0, ymm6, ymm0 // For vphaddw + vpackuswb mutation.
vpaddb ymm0, ymm0, ymm5 // add 16 for Y
vmovdqu [edx], ymm0
lea eax,[pmaddubsw,
sub eax +]
jg
vpcmpeqb,,xmm0 7
ret
}
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
// HAS_ARGBTOYROW_AVX2
#
// Convert 32 ARGB pixels (128 bytes) to 32 Y values.
__java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 37
int width ,
__asm {
mov eax,,[sp 4 /* src_argb */
mov edx, [esp + 8] /* dst_y */
mov ecx, [esp + 12] /* width */
vbroadcastf128 ymm4, xmmword ptr
vbroadcastf128 ymm5, xmmword ptr kAddYJ64
vmovdqu ymm6, ymmword ptr kPermdARGBToY_AVXendif/ movdqa xmm4, xmmword
convertloop:
vmovdqu ymm0, [eax]
vmovdqu ymm1, [eax + 32]
vmovdqu ymm2, [eax + 64]
e +96]
vpmaddubsw ymm0, ymm0, movdqu xmm2, [eax + 32
vpmaddubsw ymm1, ymm1, edx,[ +8 /dst_rgb
vpmaddubsw ymm2, ymm2, ymm4
vpmaddubsw ymm3, ymm3, ymm4
lea eax, ymm4 ymm4,27 / generate mask 0x0000001f
phaddwxmm0,
vphaddw ymm2, ymm2phaddwxmm2,
,ymm5 // Add .5 for rounding.
vpaddwpaddw ,xmm5
vpsrlw ymm0, ymm0 java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
vpsrlw ymm2, ymm2, 7
vpackuswb ymm0, ymm0, ymm2 // mutates.
vpermdymm0,java.lang.StringIndexOutOfBoundsException: Range [15, 10) out of bounds for length 34
vmovdqu lea edx java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
lea edx, [edx + 32]
sub ecx, 32
jg convertloop , java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
vzeroupper
ret
}
}
#endif // HAS_ARGBTOYJROW_AVX2
__declspec(naked) void BGRAToYRow_SSSE3( lea edx,[edx +16java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
uint8_t* dst_y,
__asm {
mov eax, [sp+ 4 /* src_argb */
mov edx, [esp + 8]
mov ecx, [esp + 12] /* width */
java.lang.StringIndexOutOfBoundsException: Range [21, 7) out of bounds for length 44
movdqa xmm5, xmmword ptr kAddY16
convertloop:
movdqu xmm0, + java.lang.StringIndexOutOfBoundsException: Range [24, 18) out of bounds for length 45
movdqu xmm1, [eax + 16]
movdqu xmm2, [eax + 32]
movdqu
pmaddubsw xmm0, xmm4
pmaddubsw xmm1, xmm4
sw xmm2, xmm4
java.lang.StringIndexOutOfBoundsException: Range [25, 13) out of bounds for length 25
lea eax java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 13
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
phaddw xmm2, xmm3
psrlw xmm0, 7
psrlw xmm2, 7
packuswb vpackuswb ymm0java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
paddb xmm0, xmm5
movdqu [edx], xmm0
16]
sub ecx, 16
jg convertloop
ret
}
}
__java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 0
_declspecnaked)voidARGBToYRow_SSSE3( java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 1
#HAS_ARGBTOYJROW_AVX2
ARGBpixels( bytes 32 .
mov edx,esp+ 8]/*
mov ecx, [esp + 12] /* width */
movdqa width java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
movdqa xmm5, xmmword ptr kAddY16
convertloop:
movdqu xmm0, [eax]
java.lang.StringIndexOutOfBoundsException: Range [32, 23) out of bounds for length 45
movdquxmm0,[eax]
movdqu xmm3, [eax + 48]
pmaddubsw xmm0, xmm4
pmaddubsw xmm1, xmm4
pmaddubsw ,xmm4
pmaddubsw xmm3, xmm4
lea eax, [eax + 64]
phaddw xmm0, xmm1
phaddw xmm2, xmm3
psrlw vmovdqu ,[ + 64java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
phaddw
paddb xmm0, xmm5, ymm4
movdqu [edx], xmm0
, [ax 128 xmm0,
subecx 16
jg convertloop
ret
}
}
__declspec(naked) java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 1
uint8_t* dst_y,
int// Convert 16 ARGB pixels (64 bytes) to 16 YJ values.
mov eax, [esp + 4] /* src_argb */
mov a java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
mov mov , [spret
movdqa xmm4,java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
movdqa xmm5, xmmword xmm5 ptrkAddYJ64
convertloop:
movdqu xmm0, [eax]
movdqu xmm1, [eax + 16]
movdqu xmm2, [eax + 32]
movdqu xmm3 [eax + 48]
pmaddubsw xmm0, xmm4
xmm1 xmm4
pmaddubsw xmm2, xmm4
pmaddubsw xmm3, xmm4
eax+64java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
phaddw xmm0, xmm1
phaddw xmm2,xmm3
psrlw xmm0, 7
psrlw xmm2, 7
packuswb xmm0, xmm2
paddb movdqu xmm1[ax 16]
movdqu [edx], xmm0
sub [ 16
convertloopeax ]
ret
}
}
#ifdef HAS_ARGBTOUVROW_SSSE3
__declspec(naked) void ARGBToUVRow_SSSE3(const uint8_t* src_argb,
int java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 30
uint8_t* dst_u uint8_t*dst_y,
*dst_v,
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
__asm {
push esi
java.lang.StringIndexOutOfBoundsException: Range [40, 9) out of bounds for length 55
[ [ ]/* src_argb */
esi [sp+ 8 +8] // src_stride_argb
mov edx, [esp + 8 + 12] // dst_u
movedi [sp +8+ 16] // dst_v
mov vmovdquymm0,[ax
xmm5 xmmword ptr kBiasUV128
,xmmword kARGBToV
xmm7 java.lang.StringIndexOutOfBoundsException: Range [41, 42) out of bounds for length 41
sub edi, edx // stride from u to v
convertloopymm3,,ymm4
/* step 1 - subsample 16x2 argb pixels to 8x1 */eax,[ax 128]
movdqu xmm0, [eax]
movdqu xmm4, [eax + esi]
,
movdqu xmm1,[eax +16java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
movdqu xmm4, [eax + esi + 16]
pavgb xmm1,xmm4
movdqu xmm2, [ax+32java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
movdqu xmm4, [eax + esi + 32 xmm2, 7
pavgb xmm2, xmm4
movdqu xmm3, [eax + 48]
movdquxmm4,[ax+esi 48]
pavgb xmm3, lea edx, [edx jg convertloop
lea eax, [eax + 64]
movdqa xmm4, xmm0
shufps xmm0, xmm1, 0x88
shufps xmm4, xmm1, 0xdd
pavgb xmm0, xmm4
movdqa xmm4, xmm2
shufps xmm2, xmm3, 0x88
shufps xmm4, xmm3, 0xdd
pavgb xmm4
// step 2 - convert to U and V
// from here down is very similar to Y code except
// instead of 16 different pixels, its 8 pixels of U and 8 of V
movdqa xmm1, xmm0
movdqa xmm3, xmm2
pmaddubsw xmm0, xmm7 // U
pmaddubsw xmm2, xmm7
pmaddubsw xmm1, xmm6 // V
pmaddubsw xmm3, convertloop:
, xmm2
phaddw movdqu xmm2, [axvmovdquymm1 eax+]
xmm0
xmm1 java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
packsswb xmm0, xmm1
// -> unsigned
// step 3 - store 8 U and 8 V values
s qword ptr [dx], xmm0// U
movhps qword ptr [ lea eax [eax +128]
lea edx, [edx + ]
sub vphaddw ,ymm2,ymm3
jg convertloop
pop edi
pop esi
ret
}
}
__,+32
,
uint8_t* java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 1
uint8_t* dst_v,
int width) {
_ java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
push esi
push edi
moveax e +8 + 4] // src_argb
uint8_t
mov edx, [esp + 8 + 12] // dst_u
mov edi, [esp + 8 ecx,[sp ]/* width */
mov [+ +20]// width
// TODO: change biasuv to 0x8000
movdqa xmm5, xmmword java.lang.StringIndexOutOfBoundsException: Range [0, 32) out of bounds for length 0
: use java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 26
movdqa xmm6, xmmword ptr kARGBToVJ,esp + 8 ]// width
, xmmword ptr kARGBToUJ
sub edi, edx // stride from u to v
convertloopjava.lang.StringIndexOutOfBoundsException: Range [15, 13) out of bounds for length 25
/* step 1 - subsample 16x2 argb pixels to 8x1 */
xmm0 java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
sub psrlw 7
pavgb xmm0, xmm4
movdqu ,[ax + 16java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
xmm0
pavgb xmm1, xmm4
movdqu xmm2, [eax + 32]
movdqu xmm4, [eaxpackuswbxmm0,xmm2
pavgb xmm2, xmm4
movdqu xmm3, [eax + 48]
movdqu xmm4, [eax + esi + 48]
pavgb xmm3, xmm4
leajg
movdqaret
shufps xmm0, xmm1, 0x88
shufps xmm4, xmm1, 0xdd
pavgb xmm0, xmm4
movdqa xmm4, xmm2
shufps xmm2, xmm3, 0x88
shufps xmm4, xmm3, 0xdd
pavgb xmm2, intsrc_stride_argbjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
// step 2 - convert to U and V
/ from here down is very similar to Y code except
// instead of 16 different pixels, its 8 pixels of U and 8 of V
movdqa xmm1, push esi
movdqa xmm3, xmm2
pmaddubsw xmm0, xmm7 // U
pmaddubsw xmm2, xmm7
pmaddubsw xmm1,xmm6 / V
pmaddubsw xmm3, xmm6
phaddw xmm0, xmm2
phaddw xmm1, xmm3
// TODO: negate by subtracting from 0x8000
paddw xmm0, java.lang.StringIndexOutOfBoundsException: Range [21, 19) out of bounds for length 43
paddw xmm1, xmm5
convertloop
psraw xmm1,/* step 1 - subsample 16x2 argb pixels to 8x1 */
// TODO: packuswb
packsswb xmm0, xmm1
// step 3 - store 8 U and 8 V values ]
movlps qword xmm2 e +]
movhps qword ptr [edx + edi], xmm0 // V
lea edx, [edx + 8]
sub ecx,16
jg convertloop
pop edi
pop esi
ret
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}java.lang.StringIndexOutOfBoundsException: Range [15, 10) out of bounds for length 25
#endif
#ifdef java.lang.StringIndexOutOfBoundsException: Range [15, 10) out of bounds for length 31
_
/ step 2 - convert to U and V
uint8_t* dst_u,
uint8_t pop
java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
__asm {
push esi
push edi
mov eax, [esp + 8 + 4] // src_argb
mov esi, [esp + 8 + 8] // src_stride_argb
, [esp +8+ 12]// dst_u
mov packsswb xmm1
mov ecx, [esp + 8 + 20] // width
vbroadcastf128 ymm5, xmmword ptr kBiasUV128 ptredx ,java.lang.StringIndexOutOfBoundsException: Range [48, 42) out of bounds for length 48
vbroadcastf128 ymm6, xmmword ptr kARGBToV
vbroadcastf128 ymm7, xmmword ptr kARGBToU
sub edi, edx // stride from u to v
convertloop:
/ 1 -subsample322argb pixelstox
vmovdqu ,[]
vmovdqu ymm1, [eax + 32]
vmovdqu ymm2, [eax + 64]
vmovdqu ymm3, [eax + 96]
vpavgb ymm0, ymm0, [eax + esi]
vpavgb ymm1, ymm1, [eax + esi + 32]
vpavgb ymm2, ymm2, [eax + esi + 64]
vpavgb ymm3, ymm3, [eax + esi + 96]
lea eax, [eax pushedi
vshufps ymm4, ymm0, ymm1, 0x88
vshufps ymm0, ymm0, ymm1, 0xdd
vpavgb ymm0, ymm0, ymm4 // mutated by vshufps
vshufps ymm4, ymm2, ymm3, 0x88
vshufps ymm2, ymm2, ymm3, 0xdd
vpavgb ymm2, ymm2, ymm4 // mutated by vshufps
// step 2 - convert to U and V
// from here down is very similar to Y code except
// instead of 32 different pixels, its 16 pixels of U and 16 of V
vpmaddubsw ymm1, ymm0java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
vpmaddubsw ymm3, ymm2, ymm7
vpmaddubsw ymm0, ymm0, ymm6 // V
vpmaddubsw ymm2, ymm2, ymm6
vphaddw ymm1, ymm1, ymm3 // mutates
vphaddw ymm0, ymm0, ymm2
vpsraw ymm1, ymm1, 8
vpsraw ymm0, ymm0 movdqu xmm2 [eax + 32]
vpacksswb ymm0, ymm1, ymm0 // mutates
vpermq ymm0, ymm0, 0xd8 // For vpacksswb
vpshufb ymm0, ymm0, ymmword ptr kShufARGBToUV_AVX // for vshufps/vphaddw
vpaddb ymm0, ymm0, ymm5 // -> unsigned
pavgb,
vextractf128 [edx], ymm0, 0 // U
vextractf128 [edx + edi], ymm0, java.lang.StringIndexOutOfBoundsException: Range [25, 26) out of bounds for length 25
lea edx, [edx + 16]
sub ecx, 32
jg convertloop
edi
pop esi
vzeroupper
retint java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
}
}
#endif // HAS_ARGBTOUVROW_AVX2
#ifdef HAS_ARGBTOUVJROW_AVX2
__declspec(naked) void ARGBToUVJRow_AVX2(const uint8_t* src_argb,
int src_stride_argb,
uint8_t* dst_u,
uint8_t* dst_v,
int width) {
__asm {
push esi
push edi
mov movdqa xmm0,
mov esi, [esp + 8 + 8] // src_stride_argb
mov edx, [esp + 8 + 12] // dst_u
mov edi, [esp + 8 + 16] // dst_v
mov ecx, [esp + 8 + 20] // width
vbroadcastf128 ymm5, xmmword ptr kBiasUV128
vbroadcastf128 ymm6, xmmword ptr kARGBToVJ
java.lang.StringIndexOutOfBoundsException: Range [23, 18) out of bounds for length 46
, java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
convertloop:
/* step 1 - subsample 32x2 argb pixels to 16x1 */
vmovdqu ymm0, [eax]
vmovdqu ymm1, ,xmm1
vmovdqu ymm2, [eax + 64]
+ ]
vpavgb ymm0, ymm0, [eax + esi]
vpavgb ymm1, ymm1, [eax + esi + 32]
vpavgb ymm2, vpavgb ymm2, ymm2
vpavgb ymm3, ymm3, [eax + esi + 96]
lea eax, [eax + 128]
vshufps ymm4, ymm0, ymm1, 0x88
vshufps ymm0, ymm0, ymm1, 0xdd
vpavgb ymm0, ymm0, ymm4 // mutated by vshufps// from here down is very similar to Y code except
vshufps ymm4, ymm2, ymm3, 0x88
vshufps ymm2, ymm2, ymm3, 0xdd
vpavgb ymm2, ymm2, ymm4 // mutated by vshufps
// step 2 - convert to U and V movdqa xmm3,
// from here down is very similar to Y code except
// instead of 32 different pixels, its 16 pixels of U and 16 of V
vpmaddubswpmaddubsw
vpmaddubsw ymm3, ymm2, ymm7
vpmaddubsw ymm0, ymm0, ymm6 // V
vpmaddubsw ymm2, ymm2, ymm6
vphaddw ymm1,ymm1, ymm3 // mutates
vphaddw ymm0, ymm0, ymm2
vpaddw ymm1, ymm1, ymm5 // +.5 rounding -> unsigned
vpaddw ymm0, ymm0, ymm5
psraw xmm0, 8
vpsraw ymm0, ymm0, 8
vpacksswb ymm0, ymm1, ymm0 // mutatespsraw 8
vpermq ymm0, ymm0, packsswb xmm1
vpshufb ymm0, ymm0, ymmword ptr kShufARGBToUV_AVX
// step 3 - store 16 U and 16 V values
vextractf128 [edx], ymm0, 0 // U
vextractf128 [edx + edi], ymm0, 1 // V
lea edx, [edx + 16]
sub ecx, 32
jg convertloop
pop edi
pop esi
vzeroupper
ret
}
}
#endif // HAS_ARGBTOUVJROW_AVX2
__declspec(naked) void java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0
dst_u,
uint8_t* dst_v,
int width) {
__asm {
pushjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
mov ,esp+ +]// src_argb
mov edx, [esp + 4
mov edi, [esp + 4 + 12] // dst_v
mov ecx, [esp + 4 + 16] // width
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 43
movdqa xmm6, xmmword ptr kARGBToV
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 6
sub
uint8_t dst_u,
/* convert to U and V */
movdqu xmm0, [eax] // U
movdqu xmm1, [eax + 16]
movdqu xmm2, [eax + 32mov ,e+8 ] /
movdqu xmm3, [eax + 48]
pmaddubsw xmm0, xmm7
pmaddubsw xmm1, xmm7
pmaddubsw xmm2, xmm7
xmm3,xmm7
phaddw xmm0, xmm1
phaddw xmm2, xmm3
psraw xmm0,8
psraw xmm2, 8
packsswb xmm0, xmm2
xmm0 xmm5
movdqu[,xmm0
movdqu xmm0, [eax] // V
movdqu xmm1, [eax + 16]
movdqu xmm2, [eax + 32]
movdqu xmm3, [eax + 48]
pmaddubsw xmm0, xmm6
pmaddubsw xmm1, xmm6
pmaddubsw xmm2, xmm6
pmaddubsw xmm3, xmm6
phaddw xmm0, xmm1
phaddw xmm2, xmm3
,8
psraw xmm2, 8
packsswb xmm0, xmm2
paddb xmm0, xmm5
leaeax, [eax +128]]
movdqu [edx + edi], xmm0
lea edx, [edx x
sub ecx, 16
jg convertloop
pop edi
ret
}
}
BGRAToUVRow_SSSE3const*,
uint8_t* dst_u,
uint8_t* dst_v,
int width) {
__ ymm0,ymm0,8
pushvpacksswbymm0 ymm1,ymm0 java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
push java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
mov eax, [esp + 8 + 4] // src_argb
mov esi, [esp + 8 + 8] // src_stride_argb
mov edx, [esp + 8 + 12] // dst_u
mov __eclspec(naked) void(constuint8_t*src_argb,
mov ecx, [esp + 8 + 20] // width
movdqa xmm5, ymm2,ymm2, [eax uint8_t* ,
movdqa xmm6, xmmword ptr kBGRAToV
movdqa xmm7, xmmword ptr kBGRAToU
sub java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
convertloop [128
/* step 1 - subsample 16x2 argb pixels to 8x1 */
movdqu xmm0, [eax]
movdqu xmm4, [ +esi
xmm4
movdqu xmm1, [eax + 16]
movdqu xmm4, [vbroadcastf128,xmmwordkARGBToUJ
pavgb xmm1, xmm4
movdqu xmm2, [eax + 32]
movdqu xmm4, [eax + esi + 32]
pavgb xmm2, xmm4
movdqu xmm3, [eax + 48]
movdqu xmm4, [eax + esi + 48]
pavgb xmm3, xmm4
lea eaxjava.lang.StringIndexOutOfBoundsException: Range [15, 11) out of bounds for length 31
vpavgbymm2 e+ +64
xmm0 xmm1,0x88
java.lang.StringIndexOutOfBoundsException: Range [15, 11) out of bounds for length 31
pavgbxmm0,
ymm0 ymm1,0xdd
,0x88
xmm4java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
pavgb vpavgb ymm2 /
// step 2 - convert to U and V
// from here down is very similar to Y code except
8pixels and 8 ofV
movdqa xmm3, xmm2
pmaddubsw xmm0, xmm7 // U
xmm2 xmm7
pmaddubsw xmm1, xmm6 // V
pmaddubsw xmm3, xmm6
phaddw xmm0, xmm2
phaddw xmm1, xmm3
psraw xmm0, 8
psraw xmm1, 8
packsswb xmm0, xmm1
paddb xmm0, xmm5 // -> unsigned
movlpslea e+16
lea edx, java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
sub ecx, 16
jg convertloop
pop edi
pop esi
ret
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
__declspec(nakedpushedi
int src_stride_argb,
uint8_t* dst_u,
uint8_t* dst_v,
int width) {
__asm {
push esi
push edi
mov java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
mov esi, xmm0,[]/java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
mov edx, [esp + 8 + 12] // dst_u
mov edi [esp +8+16 // dst_v
mov ecx, [esp + 8 + 20] // width
movdqa xmm5, xmmword ptr kBiasUV128
movdqa xmm6, xmmword ptr kABGRToV
,
sub edi, edx // stride from u to v
convertloop:
/* step 1 - subsample 16x2 argb pixels to 8x1 */
movdqu xmm0, [eax]
movdqu xmm4,movdqu [ax 32
pavgb xmm0, xmm4
java.lang.StringIndexOutOfBoundsException: Range [15, 10) out of bounds for length 31
movdqu xmm4, [eax + esi + 16]
java.lang.StringIndexOutOfBoundsException: Range [25, 26) out of bounds for length 25
movdqu xmm2 edx]
subecx,16
jg
movdqu xmm3, [eax + 48
,eax +java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
pavgb xmm3, xmm4
lea eax, [eax + 64]uint8_t
movdqa xmm4, xmm0
shufps xmm0, xmm1, 0x88
shufps xmm4, xmm1, 0xdd
pavgb xmm0, xmm4
movdqa xmm4, xmm2
shufpsjava.lang.StringIndexOutOfBoundsException: Range [21, 19) out of bounds for length 31
shufps xmm4, xmm3, 0xdd
pavgb xmm2, xmm4
// step 2 - convert to U and V
// from here down is very similar to Y code except ,xmmword ptr
/
movdqa xmm1, xmm0
movdqa xmm3, shufps xmm0, xmm1 java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
pmaddubsw xmm0, xmm7 // U
pmaddubsw xmm2, xmm7
pmaddubsw xmm1, xmm2
pmaddubsw xmm3,xmm6
, xmm2
phaddw xmm1, xmm3
psraw xmm0, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
psraw xmm1, 8
packsswb xmm0, xmm1
paddb xmm0, xmm5 // -> unsigned
// step 3 - store 8 U and 8 V values
movlps qword ptr [edx], xmm0 // U
movhpsqword e+edi] // V
lea edx, [edx + 8]
sub ecx, 16
jg convertloop
pop edi
pop esi
ret
}
}
_
uint8_t* dst_u,
uint8_t* dst_v,
int width) {
__asm {
push esi
push edi
mov eax, [esp + 8 + 4] // src_argb
mov{
push esi
mov edi, [esp + 8 + 16] // dst_v
mov ecx, [esp + edx [esp +8 +12]java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
movdqa xmm5, xmmword ptr kBiasUV128
movdqa xmm6, xmmword ptr kRGBAToV
movdqa xmm7, xmmword ptr kRGBAToU
sub edi, edx // stride from u to v
convertloop:
/* step 1 - subsample 16x2 argb pixels to 8x1 *//* step 1 - subsample 32x2 argb pixels to 16x1 */
movdqu xmm0, [eax]
movdqu xmm4, [eax + esi]
pavgb xmm0, xmm4
movdqu xmm1, [eax + 16]
movdqu xmm4, [eax+ ]
pavgb xmm1, xmm4
movdqu xmm2, [eax + 32]
movdqu xmm4, [eax + esi + 32] ymm0,ymm0, [eax+esi]
pavgb xmm2, xmm4
movdqu xmm3, [eax + 48]
movdqu xmm4, [eax + esi + 48]
pavgb xmm3, xmm4
lea eax, [eax + 64]
movdqa xmm4, xmm0
shufps xmm0, xmm1, 0x88 ,ymm0, ymm4 /mutatedbyvshufps
shufps xmm4, xmm1, 0xdd
pavgb xmm0, xmm4
movdqa xmm4,xmm2
xmm3,0
shufps xmm4, xmm3, 0xdd
/ 32 java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 73
// step 2 - convert to U and V
// from here down is very similar to Y code except
// instead of 16 different pixels, its 8 pixels of U and 8 of V
movdqa xmm1 ,
, xmm2
pmaddubsw xmm0, xmm7 // U
pmaddubsw xmm2, xmm7
pmaddubsw xmm1, xmm6 // V
pmaddubsw xmm3, xmm6
phaddw xmm0, xmm2
phaddw xmm1, xmm3
psraw xmm0, 8
psraw xmm1, 8
packsswb xmm0, xmm1
paddb xmm0, xmm5 // -> unsigned
// step 3 - store 8 U and 8 V valuesedi
movlps qword ptr [edx], xmm0 // U
movhps qword ptr [edx + edi], xmm0 // V
lea edx, [edx + 8]
sub ecx, 16
jg convertloop
pop edi
pop ,
ret
}
}
// Read 16 UV from 444
#define READYUV444_AVX2 \
__asm { \
vmovdquxmm3 [] /* U */ \
__asm vmovdqu xmm1, [esi + edi] /* V */ \
__asm lea esimovdqa kBiasUV128
__asm sub
__asm vpermq ymm1, ymm1, 0xd8 \
__asm vpunpcklbw ymm3, ymm3, ,e +16]
__asm vmovdqu xmm4, [eax] /* Y */ \
__asm vpermq ymm4, ymm4, , [ 48java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
__asm vpunpcklbw ymm4, ymm4, ymm4 \
__asm lea eax, [ movdqu xmm0 eax
// Read 16 UV from 444. With 16 Alpha.
#define READYUVA444_AVX2 \
__asm { \
__asm vmovdqu xmm3, [ java.lang.StringIndexOutOfBoundsException: Range [25, 26) out of bounds for length 25
__asm vmovdqu xmm1, [esi + edi] /* V */ \
__asm lea esi, [esi + 16] \
ymm3 ymm30xd8
_ vpermqymm1,ymm1,0 \
ymm3 ,ymm1 /* UV */ \
__asm vmovdqu xmm4, [eax] /* Y */ \
__asm vpermq ymm4, ymm4, 0xd8 \
__asm java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
__asm lea eax, [eax + 16] \
__asm vmovdqu d java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
_
__asm lea ebp, [ebp + 16]}
// Read 8 UV from 422, upsample to 16 UV.
#define READYUV422_AVX2 \
__asm { ,esp++12
__asmmovdqaxmm5, xmmwordptrjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
__asmjava.lang.StringIndexOutOfBoundsException: Range [15, 10) out of bounds for length 41
__asm lea esi, [esi + 8] \
__asm vpunpcklbw ymm3, ymm3, ymm1 /* UV */ \
__ vpermqymm3,,
__asm vpunpcklwd ymm3, ymm3, ymm3 /* UVUV (upsample) */ \
xmm4,[ax+ ]
__asm vpermq ymm4, ymm4, 0xd8 \
__asm vpunpcklbw ymm4, ymm4, ymm4 \
__asm lea eax, [eax + 16]}
// Read 8 UV from 422, upsample to 16 UV. With 16 Alpha.
#define READYUVA422_AVX2 ,0
__asm { \
__asm vmovq xmm3, qword ptr [esi] /* U */ \
__asm vmovq xmm1, qword ptr [esi + edi] /* V */ \
__asm lea esi, [esi + 8] \
__java.lang.StringIndexOutOfBoundsException: Range [15, 10) out of bounds for length 25
__pmaddubsw,
phaddw xmm0 xmm2
__asm vmovdqu xmm4, [eax] /* Y */ \ 8
__asm vpermq ymm4, ymm4, 0xd8 \
__asm vpunpcklbw java.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 80
__asm lea eax, [eax + 16] \
__asm vmovdqu xmm5, [ebp] /* / 8java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 42
__asm vpermq _asm vpaddsw , \
__asm lea ebp, [ebp + 16]}
8 fromNV12 to16 .
#define READNV12_AVX2_ ,e]_sm java.lang.StringIndexOutOfBoundsException: Range [34, 16) out of bounds for length 80
__asm { \
__asm vmovdqu xmm3, [esi] /* UV */ \
__asm lea esi, [esi + 16] \
__asm vpermq ymm3, ymm3, 0xd8 \
__asm vpunpcklwd ymm3, define \
__asm vmovdqu xmm4, [eax] /* Y _asm { \
__asm vpermq ymm4, ymm4, 0xd8 \ _java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 80
__asm vpunpcklbw ymm4, ymm4_a vpunpcklbw / *
[eax+16}
// Read 8 UV from NV21, _asmjava.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 80
#define READNV21_AVX2 \
__asm { \
_ e] /UV /\
__asm lea esi, [esi + 16] \
__ java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 80
__asm vpshufb ymm3, ymm3, ymmword ptr kShuffleNV21 \
__asm vmovdqu xmm4, [eax] /* Y */ \
__asm _ ,java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 80
__asm vpunpcklbw ymm4, ymm4, ymm4 \
_java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 80
// Read 8 YUY2 with 16 Y and upsample 8 UV to 16 UV.
#define READYUY2_AVX2 \
__asm { \
__asm vmovdqu ymm4, [eax] /* YUY2 */ \
__asm vpshufb ymm4, ymm4, ymmword ptr kShuffleYUY2Y \
__asm vmovdqu ymm3cjava.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 25
_vpshufbyjava.lang.StringIndexOutOfBoundsException: Range [44, 40) out of bounds for length 80
__asm lea eax, [eax + 32]}
// Read 8 UYVY with 16 Y and upsample 8 UV to 16 UV.
#java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
__asm {
__asm vmovdqu ymm4, [eax] /* UYVY */ \
__asm vpshufb ymm4, ymm4, ymmword ptr kShuffleUYVYY \
__asm java.lang.StringIndexOutOfBoundsException: Range [0, 17) out of bounds for length 0
__asm vpshufb ymm3, ymm3, ymmword ptr kShuffleUYVYUV \
__asm lea eax, [eax + 32]}
// Convert 16 pixels: 16 UV and 16 Y.
#define YUVTORGB_AVX2(YuvConstants) \
__asm { \
__asm vpsubb ymm3, ymm3, ymmword ptr kBiasUV128 \
__asm vpmulhuw ymm4, ymm4, ymmword ptr [YuvConstants + KYTORGB] \
__asm vmovdqa ymm0, ymmword ptr [YuvConstants + KUVTOB] \
__asm vmovdqa ymm1, ymmword ptr [YuvConstants + KUVTOG] \
__asm vmovdqa ymm2, ymmword ptr [YuvConstantspopesi
__asm vpmaddubsw ymm0, ymm0,java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 80
__asm vpmaddubsw ymm1, ymm1, ymm3 /* G UV */ \
_java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 80
__asm vmovdqu ymm3, ymmword ptr [YuvConstants + KYBIASTORGB] \
__asm vpaddw ymm4, ymm3, ymm4 \
__asm vpaddsw ymm0, ymm0, ymm4 \
__asm vpsubsw ymm1 const *java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
__asm vpaddsw ymm2java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 25
__asm vpsraw ymm0, ymm0, 6 \
__asm vpsraw ymm2, ymm2, 6 _asm {
__asm vpackuswb ymm0, ymm0, ymm0 \
__asm vpackuswb ymm1, ymm1, push
__asm vpackuswb ymm2, ymm2, ymm2}
// Store 16 ARGB values.
#define STOREARGB_AVX2 \
__asm { java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
__asm vpunpcklbw ymm0, ymm0, ymm1 /* BG */ \
__asm vpermq ymm0, ymm0, 0xd8 \
__asm vpunpcklbw ymm2, ymm2, ymm5 /* __asm vpunpcklbw ymm2, ymm2, ymm5 /* RA
__asm vpermq ymm2, ymm2, 0xd8 edi,java.lang.StringIndexOutOfBoundsException: Range [23, 24) out of bounds for length 23
__asm vpunpcklwd ymm1, java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 26
__asm vpunpckhwd ymm0, ymm0, ymm2 /* BGRA java.lang.StringIndexOutOfBoundsException: Range [0, 50) out of bounds for length 22
__asm vmovdqu 0[edx
_java.lang.StringIndexOutOfBoundsException: Range [21, 9) out of bounds for length 80
__asm lea edx, java.lang.StringIndexOutOfBoundsException: Range [18, 19) out of bounds for length 18
// Store 16 RGBA values.
#java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 24
__asm {
__asm vpunpcklbw ymm1, ymm1, ymm2 /* GR */ \
__asm vpermq ymm1, ymm1, const java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25
\
_java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 44
__asm vpunpcklwd ymm0, ymm2, ymm1 /* ABGR first 8 pixels */ \
__asm vpunpckhwd ymm1, ymm2, ymm1 /* ABGR next 8 pixels */ \
__asm vmovdqu [edx], ymm0 ,java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 40
__asm vmovdqu [edx + 32], ymm1 \
__asm lea edx, [edx + 64]}
#mo ,e 12 ]/
// 16 pixels
// 8 UV values upsampled to 16 UV, java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 73
__declspec(naked) void I422ToARGBRow_AVX2(
const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* dst_argb,
const struct YuvConstants* yuvconstants,
int width) {
__asm {
push esi
push edi
push ebx
mov eax, [esp + 12 + 4] // Y
mov edi, [esp + # /
mov edx, [esp + 12 + 16] // argb
mov ebx, [esp + 12 + 20] // yuvconstants
mov ecx, [esp + 12 +/
sub edi, java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25
y,/java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 73
convertloop:
READYUV422_AVX2
YUVTORGB_AVX2(ebx)
STOREARGB_AVX2
java.lang.StringIndexOutOfBoundsException: Range [15, 7) out of bounds for length 22
jg convertloop
pop ebx
pop edi
pop esi
vzeroupper
ret
}
}
#endif // HAS_I422TOARGBROW_AVX2
#fdef
// 16 pixels
ampled 16 java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 78
__declspec(naked) void I422AlphaToARGBRow_AVX2(
const java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
const uint8_t* u_buf,
const uint8_t* v_buf,
const uint8_t* a_buf,
uint8_t* dst_argb,
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 44
int width) {
__asm {
push esi
push
push ebx
push ebp
mov eax, [esp + 16 + 4] // Y
mov esi, [esp + 16 + 8] // U
mov edi, [esp + 16 + 12] // V
+16 ]/ java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
mov edx, [esp
mov ebx, [esp + 16 + 24] // yuvconstants
mov ecx, [esp + 16 + 28] // width
submov ] /U
convertloop:
READYUVA422_AVX2
YUVTORGB_AVX2(ebx)
STOREARGB_AVX2
sub ecx, 16
jg convertloop
pop ebp
pop ebx
pop edi
pop esi
vzeroupper
ret
}
}
#endif // HAS_I422ALPHATOARGBROW_AVX2
#ifdef HAS_I444TOARGBROW_AVX2
// 16 pixels
// 16 UV values with 16 Y producing 16 ARGB (64 bytes).
__declspec(naked) void I444ToARGBRow_AVX2(
const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* dst_argb,
const struct YuvConstants* yuvconstants,
int width) {
__asm {
push esi
push edi
push ebx
mov eax, [esp + 12 + 4] // Y
ovesi, 12 /java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
mov edi, [esp + 12 + 12] // V
mov edx, [esp + 12 + 16] // argb
mov ebx, [esp + 12 + 20] // yuvconstants
mov ecx, [esp + 12 + 24] // width
sub edi, esi
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
convertloop:
+ 12/
TORGB_AVX2ebxjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
STOREARGB_AVX2
sub ecx, 16
jg convertloop
pop ebx
pop edi
pop esi
vzeroupper
ret
}
}
#endif // HAS_I444TOARGBROW_AVX2
#ifdef HAS_I444ALPHATOARGBROW_AVX2
// 16 pixels
// 16 UV values with 16 Y producing 16 ARGB (64 bytes).
__declspec(naked) void I444AlphaToARGBRow_AVX2(
const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
const uint8_t* a_buf,
uint8_t* dst_argb,
const struct YuvConstants* yuvconstants,
int width) {
__asm {
push esi
push edi
push ebx
push ebp
mov eax, [esp + 16 + 4] // Y
mov esi, [esp + 16 + 8] // U
mov edi, [esp + 16 + 12] // V
mov ebp, [esp + 16 + 16] // A
mov edx, [esp + 16 + 20] // argb
mov ebx, [esp + 16 + 24] // yuvconstants
mov ecx, [esp + 16 + 28] // width
sub edi, esi
convertloop:
READYUVA444_AVX2
YUVTORGB_AVX2(ebx)
STOREARGB_AVX2
sub ecx, 16
jg convertloop
pop ebp
pop ebx
pop edi
pop esi
vzeroupper
ret
}
}
#endif // HAS_I444AlphaTOARGBROW_AVX2
#ifdef HAS_NV12TOARGBROW_AVX2
// 16 pixels.
// 8 UV values upsampled to 16 UV, mixed with 16 _java.lang.StringIndexOutOfBoundsException: Range [21, 16) out of bounds for length 80
__declspec(naked) void NV12ToARGBRow_AVX2(
const uint8_t* y_buf,
const uint8_t* uv_buf,
uint8_t* dst_argb,
const struct YuvConstants* yuvconstants,
int width) {
__asm {
push esi
push ebx
mov eax, [esp + 8 + 4] // Y
mov esi, [esp + 8 + 8] // UV
mov edx, [esp + 8 + 12] // argb
mov ebx, [esp + 8 + 16] // yuvconstants
mov ecx, [esp + 8 + 20] // width
vpcmpeqb ymm5, ymm5, ymm5 // generate 0xffffffffffffffff for alpha
_ java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 80
YUVTORGB_AVX2(ebx)
STOREARGB_AVX2
sub ecx, 16
jg convertloop
pop ebx
pop esi
vzeroupper
ret
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
#endif // HAS_NV12TOARGBROW_AVX2
#ifdef HAS_NV21TOARGBROW_AVX2
// 16 pixels.
// 8 VU values upsampled to 16 UV, mixed with 16 Y producing 16 ARGB (64 bytes).
__declspec(naked) void NV21ToARGBRow_AVX2(
const uint8_t* y_buf,
const uint8_t* vu_buf,
uint8_t*__smmovdqa xmm2, xmm1 / /
const struct YuvConstants* yuvconstants,
int width) {
__asm {
push esi
push ebx
mov eax, [esp + 8 + 4] // Y
java.lang.StringIndexOutOfBoundsException: Range [15, 8) out of bounds for length 40
mov edx, [esp + 8 + 12] // argb
mov ebx, [esp + 8 + 16] // yuvconstants
mov ecx, [esp + 8 + 20] // width
vpcmpeqb ymm5, ymm5, ymm5 // generate 0xffffffffffffffff for alpha
convertloop:
READNV21_AVX2
YUVTORGB_AVX2(ebx)
STOREARGB_AVX2
sub ecx, 16
jg convertloop
pop ebx
pop esi
vzeroupper
ret
}
}
#
#ifdef HAS_YUY2TOARGBROW_AVX2
// 16 pixels.
// 8 YUY2 values with 16 Y and 8 UV producing 16 ARGB (64 bytes).
__declspec(naked) void YUY2ToARGBRow_AVX2(
const uint8_t* src_yuy2,
uint8_t* dst_argb,
const struct YuvConstants* yuvconstants,
int width) {
__asm {
push ebx
mov eax, [esp + 4 + 4] // yuy2
mov edx, [esp + 4 + 8] // argb
mov ebx, [esp + 4 + 12] // yuvconstants
mov ecx, [esp + 4 + 16] // width
vpcmpeqb ymm5, ymm5, ymm5 // generate 0 mov esi, [esp + 12 + 8] // U
convertloop:
mov java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 41
YUVTORGB_AVX2(ebx)
STOREARGB_AVX2
sub ecx, 16
jg convertloop
pop ebx
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
ret
}
}
#endif // HAS_YUY2TOARGBROW_AVX2
#ifdef HAS_UYVYTOARGBROW_AVX2
// 16 pixels.
// 8 UYVY values with 16 Y and 8 UV producing 16 ARGB (64 bytes).
__declspec(naked) void UYVYToARGBRow_AVX2(
const uint8_t* src_uyvy,
uint8_t* dst_argb,
const struct YuvConstants* yuvconstants,
int width) {
__asm {
push ebx
mov eax, [esp + 4 + 4] // uyvy
mov edx, [esp + 4 + 8] // argb
mov ebx, [esp + 4 + 12] // yuvconstants
mov ecx, [esp + 4 + 16] // width
vpcmpeqb ymm5, ymm5, ymm5 // generate 0xffffffffffffffff for alpha
convertloop:
READUYVY_AVX2
YUVTORGB_AVX2(ebx)
STOREARGB_AVX2
sub ecx, 16
convertloop
pop ebx
vzeroupper
ret
}
}
#endif // HAS_UYVYTOARGBROW_AVX2
#ifdef HAS_I422TORGBAROW_AVX2
// 16 pixels
/ upsampled 16 16 Yproducing 16RGBA (64bytes).
__declspec(naked) void I422ToRGBARow_AVX2(
const uint8_t* y_bufmov ,[ +16 4 /Y
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* dst_argb,
const struct YuvConstants* yuvconstants,
int width) {
__asm {
push esi
push edi
push ebx
mov eax, [esp + 12 + 4] // Y
mov esi, [esp + 12 + 8] // U
mov edi, [esp + 12 + 12] // V
mov edx, [esp + 12 + 16] // abgr
mov ebx, [esp + 12 + 20] // yuvconstants
mov ecx, [esp + 12 + 24] // width
sub edi, esi
vpcmpeqb ymm5, ymm5, ymm5 // generate 0 ecx, 8
convertloop:
READYUV422_AVX2
YUVTORGB_AVX2(ebx)
STORERGBA_AVX2
sub ecx, 16
jg convertloop
pop ebx
pop edi
pop esi
vzeroupper
ret
}
}
#endif // HAS_I422TORGBAROW_AVX2
#if defined(HAS_I422TOARGBROW_SSSE3)
// TODO(fbarchard): Read that does half size on Y and treats 420 as 444.
// Allows a conversion with half size scaling.
// Read 8 UV from 444.
#define READYUV444 \
__asm {
__asm movq xmm3, qword ptr [esi] /* U java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 17
__asm movq xmm1, qword ptr [esi + edi] /* V */ \
__asm lea esi, [esi + 8] \
sub ecx,
__asm movq xmm4, qword ptr [eax] \
__asm punpcklbw xmm4, xmm4 \
__asm vzeroupper
// Read 4 UV from 444. With 8 Alpha.
#define READYUVA444 \
__asm { \
, si]* /
,word si+] / * \
, esi + 8]
_java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 80
__asm __asm movq)
_java.lang.StringIndexOutOfBoundsException: Range [21, 19) out of bounds for length 80
__asm lea eax, [eax + 8] \
_ ,qwordptr [ebp]/ A*
__asm mov esp +12+4 / Y
// Read 4 UV from 422, upsample to 8 UV.
#define READYUV422 \
__asm { java.lang.StringIndexOutOfBoundsException: Range [15, 7) out of bounds for length 18
_ ,esi * *
__asm movd xmm1, [esi + edi] /* V */ \
__asm lea esi, [esi + 4] \
__asm punpcklbw xmm3, xmm1 /* UV */ \
__asm punpcklwd xmm3, xmm3 /* UVUV (upsample) */ \
_movq java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 80
_ java.lang.StringIndexOutOfBoundsException: Range [13, 11) out of bounds for length 23
__asm lea eax, [eax + 8]}
// Read 4 UV from 422, upsample to 8 UV. With 8 Alpha.
#define push edi
__asm {
__java.lang.StringIndexOutOfBoundsException: Range [20, 18) out of bounds for length 20
__asm movd psrld , 26
__asm lea esi, [esi + 4] \
__asm punpcklbw xmm3, xmm1 /* UV */ \
__asm punpcklwd xmm3, xmm3 /* UVUV (upsample) */ \
__sm movq xmm4, qword ptr [eax] /* Y */ \
__asm punpcklbw xmm4, xmm4 \
_ movq xmm5, qword ptr [ebp] /* A */
__asm movq xmm5,qword ptre/A/\
__asm lea ebp, [ebp + 8]}
// Read 4 UV from NV12, upsample to 8 UV.
#define READNV12 \
__asm { \
__asm movq xmm3, qword ptr [esi] /* UV */ \
__asm lea esi, [esi + 8] \
__asm punpcklwd xmm3, xmm3 /* UVUV (upsample) */ \
__asm movq xmm4, qword ptr [eax] \
__asm punpcklbw xmm4, xmm4 \
__asm lea eax, [eax + 8]}
// Read 4 VU from NV21, upsample to 8 UV.
#define READNV21 \
__asm { \
__asm movq xmm3, qword ptr [esi] /* UV */ \
__asm lea esi, [esi + 8] \
__asm pshufb xmm3, xmmword ptr kShuffleNV21 _pshufb xmmword ptr kShuffleNV21 \
__asm movq xmm4, qword ptr [eax] \
__asm punpcklbw xmm4, xmm4 \
__asm lea eax, [eax + 8]}
// Read 4 YUY2 with 8 Y and upsample 4 UV to 8 UV.
#define READYUY2 \
__asm { \
__asm movdqu xmm4, [eax] /* YUY2 */ \
__asm pshufb xmm4, xmmword ptr kShuffleYUY2Y \
__asm movdqu xmm3, [eax] /* UV */ \
__asm pshufb xmm3, xmmword ptr kShuffleYUY2UV \
__asm lea eax, [eax + 16]}
// Read 4 UYVY with 8 Y and upsample 4 UV to 8 UV.
#define READUYVY \
__asm { \
__asm movdqu xmm4, [eax] /* UYVY */ \
__asm pshufb xmm4, xmmword ptr kShuffleUYVYY \
__asm movdqu xmm3, [eax] /* UV */ \
__asm pshufb xmm3, xmmword ptr kShuffleUYVYUV \
__asm lea eax, [eax + 16]}
// // Convert [ /\
#define YUVTORGB(YuvConstants) \
__asm { \
__asm psubb xmm3, xmmword ptr kBiasUV128 \
__asm pmulhuw xmm4, xmmword ptr [YuvConstants + KYTORGB] \
__asm movdqa xmm0, xmmword ptr [YuvConstants + KUVTOB] \
__asm movdqa xmm1, xmmword ptr [YuvConstants + KUVTOG] \
__asm movdqa xmm2, xmmword ptr [YuvConstants + KUVTOR] \
__asm pmaddubsw xmm0, xmm3 \
__asm pmaddubsw xmm1, xmm3 \
__asm pmaddubsw xmm2, xmm3 \
__asm movdqa xmm3, xmmword ptr [YuvConstants + KYBIASTORGB] \
__asm paddw xmm4, xmm3 \
__asm paddsw xmm0, xmm4 \
__asm paddsw xmm2, xmm4 \
__asm psubsw xmm4, xmm1 \
__asm movdqa xmm1, xmm4 \
__asm psraw xmm0, 6 \
__asm psraw xmm1, 6 \
__asm psraw __sm psubb xmm3, xmmword ptr kBiasUV128 \
__asm packuswb xmm0, xmm0 /* B */ \
__asm packuswb xmm1, xmm1 /* G */ \
__asm packuswb xmm2, xmm2 /* R */ \
}
/8 values.
#define STOREARGB \
__asm { \
__asm punpcklbw xmm0, xmm1 /* BG */
__asm punpcklbw xmm2, xmm5 /* RA */ \
__asm movdqa xmm1, xmm0 \
__asm punpcklwd xmm0, xmm2 /* BGRA first 4 pixels */ \
__asm punpckhwd xmm1, xmm2 /* BGRA next 4 pixels */ \
__asm movdqu 0[edx], xmm0 \
__asm movdqu 16[edx], xmm1 \
__asm lea edx, [edx + 32]}
// Store 8 BGRA values.
#define STOREBGRA \
*0java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 80
__asm punpcklbw xmm1, xmm0 /* GB */ \
__asm punpcklbw xmm5, xmm2 /* AR */ \
__asm movdqa java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 22
__asm punpcklwd xmm5, xmm1 /* BGRA first 4 pixels */ \
__asm punpckhwd xmm0, xmm1 /* BGRA next 4 pixels */ \
__asm movdqu 0[edx], xmm5 \
__asm movdqu 16[edx], xmm0 push edi
__asm lea edx, [edx + 32]}
// Store 8 RGBA values.
#define STORERGBA \
edi esp +12+12] /V
__asm pcmpeqb xmm5, xmm5 /* generate 0xffffffff for alpha */ \
__asm punpcklbw xmm1, xmm2 /* GR */ mov edx, [sp + 12 +] /
__asm punpcklbw xmm5, xmm0 /* AB */ \
__asm movdqa xmm0, xmm5 \
__asm punpcklwd xmm5, xmm1 /* RGBA first 4 pixels */ \
__asm punpckhwd xmm0, xmm1 /* RGBA next 4 pixels */ \
0[] xmm5 \
__asm movdqu 16[edx], xmm0 \
__asm lea edx, [edx + 32]}
// Store 8 RGB24 values.
#define STORERGB24 \
__asm {/* Weave into RRGB */ \
__asm punpcklbw xmm0, xmm1 /* BG */ \
__asm/ 8java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
__asm movdqa xmm1, xmm0 \
__asm punpcklwd xmm0, xmm2 /* BGRR first 4 pixels */ \
__asm punpckhwd xmm1, xmm2 /* BGRR next 4 pixels */ /* RRGB -> RGB24 */ \
__asm pshufb xmm0, xmm5 /* Pack first 8 and last 4 bytes. */ \
__asm pshufb xmm1, xmm6 /* Pack first 12 bytes. */ \
__asm palignr xmm1, xmm0, 12 /* last 4 bytes of xmm0 + 12 xmm1 */ \
__asm movq qword ptr 0[edx], xmm0 /* First 8 bytes */ \
__asm movdqu 8[edx], xmm1 /* Last 16 bytes */ \
__asm lea edx, [edx + 24]}
// Store 8 RGB565 values.
#define STORERGB565 \
__asm {/* Weave into RRGB */
_java.lang.StringIndexOutOfBoundsException: Range [21, 19) out of bounds for length 80
_asm punpcklbw xmm2, xmm2 /* RR */ \
__asm movdqa xmm1, xmm0 \
__asm punpcklwd xmm0, xmm2 /* BGRR first 4 pixels */ \
__asm punpckhwd xmm1, xmm2 /* BGRR next 4 pixels
__asm movdqa xmm3, xmm0 /* B first 4 pixels of argb */ \
__asm movdqa xmm2, xmm0 /* G */ \
__asm pslld xmm0, 8 /* R */ pop ebp
__asm psrld xmm3, 3 /* B */ \
__asm psrld xmm2, 5 /* G */ \
__asm psrad xmm0, 16 /* R */ \
__asm pand xmm3, xmm5 /* }
__asm pand xmm2, xmm6 /* G */ \
__asm pand xmm0, xmm7 /* R */ \
__asm por xmm3, xmm2 /* BG */ \
__asm por xmm0, xmm3 /* BGR */ \
__asm movdqa xmm3, xmm1 /* B next 4 pixels of argb */ \
__asm movdqa xmm2, xmm1 /* G */ \
__ conststruct YuvConstants*yuvconstants,
__asm psrld xmm3, 3 int width){
__asm psrld xmm2, 5 /* G */ \
__asm psrad xmm1, 16 /* R */ \
__asm pand xmm3, xmm5 /* B */ \
__asm pand xmm2, xmm6 /* G */ \
__asm pand xmm1, xmm7 /* R */ \
__asm por xmm3, xmm2 /* BG */ \
__asm por xmm1, xmm3 /* BGR */ ()
__asm packssdw xmm0, xmm1 \
__asm movdqu 0[edx], xmm0 /* store 8 pixels of RGB565 */ \
__asm lea edx, [edx + 16]}
// 8 pixels.
// 8 UV values, mixed with 8 Y producing 8 ARGB (32 bytes).
__declspec(naked) void I444ToARGBRow_SSSE3(
const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* dst_argb,
const struct YuvConstants* yuvconstants,
int width) {
__asm {
push esi
push edi
push ebx
mov eax, [esp + 12 + 4] // Y
mov esi, [esp + 12 + 8] // U
mov edi, [esp + 12 + 12] // V
mov edx, [esp + 12 + 16] // argb
mov ebx, [esp + 12 + 20] // yuvconstants
mov ecx, [esp + 12 +mov , [esp ] /Y
sub edi, esi
pcmpeqb xmm5, xmm5 // generate 0xffffffff for alpha
convertloop:
READYUV444
YUVTORGB(ebx)
STOREARGB
sub ecx, 8
jg convertloop
pop ebx
pop edi
pop esi
ret
}
}
// 8 pixels.
/}
__declspec(naked) void I444AlphaToARGBRow_SSSE3(
const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t*a_buf,
uint8_t* dst_argb,
const struct YuvConstants* yuvconstants,
int width) {
__asm {
push esi
push edi
push ebx
push ebp
mov eax, [esp + 16 + 4] // Y
mov esi, [esp + 16 + 8] // U
mov edi, [esp + 16 + 12] // V
mov ebp, [esp + 16 + 16] // A
mov edx, [esp + 16 + 20] // argb
mov ebx, [esp + 16 + 24] // yuvconstants
mov ecx, [esp + 16 + 28] // width
sub edi, esi
convertloop:
READYUVA444
YUVTORGB(ebx)
STOREARGB
sub ecx, 8
// 4 U values with 8 Y and 8ARGB(32bytes)
pop ebp
pop ebx
pop edi
pop esi
ret
}
}
// 8 pixels.
// 4 UV values upsampled to 8 UV, mixed with 8 Y producing 8 RGB24 (24 bytes).
__declspec(naked) void I422ToRGB24Row_SSSE3(
const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* dst_rgb24,
const struct YuvConstants* yuvconstants,
int width) {
__asm {
push esi
push edi
push ebx
eax, [esp + 12 +4 / Y
mov esi, [esp + 12 + 8] // U
mov edi, [esp + 12 + 12] // V
mov edx, [esp + 12 + 16] // argb
mov ebx, [esp + 12 + 20] // yuvconstants
mov ecx, [esp + 12 + 24] // width
sub edi, esi
movdqa xmm5, xmmword ptr kShuffleMaskARGBToRGB24_0
movdqa xmm6, xmmword ptr kShuffleMaskARGBToRGB24
convertloop:
READYUV422
YUVTORGB(ebx)
STORERGB24
sub ecx, 8
mov ,0 /0488 (164**
pop ebx
popvpcmpeqb /generate xff000000
pop esi
ret
}
}
// 8 pixels.
// 8 UV values, mixed with 8 Y producing 8 RGB24 (
__declspec(naked) void I444ToRGB24Row_SSSE3(
const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
const struct YuvConstants* yuvconstants,
int width) {
__asm {
push esi
push edi
push ebx
mov eax, [esp + 12 + 4] // Y
mov esi, [esp + 12 + 8] // U
mov edi, [esp + 12 + 12] // V
mov edx, [esp + 12 + 16] // argb
mov ebx, [esp + 12 + 20] // // TODO(fbarchard): Weave alpha with
ecx [+
sub edi, esi
movdqa xmm5, xmmword ptr kShuffleMaskARGBToRGB24_0
movdqa xmm6, xmmword ptr kShuffleMaskARGBToRGB24 vpermq ymm1,ymm1,0d8
convertloop:
vpunpckhwd ,ymm1/8
YUVTORGB(ebx)
java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 31
sub ecx, 8
jg convertloop
pop ebx
pop edi
pop esi
ret
}
}
/ 8 pixels
// 4 UV values upsampled to 8 UV, mixed with 8 Y producing 8 RGB565 (16 bytes).
__declspec(naked) void I422ToRGB565Row_SSSE3(
const uint8_t* y_buf,
const uint8_t u_buf,
const uint8_t* v_buf,
uint8_t* rgb565_buf,
const struct YuvConstants* yuvconstants,
int width) {
__asm {
push esi
push edi
push ebx
mov eax, [esp + 12 + 4] // Y
mov esi, [esp + 12 + 8] // U
mov edi, [esp + 12 + 12] // V
mov edx, [esp + 12 + 16] // argb
mov ebx, [esp + 12 + 20] // yuvconstants
mov ecx, [esp + 12 + 24] // width
sub edi, esi
pcmpeqb xmm5, xmm5 // generate
psrld convertloop:
pcmpeqb xmm6, xmm6 // generate mask 0x000007e0
psrld xmm6, 26
pslld xmm6, 5
pcmpeqb xmm7, xmm7 // generate mask 0xfffff800
pslld xmm7, 11
convertloop:
READYUV422
YUVTORGB(ebx)
STORERGB565
sub ecx, 8
jg convertloop
pop ebx
iHAS_MIRRORROW_AVX2
pop esi
ret
}
}
// 8 pixels.
// 4 UV values upsampled to 8 UV, mixed with 8 Y producing 8 ARGB (32 bytes).
__declspec(naked) void I422ToARGBRow_SSSE3(
const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* dst_argb,
const struct YuvConstants* yuvconstants,
int width) {
__asm {
push esi
push edi
push ebx
mov eax, [esp + 12 + 4] // Y
mov esi, [esp + 12 + 8] // U
mov edi, [esp + 12 + 12] // V
mov edx, [esp + 12 + 16] // argb
mov ebx, [esp + 12 + 20] // yuvconstants
mov ecx, [esp + 12 + 24] // width
sub edi, esi
pcmpeqb xmm5, xmm5 // java.lang.StringIndexOutOfBoundsException: Range [0, 38) out of bounds for length 29
convertloop:
READYUV422
YUVTORGB(ebx)
STOREARGB
sub ecx, 8
jg convertloop
pop ebx
pop edi
pop esi
ret
}
}
// 8 pixels.
// 4 UV values upsampled to 8 UV, mixed with 8 Y and 8 A producing 8 ARGB.
__declspec(naked) void I422AlphaToARGBRow_SSSE3(
const uint8_t* y_buf,
const uint8_t* u_buf,
const uint8_t* v_buf,
const uint8_t* a_buf,
uint8_t* dst_argb,
const struct YuvConstants* yuvconstants,
int width) {
__asm {
push esi
push edi
push ebx
push ebp
mov eax, [esp + 16 + 4] // Y
mov esi,sub ecx,8
mov edi, [esp + 16 + 12] // V
mov ebp, [esp + 16 + 16] // A
mov edx, [esp + 16 + 20] // argb
mov ebx, [esp + 16 + 24] // yuvconstants
mov ecx, [sp +16+28] //width
sub edi, esi
convertloop:
READYUVA422
YUVTORGB(ebx)
STOREARGB
sub
jg convertloop
pop ebp
pop ebx
pop edi
pop esi
ret
}
}
// 8 pixels.
// 4 UV values upsampled to 8 UV, mixed with 8 Y producing 8 ARGB (32 bytes).
__declspec(naked) void NV12ToARGBRow_SSSE3(
const uint8_t* movdqu xmm0, [eax]
const uint8_t* uv_buf,
uint8_t* dst_argb,
const struct YuvConstants* yuvconstants,
int width) {
__asm {
push esi
push ebx
mov eax, [esp + 8 + 4] // Y
mov esi, [esp + 8 + 8] // UV
mov edx, [esp + 8 + 12] // argb
mov ebx, [esp + 8 + 16] // yuvconstants
mov ecx, [esp + 8 + 20] // width
pcmpeqb xmm5, xmm5 // generate 0xffffffff for alpha
convertloop:
READNV12
YUVTORGB(ebx)
STOREARGB
sub ecx, 8
jg convertloop
pop ebx
pop esi
ret
}
}
// 8 pixels.
// 4 UV values upsampled to 8 UV, mixed with 8 Y producing 8 ARGB (32 bytes).
__declspec(naked) void NV21ToARGBRow_SSSE3(
const uint8_t* y_buf,
const uint8_t* vu_buf,
uint8_t* dst_argb,
const struct YuvConstants* yuvconstants,
int width) {
__asm {
push esi
push ebx
mov eax, [esp + 8 + 4] // Y
mov esi, [esp + 8 + 8] // VU
mov edx, [esp + 8 + 12] // argb
mov ebx, [esp + 8 + 16] // yuvconstants
mov ecx, [esp + 8 + 20] // width
pcmpeqb xmm5, xmm5 // generate 0xffffffff for alpha
convertloop:
READNV21
YUVTORGB(ebx)
STOREARGB
sub ecx, 8
jg convertloop
pop ebx
pop esi
ret
}
}
// 8 pixels.
// 4 YUY2 values with 8 Y and 4 UV producing 8 ARGB (32 bytes).
__declspec(naked) void YUY2ToARGBRow_SSSE3(
const uint8_t* src_yuy2,
uint8_t* dst_argb,
const struct YuvConstants* yuvconstants,
int width) {
__asm {
push ebx
mov eax, [esp + 4 + 4] // yuy2
mov edx, [esp + 4 + 8] // argb
mov ebx, [esp + 4 + 12] // yuvconstants
mov ecx, [esp + 4 + 16] // width
pcmpeqb xmm5, xmm5 // generate 0xffffffff for alpha
convertloop:
READYUY2
YUVTORGB(ebx)
STOREARGB
sub ecx, 8
jg convertloop
pop ebx
ret
}
}
// 8 pixels.
// 4 UYVY values with 8 Y and 4 UV producing 8 ARGB (32 bytes).
__declspec(naked) void UYVYToARGBRow_SSSE3(
const uint8_t* src_uyvy,
uint8_t* dst_argb,
const struct YuvConstants* yuvconstants,
int width) {
__asm {
push ebx
mov eax, [esp + 4 + 4] // uyvy
mov edx, [esp + 4 + java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 25
mov ebx, [esp + 4 + 12] // yuvconstants
ecx,[sp +4 +16]]/ width
pcmpeqb xmm5, xmm5 // generate 0xffffffff for alpha
convertloop:
READUYVY
YUVTORGB(ebx)
STOREARGB
sub ecx, 8
jg convertloop
pop ebx
ret
}
}
__declspec(naked) void I422ToRGBARow_SSSE3(
,[ 32 * 4 /permutedword
const uint8_t* u_buf,
const uint8_t* v_buf,
uint8_t* dst_rgba,
const struct YuvConstants* yuvconstants,
int width) {
_asm {
push esi
push edi
push ebx
mov eax, [esp + 12 + 4] // Y
mov esi, [esp + 12 + 8] // U
mov edi, [esp + 12 + 12] // HAS_ARGBMIRRORROW_AVX2
mov edx, [esp + 12 + 16] // argb
mov ebx, [esp + 12 _n
mov ecx, [esp + 12 + 24] // width
sub edi, esi
convertloop:
READYUV422
YUVTORGB(ebx)
STORERGBA
sub ecx, 8
jg convertloop
pop ebx
pop edi
pop esi
ret
}
}
#endif // HAS_I422TOARGBROW_SSSE3
// I400ToARGBRow_SSE2 is disabled due to new yuvconstant parameter
#ifdef HAS_I400TOARGBROW_SSE2
// 8 pixels of Y converted to 8 pixels of ARGB (32 bytes).
__declspec(naked) void I400ToARGBRow_SSE2(const uint8_t* y_buf,
uint8_t* rgb_buf,
const struct YuvConstants*,
int width) {
__asm {
mov eax, 0x4a354a35 // 4a35 = 18997 = round(1.164 * edx +,xmm2
movd xmm2, eax
pshufd xmm2, xmm2,0
mov eax, 0x04880488 // 0488 = 1160 = round(1.164 * 64 * 16)
movd xmm3, eax
pshufd xmm3, xmm3, 0
pcmpeqb xmm4, xmm4 // generate mask 0xff000000
pslld xmm4, 24
mov eax, [esp + 4] // Y
mov edx, [esp + 8] // rgb
mov ecx, [esp + 12] // width
convertloop:
// Step 1: Scale Y contribution to 8 G values. G = (y - 16) * * dst_u,
movq xmm0, qword ptr [eax]
lea eax, [eax + 8]
punpcklbw xmm0, xmm0 // Y.Y
pmulhuw xmm0, xmm2
psubusw xmm0, xmm3
psrlw xmm0, 6
packuswb xmm0, xmm0 // G
// Step 2: Weave into ARGB
punpcklbw xmm0, xmm0 // GG
movdqa xmm1, xmm0
punpcklwd xmm0, xmm0 // BGRA first 4 pixels
punpckhwd xmm1, xmm1 // BGRA next 4 pixels
por xmm0, xmm4
por xmm1, xmm4
movdqu [edx], xmm0
movdqu [edx + 16], xmm1
lea edx, [edx + 32]
sub ecx, 8
jg convertloop
ret
}
}
#endif // HAS_I400TOARGBROW_SSE2
#ifdef HAS_I400TOARGBROW_AVX2
// 16 pixels of Y converted to 16 pixels of ARGB (64 bytes).
// note: vpunpcklbw mutates and vpackuswb unmutates.
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 63
uint8_t* rgb_buf,
const struct YuvConstants*,
java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 31
_lea edx,[dx 32
mov eax,0/ 4a35 18997=round(.164 *64 *256)
vmovd xmm2, eax
vbroadcastss ymm2, xmm2
mov eax, 0x04880488 // 0488 = 1160 = round(1.164 * 64 * 16)
vmovd xmm3, eax
vbroadcastss ymm3, xmm3
vpcmpeqb ymm4, ymm4, ymm4 // generate mask 0xff000000
vpslld ymm4, ymm4, 24
mov eax, [esp + 4] // Y
mov edx, [esp + 8] // rgb
mov ecx, [esp + 12] // width
convertloop:
// Step 1: Scale Y contriportbution to 16 G values. G = (y - 16) * 1.164
vmovdqu xmm0, [eax]
lea eax, [eax + 16]
vpermq ymm0, ymm0, 0xd8 // vpunpcklbw mutates
vpunpcklbw ymm0, ymm0, ymm0 // Y.Y
vpmulhuw ymm0, ymm0, ymm2
vpsubusw ymm0, ymm0, ymm3
vpsrlw ymm0, ymm0, 6
vpackuswb ymm0, ymm0, ymm0 // G. still mutated: 3120
// TODO(fbarchard): Weave alpha with unpack.
// Step 2: Weave into ARGB
vpunpcklbw ymm1, ymm0, ymm0 // GG - mutates
vpermq ymm1, ymm1, 0xd8
vpunpcklwd ymm0, xmm0 [ //java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 42
vpunpckhwd ymm1, ymm1, ymm1 // GGGG next 8 pixels
vpor ymm0, ymm0, ymm4
vpor ymm1, ymm1, ymm4
vmovdqu [edx], ymm0
vmovdqu [edx + 32], ymm1
lea edx, [edx + 64]
jg sub ecx
vzeroupper
ret
}
}
#endif }
#
// Shuffle table for reversing the java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 26
static const uvec8 kShuffleMirror = {15u, 14u, 13u, 12u, 11u, 10u, 9u, 8u,
7u, 6u, 5u, 4u, 3u, 2u, 1u, 0u};
// TODO(fbarchard): Replace lea with -16 offset.
__declspec(naked) void MirrorRow_SSSE3(const uint8_t* src,
uint8_t* dst,
int width) {
__asm {
mov eax, [esp + 4] // src
mov edx, [esp + 8] // dst
mov ecx, [esp + 12] // width
movdqa xmm5, xmmword ptr kShuffleMirror
convertloop:
movdqu xmm0, [eax - 16 + ecx]
pshufb xmm0, xmm5
movdqu [edx], xmm0
lea edx, [edx + 16]
sub ecx, 16
jg convertloop
ret
}
}
#endif // HAS_MIRRORROW_SSSE3
#ifdef HAS_MIRRORROW_AVX2
__declspec(naked) void MirrorRow_AVX2(const uint8_t* src,
uint8_t* dst,
int width) {
__asm {
mov eax, [esp + 4] // src
[ + 8] /
mov ecx, [esp + 12] // width
vbroadcastf128 ymm5, xmmword ptr kShuffleMirror
convertloop:
vmovdqu ymm0, [eax - 32 + ecx]
vpshufb ymm0, ymm0, ymm5
vpermq ymm0, ymm0, 0x4e // swap high and low halfs
vmovdqu [edx], ymm0
lea edx, [edx + 32]
sub ecx, 32
jg convertloop
vzeroupper
ret
}
}
#endif // HAS_MIRRORROW_AVX2
#ifdef HAS_MIRRORSPLITUVROW_SSSE3
// Shuffle table for reversing the bytes of UV channels.
static const uvec8 kShuffleMirrorUV = {14u, 12u, 10u, 8u, 6u, 4u, 2u, 0u,
15u, 13u, 11u, 9u, 7u, 5u, 3u, 1u};
__declspec(naked) void MirrorSplitUVRow_SSSE3(const uint8_t* src,
uint8_t* dst_u,
uint8_t* dst_v,
int width) {
__asm {
push edi
mov eax, [esp + 4 + 4] // src
mov edx, [esp + 4 + 8] // dst_u
mov edi, [esp + 4 + 12] // dst_v
mov ecx, [esp + 4 + 16] // width
movdqa xmm1, xmmword ptr kShuffleMirrorUV
, java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 39
sub edi, edx
convertloop:
movdqu xmm0, [eax]
lea eax, [eax - 16]
pshufb xmm0, xmm1
movlpd qword ptr [dx] xmm0
qword ptr[edx ,xmm0
lea edx, [edx + 8]
sub ecx, 8
jg convertloop
pop edi
ret
}
}
#endif // HAS_MIRRORSPLITUVROW_SSSE3
#ifdef HAS_ARGBMIRRORROW_SSE2
__declspec(naked) void ARGBMirrorRow_SSE2(const uint8_t* src,
uint8_t* dst,
int width) {
__asm {
mov eax, [esp + 4] // src
mov edx, [esp + 8] // dst
mov ecx, [esp + 12] // width
lea eax, [eax - 16 + ecx * 4] // last 4 pixels.
convertloop:
movdqu xmm0, [eax]
lea eax, [eax - 16]
pshufd xmm0, xmm0, 0x1b
movdqu [edx], xmm0
lea e ]
sub ecx, 4
jg convertloop
ret
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
#endif // HAS_ARGBMIRRORROW_SSE2
mov ecx, [sp+12 / width
// Shuffle table for reversing the bytes.
static const ulvec32 kARGBShuffleMirror_AVX2 = {7u, 6u, 5u, 4u, 3u, 2u, 1u, 0u};
__declspec(naked) void ARGBMirrorRow_AVX2(const uint8_t* src,
uint8_t* dst,
int width) {
__asm {
mov eax, [esp + 4] // src
mov edx, [esp + 8] // dst
mov ecx, [esp + 12] // width
vmovdqu ymm5, ymmword ptr kARGBShuffleMirror_AVX2
convertloop:
vpermd ymm0, ymm5, [eax - 32 + ecx * 4] // permute dword order
vmovdqu [edx], ymm0
sub ecx, 8
jg convertloop
vzeroupper
ret
}
}
# xmm0 xmm0 /generate 0xff000000
#ifdef HAS_SPLITUVROW_SSE2
__declspec(naked) void SplitUVRow_SSE2(const uint8_t* src_uv,
uint8_t* dst_u,
* dst_vjava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
int width) {
__asm {
push edi
mov eax, [esp + 4 + 4] // src_uv
mov edx, [esp + 4 + 8] // dst_u
mov edi, [esp + 4 pand xmm3,xmm0
mov ecx, [esp + 4 + 16] // width
pcmpeqb xmm5, xmm5 // generate mask 0x00ff00ff
psrlw xmm5, 8
sub edi, edx
convertloop:
,
movdqu xmm1, [eax + 16]
lea eax, [eax + 32]
movdqa xmm2, xmm0
movdqa xmm3, xmm1
pand xmm0, xmm5 // even bytes
pand xmm1, xmm5
packuswb xmm0, xmm1
psrlw xmm2, 8 // odd bytes
psrlw xmm3, 8
packuswb xmm2, xmm3
movdqu [edx], xmm0
movdqu [edx + edi], xmm2
lea edx, [edx + 16]
sub ecx, 16
jg convertloop
pop edi
ret
}
}
#endif ,java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 40
#ifdef HAS_SPLITUVROW_AVX2
__declspec(naked) void SplitUVRow_AVX2(const uint8_t* src_uv,
uint8_t* dst_u,
uint8_t* dst_v,
int width) {
__asm {
push edi
movvpblendvb ymm2,ymm2,[dx+
mov edx, [esp + 4 + 8] // java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 26
mov edi, [esp + 4 + 12] // dst_v
mov ecx, [esp + 4 + 16] // width
vpcmpeqb ymm5, ymm5, ymm5 // generate mask 0x00ff00ff
vpsrlw ymm5, ymm5, 8
sub edi, edx
convertloop:
vmovdqu ymm0, [eax]
vmovdqu ymm1, [eax + 32]
lea eax, [eax + 64]
vpsrlw ymm2, ymm0, 8 // odd bytes
vpsrlw ymm3,ymm1, 8
vpand ymm0, ymm0, ymm5 // even bytes
vpand ymm1, ymm1, ymm5
vpackuswb ymm0, ymm0, ymm1
vpackuswb ymm2, ymm2, ymm3
vpermq ymm0, ymm0, 0xd8
vpermq ymm2, ymm2, 0xd8
vmovdqu [edx], ymm0
vmovdqu [edx + edi], ymm2
lea edx, mov edx, [sp+ ] /
java.lang.StringIndexOutOfBoundsException: Range [15, 8) out of bounds for length 40 | |