Lines Matching refs:wrk
22 void (*WebPRescalerImportRow)(WebPRescaler* const wrk,
24 void (*WebPRescalerExportRow)(WebPRescaler* const wrk, int x_out) = NULL;
29 static void ImportRowC(WebPRescaler* const wrk, in ImportRowC() argument
31 const int x_stride = wrk->num_channels; in ImportRowC()
32 const int x_out_max = wrk->dst_width * wrk->num_channels; in ImportRowC()
36 if (!wrk->x_expand) { in ImportRowC()
39 accum += wrk->x_add; in ImportRowC()
40 for (; accum > 0; accum -= wrk->x_sub) { in ImportRowC()
48 wrk->frow[x_out] = (sum + base) * wrk->x_sub - frac; in ImportRowC()
50 sum = (int)MULT_FIX(frac, wrk->fx_scale); in ImportRowC()
60 accum += wrk->x_add; in ImportRowC()
62 wrk->frow[x_out] = right * wrk->x_add + (left - right) * accum; in ImportRowC()
63 accum -= wrk->x_sub; in ImportRowC()
68 wrk->irow[x_out] += wrk->frow[x_out]; in ImportRowC()
72 static void ExportRowC(WebPRescaler* const wrk, int x_out) { in ExportRowC() argument
73 if (wrk->y_accum <= 0) { in ExportRowC()
74 uint8_t* const dst = wrk->dst; in ExportRowC()
75 int32_t* const irow = wrk->irow; in ExportRowC()
76 const int32_t* const frow = wrk->frow; in ExportRowC()
77 const int yscale = wrk->fy_scale * (-wrk->y_accum); in ExportRowC()
78 const int x_out_max = wrk->dst_width * wrk->num_channels; in ExportRowC()
81 const int v = (int)MULT_FIX(irow[x_out] - frac, wrk->fxy_scale); in ExportRowC()
85 wrk->y_accum += wrk->y_add; in ExportRowC()
86 wrk->dst += wrk->dst_stride; in ExportRowC()
95 static void ImportRowMIPS(WebPRescaler* const wrk, in ImportRowMIPS() argument
97 const int x_stride = wrk->num_channels; in ImportRowMIPS()
98 const int x_out_max = wrk->dst_width * wrk->num_channels; in ImportRowMIPS()
99 const int fx_scale = wrk->fx_scale; in ImportRowMIPS()
100 const int x_add = wrk->x_add; in ImportRowMIPS()
101 const int x_sub = wrk->x_sub; in ImportRowMIPS()
102 int* frow = wrk->frow + channel; in ImportRowMIPS()
103 int* irow = wrk->irow + channel; in ImportRowMIPS()
111 if (!wrk->x_expand) { in ImportRowMIPS()
192 static void ExportRowMIPS(WebPRescaler* const wrk, int x_out) { in ExportRowMIPS() argument
193 if (wrk->y_accum <= 0) { in ExportRowMIPS()
194 uint8_t* const dst = wrk->dst; in ExportRowMIPS()
195 int32_t* const irow = wrk->irow; in ExportRowMIPS()
196 const int32_t* const frow = wrk->frow; in ExportRowMIPS()
197 const int yscale = wrk->fy_scale * (-wrk->y_accum); in ExportRowMIPS()
198 const int x_out_max = wrk->dst_width * wrk->num_channels; in ExportRowMIPS()
201 if ((wrk->fxy_scale >> 32) == 0) { in ExportRowMIPS()
203 const int temp2 = (int)(wrk->fxy_scale); in ExportRowMIPS()
247 wrk->y_accum += wrk->y_add; in ExportRowMIPS()
248 wrk->dst += wrk->dst_stride; in ExportRowMIPS()
250 ExportRowC(wrk, x_out); in ExportRowMIPS()
258 void WebPRescalerInit(WebPRescaler* const wrk, int src_width, int src_height, in WebPRescalerInit() argument
262 wrk->x_expand = (src_width < dst_width); in WebPRescalerInit()
263 wrk->src_width = src_width; in WebPRescalerInit()
264 wrk->src_height = src_height; in WebPRescalerInit()
265 wrk->dst_width = dst_width; in WebPRescalerInit()
266 wrk->dst_height = dst_height; in WebPRescalerInit()
267 wrk->dst = dst; in WebPRescalerInit()
268 wrk->dst_stride = dst_stride; in WebPRescalerInit()
269 wrk->num_channels = num_channels; in WebPRescalerInit()
271 wrk->x_add = wrk->x_expand ? (x_sub - 1) : x_add - x_sub; in WebPRescalerInit()
272 wrk->x_sub = wrk->x_expand ? (x_add - 1) : x_sub; in WebPRescalerInit()
273 wrk->y_accum = y_add; in WebPRescalerInit()
274 wrk->y_add = y_add; in WebPRescalerInit()
275 wrk->y_sub = y_sub; in WebPRescalerInit()
276 wrk->fx_scale = (1 << RFIX) / x_sub; in WebPRescalerInit()
277 wrk->fy_scale = (1 << RFIX) / y_sub; in WebPRescalerInit()
278 wrk->fxy_scale = wrk->x_expand ? in WebPRescalerInit()
281 wrk->irow = work; in WebPRescalerInit()
282 wrk->frow = work + num_channels * dst_width; in WebPRescalerInit()
304 int WebPRescaleNeededLines(const WebPRescaler* const wrk, int max_num_lines) { in WebPRescaleNeededLines() argument
305 const int num_lines = (wrk->y_accum + wrk->y_sub - 1) / wrk->y_sub; in WebPRescaleNeededLines()
309 int WebPRescalerImport(WebPRescaler* const wrk, int num_lines, in WebPRescalerImport() argument
312 while (total_imported < num_lines && wrk->y_accum > 0) { in WebPRescalerImport()
314 for (channel = 0; channel < wrk->num_channels; ++channel) { in WebPRescalerImport()
315 WebPRescalerImportRow(wrk, src, channel); in WebPRescalerImport()
319 wrk->y_accum -= wrk->y_sub; in WebPRescalerImport()