]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/imgresample.c
cosmetic: align backslashes in makefiles
[ffmpeg] / libavcodec / imgresample.c
index 8da1b4d315f3fb9392c60bafafe55437f8ac56cc..fa4424810485e8894fb04637319fbf1bca522af6 100644 (file)
@@ -53,7 +53,7 @@ struct SwsContext {
     enum PixelFormat src_pix_fmt, dst_pix_fmt;
 };
 
-struct ImgReSampleContext {
+typedef struct ImgReSampleContext {
     int iwidth, iheight, owidth, oheight;
     int topBand, bottomBand, leftBand, rightBand;
     int padtop, padbottom, padleft, padright;
@@ -62,7 +62,7 @@ struct ImgReSampleContext {
     DECLARE_ALIGNED_8(int16_t, h_filters[NB_PHASES][NB_TAPS]); /* horizontal filters */
     DECLARE_ALIGNED_8(int16_t, v_filters[NB_PHASES][NB_TAPS]); /* vertical filters */
     uint8_t *line_buf;
-};
+} ImgReSampleContext;
 
 void av_build_filter(int16_t *filter, double factor, int tap_count, int phase_count, int scale, int type);
 
@@ -408,10 +408,10 @@ static void component_resample(ImgReSampleContext *s,
         else
 #endif
 #ifdef HAVE_ALTIVEC
-            if ((mm_flags & MM_ALTIVEC) && NB_TAPS == 4 && FILTER_BITS <= 6)
-                v_resample16_altivec(output, owidth,
-                                s->line_buf + (ring_y - NB_TAPS + 1) * owidth, owidth,
-                                &s->v_filters[phase_y][0]);
+        if ((mm_flags & MM_ALTIVEC) && NB_TAPS == 4 && FILTER_BITS <= 6)
+            v_resample16_altivec(output, owidth,
+                                 s->line_buf + (ring_y - NB_TAPS + 1) * owidth,
+                                 owidth, &s->v_filters[phase_y][0]);
         else
 #endif
             v_resample(output, owidth,
@@ -424,13 +424,6 @@ static void component_resample(ImgReSampleContext *s,
     }
 }
 
-ImgReSampleContext *img_resample_init(int owidth, int oheight,
-                                      int iwidth, int iheight)
-{
-    return img_resample_full_init(owidth, oheight, iwidth, iheight,
-            0, 0, 0, 0, 0, 0, 0, 0);
-}
-
 ImgReSampleContext *img_resample_full_init(int owidth, int oheight,
                                       int iwidth, int iheight,
                                       int topBand, int bottomBand,
@@ -484,6 +477,13 @@ fail:
     return NULL;
 }
 
+ImgReSampleContext *img_resample_init(int owidth, int oheight,
+                                      int iwidth, int iheight)
+{
+    return img_resample_full_init(owidth, oheight, iwidth, iheight,
+            0, 0, 0, 0, 0, 0, 0, 0);
+}
+
 void img_resample(ImgReSampleContext *s,
                   AVPicture *output, const AVPicture *input)
 {
@@ -790,7 +790,7 @@ int main(int argc, char **argv)
         }
     }
     save_pgm("/tmp/in.pgm", img, XSIZE, YSIZE);
-    for(i=0;i<sizeof(factors)/sizeof(float);i++) {
+    for(i=0;i<FF_ARRAY_ELEMS(factors);i++) {
         fact = factors[i];
         xsize = (int)(XSIZE * fact);
         ysize = (int)((YSIZE - 100) * fact);