Commit Graph

237 Commits

Author SHA1 Message Date
Jan Ekström 29561c8e2d avutil/pix{desc,fmt}: add new matrix coefficients from H.273 v3
* SMPTE ST 2128 IPT-C2 defines the coefficients utilized in DoVi
  Profile 5. Profile 5 can thus now be represented in VUI as
  {AVCOL_RANGE_JPEG, AVCOL_PRI_BT2020, AVCOL_TRC_SMPTE2084,
   AVCOL_SPC_IPT_C2, AVCHROMA_LOC_LEFT} (although other chroma
  sample locations are allowed). AVCOL_TRC_SMPTE2084 should in
  this case be interpreted as 'PQ with reshaping'.
* YCgCo-Re and YCgCo-Ro define the bitexact YCgCo-R, where the
  number of bits added to a source RGB bit depth is 2 (i.e., even)
  and 1 (i.e., odd), respectively.
2024-04-03 21:31:35 +03:00
James Almer a12cd3be98 avutil: remove deprecated FF_API_XVMC
Signed-off-by: James Almer <jamrial@gmail.com>
2024-03-07 08:53:30 -03:00
Michael Niedermayer eea9bd88a5
avutil/pixfmt: Add AV_VIDEO_MAX_PLANES
It seems we do not have a named identifier for the maximum planes of pixel formats

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-02-16 21:34:38 +01:00
Jeffrey Knockel 0e20146db0
avutil/pixfmt: fix AV_PIX_FMT_RGB8 description
Previously AV_PIX_FMT_RGB8 was documented as "RGB 3:3:2,
(msb)2R 3G 3B(lsb)".  While the RGB 3:3:2 part is correct, the latter
part should be: (msb)3R 3G 2B(lsb).  This commit also updates the
format's pixdesc description to be (msb)3R 3G 2B(lsb).

Signed-off-by: Jeffrey Knockel <jeff@jeffreyknockel.com>
Reviewed-by: "Diederick C. Niehorster" <dcnieho@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-01-16 01:34:57 +01:00
Wu Jianhua 142f727b9c libavutil: add hwcontext_d3d12va and AV_PIX_FMT_D3D12
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Tong Wu <tong1.wu@intel.com>
2023-12-21 16:15:23 +08:00
Paul B Mahol 8e1ef7c38f avutil: add GBRAP14 format support 2023-09-28 19:36:08 +02:00
Lynne 0bda3340a3
lavu: add 12-bit 2-plane 422 and 444 pixel formats 2023-05-29 00:41:35 +02:00
Haihao Xiang 3dc8bceabe lavu/pixfmt: Update the description for AV_PIX_FMT_QSV
Since D3D11 was introduced for QSV in FFmpeg 5.0, there is an implied
API/ABI change for user-supplied frames [1], hence update the
description for AV_PIX_FMT_QSV.

[1] https://ffmpeg.org/pipermail/ffmpeg-devel/2021-December/290444.html

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-11-22 13:52:38 +08:00
Leo Izen 479747645f avutil/pixfmt.h: add native-endian RGB32F and RGBA32F formats
Add an AV_PIX_FMT_NE macro for RGB32FBE/RGB32FLE and also one for
RGBA32FBE/RGBA32FLE for packed 32-bit float RGB samples, and also
packed 32-bit float RGBA samples, respectively.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Leo Izen <leo.izen@gmail.com>
2022-10-11 16:31:15 -03:00
Paul B Mahol 7bb0afc245 avutil: add RGBA single-float precision packed formats 2022-09-25 18:34:48 +02:00
Paul B Mahol 63bb6d6a9b avutil: add RGB single-precision float formats 2022-09-25 18:34:48 +02:00
Philip Langdale d75c4693fe lavu/pixfmt: Add P012, Y212, XV30, and XV36 formats
These are the formats we want/need to use when dealing with the Intel
VAAPI decoder for 12bit 4:2:0, 12bit 4:2:2, 10bit 4:4:4 and 12bit 4:4:4
respectively.

