Commit Graph

190 Commits

Author SHA1 Message Date
Martin Pulec
fa8f3c64be fixed vc_copylineV210toY216 conversion 2023-01-02 15:08:27 +01:00
Martin Pulec
15af296d27 save_video_frame_as_y4m: store also >8b YUV 2022-11-28 09:19:34 +01:00
Martin Pulec
1793514f7d save_video_frame to y4m for YUV 2022-11-28 09:19:33 +01:00
Martin Pulec
9513870057 added vc_copyliner10ktoRG48 2022-11-25 11:02:21 +01:00
Martin Pulec
0364f0253e GL: fixed displaying of R10k width % 64 != 0
R10k line is padded to 256 B (as DeckLinks requires) so widths not
divisible by 64 pixels were not displayed correctly.

Not sure if AJA holds also this convetion, it is not mentioned in docs
for NTV2_FBF_10BIT_DPX. However, SDI formats' line widths are generally
divisible by 64 pixels so it is not relevant there.

Steps to reproduce the problem were:

    uv -t testcard:size=48x32:codec=R10k -d gl
2022-11-14 16:44:16 +01:00
Martin Pulec
8c98ea992d set "padding" 2 bits of R10k to 0x3
Although those bits seem to be used as a padding only (eg. according to
multimediawiki), it maps eg. to OpenGL format that uses 2 remaining bits
as an alpha so it is safer to set it to ones.
2022-11-07 10:05:54 +01:00
Martin Pulec
7a8ac7f051 vc_copylineUYVYtoY416: set alpha to 0xFFFFU
Similarly to recently fixed RGBA conversions, set full alpha for this
conversion.
2022-11-07 08:45:38 +01:00
Martin Pulec
ef4fc34fc8 video_codec: apply full alpha mask to remaining fncs
Applied full aplha mask to remaining functions converting to RGBA.
2022-11-07 08:34:27 +01:00
Martin Pulec
9ab6a9bd50 conversions: apply alpha masks for all ->RGBA
similarly to 2c9822f, apply full alpha for all conversions to RGBA

The reason is to avoid displaying blank by displays interpreting the
alpha value.
2022-11-04 16:50:56 +01:00
Martin Pulec
2c9822f935 vc_copylineRGBtoRGBA: mask remaining bites with 1s
refer to GH-250
2022-11-04 15:19:00 +01:00
Martin Pulec
326ceb21be vc_copylineY216toV210: finish the line
convert whole pixel block if dst width is not divisible by 6 (v210 block)
2022-11-04 14:03:05 +01:00
Martin Pulec
2d69e343ac added vc_copylineV210toY416
+ fixed description of v210 codec in types.h
2022-10-17 15:11:08 +02:00
Martin Pulec
2b8ab0f82b vc_copylineV210toY216: fixes
- fixed wrong conversion to (Y416 instead of Y216)
- bad mask (0x3FU instead of 0x3FFU)
+ simplified
2022-10-17 15:11:07 +02:00
Martin Pulec
b838e7d2e7 video_codec: updated vc_copylineDPX10toRGB
Implemented rest of the function and thus do not print the warning.
2022-08-19 09:18:17 +02:00
Martin Pulec
9f926828af added vc_copylineY416toRG48 2022-08-15 13:19:47 +02:00
Martin Pulec
9195808232 video_codec.c: avoid multiple evaluation in macro
Avoid multiple evaluation of expressions in macro expansions.
2022-08-15 11:11:48 +02:00
Martin Pulec
fcd2522822 moved OPTIMIZED_FOR to utils/macros.h
It belongs rather there than to host.h where it was originally.
2022-08-12 12:22:22 +02:00
Martin Pulec
b15ede7aec video_codec: v210, R10k add 10b to description 2022-08-08 15:08:38 +02:00
Martin Pulec
e1a490b334 testcard: added gray pattern 2022-08-05 09:43:22 +02:00
Martin Pulec
d2c5ca065d fixed vc_copylineRGBAtoUYVY
- the required space for intermediate result was actually 2x larger than
  dst buffer could provide
+ make arguments of vc_copylineRGBAtoUYVY restrict again -- no longer
  used in situ, thus it can be restricted again
2022-08-02 15:03:55 +02:00
Martin Pulec
0c4c74ace0 added vc_copylineR10ktoUYVY 2022-07-22 15:52:15 +02:00
Martin Pulec
a84d0a67d9 get_pf_block_pixels/bytes: ensure >0 ret val
Ensure that the above function return value >0 (CID 395232).
2022-06-21 10:21:32 +02:00
Martin Pulec
1a31999f1a utils/misc: split to misc and macros.h
Some macros are quite common so it is perhaps more wise to use a
separate header.

Also moved ref_count_init_once and ref_count_terminate last to misc.h.
2022-06-06 11:06:06 +02:00
Martin Pulec
d968581b8f video_codec: best_decoder_cmp: small refactor
If bit depths are the same, continue directly to next feature.
2022-06-01 11:22:03 +02:00
Martin Pulec
975805b087 video_codec: improved comparator best
- check for exact match first
- continue comparing if bit depths are the same - this was perhaps
  incorrect previously, because it reported codec equality if bit
  depth was equal
