Commit Graph

4077 Commits

Author SHA1 Message Date
Stefano Sabatini
e8a9b64410 lavu/base64: add AV_BASE64_DECODE_SIZE() macro
This is consistent with the AV_BASE64_SIZE macro and avoids the literal
use of constants in the code.
2016-04-02 12:48:21 +02:00
wm4
f099cb2f8a lavu: improve documentation of some AVFrame functions 2016-04-01 12:52:12 +02:00
Lou Logan
06eef96b69 fix some a/an typos
Signed-off-by: Lou Logan <lou@lrcd.com>
2016-03-28 14:13:17 -08:00
Thilo Borgmann
4ebf0b109c lavu/dict: Add new flag to allow multiple equal keys. 2016-03-25 17:08:11 +01:00
Michael Niedermayer
54f43984e1 avutil/parseutils: mark args as static const
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-24 19:31:02 +01:00
Petru Rares Sincraian
f707042c93 Added more tests to libavutil/parseutils.c
- Added tests for av_find_info_tag().
    - Added test for av_get_known_color_name()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-24 19:29:43 +01:00
Petru Rares Sincraian
68e5976543 Refactor libavutil/parseutils.c
All tests were in the main method which produces a long main. Now, each test
is in his own method.

I think this produces a more clear code and follows more with the main
priority of FFmpeg "simplicity and small code size"

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-24 03:38:12 +01:00
Ganesh Ajjanagadde
db1a642cd2 all: move ff_exp10, ff_exp10f, ff_fast_powf to lavu/ffmath.h
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>
2016-03-22 10:15:31 -07:00
Petru Rares Sincraian
124526ba1a Added a selftest to libavutil/display.c
- Check if av_display_rotation_get() gets the correct degrees
    - Check if av_display_rotation_set() sets the correct matrix
    - Check if av_display_matrix_flip() changes correct the matrix

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-22 17:24:55 +01:00
Ganesh Ajjanagadde
bccc81dfa0 lavc/aacenc_utils: replace powf(x,y) by expf(logf(x), y)
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>
2016-03-18 07:47:25 -07:00
Marton Balint
c3c7a879ba avutil/dict: add warning to docs about invalidating existing entries when adding a new entry
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-03-15 00:55:16 +01:00
Marton Balint
a740263d7e avutil/dict: do not realloc entries when deleting a non-existing item
Deleting a non-existing item should not invalidate existing entries returned
with av_dict_get.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-03-15 00:55:16 +01:00
Ganesh Ajjanagadde
0c33ceda91 lavu/lfg-test: add simple sample mean, stddev checks
Also added a TODO to change to a proper normality test in the future.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanag@gmail.com>
2016-03-13 12:41:36 -04:00
Michael Niedermayer
b4f59beeb4 avutil/file: Move av_tempfile() to avutil/file_open ff_tempfile()
document the issue with av_tempfile()

