]> git.sesse.net Git - ffmpeg/commitdiff
lavfi/select/scene: move out convoluted sad variable init from loop.
authorClément Bœsch <ubitux@gmail.com>
Sat, 13 Oct 2012 16:10:28 +0000 (18:10 +0200)
committerClément Bœsch <ubitux@gmail.com>
Sat, 13 Oct 2012 23:23:00 +0000 (01:23 +0200)
libavfilter/vf_select.c

index 143e8cce9edf861f28b30cda96050b30d4871751..c600024c027c090401eb61a8d48242c6c335cae2 100644 (file)
@@ -205,13 +205,13 @@ static double get_scene_score(AVFilterContext *ctx, AVFilterBufferRef *picref)
         picref->video->w    == prev_picref->video->w &&
         picref->linesize[0] == prev_picref->linesize[0]) {
         int x, y;
-        int64_t sad;
+        int64_t sad = 0;
         double mafd, diff;
         uint8_t *p1 =      picref->data[0];
         uint8_t *p2 = prev_picref->data[0];
         const int linesize = picref->linesize[0];
 
-        for (sad = y = 0; y < picref->video->h; y += 8)
+        for (y = 0; y < picref->video->h; y += 8)
             for (x = 0; x < linesize; x += 8)
                 sad += select->c.sad[1](select,
                                         p1 + y * linesize + x,