mirror of
https://github.com/webmproject/libwebp.git
synced 2025-08-29 23:32:05 +02:00
apply clang-format
(Debian clang-format version 19.1.7 (3+build4)) with `--style=Google`. Manual changes: * clang-format disabled around macros with stringification (mostly assembly) * some inline assembly strings were adjusted to avoid awkward line breaks * trailing commas, `//` or suffixes (`ull`) added to help array formatting * thread_utils.c: parameter comments were changed to the more common /*...=*/ style to improve formatting The automatically generated code under swig/ was skipped. Bug: 433996651 Change-Id: Iea3f24160d78d2a2653971cdf13fa932e47ff1b3
This commit is contained in:
@@ -18,46 +18,48 @@
|
||||
#include "src/dsp/lossless.h"
|
||||
#include "src/dsp/msa_macro.h"
|
||||
|
||||
#define TRANSFORM_COLOR_8(src0, src1, dst0, dst1, c0, c1, mask0, mask1) do { \
|
||||
v8i16 g0, g1, t0, t1, t2, t3; \
|
||||
v4i32 t4, t5; \
|
||||
VSHF_B2_SH(src0, src0, src1, src1, mask0, mask0, g0, g1); \
|
||||
DOTP_SB2_SH(g0, g1, c0, c0, t0, t1); \
|
||||
SRAI_H2_SH(t0, t1, 5); \
|
||||
t0 = __msa_subv_h((v8i16)src0, t0); \
|
||||
t1 = __msa_subv_h((v8i16)src1, t1); \
|
||||
t4 = __msa_srli_w((v4i32)src0, 16); \
|
||||
t5 = __msa_srli_w((v4i32)src1, 16); \
|
||||
DOTP_SB2_SH(t4, t5, c1, c1, t2, t3); \
|
||||
SRAI_H2_SH(t2, t3, 5); \
|
||||
SUB2(t0, t2, t1, t3, t0, t1); \
|
||||
VSHF_B2_UB(src0, t0, src1, t1, mask1, mask1, dst0, dst1); \
|
||||
} while (0)
|
||||
#define TRANSFORM_COLOR_8(src0, src1, dst0, dst1, c0, c1, mask0, mask1) \
|
||||
do { \
|
||||
v8i16 g0, g1, t0, t1, t2, t3; \
|
||||
v4i32 t4, t5; \
|
||||
VSHF_B2_SH(src0, src0, src1, src1, mask0, mask0, g0, g1); \
|
||||
DOTP_SB2_SH(g0, g1, c0, c0, t0, t1); \
|
||||
SRAI_H2_SH(t0, t1, 5); \
|
||||
t0 = __msa_subv_h((v8i16)src0, t0); \
|
||||
t1 = __msa_subv_h((v8i16)src1, t1); \
|
||||
t4 = __msa_srli_w((v4i32)src0, 16); \
|
||||
t5 = __msa_srli_w((v4i32)src1, 16); \
|
||||
DOTP_SB2_SH(t4, t5, c1, c1, t2, t3); \
|
||||
SRAI_H2_SH(t2, t3, 5); \
|
||||
SUB2(t0, t2, t1, t3, t0, t1); \
|
||||
VSHF_B2_UB(src0, t0, src1, t1, mask1, mask1, dst0, dst1); \
|
||||
} while (0)
|
||||
|
||||
#define TRANSFORM_COLOR_4(src, dst, c0, c1, mask0, mask1) do { \
|
||||
const v16i8 g0 = VSHF_SB(src, src, mask0); \
|
||||
v8i16 t0 = __msa_dotp_s_h(c0, g0); \
|
||||
v8i16 t1; \
|
||||
v4i32 t2; \
|
||||
t0 = SRAI_H(t0, 5); \
|
||||
t0 = __msa_subv_h((v8i16)src, t0); \
|
||||
t2 = __msa_srli_w((v4i32)src, 16); \
|
||||
t1 = __msa_dotp_s_h(c1, (v16i8)t2); \
|
||||
t1 = SRAI_H(t1, 5); \
|
||||
t0 = t0 - t1; \
|
||||
dst = VSHF_UB(src, t0, mask1); \
|
||||
} while (0)
|
||||
#define TRANSFORM_COLOR_4(src, dst, c0, c1, mask0, mask1) \
|
||||
do { \
|
||||
const v16i8 g0 = VSHF_SB(src, src, mask0); \
|
||||
v8i16 t0 = __msa_dotp_s_h(c0, g0); \
|
||||
v8i16 t1; \
|
||||
v4i32 t2; \
|
||||
t0 = SRAI_H(t0, 5); \
|
||||
t0 = __msa_subv_h((v8i16)src, t0); \
|
||||
t2 = __msa_srli_w((v4i32)src, 16); \
|
||||
t1 = __msa_dotp_s_h(c1, (v16i8)t2); \
|
||||
t1 = SRAI_H(t1, 5); \
|
||||
t0 = t0 - t1; \
|
||||
dst = VSHF_UB(src, t0, mask1); \
|
||||
} while (0)
|
||||
|
||||
static void TransformColor_MSA(const VP8LMultipliers* WEBP_RESTRICT const m,
|
||||
uint32_t* WEBP_RESTRICT data, int num_pixels) {
|
||||
v16u8 src0, dst0;
|
||||
const v16i8 g2br = (v16i8)__msa_fill_w(m->green_to_blue |
|
||||
(m->green_to_red << 16));
|
||||
const v16i8 g2br =
|
||||
(v16i8)__msa_fill_w(m->green_to_blue | (m->green_to_red << 16));
|
||||
const v16i8 r2b = (v16i8)__msa_fill_w(m->red_to_blue);
|
||||
const v16u8 mask0 = { 1, 255, 1, 255, 5, 255, 5, 255, 9, 255, 9, 255,
|
||||
13, 255, 13, 255 };
|
||||
const v16u8 mask1 = { 16, 1, 18, 3, 20, 5, 22, 7, 24, 9, 26, 11,
|
||||
28, 13, 30, 15 };
|
||||
const v16u8 mask0 = {1, 255, 1, 255, 5, 255, 5, 255,
|
||||
9, 255, 9, 255, 13, 255, 13, 255};
|
||||
const v16u8 mask1 = {16, 1, 18, 3, 20, 5, 22, 7,
|
||||
24, 9, 26, 11, 28, 13, 30, 15};
|
||||
|
||||
while (num_pixels >= 8) {
|
||||
v16u8 src1, dst1;
|
||||
@@ -99,8 +101,8 @@ static void SubtractGreenFromBlueAndRed_MSA(uint32_t* argb_data,
|
||||
int i;
|
||||
uint8_t* ptemp_data = (uint8_t*)argb_data;
|
||||
v16u8 src0, dst0, tmp0;
|
||||
const v16u8 mask = { 1, 255, 1, 255, 5, 255, 5, 255, 9, 255, 9, 255,
|
||||
13, 255, 13, 255 };
|
||||
const v16u8 mask = {1, 255, 1, 255, 5, 255, 5, 255,
|
||||
9, 255, 9, 255, 13, 255, 13, 255};
|
||||
|
||||
while (num_pixels >= 8) {
|
||||
v16u8 src1, dst1, tmp1;
|
||||
|
Reference in New Issue
Block a user