]> granicus.if.org Git - libvpx/commitdiff
apply clang-format
authorclang-format <noreply@google.com>
Thu, 15 Sep 2016 22:07:46 +0000 (15:07 -0700)
committerJames Zern <jzern@google.com>
Thu, 15 Sep 2016 22:07:53 +0000 (15:07 -0700)
Change-Id: I501597b7c1e0f0c7ae2aea3ee8073f0a641b3487

28 files changed:
examples/vp8_multi_resolution_encoder.c
examples/vp9_spatial_svc_encoder.c
examples/vpx_temporal_svc_encoder.c
vp8/common/entropymode.c
vp8/common/entropymode.h
vp8/common/onyxc_int.h
vp8/decoder/error_concealment.c
vp8/encoder/firstpass.c
vp8/encoder/mcomp.c
vp8/encoder/pickinter.c
vp8/encoder/ratectrl.c
vp8/encoder/rdopt.c
vp8/encoder/vp8_quantize.c
vp9/common/vp9_entropy.h
vp9/common/vp9_entropymode.c
vp9/common/vp9_entropymode.h
vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_encodemb.c
vp9/encoder/vp9_encoder.c
vp9/encoder/vp9_mcomp.c
vp9/encoder/vp9_pickmode.c
vp9/encoder/vp9_ratectrl.c
vp9/encoder/vp9_svc_layercontext.c
vp9/encoder/vp9_tokenize.c
vp9/vp9_cx_iface.c
vpx_dsp/x86/vpx_subpixel_8t_intrin_avx2.c
vpx_ports/x86.h
vpxenc.c

index a89ec89e38cb98931deace803c0143963102212f..65308a0bd0becfe18430375e005927e97adea0a5 100644 (file)
@@ -340,8 +340,7 @@ int main(int argc, char **argv) {
   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]);
index 57cca8b772842b53fc383294b520cf3bfd9f589d..cecdce0804ceb9571f19e7972e63b92c4670fe14 100644 (file)
@@ -497,8 +497,7 @@ static void printout_rate_control_summary(struct RateControlStats *rc,
          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);
 }
