[FFmpeg-devel] [PATCH] Some documentation for swscale.h

Michael Niedermayer michaelni
Sun Feb 8 16:21:01 CET 2009


On Sat, Feb 07, 2009 at 10:45:47PM +0100, Stefano Sabatini wrote:
> Hi all, no hurry for reviewing this since I'm still in the process of
> learning how to use properly swscale and there is quite some
> sofistication involved in it, anyway some review would be welcome, and
> I can commit by little steps the various parts as long as they are
> OKed.
> 
> Regards.
> -- 
> FFmpeg = Fundamental and Foolish Mysterious Portable Enhanced Governor

> Index: libswscale/swscale.h
> ===================================================================
> --- libswscale/swscale.h	(revision 28480)
> +++ libswscale/swscale.h	(working copy)
> @@ -98,8 +98,8 @@
>  // when used for filters they must have an odd number of elements
>  // coeffs cannot be shared between vectors
>  typedef struct {
> -    double *coeff;
> -    int length;
> +    double *coeff;              ///< pointers to the list of coefficients
> +    int length;                 ///< number of coefficients in the vector
>  } SwsVector;
>  
>  // vectors can be shared

ok

[...]

> +
> +/**
> + * Scales the image slice in \p src and puts the resulting scaled
> + * slice in \p dst. An slice is a sequence of consecutive rows in an
> + * image.
> + *

> + * @param context the scaling context previously created with
> + * sws_getContext()
> + * @param src the pointer to the array of pointers to the planes of
> + * the source image (just one pointer in case of packed data)
> + * @param srcStride the pointer to the array containing the strides or
> + * linesizes of the source image for each plane (in the case of packed
> + * image formats there is only one linesize).
> + * @param srcSliceY the position of the source slice to process, that
> + * is the number of the first row of the slice
> + * @param srcSliceH the heigth of the slice, that is the number of
> + * rows of the slice
> + * @param dst the pointer to the array containing the pointers to the
> + * data planes of the image (just one pointer in case of packed data)
> + * @param srcStride the pointer to the array containing the strides or
> + * linesizes of the destination image for each plane (in the case of
> + * packed image formats there is only one linesize).
> + * @return the height of the output slice

trytoaddsomewhitespaceplease


> + */
>  int sws_scale(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
>                int srcSliceH, uint8_t* dst[], int dstStride[]);

> +
> +/**
> + * @deprecated Use sws_scale() instead.
> + */
>  int sws_scale_ordered(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
>                        int srcSliceH, uint8_t* dst[], int dstStride[]) attribute_deprecated;

wrong patch


>  
> +/**
> + * @param inv_table the yuv2rgb coefficients, normally Inverse_Table_6_9[x]

> + * @param fullRange if 1 then the luma range is 0..255, if 0 it is 16..235

and the chroma range ...


> + * @return -1 if not supported
> + */

the return is always negative for errors non negative no error,
thats the case for nearly all of libav!


> +int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation);
>  
> -int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation);

?


[...]
>                                  float chromaHShift, float chromaVShift,
>                                  int verbose);
> +
>  void sws_freeFilter(SwsFilter *filter);

huh?


>  
> +/**
> + * Checks if context is valid or reallocs a new one instead.  If
> + * context is NULL, just calls sws_getContext() to get a new one.
> + * Otherwise, checks if the parameters are the ones already saved in
> + * context.  If that is the case, returns the current context.
> + * Otherwise, frees context and gets a new one.
> + *
> + * Be warned that \p srcFilter and \p dstFilter are not checked, they
> + * are assumed to remain valid.
> + */
>  struct SwsContext *sws_getCachedContext(struct SwsContext *context,
>                                          int srcW, int srcH, int srcFormat,
>                                          int dstW, int dstH, int dstFormat, int flags,
[...]
> @@ -3166,16 +3166,6 @@
>      av_free(c);
>  }
>  
> -/**
> - * Checks if context is valid or reallocs a new one instead.
> - * If context is NULL, just calls sws_getContext() to get a new one.
> - * Otherwise, checks if the parameters are the ones already saved in context.
> - * If that is the case, returns the current context.
> - * Otherwise, frees context and gets a new one.
> - *
> - * Be warned that srcFilter, dstFilter are not checked, they are
> - * asumed to remain valid.
> - */
>  struct SwsContext *sws_getCachedContext(struct SwsContext *context,

moving of comments and changes MUST be in seperate patches.
and i must say ive edited this now a few times to not sound too rude but
this isnt the first time that doxy patches from you are such a mess.

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090208/fe17f0aa/attachment.pgp>



More information about the ffmpeg-devel mailing list