The initial use was incorrect - it assumed that on big endian, the bytes
b0,b1,b2,b3 need to be swapped so value b[0] would be what was b[3]
on little-endian which is not true (writting bytes)
This mistake has then spread across UltraGrid.
This should be the last compat needed (in respect to the encoder producing
4:2:0 only in 8-bit - lavc encoder is not considered but it will likely
work just with encoded UYVY, anyways).
removed all ad hoc optimizations:
- -Ofast - removed by context (pixfmt_conv compiles with), _but_ see
previous commit - even in pixfmt_conv it was not actually used
- remove ALWAYS_INLINE + OPTIMIZED_FOR - from measurements it doesn't
seem to make some difference
for generic use, should be just a refactor
testted with:
`uv -t testcard:c=R12L -c lavc:e=libx265 -p change_pixfmt:RGBA -d gl`
(`change_pixfmt` required to allow decode to R12L, which GL does not
natively support)
technically it will be C2Y but the c23.h can be perhaps used for both
in c++, std::size() is rather used
This fixes compilation of pano_gl, where its implementation
of countof clashes with the macro (leaked through
debug.h->color_out.h->utils/macros.h, which no longer contains that
define).
This is handled differently and may trigger unexpected decode to HW_VDPAU
if gl display advertises that, eg. `uv -t testcard -c lavc:c=MJPG -d gl`.
This fixes the commit 647d8627 (2025-06-25) that unintentionally
enabled that.
The HW accel is hanndled actually separately ahd snouldn't be "enabled"
in this way.
see also recent commit 951f9648
countof seem to be upcoming C2Y language macro (and _Countof operator)
so make use of it instead of ARR_COUNT that is now removed.
compare just the in codec and the MIN(intermediate, out_pixfmt)
to avoid missleading message
`[to_lavc_vid_conv] conversion is reducing subsampling from 4444 to 4440`
as eg. in:
<https://github.com/CESNET/UltraGrid/issues/480>
if converting R12L to bgra over RGBA - the alpha channel is present just
in the intermediate but both ends have 444 without alpha channel.
Fix the benchmark tool build when src/config.h present and CUDA
conversions enabled there. The appropriate CUDA files will be required
if HAVE_LAVC_CUDA_CONV is defined.
If there is no direct conversion from a AV PF compatible with internal
format, penalize a bit.
This may be mostly unneeded but just in case. It can be safely reverted,
anyways.
Assume that the output pixel format (ugc) is supported if there is at
least one conversion. This may not be optimal but it is just as it was
until now, we just remove the hard coded list.
Effectively this is just a refactor, except:
- VDEC_PRIO_NOT_PREFERRED now not returned if internal.rgb !=
codec_is_rgb(ugc) - doesn't seem relevant, because the codec is already
probed and ugc determined. So any alternative decompress will need to do
the conversion as well.
When supported by the display, this eliminates the conversion eg. to
Y416 for video display because UYVY or v210 are 4:2:2. But the conversion
went over UYVY anyways (there was no conv from Y444 keeping subsampling), eg:
`$ uv -t testcard:c=vuya -d gl`
was originally:
```
./src/libavcodec/from_lavc_vid_conv.c: selected conversion from yuv444p to Y416 with UYVY intermediate.
```
now VUYA is selected
Set the metadata for parallel conversion later - av_frame_make_writable()
may actually alter that (at least pointer but perhaps also linesize), those
old values might have been invalidated by that lavc call.
Corrected various spelling mistakes in comments, documentation, and
variable names across the project. Changes include:
- Documentation files (CONTRIBUTING.md, README.md, etc.)
- Source code comments in C/C++ files
- Function parameter names and descriptions
No functional changes were made.
1. to SDL3 nv12 (not supported before)
2. to_lavc - use rgba_to_bgra - the vc_copyline version was not keeping alpha
(if ever used - this may cause regressions, unfortunately, if alpha is
assumed to be 100%, because the orig version set it always)
3. uyvy_to_i420 use by testcard and to_lavc
uyvy_to_i420: do not write out of bounds
If width % 2 = 1, 1 extra luma on first line of pair will override the
first luma on the second.