Marton Balint
8fccd6d510
avutil/rational: increase av_d2q precision
...
Fixes parsing small timebases from expressions (where the expression API
converts the result to double), like in this command line:
ffprobe -f lavfi -i testsrc=d=1,settb=1/2000000000 -show_streams -show_entries stream=time_base
Before the patch timebase was parsed as 1/1999999999.
Signed-off-by: Marton Balint <cus@passwd.hu>
9 months ago
Nicolas George
6b65c4ec54
lavu: add av_gcd_q().
5 years ago
Ganesh Ajjanagadde
7dabc78ce1
lavu/rational: add more info regarding floor(x+0.5) usage
...
Add some more verbose info regarding why the imprecise and slow floor(x+0.5) hack
is used; helpful for future maintenance.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanag@gmail.com>
9 years ago
Michael Niedermayer
97b8db334a
avutil/rational: Test av_rescale_rnd() with combinations of "special" values
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Ganesh Ajjanagadde
8d9f86bd37
avutil/rational: use frexp rather than ad-hoc log to get floating point exponent
...
This simplifies and cleans up the code.
Furthermore, it is much faster due to absence of the slow log computation.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
9 years ago
Michael Niedermayer
1fb9b2a283
avutil: Add av_q2intfloat()
...
This function allows writing AVRationals as IEEE floats without the need
of platform dependant float operations
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
827af24230
avutil/rational: Check that av_reduce() returns values within the requested max
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
cd7037dd7a
avutil/rational: av_add_stable() test code
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
46ad287a2a
avutil/rational: avoid llrint() and rint()
...
This should workaround issues with these functions on ia64 and sparc64
Fixes Ticket2713
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
887d74c47e
av_d2q: Add a special case for |value| > MAX and |value| < 1/MAX
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
d480b36db4
av_d2q: Avoid llrint(), its not correctly implemented in old netbsd
...
This should fix some fate failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
64eacb839e
av_d2q: fix rounding for negative values
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
de7d290631
av_d2q: Fix infinity check
...
The old check would fail on huge but not infinite values
and the later code could then fail to handle them correctly in
some cases.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
d46c588f3c
Remove commented-out #includes
12 years ago
Michael Niedermayer
0efcf16a3e
replace av_log(0, by av_log(NULL,
...
The first parameter is a pointer and NULL is more correct
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
6204ea17f1
rational: test add/sub too
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
80391552c9
libavutil: Remove pointless rational test program.
13 years ago
Yordan Makariev
425b45d4b0
Code clean-up for crc.c, lfg.c, log.c, random_see.d, rational.c and tree.c.
...
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
13 years ago
Diego Biurrun
812f2376ee
rational-test: Add proper main() declaration to fix gcc warnings.
14 years ago
Mans Rullgard
2912e87a6c
Replace FFmpeg with Libav in licence headers
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Michael Niedermayer
59a3bf0e51
Add selftest code for av_cmp_q().
...
Originally committed as revision 25339 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Stefano Sabatini
6b4ed22f75
Make av_d2q() manage the case in which the value to convert is inf.
...
Originally committed as revision 25332 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Stefano Sabatini
1405782cf4
Avoid cast of double nan to int.
...
It may cause exceptions on some platform.
Originally committed as revision 25311 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Måns Rullgård
b64b4134d5
Rename libavutil/assert.h to avassert.h
...
This avoids conflicts with the system assert.h.
Originally committed as revision 25284 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Michael Niedermayer
b926b6282d
av_assert() system.
...
With this the developer can now choose if he wants an assert always enabled or at which
compile time assert level. This can thus replace the #define NDEBUG hacks
Originally committed as revision 25278 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
David Conrad
31fdd64194
Convert NaN to 0/0 in av_d2q
...
This fixes aspect ratio calculation for encoding from files with 0/0 stored,
common with ogg/theora
Originally committed as revision 23280 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Diego Biurrun
ba87f0801d
Remove explicit filename from Doxygen @file commands.
...
Passing an explicit filename to this command is only necessary if the
documentation in the @file block refers to a file different from the
one the block resides in.
Originally committed as revision 22921 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Diego Biurrun
bad5537e2c
Use full internal pathname in doxygen @file directives.
...
Otherwise doxygen complains about ambiguous filenames when files exist
under the same name in different subdirectories.
Originally committed as revision 16912 to svn://svn.ffmpeg.org/ffmpeg/trunk
16 years ago
Diego Biurrun
674bd4f691
cosmetics: Use 'num' instead of 'nom' as abbreviation for numerator.
...
Originally committed as revision 16910 to svn://svn.ffmpeg.org/ffmpeg/trunk
16 years ago
Diego Biurrun
89c9ff504b
spelling/grammar/consistency review part I
...
Originally committed as revision 16840 to svn://svn.ffmpeg.org/ffmpeg/trunk
16 years ago
Diego Biurrun
dfcb6b56f9
Directly #include a bunch of indirectly #included headers.
...
Originally committed as revision 16748 to svn://svn.ffmpeg.org/ffmpeg/trunk
16 years ago
Aurelien Jacobs
9ce6c13879
export gcd function as av_gcd()
...
Originally committed as revision 16653 to svn://svn.ffmpeg.org/ffmpeg/trunk
16 years ago
Stefano Sabatini
05b90fc0c5
Implement av_nearer_q() and av_find_nearest_q_idx() functions.
...
Originally committed as revision 15415 to svn://svn.ffmpeg.org/ffmpeg/trunk
16 years ago
Diego Biurrun
e5a389a1b7
license header consistency cosmetics
...
Originally committed as revision 9484 to svn://svn.ffmpeg.org/ffmpeg/trunk
18 years ago
Dujardin Bernard
0b0065992e
move doxy comments from rational.c to rational.h and add some new comments
...
patch by Dujardin Bernard %dujardin P iut A numericable P fr%
Originally committed as revision 8132 to svn://svn.ffmpeg.org/ffmpeg/trunk
18 years ago
Michael Niedermayer
6880edab82
fix av_reduce() with things like 1/0 and 0/0
...
Originally committed as revision 7431 to svn://svn.ffmpeg.org/ffmpeg/trunk
18 years ago
Michael Niedermayer
62b9fc1571
fix overflow and remove wrong comment
...
Originally committed as revision 7187 to svn://svn.ffmpeg.org/ffmpeg/trunk
18 years ago
Michael Niedermayer
3db1b8b538
return optimal fraction
...
based on a patch by Uoti Urpala
Originally committed as revision 7186 to svn://svn.ffmpeg.org/ffmpeg/trunk
18 years ago
Diego Biurrun
c26abfa541
Rename ABS macro to FFABS.
...
Originally committed as revision 6666 to svn://svn.ffmpeg.org/ffmpeg/trunk
18 years ago
Diego Biurrun
b78e7197a8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
...
and fix GPL/LGPL version mismatches.
Originally committed as revision 6577 to svn://svn.ffmpeg.org/ffmpeg/trunk
18 years ago
Michael Niedermayer
79dc59b726
simplify
...
Originally committed as revision 5802 to svn://svn.ffmpeg.org/ffmpeg/trunk
19 years ago
Michael Niedermayer
0912bf577a
for floats fabs is better & smaller then ABS
...
Originally committed as revision 5801 to svn://svn.ffmpeg.org/ffmpeg/trunk
19 years ago
Diego Biurrun
5509bffa88
Update licensing information: The FSF changed postal address.
...
Originally committed as revision 4842 to svn://svn.ffmpeg.org/ffmpeg/trunk
19 years ago
Diego Biurrun
115329f160
COSMETICS: Remove all trailing whitespace.
...
Originally committed as revision 4749 to svn://svn.ffmpeg.org/ffmpeg/trunk
19 years ago
Alexander Strasser
c11c2bc20b
libavutil: Utility code from libavcodec moved to a separate library.
...
Originally committed as revision 4489 to svn://svn.ffmpeg.org/ffmpeg/trunk
20 years ago
Michael Niedermayer
5c07b9e914
more comments
...
Originally committed as revision 3317 to svn://svn.ffmpeg.org/ffmpeg/trunk
21 years ago
Michael Niedermayer
bf63eb4bba
av_d2q() documentation
...
Originally committed as revision 2522 to svn://svn.ffmpeg.org/ffmpeg/trunk
21 years ago
Michael Niedermayer
33a6984b8c
BSD doesnt have log2
...
Originally committed as revision 2407 to svn://svn.ffmpeg.org/ffmpeg/trunk
21 years ago
Michael Niedermayer
5ff85f1d8b
AVRational
...
sample_aspect_ratio
aspect ratio in JPEG JFIF is SAR not DAR !
removed nonsense SAR guessing code
various related cleanups
bugs?
Originally committed as revision 2403 to svn://svn.ffmpeg.org/ffmpeg/trunk
21 years ago