Commit Graph

3813 Commits

Author SHA1 Message Date
Andreas Cadhalpun
b45e112bbd softfloat: decrease MIN_EXP to cover full float range
floats are not necessarily normalized, so a normalized softfloat needs
MIN_EXP lowered by 23 to cover that range.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 2d6f46d801)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-27 00:46:35 +01:00
Andreas Cadhalpun
ccda73a711 softfloat: handle -INT_MAX correctly
This is similar to commit 9ac61e73d0.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 0edd569466)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-11-27 00:46:35 +01:00
Shivraj Patil
b9ec80322b avutil/mips/generic_macros_msa: rename macro variable which causes segfault for mips r6
Signed-off-by: Shivraj Patil <shivraj.patil@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c1cc13cd2a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-26 15:12:25 +01:00
Kacper Michajłow
d3ecb24539 libavutil/opt: Small bugfix in example.
Fix const corectness and zero init the struct. This example code would actually crash when initializing string.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 69630f4d30)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-15 20:25:13 +02:00
Jan Ekström
3003277103 pgssubdec: fix subpicture output colorspace and range
Functionality used before didn't widen the values from limited to
full range. Additionally, now the decoder uses BT.709 where it
should be used according to the video resolution.

Default for not yet set colorimetry is BT.709 due to most observed
HDMV content being HD.

BT.709 coefficients were gathered from the first two parts of BT.709
to BT.2020 conversion guide in ARIB STD-B62 (Pt. 1, Chapter 6.2.2).
They were additionally confirmed by manually calculating values.

Fixes #4637
(cherry picked from commit 9779b62624)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-27 04:40:12 +02:00
Michael Niedermayer
7dac928e61 avutil/random_seed: Add the runtime in cycles of the main loop to the entropy pool
This should theoretically improve the randomness slightly

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2540d884f3)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-27 04:40:11 +02:00
Martin Cracauer
49fc295612 avutil/channel_layout: AV_CH_LAYOUT_6POINT1_BACK not reachable in parsing
Trying to make heads and tails out of DTS 6.1 I can across this typo.

I also noticed that this wiki page is incorrect or misleading, the
channel order for 6.1 given does not match the source code.  At the
least it should be clarified that the layout given does not apply to
DTS.  https://trac.ffmpeg.org/wiki/AudioChannelManipulation

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 73d1398f0c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-27 04:40:11 +02:00
Michael Niedermayer
23ef5996a5 avutil/pixdesc: Make get_color_type() aware of CIE XYZ formats
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1ec7a70380)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-22 03:50:51 +01:00
Michael Niedermayer
536f6c4ec2 avutil/frame: Free destination qp_table_buf in frame_copy_props()
Fixes memleak
Fixes: Ticket4899

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4099e4a77d)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-13 21:08:23 +01:00
Michael Niedermayer
6fec0dbd2e avutil/opt: check for and handle errors in av_opt_set_dict2()
Previously errors could result in random entries to be lost.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f3ace85d88)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-28 15:53:54 +01:00
James Almer
3e3aa25afa x86/float_dsp: zero extend offset from ff_scalarproduct_float_sse
Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit dc79824deb)
2016-01-08 14:02:27 -03:00
Michael Niedermayer
4608cc176b avutil/mathematics: Fix division by 0
Fixes: CID1341571

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bc8b1e694c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-09 17:53:44 +01:00
Michael Niedermayer
f2258e9899 avutil/timecode: Fix fps check
The fps variable is explicitly set to -1 in case of some errors, the check must
thus be signed or the code setting it needs to use 0 as error code
the type of the field could be changed as well but its in an installed header

Fixes: integer overflow
Fixes: 9982cc157b1ea90429435640a989122f/asan_generic_3ad004a_3799_22cf198d9cd09928e2d9ad250474fa58.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b46dcd5209)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:51:27 +01:00
Michael Niedermayer
e04b039b15 avutil/mathematics: return INT64_MIN (=AV_NOPTS_VALUE) from av_rescale_rnd() for overflows
Fixes integer overflow
Fixes: mozilla bug 1229167

