Ecosyste.ms: OpenCollective

An open API service for software projects hosted on Open Collective.

github.com/haasn/libplacebo

Official mirror of libplacebo
https://github.com/haasn/libplacebo

shaders/colorspace: complete refactor of tone mapping pipeline

This refactors the code to take advantage of the new gamut mapping API.
In the process, it has a...

c378870595d3254490183352057d07359da4d54c authored over 1 year ago by Niklas Haas <[email protected]>
tests/tone_mapping: add rudimentary gamut mapping test

8dfb171bcf3b323726a77ee209a3128c3d65899a authored over 1 year ago by Niklas Haas <[email protected]>
gamut_mapping: add new gamut mapping API

So, this is a big mathdump with little in the way of history, but I
arrived at these algorithms ...

64099247d799272b9c72997c0fc834426b02ccee authored over 1 year ago by Niklas Haas <[email protected]>
colorspace: add IPTPQc4 model definitions

Will be used for the upcoming major refactor of the tone mapping / gamut
mapping pipeline.

We d...

95609471845d983b0946931be2095179bafa3d04 authored over 1 year ago by Niklas Haas <[email protected]>
common: add pl_smoothstep

And use it in shaders/colorspace.c

90df6765924eb01a74336d10adc7529abbe2fade authored over 1 year ago by Niklas Haas <[email protected]>
common: simplify PL_CMP

Less branching, in theory.

2a84cfffd65a8138c13c051ad4c0ac5fb446ba3d authored over 1 year ago by Niklas Haas <[email protected]>
utils/libav: fix AVFrame <-> AVBufferRef mapping

This needs to go through av_frame_get_plane_buffer(), because
frame->data and frame->buf are not...

9faea1bf6964cc45c861d23e2a991f383f62eabf authored almost 2 years ago by Niklas Haas <[email protected]>
tests/opengl: also test highest GLES in CI_MAXGL

ba8a047f8fa33366fbf444a64a7b2418504c7784 authored almost 2 years ago by Niklas Haas <[email protected]>
tests/opengl_surfaceless: reduce unnecessary GL testing

This is starting to hit timeouts now even on my workstation. We really
don't need to test all of...

ed77a5a8b9e6013eafc3ea5d533e63a87aae4a02 authored almost 2 years ago by Niklas Haas <[email protected]>
dispatc: force explicit LOD when texturing

A GLSL 130+ simplification, this variant (in theory) allows the
implementation to assume there a...

51322e778187d2085df013abc99b20288c2ef92f authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/sampling: simplify bicubic shader

