]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_nnedi.c
avfilter/vf_waveform: add acolor filter
[ffmpeg] / libavfilter / vf_nnedi.c
index a1f2952369be37be547ee2d04bf97177d1292fac..b14aa64c0462afda46050d1d2fe5941f2056c975 100644 (file)
@@ -362,7 +362,7 @@ static int32_t process_line0(const uint8_t *tempu, int width, uint8_t *dstp8, co
             tmp /= 32;
             dstp[x] = FFMAX(FFMIN(tmp, maximum), minimum);
         } else {
-            memset(dstp + x, 255, sizeof(uint8_t));
+            dstp[x] = 255;
             count++;
         }
     }
@@ -601,7 +601,7 @@ static void evalfunc_1(NNEDIContext *s, FrameData *frame_data)
 
         const int ystart = frame_data->field[plane];
         const int ystop = height - 12;
-        uint8_t *srcpp;
+        const uint8_t *srcpp;
 
         if (!(s->process_plane & (1 << plane)))
             continue;
@@ -612,14 +612,9 @@ static void evalfunc_1(NNEDIContext *s, FrameData *frame_data)
 
         for (y = ystart; y < ystop; y += 2) {
             for (x = 32; x < width - 32; x++) {
-                uint32_t pixel = 0;
-                uint32_t all_ones = 0;
                 float mstd[4];
 
-                memcpy(&pixel, dstp + x, sizeof(uint8_t));
-                memset(&all_ones, 255, sizeof(uint8_t));
-
-                if (pixel != all_ones)
+                if (dstp[x] != 255)
                     continue;
 
                 s->extract((const uint8_t *)(srcpp + x), src_stride, xdia, ydia, mstd, input);
@@ -1154,7 +1149,7 @@ static av_cold int init(AVFilterContext *ctx)
 
     s->fdsp = avpriv_float_dsp_alloc(0);
     if (!s->fdsp)
-        return AVERROR(ENOMEM);
+        ret = AVERROR(ENOMEM);
 
 fail:
     av_free(bdata);
@@ -1178,6 +1173,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 
     av_freep(&s->frame_data.input);
     av_freep(&s->frame_data.temp);
+    av_freep(&s->fdsp);
     av_frame_free(&s->second);
 }