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
74 src_weight);74 src_weight);
75 vp8_filter_by_weight8x8(v_src, uv_src_stride, v_dst, uv_dst_stride,75 vp8_filter_by_weight8x8(v_src, uv_src_stride, v_dst, uv_dst_stride,
76 src_weight);76 src_weight);
77 } else /* if (block_size == 8) */77 } else {
78 {
79 vp8_filter_by_weight8x8(y_src, y_src_stride, y_dst, y_dst_stride,78 vp8_filter_by_weight8x8(y_src, y_src_stride, y_dst, y_dst_stride,
80 src_weight);79 src_weight);
81 vp8_filter_by_weight4x4(u_src, uv_src_stride, u_dst, uv_dst_stride,80 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
136 usad = (vpx_sad8x8(u, uv_stride, ud, uvd_stride) + 32) >> 6;135 usad = (vpx_sad8x8(u, uv_stride, ud, uvd_stride) + 32) >> 6;
137 vsad = (vpx_sad8x8(v, uv_stride, vd, uvd_stride) + 32) >> 6;136 vsad = (vpx_sad8x8(v, uv_stride, vd, uvd_stride) + 32) >> 6;
138#endif137#endif
139 } else /* if (blksize == 8) */138 } else {
140 {
141 actd = (vpx_variance8x8(yd, yd_stride, VP8_ZEROS, 0, &sse) + 32) >> 6;139 actd = (vpx_variance8x8(yd, yd_stride, VP8_ZEROS, 0, &sse) + 32) >> 6;
142 act = (vpx_variance8x8(y, y_stride, VP8_ZEROS, 0, &sse) + 32) >> 6;140 act = (vpx_variance8x8(y, y_stride, VP8_ZEROS, 0, &sse) + 32) >> 6;
143#ifdef USE_SSD141#ifdef USE_SSD
@@ -186,14 +184,12 @@ static void multiframe_quality_enhance_block( · 42 unmodified lines
186 apply_ifactor(y, y_stride, yd, yd_stride, u, v, uv_stride, ud, vd,184 apply_ifactor(y, y_stride, yd, yd_stride, u, v, uv_stride, ud, vd,
187 uvd_stride, blksize, ifactor);185 uvd_stride, blksize, ifactor);
188 }186 }
189 } else /* else implicitly copy from previous frame */187 } else { /* else implicitly copy from previous frame */
190 {
191 if (blksize == 16) {188 if (blksize == 16) {
192 vp8_copy_mem16x16(y, y_stride, yd, yd_stride);189 vp8_copy_mem16x16(y, y_stride, yd, yd_stride);
193 vp8_copy_mem8x8(u, uv_stride, ud, uvd_stride);190 vp8_copy_mem8x8(u, uv_stride, ud, uvd_stride);
194 vp8_copy_mem8x8(v, uv_stride, vd, uvd_stride);191 vp8_copy_mem8x8(v, uv_stride, vd, uvd_stride);
195 } else /* if (blksize == 8) */192 } else {
196 {
197 vp8_copy_mem8x8(y, y_stride, yd, yd_stride);193 vp8_copy_mem8x8(y, y_stride, yd, yd_stride);
198 for (up = u, udp = ud, i = 0; i < uvblksize;194 for (up = u, udp = ud, i = 0; i < uvblksize;
199 ++i, up += uv_stride, udp += uvd_stride) {195 ++i, up += uv_stride, udp += uvd_stride) {
@@ -297,8 +293,7 @@ void vp8_multiframe_quality_enhance(VP8_COMMON *cm) { · 97 unmodified lines
297 }293 }
298 }294 }
299 }295 }
300 } else /* totmap = 4 */296 } else { /* totmap = 4 */
301 {
302 multiframe_quality_enhance_block(297 multiframe_quality_enhance_block(
303 16, qcurr, qprev, y_ptr, u_ptr, v_ptr, show->y_stride,298 16, qcurr, qprev, y_ptr, u_ptr, v_ptr, show->y_stride,
304 show->uv_stride, yd_ptr, ud_ptr, vd_ptr, dest->y_stride,299 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
111 111
112 /* Note the baseline filter values for each segment */112 /* Note the baseline filter values for each segment */
113 if (mbd->segmentation_enabled) {113 if (mbd->segmentation_enabled) {
114 /* Abs value */
115 if (mbd->mb_segement_abs_delta == SEGMENT_ABSDATA) {114 if (mbd->mb_segement_abs_delta == SEGMENT_ABSDATA) {
116 lvl_seg = mbd->segment_feature_data[MB_LVL_ALT_LF][seg];115 lvl_seg = mbd->segment_feature_data[MB_LVL_ALT_LF][seg];
117 } else /* Delta Value */116 } else { /* Delta Value */
118 {
119 lvl_seg += mbd->segment_feature_data[MB_LVL_ALT_LF][seg];117 lvl_seg += mbd->segment_feature_data[MB_LVL_ALT_LF][seg];
120 }118 }
121 lvl_seg = (lvl_seg > 0) ? ((lvl_seg > 63) ? 63 : lvl_seg) : 0;119 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
344 342
345 mode_info_context++; /* Skip border mb */343 mode_info_context++; /* Skip border mb */
346 }344 }
347 } else /* SIMPLE_LOOPFILTER */345 } else { /* SIMPLE_LOOPFILTER */
348 {
349 for (mb_row = 0; mb_row < mb_rows; ++mb_row) {346 for (mb_row = 0; mb_row < mb_rows; ++mb_row) {
350 for (mb_col = 0; mb_col < mb_cols; ++mb_col) {347 for (mb_col = 0; mb_col < mb_cols; ++mb_col) {
351 int skip_lf = (mode_info_context->mbmi.mode != B_PRED &&348 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
65 const vp8_prob *const p = (const vp8_prob *)mvc;65 const vp8_prob *const p = (const vp8_prob *)mvc;
66 int x = 0;66 int x = 0;
67 67
68 if (vp8_read(r, p[mvpis_short])) /* Large */68 if (vp8_read(r, p[mvpis_short])) { /* Large */
69 {
70 int i = 0;69 int i = 0;
71 70
72 do {71 do {
@@ -285,8 +284,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, · 212 unmodified lines
285 MB_MODE_INFO *mbmi) {284 MB_MODE_INFO *mbmi) {
286 vp8_reader *const bc = &pbi->mbc[8];285 vp8_reader *const bc = &pbi->mbc[8];
287 mbmi->ref_frame = (MV_REFERENCE_FRAME)vp8_read(bc, pbi->prob_intra);286 mbmi->ref_frame = (MV_REFERENCE_FRAME)vp8_read(bc, pbi->prob_intra);
288 if (mbmi->ref_frame) /* inter MB */287 if (mbmi->ref_frame) { /* inter MB */
289 {
290 enum { CNT_INTRA, CNT_NEAREST, CNT_NEAR, CNT_SPLITMV };288 enum { CNT_INTRA, CNT_NEAREST, CNT_NEAR, CNT_SPLITMV };
291 int cnt[4];289 int cnt[4];
292 int *cntx = cnt;290 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
500 }500 }
501 501
502 write_uv_mode(w, mi->uv_mode, pc->fc.uv_mode_prob);502 write_uv_mode(w, mi->uv_mode, pc->fc.uv_mode_prob);
503 } else /* inter coded */503 } else { /* inter coded */
504 {
505 int_mv best_mv;504 int_mv best_mv;
506 vp8_prob mv_ref_p[VP8_MVREFS - 1];505 vp8_prob mv_ref_p[VP8_MVREFS - 1];
507 506
vp8/encoder/encodemv.c+2−4
@@ -25,14 +25,12 @@ static void encode_mvcomponent(vp8_writer *const w, const int v, · 24 unmodified lines
25 const vp8_prob *p = mvc->prob;25 const vp8_prob *p = mvc->prob;
26 const int x = v < 0 ? -v : v;26 const int x = v < 0 ? -v : v;
27 27
28 if (x < mvnum_short) /* Small */28 if (x < mvnum_short) { /* Small */
29 {
30 vp8_write(w, 0, p[mvpis_short]);29 vp8_write(w, 0, p[mvpis_short]);
31 vp8_treed_write(w, vp8_small_mvtree, p + MVPshort, x, 3);30 vp8_treed_write(w, vp8_small_mvtree, p + MVPshort, x, 3);
32 31
33 if (!x) return; /* no sign bit */32 if (!x) return; /* no sign bit */
34 } else /* Large */33 } else { /* Large */
35 {
36 int i = 0;34 int i = 0;
37 35
38 vp8_write(w, 1, p[mvpis_short]);36 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
2925 2925
2926 cpi->current_ref_frames[GOLDEN_FRAME] = cm->current_video_frame;2926 cpi->current_ref_frames[GOLDEN_FRAME] = cm->current_video_frame;
2927 cpi->current_ref_frames[ALTREF_FRAME] = cm->current_video_frame;2927 cpi->current_ref_frames[ALTREF_FRAME] = cm->current_video_frame;
2928 } else /* For non key frames */2928 } else {
2929 {
2930 if (cm->refresh_alt_ref_frame) {2929 if (cm->refresh_alt_ref_frame) {
2931 assert(!cm->copy_buffer_to_arf);2930 assert(!cm->copy_buffer_to_arf);
2932 2931
@@ -2947,8 +2946,7 @@ static void update_reference_frames(VP8_COMP *cpi) { · 14 unmodified lines
2947 cpi->current_ref_frames[ALTREF_FRAME] =2946 cpi->current_ref_frames[ALTREF_FRAME] =
2948 cpi->current_ref_frames[LAST_FRAME];2947 cpi->current_ref_frames[LAST_FRAME];
2949 }2948 }
2950 } else /* if (cm->copy_buffer_to_arf == 2) */2949 } else {
2951 {
2952 if (cm->alt_fb_idx != cm->gld_fb_idx) {2950 if (cm->alt_fb_idx != cm->gld_fb_idx) {
2953 yv12_fb[cm->gld_fb_idx].flags |= VP8_ALTR_FRAME;2951 yv12_fb[cm->gld_fb_idx].flags |= VP8_ALTR_FRAME;
2954 yv12_fb[cm->alt_fb_idx].flags &= ~VP8_ALTR_FRAME;2952 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
2980 cpi->current_ref_frames[GOLDEN_FRAME] =2978 cpi->current_ref_frames[GOLDEN_FRAME] =
2981 cpi->current_ref_frames[LAST_FRAME];2979 cpi->current_ref_frames[LAST_FRAME];
2982 }2980 }
2983 } else /* if (cm->copy_buffer_to_gf == 2) */2981 } else {
2984 {
2985 if (cm->alt_fb_idx != cm->gld_fb_idx) {2982 if (cm->alt_fb_idx != cm->gld_fb_idx) {
2986 yv12_fb[cm->alt_fb_idx].flags |= VP8_GOLD_FRAME;2983 yv12_fb[cm->alt_fb_idx].flags |= VP8_GOLD_FRAME;
2987 yv12_fb[cm->gld_fb_idx].flags &= ~VP8_GOLD_FRAME;2984 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
3012 int i;3009 int i;
3013 for (i = LAST_FRAME; i < MAX_REF_FRAMES; ++i)3010 for (i = LAST_FRAME; i < MAX_REF_FRAMES; ++i)
3014 vp8_yv12_copy_frame(cpi->Source, &cpi->denoiser.yv12_running_avg[i]);3011 vp8_yv12_copy_frame(cpi->Source, &cpi->denoiser.yv12_running_avg[i]);
3015 } else /* For non key frames */3012 } else {
3016 {
3017 vp8_yv12_extend_frame_borders(3013 vp8_yv12_extend_frame_borders(
3018 &cpi->denoiser.yv12_running_avg[INTRA_FRAME]);3014 &cpi->denoiser.yv12_running_avg[INTRA_FRAME]);
3019 3015
vp8/encoder/ratectrl.c+2−4
@@ -498,11 +498,9 @@ static void calc_gf_params(VP8_COMP *cpi) { · 497 unmodified lines
498 * This is updated once the real frame size/boost is known.498 * This is updated once the real frame size/boost is known.
499 */499 */
500 if (cpi->oxcf.fixed_q == -1) {500 if (cpi->oxcf.fixed_q == -1) {
501 if (cpi->pass == 2) /* 2 Pass */501 if (cpi->pass == 2) { /* 2 Pass */
502 {
503 cpi->frames_till_gf_update_due = cpi->baseline_gf_interval;502 cpi->frames_till_gf_update_due = cpi->baseline_gf_interval;
504 } else /* 1 Pass */503 } else { /* 1 Pass */
505 {
506 cpi->frames_till_gf_update_due = cpi->baseline_gf_interval;504 cpi->frames_till_gf_update_due = cpi->baseline_gf_interval;
507 505
508 if (cpi->last_boost > 750) cpi->frames_till_gf_update_due++;506 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
853 default: break;853 default: break;
854 }854 }
855 855
856 if (m == ABOVE4X4) /* replace above with left if same */856 if (m == ABOVE4X4) { /* replace above with left if same */
857 {
858 int_mv left_mv;857 int_mv left_mv;
859 858
860 left_mv.as_int = col ? d[-1].bmi.mv.as_int : left_block_mv(mic, i);859 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
144 }144 }
145 si->is_kf = 0;145 si->is_kf = 0;
146 146
147 if (data_sz >= 10 && !(clear[0] & 0x01)) /* I-Frame */147 if (data_sz >= 10 && !(clear[0] & 0x01)) { /* I-Frame */
148 {
149 si->is_kf = 1;148 si->is_kf = 1;
150 149
151 /* vet via sync code */150 /* 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