Commit Graph

9748 Commits

Author SHA1 Message Date
Martin Pulec
ef0cd7130d unify stod/stoi invalid_argument::what parse
This is a hack to check whether given invalid_argument message belongs
to stoi/stod. It is usually used to catch non-numeric user input where
a number was expected.
2024-09-13 15:35:44 +02:00
Martin Pulec
ab25c2d1fc audio volume format: delimiting '/' unformatted
it very slightly helps readibility
2024-09-13 15:35:44 +02:00
Martin Pulec
86e218f40a audio/utils: improved including 2024-09-13 15:35:44 +02:00
Martin Pulec
6aed0ee771 audio: unify volume statistics formatting 2024-09-13 15:35:42 +02:00
Martin Pulec
414a333041 vcomp/cmpto_j2k: print CUDA support in usage 2024-09-13 15:23:33 +02:00
Martin Pulec
1e9d6ded84 vcomp/cmpto_j2k: add units to summary
In the previous commit just SI prefixes were printed.
2024-09-13 08:26:29 +02:00
Martin Pulec
db348ae9e5 vcomp/cmpto_j2k: print used parameters 2024-09-12 16:35:58 +02:00
Martin Pulec
0a8467b01f vcomp/cmpto_j2k: print opt hint in help
+ use unit_evaluate_dbl (instead of unit_evaluate) - **also** in decompress
2024-09-12 16:35:57 +02:00
Martin Pulec
ff1d9f3e9f vcomp/cmpto_j2k: accept opt prefixes 2024-09-12 16:35:57 +02:00
Martin Pulec
dfda8de842 vcomp/cmpto_j2k: advertise -O j2k-enc-cpu-conv
The GPU conversion should be better choice in general. The situation
where it can be useful is when the GPU is working hard to manage the
compression alone so that deploying on CPU saves some performance for
the encoder.
2024-09-12 16:35:57 +02:00
Martin Pulec
34b6ffbaa7 configure.ac: lavc cuda conv check improvement
- assume the feature, not cuda, when ensuring
- improved the message what can be wrong
2024-09-12 16:35:57 +02:00
Martin Pulec
92565ca2ae vcomp/cmpto_j2k: run GPU conv as prepreprocess
Set the pixfmt conversion CUDA kernel as cmpto_j2k_enc preprocessor,
not run directly.

This also eliminates to need to have the conversion kernel if conversion
is needed - CPU conversion will be sufficient. Currently not effective,
only R12L is converted for which there is the kernel.

refer to GH-406
2024-09-12 16:35:41 +02:00
Martin Pulec
caacebca37 vcomp/cmpto_j2k: allow late (lazy) initialization
Initialize the encoder stuff in configure_with, not _init.

It will allow the encoder parameter changes during the
reconfiguration. This will, however, require additional syncrhonization
and cleanup on the reconf.

There is no functional change in this commit but it changes the internal
behavior, namely the codec state is destroyed on reconfiguration and
newly created.
2024-09-12 15:06:00 +02:00
Martin Pulec
9b9105f6ae tx audio R-S warning: use the correct max_len
The data_len var used to compute packet_count may be lesser than its
initial value (tx->mtu - hdrs_len) because it might have been decreased
to number of remaining bytes of the last packet.

Returned back data_len to the do-loop and compute the value as
max_len.
2024-09-11 15:28:30 +02:00
Martin Pulec
8ff8a78592 tx audio: warn if Reed-Solomon is inadequate
refer to GH-408
2024-09-11 14:48:52 +02:00
Martin Pulec
215b823861 Reed-Solomon: add defaults for audio
For unsompreesed audio, where it has only the advantage, set default
R-S values to k=160 n=240 (50 % redundancy).

