Commit Graph

558 Commits

Author SHA1 Message Date
Lynne
e8f054b095 lavu/tx: implement 32 bit fixed point FFT and MDCT
Required minimal changes to the code so made sense to implement.
FFT and MDCT tested, the output of both was properly rounded.
Fun fact: the non-power-of-two fixed-point FFT and MDCT are the fastest ever
non-power-of-two fixed-point FFT and MDCT written.
This can replace the power of two integer MDCTs in aac and ac3 if the
MIPS optimizations are ported across.
Unfortunately the ac3 encoder uses a 16-bit fixed point forward transform,
unlike the encoder which uses a 32bit inverse transform, so some modifications
might be required there.

The 3-point FFT is somewhat less accurate than it otherwise could be,
having minor rounding errors with bigger transforms. However, this
could be improved later, and the way its currently written is the way one
would write assembly for it.
Similar rounding errors can also be found throughout the power of two FFTs
as well, though those are more difficult to correct.
Despite this, the integer transforms are more than accurate enough.
2020-02-13 17:10:34 +00:00
Michael Niedermayer
3182114f88 avutil/log: Add av_log_once() for printing a message just once with a high log level
Compared to ad-hoc if(printed) ... code this allows the user to disable
it by adjusting the log level

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-02-12 10:25:25 +01:00
Lynne
73a8c8e6e4 lavu: bump minor version for the Vulkan patchset 2020-02-04 23:49:56 +00:00
Michael Niedermayer
45259a0ee4 avutil/eval: Add av_expr_count_func() similar to av_expr_count_vars()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-28 11:20:48 +01:00
Marton Balint
16685114d5 avutil/buffer: add av_buffer_pool_buffer_get_opaque
In order to access the original opaque parameter of a buffer in the buffer
pool. (The buffer pool implementation overrides the normal opaque parameter but
also saves it so it is accessible).

v2: add assertion check before dereferencing the BufferPoolEntry.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-12-26 00:47:24 +01:00
Oleg Dobkin
32ba563cfc avutil/hwcontext_cuda: allow using primary CUDA device context
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2019-11-26 16:24:40 +01:00
Gyan Doshi
1c23abc88f avutil/eval: add function to track variable use
1)Some filters allow cross-referenced expressions e.g. x=y+10. In
such cases, filters evaluate expressions multiple times for
successful evaluation of all expressions. If the expression for one or
more variables contains a RNG, the result may vary across evaluation
leading to inconsistent values across the cross-referenced expressions.

2)A related case is circular expressions e.g. x=y+10 and y=x+10 which
cannot be succesfully resolved.

3)Certain filter variables may only be applicable in specific eval modes
and lead to a failure of evaluation in other modes e.g. pts is only
relevant for frame eval mode.

At present, there is no reliable means to identify these occurrences and
thus the error messages provided are broad or inaccurate. The helper
function introduced - av_expr_count_vars - allows developers to identify
the use and count of variables in expressions and thus tailor the error
message, allow for a graceful fallback and/or decide evaluation order.
2019-11-17 11:07:05 +05:30
Paul B Mahol
f3746d31f9 avutil/opt: add AV_OPT_FLAG_RUNTIME_PARAM flag 2019-10-14 11:28:54 +02:00
Aman Gupta
f30fb5ef62 avutil/version: bump for hwcontext_videotoolbox api change
av_map_videotoolbox_format_from_pixfmt2() added in previous
commit to support full-range pixel formats.

Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-09-04 12:56:25 -07: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
Lynne
42e2319ba9 lavu/tx: add support for double precision FFT and MDCT
Simply moves and templates the actual transforms to support an
additional data type.
Unlike the float version, which is equal or better than libfftw3f,
double precision output is bit identical with libfftw3.
2019-08-02 01:19:52 +01:00
Michael Niedermayer
80bb65fafa Bump minor versions again on master to keep 4.2 versions separate from master
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-07-21 18:36:31 +02:00
Michael Niedermayer
22db337a40 Bump minor versions to separate 4.2 from master
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-07-21 18:36:18 +02:00
Amir Pauker
a30e44098a avutil: add FF_DECODE_ERROR_DECODE_SLICES for AVFrame.decode_error_flags
Signed-off-by: Amir Pauker <amir@livelyvideo.tv>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-06-29 19:22:19 +02:00
Amir Pauker
edfced8c04 avutil: add FF_DECODE_ERROR_CONCEALMENT_ACTIVE flag for AVFrame.decode_error_flags
FF_DECODE_ERROR_CONCEALMENT_ACTIVE is set when the decoded frame has error(s) but the returned value from
avcodec_receive_frame is zero i.e. concealed errors

