shithub: libvpx

Download patch

ref: 7a9e476072138f2058d808a403d5ef7a06684aae
parent: 6ae58fd55e92833d0cbe78f4eb6b1306241b94e3
parent: 5f6d143b41ca45c9f823849473bb8ce5437b0659
author: James Zern <jzern@google.com>
date: Fri Sep 16 03:11:33 EDT 2016

Merge changes from topic 'clang-format'

* changes:
  apply clang-format
  .clang-format: update to 3.8.1

--- a/.clang-format
+++ b/.clang-format
@@ -1,10 +1,11 @@
 ---
 Language:        Cpp
 # BasedOnStyle:  Google
-# Generated with clang-format 3.7.1
+# Generated with clang-format 3.8.1
 AccessModifierOffset: -1
-AlignAfterOpenBracket: true
+AlignAfterOpenBracket: Align
 AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
 AlignEscapedNewlinesLeft: true
 AlignOperands:   true
 AlignTrailingComments: true
@@ -15,10 +16,23 @@
 AllowShortIfStatementsOnASingleLine: true
 AllowShortLoopsOnASingleLine: true
 AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
 AlwaysBreakBeforeMultilineStrings: true
 AlwaysBreakTemplateDeclarations: true
 BinPackArguments: true
 BinPackParameters: true
+BraceWrapping:
+  AfterClass:      false
+  AfterControlStatement: false
+  AfterEnum:       false
+  AfterFunction:   false
+  AfterNamespace:  false
+  AfterObjCDeclaration: false
+  AfterStruct:     false
+  AfterUnion:      false
+  BeforeCatch:     false
+  BeforeElse:      false
+  IndentBraces:    false
 BreakBeforeBinaryOperators: None
 BreakBeforeBraces: Attach
 BreakBeforeTernaryOperators: true
@@ -33,6 +47,13 @@
 DisableFormat:   false
 ExperimentalAutoDetectBinPacking: false
 ForEachMacros:   [ foreach, Q_FOREACH, BOOST_FOREACH ]
+IncludeCategories:
+  - Regex:           '^<.*\.h>'
+    Priority:        1
+  - Regex:           '^<.*'
+    Priority:        2
+  - Regex:           '.*'
+    Priority:        3
 IndentCaseLabels: true
 IndentWidth:     2
 IndentWrappedFunctionNames: false
@@ -51,6 +72,8 @@
 PenaltyExcessCharacter: 1000000
 PenaltyReturnTypeOnItsOwnLine: 200
 PointerAlignment: Right
+ReflowComments:  true
+SortIncludes:    false
 SpaceAfterCStyleCast: false
 SpaceBeforeAssignmentOperators: true
 SpaceBeforeParens: ControlStatements
--- a/examples/vp8_multi_resolution_encoder.c
+++ b/examples/vp8_multi_resolution_encoder.c
@@ -340,8 +340,7 @@
   unsigned int num_temporal_layers[NUM_ENCODERS] = { 3, 3, 3 };
 
   if (argc != (7 + 3 * NUM_ENCODERS))
-    die(
-        "Usage: %s <width> <height> <frame_rate>  <infile> <outfile(s)> "
+    die("Usage: %s <width> <height> <frame_rate>  <infile> <outfile(s)> "
         "<rate_encoder(s)> <temporal_layer(s)> <key_frame_insert> <output "
         "psnr?> \n",
         argv[0]);
--- a/examples/vp9_spatial_svc_encoder.c
+++ b/examples/vp9_spatial_svc_encoder.c
@@ -497,8 +497,7 @@
          rc->avg_st_encoding_bitrate, sqrt(rc->variance_st_encoding_bitrate),
          perc_fluctuation);
   if (frame_cnt != tot_num_frames)
-    die(
-        "Error: Number of input frames not equal to output encoded frames != "
+    die("Error: Number of input frames not equal to output encoded frames != "
         "%d tot_num_frames = %d\n",
         frame_cnt, tot_num_frames);
 }
