[FFmpeg-cvslog] ivi_common: Initialize a variable at declaration in ff_ivi_decode_blocks().

Diego Biurrun git at videolan.org
Sat Apr 21 23:24:49 CEST 2012


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Mon Apr  2 19:34:44 2012 +0200| [b1563d0cf99a6ac1dd66d8baabe60b1c859a735a] | committer: Diego Biurrun

ivi_common: Initialize a variable at declaration in ff_ivi_decode_blocks().

This simplifies the code a bit and avoids an uninitialized variable warning.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b1563d0cf99a6ac1dd66d8baabe60b1c859a735a
---

 libavcodec/ivi_common.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c
index b930e15..b9ec1c2 100644
--- a/libavcodec/ivi_common.c
+++ b/libavcodec/ivi_common.c
@@ -330,7 +330,7 @@ int ff_ivi_dec_tile_data_size(GetBitContext *gb)
 int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile)
 {
     int         mbn, blk, num_blocks, num_coeffs, blk_size, scan_pos, run, val,
-                pos, is_intra, mc_type, mv_x, mv_y, col_mask;
+                pos, is_intra, mc_type = 0, mv_x, mv_y, col_mask;
     uint8_t     col_flags[8];
     int32_t     prev_dc, trvec[64];
     uint32_t    cbp, sym, lo, hi, quant, buf_offs, q;
@@ -370,9 +370,7 @@ int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile)
         if (!is_intra) {
             mv_x = mb->mv_x;
             mv_y = mb->mv_y;
-            if (!band->is_halfpel) {
-                mc_type = 0; /* we have only fullpel vectors */
-            } else {
+            if (band->is_halfpel) {
                 mc_type = ((mv_y & 1) << 1) | (mv_x & 1);
                 mv_x >>= 1;
                 mv_y >>= 1; /* convert halfpel vectors into fullpel ones */



More information about the ffmpeg-cvslog mailing list