apply clang-format

Change-Id: Ib1b5dde5d4c6479c968cd7d7a4a1d01abae1fcf6
diff --git a/av1/encoder/av1_quantize.h b/av1/encoder/av1_quantize.h
index 92ba3e7..62a03da 100644
--- a/av1/encoder/av1_quantize.h
+++ b/av1/encoder/av1_quantize.h
@@ -43,10 +43,12 @@
 
 typedef struct {
 #if CONFIG_NEW_QUANT
-  DECLARE_ALIGNED(16, tran_low_t, y_cuml_bins_nuq[QUANT_PROFILES][QINDEX_RANGE]
-                                                 [COEF_BANDS][NUQ_KNOTS]);
-  DECLARE_ALIGNED(16, tran_low_t, uv_cuml_bins_nuq[QUANT_PROFILES][QINDEX_RANGE]
-                                                  [COEF_BANDS][NUQ_KNOTS]);
+  DECLARE_ALIGNED(
+      16, tran_low_t,
+      y_cuml_bins_nuq[QUANT_PROFILES][QINDEX_RANGE][COEF_BANDS][NUQ_KNOTS]);
+  DECLARE_ALIGNED(
+      16, tran_low_t,
+      uv_cuml_bins_nuq[QUANT_PROFILES][QINDEX_RANGE][COEF_BANDS][NUQ_KNOTS]);
 #endif  // CONFIG_NEW_QUANT
   // 0: dc 1: ac 2-8: ac repeated to SIMD width
   DECLARE_ALIGNED(16, int16_t, y_quant[QINDEX_RANGE][8]);
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 0c9965f..bda7217 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -1232,8 +1232,9 @@
     if (left_mi)
       palette_y_mode_ctx +=
           (left_mi->mbmi.palette_mode_info.palette_size[0] > 0);
-    aom_write(w, n > 0, av1_default_palette_y_mode_prob[bsize - BLOCK_8X8]
-                                                       [palette_y_mode_ctx]);
+    aom_write(
+        w, n > 0,
+        av1_default_palette_y_mode_prob[bsize - BLOCK_8X8][palette_y_mode_ctx]);
     if (n > 0) {
       av1_write_token(w, av1_palette_size_tree,
                       av1_default_palette_y_size_prob[bsize - BLOCK_8X8],
@@ -2987,12 +2988,11 @@
 #endif
 #if CONFIG_ENTROPY
 // Calculate the token counts between subsequent subframe updates.
-static void get_coef_counts_diff(AV1_COMP *cpi, int index,
-                                 av1_coeff_count coef_counts[TX_SIZES]
-                                                            [PLANE_TYPES],
-                                 unsigned int eob_counts[TX_SIZES][PLANE_TYPES]
-                                                        [REF_TYPES][COEF_BANDS]
-                                                        [COEFF_CONTEXTS]) {
+static void get_coef_counts_diff(
+    AV1_COMP *cpi, int index,
+    av1_coeff_count coef_counts[TX_SIZES][PLANE_TYPES],
+    unsigned int eob_counts[TX_SIZES][PLANE_TYPES][REF_TYPES][COEF_BANDS]
+                           [COEFF_CONTEXTS]) {
   int i, j, k, l, m, tx_size, val;
   const int max_idx = cpi->common.coef_probs_update_idx;
   const TX_MODE tx_mode = cpi->common.tx_mode;
@@ -3011,8 +3011,8 @@
                   cpi->common.counts.eob_branch[tx_size][i][j][k][l] -
                   subframe_stats->eob_counts_buf[max_idx][tx_size][i][j][k][l];
             } else {
-              val = subframe_stats->eob_counts_buf[index + 1][tx_size][i][j][k]
-                                                  [l] -
+              val = subframe_stats
+                        ->eob_counts_buf[index + 1][tx_size][i][j][k][l] -
                     subframe_stats->eob_counts_buf[index][tx_size][i][j][k][l];
             }
             assert(val >= 0);
@@ -3021,13 +3021,13 @@
             for (m = 0; m < ENTROPY_TOKENS; ++m) {
               if (index == max_idx) {
                 val = cpi->td.rd_counts.coef_counts[tx_size][i][j][k][l][m] -
-                      subframe_stats->coef_counts_buf[max_idx][tx_size][i][j][k]
-                                                     [l][m];
+                      subframe_stats
+                          ->coef_counts_buf[max_idx][tx_size][i][j][k][l][m];
               } else {
-                val = subframe_stats->coef_counts_buf[index + 1][tx_size][i][j]
-                                                     [k][l][m] -
-                      subframe_stats->coef_counts_buf[index][tx_size][i][j][k]
-                                                     [l][m];
+                val = subframe_stats
+                          ->coef_counts_buf[index + 1][tx_size][i][j][k][l][m] -
+                      subframe_stats
+                          ->coef_counts_buf[index][tx_size][i][j][k][l][m];
               }
               assert(val >= 0);
               coef_counts[tx_size][i][j][k][l][m] = val;
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 7917b19..6d98498 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -2083,8 +2083,8 @@
                               [ref0 != BWDREF_FRAME]++;
           } else {
             const int bit1 = !(ref0 == LAST2_FRAME || ref0 == LAST_FRAME);
-            counts->single_ref[av1_get_pred_context_single_ref_p3(xd)][2]
-                              [bit1]++;
+            counts
+                ->single_ref[av1_get_pred_context_single_ref_p3(xd)][2][bit1]++;
             if (!bit1) {
               counts->single_ref[av1_get_pred_context_single_ref_p4(xd)][3]
                                 [ref0 != LAST_FRAME]++;
@@ -2491,8 +2491,8 @@
             !xd->mi[0]->mbmi.skip) {
           int eset = get_ext_tx_set(supertx_size, bsize, 1);
           if (eset > 0) {
-            ++td->counts->inter_ext_tx[eset][supertx_size]
-                                      [xd->mi[0]->mbmi.tx_type];
+            ++td->counts
+                  ->inter_ext_tx[eset][supertx_size][xd->mi[0]->mbmi.tx_type];
           }
         }
 #else
@@ -3992,11 +3992,10 @@
 
         pc_tree->partitioning = PARTITION_SPLIT;
 
-        sum_rdc.rate +=
-            av1_cost_bit(cm->fc->supertx_prob
-                             [partition_supertx_context_lookup[PARTITION_SPLIT]]
-                             [supertx_size],
-                         0);
+        sum_rdc.rate += av1_cost_bit(
+            cm->fc->supertx_prob[partition_supertx_context_lookup
+                                     [PARTITION_SPLIT]][supertx_size],
+            0);
         sum_rdc.rdcost =
             RDCOST(x->rdmult, x->rddiv, sum_rdc.rate, sum_rdc.dist);
 
@@ -4010,9 +4009,8 @@
                         &tmp_rdc.rate, &tmp_rdc.dist, &best_tx, pc_tree);
 
           tmp_rdc.rate += av1_cost_bit(
-              cm->fc->supertx_prob
-                  [partition_supertx_context_lookup[PARTITION_SPLIT]]
-                  [supertx_size],
+              cm->fc->supertx_prob[partition_supertx_context_lookup
+                                       [PARTITION_SPLIT]][supertx_size],
               1);
           tmp_rdc.rdcost =
               RDCOST(x->rdmult, x->rddiv, tmp_rdc.rate, tmp_rdc.dist);
@@ -4076,11 +4074,10 @@
 
         pc_tree->partitioning = PARTITION_SPLIT;
 
-        sum_rdc.rate +=
-            av1_cost_bit(cm->fc->supertx_prob
-                             [partition_supertx_context_lookup[PARTITION_SPLIT]]
-                             [supertx_size],
-                         0);
+        sum_rdc.rate += av1_cost_bit(
+            cm->fc->supertx_prob[partition_supertx_context_lookup
+                                     [PARTITION_SPLIT]][supertx_size],
+            0);
         sum_rdc.rdcost =
             RDCOST(x->rdmult, x->rddiv, sum_rdc.rate, sum_rdc.dist);
 
@@ -4094,9 +4091,8 @@
                         &tmp_rdc.rate, &tmp_rdc.dist, &best_tx, pc_tree);
 
           tmp_rdc.rate += av1_cost_bit(
-              cm->fc->supertx_prob
-                  [partition_supertx_context_lookup[PARTITION_SPLIT]]
-                  [supertx_size],
+              cm->fc->supertx_prob[partition_supertx_context_lookup
+                                       [PARTITION_SPLIT]][supertx_size],
               1);
           tmp_rdc.rdcost =
               RDCOST(x->rdmult, x->rddiv, tmp_rdc.rate, tmp_rdc.dist);
@@ -5806,8 +5802,8 @@
       int eset = get_ext_tx_set(tx_size, bsize, is_inter);
       if (eset > 0) {
         if (is_inter) {
-          ++td->counts->inter_ext_tx[eset][txsize_sqr_map[tx_size]]
-                                    [mbmi->tx_type];
+          ++td->counts
+                ->inter_ext_tx[eset][txsize_sqr_map[tx_size]][mbmi->tx_type];
         } else {
           ++td->counts->intra_ext_tx[eset][txsize_sqr_map[tx_size]][mbmi->mode]
                                     [mbmi->tx_type];
@@ -5820,9 +5816,9 @@
       if (is_inter) {
         ++td->counts->inter_ext_tx[tx_size][mbmi->tx_type];
       } else {
-        ++td->counts->intra_ext_tx[tx_size]
-                                  [intra_mode_to_tx_type_context[mbmi->mode]]
-                                  [mbmi->tx_type];
+        ++td->counts
+              ->intra_ext_tx[tx_size][intra_mode_to_tx_type_context[mbmi->mode]]
+                            [mbmi->tx_type];
       }
     }
 #endif  // CONFIG_EXT_TX
diff --git a/av1/encoder/encodemb.c b/av1/encoder/encodemb.c
index 8e39d57..1a87203 100644
--- a/av1/encoder/encodemb.c
+++ b/av1/encoder/encodemb.c
@@ -1153,11 +1153,11 @@
   assert(OD_COEFF_SHIFT >= 3);
   // DC quantizer for PVQ
   if (use_activity_masking)
-    pvq_dc_quant = OD_MAXI(
-        1, (quant[0] << (OD_COEFF_SHIFT - 3)) *
-                   daala_enc->state.pvq_qm_q4[plane]
-                                             [od_qm_get_index(tx_size, 0)] >>
-               4);
+    pvq_dc_quant =
+        OD_MAXI(1, (quant[0] << (OD_COEFF_SHIFT - 3)) *
+                           daala_enc->state
+                               .pvq_qm_q4[plane][od_qm_get_index(tx_size, 0)] >>
+                       4);
   else
     pvq_dc_quant = OD_MAXI(1, quant[0] << (OD_COEFF_SHIFT - 3));
 
diff --git a/av1/encoder/firstpass.c b/av1/encoder/firstpass.c
index 683bde6..f78b977 100644
--- a/av1/encoder/firstpass.c
+++ b/av1/encoder/firstpass.c
@@ -1594,10 +1594,11 @@
   }
 
   // Clamp odd edge cases.
-  total_group_bits =
-      (total_group_bits < 0) ? 0 : (total_group_bits > twopass->kf_group_bits)
-                                       ? twopass->kf_group_bits
-                                       : total_group_bits;
+  total_group_bits = (total_group_bits < 0)
+                         ? 0
+                         : (total_group_bits > twopass->kf_group_bits)
+                               ? twopass->kf_group_bits
+                               : total_group_bits;
 
   // Clip based on user supplied data rate variability limit.
   if (total_group_bits > (int64_t)max_bits * rc->baseline_gf_interval)
diff --git a/av1/encoder/mcomp.c b/av1/encoder/mcomp.c
index 2956447..af112e5 100644
--- a/av1/encoder/mcomp.c
+++ b/av1/encoder/mcomp.c
@@ -944,13 +944,12 @@
 // candidates as indicated in the num_candidates and candidates arrays
 // passed into this function
 //
-static int pattern_search(MACROBLOCK *x, MV *start_mv, int search_param,
-                          int sad_per_bit, int do_init_search, int *cost_list,
-                          const aom_variance_fn_ptr_t *vfp, int use_mvcost,
-                          const MV *center_mv,
-                          const int num_candidates[MAX_PATTERN_SCALES],
-                          const MV candidates[MAX_PATTERN_SCALES]
-                                             [MAX_PATTERN_CANDIDATES]) {
+static int pattern_search(
+    MACROBLOCK *x, MV *start_mv, int search_param, int sad_per_bit,
+    int do_init_search, int *cost_list, const aom_variance_fn_ptr_t *vfp,
+    int use_mvcost, const MV *center_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,
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index e87e535..f1659a6 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -4844,8 +4844,8 @@
 
 #if CONFIG_EXT_INTER
   if (is_compound) {
-    return cpi->inter_compound_mode_cost[mode_context]
-                                        [INTER_COMPOUND_OFFSET(mode)];
+    return cpi
+        ->inter_compound_mode_cost[mode_context][INTER_COMPOUND_OFFSET(mode)];
   } else {
     if (mode == NEWMV || mode == NEWFROMNEARMV) {
 #else
@@ -4885,8 +4885,8 @@
   assert(is_inter_mode(mode));
 #if CONFIG_EXT_INTER
   if (is_inter_compound_mode(mode)) {
-    return cpi->inter_compound_mode_cost[mode_context]
-                                        [INTER_COMPOUND_OFFSET(mode)];
+    return cpi
+        ->inter_compound_mode_cost[mode_context][INTER_COMPOUND_OFFSET(mode)];
   } else {
 #endif  // CONFIG_EXT_INTER
     return cpi->inter_mode_cost[mode_context][INTER_OFFSET(mode)];
@@ -4929,17 +4929,15 @@
 }
 #endif  // CONFIG_GLOBAL_MOTION
 
-static int set_and_cost_bmi_mvs(const AV1_COMP *const cpi, MACROBLOCK *x,
-                                MACROBLOCKD *xd, int i, PREDICTION_MODE mode,
-                                int_mv this_mv[2],
-                                int_mv frame_mv[MB_MODE_COUNT]
-                                               [TOTAL_REFS_PER_FRAME],
-                                int_mv seg_mvs[TOTAL_REFS_PER_FRAME],
+static int set_and_cost_bmi_mvs(
+    const AV1_COMP *const cpi, MACROBLOCK *x, MACROBLOCKD *xd, int i,
+    PREDICTION_MODE mode, int_mv this_mv[2],
+    int_mv frame_mv[MB_MODE_COUNT][TOTAL_REFS_PER_FRAME],
+    int_mv seg_mvs[TOTAL_REFS_PER_FRAME],
 #if CONFIG_EXT_INTER
-                                int_mv compound_seg_newmvs[2],
+    int_mv compound_seg_newmvs[2],
 #endif  // CONFIG_EXT_INTER
-                                int_mv *best_ref_mv[2], const int *mvjcost,
-                                int *mvcost[2]) {
+    int_mv *best_ref_mv[2], const int *mvjcost, int *mvcost[2]) {
   MODE_INFO *const mic = xd->mi[0];
   const MB_MODE_INFO *const mbmi = &mic->mbmi;
   const MB_MODE_INFO_EXT *const mbmi_ext = x->mbmi_ext;
@@ -6739,13 +6737,12 @@
   ctx->hybrid_pred_diff = (int)comp_pred_diff[REFERENCE_MODE_SELECT];
 }
 
-static void setup_buffer_inter(const AV1_COMP *const cpi, MACROBLOCK *x,
-                               MV_REFERENCE_FRAME ref_frame,
-                               BLOCK_SIZE block_size, int mi_row, int mi_col,
-                               int_mv frame_nearest_mv[TOTAL_REFS_PER_FRAME],
-                               int_mv frame_near_mv[TOTAL_REFS_PER_FRAME],
-                               struct buf_2d yv12_mb[TOTAL_REFS_PER_FRAME]
-                                                    [MAX_MB_PLANE]) {
+static void setup_buffer_inter(
+    const AV1_COMP *const cpi, MACROBLOCK *x, MV_REFERENCE_FRAME ref_frame,
+    BLOCK_SIZE block_size, int mi_row, int mi_col,
+    int_mv frame_nearest_mv[TOTAL_REFS_PER_FRAME],
+    int_mv frame_near_mv[TOTAL_REFS_PER_FRAME],
+    struct buf_2d yv12_mb[TOTAL_REFS_PER_FRAME][MAX_MB_PLANE]) {
   const AV1_COMMON *cm = &cpi->common;
   const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_buffer(cpi, ref_frame);
   MACROBLOCKD *const xd = &x->e_mbd;
@@ -10282,8 +10279,9 @@
           clamp_mv2(&cur_mv.as_mv, xd);
 
           if (!mv_check_bounds(x, &cur_mv.as_mv)) {
-            int dummy_single_skippable[MB_MODE_COUNT]
-                                      [TOTAL_REFS_PER_FRAME] = { { 0 } };
+            int dummy_single_skippable[MB_MODE_COUNT][TOTAL_REFS_PER_FRAME] = {
+              { 0 }
+            };
 #if CONFIG_EXT_INTER
             int_mv dummy_single_newmvs[2][TOTAL_REFS_PER_FRAME] = { { { 0 } },
                                                                     { { 0 } } };
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index 6404fcc..81ef54f 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -182,10 +182,10 @@
     sf->tx_size_search_method =
         frame_is_boosted(cpi) ? USE_FULL_RD : USE_LARGESTALL;
     sf->mode_search_skip_flags =
-        (cm->frame_type == KEY_FRAME) ? 0 : FLAG_SKIP_INTRA_DIRMISMATCH |
-                                                FLAG_SKIP_INTRA_BESTINTER |
-                                                FLAG_SKIP_COMP_BESTINTRA |
-                                                FLAG_SKIP_INTRA_LOWVAR;
+        (cm->frame_type == KEY_FRAME)
+            ? 0
+            : FLAG_SKIP_INTRA_DIRMISMATCH | FLAG_SKIP_INTRA_BESTINTER |
+                  FLAG_SKIP_COMP_BESTINTRA | FLAG_SKIP_INTRA_LOWVAR;
     sf->disable_filter_search_var_thresh = 100;
     sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
     sf->auto_min_max_partition_size = RELAXED_NEIGHBORING_MIN_MAX;
@@ -322,10 +322,10 @@
 
   if (speed >= 2) {
     sf->mode_search_skip_flags =
-        (cm->frame_type == KEY_FRAME) ? 0 : FLAG_SKIP_INTRA_DIRMISMATCH |
-                                                FLAG_SKIP_INTRA_BESTINTER |
-                                                FLAG_SKIP_COMP_BESTINTRA |
-                                                FLAG_SKIP_INTRA_LOWVAR;
+        (cm->frame_type == KEY_FRAME)
+            ? 0
+            : FLAG_SKIP_INTRA_DIRMISMATCH | FLAG_SKIP_INTRA_BESTINTER |
+                  FLAG_SKIP_COMP_BESTINTRA | FLAG_SKIP_INTRA_LOWVAR;
     sf->adaptive_pred_interp_filter = 2;
     sf->disable_filter_search_var_thresh = 50;
     sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
diff --git a/av1/encoder/subexp.c b/av1/encoder/subexp.c
index c40ce37..577b618 100644
--- a/av1/encoder/subexp.c
+++ b/av1/encoder/subexp.c
@@ -216,10 +216,9 @@
   return bestsavings;
 }
 
-int av1_prob_update_search_model_subframe(unsigned int ct[ENTROPY_NODES]
-                                                         [COEF_PROBS_BUFS][2],
-                                          const aom_prob *oldp, aom_prob *bestp,
-                                          aom_prob upd, int stepsize, int n) {
+int av1_prob_update_search_model_subframe(
+    unsigned int ct[ENTROPY_NODES][COEF_PROBS_BUFS][2], const aom_prob *oldp,
+    aom_prob *bestp, aom_prob upd, int stepsize, int n) {
   int i, old_b, new_b, update_b, savings, bestsavings;
   int newp;
   const int step_sign = *bestp > oldp[PIVOT_NODE] ? -1 : 1;
diff --git a/av1/encoder/subexp.h b/av1/encoder/subexp.h
index 9cd3c0b..e331582 100644
--- a/av1/encoder/subexp.h
+++ b/av1/encoder/subexp.h
@@ -38,10 +38,9 @@
 #if CONFIG_ENTROPY
 int av1_prob_update_search_subframe(unsigned int ct[][2], aom_prob oldp,
                                     aom_prob *bestp, aom_prob upd, int n);
-int av1_prob_update_search_model_subframe(unsigned int ct[ENTROPY_NODES]
-                                                         [COEF_PROBS_BUFS][2],
-                                          const aom_prob *oldp, aom_prob *bestp,
-                                          aom_prob upd, int stepsize, int n);
+int av1_prob_update_search_model_subframe(
+    unsigned int ct[ENTROPY_NODES][COEF_PROBS_BUFS][2], const aom_prob *oldp,
+    aom_prob *bestp, aom_prob upd, int stepsize, int n);
 #endif  // CONFIG_ENTROPY
 
 //
diff --git a/av1/encoder/tokenize.c b/av1/encoder/tokenize.c
index 549815f..9f23b04 100644
--- a/av1/encoder/tokenize.c
+++ b/av1/encoder/tokenize.c
@@ -412,11 +412,10 @@
   int i, j;
   int this_rate = 0;
   uint8_t color_order[PALETTE_MAX_SIZE];
-  const aom_prob(*const probs)[PALETTE_COLOR_INDEX_CONTEXTS]
-                              [PALETTE_COLORS - 1] =
-                                  plane == 0
-                                      ? av1_default_palette_y_color_index_prob
-                                      : av1_default_palette_uv_color_index_prob;
+  const aom_prob(
+      *const probs)[PALETTE_COLOR_INDEX_CONTEXTS][PALETTE_COLORS - 1] =
+      plane == 0 ? av1_default_palette_y_color_index_prob
+                 : av1_default_palette_uv_color_index_prob;
   int plane_block_width, rows, cols;
   av1_get_block_dimensions(bsize, plane, xd, &plane_block_width, NULL, &rows,
                            &cols);