vp8: correct if/else '{' placement

swap '{' and c-style comments removing a few redundant ones along the
way; covers most leftovers from the clang-tidy run against an
x86_64-linux config.

Change-Id: I67a45596f80a12389faca49c5be440875092a7df
This commit is contained in:
James Zern 2016-07-19 20:56:25 -07:00
parent 3bf02ad74a
commit acb9460929
9 changed files with 20 additions and 41 deletions

View File

@ -74,8 +74,7 @@ static void apply_ifactor(unsigned char *y_src, int y_src_stride,
src_weight);
vp8_filter_by_weight8x8(v_src, uv_src_stride, v_dst, uv_dst_stride,
src_weight);
} else /* if (block_size == 8) */
{
} else {
vp8_filter_by_weight8x8(y_src, y_src_stride, y_dst, y_dst_stride,
src_weight);
vp8_filter_by_weight4x4(u_src, uv_src_stride, u_dst, uv_dst_stride,
@ -136,8 +135,7 @@ static void multiframe_quality_enhance_block(
usad = (vpx_sad8x8(u, uv_stride, ud, uvd_stride) + 32) >> 6;
vsad = (vpx_sad8x8(v, uv_stride, vd, uvd_stride) + 32) >> 6;
#endif
} else /* if (blksize == 8) */
{
} else {
actd = (vpx_variance8x8(yd, yd_stride, VP8_ZEROS, 0, &sse) + 32) >> 6;
act = (vpx_variance8x8(y, y_stride, VP8_ZEROS, 0, &sse) + 32) >> 6;
#ifdef USE_SSD
@ -186,14 +184,12 @@ static void multiframe_quality_enhance_block(
apply_ifactor(y, y_stride, yd, yd_stride, u, v, uv_stride, ud, vd,
uvd_stride, blksize, ifactor);
}
} else /* else implicitly copy from previous frame */
{
} else { /* else implicitly copy from previous frame */
if (blksize == 16) {
vp8_copy_mem16x16(y, y_stride, yd, yd_stride);
vp8_copy_mem8x8(u, uv_stride, ud, uvd_stride);
vp8_copy_mem8x8(v, uv_stride, vd, uvd_stride);
} else /* if (blksize == 8) */
{
} else {
vp8_copy_mem8x8(y, y_stride, yd, yd_stride);
for (up = u, udp = ud, i = 0; i < uvblksize;
++i, up += uv_stride, udp += uvd_stride) {
@ -297,8 +293,7 @@ void vp8_multiframe_quality_enhance(VP8_COMMON *cm) {
}
}
}
} else /* totmap = 4 */
{
} else { /* totmap = 4 */
multiframe_quality_enhance_block(
16, qcurr, qprev, y_ptr, u_ptr, v_ptr, show->y_stride,
show->uv_stride, yd_ptr, ud_ptr, vd_ptr, dest->y_stride,

View File

@ -111,11 +111,9 @@ void vp8_loop_filter_frame_init(VP8_COMMON *cm, MACROBLOCKD *mbd,
/* Note the baseline filter values for each segment */
if (mbd->segmentation_enabled) {
/* Abs value */
if (mbd->mb_segement_abs_delta == SEGMENT_ABSDATA) {
lvl_seg = mbd->segment_feature_data[MB_LVL_ALT_LF][seg];
} else /* Delta Value */
{
} else { /* Delta Value */
lvl_seg += mbd->segment_feature_data[MB_LVL_ALT_LF][seg];
}
lvl_seg = (lvl_seg > 0) ? ((lvl_seg > 63) ? 63 : lvl_seg) : 0;
@ -344,8 +342,7 @@ void vp8_loop_filter_frame(VP8_COMMON *cm, MACROBLOCKD *mbd, int frame_type) {
mode_info_context++; /* Skip border mb */
}
} else /* SIMPLE_LOOPFILTER */
{
} else { /* SIMPLE_LOOPFILTER */
for (mb_row = 0; mb_row < mb_rows; ++mb_row) {
for (mb_col = 0; mb_col < mb_cols; ++mb_col) {
int skip_lf = (mode_info_context->mbmi.mode != B_PRED &&

View File

@ -65,8 +65,7 @@ static int read_mvcomponent(vp8_reader *r, const MV_CONTEXT *mvc) {
const vp8_prob *const p = (const vp8_prob *)mvc;
int x = 0;
if (vp8_read(r, p[mvpis_short])) /* Large */
{
if (vp8_read(r, p[mvpis_short])) { /* Large */
int i = 0;
do {
@ -285,8 +284,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi,
MB_MODE_INFO *mbmi) {
vp8_reader *const bc = &pbi->mbc[8];
mbmi->ref_frame = (MV_REFERENCE_FRAME)vp8_read(bc, pbi->prob_intra);
if (mbmi->ref_frame) /* inter MB */
{
if (mbmi->ref_frame) { /* inter MB */
enum { CNT_INTRA, CNT_NEAREST, CNT_NEAR, CNT_SPLITMV };
int cnt[4];
int *cntx = cnt;

View File

@ -500,8 +500,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) {
}
write_uv_mode(w, mi->uv_mode, pc->fc.uv_mode_prob);
} else /* inter coded */
{
} else { /* inter coded */
int_mv best_mv;
vp8_prob mv_ref_p[VP8_MVREFS - 1];

View File

@ -25,14 +25,12 @@ static void encode_mvcomponent(vp8_writer *const w, const int v,
const vp8_prob *p = mvc->prob;
const int x = v < 0 ? -v : v;
if (x < mvnum_short) /* Small */
{
if (x < mvnum_short) { /* Small */
vp8_write(w, 0, p[mvpis_short]);
vp8_treed_write(w, vp8_small_mvtree, p + MVPshort, x, 3);
if (!x) return; /* no sign bit */
} else /* Large */
{
} else { /* Large */
int i = 0;
vp8_write(w, 1, p[mvpis_short]);

View File

@ -2925,8 +2925,7 @@ static void update_reference_frames(VP8_COMP *cpi) {
cpi->current_ref_frames[GOLDEN_FRAME] = cm->current_video_frame;
cpi->current_ref_frames[ALTREF_FRAME] = cm->current_video_frame;
} else /* For non key frames */
{
} else {
if (cm->refresh_alt_ref_frame) {
assert(!cm->copy_buffer_to_arf);
@ -2947,8 +2946,7 @@ static void update_reference_frames(VP8_COMP *cpi) {
cpi->current_ref_frames[ALTREF_FRAME] =
cpi->current_ref_frames[LAST_FRAME];
}
} else /* if (cm->copy_buffer_to_arf == 2) */
{
} else {
if (cm->alt_fb_idx != cm->gld_fb_idx) {
yv12_fb[cm->gld_fb_idx].flags |= VP8_ALTR_FRAME;
yv12_fb[cm->alt_fb_idx].flags &= ~VP8_ALTR_FRAME;
@ -2980,8 +2978,7 @@ static void update_reference_frames(VP8_COMP *cpi) {
cpi->current_ref_frames[GOLDEN_FRAME] =
cpi->current_ref_frames[LAST_FRAME];
}
} else /* if (cm->copy_buffer_to_gf == 2) */
{
} else {
if (cm->alt_fb_idx != cm->gld_fb_idx) {
yv12_fb[cm->alt_fb_idx].flags |= VP8_GOLD_FRAME;
yv12_fb[cm->gld_fb_idx].flags &= ~VP8_GOLD_FRAME;
@ -3012,8 +3009,7 @@ static void update_reference_frames(VP8_COMP *cpi) {
int i;
for (i = LAST_FRAME; i < MAX_REF_FRAMES; ++i)
vp8_yv12_copy_frame(cpi->Source, &cpi->denoiser.yv12_running_avg[i]);
} else /* For non key frames */
{
} else {
vp8_yv12_extend_frame_borders(
&cpi->denoiser.yv12_running_avg[INTRA_FRAME]);

View File

@ -498,11 +498,9 @@ static void calc_gf_params(VP8_COMP *cpi) {
* This is updated once the real frame size/boost is known.
*/
if (cpi->oxcf.fixed_q == -1) {
if (cpi->pass == 2) /* 2 Pass */
{
if (cpi->pass == 2) { /* 2 Pass */
cpi->frames_till_gf_update_due = cpi->baseline_gf_interval;
} else /* 1 Pass */
{
} else { /* 1 Pass */
cpi->frames_till_gf_update_due = cpi->baseline_gf_interval;
if (cpi->last_boost > 750) cpi->frames_till_gf_update_due++;

View File

@ -853,8 +853,7 @@ static int labels2mode(MACROBLOCK *x, int const *labelings, int which_label,
default: break;
}
if (m == ABOVE4X4) /* replace above with left if same */
{
if (m == ABOVE4X4) { /* replace above with left if same */
int_mv left_mv;
left_mv.as_int = col ? d[-1].bmi.mv.as_int : left_block_mv(mic, i);

View File

@ -144,8 +144,7 @@ static vpx_codec_err_t vp8_peek_si_internal(const uint8_t *data,
}
si->is_kf = 0;
if (data_sz >= 10 && !(clear[0] & 0x01)) /* I-Frame */
{
if (data_sz >= 10 && !(clear[0] & 0x01)) { /* I-Frame */
si->is_kf = 1;
/* vet via sync code */