Commit Graph

9736 Commits

Author SHA1 Message Date
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
Martin Pulec
650bf71010 vc_copylineR12LtoRG48: do not override output buf
In non-native R12L lengths (width%8!=0). do not override the output
last block.
2024-09-03 16:50:54 +02:00
Martin Pulec
06a3ca6081 debug_dump: early return
Currently, if log_level isn't at least DEBUG, nothing will be printed,
anyways.
2024-09-03 16:41:51 +02:00
Martin Pulec
5aa5261dda debug_dump: improved printout
- use 'h' suffix when len printed in hexa
- for missing bytes at the end (not aligned to 16 B) print 2 spaces
instead of 1, because it stands for 2 nibbles. Otherwise the ASCII
representation would be moved left (the muber of chars didn't match).
2024-09-03 16:41:51 +02:00
Martin Pulec
33675df8f6 pattern pixel_{rows,column}: add diagonal+rename
- added diagonal variant
- rename to pixel_bars again (we now have 3 flavors, but are related).

vertical/horizontal/diagonal is now an option
2024-09-03 16:41:49 +02:00
Martin Pulec
6e42db0bed image_pattern_pixel_bars: allow also rows
+ bars rename to columns
2024-09-03 14:54:56 +02:00
Martin Pulec
66e7b23f2c video_pattern_generator/interlaced: check width 2024-09-03 14:54:56 +02:00
Martin Pulec
c9aef86c40 video_pattern_generator/interlaced: alloc inc MAX_PADDING 2024-09-03 14:54:56 +02:00
Martin Pulec
0e7b990d2b video_pattern_generator usage: reformat
as the number of of patterns grew, it became a bit messy
2024-09-03 14:54:56 +02:00
Martin Pulec
0466ef87a8 video_pattern_generator: new pattern pixel_bars
makes the bars as the default pattern, but width is set to 1 pixel
(and repeated).
2024-09-03 14:54:56 +02:00
Martin Pulec
cc6b820db2 vcomp/cmpto_j2k, pool: alloc extra data
padding for conversions
2024-09-03 14:54:21 +02:00
Martin Pulec
62dece8d97 to_lavc_vid_conv: extra padding for alloc
fixes `uv -t testcard:codec=R12L:size=1921x1080 -c lavc`
2024-09-03 09:14:23 +02:00
Martin Pulec
0df55a477f testcard/pattern=blank: print inline help 2024-09-03 09:14:15 +02:00