Signed-off-by: Amir Pauker <amir@livelyvideo.tv>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-06-16 09:56:43 +02:00
Lynne
87ee9d580c lavu: bump minor and update APIchanges for the new transform API 2019-05-16 00:02:15 +01: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
ManojGuptaBonda
d617d54efa avutil/hwcontext_vdpau: Map 444 pix fmts to new VdpYCbCr types
New VdpYCbCr Formats VDP_YCBCR_FORMAT_Y_U_V_444 and,
VDP_YCBCR_FORMAT_Y_UV_444 have been added in VDPAU with libvdpau-1.2
to be used in get/putbits for YUV 4:4:4 surfaces. Earlier mapping of
AV_PIX_FMT_YUV444P to VDP_YCBCR_FORMAT_YV12 is not valid.

Hence this Change maps AV_PIX_FMT_YUV444P to VDP_YCBCR_FORMAT_Y_U_V_444
to access the YUV 4:4:4 surface via read-back API's of VDPAU.
2019-05-05 11:35:35 -07:00
Guo, Yejun
1ef4828276 avutil: add ROI (Region Of Interest) data struct and bump version
The encoders such as libx264 support different QPs offset for different MBs,
it makes possible for ROI-based encoding. It makes sense to add support
within ffmpeg to generate/accept ROI infos and pass into encoders.

Typical usage: After AVFrame is decoded, a ffmpeg filter or user's code
generates ROI info for that frame, and the encoder finally does the
ROI-based encoding.

The ROI info is maintained as side data of AVFrame.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2019-01-17 21:47:11 +00:00
Mohammad Izadi
2744d6b364 Add HDR dynamic metadata struct (for SMPTE 2094-40) to libavutil
The dynamic metadata contains data for color volume transform -
application 4 of SMPTE 2094-40:2016 standard. The data comes from
HEVC in the SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2018-12-21 17:52:00 +01:00
Martin Vignali
80b0624099 avutil : add YUVA444P12 and YUVA422P12 2018-11-24 16:24:43 +01:00
Martin Storsjö
4e9cff2824 libavutil: Undeprecate the AVFrame reordered_opaque field
This was marked as deprecated (but only in the doxygen, not with an
actual deprecation attribute) in 81c623fae0 in 2011, but was
undeprecated in ad1ee5fa7.

Signed-off-by: Martin Storsjö <martin@martin.st>
2018-11-05 15:52:08 +02:00
Michael Niedermayer
517573a670 Bump minor version for master after 4.1 branchpoint
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-11-02 00:53:07 +01:00
Michael Niedermayer
780d5e30a0 Bump minor versions for branching 4.1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-11-02 00:15:32 +01:00
Michael Niedermayer
718044dc19 avutil/pixdesc: Add av_write_image_line2(), av_read_image_line2()
This is needed because of 32bit float formats (which are difficult to
store in 16bits)

This also fixes undefined behavior found by fate

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-10-27 22:39:27 +02:00
Josh de Kock
f9d4126f28 lavu: bump version, add Changelog entry 2018-10-24 11:25:19 +01:00
Marton Balint
4737387d28 avutil/file: allow mapping 0 byte files with av_file_map
Signed-off-by: Marton Balint <cus@passwd.hu>
2018-09-09 21:21:42 +02: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
Timo Rothenpieler
41a18982d0 avutil/hwcontext_cuda: add support for nvenc rgb formats 2018-05-10 00:34:22 +02:00
Timo Rothenpieler
c855683427 avutil/hwcontext_cuda: add CUstream in cuda hwctx 2018-05-10 00:34:22 +02:00
Marton Balint
56b081da57 avutil/pixdesc: add AV_PIX_FMT_FLAG_ALPHA to AV_PIX_FMT_PAL8
Signed-off-by: Marton Balint <cus@passwd.hu>
2018-04-30 21:51:31 +02:00
Clément Bœsch
5be0410cb3 lavu/opt: add AV_OPT_FLAG_DEPRECATED 2018-04-26 19:50:29 +02:00
Clément Bœsch
71fa82bed6 lavu/threadmessage: add av_thread_message_queue_nb_elems() 2018-04-26 19:41:19 +02:00
Michael Niedermayer
3c1ecb057d Bump minor versions after release/4.0 branching
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-16 12:35:12 +02:00
Michael Niedermayer
7e3a070d9a Bump minor versions for branching release/4.0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-16 12:35:12 +02:00
wm4
d6fc031caf avutil/pixdesc: deprecate AV_PIX_FMT_FLAG_PSEUDOPAL
PSEUDOPAL pixel formats are not paletted, but carried a palette with the
intention of allowing code to treat unpaletted formats as paletted. The
palette simply mapped the byte values to the resulting RGB values,
making it some sort of LUT for RGB conversion.

