[FFmpeg-devel] [PATCH] Introduce av_fill_image_planesizes() (was: swscale-test: add md5 output)

Ramiro Polla ramiro.polla
Sun Sep 26 23:12:27 CEST 2010


On Wed, Sep 22, 2010 at 6:31 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Wed, Sep 15, 2010 at 07:19:28PM -0300, Ramiro Polla wrote:

>> ?doc/APIchanges ? ? ? | ? ?3 +++
>> ?libavcore/avcore.h ? | ? ?2 +-
>> ?libavcore/imgutils.c | ? 23 +++++++++++++++++++----
>> ?libavcore/imgutils.h | ? 12 ++++++++++++
>> ?4 files changed, 35 insertions(+), 5 deletions(-)
>> f781b802c36a7541868bc05f89fcc82aeeadc12c ?add_av_image_fill_planesizes_2.diff
>> Index: doc/APIchanges
>> ===================================================================
>> --- doc/APIchanges ? ?(revision 25126)
>> +++ doc/APIchanges ? ?(working copy)
>> @@ -13,6 +13,9 @@ libavutil: ? 2009-03-08
>>
>> ?API changes, most recent first:
>>
>> +2010-09-xx - rxxxxx - lavcore 0.10.0 - imgutils.h
>> + ?Add function av_fill_image_planesizes(), declared in libavcore/imgutils.h.
>> +
>> ?2010-09-08 - r25076 - lavu 50.26.0 - av_get_cpu_flags()
>> ? ?Add av_get_cpu_flags().
>>
>> Index: libavcore/imgutils.h
>> ===================================================================
>> --- libavcore/imgutils.h ? ? ?(revision 25126)
>> +++ libavcore/imgutils.h ? ? ?(working copy)
>> @@ -101,6 +101,18 @@ void av_image_copy(uint8_t *dst_data[4], int dst_l
>> ? ? ? ? ? ? ? ? ? ? enum PixelFormat pix_fmt, int width, int height);
>>
>> ?/**
>> + * Fill plane sizes for an image with pixel format pix_fmt and height height.
>> + *
>> + * @param planesizes[4] array to be filled with the size for each image plane
>> + * @param linesizes[4] the array containing the linesize for each
>> + * plane, should be filled by av_image_fill_linesizes()
>> + * @return the size in bytes required for the image buffer, a negative
>> + * error code in case of failure
>
> in/out should be marked with proper syntax
> something shoudl be said about with what goal it chooses linesizes
> alignemnt ans such
>
> That said iam not too happy about this api bloat with odd wrapers

New patch attached with updated documentation (mentions desired
linesize instead of telling user to use av_image_fill_liniesizes()).

Getting the plane size from a function is useful to do stuff for each
plane independently (like allocating or copying memory, or running
crc) without needing some pix_fmt/chroma-specific code for every code
that needs this.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_av_image_fill_planesizes_3.diff
Type: text/x-diff
Size: 3669 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100926/568e7428/attachment.diff>



More information about the ffmpeg-devel mailing list