For uncompressed audio, the number of packets per frmae start at 3
(for 16-bit 30p), for which the value is appropriate. Not for the
audio captured at 60 Hz, however. Here it, is 1600 B with 16-bit samples,
with the R-S FEC this yields 2 packets only.
2024-09-11 13:11:09 +02:00
Martin Pulec
5bae31fb81 fec.cpp: include-what-you-use
+ replace `using namespace std` with individual items
2024-09-11 12:27:07 +02:00
Martin Pulec
19aa9803f2 fec/RS+LDGM: print setting when init
The values may not be set explicitly by the user so print the info.
2024-09-11 11:24:48 +02:00
Martin Pulec
002bb4dc7f tv.h (+others): get rid of NS_IN_MS[_DBL]
Use rather the more comprehensible NS_TO_MS and NS_TO_MS function-like
macros (obvious from what to what the conversion is performed).
2024-09-10 16:40:29 +02:00
Martin Pulec
0b5a3dc517 vcec/lavd: fixed check_duration arg
Actually the original value should have triggered the warning almost
always when there is RGB->YCbCr or YCbCr->RGB conversion. Seemingly it
doesn't happen often.
2024-09-10 16:28:21 +02:00
Martin Pulec
6a5758ef48 kernels.cu: compat 2024-09-10 16:10:04 +02:00
Martin Pulec
8b7db976c8 cmpto_j2k: print also cpu convs duration
in debug
2024-09-10 15:24:36 +02:00
Martin Pulec
faa6a7bd72 rt48_to_r12l_compute_blk: fixed odd widths
see the previous commit as well
2024-09-10 15:24:36 +02:00
Martin Pulec
4c12bc85da r12l_to_rg48_compute_blk: fixed odd widths
Fixes unaligned access introduced in HEAD~2 (optimizing the r12l_to_rg48
kernel).
2024-09-10 15:24:36 +02:00
Martin Pulec
dfba579437 rt48_to_r12l_compute_blk: optimize as well
see the previous commit

Duration for 4096x2160 reduction is from some 18.5 to 0.5 ms.

refers to GH-406
2024-09-10 15:24:36 +02:00
Martin Pulec
f17b0d8487 r12l_to_rg48_compute_blk: optimize
load/store uint32_t to optimize the performance

This reduces the duration from some 16.6 ms to 0.6 ms for 4096x216 on
1080 Ti.

refers to GH-406
2024-09-10 15:24:16 +02:00
Martin Pulec
4d5f7a76ac kernels: report elapsed mode in debug
Instead of using compile-time DEBUG macro, prefer run-time specified
log_level.
2024-09-10 12:07:05 +02:00
Martin Pulec
b1cd3166c4 Revert "export: crash if nullptr passed"
This reverts commit 4143900605.

Actaully, the transcoding reflector doesn't set the export module,
so that it will crash with this. Crasing command:
```
hd-rum-transcode 8M 5004 -c lavc -P 6004 100::
```
2024-09-10 09:17:34 +02:00
Martin Pulec
be7dcb67c7 aplay/alsa: print req val if buff fails to set 2024-09-10 08:59:24 +02:00
Martin Pulec
52ed2fdd22 tv.h: replace time conv macros (+ in alsa)
Replace time conversion macros defined 2 commits ago between msec
and usec.

This is proposed (considered) solution to the todo in tv.h - inconsistent
unit conversion macros. Rather than value, it might be better to use
function-like macros.

The issues is that there will be actaully double the amount - A_TO_B and
B_TO_A. To keep it in a reasonable range, it would be best to remove
the _DBL versions and keep the user typing the arg to double inestead
2024-09-10 08:58:27 +02:00
Martin Pulec
47c13e3968 configure: add kernels to vcomp/cmpto_j2k as well
refers to GH-406
2024-09-06 11:21:20 +02:00
Martin Pulec
f3462fc599 aplay/alsa: control debug print delay by log_level
use run-time log_level rather then macro DEBUG
2024-09-06 11:19:25 +02:00
Martin Pulec
fb15ce9218 aplay/alsa: moved buffer setting to a separate fn
refactor only

