Commit Graph

9888 Commits

Author SHA1 Message Date
Martin Pulec
30bceebdba pbuf: rename loss_pct to recv_pct
the number tells actually the percent of received pckts, not lost
2024-10-16 11:06:07 +02:00
Martin Pulec
d2bac1f926 pbuf, pdb: improved including
include-what-you-use
2024-10-16 10:51:24 +02:00
Martin Pulec
bf39e121af CI FFmpeg Linux: updated libde265 patch
remove FFCodec.init_static_data - dropped from upstream but not used by
libde265 plugin anyways
2024-10-16 09:45:13 +02:00
Martin Pulec
550cfb5d8a CI Linux FFmpeg: use GH mirror
Since the CI is run on GH, this will lower risk of fails due to
eg. external outage. Also it is possible that the clone will be slightly
faster.
2024-10-16 09:31:11 +02:00
Martin Pulec
4c8f4b32f2 CI Linux FFmpeg: compat vaapi patch update 2024-10-16 09:11:50 +02:00
Martin Pulec
3d0cf25ab9 jpeg_reader: check comp_count validity
+ piggyback switch error msg from verbose (it will fail so the error
just in verbose doesn't make much sense)
2024-10-15 16:20:06 +02:00
Martin Pulec
36f427485f CI Linux: add deb-src in U24.04
ubuntu-latest is now U24.04, which uses .source files in deb822 format
instead the original .list in one-line-style format. ubuntu-latest is
used by Coverity runner.
2024-10-15 16:19:54 +02:00
Martin Pulec
91819d289d jpeg_reader: read_adobe_app14 fix
the terminating NUL byte was not read - the tag is 'Adobe\0'

+ mark length as const as it won't change later
2024-10-15 16:13:44 +02:00
Martin Pulec
47b1b8c871 jpeg_reader: bound-check all marker read fns 2024-10-15 16:13:44 +02:00
Martin Pulec
1c61070f91 CI Linux: use libcurl4-openssl-dev instead of NSS
Needed for coverity-scan newly builds on ubuntu-latest (currently
24.04). Ubuntu 24.04 has no longer libcurl4-nss-dev.
2024-10-15 16:13:44 +02:00
Martin Pulec
e102b79600 jpeg_reader: replaced read_marker
replaced old read_marker with bound-checking (former) read_marker_new
2024-10-15 16:13:44 +02:00
Martin Pulec
9531c04a23 jpeg_reader: sanitize input
Sanitize incorrect marker lengths for SOS and SOF0 as reported by Coverity
CID 469656. Utilized image_end sentinel as in GPUJPEG.
2024-10-15 16:13:37 +02:00
Martin Pulec
50b7207b5d add README.hdml to legacy macOS dmg
Redirects to a wiki page informing how to allow unsigned UG build
(alternative builds are not signed).
2024-10-15 09:37:45 +02:00
Martin Pulec
2b62857dea vdisp/ndi: set stride explicitly
The documentation in header for
NDIlib_video_frame_v2_t.line_stride_in_bytes says that if set to 0,
default value (size of pixel * bpp) will be used.

However, this doesn't seem to work for P216 and PA16 in Windows. It does
in Linux, also 8-bit formats do not require that. However in Windows,
it causes "No data received.".

see also GH-148
2024-10-14 16:27:05 +02:00
Martin Pulec
3e52ae4eab vdisp/ndi: safe syncs 2024-10-14 15:40:45 +02:00
Martin Pulec
b840e0a1a8 ndi_common: add mac fallback path to NDI Tools
Compared to MSW, NDI doesn't set neither the NDI_RUNTIME_DIR_V6
environment variable nor doesn't have "global" runtimne installation path.

The dylib is, however, included dirctly inside individual applications'
bundles. Most of the NDI Tools apps use libndi_advanced.dylib but some
(including the used NDI Launcher) uses libndi.dylib.
2024-10-14 14:49:09 +02:00
Martin Pulec
d1e510f3d7 ndi_common [Win]: add also Tools\Runtime fallback
In the [wiki], for macOS and Windows, NDI Tools installation is advised,
which does bring its own NDI Runtime, but in a different path. So adding
it for Windows.

[wiki]: https://github.com/CESNET/UltraGrid/wiki/NDI
2024-10-14 14:49:09 +02:00
Martin Pulec
b3c89e34d2 ndi_common: unify loader for Win and mac/Linux
Always try the list of libraries. Also replace FALLBACK_NDI_PATH with
_PATHS which now can contain comma-delimited list of libraries.
2024-10-14 14:49:04 +02:00
Martin Pulec
055e751101 vcap/ndi: handle source disconnect 2024-10-14 10:33:19 +02:00
Martin Pulec
68239316c0 vcap/ndi: partial name matching updated
- allow also matching for machine name (case-insensitive) in addition
to source name
- document it in help
- various improvemetnts: includes, the partial matching is now done in
a separate loop and without c++ regexes (readabilitz)
2024-10-14 10:33:16 +02:00
Martin Pulec
d9fef1ac32 vcap/ndi: ndi_disp_convert_Y416_to_PA16 fix 2024-10-11 16:31:38 +02:00
Martin Pulec
f12577f0b9 fix vc_copylineRG48toY216
incorrectly braced

Actually not obvious until 2f450060 (2024-09-24) because the chroma x1.5
was used but clamped, which has somehow hidden that.
2024-10-11 16:14:00 +02:00
Martin Pulec
fd08c583eb improved including in few files 2024-10-11 16:13:39 +02:00
Martin Pulec
c96a167d08 configure.ac: check the header in MSW as well 2024-10-11 14:36:39 +02:00
Martin Pulec
2b022dd1d8 ndi_common.h: lib loading debug messages
print NDI lib loaded path
2024-10-11 14:06:55 +02:00
Martin Pulec
5ce4e45d12 ndi_common.h: simplify - use static cstr length 2024-10-11 14:06:54 +02:00
Martin Pulec
9c18c7e8e7 vdisp/ndi: refactor init
Use parse_fmt and do not use cumbersome pseudo-C++ exceptions imitation.
2024-10-11 14:05:28 +02:00
Martin Pulec
b9c012737f jpeg_reader: add additional SPIFF CS
Add all color space parameter specifications from T.81 - map known ones,
add commented-out case for the rest.
2024-10-09 15:08:52 +02:00
Martin Pulec
f2d2fcdb8d jpeg_reader: support for spiff pictures
+ hint for GPUJPEG to set limited 601
2024-10-09 15:08:52 +02:00
Martin Pulec
73fbec1c8c from_lavc_vid_conv: small refactor
Pass less data in convert_task_data and rather copy relevant
AVFrame properties to AVFrame parts. Compute then the properties in
do_av_to_uv_convert.
2024-10-09 15:08:52 +02:00
Martin Pulec
3b3a34a99a from_lavc_vid_conv: lmt_rng=1 for full-r. src RGB
Set lmt_rng=0 for full-range src YCbCr only - the color conversions are
used for both (src) YCbCr->RGB and RGB->YCbCr (perhaps less often). In
the second case, the input is full-range so that output YCbCr would be
full-range YCbCr 709. which is incorrect.
2024-10-09 15:08:52 +02:00
Martin Pulec
94abcab830 gh/scripts/download-gh-asset.sh: use $GITHUB_TOKEN
Use $GITHUB_TOKEN if provided (it is in the CI) to get around API rate
limiting (it already is used by the curl calls made by fetch_json
function).
2024-10-09 15:08:49 +02:00
Martin Piatka
6475aa7358 vdisp/multiplier: Copy frame metadata
The metadate is useful in some cases like the decklink synchronized
mode. Fixes GH-419
2024-10-09 10:16:34 +02:00
Martin Pulec
36c47a697a CS_{601,709}: drop _LIM suffix
Since we (currently) use the same value for full-range (setting
ycbcr_bit_depth=0) this may be confusing.
2024-10-08 16:16:15 +02: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
14554b8777 moved internal macros from color.h to .c 2024-10-08 15:18:23 +02:00
Martin Pulec
5daca13530 GL: compute coeffs dynamically 2024-10-08 15:14:13 +02:00
Martin Pulec
3f813d5a2d color: store also Y_SCALE in coeffs 2024-10-08 15:06:23 +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
6b7422e56a vdec/gpujpeg: toggle on itu601->709 override
If the JPEG is interpreted as FFmpeg encoded limited range 601
(CS=ITU601), override the CS to BT.709 (UG encodes BT.709).
2024-10-08 14:35:30 +02:00
Martin Pulec
49604293e5 vdec/lavd: override colorspace only for FF JPEGs
Check if range is MPEG and CS=BT470GB (JPEG compressed with FFmpeg in
UltraGrid). Otherwise do not override the props - JPEGs from webcamse
etc. that almost certailny have the JPEG (full) range.
2024-10-08 14:26:23 +02:00
Martin Pulec
88d8769524 vdisp/sdl2: set BT709 conversions explicitly
(if BT601 is not set by --param)

The default value is SDL_YUV_CONVERSION_AUTO, which is 601 for SD and 709
for HD. UltraGrid doesn't distinguish and implictly assumes 709 always
(although 601 for SD makes sense).
2024-10-08 13:53:08 +02:00
Martin Pulec
a0f8794153 vdec/gpujpeg: include directly used sys headers
do not use config*.h
2024-10-08 12:35:24 +02:00
Martin Pulec
3aa91f67ad vcomp,vdec/gpujpeg: toggle on profiling in debug
If log_level >= LOG_LEVEL_DEBUG, set the perf_stats option, which with
current GPUJPEG prints the performance stats to stdout.
2024-10-08 12:32:02 +02:00
Martin Pulec
22e9b7cfee import: accept video.info written by Win in *nix
In MSW it seems like the video.info is written in text mode, so that line
ending is CRLF. When read in POSIX systems, \r is not consumated so that
expect it can be present.
2024-10-08 12:32:02 +02:00
Martin Pulec
5471e80497 removed MJPG codec_t
Remove MJPG codec_t which was complementary to JPEG. The difference was
that JPEG was used for JPEG with restart intervals and MJPG without.

But slices are now enabled for MJPG (emits reset marker every 16 lines)
which actually gives the GPUJPEG decoder a space for efficient decoding.

Measured decoding performance using Ryzen 7900X and RTX 4080:

NewZealand (UYVY, 3840x2160, frame 2500):

  encoded by\decoded by  GPUJPEG  lavd
  -c libavcodec          7.1 ms   19 ms
  -c gpujpeg             1.35 ms  14.3 ms

-t testcard:s=3840x2160:patt=text

  encoded by\decoded by  GPUJPEG  lavd
  -c libavcodec          2 ms     40 ms
  -c gpujpeg             25 ms    40 ms

The advantage is simpler maintanance (no need to handle 2 codec
identifiers) and also performance because from the above, the  GPUJPEG
decode should be faster even for JPEGs encoded by lavc.

Only situation where lavd performs better is a stream without restart
intervals at all (either `-c lavc:slices=1`, `-c gpujpeg:r=0` or from
a webcam), let say 28 ms for lavd and 40 for GPUJPEG. But it is not worth
keeping it for such a case - it will be better implemented using struct
pixfmt_desc to return rst count and picking the decoder according to
this if really needed.
2024-10-08 12:32:02 +02:00
Martin Pulec
0cc939da56 from_lavc_vid_conv: full-range warn once
As this can occur if the source is eg. a webcam-compressed JPEG and
cannot be easily work-arounded, print the warning just once.

Also update the message - it is not problem that is not being unsupported
but clipping the values (also redundant "may", because we can be sure).
2024-10-08 12:32:02 +02:00
Martin Pulec
4e13bc903c add MSG_ONCE
refer to GH-411
2024-10-08 12:31:59 +02:00
Martin Pulec
d693e74068 vcapf,vopp/matrix2: supp fmts converted over Y416
+ do not print the BT.601 hint if matrix with 601->709 conv used
2024-10-03 15:13:37 +02:00
Martin Pulec
f08f56f6b5 vcapf,vopp/matrix: hint to use matrix2 + improve
Hint to use matrix2 - matrix (1) is somehow special, especially when
handling UYVY that is handled (historically) very unorthodoxly - after
matrix applied, marked as RGB (YUV expanded to 4:4:4).

also improved including (IWYU)
2024-10-03 15:13:37 +02:00