2022-06-01 11:22:02 +02:00
Martin Pulec
7b1837c668 video_codec: removed slow parameter from get_decoder_from_to 2022-05-30 15:38:48 +02:00
Martin Pulec
b81f0fed32 video codec: removed needless protoypes 2022-05-30 15:38:48 +02:00
Martin Pulec
9001fe9ad1 video codec: conversion selection logic
Do not use third parameter of get_decoder_from_to by caller to get fast
decode first, Created function get_fastest_decoder_from instead, that
hides and encapsulates the selection logic.
2022-05-30 15:38:48 +02:00
Martin Pulec
b914f6ee22 video_codec: few improvements
- get_best_decoder_for: added doxy
- "                   : return also vc_memcpy
- "                   : simplified return - there exist only one
  conversion in the end (no matter if slow or not)
- fixed protoypes for both get_best_decoder_for and codec_is_in_set:
  the first should not be neither const nor pure, 2nd may be pure
- codec_is_in_set: argument can be pointer to const
2022-05-30 15:38:48 +02:00
Martin Pulec
d66f336e1d video_codec: removed some more ext link
+ return vc_copylineRGB[A] for RGB->RGB and RGBA->RGBA instead of
  vc_memcpy - we cannot know if caller wants or doesn't want to use
  rgb-shifts other than default. Both implementations call vc_memcpy
  if s/he does
2022-05-30 15:38:47 +02:00
Martin Pulec
9c72e92c36 video_codec: removed some external linkage for convs 2022-05-30 15:38:44 +02:00
Martin Pulec
dc033b5361 added vc_copylineV210toY216
Can be used by NDI display that doesn't support v210 natively but does
Y216.
2022-05-26 15:26:29 +02:00
Martin Pulec
7b54034426 video_codec.c: removed function casts
Those were required previously when some conversions had incompatible
prototype (missing r,g,b shifts for pixfmts not using it - that is
almost all except RGBA).
2022-05-26 15:26:29 +02:00
Martin Pulec
b5072a936e ProRes: fixed metadata (not inter-frame) 2022-05-26 09:06:58 +02:00
Martin Pulec
5b0c8ca268 video pattern generator: add full-depth Y216/Y416 2022-05-25 14:47:18 +02:00
Martin Pulec
fe8d353e0c video_codec.c: make some functions explicitly bool 2022-05-25 14:47:18 +02:00
Martin Pulec
df635235c9 video_codec: remove bpp in favor of block pix width
bpp is still deducible by pixel_block_bytes/pixel_block_pixels
2022-05-24 14:08:57 +02:00
Martin Pulec
0fd508cfb8 video_codec.c: rename get_pf_block_size->bytes
Renamed get_pf_block_size to get_pf_block_bytes.
2022-05-24 10:31:27 +02:00
Martin Pulec
df5901a286 added Y416 + basic conversions & testcard 2022-05-20 10:45:02 +02:00
Martin Pulec
0d2a354d50 testcard: help rename 12-bit group to 12+
Only R12L is truly 12-bit, Y216 and RG48 not.
2022-05-20 10:45:01 +02:00
Martin Pulec
e4438a0108 video_codec.c: remove no longer used conversion
+ removed no longer valid docu lines
2022-05-18 13:47:43 +02:00
Martin Pulec
45bcb26572 added vc_copylineY216toV210() 2022-05-09 13:54:24 +02:00
Martin Pulec
be2dd026d3 added RG48->v210 conversion 2022-05-06 09:56:04 +02:00
Martin Pulec
53e6876ac7 vc_copyliner10k: pointless double cast to same type 2022-05-02 16:12:25 +02:00
Martin Pulec
f84c5ec859 VideoToolbox: offer also P210
If decoding to swformat fails, try to use also P210 depending. It is
used if >8 bits video is present, otherwise UYVY is preferred.
2022-03-30 16:51:35 +02:00
Martin Pulec
ba0ec6dacd libavcodec ProRes: use distinct FCC for profiles
Use distinct fourcc for different profiles - this is now not necessarily
required but it seems like videotoolbox decoder may need to have it set.

Moreover, this fourcc selection is "correct" because the codec
distinguishes the profiles with different codes.
2022-03-25 15:07:43 +01:00
Martin Pulec
fd88ead463 libavcodec: added Apple ProRes 2022-03-25 10:54:02 +01:00
Martin Pulec
6c8136860b video_codec.c: Apple uses different qsort_r proto.
Apple uses different qsort_r prototype than GNU version, see also here:
https://stackoverflow.com/questions/39560773/different-declarations-of-qsort-r-on-mac-and-linux/39561369#39561369
2022-03-24 16:55:09 +01:00
Martin Pulec
e72de3967b video_codec: set block size to 1 for compressed
This slightly simplifies things (like division of the size to packets).
2022-03-11 10:19:50 +01:00
Martin Piatka
e25bdba283 video_codec: Remove sse compatibility macro
bsrli and bssli are supported since gcc 4.8 and clang 3.7 (7 years old).
Supporting older compilers does not make sense anymore since
UltraGrid needs c++17 support.
2022-03-01 13:27:24 +01:00