96 Commits

Author SHA1 Message Date
Martin Pulec
1d4754b681 tools/Makefile: compat - use :=
GNU Make 3.81 as in macOS 14 doesn't support the new ::= syntax, use
the legacy one.

(the ::= syntax is quite new, defined by POSIX v8 in 2024)
2026-03-04 09:04:52 +01:00
Martin Pulec
a22bc8f7e9 moved to_planar conversion from pixfmt_conv
this follows the recent similar change for from_planar
2026-03-04 09:04:52 +01:00
Martin Piatka
eff2cbbc84 tools/ipc_frame_ug: Add copyright header 2026-03-03 14:10:42 +01:00
Martin Piatka
ae24fa6159 tools/ipc_frame_ug: Remove config includes 2026-03-03 14:10:42 +01:00
Martin Pulec
cb5076b768 tools/Makefile: use pkg-config for libavcodec path
eg. when in non-system searched as on Mac with Homebrew
2026-02-27 16:07:14 +01:00
Martin Pulec
9d2dcc36d1 build: do not use -Ofast
-Ofast is basically -O3 + -ffast-math

But from my measurements (x64 gcc and arm64 clang), it doesn't make
any difference as tested with `tools/convert benchmark`. Actually,
currently almost no conversion uses floating point math except of
vc_copylineUYVYtoRGBA, for which the -ffast-math didn't have any
performance impact.
2026-02-27 16:07:11 +01:00
Martin Pulec
b93c6d12f0 tools/benchmark_ff_convs: updated to the new API
.from_planar_func needs to be set from conv metadata now
2026-02-27 09:49:19 +01:00
Martin Pulec
62e0ffacb5 tools/Makefile/benchmark_ff_convs: compile fix
after recent changes
2026-02-27 09:20:53 +01:00
Martin Pulec
7cd99c6a68 moved from planar conversions from pixfmt_conv
removed all ad hoc optimizations:
- -Ofast - removed by context (pixfmt_conv compiles with), _but_ see
previous commit - even in pixfmt_conv it was not actually used
- remove ALWAYS_INLINE + OPTIMIZED_FOR - from measurements it doesn't
seem to make some difference
2026-02-25 16:52:43 +01:00
Martin Pulec
77cf31e45a vdec/jpegxs: run the conversions in parallel
Since the decompression is synchronous, so that decompression and
conversion cannot interleaved, it is very useful to set the conversion
to be performed in multiple threads.

For 4K, the conversions may (to R12L or R10k) may take around 10 ms when
run in single thread, which makes it a bit hard for 60 FPS video (the
decompression must then take at most 6 ms).

To enable eg. 2160p60 video, make the decoders run in parallel.

As for now, just the conversions using generic decode_planar_func_t are
parallelized. Eveutally all conversions would use this API.
2026-02-25 16:52:42 +01:00
Martin Pulec
9ca0cce5f9 tools/benchmark_ff_convs.c: fix color.h rename 2026-02-20 15:24:07 +01:00
Martin Pulec
434d23ddd6 color.{c,h}: rename to color_space
color is too much general - the declarations relate to color spaces
2025-10-08 15:19:36 +02:00
Martin Piatka
7b44acee22 tools/ipc_frame: Fix color_spec selection 2025-07-17 13:59:28 +02:00
Martin Pulec
e8cd71b259 vcap/import: IWYU + aligned_malloc compat 2025-03-25 09:17:13 +01:00
Martin Pulec
e2b42a3c03 add tools/mux_ivf
refers to GH-434
2025-03-13 09:14:35 +01:00
Martin Pulec
e868262f5d from_lavc_vid_conv: handle full-range input
If CS conversion is done, handle also full-range input. This shouldn't be
the case most of the time (we use always limited range) but the case that
is handled is namely a JPEG from a webcam or so, which is 601
limited. Full YCbCr->YCbCr is not handled by this commit.
2024-10-08 16:12:34 +02:00
Martin Pulec
5a6fb12536 tools/benchmark_ff_convs: follow API update
also ug_stub needs some more stuff
2024-10-08 15:04:35 +02:00
Martin Pulec
34c72bf55b from_lavc_vid_conf: pass params in struct to conv
This will make easier further changes.

Also it is somehow more readable (although the amount of code is actually
200 lines more).
2024-10-02 16:31:57 +02:00
Martin Pulec
bdce8d7ae8 tools: add ug_stub.c to substitute host.cpp
Because host.cpp has extensive dependencies on UG internals, it is a
bit tricky to link-in. Created a replacement instead.
2024-09-30 11:07:37 +02:00
Martin Pulec
4542f9d1c6 tools/benchmark_ff_conv: add bench for from_lavc 2024-09-27 17:06:18 +02:00
Martin Pulec
fa0412b121 tools: add benchmark_ff_convs (only to_lavc now) 2024-09-27 17:06:17 +02:00
Martin Pulec
1a118aea3b color.c,pixfmt_conv.c: do not hard-code the coeffs
Start rewrite with coefficients not hard-coded in the macro. For the
beginning, the new implementation used in pixfmt_conv.o. From
the performance evaluation it doesn't have impact on performance
(`tools/convert benchmark`).
2024-09-27 17:06:16 +02:00
Martin Pulec
01e4d1b432 tools/convert benchmark: convert per-line
The measured performance should more representative because it
approximates more closely how it is done in UltraGrid.
2024-09-26 14:30:11 +02:00
Martin Pulec
5c311cebd1 tools/Makefile: use -Ofast by default
For the benchmark, we use -Ofast in UltraGrid so make it the same.

