[x264-devel] Cosmetics: make struct definition braces consistent

Kieran Kunhya git at videolan.org
Thu Mar 24 06:38:34 CET 2011


x264 | branch: master | Kieran Kunhya <kieran at kunhya.com> | Tue Mar  8 09:41:46 2011 +0000| [c7e352ca08a68b891480b6cb449dd3f9bfb45218] | committer: Jason Garrett-Glaser

Cosmetics: make struct definition braces consistent

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=c7e352ca08a68b891480b6cb449dd3f9bfb45218
---

 common/cabac.c    |   11 ++++++-----
 common/cpu.c      |    3 ++-
 common/cpu.h      |    3 ++-
 common/pixel.h    |    9 ++++++---
 encoder/analyse.c |   33 ++++++++++++++++++++++-----------
 encoder/cabac.c   |    9 ++++++---
 encoder/me.h      |    3 ++-
 encoder/rdo.c     |    6 ++++--
 tools/checkasm.c  |    6 ++++--
 x264.c            |    3 ++-
 x264.h            |    6 ++++--
 11 files changed, 60 insertions(+), 32 deletions(-)

diff --git a/common/cabac.c b/common/cabac.c
index b1e3143..97bc24d 100644
--- a/common/cabac.c
+++ b/common/cabac.c
@@ -708,11 +708,12 @@ const uint8_t x264_cabac_transition[128][2] =
     {118, 122}, {123, 119}, {120, 124}, {125, 121}, {122, 126}, {127, 123}, {124, 127}, {126, 125}
 };
 
