[FFmpeg-devel] [PATCH 3/3] Implement inline function av_fill_image_max_step() and use it for factorizing code.

Michael Niedermayer michaelni
Wed Aug 18 13:48:09 CEST 2010


On Thu, Aug 12, 2010 at 01:23:30AM +0200, Stefano Sabatini wrote:
[...]
> diff --git a/libavcore/imgutils.h b/libavcore/imgutils.h
> index c2cf6eb..2f141bf 100644
> --- a/libavcore/imgutils.h
> +++ b/libavcore/imgutils.h
> @@ -24,10 +24,39 @@
>   * misc image utilities
>   */
>  
> -#include "libavutil/pixfmt.h"
> +#include "libavutil/pixdesc.h"
>  #include "avcore.h"
>  
>  /**
> + * Compute the max pixel step for each plane of an image with a
> + * format described by pix_desc.
> + *
> + * The pixel step is the number of bytes between the bytes of a pixel
> + * component which describe a pixel. Since a plane may contain
> + * different pixel components, the maximum step is relative to the
> + * component with the max step.
> + *
> + * @param max_step_comp put here the array containing the component
> + * for each plane which has the max pixel step. May be NULL.
> + */
> +static inline void av_fill_image_max_step(int max_step[4], int max_step_comp[4], const AVPixFmtDescriptor *pix_desc)
> +{
> +    int i;
> +    memset(max_step     , 0, 4*sizeof(max_step     [0]));

isnt sizeof(max_step) the same?

anyway, patch should be ok

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100818/3156eb2c/attachment.pgp>



More information about the ffmpeg-devel mailing list