Mercurial > libavcodec.hg
diff avcodec.h @ 9217:53ec03e7ba40 libavcodec
Fix avpicture_get_size for non-paletted formats with a helper palette
to not include the size of that palette.
Also clarify its documentation.
author | reimar |
---|---|
date | Sat, 21 Mar 2009 10:25:20 +0000 |
parents | 7b62de9c383d |
children | 18dffa8f2382 |
line wrap: on
line diff
--- a/avcodec.h Sat Mar 21 01:54:31 2009 +0000 +++ b/avcodec.h Sat Mar 21 10:25:20 2009 +0000 @@ -2676,6 +2676,7 @@ * If a planar format is specified, several pointers will be set pointing to * the different picture planes and the line sizes of the different planes * will be stored in the lines_sizes array. + * Call with ptr == NULL to get the required size for the ptr buffer. * * @param picture AVPicture whose fields are to be filled in * @param ptr Buffer which will contain or contains the actual image data @@ -2692,11 +2693,14 @@ /** * Calculate the size in bytes that a picture of the given width and height * would occupy if stored in the given picture format. + * Note that this returns the size of a compact representation as generated + * by avpicture_layout, which can be smaller than the size required for e.g. + * avpicture_fill. * * @param pix_fmt the given picture format * @param width the width of the image * @param height the height of the image - * @return Image data size in bytes + * @return Image data size in bytes or -1 on error (e.g. too large dimensions). */ int avpicture_get_size(int pix_fmt, int width, int height); void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift);