summaryrefslogtreecommitdiff
path: root/libavutil/internal.h
Commit message (Collapse)AuthorAge
* Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt2021-09-20
| | | | | | | They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavu/internal: add FF_FIELD_AT().Nicolas George2021-08-14
|
* avutil/internal: Move MAKE_ACCESSORS to its only userAndreas Rheinhardt2021-08-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Move ff_tlog() from lavc/internal.h to lavu/internal.hAndreas Rheinhardt2021-08-05
| | | | | | | It is also used by libavfilter and it is only natural to define it alongside ff_dlog(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/internal, swresample/audioconvert: Remove cpu.h inclusionsAndreas Rheinhardt2021-07-22
| | | | | | | | | | These inclusions are not necessary, as cpu.h is already included wherever it is needed (via direct inclusion or via the arch-specific headers). Also remove other unnecessary cpu.h inclusions from ordinary non-headers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/buffer: Switch AVBuffer API to size_tAndreas Rheinhardt2021-04-27
| | | | | | | Announced in 14040a1d913794d9a3fd6406a6d8c2f0e37e0062. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/pixdesc: Remove deprecated AV_PIX_FMT_FLAG_PSEUDOPALAndreas Rheinhardt2021-04-27
| | | | | | | Deprecated in d6fc031caf64eed921bbdef86d79d56bfc2633b0. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/common: Add FF_PTR_ADD()Michael Niedermayer2021-03-31
| | | | | Suggested-by: Andreas Rheinhardt Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/buffer: change public function and struct size parameter types to size_tJames Almer2021-03-10
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavu/mem: move the DECLARE_ALIGNED macro family to mem_internal on next+1 bumpAnton Khirnov2021-01-01
| | | | They are not properly namespaced and not intended for public use.
* lavu: move LOCAL_ALIGNED from internal.h to mem_internal.hAnton Khirnov2021-01-01
| | | | That is a more appropriate place for it.
* lavu/internal: Fix comment for avpriv_dict_set_timestampJun Zhao2020-06-14
| | | | | | Fix comment for avpriv_dict_set_timestamp from b72a7b96f84 Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avutil/internal: remove FF_ALLOCx{_ARRAY}_OR_GOTO macrosLimin Wang2020-06-13
| | | | | | | | | | | | | | | | | These functions have a terrible design, let us fix them before extending them. First design mistake: no error code. A helper function for testing memory allocation failure where AVERROR(ENOMEM) does not appear is absurd. Second design mistake: printing a message. Return the error code, let the caller print the error message. Third design mistake: hard-coded use of goto. http://ffmpeg.org/pipermail/ffmpeg-devel/2020-May/262544.html Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/h264dec: remove FF_ALLOCZ_ARRAY_OR_GOTO and gotos lableLimin Wang2020-06-13
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* lavu/internal: Replace an empty loop with "do {}".Carl Eugen Hoyos2018-12-19
| | | | | | | Silences a clang warning when not compiling for x86: libswscale/utils.c:345:13: warning: while loop has empty body Suggested-by: Nicolas George
* avutil/pixdesc: deprecate AV_PIX_FMT_FLAG_PSEUDOPALwm42018-04-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge commit '3152058bf1dca318898550efacf0286f4836cae6'James Almer2017-11-19
|\ | | | | | | | | | | | | * commit '3152058bf1dca318898550efacf0286f4836cae6': libavcodec: Don't use dllexport, only dllimport when building DLLs Merged-by: James Almer <jamrial@gmail.com>
* | Avoid corrupting diagnostic state with _Pragma changes.Dale Curtis2017-11-14
| | | | | | | | | | | | | | | | | | | | | | The macros for ICC and MSVC correctly push and pop the diagnostic state of the compiler when disabling deprecation warnings. The ones for clang/gcc should do the same. Without this, if a blanket deprecation warning is applied to the code base it'll be flipped back on incorrectly with FF_ENABLE_DEPRECATION_WARNINGS. Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'accb06120c13a4ead442464d96f2fa318fa07a4e'James Almer2017-11-11
|\| | | | | | | | | | | | | * commit 'accb06120c13a4ead442464d96f2fa318fa07a4e': configure: Use dllexport/dllimport for data symbols across DLLs with mingw Merged-by: James Almer <jamrial@gmail.com>
* | Merge commit 'abf1c058d1bd0ed1b820ea5e501a4484756f00b0'James Almer2017-11-11
|\| | | | | | | | | | | | | * commit 'abf1c058d1bd0ed1b820ea5e501a4484756f00b0': msvc: Properly specify dllexport for data symbols shared across dll boundaries Merged-by: James Almer <jamrial@gmail.com>
| * msvc: Properly specify dllexport for data symbols shared across dll boundariesMartin Storsjö2017-08-31
| | | | | | | | | | | | | | | | | | We currently only have exported data symbols within libavcodec, but the concept is easy to extend to other libraries if necessary. The attribute declaration needs to be in a private header though, since we can't use CONFIG_SHARED in public installed headers. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '10f4511f14a4e830c0ed471df4cd1cc2a18a481a'James Almer2017-10-26
|\| | | | | | | | | | | | | | | | | | | * commit '10f4511f14a4e830c0ed471df4cd1cc2a18a481a': libavutil: Make LOCAL_ALIGNED(xx be equal to LOCAL_ALIGNED_xx( Also added LOCAL_ALIGNED_4 as it's used in vp8 decoder, and simplified the configure defines. Merged-by: James Almer <jamrial@gmail.com>
| * libavutil: Make LOCAL_ALIGNED(xx be equal to LOCAL_ALIGNED_xx(Martin Storsjö2017-03-31
| | | | | | | | | | | | | | | | | | | | | | Previously, the former form always produced a manually aligned, padded buffer, while the latter can use DECLARE_ALIGNED, if that amount of stack alignment is supported. libavutil/internal.h needs to include mem.h, since it uses the DECLARE_ALIGNED macro. Signed-off-by: Martin Storsjö <martin@martin.st>
| * lavu: add LOCAL_ALIGNED_32James Almer2016-08-03
| | | | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | avutil/internal: Do not enable CHECKED with DEBUGMichael Niedermayer2017-04-11
| | | | | | | | | | | | | | | | | | This avoids potential undefined behavior in debug mode while still allowing developers which want to check for potential additional overflows to do so by manually enabling this. Reviewed-by: wm4 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Factorize CHECK/SUINT codeMichael Niedermayer2017-02-21
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Factor CHECKED out of DEBUG so it can be set seperatlyMichael Niedermayer2017-02-19
| | | | | | | | | | Suggested-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/reverse: move the ff_reverse declaration to a separate headerJames Almer2017-01-12
| | | | | | | | | | | | | | | | Fixes compilation with hardcoded tables after eaff1aa09e90e2711207c9463db8bf8e8dec8178 and e71b8119e7db675dd2dac3f7fb069b0df2943c38 Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat: factorize iso 8601 timestamp writer to a dictionary avutil functionMarton Balint2016-08-17
| | | | | | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* | all: move ff_exp10, ff_exp10f, ff_fast_powf to lavu/ffmath.hGanesh Ajjanagadde2016-03-22
| | | | | | | | | | | | | | | | | | | | | | The idea is to use ffmath.h for internal implementations of math functions. Currently, it is used for variants of libm functions, but is by no means limited to such things. Note that this is not exported; use lavu/mathematics for such purposes. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanag@gmail.com>
* | lavc/aacenc_utils: replace powf(x,y) by expf(logf(x), y)Ganesh Ajjanagadde2016-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is ~2x faster for y not an integer on Haswell+GCC, and should generally be faster due to the fact that anyway powf essentially does this under the hood. Made an inline function in lavu/internal.h for this purpose. Note that there are some accuracy differences, that should generally be negligible. In particular, FATE still passes on this platform. Results in ~ 7% speedup in aac encoding with -march=native, Haswell+GCC. before: ffmpeg -i sin.flac -acodec aac -y sin_new.aac 6.05s user 0.06s system 104% cpu 5.821 total after: ffmpeg -i sin.flac -acodec aac -y sin_new.aac 5.67s user 0.03s system 105% cpu 5.416 total This is also faster than an alternative approach that pulls in powf, gets rid of the crufty NaN checks and other special cases, exploits knowledge about the intervals, etc. This of course does not exclude smarter approaches; just suggests that there would need to be significant work on this front of lower utility than searches for hotspots elsewhere. Reviewed-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanag@gmail.com>
* | avutil/file: Move av_tempfile() to avutil/file_open ff_tempfile()Michael Niedermayer2016-03-12
| | | | | | | | | | | | | | document the issue with av_tempfile() Tested-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '50078c1c8070dd8d1c329e8117ff30ec72489039'Hendrik Leppkes2016-01-02
|\| | | | | | | | | | | | | * commit '50078c1c8070dd8d1c329e8117ff30ec72489039': libavutil: move FFALIGN macro from common.h to macros.h Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * libavutil: move FFALIGN macro from common.h to macros.hJanne Grunau2015-12-14
| | | | | | | | | | | | | | | | | | Include macros.h explicitly in common.h so that external code using FFALIGN does not break. It was already implicitly included through version.h. Include macros.h in lls.h and internal.h for FFALIGN. lls.h was including common.h only for FFALIGN and internal.h was missing the include for FFALIGN. `make checkheaders` did not catch it because it's an internal header.
* | lavu/internal: add ff_exp10Ganesh Ajjanagadde2015-12-25
| | | | | | | | | | | | | | | | | | | | | | | | | | Fast, reasonably accurate 10^x. Alternative of detection of libm exp10 at configure time is not worth the trouble, since it is anyway not POSIX or ISO C, and currently only the GNU libm has it. Furthermore, GNU libm's variant is ~ 2x slower, and is ironically not correctly rounded (2 ulp off) to justify all that slowdown. Reviewed-by: James Almer <jamrial@gmail.com> Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | cosmetics: Fix weird indentationsTimothy Gu2015-12-07
| |
* | avutil: Move av_rint64_clip_* to internal.hMichael Niedermayer2015-11-15
| | | | | | | | | | | | | | | | | | | | The function is renamed to ff_rint64_clip() This should avoid build failures on VS2012 Feel free to changes this to a different solution Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/internal: add av_warn_unused_result to avpriv_openGanesh Ajjanagadde2015-10-16
| | | | | | | | | | | | | | | | The open syscall can obviously fail, and its return code needs to be checked. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | lavu: Drop FF_API_GET_CHANNEL_LAYOUT_COMPAT cruftHendrik Leppkes2015-09-05
| | | | | | | | | | 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.
* | Move ff_dlog from lavc to lavu.Ronald S. Bultje2015-08-18
| |
* | avutil: add ff_reverse as av_reverse replacementAndreas Cadhalpun2015-08-12
| | | | | | | | | | | | | | The table is used in libavutil/eval.c. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | Put a space between string literals and macros.Chris Watkins2015-07-07
| | | | | | | | | | | | | | | | | | When compiling libavutil/internal.h as C++11, clang warns that a space is required between a string literal and an identifier. Put spaces in concatenations of string literals and EXTERN_PREFIX. Signed-off-by: Chris Watkins <watk@chromium.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'a6f19d6a9f8d1e08653d9d77581e8c823f4955c2'Michael Niedermayer2015-06-08
|\| | | | | | | | | | | | | | | | | | | | | * commit 'a6f19d6a9f8d1e08653d9d77581e8c823f4955c2': configure: Support MSVC 2015 Conflicts: configure libavutil/internal.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * configure: Support MSVC 2015Luca Barbato2015-06-08
| | | | | | | | | | | | | | | | | | | | | | The C runtime C99 compatibility had been improved a lot and it now rejects some of the compatibility defines provided for the older versions. Many thanks to Ray for the time spent testing. Bug-Id: 864 CC: libav-stable@libav.org
* | avutil/internal: Suppress empty body warning from emms_c()Michael Niedermayer2015-05-06
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | configure: Make compilable with VS2015 (missing hunk)Peter Tissen2015-03-06
| | | | | | | | | | | | | | This hunk was missing in the github pull request when i downloaded it, but is needed Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil: move internal function out of public headerwm42015-02-10
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Factorize avpriv_mirror() outMichael Niedermayer2015-01-05
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '277ff7f5dc134f1c2dfc4ea0ef3540340482e3d2'Michael Niedermayer2014-11-24
|\| | | | | | | | | | | | | | | | | | | | | * commit '277ff7f5dc134f1c2dfc4ea0ef3540340482e3d2': lavu: move internal define to the only places where it is used Conflicts: libavcodec/h264_cabac.c libavutil/internal.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavu: move internal define to the only places where it is usedVittorio Giovara2014-11-24
| |