mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-17 14:29:48 +02:00
Refactor CopyPlane() and CopyPixels() methods: put them in utils.
Change-Id: I0e1533df557a0fa42c670e3b826fc0675c36e0a5
This commit is contained in:
@ -82,7 +82,6 @@ static int EncodeLossless(const uint8_t* const data, int width, int height,
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@ -166,16 +165,6 @@ static int EncodeAlphaInternal(const uint8_t* const data, int width, int height,
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// TODO(skal): move to dsp/ ?
|
||||
static void CopyPlane(const uint8_t* src, int src_stride,
|
||||
uint8_t* dst, int dst_stride, int width, int height) {
|
||||
while (height-- > 0) {
|
||||
memcpy(dst, src, width);
|
||||
src += src_stride;
|
||||
dst += dst_stride;
|
||||
}
|
||||
}
|
||||
|
||||
static int GetNumColors(const uint8_t* data, int width, int height,
|
||||
int stride) {
|
||||
int j;
|
||||
@ -326,7 +315,7 @@ static int EncodeAlpha(VP8Encoder* const enc,
|
||||
}
|
||||
|
||||
// Extract alpha data (width x height) from raw_data (stride x height).
|
||||
CopyPlane(pic->a, pic->a_stride, quant_alpha, width, width, height);
|
||||
WebPCopyPlane(pic->a, pic->a_stride, quant_alpha, width, width, height);
|
||||
|
||||
if (reduce_levels) { // No Quantization required for 'quality = 100'.
|
||||
// 16 alpha levels gives quite a low MSE w.r.t original alpha plane hence
|
||||
|
Reference in New Issue
Block a user