Skip to content
Snippets Groups Projects
  1. Nov 26, 2024
  2. Mar 11, 2024
  3. Mar 05, 2024
  4. Feb 21, 2024
    • Niklas Haas's avatar
      renderer: refactor background/border clearing options · 36388111
      Niklas Haas authored
      The current behavior is very ad-hoc and presents numerous issues to
      downstream clients. Make this configuration process more straightforward
      by adding an explicit clearing mode enum field to `pl_render_params`,
      which the old override fields are specific instances of.
      
      Notably, this could be extended in the future, e.g. by PL_CLEAR_GRADIENT
      or whatever. (Although this can already be done as of right now by
      setting both clear modes to PL_CLEAR_NONE and using blend_params on top
      of a custom-drawn gradient)
      
      The default of `PL_COLOR_CLEAR` for both is consistent with the current
      status quo, and also presents the least surprising outcome when
      combining transparent/opaque images with transparent/opaque
      framebuffers. This way, the user only gets transparent images output if
      they explicitly opt-in to it, either by setting
      `background_transparency` to 1 (like `plplay` does), or by setting the
      background clearing mode to `PL_CLEAR_SKIP`.
      
      In particular, `border = PL_CLEAR_SKIP` will result in "garbage" pixels
      out of the box, at least on implementations which don't pre-clear
      framebuffers for you.
      
      Supersedes: videolan/libplacebo!637
      36388111
    • Niklas Haas's avatar
      renderer: add pl_frame_clear_tiles · 2b8fd9b0
      Niklas Haas authored
      Analog to pl_frame_clear_rgba. I had to decide carefully whether
      I wanted to preserve the symmetry with `pl_frame_clear_rgba` in taking
      only a `pl_gpu`, or if I should take the whole `pl_renderer` to gain
      access to the internal `pl_dispatch`. But I decided to go with the
      `pl_gpu`, since we might want to move this set of functions to
      a different module in the future. (It's not really renderer-specific)
      
      I also really regret having to go through such hoops every time to get
      the per-plane subsampling ratio. Truthfully, this should probably be
      a helper function.
      
      See-Also: videolan/libplacebo!637
      2b8fd9b0
    • Niklas Haas's avatar
      colorspace: split PL_ALPHA_NONE off from PL_ALPHA_UNKNOWN · 0ee549aa
      Niklas Haas authored
      This field was doing double duty between marking the alpha mode as
      unknown and marking the alpha channel as absent, with inconsistent
      results. In particular, pl_renderer always inferred the alpha channel if
      present in the texture, leaving users with no options for easily
      manually disabling it.
      
      This patch adds PL_ALPHA_NONE to rectify the situation, allowing API
      users to set `target.repr.alpha = PL_ALPHA_NONE` to explicitly disable
      alpha blending even when the target supports it.
      
      See-Also: !637
      0ee549aa
  5. Feb 17, 2024
    • Kacper Michajłow's avatar
      utils/libav: add pl_map_avdovi_metadata · a9f57049
      Kacper Michajłow authored
      Convenience function, we don't care about pl_frame here.
      
      Also deprecate pl_frame_map_avdovi_metadata to reduce API surface in
      future, both functions do the same thing. Prefer the one with relaxed
      API.
      a9f57049
  6. Nov 18, 2023
    • Niklas Haas's avatar
      cache: add pl_cache_signature · 452377d5
      Niklas Haas authored
      This is technically redundant with pl_cache_iterate() and simply
      performing the XOR yourself, but much more efficient and convenient.
      452377d5
  7. Nov 05, 2023
  8. Oct 31, 2023
    • Niklas Haas's avatar
      utils/frame_queue: add PTS drift compensation · de6d57f0
      Niklas Haas authored
      By default, allows for correcting drift/jitter of up to 1 ms per frame,
      in line with expected jitter from e.g. Matroska sources. This is enough
      to cover the mismatch between 23.976 Hz and 24.000 Hz, but not the
      mismatch between 24 and 25 Hz (which is just over 1ms per frame).
      
      There are two use cases in which this code will be useful:
      
      1. Displaying 23.976 Hz video files on e.g. 60.000 Hz monitor (or any
         other near-miss), in display-timed mode. Given the usual 3:2
         cadence, after five vsyncs (three source frames), we will have:
      
         Vsync (wallclock) PTS = 83.33333333333334
         Frame PTS = 83.41675008341676
      
         This is a difference of 0.1ms, and will therefore be fixed by this
         code, adjusting all future wallclock PTS up by the cumulative drift
         (0.1ms).
      
      2. Displaying any video with some amount of jitter on the PTS
         measurements. This avoids some situation where we have frames with
         weights 0.999 and 0.001 for example. Normally this should get rounded
         away by the frame mixing code anyway, but it's better to have an
         exact match.
      de6d57f0
  9. Sep 30, 2023
  10. Sep 28, 2023
  11. Sep 26, 2023
  12. Sep 25, 2023
  13. Sep 20, 2023
  14. Sep 19, 2023
    • Niklas Haas's avatar
      filters: fix PL_FILTER_DOWNSCALING definition · 309c86da
      Niklas Haas authored
      This was accidentally set to the same as PL_FILTER_UPSCALING.
      309c86da
    • Niklas Haas's avatar
      filters: calculate exact radius and main lobe size · a117f33f
      Niklas Haas authored
      And store these values to pl_filter.radius and pl_filter.radius_cutoff,
      even for ortho filters. Deprecate the now redundant radius_cutoff.
      
      Will probably be helpful if we ever want to use main lobe antiringing
      for ortho scalers as well. Also improves accuracy of the LUTs, and
      allows using smaller LUTs for ortho scalers that have large regions of
      mostly zero.
      
      Finally, this is a very slight performance improvement to ortho
      downscaling with extreme ratios, since we can round up to a smaller
      integer multiple. Probably not very relevant in practice.
      a117f33f
    • Niklas Haas's avatar
      shaders/sampling: hard-code scaler configuration · 64d7c5aa
      Niklas Haas authored
      Testing revealed the LUT size of 256 to have no performance downside
      compared to 64, and it still fits into the hard limit for literal LUTs.
      The maximum error (at ~1000x upsampling) is also on the order of 1e-4,
      far surpassing any threshold of perceptibility.
      
      Similarly, 1e-3 polar cutoff is not only completely below the dithering
      noise floor at 8-bits SDR, but also below JND (~10 bits). Going any
      higher than this starts to lead to visible/measurable artifacts, and
      going any lower is just slower for no benefit.
      
      Reducing option bloat, one commit at a time.
      64d7c5aa
    • Niklas Haas's avatar
      gpu: add pl_tex_transfer_params.no_import · 9f2b1f57
      Niklas Haas authored
      To bypass host pointer importing, for debugging and in some situations
      where doing so would lead to quickly exhausting 4G limit.
      9f2b1f57
    • Niklas Haas's avatar
      shaders/sampling: add more fast shader variants · add79fb5
      Niklas Haas authored
      These are easy to generate for specific, fixed, always positive shaders
      based on the same principle.
      add79fb5
  15. Sep 18, 2023
  16. Sep 14, 2023
    • Niklas Haas's avatar
      renderer: remove pl_render_params.icc_params · d21e2183
      Niklas Haas authored
      So, there are a number of things that motivate this:
      
      1. Using the same ICC profile settings for both the display and the
         image is rather confused, especially with regards to `max_luma`
         handling. (see #302)
      2. Forcing a specific 3DLUT size for both is also wrong, since most
         image ICC profiles are very simple to describe and do not require
         large 3DLUTs.
      3. The dependency of `icc_fallback` on `pl_render_params` breaks our
         ability to provide !575.
      4. I don't like the ad-hoc cache stuff leaking its way into
         pl_render_params (and especially being incompatible with pl_options)
      
      Fixes: #302
      d21e2183
    • Niklas Haas's avatar
      renderer: add pl_frame.icc · 56e17c1f
      Niklas Haas authored
      Augments the more clunky pl_frame.profile with an explicit API that
      allows the user to initialize the ICC object externally.
      
      I decided not to deprecate `pl_frame.profile` for now, because
      *requiring* the use of the new API would make e.g. the libav wrappers
      much more difficult to write, since they would now need to maintain
      external state somehow.
      
      Yet more reasons `pl_frame` should always have been a heap-allocated
      object, so we can just tie the lifetime of the ICC profile to it...
      56e17c1f
    • Niklas Haas's avatar
      shaders/icc: add pl_icc_update helper · 23b84d18
      Niklas Haas authored
      To recreate an ICC profile only if it changed. Mirrors the logic inside
      `update_icc` of pl_renderer, except with the addition of the ability to
      directly re-use an already-opened profile, skipping the need to keep
      this profile loaded persistently.
      23b84d18
    • Niklas Haas's avatar
      meson: fix typo (cosmetic) · 01d9da5f
      Niklas Haas authored
      01d9da5f
    • Niklas Haas's avatar
      renderer: add pl_render_params.correct_subpixel_offsets · 4f2c19c8
      Niklas Haas authored
      Allows forcing the use of a scale pass to force all residual subpixel
      offsets, instead of implicitly ignoring them.
      
      Closes: #291
      Closes: https://github.com/mpv-player/mpv/issues/11948
      4f2c19c8
  17. Sep 08, 2023
    • Niklas Haas's avatar
      global: remove MSAN hacks · 2806c27a
      Niklas Haas authored
      We no longer support running MSAN without fully instrumented
      dependencies at all, either in the CI or otherwise. So, no more need for
      all these hacks.
      
      It was fun while it lasted.
      2806c27a
    • Niklas Haas's avatar
      dispatch: deprecate pl_dispatch_save/load · 5b3f4007
      Niklas Haas authored
      Caching is now done directly inside the pl_gpu, via the pl_cache
      mechanism. This cache layer is no longer functional or needed.
      
      Redirect the calls for backwards compatibility, although this will
      still regress API users who do not set `pl_cache` explicitly.
      5b3f4007
    • Niklas Haas's avatar
      gpu: remove pl_pass_params.cached_program · 1759d2f4
      Niklas Haas authored
      No longer functional after the recent changes to make pl_gpu use
      pl_cache directly. No need for backwards compatibility because there is
      basically no user of this API in the wild.
      1759d2f4
    • Niklas Haas's avatar
      shaders/icc: refactor cache mechanism · 11af3487
      Niklas Haas authored
      Now users can be explicit about which cache they want to use, with the
      save/load callbacks being used as a fallback for backwards
      compatibility (for now).
      11af3487
    • Niklas Haas's avatar
      gpu: add pl_gpu_set_cache() · 6f0ec19a
      Niklas Haas authored
      Allows attaching custom pl_cache to a pl_gpu.
      6f0ec19a
    • Niklas Haas's avatar
      cache: add common/core caching mechanism · 8a2af4cc
      Niklas Haas authored
      Motivated by #299
      
      This mechanism should be more pluggable and less opaque than the
      previous ad-hoc dispatch cache, and gives the user better control over
      exactly when and where stuff is cached (or not).
      
      I will eventually also add an internal file-based cacher to serve as an
      example cache_cb, but that is a plan for the future.
      8a2af4cc
  18. Sep 03, 2023
Loading