Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Chromium
third_party/libwebp/src/dsp/lossless.c
static void PredictorInverseTransform_C(const VP8LTransform *const transform, int y_start, int y_end, const uint32_t *in, uint32_t *out) { const int width = transform->xsize_; if (y_start == 0) { PredictorAdd0_C(in, NULL, 1, out); ...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless.c
void VP8LAddGreenToBlueAndRed_C(const uint32_t *src, int num_pixels, uint32_t *dst) { int i; for (i = 0; i < num_pixels; ++i) { const uint32_t argb = src[i]; const uint32_t green = ((argb >> 8) & 0xff); uint32_t red_blue = (argb & 0x00ff00ffu); red_blue += (green << 1...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless.c
void VP8LConvertBGRAToRGBA_C(const uint32_t *src, int num_pixels, uint8_t *dst) { const uint32_t *const src_end = src + num_pixels; while (src < src_end) { const uint32_t argb = *src++; *dst++ = (argb >> 16) & 0xff; *dst++ = (argb >> 8) & 0xff; *dst++ = (argb >> 0) & 0x...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless.c
void VP8LConvertFromBGRA(const uint32_t *const in_data, int num_pixels, WEBP_CSP_MODE out_colorspace, uint8_t *const rgba) { switch (out_colorspace) { case MODE_RGB: VP8LConvertBGRAToRGB(in_data, num_pixels, rgba); break; case MODE_RGBA: VP8LConvertBGRAToRGBA(in_data, num_pixe...
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_enc.c
void VP8LBitEntropyInit(VP8LBitEntropy *const entropy) { entropy->entropy = 0.; entropy->sum = 0; entropy->nonzeros = 0; entropy->max_val = 0; entropy->nonzero_code = VP8L_NON_TRIVIAL_SYM; }
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_enc.c
static WEBP_INLINE void GetEntropyUnrefinedHelper(uint32_t val, int i, uint32_t *const val_prev, int *const i_prev, VP8LBitEntropy *const bit_entropy, VP8LStreaks *const stats) { const int streak = i - *i_prev; if (*val_prev != 0) { bit_entropy->sum += (*val_...
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_enc.c
static void GetEntropyUnrefined_C(const uint32_t X[], int length, VP8LBitEntropy *const bit_entropy, VP8LStreaks *const stats) { int i; int i_prev = 0; uint32_t x_prev = X[0]; memset(stats, 0, sizeof(*stats)); VP8LBitEntropyInit(bit_entropy...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_enc.c
static WEBP_INLINE uint8_t TransformColorBlue(uint8_t green_to_blue, uint8_t red_to_blue, uint32_t argb) { const int8_t green = U32ToS8(argb >> 8); const int8_t red = U32ToS8(argb >> 16); uint8_t new_blue = argb & 0xff; ...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_enc.c
void VP8LBundleColorMap_C(const uint8_t *const row, int width, int xbits, uint32_t *dst) { int x; if (xbits > 0) { const int bit_depth = 1 << (3 - xbits); const int mask = (1 << xbits) - 1; uint32_t code = 0xff000000; for (x = 0; x < width; ++x) { const int xsub = x &...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_enc.c
static void AddVectorEq_C(const uint32_t *a, uint32_t *out, int size) { int i; for (i = 0; i < size; ++i) out[i] += a[i]; } #define ADD(X, ARG, LEN) \ do { \ if (a->is_used_[X]) ...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_enc.c
static WEBP_INLINE uint32_t Average2(uint32_t a0, uint32_t a1) { return (((a0 ^ a1) & 0xfefefefeu) >> 1) + (a0 & a1); }
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_enc.c
static WEBP_INLINE uint32_t Average4(uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { return Average2(Average2(a0, a1), Average2(a2, a3)); }
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_enc_mips_dsp_r2.c
WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInitMIPSdspR2(void) { VP8LSubtractGreenFromBlueAndRed = SubtractGreenFromBlueAndRed_MIPSdspR2; VP8LTransformColor = TransformColor_MIPSdspR2; VP8LCollectColorBlueTransforms = CollectColorBlueTransforms_MIPSdspR2; VP8LCollectColorRedTransforms = CollectColorRedTransforms_...
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_enc_sse2.c
static void AddVector_SSE2(const uint32_t *a, const uint32_t *b, uint32_t *out, int size) { int i; for (i = 0; i + LINE_SIZE <= size; i += LINE_SIZE) { const __m128i a0 = _mm_loadu_si128((const __m128i *)&a[i + 0]); const __m128i a1 = _mm_loadu_si128((const __m128i *)&a[i + 4]); #...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_enc_sse2.c
static void PredictorSub11_SSE2(const uint32_t *in, const uint32_t *upper, int num_pixels, uint32_t *out) { int i; for (i = 0; i + 4 <= num_pixels; i += 4) { const __m128i L = _mm_loadu_si128((const __m128i *)&in[i - 1]); const __m128i T = _mm_loadu_si128((const __m128i *)&up...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_enc_sse2.c
static void PredictorSub12_SSE2(const uint32_t *in, const uint32_t *upper, int num_pixels, uint32_t *out) { int i; const __m128i zero = _mm_setzero_si128(); for (i = 0; i + 4 <= num_pixels; i += 4) { const __m128i src = _mm_loadu_si128((const __m128i *)&in[i]); const __m128...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_enc_sse41.c
static void SubtractGreenFromBlueAndRed_SSE41(uint32_t *argb_data, int num_pixels) { int i; const __m128i kCstShuffle = _mm_set_epi8(-1, 13, -1, 13, -1, 9, -1, 9, -1, 5, -1, 5, -1, 1, -1, 1); for (i = 0; i + 4 <= num_pixels; i += 4) { const __m128i in = _mm_...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_mips_dsp_r2.c
static WEBP_INLINE uint32_t Select(uint32_t a, uint32_t b, uint32_t c) { int temp0, temp1, temp2, temp3, temp4, temp5; __asm__ volatile("cmpgdu.lt.qb %[temp1], %[c], %[b] \n\t" "pick.qb %[temp1], %[b], %[c] \n\t" "pick.qb %[temp2], %[c...
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_mips_dsp_r2.c
static WEBP_INLINE uint32_t Average3(uint32_t a0, uint32_t a1, uint32_t a2) { return Average2(Average2(a0, a2), a1); }
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_mips_dsp_r2.c
static uint32_t Predictor13_MIPSdspR2(uint32_t left, const uint32_t *const top) { return ClampedAddSubtractHalf(left, top[0], top[-1]); }
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_msa.c
static void AddGreenToBlueAndRed_MSA(const uint32_t *const src, int num_pixels, uint32_t *dst) { int i; const uint8_t *in = (const uint8_t *)src; uint8_t *out = (uint8_t *)dst; v16u8 src0, dst0, tmp0; const v16u8 mask = {1, 255, 1, 255, 5, 255, 5, 255, ...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_msa.c
WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitMSA(void) { VP8LConvertBGRAToRGBA = ConvertBGRAToRGBA_MSA; VP8LConvertBGRAToBGR = ConvertBGRAToBGR_MSA; VP8LConvertBGRAToRGB = ConvertBGRAToRGB_MSA; VP8LAddGreenToBlueAndRed = AddGreenToBlueAndRed_MSA; VP8LTransformColorInverse = TransformColorInverse_MSA; } #else
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_neon.c
static WEBP_INLINE uint8x8_t Average2_u8_NEON(uint32_t a0, uint32_t a1) { const uint8x8_t A0 = LOAD_U32_AS_U8(a0); const uint8x8_t A1 = LOAD_U32_AS_U8(a1); return vhadd_u8(A0, A1); }
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_neon.c
static WEBP_INLINE uint32_t ClampedAddSubtractHalf_NEON(uint32_t c0, uint32_t c1, uint32_t c2) { const uint8x8_t avg = Average2_u8_NEON(c0, c1); const uint8x8_t C2 = LOAD_U32_AS_U8(c2); const uint8x8_t...
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_neon.c
static uint32_t Predictor6_NEON(uint32_t left, const uint32_t *const top) { return Average2_NEON(left, top[-1]); }
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_neon.c
static void PredictorAdd0_NEON(const uint32_t *in, const uint32_t *upper, int num_pixels, uint32_t *out) { int i; const uint8x16_t black = vreinterpretq_u8_u32(vdupq_n_u32(ARGB_BLACK)); for (i = 0; i + 4 <= num_pixels; i += 4) { const uint8x16_t src = LOADQ_U32P_AS_U8(&in[i]); ...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_neon.c
static void PredictorAdd5_NEON(const uint32_t *in, const uint32_t *upper, int num_pixels, uint32_t *out) { int i; uint8x16_t L = LOADQ_U32_AS_U8(out[-1]); for (i = 0; i + 4 <= num_pixels; i += 4) { const uint8x16_t src = LOADQ_U32P_AS_U8(&in[i]); const uint8x16_t T = LOADQ_...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_neon.c
static void PredictorAdd13_NEON(const uint32_t *in, const uint32_t *upper, int num_pixels, uint32_t *out) { int i; uint8x16_t L = LOADQ_U32_AS_U8(out[-1]); for (i = 0; i + 4 <= num_pixels; i += 4) { const uint8x16_t src = LOADQ_U32P_AS_U8(&in[i]); const uint8x16_t T = LOADQ...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_neon.c
WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitNEON(void) { VP8LPredictors[5] = Predictor5_NEON; VP8LPredictors[6] = Predictor6_NEON; VP8LPredictors[7] = Predictor7_NEON; VP8LPredictors[13] = Predictor13_NEON; VP8LPredictorsAdd[0] = PredictorAdd0_NEON; VP8LPredictorsAdd[1] = PredictorAdd1_NEON; VP8LPredictor...
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_sse2.c
static WEBP_INLINE void Average2_uint32_SSE2(const uint32_t a0, const uint32_t a1, __m128i *const avg) { const __m128i ones = _mm_set1_epi8(1); const __m128i A0 = _mm_cvtsi32_si128(a0); const __m128i A1 = _mm_cvtsi32_si128(a1); const __m128i avg1 = _mm_avg_epu8(A0, A1); const __m128i one = _mm_and_si128(_mm_...
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_sse2.c
static WEBP_INLINE uint32_t Average4_SSE2(uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { const __m128i avg1 = Average2_uint32_16_SSE2(a0, a1); const __m128i avg2 = Average2_uint32_16_SSE2(a2, a3); const __m128i sum = _mm_add_epi16(avg2, avg1); const __m128i avg3...
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_sse2.c
static uint32_t Predictor9_SSE2(uint32_t left, const uint32_t *const top) { const uint32_t pred = Average2_SSE2(top[0], top[1]); (void)left; return pred; }
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_sse2.c
static uint32_t Predictor12_SSE2(uint32_t left, const uint32_t *const top) { const uint32_t pred = ClampedAddSubtractFull_SSE2(left, top[0], top[-1]); return pred; }
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_sse2.c
static void PredictorAdd0_SSE2(const uint32_t *in, const uint32_t *upper, int num_pixels, uint32_t *out) { int i; const __m128i black = _mm_set1_epi32(ARGB_BLACK); for (i = 0; i + 4 <= num_pixels; i += 4) { const __m128i src = _mm_loadu_si128((const __m128i *)&in[i]); const ...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/lossless_sse2.c
static void PredictorAdd12_SSE2(const uint32_t *in, const uint32_t *upper, int num_pixels, uint32_t *out) { int i; const __m128i zero = _mm_setzero_si128(); const __m128i L8 = _mm_cvtsi32_si128(out[-1]); __m128i L = _mm_unpacklo_epi8(L8, zero); for (i = 0; i + 4 <= num_pixels; ...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/rescaler.c
void WebPRescalerExportRow(WebPRescaler *const wrk) { if (wrk->y_accum <= 0) { assert(!WebPRescalerOutputDone(wrk)); if (wrk->y_expand) { WebPRescalerExportRowExpand(wrk); } else if (wrk->fxy_scale) { WebPRescalerExportRowShrink(wrk); } else { int i; assert(wrk->src_height == w...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/rescaler_mips_dsp_r2.c
WEBP_TSAN_IGNORE_FUNCTION void WebPRescalerDspInitMIPSdspR2(void) { WebPRescalerExportRowExpand = ExportRowExpand_MIPSdspR2; } #else // !WEBP_USE_MIPS_DSP_R2
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/rescaler_neon.c
WEBP_TSAN_IGNORE_FUNCTION void WebPRescalerDspInitNEON(void) { WebPRescalerExportRowExpand = RescalerExportRowExpand_NEON; WebPRescalerExportRowShrink = RescalerExportRowShrink_NEON; } #else
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/ssim_sse2.c
WEBP_TSAN_IGNORE_FUNCTION void VP8SSIMDspInitSSE2(void) { #if !defined(WEBP_DISABLE_STATS) VP8AccumulateSSE = AccumulateSSE_SSE2; #endif #if !defined(WEBP_REDUCE_SIZE) VP8SSIMGet = SSIMGet_SSE2; #endif } #else
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/upsampling_mips_dsp_r2.c
static WEBP_INLINE void YuvToArgb(uint8_t y, uint8_t u, uint8_t v, uint8_t *const argb) { int r, g, b; YUV_TO_RGB(y, u, v, r, g, b); argb[0] = 0xff; argb[1] = r; argb[2] = g; argb[3] = b; } #endif
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/upsampling_msa.c
static WEBP_INLINE int Clip8(int v) { return v < 0 ? 0 : v > 255 ? 255 : v; }
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/upsampling_msa.c
static void YuvToRgb565(int y, int u, int v, uint8_t *const rgb) { const int y1 = MultHi(y, 19077); const int r1 = y1 + MultHi(v, 26149) - 14234; const int g1 = y1 - MultHi(u, 6419) - MultHi(v, 13320) + 8708; const int b1 = y1 + MultHi(u, 33050) - 17685; const int r = Clip8(r1 >> 6); const int g = Clip8(g1 ...
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/upsampling_msa.c
static void YuvToRgbaLine(const uint8_t *y, const uint8_t *u, const uint8_t *v, uint8_t *dst, int length) { v16u8 R, G, B; const v16u8 A = (v16u8)__msa_ldi_b(ALPHAVAL); while (length >= 16) { CALC_RGB16(y, u, v, R, G, B); STORE16_4(R, G, B, A, dst); y += 16; u += 16; ...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/upsampling_msa.c
static void YuvToRgba4444Line(const uint8_t *y, const uint8_t *u, const uint8_t *v, uint8_t *dst, int length) { v16u8 R, G, B, RG, BA, tmp0, tmp1; while (length >= 16) { #if (WEBP_SWAP_16BIT_CSP == 1) CALC_RGBA4444(y, u, v, BA, RG, 16, dst); #else CALC_RGBA4444(y, u, v, RG, BA...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/upsampling_neon.c
static void Upsample16Pixels_NEON(const uint8_t *r1, const uint8_t *r2, uint8_t *out) { UPSAMPLE_16PIXELS(r1, r2, out); } #define UPSAMPLE_LAST_BLOCK(tb, bb, num_pixels, out) \ { \...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/yuv.c
static void ConvertBGR24ToY_C(const uint8_t *bgr, uint8_t *y, int width) { int i; for (i = 0; i < width; ++i, bgr += 3) { y[i] = VP8RGBToY(bgr[2], bgr[1], bgr[0], YUV_HALF); } }
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/yuv.c
static uint64_t SharpYUVUpdateY_C(const uint16_t *ref, const uint16_t *src, uint16_t *dst, int len) { uint64_t diff = 0; int i; for (i = 0; i < len; ++i) { const int diff_y = ref[i] - src[i]; const int new_y = (int)dst[i] + diff_y; dst[i] = clip_y(new_y); diff +=...
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/yuv.c
static void SharpYUVFilterRow_C(const int16_t *A, const int16_t *B, int len, const uint16_t *best_y, uint16_t *out) { int i; for (i = 0; i < len; ++i, ++A, ++B) { const int v0 = (A[0] * 9 + A[1] * 3 + B[0] * 3 + B[1] + 8) >> 4; const int v1 = (A[1] * 9 + A[0] * 3 + B[1] * 3 +...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/yuv_neon.c
static uint8x8_t ConvertRGBToY_NEON(const uint8x8_t R, const uint8x8_t G, const uint8x8_t B) { const uint16x8_t r = vmovl_u8(R); const uint16x8_t g = vmovl_u8(G); const uint16x8_t b = vmovl_u8(B); const uint16x4_t r_lo = vget_low_u16(r); const uint16x4_t r_hi = vget_high_u1...
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/yuv_neon.c
static void ConvertRGBA32ToUV_NEON(const uint16_t *rgb, uint8_t *u, uint8_t *v, int width) { int i; for (i = 0; i + 8 <= width; i += 8, rgb += 4 * 8) { const uint16x8x4_t RGB = vld4q_u16((const uint16_t *)rgb); int16x8_t U, V; CONVERT_RGB_TO_UV(RGB.val[0], RGB.val[1],...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/yuv_neon.c
static void ConvertARGBToUV_NEON(const uint32_t *argb, uint8_t *u, uint8_t *v, int src_width, int do_store) { int i; for (i = 0; i + 16 <= src_width; i += 16, u += 8, v += 8) { const uint8x16x4_t RGB = vld4q_u8((const uint8_t *)&argb[i]); const uint16x8_t R = vpaddlq_u8(RGB....
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/yuv_neon.c
static uint16_t clip_y_NEON(int v) { return (v < 0) ? 0 : (v > MAX_Y) ? MAX_Y : (uint16_t)v; }
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/yuv_neon.c
static uint64_t SharpYUVUpdateY_NEON(const uint16_t *ref, const uint16_t *src, uint16_t *dst, int len) { int i; const int16x8_t zero = vdupq_n_s16(0); const int16x8_t max = vdupq_n_s16(MAX_Y); uint64x2_t sum = vdupq_n_u64(0); uint64_t diff; for (i = 0; i + 8 <= len; i +...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/yuv_sse2.c
static WEBP_INLINE __m128i Load_UV_HI_8_SSE2(const uint8_t *src) { const __m128i zero = _mm_setzero_si128(); const __m128i tmp0 = _mm_cvtsi32_si128(*(const uint32_t *)src); const __m128i tmp1 = _mm_unpacklo_epi8(zero, tmp0); return _mm_unpacklo_epi16(tmp1, tmp1); }
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/yuv_sse2.c
void VP8YuvToArgb32_SSE2(const uint8_t *y, const uint8_t *u, const uint8_t *v, uint8_t *dst) { const __m128i kAlpha = _mm_set1_epi16(255); int n; for (n = 0; n < 32; n += 8, dst += 32) { __m128i R, G, B; YUV444ToRGB_SSE2(y + n, u + n, v + n, &R, &G, &B); PackAndStore4_SSE2(&k...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/yuv_sse2.c
void VP8YuvToRgba444432_SSE2(const uint8_t *y, const uint8_t *u, const uint8_t *v, uint8_t *dst) { const __m128i kAlpha = _mm_set1_epi16(255); int n; for (n = 0; n < 32; n += 8, dst += 16) { __m128i R, G, B; YUV444ToRGB_SSE2(y + n, u + n, v + n, &R, &G, &B); PackAndStore4...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/yuv_sse2.c
void VP8YuvToRgb56532_SSE2(const uint8_t *y, const uint8_t *u, const uint8_t *v, uint8_t *dst) { int n; for (n = 0; n < 32; n += 8, dst += 16) { __m128i R, G, B; YUV444ToRGB_SSE2(y + n, u + n, v + n, &R, &G, &B); PackAndStore565_SSE2(&R, &G, &B, dst); } }
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/yuv_sse2.c
void VP8YuvToRgb32_SSE2(const uint8_t *y, const uint8_t *u, const uint8_t *v, uint8_t *dst) { __m128i R0, R1, R2, R3, G0, G1, G2, G3, B0, B1, B2, B3; __m128i rgb0, rgb1, rgb2, rgb3, rgb4, rgb5; YUV444ToRGB_SSE2(y + 0, u + 0, v + 0, &R0, &G0, &B0); YUV444ToRGB_SSE2(y + 8, u + 8, v + 8, &...
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/yuv_sse2.c
static void YuvToArgbRow_SSE2(const uint8_t *y, const uint8_t *u, const uint8_t *v, uint8_t *dst, int len) { const __m128i kAlpha = _mm_set1_epi16(255); int n; for (n = 0; n + 8 <= len; n += 8, dst += 32) { __m128i R, G, B; YUV420ToRGB_SSE2(y, u, v, &R, &G, &B); PackAndSt...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/yuv_sse2.c
static void HorizontalAddPack_SSE2(const __m128i *const A, const __m128i *const B, __m128i *const out) { const __m128i k2 = _mm_set1_epi16(2); const __m128i C = _mm_madd_epi16(*A, k2); const __m128i D = _mm_madd_epi16(*B, k2); *out = _mm_packs_epi32(C, D); }
[ 0, 0 ]
Chromium
third_party/libwebp/src/dsp/yuv_sse2.c
static void ConvertARGBToUV_SSE2(const uint32_t *argb, uint8_t *u, uint8_t *v, int src_width, int do_store) { const int max_width = src_width & ~31; int i; for (i = 0; i < max_width; i += 32, u += 16, v += 16) { __m128i rgb[6], U0, V0, U1, V1; RGB32PackedToPlanar_SSE2(&arg...
[ 1, 0 ]
Chromium
third_party/libwebp/src/dsp/yuv_sse41.c
void VP8YuvToBgr32_SSE41(const uint8_t *y, const uint8_t *u, const uint8_t *v, uint8_t *dst) { __m128i R0, R1, R2, R3, G0, G1, G2, G3, B0, B1, B2, B3; __m128i bgr0, bgr1, bgr2, bgr3, bgr4, bgr5; YUV444ToRGB_SSE41(y + 0, u + 0, v + 0, &R0, &G0, &B0); YUV444ToRGB_SSE41(y + 8, u + 8, v + ...
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/alpha_enc.c
int VP8EncStartAlpha(VP8Encoder *const enc) { if (enc->has_alpha_) { if (enc->thread_level_ > 0) { WebPWorker *const worker = &enc->alpha_worker_; if (!WebPGetWorkerInterface()->Reset(worker)) { return 0; } WebPGetWorkerInterface()->Launch(worker); return 1; } else { ...
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/alpha_enc.c
int VP8EncFinishAlpha(VP8Encoder *const enc) { if (enc->has_alpha_) { if (enc->thread_level_ > 0) { WebPWorker *const worker = &enc->alpha_worker_; if (!WebPGetWorkerInterface()->Sync(worker)) return 0; } } return WebPReportProgress(enc->pic_, enc->percent_ + 20, &enc->percent_); }
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/analysis_enc.c
static void SmoothSegmentMap(VP8Encoder *const enc) { int n, x, y; const int w = enc->mb_w_; const int h = enc->mb_h_; const int majority_cnt_3_x_3_grid = 5; uint8_t *const tmp = (uint8_t *)WebPSafeMalloc(w * h, sizeof(*tmp)); assert((uint64_t)(w * h) == (uint64_t)w * h); if (tmp == NULL) return; f...
[ 1, 0 ]
Chromium
third_party/libwebp/src/enc/analysis_enc.c
static int FastMBAnalyze(VP8EncIterator *const it) { // [8-17] range and favor intra4 at high quality, intra16 for low quality. const int q = (int)it->enc_->config_->quality; const uint32_t kThreshold = 8 + (17 - 8) * q / 100; int k; uint32_t dc[16], m, m2; for (k = 0; k < 16; k += 4) { VP8Mean16x4(it-...
[ 1, 0 ]
Chromium
third_party/libwebp/src/enc/analysis_enc.c
static int MBAnalyzeBestUVMode(VP8EncIterator *const it) { int best_alpha = DEFAULT_ALPHA; int smallest_alpha = 0; int best_mode = 0; const int max_mode = MAX_UV_MODE; int mode; VP8MakeChroma8Preds(it); for (mode = 0; mode < max_mode; ++mode) { VP8Histogram histo; int alpha; InitHistogram(&hi...
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/backward_references_cost_enc.c
static WEBP_INLINE void AddSingleLiteralWithCostModel( const uint32_t *const argb, VP8LColorCache *const hashers, const CostModel *const cost_model, int idx, int use_color_cache, float prev_cost, float *const cost, uint16_t *const dist_array) { double cost_val = prev_cost; const uint32_t color = argb[id...
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/backward_references_cost_enc.c
static void DeleteIntervalList(CostManager *const manager, const CostInterval *interval) { while (interval != NULL) { const CostInterval *const next = interval->next_; if (!CostIntervalIsInFreeList(manager, interval)) { WebPSafeFree((void *)interval); } interval = ...
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/backward_references_cost_enc.c
static void CostManagerClear(CostManager *const manager) { if (manager == NULL) return; WebPSafeFree(manager->costs_); WebPSafeFree(manager->cache_intervals_); DeleteIntervalList(manager, manager->head_); manager->head_ = NULL; DeleteIntervalList(manager, manager->recycled_intervals_); manager->recy...
[ 1, 0 ]
Chromium
third_party/libwebp/src/enc/backward_references_cost_enc.c
static WEBP_INLINE void PopInterval(CostManager *const manager, CostInterval *const interval) { if (interval == NULL) return; ConnectIntervals(manager, interval->previous_, interval->next_); if (CostIntervalIsInFreeList(manager, interval)) { CostIntervalAddToFreeList(m...
[ 1, 0 ]
Chromium
third_party/libwebp/src/enc/backward_references_cost_enc.c
static WEBP_INLINE void UpdateCostAtIndex(CostManager *const manager, int i, int do_clean_intervals) { CostInterval *current = manager->head_; while (current != NULL && current->start_ <= i) { CostInterval *const next = current->next_; if (current->end_ <= i) { ...
[ 1, 0 ]
Chromium
third_party/libwebp/src/enc/backward_references_cost_enc.c
static void TraceBackwards(uint16_t *const dist_array, int dist_array_size, uint16_t **const chosen_path, int *const chosen_path_size) { uint16_t *path = dist_array + dist_array_size; uint16_t *cur = dist_array + dist_array_size - 1; while (cur >= dist_array) ...
[ 1, 0 ]
Chromium
third_party/libwebp/src/enc/backward_references_cost_enc.c
static int BackwardReferencesHashChainFollowChosenPath( const uint32_t *const argb, int cache_bits, const uint16_t *const chosen_path, int chosen_path_size, const VP8LHashChain *const hash_chain, VP8LBackwardRefs *const refs) { const int use_color_cache = (cache_bits > 0); int ix; int i = 0; int ok ...
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/backward_references_cost_enc.c
int VP8LBackwardReferencesTraceBackwards(int xsize, int ysize, const uint32_t *const argb, int cache_bits, const VP8LHashChain *const hash_chain, const VP8L...
[ 1, 0 ]
Chromium
third_party/libwebp/src/enc/backward_references_enc.c
int VP8LDistanceToPlaneCode(int xsize, int dist) { const int yoffset = dist / xsize; const int xoffset = dist - yoffset * xsize; if (xoffset <= 8 && yoffset < 8) { return plane_to_code_lut[yoffset * 16 + 8 - xoffset] + 1; } else if (xoffset > xsize - 8 && yoffset < 7) { return plane_to_code_lut[(yoffset...
[ 1, 0 ]
Chromium
third_party/libwebp/src/enc/backward_references_enc.c
VP8LRefsCursor VP8LRefsCursorInit(const VP8LBackwardRefs *const refs) { VP8LRefsCursor c; c.cur_block_ = refs->refs_; if (refs->refs_ != NULL) { c.cur_pos = c.cur_block_->start_; c.last_pos_ = c.cur_pos + c.cur_block_->size_; } else { c.cur_pos = NULL; c.last_pos_ = NULL; } return c; }
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/backward_references_enc.c
int VP8LHashChainInit(VP8LHashChain *const p, int size) { assert(p->size_ == 0); assert(p->offset_length_ == NULL); assert(size > 0); p->offset_length_ = (uint32_t *)WebPSafeMalloc(size, sizeof(*p->offset_length_)); if (p->offset_length_ == NULL) return 0; p->size_ = size; return 1; }
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/backward_references_enc.c
static int BackwardReferencesRle(int xsize, int ysize, const uint32_t *const argb, int cache_bits, VP8LBackwardRefs *const refs) { const int pix_count = xsize * ysize; int i, k; const int use_color_cache = (cache_bits > 0); VP8LColorCache hashers...
[ 1, 0 ]
Chromium
third_party/libwebp/src/enc/backward_references_enc.c
WebPEncodingError VP8LGetBackwardReferences( int width, int height, const uint32_t *const argb, int quality, int low_effort, int lz77_types_to_try, int cache_bits_max, int do_no_cache, const VP8LHashChain *const hash_chain, VP8LBackwardRefs *const refs, int *const cache_bits_best) { if (low_effort) { ...
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/config_enc.c
int WebPConfigLosslessPreset(WebPConfig *config, int level) { if (config == NULL || level < 0 || level > MAX_LEVEL) return 0; config->lossless = 1; config->method = kLosslessPresets[level].method_; config->quality = kLosslessPresets[level].quality_; return 1; }
[ 1, 0 ]
Chromium
third_party/libwebp/src/enc/cost_enc.c
static int VariableLevelCost(int level, const uint8_t probas[NUM_PROBAS]) { int pattern = VP8LevelCodes[level - 1][0]; int bits = VP8LevelCodes[level - 1][1]; int cost = 0; int i; for (i = 2; pattern; ++i) { if (pattern & 1) { cost += VP8BitCost(bits & 1, probas[i]); } bits >>= 1; patte...
[ 1, 0 ]
Chromium
third_party/libwebp/src/enc/cost_enc.c
void VP8InitResidual(int first, int coeff_type, VP8Encoder *const enc, VP8Residual *const res) { res->coeff_type = coeff_type; res->prob = enc->proba_.coeffs_[coeff_type]; res->stats = enc->proba_.stats_[coeff_type]; res->costs = enc->proba_.remapped_costs_[coeff_type]; res->first = first...
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/cost_enc.c
int VP8GetCostLuma16(VP8EncIterator *const it, const VP8ModeScore *const rd) { VP8Residual res; VP8Encoder *const enc = it->enc_; int x, y; int R = 0; VP8IteratorNzToBytes(it); // DC VP8InitResidual(0, 1, enc, &res); VP8SetResidualCoeffs(rd->y_dc_levels, &res); R += VP8GetResidualCost(it->top_nz_[8]...
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/filter_enc.c
static int GetILevel(int sharpness, int level) { if (sharpness > 0) { if (sharpness > 4) { level >>= 2; } else { level >>= 1; } if (level > 9 - sharpness) { level = 9 - sharpness; } } if (level < 1) level = 1; return level; }
[ 1, 0 ]
Chromium
third_party/libwebp/src/enc/filter_enc.c
static void DoFilter(const VP8EncIterator *const it, int level) { const VP8Encoder *const enc = it->enc_; const int ilevel = GetILevel(enc->config_->filter_sharpness, level); const int limit = 2 * level + ilevel; uint8_t *const y_dst = it->yuv_out2_ + Y_OFF_ENC; uint8_t *const u_dst = it->yuv_out2_ + U_OFF_E...
[ 1, 0 ]
Chromium
third_party/libwebp/src/enc/frame_enc.c
static float Clamp(float v, float min, float max) { return (v < min) ? min : (v > max) ? max : v; }
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/frame_enc.c
static void ResetStats(VP8Encoder *const enc) { VP8EncProba *const proba = &enc->proba_; VP8CalculateLevelCosts(proba); proba->nb_skip_ = 0; } // Skip decision probability
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/frame_enc.c
static void SetSegmentProbas(VP8Encoder *const enc) { int p[NUM_MB_SEGMENTS] = {0}; int n; for (n = 0; n < enc->mb_w_ * enc->mb_h_; ++n) { const VP8MBInfo *const mb = &enc->mb_info_[n]; ++p[mb->segment_]; } #if !defined(WEBP_DISABLE_STATS) if (enc->pic_->stats != NULL) { for (n = 0; n < NUM_MB_S...
[ 1, 0 ]
Chromium
third_party/libwebp/src/enc/frame_enc.c
static void StoreSSE(const VP8EncIterator *const it) { VP8Encoder *const enc = it->enc_; const uint8_t *const in = it->yuv_in_; const uint8_t *const out = it->yuv_out_; enc->sse_[0] += VP8SSE16x16(in + Y_OFF_ENC, out + Y_OFF_ENC); enc->sse_[1] += VP8SSE8x8(in + U_OFF_ENC, out + U_OFF_ENC); enc->sse_[2] += ...
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/frame_enc.c
static int PostLoopFinalize(VP8EncIterator *const it, int ok) { VP8Encoder *const enc = it->enc_; if (ok) { int p; for (p = 0; p < enc->num_parts_; ++p) { VP8BitWriterFinish(enc->parts_ + p); ok &= !enc->parts_[p].error_; } } if (ok) { // All good. Finish up. #if !defined(WEBP_DISABLE_S...
[ 1, 0 ]
Chromium
third_party/libwebp/src/enc/frame_enc.c
int VP8EncTokenLoop(VP8Encoder *const enc) { (void)enc; return 0; } #endif // DISABLE_TOKEN_BUFFER
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/histogram_enc.c
static void HistogramCopy(const VP8LHistogram *const src, VP8LHistogram *const dst) { uint32_t *const dst_literal = dst->literal_; const int dst_cache_bits = dst->palette_code_bits_; const int literal_size = VP8LHistogramNumCodes(dst_cache_bits); const int histo_size = VP8LGetHistogra...
[ 1, 0 ]
Chromium
third_party/libwebp/src/enc/histogram_enc.c
void VP8LFreeHistogram(VP8LHistogram *const histo) { WebPSafeFree(histo); }
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/histogram_enc.c
void VP8LHistogramStoreRefs(const VP8LBackwardRefs *const refs, VP8LHistogram *const histo) { VP8LRefsCursor c = VP8LRefsCursorInit(refs); while (VP8LRefsCursorOk(&c)) { VP8LHistogramAddSinglePixOrCopy(histo, c.cur_pos, NULL, 0); VP8LRefsCursorNext(&c); } }
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/histogram_enc.c
void VP8LHistogramCreate(VP8LHistogram *const p, const VP8LBackwardRefs *const refs, int palette_code_bits) { if (palette_code_bits >= 0) { p->palette_code_bits_ = palette_code_bits; } HistogramClear(p); VP8LHistogramStoreRefs(refs, p); }
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/histogram_enc.c
VP8LHistogram *VP8LAllocateHistogram(int cache_bits) { VP8LHistogram *histo = NULL; const int total_size = VP8LGetHistogramSize(cache_bits); uint8_t *const memory = (uint8_t *)WebPSafeMalloc(total_size, sizeof(*memory)); if (memory == NULL) return NULL; histo = (VP8LHistogram *)memory; histo->lit...
[ 0, 0 ]
Chromium
third_party/libwebp/src/enc/histogram_enc.c
static void HistogramSetResetPointers(VP8LHistogramSet *const set, int cache_bits) { int i; const int histo_size = VP8LGetHistogramSize(cache_bits); uint8_t *memory = (uint8_t *)(set->histograms); memory += set->max_size * sizeof(*set->histograms); for (i = 0; i < set->ma...
[ 1, 0 ]
Chromium
third_party/libwebp/src/enc/histogram_enc.c
static void HistogramSetRemoveHistogram(VP8LHistogramSet *const set, int i, int *const num_used) { assert(set->histograms[i] != NULL); set->histograms[i] = NULL; --*num_used; if (i == set->size - 1) { while (set->size >= 1 && set->histograms[set->size - 1] == NULL) {...
[ 1, 0 ]
Chromium
third_party/libwebp/src/enc/histogram_enc.c
double VP8LBitsEntropy(const uint32_t *const array, int n) { VP8LBitEntropy entropy; VP8LBitsEntropyUnrefined(array, n, &entropy); return BitsEntropyRefine(&entropy); }
[ 0, 0 ]