Found-by: Tyson Smith
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f03c2ceec1)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:51:27 +01:00
Michael Niedermayer
460710500e avutil/mathematics: Do not treat INT64_MIN as positive in av_rescale_rnd
The code expects actual positive numbers and gives completely wrong
results if INT64_MIN is treated as positive
Instead clip it into the valid range that is add 1 and treat it as
negative

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 25e37f5ea9)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:51:27 +01:00
Michael Niedermayer
4d9999705f avutil/integer: Fix av_mod_i() with negative dividend
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3a9cb18855)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:51:27 +01:00
James Almer
644296e736 avutil/softfloat: use abort() instead of av_assert0(0)
Fixes compilation of host tool aacps_fixed_tablegen.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 9f4a41bf99)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-27 15:01:22 +01:00
Andreas Cadhalpun
510d88ae93 softfloat: assert when the argument of av_sqrt_sf is negative
The correct result can't be expressed in SoftFloat.
Currently it returns a random value from an out of bounds read.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit f3866a14c3)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:35:45 +01:00
Andreas Cadhalpun
e10c353ca5 softfloat: handle INT_MIN correctly in av_int2sf
Otherwise v=INT_MIN doesn't get normalized and thus triggers av_assert2
in other functions.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 9ac61e73d0)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:00:57 +01:00
Michael Niedermayer
72be96ac55 avutil/softfloat: Include negative numbers in cmp/gt tests
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 955cdc43a3)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:00:57 +01:00
Michael Niedermayer
6581e40e1a avutil/softfloat: Fix av_gt_sf() with large exponents try #2
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 05b05a7a84)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:00:57 +01:00
Michael Niedermayer
0f9c617979 avutil/softfloat: Add test for av_gt_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 791ea23e57)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:00:57 +01:00
Michael Niedermayer
f9998d1994 avutil/softfloat: Extend the av_cmp_sf() test to cover a wider range of exponents
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ecfb076141)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:00:57 +01:00
Michael Niedermayer
7ad4bf4899 avutil/softfloat: Fix overflows in shifts in av_cmp_sf() and av_gt_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cee3c9d29a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:00:57 +01:00
Michael Niedermayer
43ada90fc5 avutil/softfloat: Add test for av_cmp_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit df2a2117d2)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:00:57 +01:00
Ganesh Ajjanagadde
476ddffccb avutil/common: add FFDIFFSIGN macro
This is of use for defining comparator callbacks. Common approaches like
return x-y are not safe due to the risks of overflow.
Furthermore, the (x > y) - (x < y) trick is optimized to branchless
code.
This also documents this macro accordingly.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
(cherry picked from commit 265f83fd35)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 00:00:57 +01:00
Michael Niedermayer
b533998d0a avutil/softfloat: Add tests for exponent underflows
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 596dfe7d6c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-11 23:32:58 +01:00
Michael Niedermayer
acd203fc0d avutil/softfloat: Fix exponent underflow in av_div_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 046218b212)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-11 23:32:54 +01:00
Michael Niedermayer
402c4a9f81 avutil/softfloat: Fix exponent underflow in av_mul_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a1e3303fc0)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-11 23:32:51 +01:00
Michael Niedermayer
6e4bfbe936 avutil/softfloat: Fix typo in av_mul_sf() doxy
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4135a2bfd6)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-11 23:32:48 +01:00
Michael Niedermayer
f38beb47da avutil/softfloat: Correctly set the exponent for 0.0 in av_sqrt_sf()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 107db5abf3)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-11 23:32:32 +01:00
Michael Niedermayer
efa9128556 avutil/softfloat: FLOAT_0 should use MIN_EXP
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a66b243d52)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-11 23:32:27 +01:00
Michael Niedermayer
1290037626 libavutil/channel_layout: Check strtol*() for failure
Fixes assertion failure
Fixes: 4f5814bb15d2dda6fc18ef9791b13816/signal_sigabrt_7ffff6ae7cc9_65_7209d160d168b76f311be6cd64a548eb.wv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c9bfd6a8c3)

Conflicts:

	libavutil/channel_layout.c
