KNLMeansCL icon indicating copy to clipboard operation
KNLMeansCL copied to clipboard

Corrupt / garbage output when image width is a multiple of 64

Open JohnstonJ opened this issue 1 year ago • 2 comments

If the image width is a multiple of 64, KNLMeansCL outputs garbage. Tested with the release at https://github.com/pinterf/KNLMeansCL/releases/tag/v1.1.1e using 64-bit version, on an AMD Ryzen 7 Pro 4750U with integrated Radeon graphics.

This is a simple test case:

plugin_dir = "C:\VideoProject\Software\AviSynth-plugin\"
LoadPlugin(plugin_dir + "KNLMeansCL.dll")

function test(int width) {
    input = ColorBars(width=width, height=480, pixel_type="YV24").Trim(0, 50).Subtitle(String(width), size=36).FadeOut(50).ConvertToY8()
    output = input.KNLMeansCL()
    StackVertical(input, output)
}

StackHorizontal( \
    test(8*1),  test(8*2),  test(8*3),  test(8*4),  test(8*5),  test(8*6),  test(8*7),  test(8*8),  \
    test(8*9),  test(8*10), test(8*11), test(8*12), test(8*13), test(8*14), test(8*15), test(8*16), \
    test(8*17), test(8*18), test(8*19), test(8*20), test(8*21), test(8*22), test(8*23), test(8*24), \
    test(8*25), test(8*26), test(8*27), test(8*28), test(8*29), test(8*30), test(8*31), test(8*32), \
    test(8*33), test(8*34), test(8*35), test(8*36), test(8*37), test(8*38), test(8*39), test(8*40), \
    test(8*41), test(8*42), test(8*43), test(8*44), test(8*45), test(8*46), test(8*47), test(8*48) \
)

Preview it in AvsPmod, or render it with ffmpeg -i knlbug.avs -c:v huffyuv knlbug.avi.

And here is an example output image:

image

Notice that the bottom row (filter output) is missing outputs whenever width is a multiple of 64.

In real-world videos, I've seen where the filter output gets stuck at a specific frame, and doesn't change when I move the AvsPmod slider bar. Other times, it will show total garbage, as if it was displaying uninitialized memory.

For reference, here's what ColorBars(width=720, height=480).ConvertToY8().KNLMeansCL(info=true) shows:

image

JohnstonJ avatar Aug 13 '24 00:08 JohnstonJ

Here's another example that shows corrupt output. This is from the same test code above, except I removed the ConvertToY8 call.

image

JohnstonJ avatar Aug 17 '24 19:08 JohnstonJ

Hi, sorry, I received no notification on this repo. Before investigating, do you still have the issue, or it was just a bad driver?

pinterf avatar Nov 30 '24 12:11 pinterf