[FFmpeg-devel] [PATCH] cleanup swscale

Luca Barbato lu_zero
Fri Jun 8 09:46:58 CEST 2007


Michael Niedermayer wrote:
>> -static inline void yuv2yuvXinC(int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
>> -                               int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
>> -                               uint8_t *dest, uint8_t *uDest, uint8_t *vDest, int dstW, int chrDstW)
>> +static inline void yuv2yuvXinC(int16_t *lumFilter,
>> +                               int16_t **lumSrc, int lumFilterSize,
>> +                               int16_t *chrFilter,
>> +                               int16_t **chrSrc, int chrFilterSize,
>> +                               uint8_t *dest,
>> +                               uint8_t *uDest, uint8_t *vDest,
>> +                               int dstW, int chrDstW)
> 
> this is less readable not more than the original code

people using 80col will find the latter more readable.

> 
> same here

Idem
> 
> 
> [...]
>>  
>> -static inline void yuv2packedXinC(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
>> -                                  int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
>> +static inline void yuv2packedXinC(SwsContext *c,
>> +                                  int16_t *lumFilter,
>> +                                  int16_t **lumSrc, int lumFilterSize,
>> +                                  int16_t *chrFilter,
>> +                                  int16_t **chrSrc, int chrFilterSize,
> 
> static inline void yuv2packedXinC(SwsContext *c, 
>                                   int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
>                                   int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
> 

not 80cols safe

> this too is worse than it was
> also note you can reorder the parameters for static funtions as you see fit

I'll try something then.

> 
> static int rgb2rgbWrapper(SwsContext *c, 
>                           uint8_t* src[], int srcStride[],
>                           uint8_t* dst[], int dstStride[],
>                           int srcSliceY, int srcSliceH){
> 
> being an option

right

>> -int sws_setColorspaceDetails(SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation){
>> +int sws_setColorspaceDetails(SwsContext *c, const int inv_table[4],
>> +                             int srcRange,  const int table[4],
>> +                             int dstRange,
>> +                             int brightness, int contrast, int saturation){
> 
> int sws_setColorspaceDetails(SwsContext *c, 
>                              const int inv_table[4], int srcRange,
>                              const int     table[4], int dstRange,
>                              int brightness, int contrast, int saturation){
> 
> being the obvios choice

Looks nice

> struct SwsContext *sws_getCachedContext(struct SwsContext *context,
>                                         int srcW, int srcH, int srcFormat,
>                                         int dstW, int dstH, int dstFormat, 
>                                         int flags,
>                                         SwsFilter *srcFilter, SwsFilter *dstFilter,
>                                         double *param);
> 
> might be better
> 

ok

> note, breaking lines while making the code less readable is NOT ok
> i will not accpet such a patch, making the code more readable and
> while doing that trying to keep things <80chars is ok

I'll try something, keep in mind for people using strict 80col swscale
is just an ugly mess as is. I'll try to compare the result with the
current status on a 120col setup

btw

cutting the static inline on another line would be allowed?

static inline void
yuv2packedXinC(SwsContext *c,
               int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
               int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,

static inline void yuv2packedXinC(SwsContext *c,
               int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
               int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,

static inline
void yuv2packedXinC(SwsContext *c,
....

All I want is to have swscale readable so I can mess with it with less
chance to make disasters in the process.

lu

-- 

Luca Barbato

Gentoo/linux Gentoo/PPC
http://dev.gentoo.org/~lu_zero




More information about the ffmpeg-devel mailing list