pax_global_header 0000666 0000000 0000000 00000000064 14634577501 0014526 g ustar 00root root 0000000 0000000 52 comment=1fd3c7bde7b943fe8985c893310b5269a09b46c5
libplacebo-v7.349.0/ 0000775 0000000 0000000 00000000000 14634577501 0014174 5 ustar 00root root 0000000 0000000 libplacebo-v7.349.0/.github/ 0000775 0000000 0000000 00000000000 14634577501 0015534 5 ustar 00root root 0000000 0000000 libplacebo-v7.349.0/.github/FUNDING.yml 0000664 0000000 0000000 00000000064 14634577501 0017351 0 ustar 00root root 0000000 0000000 github: haasn
patreon: haasn
open_collective: haasn
libplacebo-v7.349.0/.github/workflows/ 0000775 0000000 0000000 00000000000 14634577501 0017571 5 ustar 00root root 0000000 0000000 libplacebo-v7.349.0/.github/workflows/ci.yml 0000664 0000000 0000000 00000000535 14634577501 0020712 0 ustar 00root root 0000000 0000000 name: ci
on:
push:
branches:
- master
- pages-test
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
libplacebo-v7.349.0/.gitignore 0000664 0000000 0000000 00000000113 14634577501 0016157 0 ustar 00root root 0000000 0000000 /build*
/tags
/TAGS
/demos/3rdparty
/3rdparty
*.exe
*.o
.cache
__pycache__
libplacebo-v7.349.0/.gitlab-ci.yml 0000664 0000000 0000000 00000012414 14634577501 0016632 0 ustar 00root root 0000000 0000000 workflow:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
stages:
- compile
- test
- sanitize
variables:
GIT_SUBMODULE_STRATEGY: recursive
IMAGE_UBUNTU_JAMMY: registry.videolan.org/libplacebo-ubuntu-jammy:20230730213642
IMAGE_UBUNTU_JAMMY_AARCH: registry.videolan.org/libplacebo-ubuntu-jammy-aarch64:20230203024122
linux:
image: $IMAGE_UBUNTU_JAMMY
stage: compile
tags:
- docker
- amd64
script:
- meson build --buildtype release
--werror
-Dtests=true
-Dshaderc=enabled
-Dglslang=enabled
- ninja -C build
static:
image: $IMAGE_UBUNTU_JAMMY
stage: compile
tags:
- docker
- amd64
script:
- meson build --buildtype release
--default-library static
--werror
-Dshaderc=enabled
-Dglslang=enabled
- ninja -C build
win32:
image: $IMAGE_UBUNTU_JAMMY
stage: compile
tags:
- docker
- amd64
script:
- meson build --buildtype release
--werror
-Dtests=true
-Ddebug-abort=true
-Dd3d11=enabled
--cross-file /opt/crossfiles/i686-w64-mingw32.meson
- ninja -C build
- cd build && meson test -t 5 -v --num-processes=1
win64:
image: $IMAGE_UBUNTU_JAMMY
stage: compile
tags:
- docker
- amd64
script:
- meson build --buildtype release
--werror
-Dtests=true
-Ddebug-abort=true
-Dd3d11=enabled
--cross-file /opt/crossfiles/x86_64-w64-mingw32.meson
- ninja -C build
- cd build && meson test -t 5 -v --num-processes=1
aarch64:
image: $IMAGE_UBUNTU_JAMMY_AARCH
stage: compile
tags:
- docker
- aarch64
script:
- meson build --buildtype release --werror -Dtests=true
- ninja -C build
- cd build && meson test -t 5 -v --num-processes=1
macos:
stage: compile
tags:
- amd64
- monterey
script:
- meson build --buildtype release
-Ddefault_library=both
-Dtests=true
-Ddebug-abort=true
-Dc_args='-mmacosx-version-min=10.11 -Wunguarded-availability'
--werror
- ninja -C build
- cd build && meson test -t 5 -v --num-processes=1
scan:
image: $IMAGE_UBUNTU_JAMMY
stage: compile
tags:
- docker
- amd64
script:
- env CC=clang CXX=clang++ CC_LD=lld CXX_LD=lld
meson build --buildtype debugoptimized
--werror
-Dtests=true
-Dbench=true
-Dshaderc=enabled
-Dglslang=enabled
- ninja -C build scan-build
llvmpipe:
image: $IMAGE_UBUNTU_JAMMY
stage: test
tags:
- docker
- amd64
script:
- meson build --buildtype release
--werror
-Dtests=true
-Ddebug-abort=true
-Dc_args='-DCI_ALLOW_SW -DCI_MAXGL'
-Dshaderc=enabled
-Dglslang=enabled
- ninja -C build
- cd build && meson test -t 20 -v --num-processes=1
gpu:
image: $IMAGE_UBUNTU_JAMMY
stage: test
tags:
- gpu
script:
- meson build --buildtype release
--werror
-Dtests=true
-Ddemos=false
-Ddebug-abort=true
-Dshaderc=enabled
-Dglslang=enabled
-Db_coverage=true
- ninja -C build
- vulkaninfo
- cd build && meson test -t 5 -v --num-processes=1
- ninja coverage-html
- mv meson-logs/coveragereport ../coverage
- ninja coverage-xml
- grep -Eo 'line-rate="[^"]+"' meson-logs/coverage.xml | head -n 1 |
grep -Eo '[0-9.]+' | awk '{ print "coverage:", $1 * 100 } '
coverage: '/^coverage: (\d+.\d+)$/'
artifacts:
expose_as: 'Coverage HTML report'
paths:
- coverage/
reports:
coverage_report:
coverage_format: cobertura
path: build/meson-logs/coverage.xml
sanitize:
image: $IMAGE_UBUNTU_JAMMY
stage: sanitize
tags:
- gpu
variables:
UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1'
script:
- env CC=clang CXX=clang++ CC_LD=lld CXX_LD=lld
meson build --buildtype debugoptimized
--werror
-Dtests=true
-Ddebug-abort=true
-Dc_args='-DCI_MAXGL -Wno-deprecated-declarations'
-Db_sanitize=address,undefined
-Db_lundef=false
-Dshaderc=enabled
- ninja -C build
- cd build && time meson test -t 5 -v --num-processes=1
libplacebo-v7.349.0/.gitmodules 0000664 0000000 0000000 00000001211 14634577501 0016344 0 ustar 00root root 0000000 0000000 [submodule "demos/3rdparty/nuklear"]
path = demos/3rdparty/nuklear
url = https://github.com/Immediate-Mode-UI/Nuklear.git
[submodule "3rdparty/glad"]
path = 3rdparty/glad
url = https://github.com/Dav1dde/glad
[submodule "3rdparty/jinja"]
path = 3rdparty/jinja
url = https://github.com/pallets/jinja
[submodule "3rdparty/markupsafe"]
path = 3rdparty/markupsafe
url = https://github.com/pallets/markupsafe
[submodule "3rdparty/Vulkan-Headers"]
path = 3rdparty/Vulkan-Headers
url = https://github.com/KhronosGroup/Vulkan-Headers
[submodule "3rdparty/fast_float"]
path = 3rdparty/fast_float
url = https://github.com/fastfloat/fast_float.git
libplacebo-v7.349.0/3rdparty/ 0000775 0000000 0000000 00000000000 14634577501 0015744 5 ustar 00root root 0000000 0000000 libplacebo-v7.349.0/3rdparty/Vulkan-Headers/ 0000775 0000000 0000000 00000000000 14634577501 0020555 5 ustar 00root root 0000000 0000000 libplacebo-v7.349.0/3rdparty/fast_float/ 0000775 0000000 0000000 00000000000 14634577501 0020066 5 ustar 00root root 0000000 0000000 libplacebo-v7.349.0/3rdparty/glad/ 0000775 0000000 0000000 00000000000 14634577501 0016653 5 ustar 00root root 0000000 0000000 libplacebo-v7.349.0/3rdparty/jinja/ 0000775 0000000 0000000 00000000000 14634577501 0017037 5 ustar 00root root 0000000 0000000 libplacebo-v7.349.0/3rdparty/markupsafe/ 0000775 0000000 0000000 00000000000 14634577501 0020102 5 ustar 00root root 0000000 0000000 libplacebo-v7.349.0/LICENSE 0000664 0000000 0000000 00000057636 14634577501 0015222 0 ustar 00root root 0000000 0000000 GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
libplacebo-v7.349.0/README.md 0000664 0000000 0000000 00000040333 14634577501 0015456 0 ustar 00root root 0000000 0000000 # libplacebo
[](https://code.videolan.org/videolan/libplacebo/pipelines)
[](https://code.videolan.org/videolan/libplacebo/-/jobs/artifacts/master/file/coverage/index.html?job=test-gpu)
[](https://github.com/sponsors/haasn)
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SFJUTMPSZEAHC)
[](https://www.patreon.com/haasn)
**libplacebo** is, in a nutshell, the core rendering algorithms and ideas of
[mpv](https://mpv.io) rewritten as an independent library. As of today,
libplacebo contains a large assortment of video processing shaders, focusing
on both quality and performance. These include features such as the following:
- High-quality, optimized **upscaling and downscaling** including support for
polar filters ("Jinc"), anti-aliasing, anti-ringing and gamma correct
scaling.
- Dynamic **HDR tone mapping**, including real-time measurement of scene
histogram, scene change detection, dynamic exposure control, perceptual gamut
stretching, contrast recovery and more.
- Native support for **Dolby Vision HDR**, including Profile 5 conversion to
HDR/PQ or SDR, reading DV side data, and reshaping. (BL only, currently)
- A colorimetrically accurate **color management** engine with support for
soft gamut mapping, ICC profiles, accurate ITU-R BT.1886 emulation, black
point compensation, and custom 3DLUTs (.cube).
- A pluggable, extensible [**custom shader
system**](http://libplacebo.org/custom-shaders/). This can be used to
arbitrarily extend the range of custom shaders to include popular user
shaders like RAVU, FSRCNNX, or Anime4K. See the [mpv wiki on user
scripts](https://github.com/mpv-player/mpv/wiki/User-Scripts#user-shaders)
for more information.
- High performance **film grain synthesis** for AV1 and H.274, allowing media
players to offload this part of decoding from the CPU to the GPU.
- Tunable, fast **debanding** and **deinterlacing** shaders.
- High quality gamma-correct **dithering**, including error diffusion modes.
Every attempt was made to provide these features at a **high level of
abstraction**, taking away all the messy details of GPU programming, color
spaces, obscure subsampling modes, image metadata manipulation, and so on.
Expert-level functionality is packed into easy-to-use functions like
`pl_frame_from_avframe` and `pl_render_image`.
### Hardware requirements
libplacebo currently supports Vulkan (including MoltenVK), OpenGL, and
Direct3D 11. It currently has the following minimum hardware requirements:
- **Vulkan**: Core version 1.2
- **OpenGL**: GLSL version >= 130 (GL >= 3.0, GL ES >= 3.0)
- **Direct3D**: Feature level >= 9_1
For more documentation, including an introduction to the API, see [the project
website](https://libplacebo.org).
### Examples
This screenshot from the included [plplay demo program](./demos/plplay.c)
highlights just some of the features supported by the libplacebo rendering
code, all of which are adjustable dynamically during video playback.
[
](./demos/screenshots/plplay1.png)
[
](./demos/screenshots/plplay2.png)
[
](./demos/screenshots/plplay3.png)
[
](./demos/screenshots/plplay4.png)
[
](./demos/screenshots/plplay5.png)
[
](./demos/screenshots/plplay6.png)
### History
This project grew out of an interest to accomplish the following goals:
- Clean up mpv's internal [RA](#tier-1-rendering-abstraction) API and make it
reusable for other projects, as a general high-level backend-agnostic
graphics API wrapper.
- Provide a standard library of useful GPU-accelerated image processing
primitives based on GLSL, so projects like media players or browsers can use
them without incurring a heavy dependency on `libmpv`.
- Rewrite core parts of mpv's GPU-accelerated video renderer on top of
redesigned abstractions, in order to modernize it and allow supporting more
features.
It has since been adopted by [VLC](https://www.videolan.org/vlc/) as their
optional Vulkan-based video output path, and is provided as a Vulkan-based
video filter in the FFmpeg project.
## API Overview
The public API of libplacebo is currently split up into the following
components, the header files (and documentation) for which are available
inside the [`src/include/libplacebo`](src/include/libplacebo) directory. The
API is available in different "tiers", representing levels of abstraction
inside libplacebo. The APIs in higher tiers depend on those in lower tiers.
Which tier is used by a user depends on how much power/control they want over
the actual rendering. The low-level tiers are more suitable for big projects
that need strong control over the entire rendering pipeline; whereas the
high-level tiers are more suitable for smaller or simpler projects that want
libplacebo to take care of everything.
### Tier 0 (logging, raw math primitives)
- `cache.h`: Caching subsystem. Used to cache large or computationally heavy
binary blobs, such as compiled shaders, 3DLUTs, and so on.
- `colorspace.h`: A collection of enums and structs for describing color
spaces, as well as a collection of helper functions for computing various
color space transformation matrices.
- `common.h`: A collection of miscellaneous utility types and macros that are
shared among multiple subsystems. Usually does not need to be included
directly.
- `log.h`: Logging subsystem.
- `config.h`: Macros defining information about the way libplacebo was built,
including the version strings and compiled-in features/dependencies. Usually
does not need to be included directly. May be useful for feature tests.
- `dither.h`: Some helper functions for generating various noise and dithering
matrices. Might be useful for somebody else.
- `filters.h`: A collection of reusable reconstruction filter kernels, which
can be used for scaling. The generated weights arrays are semi-tailored to
the needs of libplacebo, but may be useful to somebody else regardless. Also
contains the structs needed to define a filter kernel for the purposes of
libplacebo's upscaling routines.
- `tone_mapping.h`: A collection of tone mapping functions, used for
conversions between HDR and SDR content.
- `gamut_mapping.h`: A collection of gamut mapping functions, used for
conversions between wide gamut and standard gamut content, as well as
for gamut recompression after tone-mapping.
The API functions in this tier are either used throughout the program
(context, common etc.) or are low-level implementations of filter kernels,
color space conversion logic etc.; which are entirely independent of GLSL
and even the GPU in general.
### Tier 1 (rendering abstraction)
- `gpu.h`: Exports the GPU abstraction API used by libplacebo internally.
- `swapchain.h`: Exports an API for wrapping platform-specific swapchains and
other display APIs. This is the API used to actually queue up rendered
frames for presentation (e.g. to a window or display device).
- `vulkan.h`: GPU API implementation based on Vulkan.
- `opengl.h`: GPU API implementation based on OpenGL.
- `d3d11.h`: GPU API implementation based on Direct3D 11.
- `dummy.h`: Dummy GPI API (interfaces with CPU only, no shader support)
As part of the public API, libplacebo exports a middle-level abstraction for
dealing with GPU objects and state. Basically, this is the API libplacebo uses
internally to wrap OpenGL, Vulkan, Direct3D etc. into a single unifying API
subset that abstracts away state, messy details, synchronization etc. into a
fairly high-level API suitable for libplacebo's image processing tasks.
It's made public both because it constitutes part of the public API of various
image processing functions, but also in the hopes that it will be useful for
other developers of GPU-accelerated image processing software.
### Tier 2 (GLSL generating primitives)
- `shaders.h`: The low-level interface to shader generation. This can be used
to generate GLSL stubs suitable for inclusion in other programs, as part of
larger shaders. For example, a program might use this interface to generate
a specialized tone-mapping function for performing color space conversions,
then call that from their own fragment shader code. This abstraction has an
optional dependency on `gpu.h`, but can also be used independently from it.
In addition to this low-level interface, there are several available shader
routines which libplacebo exports:
- `shaders/colorspace.h`: Shader routines for decoding and transforming
colors, tone mapping, and so forth.
- `shaders/custom.h`: Allows directly ingesting custom GLSL logic into the
`pl_shader` abstraction, either as bare GLSL or in [mpv .hook
format](https://mpv.io/manual/master/#options-glsl-shaders).
- `shaders/deinterlacing.h`: GPU deinterlacing shader based on yadif.
- `shaders/dithering.h`: Shader routine for various GPU dithering methods.
- `shaders/film_grain.h`: Film grain synthesis shaders for AV1 and H.274.
- `shaders/icc.h`: Shader for ICC profile based color management.
- `shaders/lut.h`: Code for applying arbitrary 1D/3D LUTs.
- `shaders/sampling.h`: Shader routines for various algorithms that sample
from images, such as debanding and scaling.
### Tier 3 (shader dispatch)
- `dispatch.h`: A higher-level interface to the `pl_shader` system, based on
`gpu.h`. This dispatch mechanism generates+executes complete GLSL shaders,
subject to the constraints and limitations of the underlying GPU.
This shader dispatch mechanism is designed to be combined with the shader
processing routines exported by `shaders/*.h`, but takes care of the low-level
translation of the resulting `pl_shader_res` objects into legal GLSL. It also
takes care of resource binding, shader input placement, as well as shader
caching and resource pooling; and makes sure all generated shaders have unique
identifiers (so they can be freely merged together).
### Tier 4 (high level renderer)
- `options.h`: A high-level options framework which wraps all of the options
comprising `pl_render_params` into a memory-managed, serializable struct that
can also be treated as a key/value dictionary. Also includes an options
parser to load options provided by the API user in string format.
- `renderer.h`: A high-level renderer which combines the shader primitives
and dispatch mechanism into a fully-fledged rendering pipeline that takes
raw texture data and transforms it into the desired output image.
- `utils/frame_queue.h`: A high-level frame queuing abstraction. This API
can be used to interface with a decoder (or other source of frames), and
takes care of translating timestamped frames into a virtual stream of
presentation events suitable for use with `renderer.h`, including any extra
context required for frame interpolation (`pl_frame_mix`).
- `utils/upload.h`: A high-level helper for uploading generic data in some
user-described format to a plane texture suitable for use with `renderer.h`.
These helpers essentially take care of picking/mapping a good image format
supported by the GPU. (Note: Eventually, this function will also support
on-CPU conversions to a different format where necessary, but for now, it
will just fail)
- `utils/dav1d.h`: High level helper for translating between Dav1dPicture
and libplacebo's `pl_frame`. (Single header library)
- `utils/libav.h`: High-level helpers for interoperation between
libplacebo and FFmpeg's libav* abstractions. (Single header library)
This is the "primary" interface to libplacebo, and the one most users will be
interested in. It takes care of internal details such as degrading to simpler
algorithms depending on the hardware's capabilities, combining the correct
sequence of colorspace transformations and shader passes in order to get the
best overall image quality, and so forth.
## Authors
libplacebo was founded and primarily developed by Niklas Haas
([@haasn](https://github.com/haasn)), but it would not be possible without the
contributions of others, especially support for windows.
[](https://github.com/haasn/libplacebo/graphs/contributors)
### License
libplacebo is currently available under the terms of the LGPLv2.1 (or later)
license. However, it's possible to release it under a more permissive license
(e.g. BSD2) if a use case emerges.
Please open an issue if you have a use case for a BSD2-licensed libplacebo.
## Installing
### Obtaining
When cloning libplacebo, make sure to provide the `--recursive``` flag:
```bash
$ git clone --recursive https://code.videolan.org/videolan/libplacebo
```
Alternatively (on an existing clone):
```bash
$ git submodule update --init
```
Doing either of these pulls in a handful of bundled 3rdparty dependencies.
Alternatively, they can be provided via the system.
### Building from source
libplacebo is built using the [meson build system](http://mesonbuild.com/).
You can build the project using the following steps:
```bash
$ DIR=./build
$ meson $DIR
$ ninja -C$DIR
```
To rebuild the project on changes, re-run `ninja -Cbuild`. If you wish to
install the build products to the configured prefix (typically `/usr/local/`),
you can run `ninja -Cbuild install`. Note that this is normally ill-advised
except for developers who know what they're doing. Regular users should rely
on distro packages.
### Dependencies
In principle, libplacebo has no mandatory dependencies - only optional ones.
However, to get a useful version of libplacebo. you most likely want to build
with support for either `opengl`, `vulkan` or `d3d11`. libplacebo built without
these can still be used (e.g. to generate GLSL shaders such as the ones used in
VLC), but the usefulness is severely impacted since most components will be
missing, impaired or otherwise not functional.
A full list of optional dependencies each feature requires:
- **glslang**: `glslang` + its related libraries (e.g. `libSPIRV.so`)
- **lcms**: `liblcms2`
- **libdovi**: `libdovi`
- **opengl**: `glad2` (*)
- **shaderc**: `libshaderc`
- **vulkan**: `libvulkan`, `python3-jinja2` (*)
- **xxhash**: `libxxhash`
(*) This dependency is bundled automatically when doing a recursive clone.
#### Vulkan support
Because the vulkan backend requires on code generation at compile time,
`python3-Jinja2` is a hard dependency of the build system. In addition to this,
the path to the Vulkan registry (`vk.xml`) must be locatable, ideally by
explicitly providing it via the `-Dvulkan-registry=/path/to/vk.xml` option,
unless it can be found in one of the built-in hard-coded locations.
### Configuring
To get a list of configuration options supported by libplacebo, after running
`meson $DIR` you can run `meson configure $DIR`, e.g.:
```bash
$ meson $DIR
$ meson configure $DIR
```
If you want to disable a component, for example Vulkan support, you can
explicitly set it to `false`, i.e.:
```bash
$ meson configure $DIR -Dvulkan=disabled -Dshaderc=disabled
$ ninja -C$DIR
```
### Testing
To enable building and executing the tests, you need to build with
`tests` enabled, i.e.:
```bash
$ meson configure $DIR -Dtests=true
$ ninja -C$DIR test
```
### Benchmarking
A naive benchmark suite is provided as an extra test case, disabled by default
(due to the high execution time required). To enable it, use the `bench`
option:
```bash
$ meson configure $DIR -Dbench=true
$ meson test -C$DIR benchmark --verbose
```
## Using
For a full documentation of the API, refer to the above [API
Overview](#api-overview) as well as the [public header
files](src/include/libplacebo). You can find additional examples of how to use
the various components in the [demo programs](demos) as well as in the [unit
tests](src/tests).
libplacebo-v7.349.0/RELEASING.md 0000664 0000000 0000000 00000001215 14634577501 0016026 0 ustar 00root root 0000000 0000000 # New release steps
## Pre-release (vX.Y.0-rcN)
1. Tag `vX.Y.0-rcN` on `master`
## Normal release (vX.Y.0)
1. Tag `vX.Y.0` on `master`
2. Create version branch `vX.Y`
3. Force-push `release` branch (or fast-forward if possible)
4. Update topic on IRC #libplacebo
5. Bump 'X' version number in meson.build, for next release (optional)
6. Tag release on github
## Bugfix release (vX.Y.Z)
1. Cherry-pick bug fixes onto version branch (`vX.Y`)
2. Update `Z` version number in `meson.build`
3. Tag `vX.Y.Z` on this branch
4. Fast-forward `release` branch iff this is the latest major release
5. Update topic on IRC #libplacebo
6. Tag release on github
libplacebo-v7.349.0/compile 0000775 0000000 0000000 00000000075 14634577501 0015554 0 ustar 00root root 0000000 0000000 #!/bin/sh
DIR=./build
[ -d $DIR ] || meson $DIR
ninja -C$DIR
libplacebo-v7.349.0/demos/ 0000775 0000000 0000000 00000000000 14634577501 0015303 5 ustar 00root root 0000000 0000000 libplacebo-v7.349.0/demos/3rdparty/ 0000775 0000000 0000000 00000000000 14634577501 0017053 5 ustar 00root root 0000000 0000000 libplacebo-v7.349.0/demos/3rdparty/nuklear/ 0000775 0000000 0000000 00000000000 14634577501 0020514 5 ustar 00root root 0000000 0000000 libplacebo-v7.349.0/demos/LICENSE 0000664 0000000 0000000 00000015610 14634577501 0016313 0 ustar 00root root 0000000 0000000 Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.
For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:
i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation
thereof, including any amended or successor version of such
directive); and
vii. other similar, equivalent or corresponding rights throughout the
world based on applicable law or treaty, and any national
implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties of
title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects, accuracy, or
the present or absence of errors, whether or not discoverable, all to
the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the
Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.
libplacebo-v7.349.0/demos/colors.c 0000664 0000000 0000000 00000004226 14634577501 0016754 0 ustar 00root root 0000000 0000000 /* Simplistic demo that just makes the window colorful, including alpha
* transparency if supported by the windowing system.
*
* License: CC0 / Public Domain
*/
#include
#include
#include
#include
#include "common.h"
#include "pl_clock.h"
#include "window.h"
static pl_log logger;
static struct window *win;
static void uninit(int ret)
{
window_destroy(&win);
pl_log_destroy(&logger);
exit(ret);
}
int main(int argc, char **argv)
{
logger = pl_log_create(PL_API_VER, pl_log_params(
.log_cb = pl_log_color,
.log_level = PL_LOG_DEBUG,
));
win = window_create(logger, &(struct window_params) {
.title = "colors demo",
.width = 640,
.height = 480,
.alpha = true,
});
if (!win)
uninit(1);
pl_clock_t ts_start, ts;
if ((ts_start = pl_clock_now()) == 0) {
uninit(1);
}
while (!win->window_lost) {
if (window_get_key(win, KEY_ESC))
break;
struct pl_swapchain_frame frame;
bool ok = pl_swapchain_start_frame(win->swapchain, &frame);
if (!ok) {
// Something unexpected happened, perhaps the window is not
// visible? Wait for events and try again.
window_poll(win, true);
continue;
}
if ((ts = pl_clock_now()) == 0)
uninit(1);
const double period = 10.; // in seconds
double secs = fmod(pl_clock_diff(ts, ts_start), period);
double pos = 2 * M_PI * secs / period;
float alpha = (cos(pos) + 1.0) / 2.0;
assert(frame.fbo->params.blit_dst);
pl_tex_clear(win->gpu, frame.fbo, (float[4]) {
alpha * (sinf(2 * pos + 0.0) + 1.0) / 2.0,
alpha * (sinf(2 * pos + 2.0) + 1.0) / 2.0,
alpha * (sinf(2 * pos + 4.0) + 1.0) / 2.0,
alpha,
});
ok = pl_swapchain_submit_frame(win->swapchain);
if (!ok) {
fprintf(stderr, "libplacebo: failed submitting frame!\n");
uninit(3);
}
pl_swapchain_swap_buffers(win->swapchain);
window_poll(win, false);
}
uninit(0);
}
libplacebo-v7.349.0/demos/common.h 0000664 0000000 0000000 00000000302 14634577501 0016737 0 ustar 00root root 0000000 0000000 // License: CC0 / Public Domain
#pragma once
#include
#include
#include
#include
#include
#include "config_demos.h"
libplacebo-v7.349.0/demos/meson.build 0000664 0000000 0000000 00000011153 14634577501 0017446 0 ustar 00root root 0000000 0000000 glfw = dependency('glfw3', required: false)
sdl = dependency('sdl2', required: false)
sdl_image = dependency('SDL2_image', required: false)
ffmpeg_deps = [
dependency('libavcodec', required: false),
dependency('libavformat', required: false),
dependency('libavutil', required: false),
]
ffmpeg_found = true
foreach dep : ffmpeg_deps
ffmpeg_found = ffmpeg_found and dep.found()
endforeach
nuklear = disabler()
nuklear_inc = include_directories('./3rdparty/nuklear')
if cc.has_header('nuklear.h', include_directories: nuklear_inc)
nuklear_lib = static_library('nuklear',
include_directories: nuklear_inc,
c_args: ['-O2', '-Wno-missing-prototypes'],
dependencies: [ libplacebo, libm ],
sources: 'ui.c',
)
nuklear = declare_dependency(
include_directories: nuklear_inc,
link_with: nuklear_lib,
)
else
warning('Nuklear was not found in `demos/3rdparty`. Please run ' +
'`git submodule update --init` followed by `meson --wipe`.')
endif
conf_demos = configuration_data()
conf_demos.set('HAVE_NUKLEAR', nuklear.found())
conf_demos.set('HAVE_EGL', cc.check_header('EGL/egl.h', required: false))
apis = []
# Enable all supported combinations of API and windowing system
if glfw.found()
if components.get('vulkan')
conf_demos.set('HAVE_GLFW_VULKAN', true)
apis += static_library('glfw-vk',
dependencies: [libplacebo, libm, glfw, vulkan_headers],
sources: 'window_glfw.c',
c_args: ['-DUSE_VK'],
include_directories: vulkan_headers_inc,
)
endif
if components.get('opengl')
conf_demos.set('HAVE_GLFW_OPENGL', true)
apis += static_library('glfw-gl',
dependencies: [libplacebo, glfw],
sources: 'window_glfw.c',
c_args: '-DUSE_GL',
)
endif
if components.get('d3d11')
conf_demos.set('HAVE_GLFW_D3D11', true)
apis += static_library('glfw-d3d11',
dependencies: [libplacebo, glfw],
sources: 'window_glfw.c',
c_args: '-DUSE_D3D11',
)
endif
endif
if sdl.found()
if components.get('vulkan')
conf_demos.set('HAVE_SDL_VULKAN', true)
apis += static_library('sdl-vk',
dependencies: [libplacebo, sdl, vulkan_headers],
sources: 'window_sdl.c',
c_args: ['-DUSE_VK'],
include_directories: vulkan_headers_inc,
)
endif
if components.get('opengl')
conf_demos.set('HAVE_SDL_OPENGL', true)
apis += static_library('sdl-gl',
dependencies: [libplacebo, sdl],
sources: 'window_sdl.c',
c_args: '-DUSE_GL',
)
endif
endif
configure_file(
output: 'config_demos.h',
configuration: conf_demos,
)
if apis.length() == 0
warning('Demos enabled but no supported combination of windowing system ' +
'and graphical APIs was found. Demo programs require either GLFW or ' +
'SDL and either Vulkan or OpenGL to function.')
else
additional_dep = []
if host_machine.system() == 'windows'
additional_dep += cc.find_library('winmm')
endif
dep = declare_dependency(
dependencies: [ libplacebo, build_deps ] + additional_dep,
sources: ['window.c', 'utils.c'],
include_directories: vulkan_headers_inc,
link_with: apis,
)
# Graphical demo programs
executable('colors', 'colors.c',
dependencies: [ dep, pl_clock, libm ],
link_args: link_args,
link_depends: link_depends,
)
if sdl_image.found()
executable('sdlimage', 'sdlimage.c',
dependencies: [ dep, libm, sdl_image ],
link_args: link_args,
link_depends: link_depends,
)
endif
if ffmpeg_found
plplay_deps = [ dep, pl_thread, pl_clock ] + ffmpeg_deps
if nuklear.found()
plplay_deps += nuklear
endif
if host_machine.system() == 'windows'
plplay_deps += cc.find_library('shlwapi', required: true)
endif
plplay_sources = ['plplay.c', 'settings.c']
if host_machine.system() == 'windows'
windows = import('windows')
plplay_sources += windows.compile_resources(demos_rc, depends: version_h,
include_directories: meson.project_source_root()/'win32')
endif
executable('plplay', plplay_sources,
dependencies: plplay_deps,
link_args: link_args,
link_depends: link_depends,
install: true,
)
endif
endif
# Headless vulkan demos
if components.get('vk-proc-addr')
executable('video-filtering', 'video-filtering.c',
dependencies: [ libplacebo, pl_clock, pl_thread, vulkan_loader ],
c_args: '-O2',
link_args: link_args,
link_depends: link_depends,
)
executable('multigpu-bench', 'multigpu-bench.c',
dependencies: [ libplacebo, pl_clock, vulkan_loader ],
c_args: '-O2',
link_args: link_args,
link_depends: link_depends,
)
endif
libplacebo-v7.349.0/demos/multigpu-bench.c 0000664 0000000 0000000 00000034021 14634577501 0020372 0 ustar 00root root 0000000 0000000 /* GPU->GPU transfer benchmarks. Requires some manual setup.
*
* License: CC0 / Public Domain
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include "pl_clock.h"
#define ALIGN2(x, align) (((x) + (align) - 1) & ~((align) - 1))
enum {
// Image configuration
NUM_TEX = 16,
WIDTH = 1920,
HEIGHT = 1080,
DEPTH = 16,
COMPS = 1,
// Queue configuration
NUM_QUEUES = NUM_TEX,
ASYNC_TX = 1,
ASYNC_COMP = 1,
// Buffer configuration
PTR_ALIGN = 4096,
PIXEL_PITCH = DEPTH / 8,
ROW_PITCH = ALIGN2(WIDTH * PIXEL_PITCH, 256),
IMAGE_SIZE = ROW_PITCH * HEIGHT,
BUFFER_SIZE = IMAGE_SIZE + PTR_ALIGN - 1,
// Test configuration
TEST_MS = 1500,
WARMUP_MS = 500,
POLL_FREQ = 10,
};
static uint8_t* page_align(uint8_t *data)
{
return (uint8_t *) ALIGN2((uintptr_t) data, PTR_ALIGN);
}
enum mem_owner {
CPU,
SRC,
DST,
NUM_MEM_OWNERS,
};
enum mem_type {
RAM,
GPU,
NUM_MEM_TYPES,
};
// This is attached to every `pl_tex.params.user_data`
struct buffers {
pl_gpu gpu;
pl_buf buf[NUM_MEM_TYPES];
pl_buf exported[NUM_MEM_TYPES];
pl_buf imported[NUM_MEM_TYPES];
struct pl_tex_transfer_params async;
};
static struct buffers *alloc_buffers(pl_gpu gpu)
{
struct buffers *buffers = malloc(sizeof(*buffers));
*buffers = (struct buffers) { .gpu = gpu };
for (enum mem_type type = 0; type < NUM_MEM_TYPES; type++) {
buffers->buf[type] = pl_buf_create(gpu, pl_buf_params(
.size = BUFFER_SIZE,
.memory_type = type == RAM ? PL_BUF_MEM_HOST : PL_BUF_MEM_DEVICE,
.host_mapped = true,
));
if (!buffers->buf[type])
exit(2);
if (gpu->export_caps.buf & PL_HANDLE_DMA_BUF) {
buffers->exported[type] = pl_buf_create(gpu, pl_buf_params(
.size = BUFFER_SIZE,
.memory_type = type == RAM ? PL_BUF_MEM_HOST : PL_BUF_MEM_DEVICE,
.export_handle = PL_HANDLE_DMA_BUF,
));
}
}
return buffers;
}
static void free_buffers(struct buffers *buffers)
{
for (enum mem_type type = 0; type < NUM_MEM_TYPES; type++) {
pl_buf_destroy(buffers->gpu, &buffers->buf[type]);
pl_buf_destroy(buffers->gpu, &buffers->exported[type]);
pl_buf_destroy(buffers->gpu, &buffers->imported[type]);
}
free(buffers);
}
static void link_buffers(pl_gpu gpu, struct buffers *buffers,
const struct buffers *import)
{
if (!(gpu->import_caps.buf & PL_HANDLE_DMA_BUF))
return;
for (enum mem_type type = 0; type < NUM_MEM_TYPES; type++) {
if (!import->exported[type])
continue;
buffers->imported[type] = pl_buf_create(gpu, pl_buf_params(
.size = BUFFER_SIZE,
.memory_type = type == RAM ? PL_BUF_MEM_HOST : PL_BUF_MEM_DEVICE,
.import_handle = PL_HANDLE_DMA_BUF,
.shared_mem = import->exported[type]->shared_mem,
));
}
}
struct ctx {
pl_gpu srcgpu, dstgpu;
pl_tex src, dst;
// for copy-based methods
enum mem_owner owner;
enum mem_type type;
bool noimport;
bool async;
};
static void await_buf(pl_gpu gpu, pl_buf buf)
{
while (pl_buf_poll(gpu, buf, UINT64_MAX))
; // do nothing
}
static void async_upload(void *priv)
{
struct buffers *buffers = priv;
pl_tex_upload(buffers->gpu, &buffers->async);
}
static inline void copy_ptr(struct ctx ctx)
{
const pl_gpu srcgpu = ctx.srcgpu, dstgpu = ctx.dstgpu;
const pl_tex src = ctx.src, dst = ctx.dst;
struct buffers *srcbuffers = src->params.user_data;
struct buffers *dstbuffers = dst->params.user_data;
pl_buf buf = NULL;
uint8_t *data = NULL;
if (ctx.owner == CPU) {
static uint8_t static_buffer[BUFFER_SIZE];
data = page_align(static_buffer);
} else {
struct buffers *b = ctx.owner == SRC ? srcbuffers : dstbuffers;
buf = b->buf[ctx.type];
data = page_align(buf->data);
await_buf(b->gpu, buf);
}
struct pl_tex_transfer_params src_params = {
.tex = src,
.row_pitch = ROW_PITCH,
.no_import = ctx.noimport,
};
if (ctx.owner == SRC) {
src_params.buf = buf;
src_params.buf_offset = data - buf->data;
} else {
src_params.ptr = data;
}
struct pl_tex_transfer_params dst_params = {
.tex = dst,
.row_pitch = ROW_PITCH,
.no_import = ctx.noimport,
};
if (ctx.owner == DST) {
dst_params.buf = buf;
dst_params.buf_offset = data - buf->data;
} else {
dst_params.ptr = data;
}
if (ctx.async) {
src_params.callback = async_upload;
src_params.priv = dstbuffers;
dstbuffers->async = dst_params;
pl_tex_download(srcgpu, &src_params);
} else {
pl_tex_download(srcgpu, &src_params);
pl_tex_upload(dstgpu, &dst_params);
}
}
static inline void copy_interop(struct ctx ctx)
{
const pl_gpu srcgpu = ctx.srcgpu, dstgpu = ctx.dstgpu;
const pl_tex src = ctx.src, dst = ctx.dst;
struct buffers *srcbuffers = src->params.user_data;
struct buffers *dstbuffers = dst->params.user_data;
struct pl_tex_transfer_params src_params = {
.tex = src,
.row_pitch = ROW_PITCH,
};
struct pl_tex_transfer_params dst_params = {
.tex = dst,
.row_pitch = ROW_PITCH,
};
if (ctx.owner == SRC) {
src_params.buf = srcbuffers->exported[ctx.type];
dst_params.buf = dstbuffers->imported[ctx.type];
} else {
src_params.buf = srcbuffers->imported[ctx.type];
dst_params.buf = dstbuffers->exported[ctx.type];
}
await_buf(srcgpu, src_params.buf);
if (ctx.async) {
src_params.callback = async_upload;
src_params.priv = dstbuffers;
dstbuffers->async = dst_params;
pl_tex_download(srcgpu, &src_params);
} else {
pl_tex_download(srcgpu, &src_params);
await_buf(srcgpu, src_params.buf); // manual cross-GPU synchronization
pl_tex_upload(dstgpu, &dst_params);
}
}
typedef void method(struct ctx ctx);
static double bench(struct ctx ctx, pl_tex srcs[], pl_tex dsts[], method fun)
{
const pl_gpu srcgpu = ctx.srcgpu, dstgpu = ctx.dstgpu;
pl_clock_t start_warmup = 0, start_test = 0;
uint64_t frames = 0, frames_warmup = 0;
start_warmup = pl_clock_now();
do {
const int idx = frames % NUM_TEX;
ctx.src = srcs[idx];
ctx.dst = dsts[idx];
// Generate some quasi-unique data in the source
float x = M_E * (frames / 100.0);
pl_tex_clear(srcgpu, ctx.src, (float[4]) {
sinf(x + 0.0) / 2.0 + 0.5,
sinf(x + 2.0) / 2.0 + 0.5,
sinf(x + 4.0) / 2.0 + 0.5,
1.0,
});
if (fun)
fun(ctx);
pl_gpu_flush(srcgpu); // to rotate queues
pl_gpu_flush(dstgpu);
frames++;
if (frames % POLL_FREQ == 0) {
pl_clock_t now = pl_clock_now();
if (start_test) {
if (pl_clock_diff(now, start_test) > TEST_MS * 1e-3)
break;
} else if (pl_clock_diff(now, start_warmup) > WARMUP_MS * 1e-3) {
start_test = now;
frames_warmup = frames;
}
}
} while (true);
pl_gpu_finish(srcgpu);
pl_gpu_finish(dstgpu);
return pl_clock_diff(pl_clock_now(), start_test) / (frames - frames_warmup);
}
static void run_tests(pl_gpu srcgpu, pl_gpu dstgpu)
{
const enum pl_fmt_caps caps = PL_FMT_CAP_HOST_READABLE;
pl_fmt srcfmt = pl_find_fmt(srcgpu, PL_FMT_UNORM, COMPS, DEPTH, DEPTH, caps);
pl_fmt dstfmt = pl_find_fmt(dstgpu, PL_FMT_UNORM, COMPS, DEPTH, DEPTH, caps);
if (!srcfmt || !dstfmt)
exit(2);
pl_tex src[NUM_TEX], dst[NUM_TEX];
for (int i = 0; i < NUM_TEX; i++) {
struct buffers *srcbuffers = alloc_buffers(srcgpu);
struct buffers *dstbuffers = alloc_buffers(dstgpu);
if (!memcmp(srcgpu->uuid, dstgpu->uuid, sizeof(srcgpu->uuid))) {
link_buffers(srcgpu, srcbuffers, dstbuffers);
link_buffers(dstgpu, dstbuffers, srcbuffers);
}
src[i] = pl_tex_create(srcgpu, pl_tex_params(
.w = WIDTH,
.h = HEIGHT,
.format = srcfmt,
.host_readable = true,
.blit_dst = true,
.user_data = srcbuffers,
));
dst[i] = pl_tex_create(dstgpu, pl_tex_params(
.w = WIDTH,
.h = HEIGHT,
.format = dstfmt,
.host_writable = true,
.blit_dst = true,
.user_data = dstbuffers,
));
if (!src[i] || !dst[i])
exit(2);
}
struct ctx ctx = {
.srcgpu = srcgpu,
.dstgpu = dstgpu,
};
static const char *owners[] = {
[CPU] = "cpu",
[SRC] = "src",
[DST] = "dst",
};
static const char *types[] = {
[RAM] = "ram",
[GPU] = "gpu",
};
double baseline = bench(ctx, src, dst, NULL);
// Test all possible generic copy methods
for (enum mem_owner owner = 0; owner < NUM_MEM_OWNERS; owner++) {
for (enum mem_type type = 0; type < NUM_MEM_TYPES; type++) {
for (int async = 0; async <= 1; async++) {
for (int noimport = 0; noimport <= 1; noimport++) {
// Blacklist undesirable configurations:
if (owner == CPU && type != RAM)
continue; // impossible
if (owner == CPU && async)
continue; // no synchronization on static buffer
if (owner == SRC && type == GPU)
continue; // GPU readback is orders of magnitude too slow
if (owner == DST && !noimport)
continue; // exhausts source address space
struct ctx cfg = ctx;
cfg.noimport = noimport;
cfg.owner = owner;
cfg.type = type;
cfg.async = async;
printf(" %s %s %s %s : ",
owners[owner], types[type],
noimport ? "memcpy" : " ",
async ? "async" : " ");
double dur = bench(cfg, src, dst, copy_ptr) - baseline;
printf("avg %.0f μs\t%.3f fps\n",
1e6 * dur, 1.0 / dur);
}
}
}
}
// Test DMABUF interop when supported
for (enum mem_owner owner = 0; owner < NUM_MEM_OWNERS; owner++) {
for (enum mem_type type = 0; type < NUM_MEM_TYPES; type++) {
for (int async = 0; async <= 1; async++) {
struct buffers *buffers;
switch (owner) {
case SRC:
buffers = dst[0]->params.user_data;
if (!buffers->imported[type])
continue;
break;
case DST:
buffers = src[0]->params.user_data;
if (!buffers->imported[type])
continue;
break;
default: continue;
}
struct ctx cfg = ctx;
cfg.owner = owner;
cfg.type = type;
printf(" %s %s %s %s : ",
owners[owner], types[type], "dmabuf",
async ? "async" : " ");
double dur = bench(cfg, src, dst, copy_interop) - baseline;
printf("avg %.0f μs\t%.3f fps\n",
1e6 * dur, 1.0 / dur);
}
}
}
for (int i = 0; i < NUM_TEX; i++) {
free_buffers(src[i]->params.user_data);
free_buffers(dst[i]->params.user_data);
pl_tex_destroy(srcgpu, &src[i]);
pl_tex_destroy(dstgpu, &dst[i]);
}
}
int main(int argc, const char *argv[])
{
if (argc < 3) {
fprintf(stderr, "Usage: %s 'Device 1' 'Device 2'\n\n", argv[0]);
fprintf(stderr, "(Use `vulkaninfo` for a list of devices)\n");
exit(1);
}
pl_log log = pl_log_create(PL_API_VER, pl_log_params(
.log_cb = pl_log_color,
.log_level = PL_LOG_WARN,
));
pl_vk_inst inst = pl_vk_inst_create(log, pl_vk_inst_params(
.debug = false,
));
pl_vulkan dev1 = pl_vulkan_create(log, pl_vulkan_params(
.device_name = argv[1],
.queue_count = NUM_QUEUES,
.async_transfer = ASYNC_TX,
.async_compute = ASYNC_COMP,
));
pl_vulkan dev2 = pl_vulkan_create(log, pl_vulkan_params(
.device_name = argv[2],
.queue_count = NUM_QUEUES,
.async_transfer = ASYNC_TX,
.async_compute = ASYNC_COMP,
));
if (!dev1 || !dev2) {
fprintf(stderr, "Failed creating Vulkan device!\n");
exit(1);
}
if (ROW_PITCH % dev1->gpu->limits.align_tex_xfer_pitch) {
fprintf(stderr, "Warning: Row pitch %d is not a multiple of optimal "
"transfer pitch (%zu) for GPU '%s'\n", ROW_PITCH,
dev1->gpu->limits.align_tex_xfer_pitch, argv[1]);
}
if (ROW_PITCH % dev2->gpu->limits.align_tex_xfer_pitch) {
fprintf(stderr, "Warning: Row pitch %d is not a multiple of optimal "
"transfer pitch (%zu) for GPU '%s'\n", ROW_PITCH,
dev2->gpu->limits.align_tex_xfer_pitch, argv[2]);
}
printf("%s -> %s:\n", argv[1], argv[2]);
run_tests(dev1->gpu, dev2->gpu);
if (strcmp(argv[1], argv[2])) {
printf("%s -> %s:\n", argv[2], argv[1]);
run_tests(dev2->gpu, dev1->gpu);
}
pl_vulkan_destroy(&dev1);
pl_vulkan_destroy(&dev2);
pl_vk_inst_destroy(&inst);
pl_log_destroy(&log);
}
libplacebo-v7.349.0/demos/plplay.c 0000664 0000000 0000000 00000057536 14634577501 0016770 0 ustar 00root root 0000000 0000000 /* Example video player based on ffmpeg. Designed to expose every libplacebo
* option for testing purposes. Not a serious video player, no real error
* handling. Simply infinitely loops its input.
*
* License: CC0 / Public Domain
*/
#include
#include
#include "common.h"
#include "window.h"
#include "utils.h"
#include "plplay.h"
#include "pl_clock.h"
#include "pl_thread.h"
#ifdef HAVE_NUKLEAR
#include "ui.h"
#else
struct ui;
static void ui_destroy(struct ui **ui) {}
static bool ui_draw(struct ui *ui, const struct pl_swapchain_frame *frame) { return true; };
#endif
#include
static inline void log_time(struct timing *t, double ts)
{
t->sum += ts;
t->sum2 += ts * ts;
t->peak = fmax(t->peak, ts);
t->count++;
}
static void uninit(struct plplay *p)
{
if (p->decoder_thread_created) {
p->exit_thread = true;
pl_queue_push(p->queue, NULL); // Signal EOF to wake up thread
pl_thread_join(p->decoder_thread);
}
pl_queue_destroy(&p->queue);
pl_renderer_destroy(&p->renderer);
pl_options_free(&p->opts);
for (int i = 0; i < p->shader_num; i++) {
pl_mpv_user_shader_destroy(&p->shader_hooks[i]);
free(p->shader_paths[i]);
}
for (int i = 0; i < MAX_FRAME_PASSES; i++)
pl_shader_info_deref(&p->frame_info[i].shader);
for (int j = 0; j < MAX_BLEND_FRAMES; j++) {
for (int i = 0; i < MAX_BLEND_PASSES; i++)
pl_shader_info_deref(&p->blend_info[j][i].shader);
}
free(p->shader_hooks);
free(p->shader_paths);
free(p->icc_name);
pl_icc_close(&p->icc);
if (p->cache) {
if (pl_cache_signature(p->cache) != p->cache_sig) {
FILE *file = fopen(p->cache_file, "wb");
if (file) {
pl_cache_save_file(p->cache, file);
fclose(file);
}
}
pl_cache_destroy(&p->cache);
}
// Free this before destroying the window to release associated GPU buffers
avcodec_free_context(&p->codec);
avformat_free_context(p->format);
ui_destroy(&p->ui);
window_destroy(&p->win);
pl_log_destroy(&p->log);
memset(p, 0, sizeof(*p));
}
static bool open_file(struct plplay *p, const char *filename)
{
static const int av_log_level[] = {
[PL_LOG_NONE] = AV_LOG_QUIET,
[PL_LOG_FATAL] = AV_LOG_PANIC,
[PL_LOG_ERR] = AV_LOG_ERROR,
[PL_LOG_WARN] = AV_LOG_WARNING,
[PL_LOG_INFO] = AV_LOG_INFO,
[PL_LOG_DEBUG] = AV_LOG_VERBOSE,
[PL_LOG_TRACE] = AV_LOG_DEBUG,
};
av_log_set_level(av_log_level[p->args.verbosity]);
printf("Opening file: '%s'\n", filename);
if (avformat_open_input(&p->format, filename, NULL, NULL) != 0) {
fprintf(stderr, "libavformat: Failed opening file!\n");
return false;
}
printf("Format: %s\n", p->format->iformat->name);
if (p->format->duration != AV_NOPTS_VALUE)
printf("Duration: %.3f s\n", p->format->duration / 1e6);
if (avformat_find_stream_info(p->format, NULL) < 0) {
fprintf(stderr, "libavformat: Failed finding stream info!\n");
return false;
}
// Find "best" video stream
int stream_idx =
av_find_best_stream(p->format, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0);
if (stream_idx < 0) {
fprintf(stderr, "plplay: File contains no video streams?\n");
return false;
}
const AVStream *stream = p->format->streams[stream_idx];
const AVCodecParameters *par = stream->codecpar;
printf("Found video track (stream %d)\n", stream_idx);
printf("Resolution: %d x %d\n", par->width, par->height);
if (stream->avg_frame_rate.den && stream->avg_frame_rate.num)
printf("FPS: %f\n", av_q2d(stream->avg_frame_rate));
if (stream->r_frame_rate.den && stream->r_frame_rate.num)
printf("TBR: %f\n", av_q2d(stream->r_frame_rate));
if (stream->time_base.den && stream->time_base.num)
printf("TBN: %f\n", av_q2d(stream->time_base));
if (par->bit_rate)
printf("Bitrate: %"PRIi64" kbps\n", par->bit_rate / 1000);
printf("Format: %s\n", av_get_pix_fmt_name(par->format));
p->stream = stream;
return true;
}
static bool init_codec(struct plplay *p)
{
assert(p->stream);
assert(p->win->gpu);
const AVCodec *codec = avcodec_find_decoder(p->stream->codecpar->codec_id);
if (!codec) {
fprintf(stderr, "libavcodec: Failed finding matching codec\n");
return false;
}
p->codec = avcodec_alloc_context3(codec);
if (!p->codec) {
fprintf(stderr, "libavcodec: Failed allocating codec\n");
return false;
}
if (avcodec_parameters_to_context(p->codec, p->stream->codecpar) < 0) {
fprintf(stderr, "libavcodec: Failed copying codec parameters to codec\n");
return false;
}
printf("Codec: %s (%s)\n", codec->name, codec->long_name);
const AVCodecHWConfig *hwcfg = 0;
if (p->args.hwdec) {
for (int i = 0; (hwcfg = avcodec_get_hw_config(codec, i)); i++) {
if (!pl_test_pixfmt(p->win->gpu, hwcfg->pix_fmt))
continue;
if (!(hwcfg->methods & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX))
continue;
int ret = av_hwdevice_ctx_create(&p->codec->hw_device_ctx,
hwcfg->device_type,
NULL, NULL, 0);
if (ret < 0) {
fprintf(stderr, "libavcodec: Failed opening HW device context, skipping\n");
continue;
}
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(hwcfg->pix_fmt);
printf("Using hardware frame format: %s\n", desc->name);
p->codec->extra_hw_frames = 4;
break;
}
}
if (!hwcfg)
printf("Using software decoding\n");
p->codec->thread_count = FFMIN(av_cpu_count() + 1, 16);
p->codec->get_buffer2 = pl_get_buffer2;
p->codec->opaque = &p->win->gpu;
#if LIBAVCODEC_VERSION_MAJOR < 60
AV_NOWARN_DEPRECATED({
p->codec->thread_safe_callbacks = 1;
});
#endif
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(58, 113, 100)
p->codec->export_side_data |= AV_CODEC_EXPORT_DATA_FILM_GRAIN;
#endif
if (avcodec_open2(p->codec, codec, NULL) < 0) {
fprintf(stderr, "libavcodec: Failed opening codec\n");
return false;
}
return true;
}
static bool map_frame(pl_gpu gpu, pl_tex *tex,
const struct pl_source_frame *src,
struct pl_frame *out_frame)
{
AVFrame *frame = src->frame_data;
struct plplay *p = frame->opaque;
bool ok = pl_map_avframe_ex(gpu, out_frame, pl_avframe_params(
.frame = frame,
.tex = tex,
.map_dovi = !p->ignore_dovi,
));
av_frame_free(&frame); // references are preserved by `out_frame`
if (!ok) {
fprintf(stderr, "Failed mapping AVFrame!\n");
return false;
}
p->stats.mapped++;
pl_frame_copy_stream_props(out_frame, p->stream);
return true;
}
static void unmap_frame(pl_gpu gpu, struct pl_frame *frame,
const struct pl_source_frame *src)
{
pl_unmap_avframe(gpu, frame);
}
static void discard_frame(const struct pl_source_frame *src)
{
AVFrame *frame = src->frame_data;
struct plplay *p = frame->opaque;
p->stats.dropped++;
av_frame_free(&frame);
printf("Dropped frame with PTS %.3f\n", src->pts);
}
static PL_THREAD_VOID decode_loop(void *arg)
{
int ret;
struct plplay *p = arg;
AVPacket *packet = av_packet_alloc();
AVFrame *frame = av_frame_alloc();
if (!frame || !packet)
goto done;
float frame_duration = av_q2d(av_inv_q(p->stream->avg_frame_rate));
double first_pts = 0.0, base_pts = 0.0, last_pts = 0.0;
uint64_t num_frames = 0;
while (!p->exit_thread) {
switch ((ret = av_read_frame(p->format, packet))) {
case 0:
if (packet->stream_index != p->stream->index) {
// Ignore unrelated packets
av_packet_unref(packet);
continue;
}
ret = avcodec_send_packet(p->codec, packet);
av_packet_unref(packet);
break;
case AVERROR_EOF:
// Send empty input to flush decoder
ret = avcodec_send_packet(p->codec, NULL);
break;
default:
fprintf(stderr, "libavformat: Failed reading packet: %s\n",
av_err2str(ret));
goto done;
}
if (ret < 0) {
fprintf(stderr, "libavcodec: Failed sending packet to decoder: %s\n",
av_err2str(ret));
goto done;
}
// Decode all frames from this packet
while ((ret = avcodec_receive_frame(p->codec, frame)) == 0) {
last_pts = frame->pts * av_q2d(p->stream->time_base);
if (num_frames++ == 0)
first_pts = last_pts;
frame->opaque = p;
(void) atomic_fetch_add(&p->stats.decoded, 1);
pl_queue_push_block(p->queue, UINT64_MAX, &(struct pl_source_frame) {
.pts = last_pts - first_pts + base_pts,
.duration = frame_duration,
.map = map_frame,
.unmap = unmap_frame,
.discard = discard_frame,
.frame_data = frame,
// allow soft-disabling deinterlacing at the source frame level
.first_field = p->opts->params.deinterlace_params
? pl_field_from_avframe(frame)
: PL_FIELD_NONE,
});
frame = av_frame_alloc();
}
switch (ret) {
case AVERROR(EAGAIN):
continue;
case AVERROR_EOF:
if (num_frames <= 1)
goto done; // still image or empty file
// loop infinitely
ret = av_seek_frame(p->format, p->stream->index, 0, AVSEEK_FLAG_BACKWARD);
if (ret < 0) {
fprintf(stderr, "libavformat: Failed seeking in stream: %s\n",
av_err2str(ret));
goto done;
}
avcodec_flush_buffers(p->codec);
base_pts += last_pts;
num_frames = 0;
continue;
default:
fprintf(stderr, "libavcodec: Failed decoding frame: %s\n",
av_err2str(ret));
goto done;
}
}
done:
pl_queue_push(p->queue, NULL); // Signal EOF to flush queue
av_packet_free(&packet);
av_frame_free(&frame);
PL_THREAD_RETURN();
}
static void update_colorspace_hint(struct plplay *p, const struct pl_frame_mix *mix)
{
const struct pl_frame *frame = NULL;
for (int i = 0; i < mix->num_frames; i++) {
if (mix->timestamps[i] > 0.0)
break;
frame = mix->frames[i];
}
if (!frame)
return;
struct pl_color_space hint = {0};
if (p->colorspace_hint)
hint = frame->color;
if (p->target_override)
apply_csp_overrides(p, &hint);
pl_swapchain_colorspace_hint(p->win->swapchain, &hint);
}
static bool render_frame(struct plplay *p, const struct pl_swapchain_frame *frame,
const struct pl_frame_mix *mix)
{
struct pl_frame target;
pl_options opts = p->opts;
pl_frame_from_swapchain(&target, frame);
update_settings(p, &target);
if (p->target_override) {
target.repr = p->force_repr;
pl_color_repr_merge(&target.repr, &frame->color_repr);
apply_csp_overrides(p, &target.color);
// Update ICC profile parameters dynamically
float target_luma = 0.0f;
if (!p->use_icc_luma) {
pl_color_space_nominal_luma_ex(pl_nominal_luma_params(
.metadata = PL_HDR_METADATA_HDR10, // use only static HDR nits
.scaling = PL_HDR_NITS,
.color = &target.color,
.out_max = &target_luma,
));
}
pl_icc_update(p->log, &p->icc, NULL, pl_icc_params(
.max_luma = target_luma,
.force_bpc = p->force_bpc,
));
target.icc = p->icc;
}
assert(mix->num_frames);
pl_rect2df crop = mix->frames[0]->crop;
if (p->stream->sample_aspect_ratio.num && p->target_zoom != ZOOM_RAW) {
float sar = av_q2d(p->stream->sample_aspect_ratio);
pl_rect2df_stretch(&crop, fmaxf(1.0f, sar), fmaxf(1.0f, 1.0 / sar));
}
// Apply target rotation and un-rotate crop relative to target
target.rotation = p->target_rot;
pl_rect2df_rotate(&crop, mix->frames[0]->rotation - target.rotation);
switch (p->target_zoom) {
case ZOOM_PAD:
pl_rect2df_aspect_copy(&target.crop, &crop, 0.0);
break;
case ZOOM_CROP:
pl_rect2df_aspect_copy(&target.crop, &crop, 1.0);
break;
case ZOOM_STRETCH:
break; // target.crop already covers full image
case ZOOM_FIT:
pl_rect2df_aspect_fit(&target.crop, &crop, 0.0);
break;
case ZOOM_RAW: ;
// Ensure pixels are exactly aligned, to avoid fractional scaling
int w = roundf(fabsf(pl_rect_w(crop)));
int h = roundf(fabsf(pl_rect_h(crop)));
target.crop.x0 = roundf((pl_rect_w(target.crop) - w) / 2.0f);
target.crop.y0 = roundf((pl_rect_h(target.crop) - h) / 2.0f);
target.crop.x1 = target.crop.x0 + w;
target.crop.y1 = target.crop.y0 + h;
break;
case ZOOM_400:
case ZOOM_200:
case ZOOM_100:
case ZOOM_50:
case ZOOM_25: ;
const float z = powf(2.0f, (int) ZOOM_100 - p->target_zoom);
const float sx = z * fabsf(pl_rect_w(crop)) / pl_rect_w(target.crop);
const float sy = z * fabsf(pl_rect_h(crop)) / pl_rect_h(target.crop);
pl_rect2df_stretch(&target.crop, sx, sy);
break;
}
struct pl_color_map_params *cpars = &opts->color_map_params;
if (cpars->visualize_lut) {
cpars->visualize_rect = (pl_rect2df) {0, 0, 1, 1};
float tar = pl_rect2df_aspect(&target.crop);
pl_rect2df_aspect_set(&cpars->visualize_rect, 1.0f / tar, 0.0f);
}
pl_clock_t ts_pre = pl_clock_now();
if (!pl_render_image_mix(p->renderer, mix, &target, &opts->params))
return false;
pl_clock_t ts_rendered = pl_clock_now();
if (!ui_draw(p->ui, frame))
return false;
pl_clock_t ts_ui_drawn = pl_clock_now();
log_time(&p->stats.render, pl_clock_diff(ts_rendered, ts_pre));
log_time(&p->stats.draw_ui, pl_clock_diff(ts_ui_drawn, ts_rendered));
p->stats.rendered++;
return true;
}
static bool render_loop(struct plplay *p)
{
pl_options opts = p->opts;
struct pl_queue_params qparams = *pl_queue_params(
.interpolation_threshold = 0.01,
.timeout = UINT64_MAX,
);
// Initialize the frame queue, blocking indefinitely until done
struct pl_frame_mix mix;
switch (pl_queue_update(p->queue, &mix, &qparams)) {
case PL_QUEUE_OK: break;
case PL_QUEUE_EOF: return true;
case PL_QUEUE_ERR: goto error;
default: abort();
}
struct pl_swapchain_frame frame;
update_colorspace_hint(p, &mix);
if (!pl_swapchain_start_frame(p->win->swapchain, &frame))
goto error;
// Disable background transparency by default if the swapchain does not
// appear to support alpha transaprency
if (frame.color_repr.alpha == PL_ALPHA_NONE)
opts->params.background_transparency = 0.0;
if (!render_frame(p, &frame, &mix))
goto error;
if (!pl_swapchain_submit_frame(p->win->swapchain))
goto error;
// Wait until rendering is complete. Do this before measuring the time
// start, to ensure we don't count initialization overhead as part of the
// first vsync.
pl_gpu_finish(p->win->gpu);
p->stats.render = p->stats.draw_ui = (struct timing) {0};
pl_clock_t ts_start = 0, ts_prev = 0;
pl_swapchain_swap_buffers(p->win->swapchain);
window_poll(p->win, false);
double pts_target = 0.0, prev_pts = 0.0;
while (!p->win->window_lost) {
if (window_get_key(p->win, KEY_ESC))
break;
if (p->toggle_fullscreen)
window_toggle_fullscreen(p->win, !window_is_fullscreen(p->win));
update_colorspace_hint(p, &mix);
pl_clock_t ts_acquire = pl_clock_now();
if (!pl_swapchain_start_frame(p->win->swapchain, &frame)) {
// Window stuck/invisible? Block for events and try again.
window_poll(p->win, true);
continue;
}
pl_clock_t ts_pre_update = pl_clock_now();
log_time(&p->stats.acquire, pl_clock_diff(ts_pre_update, ts_acquire));
if (!ts_start)
ts_start = ts_pre_update;
qparams.timeout = 0; // non-blocking update
qparams.radius = pl_frame_mix_radius(&p->opts->params);
qparams.pts = fmax(pts_target, pl_clock_diff(ts_pre_update, ts_start));
p->stats.current_pts = qparams.pts;
if (qparams.pts != prev_pts)
log_time(&p->stats.pts_interval, qparams.pts - prev_pts);
prev_pts = qparams.pts;
retry:
switch (pl_queue_update(p->queue, &mix, &qparams)) {
case PL_QUEUE_ERR: goto error;
case PL_QUEUE_EOF:
printf("End of file reached\n");
return true;
case PL_QUEUE_OK:
break;
case PL_QUEUE_MORE:
qparams.timeout = UINT64_MAX; // retry in blocking mode
goto retry;
}
pl_clock_t ts_post_update = pl_clock_now();
log_time(&p->stats.update, pl_clock_diff(ts_post_update, ts_pre_update));
if (qparams.timeout) {
double stuck_ms = 1e3 * pl_clock_diff(ts_post_update, ts_pre_update);
fprintf(stderr, "Stalled for %.4f ms due to frame queue underrun!\n", stuck_ms);
ts_start += ts_post_update - ts_pre_update; // subtract time spent waiting
p->stats.stalled++;
p->stats.stalled_ms += stuck_ms;
}
if (!render_frame(p, &frame, &mix))
goto error;
if (pts_target) {
pl_gpu_flush(p->win->gpu);
pl_clock_t ts_wait = pl_clock_now();
double pts_now = pl_clock_diff(ts_wait, ts_start);
if (pts_target >= pts_now) {
log_time(&p->stats.sleep, pts_target - pts_now);
pl_thread_sleep(pts_target - pts_now);
} else {
double missed_ms = 1e3 * (pts_now - pts_target);
fprintf(stderr, "Missed PTS target %.3f (%.3f ms in the past)\n",
pts_target, missed_ms);
p->stats.missed++;
p->stats.missed_ms += missed_ms;
}
pts_target = 0.0;
}
pl_clock_t ts_pre_submit = pl_clock_now();
if (!pl_swapchain_submit_frame(p->win->swapchain)) {
fprintf(stderr, "libplacebo: failed presenting frame!\n");
goto error;
}
pl_clock_t ts_post_submit = pl_clock_now();
log_time(&p->stats.submit, pl_clock_diff(ts_post_submit, ts_pre_submit));
if (ts_prev)
log_time(&p->stats.vsync_interval, pl_clock_diff(ts_post_submit, ts_prev));
ts_prev = ts_post_submit;
pl_swapchain_swap_buffers(p->win->swapchain);
pl_clock_t ts_post_swap = pl_clock_now();
log_time(&p->stats.swap, pl_clock_diff(ts_post_swap, ts_post_submit));
window_poll(p->win, false);
// In content-timed mode (frame mixing disabled), delay rendering
// until the next frame should become visible
if (!opts->params.frame_mixer) {
struct pl_source_frame next;
for (int i = 0;; i++) {
if (!pl_queue_peek(p->queue, i, &next))
break;
if (next.pts > qparams.pts) {
pts_target = next.pts;
break;
}
}
}
if (p->fps_override)
pts_target = fmax(pts_target, qparams.pts + 1.0 / p->fps);
}
return true;
error:
fprintf(stderr, "Render loop failed, exiting early...\n");
return false;
}
static void info_callback(void *priv, const struct pl_render_info *info)
{
struct plplay *p = priv;
switch (info->stage) {
case PL_RENDER_STAGE_FRAME:
if (info->index >= MAX_FRAME_PASSES)
return;
p->num_frame_passes = info->index + 1;
pl_dispatch_info_move(&p->frame_info[info->index], info->pass);
return;
case PL_RENDER_STAGE_BLEND:
if (info->index >= MAX_BLEND_PASSES || info->count >= MAX_BLEND_FRAMES)
return;
p->num_blend_passes[info->count] = info->index + 1;
pl_dispatch_info_move(&p->blend_info[info->count][info->index], info->pass);
return;
case PL_RENDER_STAGE_COUNT:
break;
}
abort();
}
static struct plplay state;
int main(int argc, char *argv[])
{
state = (struct plplay) {
.target_override = true,
.use_icc_luma = true,
.fps = 60.0,
.args = {
.preset = &pl_render_default_params,
.verbosity = PL_LOG_INFO,
},
};
if (!parse_args(&state.args, argc, argv))
return -1;
state.log = pl_log_create(PL_API_VER, pl_log_params(
.log_cb = pl_log_color,
.log_level = state.args.verbosity,
));
pl_options opts = state.opts = pl_options_alloc(state.log);
pl_options_reset(opts, state.args.preset);
// Enable this by default to save one click
opts->params.cone_params = &opts->cone_params;
// Enable dynamic parameters by default, due to plplay's heavy reliance on
// GUI controls for dynamically adjusting render parameters.
opts->params.dynamic_constants = true;
// Hook up our pass info callback
opts->params.info_callback = info_callback;
opts->params.info_priv = &state;
struct plplay *p = &state;
if (!open_file(p, state.args.filename))
goto error;
const AVCodecParameters *par = p->stream->codecpar;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(par->format);
if (!desc)
goto error;
struct window_params params = {
.title = "plplay",
.width = par->width,
.height = par->height,
.forced_impl = state.args.window_impl,
};
if (desc->flags & AV_PIX_FMT_FLAG_ALPHA) {
params.alpha = true;
opts->params.background_transparency = 1.0;
}
p->win = window_create(p->log, ¶ms);
if (!p->win)
goto error;
// Test the AVPixelFormat against the GPU capabilities
if (!pl_test_pixfmt(p->win->gpu, par->format)) {
fprintf(stderr, "Unsupported AVPixelFormat: %s\n", desc->name);
goto error;
}
#ifdef HAVE_NUKLEAR
p->ui = ui_create(p->win->gpu);
if (!p->ui)
goto error;
#endif
if (!init_codec(p))
goto error;
const char *cache_dir = get_cache_dir(&(char[512]) {0});
if (cache_dir) {
int ret = snprintf(p->cache_file, sizeof(p->cache_file), "%s/plplay.cache", cache_dir);
if (ret > 0 && ret < sizeof(p->cache_file)) {
p->cache = pl_cache_create(pl_cache_params(
.log = p->log,
.max_total_size = 50 << 20, // 50 MB
));
pl_gpu_set_cache(p->win->gpu, p->cache);
FILE *file = fopen(p->cache_file, "rb");
if (file) {
pl_cache_load_file(p->cache, file);
p->cache_sig = pl_cache_signature(p->cache);
fclose(file);
}
}
}
p->queue = pl_queue_create(p->win->gpu);
int ret = pl_thread_create(&p->decoder_thread, decode_loop, p);
if (ret != 0) {
fprintf(stderr, "Failed creating decode thread: %s\n", strerror(errno));
goto error;
}
p->decoder_thread_created = true;
p->renderer = pl_renderer_create(p->log, p->win->gpu);
if (!render_loop(p))
goto error;
printf("Exiting...\n");
uninit(p);
return 0;
error:
uninit(p);
return 1;
}
libplacebo-v7.349.0/demos/plplay.h 0000664 0000000 0000000 00000006607 14634577501 0016766 0 ustar 00root root 0000000 0000000 #include
#include
#include
#include
#include "common.h"
#include "pl_thread.h"
#define MAX_FRAME_PASSES 256
#define MAX_BLEND_PASSES 8
#define MAX_BLEND_FRAMES 8
enum {
ZOOM_PAD = 0,
ZOOM_CROP,
ZOOM_STRETCH,
ZOOM_FIT,
ZOOM_RAW,
ZOOM_400,
ZOOM_200,
ZOOM_100,
ZOOM_50,
ZOOM_25,
ZOOM_COUNT,
};
struct plplay_args {
const struct pl_render_params *preset;
enum pl_log_level verbosity;
const char *window_impl;
const char *filename;
bool hwdec;
};
bool parse_args(struct plplay_args *args, int argc, char *argv[]);
struct plplay {
struct plplay_args args;
struct window *win;
struct ui *ui;
char cache_file[512];
// libplacebo
pl_log log;
pl_renderer renderer;
pl_queue queue;
pl_cache cache;
uint64_t cache_sig;
// libav*
AVFormatContext *format;
AVCodecContext *codec;
const AVStream *stream; // points to first video stream of `format`
pl_thread decoder_thread;
bool decoder_thread_created;
bool exit_thread;
// settings / ui state
pl_options opts;
pl_rotation target_rot;
int target_zoom;
bool colorspace_hint;
bool colorspace_hint_dynamic;
bool ignore_dovi;
bool toggle_fullscreen;
bool advanced_scalers;
bool target_override; // if false, fields below are ignored
struct pl_color_repr force_repr;
enum pl_color_primaries force_prim;
enum pl_color_transfer force_trc;
struct pl_hdr_metadata force_hdr;
bool force_hdr_enable;
bool fps_override;
float fps;
// ICC profile
pl_icc_object icc;
char *icc_name;
bool use_icc_luma;
bool force_bpc;
// custom shaders
const struct pl_hook **shader_hooks;
char **shader_paths;
size_t shader_num;
size_t shader_size;
// pass metadata
struct pl_dispatch_info blend_info[MAX_BLEND_FRAMES][MAX_BLEND_PASSES];
struct pl_dispatch_info frame_info[MAX_FRAME_PASSES];
int num_frame_passes;
int num_blend_passes[MAX_BLEND_FRAMES];
// playback statistics
struct {
_Atomic uint32_t decoded;
uint32_t rendered;
uint32_t mapped;
uint32_t dropped;
uint32_t missed;
uint32_t stalled;
double missed_ms;
double stalled_ms;
double current_pts;
struct timing {
double sum, sum2, peak;
uint64_t count;
} acquire, update, render, draw_ui, sleep, submit, swap,
vsync_interval, pts_interval;
} stats;
};
void update_settings(struct plplay *p, const struct pl_frame *target);
static inline void apply_csp_overrides(struct plplay *p, struct pl_color_space *csp)
{
if (p->force_prim) {
csp->primaries = p->force_prim;
csp->hdr.prim = *pl_raw_primaries_get(csp->primaries);
}
if (p->force_trc)
csp->transfer = p->force_trc;
if (p->force_hdr_enable) {
struct pl_hdr_metadata fix = p->force_hdr;
fix.prim = csp->hdr.prim;
csp->hdr = fix;
} else if (p->colorspace_hint_dynamic) {
pl_color_space_nominal_luma_ex(pl_nominal_luma_params(
.color = csp,
.metadata = PL_HDR_METADATA_ANY,
.scaling = PL_HDR_NITS,
.out_min = &csp->hdr.min_luma,
.out_max = &csp->hdr.max_luma,
));
}
}
libplacebo-v7.349.0/demos/screenshots/ 0000775 0000000 0000000 00000000000 14634577501 0017643 5 ustar 00root root 0000000 0000000 libplacebo-v7.349.0/demos/screenshots/plplay1.png 0000664 0000000 0000000 00000061627 14634577501 0021747 0 ustar 00root root 0000000 0000000 ‰PNG
IHDR Á õ 1f ÐeXIfII*
Á õ † Œ ” ( 1
œ 2 ª i‡ ¾ H H GIMP 2.10.34 2023:07:30 21:27:15 _|³x „iCCPICC profile xœ}‘=HÃ@Å_S¥"‡v"’¡:ÙÅŠ8Ö*¡B¨Zu0¹ôš´$).Ž‚kÁÁŪƒ‹³®®‚ øâêâ¤è"%þ/)´ˆñà¸ïî=îÞB«Ê4³/hºedRI1—_¯`!D—™YŸ“¤4<Ç×=||½‹ñ,ïsŽ!µ`2À''Xݰˆ7ˆg6:ç}â0+Ë*ñ9ñ¤A$~äºâòç’ÃÏÙÌ