Commit Graph

7684 Commits

Author SHA1 Message Date
Martin Pulec
ab008cc0b6 vdec/lavd: do not pass widht/height
already member ov AVFrame
2024-10-02 16:31:57 +02:00
Martin Pulec
dc96946582 vdec/lavd: print warning on unspported cs/range 2024-10-02 16:31:57 +02:00
Martin Pulec
9c5015661f lavd: override JPEG color-space to BT.701
FFmpeg returns always bt470b, even with GPUJPEG SPIFF JPEGs (only the
color_range can be either tv or pc depending if sender sets range as
JPEG or MPEG - we're setting MPEG for YCbCr always).

Also alter the JPEG message.
2024-10-02 16:31:57 +02:00
Martin Pulec
2448f92bea vdec/lavd: print codec characteristics in verbose 2024-10-02 16:31:57 +02:00
Martin Pulec
792c06d4f6 vcomp/lavc: set limited-range BT.601 for QSV 2024-10-02 16:31:54 +02:00
Martin Pulec
fc6efc9a5b vcomp/lavc: remove unneeded code
The same assignment is later in the get_av_pixfmt_details() call (this
is the relict from the times when function was implemented differently
- 23ca8f37).
2024-09-30 15:26:01 +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
9adf7b6101 compat/htonl.->compat/net.h
It can be used in place of other network-related headers, not just for
htonl and family.

+ compat for fd_t and INVALID_SOCKET (that has been in config_*.h)
2024-09-30 10:54:14 +02:00
Martin Pulec
745c7f9aee support conversions with BT.601 chromicities
Added experimental support for conversions with BT.601 primaries. The
command-line interface will most likely change.
2024-09-27 17:14:13 +02:00
Martin Pulec
7d5b94af9d pixfmt_conv.c,video_codec.c: updated Doxy 2024-09-27 17:06:29 +02:00
Martin Pulec
16cfc6a3e2 color.c: generalize the macros
do not assume just BT.709 coefficients
2024-09-27 17:06:29 +02:00
Martin Pulec
7168c8763b color.h: rm no longer needed macros (_709_SCALED)
+ moved the coefficient computing ones to color.c
2024-09-27 17:06:18 +02:00
Martin Pulec
6e9339133b fixed the test to use new coeffs API
+ wrap the function with obligatory extern "C" for C++ code (as the
test is)
2024-09-27 17:06:18 +02:00
Martin Pulec
b3a5cdb309 from_lavc_vid_conv: use generic coeffs 2024-09-27 17:06:18 +02:00
Martin Pulec
4542f9d1c6 tools/benchmark_ff_conv: add bench for from_lavc 2024-09-27 17:06:18 +02:00
Martin Pulec
e0ad7892aa to_lavc_vid_conv_init: assert thread_count>0
0 (auto) is not accepted by this function
2024-09-27 17:06:18 +02:00
Martin Pulec
4f613d6a50 get_color_coeffs: copy the pointed struct
to allow the compiler better optimize (see Doxy note for
get_color_coeffs())
2024-09-27 17:06:17 +02:00
Martin Pulec
5a08f9a78f to_lavc_vid_conv: use generic coefficients 2024-09-27 17:06:17 +02:00
Martin Pulec
6163404319 copylineYUVtoRGB: use generic coefficients 2024-09-27 17:06:17 +02:00
Martin Pulec
b0d0be803a vc_copylineToUYVY: manually unroll
GCC seems to need it (now). Note that inner loop with #pragma unroll
doesn't seem to work.

Seems to slightly improve the performance on AMD Ryzen 9 7900X, otherwhere
it seems to be the same. Combining 2 or 4 items in one iteration gives
similar performance so picking 2; 8 is significantly worse.
2024-09-27 17:06:17 +02:00
Martin Pulec
8f91839d80 vc_copylineToUYVY: macro to inline function
only refactor

The loop body keeped as a macro for further reuse.
2024-09-27 17:06:16 +02:00
Martin Pulec
0c456e9723 vc_copylineToUYVY709: use global coefficients
Do not hard code them + drop 709 suffix (we no longer know what
coefficinets those are).
2024-09-27 17:06:16 +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
0483f34375 color.h: YCbCr->RGB: also correctly round coeffs
rounded when converting to int
2024-09-27 17:06:16 +02:00
Martin Pulec
2f450060cc color.h: give up clamp for limited value
The [document] referenced in the header is far from being strict in this
respect. The values that were clamed to was Nominal Video Range. At
the same time, the Preferred Min./Max. is significantly lower/higher
(16-235 vs 5-246 for 8 bit). This value can be understood as a "soft"
limit while the Total Video Signal Range (1-254) as a hard limit.

Some decoders (FFmpeg HEVC) overshot the nominal values, anyways.

[document]:
https://tech.ebu.ch/docs/r/r103.pdf
2024-09-27 17:06:16 +02:00
Martin Pulec
4fe65769f0 color coeff computing updates
Mainly depth is included in Y_ and CBCR_LIMIT - the used denominator
255.0 matched only 8 bits.

Add (substract) epsilon 0.5 when converting the to integer to round the
value correctly.
2024-09-27 17:06:15 +02:00
Martin Pulec
cad561ead6 from_lavc_vid_conv: yuv444p10le_to_rgb - in 10b
copute in 10 bits, not 8

+ substracted Y floor from Y, which was not before
2024-09-27 17:06:15 +02:00
Martin Pulec
7135b63fe2 vrxtx/rtp: display_buf_increase_warning improved
- print the buffer size with more human-readable SI-prefix. The value is
repeated later twice, anyways.
- print correctly sysctl item in macOS (was net.core.rmem_max in text,
although later correctly in the command net.inet.udp.recvspace)

Also use positional parameters for printf (more readable here). Early
return for _WIN32.
2024-09-27 17:05:08 +02:00
Martin Pulec
707e4af458 get rid of WORDS_BIGENDIAN
WORDS_BIGENDIAN is defiend by config.h

Use __BYTE_ORDER__  defined by GNU compilers (POSIX 2024 further defines
endian.h header but not yet in macOS /15/),
2024-09-26 14:36:42 +02:00
Martin Pulec
3e791253b4 MSG(): check log_level early
Improve MSG() in a way that LOG() is - check the log_level first and if
not printed, just skip. Previously the eventual arguments were evaluated
and also log_msg() was called (althoug exitted immediately).
2024-09-26 10:02:12 +02:00
Martin Pulec
3501981441 testcard_common: print if cannot convert
Instead of just aborting on assert for `-t testcard:c=DVS10` print at
least a user-friendly message.

+ in debug verbosity print the same message in get_decoder_from_to() if
returning NULL (to be used in similar cases when the returned NULL is
poorly handled)
2024-09-26 10:02:11 +02:00
Martin Pulec
4045ad0d08 pixfmt_conv: include directly used headers
not through config*.h

+ use __BYTE_ORDER__ (defined by GNU compiler) instead of
WORDS_BIGENDIAN. POSIX 2024 standardizes endiah.h but not yet present
on macOSes.
2024-09-26 10:02:11 +02:00
Martin Piatka
b09d76bcd3 video_display/file: Fix crash on init
VIDEO_CODEC_NONE would get passed through get_available_pix_fmts() to
get_pixfmt_desc() and fail on assert
2024-09-25 15:03:40 +02:00
Martin Piatka
fa4798f2b6 rtp/video_decoders: Report new incoming fmt on control port 2024-09-25 12:44:07 +02:00
Martin Piatka
4ff98951a1 rtp/audio_decoders: Report new incoming fmt on control port 2024-09-25 12:44:06 +02:00
Martin Pulec
bbcb4a7937 vdisp/sdl2: fixed a leak
reported as CID 469287
2024-09-24 12:38:50 +02:00
Martin Pulec
970475c3f5 video_decoders: rm libavcodec/defs.h inc by mistake
Added unintentionally with IWYW but the older versions of
libavcoded didn't have the header (and had it included directly in
libavcodec/avcodec.h that is included later).
2024-09-24 08:11:00 +02:00
Martin Pulec
264d40af94 RTP: print bound ports in verbose
Until now, in verbose mode was printed the dynamically selected port
pair. But the knowledge should be useful also to ensure the ports where
it doesn't need to be clear, eg. in server mode or for receiver to see
that 5004 is indeed bound.
2024-09-23 14:11:08 +02:00
Martin Pulec
c572e20959 vdisp/sdl2: removed param sdl2-r10k
It didn't seem that R10k worked for anyone before 18th Sep (commit
3c9e2602) because bit shuffling is needed (r10k_to_sdl2()).

