[FFmpeg-devel] [PATCH] swscale: Use function pointers inside swScale().

Ramiro Polla ramiro.polla
Sun Apr 5 00:06:29 CEST 2009


Hi,

On Fri, Apr 3, 2009 at 12:38 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Fri, Apr 03, 2009 at 12:07:10AM -0300, Ramiro Polla wrote:

[...]

>> Index: swscale_internal.h
>> ===================================================================
>> --- swscale_internal.h ? ? ? ?(revision 29130)
>> +++ swscale_internal.h ? ? ? ?(working copy)
>> @@ -214,6 +214,55 @@
>> ? ? ?uint64_t sparc_coeffs[10] __attribute__((aligned(8)));
>> ?#endif
>>
>> + ? ?/* function pointers for swScale() */
>> + ? ?void (*yuv2nv12X ?)(struct SwsContext *c,
>> + ? ? ? ? ? ? ? ? ? ? ? ?int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
>> + ? ? ? ? ? ? ? ? ? ? ? ?int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
>> + ? ? ? ? ? ? ? ? ? ? ? ?uint8_t *dest, uint8_t *uDest,
>> + ? ? ? ? ? ? ? ? ? ? ? ?int dstW, int chrDstW, int dstFormat);
>> + ? ?void (*yuv2yuv1 ? )(struct SwsContext *c,
>> + ? ? ? ? ? ? ? ? ? ? ? ?int16_t *lumSrc, int16_t *chrSrc, int16_t *alpSrc,
>> + ? ? ? ? ? ? ? ? ? ? ? ?uint8_t *dest,
>> + ? ? ? ? ? ? ? ? ? ? ? ?uint8_t *uDest, uint8_t *vDest, uint8_t *aDest,
>> + ? ? ? ? ? ? ? ? ? ? ? ?long dstW, long chrDstW);
>> + ? ?void (*yuv2yuvX ? )(struct SwsContext *c,
>> + ? ? ? ? ? ? ? ? ? ? ? ?int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
>> + ? ? ? ? ? ? ? ? ? ? ? ?int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
>> + ? ? ? ? ? ? ? ? ? ? ? ?int16_t **alpSrc,
>> + ? ? ? ? ? ? ? ? ? ? ? ?uint8_t *dest,
>> + ? ? ? ? ? ? ? ? ? ? ? ?uint8_t *uDest, uint8_t *vDest, uint8_t *aDest,
>> + ? ? ? ? ? ? ? ? ? ? ? ?long dstW, long chrDstW);
>> + ? ?void (*yuv2packed1)(struct SwsContext *c,
>> + ? ? ? ? ? ? ? ? ? ? ? ?uint16_t *buf0, uint16_t *uvbuf0, uint16_t *uvbuf1,
>> + ? ? ? ? ? ? ? ? ? ? ? ?uint16_t *abuf0, uint8_t *dest,
>> + ? ? ? ? ? ? ? ? ? ? ? ?int dstW, int uvalpha, int dstFormat, int flags, int y);
>> + ? ?void (*yuv2packed2)(struct SwsContext *c,
>> + ? ? ? ? ? ? ? ? ? ? ? ?uint16_t *buf0, uint16_t *buf1,
>> + ? ? ? ? ? ? ? ? ? ? ? ?uint16_t *uvbuf0, uint16_t *uvbuf1,
>> + ? ? ? ? ? ? ? ? ? ? ? ?uint16_t *abuf0, uint16_t *abuf1,
>> + ? ? ? ? ? ? ? ? ? ? ? ?uint8_t *dest,
>> + ? ? ? ? ? ? ? ? ? ? ? ?int dstW, int yalpha, int uvalpha, int y);
>> + ? ?void (*yuv2packedX)(struct SwsContext *c,
>> + ? ? ? ? ? ? ? ? ? ? ? ?int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
>> + ? ? ? ? ? ? ? ? ? ? ? ?int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
>> + ? ? ? ? ? ? ? ? ? ? ? ?int16_t **alpSrc, uint8_t *dest,
>> + ? ? ? ? ? ? ? ? ? ? ? ?long dstW, long dstY);
>> +
>> + ? ?void (*hyscale_internal)(uint8_t *dst, uint8_t *src,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? long width, uint32_t *pal);
>> + ? ?void (*hcscale_internal)(uint8_t *dstU, uint8_t *dstV,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? uint8_t *src1, uint8_t *src2,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? long width, uint32_t *pal);
>> + ? ?void (*hyscale_fast)(struct SwsContext *c,
>> + ? ? ? ? ? ? ? ? ? ? ? ? int16_t *dst, int dstWidth,
>> + ? ? ? ? ? ? ? ? ? ? ? ? uint8_t *src, int srcW, int xInc);
>> + ? ?void (*hcscale_fast)(struct SwsContext *c,
>> + ? ? ? ? ? ? ? ? ? ? ? ? int16_t *dst, int dstWidth,
>> + ? ? ? ? ? ? ? ? ? ? ? ? uint8_t *src1, uint8_t *src2, int srcW, int xInc);
>> +
>> + ? ?void (*hScale)(int16_t *dst, int dstW, uint8_t *src, int srcW,
>> + ? ? ? ? ? ? ? ? ? int xInc, int16_t *filter, int16_t *filterPos, long filterSize);
>> +
>
> all the parameters that have src in their name should be const but they likely
> arent the only ones

Yes, and that is yet another separate issue. Anyways, 3 patches attached.

Ramiro Polla
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-swscale-Add-const-to-some-swScale-functions-parame.patch
Type: text/x-diff
Size: 23436 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090404/7a7395a1/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-swscale-related-cosmetics.patch
Type: text/x-diff
Size: 1290 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090404/7a7395a1/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-swscale-Use-function-pointers-for-swScale-functions.patch
Type: text/x-diff
Size: 23975 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090404/7a7395a1/attachment-0002.patch>



More information about the ffmpeg-devel mailing list