[FFmpeg-user] xmedian questions

Paul B Mahol onemda at gmail.com
Fri Jan 1 11:37:18 EET 2021


On Fri, Jan 1, 2021 at 4:08 AM Mark Filipak (ffmpeg) <markfilipak at bog.us>
wrote:

> On 12/31/2020 09:50 PM, list+ffmpeg-user at jdlh.com wrote:
> > On 2020-12-31 17:25, Mark Filipak (ffmpeg) wrote:
> >> 1, Median? Really? (Or maybe really average?)
> >>
> >> For inputs = 239+15+15+15:
> >> median = (239+15)/2 = 127
> >> average = (239+15+15+15)/4 = 71
> >> For inputs = 239+239+239+15:
> >> median = (239+15)/2 = 127 (again)
> >> average = (239+239+239+15)/4 = 183
> >
> > It jumped out at me that the expressions you are computing for "median"
> don't match the definition I
> > am used to. It looks like you are computing the average of the largest
> and smallest samples. I
> > understand "median" to be a value such that half the samples are greater
> than or equal to, and half
> > are less than equal to, the value.
> >
> > For inputs = 239+15+15+15:
> > median = 15 (239, 15 >= 15; 15, 15 <= 15)
> > For inputs = 239+239+239+15:
> > median = 239 (239, 239 >= 239; 239, 15 <= 15)
> >
> > So, how to you define "median"? And how does FFmpeg?
> >
> >       —Jim DeLaHunt
>
> Thank you, Jim. You are correct. I reckon I was thinking of some sort of
> mean value -- there are
> several versions of mean.
>
> Median: The middle number in a given sequence of numbers, taken as the
> average of the two middle
> numbers when the sequence has an even number of numbers.
>
> Hmmm... What sort of weighting is that?
>
> For inputs = 239+15+15+15:
> median = (15+15)/2 = 15
> average = (239+15+15+15)/4 = 71
> For inputs = 239+239+239+15:
> median = (239+239)/2 = 239
> average = (239+239+239+15)/4 = 183
>
> As you see, the median winds up being either 15 or 239.
> So, what's the function of 'percentile'?
>

Input pixels are sorted first.
percentile says where in sorted list to pick pixel value.


> And why is "inputs=2" not allowed?
>

Because it is same as mix=2 filter

_______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-user mailing list