Avoids a lot of unnecessary string printing and makes the math slightly
simpler (and hopefully f...

bc6dd19afabf733ba036cfc2fc12e3d709ebb1fd authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/sampling: cache sh_bind results

4c66025ce331463251ec9dc7fd9a5d9e936bca58 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/deinterlacing: cache pos/pt

`sh_bind` informs users that these values should be cached

35e48fb59a99c135777f98a60b4d0b7d10577da7 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/colorspace: drop redundant memory barriers

As a consequence of the peak detection redesign, we no longer re-read
from the same SSBO in the ...

da820acbde2c1385e148be8167b656a581f8d2cc authored almost 2 years ago by Niklas Haas <[email protected]>
colorspace: avoid NAN on negative PQ inputs

19de385d3c23ae705016939cbb26d8b2a8c3e181 authored almost 2 years ago by Niklas Haas <[email protected]>
tests/bench: fix LUT tone mapping test

This was set to a method that was implemented in pure GLSL.

8d14a90723bc989d60a40bd484c32f95926ca0cc authored almost 2 years ago by Niklas Haas <[email protected]>
gpu: fix whitespace

05523624d84816d6d6a72b048c9732c5564c9f22 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/lut: log LUT generation CPU time

Capped to trace verbosity for dynamically regenerating LUTs.

51cd475266a1a13b3bed549a05f87ce3c6c5f472 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/colorspace: ignore small deviations in peak

Sometimes, rounding/encoding error causes small (+/-1 PQ unit)
deviations in static frames repea...

ed78bbda59c75b66a50fa61c50f61e826e4e1b79 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/colorspace: clamp detected peak to sane value

Some synthetic test clips can have PQ values as high as 10 million nits,
so clamp the detected r...

2c1483e0277977e3f03fe8bd2f83c91e677a4c27 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/colorspace: reduce string print boilerplate

For BT.2100, just hard-code the LMS matrix directly instead of
formatting it as a string argumen...

df9251a886b4e475a63abb96f781e48f21cb1b01 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders: add sh_var_mat3 and SH_MAT3 helpers

To reduce boilerplate of transposing pl_matrix3x3 into shaders.

a7492500109f6f6eff0b7015b81b9eb854ac0288 authored almost 2 years ago by Niklas Haas <[email protected]>
utils/frame_queue: don't estimate fps when PTS are not monotonically increasing

This would not produce correct result anyway.

9d9e59589d970771573587eee1cc9bbd8d1d6ec2 authored almost 2 years ago by Kacper Michajłow <[email protected]>
utils/frame_queue: use fmaxf for float

No need to promote to double.

9f1a9092cc9f6b0b2edca0a1af0de9b0c11bb78a authored almost 2 years ago by Kacper Michajłow <[email protected]>
common: typedef pl_matrix3x3 etc. structs

These are used very frequently and it's sort of stupid to write `struct`
in front of them every ...

e3fce6ad87c6968a68a3f7e392b69ee90fd7e984 authored almost 2 years ago by Niklas Haas <[email protected]>
vulkan/swapchain: work around nvidia swapchain resizing bug

This is probably not the proper solution, but it's better than the
status quo of crashing and ha...

0f749e9810cdc110225ac07b53ed5bc2f982bf9f authored almost 2 years ago by Niklas Haas <[email protected]>
vulkan: add VkPhysicalDeviceProperties to vk_ctx

To replace the old `limits` field by the more general one.

e99f823d5a6bd56967a04c7074330907e985e3c3 authored almost 2 years ago by Niklas Haas <[email protected]>
ci: use clang also for ASAN

d2e58cf5202a27673ef049f15c3452c6fd6dc9e4 authored almost 2 years ago by Kacper Michajłow <[email protected]>
ci: update jammy image to include lld

d713a317f899a28eddb5e61960f0a0d18f6dddd5 authored almost 2 years ago by Kacper Michajłow <[email protected]>
ci: move meson build command to new line

Cosmetic change only.

9f4d66885df74dbeb5dcb03516580a9752535948 authored almost 2 years ago by Kacper Michajłow <[email protected]>
ci: do not build demos in coverage build

We don't care about demos coverage.

b50f41797eb03209768875e70b40af3f87058810 authored almost 2 years ago by Kacper Michajłow <[email protected]>
ci: use lld along with clang

This is a fix for linking errors with MSAN/UBSAN when static runtime is
linked also into shared ...

f8e9d424ac6d7ea2366274cc4eaf34aca68c9a16 authored almost 2 years ago by Kacper Michajłow <[email protected]>
Revert "ci: disable building demos with msan/ubsan"

This reverts commit 9d93981b94a5781cc0afe089a4b682514f5c4d60.
This reverts commit 88c39881fdc462...

2338539a7fe1da915f2ac17791fd604f05b201a3 authored almost 2 years ago by Kacper Michajłow <[email protected]>
log: add missing backtrace header in Windows code path

97d008b6d39a05b619e5b61fac05f4f2ef122ede authored almost 2 years ago by Kacper Michajłow <[email protected]>
log: fix type of HMODULE

For correctness, it is still pointer under the hood.

dc6e5a5e3deaa5355a91338c9497371f318da308 authored almost 2 years ago by Kacper Michajłow <[email protected]>
demos/colors: add support for escaping out of demo

fc874b5b990c4c70119b30e12367a0c322789eca authored almost 2 years ago by Niklas Haas <[email protected]>
docs: fix typo in website

0f36b010f96649c57295242fa8e899918328267f authored almost 2 years ago by Niklas Haas <[email protected]>
pl_alloc: reduce code duplication

This already exists as PL_ALIGN2

981f10027544fd30c23dc4f8394deaaa7f3b1f2e authored almost 2 years ago by Niklas Haas <[email protected]>
dispatch: don't unnecessarily reset shaders twice

The CPU overhead of this function is quite a substantial contribution,
surprisingly, to the over...

9bf3cb11748484bb5bb191995a885eb5d057166a authored almost 2 years ago by Niklas Haas <[email protected]>
demos/plplay: switch to pl_shader_info

We can now ref this struct directly instead of needing to manually
strcpy.

4349f641869c2a7210a457e261fe753f1a662d50 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/custom: re-use sh_var() etc.

Avoid touching sh->vars directly, and instead add a '#define' from the
internally generated iden...

cf842d9def8d50d2b87953770e4d92ba4c4c8044 authored almost 2 years ago by Niklas Haas <[email protected]>
dispatch: minor optimizations of shader generation

Replace some expensive %s formatters by slightly cheaper const str
formatters, and split up some...

3fd5c7bc090c3b5d7d8f086862e67646ef21c1e9 authored almost 2 years ago by Niklas Haas <[email protected]>
demos/plplay: refactor pass display

Make this UI more compact by default, but allow expanding it to provide
a more detailed view.

3edadd1e936ed30f3530b1cbff3547fa6cbbc4b8 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders: fix sh_desc texel buffer handling

Texel buffers should not have buffer variables attached.

845d83ff73484c3488c6ab4ad9833f84adfaa1a2 authored almost 2 years ago by Niklas Haas <[email protected]>
pl_alloc: nuke pl_ref

Only used for the clumsy shader subpass refcouting system, now removed.

7671178f6db0c391672d23dc7362f91b99abff75 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders: remove SH_TMP macro

No longer helpful.

9e9375075a3f6638f5b1081720e7060a0aaf415a authored almost 2 years ago by Niklas Haas <[email protected]>
shaders: simplify SH_TMP refcounting system

Instead of this complicated pl_ref business, just use a single void *tmp
object and directly ste...

3e0ab3e0589134c6babedd0be66b2afa01878149 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders: defer pl_asprintf on shader variables

Instead, just pack the `ident_t` directly into the `const char *`,
guarded by a sentinel value t...

ca5437145803681835009b44f94f1e84473f6f26 authored almost 2 years ago by Niklas Haas <[email protected]>
dispatch: refactor add_buffer_vars sorting

Instead of using pl_calloc to allocate a temporary buffer of pointers,
use a persistent array in...

9d76df00be1b8d1236e08f9227b9106523d511cb authored almost 2 years ago by Niklas Haas <[email protected]>
shaders: stop using pl_shader_res internally

Stop piggy-backing off a partially filled `pl_shader_res` struct
intenrally, and instead treat t...

d77cae870772ab41150dc1bc7e5cf0ba0f807fda authored almost 2 years ago by Niklas Haas <[email protected]>
shaders: pool small temporary allocations

These are used for things like pl_memdup() inside pl_var() et al.

Ideally, I would like to have...

a1c1f6cec0dc8ada5e496414dea6624ed3f165bf authored almost 2 years ago by Niklas Haas <[email protected]>
shaders: add sh_attr

And reuse it internally inside sh_attr_vec2

619d981f298f5b5190b8a8aaeb81c63d2d7be5bf authored almost 2 years ago by Niklas Haas <[email protected]>
shaders: don't strdup sh_subpass info steps

No longer needed. We can simply re-use the same array stealing scheme.
As an aside, use pl_free_...

24a0d726df5086b0eece017307f2a1b6582f8c16 authored almost 2 years ago by Niklas Haas <[email protected]>
renderer: improve description of frame mixing shader

e9ab73942d60e33c50429e2a335dd4a841fa988b authored almost 2 years ago by Niklas Haas <[email protected]>
pl_alloc: fix pl_free_children

This failed if called twice on the same object.

b994f1da89c159907712acca80cf4506e0bc22b6 authored almost 2 years ago by Niklas Haas <[email protected]>
renderer: fix possible memleak

This shader was never aborted before being overwritten by NULL.

c9e7492b61d3d92140561ac3bc5f2b91c9471458 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders: add pl_shader_info to replace pl_dispatch_info.shader

The `pl_dispatch_info` had a number of serious shortcomings. One of
these was the fact that it r...

db45e14c11c53462998dc604144d6865378e9dfa authored almost 2 years ago by Niklas Haas <[email protected]>
shaders: correctly ref objs in sh_subpass

These objects were not correctly ref'd. This does not fix any bugs in
practice, because we do no...

3d95433bbca5834d7b8ba0359fe7e2e192724c9a authored almost 2 years ago by Niklas Haas <[email protected]>
pl_alloc: don't downsize in PL_ARRAY_RESIZE

Avoid unnecessary re-allocations to *reduce* the size of a buffer. Where
this is intended (curre...

87610fd476a891f13e8963e01de78109f208af21 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/colorspace: simplify tone map description

This was needlessly verbose and also confusing, and hard to parse.
Simplify it again.

0daf0ab20d4bf346adc49ae1c2ed1a399b2a0106 authored almost 2 years ago by Niklas Haas <[email protected]>
log: ensure pl_log_stack_trace is never inlined

Even in LTO scenario. This function is used to print call stack, we
don't want it to be inlined ...

4e882ddd47493a5513aadaedef007faf8051a9b1 authored almost 2 years ago by Kacper Michajłow <[email protected]>
common: add PL_NOINLINE

fddc3bda307237f9c3a5acd3ece77ad2c1ed6481 authored almost 2 years ago by Kacper Michajłow <[email protected]>
log: cast FARPROC to void* first to suppress GCC warning

GCC complains about Wcast-function-type, but this is correct usage of
GetProcAddress(), to suppr...

cd7a371a0dcbb0d0cc8795d5c4788d1873332523 authored almost 2 years ago by Kacper Michajłow <[email protected]>
log: add pl_log_stack_trace support on Windows

Use DbgHelp to symbolize stack trace. This works only with PDB files.
Works fine with clang prod...

7f9eb409dc679ee5bf096dbdfd84a5ccfee38b7a authored almost 2 years ago by Kacper Michajłow <[email protected]>
d3d11: print stack trace on debug messages

994323fa501807fa50ca6b383373d10ec85162ac authored almost 2 years ago by Kacper Michajłow <[email protected]>
log: skip the first frame when using execinfo

We don't care about the pl_log_stack_trace function. This also make it
compatible with libunwind...

c02a8a2f49b462c4715add17855cc4575d1d2ac7 authored almost 2 years ago by Kacper Michajłow <[email protected]>
vulkan: gurad against possible stack buffer overflow

5243e797afa4d6dde63d66df013b4667304cad4e authored almost 2 years ago by Kacper Michajłow <[email protected]>
ci: only test one GL version for repeat GPU jobs

To speed up the abysmal amount of time it takes the CI runner to slog
its way through all these ...

2f629a8b73e09294d4c8282ee8621935c1a98426 authored almost 2 years ago by Niklas Haas <[email protected]>
ci: add gpu-strip job

Just testing whether our generated shaders also work when stripped, to
avoid mistakes like using...

2b27c0655cffe000649d10098fde22a872e852b3 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders: allow using unsigned integer identifiers

Reduces shader generation overhead by something like ~30%, eliminating
most of the string concat...

a62b684799e8bcc04c2a3f2ec1477ca1e5867a37 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/lut: parametrize ident_t

72eb983b95dc1397cd52b5978ffe60cf01beb6cf authored almost 2 years ago by Niklas Haas <[email protected]>
dispatch: parametrize ident_t

16af9f2150803c0a576aa722ea3a95081e4ab700 authored almost 2 years ago by Niklas Haas <[email protected]>
dispatch: pass position vertex by index

Avoids a handful of strcmp() calls and makes this code independent of
the exact representation o...

53398f2b14e7de335b70ccc2e18c7cde0263cf76 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/film_grain: parametrize ident_t

528e3d4138e279618c69455404836fb7ec3e3e2c authored almost 2 years ago by Niklas Haas <[email protected]>
shaders: parametrize `ident_t` printf fmt and initializer

I want to switch from using string-based identifiers to using integers.
To make this transition ...

656239e9270cddf6f27ebc5997df822d973522bf authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/sampling: parametrize ident_t

a3a03fb2a9dfe08242e74294f2cf008ece109f7c authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/dithering: parametrize ident_t

532a02b87e3fdf5af08ca11d37a2387e4a429d01 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/deinterlacing: parametrize ident_t

16cd59b87348253cb5011255aa2bc3b527b855bd authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/custom/mpv: parametrize ident_t

85968d9ba976731d20194199d0a9735fab3512a4 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/colorspace: parametrize ident_t

2e478be5645c0a81c702fd7d830a6477f3258892 authored almost 2 years ago by Niklas Haas <[email protected]>
renderer: parametrize ident_t

402e30b9225d9b730dbf1f33f07d1d86d29b29b6 authored almost 2 years ago by Niklas Haas <[email protected]>
gpu/utils: parametrize ident_t

b81910df90157570dbac0de881a01541bc35d32c authored almost 2 years ago by Niklas Haas <[email protected]>
shaders: require uniqueness of buffers

This seems like an obscure edge case that was only required for the old
peak detection SSBO logic.

f648c423f296ef37f2a8d023f1d9d10bfae7a480 authored almost 2 years ago by Niklas Haas <[email protected]>
renderer: always load frame mixing weight

Makes it less annoying to deal with identifiers that have varying
representations.

f6c6c753db9774afb09455bd0240c9182ae324b3 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/icc: parametrize ident_t

af5ab4177613d6f6d12367fc7cf0e46acf25148c authored almost 2 years ago by Niklas Haas <[email protected]>
shaders: assert name in sh_fresh

This is never used without a name in practice, might as well make it an
assumption to simplify t...

23806abe4a2bd484f77a84c3455b5355fc28cdc8 authored almost 2 years ago by Niklas Haas <[email protected]>
vulkan/context: remove old work-around

From 2021, should hopefully no longer be an issue.

90c6d26693438ada0f1f33b0b05b5d43c53b9c5e authored almost 2 years ago by Niklas Haas <[email protected]>
format: remove zero check from print_hex

Instead of checking if input is 0, add one bit to CLZ check, so it
always is a valid call. Calli...

ae47a31fb4d9139f9e6d29e75827b146c6a45788 authored almost 2 years ago by Kacper Michajłow <[email protected]>
format: cast to ushort before calling print_hex

This may seem counterintuitive because `print_hex` is implemented for
uint anyway, but this lets...

4accabc6ed2fdf1727a2948a120e5008359df1b7 authored almost 2 years ago by Kacper Michajłow <[email protected]>
colorspace: don't nuke HDR10 minimum in pl_color_space_infer

We only wanted to sanitize values here, not strip them for PQ (as
pl_color_space_nominal_peak_ex...

208167deb3e40c791c4da17e47c54834a0de8d6a authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/colorspace: rename misleading variable

This is no longer just for BPC.

207fe638152e21c8cce2bea36f19ca06050f27a4 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/colorspace: improve description of tone-mapping shader

Also prints the actual tone-mapping function in use.

6acb9f304a15599b5b7b3c7b33a4a32a24e7fd93 authored almost 2 years ago by Niklas Haas <[email protected]>
meson: bump minimum version to 0.63 for prefer_static

Fixes: 1cb6507
Fixes: https://github.com/haasn/libplacebo/issues/162

9299811ab8024316f8c5c2b1164ca439a62890ad authored almost 2 years ago by Kacper Michajłow <[email protected]>
format: fix %hx formatting

The version that made it into the commit was accidentally out-of-sync
with itself. Fix it and ad...

23ae2abb91ebc01e9f5aa630827c2a2c0fd556a7 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders: refactor shader identifier naming

Preliminary work for an upcoming refactor which will treat identifiers
directly as unsigned shor...

b9f47ff149d68790ff5c8553f6c6dba8b696d6d7 authored almost 2 years ago by Niklas Haas <[email protected]>
format: support %hx in *printf_c

We want this specifically for shader identifiers. Spend some amount of
effort in micro-optimizin...

0da67d31f319fe47632b9a0b17eb45048b74e2c6 authored almost 2 years ago by Niklas Haas <[email protected]>
renderer: fix ICC profile tone-mapping logic

The current code resulted in forced BPC when using an ICC profile, as a
result of the source bla...

b2eead5588f521991ede5aa572458fd004300a30 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/colorspace: highlight sub-black region in visualize_lut

Since this confused me at first.

2df008f381ffd97047b15e0d516e81bd0fcedcbf authored almost 2 years ago by Niklas Haas <[email protected]>
colorspace: ensure min_luma is positive

For sanity...

70d82247a3cfad5e36057dcabbfb0adf2210a704 authored almost 2 years ago by Niklas Haas <[email protected]>
shaders/colorspace: fix linear GLSL implementation

This code never clipped the values, which resulted in inconsistent
behavior with the LUT version...

0a50d3bc420d3b841e93535f64fc76ff5df49980 authored almost 2 years ago by Niklas Haas <[email protected]>