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

Ramiro Polla ramiro.polla
Sat Jan 16 23:40:42 CET 2010


On Thu, Jan 14, 2010 at 10:56 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Thu, Jan 14, 2010 at 04:13:36AM -0200, Ramiro Polla wrote:
[...]

OK'd hunks applied.

[...]
>> + ? ?int chrSrcHSubSample; ? ? ? ? ///< Binary logarithm of horizontal subsampling factor between luma/alpha and chroma planes in source ? ? ?image.
>
> log2 is shorter

Hmm, I prefer the more explicative "Binary logarithm". This is more
easily searchable on Wikipedia for example.

>> + ? ?int sliceDir; ? ? ? ? ? ? ? ? ///< Direction that slices are fed to the scaler (top-to-bottom or bottom-to-top).
>
> its a int not a string ;) which is which

Values enumerated.

>> + ? ?/**
>> + ? ? * @name Scaled horizontal lines ring buffer.
>> + ? ? * The horizontal scaler keeps just enough scaled lines in a ring buffer
>> + ? ? * so they may be passed to the vertical scaler. The pointers to the
>> + ? ? * allocated buffers for each line are duplicated in sequence in the ring
>> + ? ? * buffer to simplify indexing and avoid wrapping around between lines
>> + ? ? * inside the vertical scaler code. The wrapping is done before the
>> + ? ? * vertical scaler is called.
>> + ? ? */
>> + ? ?//@{
>> + ? ?int16_t **lumPixBuf; ? ? ? ? ?///< Ring buffer for scaled horizontal luma ? plane lines to be fed to the vertical scaler.
>> + ? ?int16_t **chrPixBuf; ? ? ? ? ?///< Ring buffer for scaled horizontal chroma plane lines to be fed to the vertical scaler.
>> + ? ?int16_t **alpPixBuf; ? ? ? ? ?///< Ring buffer for scaled horizontal alpha ?plane lines to be fed to the vertical scaler.
>> + ? ?int ? ? ? vLumBufSize; ? ? ? ?///< Number of vertical luma/alpha lines allocated in the ring buffer.
>> + ? ?int ? ? ? vChrBufSize; ? ? ? ?///< Number of vertical chroma ? ? lines allocated in the ring buffer.
>> + ? ?int ? ? ? lastInLumBuf; ? ? ? ///< Last scaled horizontal luma/alpha line from source in the ring buffer.
>> + ? ?int ? ? ? lastInChrBuf; ? ? ? ///< Last scaled horizontal chroma ? ? line from source in the ring buffer.
>> + ? ?int ? ? ? lumBufIndex; ? ? ? ?///< Index in ring buffer of the last scaled horizontal luma/alpha line from source.
>> + ? ?int ? ? ? chrBufIndex; ? ? ? ?///< Index in ring buffer of the last scaled horizontal chroma ? ? line from source.
>> + ? ?//@}
>
> sounds probable, you know its long ago that i worked much on sws
> i could miss some wrong but probable sounding things ...

I didn't know if this meant ok or not, so not applied for now.

By the way this should make it easier for other people to understand
the code. Could other people please take some time to check if it
becomes more understandable how the ring buffer and filters work with
this patch?

>> @@ -231,39 +280,67 @@ typedef struct SwsContext {
>> ? ? ? ? ? ? ? ? ? ? ? ? ?uint8_t *dest,
>> ? ? ? ? ? ? ? ? ? ? ? ? ?uint8_t *uDest, uint8_t *vDest, uint8_t *aDest,
>> ? ? ? ? ? ? ? ? ? ? ? ? ?long dstW, long chrDstW);
>> + ? ?/**
>> + ? ? * Vertical YV12 to RGB converter without scaling or interpolating.
>> + ? ? */
>> ? ? ?void (*yuv2packed1)(struct SwsContext *c,
>> ? ? ? ? ? ? ? ? ? ? ? ? ?const uint16_t *buf0,
>> ? ? ? ? ? ? ? ? ? ? ? ? ?const uint16_t *uvbuf0, const uint16_t *uvbuf1,
>> ? ? ? ? ? ? ? ? ? ? ? ? ?const uint16_t *abuf0,
>> ? ? ? ? ? ? ? ? ? ? ? ? ?uint8_t *dest,
>> ? ? ? ? ? ? ? ? ? ? ? ? ?int dstW, int uvalpha, int dstFormat, int flags, int y);
>
> theres a check for uvalpha < 2048 and interpolation in there

Hmm, then the comment on the function in swscale_template.c was wrong.
Should the comments be on the function pointers or on the functions
themselves? I removed them from the functions.

New patch attached a little bit cleaner for review.

Ramiro Polla
-------------- next part --------------
A non-text attachment was scrubbed...
Name: doxument_2.diff
Type: text/x-diff
Size: 14164 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100116/47a79b10/attachment.diff>



More information about the ffmpeg-devel mailing list