diff mbox series

[FFmpeg-devel,05/60] lavfi/vf_ssim360: fix variable shadowing

Message ID D41CE2FHVDVC.1S4SBQCGRSLBG@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,01/60] fftools/ffmpeg_opt: fix variable shadowing | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Marvin Scholz Sept. 8, 2024, 5:54 p.m. UTC
---
 libavfilter/vf_ssim360.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Comments

Anton Khirnov Sept. 9, 2024, 10:12 a.m. UTC | #1
Quoting Marvin Scholz (2024-09-08 19:54:47)
> ---
>  libavfilter/vf_ssim360.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)

Looks ok.
diff mbox series

Patch

diff --git a/libavfilter/vf_ssim360.c b/libavfilter/vf_ssim360.c
index 68bd7b4d78..42632bcd85 100644
--- a/libavfilter/vf_ssim360.c
+++ b/libavfilter/vf_ssim360.c
@@ -1132,7 +1132,7 @@  static int do_ssim360(FFFrameSync *fs)
     AVFrame *master, *ref;
     AVDictionary **metadata;
     double c[4], ssim360v = 0.0, ssim360p50 = 0.0;
-    int i, ret;
+    int ret;
     int need_frame_skip = s->nb_net_frames % (s->frame_skip_ratio + 1);
     HeatmapList* h_ptr = NULL;
 
@@ -1153,7 +1153,7 @@  static int do_ssim360(FFFrameSync *fs)
             return ret;
     }
 
-    for (i = 0; i < s->nb_components; i++) {
+    for (int i = 0; i < s->nb_components; i++) {
         if (s->use_tape) {
             c[i] = ssim360_tape(master->data[i], s->main_tape_map[i][0],
                                 ref->data[i],    s->ref_tape_map [i][0],
@@ -1191,16 +1191,16 @@  static int do_ssim360(FFFrameSync *fs)
 
     // Record percentiles from histogram and attach metadata when using tape
     if (s->use_tape) {
-        int i, p, hist_indices[4];
+        int hist_indices[4];
         double hist_weight[4];
 
-        for (i = 0; i < s->nb_components; i++) {
+        for (int i = 0; i < s->nb_components; i++) {
             hist_indices[i] = SSIM360_HIST_SIZE - 1;
             hist_weight[i] = 0;
         }
 
-        for (p = 0; PERCENTILE_LIST[p] >= 0.0; p ++) {
-            for (i = 0; i < s->nb_components; i++) {
+        for (int p = 0; PERCENTILE_LIST[p] >= 0.0; p ++) {
+            for (int i = 0; i < s->nb_components; i++) {
                 double target_weight, ssim360p;
 
                 // Target weight = total number of samples above the specified percentile
@@ -1218,12 +1218,12 @@  static int do_ssim360(FFFrameSync *fs)
             }
         }
 
-        for (i = 0; i < s->nb_components; i++) {
+        for (int i = 0; i < s->nb_components; i++) {
             memset(s->ssim360_hist[i], 0, SSIM360_HIST_SIZE * sizeof(double));
             s->ssim360_hist_net[i] = 0;
         }
 
-        for (i = 0; i < s->nb_components; i++) {
+        for (int i = 0; i < s->nb_components; i++) {
             int cidx = s->is_rgb ? s->rgba_map[i] : i;
             set_meta(metadata, "lavfi.ssim360.", s->comps[i], c[cidx]);
         }
@@ -1235,7 +1235,7 @@  static int do_ssim360(FFFrameSync *fs)
         if (s->stats_file) {
             fprintf(s->stats_file, "n:%"PRId64" ", s->nb_ssim_frames);
 
-            for (i = 0; i < s->nb_components; i++) {
+            for (int i = 0; i < s->nb_components; i++) {
                 int cidx = s->is_rgb ? s->rgba_map[i] : i;
                 fprintf(s->stats_file, "%c:%f ", s->comps[i], c[cidx]);
             }