mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-18 14:59:48 +02:00
Rescale: let ImportRow / ExportRow be pointer-to-function
Separate the C version from the MIPS32 version and have run-time initialization during RescalerInit() Change-Id: I93cfa5691c073a099fe62eda1333ad2bb749915b
This commit is contained in:
10
src/dec/io.c
10
src/dec/io.c
@ -370,9 +370,9 @@ static int ExportRGB(WebPDecParams* const p, int y_pos) {
|
||||
WebPRescalerHasPendingOutput(&p->scaler_u)) {
|
||||
assert(p->last_y + y_pos + num_lines_out < p->output->height);
|
||||
assert(p->scaler_u.y_accum == p->scaler_v.y_accum);
|
||||
WebPRescalerExportRow(&p->scaler_y);
|
||||
WebPRescalerExportRow(&p->scaler_u);
|
||||
WebPRescalerExportRow(&p->scaler_v);
|
||||
WebPRescalerExportRow(&p->scaler_y, 0);
|
||||
WebPRescalerExportRow(&p->scaler_u, 0);
|
||||
WebPRescalerExportRow(&p->scaler_v, 0);
|
||||
convert(p->scaler_y.dst, p->scaler_u.dst, p->scaler_v.dst,
|
||||
dst, p->scaler_y.dst_width);
|
||||
dst += buf->stride;
|
||||
@ -420,7 +420,7 @@ static int ExportAlpha(WebPDecParams* const p, int y_pos) {
|
||||
while (WebPRescalerHasPendingOutput(&p->scaler_a)) {
|
||||
int i;
|
||||
assert(p->last_y + y_pos + num_lines_out < p->output->height);
|
||||
WebPRescalerExportRow(&p->scaler_a);
|
||||
WebPRescalerExportRow(&p->scaler_a, 0);
|
||||
for (i = 0; i < width; ++i) {
|
||||
const uint32_t alpha_value = p->scaler_a.dst[i];
|
||||
dst[4 * i] = alpha_value;
|
||||
@ -453,7 +453,7 @@ static int ExportAlphaRGBA4444(WebPDecParams* const p, int y_pos) {
|
||||
while (WebPRescalerHasPendingOutput(&p->scaler_a)) {
|
||||
int i;
|
||||
assert(p->last_y + y_pos + num_lines_out < p->output->height);
|
||||
WebPRescalerExportRow(&p->scaler_a);
|
||||
WebPRescalerExportRow(&p->scaler_a, 0);
|
||||
for (i = 0; i < width; ++i) {
|
||||
// Fill in the alpha value (converted to 4 bits).
|
||||
const uint32_t alpha_value = p->scaler_a.dst[i] >> 4;
|
||||
|
@ -420,7 +420,7 @@ static int Export(WebPRescaler* const rescaler, WEBP_CSP_MODE colorspace,
|
||||
int num_lines_out = 0;
|
||||
while (WebPRescalerHasPendingOutput(rescaler)) {
|
||||
uint8_t* const dst = rgba + num_lines_out * rgba_stride;
|
||||
WebPRescalerExportRow(rescaler);
|
||||
WebPRescalerExportRow(rescaler, 0);
|
||||
WebPMultARGBRow(src, dst_width, 1);
|
||||
VP8LConvertFromBGRA(src, dst_width, colorspace, dst);
|
||||
++num_lines_out;
|
||||
@ -537,7 +537,7 @@ static int ExportYUVA(const VP8LDecoder* const dec, int y_pos) {
|
||||
const int dst_width = rescaler->dst_width;
|
||||
int num_lines_out = 0;
|
||||
while (WebPRescalerHasPendingOutput(rescaler)) {
|
||||
WebPRescalerExportRow(rescaler);
|
||||
WebPRescalerExportRow(rescaler, 0);
|
||||
WebPMultARGBRow(src, dst_width, 1);
|
||||
ConvertToYUVA(src, dst_width, y_pos, dec->output_);
|
||||
++y_pos;
|
||||
|
Reference in New Issue
Block a user