• Home
  • Raw
  • Download

Lines Matching refs:io

25 static int EmitYUV(const VP8Io* const io, WebPDecParams* const p) {  in EmitYUV()  argument
28 uint8_t* const y_dst = buf->y + io->mb_y * buf->y_stride; in EmitYUV()
29 uint8_t* const u_dst = buf->u + (io->mb_y >> 1) * buf->u_stride; in EmitYUV()
30 uint8_t* const v_dst = buf->v + (io->mb_y >> 1) * buf->v_stride; in EmitYUV()
31 const int mb_w = io->mb_w; in EmitYUV()
32 const int mb_h = io->mb_h; in EmitYUV()
37 memcpy(y_dst + j * buf->y_stride, io->y + j * io->y_stride, mb_w); in EmitYUV()
40 memcpy(u_dst + j * buf->u_stride, io->u + j * io->uv_stride, uv_w); in EmitYUV()
41 memcpy(v_dst + j * buf->v_stride, io->v + j * io->uv_stride, uv_w); in EmitYUV()
43 return io->mb_h; in EmitYUV()
47 static int EmitSampledRGB(const VP8Io* const io, WebPDecParams* const p) { in EmitSampledRGB() argument
50 uint8_t* const dst = buf->rgba + io->mb_y * buf->stride; in EmitSampledRGB()
51 WebPSamplerProcessPlane(io->y, io->y_stride, in EmitSampledRGB()
52 io->u, io->v, io->uv_stride, in EmitSampledRGB()
53 dst, buf->stride, io->mb_w, io->mb_h, in EmitSampledRGB()
55 return io->mb_h; in EmitSampledRGB()
62 static int EmitFancyRGB(const VP8Io* const io, WebPDecParams* const p) { in EmitFancyRGB() argument
63 int num_lines_out = io->mb_h; // a priori guess in EmitFancyRGB()
65 uint8_t* dst = buf->rgba + io->mb_y * buf->stride; in EmitFancyRGB()
67 const uint8_t* cur_y = io->y; in EmitFancyRGB()
68 const uint8_t* cur_u = io->u; in EmitFancyRGB()
69 const uint8_t* cur_v = io->v; in EmitFancyRGB()
72 int y = io->mb_y; in EmitFancyRGB()
73 const int y_end = io->mb_y + io->mb_h; in EmitFancyRGB()
74 const int mb_w = io->mb_w; in EmitFancyRGB()
90 cur_u += io->uv_stride; in EmitFancyRGB()
91 cur_v += io->uv_stride; in EmitFancyRGB()
93 cur_y += 2 * io->y_stride; in EmitFancyRGB()
94 upsample(cur_y - io->y_stride, cur_y, in EmitFancyRGB()
99 cur_y += io->y_stride; in EmitFancyRGB()
100 if (io->crop_top + y_end < io->crop_bottom) { in EmitFancyRGB()
130 static int EmitAlphaYUV(const VP8Io* const io, WebPDecParams* const p, in EmitAlphaYUV() argument
132 const uint8_t* alpha = io->a; in EmitAlphaYUV()
134 const int mb_w = io->mb_w; in EmitAlphaYUV()
135 const int mb_h = io->mb_h; in EmitAlphaYUV()
136 uint8_t* dst = buf->a + io->mb_y * buf->a_stride; in EmitAlphaYUV()
143 alpha += io->width; in EmitAlphaYUV()
153 static int GetAlphaSourceRow(const VP8Io* const io, in GetAlphaSourceRow() argument
155 int start_y = io->mb_y; in GetAlphaSourceRow()
156 *num_rows = io->mb_h; in GetAlphaSourceRow()
160 if (io->fancy_upsampling) { in GetAlphaSourceRow()
169 *alpha -= io->width; in GetAlphaSourceRow()
171 if (io->crop_top + io->mb_y + io->mb_h == io->crop_bottom) { in GetAlphaSourceRow()
173 *num_rows = io->crop_bottom - io->crop_top - start_y; in GetAlphaSourceRow()
179 static int EmitAlphaRGB(const VP8Io* const io, WebPDecParams* const p, in EmitAlphaRGB() argument
181 const uint8_t* alpha = io->a; in EmitAlphaRGB()
183 const int mb_w = io->mb_w; in EmitAlphaRGB()
189 const int start_y = GetAlphaSourceRow(io, &alpha, &num_rows); in EmitAlphaRGB()
192 const int has_alpha = WebPDispatchAlpha(alpha, io->width, mb_w, in EmitAlphaRGB()
205 static int EmitAlphaRGBA4444(const VP8Io* const io, WebPDecParams* const p, in EmitAlphaRGBA4444() argument
207 const uint8_t* alpha = io->a; in EmitAlphaRGBA4444()
209 const int mb_w = io->mb_w; in EmitAlphaRGBA4444()
213 const int start_y = GetAlphaSourceRow(io, &alpha, &num_rows); in EmitAlphaRGBA4444()
229 alpha += io->width; in EmitAlphaRGBA4444()
257 static int EmitRescaledYUV(const VP8Io* const io, WebPDecParams* const p) { in EmitRescaledYUV() argument
258 const int mb_h = io->mb_h; in EmitRescaledYUV()
262 if (WebPIsAlphaMode(p->output->colorspace) && io->a != NULL) { in EmitRescaledYUV()
267 WebPMultRows((uint8_t*)io->y, io->y_stride, in EmitRescaledYUV()
268 io->a, io->width, io->mb_w, mb_h, 0); in EmitRescaledYUV()
270 num_lines_out = Rescale(io->y, io->y_stride, mb_h, scaler); in EmitRescaledYUV()
271 Rescale(io->u, io->uv_stride, uv_mb_h, p->scaler_u); in EmitRescaledYUV()
272 Rescale(io->v, io->uv_stride, uv_mb_h, p->scaler_v); in EmitRescaledYUV()
276 static int EmitRescaledAlphaYUV(const VP8Io* const io, WebPDecParams* const p, in EmitRescaledAlphaYUV() argument
280 if (io->a != NULL) { in EmitRescaledAlphaYUV()
282 const int num_lines_out = Rescale(io->a, io->width, io->mb_h, p->scaler_a); in EmitRescaledAlphaYUV()
290 assert(p->last_y + expected_num_lines_out <= io->scaled_height); in EmitRescaledAlphaYUV()
291 FillAlphaPlane(dst_a, io->scaled_width, expected_num_lines_out, in EmitRescaledAlphaYUV()
297 static int InitYUVRescaler(const VP8Io* const io, WebPDecParams* const p) { in InitYUVRescaler() argument
300 const int out_width = io->scaled_width; in InitYUVRescaler()
301 const int out_height = io->scaled_height; in InitYUVRescaler()
304 const int uv_in_width = (io->mb_w + 1) >> 1; in InitYUVRescaler()
305 const int uv_in_height = (io->mb_h + 1) >> 1; in InitYUVRescaler()
331 WebPRescalerInit(p->scaler_y, io->mb_w, io->mb_h, in InitYUVRescaler()
343 WebPRescalerInit(p->scaler_a, io->mb_w, io->mb_h, in InitYUVRescaler()
378 static int EmitRescaledRGB(const VP8Io* const io, WebPDecParams* const p) { in EmitRescaledRGB() argument
379 const int mb_h = io->mb_h; in EmitRescaledRGB()
386 io->y + j * io->y_stride, io->y_stride); in EmitRescaledRGB()
391 io->u + uv_j * io->uv_stride, io->uv_stride); in EmitRescaledRGB()
394 io->v + uv_j * io->uv_stride, io->uv_stride); in EmitRescaledRGB()
466 static int EmitRescaledAlphaRGB(const VP8Io* const io, WebPDecParams* const p, in EmitRescaledAlphaRGB() argument
468 if (io->a != NULL) { in EmitRescaledAlphaRGB()
473 const int row_offset = scaler->src_y - io->mb_y; in EmitRescaledAlphaRGB()
474 WebPRescalerImport(scaler, io->mb_h + io->mb_y - scaler->src_y, in EmitRescaledAlphaRGB()
475 io->a + row_offset * io->width, io->width); in EmitRescaledAlphaRGB()
482 static int InitRGBRescaler(const VP8Io* const io, WebPDecParams* const p) { in InitRGBRescaler() argument
484 const int out_width = io->scaled_width; in InitRGBRescaler()
485 const int out_height = io->scaled_height; in InitRGBRescaler()
486 const int uv_in_width = (io->mb_w + 1) >> 1; in InitRGBRescaler()
487 const int uv_in_height = (io->mb_h + 1) >> 1; in InitRGBRescaler()
517 WebPRescalerInit(p->scaler_y, io->mb_w, io->mb_h, in InitRGBRescaler()
530 WebPRescalerInit(p->scaler_a, io->mb_w, io->mb_h, in InitRGBRescaler()
550 static int CustomSetup(VP8Io* io) { in CustomSetup() argument
551 WebPDecParams* const p = (WebPDecParams*)io->opaque; in CustomSetup()
560 if (!WebPIoInitFromOptions(p->options, io, is_alpha ? MODE_YUV : MODE_YUVA)) { in CustomSetup()
566 if (io->use_scaling) { in CustomSetup()
568 const int ok = is_rgb ? InitRGBRescaler(io, p) : InitYUVRescaler(io, p); in CustomSetup()
579 if (io->fancy_upsampling) { in CustomSetup()
581 const int uv_width = (io->mb_w + 1) >> 1; in CustomSetup()
582 p->memory = WebPSafeMalloc(1ULL, (size_t)(io->mb_w + 2 * uv_width)); in CustomSetup()
587 p->tmp_u = p->tmp_y + io->mb_w; in CustomSetup()
613 static int CustomPut(const VP8Io* io) { in CustomPut() argument
614 WebPDecParams* const p = (WebPDecParams*)io->opaque; in CustomPut()
615 const int mb_w = io->mb_w; in CustomPut()
616 const int mb_h = io->mb_h; in CustomPut()
618 assert(!(io->mb_y & 1)); in CustomPut()
623 num_lines_out = p->emit(io, p); in CustomPut()
625 p->emit_alpha(io, p, num_lines_out); in CustomPut()
633 static void CustomTeardown(const VP8Io* io) { in CustomTeardown() argument
634 WebPDecParams* const p = (WebPDecParams*)io->opaque; in CustomTeardown()
642 void WebPInitCustomIo(WebPDecParams* const params, VP8Io* const io) { in WebPInitCustomIo() argument
643 io->put = CustomPut; in WebPInitCustomIo()
644 io->setup = CustomSetup; in WebPInitCustomIo()
645 io->teardown = CustomTeardown; in WebPInitCustomIo()
646 io->opaque = params; in WebPInitCustomIo()