1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-31 12:11:52 +00:00

filter_kernels: add warnings for potential LUT sampling error

This commit is contained in:
Bin Jin 2015-12-05 17:32:36 +00:00 committed by wm4
parent aaa64b879e
commit 18fe6e6dc8

View File

@ -139,6 +139,12 @@ static void mp_compute_weights(struct filter_kernel *filter,
// Fill the given array with weights for the range [0.0, 1.0]. The array is
// interpreted as rectangular array of count * filter->size items.
//
// There will be slight sampling error if these weights are used in a OpenGL
// texture as LUT directly. The sampling point of a texel is located at its
// center, so out_array[0] will end up at 0.5 / count instead of 0.0.
// Correct lookup requires a linear coordinate mapping from [0.0, 1.0] to
// [0.5 / count, 1.0 - 0.5 / count].
void mp_compute_lut(struct filter_kernel *filter, int count, float *out_array)
{
struct filter_window *window = &filter->w;