[FFmpeg-cvslog] lavfi/select/scene: move out convoluted sad variable init from loop.

Clément Bœsch git at videolan.org
Sun Oct 14 02:21:20 CEST 2012


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Sat Oct 13 18:10:28 2012 +0200| [dff826b4a8d330bb672938ac168adbc4207be81a] | committer: Clément Bœsch

lavfi/select/scene: move out convoluted sad variable init from loop.

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

 libavfilter/vf_select.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_select.c b/libavfilter/vf_select.c
index 143e8cc..c600024 100644
--- a/libavfilter/vf_select.c
+++ b/libavfilter/vf_select.c
@@ -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,



More information about the ffmpeg-cvslog mailing list