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

Stefano Sabatini stefano.sabatini-lala
Tue Feb 10 01:19:03 CET 2009


On date Sunday 2009-02-08 16:21:01 +0100, Michael Niedermayer encoded:
> 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

Applied.
 
> [...]
> 
> > +
> > +/**
> > + * 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.

Sorry, I split part of the patch into small patches, hope they are
more acceptable now.

Summary:

* sws-scale-ordered-is-deprecated.patch
  Add a notice telling sws_scale_ordered() is deprecated.

* sws-remove-sws-scale-ordered-docs.patch
  Remove pointless comment on sws_scale_ordered() (at least I cannot
  interpret it).

* sws-move-getcached-context-doc.patch
  Move the already existing doc for getCachedContext() from swscale.c to
  swscale.h.

* sws-fix-getcached-context-doc.patch
  Add \p for params, fix some typos and perform some rewording.

* sws-document-getconstvec.patch
  Document sws_getConstVec().

* sws-document-getidentityvec.patch
  Document sws_getIdentityVec().

* sws-document-scalevec.patch
  Document sws_getScaleVec().

* sws-document-clonevec.patch
  Document sws_cloneVec().

* sws-document-printvec.patch
  Document sws_printVec().

Regards.
-- 
FFmpeg = Furious & Faboulous Mythic Problematic Ecstatic Genius
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws-scale-ordered-is-deprecated.patch
Type: text/x-diff
Size: 704 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090210/d104405a/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws-remove-sws-scale-ordered-docs.patch
Type: text/x-diff
Size: 617 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090210/d104405a/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws-move-getcached-context-doc.patch
Type: text/x-diff
Size: 2004 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090210/d104405a/attachment-0002.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws-fix-getcached-context-doc.patch
Type: text/x-diff
Size: 1324 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090210/d104405a/attachment-0003.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws-document-getconstvec.patch
Type: text/x-diff
Size: 911 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090210/d104405a/attachment-0004.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws-document-getidentityvec.patch
Type: text/x-diff
Size: 580 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090210/d104405a/attachment-0005.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws-document-scalevec.patch
Type: text/x-diff
Size: 589 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090210/d104405a/attachment-0006.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws-document-clonevec.patch
Type: text/x-diff
Size: 601 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090210/d104405a/attachment-0007.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sws-document-printvec.patch
Type: text/x-diff
Size: 497 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090210/d104405a/attachment-0008.patch>



More information about the ffmpeg-devel mailing list