]> granicus.if.org Git - libx264/commitdiff
Cosmetics
authorAnton Mitrofanov <BugMaster@narod.ru>
Sat, 26 Nov 2016 12:30:58 +0000 (15:30 +0300)
committerHenrik Gramner <henrik@gramner.com>
Thu, 1 Dec 2016 17:00:07 +0000 (18:00 +0100)
Also make x264_weighted_reference_duplicate() static.

42 files changed:
common/aarch64/mc-c.c
common/aarch64/predict-c.c
common/arm/mc-c.c
common/arm/predict-c.c
common/bitstream.c
common/bitstream.h
common/cabac.h
common/common.c
common/common.h
common/dct.h
common/deblock.c
common/frame.c
common/frame.h
common/macroblock.c
common/macroblock.h
common/mc.h
common/mips/pixel-c.c
common/mips/predict-c.c
common/mips/quant-c.c
common/opencl.c
common/opencl/x264-cl.h
common/pixel.h
common/ppc/deblock.c
common/ppc/pixel.c
common/ppc/predict.h
common/predict.c
common/predict.h
common/x86/mc-c.c
common/x86/predict.h
encoder/analyse.h
encoder/cabac.c
encoder/encoder.c
encoder/macroblock.h
encoder/me.c
encoder/me.h
encoder/ratecontrol.c
encoder/ratecontrol.h
encoder/rdo.c
encoder/set.c
output/matroska.c
x264.c
x264.h