It was used for 1 byte formats only: RGB4_BYTE, BGR4_BYTE, RGB8, BGR8,
GRAY8. The first 4 are awfully obscure, used only by some ancient bitmap
formats. The last one, GRAY8, is more common, but its treatment is
grossly incorrect. It considers full range GRAY8 only, so GRAY8 coming
from typical Y video planes was not mapped to the correct RGB values.
This cannot be fixed, because AVFrame.color_range can be freely changed
at runtime, and there is nothing to ensure the pseudo palette is
updated.

Also, nothing actually used the PSEUDOPAL palette data, except xwdenc
(trivially changed in the previous commit). All other code had to treat
it as a special case, just to ignore or to propagate palette data.

In conclusion, this was just a very strange old mechnaism that has no
real justification to exist anymore (although it may have been nice and
useful in the past). Now it's an artifact that makes the API harder to
use: API users who allocate their own pixel data have to be aware that
they need to allocate the palette, or FFmpeg will crash on them in
_some_ situations. On top of this, there was no API to allocate the
pseuo palette outside of av_frame_get_buffer().

This patch not only deprecates AV_PIX_FMT_FLAG_PSEUDOPAL, but also makes
the pseudo palette optional. Nothing accesses it anymore, though if it's
set, it's propagated. It's still allocated and initialized for
compatibility with API users that rely on this feature. But new API
users do not need to allocate it. This was an explicit goal of this
patch.

Most changes replace AV_PIX_FMT_FLAG_PSEUDOPAL with FF_PSEUDOPAL. I
first tried #ifdefing all code, but it was a mess. The FF_PSEUDOPAL
macro reduces the mess, and still allows defining FF_API_PSEUDOPAL to 0.

Passes FATE with FF_API_PSEUDOPAL enabled and disabled. In addition,
FATE passes with FF_API_PSEUDOPAL set to 1, but with allocation
functions manually changed to not allocating a palette.
2018-04-03 17:53:00 +02:00
Jacob Trimble
db2a7c947e avcodec/avcodec.h: Add encryption info side data.
This new side-data will contain info on how a packet is encrypted.
This allows the app to handle packet decryption.

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-24 03:11:08 +01:00
wm4
4b86ac27a0 lavu/frame: add QP side data
This adds a way for an API user to transfer QP data and metadata without
having to keep the reference to AVFrame, and without having to
explicitly care about QP APIs. It might also provide a way to finally
remove the deprecated QP related fields. In the end, the QP table should
be handled in a very similar way to e.g. AV_FRAME_DATA_MOTION_VECTORS.

There are two side data types, because I didn't care about having to
repack the QP data so the table and the metadata are in a single
AVBufferRef. Otherwise it would have either required a copy on decoding
(extra slowdown for something as obscure as the QP data), or would have
required making intrusive changes to the codecs which support export of
this data.

The new side data types are added under deprecation guards, because I
don't intend to change the status of the QP export as being deprecated
(as it was before this patch too).
2018-03-18 12:36:24 +01:00
James Almer
7af2336598 avutil: bump version after the latest AVOption flag addition
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-16 00:19:45 -03:00
James Almer
950170bd3b avutil: add missing version bump for AV_CRC_8_EBU
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-10 01:15:05 -03:00
Rostislav Pehlivanov
6731f60598 frame: add an av_frame_new_side_data_from_buf function
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2018-03-01 20:37:18 +00:00
wm4
474194a8d0 avutil/opt: remove ABI hacks
These were needed for ABI compatibility with Libav. We don't need them
anymore.
2018-02-13 04:46:04 +01:00
James Darnley
8b81eabe57 avutil: add AVX-512 flags 2017-12-24 22:02:41 +01:00
Aman Gupta
e4d9f05ca7 lavu/hwcontext: add AV_HWDEVICE_TYPE_MEDIACODEC
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2017-12-16 00:52:00 +01:00
Andrew D'Addesio
9b45bcf713 libavutil: Add saturating subtraction functions
Add av_sat_sub32 and av_sat_dsub32 as the subtraction analogues to
av_sat_add32/av_sat_dadd32.

Also clarify the formulas for dadd32/dsub32.

Signed-off-by: Andrew D'Addesio <modchipv12@gmail.com>
2017-12-04 07:28:45 +00:00
James Almer
d268094f88 Merge commit '99e9697e3a12ab4a6638a36b95edafd6a98f9eaa'
* commit '99e9697e3a12ab4a6638a36b95edafd6a98f9eaa':
  stereo3d: Support view type for frame sequence type

Merged-by: James Almer <jamrial@gmail.com>
2017-11-29 21:06:49 -03:00
Vittorio Giovara
99e9697e3a stereo3d: Support view type for frame sequence type
Implement detection in h264 and hevc and insertion in framepack filter.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-11-28 14:56:51 -05: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
b25d8ef0a7 lavu: OpenCL hwcontext implementation 2017-11-22 23:02:29 +00:00
Mark Thompson
a050f56c09 lavu: Add OpenCL hardware pixfmt 2017-11-22 23:01:29 +00:00