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.
_______________________________________________
ffmpeg-user mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".