mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 08:46:47 +08:00
DetilePlane and unittest for NEON
Bug: libyuv:915, b/215425056 Change-Id: Iccab1ed3f6d385f02895d44faa94d198ad79d693 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3424820 Reviewed-by: Justin Green <greenjustin@google.com> Reviewed-by: Frank Barchard <fbarchard@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
This commit is contained in:
parent
2c6bfc02d5
commit
804980bbab
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,6 +12,7 @@ pin-log.txt
|
||||
/native_client
|
||||
/net
|
||||
/out
|
||||
/unit_test/out
|
||||
/source/out
|
||||
/sde-avx-sse-transition-out.txt
|
||||
/testing
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Name: libyuv
|
||||
URL: http://code.google.com/p/libyuv/
|
||||
Version: 1809
|
||||
Version: 1810
|
||||
License: BSD
|
||||
License File: LICENSE
|
||||
|
||||
|
||||
@ -58,15 +58,15 @@
|
||||
DUP2_ARG1(_INS, _IN2, _IN3, _OUT2, _OUT3); \
|
||||
}
|
||||
|
||||
#define DUP4_ARG2(_INS, _IN0, _IN1, _IN2, _IN3, _IN4, _IN5, _IN6, _IN7, \
|
||||
_OUT0, _OUT1, _OUT2, _OUT3) \
|
||||
#define DUP4_ARG2(_INS, _IN0, _IN1, _IN2, _IN3, _IN4, _IN5, _IN6, _IN7, _OUT0, \
|
||||
_OUT1, _OUT2, _OUT3) \
|
||||
{ \
|
||||
DUP2_ARG2(_INS, _IN0, _IN1, _IN2, _IN3, _OUT0, _OUT1); \
|
||||
DUP2_ARG2(_INS, _IN4, _IN5, _IN6, _IN7, _OUT2, _OUT3); \
|
||||
}
|
||||
|
||||
#define DUP4_ARG3(_INS, _IN0, _IN1, _IN2, _IN3, _IN4, _IN5, _IN6, _IN7, \
|
||||
_IN8, _IN9, _IN10, _IN11, _OUT0, _OUT1, _OUT2, _OUT3) \
|
||||
#define DUP4_ARG3(_INS, _IN0, _IN1, _IN2, _IN3, _IN4, _IN5, _IN6, _IN7, _IN8, \
|
||||
_IN9, _IN10, _IN11, _OUT0, _OUT1, _OUT2, _OUT3) \
|
||||
{ \
|
||||
DUP2_ARG3(_INS, _IN0, _IN1, _IN2, _IN3, _IN4, _IN5, _OUT0, _OUT1); \
|
||||
DUP2_ARG3(_INS, _IN6, _IN7, _IN8, _IN9, _IN10, _IN11, _OUT2, _OUT3); \
|
||||
@ -91,8 +91,9 @@
|
||||
* out : 23,40,41,26, 23,40,41,26
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m128i __lsx_vdp2add_h_b(__m128i in_c, __m128i in_h, __m128i in_l)
|
||||
{
|
||||
static inline __m128i __lsx_vdp2add_h_b(__m128i in_c,
|
||||
__m128i in_h,
|
||||
__m128i in_l) {
|
||||
__m128i out;
|
||||
|
||||
out = __lsx_vmaddwev_h_b(in_c, in_h, in_l);
|
||||
@ -117,8 +118,9 @@ static inline __m128i __lsx_vdp2add_h_b(__m128i in_c, __m128i in_h, __m128i in_l
|
||||
* out : 23,40,41,26, 23,40,41,26
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m128i __lsx_vdp2add_h_bu(__m128i in_c, __m128i in_h, __m128i in_l)
|
||||
{
|
||||
static inline __m128i __lsx_vdp2add_h_bu(__m128i in_c,
|
||||
__m128i in_h,
|
||||
__m128i in_l) {
|
||||
__m128i out;
|
||||
|
||||
out = __lsx_vmaddwev_h_bu(in_c, in_h, in_l);
|
||||
@ -143,8 +145,9 @@ static inline __m128i __lsx_vdp2add_h_bu(__m128i in_c, __m128i in_h, __m128i in_
|
||||
* out : 23,40,41,26
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m128i __lsx_vdp2add_w_h(__m128i in_c, __m128i in_h, __m128i in_l)
|
||||
{
|
||||
static inline __m128i __lsx_vdp2add_w_h(__m128i in_c,
|
||||
__m128i in_h,
|
||||
__m128i in_l) {
|
||||
__m128i out;
|
||||
|
||||
out = __lsx_vmaddwev_w_h(in_c, in_h, in_l);
|
||||
@ -167,8 +170,7 @@ static inline __m128i __lsx_vdp2add_w_h(__m128i in_c, __m128i in_h, __m128i in_l
|
||||
* out : 22,38,38,22, 22,38,38,22
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m128i __lsx_vdp2_h_b(__m128i in_h, __m128i in_l)
|
||||
{
|
||||
static inline __m128i __lsx_vdp2_h_b(__m128i in_h, __m128i in_l) {
|
||||
__m128i out;
|
||||
|
||||
out = __lsx_vmulwev_h_b(in_h, in_l);
|
||||
@ -191,8 +193,7 @@ static inline __m128i __lsx_vdp2_h_b(__m128i in_h, __m128i in_l)
|
||||
* out : 22,38,38,22, 22,38,38,22
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m128i __lsx_vdp2_h_bu(__m128i in_h, __m128i in_l)
|
||||
{
|
||||
static inline __m128i __lsx_vdp2_h_bu(__m128i in_h, __m128i in_l) {
|
||||
__m128i out;
|
||||
|
||||
out = __lsx_vmulwev_h_bu(in_h, in_l);
|
||||
@ -215,8 +216,7 @@ static inline __m128i __lsx_vdp2_h_bu(__m128i in_h, __m128i in_l)
|
||||
* out : 22,38,38,22, 22,38,38,6
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m128i __lsx_vdp2_h_bu_b(__m128i in_h, __m128i in_l)
|
||||
{
|
||||
static inline __m128i __lsx_vdp2_h_bu_b(__m128i in_h, __m128i in_l) {
|
||||
__m128i out;
|
||||
|
||||
out = __lsx_vmulwev_h_bu_b(in_h, in_l);
|
||||
@ -239,8 +239,7 @@ static inline __m128i __lsx_vdp2_h_bu_b(__m128i in_h, __m128i in_l)
|
||||
* out : 22,38,38,22
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m128i __lsx_vdp2_w_h(__m128i in_h, __m128i in_l)
|
||||
{
|
||||
static inline __m128i __lsx_vdp2_w_h(__m128i in_h, __m128i in_l) {
|
||||
__m128i out;
|
||||
|
||||
out = __lsx_vmulwev_w_h(in_h, in_l);
|
||||
@ -251,8 +250,8 @@ static inline __m128i __lsx_vdp2_w_h(__m128i in_h, __m128i in_l)
|
||||
/*
|
||||
* =============================================================================
|
||||
* Description : Clip all halfword elements of input vector between min & max
|
||||
* out = ((_in) < (min)) ? (min) : (((_in) > (max)) ? (max) : (_in))
|
||||
* Arguments : Inputs - _in (input vector)
|
||||
* out = ((_in) < (min)) ? (min) : (((_in) > (max)) ? (max) :
|
||||
* (_in)) Arguments : Inputs - _in (input vector)
|
||||
* - min (min threshold)
|
||||
* - max (max threshold)
|
||||
* Outputs - out (output vector with clipped elements)
|
||||
@ -264,8 +263,7 @@ static inline __m128i __lsx_vdp2_w_h(__m128i in_h, __m128i in_l)
|
||||
* out : 1,2,9,9, 1,9,9,9
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m128i __lsx_vclip_h(__m128i _in, __m128i min, __m128i max)
|
||||
{
|
||||
static inline __m128i __lsx_vclip_h(__m128i _in, __m128i min, __m128i max) {
|
||||
__m128i out;
|
||||
|
||||
out = __lsx_vmax_h(min, _in);
|
||||
@ -285,8 +283,7 @@ static inline __m128i __lsx_vclip_h(__m128i _in, __m128i min, __m128i max)
|
||||
* out : 0,255,255,249, 0,255,255,249
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m128i __lsx_vclip255_h(__m128i _in)
|
||||
{
|
||||
static inline __m128i __lsx_vclip255_h(__m128i _in) {
|
||||
__m128i out;
|
||||
|
||||
out = __lsx_vmaxi_h(_in, 0);
|
||||
@ -306,8 +303,7 @@ static inline __m128i __lsx_vclip255_h(__m128i _in)
|
||||
* out : 0,255,255,249
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m128i __lsx_vclip255_w(__m128i _in)
|
||||
{
|
||||
static inline __m128i __lsx_vclip255_w(__m128i _in) {
|
||||
__m128i out;
|
||||
|
||||
out = __lsx_vmaxi_w(_in, 0);
|
||||
@ -333,7 +329,7 @@ static inline __m128i __lsx_vclip255_w(__m128i _in)
|
||||
_in0 = __lsx_vxor_v(_in0, _in1); \
|
||||
_in1 = __lsx_vxor_v(_in0, _in1); \
|
||||
_in0 = __lsx_vxor_v(_in0, _in1); \
|
||||
} \
|
||||
}
|
||||
|
||||
/*
|
||||
* =============================================================================
|
||||
@ -366,17 +362,17 @@ static inline __m128i __lsx_vclip255_w(__m128i _in)
|
||||
* =============================================================================
|
||||
* Description : Transpose 8x8 block with byte elements in vectors
|
||||
* Arguments : Inputs - _in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7
|
||||
* Outputs - _out0, _out1, _out2, _out3, _out4, _out5, _out6, _out7
|
||||
* Details : The rows of the matrix become columns, and the columns become rows.
|
||||
* Example : LSX_TRANSPOSE8x8_B
|
||||
* _in0 : 00,01,02,03,04,05,06,07, 00,00,00,00,00,00,00,00
|
||||
* _in1 : 10,11,12,13,14,15,16,17, 00,00,00,00,00,00,00,00
|
||||
* _in2 : 20,21,22,23,24,25,26,27, 00,00,00,00,00,00,00,00
|
||||
* _in3 : 30,31,32,33,34,35,36,37, 00,00,00,00,00,00,00,00
|
||||
* _in4 : 40,41,42,43,44,45,46,47, 00,00,00,00,00,00,00,00
|
||||
* _in5 : 50,51,52,53,54,55,56,57, 00,00,00,00,00,00,00,00
|
||||
* _in6 : 60,61,62,63,64,65,66,67, 00,00,00,00,00,00,00,00
|
||||
* _in7 : 70,71,72,73,74,75,76,77, 00,00,00,00,00,00,00,00
|
||||
* Outputs - _out0, _out1, _out2, _out3, _out4, _out5, _out6,
|
||||
* _out7 Details : The rows of the matrix become columns, and the columns
|
||||
* become rows. Example : LSX_TRANSPOSE8x8_B _in0 : 00,01,02,03,04,05,06,07,
|
||||
* 00,00,00,00,00,00,00,00 _in1 : 10,11,12,13,14,15,16,17,
|
||||
* 00,00,00,00,00,00,00,00 _in2 : 20,21,22,23,24,25,26,27,
|
||||
* 00,00,00,00,00,00,00,00 _in3 : 30,31,32,33,34,35,36,37,
|
||||
* 00,00,00,00,00,00,00,00 _in4 : 40,41,42,43,44,45,46,47,
|
||||
* 00,00,00,00,00,00,00,00 _in5 : 50,51,52,53,54,55,56,57,
|
||||
* 00,00,00,00,00,00,00,00 _in6 : 60,61,62,63,64,65,66,67,
|
||||
* 00,00,00,00,00,00,00,00 _in7 : 70,71,72,73,74,75,76,77,
|
||||
* 00,00,00,00,00,00,00,00
|
||||
*
|
||||
* _ out0 : 00,10,20,30,40,50,60,70, 00,00,00,00,00,00,00,00
|
||||
* _ out1 : 01,11,21,31,41,51,61,71, 00,00,00,00,00,00,00,00
|
||||
@ -389,7 +385,8 @@ static inline __m128i __lsx_vclip255_w(__m128i _in)
|
||||
* =============================================================================
|
||||
*/
|
||||
#define LSX_TRANSPOSE8x8_B(_in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7, \
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, _out7)\
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, \
|
||||
_out7) \
|
||||
{ \
|
||||
__m128i zero = {0}; \
|
||||
__m128i shuf8 = {0x0F0E0D0C0B0A0908, 0x1716151413121110}; \
|
||||
@ -431,7 +428,8 @@ static inline __m128i __lsx_vclip255_w(__m128i _in)
|
||||
* =============================================================================
|
||||
*/
|
||||
#define LSX_TRANSPOSE8x8_H(_in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7, \
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, _out7)\
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, \
|
||||
_out7) \
|
||||
{ \
|
||||
__m128i _s0, _s1, _t0, _t1, _t2, _t3, _t4, _t5, _t6, _t7; \
|
||||
\
|
||||
@ -468,16 +466,16 @@ static inline __m128i __lsx_vclip255_w(__m128i _in)
|
||||
* Arguments : Inputs - _in0, _in1, _in2, _in3 (input 8x4 byte block)
|
||||
* Outputs - _out0, _out1, _out2, _out3 (output 4x8 byte block)
|
||||
* Return Type - as per RTYPE
|
||||
* Details : The rows of the matrix become columns, and the columns become rows.
|
||||
* Example : LSX_TRANSPOSE8x4_B
|
||||
* _in0 : 00,01,02,03,00,00,00,00, 00,00,00,00,00,00,00,00
|
||||
* _in1 : 10,11,12,13,00,00,00,00, 00,00,00,00,00,00,00,00
|
||||
* _in2 : 20,21,22,23,00,00,00,00, 00,00,00,00,00,00,00,00
|
||||
* _in3 : 30,31,32,33,00,00,00,00, 00,00,00,00,00,00,00,00
|
||||
* _in4 : 40,41,42,43,00,00,00,00, 00,00,00,00,00,00,00,00
|
||||
* _in5 : 50,51,52,53,00,00,00,00, 00,00,00,00,00,00,00,00
|
||||
* _in6 : 60,61,62,63,00,00,00,00, 00,00,00,00,00,00,00,00
|
||||
* _in7 : 70,71,72,73,00,00,00,00, 00,00,00,00,00,00,00,00
|
||||
* Details : The rows of the matrix become columns, and the columns become
|
||||
* rows. Example : LSX_TRANSPOSE8x4_B _in0 : 00,01,02,03,00,00,00,00,
|
||||
* 00,00,00,00,00,00,00,00 _in1 : 10,11,12,13,00,00,00,00,
|
||||
* 00,00,00,00,00,00,00,00 _in2 : 20,21,22,23,00,00,00,00,
|
||||
* 00,00,00,00,00,00,00,00 _in3 : 30,31,32,33,00,00,00,00,
|
||||
* 00,00,00,00,00,00,00,00 _in4 : 40,41,42,43,00,00,00,00,
|
||||
* 00,00,00,00,00,00,00,00 _in5 : 50,51,52,53,00,00,00,00,
|
||||
* 00,00,00,00,00,00,00,00 _in6 : 60,61,62,63,00,00,00,00,
|
||||
* 00,00,00,00,00,00,00,00 _in7 : 70,71,72,73,00,00,00,00,
|
||||
* 00,00,00,00,00,00,00,00
|
||||
*
|
||||
* _out0 : 00,10,20,30,40,50,60,70, 00,00,00,00,00,00,00,00
|
||||
* _out1 : 01,11,21,31,41,51,61,71, 00,00,00,00,00,00,00,00
|
||||
@ -532,9 +530,10 @@ static inline __m128i __lsx_vclip255_w(__m128i _in)
|
||||
* 120,121,122,123,124,125,126,127
|
||||
* =============================================================================
|
||||
*/
|
||||
#define LSX_TRANSPOSE16x8_B(_in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7, _in8, \
|
||||
_in9, _in10, _in11, _in12, _in13, _in14, _in15, _out0, \
|
||||
_out1, _out2, _out3, _out4, _out5, _out6, _out7) \
|
||||
#define LSX_TRANSPOSE16x8_B(_in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7, \
|
||||
_in8, _in9, _in10, _in11, _in12, _in13, _in14, \
|
||||
_in15, _out0, _out1, _out2, _out3, _out4, _out5, \
|
||||
_out6, _out7) \
|
||||
{ \
|
||||
__m128i _tmp0, _tmp1, _tmp2, _tmp3, _tmp4, _tmp5, _tmp6, _tmp7; \
|
||||
__m128i _t0, _t1, _t2, _t3, _t4, _t5, _t6, _t7; \
|
||||
@ -616,7 +615,8 @@ static inline __m128i __lsx_vclip255_w(__m128i _in)
|
||||
* =============================================================================
|
||||
*/
|
||||
#define LSX_BUTTERFLY_8_B(_in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7, \
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, _out7)\
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, \
|
||||
_out7) \
|
||||
{ \
|
||||
_out0 = __lsx_vadd_b(_in0, _in7); \
|
||||
_out1 = __lsx_vadd_b(_in1, _in6); \
|
||||
@ -629,7 +629,8 @@ static inline __m128i __lsx_vclip255_w(__m128i _in)
|
||||
}
|
||||
|
||||
#define LSX_BUTTERFLY_8_H(_in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7, \
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, _out7)\
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, \
|
||||
_out7) \
|
||||
{ \
|
||||
_out0 = __lsx_vadd_h(_in0, _in7); \
|
||||
_out1 = __lsx_vadd_h(_in1, _in6); \
|
||||
@ -642,7 +643,8 @@ static inline __m128i __lsx_vclip255_w(__m128i _in)
|
||||
}
|
||||
|
||||
#define LSX_BUTTERFLY_8_W(_in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7, \
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, _out7)\
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, \
|
||||
_out7) \
|
||||
{ \
|
||||
_out0 = __lsx_vadd_w(_in0, _in7); \
|
||||
_out1 = __lsx_vadd_w(_in1, _in6); \
|
||||
@ -655,7 +657,8 @@ static inline __m128i __lsx_vclip255_w(__m128i _in)
|
||||
}
|
||||
|
||||
#define LSX_BUTTERFLY_8_D(_in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7, \
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, _out7)\
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, \
|
||||
_out7) \
|
||||
{ \
|
||||
_out0 = __lsx_vadd_d(_in0, _in7); \
|
||||
_out1 = __lsx_vadd_d(_in1, _in6); \
|
||||
@ -685,8 +688,7 @@ static inline __m128i __lsx_vclip255_w(__m128i _in)
|
||||
* Example : See out = __lasx_xvdp2_w_h(in_h, in_l)
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvdp2_h_bu(__m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvdp2_h_bu(__m256i in_h, __m256i in_l) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvmulwev_h_bu(in_h, in_l);
|
||||
@ -708,8 +710,7 @@ static inline __m256i __lasx_xvdp2_h_bu(__m256i in_h, __m256i in_l)
|
||||
* Example : See out = __lasx_xvdp2_w_h(in_h, in_l)
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvdp2_h_b(__m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvdp2_h_b(__m256i in_h, __m256i in_l) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvmulwev_h_b(in_h, in_l);
|
||||
@ -734,8 +735,7 @@ static inline __m256i __lasx_xvdp2_h_b(__m256i in_h, __m256i in_l)
|
||||
* out : 22,38,38,22, 22,38,38,22
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvdp2_w_h(__m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvdp2_w_h(__m256i in_h, __m256i in_l) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvmulwev_w_h(in_h, in_l);
|
||||
@ -757,8 +757,7 @@ static inline __m256i __lasx_xvdp2_w_h(__m256i in_h, __m256i in_l)
|
||||
* Example : See out = __lasx_xvdp2_w_h(in_h, in_l)
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvdp2_d_w(__m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvdp2_d_w(__m256i in_h, __m256i in_l) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvmulwev_d_w(in_h, in_l);
|
||||
@ -780,8 +779,7 @@ static inline __m256i __lasx_xvdp2_d_w(__m256i in_h, __m256i in_l)
|
||||
* Example : See out = __lasx_xvdp2_w_h(in_h, in_l)
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvdp2_w_hu_h(__m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvdp2_w_hu_h(__m256i in_h, __m256i in_l) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvmulwev_w_hu_h(in_h, in_l);
|
||||
@ -803,8 +801,9 @@ static inline __m256i __lasx_xvdp2_w_hu_h(__m256i in_h, __m256i in_l)
|
||||
* Example : See out = __lasx_xvdp2add_w_h(in_c, in_h, in_l)
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvdp2add_h_b(__m256i in_c,__m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvdp2add_h_b(__m256i in_c,
|
||||
__m256i in_h,
|
||||
__m256i in_l) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvmaddwev_h_b(in_c, in_h, in_l);
|
||||
@ -830,8 +829,9 @@ static inline __m256i __lasx_xvdp2add_h_b(__m256i in_c,__m256i in_h, __m256i in_
|
||||
* out : 23,40,41,26, 23,40,41,26
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvdp2add_w_h(__m256i in_c, __m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvdp2add_w_h(__m256i in_c,
|
||||
__m256i in_h,
|
||||
__m256i in_l) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvmaddwev_w_h(in_c, in_h, in_l);
|
||||
@ -853,8 +853,9 @@ static inline __m256i __lasx_xvdp2add_w_h(__m256i in_c, __m256i in_h, __m256i in
|
||||
* Example : See out = __lasx_xvdp2add_w_h(in_c, in_h, in_l)
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvdp2add_w_hu(__m256i in_c, __m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvdp2add_w_hu(__m256i in_c,
|
||||
__m256i in_h,
|
||||
__m256i in_l) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvmaddwev_w_hu(in_c, in_h, in_l);
|
||||
@ -876,8 +877,9 @@ static inline __m256i __lasx_xvdp2add_w_hu(__m256i in_c, __m256i in_h, __m256i i
|
||||
* Example : See out = __lasx_xvdp2add_w_h(in_c, in_h, in_l)
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvdp2add_w_hu_h(__m256i in_c, __m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvdp2add_w_hu_h(__m256i in_c,
|
||||
__m256i in_h,
|
||||
__m256i in_l) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvmaddwev_w_hu_h(in_c, in_h, in_l);
|
||||
@ -900,8 +902,9 @@ static inline __m256i __lasx_xvdp2add_w_hu_h(__m256i in_c, __m256i in_h, __m256i
|
||||
* Example : See out = __lasx_xvdp2sub_w_h(in_c, in_h, in_l)
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvdp2sub_h_bu(__m256i in_c, __m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvdp2sub_h_bu(__m256i in_c,
|
||||
__m256i in_h,
|
||||
__m256i in_l) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvmulwev_h_bu(in_h, in_l);
|
||||
@ -929,8 +932,9 @@ static inline __m256i __lasx_xvdp2sub_h_bu(__m256i in_c, __m256i in_h, __m256i i
|
||||
* out : -7,-3,0,0, 0,-1,0,-1
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvdp2sub_w_h(__m256i in_c, __m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvdp2sub_w_h(__m256i in_c,
|
||||
__m256i in_h,
|
||||
__m256i in_l) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvmulwev_w_h(in_h, in_l);
|
||||
@ -956,8 +960,7 @@ static inline __m256i __lasx_xvdp2sub_w_h(__m256i in_c, __m256i in_h, __m256i in
|
||||
* out : -2,0,1,1
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvdp4_d_h(__m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvdp4_d_h(__m256i in_h, __m256i in_l) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvmulwev_w_h(in_h, in_l);
|
||||
@ -978,8 +981,7 @@ static inline __m256i __lasx_xvdp4_d_h(__m256i in_h, __m256i in_l)
|
||||
* Example : See out = __lasx_xvaddwh_w_h(in_h, in_l)
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvaddwh_h_b(__m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvaddwh_h_b(__m256i in_h, __m256i in_l) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvilvh_b(in_h, in_l);
|
||||
@ -1002,8 +1004,7 @@ static inline __m256i __lasx_xvaddwh_h_b(__m256i in_h, __m256i in_l)
|
||||
* out : 1,0,0,-1, 1,0,0, 2
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvaddwh_w_h(__m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvaddwh_w_h(__m256i in_h, __m256i in_l) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvilvh_h(in_h, in_l);
|
||||
@ -1023,8 +1024,7 @@ static inline __m256i __lasx_xvaddwh_h_b(__m256i in_h, __m256i in_l)
|
||||
* Example : See out = __lasx_xvaddwl_w_h(in_h, in_l)
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvaddwl_h_b(__m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvaddwl_h_b(__m256i in_h, __m256i in_l) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvilvl_b(in_h, in_l);
|
||||
@ -1047,8 +1047,7 @@ static inline __m256i __lasx_xvaddwl_h_b(__m256i in_h, __m256i in_l)
|
||||
* out : 5,-1,4,2, 1,0,2,-1
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvaddwl_w_h(__m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvaddwl_w_h(__m256i in_h, __m256i in_l) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvilvl_h(in_h, in_l);
|
||||
@ -1068,8 +1067,7 @@ static inline __m256i __lasx_xvaddwl_w_h(__m256i in_h, __m256i in_l)
|
||||
* Example : See out = __lasx_xvaddwl_w_h(in_h, in_l)
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvaddwl_h_bu(__m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvaddwl_h_bu(__m256i in_h, __m256i in_l) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvilvl_b(in_h, in_l);
|
||||
@ -1088,8 +1086,7 @@ static inline __m256i __lasx_xvaddwl_h_bu(__m256i in_h, __m256i in_l)
|
||||
* Example : See out = __lasx_xvaddw_w_w_h(in_h, in_l)
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvaddw_h_h_bu(__m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvaddw_h_h_bu(__m256i in_h, __m256i in_l) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvsllwil_hu_bu(in_l, 0);
|
||||
@ -1111,8 +1108,7 @@ static inline __m256i __lasx_xvaddw_h_h_bu(__m256i in_h, __m256i in_l)
|
||||
* out : 2, 0,1,2, -1,0,1,1,
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvaddw_w_w_h(__m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvaddw_w_w_h(__m256i in_h, __m256i in_l) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvsllwil_w_h(in_l, 0);
|
||||
@ -1138,8 +1134,9 @@ static inline __m256i __lasx_xvaddw_w_w_h(__m256i in_h, __m256i in_l)
|
||||
* out : 201, 602,1203,2004, -995, -1794,-2793,-3992
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvmaddwl_w_h(__m256i in_c, __m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvmaddwl_w_h(__m256i in_c,
|
||||
__m256i in_h,
|
||||
__m256i in_l) {
|
||||
__m256i tmp0, tmp1, out;
|
||||
|
||||
tmp0 = __lasx_xvsllwil_w_h(in_h, 0);
|
||||
@ -1162,8 +1159,9 @@ static inline __m256i __lasx_xvmaddwl_w_h(__m256i in_c, __m256i in_h, __m256i in
|
||||
* Example : See out = __lasx_xvmaddwl_w_h(in_c, in_h, in_l)
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvmaddwh_w_h(__m256i in_c, __m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvmaddwh_w_h(__m256i in_c,
|
||||
__m256i in_h,
|
||||
__m256i in_l) {
|
||||
__m256i tmp0, tmp1, out;
|
||||
|
||||
tmp0 = __lasx_xvilvh_h(in_h, in_h);
|
||||
@ -1188,8 +1186,7 @@ static inline __m256i __lasx_xvmaddwh_w_h(__m256i in_c, __m256i in_h, __m256i in
|
||||
* out : 6,1,3,0, 0,0,1,0
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvmulwl_w_h(__m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvmulwl_w_h(__m256i in_h, __m256i in_l) {
|
||||
__m256i tmp0, tmp1, out;
|
||||
|
||||
tmp0 = __lasx_xvsllwil_w_h(in_h, 0);
|
||||
@ -1213,8 +1210,7 @@ static inline __m256i __lasx_xvmulwl_w_h(__m256i in_h, __m256i in_l)
|
||||
* out : 0,0,0,0, 0,0,0,1
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvmulwh_w_h(__m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvmulwh_w_h(__m256i in_h, __m256i in_l) {
|
||||
__m256i tmp0, tmp1, out;
|
||||
|
||||
tmp0 = __lasx_xvilvh_h(in_h, in_h);
|
||||
@ -1234,12 +1230,11 @@ static inline __m256i __lasx_xvmulwh_w_h(__m256i in_h, __m256i in_l)
|
||||
* halfword) and the results are stored to the out vector.
|
||||
* Example : out = __lasx_xvsaddw_hu_hu_bu(in_h, in_l)
|
||||
* in_h : 2,65532,1,2, 1,0,0,0, 0,0,1,0, 1,0,0,1
|
||||
* in_l : 3,6,3,0, 0,0,0,1, 0,0,1,1, 0,0,0,1, 3,18,3,0, 0,0,0,1, 0,0,1,1, 0,0,0,1
|
||||
* out : 5,65535,4,2, 1,0,0,1, 3,18,4,0, 1,0,0,2,
|
||||
* in_l : 3,6,3,0, 0,0,0,1, 0,0,1,1, 0,0,0,1, 3,18,3,0, 0,0,0,1, 0,0,1,1,
|
||||
* 0,0,0,1 out : 5,65535,4,2, 1,0,0,1, 3,18,4,0, 1,0,0,2,
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvsaddw_hu_hu_bu(__m256i in_h, __m256i in_l)
|
||||
{
|
||||
static inline __m256i __lasx_xvsaddw_hu_hu_bu(__m256i in_h, __m256i in_l) {
|
||||
__m256i tmp1, out;
|
||||
__m256i zero = {0};
|
||||
|
||||
@ -1264,8 +1259,7 @@ static inline __m256i __lasx_xvsaddw_hu_hu_bu(__m256i in_h, __m256i in_l)
|
||||
* out : 1,2,9,9, 1,9,9,9, 4,4,4,4, 5,5,5,5
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvclip_h(__m256i in, __m256i min, __m256i max)
|
||||
{
|
||||
static inline __m256i __lasx_xvclip_h(__m256i in, __m256i min, __m256i max) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvmax_h(min, in);
|
||||
@ -1283,8 +1277,7 @@ static inline __m256i __lasx_xvclip_h(__m256i in, __m256i min, __m256i max)
|
||||
* Example : See out = __lasx_xvclip255_w(in)
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvclip255_h(__m256i in)
|
||||
{
|
||||
static inline __m256i __lasx_xvclip255_h(__m256i in) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvmaxi_h(in, 0);
|
||||
@ -1304,8 +1297,7 @@ static inline __m256i __lasx_xvclip255_h(__m256i in)
|
||||
* out : 0,255,255,249, 0,255,255,249
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvclip255_w(__m256i in)
|
||||
{
|
||||
static inline __m256i __lasx_xvclip255_w(__m256i in) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvmaxi_w(in, 0);
|
||||
@ -1329,8 +1321,7 @@ static inline __m256i __lasx_xvclip255_w(__m256i in)
|
||||
* out : 11,11,11,11, 11,11,11,11, 11,11,11,11, 11,11,11,11
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvsplati_l_h(__m256i in, int idx)
|
||||
{
|
||||
static inline __m256i __lasx_xvsplati_l_h(__m256i in, int idx) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvpermi_q(in, in, 0x02);
|
||||
@ -1354,8 +1345,7 @@ static inline __m256i __lasx_xvsplati_l_h(__m256i in, int idx)
|
||||
* out : 2,2,2,2, 2,2,2,2, 2,2,2,2, 2,2,2,2
|
||||
* =============================================================================
|
||||
*/
|
||||
static inline __m256i __lasx_xvsplati_h_h(__m256i in, int idx)
|
||||
{
|
||||
static inline __m256i __lasx_xvsplati_h_h(__m256i in, int idx) {
|
||||
__m256i out;
|
||||
|
||||
out = __lasx_xvpermi_q(in, in, 0x13);
|
||||
@ -1380,7 +1370,8 @@ static inline __m256i __lasx_xvsplati_h_h(__m256i in, int idx)
|
||||
* _out3 : 4,4,4,4
|
||||
* =============================================================================
|
||||
*/
|
||||
#define LASX_TRANSPOSE4x4_D(_in0, _in1, _in2, _in3, _out0, _out1, _out2, _out3) \
|
||||
#define LASX_TRANSPOSE4x4_D(_in0, _in1, _in2, _in3, _out0, _out1, _out2, \
|
||||
_out3) \
|
||||
{ \
|
||||
__m256i _tmp0, _tmp1, _tmp2, _tmp3; \
|
||||
_tmp0 = __lasx_xvilvl_d(_in1, _in0); \
|
||||
@ -1397,16 +1388,11 @@ static inline __m256i __lasx_xvsplati_h_h(__m256i in, int idx)
|
||||
* =============================================================================
|
||||
* Description : Transpose 8x8 block with word elements in vectors
|
||||
* Arguments : Inputs - _in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7
|
||||
* Outputs - _out0, _out1, _out2, _out3, _out4, _out5, _out6, _out7
|
||||
* Example : LASX_TRANSPOSE8x8_W
|
||||
* _in0 : 1,2,3,4,5,6,7,8
|
||||
* _in1 : 2,2,3,4,5,6,7,8
|
||||
* _in2 : 3,2,3,4,5,6,7,8
|
||||
* _in3 : 4,2,3,4,5,6,7,8
|
||||
* _in4 : 5,2,3,4,5,6,7,8
|
||||
* _in5 : 6,2,3,4,5,6,7,8
|
||||
* _in6 : 7,2,3,4,5,6,7,8
|
||||
* _in7 : 8,2,3,4,5,6,7,8
|
||||
* Outputs - _out0, _out1, _out2, _out3, _out4, _out5, _out6,
|
||||
* _out7 Example : LASX_TRANSPOSE8x8_W _in0 : 1,2,3,4,5,6,7,8 _in1 :
|
||||
* 2,2,3,4,5,6,7,8 _in2 : 3,2,3,4,5,6,7,8 _in3 : 4,2,3,4,5,6,7,8 _in4 :
|
||||
* 5,2,3,4,5,6,7,8 _in5 : 6,2,3,4,5,6,7,8 _in6 : 7,2,3,4,5,6,7,8 _in7 :
|
||||
* 8,2,3,4,5,6,7,8
|
||||
*
|
||||
* _out0 : 1,2,3,4,5,6,7,8
|
||||
* _out1 : 2,2,2,2,2,2,2,2
|
||||
@ -1419,7 +1405,8 @@ static inline __m256i __lasx_xvsplati_h_h(__m256i in, int idx)
|
||||
* =============================================================================
|
||||
*/
|
||||
#define LASX_TRANSPOSE8x8_W(_in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7, \
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, _out7) \
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, \
|
||||
_out7) \
|
||||
{ \
|
||||
__m256i _s0_m, _s1_m; \
|
||||
__m256i _tmp0_m, _tmp1_m, _tmp2_m, _tmp3_m; \
|
||||
@ -1457,15 +1444,15 @@ static inline __m256i __lasx_xvsplati_h_h(__m256i in, int idx)
|
||||
* Arguments : Inputs - _in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7,
|
||||
* _in8, _in9, _in10, _in11, _in12, _in13, _in14, _in15
|
||||
* (input 16x8 byte block)
|
||||
* Outputs - _out0, _out1, _out2, _out3, _out4, _out5, _out6, _out7
|
||||
* (output 8x16 byte block)
|
||||
* Details : The rows of the matrix become columns, and the columns become rows.
|
||||
* Example : See LASX_TRANSPOSE16x8_H
|
||||
* Outputs - _out0, _out1, _out2, _out3, _out4, _out5, _out6,
|
||||
* _out7 (output 8x16 byte block) Details : The rows of the matrix become
|
||||
* columns, and the columns become rows. Example : See LASX_TRANSPOSE16x8_H
|
||||
* =============================================================================
|
||||
*/
|
||||
#define LASX_TRANSPOSE16x8_B(_in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7, \
|
||||
_in8, _in9, _in10, _in11, _in12, _in13, _in14, _in15, \
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, _out7) \
|
||||
_in8, _in9, _in10, _in11, _in12, _in13, _in14, \
|
||||
_in15, _out0, _out1, _out2, _out3, _out4, _out5, \
|
||||
_out6, _out7) \
|
||||
{ \
|
||||
__m256i _tmp0_m, _tmp1_m, _tmp2_m, _tmp3_m; \
|
||||
__m256i _tmp4_m, _tmp5_m, _tmp6_m, _tmp7_m; \
|
||||
@ -1510,20 +1497,14 @@ static inline __m256i __lasx_xvsplati_h_h(__m256i in, int idx)
|
||||
* Arguments : Inputs - _in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7,
|
||||
* _in8, _in9, _in10, _in11, _in12, _in13, _in14, _in15
|
||||
* (input 16x8 byte block)
|
||||
* Outputs - _out0, _out1, _out2, _out3, _out4, _out5, _out6, _out7
|
||||
* (output 8x16 byte block)
|
||||
* Details : The rows of the matrix become columns, and the columns become rows.
|
||||
* Example : LASX_TRANSPOSE16x8_H
|
||||
* _in0 : 1,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0
|
||||
* _in1 : 2,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0
|
||||
* _in2 : 3,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0
|
||||
* _in3 : 4,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0
|
||||
* _in4 : 5,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0
|
||||
* _in5 : 6,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0
|
||||
* _in6 : 7,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0
|
||||
* _in7 : 8,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0
|
||||
* _in8 : 9,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0
|
||||
* _in9 : 1,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0
|
||||
* Outputs - _out0, _out1, _out2, _out3, _out4, _out5, _out6,
|
||||
* _out7 (output 8x16 byte block) Details : The rows of the matrix become
|
||||
* columns, and the columns become rows. Example : LASX_TRANSPOSE16x8_H _in0
|
||||
* : 1,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0 _in1 : 2,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0 _in2
|
||||
* : 3,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0 _in3 : 4,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0 _in4
|
||||
* : 5,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0 _in5 : 6,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0 _in6
|
||||
* : 7,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0 _in7 : 8,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0 _in8
|
||||
* : 9,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0 _in9 : 1,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0
|
||||
* _in10 : 0,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0
|
||||
* _in11 : 2,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0
|
||||
* _in12 : 3,2,3,4,5,6,7,8,0,0,0,0,0,0,0,0
|
||||
@ -1542,8 +1523,9 @@ static inline __m256i __lasx_xvsplati_h_h(__m256i in, int idx)
|
||||
* =============================================================================
|
||||
*/
|
||||
#define LASX_TRANSPOSE16x8_H(_in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7, \
|
||||
_in8, _in9, _in10, _in11, _in12, _in13, _in14, _in15, \
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, _out7) \
|
||||
_in8, _in9, _in10, _in11, _in12, _in13, _in14, \
|
||||
_in15, _out0, _out1, _out2, _out3, _out4, _out5, \
|
||||
_out6, _out7) \
|
||||
{ \
|
||||
__m256i _tmp0_m, _tmp1_m, _tmp2_m, _tmp3_m; \
|
||||
__m256i _tmp4_m, _tmp5_m, _tmp6_m, _tmp7_m; \
|
||||
@ -1614,11 +1596,12 @@ static inline __m256i __lasx_xvsplati_h_h(__m256i in, int idx)
|
||||
* Arguments : Inputs - _in0, _in1, _in2, _in3
|
||||
* Outputs - _out0, _out1, _out2, _out3
|
||||
* Return Type - signed halfword
|
||||
* Details : The rows of the matrix become columns, and the columns become rows.
|
||||
* Example : See LASX_TRANSPOSE8x8_H
|
||||
* Details : The rows of the matrix become columns, and the columns become
|
||||
* rows. Example : See LASX_TRANSPOSE8x8_H
|
||||
* =============================================================================
|
||||
*/
|
||||
#define LASX_TRANSPOSE4x4_H(_in0, _in1, _in2, _in3, _out0, _out1, _out2, _out3) \
|
||||
#define LASX_TRANSPOSE4x4_H(_in0, _in1, _in2, _in3, _out0, _out1, _out2, \
|
||||
_out3) \
|
||||
{ \
|
||||
__m256i _s0_m, _s1_m; \
|
||||
\
|
||||
@ -1635,13 +1618,13 @@ static inline __m256i __lasx_xvsplati_h_h(__m256i in, int idx)
|
||||
* Description : Transpose input 8x8 byte block
|
||||
* Arguments : Inputs - _in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7
|
||||
* (input 8x8 byte block)
|
||||
* Outputs - _out0, _out1, _out2, _out3, _out4, _out5, _out6, _out7
|
||||
* (output 8x8 byte block)
|
||||
* Example : See LASX_TRANSPOSE8x8_H
|
||||
* Outputs - _out0, _out1, _out2, _out3, _out4, _out5, _out6,
|
||||
* _out7 (output 8x8 byte block) Example : See LASX_TRANSPOSE8x8_H
|
||||
* =============================================================================
|
||||
*/
|
||||
#define LASX_TRANSPOSE8x8_B(_in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7, _out0, \
|
||||
_out1, _out2, _out3, _out4, _out5, _out6, _out7) \
|
||||
#define LASX_TRANSPOSE8x8_B(_in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7, \
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, \
|
||||
_out7) \
|
||||
{ \
|
||||
__m256i _tmp0_m, _tmp1_m, _tmp2_m, _tmp3_m; \
|
||||
__m256i _tmp4_m, _tmp5_m, _tmp6_m, _tmp7_m; \
|
||||
@ -1668,16 +1651,12 @@ static inline __m256i __lasx_xvsplati_h_h(__m256i in, int idx)
|
||||
* Description : Transpose 8x8 block with halfword elements in vectors.
|
||||
* Arguments : Inputs - _in0, _in1, ~
|
||||
* Outputs - _out0, _out1, ~
|
||||
* Details : The rows of the matrix become columns, and the columns become rows.
|
||||
* Example : LASX_TRANSPOSE8x8_H
|
||||
* _in0 : 1,2,3,4, 5,6,7,8, 1,2,3,4, 5,6,7,8
|
||||
* _in1 : 8,2,3,4, 5,6,7,8, 8,2,3,4, 5,6,7,8
|
||||
* _in2 : 8,2,3,4, 5,6,7,8, 8,2,3,4, 5,6,7,8
|
||||
* _in3 : 1,2,3,4, 5,6,7,8, 1,2,3,4, 5,6,7,8
|
||||
* _in4 : 9,2,3,4, 5,6,7,8, 9,2,3,4, 5,6,7,8
|
||||
* _in5 : 1,2,3,4, 5,6,7,8, 1,2,3,4, 5,6,7,8
|
||||
* _in6 : 1,2,3,4, 5,6,7,8, 1,2,3,4, 5,6,7,8
|
||||
* _in7 : 9,2,3,4, 5,6,7,8, 9,2,3,4, 5,6,7,8
|
||||
* Details : The rows of the matrix become columns, and the columns become
|
||||
* rows. Example : LASX_TRANSPOSE8x8_H _in0 : 1,2,3,4, 5,6,7,8, 1,2,3,4,
|
||||
* 5,6,7,8 _in1 : 8,2,3,4, 5,6,7,8, 8,2,3,4, 5,6,7,8 _in2 : 8,2,3,4, 5,6,7,8,
|
||||
* 8,2,3,4, 5,6,7,8 _in3 : 1,2,3,4, 5,6,7,8, 1,2,3,4, 5,6,7,8 _in4 : 9,2,3,4,
|
||||
* 5,6,7,8, 9,2,3,4, 5,6,7,8 _in5 : 1,2,3,4, 5,6,7,8, 1,2,3,4, 5,6,7,8 _in6 :
|
||||
* 1,2,3,4, 5,6,7,8, 1,2,3,4, 5,6,7,8 _in7 : 9,2,3,4, 5,6,7,8, 9,2,3,4, 5,6,7,8
|
||||
*
|
||||
* _out0 : 1,8,8,1, 9,1,1,9, 1,8,8,1, 9,1,1,9
|
||||
* _out1 : 2,2,2,2, 2,2,2,2, 2,2,2,2, 2,2,2,2
|
||||
@ -1689,8 +1668,9 @@ static inline __m256i __lasx_xvsplati_h_h(__m256i in, int idx)
|
||||
* _out7 : 8,8,8,8, 8,8,8,8, 8,8,8,8, 8,8,8,8
|
||||
* =============================================================================
|
||||
*/
|
||||
#define LASX_TRANSPOSE8x8_H(_in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7, _out0, \
|
||||
_out1, _out2, _out3, _out4, _out5, _out6, _out7) \
|
||||
#define LASX_TRANSPOSE8x8_H(_in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7, \
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, \
|
||||
_out7) \
|
||||
{ \
|
||||
__m256i _s0_m, _s1_m; \
|
||||
__m256i _tmp0_m, _tmp1_m, _tmp2_m, _tmp3_m; \
|
||||
@ -1784,7 +1764,8 @@ static inline __m256i __lasx_xvsplati_h_h(__m256i in, int idx)
|
||||
* =============================================================================
|
||||
*/
|
||||
#define LASX_BUTTERFLY_8_B(_in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7, \
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, _out7)\
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, \
|
||||
_out7) \
|
||||
{ \
|
||||
_out0 = __lasx_xvadd_b(_in0, _in7); \
|
||||
_out1 = __lasx_xvadd_b(_in1, _in6); \
|
||||
@ -1797,7 +1778,8 @@ static inline __m256i __lasx_xvsplati_h_h(__m256i in, int idx)
|
||||
}
|
||||
|
||||
#define LASX_BUTTERFLY_8_H(_in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7, \
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, _out7)\
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, \
|
||||
_out7) \
|
||||
{ \
|
||||
_out0 = __lasx_xvadd_h(_in0, _in7); \
|
||||
_out1 = __lasx_xvadd_h(_in1, _in6); \
|
||||
@ -1810,7 +1792,8 @@ static inline __m256i __lasx_xvsplati_h_h(__m256i in, int idx)
|
||||
}
|
||||
|
||||
#define LASX_BUTTERFLY_8_W(_in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7, \
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, _out7)\
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, \
|
||||
_out7) \
|
||||
{ \
|
||||
_out0 = __lasx_xvadd_w(_in0, _in7); \
|
||||
_out1 = __lasx_xvadd_w(_in1, _in6); \
|
||||
@ -1823,7 +1806,8 @@ static inline __m256i __lasx_xvsplati_h_h(__m256i in, int idx)
|
||||
}
|
||||
|
||||
#define LASX_BUTTERFLY_8_D(_in0, _in1, _in2, _in3, _in4, _in5, _in6, _in7, \
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, _out7)\
|
||||
_out0, _out1, _out2, _out3, _out4, _out5, _out6, \
|
||||
_out7) \
|
||||
{ \
|
||||
_out0 = __lasx_xvadd_d(_in0, _in7); \
|
||||
_out1 = __lasx_xvadd_d(_in1, _in6); \
|
||||
|
||||
@ -83,6 +83,16 @@ void SetPlane(uint8_t* dst_y,
|
||||
int height,
|
||||
uint32_t value);
|
||||
|
||||
// Convert a plane of tiles of 16 x H to linear.
|
||||
LIBYUV_API
|
||||
void DetilePlane(const uint8_t* src_y,
|
||||
int src_stride_y,
|
||||
uint8_t* dst_y,
|
||||
int dst_stride_y,
|
||||
int width,
|
||||
int height,
|
||||
int tile_height);
|
||||
|
||||
// Split interleaved UV plane into separate U and V planes.
|
||||
LIBYUV_API
|
||||
void SplitUVPlane(const uint8_t* src_uv,
|
||||
|
||||
@ -400,8 +400,8 @@ extern "C" {
|
||||
|
||||
// The following are available for AVX512 clang x64 platforms:
|
||||
// TODO(fbarchard): Port to x86
|
||||
#if !defined(LIBYUV_DISABLE_X86) && \
|
||||
defined(__x86_64__) && (defined(CLANG_HAS_AVX512))
|
||||
#if !defined(LIBYUV_DISABLE_X86) && defined(__x86_64__) && \
|
||||
(defined(CLANG_HAS_AVX512))
|
||||
#define HAS_I422TOARGBROW_AVX512BW
|
||||
#endif
|
||||
|
||||
@ -536,7 +536,7 @@ extern "C" {
|
||||
#define HAS_SCALESUMSAMPLES_NEON
|
||||
#define HAS_GAUSSROW_F32_NEON
|
||||
#define HAS_GAUSSCOL_F32_NEON
|
||||
|
||||
#define HAS_DETILEROW_NEON
|
||||
#endif
|
||||
#if !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa)
|
||||
#define HAS_ABGRTOUVROW_MSA
|
||||
@ -1768,7 +1768,9 @@ void ARGBMirrorRow_Any_NEON(const uint8_t* src_ptr,
|
||||
uint8_t* dst_ptr,
|
||||
int width);
|
||||
void ARGBMirrorRow_Any_MSA(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
|
||||
void ARGBMirrorRow_Any_LASX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width);
|
||||
void ARGBMirrorRow_Any_LASX(const uint8_t* src_ptr,
|
||||
uint8_t* dst_ptr,
|
||||
int width);
|
||||
|
||||
void RGB24MirrorRow_SSSE3(const uint8_t* src_rgb24,
|
||||
uint8_t* dst_rgb24,
|
||||
@ -1828,7 +1830,15 @@ void SplitUVRow_Any_LSX(const uint8_t* src_ptr,
|
||||
uint8_t* dst_u,
|
||||
uint8_t* dst_v,
|
||||
int width);
|
||||
void DetileRow_C(const uint8_t* src,
|
||||
ptrdiff_t src_tile_stride,
|
||||
uint8_t* dst,
|
||||
int width);
|
||||
|
||||
void DetileRow_NEON(const uint8_t* src,
|
||||
ptrdiff_t src_tile_stride,
|
||||
uint8_t* dst,
|
||||
int width);
|
||||
void MergeUVRow_C(const uint8_t* src_u,
|
||||
const uint8_t* src_v,
|
||||
uint8_t* dst_uv,
|
||||
@ -2802,7 +2812,6 @@ void ARGBToARGB4444Row_LASX(const uint8_t* src_argb,
|
||||
uint8_t* dst_rgb,
|
||||
int width);
|
||||
|
||||
|
||||
void ARGBToRGBARow_C(const uint8_t* src_argb, uint8_t* dst_rgb, int width);
|
||||
void ARGBToRGB24Row_C(const uint8_t* src_argb, uint8_t* dst_rgb, int width);
|
||||
void ARGBToRAWRow_C(const uint8_t* src_argb, uint8_t* dst_rgb, int width);
|
||||
@ -4097,7 +4106,6 @@ void ARGBToARGB4444Row_Any_LASX(const uint8_t* src_ptr,
|
||||
uint8_t* dst_ptr,
|
||||
int width);
|
||||
|
||||
|
||||
void I444ToARGBRow_Any_NEON(const uint8_t* y_buf,
|
||||
const uint8_t* u_buf,
|
||||
const uint8_t* v_buf,
|
||||
@ -4878,7 +4886,6 @@ void ARGBQuantizeRow_LSX(uint8_t* dst_argb,
|
||||
int interval_offset,
|
||||
int width);
|
||||
|
||||
|
||||
void ARGBShadeRow_C(const uint8_t* src_argb,
|
||||
uint8_t* dst_argb,
|
||||
int width,
|
||||
@ -4912,7 +4919,6 @@ void ComputeCumulativeSumRow_SSE2(const uint8_t* row,
|
||||
const int32_t* previous_cumsum,
|
||||
int width);
|
||||
|
||||
|
||||
void CumulativeSumToAverageRow_C(const int32_t* tl,
|
||||
const int32_t* bl,
|
||||
int w,
|
||||
@ -5259,7 +5265,6 @@ float ScaleSumSamples_NEON(const float* src,
|
||||
void ScaleSamples_C(const float* src, float* dst, float scale, int width);
|
||||
void ScaleSamples_NEON(const float* src, float* dst, float scale, int width);
|
||||
|
||||
|
||||
void GaussRow_F32_NEON(const float* src, float* dst, int width);
|
||||
void GaussRow_F32_C(const float* src, float* dst, int width);
|
||||
|
||||
|
||||
@ -1564,7 +1564,6 @@ void ScaleRowDown34_1_Box_Any_MSA(const uint8_t* src_ptr,
|
||||
uint8_t* dst_ptr,
|
||||
int dst_width);
|
||||
|
||||
|
||||
void ScaleRowDown2_LSX(const uint8_t* src_ptr,
|
||||
ptrdiff_t src_stride,
|
||||
uint8_t* dst,
|
||||
|
||||
@ -11,6 +11,6 @@
|
||||
#ifndef INCLUDE_LIBYUV_VERSION_H_
|
||||
#define INCLUDE_LIBYUV_VERSION_H_
|
||||
|
||||
#define LIBYUV_VERSION 1809
|
||||
#define LIBYUV_VERSION 1810
|
||||
|
||||
#endif // INCLUDE_LIBYUV_VERSION_H_
|
||||
@ -2448,8 +2448,7 @@ int RGB565ToI420(const uint8_t* src_rgb565,
|
||||
}
|
||||
}
|
||||
// MSA version does direct RGB565 to YUV.
|
||||
#elif (defined(HAS_RGB565TOYROW_MSA) \
|
||||
|| defined(HAS_RGB565TOYROW_LSX))
|
||||
#elif (defined(HAS_RGB565TOYROW_MSA) || defined(HAS_RGB565TOYROW_LSX))
|
||||
#if defined(HAS_RGB565TOYROW_MSA) && defined(HAS_RGB565TOUVROW_MSA)
|
||||
if (TestCpuFlag(kCpuHasMSA)) {
|
||||
RGB565ToUVRow = RGB565ToUVRow_Any_MSA;
|
||||
|
||||
@ -90,7 +90,8 @@ int I420ToARGBMatrix(const uint8_t* src_y,
|
||||
}
|
||||
#endif
|
||||
#if defined(HAS_I422TOARGBROW_AVX512BW)
|
||||
if (TestCpuFlag(kCpuHasAVX512BW | kCpuHasAVX512VL) == (kCpuHasAVX512BW | kCpuHasAVX512VL)) {
|
||||
if (TestCpuFlag(kCpuHasAVX512BW | kCpuHasAVX512VL) ==
|
||||
(kCpuHasAVX512BW | kCpuHasAVX512VL)) {
|
||||
I422ToARGBRow = I422ToARGBRow_Any_AVX512BW;
|
||||
if (IS_ALIGNED(width, 32)) {
|
||||
I422ToARGBRow = I422ToARGBRow_AVX512BW;
|
||||
@ -329,7 +330,8 @@ int I422ToARGBMatrix(const uint8_t* src_y,
|
||||
}
|
||||
#endif
|
||||
#if defined(HAS_I422TOARGBROW_AVX512BW)
|
||||
if (TestCpuFlag(kCpuHasAVX512BW | kCpuHasAVX512VL) == (kCpuHasAVX512BW | kCpuHasAVX512VL)) {
|
||||
if (TestCpuFlag(kCpuHasAVX512BW | kCpuHasAVX512VL) ==
|
||||
(kCpuHasAVX512BW | kCpuHasAVX512VL)) {
|
||||
I422ToARGBRow = I422ToARGBRow_Any_AVX512BW;
|
||||
if (IS_ALIGNED(width, 32)) {
|
||||
I422ToARGBRow = I422ToARGBRow_AVX512BW;
|
||||
@ -5094,7 +5096,8 @@ int I420ToRGB565Dither(const uint8_t* src_y,
|
||||
}
|
||||
#endif
|
||||
#if defined(HAS_I422TOARGBROW_AVX512BW)
|
||||
if (TestCpuFlag(kCpuHasAVX512BW | kCpuHasAVX512VL) == (kCpuHasAVX512BW | kCpuHasAVX512VL)) {
|
||||
if (TestCpuFlag(kCpuHasAVX512BW | kCpuHasAVX512VL) ==
|
||||
(kCpuHasAVX512BW | kCpuHasAVX512VL)) {
|
||||
I422ToARGBRow = I422ToARGBRow_Any_AVX512BW;
|
||||
if (IS_ALIGNED(width, 32)) {
|
||||
I422ToARGBRow = I422ToARGBRow_AVX512BW;
|
||||
|
||||
@ -201,11 +201,7 @@ LIBYUV_API SAFEBUFFERS int LoongarchCpuCaps(void) {
|
||||
int flag = 0x0;
|
||||
uint32_t cfg2 = 0;
|
||||
|
||||
__asm__ volatile(
|
||||
"cpucfg %0, %1 \n\t"
|
||||
: "+&r"(cfg2)
|
||||
: "r"(LOONGARCH_CFG2)
|
||||
);
|
||||
__asm__ volatile("cpucfg %0, %1 \n\t" : "+&r"(cfg2) : "r"(LOONGARCH_CFG2));
|
||||
|
||||
if (cfg2 & LOONGARCH_CFG2_LSX)
|
||||
flag |= kCpuHasLSX;
|
||||
|
||||
@ -853,6 +853,53 @@ int NV21ToNV12(const uint8_t* src_y,
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Detile a plane of data
|
||||
// tile width is 16 and assumed.
|
||||
// tile_height is 16 or 32 for MM21.
|
||||
// src_stride_y is bytes per row of source ignoring tiling. e.g. 640
|
||||
// TODO: More detile row functions.
|
||||
|
||||
LIBYUV_API
|
||||
void DetilePlane(const uint8_t* src_y,
|
||||
int src_stride_y,
|
||||
uint8_t* dst_y,
|
||||
int dst_stride_y,
|
||||
int width,
|
||||
int height,
|
||||
int tile_height) {
|
||||
const ptrdiff_t src_tile_stride = 16 * tile_height;
|
||||
int y;
|
||||
void (*DetileRow)(const uint8_t* src, ptrdiff_t src_tile_stride, uint8_t* dst,
|
||||
int width) = DetileRow_C;
|
||||
assert(src_stride_y >= 0);
|
||||
assert(tile_height > 0);
|
||||
assert(src_stride_y > 0);
|
||||
|
||||
// Negative height means invert the image.
|
||||
if (height < 0) {
|
||||
height = -height;
|
||||
dst_y = dst_y + (height - 1) * dst_stride_y;
|
||||
dst_stride_y = -dst_stride_y;
|
||||
}
|
||||
|
||||
#if defined(HAS_DETILEROW_NEON)
|
||||
if (TestCpuFlag(kCpuHasNEON) && IS_ALIGNED(width, 16)) {
|
||||
DetileRow = DetileRow_NEON;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Detile plane
|
||||
for (y = 0; y < height; ++y) {
|
||||
DetileRow(src_y, src_tile_stride, dst_y, width);
|
||||
dst_y += dst_stride_y;
|
||||
src_y += 16;
|
||||
// Advance to next row of tiles.
|
||||
if ((y & (tile_height - 1)) == (tile_height - 1)) {
|
||||
src_y = src_y - src_tile_stride + src_stride_y * tile_height;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Support function for NV12 etc RGB channels.
|
||||
// Width and height are plane sizes (typically half pixel width).
|
||||
LIBYUV_API
|
||||
|
||||
@ -84,7 +84,6 @@ void TransposeUVWx16_C(const uint8_t* src,
|
||||
dst_stride_a, (dst_b + 8), dst_stride_b, width);
|
||||
}
|
||||
|
||||
|
||||
void TransposeWx16_LSX(const uint8_t* src,
|
||||
int src_stride,
|
||||
uint8_t* dst,
|
||||
@ -139,23 +138,23 @@ void TransposeWx16_LSX(const uint8_t* src,
|
||||
res8 = __lsx_vilvl_w(reg4, reg0);
|
||||
res9 = __lsx_vilvh_w(reg4, reg0);
|
||||
ILVLH_D(res0, res8, res1, res9, dst0, dst1, dst2, dst3);
|
||||
LSX_ST_4(dst0, dst1, dst2, dst3, dst, dst_stride, dst_stride2,
|
||||
dst_stride3, dst_stride4);
|
||||
LSX_ST_4(dst0, dst1, dst2, dst3, dst, dst_stride, dst_stride2, dst_stride3,
|
||||
dst_stride4);
|
||||
res8 = __lsx_vilvl_w(reg5, reg1);
|
||||
res9 = __lsx_vilvh_w(reg5, reg1);
|
||||
ILVLH_D(res2, res8, res3, res9, dst0, dst1, dst2, dst3);
|
||||
LSX_ST_4(dst0, dst1, dst2, dst3, dst, dst_stride, dst_stride2,
|
||||
dst_stride3, dst_stride4);
|
||||
LSX_ST_4(dst0, dst1, dst2, dst3, dst, dst_stride, dst_stride2, dst_stride3,
|
||||
dst_stride4);
|
||||
res8 = __lsx_vilvl_w(reg6, reg2);
|
||||
res9 = __lsx_vilvh_w(reg6, reg2);
|
||||
ILVLH_D(res4, res8, res5, res9, dst0, dst1, dst2, dst3);
|
||||
LSX_ST_4(dst0, dst1, dst2, dst3, dst, dst_stride, dst_stride2,
|
||||
dst_stride3, dst_stride4);
|
||||
LSX_ST_4(dst0, dst1, dst2, dst3, dst, dst_stride, dst_stride2, dst_stride3,
|
||||
dst_stride4);
|
||||
res8 = __lsx_vilvl_w(reg7, reg3);
|
||||
res9 = __lsx_vilvh_w(reg7, reg3);
|
||||
ILVLH_D(res6, res8, res7, res9, dst0, dst1, dst2, dst3);
|
||||
LSX_ST_4(dst0, dst1, dst2, dst3, dst, dst_stride, dst_stride2,
|
||||
dst_stride3, dst_stride4);
|
||||
LSX_ST_4(dst0, dst1, dst2, dst3, dst, dst_stride, dst_stride2, dst_stride3,
|
||||
dst_stride4);
|
||||
src += 16;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2659,6 +2659,21 @@ void RGB24MirrorRow_C(const uint8_t* src_rgb24, uint8_t* dst_rgb24, int width) {
|
||||
}
|
||||
}
|
||||
|
||||
void DetileRow_C(const uint8_t* src,
|
||||
ptrdiff_t src_tile_stride,
|
||||
uint8_t* dst,
|
||||
int width) {
|
||||
int x;
|
||||
for (x = 0; x < width - 15; x += 16) {
|
||||
memcpy(dst, src, 16);
|
||||
dst += 16;
|
||||
src += src_tile_stride;
|
||||
}
|
||||
if (width & 15) {
|
||||
memcpy(dst, src, width & 15);
|
||||
}
|
||||
}
|
||||
|
||||
void SplitUVRow_C(const uint8_t* src_uv,
|
||||
uint8_t* dst_u,
|
||||
uint8_t* dst_v,
|
||||
|
||||
@ -66,8 +66,8 @@ extern "C" {
|
||||
}
|
||||
|
||||
// Convert 16 pixels of YUV420 to RGB.
|
||||
#define YUVTORGB_D(in_y, in_uvl, in_uvh, ubvr, ugvg, \
|
||||
yg, yb, b_l, b_h, g_l, g_h, r_l, r_h) \
|
||||
#define YUVTORGB_D(in_y, in_uvl, in_uvh, ubvr, ugvg, yg, yb, b_l, b_h, g_l, \
|
||||
g_h, r_l, r_h) \
|
||||
{ \
|
||||
__m256i u_l, u_h, v_l, v_h; \
|
||||
__m256i yl_ev, yl_od, yh_ev, yh_od; \
|
||||
@ -93,20 +93,20 @@ extern "C" {
|
||||
temp1 = __lasx_xvadd_w(yl_od, u_l); \
|
||||
temp2 = __lasx_xvadd_w(yh_ev, u_h); \
|
||||
temp3 = __lasx_xvadd_w(yh_od, u_h); \
|
||||
DUP4_ARG2(__lasx_xvsrai_w, temp0, 6, temp1, 6, temp2, 6, temp3, 6, \
|
||||
temp0, temp1, temp2, temp3); \
|
||||
DUP4_ARG1(__lasx_xvclip255_w, temp0, temp1, temp2, temp3, \
|
||||
temp0, temp1, temp2, temp3); \
|
||||
DUP4_ARG2(__lasx_xvsrai_w, temp0, 6, temp1, 6, temp2, 6, temp3, 6, temp0, \
|
||||
temp1, temp2, temp3); \
|
||||
DUP4_ARG1(__lasx_xvclip255_w, temp0, temp1, temp2, temp3, temp0, temp1, \
|
||||
temp2, temp3); \
|
||||
b_l = __lasx_xvpackev_h(temp1, temp0); \
|
||||
b_h = __lasx_xvpackev_h(temp3, temp2); \
|
||||
temp0 = __lasx_xvadd_w(yl_ev, v_l); \
|
||||
temp1 = __lasx_xvadd_w(yl_od, v_l); \
|
||||
temp2 = __lasx_xvadd_w(yh_ev, v_h); \
|
||||
temp3 = __lasx_xvadd_w(yh_od, v_h); \
|
||||
DUP4_ARG2(__lasx_xvsrai_w, temp0, 6, temp1, 6, temp2, 6, temp3, 6, \
|
||||
temp0, temp1, temp2, temp3); \
|
||||
DUP4_ARG1(__lasx_xvclip255_w, temp0, temp1, temp2, temp3, \
|
||||
temp0, temp1, temp2, temp3); \
|
||||
DUP4_ARG2(__lasx_xvsrai_w, temp0, 6, temp1, 6, temp2, 6, temp3, 6, temp0, \
|
||||
temp1, temp2, temp3); \
|
||||
DUP4_ARG1(__lasx_xvclip255_w, temp0, temp1, temp2, temp3, temp0, temp1, \
|
||||
temp2, temp3); \
|
||||
r_l = __lasx_xvpackev_h(temp1, temp0); \
|
||||
r_h = __lasx_xvpackev_h(temp3, temp2); \
|
||||
DUP2_ARG2(__lasx_xvdp2_w_h, in_uvl, ugvg, in_uvh, ugvg, u_l, u_h); \
|
||||
@ -114,17 +114,16 @@ extern "C" {
|
||||
temp1 = __lasx_xvsub_w(yl_od, u_l); \
|
||||
temp2 = __lasx_xvsub_w(yh_ev, u_h); \
|
||||
temp3 = __lasx_xvsub_w(yh_od, u_h); \
|
||||
DUP4_ARG2(__lasx_xvsrai_w, temp0, 6, temp1, 6, temp2, 6, temp3, 6, \
|
||||
temp0, temp1, temp2, temp3); \
|
||||
DUP4_ARG1(__lasx_xvclip255_w, temp0, temp1, temp2, temp3, \
|
||||
temp0, temp1, temp2, temp3); \
|
||||
DUP4_ARG2(__lasx_xvsrai_w, temp0, 6, temp1, 6, temp2, 6, temp3, 6, temp0, \
|
||||
temp1, temp2, temp3); \
|
||||
DUP4_ARG1(__lasx_xvclip255_w, temp0, temp1, temp2, temp3, temp0, temp1, \
|
||||
temp2, temp3); \
|
||||
g_l = __lasx_xvpackev_h(temp1, temp0); \
|
||||
g_h = __lasx_xvpackev_h(temp3, temp2); \
|
||||
}
|
||||
|
||||
// Convert 8 pixels of YUV420 to RGB.
|
||||
#define YUVTORGB(in_y, in_uv, ubvr, ugvg, \
|
||||
yg, yb, out_b, out_g, out_r) \
|
||||
#define YUVTORGB(in_y, in_uv, ubvr, ugvg, yg, yb, out_b, out_g, out_r) \
|
||||
{ \
|
||||
__m256i u_l, v_l, yl_ev, yl_od; \
|
||||
__m256i temp0, temp1; \
|
||||
@ -157,8 +156,7 @@ extern "C" {
|
||||
}
|
||||
|
||||
// Pack and Store 16 ARGB values.
|
||||
#define STOREARGB_D(a_l, a_h, r_l, r_h, g_l, g_h, \
|
||||
b_l, b_h, pdst_argb) \
|
||||
#define STOREARGB_D(a_l, a_h, r_l, r_h, g_l, g_h, b_l, b_h, pdst_argb) \
|
||||
{ \
|
||||
__m256i temp0, temp1, temp2, temp3; \
|
||||
\
|
||||
@ -206,8 +204,8 @@ void MirrorRow_LASX(const uint8_t* src, uint8_t* dst, int width) {
|
||||
src += width - 64;
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP2_ARG2(__lasx_xvld, src, 0, src, 32, src0, src1);
|
||||
DUP2_ARG3(__lasx_xvshuf_b, src0, src0, shuffler,
|
||||
src1, src1, shuffler, src0, src1);
|
||||
DUP2_ARG3(__lasx_xvshuf_b, src0, src0, shuffler, src1, src1, shuffler, src0,
|
||||
src1);
|
||||
src0 = __lasx_xvpermi_q(src0, src0, 0x01);
|
||||
src1 = __lasx_xvpermi_q(src1, src1, 0x01);
|
||||
__lasx_xvst(src1, dst, 0);
|
||||
@ -245,8 +243,8 @@ void ARGBMirrorRow_LASX(const uint8_t* src, uint8_t* dst, int width) {
|
||||
src += (width * 4) - 64;
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP2_ARG2(__lasx_xvld, src, 0, src, 32, src0, src1);
|
||||
DUP2_ARG3(__lasx_xvshuf_b, src0, src0, shuffler,
|
||||
src1, src1, shuffler, src0, src1);
|
||||
DUP2_ARG3(__lasx_xvshuf_b, src0, src0, shuffler, src1, src1, shuffler, src0,
|
||||
src1);
|
||||
dst1 = __lasx_xvpermi_q(src0, src0, 0x01);
|
||||
dst0 = __lasx_xvpermi_q(src1, src1, 0x01);
|
||||
__lasx_xvst(dst0, dst, 0);
|
||||
@ -335,8 +333,8 @@ void I422ToARGBRow_LASX(const uint8_t* src_y,
|
||||
__m256i y, uv_l, uv_h, b_l, b_h, g_l, g_h, r_l, r_h;
|
||||
|
||||
READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h);
|
||||
YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg,
|
||||
vec_yb, b_l, b_h, g_l, g_h, r_l, r_h);
|
||||
YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l,
|
||||
g_h, r_l, r_h);
|
||||
STOREARGB_D(alpha, alpha, r_l, r_h, g_l, g_h, b_l, b_h, dst_argb);
|
||||
src_y += 32;
|
||||
src_u += 16;
|
||||
@ -363,8 +361,8 @@ void I422ToRGBARow_LASX(const uint8_t* src_y,
|
||||
__m256i y, uv_l, uv_h, b_l, b_h, g_l, g_h, r_l, r_h;
|
||||
|
||||
READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h);
|
||||
YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg,
|
||||
vec_yb, b_l, b_h, g_l, g_h, r_l, r_h);
|
||||
YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l,
|
||||
g_h, r_l, r_h);
|
||||
STOREARGB_D(r_l, r_h, g_l, g_h, b_l, b_h, alpha, alpha, dst_argb);
|
||||
src_y += 32;
|
||||
src_u += 16;
|
||||
@ -396,8 +394,8 @@ void I422AlphaToARGBRow_LASX(const uint8_t* src_y,
|
||||
a_l = __lasx_xvilvl_b(zero, y);
|
||||
a_h = __lasx_xvilvh_b(zero, y);
|
||||
READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h);
|
||||
YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg,
|
||||
vec_yb, b_l, b_h, g_l, g_h, r_l, r_h);
|
||||
YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l,
|
||||
g_h, r_l, r_h);
|
||||
STOREARGB_D(a_l, a_h, r_l, r_h, g_l, g_h, b_l, b_h, dst_argb);
|
||||
src_y += 32;
|
||||
src_u += 16;
|
||||
@ -437,12 +435,13 @@ void I422ToRGB24Row_LASX(const uint8_t* src_y,
|
||||
__m256i temp0, temp1, temp2, temp3;
|
||||
|
||||
READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h);
|
||||
YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg,
|
||||
vec_yb, b_l, b_h, g_l, g_h, r_l, r_h);
|
||||
YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l,
|
||||
g_h, r_l, r_h);
|
||||
temp0 = __lasx_xvpackev_b(g_l, b_l);
|
||||
temp1 = __lasx_xvpackev_b(g_h, b_h);
|
||||
DUP4_ARG3(__lasx_xvshuf_b, r_l, temp0, shuffler1, r_h, temp1, shuffler1,
|
||||
r_l, temp0, shuffler0, r_h, temp1, shuffler0, temp2, temp3, temp0, temp1);
|
||||
r_l, temp0, shuffler0, r_h, temp1, shuffler0, temp2, temp3, temp0,
|
||||
temp1);
|
||||
|
||||
b_l = __lasx_xvilvl_d(temp1, temp2);
|
||||
b_h = __lasx_xvilvh_d(temp3, temp1);
|
||||
@ -479,8 +478,8 @@ void I422ToRGB565Row_LASX(const uint8_t* src_y,
|
||||
__m256i dst_l, dst_h;
|
||||
|
||||
READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h);
|
||||
YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg,
|
||||
vec_yb, b_l, b_h, g_l, g_h, r_l, r_h);
|
||||
YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l,
|
||||
g_h, r_l, r_h);
|
||||
b_l = __lasx_xvsrli_h(b_l, 3);
|
||||
b_h = __lasx_xvsrli_h(b_h, 3);
|
||||
g_l = __lasx_xvsrli_h(g_l, 2);
|
||||
@ -518,10 +517,10 @@ void I422ToARGB4444Row_LASX(const uint8_t* src_y,
|
||||
__m256i vec_yb, vec_yg;
|
||||
__m256i vec_ubvr, vec_ugvg;
|
||||
__m256i const_0x80 = __lasx_xvldi(0x80);
|
||||
__m256i alpha = {0xF000F000F000F000, 0xF000F000F000F000,
|
||||
0xF000F000F000F000, 0xF000F000F000F000};
|
||||
__m256i mask = {0x00F000F000F000F0, 0x00F000F000F000F0,
|
||||
0x00F000F000F000F0, 0x00F000F000F000F0};
|
||||
__m256i alpha = {0xF000F000F000F000, 0xF000F000F000F000, 0xF000F000F000F000,
|
||||
0xF000F000F000F000};
|
||||
__m256i mask = {0x00F000F000F000F0, 0x00F000F000F000F0, 0x00F000F000F000F0,
|
||||
0x00F000F000F000F0};
|
||||
|
||||
YUVTORGB_SETUP(yuvconstants, vec_ubvr, vec_ugvg, vec_yg, vec_yb);
|
||||
|
||||
@ -530,8 +529,8 @@ void I422ToARGB4444Row_LASX(const uint8_t* src_y,
|
||||
__m256i dst_l, dst_h;
|
||||
|
||||
READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h);
|
||||
YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg,
|
||||
vec_yb, b_l, b_h, g_l, g_h, r_l, r_h);
|
||||
YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l,
|
||||
g_h, r_l, r_h);
|
||||
b_l = __lasx_xvsrli_h(b_l, 4);
|
||||
b_h = __lasx_xvsrli_h(b_h, 4);
|
||||
r_l = __lasx_xvsrli_h(r_l, 4);
|
||||
@ -568,8 +567,8 @@ void I422ToARGB1555Row_LASX(const uint8_t* src_y,
|
||||
__m256i vec_yb, vec_yg;
|
||||
__m256i vec_ubvr, vec_ugvg;
|
||||
__m256i const_0x80 = __lasx_xvldi(0x80);
|
||||
__m256i alpha = {0x8000800080008000, 0x8000800080008000,
|
||||
0x8000800080008000, 0x8000800080008000};
|
||||
__m256i alpha = {0x8000800080008000, 0x8000800080008000, 0x8000800080008000,
|
||||
0x8000800080008000};
|
||||
|
||||
YUVTORGB_SETUP(yuvconstants, vec_ubvr, vec_ugvg, vec_yg, vec_yb);
|
||||
|
||||
@ -578,8 +577,8 @@ void I422ToARGB1555Row_LASX(const uint8_t* src_y,
|
||||
__m256i dst_l, dst_h;
|
||||
|
||||
READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h);
|
||||
YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg,
|
||||
vec_yb, b_l, b_h, g_l, g_h, r_l, r_h);
|
||||
YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l,
|
||||
g_h, r_l, r_h);
|
||||
b_l = __lasx_xvsrli_h(b_l, 3);
|
||||
b_h = __lasx_xvsrli_h(b_h, 3);
|
||||
g_l = __lasx_xvsrli_h(g_l, 3);
|
||||
@ -756,8 +755,8 @@ void ARGBToYRow_LASX(const uint8_t* src_argb0, uint8_t* dst_y, int width) {
|
||||
__m256i const_81 = __lasx_xvldi(0x81);
|
||||
__m256i const_1080 = {0x1080108010801080, 0x1080108010801080,
|
||||
0x1080108010801080, 0x1080108010801080};
|
||||
__m256i control = {0x0000000400000000, 0x0000000500000001,
|
||||
0x0000000600000002, 0x0000000700000003};
|
||||
__m256i control = {0x0000000400000000, 0x0000000500000001, 0x0000000600000002,
|
||||
0x0000000700000003};
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lasx_xvld, src_argb0, 0, src_argb0, 32, src_argb0, 64,
|
||||
@ -802,8 +801,8 @@ void ARGBToUVRow_LASX(const uint8_t* src_argb0,
|
||||
0x002f002f002f002f, 0x002f002f002f002f};
|
||||
__m256i const_0x12 = {0x0009000900090009, 0x0009000900090009,
|
||||
0x0009000900090009, 0x0009000900090009};
|
||||
__m256i control = {0x0000000400000000, 0x0000000500000001,
|
||||
0x0000000600000002, 0x0000000700000003};
|
||||
__m256i control = {0x0000000400000000, 0x0000000500000001, 0x0000000600000002,
|
||||
0x0000000700000003};
|
||||
__m256i const_0x8080 = {0x8080808080808080, 0x8080808080808080,
|
||||
0x8080808080808080, 0x8080808080808080};
|
||||
|
||||
@ -861,13 +860,13 @@ void ARGBToRGB24Row_LASX(const uint8_t* src_argb, uint8_t* dst_rgb, int width) {
|
||||
int len = (width / 32) - 1;
|
||||
__m256i src0, src1, src2, src3;
|
||||
__m256i tmp0, tmp1, tmp2, tmp3;
|
||||
__m256i shuf = {0x0908060504020100, 0x000000000E0D0C0A,
|
||||
0x0908060504020100, 0x000000000E0D0C0A};
|
||||
__m256i control = {0x0000000100000000, 0x0000000400000002,
|
||||
0x0000000600000005, 0x0000000700000003};
|
||||
__m256i shuf = {0x0908060504020100, 0x000000000E0D0C0A, 0x0908060504020100,
|
||||
0x000000000E0D0C0A};
|
||||
__m256i control = {0x0000000100000000, 0x0000000400000002, 0x0000000600000005,
|
||||
0x0000000700000003};
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src_argb, 64,
|
||||
src_argb, 96, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src_argb, 64, src_argb,
|
||||
96, src0, src1, src2, src3);
|
||||
tmp0 = __lasx_xvshuf_b(src0, src0, shuf);
|
||||
tmp1 = __lasx_xvshuf_b(src1, src1, shuf);
|
||||
tmp2 = __lasx_xvshuf_b(src2, src2, shuf);
|
||||
@ -883,8 +882,8 @@ void ARGBToRGB24Row_LASX(const uint8_t* src_argb, uint8_t* dst_rgb, int width) {
|
||||
dst_rgb += 96;
|
||||
src_argb += 128;
|
||||
}
|
||||
DUP4_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src_argb, 64,
|
||||
src_argb, 96, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src_argb, 64, src_argb, 96,
|
||||
src0, src1, src2, src3);
|
||||
tmp0 = __lasx_xvshuf_b(src0, src0, shuf);
|
||||
tmp1 = __lasx_xvshuf_b(src1, src1, shuf);
|
||||
tmp2 = __lasx_xvshuf_b(src2, src2, shuf);
|
||||
@ -907,13 +906,13 @@ void ARGBToRAWRow_LASX(const uint8_t* src_argb, uint8_t* dst_rgb, int width) {
|
||||
int len = (width / 32) - 1;
|
||||
__m256i src0, src1, src2, src3;
|
||||
__m256i tmp0, tmp1, tmp2, tmp3;
|
||||
__m256i shuf = {0x090A040506000102, 0x000000000C0D0E08,
|
||||
0x090A040506000102, 0x000000000C0D0E08};
|
||||
__m256i control = {0x0000000100000000, 0x0000000400000002,
|
||||
0x0000000600000005, 0x0000000700000003};
|
||||
__m256i shuf = {0x090A040506000102, 0x000000000C0D0E08, 0x090A040506000102,
|
||||
0x000000000C0D0E08};
|
||||
__m256i control = {0x0000000100000000, 0x0000000400000002, 0x0000000600000005,
|
||||
0x0000000700000003};
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src_argb, 64,
|
||||
src_argb, 96, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src_argb, 64, src_argb,
|
||||
96, src0, src1, src2, src3);
|
||||
tmp0 = __lasx_xvshuf_b(src0, src0, shuf);
|
||||
tmp1 = __lasx_xvshuf_b(src1, src1, shuf);
|
||||
tmp2 = __lasx_xvshuf_b(src2, src2, shuf);
|
||||
@ -929,8 +928,8 @@ void ARGBToRAWRow_LASX(const uint8_t* src_argb, uint8_t* dst_rgb, int width) {
|
||||
dst_rgb += 96;
|
||||
src_argb += 128;
|
||||
}
|
||||
DUP4_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src_argb, 64,
|
||||
src_argb, 96, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src_argb, 64, src_argb, 96,
|
||||
src0, src1, src2, src3);
|
||||
tmp0 = __lasx_xvshuf_b(src0, src0, shuf);
|
||||
tmp1 = __lasx_xvshuf_b(src1, src1, shuf);
|
||||
tmp2 = __lasx_xvshuf_b(src2, src2, shuf);
|
||||
@ -948,13 +947,15 @@ void ARGBToRAWRow_LASX(const uint8_t* src_argb, uint8_t* dst_rgb, int width) {
|
||||
__lasx_xvstelm_d(tmp3, dst_rgb, 16, 2);
|
||||
}
|
||||
|
||||
void ARGBToRGB565Row_LASX(const uint8_t* src_argb, uint8_t* dst_rgb, int width) {
|
||||
void ARGBToRGB565Row_LASX(const uint8_t* src_argb,
|
||||
uint8_t* dst_rgb,
|
||||
int width) {
|
||||
int x;
|
||||
int len = width / 16;
|
||||
__m256i zero = __lasx_xvldi(0);
|
||||
__m256i src0, src1, tmp0, tmp1, dst0;
|
||||
__m256i shift = {0x0300030003000300, 0x0300030003000300,
|
||||
0x0300030003000300, 0x0300030003000300};
|
||||
__m256i shift = {0x0300030003000300, 0x0300030003000300, 0x0300030003000300,
|
||||
0x0300030003000300};
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP2_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src0, src1);
|
||||
@ -980,10 +981,10 @@ void ARGBToARGB1555Row_LASX(const uint8_t* src_argb,
|
||||
int len = width / 16;
|
||||
__m256i zero = __lasx_xvldi(0);
|
||||
__m256i src0, src1, tmp0, tmp1, tmp2, tmp3, dst0;
|
||||
__m256i shift1 = {0x0703070307030703, 0x0703070307030703,
|
||||
0x0703070307030703, 0x0703070307030703};
|
||||
__m256i shift2 = {0x0200020002000200, 0x0200020002000200,
|
||||
0x0200020002000200, 0x0200020002000200};
|
||||
__m256i shift1 = {0x0703070307030703, 0x0703070307030703, 0x0703070307030703,
|
||||
0x0703070307030703};
|
||||
__m256i shift2 = {0x0200020002000200, 0x0200020002000200, 0x0200020002000200,
|
||||
0x0200020002000200};
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP2_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src0, src1);
|
||||
@ -1042,11 +1043,11 @@ void ARGBToUV444Row_LASX(const uint8_t* src_argb,
|
||||
__m256i const_18 = __lasx_xvldi(18);
|
||||
__m256i const_0x8080 = {0x8080808080808080, 0x8080808080808080,
|
||||
0x8080808080808080, 0x8080808080808080};
|
||||
__m256i control = {0x0000000400000000, 0x0000000500000001,
|
||||
0x0000000600000002, 0x0000000700000003};
|
||||
__m256i control = {0x0000000400000000, 0x0000000500000001, 0x0000000600000002,
|
||||
0x0000000700000003};
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src_argb, 64,
|
||||
src_argb, 96, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src_argb, 64, src_argb,
|
||||
96, src0, src1, src2, src3);
|
||||
tmp0 = __lasx_xvpickev_h(src1, src0);
|
||||
tmp1 = __lasx_xvpickod_h(src1, src0);
|
||||
tmp2 = __lasx_xvpickev_h(src3, src2);
|
||||
@ -1149,8 +1150,8 @@ void ARGBAttenuateRow_LASX(const uint8_t* src_argb,
|
||||
__m256i src0, src1, tmp0, tmp1;
|
||||
__m256i reg0, reg1, reg2, reg3, reg4, reg5;
|
||||
__m256i b, g, r, a, dst0, dst1;
|
||||
__m256i control = {0x0005000100040000, 0x0007000300060002,
|
||||
0x0005000100040000, 0x0007000300060002};
|
||||
__m256i control = {0x0005000100040000, 0x0007000300060002, 0x0005000100040000,
|
||||
0x0007000300060002};
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP2_ARG2(__lasx_xvld, src_argb, 0, src_argb, 32, src0, src1);
|
||||
@ -1228,8 +1229,8 @@ void ARGBShuffleRow_LASX(const uint8_t* src_argb,
|
||||
int x;
|
||||
int len = width / 16;
|
||||
__m256i src0, src1, dst0, dst1;
|
||||
__m256i shuf = {0x0404040400000000, 0x0C0C0C0C08080808,
|
||||
0x0404040400000000, 0x0C0C0C0C08080808};
|
||||
__m256i shuf = {0x0404040400000000, 0x0C0C0C0C08080808, 0x0404040400000000,
|
||||
0x0C0C0C0C08080808};
|
||||
__m256i temp = __lasx_xvldrepl_w(shuffler, 0);
|
||||
|
||||
shuf = __lasx_xvadd_b(shuf, temp);
|
||||
@ -1304,14 +1305,14 @@ void ARGBSepiaRow_LASX(uint8_t* dst_argb, int width) {
|
||||
__m256i spb_g = __lasx_xvldi(68);
|
||||
__m256i spg_g = __lasx_xvldi(88);
|
||||
__m256i spr_g = __lasx_xvldi(98);
|
||||
__m256i spb_br = {0x2311231123112311, 0x2311231123112311,
|
||||
0x2311231123112311, 0x2311231123112311};
|
||||
__m256i spg_br = {0x2D162D162D162D16, 0x2D162D162D162D16,
|
||||
0x2D162D162D162D16, 0x2D162D162D162D16};
|
||||
__m256i spr_br = {0x3218321832183218, 0x3218321832183218,
|
||||
0x3218321832183218, 0x3218321832183218};
|
||||
__m256i shuff = {0x1706150413021100, 0x1F0E1D0C1B0A1908,
|
||||
0x1706150413021100, 0x1F0E1D0C1B0A1908};
|
||||
__m256i spb_br = {0x2311231123112311, 0x2311231123112311, 0x2311231123112311,
|
||||
0x2311231123112311};
|
||||
__m256i spg_br = {0x2D162D162D162D16, 0x2D162D162D162D16, 0x2D162D162D162D16,
|
||||
0x2D162D162D162D16};
|
||||
__m256i spr_br = {0x3218321832183218, 0x3218321832183218, 0x3218321832183218,
|
||||
0x3218321832183218};
|
||||
__m256i shuff = {0x1706150413021100, 0x1F0E1D0C1B0A1908, 0x1706150413021100,
|
||||
0x1F0E1D0C1B0A1908};
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP2_ARG2(__lasx_xvld, dst_argb, 0, dst_argb, 32, src0, src1);
|
||||
|
||||
@ -32,8 +32,7 @@ extern "C" {
|
||||
}
|
||||
|
||||
// Convert 8 pixels of YUV420 to RGB.
|
||||
#define YUVTORGB(in_y, in_vu, vrub, vgug, \
|
||||
yg, yb, out_b, out_g, out_r) \
|
||||
#define YUVTORGB(in_y, in_vu, vrub, vgug, yg, yb, out_b, out_g, out_r) \
|
||||
{ \
|
||||
__m128i y_ev, y_od, u_l, v_l; \
|
||||
__m128i tmp0, tmp1, tmp2, tmp3; \
|
||||
@ -74,8 +73,8 @@ extern "C" {
|
||||
}
|
||||
|
||||
// Convert I444 pixels of YUV420 to RGB.
|
||||
#define I444TORGB(in_yy, in_u, in_v, ub, vr, ugvg, \
|
||||
yg, yb, out_b, out_g, out_r) \
|
||||
#define I444TORGB(in_yy, in_u, in_v, ub, vr, ugvg, yg, yb, out_b, out_g, \
|
||||
out_r) \
|
||||
{ \
|
||||
__m128i y_ev, y_od, u_ev, v_ev, u_od, v_od; \
|
||||
__m128i tmp0, tmp1, tmp2, tmp3; \
|
||||
@ -177,8 +176,8 @@ void ARGB4444ToARGBRow_LSX(const uint8_t* src_argb4444,
|
||||
reg2 = __lsx_vslli_b(tmp2, 4);
|
||||
reg1 = __lsx_vsrli_b(tmp1, 4);
|
||||
reg3 = __lsx_vsrli_b(tmp3, 4);
|
||||
DUP4_ARG2(__lsx_vor_v, tmp0, reg0, tmp1, reg1, tmp2, reg2,
|
||||
tmp3, reg3, tmp0, tmp1, tmp2, tmp3);
|
||||
DUP4_ARG2(__lsx_vor_v, tmp0, reg0, tmp1, reg1, tmp2, reg2, tmp3, reg3, tmp0,
|
||||
tmp1, tmp2, tmp3);
|
||||
dst0 = __lsx_vilvl_b(tmp1, tmp0);
|
||||
dst2 = __lsx_vilvl_b(tmp3, tmp2);
|
||||
dst1 = __lsx_vilvh_b(tmp1, tmp0);
|
||||
@ -413,8 +412,8 @@ void ARGB1555ToUVRow_LSX(const uint8_t* src_argb1555,
|
||||
__m128i const_8080 = {0x8080808080808080, 0x8080808080808080};
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_argb1555, 0, src_argb1555, 16,
|
||||
next_argb1555, 0, next_argb1555, 16, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, src_argb1555, 0, src_argb1555, 16, next_argb1555, 0,
|
||||
next_argb1555, 16, src0, src1, src2, src3);
|
||||
DUP2_ARG2(__lsx_vpickev_b, src1, src0, src3, src2, tmp0, tmp2);
|
||||
DUP2_ARG2(__lsx_vpickod_b, src1, src0, src3, src2, tmp1, tmp3);
|
||||
tmpb = __lsx_vandi_b(tmp0, 0x1F);
|
||||
@ -524,8 +523,8 @@ void RGB565ToUVRow_LSX(const uint8_t* src_rgb565,
|
||||
__m128i const_8080 = {0x8080808080808080, 0x8080808080808080};
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_rgb565, 0, src_rgb565, 16,
|
||||
next_rgb565, 0, next_rgb565, 16, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, src_rgb565, 0, src_rgb565, 16, next_rgb565, 0,
|
||||
next_rgb565, 16, src0, src1, src2, src3);
|
||||
DUP2_ARG2(__lsx_vpickev_b, src1, src0, src3, src2, tmp0, tmp2);
|
||||
DUP2_ARG2(__lsx_vpickod_b, src1, src0, src3, src2, tmp1, tmp3);
|
||||
tmpb = __lsx_vandi_b(tmp0, 0x1F);
|
||||
@ -630,12 +629,18 @@ void RGB24ToUVRow_LSX(const uint8_t* src_rgb24,
|
||||
nex0 = __lsx_vld(next_rgb24, 0);
|
||||
nex1 = __lsx_vld(next_rgb24, 16);
|
||||
nex2 = __lsx_vld(next_rgb24, 32);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src1, src0, shuff0_b, nex1, nex0, shuff0_b, tmpb, nexb);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src1, src0, shuff0_g, nex1, nex0, shuff0_g, tmpg, nexg);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src1, src0, shuff0_r, nex1, nex0, shuff0_r, tmpr, nexr);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src2, tmpb, shuff1_b, nex2, nexb, shuff1_b, tmpb, nexb);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src2, tmpg, shuff1_g, nex2, nexg, shuff1_g, tmpg, nexg);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src2, tmpr, shuff1_r, nex2, nexr, shuff1_r, tmpr, nexr);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src1, src0, shuff0_b, nex1, nex0, shuff0_b, tmpb,
|
||||
nexb);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src1, src0, shuff0_g, nex1, nex0, shuff0_g, tmpg,
|
||||
nexg);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src1, src0, shuff0_r, nex1, nex0, shuff0_r, tmpr,
|
||||
nexr);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src2, tmpb, shuff1_b, nex2, nexb, shuff1_b, tmpb,
|
||||
nexb);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src2, tmpg, shuff1_g, nex2, nexg, shuff1_g, tmpg,
|
||||
nexg);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src2, tmpr, shuff1_r, nex2, nexr, shuff1_r, tmpr,
|
||||
nexr);
|
||||
RGBTOUV(tmpb, tmpg, tmpr, nexb, nexg, nexr, dst0);
|
||||
__lsx_vstelm_d(dst0, dst_u, 0, 0);
|
||||
__lsx_vstelm_d(dst0, dst_v, 0, 1);
|
||||
@ -710,12 +715,18 @@ void RAWToUVRow_LSX(const uint8_t* src_raw,
|
||||
nex0 = __lsx_vld(next_raw, 0);
|
||||
nex1 = __lsx_vld(next_raw, 16);
|
||||
nex2 = __lsx_vld(next_raw, 32);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src1, src0, shuff0_b, nex1, nex0, shuff0_b, tmpb, nexb);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src1, src0, shuff0_g, nex1, nex0, shuff0_g, tmpg, nexg);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src1, src0, shuff0_r, nex1, nex0, shuff0_r, tmpr, nexr);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src2, tmpb, shuff1_b, nex2, nexb, shuff1_b, tmpb, nexb);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src2, tmpg, shuff1_g, nex2, nexg, shuff1_g, tmpg, nexg);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src2, tmpr, shuff1_r, nex2, nexr, shuff1_r, tmpr, nexr);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src1, src0, shuff0_b, nex1, nex0, shuff0_b, tmpb,
|
||||
nexb);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src1, src0, shuff0_g, nex1, nex0, shuff0_g, tmpg,
|
||||
nexg);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src1, src0, shuff0_r, nex1, nex0, shuff0_r, tmpr,
|
||||
nexr);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src2, tmpb, shuff1_b, nex2, nexb, shuff1_b, tmpb,
|
||||
nexb);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src2, tmpg, shuff1_g, nex2, nexg, shuff1_g, tmpg,
|
||||
nexg);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src2, tmpr, shuff1_r, nex2, nexr, shuff1_r, tmpr,
|
||||
nexr);
|
||||
RGBTOUV(tmpb, tmpg, tmpr, nexb, nexg, nexr, dst0);
|
||||
__lsx_vstelm_d(dst0, dst_u, 0, 0);
|
||||
__lsx_vstelm_d(dst0, dst_v, 0, 1);
|
||||
@ -748,8 +759,8 @@ void NV12ToARGBRow_LSX(const uint8_t* src_y,
|
||||
for (x = 0; x < len; x++) {
|
||||
vec_y = __lsx_vld(src_y, 0);
|
||||
vec_vu = __lsx_vld(src_uv, 0);
|
||||
YUVTORGB(vec_y, vec_vu, vec_vrub, vec_vgug, vec_yg, vec_yb,
|
||||
out_b, out_g, out_r);
|
||||
YUVTORGB(vec_y, vec_vu, vec_vrub, vec_vgug, vec_yg, vec_yb, out_b, out_g,
|
||||
out_r);
|
||||
STOREARGB(alpha, out_r, out_g, out_b, dst_argb);
|
||||
src_y += 8;
|
||||
src_uv += 8;
|
||||
@ -777,8 +788,8 @@ void NV12ToRGB565Row_LSX(const uint8_t* src_y,
|
||||
for (x = 0; x < len; x++) {
|
||||
vec_y = __lsx_vld(src_y, 0);
|
||||
vec_vu = __lsx_vld(src_uv, 0);
|
||||
YUVTORGB(vec_y, vec_vu, vec_vrub, vec_vgug, vec_yg, vec_yb,
|
||||
out_b, out_g, out_r);
|
||||
YUVTORGB(vec_y, vec_vu, vec_vrub, vec_vgug, vec_yg, vec_yb, out_b, out_g,
|
||||
out_r);
|
||||
out_b = __lsx_vsrli_h(out_b, 3);
|
||||
out_g = __lsx_vsrli_h(out_g, 2);
|
||||
out_r = __lsx_vsrli_h(out_r, 3);
|
||||
@ -815,8 +826,8 @@ void NV21ToARGBRow_LSX(const uint8_t* src_y,
|
||||
for (x = 0; x < len; x++) {
|
||||
vec_y = __lsx_vld(src_y, 0);
|
||||
vec_uv = __lsx_vld(src_vu, 0);
|
||||
YUVTORGB(vec_y, vec_uv, vec_ubvr, vec_ugvg, vec_yg, vec_yb,
|
||||
out_r, out_g, out_b);
|
||||
YUVTORGB(vec_y, vec_uv, vec_ubvr, vec_ugvg, vec_yg, vec_yb, out_r, out_g,
|
||||
out_b);
|
||||
STOREARGB(alpha, out_r, out_g, out_b, dst_argb);
|
||||
src_y += 8;
|
||||
src_vu += 8;
|
||||
@ -918,8 +929,8 @@ void ARGBToYJRow_LSX(const uint8_t* src_argb, uint8_t* dst_y, int width) {
|
||||
__m128i const_br = {0x4D1D4D1D4D1D4D1D, 0x4D1D4D1D4D1D4D1D};
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32,
|
||||
src_argb, 48, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb, 48,
|
||||
src0, src1, src2, src3);
|
||||
tmp0 = __lsx_vpickev_b(src1, src0);
|
||||
tmp1 = __lsx_vpickod_b(src1, src0);
|
||||
tmp2 = __lsx_vpickev_b(src3, src2);
|
||||
@ -946,8 +957,8 @@ void BGRAToYRow_LSX(const uint8_t* src_bgra, uint8_t* dst_y, int width) {
|
||||
__m128i const_1080 = {0x1080108010801080, 0x1080108010801080};
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_bgra, 0, src_bgra, 16, src_bgra, 32,
|
||||
src_bgra, 48, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, src_bgra, 0, src_bgra, 16, src_bgra, 32, src_bgra, 48,
|
||||
src0, src1, src2, src3);
|
||||
tmp0 = __lsx_vpickod_b(src1, src0);
|
||||
tmp1 = __lsx_vpickev_b(src1, src0);
|
||||
tmp2 = __lsx_vpickod_b(src3, src2);
|
||||
@ -983,10 +994,10 @@ void BGRAToUVRow_LSX(const uint8_t* src_bgra,
|
||||
__m128i const_8080 = {0x8080808080808080, 0x8080808080808080};
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_bgra, 0, src_bgra, 16, src_bgra, 32,
|
||||
src_bgra, 48, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, next_bgra, 0, next_bgra, 16, next_bgra, 32,
|
||||
next_bgra, 48, nex0, nex1, nex2, nex3);
|
||||
DUP4_ARG2(__lsx_vld, src_bgra, 0, src_bgra, 16, src_bgra, 32, src_bgra, 48,
|
||||
src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, next_bgra, 0, next_bgra, 16, next_bgra, 32, next_bgra,
|
||||
48, nex0, nex1, nex2, nex3);
|
||||
tmp0 = __lsx_vpickod_b(src1, src0);
|
||||
tmp1 = __lsx_vpickev_b(src1, src0);
|
||||
tmp2 = __lsx_vpickod_b(src3, src2);
|
||||
@ -1022,8 +1033,8 @@ void ABGRToYRow_LSX(const uint8_t* src_abgr, uint8_t* dst_y, int width) {
|
||||
__m128i const_1080 = {0x1080108010801080, 0x1080108010801080};
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_abgr, 0, src_abgr, 16, src_abgr, 32,
|
||||
src_abgr, 48, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, src_abgr, 0, src_abgr, 16, src_abgr, 32, src_abgr, 48,
|
||||
src0, src1, src2, src3);
|
||||
tmp0 = __lsx_vpickev_b(src1, src0);
|
||||
tmp1 = __lsx_vpickod_b(src1, src0);
|
||||
tmp2 = __lsx_vpickev_b(src3, src2);
|
||||
@ -1059,10 +1070,10 @@ void ABGRToUVRow_LSX(const uint8_t* src_abgr,
|
||||
__m128i const_8080 = {0x8080808080808080, 0x8080808080808080};
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_abgr, 0, src_abgr, 16, src_abgr, 32,
|
||||
src_abgr, 48, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, next_abgr, 0, next_abgr, 16, next_abgr, 32,
|
||||
next_abgr, 48, nex0, nex1, nex2, nex3);
|
||||
DUP4_ARG2(__lsx_vld, src_abgr, 0, src_abgr, 16, src_abgr, 32, src_abgr, 48,
|
||||
src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, next_abgr, 0, next_abgr, 16, next_abgr, 32, next_abgr,
|
||||
48, nex0, nex1, nex2, nex3);
|
||||
tmp0 = __lsx_vpickev_b(src1, src0);
|
||||
tmp1 = __lsx_vpickod_b(src1, src0);
|
||||
tmp2 = __lsx_vpickev_b(src3, src2);
|
||||
@ -1098,8 +1109,8 @@ void RGBAToYRow_LSX(const uint8_t* src_rgba, uint8_t* dst_y, int width) {
|
||||
__m128i const_1080 = {0x1080108010801080, 0x1080108010801080};
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_rgba, 0, src_rgba, 16, src_rgba, 32,
|
||||
src_rgba, 48, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, src_rgba, 0, src_rgba, 16, src_rgba, 32, src_rgba, 48,
|
||||
src0, src1, src2, src3);
|
||||
tmp0 = __lsx_vpickod_b(src1, src0);
|
||||
tmp1 = __lsx_vpickev_b(src1, src0);
|
||||
tmp2 = __lsx_vpickod_b(src3, src2);
|
||||
@ -1135,10 +1146,10 @@ void RGBAToUVRow_LSX(const uint8_t* src_rgba,
|
||||
__m128i const_8080 = {0x8080808080808080, 0x8080808080808080};
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_rgba, 0, src_rgba, 16, src_rgba, 32,
|
||||
src_rgba, 48, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, next_rgba, 0, next_rgba, 16, next_rgba, 32,
|
||||
next_rgba, 48, nex0, nex1, nex2, nex3);
|
||||
DUP4_ARG2(__lsx_vld, src_rgba, 0, src_rgba, 16, src_rgba, 32, src_rgba, 48,
|
||||
src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, next_rgba, 0, next_rgba, 16, next_rgba, 32, next_rgba,
|
||||
48, nex0, nex1, nex2, nex3);
|
||||
tmp0 = __lsx_vpickod_b(src1, src0);
|
||||
tmp1 = __lsx_vpickev_b(src1, src0);
|
||||
tmp2 = __lsx_vpickod_b(src3, src2);
|
||||
@ -1184,10 +1195,10 @@ void ARGBToUVJRow_LSX(const uint8_t* src_argb,
|
||||
__m128i const_8080 = {0x8080808080808080, 0x8080808080808080};
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32,
|
||||
src_argb, 48, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, next_argb, 0, next_argb, 16, next_argb, 32,
|
||||
next_argb, 48, nex0, nex1, nex2, nex3);
|
||||
DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb, 48,
|
||||
src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, next_argb, 0, next_argb, 16, next_argb, 32, next_argb,
|
||||
48, nex0, nex1, nex2, nex3);
|
||||
tmp0 = __lsx_vpickev_b(src1, src0);
|
||||
tmp1 = __lsx_vpickod_b(src1, src0);
|
||||
tmp2 = __lsx_vpickev_b(src3, src2);
|
||||
@ -1252,14 +1263,14 @@ void I444ToARGBRow_LSX(const uint8_t* src_y,
|
||||
vec_yl = __lsx_vilvl_b(vec_y, vec_y);
|
||||
vec_ul = __lsx_vilvl_b(zero, vec_u);
|
||||
vec_vl = __lsx_vilvl_b(zero, vec_v);
|
||||
I444TORGB(vec_yl, vec_ul, vec_vl, vec_ub, vec_vr, vec_ugvg,
|
||||
vec_yg, vec_yb, out_b, out_g, out_r);
|
||||
I444TORGB(vec_yl, vec_ul, vec_vl, vec_ub, vec_vr, vec_ugvg, vec_yg, vec_yb,
|
||||
out_b, out_g, out_r);
|
||||
STOREARGB(alpha, out_r, out_g, out_b, dst_argb);
|
||||
vec_yh = __lsx_vilvh_b(vec_y, vec_y);
|
||||
vec_uh = __lsx_vilvh_b(zero, vec_u);
|
||||
vec_vh = __lsx_vilvh_b(zero, vec_v);
|
||||
I444TORGB(vec_yh, vec_uh, vec_vh, vec_ub, vec_vr, vec_ugvg,
|
||||
vec_yg, vec_yb, out_b, out_g, out_r);
|
||||
I444TORGB(vec_yh, vec_uh, vec_vh, vec_ub, vec_vr, vec_ugvg, vec_yg, vec_yb,
|
||||
out_b, out_g, out_r);
|
||||
STOREARGB(alpha, out_r, out_g, out_b, dst_argb);
|
||||
src_y += 16;
|
||||
src_u += 16;
|
||||
@ -1371,8 +1382,8 @@ void YUY2ToARGBRow_LSX(const uint8_t* src_yuy2,
|
||||
src0 = __lsx_vld(src_yuy2, 0);
|
||||
vec_y = __lsx_vpickev_b(src0, src0);
|
||||
vec_vu = __lsx_vpickod_b(src0, src0);
|
||||
YUVTORGB(vec_y, vec_vu, vec_vrub, vec_vgug, vec_yg, vec_yb,
|
||||
out_b, out_g, out_r);
|
||||
YUVTORGB(vec_y, vec_vu, vec_vrub, vec_vgug, vec_yg, vec_yb, out_b, out_g,
|
||||
out_r);
|
||||
STOREARGB(alpha, out_r, out_g, out_b, dst_argb);
|
||||
src_yuy2 += 16;
|
||||
}
|
||||
@ -1400,8 +1411,8 @@ void UYVYToARGBRow_LSX(const uint8_t* src_uyvy,
|
||||
src0 = __lsx_vld(src_uyvy, 0);
|
||||
vec_y = __lsx_vpickod_b(src0, src0);
|
||||
vec_vu = __lsx_vpickev_b(src0, src0);
|
||||
YUVTORGB(vec_y, vec_vu, vec_vrub, vec_vgug, vec_yg, vec_yb,
|
||||
out_b, out_g, out_r);
|
||||
YUVTORGB(vec_y, vec_vu, vec_vrub, vec_vgug, vec_yg, vec_yb, out_b, out_g,
|
||||
out_r);
|
||||
STOREARGB(alpha, out_r, out_g, out_b, dst_argb);
|
||||
src_uyvy += 16;
|
||||
}
|
||||
@ -1535,8 +1546,8 @@ void ARGBExtractAlphaRow_LSX(const uint8_t* src_argb,
|
||||
__m128i src0, src1, src2, src3, tmp0, tmp1, dst0;
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32,
|
||||
src_argb, 48, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb, 48,
|
||||
src0, src1, src2, src3);
|
||||
tmp0 = __lsx_vpickod_b(src1, src0);
|
||||
tmp1 = __lsx_vpickod_b(src3, src2);
|
||||
dst0 = __lsx_vpickod_b(tmp1, tmp0);
|
||||
@ -1562,8 +1573,8 @@ void ARGBBlendRow_LSX(const uint8_t* src_argb,
|
||||
__m128i control = {0xFF000000FF000000, 0xFF000000FF000000};
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16,
|
||||
src_argb1, 0, src_argb1, 16, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb1, 0, src_argb1, 16,
|
||||
src0, src1, src2, src3);
|
||||
tmp0 = __lsx_vshuf4i_b(src0, 0xFF);
|
||||
tmp1 = __lsx_vshuf4i_b(src1, 0xFF);
|
||||
a0 = __lsx_vilvl_b(zero, tmp0);
|
||||
@ -1576,8 +1587,8 @@ void ARGBBlendRow_LSX(const uint8_t* src_argb,
|
||||
reg3 = __lsx_vilvh_b(zero, src3);
|
||||
DUP4_ARG2(__lsx_vsub_h, const_256, a0, const_256, a1, const_256, a2,
|
||||
const_256, a3, a0, a1, a2, a3);
|
||||
DUP4_ARG2(__lsx_vmul_h, a0, reg0, a1, reg1, a2, reg2, a3, reg3,
|
||||
reg0, reg1, reg2, reg3);
|
||||
DUP4_ARG2(__lsx_vmul_h, a0, reg0, a1, reg1, a2, reg2, a3, reg3, reg0, reg1,
|
||||
reg2, reg3);
|
||||
DUP2_ARG3(__lsx_vsrani_b_h, reg1, reg0, 8, reg3, reg2, 8, dst0, dst1);
|
||||
dst0 = __lsx_vsadd_bu(dst0, src0);
|
||||
dst1 = __lsx_vsadd_bu(dst1, src1);
|
||||
@ -1608,8 +1619,8 @@ void ARGBQuantizeRow_LSX(uint8_t* dst_argb,
|
||||
__m128i control = {0xFF000000FF000000, 0xFF000000FF000000};
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, dst_argb, 0, dst_argb, 16, dst_argb, 32,
|
||||
dst_argb, 48, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, dst_argb, 0, dst_argb, 16, dst_argb, 32, dst_argb, 48,
|
||||
src0, src1, src2, src3);
|
||||
reg0 = __lsx_vilvl_b(zero, src0);
|
||||
reg1 = __lsx_vilvh_b(zero, src0);
|
||||
reg2 = __lsx_vilvl_b(zero, src1);
|
||||
@ -1652,10 +1663,10 @@ void ARGBQuantizeRow_LSX(uint8_t* dst_argb,
|
||||
dst3 = __lsx_vpickev_b(reg3, reg2);
|
||||
DUP4_ARG2(__lsx_vmul_b, dst0, vec_size, dst1, vec_size, dst2, vec_size,
|
||||
dst3, vec_size, dst0, dst1, dst2, dst3);
|
||||
DUP4_ARG2(__lsx_vadd_b, dst0, vec_offset, dst1, vec_offset, dst2, vec_offset,
|
||||
dst3, vec_offset, dst0, dst1, dst2, dst3);
|
||||
DUP4_ARG3(__lsx_vbitsel_v, dst0, src0, control, dst1, src1, control,
|
||||
dst2, src2, control, dst3, src3, control, dst0, dst1, dst2, dst3);
|
||||
DUP4_ARG2(__lsx_vadd_b, dst0, vec_offset, dst1, vec_offset, dst2,
|
||||
vec_offset, dst3, vec_offset, dst0, dst1, dst2, dst3);
|
||||
DUP4_ARG3(__lsx_vbitsel_v, dst0, src0, control, dst1, src1, control, dst2,
|
||||
src2, control, dst3, src3, control, dst0, dst1, dst2, dst3);
|
||||
__lsx_vst(dst0, dst_argb, 0);
|
||||
__lsx_vst(dst1, dst_argb, 16);
|
||||
__lsx_vst(dst2, dst_argb, 32);
|
||||
@ -1684,18 +1695,20 @@ void ARGBColorMatrixRow_LSX(const uint8_t* src_argb,
|
||||
src0, matrix_a, tmp_b, tmp_g, tmp_r, tmp_a);
|
||||
DUP4_ARG2(__lsx_vdp2_h_bu_b, src1, matrix_b, src1, matrix_g, src1, matrix_r,
|
||||
src1, matrix_a, reg_b, reg_g, reg_r, reg_a);
|
||||
DUP4_ARG2(__lsx_vhaddw_w_h, tmp_b, tmp_b, tmp_g, tmp_g, tmp_r, tmp_r,
|
||||
tmp_a, tmp_a, tmp_b, tmp_g, tmp_r, tmp_a);
|
||||
DUP4_ARG2(__lsx_vhaddw_w_h, reg_b, reg_b, reg_g, reg_g, reg_r, reg_r,
|
||||
reg_a, reg_a, reg_b, reg_g, reg_r, reg_a);
|
||||
DUP4_ARG2(__lsx_vsrai_w, tmp_b, 6, tmp_g, 6, tmp_r, 6,
|
||||
tmp_a, 6, tmp_b, tmp_g, tmp_r, tmp_a);
|
||||
DUP4_ARG2(__lsx_vsrai_w, reg_b, 6, reg_g, 6, reg_r, 6,
|
||||
reg_a, 6, reg_b, reg_g, reg_r, reg_a);
|
||||
DUP4_ARG1(__lsx_vclip255_w, tmp_b, tmp_g, tmp_r, tmp_a, tmp_b, tmp_g, tmp_r, tmp_a)
|
||||
DUP4_ARG1(__lsx_vclip255_w, reg_b, reg_g, reg_r, reg_a, reg_b, reg_g, reg_r, reg_a)
|
||||
DUP4_ARG2(__lsx_vpickev_h, reg_b, tmp_b, reg_g, tmp_g, reg_r, tmp_r,
|
||||
reg_a, tmp_a, tmp_b, tmp_g, tmp_r, tmp_a);
|
||||
DUP4_ARG2(__lsx_vhaddw_w_h, tmp_b, tmp_b, tmp_g, tmp_g, tmp_r, tmp_r, tmp_a,
|
||||
tmp_a, tmp_b, tmp_g, tmp_r, tmp_a);
|
||||
DUP4_ARG2(__lsx_vhaddw_w_h, reg_b, reg_b, reg_g, reg_g, reg_r, reg_r, reg_a,
|
||||
reg_a, reg_b, reg_g, reg_r, reg_a);
|
||||
DUP4_ARG2(__lsx_vsrai_w, tmp_b, 6, tmp_g, 6, tmp_r, 6, tmp_a, 6, tmp_b,
|
||||
tmp_g, tmp_r, tmp_a);
|
||||
DUP4_ARG2(__lsx_vsrai_w, reg_b, 6, reg_g, 6, reg_r, 6, reg_a, 6, reg_b,
|
||||
reg_g, reg_r, reg_a);
|
||||
DUP4_ARG1(__lsx_vclip255_w, tmp_b, tmp_g, tmp_r, tmp_a, tmp_b, tmp_g, tmp_r,
|
||||
tmp_a)
|
||||
DUP4_ARG1(__lsx_vclip255_w, reg_b, reg_g, reg_r, reg_a, reg_b, reg_g, reg_r,
|
||||
reg_a)
|
||||
DUP4_ARG2(__lsx_vpickev_h, reg_b, tmp_b, reg_g, tmp_g, reg_r, tmp_r, reg_a,
|
||||
tmp_a, tmp_b, tmp_g, tmp_r, tmp_a);
|
||||
tmp0 = __lsx_vpackev_b(tmp_g, tmp_b);
|
||||
tmp1 = __lsx_vpackev_b(tmp_a, tmp_r);
|
||||
dst0 = __lsx_vilvl_h(tmp1, tmp0);
|
||||
@ -1717,8 +1730,8 @@ void SplitUVRow_LSX(const uint8_t* src_uv,
|
||||
__m128i dst0, dst1, dst2, dst3;
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_uv, 0, src_uv, 16, src_uv, 32,
|
||||
src_uv, 48, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, src_uv, 0, src_uv, 16, src_uv, 32, src_uv, 48, src0,
|
||||
src1, src2, src3);
|
||||
DUP2_ARG2(__lsx_vpickev_b, src1, src0, src3, src2, dst0, dst1);
|
||||
DUP2_ARG2(__lsx_vpickod_b, src1, src0, src3, src2, dst2, dst3);
|
||||
__lsx_vst(dst0, dst_u, 0);
|
||||
@ -1756,10 +1769,10 @@ void MirrorSplitUVRow_LSX(const uint8_t* src_uv,
|
||||
src_uv += (width << 1);
|
||||
for (x = 0; x < len; x++) {
|
||||
src_uv -= 64;
|
||||
DUP4_ARG2(__lsx_vld, src_uv, 0, src_uv, 16, src_uv, 32,
|
||||
src_uv, 48, src2, src3, src0, src1);
|
||||
DUP4_ARG3(__lsx_vshuf_b, src1, src0, shuff1, src3, src2, shuff1,
|
||||
src1, src0, shuff0, src3, src2, shuff0, dst0, dst1, dst2, dst3);
|
||||
DUP4_ARG2(__lsx_vld, src_uv, 0, src_uv, 16, src_uv, 32, src_uv, 48, src2,
|
||||
src3, src0, src1);
|
||||
DUP4_ARG3(__lsx_vshuf_b, src1, src0, shuff1, src3, src2, shuff1, src1, src0,
|
||||
shuff0, src3, src2, shuff0, dst0, dst1, dst2, dst3);
|
||||
__lsx_vst(dst0, dst_v, 0);
|
||||
__lsx_vst(dst1, dst_v, 16);
|
||||
__lsx_vst(dst2, dst_u, 0);
|
||||
@ -1783,13 +1796,16 @@ void HalfFloatRow_LSX(const uint16_t* src,
|
||||
__m128i zero = __lsx_vldi(0);
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src, 0, src, 16, src, 32, src, 48, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vilvl_h, zero, src0, zero, src1, zero, src2,
|
||||
zero, src3, tmp0, tmp2, tmp4, tmp6);
|
||||
DUP4_ARG2(__lsx_vilvh_h, zero, src0, zero, src1, zero, src2,
|
||||
zero, src3, tmp1, tmp3, tmp5, tmp7);
|
||||
DUP4_ARG1(__lsx_vffint_s_wu, tmp0, tmp2, tmp4, tmp6, reg0, reg2, reg4, reg6);
|
||||
DUP4_ARG1(__lsx_vffint_s_wu, tmp1, tmp3, tmp5, tmp7, reg1, reg3, reg5, reg7);
|
||||
DUP4_ARG2(__lsx_vld, src, 0, src, 16, src, 32, src, 48, src0, src1, src2,
|
||||
src3);
|
||||
DUP4_ARG2(__lsx_vilvl_h, zero, src0, zero, src1, zero, src2, zero, src3,
|
||||
tmp0, tmp2, tmp4, tmp6);
|
||||
DUP4_ARG2(__lsx_vilvh_h, zero, src0, zero, src1, zero, src2, zero, src3,
|
||||
tmp1, tmp3, tmp5, tmp7);
|
||||
DUP4_ARG1(__lsx_vffint_s_wu, tmp0, tmp2, tmp4, tmp6, reg0, reg2, reg4,
|
||||
reg6);
|
||||
DUP4_ARG1(__lsx_vffint_s_wu, tmp1, tmp3, tmp5, tmp7, reg1, reg3, reg5,
|
||||
reg7);
|
||||
DUP4_ARG2(__lsx_vfmul_s, reg0, vec_mult, reg1, vec_mult, reg2, vec_mult,
|
||||
reg3, vec_mult, reg0, reg1, reg2, reg3);
|
||||
DUP4_ARG2(__lsx_vfmul_s, reg4, vec_mult, reg5, vec_mult, reg6, vec_mult,
|
||||
@ -1798,8 +1814,8 @@ void HalfFloatRow_LSX(const uint16_t* src,
|
||||
(v4u32)reg3, 13, tmp0, tmp1, tmp2, tmp3);
|
||||
DUP4_ARG2(__lsx_vsrli_w, (v4u32)reg4, 13, (v4u32)reg5, 13, (v4u32)reg6, 13,
|
||||
(v4u32)reg7, 13, tmp4, tmp5, tmp6, tmp7);
|
||||
DUP4_ARG2(__lsx_vpickev_h, tmp1, tmp0, tmp3, tmp2, tmp5, tmp4,
|
||||
tmp7, tmp6, dst0, dst1, dst2, dst3);
|
||||
DUP4_ARG2(__lsx_vpickev_h, tmp1, tmp0, tmp3, tmp2, tmp5, tmp4, tmp7, tmp6,
|
||||
dst0, dst1, dst2, dst3);
|
||||
__lsx_vst(dst0, dst, 0);
|
||||
__lsx_vst(dst1, dst, 16);
|
||||
__lsx_vst(dst2, dst, 32);
|
||||
|
||||
@ -616,7 +616,7 @@ void DetileRow_NEON(const uint8_t* src,
|
||||
"1: \n"
|
||||
"ld1 {v0.16b}, [%0], %3 \n" // load 16 bytes
|
||||
"subs %w2, %w2, #16 \n" // 16 processed per loop
|
||||
"prfm pldl1keep, [%0, 448] \n"
|
||||
"prfm pldl1keep, [%0, 1792] \n" // 7 tiles of 256b ahead
|
||||
"st1 {v0.16b}, [%1], #16 \n" // store 16 bytes
|
||||
"b.gt 1b \n"
|
||||
: "+r"(src), // %0
|
||||
|
||||
@ -631,7 +631,8 @@ static void ScaleYUVToARGBBilinearUp(int src_width,
|
||||
}
|
||||
#endif
|
||||
#if defined(HAS_I422TOARGBROW_AVX512BW)
|
||||
if (TestCpuFlag(kCpuHasAVX512BW | kCpuHasAVX512VL) == (kCpuHasAVX512BW | kCpuHasAVX512VL)) {
|
||||
if (TestCpuFlag(kCpuHasAVX512BW | kCpuHasAVX512VL) ==
|
||||
(kCpuHasAVX512BW | kCpuHasAVX512VL)) {
|
||||
I422ToARGBRow = I422ToARGBRow_Any_AVX512BW;
|
||||
if (IS_ALIGNED(src_width, 32)) {
|
||||
I422ToARGBRow = I422ToARGBRow_AVX512BW;
|
||||
|
||||
@ -25,8 +25,8 @@ extern "C" {
|
||||
#define LOAD_DATA(_src, _in, _out) \
|
||||
{ \
|
||||
int _tmp1, _tmp2, _tmp3, _tmp4; \
|
||||
DUP4_ARG2(__lsx_vpickve2gr_w, _in, 0, _in, 1, _in, 2, \
|
||||
_in, 3, _tmp1, _tmp2, _tmp3, _tmp4); \
|
||||
DUP4_ARG2(__lsx_vpickve2gr_w, _in, 0, _in, 1, _in, 2, _in, 3, _tmp1, \
|
||||
_tmp2, _tmp3, _tmp4); \
|
||||
_out = __lsx_vinsgr2vr_w(_out, _src[_tmp1], 0); \
|
||||
_out = __lsx_vinsgr2vr_w(_out, _src[_tmp2], 1); \
|
||||
_out = __lsx_vinsgr2vr_w(_out, _src[_tmp3], 2); \
|
||||
@ -157,8 +157,8 @@ void ScaleARGBRowDownEvenBox_LSX(const uint8_t* src_argb,
|
||||
next_argb += stepx;
|
||||
tmp7 = __lsx_vldrepl_d(next_argb, 0);
|
||||
next_argb += stepx;
|
||||
DUP4_ARG2(__lsx_vilvl_d, tmp1, tmp0, tmp3, tmp2, tmp5, tmp4,
|
||||
tmp7, tmp6, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vilvl_d, tmp1, tmp0, tmp3, tmp2, tmp5, tmp4, tmp7, tmp6,
|
||||
src0, src1, src2, src3);
|
||||
DUP2_ARG2(__lsx_vaddwev_h_bu, src0, src2, src1, src3, tmp0, tmp2);
|
||||
DUP2_ARG2(__lsx_vaddwod_h_bu, src0, src2, src1, src3, tmp1, tmp3);
|
||||
DUP2_ARG2(__lsx_vpackev_w, tmp1, tmp0, tmp3, tmp2, reg0, reg1);
|
||||
@ -181,8 +181,8 @@ void ScaleRowDown2_LSX(const uint8_t* src_ptr,
|
||||
(void)src_stride;
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_ptr, 0, src_ptr, 16, src_ptr, 32, src_ptr,
|
||||
48, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, src_ptr, 0, src_ptr, 16, src_ptr, 32, src_ptr, 48,
|
||||
src0, src1, src2, src3);
|
||||
DUP2_ARG2(__lsx_vpickod_b, src1, src0, src3, src2, dst0, dst1);
|
||||
__lsx_vst(dst0, dst, 0);
|
||||
__lsx_vst(dst1, dst, 16);
|
||||
@ -202,8 +202,8 @@ void ScaleRowDown2Linear_LSX(const uint8_t* src_ptr,
|
||||
(void)src_stride;
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_ptr, 0, src_ptr, 16, src_ptr, 32, src_ptr,
|
||||
48, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, src_ptr, 0, src_ptr, 16, src_ptr, 32, src_ptr, 48,
|
||||
src0, src1, src2, src3);
|
||||
DUP2_ARG2(__lsx_vpickev_b, src1, src0, src3, src2, tmp0, tmp2);
|
||||
DUP2_ARG2(__lsx_vpickod_b, src1, src0, src3, src2, tmp1, tmp3);
|
||||
DUP2_ARG2(__lsx_vavgr_bu, tmp0, tmp1, tmp2, tmp3, dst0, dst1);
|
||||
@ -226,14 +226,14 @@ void ScaleRowDown2Box_LSX(const uint8_t* src_ptr,
|
||||
__m128i dst0, dst1;
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_ptr, 0, src_ptr, 16, src_ptr, 32, src_ptr,
|
||||
48, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, src_nex, 0, src_nex, 16, src_nex, 32, src_nex,
|
||||
48, src4, src5, src6, src7);
|
||||
DUP4_ARG2(__lsx_vaddwev_h_bu, src0, src4, src1, src5, src2, src6, src3, src7,
|
||||
tmp0, tmp2, tmp4, tmp6);
|
||||
DUP4_ARG2(__lsx_vaddwod_h_bu, src0, src4, src1, src5, src2, src6, src3, src7,
|
||||
tmp1, tmp3, tmp5, tmp7);
|
||||
DUP4_ARG2(__lsx_vld, src_ptr, 0, src_ptr, 16, src_ptr, 32, src_ptr, 48,
|
||||
src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, src_nex, 0, src_nex, 16, src_nex, 32, src_nex, 48,
|
||||
src4, src5, src6, src7);
|
||||
DUP4_ARG2(__lsx_vaddwev_h_bu, src0, src4, src1, src5, src2, src6, src3,
|
||||
src7, tmp0, tmp2, tmp4, tmp6);
|
||||
DUP4_ARG2(__lsx_vaddwod_h_bu, src0, src4, src1, src5, src2, src6, src3,
|
||||
src7, tmp1, tmp3, tmp5, tmp7);
|
||||
DUP4_ARG2(__lsx_vadd_h, tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7,
|
||||
tmp0, tmp1, tmp2, tmp3);
|
||||
DUP2_ARG3(__lsx_vsrarni_b_h, tmp1, tmp0, 2, tmp3, tmp2, 2, dst0, dst1);
|
||||
@ -255,8 +255,8 @@ void ScaleRowDown4_LSX(const uint8_t* src_ptr,
|
||||
(void)src_stride;
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_ptr, 0, src_ptr, 16, src_ptr, 32, src_ptr,
|
||||
48, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, src_ptr, 0, src_ptr, 16, src_ptr, 32, src_ptr, 48,
|
||||
src0, src1, src2, src3);
|
||||
DUP2_ARG2(__lsx_vpickev_b, src1, src0, src3, src2, tmp0, tmp1);
|
||||
dst0 = __lsx_vpickod_b(tmp1, tmp0);
|
||||
__lsx_vst(dst0, dst, 0);
|
||||
@ -279,30 +279,30 @@ void ScaleRowDown4Box_LSX(const uint8_t* src_ptr,
|
||||
__m128i reg0, reg1, reg2, reg3, reg4, reg5, reg6, reg7, dst0;
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_ptr, 0, src_ptr, 16, src_ptr, 32, src_ptr,
|
||||
48, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, ptr1, 0, ptr1, 16, ptr1, 32, ptr1, 48,
|
||||
src4, src5, src6, src7);
|
||||
DUP4_ARG2(__lsx_vaddwev_h_bu, src0, src4, src1, src5, src2, src6, src3, src7,
|
||||
tmp0, tmp2, tmp4, tmp6);
|
||||
DUP4_ARG2(__lsx_vaddwod_h_bu, src0, src4, src1, src5, src2, src6, src3, src7,
|
||||
tmp1, tmp3, tmp5, tmp7);
|
||||
DUP4_ARG2(__lsx_vld, src_ptr, 0, src_ptr, 16, src_ptr, 32, src_ptr, 48,
|
||||
src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, ptr1, 0, ptr1, 16, ptr1, 32, ptr1, 48, src4, src5,
|
||||
src6, src7);
|
||||
DUP4_ARG2(__lsx_vaddwev_h_bu, src0, src4, src1, src5, src2, src6, src3,
|
||||
src7, tmp0, tmp2, tmp4, tmp6);
|
||||
DUP4_ARG2(__lsx_vaddwod_h_bu, src0, src4, src1, src5, src2, src6, src3,
|
||||
src7, tmp1, tmp3, tmp5, tmp7);
|
||||
DUP4_ARG2(__lsx_vadd_h, tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7,
|
||||
reg0, reg1, reg2, reg3);
|
||||
DUP4_ARG2(__lsx_vld, ptr2, 0, ptr2, 16, ptr2, 32, ptr2, 48,
|
||||
src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, ptr3, 0, ptr3, 16, ptr3, 32, ptr3, 48,
|
||||
src4, src5, src6, src7);
|
||||
DUP4_ARG2(__lsx_vaddwev_h_bu, src0, src4, src1, src5, src2, src6, src3, src7,
|
||||
tmp0, tmp2, tmp4, tmp6);
|
||||
DUP4_ARG2(__lsx_vaddwod_h_bu, src0, src4, src1, src5, src2, src6, src3, src7,
|
||||
tmp1, tmp3, tmp5, tmp7);
|
||||
DUP4_ARG2(__lsx_vld, ptr2, 0, ptr2, 16, ptr2, 32, ptr2, 48, src0, src1,
|
||||
src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, ptr3, 0, ptr3, 16, ptr3, 32, ptr3, 48, src4, src5,
|
||||
src6, src7);
|
||||
DUP4_ARG2(__lsx_vaddwev_h_bu, src0, src4, src1, src5, src2, src6, src3,
|
||||
src7, tmp0, tmp2, tmp4, tmp6);
|
||||
DUP4_ARG2(__lsx_vaddwod_h_bu, src0, src4, src1, src5, src2, src6, src3,
|
||||
src7, tmp1, tmp3, tmp5, tmp7);
|
||||
DUP4_ARG2(__lsx_vadd_h, tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7,
|
||||
reg4, reg5, reg6, reg7);
|
||||
DUP4_ARG2(__lsx_vadd_h, reg0, reg4, reg1, reg5, reg2, reg6, reg3, reg7,
|
||||
reg0, reg1, reg2, reg3);
|
||||
DUP4_ARG2(__lsx_vhaddw_wu_hu, reg0, reg0, reg1, reg1, reg2, reg2, reg3, reg3,
|
||||
reg0, reg1, reg2, reg3);
|
||||
DUP4_ARG2(__lsx_vhaddw_wu_hu, reg0, reg0, reg1, reg1, reg2, reg2, reg3,
|
||||
reg3, reg0, reg1, reg2, reg3);
|
||||
DUP2_ARG3(__lsx_vsrarni_h_w, reg1, reg0, 4, reg3, reg2, 4, tmp0, tmp1);
|
||||
dst0 = __lsx_vpickev_b(tmp1, tmp0);
|
||||
__lsx_vst(dst0, dst, 0);
|
||||
@ -353,8 +353,8 @@ void ScaleRowDown38_2_Box_LSX(const uint8_t* src_ptr,
|
||||
len = dst_width / 12;
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_ptr, 0, src_ptr, 16, src_nex, 0, src_nex,
|
||||
16, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, src_ptr, 0, src_ptr, 16, src_nex, 0, src_nex, 16, src0,
|
||||
src1, src2, src3);
|
||||
DUP2_ARG2(__lsx_vaddwev_h_bu, src0, src2, src1, src3, tmp0, tmp2);
|
||||
DUP2_ARG2(__lsx_vaddwod_h_bu, src0, src2, src1, src3, tmp1, tmp3);
|
||||
DUP2_ARG2(__lsx_vpickev_h, tmp2, tmp0, tmp3, tmp1, reg0, reg1);
|
||||
@ -394,15 +394,15 @@ void ScaleRowDown38_3_Box_LSX(const uint8_t* src_ptr,
|
||||
len = dst_width / 12;
|
||||
|
||||
for (x = 0; x < len; x++) {
|
||||
DUP4_ARG2(__lsx_vld, src_ptr, 0, src_ptr, 16, ptr1, 0, ptr1, 16,
|
||||
src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vld, src_ptr, 0, src_ptr, 16, ptr1, 0, ptr1, 16, src0, src1,
|
||||
src2, src3);
|
||||
DUP2_ARG2(__lsx_vld, ptr2, 0, ptr2, 16, src4, src5);
|
||||
DUP2_ARG2(__lsx_vaddwev_h_bu, src0, src2, src1, src3, tmp0, tmp2);
|
||||
DUP2_ARG2(__lsx_vaddwod_h_bu, src0, src2, src1, src3, tmp1, tmp3);
|
||||
DUP2_ARG2(__lsx_vpackev_b, zero, src4, zero, src5, tmp4, tmp6);
|
||||
DUP2_ARG2(__lsx_vpackod_b, zero, src4, zero, src5, tmp5, tmp7);
|
||||
DUP4_ARG2(__lsx_vadd_h, tmp0, tmp4, tmp1, tmp5, tmp2, tmp6, tmp3,
|
||||
tmp7, tmp0, tmp1, tmp2, tmp3);
|
||||
DUP4_ARG2(__lsx_vadd_h, tmp0, tmp4, tmp1, tmp5, tmp2, tmp6, tmp3, tmp7,
|
||||
tmp0, tmp1, tmp2, tmp3);
|
||||
DUP2_ARG2(__lsx_vpickev_h, tmp2, tmp0, tmp3, tmp1, reg0, reg1);
|
||||
DUP2_ARG2(__lsx_vpackod_h, tmp1, tmp0, tmp3, tmp2, reg2, reg3);
|
||||
tmp4 = __lsx_vpickev_w(reg3, reg2);
|
||||
@ -476,28 +476,28 @@ void ScaleFilterCols_LSX(uint8_t* dst_ptr,
|
||||
tmp3 = __lsx_vsrai_w(vec_x, 16);
|
||||
tmp7 = __lsx_vand_v(vec_x, const1);
|
||||
vec_x = __lsx_vadd_w(vec_x, vec1);
|
||||
DUP4_ARG2(__lsx_vsrai_w, tmp4, 9, tmp5, 9, tmp6, 9, tmp7, 9,
|
||||
tmp4, tmp5, tmp6, tmp7);
|
||||
DUP4_ARG2(__lsx_vsrai_w, tmp4, 9, tmp5, 9, tmp6, 9, tmp7, 9, tmp4, tmp5,
|
||||
tmp6, tmp7);
|
||||
LOAD_DATA(src_ptr, tmp0, reg0);
|
||||
LOAD_DATA(src_ptr, tmp1, reg1);
|
||||
LOAD_DATA(src_ptr, tmp2, reg2);
|
||||
LOAD_DATA(src_ptr, tmp3, reg3);
|
||||
DUP4_ARG2(__lsx_vaddi_wu, tmp0, 1, tmp1, 1, tmp2, 1, tmp3, 1,
|
||||
tmp0, tmp1, tmp2, tmp3);
|
||||
DUP4_ARG2(__lsx_vaddi_wu, tmp0, 1, tmp1, 1, tmp2, 1, tmp3, 1, tmp0, tmp1,
|
||||
tmp2, tmp3);
|
||||
LOAD_DATA(src_ptr, tmp0, reg4);
|
||||
LOAD_DATA(src_ptr, tmp1, reg5);
|
||||
LOAD_DATA(src_ptr, tmp2, reg6);
|
||||
LOAD_DATA(src_ptr, tmp3, reg7);
|
||||
DUP4_ARG2(__lsx_vsub_w, reg4, reg0, reg5, reg1, reg6, reg2, reg7,
|
||||
reg3, reg4, reg5, reg6, reg7);
|
||||
DUP4_ARG2(__lsx_vmul_w, reg4, tmp4, reg5, tmp5, reg6, tmp6, reg7,
|
||||
tmp7, reg4, reg5, reg6, reg7);
|
||||
DUP4_ARG2(__lsx_vadd_w, reg4, const2, reg5, const2, reg6, const2,
|
||||
reg7, const2, reg4, reg5, reg6, reg7);
|
||||
DUP4_ARG2(__lsx_vsrai_w, reg4, 7, reg5, 7, reg6, 7, reg7, 7,
|
||||
DUP4_ARG2(__lsx_vsub_w, reg4, reg0, reg5, reg1, reg6, reg2, reg7, reg3,
|
||||
reg4, reg5, reg6, reg7);
|
||||
DUP4_ARG2(__lsx_vadd_w, reg0, reg4, reg1, reg5, reg2, reg6, reg3,
|
||||
reg7, reg0, reg1, reg2, reg3);
|
||||
DUP4_ARG2(__lsx_vmul_w, reg4, tmp4, reg5, tmp5, reg6, tmp6, reg7, tmp7,
|
||||
reg4, reg5, reg6, reg7);
|
||||
DUP4_ARG2(__lsx_vadd_w, reg4, const2, reg5, const2, reg6, const2, reg7,
|
||||
const2, reg4, reg5, reg6, reg7);
|
||||
DUP4_ARG2(__lsx_vsrai_w, reg4, 7, reg5, 7, reg6, 7, reg7, 7, reg4, reg5,
|
||||
reg6, reg7);
|
||||
DUP4_ARG2(__lsx_vadd_w, reg0, reg4, reg1, reg5, reg2, reg6, reg3, reg7,
|
||||
reg0, reg1, reg2, reg3);
|
||||
DUP2_ARG2(__lsx_vpickev_h, reg1, reg0, reg3, reg2, tmp0, tmp1);
|
||||
dst0 = __lsx_vpickev_b(tmp1, tmp0);
|
||||
__lsx_vst(dst0, dst_ptr, 0);
|
||||
@ -598,7 +598,8 @@ void ScaleRowDown34_LSX(const uint8_t* src_ptr,
|
||||
for (x = 0; x < dst_width; x += 48) {
|
||||
DUP4_ARG2(__lsx_vld, src_ptr, 0, src_ptr, 16, src_ptr, 32, src_ptr, 48,
|
||||
src0, src1, src2, src3);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src1, src0, shuff0, src2, src1, shuff1, dst0, dst1);
|
||||
DUP2_ARG3(__lsx_vshuf_b, src1, src0, shuff0, src2, src1, shuff1, dst0,
|
||||
dst1);
|
||||
dst2 = __lsx_vshuf_b(src3, src2, shuff2);
|
||||
__lsx_vst(dst0, dst, 0);
|
||||
__lsx_vst(dst1, dst, 16);
|
||||
@ -644,16 +645,16 @@ void ScaleRowDown34_0_Box_LSX(const uint8_t* src_ptr,
|
||||
const0, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vdp2_h_bu, tmp4, const1, tmp5, const2, tmp6, const0, tmp7,
|
||||
const1, src4, src5, src6, src7);
|
||||
DUP4_ARG2(__lsx_vdp2_h_bu, tmp8, const2, tmp9, const0, tmp10, const1,
|
||||
tmp11, const2, tmp0, tmp1, tmp2, tmp3);
|
||||
DUP4_ARG2(__lsx_vdp2_h_bu, tmp8, const2, tmp9, const0, tmp10, const1, tmp11,
|
||||
const2, tmp0, tmp1, tmp2, tmp3);
|
||||
DUP4_ARG2(__lsx_vsrar_h, src0, shift0, src1, shift1, src2, shift2, src3,
|
||||
shift0, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vsrar_h, src4, shift1, src5, shift2, src6, shift0, src7,
|
||||
shift1, src4, src5, src6, src7);
|
||||
DUP4_ARG2(__lsx_vsrar_h, tmp0, shift2, tmp1, shift0, tmp2, shift1, tmp3,
|
||||
shift2, tmp0, tmp1, tmp2, tmp3);
|
||||
DUP4_ARG2(__lsx_vslli_h, src0, 1, src1, 1, src2, 1, src3, 1,
|
||||
tmp5, tmp6, tmp7, tmp8);
|
||||
DUP4_ARG2(__lsx_vslli_h, src0, 1, src1, 1, src2, 1, src3, 1, tmp5, tmp6,
|
||||
tmp7, tmp8);
|
||||
DUP2_ARG2(__lsx_vslli_h, src4, 1, src5, 1, tmp9, tmp10);
|
||||
DUP4_ARG2(__lsx_vadd_h, src0, tmp5, src1, tmp6, src2, tmp7, src3, tmp8,
|
||||
src0, src1, src2, src3);
|
||||
@ -708,8 +709,8 @@ void ScaleRowDown34_1_Box_LSX(const uint8_t* src_ptr,
|
||||
const0, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vdp2_h_bu, tmp4, const1, tmp5, const2, tmp6, const0, tmp7,
|
||||
const1, src4, src5, src6, src7);
|
||||
DUP4_ARG2(__lsx_vdp2_h_bu, tmp8, const2, tmp9, const0, tmp10, const1,
|
||||
tmp11, const2, tmp0, tmp1, tmp2, tmp3);
|
||||
DUP4_ARG2(__lsx_vdp2_h_bu, tmp8, const2, tmp9, const0, tmp10, const1, tmp11,
|
||||
const2, tmp0, tmp1, tmp2, tmp3);
|
||||
DUP4_ARG2(__lsx_vsrar_h, src0, shift0, src1, shift1, src2, shift2, src3,
|
||||
shift0, src0, src1, src2, src3);
|
||||
DUP4_ARG2(__lsx_vsrar_h, src4, shift1, src5, shift2, src6, shift0, src7,
|
||||
|
||||
@ -257,7 +257,8 @@ TEST_F(LibYUVBaseTest, TestLinuxMipsMsa) {
|
||||
|
||||
EXPECT_EQ(0, MipsCpuCaps("../../unit_test/testdata/mips.txt"));
|
||||
EXPECT_EQ(kCpuHasMSA, MipsCpuCaps("../../unit_test/testdata/mips_msa.txt"));
|
||||
EXPECT_EQ(kCpuHasMSA, MipsCpuCaps("../../unit_test/testdata/mips_loongson2k.txt"));
|
||||
EXPECT_EQ(kCpuHasMSA,
|
||||
MipsCpuCaps("../../unit_test/testdata/mips_loongson2k.txt"));
|
||||
} else {
|
||||
printf("WARNING: unable to load \"../../unit_test/testdata/mips.txt\"\n");
|
||||
}
|
||||
|
||||
39
unit_test/planar_test.cc
Normal file → Executable file
39
unit_test/planar_test.cc
Normal file → Executable file
@ -1484,6 +1484,45 @@ TEST_F(LibYUVPlanarTest, TestCopyPlane) {
|
||||
EXPECT_EQ(0, err);
|
||||
}
|
||||
|
||||
TEST_F(LibYUVPlanarTest, TestDetilePlane) {
|
||||
int i, j;
|
||||
|
||||
// orig is tiled. Allocate enough memory for tiles.
|
||||
int orig_width = (benchmark_width_ + 15) & ~15;
|
||||
int orig_height = (benchmark_height_ + 15) & ~15;
|
||||
int orig_plane_size = orig_width * orig_height;
|
||||
int y_plane_size = benchmark_width_ * benchmark_height_;
|
||||
align_buffer_page_end(orig_y, orig_plane_size);
|
||||
align_buffer_page_end(dst_c, y_plane_size);
|
||||
align_buffer_page_end(dst_opt, y_plane_size);
|
||||
|
||||
MemRandomize(orig_y, orig_plane_size);
|
||||
memset(dst_c, 0, y_plane_size);
|
||||
memset(dst_opt, 0, y_plane_size);
|
||||
|
||||
// Disable all optimizations.
|
||||
MaskCpuFlags(disable_cpu_flags_);
|
||||
for (j = 0; j < benchmark_iterations_; j++) {
|
||||
DetilePlane(orig_y, orig_width, dst_c, benchmark_width_,
|
||||
benchmark_width_, benchmark_height_, 16);
|
||||
}
|
||||
|
||||
// Enable optimizations.
|
||||
MaskCpuFlags(benchmark_cpu_info_);
|
||||
for (j = 0; j < benchmark_iterations_; j++) {
|
||||
DetilePlane(orig_y, orig_width, dst_opt, benchmark_width_,
|
||||
benchmark_width_, benchmark_height_, 16);
|
||||
}
|
||||
|
||||
for (i = 0; i < y_plane_size; ++i) {
|
||||
EXPECT_EQ(dst_c[i], dst_opt[i]);
|
||||
}
|
||||
|
||||
free_aligned_buffer_page_end(orig_y);
|
||||
free_aligned_buffer_page_end(dst_c);
|
||||
free_aligned_buffer_page_end(dst_opt);
|
||||
}
|
||||
|
||||
static int TestMultiply(int width,
|
||||
int height,
|
||||
int benchmark_iterations,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user