-const uint8_t x264_cabac_renorm_shift[64]= {
- 6,5,4,4,3,3,3,3,2,2,2,2,2,2,2,2,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+const uint8_t x264_cabac_renorm_shift[64] =
+{
+    6,5,4,4,3,3,3,3,2,2,2,2,2,2,2,2,
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 };
 
 /* -ln2(probability) */
diff --git a/common/cpu.c b/common/cpu.c
index 8793445..a6bc121 100644
--- a/common/cpu.c
+++ b/common/cpu.c
@@ -45,7 +45,8 @@
 #include <machine/cpu.h>
 #endif
 
-const x264_cpu_name_t x264_cpu_names[] = {
+const x264_cpu_name_t x264_cpu_names[] =
+{
     {"Altivec", X264_CPU_ALTIVEC},
 //  {"MMX",     X264_CPU_MMX}, // we don't support asm on mmx1 cpus anymore
     {"MMX2",    X264_CPU_MMX|X264_CPU_MMXEXT},
diff --git a/common/cpu.h b/common/cpu.h
index dfc24bf..5438f92 100644
--- a/common/cpu.h
+++ b/common/cpu.h
@@ -53,7 +53,8 @@ int x264_stack_align( void (*func)(), ... );
 #define x264_stack_align(func,...) func(__VA_ARGS__)
 #endif
 
-typedef struct {
+typedef struct
+{
     const char name[16];
     int flags;
 } x264_cpu_name_t;
diff --git a/common/pixel.h b/common/pixel.h
index e4530ea..7b2f1b1 100644
--- a/common/pixel.h
+++ b/common/pixel.h
@@ -47,10 +47,12 @@ enum
     PIXEL_2x2   = 9,
 };
 
-static const struct {
+static const struct
+{
     int w;
     int h;
-} x264_pixel_size[7] = {
+} x264_pixel_size[7] =
+{
     { 16, 16 },
     { 16,  8 }, {  8, 16 },
     {  8,  8 },
@@ -58,7 +60,8 @@ static const struct {
     {  4,  4 }
 };
 
-static const uint8_t x264_size2pixel[5][5] = {
+static const uint8_t x264_size2pixel[5][5] =
+{
     { 0, },
     { 0, PIXEL_4x4, PIXEL_8x4, 0, 0 },
     { 0, PIXEL_4x8, PIXEL_8x8, 0, PIXEL_16x8 },
diff --git a/encoder/analyse.c b/encoder/analyse.c
index 5419bd1..ea53005 100644
--- a/encoder/analyse.c
+++ b/encoder/analyse.c
@@ -138,7 +138,8 @@ typedef struct
 } x264_mb_analysis_t;
 
 /* lambda = pow(2,qp/6-2) */
-const uint16_t x264_lambda_tab[QP_MAX_MAX+1] = {
+const uint16_t x264_lambda_tab[QP_MAX_MAX+1] =
+{
    1,   1,   1,   1,   1,   1,   1,   1, /*  0- 7 */
    1,   1,   1,   1,   1,   1,   1,   1, /*  8-15 */
    2,   2,   2,   2,   3,   3,   3,   4, /* 16-23 */
@@ -154,7 +155,8 @@ const uint16_t x264_lambda_tab[QP_MAX_MAX+1] = {
 
 /* lambda2 = pow(lambda,2) * .9 * 256 */
 /* Capped to avoid overflow */
-const int x264_lambda2_tab[QP_MAX_MAX+1] = {
+const int x264_lambda2_tab[QP_MAX_MAX+1] =
+{
        14,       18,       22,       28,       36,       45,      57,      72, /*  0- 7 */
        91,      115,      145,      182,      230,      290,     365,     460, /*  8-15 */
       580,      731,      921,     1161,     1462,     1843,    2322,    2925, /* 16-23 */
@@ -168,14 +170,16 @@ const int x264_lambda2_tab[QP_MAX_MAX+1] = {
 134217727,134217727,134217727,134217727,134217727,134217727,                   /* 76-81 */
 };
 
-const uint8_t x264_exp2_lut[64] = {
+const uint8_t x264_exp2_lut[64] =
+{
       0,   3,   6,   8,  11,  14,  17,  20,  23,  26,  29,  32,  36,  39,  42,  45,
      48,  52,  55,  58,  62,  65,  69,  72,  76,  80,  83,  87,  91,  94,  98, 102,
     106, 110, 114, 118, 122, 126, 130, 135, 139, 143, 147, 152, 156, 161, 165, 170,
     175, 179, 184, 189, 194, 198, 203, 208, 214, 219, 224, 229, 234, 240, 245, 250
 };
 
-const float x264_log2_lut[128] = {
+const float x264_log2_lut[128] =
+{
     0.00000, 0.01123, 0.02237, 0.03342, 0.04439, 0.05528, 0.06609, 0.07682,
     0.08746, 0.09803, 0.10852, 0.11894, 0.12928, 0.13955, 0.14975, 0.15987,
     0.16993, 0.17991, 0.18982, 0.19967, 0.20945, 0.21917, 0.22882, 0.23840,
@@ -195,13 +199,15 @@ const float x264_log2_lut[128] = {
 };
 
 /* Avoid an int/float conversion. */
-const float x264_log2_lz_lut[32] = {
+const float x264_log2_lz_lut[32] =
+{
     31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
 };
 
 // should the intra and inter lambdas be different?
 // I'm just matching the behaviour of deadzone quant.
-static const int x264_trellis_lambda2_tab[2][QP_MAX_MAX+1] = {
+static const int x264_trellis_lambda2_tab[2][QP_MAX_MAX+1] =
+{
     // inter lambda = .85 * .85 * 2**(qp/3. + 10 - LAMBDA_BITS)
     {
                46,       58,       73,       92,      117,      147,
@@ -238,7 +244,8 @@ static const int x264_trellis_lambda2_tab[2][QP_MAX_MAX+1] = {
 };
 
 #define MAX_CHROMA_LAMBDA_OFFSET 36
-static const uint16_t x264_chroma_lambda2_offset_tab[MAX_CHROMA_LAMBDA_OFFSET+1] = {
+static const uint16_t x264_chroma_lambda2_offset_tab[MAX_CHROMA_LAMBDA_OFFSET+1] =
+{
        16,    20,    25,    32,    40,    50,
        64,    80,   101,   128,   161,   203,
       256,   322,   406,   512,   645,   812,
@@ -249,16 +256,20 @@ static const uint16_t x264_chroma_lambda2_offset_tab[MAX_CHROMA_LAMBDA_OFFSET+1]
 };
 
 /* TODO: calculate CABAC costs */
-static const uint8_t i_mb_b_cost_table[X264_MBTYPE_MAX] = {
+static const uint8_t i_mb_b_cost_table[X264_MBTYPE_MAX] =
+{
     9, 9, 9, 9, 0, 0, 0, 1, 3, 7, 7, 7, 3, 7, 7, 7, 5, 9, 0
 };
-static const uint8_t i_mb_b16x8_cost_table[17] = {
+static const uint8_t i_mb_b16x8_cost_table[17] =
+{
     0, 0, 0, 0, 0, 0, 0, 0, 5, 7, 7, 7, 5, 7, 9, 9, 9
 };
-static const uint8_t i_sub_mb_b_cost_table[13] = {
+static const uint8_t i_sub_mb_b_cost_table[13] =
+{
     7, 5, 5, 3, 7, 5, 7, 3, 7, 7, 7, 5, 1
 };
-static const uint8_t i_sub_mb_p_cost_table[4] = {
+static const uint8_t i_sub_mb_p_cost_table[4] =
+{
     5, 3, 3, 1
 };
 
diff --git a/encoder/cabac.c b/encoder/cabac.c
index 6333737..4870cf4 100644
--- a/encoder/cabac.c
+++ b/encoder/cabac.c
@@ -510,11 +510,13 @@ static int ALWAYS_INLINE x264_cabac_mb_cbf_ctxidxinc( x264_t *h, int i_cat, int
 }
 
 
-static const uint16_t significant_coeff_flag_offset[2][6] = {
+static const uint16_t significant_coeff_flag_offset[2][6] =
+{
     { 105, 120, 134, 149, 152, 402 },
     { 277, 292, 306, 321, 324, 436 }
 };
-static const uint16_t last_coeff_flag_offset[2][6] = {
+static const uint16_t last_coeff_flag_offset[2][6] =
+{
     { 166, 181, 195, 210, 213, 417 },
     { 338, 353, 367, 382, 385, 451 }
 };
@@ -532,7 +534,8 @@ static const uint8_t significant_coeff_flag_offset_8x8[2][63] =
     9, 9,10,10, 8,11,12,11, 9, 9,10,10, 8,13,13, 9,
     9,10,10, 8,13,13, 9, 9,10,10,14,14,14,14,14
 }};
-static const uint8_t last_coeff_flag_offset_8x8[63] = {
+static const uint8_t last_coeff_flag_offset_8x8[63] =
+{
     0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
     3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
diff --git a/encoder/me.h b/encoder/me.h
index 06e355b..3281630 100644
--- a/encoder/me.h
+++ b/encoder/me.h
@@ -55,7 +55,8 @@ typedef struct
     ALIGNED_4( int16_t mv[2] );
 } ALIGNED_16( x264_me_t );
 
-typedef struct {
+typedef struct
+{
     int sad;
     int16_t mv[2];
 } mvsad_t;
diff --git a/encoder/rdo.c b/encoder/rdo.c
index c59960f..0fa57b3 100644
--- a/encoder/rdo.c
+++ b/encoder/rdo.c
@@ -387,7 +387,8 @@ void x264_rdo_init( void )
     }
 }
 
-typedef struct {
+typedef struct
+{
     int64_t score;
     int level_idx; // index into level_tree[]
     uint8_t cabac_state[10]; //just the contexts relevant to coding abs_level_m1
@@ -435,7 +436,8 @@ int quant_trellis_cabac( x264_t *h, dctcoef *dct,
     // (# of coefs) * (# of ctx) * (# of levels tried) = 1024
     // we don't need to keep all of those: (# of coefs) * (# of ctx) would be enough,
     // but it takes more time to remove dead states than you gain in reduced memory.
-    struct {
+    struct
+    {
         uint16_t abs_level;
         uint16_t next;
     } level_tree[64*8*2];
diff --git a/tools/checkasm.c b/tools/checkasm.c
index b6a2060..f11b53f 100644
--- a/tools/checkasm.c
+++ b/tools/checkasm.c
@@ -61,14 +61,16 @@ int quiet = 0;
 #define MAX_FUNCS 1000  // just has to be big enough to hold all the existing functions
 #define MAX_CPUS 10     // number of different combinations of cpu flags
 
-typedef struct {
+typedef struct
+{
     void *pointer; // just for detecting duplicates
     uint32_t cpu;
     uint32_t cycles;
     uint32_t den;
 } bench_t;
 
-typedef struct {
+typedef struct
+{
     char *name;
     bench_t vers[MAX_CPUS];
 } bench_func_t;
diff --git a/x264.c b/x264.c
index 1c551f8..2e2a908 100644
--- a/x264.c
+++ b/x264.c
@@ -126,7 +126,8 @@ static const char * const muxer_names[] =
 static const char * const pulldown_names[] = { "none", "22", "32", "64", "double", "triple", "euro", 0 };
 static const char * const log_level_names[] = { "none", "error", "warning", "info", "debug", 0 };
 
-typedef struct{
+typedef struct
+{
     int mod;
     uint8_t pattern[24];
     float fps_factor;
diff --git a/x264.h b/x264.h
index 24c3792..8e12ea7 100644
--- a/x264.h
+++ b/x264.h
@@ -385,7 +385,8 @@ typedef struct x264_param_t
 
     /* Cropping Rectangle parameters: added to those implicitly defined by
        non-mod16 video resolutions. */
-    struct {
+    struct
+    {
         unsigned int i_left;
         unsigned int i_top;
         unsigned int i_right;
@@ -480,7 +481,8 @@ void x264_nal_encode( x264_t *h, uint8_t *dst, x264_nal_t *nal );
  * H.264 level restriction information
  ****************************************************************************/
 
-typedef struct {
+typedef struct
+{
     int level_idc;
     int mbps;        /* max macroblock processing rate (macroblocks/sec) */
     int frame_size;  /* max frame size (macroblocks) */



More information about the x264-devel mailing list