Also the negative meaning (=no), which has been added just in the last
week commit can be replaced with '--param decoder-use-codec='!R10k'`.
2024-09-23 14:11:07 +02:00
Martin Pulec
ccfbd9b03b video_decoders: allow display codec blacklist
using param decoder-use-codec with an exclamation mark
2024-09-23 14:11:07 +02:00
Martin Pulec
b52bf7b991 video_decoders: improved including 2024-09-23 14:11:07 +02:00
Martin Pulec
36d5affe8e video_decoders: use PADDING not MAX_PADDING
But set the padding as the maximum of AV_INPUT_BUFFER_PADDING_SIZE
(if there is include) and MAX_PADDING (both are currently 64).

Use __has_include() instead of HAVE_LIBAVCODEC_H.
2024-09-23 14:11:03 +02:00
Martin Pulec
e1b37950ca vcap/aggregate: improved includes
avoid including config*.h
2024-09-20 16:09:41 +02:00
Martin Piatka
2798cfb5f8 capabilities: Report placeholder text for codec options 2024-09-20 15:33:22 +02:00
Martin Pulec
be0b38e647 vdisp/sdl2: handle R10k as other pixfmts 2024-09-18 16:03:43 +02:00
Martin Pulec
3a238de998 vdisp/sdl: R10k conversion optimized
Create inner loop with fixed amount of iterations (16). This will allow
the compiler to unroll the inner loop and vectorize (16 iterations per
4 bytes is 512b allowing up to 512b instructions).

The eventual rest (%16 != 0) is computed per pixel as it used to be..
2024-09-18 14:35:48 +02:00
Martin Pulec
70e169db3f utils/misc: improved including 2024-09-18 14:35:48 +02:00
Martin Pulec
3c9e260240 vdisp/sdl2: enable R10k
Seem to be working now (but requires a byte swap for the R10k pixels
values).

refer to GH-412
2024-09-18 14:34:57 +02:00
Martin Pulec
7b3953615b vdisp/sdl2: putf - early return on poison pill 2024-09-18 10:30:56 +02:00
Martin Pulec
78fa125ff8 vdisp/sdl2: if [WAYLAND_]DISPLAY undef, use KMSDRM
If neither DISPLAY nor WAYLAND_DISPLAY environment variable is defined,
set driver=KMSDRM by default in Linux.
2024-09-17 14:37:51 +02:00