As with the already supported Y210 and YUVX (XVUY) formats, they are
based on formats Microsoft picked as their preferred 4:2:2 and 4:4:4
video formats, and Intel ran with it.

P12 and Y212 are simply an extension of 10 bit formats to say 12 bits
will be used, with 4 unused bits instead of 6.

XV30, and XV36, as exotic as they sound, are variants of Y410 and Y412
where the alpha channel is left formally undefined. We prefer these
over the alpha versions because the hardware cannot actually do
anything with the alpha channel and respecting it is just overhead.

Y412/XV46 is a normal looking packed 4 channel format where each
channel is 16bits wide but only the 12msb are used (like P012).

Y410/XV30 packs three 10bit channels in 32bits with 2bits of alpha,
like A/X2RGB10 style formats. This annoying layout forced me to define
the BE version as a bitstream format. It seems like our pixdesc
infrastructure can handle the LE version being byte-defined, but not
when it's reversed. If there's a better way to handle this, please
let me know. Our existing X2 formats all have the 2 bits at the MSB
end, but this format places them at the LSB end and that seems to be
the root of the problem.
2022-09-03 16:19:40 -07:00
Philip Langdale cc5a5c9860 lavu/pixfmt: Introduce VUYX format
This is the alphaless version of VUYA that I introduced recently. After
further discussion and noting that the Intel vaapi driver explicitly
lists XYUV as a support format for encoding and decoding 8bit 444
content, we decided to switch our usage and avoid the overhead of
having a declared alpha channel around.

Note that I am not removing VUYA, as this turned out to have another
use, which was to replace the need for v408enc/dec when dealing with
the format.

The vaapi switching will happen in the next change
2022-08-25 19:02:49 -07:00
Timo Rothenpieler e95b08a7dd lavu/pixfmt: add packed RGBA float16 format
This is the default format of the Windows compositor and what DXGI
Desktop Duplication will give you for any kind of HDR output.
2022-08-13 15:21:46 +02:00
Philip Langdale 6ab8a9d375 lavu/pixfmt: Add packed 4:4:4 format
The "AYUV" format is defined by Microsoft as their preferred format for
4:4:4 content, and so it is the format used by Intel VAAPI and QSV.

As Microsoft like to define their byte ordering in little-endian
fashion, the memory order is reversed, and so our pix_fmt, which
follows memory order, has a reversed name (VUYA).
2022-08-03 14:09:46 -07:00
Anton Khirnov cefa595361 lavu/pixfmt: deprecate AV_PIX_FMT_XVMC
It is no longer used for anything.
2022-02-15 10:16:16 +01:00
Diederick Niehorster 7247a6fed8 avutil/pixfmt.h: typo
Signed-off-by: Diederick Niehorster <dcnieho@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-21 11:58:23 +01:00
rcombs b2cd1fb2ec lavu/pixfmt: add high-bit-depth semi-planar 4:2:2/4:4:4 formats
These are used by VideoToolbox hardware decoders.
2021-11-28 16:40:43 -06:00
Manuel Stoeckl 0760d9153c lavu/pix_fmt: add pixel format for x2bgr10
The new format (given in big/little endian forms) matches the
existing X2RGB10 format, except with B and R channels switched.

AV_PIX_FMT_X2BGR10 data often is created by OpenGL programs
whose buffers use the GL_RGB10 internal format.

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-26 16:26:10 +02:00
Valerii Zapodovnikov 6b1268f8c3 pixfmt: fixed wrong fix of comment
This mostly reverts 785bfb1d7b.
But I also added some clarifications so that nobody mixes primaries
with matrix again. SMPTE 240 and 170 primaires are the same, while
matrix coeff. are different, because 240 is derived from 170's new
primaries and white point while 170 uses BT.601 derived from BT.470
System M (yes, with Illuminant C) a.k.a. NTSC 1953. Some nits too.