--- a/examples/vpx_temporal_svc_encoder.c
+++ b/examples/vpx_temporal_svc_encoder.c
@@ -530,14 +530,12 @@
   // Check usage and arguments.
   if (argc < min_args) {
 #if CONFIG_VP9_HIGHBITDEPTH
-    die(
-        "Usage: %s <infile> <outfile> <codec_type(vp8/vp9)> <width> <height> "
+    die("Usage: %s <infile> <outfile> <codec_type(vp8/vp9)> <width> <height> "
         "<rate_num> <rate_den> <speed> <frame_drop_threshold> <mode> "
         "<Rate_0> ... <Rate_nlayers-1> <bit-depth> \n",
         argv[0]);
 #else
-    die(
-        "Usage: %s <infile> <outfile> <codec_type(vp8/vp9)> <width> <height> "
+    die("Usage: %s <infile> <outfile> <codec_type(vp8/vp9)> <width> <height> "
         "<rate_num> <rate_den> <speed> <frame_drop_threshold> <mode> "
         "<Rate_0> ... <Rate_nlayers-1> \n",
         argv[0]);
--- a/vp8/common/entropymode.c
+++ b/vp8/common/entropymode.c
@@ -34,13 +34,12 @@
 
 static const vp8_prob sub_mv_ref_prob[VP8_SUBMVREFS - 1] = { 180, 162, 25 };
 
-const vp8_prob vp8_sub_mv_ref_prob2[SUBMVREF_COUNT][VP8_SUBMVREFS - 1] = {
-  { 147, 136, 18 },
-  { 106, 145, 1 },
-  { 179, 121, 1 },
-  { 223, 1, 34 },
-  { 208, 1, 1 }
-};
+const vp8_prob vp8_sub_mv_ref_prob2[SUBMVREF_COUNT]
+                                   [VP8_SUBMVREFS - 1] = { { 147, 136, 18 },
+                                                           { 106, 145, 1 },
+                                                           { 179, 121, 1 },
+                                                           { 223, 1, 34 },
+                                                           { 208, 1, 1 } };
 
 const vp8_mbsplit vp8_mbsplits[VP8_NUMMBSPLITS] = {
   { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 },
--- a/vp8/common/entropymode.h
+++ b/vp8/common/entropymode.h
@@ -40,8 +40,9 @@
 #define SUBMVREF_COUNT 5
 extern const vp8_prob vp8_sub_mv_ref_prob2[SUBMVREF_COUNT][VP8_SUBMVREFS - 1];
 
-extern const unsigned int vp8_kf_default_bmode_counts
-    [VP8_BINTRAMODES][VP8_BINTRAMODES][VP8_BINTRAMODES];
+extern const unsigned int vp8_kf_default_bmode_counts[VP8_BINTRAMODES]
+                                                     [VP8_BINTRAMODES]
+                                                     [VP8_BINTRAMODES];
 
 extern const vp8_tree_index vp8_bmode_tree[];
 
@@ -70,15 +71,15 @@
 extern const struct vp8_token_struct vp8_small_mvencodings[8];
 
 /* Key frame default mode probs */
-extern const vp8_prob
-    vp8_kf_bmode_prob[VP8_BINTRAMODES][VP8_BINTRAMODES][VP8_BINTRAMODES - 1];
+extern const vp8_prob vp8_kf_bmode_prob[VP8_BINTRAMODES][VP8_BINTRAMODES]
+                                       [VP8_BINTRAMODES - 1];
 extern const vp8_prob vp8_kf_uv_mode_prob[VP8_UV_MODES - 1];
 extern const vp8_prob vp8_kf_ymode_prob[VP8_YMODES - 1];
 
 void vp8_init_mbmode_probs(VP8_COMMON *x);
 void vp8_default_bmode_probs(vp8_prob dest[VP8_BINTRAMODES - 1]);
-void vp8_kf_default_bmode_probs(
-    vp8_prob dest[VP8_BINTRAMODES][VP8_BINTRAMODES][VP8_BINTRAMODES - 1]);
+void vp8_kf_default_bmode_probs(vp8_prob dest[VP8_BINTRAMODES][VP8_BINTRAMODES]
+                                             [VP8_BINTRAMODES - 1]);
 
 #ifdef __cplusplus
 }  // extern "C"
--- a/vp8/common/onyxc_int.h
+++ b/vp8/common/onyxc_int.h
@@ -42,8 +42,8 @@
   vp8_prob ymode_prob[VP8_YMODES - 1]; /* interframe intra mode probs */
   vp8_prob uv_mode_prob[VP8_UV_MODES - 1];
   vp8_prob sub_mv_ref_prob[VP8_SUBMVREFS - 1];
-  vp8_prob
-      coef_probs[BLOCK_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES];
+  vp8_prob coef_probs[BLOCK_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS]
+                     [ENTROPY_NODES];
   MV_CONTEXT mvc[2];
 } FRAME_CONTEXT;
 
--- a/vp8/decoder/error_concealment.c
+++ b/vp8/decoder/error_concealment.c
@@ -435,8 +435,8 @@
         /* Calculate the weighted sum of neighboring MVs referring
          * to the dominant frame type.
          */
-        const int w = weights_q7[abs(row - neigh_pos[i].row)][abs(
-            col - neigh_pos[i].col)];
+        const int w = weights_q7[abs(row - neigh_pos[i].row)]
+                                [abs(col - neigh_pos[i].col)];
         if (neighbors[i].ref_frame != dom_ref_frame) continue;
         w_sum += w;
         /* Q7 * Q3 = Q10 */
--- a/vp8/encoder/firstpass.c
+++ b/vp8/encoder/firstpass.c
@@ -53,8 +53,8 @@
 
 #define DOUBLE_DIVIDE_CHECK(X) ((X) < 0 ? (X)-.000001 : (X) + .000001)
 
-#define POW1 (double) cpi->oxcf.two_pass_vbrbias / 100.0
-#define POW2 (double) cpi->oxcf.two_pass_vbrbias / 100.0
+#define POW1 (double)cpi->oxcf.two_pass_vbrbias / 100.0
+#define POW2 (double)cpi->oxcf.two_pass_vbrbias / 100.0
 
 #define NEW_BOOST 1
 
--- a/vp8/encoder/mcomp.c
+++ b/vp8/encoder/mcomp.c
@@ -206,17 +206,19 @@
 /* returns distortion + motion vector cost */
 #define ERR(r, c) (MVC(r, c) + DIST(r, c))
 /* checks if (r,c) has better score than previous best */
-#define CHECK_BETTER(v, r, c)                    \
-  IFMVCV(r, c, {                                 \
-    thismse = DIST(r, c);                        \
-    if ((v = (MVC(r, c) + thismse)) < besterr) { \
-      besterr = v;                               \
-      br = r;                                    \
-      bc = c;                                    \
-      *distortion = thismse;                     \
-      *sse1 = sse;                               \
-    }                                            \
-  }, v = UINT_MAX;)
+#define CHECK_BETTER(v, r, c)                           \
+  IFMVCV(r, c,                                          \
+         {                                              \
+           thismse = DIST(r, c);                        \
+           if ((v = (MVC(r, c) + thismse)) < besterr) { \
+             besterr = v;                               \
+             br = r;                                    \
+             bc = c;                                    \
+             *distortion = thismse;                     \
+             *sse1 = sse;                               \
+           }                                            \
+         },                                             \
+         v = UINT_MAX;)
 
 int vp8_find_best_sub_pixel_step_iteratively(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
                                              int_mv *bestmv, int_mv *ref_mv,
--- a/vp8/encoder/pickinter.c
+++ b/vp8/encoder/pickinter.c
@@ -976,8 +976,8 @@
             xd->dst.y_stride, xd->predictor, 16);
         distortion2 = vpx_variance16x16(*(b->base_src), b->src_stride,
                                         x->e_mbd.predictor, 16, &sse);
-        rate2 += x->mbmode_cost[x->e_mbd.frame_type][x->e_mbd.mode_info_context
-                                                         ->mbmi.mode];
+        rate2 += x->mbmode_cost[x->e_mbd.frame_type]
+                               [x->e_mbd.mode_info_context->mbmi.mode];
         this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2);
 
         if (this_rd < best_intra_rd) {
--- a/vp8/encoder/ratectrl.c
+++ b/vp8/encoder/ratectrl.c
@@ -49,36 +49,38 @@
   /* Intra case 450000/Qintra */
   {
       1125000, 900000, 750000, 642857, 562500, 500000, 450000, 450000, 409090,
-      375000, 346153, 321428, 300000, 281250, 264705, 264705, 250000, 236842,
-      225000, 225000, 214285, 214285, 204545, 204545, 195652, 195652, 187500,
-      180000, 180000, 173076, 166666, 160714, 155172, 150000, 145161, 140625,
-      136363, 132352, 128571, 125000, 121621, 121621, 118421, 115384, 112500,
-      109756, 107142, 104651, 102272, 100000, 97826, 97826, 95744, 93750, 91836,
-      90000, 88235, 86538, 84905, 83333, 81818, 80357, 78947, 77586, 76271,
-      75000, 73770, 72580, 71428, 70312, 69230, 68181, 67164, 66176, 65217,
-      64285, 63380, 62500, 61643, 60810, 60000, 59210, 59210, 58441, 57692,
-      56962, 56250, 55555, 54878, 54216, 53571, 52941, 52325, 51724, 51136,
-      50561, 49450, 48387, 47368, 46875, 45918, 45000, 44554, 44117, 43269,
-      42452, 41666, 40909, 40178, 39473, 38793, 38135, 36885, 36290, 35714,
-      35156, 34615, 34090, 33582, 33088, 32608, 32142, 31468, 31034, 30405,
-      29801, 29220, 28662,
+      375000,  346153, 321428, 300000, 281250, 264705, 264705, 250000, 236842,
+      225000,  225000, 214285, 214285, 204545, 204545, 195652, 195652, 187500,
+      180000,  180000, 173076, 166666, 160714, 155172, 150000, 145161, 140625,
+      136363,  132352, 128571, 125000, 121621, 121621, 118421, 115384, 112500,
+      109756,  107142, 104651, 102272, 100000, 97826,  97826,  95744,  93750,
+      91836,   90000,  88235,  86538,  84905,  83333,  81818,  80357,  78947,
+      77586,   76271,  75000,  73770,  72580,  71428,  70312,  69230,  68181,
+      67164,   66176,  65217,  64285,  63380,  62500,  61643,  60810,  60000,
+      59210,   59210,  58441,  57692,  56962,  56250,  55555,  54878,  54216,
+      53571,   52941,  52325,  51724,  51136,  50561,  49450,  48387,  47368,
+      46875,   45918,  45000,  44554,  44117,  43269,  42452,  41666,  40909,
+      40178,   39473,  38793,  38135,  36885,  36290,  35714,  35156,  34615,
+      34090,   33582,  33088,  32608,  32142,  31468,  31034,  30405,  29801,
+      29220,   28662,
   },
   /* Inter case 285000/Qinter */
   {
       712500, 570000, 475000, 407142, 356250, 316666, 285000, 259090, 237500,
       219230, 203571, 190000, 178125, 167647, 158333, 150000, 142500, 135714,
-      129545, 123913, 118750, 114000, 109615, 105555, 101785, 98275, 95000,
-      91935, 89062, 86363, 83823, 81428, 79166, 77027, 75000, 73076, 71250,
-      69512, 67857, 66279, 64772, 63333, 61956, 60638, 59375, 58163, 57000,
-      55882, 54807, 53773, 52777, 51818, 50892, 50000, 49137, 47500, 45967,
-      44531, 43181, 41911, 40714, 39583, 38513, 37500, 36538, 35625, 34756,
-      33928, 33139, 32386, 31666, 30978, 30319, 29687, 29081, 28500, 27941,
-      27403, 26886, 26388, 25909, 25446, 25000, 24568, 23949, 23360, 22800,
-      22265, 21755, 21268, 20802, 20357, 19930, 19520, 19127, 18750, 18387,
-      18037, 17701, 17378, 17065, 16764, 16473, 16101, 15745, 15405, 15079,
-      14766, 14467, 14179, 13902, 13636, 13380, 13133, 12895, 12666, 12445,
-      12179, 11924, 11632, 11445, 11220, 11003, 10795, 10594, 10401, 10215,
-      10035,
+      129545, 123913, 118750, 114000, 109615, 105555, 101785, 98275,  95000,
+      91935,  89062,  86363,  83823,  81428,  79166,  77027,  75000,  73076,
+      71250,  69512,  67857,  66279,  64772,  63333,  61956,  60638,  59375,
+      58163,  57000,  55882,  54807,  53773,  52777,  51818,  50892,  50000,
+      49137,  47500,  45967,  44531,  43181,  41911,  40714,  39583,  38513,
+      37500,  36538,  35625,  34756,  33928,  33139,  32386,  31666,  30978,
+      30319,  29687,  29081,  28500,  27941,  27403,  26886,  26388,  25909,
+      25446,  25000,  24568,  23949,  23360,  22800,  22265,  21755,  21268,
+      20802,  20357,  19930,  19520,  19127,  18750,  18387,  18037,  17701,
+      17378,  17065,  16764,  16473,  16101,  15745,  15405,  15079,  14766,
+      14467,  14179,  13902,  13636,  13380,  13133,  12895,  12666,  12445,
+      12179,  11924,  11632,  11445,  11220,  11003,  10795,  10594,  10401,
+      10215,  10035,
   }
 };
 
--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -105,10 +105,11 @@
   0,
 };
 