Tested-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-12 02:08:34 +01:00
Michael Niedermayer
2540d884f3 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>
2016-03-10 22:56:37 +01:00
Martin Cracauer
73d1398f0c 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>
2016-03-10 21:24:25 +01:00
NagaChaitanya Vellanki
285fda0937 Add tests for functions in hash.c
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-09 20:05:29 +01:00
Vicente Olivert Riera
ad16eff64b mips: add support for R6
Understanding the mips32r6 and mips64r6 ISAs in the configure script is
not enough. In order to have full support for MIPS R6 in FFmpeg we need
to be able to build it, and for that we need to make sure we don't use
incompatible assembler code which makes the build fail. Ifdefing the
offending code is sufficient to fix the problem.

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-09 20:05:04 +01:00
Michael Niedermayer
9b0eabdcdf avutil/color_utils: Mark test_data as static const
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-03 21:17:45 +01:00
NagaChaitanya Vellanki
df4b5f076e Add test for avpriv_get_trc_function_from_trc function
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-03 21:03:04 +01:00
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>
2016-02-29 19:26:55 -05:00
Reimar Döffinger
4dd4d53531 Document and validate AVFrame plane pointers.
Check that the required plane pointers and only
those are set up.
Currently does not enforce anything for the palette
pointer of pseudopal formats as I am unsure about the
requirements.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2016-02-28 13:33:14 +01:00
Michael Niedermayer
b70e9b4906 avutil/imgutils: Assert that the 2nd av_image_fill_linesizes() call in av_image_fill_linesizes() still succeeds
Fixes CID1271742

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-28 02:02:50 +01:00
Derek Buitenhuis
1a12eb4a73 Merge commit '29c2d06d67724e994980045afa055c6c34611b30'
* commit '29c2d06d67724e994980045afa055c6c34611b30':
  cosmetics: Drop empty comment lines

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-24 17:31:44 +00:00
Derek Buitenhuis
cb0355537d Merge commit 'd847a40888c064cc8c35b546fc5a0ccb69136a7c'
* commit 'd847a40888c064cc8c35b546fc5a0ccb69136a7c':
  hwcontext_cuda/vdpau: add to skipheaders

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-24 17:24:04 +00:00
Derek Buitenhuis
6992276aca Merge commit 'ad884d100259e55cb51a4239cd8a4fd5154c2073'
* commit 'ad884d100259e55cb51a4239cd8a4fd5154c2073':
  hwcontext: add a CUDA implementation

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-24 15:23:16 +00:00
Derek Buitenhuis
63c3e35332 Merge commit '7bc780cd4413f688d3b834037b0f9ddfd6948140'
* commit '7bc780cd4413f688d3b834037b0f9ddfd6948140':
  pixfmt: add a CUDA hwaccelled format

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-24 15:11:06 +00:00
Kieran Kunhya
4170a44bbc Add GBRAP12 pixel format
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-24 03:22:31 +01:00
Michael Niedermayer
1ec7a70380 avutil/pixdesc: Make get_color_type() aware of CIE XYZ formats
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-22 03:49:43 +01:00
Diego Biurrun
29c2d06d67 cosmetics: Drop empty comment lines 2016-02-18 15:35:30 +01:00
Paul B Mahol
08acab85d3 avfilter: add loop filters
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-02-18 11:55:00 +01:00
Anton Khirnov
d847a40888 hwcontext_cuda/vdpau: add to skipheaders 2016-02-18 08:47:39 +01:00
Michael Niedermayer
c4ac30909e avutil/hwcontext: Remove duplicate ;
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-17 21:16:14 +01:00
Derek Buitenhuis
d779d8d771 Merge commit 'a001ce31bc2bcf875a39b5fb22dae49120293b42'
* commit 'a001ce31bc2bcf875a39b5fb22dae49120293b42':
  hwcontext: add a VDPAU implementation

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-17 16:16:34 +00:00
Derek Buitenhuis
1a708780f3 Merge commit '89923e418b494e337683442ab896d754bc07341a'
* commit '89923e418b494e337683442ab896d754bc07341a':
  lavu: add a framework for handling hwaccel frames

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-17 16:12:25 +00:00
Derek Buitenhuis
26abd5149e Merge commit '721a4efc0545548a241080b53ab480e34f366240'
* commit '721a4efc0545548a241080b53ab480e34f366240':
  buffer: add support for pools using caller data in allocation

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-17 16:07:16 +00:00
Derek Buitenhuis
73bd20c4d2 Merge commit '6695f178a5929eab91d3da7e9023999f1774bd0e'
* commit '6695f178a5929eab91d3da7e9023999f1774bd0e':
  pixdesc: Use AV_CEIL_RSHIFT in documentation

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-16 16:55:28 +00:00
Derek Buitenhuis
3f462fcf76 Merge commit '1546a41adae818b340acdd9b5dacd6d0a92b6507'
* commit '1546a41adae818b340acdd9b5dacd6d0a92b6507':
  pixdesc: Drop unneeded deprecation warning guards

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-16 16:54:12 +00:00
James Almer
70d685a77f x86: use the new helper macros where useful
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-02-14 20:00:21 -03:00
James Almer
73a4589d4b x86: add some more helper macros to check for slow cpuflags
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-02-14 20:00:17 -03:00
Anton Khirnov
ad884d1002 hwcontext: add a CUDA implementation 2016-02-14 22:08:33 +01:00
Anton Khirnov
7bc780cd44 pixfmt: add a CUDA hwaccelled format 2016-02-14 22:08:22 +01:00
Anton Khirnov
a001ce31bc hwcontext: add a VDPAU implementation 2016-02-14 22:06:04 +01:00
Anton Khirnov
89923e418b lavu: add a framework for handling hwaccel frames 2016-02-14 21:36:59 +01:00
Michael Niedermayer
0eb4092c1b avutil/imgutils: remove special case for aligning the palette
This was suggested by wm4 and stefano.
After this patch using align=1 the size used by various functions would not
contain padding, while the palette would be aligned at align>1

This patch makes it required to use align>=4 if the palette is to be accessed
as uint32

As a side-effect It fixes storing pal8 in nut with odd with&height

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-14 21:30:32 +01:00
Anton Khirnov
721a4efc05 buffer: add support for pools using caller data in allocation
This should allow using more complex allocators than simple malloc
wrappers.
2016-02-14 21:24:39 +01:00
Marton Balint
ae51f9bd6c avutil/parseutils: remove 2112 date from fate test
It is not supported on 32bit.

Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-14 20:13:15 +01:00
Marton Balint
f834f0cab6 avutil/parseutils: accept everything in av_parse_time that ff_iso8601_to_unix_time accepts
Also parse timezone information previously ignored in ff_iso8601_to_unix_time.

Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-14 01:46:35 +01:00
Marton Balint
3235241061 avutil/parseutils: use microsecond precision when parsing "now" in av_parse_time()
Use av_gettime() instead of time(0) for querying current time.

Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-14 01:46:35 +01:00
Timothy Gu
123ff81a45 avutil: Remove x86_cpu.h
It is private (uninstalled) and unused.
2016-02-13 16:30:26 -08:00