[vlc-devel] [PATCH v3] codec: jpeg encoder implemented
Maxim Bublis
b at codemonkey.ru
Wed Jan 29 17:15:23 CET 2014
> > + for (int i = 0; i < p_pic->i_planes; i++)
> > + {
> > + p_row_pointers[i] = malloc(sizeof(JSAMPROW) *
> p_jpeg.comp_info[i].v_samp_factor * DCTSIZE);
>
> Really, no way to operate on the picture buffers directly?
>
> > + }
> > +
> > + while (p_jpeg.next_scanline < p_jpeg.image_height)
> > + {
> > + for (int i = 0; i < p_pic->i_planes; i++)
> > + {
> > + for (int j = 0; j < p_jpeg.comp_info[i].v_samp_factor *
> DCTSIZE; j++)
> > + {
> > + p_row_pointers[i][j] = p_pic->p[i].p_pixels +
> p_pic->p[i].i_pitch * p_jpeg.next_scanline *
> p_jpeg.comp_info[i].v_samp_factor / p_jpeg.max_v_samp_factor + j;
> > + }
> > + }
> > + jpeg_write_raw_data(&p_jpeg, p_row_pointers,
> p_jpeg.max_v_samp_factor * DCTSIZE);
> > + }
>
Maybe you could advice me how to do that without additional allocations.
JSAMPARRAY is a 3-dimensional array, top index is color component. Each
element is a JSAMPARRAY - 2-dimensional array of row pointers.
We are having p_pic->p[i].p_pixels, which is a plane array of pixels for
each color component.
--
Maxim Bublis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20140129/9664f89c/attachment.html>
More information about the vlc-devel
mailing list