-static void fill_token_costs(
-    int c[BLOCK_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS][MAX_ENTROPY_TOKENS],
-    const vp8_prob
-        p[BLOCK_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES]) {
+static void fill_token_costs(int c[BLOCK_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS]
+                                  [MAX_ENTROPY_TOKENS],
+                             const vp8_prob p[BLOCK_TYPES][COEF_BANDS]
+                                             [PREV_COEF_CONTEXTS]
+                                             [ENTROPY_NODES]) {
   int i, j, k;
 
   for (i = 0; i < BLOCK_TYPES; ++i) {
@@ -766,8 +767,8 @@
 
     rate_to = rd_cost_mbuv(x);
     this_rate = rate_to +
-                x->intra_uv_mode_cost[xd->frame_type][xd->mode_info_context
-                                                          ->mbmi.uv_mode];
+                x->intra_uv_mode_cost[xd->frame_type]
+                                     [xd->mode_info_context->mbmi.uv_mode];
 
     this_distortion = vp8_mbuverror(x) / 4;
 
@@ -1999,9 +2000,8 @@
         macro_block_yrd(x, &rd.rate_y, &distortion);
         rd.rate2 += rd.rate_y;
         rd.distortion2 += distortion;
-        rd.rate2 +=
-            x->mbmode_cost[x->e_mbd.frame_type][x->e_mbd.mode_info_context->mbmi
-                                                    .mode];
+        rd.rate2 += x->mbmode_cost[x->e_mbd.frame_type]
+                                  [x->e_mbd.mode_info_context->mbmi.mode];
         rd.rate2 += uv_intra_rate;
         rd.rate_uv = uv_intra_rate_tokenonly;
         rd.distortion2 += uv_intra_distortion;
--- a/vp8/encoder/vp8_quantize.c
+++ b/vp8/encoder/vp8_quantize.c
@@ -297,13 +297,13 @@
   if (xd->segmentation_enabled) {
     /* Abs Value */
     if (xd->mb_segement_abs_delta == SEGMENT_ABSDATA) {
-      QIndex = xd->segment_feature_data[MB_LVL_ALT_Q][xd->mode_info_context
-                                                          ->mbmi.segment_id];
+      QIndex = xd->segment_feature_data[MB_LVL_ALT_Q]
+                                       [xd->mode_info_context->mbmi.segment_id];
       /* Delta Value */
     } else {
       QIndex = cpi->common.base_qindex +
-               xd->segment_feature_data[MB_LVL_ALT_Q][xd->mode_info_context
-                                                          ->mbmi.segment_id];
+               xd->segment_feature_data[MB_LVL_ALT_Q]
+                                       [xd->mode_info_context->mbmi.segment_id];
       /* Clamp to valid range */
       QIndex = (QIndex >= 0) ? ((QIndex <= MAXQ) ? QIndex : MAXQ) : 0;
     }
--- a/vp9/common/vp9_entropy.h
+++ b/vp9/common/vp9_entropy.h
@@ -109,10 +109,10 @@
 
 // #define ENTROPY_STATS
 
-typedef unsigned int
-    vp9_coeff_count[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS][ENTROPY_TOKENS];
-typedef unsigned int
-    vp9_coeff_stats[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS][ENTROPY_NODES][2];
+typedef unsigned int vp9_coeff_count[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS]
+                                    [ENTROPY_TOKENS];
+typedef unsigned int vp9_coeff_stats[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS]
+                                    [ENTROPY_NODES][2];
 
 #define SUBEXP_PARAM 4   /* Subexponential code parameter */
 #define MODULUS_PARAM 13 /* Modulus parameter */
@@ -151,8 +151,9 @@
 typedef vpx_prob vp9_coeff_probs_model[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS]
                                       [UNCONSTRAINED_NODES];
 
-typedef unsigned int vp9_coeff_count_model
-    [REF_TYPES][COEF_BANDS][COEFF_CONTEXTS][UNCONSTRAINED_NODES + 1];
+typedef unsigned int vp9_coeff_count_model[REF_TYPES][COEF_BANDS]
+                                          [COEFF_CONTEXTS]
+                                          [UNCONSTRAINED_NODES + 1];
 
 void vp9_model_to_full_probs(const vpx_prob *model, vpx_prob *full);
 
--- a/vp9/common/vp9_entropymode.c
+++ b/vp9/common/vp9_entropymode.c
@@ -179,29 +179,29 @@
   { 101, 21, 107, 181, 192, 103, 19, 67, 125 }  // y = tm
 };
 
-const vpx_prob vp9_kf_partition_probs[PARTITION_CONTEXTS][PARTITION_TYPES - 1] =
-    {
-      // 8x8 -> 4x4
-      { 158, 97, 94 },  // a/l both not split
-      { 93, 24, 99 },   // a split, l not split
-      { 85, 119, 44 },  // l split, a not split
-      { 62, 59, 67 },   // a/l both split
-      // 16x16 -> 8x8
-      { 149, 53, 53 },  // a/l both not split
-      { 94, 20, 48 },   // a split, l not split
-      { 83, 53, 24 },   // l split, a not split
-      { 52, 18, 18 },   // a/l both split
-      // 32x32 -> 16x16
-      { 150, 40, 39 },  // a/l both not split
-      { 78, 12, 26 },   // a split, l not split
-      { 67, 33, 11 },   // l split, a not split
-      { 24, 7, 5 },     // a/l both split
-      // 64x64 -> 32x32
-      { 174, 35, 49 },  // a/l both not split
-      { 68, 11, 27 },   // a split, l not split
-      { 57, 15, 9 },    // l split, a not split
-      { 12, 3, 3 },     // a/l both split
-    };
+const vpx_prob vp9_kf_partition_probs[PARTITION_CONTEXTS]
+                                     [PARTITION_TYPES - 1] = {
+                                       // 8x8 -> 4x4
+                                       { 158, 97, 94 },  // a/l both not split
+                                       { 93, 24, 99 },   // a split, l not split
+                                       { 85, 119, 44 },  // l split, a not split
+                                       { 62, 59, 67 },   // a/l both split
+                                       // 16x16 -> 8x8
+                                       { 149, 53, 53 },  // a/l both not split
+                                       { 94, 20, 48 },   // a split, l not split
+                                       { 83, 53, 24 },   // l split, a not split
+                                       { 52, 18, 18 },   // a/l both split
+                                       // 32x32 -> 16x16
+                                       { 150, 40, 39 },  // a/l both not split
+                                       { 78, 12, 26 },   // a split, l not split
+                                       { 67, 33, 11 },   // l split, a not split
+                                       { 24, 7, 5 },     // a/l both split
+                                       // 64x64 -> 32x32
+                                       { 174, 35, 49 },  // a/l both not split
+                                       { 68, 11, 27 },   // a split, l not split
+                                       { 57, 15, 9 },    // l split, a not split
+                                       { 12, 3, 3 },     // a/l both split
+                                     };
 
 static const vpx_prob
     default_partition_probs[PARTITION_CONTEXTS][PARTITION_TYPES - 1] = {
@@ -309,10 +309,13 @@
 
 static const vpx_prob default_skip_probs[SKIP_CONTEXTS] = { 192, 128, 64 };
 
-static const vpx_prob default_switchable_interp_prob
-    [SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS - 1] = {
-      { 235, 162 }, { 36, 255 }, { 34, 3 }, { 149, 144 },
-    };
+static const vpx_prob default_switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
+                                                    [SWITCHABLE_FILTERS - 1] = {
+                                                      { 235, 162 },
+                                                      { 36, 255 },
+                                                      { 34, 3 },
+                                                      { 149, 144 },
+                                                    };
 
 static void init_mode_probs(FRAME_CONTEXT *fc) {
   vp9_copy(fc->uv_mode_prob, default_if_uv_probs);
--- a/vp9/common/vp9_entropymode.h
+++ b/vp9/common/vp9_entropymode.h
@@ -46,9 +46,8 @@
   vpx_prob uv_mode_prob[INTRA_MODES][INTRA_MODES - 1];
   vpx_prob partition_prob[PARTITION_CONTEXTS][PARTITION_TYPES - 1];
   vp9_coeff_probs_model coef_probs[TX_SIZES][PLANE_TYPES];
-  vpx_prob
-      switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS -
-                                                         1];
+  vpx_prob switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
+                                 [SWITCHABLE_FILTERS - 1];
   vpx_prob inter_mode_probs[INTER_MODE_CONTEXTS][INTER_MODES - 1];
   vpx_prob intra_inter_prob[INTRA_INTER_CONTEXTS];
   vpx_prob comp_inter_prob[COMP_INTER_CONTEXTS];
@@ -65,10 +64,10 @@
   unsigned int uv_mode[INTRA_MODES][INTRA_MODES];
   unsigned int partition[PARTITION_CONTEXTS][PARTITION_TYPES];
   vp9_coeff_count_model coef[TX_SIZES][PLANE_TYPES];
-  unsigned int
-      eob_branch[TX_SIZES][PLANE_TYPES][REF_TYPES][COEF_BANDS][COEFF_CONTEXTS];
-  unsigned int
-      switchable_interp[SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS];
+  unsigned int eob_branch[TX_SIZES][PLANE_TYPES][REF_TYPES][COEF_BANDS]
+                         [COEFF_CONTEXTS];
+  unsigned int switchable_interp[SWITCHABLE_FILTER_CONTEXTS]
+                                [SWITCHABLE_FILTERS];
   unsigned int inter_mode[INTER_MODE_CONTEXTS][INTER_MODES];
   unsigned int intra_inter[INTRA_INTER_CONTEXTS][2];
   unsigned int comp_inter[COMP_INTER_CONTEXTS][2];
@@ -80,10 +79,10 @@
 } FRAME_COUNTS;
 
 extern const vpx_prob vp9_kf_uv_mode_prob[INTRA_MODES][INTRA_MODES - 1];
-extern const vpx_prob
-    vp9_kf_y_mode_prob[INTRA_MODES][INTRA_MODES][INTRA_MODES - 1];
-extern const vpx_prob
-    vp9_kf_partition_probs[PARTITION_CONTEXTS][PARTITION_TYPES - 1];
+extern const vpx_prob vp9_kf_y_mode_prob[INTRA_MODES][INTRA_MODES]
+                                        [INTRA_MODES - 1];
+extern const vpx_prob vp9_kf_partition_probs[PARTITION_CONTEXTS]
+                                            [PARTITION_TYPES - 1];
 extern const vpx_tree_index vp9_intra_mode_tree[TREE_SIZE(INTRA_MODES)];
 extern const vpx_tree_index vp9_inter_mode_tree[TREE_SIZE(INTER_MODES)];
 extern const vpx_tree_index vp9_partition_tree[TREE_SIZE(PARTITION_TYPES)];
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -1451,18 +1451,18 @@
       if (inter_block) {
         const MV_REFERENCE_FRAME ref0 = mi->ref_frame[0];
         if (cm->reference_mode == REFERENCE_MODE_SELECT)
-          counts->comp_inter[vp9_get_reference_mode_context(
-              cm, xd)][has_second_ref(mi)]++;
+          counts->comp_inter[vp9_get_reference_mode_context(cm, xd)]
+                            [has_second_ref(mi)]++;
 
         if (has_second_ref(mi)) {
-          counts->comp_ref[vp9_get_pred_context_comp_ref_p(
-              cm, xd)][ref0 == GOLDEN_FRAME]++;
+          counts->comp_ref[vp9_get_pred_context_comp_ref_p(cm, xd)]
+                          [ref0 == GOLDEN_FRAME]++;
         } else {
-          counts->single_ref[vp9_get_pred_context_single_ref_p1(
-              xd)][0][ref0 != LAST_FRAME]++;
+          counts->single_ref[vp9_get_pred_context_single_ref_p1(xd)][0]
+                            [ref0 != LAST_FRAME]++;
           if (ref0 != LAST_FRAME)
-            counts->single_ref[vp9_get_pred_context_single_ref_p2(
-                xd)][1][ref0 != GOLDEN_FRAME]++;
+            counts->single_ref[vp9_get_pred_context_single_ref_p2(xd)][1]
+                              [ref0 != GOLDEN_FRAME]++;
         }
       }
     }
--- a/vp9/encoder/vp9_encodemb.c
+++ b/vp9/encoder/vp9_encodemb.c
@@ -148,12 +148,10 @@
       if (next < default_eob) {
         band = band_translate[i + 1];
         pt = trellis_get_coeff_context(scan, nb, i, t0, token_cache);
-        rate0 +=
-            mb->token_costs[tx_size][type][ref][band][0][pt][tokens[next][0]
-                                                                 .token];
-        rate1 +=
-            mb->token_costs[tx_size][type][ref][band][0][pt][tokens[next][1]
-                                                                 .token];
+        rate0 += mb->token_costs[tx_size][type][ref][band][0][pt]
+                                [tokens[next][0].token];
+        rate1 += mb->token_costs[tx_size][type][ref][band][0][pt]
+                                [tokens[next][1].token];
       }
       UPDATE_RD_COST();
       /* And pick the best. */
@@ -210,15 +208,13 @@
         band = band_translate[i + 1];
         if (t0 != EOB_TOKEN) {
           pt = trellis_get_coeff_context(scan, nb, i, t0, token_cache);
-          rate0 +=
-              mb->token_costs[tx_size][type][ref][band][!x][pt][tokens[next][0]
-                                                                    .token];
+          rate0 += mb->token_costs[tx_size][type][ref][band][!x][pt]
+                                  [tokens[next][0].token];
         }
         if (t1 != EOB_TOKEN) {
           pt = trellis_get_coeff_context(scan, nb, i, t1, token_cache);
-          rate1 +=
-              mb->token_costs[tx_size][type][ref][band][!x][pt][tokens[next][1]
-                                                                    .token];
+          rate1 += mb->token_costs[tx_size][type][ref][band][!x][pt]
+                                  [tokens[next][1].token];
         }
       }
 
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -2097,8 +2097,9 @@
   }
   pkt.kind = VPX_CODEC_PSNR_PKT;
   if (cpi->use_svc)