Reviewed-by: Reto Kromer <lists@reto.ch>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-02 17:30:24 +02:00
Andreas Rheinhardt ad524cb9ee avutil/pixfmt: Remove deprecated VAAPI pixel formats
Deprecated in 9f8e57efe4.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:12 -03:00
Jan Ekström d8ce8e8ed3 avutil/pixfmt: improve definition of AVColorRange
As it was brought up that the current documentation leaves things
as specific to YCbCr only, ICtCp and RGB are now mentioned.
Additionally, the specifications on which these definitions of
narrow and full range are defined are mentioned.

This way, the documentation of AVColorRange should now match how
most people seem to read interpret it at this point, and thus
flagging RGB AVFrames as full range is valid not only according to
common sense, but also the enum definition.
2020-09-23 19:14:45 +03:00
Fei Wang b09fb030c1 lavu/pix_fmt: add new pixel format x2rgb10
The format is packed RGB with each channel 10 bits available and
include 2 bits unused.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2020-06-12 17:56:15 +01:00
Linjie Fu 1c37cad084 lavu/pix_fmt: add new pixel format y210
Add some packed 4:2:2 10-bit pixel formats for hardware decode support
in VAAPI and QSV.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
2020-02-24 00:09:51 +00:00
Lynne a88449ffb2 lavu: add Vulkan hwcontext code
This commit adds the necessary code to initialize and use a Vulkan device
within the hwcontext libavutil framework.
Currently direct mapping to VAAPI and DRM frames is functional, and
transfers to CUDA and native frames are supported.

Lets hope the future Vulkan video decode extension fits well within this
framework.
2020-02-04 23:19:48 +00:00
Carl Eugen Hoyos 8b5ef2dcff lavu/pixfmt: Cosmetics, remove wrong end-of-comment markers. 2019-12-14 16:09:41 +01:00
Raphaël Zumer 8821d1f56e avutil/pixfmt: Add EBU Tech. 3213-E AVColorPrimaries value
This is an alias for JEDEC P22.

The name associated with the value is also changed
from jedec-p22 to ebu3213 to match ITU-T H.273.

Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-09-01 19:56:05 -03:00
Philip Langdale 5de4f1d871 avutil: Add NV24 and NV42 pixel formats
These are the 4:4:4 variants of the semi-planar NV12/NV21 formats.

These formats are not used much, so we've never had a reason to add
them until now. VDPAU recently added support HEVC 4:4:4 content
and when you use the OpenGL interop, the returned surfaces are in
NV24 format, so we need the pixel format for media players, even
if there's no direct use within ffmpeg.

Separately, there are apparently webcams that use NV24, but I've
never seen one.
2019-05-12 07:51:02 -07:00
Martin Vignali 80b0624099 avutil : add YUVA444P12 and YUVA422P12 2018-11-24 16:24:43 +01:00
Sergey Lavrushkin 00ae3498bf libavutil: Adds gray floating-point pixel formats.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-08-11 02:37:42 +02:00
Michael Niedermayer be0b77e6e8 avutil/pixfmt: Document chroma plane size for odd resolutions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-07-20 13:13:52 +02:00
Paul B Mahol aef93c6aa5 avutil: add gray14 pixel format
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-05-05 21:35:31 +02:00
Mark Thompson e1d1924427 lavu/pixfmt: Remove gap in the middle of enum AVPixelFormat
This was added for compatibility with libav, by leaving a space for
formats added in libav to be merged.  Since that feature has been
removed, we don't need a gap here.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-25 14:42:10 +00:00
Mark Thompson a050f56c09 lavu: Add OpenCL hardware pixfmt 2017-11-22 23:01:29 +00:00
James Almer b773a8d8c1 Merge commit 'dd343fd986459f467a2d1d70c26101dff1d47d68'
* commit 'dd343fd986459f467a2d1d70c26101dff1d47d68':
  lavu: Drop deprecated VDPAU pixel formats

