Skip to content
Snippets Groups Projects
  • Niklas Haas's avatar
    shaders/av1: completely refactor pl_shader_av1_grain · 7ac80fb8
    Niklas Haas authored
    This refactor accomplishes a number of goals:
    
    - make the pl_shader_av1_grain sample directly from `tex` instead of
      relying on pre-sampled tex, which allows it to correctly keep track of
      the texture scale even when sampling from the luma tex, and also gets
      rid of redundant fields
    - makes the grain_state per-plane rather than shared, which avoids
      thrashing the grain state cache due to changing subsampling index
    - fixes the channel order when applying grain to non-YCbCr content
    - fixes some bugs related to grain scaling w.r.t texture sample depth
    
    Tested to produce correct output on a 4:2:2 10-bit grain sample.
    7ac80fb8