-    cpi->svc.layer_context[cpi->svc.spatial_layer_id *
-                           cpi->svc.number_temporal_layers]
+    cpi->svc
+        .layer_context[cpi->svc.spatial_layer_id *
+                       cpi->svc.number_temporal_layers]
         .psnr_pkt = pkt.data.psnr;
   else
     vpx_codec_pkt_list_add(cpi->output_pkt_list, &pkt);
@@ -4037,9 +4038,10 @@
   cm->prev_frame = cm->cur_frame;
 
   if (cpi->use_svc)
-    cpi->svc.layer_context[cpi->svc.spatial_layer_id *
-                               cpi->svc.number_temporal_layers +
-                           cpi->svc.temporal_layer_id]
+    cpi->svc
+        .layer_context[cpi->svc.spatial_layer_id *
+                           cpi->svc.number_temporal_layers +
+                       cpi->svc.temporal_layer_id]
         .last_frame_type = cm->frame_type;
 
   cpi->force_update_segmentation = 0;
--- a/vp9/encoder/vp9_mcomp.c
+++ b/vp9/encoder/vp9_mcomp.c
@@ -858,12 +858,13 @@
 // candidates as indicated in the num_candidates and candidates arrays
 // passed into this function
 //
-static int vp9_pattern_search(
-    const MACROBLOCK *x, MV *ref_mv, int search_param, int sad_per_bit,
-    int do_init_search, int *cost_list, const vp9_variance_fn_ptr_t *vfp,
-    int use_mvcost, const MV *center_mv, MV *best_mv,
-    const int num_candidates[MAX_PATTERN_SCALES],
-    const MV candidates[MAX_PATTERN_SCALES][MAX_PATTERN_CANDIDATES]) {
+static int vp9_pattern_search(const MACROBLOCK *x, MV *ref_mv, int search_param,
+                              int sad_per_bit, int do_init_search,
+                              int *cost_list, const vp9_variance_fn_ptr_t *vfp,
+                              int use_mvcost, const MV *center_mv, MV *best_mv,
+                              const int num_candidates[MAX_PATTERN_SCALES],
+                              const MV candidates[MAX_PATTERN_SCALES]
+                                                 [MAX_PATTERN_CANDIDATES]) {
   const MACROBLOCKD *const xd = &x->e_mbd;
   static const int search_param_to_steps[MAX_MVSEARCH_STEPS] = {
     10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -1798,9 +1798,8 @@
     }
 
     this_rdc.rate += rate_mv;
-    this_rdc.rate +=
-        cpi->inter_mode_cost[x->mbmi_ext->mode_context[ref_frame]][INTER_OFFSET(
-            this_mode)];
+    this_rdc.rate += cpi->inter_mode_cost[x->mbmi_ext->mode_context[ref_frame]]
+                                         [INTER_OFFSET(this_mode)];
     this_rdc.rate += ref_frame_cost[ref_frame];
     this_rdc.rdcost = RDCOST(x->rdmult, x->rddiv, this_rdc.rate, this_rdc.dist);
 
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -62,7 +62,7 @@
 #else
 #define ASSIGN_MINQ_TABLE(bit_depth, name) \
   do {                                     \
-    (void) bit_depth;                      \
+    (void)bit_depth;                       \
     name = name##_8;                       \
   } while (0)
 #endif
--- a/vp9/encoder/vp9_svc_layercontext.c
+++ b/vp9/encoder/vp9_svc_layercontext.c
@@ -377,9 +377,10 @@
 
 int vp9_is_upper_layer_key_frame(const VP9_COMP *const cpi) {
   return is_two_pass_svc(cpi) && cpi->svc.spatial_layer_id > 0 &&
-         cpi->svc.layer_context[cpi->svc.spatial_layer_id *
-                                    cpi->svc.number_temporal_layers +
-                                cpi->svc.temporal_layer_id]
+         cpi->svc
+             .layer_context[cpi->svc.spatial_layer_id *
+                                cpi->svc.number_temporal_layers +
+                            cpi->svc.temporal_layer_id]
              .is_key_frame;
 }
 
@@ -409,8 +410,9 @@
   int spatial_id, temporal_id;
   spatial_id = cpi->svc.spatial_layer_id = cpi->svc.spatial_layer_to_encode;
   frame_num_within_temporal_struct =
-      cpi->svc.layer_context[cpi->svc.spatial_layer_id *
-                             cpi->svc.number_temporal_layers]
+      cpi->svc
+          .layer_context[cpi->svc.spatial_layer_id *
+                         cpi->svc.number_temporal_layers]
           .current_video_frame_in_layer %
       4;
   temporal_id = cpi->svc.temporal_layer_id =
@@ -512,8 +514,9 @@
   int spatial_id, temporal_id;
   spatial_id = cpi->svc.spatial_layer_id = cpi->svc.spatial_layer_to_encode;
   temporal_id = cpi->svc.temporal_layer_id =
-      cpi->svc.layer_context[cpi->svc.spatial_layer_id *
-                             cpi->svc.number_temporal_layers]
+      cpi->svc
+          .layer_context[cpi->svc.spatial_layer_id *
+                         cpi->svc.number_temporal_layers]
           .current_video_frame_in_layer &
       1;
   cpi->ext_refresh_last_frame = cpi->ext_refresh_golden_frame =
--- a/vp9/encoder/vp9_tokenize.c
+++ b/vp9/encoder/vp9_tokenize.c
@@ -366,11 +366,11 @@
   const int16_t *scan, *nb;
   const scan_order *so;
   const int ref = is_inter_block(mi);
-  unsigned int (*const counts)[COEFF_CONTEXTS][ENTROPY_TOKENS] =
+  unsigned int(*const counts)[COEFF_CONTEXTS][ENTROPY_TOKENS] =
       td->rd_counts.coef_counts[tx_size][type][ref];
-  vpx_prob (*const coef_probs)[COEFF_CONTEXTS][UNCONSTRAINED_NODES] =
+  vpx_prob(*const coef_probs)[COEFF_CONTEXTS][UNCONSTRAINED_NODES] =
       cpi->common.fc->coef_probs[tx_size][type][ref];
-  unsigned int (*const eob_branch)[COEFF_CONTEXTS] =
+  unsigned int(*const eob_branch)[COEFF_CONTEXTS] =
       td->counts->eob_branch[tx_size][type][ref];
   const uint8_t *const band = get_band_translate(tx_size);
   const int tx_eob = 16 << (tx_size << 1);
--- a/vp9/vp9_cx_iface.c
+++ b/vp9/vp9_cx_iface.c
@@ -975,9 +975,10 @@
 
   if (lib_flags & FRAMEFLAGS_KEY ||
       (cpi->use_svc &&
-       cpi->svc.layer_context[cpi->svc.spatial_layer_id *
-                                  cpi->svc.number_temporal_layers +
-                              cpi->svc.temporal_layer_id]
+       cpi->svc
+           .layer_context[cpi->svc.spatial_layer_id *
+                              cpi->svc.number_temporal_layers +
+                          cpi->svc.temporal_layer_id]
            .is_key_frame))
     flags |= VPX_FRAME_IS_KEY;
 
@@ -1102,8 +1103,9 @@
 
 #if CONFIG_SPATIAL_SVC
         if (cpi->use_svc)
-          cpi->svc.layer_context[cpi->svc.spatial_layer_id *
-                                 cpi->svc.number_temporal_layers]
+          cpi->svc
+              .layer_context[cpi->svc.spatial_layer_id *
+                             cpi->svc.number_temporal_layers]
               .layer_size += size;
 #endif
 
--- a/vpx_dsp/x86/vpx_subpixel_8t_intrin_avx2.c
+++ b/vpx_dsp/x86/vpx_subpixel_8t_intrin_avx2.c
@@ -42,7 +42,7 @@
       (__clang_major__ == 5 && __clang_minor__ == 0)))
 
 #define MM256_BROADCASTSI128_SI256(x) \