It won't break anything for the rest of the objects so make it default
instead of writing a custom rule for pixfmt_conv.o.
2024-09-26 14:05:55 +02:00
Martin Pulec
ef0a820048 tools/Makefile: set -msse4.1 for x86_64
to match UG (usual) defaults
2024-09-26 10:02:12 +02:00
Martin Pulec
450cb6c2dc tools/Makefile: really delete the .o files
The .o files are no longer directly in the root of tools/ but in the
respective subdirectories as in sources in src/. Used find command
instead of wildard because the objects may be deeper in src/.
2024-09-26 09:12:29 +02:00
Martin Piatka
b2c79c2fda tools/Makefile: Remove sse4.1 flag
So that compilation on ARM keeps working
2024-07-02 12:56:57 +02:00
Karel Šebela
3cde2f1ba0 pixfmt_conv.c: RGB <-> RGBA SIMD
Reduces time per 4k frame from 9 ms to about 5 ms.
2024-07-02 12:56:16 +02:00
Martin Pulec
c7bc7962aa tools/Makefile: moved "all" as a first rule
to rum `make all` as a default target (without arguments to make)
2024-03-22 16:24:01 +01:00
Martin Pulec
d3f0802e53 tools/stacktrace_addr2line.sh fixed parsing
backtrace_symbols has slightly different output than backtrace_symbols_fd:
```./build/bin/uv(+0x24d92)[0x7b9c947ad92]```

In the first, there is a space between `(+0x24d92)` and `[0x7b9c947ad92]`:
```./build/bin/uv(+0x24d92) [0x7b9c947ad92]```

so support both syntaxes (the absolute address is ignored anyways,
there were just missing quotes around a variable)
2023-11-13 16:48:22 +01:00
Martin Pulec
c14ad5f95e pixfmt_conv.h: small doxy update
\+ added some direct pixfmt_conv.h includes (in attempt to remove its
inclusion from video_codec.h, which finally didn't take place but still
it is better to include this directly)
2023-11-13 10:27:09 +01:00
Martin Pulec
96373a1e73 tools/convert: support for storing PNM/Y4M 2023-11-09 16:00:21 +01:00
Martin Piatka
b6cf85e855 tools/astat: Variable channel count support 2023-10-11 12:39:08 +02:00
Martin Piatka
1208184187 tools/astat: Add missing include guard 2023-10-11 12:39:08 +02:00
Martin Pulec
9fb2c63257 ipc_frame_unix.cpp: print init errors 2023-08-22 10:47:06 +02:00
Martin Pulec
d17c5ea24c removed platform_time.c + references
get_time_in_ns() should be used instead time_since_epoch_in_ms(). Having
both may be misleading and may lead to errors when interchanged.
2023-08-08 15:32:29 +02:00
Martin Piatka
956e5917d9 ipc_frame_unix: Use unique_ptr instead of raw 2023-07-25 16:47:23 +02:00
Martin Piatka
cb07eb354f ipc_frame: Add _hq version of ipc_frame_from_ug_frame
This version does the pixel conversion first before scaling to avoid
artifacts due to big block size of source pixel format. Significantly
slower.
2023-06-27 15:36:15 +02:00
Martin Piatka
2395f379b8 ipc_frame_ug: Respect horizontal alignment when scaling 2023-06-20 12:17:53 +02:00
Martin Piatka
56a0708343 tools/thumbnailgen: Configurable fps 2023-06-16 13:43:03 +02:00
Martin Piatka
ce2a3eca46 tools/thumbnailgen: Don't busywait for connection 2023-06-16 13:43:02 +02:00
Martin Piatka
2651e5caf5 tools/ipc_frame_unix: Add blocking wait for connect 2023-06-16 13:43:02 +02:00
Martin Piatka
f4360d107d tools/thumbnailgen: Don't reinitialize jpeg ctx on each frame 2023-06-16 13:43:02 +02:00
Martin Piatka
a01475050c tools: Add preview thumbnail generator 2023-06-16 13:43:01 +02:00
Martin Pulec
6ae7f268f0 video_codec: moved pixfmt convs to a separate file
Just the conversions grew to a significant amount so it is better to
split the file to two to keep the general video codec utility functions
in one file and the conversions in the another.
2023-03-16 14:26:22 +01:00
Martin Pulec
bb709aabe1 tools/Makefile updates: build in current directory
Build even UG obj files in tools/ subdirectory if make called there
(because color_out.o builds differently for `convert` and `uv` not to be
used interchangeably).

- supported also out-of-tree build when SRCDIR was passed, eg.:

      mkdir build && cd build
      make -f ../tools/Makefile SRCDIR=.. convert

+ decklink_temperature to gitignore
2022-11-22 14:50:25 +01:00
Martin Pulec
62f143f939 config_common.h: removed macros.h include 2022-11-22 14:50:19 +01:00
Martin Pulec
46c9c04461 tools/convert: help updates
Added basic description & return 0 if help was requested.
2022-11-22 11:49:06 +01:00
Martin Pulec
579389cebc tool/convert: compilation fixes
- moved macros to utils/macros.h (not config_common.h that is not going
  to be included) and include in config_common.h the macros.h file
  instead (later it should be removed)
- avoid dependency of color_out.o on host.o if build outside UG (easiest
  for now)
- compile tools with '-g' (obviously for better debuggability)
2022-11-22 10:34:37 +01:00
Martin Pulec
9135d4fc72 tools/convert: fixed a message 2022-11-22 10:23:04 +01:00