The rationale for this function is reflected in the documentation for
it, and is copied here:
Clip a double value into the long long amin-amax range.
This function is needed because conversion of floating point to integers when
it does not fit in the integer's representation does not necessarily saturate
correctly (usually converted to a cvttsd2si on x86) which saturates numbers
> INT64_MAX to INT64_MIN. The standard marks such conversions as undefined
behavior, allowing this sort of mathematically bogus conversions. This provides
a safe alternative that is slower obviously but assures safety and better
mathematical behavior.
API:
@param a value to clip
@param amin minimum value of the clip range
@param amax maximum value of the clip range
@return clipped value
Note that a priori if one can guarantee from the calling side that the
double is in range, it is safe to simply do an explicit/implicit cast,
and that will be far faster. However, otherwise this function should be
used.
avutil minor version is bumped.
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
It's been argued that the benefits of the current implementation far outweight
those of making the structs opaque.
This deprecation is not present in any release, so it can be safely removed.
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
These field are difficult to interpret, and are provided by a single
encoder (mpegvideoenc). In general they do not belong to a structure
containing raw data only, so remove them from AVFrame.
Mpegvideoenc now uses a private field in Picture for its internal
computations.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba':
lavu: Drop the {minus,plus}1 suffix from AVComponentDescriptor fields
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
FATE refs changed to accomodate for the new default behavior of the function.
Numbers are now interpreted as a channel layout, instead of a number of channels.
* commit '4e649debcf7f71d35c6b38cdb7ee715eba95d64a':
Postpone API-incompatible changes until the next bump
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* commit '2f9b652e8c646eabef74a6742f0d7d4c9118fd0e':
lavu: Drop deprecated context size variables
These variables had been previously un-deprecated in ffmpeg, not removed.
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* commit '2f8cbbc962dfc0dc1dd0a90b2cd6c21266380f51':
lavu: Drop deprecated external access to AVPixFmtDescriptor table
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* commit '183db02a51a422568084b113a7571c845ca68622':
lavu: Drop deprecated old_pix_fmt.h and related code
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Deprecate older VA pixel formats (MOCO, IDCT) as it is now very unlikely
to ever be useful in the future. Only keep plain AV_PIX_FMT_VAAPI format
that is aliased to the older VLD variant.
This is an API change.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
The test code is updated with some cosmetics to avoid the loop
using undefined AVHMACType values.
The old enum values will be removed in the next major bump, effectively
making both projects synced and without API or ABI issues.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
* commit '832129431fd5c693b12c32a1563944c631feaf36':
lavu: Add version information for av_version_info()
Conflicts:
doc/APIchanges
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
New functions are added to fixed_dsp, so the documentation is changed
accordingly.
Signed-off-by: Nedeljko Babic <nedeljko.babic@imgtec.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This function allows writing AVRationals as IEEE floats without the need
of platform dependant float operations
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'eaa2d123f0a643664721593d248ece6bcd85f1e6':
log: Print a full backtrace along with error messages under Valgrind
Conflicts:
libavutil/log.c
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Useful to understand where and in what execution state a certain message
is generated. It is enabled only when optimizations are disabled, since
function names are not printed otherwise.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* commit 'e4fe535d12f4f30df2dd672e30304af112a5a827':
mov: Write the display matrix in order
Conflicts:
libavformat/mov.c
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This will allow to copy the matrix as is and it is just cleaner to keep
the matrix in the same order specified by the mov standard (which is
also explicitly described in the documentation).
In order to preserve compatibility, flip the angle sign in the display API
av_display_rotation_set() and av_display_rotation_get(), and improve the
documentation mentioning the rotation direction.
* commit '5b1d9ceec715846a58fe029bc3889ed6fa62436a':
pixfmt: add a pixel format for QSV hwaccel
Conflicts:
doc/APIchanges
libavutil/pixfmt.h
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '728685f37ab333ca35980bd01766c78d197f784a':
Add a side data type for audio service type.
Conflicts:
doc/APIchanges
libavcodec/avcodec.h
libavcodec/version.h
libavutil/frame.h
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '0e6c7dfa650e8b0497bfa7a06394b7a462ddc33a':
lavu: add planar 16 bit and 8 bit rgb with alpha
Conflicts:
libavutil/pixdesc.c
libavutil/pixfmt.h
libavutil/version.h
See: e6d4e68755
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Move the lavc/imgconvert functions and rename them as follows:
avpicture_get_size -> av_image_get_buffer_size()
avpicture_fill -> av_image_fill_arrays()
avpicture_layout -> av_image_copy_to_buffer()
The new functions have an align parameter, which allows to define the
linesize alignment assumed in the buffer (which is set or read).
The names of the functions are consistent with the lavu/samples API
(av_samples_get_buffer_size(), av_samples_fill_arrays()).
A redundant check has been dropped from av_image_fill_arrays().
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Supraja Meedinti <supraja0493@gmail.com>
Previous version of this patch reviewed-by: Giorgio Vazzana <mywing81@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Function allows to create string containing object's serialized options.
Such string may be passed back to av_set_options_string() in order to restore options.
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Since av_gettime() is used in a number of places where actual
real time clock is required, the monotonic clock introduced in
ebef9f5a5 would have consequences that are hard to handle. Instead
split it into a separate function that can be used in the cases
where only relative time is desired.
On platform where no monotonic clock is available, the difference
between the two av_gettime functions is not clear, and one could
mistakenly use the relative clock where an absolute one is
required. Therefore add an offset, to make it evident that the
time returned from av_gettime_relative never is actual current
real time, even though it is based on av_gettime.
Based on a patch by Olivier Langlois.
Signed-off-by: Martin Storsjö <martin@martin.st>
* commit '04ccd584a70fad4ebb29ca340d704970ff313cbc':
pixfmt: mark further reserved values
Conflicts:
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Add CODEC_FLAG2_SKIP_MANUAL (exposed as "skip_manual"), which makes
the decoder export sample skip information via side data, instead
of applying it automatically. The format of the side data is the
same as AV_PKT_DATA_SKIP_SAMPLES, but since AVPacket and AVFrame
side data constants overlap, AV_FRAME_DATA_SKIP_SAMPLES needs to
be introduced.
This is useful for applications which want to do the timestamp
calculations manually, or which actually want to retrieve the
padding.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Unfortunately this was not explicitly documented and thus
might be risky.
But all uses I could find in FFmpeg and one in VLC had a memleak
in these cases, and I could not find any that relied on the previous
behaviour.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
The reasoning behind this addition is that various third party
applications are interested in getting some motion information out of a
video "for free" when it is available.
It was considered to export other information as well (such as the intra
information about the block, or the quantization) but the structure
might have ended up into a half full-generic, half full of codec
specific cruft. If more information is necessary, it should either be
added in the "flags" field of the AVMotionVector structure, or in
another side-data.
This commit also includes an example exporting them in a CSV stream.
This allows getting rid of the many, slightly differing, implementations
of basically the same thing.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
In order to support metadata being set as an option, it's necessary to be able
to set dictionaries as values.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
This prevents a build failure when bumping.
the uses could easily be updated / removed, if people prefer.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'f4c444e17d137c786f0ed2da0e5943df505d5f9e':
Postpone API-incompatible changes until the next bump.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
The rationale is that you have a packed format in form
<greyscale sample> <alpha sample> <greyscale sample> <alpha sample>
and shortening greyscale to 'G' might make one thing about Greenscale instead.
An alias pixel format and color space name are provided for compatibility.
* commit 'bb41115d56930b9f5d59e79dca254d1201246967':
imgutils: Do not declare avpriv_set_systematic_pal2 in the public header
Conflicts:
libavutil/internal.h
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '69e7336b8e16ee65226fc20381baf537f4b125e6':
avstring: Expose the simple name match function
Conflicts:
libavutil/avstring.c
libavutil/avstring.h
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Without this patch, "Library Version Macros" module is not visible on
libavutil homepage in `make apidoc`.
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'ab72eda15e98197cf148abc08574206cfde0d9b0':
pixfmt: mark the reserved values
Conflicts:
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '9e500efdbe0deeff1602500ebc229a0a6b6bb1a2':
Add av_image_check_sar() and use it to validate SAR
Conflicts:
libavcodec/dpx.c
libavcodec/dvdec.c
libavcodec/ffv1dec.c
libavcodec/utils.c
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '8c02adc62d71dfbb079a04753d8c16152c49de88':
lavu: add all color-related enums to AVFrame
Conflicts:
libavcodec/avcodec.h
libavutil/frame.c
libavutil/frame.h
libavutil/version.h
The version check is changed so they are available with the current ABI
FFmpeg libs should have no problems with added fields, nor should any
application using the libs, and we regularly added fields in the past.
We also moved 2 of these fields to AVFrame already previously without issues.
See: a80e622924
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Add AV_PKT_DATA_DISPLAYMATRIX and AV_FRAME_DATA_DISPLAYMATRIX as stream and
frame side data (respectively) to describe a display transformation matrix
for linear transformation operations on the decoded video.
Add functions to easily extract a rotation angle from a matrix and
conversely to setup a matrix for a given rotation angle.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
These functions are using the POSIX clock_gettime() function with the
CLOCK_MONOTONIC clock id. If these are not present on the targeted
platform, the new functions will fallback on using the original realtime functions
av_gettime() and av_usleep().
Monotonic support can be added on other platforms with their
equivalent native system API eventually if possible.
Whenever time is requested to measure relative time, the monotonic clock,
when available, is superior to the system realtime clock because it is
not affected by discontinuous jumps in the system time
In a future step, offering the flexibility to let the user choose between
rt and monotonic clock for avdevices packets will be investigated.
It is very easy to experience the issues that this patch attempt to address
by rewinding back in the past the system time while ffmpeg is running.
this is breaking the ffmpeg report printing (ffmepg.c:print_report()) and
the the rate emulator functionality (-re) without the patch.
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>