Cosmetics: use x ? y : z construct and merge intialization and
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Sun, 12 Sep 2010 21:31:39 +0000 (21:31 +0000)
committerStefano Sabatini <stefano.sabatini-lala@poste.it>
Sun, 12 Sep 2010 21:31:39 +0000 (21:31 +0000)
definition for the val variable in av_read_image_line(). Simplify.

Originally committed as revision 25109 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavutil/pixdesc.c

index e2bc649..98f5a9b 100644 (file)
@@ -55,9 +55,7 @@ void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesiz
         const uint8_t *p = data[plane]+ y*linesize[plane] + x*step + comp.offset_plus1-1;
 
         while(w--){
-            int val;
-            if(flags & PIX_FMT_BE) val= AV_RB16(p);
-            else                   val= AV_RL16(p);
+            int val = flags & PIX_FMT_BE ? AV_RB16(p) : AV_RL16(p);
             val = (val>>shift) & mask;
             if(read_pal_component)
                 val= data[1][4*val + c];