Lines Matching refs:wrk
25 void WebPRescalerInit(WebPRescaler* const wrk, int src_width, int src_height, in WebPRescalerInit() argument
29 wrk->x_expand = (src_width < dst_width); in WebPRescalerInit()
30 wrk->src_width = src_width; in WebPRescalerInit()
31 wrk->src_height = src_height; in WebPRescalerInit()
32 wrk->dst_width = dst_width; in WebPRescalerInit()
33 wrk->dst_height = dst_height; in WebPRescalerInit()
34 wrk->dst = dst; in WebPRescalerInit()
35 wrk->dst_stride = dst_stride; in WebPRescalerInit()
36 wrk->num_channels = num_channels; in WebPRescalerInit()
38 wrk->x_add = wrk->x_expand ? (x_sub - 1) : x_add - x_sub; in WebPRescalerInit()
39 wrk->x_sub = wrk->x_expand ? (x_add - 1) : x_sub; in WebPRescalerInit()
40 wrk->y_accum = y_add; in WebPRescalerInit()
41 wrk->y_add = y_add; in WebPRescalerInit()
42 wrk->y_sub = y_sub; in WebPRescalerInit()
43 wrk->fx_scale = (1 << RFIX) / x_sub; in WebPRescalerInit()
44 wrk->fy_scale = (1 << RFIX) / y_sub; in WebPRescalerInit()
45 wrk->fxy_scale = wrk->x_expand ? in WebPRescalerInit()
48 wrk->irow = work; in WebPRescalerInit()
49 wrk->frow = work + num_channels * dst_width; in WebPRescalerInit()
52 void WebPRescalerImportRow(WebPRescaler* const wrk, in WebPRescalerImportRow() argument
54 const int x_stride = wrk->num_channels; in WebPRescalerImportRow()
55 const int x_out_max = wrk->dst_width * wrk->num_channels; in WebPRescalerImportRow()
59 if (!wrk->x_expand) { in WebPRescalerImportRow()
62 accum += wrk->x_add; in WebPRescalerImportRow()
63 for (; accum > 0; accum -= wrk->x_sub) { in WebPRescalerImportRow()
71 wrk->frow[x_out] = (sum + base) * wrk->x_sub - frac; in WebPRescalerImportRow()
73 sum = (int)MULT_FIX(frac, wrk->fx_scale); in WebPRescalerImportRow()
83 accum += wrk->x_add; in WebPRescalerImportRow()
85 wrk->frow[x_out] = right * wrk->x_add + (left - right) * accum; in WebPRescalerImportRow()
86 accum -= wrk->x_sub; in WebPRescalerImportRow()
91 wrk->irow[x_out] += wrk->frow[x_out]; in WebPRescalerImportRow()
95 uint8_t* WebPRescalerExportRow(WebPRescaler* const wrk) { in WebPRescalerExportRow() argument
96 if (wrk->y_accum <= 0) { in WebPRescalerExportRow()
98 uint8_t* const dst = wrk->dst; in WebPRescalerExportRow()
99 int32_t* const irow = wrk->irow; in WebPRescalerExportRow()
100 const int32_t* const frow = wrk->frow; in WebPRescalerExportRow()
101 const int yscale = wrk->fy_scale * (-wrk->y_accum); in WebPRescalerExportRow()
102 const int x_out_max = wrk->dst_width * wrk->num_channels; in WebPRescalerExportRow()
106 const int v = (int)MULT_FIX(irow[x_out] - frac, wrk->fxy_scale); in WebPRescalerExportRow()
110 wrk->y_accum += wrk->y_add; in WebPRescalerExportRow()
111 wrk->dst += wrk->dst_stride; in WebPRescalerExportRow()
124 int WebPRescalerImport(WebPRescaler* const wrk, int num_lines, in WebPRescalerImport() argument
127 while (total_imported < num_lines && wrk->y_accum > 0) { in WebPRescalerImport()
129 for (channel = 0; channel < wrk->num_channels; ++channel) { in WebPRescalerImport()
130 WebPRescalerImportRow(wrk, src, channel); in WebPRescalerImport()
134 wrk->y_accum -= wrk->y_sub; in WebPRescalerImport()