changeset 10056:646065f63290 libavcodec

Remove useless braces around if/for/while expressions.
author diego
date Sat, 15 Aug 2009 11:12:47 +0000
parents fdb318d12314
children cfb009484d2d
files libdirac_libschro.c libdiracdec.c libdiracenc.c libschroedingerdec.c libschroedingerenc.c
diffstat 5 files changed, 13 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/libdirac_libschro.c	Sat Aug 15 11:02:50 2009 +0000
+++ b/libdirac_libschro.c	Sat Aug 15 11:12:47 2009 +0000
@@ -59,9 +59,8 @@
             avccontext->height == vf->height){
             ret_idx = idx;
             if (avccontext->time_base.den == vf->frame_rate_num &&
-                avccontext->time_base.num == vf->frame_rate_denom) {
+                avccontext->time_base.num == vf->frame_rate_denom)
                 return idx;
-            }
         }
     }
     return ret_idx;
@@ -76,9 +75,8 @@
 void ff_dirac_schro_queue_free (FfmpegDiracSchroQueue *queue,
                                 void (*free_func)(void *))
 {
-    while (queue->p_head) {
+    while (queue->p_head)
         free_func( ff_dirac_schro_queue_pop(queue) );
-    }
 }
 
 int ff_dirac_schro_queue_push_back (FfmpegDiracSchroQueue *queue, void *p_data)
--- a/libdiracdec.c	Sat Aug 15 11:02:50 2009 +0000
+++ b/libdiracdec.c	Sat Aug 15 11:12:47 2009 +0000
@@ -55,11 +55,9 @@
                       sizeof(ffmpeg_dirac_pixel_format_map[0]);
     int idx;
 
-    for (idx = 0; idx < num_formats; ++idx) {
-        if (ffmpeg_dirac_pixel_format_map[idx].dirac_pix_fmt == dirac_pix_fmt) {
+    for (idx = 0; idx < num_formats; ++idx)
+        if (ffmpeg_dirac_pixel_format_map[idx].dirac_pix_fmt == dirac_pix_fmt)
             return ffmpeg_dirac_pixel_format_map[idx].ff_pix_fmt;
-        }
-    }
     return PIX_FMT_NONE;
 }
 
--- a/libdiracenc.c	Sat Aug 15 11:02:50 2009 +0000
+++ b/libdiracenc.c	Sat Aug 15 11:12:47 2009 +0000
@@ -188,25 +188,22 @@
                             avccontext->global_quality / (FF_QP2LAMBDA*10.0);
             /* if it is not default bitrate then send target rate. */
             if (avccontext->bit_rate >= 1000 &&
-                avccontext->bit_rate != 200000) {
+                avccontext->bit_rate != 200000)
                p_dirac_params->enc_ctx.enc_params.trate =
                              avccontext->bit_rate / 1000;
-            }
         } else
             p_dirac_params->enc_ctx.enc_params.lossless = 1;
     } else if (avccontext->bit_rate >= 1000)
         p_dirac_params->enc_ctx.enc_params.trate = avccontext->bit_rate / 1000;
 
     if ((preset > VIDEO_FORMAT_QCIF || preset < VIDEO_FORMAT_QSIF525) &&
-         avccontext->bit_rate == 200000) {
+        avccontext->bit_rate == 200000)
         p_dirac_params->enc_ctx.enc_params.trate = 0;
-    }
 
-    if (avccontext->flags & CODEC_FLAG_INTERLACED_ME) {
+    if (avccontext->flags & CODEC_FLAG_INTERLACED_ME)
         /* all material can be coded as interlaced or progressive
          * irrespective of the type of source material */
         p_dirac_params->enc_ctx.enc_params.picture_coding_mode = 1;
-    }
 
     p_dirac_params->p_encoder = dirac_encoder_init (&(p_dirac_params->enc_ctx),
                                                     verbose );
--- a/libschroedingerdec.c	Sat Aug 15 11:02:50 2009 +0000
+++ b/libschroedingerdec.c	Sat Aug 15 11:12:47 2009 +0000
@@ -127,11 +127,9 @@
                       sizeof(ffmpeg_schro_pixel_format_map[0]);
     int idx;
 
-    for (idx = 0; idx < num_formats; ++idx) {
-        if (ffmpeg_schro_pixel_format_map[idx].schro_pix_fmt == schro_pix_fmt) {
+    for (idx = 0; idx < num_formats; ++idx)
+        if (ffmpeg_schro_pixel_format_map[idx].schro_pix_fmt == schro_pix_fmt)
             return ffmpeg_schro_pixel_format_map[idx].ff_pix_fmt;
-        }
-    }
     return PIX_FMT_NONE;
 }
 
@@ -197,12 +195,10 @@
     avccontext->time_base.num = p_schro_params->format->frame_rate_denominator;
 
     if (!p_schro_params->dec_pic.data[0])
-    {
         avpicture_alloc(&p_schro_params->dec_pic,
                         avccontext->pix_fmt,
                         avccontext->width,
                         avccontext->height);
-    }
 }
 
 static int libschroedinger_decode_frame(AVCodecContext *avccontext,
@@ -277,11 +273,10 @@
             /* Pull a frame out of the decoder. */
             frame = schro_decoder_pull (decoder);
 
-            if (frame) {
+            if (frame)
                 ff_dirac_schro_queue_push_back(
                                              &p_schro_params->dec_frame_queue,
                                              frame);
-            }
             break;
         case SCHRO_DECODER_EOS:
             go = 0;
--- a/libschroedingerenc.c	Sat Aug 15 11:02:50 2009 +0000
+++ b/libschroedingerenc.c	Sat Aug 15 11:12:47 2009 +0000
@@ -150,10 +150,9 @@
                                           "gop_structure",
                                           SCHRO_ENCODER_GOP_INTRA_ONLY);
 
-        if (avccontext->coder_type == FF_CODER_TYPE_VLC) {
+        if (avccontext->coder_type == FF_CODER_TYPE_VLC)
             schro_encoder_setting_set_double (p_schro_params->encoder,
                                               "enable_noarith", 1);
-        }
     }
     else {
         schro_encoder_setting_set_double (p_schro_params->encoder,
@@ -194,12 +193,11 @@
 
     }
 
-    if (avccontext->flags & CODEC_FLAG_INTERLACED_ME) {
+    if (avccontext->flags & CODEC_FLAG_INTERLACED_ME)
         /* All material can be coded as interlaced or progressive
            irrespective of the type of source material. */
         schro_encoder_setting_set_double (p_schro_params->encoder,
                                             "interlaced_coding", 1);
-    }
 
     /* FIXME: Signal range hardcoded to 8-bit data until both libschroedinger
      * and libdirac support other bit-depth data. */
@@ -324,9 +322,8 @@
             p_frame_output->size     = p_schro_params->enc_buf_size;
             p_frame_output->p_encbuf = p_schro_params->enc_buf;
             if (SCHRO_PARSE_CODE_IS_INTRA(parse_code) &&
-                SCHRO_PARSE_CODE_IS_REFERENCE(parse_code)) {
+                SCHRO_PARSE_CODE_IS_REFERENCE(parse_code))
                 p_frame_output->key_frame = 1;
-            }
 
             /* Parse the coded frame number from the bitstream. Bytes 14
              * through 17 represesent the frame number. */