changed:
- use symbolic constannts MS_IN_US[_DBL]
- use MSG() instead of log_msg()
- add _MS suffix to macros for default buf sizes
- fixed including
2024-09-06 10:54:31 +02:00
Martin Pulec
e3556c66a7 aplay/alsa: warn if buffer is too short 2024-09-05 14:47:24 +02:00
Martin Pulec
52b9ed2554 testcard/pattern: rename pixel_bars to strips + w=10
Renamed pixel_bars to strips - the original name is not much descriptive -
pixels indicated 1 pixel width, which is not necessarily true, bars
(=vertical) isn't the default mode. Also not much distinctive (there
are other "bars").

Set also the default width to 10 - actually, the original width 1 is
better for troubleshooting compressions etc. But 10 is a visually more
appealing as a default and for the original use, the with can be set
explictily.
2024-09-04 11:58:17 +02:00
Martin Pulec
3a4c13f2d1 testcard/pattern/pixel_bars: add white/gray/black
may help in some troubleshooting
2024-09-04 11:56:20 +02:00
Martin Pulec
fe77b42a1e testcard/pattern/pixel_bars: added strip width opt 2024-09-04 11:08:12 +02:00
Martin Pulec
c40430e07a rt48_to_r12l_compute_blk: compute |last_bl|%8 != 0
Compute last incomplete block (as already done for the cmpto_j2k enc)
in CUDA kernel.
2024-09-03 16:50:56 +02:00
Martin Pulec
f860792e42 kernel_rg48_to_r12l: don't process incomplete blks
see also the commit 1a543b2c
2024-09-03 16:50:56 +02:00
Martin Pulec
9edc9bdc33 vdisp/dump: fix alloc size
MIN was used by mistake, should be MAX
2024-09-03 16:50:56 +02:00
Martin Pulec
c08bce79b8 kernel_r12l_to_rg48: compute last incomplete blk 2024-09-03 16:50:56 +02:00
Martin Pulec
2c6519223a kernel_r12l_to_rg48: of-by-one error
There must be an equal comparison, because the position_x indicates the
beginning of the block, so in the first case it means at most last
unfinished block and the 2nd comparison means the last unaligned block
(if any).
2024-09-03 16:50:56 +02:00
Martin Pulec
7869b2d0b3 kernel_r12l_to_rg48: rework a bit
- separate the block computation

Drop every non-aligned end of the line, not just on the last line. The
point is, that whereas out of bound read is no more a problem, we may
also do the out-of-bound write - write the trash at the beginning of
the following line.
2024-09-03 16:50:56 +02:00
Martin Pulec
d82ae79c00 kernels.cu: move commons ahead; mark parts 2024-09-03 16:50:56 +02:00
Martin Pulec
94afd6c5b4 cmpto_j2k: param to disable GPU conversions
for debugging + eventualy if there were problems as a workaround
2024-09-03 16:50:55 +02:00
Martin Pulec
7b91ebb5d4 vcomp/cmpto_j2k: move CUDA buf alloc to set_pool
The allocation was before set_pool, which can, however, now set
cuda_convert_func to nullptr, therefore the malloc would be unneeded.
2024-09-03 16:50:55 +02:00
Martin Pulec
1cffc72fa8 vcomp/cmpto_j2k: move pool setting to a sep func
The logic is a bit tricky so separate it to a separate func.

just a refactor
2024-09-03 16:50:55 +02:00
Martin Pulec
f613056481 vcomp/cmpto_j2k: update a msg
- inform that also CPU conversion used
- do not propopse reporting - the user may report regardless it is
written. However, since also decompress doesn't support postprocess
on multiple CUDA devices, we can assume this is inherent to the codec
(although tested on a fairly old version, so this might have changed)
2024-09-03 16:50:55 +02:00
Martin Pulec
e37e58cf52 vdec/cmpto_j2k: don't use GPU postp. with more dev
If multiple CUDA devices are used, do not use the CUDA postprocess,
because this is not supported by the codec (at least the version
2.5.8). Error:
```
[J2K dec.] Error initializing context: CUDA postprocessor is supported
only when single CUDA device is configured
```
2024-09-03 16:50:55 +02:00
Martin Pulec
b1ff4c6d29 vdec/cmpto_j2k: moved setting conv to separate fn
only a refactoring now
2024-09-03 16:50:55 +02:00