-  _mm_broadcastsi128_si256((__m128i const *) & (x))
+  _mm_broadcastsi128_si256((__m128i const *)&(x))
 #else  // clang > 3.3, and not 5.0 on macosx.
 #define MM256_BROADCASTSI128_SI256(x) _mm256_broadcastsi128_si256(x)
 #endif  // clang <= 3.3
@@ -49,7 +49,7 @@
 #elif defined(__GNUC__)
 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 6)
 #define MM256_BROADCASTSI128_SI256(x) \
-  _mm_broadcastsi128_si256((__m128i const *) & (x))
+  _mm_broadcastsi128_si256((__m128i const *)&(x))
 #elif __GNUC__ == 4 && __GNUC_MINOR__ == 7
 #define MM256_BROADCASTSI128_SI256(x) _mm_broadcastsi128_si256(x)
 #else  // gcc > 4.7
--- a/vpx_ports/x86.h
+++ b/vpx_ports/x86.h
@@ -119,7 +119,7 @@
                    : "c"(ecx));
   return ((uint64_t)edx << 32) | eax;
 }
-#elif(defined(_M_X64) || defined(_M_IX86)) && defined(_MSC_FULL_VER) && \
+#elif (defined(_M_X64) || defined(_M_IX86)) && defined(_MSC_FULL_VER) && \
     _MSC_FULL_VER >= 160040219  // >= VS2010 SP1
 #include <immintrin.h>
 #define xgetbv() _xgetbv(0)
--- a/vpxenc.c
+++ b/vpxenc.c
@@ -1981,8 +1981,7 @@
     if (global.pass && global.passes == 2)
       FOREACH_STREAM({
         if (!stream->config.stats_fn)
-          die(
-              "Stream %d: Must specify --fpf when --pass=%d"
+          die("Stream %d: Must specify --fpf when --pass=%d"
               " and --passes=2\n",
               stream->index, global.pass);
       });