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
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
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.
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).
- 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.
- 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)
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
```
- 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).
fixes:
```
uv -t testcard:codec=RGB:size=1921x1080 -d sdl
```
Doesn't crash but errors are printed on console and data at the end
(perhaps something like a line) is not written.
Actually the pool properties is precompress_desc, saved_desc is used
in usual sense to check whether the properties were changed from last
(re)configuratio.
Disable copying to CUDA buffers if there is more CUDA devices configured,
it does cause the following error:
```
[J2K enc.] Setting image samples: Cannot configure input samples in CUDA
buffer because argument 'device_id' doesn't match the configured CUDA
device in encoder. Single CUDA encoder must be configured.
```
If convert function is not used, copy the data directly to GPU memory
instead of duplicating with memcpy. CUDA support must also be enabled
for this to work.