[FFmpeg-devel] [PATCH] Doxument some of SwsContext.

Michael Niedermayer michaelni
Fri Jan 22 15:31:32 CET 2010


On Wed, Jan 20, 2010 at 01:30:17AM -0200, Ramiro Polla wrote:
> On Sun, Jan 17, 2010 at 12:16 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
[...]
> >> ?swscale_internal.h | ?144 +++++++++++++++++++++++++++++++++++++++--------------
> >> ?swscale_template.c | ? ?9 ---
> >> ?2 files changed, 106 insertions(+), 47 deletions(-)
> >> 86325f9c5ef95abc3bef9318b92a1b260095ae06 ?doxument_2.diff
> >> diff --git a/swscale_internal.h b/swscale_internal.h
> >> index 65174fd..8053bcc 100644
> >> --- a/swscale_internal.h
> >> +++ b/swscale_internal.h
> >> @@ -82,51 +82,81 @@ typedef struct SwsContext {
> >> ? ? ?int chrSrcH; ? ? ? ? ? ? ? ? ?///< Height of source ? ? ?chroma ? ? planes.
> >> ? ? ?int chrDstW; ? ? ? ? ? ? ? ? ?///< Width ?of destination chroma ? ? planes.
> >> ? ? ?int chrDstH; ? ? ? ? ? ? ? ? ?///< Height of destination chroma ? ? planes.
> >> - ? ?int lumXInc, chrXInc;
> >> - ? ?int lumYInc, chrYInc;
> >> + ? ?int lumXInc; ? ? ? ? ? ? ? ? ?///< Horizontal scale factor between source and destination luma/alpha planes.
> >> + ? ?int chrXInc; ? ? ? ? ? ? ? ? ?///< Horizontal scale factor between source and destination chroma ? ? planes.
> >> + ? ?int lumYInc; ? ? ? ? ? ? ? ? ?///< Vertical ? scale factor between source and destination luma/alpha planes.
> >> + ? ?int chrYInc; ? ? ? ? ? ? ? ? ?///< Vertical ? scale factor between source and destination chroma ? ? planes.
> >
> > so we support scaling by x1, x2, x3 ?
> 
> I don't understand what you mean by this.

you say its a scale factor and undeniably its an integer, so we support only
scaling by integer multiplies ;)


[...]
> 
> >> + ? ?/**
> >> + ? ? * @name Horizontal and vertical filters.
> >> + ? ? * To better understand the following fields, here is a pseudo-code of
> >> + ? ? * their usage in filtering a horizontal line:
> >> + ? ? * @code
> >> + ? ? * for (i = 0; i < width; i++) {
> >> + ? ? * ? ? dst[i] = 0;
> >> + ? ? * ? ? for (j = 0; j < filterSize; j++)
> >> + ? ? * ? ? ? ? dst[i] += src[ filterPos[i] + j ] * filter[ filterSize * i + j ];
> >> + ? ? * }
> >> + ? ? * @endcode
> >> + ? ? */
> >> + ? ?//@{
> >> + ? ?int16_t *hLumFilter; ? ? ? ? ?///< Array of horizontal filter coefficients for luma/alpha planes.
> >> + ? ?int16_t *hChrFilter; ? ? ? ? ?///< Array of horizontal filter coefficients for chroma ? ? planes.
> >> + ? ?int16_t *vLumFilter; ? ? ? ? ?///< Array of vertical ? filter coefficients for luma/alpha planes.
> >> + ? ?int16_t *vChrFilter; ? ? ? ? ?///< Array of vertical ? filter coefficients for chroma ? ? planes.
> >> + ? ?int16_t *hLumFilterPos; ? ? ? ///< Array of horizontal filter starting positions for each dst[i] for luma/alpha planes.
> >> + ? ?int16_t *hChrFilterPos; ? ? ? ///< Array of horizontal filter starting positions for each dst[i] for chroma ? ? planes.
> >> + ? ?int16_t *vLumFilterPos; ? ? ? ///< Array of vertical ? filter starting positions for each dst[i] for luma/alpha planes.
> >> + ? ?int16_t *vChrFilterPos; ? ? ? ///< Array of vertical ? filter starting positions for each dst[i] for chroma ? ? planes.
> >> + ? ?int ? ? ?hLumFilterSize; ? ? ?///< Horizontal filter size for luma/alpha pixels.
> >> + ? ?int ? ? ?hChrFilterSize; ? ? ?///< Horizontal filter size for chroma ? ? pixels.
> >> + ? ?int ? ? ?vLumFilterSize; ? ? ?///< Vertical ? filter size for luma/alpha pixels.
> >> + ? ?int ? ? ?vChrFilterSize; ? ? ?///< Vertical ? filter size for chroma ? ? pixels.
> >> + ? ?//@}
> >>
> >
> > ok, but you miss scale down >>X in your code
> 
> I wanted to keep this more generic, but I added the shift and a
> comment explaining the actual implementation is fixed-point.

generic is fine but it should be correct even if vague
pretending theres no shift is not correct


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

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA
-------------- 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/20100122/87e39b96/attachment.pgp>



More information about the ffmpeg-devel mailing list