[MPlayer-dev-eng] [PATCH] Coring filter
Ivan Kalvachev
ikalvachev at gmail.com
Tue Jun 28 22:33:38 CEST 2005
On 6/27/05, Jan Paul Schmidt <jps at fundament.org> wrote:
> Hi there,
>
> this is my type of a coring filter for MPlayer/MEncoder. See
> attachments. vf_coring.c is the new filter file and vf_coring.diff the
> patches to integrate it into the source tree.
>
> Coring sets everything below a treshold to black. This coring filter
> only uses luminance to make the decision.
>
> Feedback is really appreciated, as this is my first encounter with the
> MPlayer/Mencoder filters.
>
> jps
Few questions.
1. fix the spelling in the patch.
2.parameter "black" is used as flag to set the cerned valuse to 0 or
threshold. How about giving black the value that should be written.
so:
if (black) {
y_out[i * dmpi->stride[0] + j] =
treshold;
}
else {
y_out[i * dmpi->stride[0] + j] = 0;
}
}
will become:
y_out[i * dmpi->stride[0] + j] = black;
So you will remove one `if` compleatly
This will have the added benefit to visually check what part of the
picture is affected by the cerneling. (put gray color on the place of
black).
I'm sure eq2 cannot do that, atm. ;)
3. Another optimization is to remove the (i*dmpi->stride[0]) that is
used many times in the loop. Just use y_out+=dmpi->stride[0] at the
end of first loop (same for y_in).
An good compiler may figure out this, but we are too cynical to call
gcc this way ;)
Ivan Kalvachev
iive
More information about the MPlayer-dev-eng
mailing list