Lypheo / vs-placebo

libplacebo-based debanding, scaling and color mapping plugin for VapourSynth
GNU Lesser General Public License v2.1
73 stars 13 forks source link

Deband: properly advance frame PRNG #14

Closed haasn closed 2 years ago

haasn commented 2 years ago

The current deband filter does not actually do a very good job debanding, because it doesn't advance the internal PRNG in any way. This is mostly my fault for not exposing pl_dispatch_reset_frame, which is what e.g. pl_renderer uses internally to advance the PRNG state. On newer libplacebo (v4.167+), that's the function we should be calling to fix this.

As a work-around, that also works for older libplacebo, we can simply pl_shader_reset the shaders we get from pl_dispatch_begin to include a frame index of our choosing, without breaking anything.