index 09794d814833a6ec79c5de8cc9f95404bf1fcb3d..11e87606595b3cdbbef1064ec96fc54fd579d20e 100644 (file)
@@ -154,7 +154,7 @@ static void mc_luma_neon( uint8_t *dst,    intptr_t i_dst_stride,
     int qpel_idx = ((mvy&3)<<2) + (mvx&3);
     intptr_t offset = (mvy>>2)*i_src_stride + (mvx>>2);
     uint8_t *src1 = src[x264_hpel_ref0[qpel_idx]] + offset;
-    if ( (mvy&3) == 3 )             // explict if() to force conditional add
+    if( (mvy&3) == 3 )             // explict if() to force conditional add
         src1 += i_src_stride;
 
     if( qpel_idx & 5 ) /* qpel interpolation needed */
@@ -180,7 +180,7 @@ static uint8_t *get_ref_neon( uint8_t *dst,   intptr_t *i_dst_stride,
     int qpel_idx = ((mvy&3)<<2) + (mvx&3);
     intptr_t offset = (mvy>>2)*i_src_stride + (mvx>>2);
     uint8_t *src1 = src[x264_hpel_ref0[qpel_idx]] + offset;
-    if ( (mvy&3) == 3 )             // explict if() to force conditional add
+    if( (mvy&3) == 3 )             // explict if() to force conditional add
         src1 += i_src_stride;
 
     if( qpel_idx & 5 ) /* qpel interpolation needed */
index c06e7d1a20a811a62798f64dc5c3a4eaabe5317f..5e8525375594b62abf3794155068cca86524d114 100644 (file)
@@ -54,13 +54,13 @@ void x264_predict_16x16_p_neon( uint8_t *src );
 void x264_predict_4x4_init_aarch64( int cpu, x264_predict_t pf[12] )
 {
 #if !HIGH_BIT_DEPTH
-    if (cpu&X264_CPU_ARMV8)
+    if( cpu&X264_CPU_ARMV8 )
     {
         pf[I_PRED_4x4_H]   = x264_predict_4x4_h_aarch64;
         pf[I_PRED_4x4_V]   = x264_predict_4x4_v_aarch64;
     }
 
-    if (cpu&X264_CPU_NEON)
+    if( cpu&X264_CPU_NEON )
     {
         pf[I_PRED_4x4_DC]     = x264_predict_4x4_dc_neon;
         pf[I_PRED_4x4_DC_TOP] = x264_predict_4x4_dc_top_neon;
@@ -73,11 +73,12 @@ void x264_predict_4x4_init_aarch64( int cpu, x264_predict_t pf[12] )
 void x264_predict_8x8c_init_aarch64( int cpu, x264_predict_t pf[7] )
 {
 #if !HIGH_BIT_DEPTH
-    if (cpu&X264_CPU_ARMV8) {
+    if( cpu&X264_CPU_ARMV8 )
+    {
         pf[I_PRED_CHROMA_V]   = x264_predict_8x8c_v_aarch64;
     }
 
-    if (!(cpu&X264_CPU_NEON))
+    if( !(cpu&X264_CPU_NEON) )
         return;
 
     pf[I_PRED_CHROMA_DC]      = x264_predict_8x8c_dc_neon;
@@ -91,7 +92,7 @@ void x264_predict_8x8c_init_aarch64( int cpu, x264_predict_t pf[7] )
 
 void x264_predict_8x16c_init_aarch64( int cpu, x264_predict_t pf[7] )
 {
-    if (!(cpu&X264_CPU_NEON))
+    if( !(cpu&X264_CPU_NEON) )
         return;
 
 #if !HIGH_BIT_DEPTH
@@ -106,7 +107,7 @@ void x264_predict_8x16c_init_aarch64( int cpu, x264_predict_t pf[7] )
 
 void x264_predict_8x8_init_aarch64( int cpu, x264_predict8x8_t pf[12], x264_predict_8x8_filter_t *predict_filter )
 {
-    if (!(cpu&X264_CPU_NEON))
+    if( !(cpu&X264_CPU_NEON) )
         return;
 
 #if !HIGH_BIT_DEPTH
@@ -124,7 +125,7 @@ void x264_predict_8x8_init_aarch64( int cpu, x264_predict8x8_t pf[12], x264_pred
 
 void x264_predict_16x16_init_aarch64( int cpu, x264_predict_t pf[7] )
 {
-    if (!(cpu&X264_CPU_NEON))
+    if( !(cpu&X264_CPU_NEON) )
         return;
 
 #if !HIGH_BIT_DEPTH
index ae1a68616b83e8215111f52c576c2175ed30179e..93490630bb7a0d0ec9bccb30302b2905f577e026 100644 (file)
@@ -161,7 +161,7 @@ static void mc_luma_neon( uint8_t *dst,    intptr_t i_dst_stride,
     int qpel_idx = ((mvy&3)<<2) + (mvx&3);
     intptr_t offset = (mvy>>2)*i_src_stride + (mvx>>2);
     uint8_t *src1 = src[x264_hpel_ref0[qpel_idx]] + offset;
-    if ( (mvy&3) == 3 )             // explict if() to force conditional add
+    if( (mvy&3) == 3 )             // explict if() to force conditional add
         src1 += i_src_stride;
 
     if( qpel_idx & 5 ) /* qpel interpolation needed */
@@ -187,7 +187,7 @@ static uint8_t *get_ref_neon( uint8_t *dst,   intptr_t *i_dst_stride,
     int qpel_idx = ((mvy&3)<<2) + (mvx&3);
     intptr_t offset = (mvy>>2)*i_src_stride + (mvx>>2);
     uint8_t *src1 = src[x264_hpel_ref0[qpel_idx]] + offset;
-    if ( (mvy&3) == 3 )             // explict if() to force conditional add
+    if( (mvy&3) == 3 )             // explict if() to force conditional add
         src1 += i_src_stride;
 
     if( qpel_idx & 5 ) /* qpel interpolation needed */
index eb52d396e7c144da0857736decafb0647d0d9025..28e7e7d748f375122df042a62c54b16de09efb31 100644 (file)
@@ -29,7 +29,7 @@
 
 void x264_predict_4x4_init_arm( int cpu, x264_predict_t pf[12] )
 {
-    if (!(cpu&X264_CPU_ARMV6))
+    if( !(cpu&X264_CPU_ARMV6) )
         return;
 
 #if !HIGH_BIT_DEPTH
@@ -38,7 +38,7 @@ void x264_predict_4x4_init_arm( int cpu, x264_predict_t pf[12] )
     pf[I_PRED_4x4_DC]  = x264_predict_4x4_dc_armv6;
     pf[I_PRED_4x4_DDR] = x264_predict_4x4_ddr_armv6;
 
-    if (!(cpu&X264_CPU_NEON))
+    if( !(cpu&X264_CPU_NEON) )
         return;
 
     pf[I_PRED_4x4_DC_TOP] = x264_predict_4x4_dc_top_neon;
@@ -48,7 +48,7 @@ void x264_predict_4x4_init_arm( int cpu, x264_predict_t pf[12] )
 
 void x264_predict_8x8c_init_arm( int cpu, x264_predict_t pf[7] )
 {
-    if (!(cpu&X264_CPU_NEON))
+    if( !(cpu&X264_CPU_NEON) )
         return;
 
 #if !HIGH_BIT_DEPTH
@@ -63,7 +63,7 @@ void x264_predict_8x8c_init_arm( int cpu, x264_predict_t pf[7] )
 
 void x264_predict_8x16c_init_arm( int cpu, x264_predict_t pf[7] )
 {
-    if (!(cpu&X264_CPU_NEON))
+    if( !(cpu&X264_CPU_NEON) )
         return;
 
 #if !HIGH_BIT_DEPTH
@@ -76,7 +76,7 @@ void x264_predict_8x16c_init_arm( int cpu, x264_predict_t pf[7] )
 
 void x264_predict_8x8_init_arm( int cpu, x264_predict8x8_t pf[12], x264_predict_8x8_filter_t *predict_filter )
 {
-    if (!(cpu&X264_CPU_NEON))
+    if( !(cpu&X264_CPU_NEON) )
         return;
 
 #if !HIGH_BIT_DEPTH
@@ -94,7 +94,7 @@ void x264_predict_8x8_init_arm( int cpu, x264_predict8x8_t pf[12], x264_predict_
 
 void x264_predict_16x16_init_arm( int cpu, x264_predict_t pf[7] )
 {
-    if (!(cpu&X264_CPU_NEON))
+    if( !(cpu&X264_CPU_NEON) )
         return;
 
 #if !HIGH_BIT_DEPTH
index f1a49968dfa21eb9404bbad904dc08933d6f38dd..3984bd1a4c6290192e7003e78578cbb7590ad317 100644 (file)
@@ -50,8 +50,8 @@ void x264_cabac_block_residual_8x8_rd_internal_sse2       ( dctcoef *l, int b_in
 void x264_cabac_block_residual_8x8_rd_internal_sse2_lzcnt ( dctcoef *l, int b_interlaced, intptr_t ctx_block_cat, x264_cabac_t *cb );
 void x264_cabac_block_residual_8x8_rd_internal_ssse3      ( dctcoef *l, int b_interlaced, intptr_t ctx_block_cat, x264_cabac_t *cb );
 void x264_cabac_block_residual_8x8_rd_internal_ssse3_lzcnt( dctcoef *l, int b_interlaced, intptr_t ctx_block_cat, x264_cabac_t *cb );
-void x264_cabac_block_residual_internal_sse2       ( dctcoef *l, int b_interlaced, intptr_t ctx_block_cat, x264_cabac_t *cb );
-void x264_cabac_block_residual_internal_sse2_lzcnt ( dctcoef *l, int b_interlaced, intptr_t ctx_block_cat, x264_cabac_t *cb );
+void x264_cabac_block_residual_internal_sse2      ( dctcoef *l, int b_interlaced, intptr_t ctx_block_cat, x264_cabac_t *cb );
+void x264_cabac_block_residual_internal_sse2_lzcnt( dctcoef *l, int b_interlaced, intptr_t ctx_block_cat, x264_cabac_t *cb );
 void x264_cabac_block_residual_internal_avx2_bmi2 ( dctcoef *l, int b_interlaced, intptr_t ctx_block_cat, x264_cabac_t *cb );
 
 uint8_t *x264_nal_escape_neon( uint8_t *dst, uint8_t *src, uint8_t *end );
index a58746bcce6151727efda034f79e3b940f0dbaef..b26cf6b2f0ded42f08f726e692aa73a9039c2a14 100644 (file)
@@ -68,7 +68,7 @@ extern const vlc_t x264_total_zeros_2x4_dc[7][8];
 
 typedef struct
 {
-    uint8_t *(*nal_escape) ( uint8_t *dst, uint8_t *src, uint8_t *end );
+    uint8_t *(*nal_escape)( uint8_t *dst, uint8_t *src, uint8_t *end );
     void (*cabac_block_residual_internal)( dctcoef *l, int b_interlaced,
                                            intptr_t ctx_block_cat, x264_cabac_t *cb );
     void (*cabac_block_residual_rd_internal)( dctcoef *l, int b_interlaced,
index cf07254fe95e60e4e581b0f9aad1462d6c09d2a9..fc6c69bcb8c2bcdceb80bbf1a6448804d40ad0c6 100644 (file)
@@ -58,7 +58,7 @@ extern const uint16_t x264_cabac_entropy[128];
 void x264_cabac_context_init( x264_t *h, x264_cabac_t *cb, int i_slice_type, int i_qp, int i_model );
 
 void x264_cabac_encode_init_core( x264_cabac_t *cb );
-void x264_cabac_encode_init ( x264_cabac_t *cb, uint8_t *p_data, uint8_t *p_end );
+void x264_cabac_encode_init( x264_cabac_t *cb, uint8_t *p_data, uint8_t *p_end );
 void x264_cabac_encode_decision_c( x264_cabac_t *cb, int i_ctx, int b );
 void x264_cabac_encode_decision_asm( x264_cabac_t *cb, int i_ctx, int b );
 void x264_cabac_encode_bypass_c( x264_cabac_t *cb, int b );
index 029f7b39348c8c538335641f18d7cbfd9e004bf5..f4b4d42386a84ecf9cbbe5aa85e25eb719e48329 100644 (file)
@@ -610,7 +610,7 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
 
 #define OPT(STR) else if( !strcmp( name, STR ) )
 #define OPT2(STR0, STR1) else if( !strcmp( name, STR0 ) || !strcmp( name, STR1 ) )
-    if(0);
+    if( 0 );
     OPT("asm")
     {
         p->cpu = isdigit(value[0]) ? atoi(value) :
index 3a74c9e7bb60d09208ff46c9b2603f0aee804342..3f71fbc6a93a395131c6d9b27df493bc5c02091b 100644 (file)
@@ -36,7 +36,7 @@
 #define X264_MAX3(a,b,c) X264_MAX((a),X264_MAX((b),(c)))
 #define X264_MIN4(a,b,c,d) X264_MIN((a),X264_MIN3((b),(c),(d)))
 #define X264_MAX4(a,b,c,d) X264_MAX((a),X264_MAX3((b),(c),(d)))
-#define XCHG(type,a,b) do{ type t = a; a = b; b = t; } while(0)
+#define XCHG(type,a,b) do { type t = a; a = b; b = t; } while( 0 )
 #define IS_DISPOSABLE(type) ( type == X264_TYPE_B )
 #define FIX8(f) ((int)(f*(1<<8)+.5))
 #define ALIGN(x,a) (((x)+((a)-1))&~((a)-1))
@@ -70,14 +70,14 @@ do {\
     var = (void*)prealloc_size;\
     preallocs[prealloc_idx++] = (uint8_t**)&var;\
     prealloc_size += ALIGN(size, NATIVE_ALIGN);\
-} while(0)
+} while( 0 )
 
 #define PREALLOC_END( ptr )\
 do {\
     CHECKED_MALLOC( ptr, prealloc_size );\
     while( prealloc_idx-- )\
         *preallocs[prealloc_idx] += (intptr_t)ptr;\
-} while(0)
+} while( 0 )
 
 #define ARRAY_SIZE(array)  (sizeof(array)/sizeof(array[0]))
 
index 91c343a546eca33fa6adfa51e0536ea9bff90c76..565adff8e6227763735b5f3e62605928680f2e2f 100644 (file)
@@ -36,22 +36,22 @@ typedef struct
     // pix1  stride = FENC_STRIDE
     // pix2  stride = FDEC_STRIDE
     // p_dst stride = FDEC_STRIDE
-    void (*sub4x4_dct)   ( dctcoef dct[16], pixel *pix1, pixel *pix2 );
-    void (*add4x4_idct)  ( pixel *p_dst, dctcoef dct[16] );
+    void (*sub4x4_dct) ( dctcoef dct[16], pixel *pix1, pixel *pix2 );
+    void (*add4x4_idct)( pixel *p_dst, dctcoef dct[16] );
 
-    void (*sub8x8_dct)   ( dctcoef dct[4][16], pixel *pix1, pixel *pix2 );
-    void (*sub8x8_dct_dc)( dctcoef dct[4], pixel *pix1, pixel *pix2 );
-    void (*add8x8_idct)  ( pixel *p_dst, dctcoef dct[4][16] );
-    void (*add8x8_idct_dc) ( pixel *p_dst, dctcoef dct[4] );
+    void (*sub8x8_dct)    ( dctcoef dct[4][16], pixel *pix1, pixel *pix2 );
+    void (*sub8x8_dct_dc) ( dctcoef dct[4], pixel *pix1, pixel *pix2 );
+    void (*add8x8_idct)   ( pixel *p_dst, dctcoef dct[4][16] );
+    void (*add8x8_idct_dc)( pixel *p_dst, dctcoef dct[4] );
 
     void (*sub8x16_dct_dc)( dctcoef dct[8], pixel *pix1, pixel *pix2 );
 
-    void (*sub16x16_dct) ( dctcoef dct[16][16], pixel *pix1, pixel *pix2 );
-    void (*add16x16_idct)( pixel *p_dst, dctcoef dct[16][16] );
-    void (*add16x16_idct_dc) ( pixel *p_dst, dctcoef dct[16] );
+    void (*sub16x16_dct)    ( dctcoef dct[16][16], pixel *pix1, pixel *pix2 );
+    void (*add16x16_idct)   ( pixel *p_dst, dctcoef dct[16][16] );
+    void (*add16x16_idct_dc)( pixel *p_dst, dctcoef dct[16] );
 
-    void (*sub8x8_dct8)  ( dctcoef dct[64], pixel *pix1, pixel *pix2 );
-    void (*add8x8_idct8) ( pixel *p_dst, dctcoef dct[64] );
+    void (*sub8x8_dct8) ( dctcoef dct[64], pixel *pix1, pixel *pix2 );
+    void (*add8x8_idct8)( pixel *p_dst, dctcoef dct[64] );
 
     void (*sub16x16_dct8) ( dctcoef dct[4][64], pixel *pix1, pixel *pix2 );
     void (*add16x16_idct8)( pixel *p_dst, dctcoef dct[4][64] );
index 636bf3ee37bc612ebdac653bda0f59ef93ba9be6..02023192a81c1ec2b7cb720167444b527dcb244c 100644 (file)
@@ -442,7 +442,7 @@ void x264_frame_deblock_row( x264_t *h, int mb_y )
                                      stride2uv, bs[dir][edge], chroma_qp, a, b, 1,\
                                      h->loopf.deblock_chroma##intra[dir] );\
             }\
-        } while(0)
+        } while( 0 )
 
         if( h->mb.i_neighbour & MB_LEFT )
         {
@@ -638,7 +638,7 @@ void x264_macroblock_deblock( x264_t *h )
                           FDEC_STRIDE, bs[dir][edge], qpc, a, b, 0,\
                           h->loopf.deblock_luma[dir] );\
         }\
-    } while(0)
+    } while( 0 )
 
     if( !transform_8x8 ) FILTER( 0, 1 );
                          FILTER( 0, 2 );
index ab0c7b3262ba77114efa3211495c99a56757e171..b7deea0e4cd845f17d0f828d5aa7af26f9150cd1 100644 (file)
@@ -357,7 +357,7 @@ static int get_plane_ptr( x264_t *h, x264_picture_t *src, uint8_t **pix, int *st
     return 0;
 }
 
-#define get_plane_ptr(...) do{ if( get_plane_ptr(__VA_ARGS__) < 0 ) return -1; }while(0)
+#define get_plane_ptr(...) do { if( get_plane_ptr(__VA_ARGS__) < 0 ) return -1; } while( 0 )
 
 int x264_frame_copy_picture( x264_t *h, x264_frame_t *dst, x264_picture_t *src )
 {
index b8ff9113825957cd534620fb14ab72cdc0c4d783..5276f45522ae5c411557d7308dc9af89264d037a 100644 (file)
@@ -211,9 +211,9 @@ typedef struct
     x264_deblock_intra_t deblock_chroma_intra_mbaff;
     x264_deblock_intra_t deblock_chroma_420_intra_mbaff;
     x264_deblock_intra_t deblock_chroma_422_intra_mbaff;
-    void (*deblock_strength) ( uint8_t nnz[X264_SCAN8_SIZE], int8_t ref[2][X264_SCAN8_LUMA_SIZE],
-                               int16_t mv[2][X264_SCAN8_LUMA_SIZE][2], uint8_t bs[2][8][4], int mvy_limit,
-                               int bframe );
+    void (*deblock_strength)( uint8_t nnz[X264_SCAN8_SIZE], int8_t ref[2][X264_SCAN8_LUMA_SIZE],
+                              int16_t mv[2][X264_SCAN8_LUMA_SIZE][2], uint8_t bs[2][8][4], int mvy_limit,
+                              int bframe );
 } x264_deblock_function_t;
 
 void          x264_frame_delete( x264_frame_t *frame );
index 081683cd58088731654f3e629f3ef7e36e7da95a..6c122018a67b098621fa1e03233355cefd3cdd63 100644 (file)
@@ -1183,7 +1183,7 @@ static void ALWAYS_INLINE x264_macroblock_cache_load( x264_t *h, int mb_x, int m
                 M16( h->mb.cache.mvd[l][x264_scan8[0]-1+0*8] ) = 0;
                 M16( h->mb.cache.mvd[l][x264_scan8[0]-1+1*8] ) = 0;
             }
-            if( h->mb.i_neighbour & MB_LEFT && (!b_mbaff || h->mb.cache.ref[l][x264_scan8[0]-1+2*8] >=0) )
+            if( h->mb.i_neighbour & MB_LEFT && (!b_mbaff || h->mb.cache.ref[l][x264_scan8[0]-1+2*8] >= 0) )
             {
                 CP16( h->mb.cache.mvd[l][x264_scan8[8 ] - 1], mvd[left[LBOT]][left_index_table->intra[2]] );
                 CP16( h->mb.cache.mvd[l][x264_scan8[10] - 1], mvd[left[LBOT]][left_index_table->intra[3]] );
index 9a556ac64e5f2bfba457ddff8896c6359bc26176..d548acb14bdc6bca7f5d0a6329c93e95d808d702 100644 (file)
@@ -108,10 +108,10 @@ static const uint8_t x264_mb_type_list_table[X264_MBTYPE_MAX][2][2] =
     {{0,0},{0,0}}                                               /* B_SKIP */
 };
 
-#define IS_SUB4x4(type) ( (type ==D_L0_4x4)||(type ==D_L1_4x4)||(type ==D_BI_4x4))
-#define IS_SUB4x8(type) ( (type ==D_L0_4x8)||(type ==D_L1_4x8)||(type ==D_BI_4x8))
-#define IS_SUB8x4(type) ( (type ==D_L0_8x4)||(type ==D_L1_8x4)||(type ==D_BI_8x4))
-#define IS_SUB8x8(type) ( (type ==D_L0_8x8)||(type ==D_L1_8x8)||(type ==D_BI_8x8)||(type ==D_DIRECT_8x8))
+#define IS_SUB4x4(type) ( (type == D_L0_4x4)||(type == D_L1_4x4)||(type == D_BI_4x4) )
+#define IS_SUB4x8(type) ( (type == D_L0_4x8)||(type == D_L1_4x8)||(type == D_BI_4x8) )
+#define IS_SUB8x4(type) ( (type == D_L0_8x4)||(type == D_L1_8x4)||(type == D_BI_8x4) )
+#define IS_SUB8x8(type) ( (type == D_L0_8x8)||(type == D_L1_8x8)||(type == D_BI_8x8)||(type == D_DIRECT_8x8) )
 enum mb_partition_e
 {
     /* sub partition type for P_8x8 and B_8x8 */
index 5a83ec228b7b2f9a9f5f600adf0baa2f44a6ff27..f6a6fd50802f3fdbfcc79c2668943f9352e81754 100644 (file)
@@ -32,7 +32,7 @@ do\
 {\
     MC_CLIP_ADD((s)[0], (x)[0]);\
     MC_CLIP_ADD((s)[1], (x)[1]);\
-} while(0)
+} while( 0 )
 
 #define PROPAGATE_LIST(cpu)\
 void x264_mbtree_propagate_list_internal_##cpu( int16_t (*mvs)[2], int16_t *propagate_amount,\
index d583d79e309236442a218d26a71143bacc3b95b1..6cac977be2a33f588bcb9eba93b6b651387cc2d3 100644 (file)
@@ -65,7 +65,7 @@ static uint32_t sad_4width_msa( uint8_t *p_src, int32_t i_src_stride,
     v16u8 diff;
     v8u16 sad = { 0 };
 
-    for ( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
+    for( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
     {
         LW4( p_src, i_src_stride, u_src0, u_src1, u_src2, u_src3 );
         p_src += ( 4 * i_src_stride );
@@ -90,7 +90,7 @@ static uint32_t sad_8width_msa( uint8_t *p_src, int32_t i_src_stride,
     v16u8 src0, src1, src2, src3, ref0, ref1, ref2, ref3;
     v8u16 sad = { 0 };
 
-    for ( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
+    for( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
     {
         LD_UB4( p_src, i_src_stride, src0, src1, src2, src3 );
         p_src += ( 4 * i_src_stride );
@@ -113,7 +113,7 @@ static uint32_t sad_16width_msa( uint8_t *p_src, int32_t i_src_stride,
     v16u8 src0, src1, ref0, ref1;
     v8u16 sad = { 0 };
 
-    for ( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
+    for( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
     {
         LD_UB2( p_src, i_src_stride, src0, src1 );
         p_src += ( 2 * i_src_stride );
@@ -147,7 +147,7 @@ static void sad_4width_x3d_msa( uint8_t *p_src, int32_t i_src_stride,
     v8u16 sad1 = { 0 };
     v8u16 sad2 = { 0 };
 
-    for ( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
+    for( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
     {
         LW4( p_src, i_src_stride, src0, src1, src2, src3 );
         INSERT_W4_UB( src0, src1, src2, src3, src );
@@ -192,7 +192,7 @@ static void sad_8width_x3d_msa( uint8_t *p_src, int32_t i_src_stride,
     v8u16 sad1 = { 0 };
     v8u16 sad2 = { 0 };
 
-    for ( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
+    for( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
     {
         LD_UB4( p_src, i_src_stride, src0, src1, src2, src3 );
         p_src += ( 4 * i_src_stride );
@@ -233,7 +233,7 @@ static void sad_16width_x3d_msa( uint8_t *p_src, int32_t i_src_stride,
     v8u16 sad1 = { 0 };
     v8u16 sad2 = { 0 };
 
-    for ( i_ht_cnt = ( i_height >> 1 ); i_ht_cnt--; )
+    for( i_ht_cnt = ( i_height >> 1 ); i_ht_cnt--; )
     {
         src = LD_UB( p_src );
         p_src += i_src_stride;
@@ -298,7 +298,7 @@ static void sad_4width_x4d_msa( uint8_t *p_src, int32_t i_src_stride,
     p_ref2 = p_aref[2];
     p_ref3 = p_aref[3];
 
-    for ( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
+    for( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
     {
         LW4( p_src, i_src_stride, src0, src1, src2, src3 );
         INSERT_W4_UB( src0, src1, src2, src3, src );
@@ -358,7 +358,7 @@ static void sad_8width_x4d_msa( uint8_t *p_src, int32_t i_src_stride,
     p_ref2 = p_aref[2];
     p_ref3 = p_aref[3];
 
-    for ( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
+    for( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
     {
         LD_UB4( p_src, i_src_stride, src0, src1, src2, src3 );
         p_src += ( 4 * i_src_stride );
@@ -408,7 +408,7 @@ static void sad_16width_x4d_msa( uint8_t *p_src, int32_t i_src_stride,
     p_ref2 = p_aref[2];
     p_ref3 = p_aref[3];
 
-    for ( i_ht_cnt = ( i_height >> 1 ); i_ht_cnt--; )
+    for( i_ht_cnt = ( i_height >> 1 ); i_ht_cnt--; )
     {
         src = LD_UB( p_src );
         p_src += i_src_stride;
@@ -465,7 +465,7 @@ static uint64_t avc_pixel_var16width_msa( uint8_t *p_pix, int32_t i_stride,
     v8u16 add, pix_r, pix_l;
     v4u32 sqr = { 0 };
 
-    for ( u_cnt = i_height; u_cnt--; )
+    for( u_cnt = i_height; u_cnt--; )
     {
         pix = LD_SB( p_pix );
         p_pix += i_stride;
@@ -489,7 +489,7 @@ static uint64_t avc_pixel_var8width_msa( uint8_t *p_pix, int32_t i_stride,
     v8u16 add, pix_r;
     v4u32 sqr = { 0 };
 
-    for ( u_cnt = i_height; u_cnt--; )
+    for( u_cnt = i_height; u_cnt--; )
     {
         pix = LD_SB( p_pix );
         p_pix += i_stride;
@@ -515,7 +515,7 @@ static uint32_t sse_diff_8width_msa( uint8_t *p_src, int32_t i_src_stride,
     v8i16 avg = { 0 };
     v4i32 vec, var = { 0 };
 
-    for ( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
+    for( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
     {
         LD_UB4( p_src, i_src_stride, src0, src1, src2, src3 );
         p_src += ( 4 * i_src_stride );
@@ -547,7 +547,7 @@ static uint32_t sse_4width_msa( uint8_t *p_src, int32_t i_src_stride,
     v16u8 ref = { 0 };
     v4i32 var = { 0 };
 
-    for ( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
+    for( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
     {
         LW4( p_src, i_src_stride, u_src0, u_src1, u_src2, u_src3 );
         p_src += ( 4 * i_src_stride );
@@ -574,7 +574,7 @@ static uint32_t sse_8width_msa( uint8_t *p_src, int32_t i_src_stride,
     v16u8 ref0, ref1, ref2, ref3;
     v4i32 var = { 0 };
 
-    for ( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
+    for( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
     {
         LD_UB4( p_src, i_src_stride, src0, src1, src2, src3 );
         p_src += ( 4 * i_src_stride );
@@ -601,7 +601,7 @@ static uint32_t sse_16width_msa( uint8_t *p_src, int32_t i_src_stride,
     v16u8 src, ref;
     v4i32 var = { 0 };
 
-    for ( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
+    for( i_ht_cnt = ( i_height >> 2 ); i_ht_cnt--; )
     {
         src = LD_UB( p_src );
         p_src += i_src_stride;
@@ -715,7 +715,7 @@ static int32_t pixel_satd_4width_msa( uint8_t *p_src, int32_t i_src_stride,
     v8i16 diff0, diff1, diff2, diff3;
     v8i16 temp0, temp1, temp2, temp3;
 
-    for ( cnt = i_height >> 2; cnt--; )
+    for( cnt = i_height >> 2; cnt--; )
     {
         LD_SB4( p_src, i_src_stride, src0, src1, src2, src3 );
         p_src += 4 * i_src_stride;
@@ -759,7 +759,7 @@ static int32_t pixel_satd_8width_msa( uint8_t *p_src, int32_t i_src_stride,
     v8i16 diff0, diff1, diff2, diff3, diff4, diff5, diff6, diff7;
     v8i16 temp0, temp1, temp2, temp3;
 
-    for ( cnt = i_height >> 2; cnt--; )
+    for( cnt = i_height >> 2; cnt--; )
     {
         LD_SB4( p_src, i_src_stride, src0, src1, src2, src3 );
         p_src += 4 * i_src_stride;
index d8183d61f6437993025cee952577234574c11764..631b20b10b85ab819a476daf6f46bf5cd53535c6 100644 (file)
@@ -101,7 +101,7 @@ static void intra_predict_horiz_16x16_msa( uint8_t *p_src, int32_t i_src_stride,
     uint8_t u_inp0, u_inp1, u_inp2, u_inp3;
     v16u8 src0, src1, src2, src3;
 
-    for ( u_row = 4; u_row--; )
+    for( u_row = 4; u_row--; )
     {
         u_inp0 = p_src[0];
         p_src += i_src_stride;
@@ -133,7 +133,7 @@ static void intra_predict_dc_4x4_msa( uint8_t *p_src_top, uint8_t *p_src_left,
     v8u16 sum_above;
     v4u32 sum;
 
-    if ( is_left && is_above )
+    if( is_left && is_above )
     {
         src_above = LD_UB( p_src_top );
 
@@ -141,7 +141,7 @@ static void intra_predict_dc_4x4_msa( uint8_t *p_src_top, uint8_t *p_src_left,
         sum = __msa_hadd_u_w( sum_above, sum_above );
         u_addition = __msa_copy_u_w( ( v4i32 ) sum, 0 );
 
-        for ( u_row = 0; u_row < 4; u_row++ )
+        for( u_row = 0; u_row < 4; u_row++ )
         {
             u_addition += p_src_left[u_row * i_src_stride_left];
         }
@@ -149,9 +149,9 @@ static void intra_predict_dc_4x4_msa( uint8_t *p_src_top, uint8_t *p_src_left,
         u_addition = ( u_addition + 4 ) >> 3;
         store = ( v16u8 ) __msa_fill_b( u_addition );
     }
-    else if ( is_left )
+    else if( is_left )
     {
-        for ( u_row = 0; u_row < 4; u_row++ )
+        for( u_row = 0; u_row < 4; u_row++ )
         {
             u_addition += p_src_left[u_row * i_src_stride_left];
         }
@@ -159,7 +159,7 @@ static void intra_predict_dc_4x4_msa( uint8_t *p_src_top, uint8_t *p_src_left,
         u_addition = ( u_addition + 2 ) >> 2;
         store = ( v16u8 ) __msa_fill_b( u_addition );
     }
-    else if ( is_above )
+    else if( is_above )
     {
         src_above = LD_UB( p_src_top );
 
@@ -217,7 +217,7 @@ static void intra_predict_dc_16x16_msa( uint8_t *p_src_top, uint8_t *p_src_left,
     v4u32 sum_top;
     v2u64 sum;
 
-    if ( is_left && is_above )
+    if( is_left && is_above )
     {
         src_above = LD_UB( p_src_top );
 
@@ -228,7 +228,7 @@ static void intra_predict_dc_16x16_msa( uint8_t *p_src_top, uint8_t *p_src_left,
         sum = __msa_hadd_u_d( sum_top, sum_top );
         u_addition = __msa_copy_u_w( ( v4i32 ) sum, 0 );
 
-        for ( u_row = 0; u_row < 16; u_row++ )
+        for( u_row = 0; u_row < 16; u_row++ )
         {
             u_addition += p_src_left[u_row * i_src_stride_left];
         }
@@ -236,9 +236,9 @@ static void intra_predict_dc_16x16_msa( uint8_t *p_src_top, uint8_t *p_src_left,
         u_addition = ( u_addition + 16 ) >> 5;
         store = ( v16u8 ) __msa_fill_b( u_addition );
     }
-    else if ( is_left )
+    else if( is_left )
     {
-        for ( u_row = 0; u_row < 16; u_row++ )
+        for( u_row = 0; u_row < 16; u_row++ )
         {
             u_addition += p_src_left[u_row * i_src_stride_left];
         }
@@ -246,7 +246,7 @@ static void intra_predict_dc_16x16_msa( uint8_t *p_src_top, uint8_t *p_src_left,
         u_addition = ( u_addition + 8 ) >> 4;
         store = ( v16u8 ) __msa_fill_b( u_addition );
     }
-    else if ( is_above )
+    else if( is_above )
     {
         src_above = LD_UB( p_src_top );
 
@@ -314,7 +314,7 @@ static void intra_predict_plane_8x8_msa( uint8_t *p_src, int32_t i_stride )
     vec5 = vec8 * int_multiplier;
     vec3 = vec8 * 4;
 
-    for ( u_lpcnt = 4; u_lpcnt--; )
+    for( u_lpcnt = 4; u_lpcnt--; )
     {
         vec0 = vec5;
         vec0 += vec4;
@@ -391,7 +391,7 @@ static void intra_predict_plane_16x16_msa( uint8_t *p_src, int32_t i_stride )
     vec6 = vec8 * 4;
     vec7 = vec8 * int_multiplier;
 
-    for ( u_lpcnt = 16; u_lpcnt--; )
+    for( u_lpcnt = 16; u_lpcnt--; )
     {
         vec0 = vec7;
         vec0 += vec4;
@@ -424,7 +424,7 @@ static void intra_predict_dc_4blk_8x8_msa( uint8_t *p_src, int32_t i_stride )
     u_src0 = __msa_copy_u_w( ( v4i32 ) sum, 0 );
     u_src1 = __msa_copy_u_w( ( v4i32 ) sum, 1 );
 
-    for ( u_lp_cnt = 0; u_lp_cnt < 4; u_lp_cnt++ )
+    for( u_lp_cnt = 0; u_lp_cnt < 4; u_lp_cnt++ )
     {
         u_src0 += p_src[u_lp_cnt * i_stride - 1];
         u_src2 += p_src[( 4 + u_lp_cnt ) * i_stride - 1];
@@ -440,7 +440,7 @@ static void intra_predict_dc_4blk_8x8_msa( uint8_t *p_src, int32_t i_stride )
     u_out2 = u_src2 * 0x01010101;
     u_out3 = u_src3 * 0x01010101;
 
-    for ( u_lp_cnt = 4; u_lp_cnt--; )
+    for( u_lp_cnt = 4; u_lp_cnt--; )
     {
         SW( u_out0, p_src );
         SW( u_out1, ( p_src + 4 ) );
index 2f7c5bc4dcc637b835294a9508db97c7495f438e..1296befc3b3884351173dc80492968593d1795bc 100644 (file)
@@ -40,7 +40,7 @@ static void avc_dequant_4x4_msa( int16_t *p_dct, int32_t pi_dequant_mf[6][16],
     LD_SW2( pi_dequant_mf[i_mf], 4, dequant_m_f0, dequant_m_f1 );
     LD_SW2( pi_dequant_mf[i_mf] + 8, 4, dequant_m_f2, dequant_m_f3 );
 
-    if ( q_bits >= 0 )
+    if( q_bits >= 0 )
     {
         v8i16 dequant_mf_h0, dequant_mf_h1, q_bits_vec;
 
@@ -106,7 +106,7 @@ static void avc_dequant_8x8_msa( int16_t *p_dct, int32_t pi_dequant_mf[6][64],
     LD_SW2( pi_dequant_mf[i_mf] + 48, 4, dequant_m_f12, dequant_m_f13 );
     LD_SW2( pi_dequant_mf[i_mf] + 56, 4, dequant_m_f14, dequant_m_f15 );
 
-    if ( q_bits >= 0 )
+    if( q_bits >= 0 )
     {
         v8i16 q_bits_vec;
         v8i16 dequant_mf_h0, dequant_mf_h1, dequant_mf_h2, dequant_mf_h3;
@@ -220,7 +220,7 @@ static void avc_dequant_4x4_dc_msa( int16_t *p_dct,
 
     LD_SH2( p_dct, 8, dct0, dct1 );
 
-    if ( q_bits >= 0 )
+    if( q_bits >= 0 )
     {
         i_dmf <<= q_bits;
 
index eac7f8e259ea9bb5dd7eacfc3f7ed9ab0e749e48..2a8293e03a81e74c0aa4f9b9621260844d570300 100644 (file)
@@ -135,7 +135,7 @@ static cl_program x264_opencl_cache_load( x264_t *h, const char *dev_name, const
     rewind( fp );
     CHECKED_MALLOC( binary, size );
 
-    if ( fread( binary, 1, size, fp ) != size )
+    if( fread( binary, 1, size, fp ) != size )
         goto fail;
     const uint8_t *ptr = (const uint8_t*)binary;
 
index 892904d966778d81cfa3458146c3cd702bc21e85..89539292c4ecc3037d4944e71b8b875f424e3f6d 100644 (file)
@@ -27,7 +27,7 @@ typedef uint32_t sum2_t;
 #define INTRA_MBS   2
 
 #define COPY2_IF_LT( x, y, a, b )\
-    if((y)<(x))\
+    if( (y) < (x) )\
     {\
         (x) = (y);\
         (a) = (b);\
index 35be44ca2cbc665e0b8e92e0ec4318cc8a24adc6..41b00d2666ad43516215d2e3eac0df9c11439a42 100644 (file)
@@ -30,9 +30,9 @@
 
 // SSD assumes all args aligned
 // other cmp functions assume first arg aligned
-typedef int  (*x264_pixel_cmp_t) ( pixel *, intptr_t, pixel *, intptr_t );
-typedef void (*x264_pixel_cmp_x3_t) ( pixel *, pixel *, pixel *, pixel *, intptr_t, int[3] );
-typedef void (*x264_pixel_cmp_x4_t) ( pixel *, pixel *, pixel *, pixel *, pixel *, intptr_t, int[4] );
+typedef int  (*x264_pixel_cmp_t)( pixel *, intptr_t, pixel *, intptr_t );
+typedef void (*x264_pixel_cmp_x3_t)( pixel *, pixel *, pixel *, pixel *, intptr_t, int[3] );
+typedef void (*x264_pixel_cmp_x4_t)( pixel *, pixel *, pixel *, pixel *, pixel *, intptr_t, int[4] );
 
 enum
 {
index f18db0ba465d04eb20d152e7ae2a151b3084959f..a31553d8f0ab365129c6046bbcc7f328ff024fcf 100644 (file)
@@ -248,14 +248,14 @@ static inline vec_u8_t h264_deblock_q1( register vec_u8_t p0, register vec_u8_t
     finaltc0 = vec_and((vec_u8_t)tc0vec, mask);                 /* tc = tc0 */               \
                                                                                              \
     p1mask = diff_lt_altivec(p2, p0, betavec);                                               \
-    p1mask = vec_and(p1mask, mask);                             /* if( |p2 - p0| < beta) */  \
+    p1mask = vec_and(p1mask, mask);                             /* if( |p2 - p0| < beta ) */ \
     tc0masked = vec_and(p1mask, (vec_u8_t)tc0vec);                                           \
     finaltc0 = vec_sub(finaltc0, p1mask);                       /* tc++ */                   \
     newp1 = h264_deblock_q1(p0, p1, p2, q0, tc0masked);                                      \
     /*end if*/                                                                               \
                                                                                              \
     q1mask = diff_lt_altivec(q2, q0, betavec);                                               \
-    q1mask = vec_and(q1mask, mask);                             /* if ( |q2 - q0| < beta ) */\
+    q1mask = vec_and(q1mask, mask);                             /* if( |q2 - q0| < beta ) */ \
     tc0masked = vec_and(q1mask, (vec_u8_t)tc0vec);                                           \
     finaltc0 = vec_sub(finaltc0, q1mask);                       /* tc++ */                   \
     newq1 = h264_deblock_q1(p0, q1, q2, q0, tc0masked);                                      \
index c190859bd4c26548efe59a58f7dab7186dfec520..567fe7f8a28fa50fcb1fb6212abf53aab9a7af1c 100644 (file)
@@ -1207,8 +1207,8 @@ static void pixel_sad_x3_8x8_altivec( uint8_t *fenc, uint8_t *pix0,
 * SSD routines
 **********************************************************************/
 
-static int pixel_ssd_16x16_altivec ( uint8_t *pix1, intptr_t i_stride_pix1,
-                                     uint8_t *pix2, intptr_t i_stride_pix2 )
+static int pixel_ssd_16x16_altivec( uint8_t *pix1, intptr_t i_stride_pix1,
+                                    uint8_t *pix2, intptr_t i_stride_pix2 )
 {
     ALIGNED_16( int sum );
 
@@ -1273,8 +1273,8 @@ static int pixel_ssd_16x16_altivec ( uint8_t *pix1, intptr_t i_stride_pix1,
     return sum;
 }
 
-static int pixel_ssd_8x8_altivec ( uint8_t *pix1, intptr_t i_stride_pix1,
-                                   uint8_t *pix2, intptr_t i_stride_pix2 )
+static int pixel_ssd_8x8_altivec( uint8_t *pix1, intptr_t i_stride_pix1,
+                                  uint8_t *pix2, intptr_t i_stride_pix2 )
 {
     ALIGNED_16( int sum );
 
index 79ebc6c904a7ad5b0670b04695c411827c3a01f1..37435f66786b27fa0794a3781a839a1e929056bd 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef X264_PPC_PREDICT_H
 #define X264_PPC_PREDICT_H
 
-void x264_predict_16x16_init_altivec ( x264_predict_t pf[7] );
+void x264_predict_16x16_init_altivec( x264_predict_t pf[7] );
 void x264_predict_8x8c_init_altivec( x264_predict_t pf[7] );
 
 #endif /* X264_PPC_PREDICT_H */
index 6b75dd8e22c0cc402a7f8a3c865ac8b3e0cf692d..d6069bd00e4ae9a98aafb3c5ce9f9d33e1bf73ed 100644 (file)
@@ -340,7 +340,7 @@ static void x264_predict_8x16c_dc_top_c( pixel *src )
 {
     int dc0 = 0, dc1 = 0;
 
-    for(int  x = 0; x < 4; x++ )
+    for( int  x = 0; x < 4; x++ )
     {
         dc0 += src[x     - FDEC_STRIDE];
         dc1 += src[x + 4 - FDEC_STRIDE];
index 9ec9d1d5a1348c75a5ef2b45cc94bc44fb2d1311..4e9e8bf7cb8574a3d6f4468590dfce0b17f800d6 100644 (file)
@@ -29,7 +29,7 @@
 
 typedef void (*x264_predict_t)( pixel *src );
 typedef void (*x264_predict8x8_t)( pixel *src, pixel edge[36] );
-typedef void (*x264_predict_8x8_filter_t) ( pixel *src, pixel edge[36], int i_neighbor, int i_filters );
+typedef void (*x264_predict_8x8_filter_t)( pixel *src, pixel edge[36], int i_neighbor, int i_filters );
 
 enum intra_chroma_pred_e
 {
index 3bff4080c67cbd377a08c9b8d4c6767cfc270aa4..9309a9ebf6e6d6f2951a1518db076b1b0072d187 100644 (file)
@@ -514,7 +514,7 @@ do\
         :"m"(x)\
     );\
     s = temp;\
-} while(0)
+} while( 0 )
 
 #undef MC_CLIP_ADD2
 #define MC_CLIP_ADD2(s,x)\
@@ -527,7 +527,7 @@ do\
         :"+m"(M32(s))\
         :"m"(M32(x))\
     );\
-} while(0)
+} while( 0 )
 #endif
 
 PROPAGATE_LIST(ssse3)
index ba1dd6bac121674bd084e9a8d89e7f3f6664ece7..e840a07f13f1b39458ca396849f6c4ee323f6186 100644 (file)
 #ifndef X264_I386_PREDICT_H
 #define X264_I386_PREDICT_H
 
-void x264_predict_16x16_init_mmx ( int cpu, x264_predict_t pf[7] );
-void x264_predict_8x16c_init_mmx  ( int cpu, x264_predict_t pf[7] );
-void x264_predict_8x8c_init_mmx  ( int cpu, x264_predict_t pf[7] );
-void x264_predict_4x4_init_mmx   ( int cpu, x264_predict_t pf[12] );
-void x264_predict_8x8_init_mmx   ( int cpu, x264_predict8x8_t pf[12], x264_predict_8x8_filter_t *predict_8x8_filter );
+void x264_predict_16x16_init_mmx( int cpu, x264_predict_t pf[7] );
+void x264_predict_8x16c_init_mmx( int cpu, x264_predict_t pf[7] );
+void x264_predict_8x8c_init_mmx ( int cpu, x264_predict_t pf[7] );
+void x264_predict_4x4_init_mmx  ( int cpu, x264_predict_t pf[12] );
+void x264_predict_8x8_init_mmx  ( int cpu, x264_predict8x8_t pf[12], x264_predict_8x8_filter_t *predict_8x8_filter );
 
 void x264_predict_16x16_v_mmx2( pixel *src );
 void x264_predict_16x16_v_sse ( pixel *src );
index 35d5110c48d1f313634901f685350071920eb8e9..2b7f7dec7d7d9a38feee5ef12c358dd904bf6a76 100644 (file)
@@ -35,8 +35,6 @@ void x264_slicetype_decide( x264_t *h );
 
 void x264_slicetype_analyse( x264_t *h, int intra_minigop );
 
-int x264_weighted_reference_duplicate( x264_t *h, int i_ref, const x264_weight_t *w );
-
 int  x264_lookahead_init( x264_t *h, int i_slicetype_length );
 int  x264_lookahead_is_empty( x264_t *h );
 void x264_lookahead_put_frame( x264_t *h, x264_frame_t *frame );
index f1149a5ba611e25775b9812b9fe0eac30a8893b5..0effb1ba784e1232cf2c5f17c2ee281afb2bd4bd 100644 (file)
@@ -350,7 +350,7 @@ do\
 {\
     uint16_t mvd = x264_cabac_mvd(h,cb,i_list,idx,width);\
     x264_macroblock_cache_mvd( h, block_idx_x[idx], block_idx_y[idx], width, height, i_list, mvd );\
-} while(0)
+} while( 0 )
 
 static inline void x264_cabac_8x8_mvd( x264_t *h, x264_cabac_t *cb, int i )
 {
@@ -947,7 +947,7 @@ do\
     }\
     else\
         x264_cabac_encode_decision( cb, ctxidxinc, 0 );\
-} while(0)
+} while( 0 )
 
 #define x264_cabac_block_residual_dc_cbf( h, cb, ctx_block_cat, i_idx, l, b_intra )\
     x264_cabac_block_residual_cbf_internal( h, cb, ctx_block_cat, i_idx, l, b_intra, 1, )
index f733adf2d97a7398e676aa7a549b6eb0ee0e9a5a..df7432853bdfdf28cb2599ae1f864d23e8f9e19f 100644 (file)
@@ -2033,7 +2033,7 @@ static inline void x264_reference_check_reorder( x264_t *h )
 }
 
 /* return -1 on failure, else return the index of the new reference frame */
-int x264_weighted_reference_duplicate( x264_t *h, int i_ref, const x264_weight_t *w )
+static int x264_weighted_reference_duplicate( x264_t *h, int i_ref, const x264_weight_t *w )
 {
     int i = h->i_ref[0];
     int j = 1;
index 585d58583814ed52879d5515678d832cfd3f9968..c304f68db46034a92b7e4946b5acf00c0e83e5e0 100644 (file)
@@ -93,7 +93,7 @@ do\
 {\
     M16( &h->mb.cache.non_zero_count[x264_scan8[p*16+idx*4]+0] ) = (nz) * 0x0101;\
     M16( &h->mb.cache.non_zero_count[x264_scan8[p*16+idx*4]+8] ) = (nz) * 0x0101;\
-} while(0)
+} while( 0 )
 
 #define CLEAR_16x16_NNZ( p ) \
 do\
@@ -102,7 +102,7 @@ do\
     M32( &h->mb.cache.non_zero_count[x264_scan8[16*p] + 1*8] ) = 0;\
     M32( &h->mb.cache.non_zero_count[x264_scan8[16*p] + 2*8] ) = 0;\
     M32( &h->mb.cache.non_zero_count[x264_scan8[16*p] + 3*8] ) = 0;\
-} while(0)
+} while( 0 )
 
 /* A special for loop that iterates branchlessly over each set
  * bit in a 4-bit input. */
index b5552fb40ade4183bdb198c6df4e2d19694af405..cafdfbe5995c882cf944f47a01ef0a13a360cb14 100644 (file)
@@ -67,7 +67,7 @@ do\
                    &p_fref_w[(my)*stride+(mx)], stride )\
              + BITS_MVD(mx,my);\
     COPY3_IF_LT( bcost, cost, bmx, mx, bmy, my );\
-} while(0)
+} while( 0 )
 
 #define COST_MV_HPEL( mx, my, cost )\
 do\
@@ -76,7 +76,7 @@ do\
     pixel *src = h->mc.get_ref( pix, &stride2, m->p_fref, stride, mx, my, bw, bh, &m->weight[0] );\
     cost = h->pixf.fpelcmp[i_pixel]( p_fenc, FENC_STRIDE, src, stride2 )\
          + p_cost_mvx[ mx ] + p_cost_mvy[ my ];\
-} while(0)
+} while( 0 )
 
 #define COST_MV_X3_DIR( m0x, m0y, m1x, m1y, m2x, m2y, costs )\
 {\
@@ -603,7 +603,7 @@ void x264_me_search_ref( x264_t *h, x264_me_t *m, int16_t (*mvc)[2], int i_mvc,
 #undef SADS
 #undef ADD_MVCOST
 #undef MIN_MV
-                    if(dir)
+                    if( dir )
                     {
                         bmx = omx + i*(dir>>4);
                         bmy = omy + i*((dir<<28)>>28);
index 06a542750996a2da2f465cc552ea8dc3969c2276..0fc095e07375caffd7a30dab4fa1b19ebea96ab9 100644 (file)
@@ -69,38 +69,38 @@ uint64_t x264_rd_cost_part( x264_t *h, int i_lambda2, int i8, int i_pixel );
 extern uint16_t *x264_cost_mv_fpel[QP_MAX+1][4];
 
 #define COPY1_IF_LT(x,y)\
-if((y)<(x))\
-    (x)=(y);
+if( (y) < (x) )\
+    (x) = (y);
 
 #define COPY2_IF_LT(x,y,a,b)\
-if((y)<(x))\
+if( (y) < (x) )\
 {\
-    (x)=(y);\
-    (a)=(b);\
+    (x) = (y);\
+    (a) = (b);\
 }
 
 #define COPY3_IF_LT(x,y,a,b,c,d)\
-if((y)<(x))\
+if( (y) < (x) )\
 {\
-    (x)=(y);\
-    (a)=(b);\
-    (c)=(d);\
+    (x) = (y);\
+    (a) = (b);\
+    (c) = (d);\
 }
 
 #define COPY4_IF_LT(x,y,a,b,c,d,e,f)\
-if((y)<(x))\
+if( (y) < (x) )\
 {\
-    (x)=(y);\
-    (a)=(b);\
-    (c)=(d);\
-    (e)=(f);\
+    (x) = (y);\
+    (a) = (b);\
+    (c) = (d);\
+    (e) = (f);\
 }
 
 #define COPY2_IF_GT(x,y,a,b)\
-if((y)>(x))\
+if( (y) > (x) )\
 {\
-    (x)=(y);\
-    (a)=(b);\
+    (x) = (y);\
+    (a) = (b);\
 }
 
 #endif
index 301ba0f7c41d2cc9691761678df0864699af5d09..ac8c8e3445f88c8355b7097e3a2adffc8b1aefb2 100644 (file)
@@ -1096,7 +1096,7 @@ int x264_ratecontrol_new( x264_t *h )
                                     &rce->weight[2][0], &rce->weight[2][1] );
                 if( count == 3 )
                     rce->i_weight_denom[1] = -1;
-                else if ( count != 8 )
+                else if( count != 8 )
                     rce->i_weight_denom[0] = rce->i_weight_denom[1] = -1;
             }
 
@@ -2869,7 +2869,7 @@ static int vbv_pass2( x264_t *h, double all_available_bits )
             t0 = 0;
             /* fix overflows */
             adj_min = 1;
-            while(adj_min && find_underflow( h, fills, &t0, &t1, 1 ))
+            while( adj_min && find_underflow( h, fills, &t0, &t1, 1 ) )
             {
                 adj_min = fix_underflow( h, t0, t1, adjustment, qscale_min, qscale_max );
                 t0 = t1;
index 9f7e227c88a83a42c586df42e6e8b8f4ceda8899..d06c5d77d90447a4fe77a14644726133335573d7 100644 (file)
@@ -61,7 +61,6 @@ void x264_ratecontrol_summary( x264_t * );
 void x264_ratecontrol_set_estimated_size( x264_t *, int bits );
 int  x264_ratecontrol_get_estimated_size( x264_t const *);
 int  x264_rc_analyse_slice( x264_t *h );
-int x264_weighted_reference_duplicate( x264_t *h, int i_ref, const x264_weight_t *w );
 void x264_threads_distribute_ratecontrol( x264_t *h );
 void x264_threads_merge_ratecontrol( x264_t *h );
 void x264_hrd_fullness( x264_t *h );
index ded0413ee4f880d11d3a836ead5a2bce45a22099..2aab1367333caeb09ebbd8212c586ee26a84d7c4 100644 (file)
@@ -863,7 +863,7 @@ int quant_trellis_cabac( x264_t *h, dctcoef *dct,
         return 0;
     }
 
-    if(0) // accessible only by goto, not fallthrough
+    if( 0 ) // accessible only by goto, not fallthrough
     {
         // node_ctx 1..7 (ctx0 ruled out because we never try both level0 and level2+ on the same coef)
         TRELLIS_LOOP(1);
index 55b7e1a7bde07140279f8e9a3692a6fe9ca18d3f..5421eebe4d5204632be3a1540b7f1478340ba78b 100644 (file)
@@ -671,7 +671,7 @@ void x264_sei_frame_packing_write( x264_t *h, bs_t *s )
     bs_write1( &q, h->param.i_frame_packing == 5 && !(h->fenc->i_frame&1) ); // current_frame_is_frame0_flag
     bs_write1( &q, 0 );                           // frame0_self_contained_flag
     bs_write1( &q, 0 );                           // frame1_self_contained_flag
-    if ( quincunx_sampling_flag == 0 && h->param.i_frame_packing != 5 )
+    if( quincunx_sampling_flag == 0 && h->param.i_frame_packing != 5 )
     {
         bs_write( &q, 4, 0 );                     // frame0_grid_position_x
         bs_write( &q, 4, 0 );                     // frame0_grid_position_y
index 91f42e5bd79956a26ba69e0bd05702103b6bf882..901a015b2859352fe36a0ecafcdc83e225616913 100644 (file)
@@ -95,9 +95,12 @@ static int set_param( hnd_t handle, x264_param_t *p_param )
     if( p_param->vui.i_sar_width && p_param->vui.i_sar_height
         && p_param->vui.i_sar_width != p_param->vui.i_sar_height )
     {
-        if ( p_param->vui.i_sar_width > p_param->vui.i_sar_height ) {
+        if( p_param->vui.i_sar_width > p_param->vui.i_sar_height )
+        {
             dw = dw * p_param->vui.i_sar_width / p_param->vui.i_sar_height;
-        } else {
+        }
+        else
+        {
             dh = dh * p_param->vui.i_sar_height / p_param->vui.i_sar_width;
         }
     }
diff --git a/x264.c b/x264.c
index f99aada6c3fd0a0b3511907c3cc7d7f5ad489f78..269905188eb1cf0c219ad8b05ad751d539a46c74 100644 (file)
--- a/x264.c
+++ b/x264.c
@@ -469,8 +469,8 @@ static void help( x264_param_t *defaults, int longhelp )
 {
     char buf[50];
 #define H0 printf
-#define H1 if(longhelp>=1) printf
-#define H2 if(longhelp==2) printf
+#define H1 if( longhelp >= 1 ) printf
+#define H2 if( longhelp == 2 ) printf
     H0( "x264 core:%d%s\n"
         "Syntax: x264 [options] -o outfile infile\n"
         "\n"
diff --git a/x264.h b/x264.h
index 2b59b92a030bab2f943fa2acba9d7cac0d95ee8b..fb9e5f2910c225bdbf5242a875b5f15060d8032e 100644 (file)
--- a/x264.h
+++ b/x264.h
@@ -552,7 +552,7 @@ typedef struct x264_param_t
      * NAL unit. This helps distinguish between nalu_process calls from different sources,
      * e.g. if doing multiple encodes in one process.
      */
-    void (*nalu_process) ( x264_t *h, x264_nal_t *nal, void *opaque );
+    void (*nalu_process)( x264_t *h, x264_nal_t *nal, void *opaque );
 } x264_param_t;
 
 void x264_nal_encode( x264_t *h, uint8_t *dst, x264_nal_t *nal );
@@ -907,7 +907,7 @@ int     x264_encoder_headers( x264_t *, x264_nal_t **pp_nal, int *pi_nal );
 int     x264_encoder_encode( x264_t *, x264_nal_t **pp_nal, int *pi_nal, x264_picture_t *pic_in, x264_picture_t *pic_out );
 /* x264_encoder_close:
  *      close an encoder handler */
-void    x264_encoder_close  ( x264_t * );
+void    x264_encoder_close( x264_t * );
 /* x264_encoder_delayed_frames:
  *      return the number of currently delayed (buffered) frames
  *      this should be used at the end of the stream, to know when you have all the encoded frames. */