On Thu, Mar 27, 2014 at 01:56:26AM +0100, Vittorio Giovara wrote:
> --- a/libavcodec/vp8.c
> +++ b/libavcodec/vp8.c
> @@ -588,24 +595,24 @@ void decode_mvs(VP8Context *s, VP8Macroblock *mb, int 
> mb_x, int mb_y, int layout
> +#define MV_EDGE_CHECK(n)                                                     
>  \
> +    {                                                                        
>  \
> +        VP8Macroblock *edge = mb_edge[n];                                    
>  \
> +        int edge_ref = edge->ref_frame;                                      
>  \
> +        if (edge_ref != VP56_FRAME_CURRENT) {                                
>  \
> +            uint32_t mv = AV_RN32A(&edge->mv);                               
>  \
> +            if (mv) {                                                        
>  \
> +                if (cur_sign_bias != sign_bias[edge_ref]) {                  
>  \
> +                    /* SWAR negate of the values in mv. */                   
>  \
> +                    mv = ~mv;                                                
>  \
> +                    mv = ((mv & 0x7fff7fff) + 0x00010001) ^ (mv & 
> 0x80008000); \

nit: maybe break the line

> @@ -836,40 +851,43 @@ int decode_block_coeffs(VP56RangeCoder *c, int16_t 
> block[16],
>      int nnz_pred, nnz, nnz_total = 0;
> -    int segment = mb->segment;
> +    int segment  = mb->segment;
>      int block_dc = 0;

IMO excessive alignment

> @@ -1088,31 +1112,33 @@ void intra_predict(VP8Context *s, VP8ThreadData *td, 
> uint8_t *dst[3],
>                      } else {
> -                        copy_dst[11] = ptr[4*x              -1];
> -                        copy_dst[19] = ptr[4*x+s->linesize  -1];
> -                        copy_dst[27] = ptr[4*x+s->linesize*2-1];
> -                        copy_dst[35] = ptr[4*x+s->linesize*3-1];
> +                        copy_dst[11] = ptr[4 * x - 1];
> +                        copy_dst[19] = ptr[4 * x + s->linesize - 1];
> +                        copy_dst[27] = ptr[4 * x + s->linesize * 2 - 1];
> +                        copy_dst[35] = ptr[4 * x + s->linesize * 3 - 1];

Maybe align the - as before.

>                  if (copy) {
> -                    AV_COPY32(ptr+4*x              , copy_dst+12);
> -                    AV_COPY32(ptr+4*x+s->linesize  , copy_dst+20);
> -                    AV_COPY32(ptr+4*x+s->linesize*2, copy_dst+28);
> -                    AV_COPY32(ptr+4*x+s->linesize*3, copy_dst+36);
> +                    AV_COPY32(ptr + 4 * x, copy_dst + 12);
> +                    AV_COPY32(ptr + 4 * x + s->linesize, copy_dst + 20);
> +                    AV_COPY32(ptr + 4 * x + s->linesize * 2, copy_dst + 28);
> +                    AV_COPY32(ptr + 4 * x + s->linesize * 3, copy_dst + 36);

similar

> @@ -1411,36 +1453,41 @@ static av_always_inline void idct_mb(VP8Context *s, 
> VP8ThreadData *td,
>          }
>  chroma_idct_end: ;

Move the ; to the next line.

> @@ -1807,11 +1879,14 @@ static int vp8_decode_mb_row_sliced(AVCodecContext 
> *avctx, void *tdata,
>      VP8ThreadData *td = &s->thread_data[jobnr];
>      VP8ThreadData *next_td = NULL, *prev_td = NULL;
>      VP8Frame *curframe = s->curframe;
> -    int mb_y, num_jobs = s->num_jobs;
> +    int num_jobs = s->num_jobs;
> +    int mb_y;

Why?

> --- a/libavcodec/vp8.h
> +++ b/libavcodec/vp8.h
> @@ -28,14 +28,15 @@
>  #if HAVE_PTHREADS
> -#include <pthread.h>
> +#   include <pthread.h>
>  #elif HAVE_W32THREADS
> -#include "compat/w32pthreads.h"
> +#   include "compat/w32pthreads.h"
>  #endif

I'd avoid this idiosyncratic formatting.

> --- a/libavcodec/vp8dsp.c
> +++ b/libavcodec/vp8dsp.c
> @@ -219,68 +224,77 @@ static av_always_inline void filter_mbedge(uint8_t *p, 
> ptrdiff_t stride)
>  
> +#define UV_LOOP_FILTER(dir, stridea, strideb)                                
>  \
> +    LOOP_FILTER(dir, 8, stridea, strideb, av_always_inline)                  
>  \
> +    static void vp8_ ## dir ## _loop_filter8uv_c(uint8_t *dstU, uint8_t 
> *dstV, \
> +                                                 ptrdiff_t stride,           
>  \
> +                                                 int fE, int fI,             
>  \
> +                                                 int hev_thresh)             
>  \
> +    {                                                                        
>  \
> +        vp8_ ## dir ## _loop_filter8_c(dstU, stride, fE, fI, hev_thresh);    
>  \
> +        vp8_ ## dir ## _loop_filter8_c(dstV, stride, fE, fI, hev_thresh);    
>  \
> +    }                                                                        
>  \
> +    static void vp8_ ## dir ## _loop_filter8uv_inner_c(uint8_t *dstU,        
>  \
> +                                                       uint8_t *dstV,        
>  \
> +                                                       ptrdiff_t stride,     
>  \
> +                                                       int fE, int fI,       
>  \
> +                                                       int hev_thresh)       
>  \
> +    {                                                                        
>  \
> +        vp8_ ## dir ## _loop_filter8_inner_c(dstU, stride, fE, fI, 
> hev_thresh); \
> +        vp8_ ## dir ## _loop_filter8_inner_c(dstV, stride, fE, fI, 
> hev_thresh); \
> +    }

Drop the initial indentation level and add empty lines between function
definitions, as you did above.

> @@ -299,184 +313,198 @@ static void vp8_h_loop_filter_simple_c(uint8_t *dst, 
> ptrdiff_t stride, int flim)
>  
> -#define PUT_PIXELS(WIDTH) \
> -static void put_vp8_pixels ## WIDTH ##_c(uint8_t *dst, ptrdiff_t dststride, 
> uint8_t *src, ptrdiff_t srcstride, int h, int x, int y) { \
> -    int i; \
> -    for (i = 0; i < h; i++, dst+= dststride, src+= srcstride) { \
> -        memcpy(dst, src, WIDTH); \
> -    } \
> -}
> +#define PUT_PIXELS(WIDTH)                                                    
>  \
> +    static void put_vp8_pixels ## WIDTH ## _c(uint8_t *dst, ptrdiff_t 
> dststride, \
> +                                              uint8_t *src, ptrdiff_t 
> srcstride, \
> +                                              int h, int x, int y) {         
>  \
> +        int i;                                                               
>  \
> +        for (i = 0; i < h; i++, dst += dststride, src += srcstride)          
>  \
> +            memcpy(dst, src, WIDTH);                                         
>  \
> +    }
>  

Drop the initial indentation level.

> -#define VP8_EPEL_H(SIZE, TAPS) \
> -static void put_vp8_epel ## SIZE ## _h ## TAPS ## _c(uint8_t *dst, ptrdiff_t 
> dststride, uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) \
> -{ \
> -    const uint8_t *filter = subpel_filters[mx-1]; \
> -    const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
> -    int x, y; \
> -\
> -    for (y = 0; y < h; y++) { \
> -        for (x = 0; x < SIZE; x++) \
> -            dst[x] = FILTER_ ## TAPS ## TAP(src, filter, 1); \
> -        dst += dststride; \
> -        src += srcstride; \
> -    } \
> -}
> -#define VP8_EPEL_V(SIZE, TAPS) \
> -static void put_vp8_epel ## SIZE ## _v ## TAPS ## _c(uint8_t *dst, ptrdiff_t 
> dststride, uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my) \
> -{ \
> -    const uint8_t *filter = subpel_filters[my-1]; \
> -    const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
> -    int x, y; \
> -\
> -    for (y = 0; y < h; y++) { \
> -        for (x = 0; x < SIZE; x++) \
> -            dst[x] = FILTER_ ## TAPS ## TAP(src, filter, srcstride); \
> -        dst += dststride; \
> -        src += srcstride; \
> -    } \
> -}
> +#define VP8_EPEL_H(SIZE, TAPS)                                               
>  \
> +    static void put_vp8_epel ## SIZE ## _h ## TAPS ## _c(uint8_t *dst,       
>  \
> +                                                         ptrdiff_t 
> dststride, \
> +                                                         uint8_t *src,       
>  \
> +                                                         ptrdiff_t 
> srcstride, \
> +                                                         int h, int mx, int 
> my) \
> +    {                                                                        
>  \
> +        const uint8_t *filter = subpel_filters[mx - 1];                      
>  \
> +        const uint8_t *cm     = ff_crop_tab + MAX_NEG_CROP;                  
>  \
> +        int x, y;                                                            
>  \
> +        for (y = 0; y < h; y++) {                                            
>  \
> +            for (x = 0; x < SIZE; x++)                                       
>  \
> +                dst[x] = FILTER_ ## TAPS ## TAP(src, filter, 1);             
>  \
> +            dst += dststride;                                                
>  \
> +            src += srcstride;                                                
>  \
> +        }                                                                    
>  \
> +    }
> +#define VP8_EPEL_V(SIZE, TAPS)                                               
>  \
> +    static void put_vp8_epel ## SIZE ## _v ## TAPS ## _c(uint8_t *dst,       
>  \
> +                                                         ptrdiff_t 
> dststride, \
> +                                                         uint8_t *src,       
>  \
> +                                                         ptrdiff_t 
> srcstride, \
> +                                                         int h, int mx, int 
> my) \
> +    {                                                                        
>  \
> +        const uint8_t *filter = subpel_filters[my - 1];                      
>  \
> +        const uint8_t *cm     = ff_crop_tab + MAX_NEG_CROP;                  
>  \
> +        int x, y;                                                            
>  \
> +        for (y = 0; y < h; y++) {                                            
>  \
> +            for (x = 0; x < SIZE; x++)                                       
>  \
> +                dst[x] = FILTER_ ## TAPS ## TAP(src, filter, srcstride);     
>  \
> +            dst += dststride;                                                
>  \
> +            src += srcstride;                                                
>  \
> +        }                                                                    
>  \
> +    }

Drop the initial indentation level and add empty lines between macro
definitions.

same below

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to