[FFmpeg-user] Documentation of chromanr filter

Mark Filipak markfilipak.windows+ffmpeg at gmail.com
Sat Jul 11 22:30:26 EEST 2020


On 07/11/2020 03:27 AM, Michael Koch wrote:
-snip-
> Foreach neighbour pixel
> {
>    A = absolute difference of U components of current pixel and neighbour pixel
>    B = absolute difference of V components of current pixel and neighbour pixel
>    if (A+B < threshold) then
>      use this neighbour pixel for averaging
> }
-snip-

May I suggest this:

1, For each 'input' sample, and
2, For each of 3 (corner) or 5 (edge) or 8 (interior) 'neighbor' samples,
2.1, If the sum of 'input' U and 'neighbor' U is less than 'threshold', and
2.2, If the sum of 'input' V and 'neighbor' V is less than 'threshold', then
2.3, Add 'neighbor' to 'candidates'.
3, Average U and V of 'input' and all 'candidates', if any, and assign the new U and V to the new 
'output' sample.

Instead of describing what an algorithm does, simply translate the code to human readable form, line 
by line. Taking that approach makes the documentation easier to understand, it assures 
code-documentation coverage, and it actually makes the documentation easier & faster to write.



More information about the ffmpeg-user mailing list