History

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.

James Zern committed 10 years ago

Commit acb94601 parent 3bf02ad9 files · +20 −41Browse files

Unified · Split

9 files
  1. vp8/common/mfqe.c +5 −10
  2. vp8/common/vp8_loopfilter.c +2 −5
  3. vp8/decoder/decodemv.c +2 −4
  4. vp8/encoder/bitstream.c +1 −2
  5. vp8/encoder/encodemv.c +2 −4
  6. vp8/encoder/onyx_if.c +4 −8
  7. vp8/encoder/ratectrl.c +2 −4
  8. vp8/encoder/rdopt.c +1 −2
  9. vp8/vp8_dx_iface.c +1 −2
vp8/common/mfqe.c+5−10
@@ -74,8 +74,7 @@ static void apply_ifactor(unsigned char *y_src, int y_src_stride, · 73 unmodified lines
7474 src_weight);
7575 vp8_filter_by_weight8x8(v_src, uv_src_stride, v_dst, uv_dst_stride,
7676 src_weight);
77− } else /* if (block_size == 8) */
78− {
77+ } else {
7978 vp8_filter_by_weight8x8(y_src, y_src_stride, y_dst, y_dst_stride,
8079 src_weight);
8180 vp8_filter_by_weight4x4(u_src, uv_src_stride, u_dst, uv_dst_stride,
@@ -136,8 +135,7 @@ static void multiframe_quality_enhance_block( · 54 unmodified lines
136135 usad = (vpx_sad8x8(u, uv_stride, ud, uvd_stride) + 32) >> 6;
137136 vsad = (vpx_sad8x8(v, uv_stride, vd, uvd_stride) + 32) >> 6;
138137 #endif
139− } else /* if (blksize == 8) */
140− {
138+ } else {
141139 actd = (vpx_variance8x8(yd, yd_stride, VP8_ZEROS, 0, &sse) + 32) >> 6;
142140 act = (vpx_variance8x8(y, y_stride, VP8_ZEROS, 0, &sse) + 32) >> 6;
143141 #ifdef USE_SSD
@@ -186,14 +184,12 @@ static void multiframe_quality_enhance_block( · 42 unmodified lines
186184 apply_ifactor(y, y_stride, yd, yd_stride, u, v, uv_stride, ud, vd,
187185 uvd_stride, blksize, ifactor);
188186 }
189− } else /* else implicitly copy from previous frame */
190− {
187+ } else { /* else implicitly copy from previous frame */
191188 if (blksize == 16) {
192189 vp8_copy_mem16x16(y, y_stride, yd, yd_stride);
193190 vp8_copy_mem8x8(u, uv_stride, ud, uvd_stride);
194191 vp8_copy_mem8x8(v, uv_stride, vd, uvd_stride);
195− } else /* if (blksize == 8) */
196− {
192+ } else {
197193 vp8_copy_mem8x8(y, y_stride, yd, yd_stride);
198194 for (up = u, udp = ud, i = 0; i < uvblksize;
199195 ++i, up += uv_stride, udp += uvd_stride) {
@@ -297,8 +293,7 @@ void vp8_multiframe_quality_enhance(VP8_COMMON *cm) { · 97 unmodified lines
297293 }
298294 }
299295 }
300− } else /* totmap = 4 */
301− {
296+ } else { /* totmap = 4 */
302297 multiframe_quality_enhance_block(
303298 16, qcurr, qprev, y_ptr, u_ptr, v_ptr, show->y_stride,
304299 show->uv_stride, yd_ptr, ud_ptr, vd_ptr, dest->y_stride,
vp8/common/vp8_loopfilter.c+2−5
@@ -111,11 +111,9 @@ void vp8_loop_filter_frame_init(VP8_COMMON *cm, MACROBLOCKD *mbd, · 110 unmodified lines
111111
112112 /* Note the baseline filter values for each segment */
113113 if (mbd->segmentation_enabled) {
114− /* Abs value */
115114 if (mbd->mb_segement_abs_delta == SEGMENT_ABSDATA) {
116115 lvl_seg = mbd->segment_feature_data[MB_LVL_ALT_LF][seg];
117− } else /* Delta Value */
118− {
116+ } else { /* Delta Value */
119117 lvl_seg += mbd->segment_feature_data[MB_LVL_ALT_LF][seg];
120118 }
121119 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) { · 222 unmodified lines
344342
345343 mode_info_context++; /* Skip border mb */
346344 }
347− } else /* SIMPLE_LOOPFILTER */
348− {
345+ } else { /* SIMPLE_LOOPFILTER */
349346 for (mb_row = 0; mb_row < mb_rows; ++mb_row) {
350347 for (mb_col = 0; mb_col < mb_cols; ++mb_col) {
351348 int skip_lf = (mode_info_context->mbmi.mode != B_PRED &&
vp8/decoder/decodemv.c+2−4
@@ -65,8 +65,7 @@ static int read_mvcomponent(vp8_reader *r, const MV_CONTEXT *mvc) { · 64 unmodified lines
6565 const vp8_prob *const p = (const vp8_prob *)mvc;
6666 int x = 0;
6767
68− if (vp8_read(r, p[mvpis_short])) /* Large */
69− {
68+ if (vp8_read(r, p[mvpis_short])) { /* Large */
7069 int i = 0;
7170
7271 do {
@@ -285,8 +284,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, · 212 unmodified lines
285284 MB_MODE_INFO *mbmi) {
286285 vp8_reader *const bc = &pbi->mbc[8];
287286 mbmi->ref_frame = (MV_REFERENCE_FRAME)vp8_read(bc, pbi->prob_intra);
288− if (mbmi->ref_frame) /* inter MB */
289− {
287+ if (mbmi->ref_frame) { /* inter MB */
290288 enum { CNT_INTRA, CNT_NEAREST, CNT_NEAR, CNT_SPLITMV };
291289 int cnt[4];
292290 int *cntx = cnt;
vp8/encoder/bitstream.c+1−2
@@ -500,8 +500,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi) { · 499 unmodified lines
500500 }
501501
502502 write_uv_mode(w, mi->uv_mode, pc->fc.uv_mode_prob);
503− } else /* inter coded */
504− {
503+ } else { /* inter coded */
505504 int_mv best_mv;
506505 vp8_prob mv_ref_p[VP8_MVREFS - 1];
507506
vp8/encoder/encodemv.c+2−4
@@ -25,14 +25,12 @@ static void encode_mvcomponent(vp8_writer *const w, const int v, · 24 unmodified lines
2525 const vp8_prob *p = mvc->prob;
2626 const int x = v < 0 ? -v : v;
2727
28− if (x < mvnum_short) /* Small */
29− {
28+ if (x < mvnum_short) { /* Small */
3029 vp8_write(w, 0, p[mvpis_short]);
3130 vp8_treed_write(w, vp8_small_mvtree, p + MVPshort, x, 3);
3231
3332 if (!x) return; /* no sign bit */
34− } else /* Large */
35− {
33+ } else { /* Large */
3634 int i = 0;
3735
3836 vp8_write(w, 1, p[mvpis_short]);
vp8/encoder/onyx_if.c+4−8
@@ -2925,8 +2925,7 @@ static void update_reference_frames(VP8_COMP *cpi) { · 2924 unmodified lines
29252925
29262926 cpi->current_ref_frames[GOLDEN_FRAME] = cm->current_video_frame;
29272927 cpi->current_ref_frames[ALTREF_FRAME] = cm->current_video_frame;
2928− } else /* For non key frames */
2929− {
2928+ } else {
29302929 if (cm->refresh_alt_ref_frame) {
29312930 assert(!cm->copy_buffer_to_arf);
29322931
@@ -2947,8 +2946,7 @@ static void update_reference_frames(VP8_COMP *cpi) { · 14 unmodified lines
29472946 cpi->current_ref_frames[ALTREF_FRAME] =
29482947 cpi->current_ref_frames[LAST_FRAME];
29492948 }
2950− } else /* if (cm->copy_buffer_to_arf == 2) */
2951− {
2949+ } else {
29522950 if (cm->alt_fb_idx != cm->gld_fb_idx) {
29532951 yv12_fb[cm->gld_fb_idx].flags |= VP8_ALTR_FRAME;
29542952 yv12_fb[cm->alt_fb_idx].flags &= ~VP8_ALTR_FRAME;
@@ -2980,8 +2978,7 @@ static void update_reference_frames(VP8_COMP *cpi) { · 25 unmodified lines
29802978 cpi->current_ref_frames[GOLDEN_FRAME] =
29812979 cpi->current_ref_frames[LAST_FRAME];
29822980 }
2983− } else /* if (cm->copy_buffer_to_gf == 2) */
2984− {
2981+ } else {
29852982 if (cm->alt_fb_idx != cm->gld_fb_idx) {
29862983 yv12_fb[cm->alt_fb_idx].flags |= VP8_GOLD_FRAME;
29872984 yv12_fb[cm->gld_fb_idx].flags &= ~VP8_GOLD_FRAME;
@@ -3012,8 +3009,7 @@ static void update_reference_frames(VP8_COMP *cpi) { · 24 unmodified lines
30123009 int i;
30133010 for (i = LAST_FRAME; i < MAX_REF_FRAMES; ++i)
30143011 vp8_yv12_copy_frame(cpi->Source, &cpi->denoiser.yv12_running_avg[i]);
3015− } else /* For non key frames */
3016− {
3012+ } else {
30173013 vp8_yv12_extend_frame_borders(
30183014 &cpi->denoiser.yv12_running_avg[INTRA_FRAME]);
30193015
vp8/encoder/ratectrl.c+2−4
@@ -498,11 +498,9 @@ static void calc_gf_params(VP8_COMP *cpi) { · 497 unmodified lines
498498 * This is updated once the real frame size/boost is known.
499499 */
500500 if (cpi->oxcf.fixed_q == -1) {
501− if (cpi->pass == 2) /* 2 Pass */
502− {
501+ if (cpi->pass == 2) { /* 2 Pass */
503502 cpi->frames_till_gf_update_due = cpi->baseline_gf_interval;
504− } else /* 1 Pass */
505− {
503+ } else { /* 1 Pass */
506504 cpi->frames_till_gf_update_due = cpi->baseline_gf_interval;
507505
508506 if (cpi->last_boost > 750) cpi->frames_till_gf_update_due++;
vp8/encoder/rdopt.c+1−2
@@ -853,8 +853,7 @@ static int labels2mode(MACROBLOCK *x, int const *labelings, int which_label, · 852 unmodified lines
853853 default: break;
854854 }
855855
856− if (m == ABOVE4X4) /* replace above with left if same */
857− {
856+ if (m == ABOVE4X4) { /* replace above with left if same */
858857 int_mv left_mv;
859858
860859 left_mv.as_int = col ? d[-1].bmi.mv.as_int : left_block_mv(mic, i);
vp8/vp8_dx_iface.c+1−2
@@ -144,8 +144,7 @@ static vpx_codec_err_t vp8_peek_si_internal(const uint8_t *data, · 143 unmodified lines
144144 }
145145 si->is_kf = 0;
146146
147− if (data_sz >= 10 && !(clear[0] & 0x01)) /* I-Frame */
148− {
147+ if (data_sz >= 10 && !(clear[0] & 0x01)) { /* I-Frame */
149148 si->is_kf = 1;
150149
151150 /* vet via sync code */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t