mirror of
https://github.com/webmproject/libwebp.git
synced 2025-02-13 15:32:53 +01:00
alpha_processing: harmonize the naming suffixes to be _C()
BUG=webp:355 Change-Id: Iae8221cd34957764ead21aa46abfc320e5514a4b
This commit is contained in:
parent
6878d42720
commit
dec5e4d330
@ -134,7 +134,7 @@ static WEBP_INLINE uint32_t GetScale(uint32_t a, int inverse) {
|
|||||||
|
|
||||||
#endif // USE_TABLES_FOR_ALPHA_MULT
|
#endif // USE_TABLES_FOR_ALPHA_MULT
|
||||||
|
|
||||||
void WebPMultARGBRowC(uint32_t* const ptr, int width, int inverse) {
|
void WebPMultARGBRow_C(uint32_t* const ptr, int width, int inverse) {
|
||||||
int x;
|
int x;
|
||||||
for (x = 0; x < width; ++x) {
|
for (x = 0; x < width; ++x) {
|
||||||
const uint32_t argb = ptr[x];
|
const uint32_t argb = ptr[x];
|
||||||
@ -154,7 +154,7 @@ void WebPMultARGBRowC(uint32_t* const ptr, int width, int inverse) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebPMultRowC(uint8_t* const ptr, const uint8_t* const alpha,
|
void WebPMultRow_C(uint8_t* const ptr, const uint8_t* const alpha,
|
||||||
int width, int inverse) {
|
int width, int inverse) {
|
||||||
int x;
|
int x;
|
||||||
for (x = 0; x < width; ++x) {
|
for (x = 0; x < width; ++x) {
|
||||||
@ -217,7 +217,7 @@ void WebPMultRows(uint8_t* ptr, int stride,
|
|||||||
#define PREMULTIPLY(x, m) (((x) * (m) + (1U << 23)) >> 24)
|
#define PREMULTIPLY(x, m) (((x) * (m) + (1U << 23)) >> 24)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void ApplyAlphaMultiply(uint8_t* rgba, int alpha_first,
|
static void ApplyAlphaMultiply_C(uint8_t* rgba, int alpha_first,
|
||||||
int w, int h, int stride) {
|
int w, int h, int stride) {
|
||||||
while (h-- > 0) {
|
while (h-- > 0) {
|
||||||
uint8_t* const rgb = rgba + (alpha_first ? 1 : 0);
|
uint8_t* const rgb = rgba + (alpha_first ? 1 : 0);
|
||||||
@ -254,7 +254,7 @@ static WEBP_INLINE uint8_t multiply(uint8_t x, uint32_t m) {
|
|||||||
return (x * m) >> 16;
|
return (x * m) >> 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
static WEBP_INLINE void ApplyAlphaMultiply4444(uint8_t* rgba4444,
|
static WEBP_INLINE void ApplyAlphaMultiply4444_C(uint8_t* rgba4444,
|
||||||
int w, int h, int stride,
|
int w, int h, int stride,
|
||||||
int rg_byte_pos /* 0 or 1 */) {
|
int rg_byte_pos /* 0 or 1 */) {
|
||||||
while (h-- > 0) {
|
while (h-- > 0) {
|
||||||
@ -275,12 +275,12 @@ static WEBP_INLINE void ApplyAlphaMultiply4444(uint8_t* rgba4444,
|
|||||||
}
|
}
|
||||||
#undef MULTIPLIER
|
#undef MULTIPLIER
|
||||||
|
|
||||||
static void ApplyAlphaMultiply_16b(uint8_t* rgba4444,
|
static void ApplyAlphaMultiply_16b_C(uint8_t* rgba4444,
|
||||||
int w, int h, int stride) {
|
int w, int h, int stride) {
|
||||||
#ifdef WEBP_SWAP_16BIT_CSP
|
#ifdef WEBP_SWAP_16BIT_CSP
|
||||||
ApplyAlphaMultiply4444(rgba4444, w, h, stride, 1);
|
ApplyAlphaMultiply4444_C(rgba4444, w, h, stride, 1);
|
||||||
#else
|
#else
|
||||||
ApplyAlphaMultiply4444(rgba4444, w, h, stride, 0);
|
ApplyAlphaMultiply4444_C(rgba4444, w, h, stride, 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -378,10 +378,10 @@ static volatile VP8CPUInfo alpha_processing_last_cpuinfo_used =
|
|||||||
WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessing(void) {
|
WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessing(void) {
|
||||||
if (alpha_processing_last_cpuinfo_used == VP8GetCPUInfo) return;
|
if (alpha_processing_last_cpuinfo_used == VP8GetCPUInfo) return;
|
||||||
|
|
||||||
WebPMultARGBRow = WebPMultARGBRowC;
|
WebPMultARGBRow = WebPMultARGBRow_C;
|
||||||
WebPMultRow = WebPMultRowC;
|
WebPMultRow = WebPMultRow_C;
|
||||||
WebPApplyAlphaMultiply = ApplyAlphaMultiply;
|
WebPApplyAlphaMultiply = ApplyAlphaMultiply_C;
|
||||||
WebPApplyAlphaMultiply4444 = ApplyAlphaMultiply_16b;
|
WebPApplyAlphaMultiply4444 = ApplyAlphaMultiply_16b_C;
|
||||||
|
|
||||||
WebPDispatchAlpha = DispatchAlpha_C;
|
WebPDispatchAlpha = DispatchAlpha_C;
|
||||||
WebPDispatchAlphaToGreen = DispatchAlphaToGreen_C;
|
WebPDispatchAlphaToGreen = DispatchAlphaToGreen_C;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#if defined(WEBP_USE_MIPS_DSP_R2)
|
#if defined(WEBP_USE_MIPS_DSP_R2)
|
||||||
|
|
||||||
static int DispatchAlpha(const uint8_t* alpha, int alpha_stride,
|
static int DispatchAlpha_MIPSdspR2(const uint8_t* alpha, int alpha_stride,
|
||||||
int width, int height,
|
int width, int height,
|
||||||
uint8_t* dst, int dst_stride) {
|
uint8_t* dst, int dst_stride) {
|
||||||
uint32_t alpha_mask = 0xffffffff;
|
uint32_t alpha_mask = 0xffffffff;
|
||||||
@ -79,7 +79,8 @@ static int DispatchAlpha(const uint8_t* alpha, int alpha_stride,
|
|||||||
return (alpha_mask != 0xff);
|
return (alpha_mask != 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MultARGBRow(uint32_t* const ptr, int width, int inverse) {
|
static void MultARGBRow_MIPSdspR2(uint32_t* const ptr, int width,
|
||||||
|
int inverse) {
|
||||||
int x;
|
int x;
|
||||||
const uint32_t c_00ffffff = 0x00ffffffu;
|
const uint32_t c_00ffffff = 0x00ffffffu;
|
||||||
const uint32_t c_ff000000 = 0xff000000u;
|
const uint32_t c_ff000000 = 0xff000000u;
|
||||||
@ -169,8 +170,8 @@ static void PackRGB_MIPSdspR2(const uint8_t* r, const uint8_t* g,
|
|||||||
extern void WebPInitAlphaProcessingMIPSdspR2(void);
|
extern void WebPInitAlphaProcessingMIPSdspR2(void);
|
||||||
|
|
||||||
WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingMIPSdspR2(void) {
|
WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingMIPSdspR2(void) {
|
||||||
WebPDispatchAlpha = DispatchAlpha;
|
WebPDispatchAlpha = DispatchAlpha_MIPSdspR2;
|
||||||
WebPMultARGBRow = MultARGBRow;
|
WebPMultARGBRow = MultARGBRow_MIPSdspR2;
|
||||||
WebPPackRGB = PackRGB_MIPSdspR2;
|
WebPPackRGB = PackRGB_MIPSdspR2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
static int DispatchAlpha(const uint8_t* alpha, int alpha_stride,
|
static int DispatchAlpha_SSE2(const uint8_t* alpha, int alpha_stride,
|
||||||
int width, int height,
|
int width, int height,
|
||||||
uint8_t* dst, int dst_stride) {
|
uint8_t* dst, int dst_stride) {
|
||||||
// alpha_and stores an 'and' operation of all the alpha[] values. The final
|
// alpha_and stores an 'and' operation of all the alpha[] values. The final
|
||||||
@ -72,7 +72,7 @@ static int DispatchAlpha(const uint8_t* alpha, int alpha_stride,
|
|||||||
return (alpha_and != 0xff);
|
return (alpha_and != 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DispatchAlphaToGreen(const uint8_t* alpha, int alpha_stride,
|
static void DispatchAlphaToGreen_SSE2(const uint8_t* alpha, int alpha_stride,
|
||||||
int width, int height,
|
int width, int height,
|
||||||
uint32_t* dst, int dst_stride) {
|
uint32_t* dst, int dst_stride) {
|
||||||
int i, j;
|
int i, j;
|
||||||
@ -98,7 +98,7 @@ static void DispatchAlphaToGreen(const uint8_t* alpha, int alpha_stride,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ExtractAlpha(const uint8_t* argb, int argb_stride,
|
static int ExtractAlpha_SSE2(const uint8_t* argb, int argb_stride,
|
||||||
int width, int height,
|
int width, int height,
|
||||||
uint8_t* alpha, int alpha_stride) {
|
uint8_t* alpha, int alpha_stride) {
|
||||||
// alpha_and stores an 'and' operation of all the alpha[] values. The final
|
// alpha_and stores an 'and' operation of all the alpha[] values. The final
|
||||||
@ -238,7 +238,7 @@ static void MultARGBRow_SSE2(uint32_t* const ptr, int width, int inverse) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
width -= x;
|
width -= x;
|
||||||
if (width > 0) WebPMultARGBRowC(ptr + x, width, inverse);
|
if (width > 0) WebPMultARGBRow_C(ptr + x, width, inverse);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MultRow_SSE2(uint8_t* const ptr, const uint8_t* const alpha,
|
static void MultRow_SSE2(uint8_t* const ptr, const uint8_t* const alpha,
|
||||||
@ -261,7 +261,7 @@ static void MultRow_SSE2(uint8_t* const ptr, const uint8_t* const alpha,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
width -= x;
|
width -= x;
|
||||||
if (width > 0) WebPMultRowC(ptr + x, alpha + x, width, inverse);
|
if (width > 0) WebPMultRow_C(ptr + x, alpha + x, width, inverse);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@ -273,9 +273,9 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingSSE2(void) {
|
|||||||
WebPMultARGBRow = MultARGBRow_SSE2;
|
WebPMultARGBRow = MultARGBRow_SSE2;
|
||||||
WebPMultRow = MultRow_SSE2;
|
WebPMultRow = MultRow_SSE2;
|
||||||
WebPApplyAlphaMultiply = ApplyAlphaMultiply_SSE2;
|
WebPApplyAlphaMultiply = ApplyAlphaMultiply_SSE2;
|
||||||
WebPDispatchAlpha = DispatchAlpha;
|
WebPDispatchAlpha = DispatchAlpha_SSE2;
|
||||||
WebPDispatchAlphaToGreen = DispatchAlphaToGreen;
|
WebPDispatchAlphaToGreen = DispatchAlphaToGreen_SSE2;
|
||||||
WebPExtractAlpha = ExtractAlpha;
|
WebPExtractAlpha = ExtractAlpha_SSE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // !WEBP_USE_SSE2
|
#else // !WEBP_USE_SSE2
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
static int ExtractAlpha(const uint8_t* argb, int argb_stride,
|
static int ExtractAlpha_SSE41(const uint8_t* argb, int argb_stride,
|
||||||
int width, int height,
|
int width, int height,
|
||||||
uint8_t* alpha, int alpha_stride) {
|
uint8_t* alpha, int alpha_stride) {
|
||||||
// alpha_and stores an 'and' operation of all the alpha[] values. The final
|
// alpha_and stores an 'and' operation of all the alpha[] values. The final
|
||||||
@ -82,7 +82,7 @@ static int ExtractAlpha(const uint8_t* argb, int argb_stride,
|
|||||||
extern void WebPInitAlphaProcessingSSE41(void);
|
extern void WebPInitAlphaProcessingSSE41(void);
|
||||||
|
|
||||||
WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingSSE41(void) {
|
WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingSSE41(void) {
|
||||||
WebPExtractAlpha = ExtractAlpha;
|
WebPExtractAlpha = ExtractAlpha_SSE41;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // !WEBP_USE_SSE41
|
#else // !WEBP_USE_SSE41
|
||||||
|
@ -538,9 +538,9 @@ void WebPMultRows(uint8_t* ptr, int stride,
|
|||||||
int width, int num_rows, int inverse);
|
int width, int num_rows, int inverse);
|
||||||
|
|
||||||
// Plain-C versions, used as fallback by some implementations.
|
// Plain-C versions, used as fallback by some implementations.
|
||||||
void WebPMultRowC(uint8_t* const ptr, const uint8_t* const alpha,
|
void WebPMultRow_C(uint8_t* const ptr, const uint8_t* const alpha,
|
||||||
int width, int inverse);
|
int width, int inverse);
|
||||||
void WebPMultARGBRowC(uint32_t* const ptr, int width, int inverse);
|
void WebPMultARGBRow_C(uint32_t* const ptr, int width, int inverse);
|
||||||
|
|
||||||
// RGB packing function. 'step' can be 3 or 4. r/g/b input is rgb or bgr order.
|
// RGB packing function. 'step' can be 3 or 4. r/g/b input is rgb or bgr order.
|
||||||
extern void (*WebPPackRGB)(const uint8_t* r, const uint8_t* g, const uint8_t* b,
|
extern void (*WebPPackRGB)(const uint8_t* r, const uint8_t* g, const uint8_t* b,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user