Lines Matching defs:wrk
28 void WebPRescalerImportRowExpandC(WebPRescaler* const wrk, const uint8_t* src) {
29 const int x_stride = wrk->num_channels;
30 const int x_out_max = wrk->dst_width * wrk->num_channels;
32 assert(!WebPRescalerInputDone(wrk));
33 assert(wrk->x_expand);
38 int accum = wrk->x_add;
40 int right = (wrk->src_width > 1) ? src[x_in + x_stride] : left;
43 wrk->frow[x_out] = right * wrk->x_add + (left - right) * accum;
46 accum -= wrk->x_sub;
50 assert(x_in < wrk->src_width * x_stride);
52 accum += wrk->x_add;
55 assert(wrk->x_sub == 0 /* <- special case for src_width=1 */ || accum == 0);
59 void WebPRescalerImportRowShrinkC(WebPRescaler* const wrk, const uint8_t* src) {
60 const int x_stride = wrk->num_channels;
61 const int x_out_max = wrk->dst_width * wrk->num_channels;
63 assert(!WebPRescalerInputDone(wrk));
64 assert(!wrk->x_expand);
72 accum += wrk->x_add;
74 accum -= wrk->x_sub;
75 assert(x_in < wrk->src_width * x_stride);
82 wrk->frow[x_out] = sum * wrk->x_sub - frac;
84 sum = (int)MULT_FIX(frac, wrk->fx_scale);
95 void WebPRescalerExportRowExpandC(WebPRescaler* const wrk) {
97 uint8_t* const dst = wrk->dst;
98 rescaler_t* const irow = wrk->irow;
99 const int x_out_max = wrk->dst_width * wrk->num_channels;
100 const rescaler_t* const frow = wrk->frow;
101 assert(!WebPRescalerOutputDone(wrk));
102 assert(wrk->y_accum <= 0);
103 assert(wrk->y_expand);
104 assert(wrk->y_sub != 0);
105 if (wrk->y_accum == 0) {
108 const int v = (int)MULT_FIX(J, wrk->fy_scale);
113 const uint32_t B = WEBP_RESCALER_FRAC(-wrk->y_accum, wrk->y_sub);
119 const int v = (int)MULT_FIX(J, wrk->fy_scale);
126 void WebPRescalerExportRowShrinkC(WebPRescaler* const wrk) {
128 uint8_t* const dst = wrk->dst;
129 rescaler_t* const irow = wrk->irow;
130 const int x_out_max = wrk->dst_width * wrk->num_channels;
131 const rescaler_t* const frow = wrk->frow;
132 const uint32_t yscale = wrk->fy_scale * (-wrk->y_accum);
133 assert(!WebPRescalerOutputDone(wrk));
134 assert(wrk->y_accum <= 0);
135 assert(!wrk->y_expand);
139 const int v = (int)MULT_FIX(irow[x_out] - frac, wrk->fxy_scale);
146 const int v = (int)MULT_FIX(irow[x_out], wrk->fxy_scale);
160 void WebPRescalerImportRow(WebPRescaler* const wrk, const uint8_t* src) {
161 assert(!WebPRescalerInputDone(wrk));
162 if (!wrk->x_expand) {
163 WebPRescalerImportRowShrink(wrk, src);
165 WebPRescalerImportRowExpand(wrk, src);
169 void WebPRescalerExportRow(WebPRescaler* const wrk) {
170 if (wrk->y_accum <= 0) {
171 assert(!WebPRescalerOutputDone(wrk));
172 if (wrk->y_expand) {
173 WebPRescalerExportRowExpand(wrk);
174 } else if (wrk->fxy_scale) {
175 WebPRescalerExportRowShrink(wrk);
178 assert(wrk->src_width == 1 && wrk->dst_width <= 2);
179 assert(wrk->src_height == 1 && wrk->dst_height == 1);
180 for (i = 0; i < wrk->num_channels * wrk->dst_width; ++i) {
181 wrk->dst[i] = wrk->irow[i];
182 wrk->irow[i] = 0;
185 wrk->y_accum += wrk->y_add;
186 wrk->dst += wrk->dst_stride;
187 ++wrk->dst_y;