summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclang-format <noreply@google.com>2017-02-13 20:06:18 -0800
committerJames Zern <jzern@google.com>2017-02-14 12:45:52 -0800
commit4b402746cad6f9dbebbb3c3b79a2da098385d46f (patch)
tree2aaf26124679e2317f031b14d4cba46502c98a01
parentf670628ca546883b1989203a38835c27d3e130b7 (diff)
downloadlibvpx-4b402746cad6f9dbebbb3c3b79a2da098385d46f.tar
libvpx-4b402746cad6f9dbebbb3c3b79a2da098385d46f.tar.gz
libvpx-4b402746cad6f9dbebbb3c3b79a2da098385d46f.tar.bz2
libvpx-4b402746cad6f9dbebbb3c3b79a2da098385d46f.zip
apply clang-format
Change-Id: I75e4a9e0b37bd4586f26c8d6c1fa27f3f6ff1bce
-rw-r--r--vp8/common/entropymode.c13
-rw-r--r--vp8/common/entropymode.h4
-rw-r--r--vp8/encoder/firstpass.c6
-rw-r--r--vp8/encoder/onyx_if.c6
-rw-r--r--vp8/encoder/rdopt.c9
-rw-r--r--vp9/common/vp9_blockd.c5
-rw-r--r--vp9/common/vp9_entropymode.c46
-rw-r--r--vp9/decoder/vp9_decodeframe.c5
-rw-r--r--vp9/decoder/vp9_detokenize.c5
-rw-r--r--vp9/encoder/vp9_bitstream.c46
-rw-r--r--vp9/encoder/vp9_firstpass.c9
-rw-r--r--vp9/encoder/vp9_mcomp.c13
-rw-r--r--vp9/encoder/vp9_speed_features.c16
-rw-r--r--vpx_dsp/x86/inv_txfm_ssse3.c8
-rw-r--r--y4menc.c6
15 files changed, 98 insertions, 99 deletions
diff --git a/vp8/common/entropymode.c b/vp8/common/entropymode.c
index 30c2fa86a..239492a8c 100644
--- a/vp8/common/entropymode.c
+++ b/vp8/common/entropymode.c
@@ -34,12 +34,13 @@ 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 e0a17df10..b3fad19be 100644
--- a/vp8/common/entropymode.h
+++ b/vp8/common/entropymode.h
@@ -78,8 +78,8 @@ 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/encoder/firstpass.c b/vp8/encoder/firstpass.c
index 884d6e18b..caf19059e 100644
--- a/vp8/encoder/firstpass.c
+++ b/vp8/encoder/firstpass.c
@@ -1185,9 +1185,9 @@ static int estimate_kf_group_q(VP8_COMP *cpi, double section_err,
current_spend_ratio = (double)cpi->long_rolling_actual_bits /
(double)cpi->long_rolling_target_bits;
current_spend_ratio =
- (current_spend_ratio > 10.0) ? 10.0 : (current_spend_ratio < 0.1)
- ? 0.1
- : current_spend_ratio;
+ (current_spend_ratio > 10.0)
+ ? 10.0
+ : (current_spend_ratio < 0.1) ? 0.1 : current_spend_ratio;
}
/* Calculate a correction factor based on the quality of prediction in
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index 37907855b..0a1e1bbc7 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -4061,9 +4061,9 @@ static void encode_frame_to_data_rate(VP8_COMP *cpi, size_t *size,
#if !CONFIG_REALTIME_ONLY
top_index = cpi->active_worst_quality;
#endif // !CONFIG_REALTIME_ONLY
- /* If we have updated the active max Q do not call
- * vp8_update_rate_correction_factors() this loop.
- */
+ /* If we have updated the active max Q do not call
+ * vp8_update_rate_correction_factors() this loop.
+ */
active_worst_qchanged = 1;
} else {
active_worst_qchanged = 0;
diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c
index b08a573f6..3792b10f8 100644
--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -107,11 +107,10 @@ 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) {
diff --git a/vp9/common/vp9_blockd.c b/vp9/common/vp9_blockd.c
index b0249687f..432759951 100644
--- a/vp9/common/vp9_blockd.c
+++ b/vp9/common/vp9_blockd.c
@@ -53,8 +53,9 @@ void vp9_foreach_transformed_block_in_plane(
// the current block size extends into the UMV and we won't
// visit the sub blocks that are wholly within the UMV.
const int max_blocks_wide =
- num_4x4_w + (xd->mb_to_right_edge >= 0 ? 0 : xd->mb_to_right_edge >>
- (5 + pd->subsampling_x));
+ num_4x4_w + (xd->mb_to_right_edge >= 0
+ ? 0
+ : xd->mb_to_right_edge >> (5 + pd->subsampling_x));
const int max_blocks_high =
num_4x4_h + (xd->mb_to_bottom_edge >= 0
? 0
diff --git a/vp9/common/vp9_entropymode.c b/vp9/common/vp9_entropymode.c
index 22365efc5..bcb9e8f29 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] = {
diff --git a/vp9/decoder/vp9_decodeframe.c b/vp9/decoder/vp9_decodeframe.c
index 628d1c8d2..f71f7d1eb 100644
--- a/vp9/decoder/vp9_decodeframe.c
+++ b/vp9/decoder/vp9_decodeframe.c
@@ -838,8 +838,9 @@ static void decode_block(TileWorkerData *twd, VP9Decoder *const pbi, int mi_row,
: xd->mb_to_right_edge >> (5 + pd->subsampling_x));
const int max_blocks_high =
num_4x4_h +
- (xd->mb_to_bottom_edge >= 0 ? 0 : xd->mb_to_bottom_edge >>
- (5 + pd->subsampling_y));
+ (xd->mb_to_bottom_edge >= 0
+ ? 0
+ : xd->mb_to_bottom_edge >> (5 + pd->subsampling_y));
xd->max_blocks_wide = xd->mb_to_right_edge >= 0 ? 0 : max_blocks_wide;
xd->max_blocks_high = xd->mb_to_bottom_edge >= 0 ? 0 : max_blocks_high;
diff --git a/vp9/decoder/vp9_detokenize.c b/vp9/decoder/vp9_detokenize.c
index a441f3add..4bd016dc7 100644
--- a/vp9/decoder/vp9_detokenize.c
+++ b/vp9/decoder/vp9_detokenize.c
@@ -99,9 +99,10 @@ static int decode_coefs(const MACROBLOCKD *xd, PLANE_TYPE type,
vp9_cat6_prob;
const int cat6_bits =
#if CONFIG_VP9_HIGHBITDEPTH
- (xd->bd == VPX_BITS_12) ? 18 : (xd->bd == VPX_BITS_10) ? 16 :
+ (xd->bd == VPX_BITS_12) ? 18
+ : (xd->bd == VPX_BITS_10) ? 16 :
#endif // CONFIG_VP9_HIGHBITDEPTH
- 14;
+ 14;
// Keep value, range, and count as locals. The compiler produces better
// results with the locals than using r directly.
BD_VALUE value = r->value;
diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c
index 43c5eaed0..1f2d88c34 100644
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -230,12 +230,11 @@ static void write_ref_frames(const VP9_COMMON *cm, const MACROBLOCKD *const xd,
}
}
-static void pack_inter_mode_mvs(VP9_COMP *cpi, const MACROBLOCKD *const xd,
- const MB_MODE_INFO_EXT *const mbmi_ext,
- vpx_writer *w,
- unsigned int *const max_mv_magnitude,
- int interp_filter_selected[MAX_REF_FRAMES]
- [SWITCHABLE]) {
+static void pack_inter_mode_mvs(
+ VP9_COMP *cpi, const MACROBLOCKD *const xd,
+ const MB_MODE_INFO_EXT *const mbmi_ext, vpx_writer *w,
+ unsigned int *const max_mv_magnitude,
+ int interp_filter_selected[MAX_REF_FRAMES][SWITCHABLE]) {
VP9_COMMON *const cm = &cpi->common;
const nmv_context *nmvc = &cm->fc->nmvc;
const struct segmentation *const seg = &cm->seg;
@@ -368,13 +367,11 @@ static void write_mb_modes_kf(const VP9_COMMON *cm, const MACROBLOCKD *xd,
write_intra_mode(w, mi->uv_mode, vp9_kf_uv_mode_prob[mi->mode]);
}
-static void write_modes_b(VP9_COMP *cpi, MACROBLOCKD *const xd,
- const TileInfo *const tile, vpx_writer *w,
- TOKENEXTRA **tok, const TOKENEXTRA *const tok_end,
- int mi_row, int mi_col,
- unsigned int *const max_mv_magnitude,
- int interp_filter_selected[MAX_REF_FRAMES]
- [SWITCHABLE]) {
+static void write_modes_b(
+ VP9_COMP *cpi, MACROBLOCKD *const xd, const TileInfo *const tile,
+ vpx_writer *w, TOKENEXTRA **tok, const TOKENEXTRA *const tok_end,
+ int mi_row, int mi_col, unsigned int *const max_mv_magnitude,
+ int interp_filter_selected[MAX_REF_FRAMES][SWITCHABLE]) {
const VP9_COMMON *const cm = &cpi->common;
const MB_MODE_INFO_EXT *const mbmi_ext =
cpi->td.mb.mbmi_ext_base + (mi_row * cm->mi_cols + mi_col);
@@ -419,13 +416,12 @@ static void write_partition(const VP9_COMMON *const cm,
}
}
-static void write_modes_sb(VP9_COMP *cpi, MACROBLOCKD *const xd,
- const TileInfo *const tile, vpx_writer *w,
- TOKENEXTRA **tok, const TOKENEXTRA *const tok_end,
- int mi_row, int mi_col, BLOCK_SIZE bsize,
- unsigned int *const max_mv_magnitude,
- int interp_filter_selected[MAX_REF_FRAMES]
- [SWITCHABLE]) {
+static void write_modes_sb(
+ VP9_COMP *cpi, MACROBLOCKD *const xd, const TileInfo *const tile,
+ vpx_writer *w, TOKENEXTRA **tok, const TOKENEXTRA *const tok_end,
+ int mi_row, int mi_col, BLOCK_SIZE bsize,
+ unsigned int *const max_mv_magnitude,
+ int interp_filter_selected[MAX_REF_FRAMES][SWITCHABLE]) {
const VP9_COMMON *const cm = &cpi->common;
const int bsl = b_width_log2_lookup[bsize];
const int bs = (1 << bsl) / 4;
@@ -483,11 +479,11 @@ static void write_modes_sb(VP9_COMP *cpi, MACROBLOCKD *const xd,
update_partition_context(xd, mi_row, mi_col, subsize, bsize);
}
-static void write_modes(VP9_COMP *cpi, MACROBLOCKD *const xd,
- const TileInfo *const tile, vpx_writer *w, int tile_row,
- int tile_col, unsigned int *const max_mv_magnitude,
- int interp_filter_selected[MAX_REF_FRAMES]
- [SWITCHABLE]) {
+static void write_modes(
+ VP9_COMP *cpi, MACROBLOCKD *const xd, const TileInfo *const tile,
+ vpx_writer *w, int tile_row, int tile_col,
+ unsigned int *const max_mv_magnitude,
+ int interp_filter_selected[MAX_REF_FRAMES][SWITCHABLE]) {
const VP9_COMMON *const cm = &cpi->common;
int mi_row, mi_col, tile_sb_row;
TOKENEXTRA *tok = NULL;
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index 4bc2354b3..bfa84ad38 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2025,10 +2025,11 @@ static int64_t calculate_total_gf_group_bits(VP9_COMP *cpi,
}
// 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/vp9/encoder/vp9_mcomp.c b/vp9/encoder/vp9_mcomp.c
index 03877e9aa..fa8b2ff0e 100644
--- a/vp9/encoder/vp9_mcomp.c
+++ b/vp9/encoder/vp9_mcomp.c
@@ -851,13 +851,12 @@ 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_speed_features.c b/vp9/encoder/vp9_speed_features.c
index 9ce756efe..d17cad1f3 100644
--- a/vp9/encoder/vp9_speed_features.c
+++ b/vp9/encoder/vp9_speed_features.c
@@ -202,10 +202,10 @@ static void set_good_speed_feature(VP9_COMP *cpi, VP9_COMMON *cm,
sf->reference_masking = cpi->oxcf.resize_mode != RESIZE_DYNAMIC ? 1 : 0;
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;
@@ -337,10 +337,10 @@ static void set_rt_speed_feature(VP9_COMP *cpi, SPEED_FEATURES *sf, int speed,
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;
// Reference masking only enabled for 1 spatial layer, and if none of the
diff --git a/vpx_dsp/x86/inv_txfm_ssse3.c b/vpx_dsp/x86/inv_txfm_ssse3.c
index 65b7277b6..661b4ce0a 100644
--- a/vpx_dsp/x86/inv_txfm_ssse3.c
+++ b/vpx_dsp/x86/inv_txfm_ssse3.c
@@ -444,10 +444,10 @@ static INLINE void idct32_34(const __m128i *in, __m128i *stp1) {
/* Stage5 */
{
- // Note:
- // #define AVOID_OVERFLOW = 0, code would be faster. But it can't pass
- // SingleExtreme test. The MaxSupportedCoeff/MinSupportedCoeff must drop
- // to 23198 and -23197, respectively.
+// Note:
+// #define AVOID_OVERFLOW = 0, code would be faster. But it can't pass
+// SingleExtreme test. The MaxSupportedCoeff/MinSupportedCoeff must drop
+// to 23198 and -23197, respectively.
#define AVOID_OVERFLOW (1)
#if AVOID_OVERFLOW
diff --git a/y4menc.c b/y4menc.c
index e26fcaf6e..05018dbc4 100644
--- a/y4menc.c
+++ b/y4menc.c
@@ -19,9 +19,9 @@ int y4m_write_file_header(char *buf, size_t len, int width, int height,
case 8:
color = fmt == VPX_IMG_FMT_444A
? "C444alpha\n"
- : fmt == VPX_IMG_FMT_I444 ? "C444\n" : fmt == VPX_IMG_FMT_I422
- ? "C422\n"
- : "C420jpeg\n";
+ : fmt == VPX_IMG_FMT_I444
+ ? "C444\n"
+ : fmt == VPX_IMG_FMT_I422 ? "C422\n" : "C420jpeg\n";
break;
case 9:
color = fmt == VPX_IMG_FMT_I44416