2015-11-05 20:47:15 +01:00
Tobias Rapp
c6c801d993 avutil/file_open: avoid file handle inheritance on Windows
Avoids inheritance of file handles on Windows systems similar to the
O_CLOEXEC/FD_CLOEXEC flag on Linux.

Fixes file lock issues in Windows applications when a child process
is started with handle inheritance enabled (standard input/output
redirection) while a FFmpeg transcoding is running in the parent
process.

Links relevant to the subject:

https://msdn.microsoft.com/en-us/library/w7sa2b22.aspx

Describes the _wsopen() function and the O_NOINHERIT flag. File handles
opened by _wsopen() are inheritable by default.

https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425%28v=vs.85%29.aspx

Describes handle inheritance when creating new processes. Handle
inheritance must be enabled (bInheritHandles = TRUE) e.g. when you want
to pass handles for stdin/stdout via lpStartupInfo.

Signed-off-by: Tobias Rapp <t.rapp@noa-audio.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4746653466)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-02 19:15:32 +01:00
Ganesh Ajjanagadde
3fedd64d4b avutil/log: fix zero length gnu_printf format string warning
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>
(cherry picked from commit 63cdb6e4a5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-08 13:15:42 +02:00
James Almer
1a56be9cdc avutil: undo FF_API_CRYPTO_CONTEXT deprecation for 2.8 release
There's no consensus yet if this deprecation is desired, so it's removed
from this release for the time being

Signed-off-by: James Almer <jamrial@gmail.com>
2015-09-05 13:02:29 -03:00
Michael Niedermayer
d6cd614dac avutil/common: Add FFNABS()
This macro avoids the undefined corner case with the *_MIN values

Previous version Reviewed-by: Ganesh Ajjanagadde <gajjanag@mit.edu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-03 09:05:50 +02:00
Michael Niedermayer
733511fb53 avutil/common: Document FFABS() corner case
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-03 02:18:01 +02:00
Hendrik Leppkes
fd2977d85f Merge commit 'e23f84d9652474353d8bbc42787a56ec1991908f'
* commit 'e23f84d9652474353d8bbc42787a56ec1991908f':
  channel_layout: Add a 16channel default layout

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-08-24 10:40:24 +02:00
Luca Barbato
e23f84d965 channel_layout: Add a 16channel default layout
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-08-23 21:44:38 +02:00
Andreas Cadhalpun
095347ffe4 disable deprecation warnings in deprecated code
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-08-22 19:16:14 +02:00
Timothy Gu
c5d9e9b354 doxygen: Remove lavu_internal group
There is no use in an internal group for a public API documentation.
2015-08-22 10:07:05 -07:00
Timothy Gu
0aa9bbbc37 version: Fix two more typos
Same as cafba99b51 but applied to
lavf and lavu.
2015-08-22 08:09:03 -07:00
Ganesh Ajjanagadde
531b0a316b avutil/x86/asm: rename REG_SP to REG_sp
REG_SP is defined by Solaris system headers.
This fixes a sea of warnings while building on Solaris:
http://fate.ffmpeg.org/report.cgi?time=20150820233505&slot=x86-opensolaris-gcc4.3

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-22 02:56:53 +02:00
Michael Niedermayer
0b7829901b */version.h: Add note/recommandition about bumping major
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-19 21:37:32 +02:00
Paul B Mahol
2fa019958b avfilter: add showfreqs filter 2015-08-19 16:15:13 +00:00
Gwenole Beauchesne
9f8e57efe4 vaapi: define a unique pixel format for VA-API (AV_PIX_FMT_VAAPI).
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>
2015-08-19 14:03:24 +02:00
Ronald S. Bultje
87068ea5c5 lavu: disable wrong value check in get_version() upon api bump. 2015-08-18 15:57:20 -04:00
Ronald S. Bultje
3285005347 Undeprecate av_opt_set_defaults2(). 2015-08-18 13:09:06 -04:00
Ronald S. Bultje
ad45121d56 options: mark av_get_{int,double,q} as deprecated.
Convert last users to av_opt_get_*() counterparts.
2015-08-18 12:05:17 -04:00