[FFmpeg-devel] [PATCH] avfilter: add median filter

Paul B Mahol onemda at gmail.com
Mon Oct 28 15:28:30 EET 2019


On 10/28/19, Moritz Barsnick <barsnick at gmx.net> wrote:
> On Sat, Oct 26, 2019 at 21:44:02 +0200, Paul B Mahol wrote:
>> +Pick median pixel from certain rectangle defined by radius.
>
> Is radius the correct term within a rectangle? (Just wondering, I do
> understand the intent.)

Correct term.

>
>> +        memset(coarse, 0, sizeof(coarse));
>> +        memset(fine, 0, sizeof(fine));
>> +        memset(luc, 0, sizeof(luc));
>
> Shouldn't this be
>     memset(arrayptr, 0, sizeof(*arrayptr));
> ?
>
>> +    MedianContext *s = ctx->priv;
>> +
>> +    for (int i = 0; i < s->nb_threads && s->coarse && s->fine; i++) {
>> +        av_freep(&s->coarse[i]);
>> +        av_freep(&s->fine[i]);
>> +    }
>
> s->coarse and s->fine are constant in this scope. Instead of checking
> them on each iteration, you could just exit early of they are (or
> either is) NULL. Not that performance matters here at all.
>
> I don't understand the rest functionally, looks fine to me.
>
> Cheers,
> Moritz
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list