Merged-by: James Almer <jamrial@gmail.com>
2017-10-23 18:15:49 -03:00
James Almer b46613dd9b Merge commit 'dcc39ee10e82833ce24aa57926c00ffeb1948198'
* commit 'dcc39ee10e82833ce24aa57926c00ffeb1948198':
  lavc: Remove deprecated XvMC support hacks

Merged-by: James Almer <jamrial@gmail.com>
2017-10-23 15:20:49 -03:00
Clément Bœsch 2b32031827 lavc: drop VDA
Deprecated (aka removed) in OSX 10.11, and we have a replacement for it
(VideoToolbox).
2017-10-23 11:56:15 +02:00
Mark Thompson 9cb23cd9fe lavu: Add DRM hwcontext 2017-09-13 22:03:27 +01:00
Vittorio Giovara 1460408703 Add single precision planar RGB pixel formats
Add a pixel format flag to identify this family.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-08-15 15:26:20 +02:00
Vittorio Giovara f357104866 pixfmt: Support chroma-derived and ictcp color matrices
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-08-10 15:54:06 +02:00
Paul B Mahol ab6d89d7ee libavutil: add GRAY9 pixel format 2017-08-07 13:06:51 +02:00
wm4 3303511f33 lavu: add new D3D11 pixfmt and hwcontext
To be used with the new d3d11 hwaccel decode API.

With the new hwaccel API, we don't want surfaces to depend on the
decoder (other than the required dimension and format). The old D3D11VA
pixfmt uses ID3D11VideoDecoderOutputView pointers, which include the
decoder configuration, and thus is incompatible with the new hwaccel
API. This patch introduces AV_PIX_FMT_D3D11, which uses ID3D11Texture2D
and an index. It's simpler and compatible with the new hwaccel API.

The introduced hwcontext supports only the new pixfmt.

Frame upload code untested.

Significantly based on work by Steve Lhomme <robux4@gmail.com>, but with
heavy changes/rewrites.

Merges Libav commit fff90422d1.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-06-27 18:05:02 +02:00
James Almer bd1179e36b avutil/pixfmt: remove superfluous define
It's an AVColorSpace value since 82ad9cbd32.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-06-01 01:18:49 -03:00
Clément Bœsch 68c9a39942 Merge commit '706af9227b58657c73e3a4df3689da734f010500'
* commit '706af9227b58657c73e3a4df3689da734f010500':
  lavu: Document the color properties enumeration values origin

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-08 14:50:12 +02:00
Clément Bœsch 82ad9cbd32 Merge commit '17dac56b8fdd80c594c39b76de3f27a7949afbde'
* commit '17dac56b8fdd80c594c39b76de3f27a7949afbde':
  lavu: Rename ycgco color space appropriately

Merged-by: Clément Bœsch <cboesch@gopro.com>
2017-03-31 09:46:51 +02:00
Clément Bœsch 0b3decc596 Merge commit '0d9b9bd37f43ee29ad9f709d85c8f3be9db71104'
* commit '0d9b9bd37f43ee29ad9f709d85c8f3be9db71104':
  lavu: Add JEDEC P22 color primaries

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-24 11:21:46 +01:00
Clément Bœsch a44ab512e6 lavu/pixfmt: fix redundant comment
Mistake introduced in a1f6b1d9d8.
2017-03-24 11:17:51 +01:00
Clément Bœsch a1f6b1d9d8 Merge commit '310c55f1799deab395319471a75c528d0fa7b30d'
* commit '310c55f1799deab395319471a75c528d0fa7b30d':
  pixfmt: Document alternative names for smpte 431 and 432

Merged-by: Clément Bœsch <u@pkh.me>
2017-03-23 11:22:32 +01:00
Vittorio Giovara dd343fd986 lavu: Drop deprecated VDPAU pixel formats
Deprecated in 07/2013.
2017-03-23 10:09:17 +01:00
Diego Biurrun dcc39ee10e lavc: Remove deprecated XvMC support hacks
Deprecated in 11/2013.
2017-03-23 10:09:14 +01:00