From 5f6d143b41ca45c9f823849473bb8ce5437b0659 Mon Sep 17 00:00:00 2001 From: clang-format Date: Thu, 15 Sep 2016 15:07:46 -0700 Subject: [PATCH] apply clang-format Change-Id: I501597b7c1e0f0c7ae2aea3ee8073f0a641b3487 --- examples/vp8_multi_resolution_encoder.c | 3 +- examples/vp9_spatial_svc_encoder.c | 3 +- examples/vpx_temporal_svc_encoder.c | 6 ++-- vp8/common/entropymode.c | 13 ++++--- vp8/common/entropymode.h | 13 +++---- vp8/common/onyxc_int.h | 4 +-- vp8/decoder/error_concealment.c | 4 +-- vp8/encoder/firstpass.c | 4 +-- vp8/encoder/mcomp.c | 24 +++++++------ vp8/encoder/pickinter.c | 4 +-- vp8/encoder/ratectrl.c | 52 ++++++++++++++-------------- vp8/encoder/rdopt.c | 18 +++++----- vp8/encoder/vp8_quantize.c | 8 ++--- vp9/common/vp9_entropy.h | 13 +++---- vp9/common/vp9_entropymode.c | 57 ++++++++++++++++--------------- vp9/common/vp9_entropymode.h | 21 ++++++------ vp9/encoder/vp9_encodeframe.c | 16 ++++----- vp9/encoder/vp9_encodemb.c | 20 +++++------ vp9/encoder/vp9_encoder.c | 12 ++++--- vp9/encoder/vp9_mcomp.c | 13 +++---- vp9/encoder/vp9_pickmode.c | 5 ++- vp9/encoder/vp9_ratectrl.c | 2 +- vp9/encoder/vp9_svc_layercontext.c | 17 +++++---- vp9/encoder/vp9_tokenize.c | 6 ++-- vp9/vp9_cx_iface.c | 12 ++++--- vpx_dsp/x86/vpx_subpixel_8t_intrin_avx2.c | 4 +-- vpx_ports/x86.h | 2 +- vpxenc.c | 3 +- 28 files changed, 182 insertions(+), 177 deletions(-) diff --git a/examples/vp8_multi_resolution_encoder.c b/examples/vp8_multi_resolution_encoder.c index a89ec89..65308a0 100644 --- a/examples/vp8_multi_resolution_encoder.c +++ b/examples/vp8_multi_resolution_encoder.c @@ -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 " + die("Usage: %s " " \n", argv[0]); diff --git a/examples/vp9_spatial_svc_encoder.c b/examples/vp9_spatial_svc_encoder.c index 57cca8b..cecdce0 100644 --- a/examples/vp9_spatial_svc_encoder.c +++ b/examples/vp9_spatial_svc_encoder.c @@ -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); } diff --git a/examples/vpx_temporal_svc_encoder.c b/examples/vpx_temporal_svc_encoder.c index 633cdf1..4a33877 100644 --- a/examples/vpx_temporal_svc_encoder.c +++ b/examples/vpx_temporal_svc_encoder.c @@ -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 " + die("Usage: %s " " " " ... \n", argv[0]); #else - die( - "Usage: %s " + die("Usage: %s " " " " ... \n", argv[0]); diff --git a/vp8/common/entropymode.c b/vp8/common/entropymode.c index 239492a..30c2fa8 100644 --- a/vp8/common/entropymode.c +++ b/vp8/common/entropymode.c @@ -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 }, diff --git a/vp8/common/entropymode.h b/vp8/common/entropymode.h index 9331eb2..e0a17df 100644 --- a/vp8/common/entropymode.h +++ b/vp8/common/entropymode.h @@ -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" diff --git a/vp8/common/onyxc_int.h b/vp8/common/onyxc_int.h index 6d3de4f..732656f 100644 --- a/vp8/common/onyxc_int.h +++ b/vp8/common/onyxc_int.h @@ -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; diff --git a/vp8/decoder/error_concealment.c b/vp8/decoder/error_concealment.c index df292f2..e221414 100644 --- a/vp8/decoder/error_concealment.c +++ b/vp8/decoder/error_concealment.c @@ -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 */ diff --git a/vp8/encoder/firstpass.c b/vp8/encoder/firstpass.c index a175d1a..cd34e33 100644 --- a/vp8/encoder/firstpass.c +++ b/vp8/encoder/firstpass.c @@ -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 diff --git a/vp8/encoder/mcomp.c b/vp8/encoder/mcomp.c index 5cdfa62..970120f 100644 --- a/vp8/encoder/mcomp.c +++ b/vp8/encoder/mcomp.c @@ -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, diff --git a/vp8/encoder/pickinter.c b/vp8/encoder/pickinter.c index 7948657..f0050d2 100644 --- a/vp8/encoder/pickinter.c +++ b/vp8/encoder/pickinter.c @@ -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) { diff --git a/vp8/encoder/ratectrl.c b/vp8/encoder/ratectrl.c index d1e6548..649f696 100644 --- a/vp8/encoder/ratectrl.c +++ b/vp8/encoder/ratectrl.c @@ -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, } }; diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c index bba4fa8..9ba301e 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -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; diff --git a/vp8/encoder/vp8_quantize.c b/vp8/encoder/vp8_quantize.c index 2bcb53c..ff6e04e 100644 --- a/vp8/encoder/vp8_quantize.c +++ b/vp8/encoder/vp8_quantize.c @@ -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; } diff --git a/vp9/common/vp9_entropy.h b/vp9/common/vp9_entropy.h index 94a1e59..1da4911 100644 --- a/vp9/common/vp9_entropy.h +++ b/vp9/common/vp9_entropy.h @@ -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); diff --git a/vp9/common/vp9_entropymode.c b/vp9/common/vp9_entropymode.c index f96d393..22365ef 100644 --- a/vp9/common/vp9_entropymode.c +++ b/vp9/common/vp9_entropymode.c @@ -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); diff --git a/vp9/common/vp9_entropymode.h b/vp9/common/vp9_entropymode.h index 64ca807..0ee663f 100644 --- a/vp9/common/vp9_entropymode.h +++ b/vp9/common/vp9_entropymode.h @@ -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)]; diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index b853dcd..8d7c357 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -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]++; } } } diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c index 87b958e..20ebe68 100644 --- a/vp9/encoder/vp9_encodemb.c +++ b/vp9/encoder/vp9_encodemb.c @@ -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]; } } diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 5510362..e8f5ec5 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -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; diff --git a/vp9/encoder/vp9_mcomp.c b/vp9/encoder/vp9_mcomp.c index b3b27b3..2d9bcbd 100644 --- a/vp9/encoder/vp9_mcomp.c +++ b/vp9/encoder/vp9_mcomp.c @@ -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, diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c index 6017816..76d2611 100644 --- a/vp9/encoder/vp9_pickmode.c +++ b/vp9/encoder/vp9_pickmode.c @@ -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); diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index c14acd5..3889d0f 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -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 diff --git a/vp9/encoder/vp9_svc_layercontext.c b/vp9/encoder/vp9_svc_layercontext.c index 879d46c..2d29e26 100644 --- a/vp9/encoder/vp9_svc_layercontext.c +++ b/vp9/encoder/vp9_svc_layercontext.c @@ -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 = diff --git a/vp9/encoder/vp9_tokenize.c b/vp9/encoder/vp9_tokenize.c index 05b9692..dc2616d 100644 --- a/vp9/encoder/vp9_tokenize.c +++ b/vp9/encoder/vp9_tokenize.c @@ -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); diff --git a/vp9/vp9_cx_iface.c b/vp9/vp9_cx_iface.c index 01ed3e7..a797b2c 100644 --- a/vp9/vp9_cx_iface.c +++ b/vp9/vp9_cx_iface.c @@ -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 diff --git a/vpx_dsp/x86/vpx_subpixel_8t_intrin_avx2.c b/vpx_dsp/x86/vpx_subpixel_8t_intrin_avx2.c index 6d53b87..2b41d99 100644 --- a/vpx_dsp/x86/vpx_subpixel_8t_intrin_avx2.c +++ b/vpx_dsp/x86/vpx_subpixel_8t_intrin_avx2.c @@ -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 diff --git a/vpx_ports/x86.h b/vpx_ports/x86.h index f765335..6ba02cf 100644 --- a/vpx_ports/x86.h +++ b/vpx_ports/x86.h @@ -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 #define xgetbv() _xgetbv(0) diff --git a/vpxenc.c b/vpxenc.c index c7b4f08..6e0af57 100644 --- 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); }); -- 2.7.4