index 633cdf1f51c2326666a512e6ed8b67a3bab293e7..4a33877874a4634f193df87b1e3d17669c3b555f 100644 (file)
@@ -530,14 +530,12 @@ int main(int argc, char **argv) {
   // 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]);
index 239492a8cb801c39cdf88a8a9a16a84cd1fd1be1..30c2fa86aebcee9d54482367ef52bcdd470bd9b1 100644 (file)
@@ -34,13 +34,12 @@ int vp8_mv_cont(const int_mv *l, const int_mv *a) {
 
 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 },
index 9331eb225f36a69567fbd7984cdf46240247bfe1..e0a17df10c2edde2d47b5ff5cff393225f3c8367 100644 (file)
@@ -40,8 +40,9 @@ extern int vp8_mv_cont(const int_mv *l, const int_mv *a);
 #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 vp8_tree_index vp8_small_mvtree[];
 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"
index 6d3de4f1a0c3910319bd6cf81e9e1be09426644e..732656f2f66b47249808ed0012cf1aeb194039fb 100644 (file)
@@ -42,8 +42,8 @@ typedef struct frame_contexts {
   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;
 
index df292f21db0f4cf9111b7ac9c55537b214cd7e55..e22141492c85f11c8692735838b5003190fa99d7 100644 (file)
@@ -435,8 +435,8 @@ static void interpolate_mvs(MACROBLOCKD *mb, EC_BLOCK *neighbors,
         /* 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 */
index a175d1a2328fadbd9f57a1358f2cab34a018e546..cd34e33fb8991d9ed7c9dd448392064e850bad77 100644 (file)
@@ -53,8 +53,8 @@ extern const int vp8_gf_boost_qadjustment[QINDEX_RANGE];
 
 #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
 
index 5cdfa62f8fd075e54eb95b06b0fad069b2340229..970120f3b26a9fdd7304d17e91125e49db983534 100644 (file)
@@ -206,17 +206,19 @@ void vp8_init3smotion_compensation(MACROBLOCK *x, int stride) {
 /* 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,
index 7948657fc7492e7e91e40296280ce26ba0cc2d4a..f0050d201f122c613a77e19dc2848e59d47944cb 100644 (file)
@@ -976,8 +976,8 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
             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) {
index d1e65487b9518f3c9f8d0c314308710bcec500ee..649f696dc75c3cf9398e4a68d8781157288e368b 100644 (file)
@@ -49,36 +49,38 @@ const int vp8_bits_per_mb[2][QINDEX_RANGE] = {
   /* 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,
   }
 };
 
index bba4fa8eaf62ba2c383622b1eb124ace646494d4..9ba301e0801c7af59065c29ee87dc77e96427ea8 100644 (file)
@@ -105,10 +105,11 @@ const int vp8_ref_frame_order[MAX_MODES] = {
   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 @@ static void rd_pick_intra_mbuv_mode(MACROBLOCK *x, int *rate,
 
     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 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
         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;
index 2bcb53cc3a7839ae266ac373bcc7cc2736ff48bb..ff6e04eaada4fc55c29cc1194488693b05449589 100644 (file)
@@ -297,13 +297,13 @@ void vp8cx_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x, int ok_to_skip) {
   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;
     }
index 94a1e5971b8aa76432a134c5ba6f78d6c9081a8b..1da49116687d282c5958931787e4cb1e3c24a8f8 100644 (file)
@@ -109,10 +109,10 @@ DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat6_prob_high12[18]);
 
 // #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 @@ extern const vpx_prob vp9_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES];
 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);
 
index f96d39352f15f3d8e3c25f2205867113fd5f61ef..22365efc504c7c8a0276f527540b8847a1cdeeb8 100644 (file)
@@ -179,29 +179,29 @@ static const vpx_prob default_if_uv_probs[INTRA_MODES][INTRA_MODES - 1] = {
   { 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 @@ void tx_counts_to_branch_counts_8x8(const unsigned int *tx_count_8x8p,
 
 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);
index 64ca807b72516dcccbe48e4943880510c3b709de..0ee663fe883575a522fd5a6da0f3b0c65f1fd9d1 100644 (file)
@@ -46,9 +46,8 @@ typedef struct frame_contexts {
   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 @@ typedef struct FRAME_COUNTS {
   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 @@ typedef struct FRAME_COUNTS {
 } 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)];
index b853dcd08f9d5145d944c5431e66f4a67f9968ff..8d7c3576b2a81e754c245febc6bd0cf9feb4f262 100644 (file)
@@ -1451,18 +1451,18 @@ static void update_stats(VP9_COMMON *cm, ThreadData *td) {
       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]++;
         }
       }
     }
index 87b958e4171833aef6dac9fdcbcb2227adec1091..20ebe68197e6a3d53d46d34d4f6478b4ca32373f 100644 (file)
@@ -148,12 +148,10 @@ int vp9_optimize_b(MACROBLOCK *mb, int plane, int block, TX_SIZE tx_size,
       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 @@ int vp9_optimize_b(MACROBLOCK *mb, int plane, int block, TX_SIZE tx_size,
         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];
         }
       }
 
index 55103627e8fab5fd55eae491762c33fda2982c04..e8f5ec55ab831035fd33a9d20f0d5b1fed542562 100644 (file)
@@ -2097,8 +2097,9 @@ static void generate_psnr_packet(VP9_COMP *cpi) {
   }
   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 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, size_t *size,
   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;
index b3b27b3cf7143146e23bdc6761a2ebb1d5a3ab5b..2d9bcbda6797bde7fe241f8aff55158de01b103c 100644 (file)
@@ -858,12 +858,13 @@ static INLINE void calc_int_cost_list(const MACROBLOCK *x, const MV *ref_mv,
 // 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,
index 60178168b36df2d902f543dfd7786d25eabdb51e..76d2611d89fa622bab461a9433d077f5a3df3b9f 100644 (file)
@@ -1798,9 +1798,8 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
     }
 
     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);
 
index c14acd59a57dc4cdc79253423b6853bec34b23df..3889d0f52f90500f6e263f39124ee9ba4eaac5ee 100644 (file)
@@ -64,7 +64,7 @@
 #else
 #define ASSIGN_MINQ_TABLE(bit_depth, name) \
   do {                                     \
-    (void) bit_depth;                      \
+    (void)bit_depth;                       \
     name = name##_8;                       \
   } while (0)
 #endif
index 879d46c76d14b9a4c5cef6981cc6b44d68ec7e6b..2d29e268b1f6fddbd63c394721c03d660ce2d2df 100644 (file)
@@ -377,9 +377,10 @@ void vp9_inc_frame_in_layer(VP9_COMP *const cpi) {
 
 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 @@ static void set_flags_and_fb_idx_for_temporal_mode3(VP9_COMP *const cpi) {
   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 @@ static void set_flags_and_fb_idx_for_temporal_mode2(VP9_COMP *const cpi) {
   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 =
index 05b9692bdfd51d822d5ac83bdce052964bae2c69..dc2616dbe1d03f31be5ef1d86cb5c8b52dc752b6 100644 (file)
@@ -366,11 +366,11 @@ static void tokenize_b(int plane, int block, int row, int col,
   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);
index 01ed3e795a8e214be0f9530e86c3ea769d27659b..a797b2c2624cc2916dd166e50c5044849325d86e 100644 (file)
@@ -975,9 +975,10 @@ static vpx_codec_frame_flags_t get_frame_pkt_flags(const VP9_COMP *cpi,
 
   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 @@ static vpx_codec_err_t encoder_encode(vpx_codec_alg_priv_t *ctx,
 
 #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
 
index 6d53b8705ddf9573efee76d392e8402614b50ab8..2b41d99e554054c4001710b9edf656282cdfe071 100644 (file)
@@ -42,14 +42,14 @@ DECLARE_ALIGNED(32, static const uint8_t, filt4_global_avx2[32]) = {
       (__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
 #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
index f76533529339848f3ab7a5118f1256052bce6891..6ba02cf1fcc185dbedc6037a5bb9e62d9f9acf30 100644 (file)
@@ -119,7 +119,7 @@ static INLINE uint64_t xgetbv(void) {
                    : "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)
index c7b4f08ff4f80e25fc73c71ab888afb5cfada902..6e0af57a42c4ee0cafc4b4059c1808e2d64ce936 100644 (file)
--- a/vpxenc.c
+++ b/vpxenc.c
@@ -1981,8 +1981,7 @@ int main(int argc, const char **argv_) {
     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);
       });