summaryrefslogtreecommitdiff
path: root/libavutil
Commit message (Collapse)AuthorAge
* intmath: remove av_ctz.Ronald S. Bultje2015-10-11
| | | | | It's a non-installed header and only used in one place (flacenc). Since ff_ctz is static inline, it's fine to use that instead.
* avutil/intmath: Change debruijn_ctz64 to use 8bit elementsMichael Niedermayer2015-10-11
| | | | | | | This reduces the memory & cache need from 256 to 64 bytes the code also seems faster with this change Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/mathematics: speed up av_gcd by using Stein's binary GCD algorithmGanesh Ajjanagadde2015-10-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses Stein's binary GCD algorithm: https://en.wikipedia.org/wiki/Binary_GCD_algorithm to get a roughly 4x speedup over Euclidean GCD on standard architectures with a compiler intrinsic for ctzll, and a roughly 2x speedup otherwise. At the moment, the compiler intrinsic is used on GCC and Clang due to its easy availability. Quick note regarding overflow: yes, subtractions on int64_t can, but the llabs takes care of that. The llabs is also guaranteed to be safe, with no annoying INT64_MIN business since INT64_MIN being a power of 2, is shifted down before being sent to llabs. The binary GCD needs ff_ctzll, an extension of ff_ctz for long long (int64_t). On GCC, this is provided by a built-in. On Microsoft, there is a BitScanForward64 analog of BitScanForward that should work; but I can't confirm. Apparently it is not available on 32 bit builds; so this may or may not work correctly. On Intel, per the documentation there is only an intrinsic for _bit_scan_forward and people have posted on forums regarding _bit_scan_forward64, but often their documentation is woeful. Again, I don't have it, so I can't test. As such, to be safe, for now only the GCC/Clang intrinsic is added, the rest use a compiled version based on the De-Bruijn method of Leiserson et al: http://supertech.csail.mit.edu/papers/debruijn.pdf. Tested with FATE, sample benchmark (x86-64, GCC 5.2.0, Haswell) with a START_TIMER and STOP_TIMER in libavutil/rationsl.c, followed by a make fate. aac-am00_88.err: builtin: 714 decicycles in av_gcd, 4095 runs, 1 skips de-bruijn: 1440 decicycles in av_gcd, 4096 runs, 0 skips previous: 2889 decicycles in av_gcd, 4096 runs, 0 skips Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavu/opt: add flag to return NULL when applicable in av_opt_getRodger Combs2015-10-09
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavu/opt: switch AV_OPT flags to shift-based formattingRodger Combs2015-10-09
|
* avutil/attributes: add av_warn_unused_resultGanesh Ajjanagadde2015-10-05
| | | | | | | | | | | | | | GCC 3.4 introduced an attribute warn_unused_result to warn when a programmer discards the return value. Applying this judiciously across the codebase can help in fixing a lot of problems. At a high level, functions which return error codes should always be checked. More concretely, consider the functions ff_add_format and the like in avfilter/formats.h. A quick examination shows that a large portion of libavfilter fails to handle the associated errors, usually AVERROR(ENOMEM). The above example was where I observed the utility of this, but it should be useful in many places across the code base. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '1aa24df74c052a73175c43e57d35b4835e537ec8'Hendrik Leppkes2015-10-03
|\ | | | | | | | | | | | | * commit '1aa24df74c052a73175c43e57d35b4835e537ec8': lavu: Deprecate AVFrame.error[] Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavu: Deprecate AVFrame.error[]Vittorio Giovara2015-09-30
| | | | | | | | | | | | | | | | | | | | | | 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>
| * mips: intreadwrite: Only execute that code for mips r1 or r2Vicente Olivert Riera2015-09-29
| | | | | | | | | | | | | | | | | | MIPS R6 supports unaligned memory access and does not have the load/store-left/right family of instructions. Signed-off-by: Vicente Olivert Riera <Vincent.Riera at imgtec.com> Signed-off-by: Luca Barbato <lu_zero at gentoo.org> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * pixfmt: Add new SMPTE color primaries and transfer characteristic valuesKevin Wheatley2015-09-17
| | | | | | | | | | | | Appeared in ITU-T Rec H.265 10/2014. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | x86inc: Make cpuflag() and notcpuflag() return 0 or 1Henrik Gramner2015-10-01
| | | | | | | | Makes it possible to use them in arithmetic expressions.
* | avutil/avstring: Inline some tiny functionsHenrik Gramner2015-09-26
| | | | | | | | | | They're short enough that inlining them actually reduces code size due to all the overhead associated with making a function call.
* | avutil/opencl: Fix volatile pointerTimo Rothenpieler2015-09-26
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* | avutil/attributes: add AV_GCC_VERSION_AT_MOSTJames Almer2015-09-18
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
* | avutil/log: fix zero length gnu_printf format string warningGanesh Ajjanagadde2015-09-17
| | | | | | | | | | | | | | | | | | This should fix warning reported by fate client: http://fate.ffmpeg.org/report.cgi?time=20150917113121&slot=x86_32-linux-gnu-gcc-4.5.1-have_6regs. Untested. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavu/avstring: switch AV_ESCAPE_FLAGs to shift-based formattingRodger Combs2015-09-15
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '7b02cb29d9d60cdd5ef321043d11d02023e7dc8f'Hendrik Leppkes2015-09-12
|\| | | | | | | | | | | | | * commit '7b02cb29d9d60cdd5ef321043d11d02023e7dc8f': pixdesc: Document the component order Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * pixdesc: Document the component orderLuca Barbato2015-09-10
| |
| * pixdesc: Add missing alpha flag for yuva420p9beHendrik Leppkes2015-09-10
| | | | | | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit 'e336c51e6ffcdb93fbcf3c6153d378400608526b'Hendrik Leppkes2015-09-12
|\| | | | | | | | | | | | | * commit 'e336c51e6ffcdb93fbcf3c6153d378400608526b': pixdesc: Consistently order components Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * pixdesc: Consistently order componentsHendrik Leppkes2015-09-10
| | | | | | | | | | | | | | | | Ensure that the components are ordered consistently, ie. always RGB(A) and YUV(A). This allows to identify a specific plane on a given pixel format without hard-coding knowledge of the plane order. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | x86: port PSIGNW to cpuflagsJames Almer2015-09-11
| | | | | | | | | | Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | avutil/version: Bump for avpriv_get_trc_function_from_trc() and ↵Michael Niedermayer2015-09-11
| | | | | | | | | | | | AVCOL_PRI/TRC_SMPTEST428_1 and AVCOL_TRC_SMPTEST2084 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/color_utils: Add basic transfer functions for each ↵Kevin Wheatley2015-09-10
| | | | | | | | | | | | | | | | | | | | AVColorTransferCharacteristic Most functions are valid over a domain and range of [0.0-1.0] but some are defined over greater. This patch does not deal with AVColorRange and assumes AVCOL_RANGE_JPEG for the returned values. Signed-off-by: Kevin Wheatley <kevin.j.wheatley@gmail.com>
* | avutil/pixfmt: Name "SMPTE ST 428-1" in AVColorPrimaries the same as in ↵Michael Niedermayer2015-09-10
| | | | | | | | | | | | AVColorTransferCharacteristic Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/pixdesc: Use "-" in color_primaries_names to be consistent with ↵Michael Niedermayer2015-09-10
| | | | | | | | | | | | color_transfer_names Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/pixdesc: Add SMPTE ST 2084 and ST 428-1 pixel descriptionsKevin Wheatley2015-09-10
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/pixfmt: Add additional primaries and transfer characteristic ↵Kevin Wheatley2015-09-10
| | | | | | | | | | | | | | | | enumerations from ITU-T Rec H.265 Signed-off-by: Kevin Wheatley <kevin.j.wheatley@gmail.com> Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/opt: refactor pixel/sample fmt common caseClément Bœsch2015-09-08
| |
* | avutil/opt: add AV_OPT_TYPE_BOOLClément Bœsch2015-09-08
| |
* | Replace all remaining occurances of step/depth_minus1 and offset_plus1Hendrik Leppkes2015-09-08
| |
* | Merge commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba'Hendrik Leppkes2015-09-08
|\| | | | | | | | | | | | | * commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba': lavu: Drop the {minus,plus}1 suffix from AVComponentDescriptor fields Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavu: Drop the {minus,plus}1 suffix from AVComponentDescriptor fieldsVittorio Giovara2015-09-07
| | | | | | | | | | | | The new fields can be accessed directly and are more intelligible. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit '6b3ef7f080293956b2e5212b83135c6b051212e9'Hendrik Leppkes2015-09-08
|\| | | | | | | | | | | | | * commit '6b3ef7f080293956b2e5212b83135c6b051212e9': lavu: Remove bit packing from AVComponentDescriptor Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavu: Remove bit packing from AVComponentDescriptorVittorio Giovara2015-09-07
| | | | | | | | | | | | | | | | | | There is no practical benefit in having this structure elements bit packed given the size of the structure and its usage. Change types from uint16_t (packed) to plain int in order to simplify modifying the structure and accessing its fields. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'b8b5d8274471129f122858bc74ad09284dae6ab7'Hendrik Leppkes2015-09-08
|\| | | | | | | | | | | | | * commit 'b8b5d8274471129f122858bc74ad09284dae6ab7': lavu: extend size of the AVPixFmtDescriptor.flags field Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavu: extend size of the AVPixFmtDescriptor.flags fieldwm42015-09-07
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'a686e58165ca0f83966431a9166cb6e17bf6095c'Hendrik Leppkes2015-09-07
|\| | | | | | | | | | | | | * commit 'a686e58165ca0f83966431a9166cb6e17bf6095c': des: Add missing include Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * des: Add missing includeVittorio Giovara2015-08-31
| |
* | Merge commit 'e88103a7f92cf27a2868b50acc8a9912f6088249'Hendrik Leppkes2015-09-05
|\| | | | | | | | | | | | | * commit 'e88103a7f92cf27a2868b50acc8a9912f6088249': Bump major versions of all libraries Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * Bump major versions of all librariesVittorio Giovara2015-08-28
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avutil/pixfmt: remove duplicate AVPixelFormat valuesJames Almer2015-09-05
| | | | | | | | | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: James Almer <jamrial@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.
* | lavu: Drop old deprecated AVOption APIHendrik Leppkes2015-09-05
| | | | | | | | Deprecated in 2011/10
* | lavu/hmac: remove deprecated type idsHendrik Leppkes2015-09-05
| |
* | Remove FF_CONST_AVUTIL55 cruftHendrik Leppkes2015-09-05
| |
* | Merge commit '4e649debcf7f71d35c6b38cdb7ee715eba95d64a'Hendrik Leppkes2015-09-05
|\| | | | | | | | | | | | | * commit '4e649debcf7f71d35c6b38cdb7ee715eba95d64a': Postpone API-incompatible changes until the next bump Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * Postpone API-incompatible changes until the next bumpVittorio Giovara2015-08-28
| |
* | Merge commit '3d89373fae281053154772d5e3e4370da09d3880'Hendrik Leppkes2015-09-05
|\| | | | | | | | | | | | | | | | | * commit '3d89373fae281053154772d5e3e4370da09d3880': lavu: Drop deprecated private lls functions Previously removed in ffmpeg Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavu: Drop deprecated private lls functionsVittorio Giovara2015-08-28
| | | | | | | | Deprecated in 02/2013.