]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_ssim.c
avfilter/vf_ssim: remove unnecessary check
[ffmpeg] / libavfilter / vf_ssim.c
index 9682c093b23ac14ed58c30ef2317d2bde77fcd65..c6e4fe286a53349766965378eb317e75de967b19 100644 (file)
@@ -243,8 +243,8 @@ static int ssim_plane_16bit(AVFilterContext *ctx, void *arg,
     const int max = td->max;
 
     for (int c = 0; c < td->nb_components; c++) {
-        const uint8_t *main = td->main_data[c];
-        const uint8_t *ref = td->ref_data[c];
+        const uint8_t *main_data = td->main_data[c];
+        const uint8_t *ref_data = td->ref_data[c];
         const int main_stride = td->main_linesize[c];
         const int ref_stride = td->ref_linesize[c];
         int width = td->planewidth[c];
@@ -263,8 +263,8 @@ static int ssim_plane_16bit(AVFilterContext *ctx, void *arg,
         for (int y = ystart; y < slice_end; y++) {
             for (; z <= y; z++) {
                 FFSWAP(void*, sum0, sum1);
-                ssim_4x4xn_16bit(&main[4 * z * main_stride], main_stride,
-                                 &ref[4 * z * ref_stride], ref_stride,
+                ssim_4x4xn_16bit(&main_data[4 * z * main_stride], main_stride,
+                                 &ref_data[4 * z * ref_stride], ref_stride,
                                  sum0, width);
             }
 
@@ -286,8 +286,8 @@ static int ssim_plane(AVFilterContext *ctx, void *arg,
     SSIMDSPContext *dsp = td->dsp;
 
     for (int c = 0; c < td->nb_components; c++) {
-        const uint8_t *main = td->main_data[c];
-        const uint8_t *ref = td->ref_data[c];
+        const uint8_t *main_data = td->main_data[c];
+        const uint8_t *ref_data = td->ref_data[c];
         const int main_stride = td->main_linesize[c];
         const int ref_stride = td->ref_linesize[c];
         int width = td->planewidth[c];
@@ -306,8 +306,8 @@ static int ssim_plane(AVFilterContext *ctx, void *arg,
         for (int y = ystart; y < slice_end; y++) {
             for (; z <= y; z++) {
                 FFSWAP(void*, sum0, sum1);
-                dsp->ssim_4x4_line(&main[4 * z * main_stride], main_stride,
-                                   &ref[4 * z * ref_stride], ref_stride,
+                dsp->ssim_4x4_line(&main_data[4 * z * main_stride], main_stride,
+                                   &ref_data[4 * z * ref_stride], ref_stride,
                                    sum0, width);
             }
 
@@ -496,7 +496,7 @@ static int config_input_ref(AVFilterLink *inlink)
     if (!s->score)
         return AVERROR(ENOMEM);
 
-    for (int t = 0; t < s->nb_threads && s->score; t++) {
+    for (int t = 0; t < s->nb_threads; t++) {
         s->score[t] = av_calloc(s->nb_components, sizeof(*s->score[0]));
         if (!s->score[t])
             return AVERROR(ENOMEM);
@@ -593,7 +593,7 @@ static const AVFilterPad ssim_outputs[] = {
     { NULL }
 };
 
-AVFilter ff_vf_ssim = {
+const AVFilter ff_vf_ssim = {
     .name          = "ssim",
     .description   = NULL_IF_CONFIG_SMALL("Calculate the SSIM between two video streams."),
     .preinit       = ssim_framesync_preinit,