Commit Graph

41 Commits

Author SHA1 Message Date
Michael Niedermayer 2bb7396bfd base64: 10l endian fix.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-22 23:06:04 +01:00
Reimar Döffinger daa47fdd2c Optimized base64 decode by writing 3 bytes at once.
About 25% faster.
decode: 248852 -> 200385 decicycles
(syntax check unchanged)

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2012-01-22 14:41:15 +01:00
Reimar Döffinger 420719e141 Cosmetics: add do {} while 0 to macro.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2012-01-22 14:41:15 +01:00
Reimar Döffinger def19c9036 Unroll base64 decode loop.
Around 50% faster.
decode:       374139 -> 248852 decicycles
syntax check: 236955 -> 123854 decicycles

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2012-01-21 16:35:11 +01:00
Reimar Döffinger 523f676b51 Use a full table for base64 decode.
Also encodes error or end marker into table.
About 20% faster.
decode:       466491 -> 374139 decicycles
syntax check: 236955 -> 161182 decicycles

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2012-01-21 14:52:05 +01:00
Reimar Döffinger 8650d5faf9 base64: more thorough decode tests.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2012-01-21 12:04:46 +01:00
Michael Niedermayer bdd739e91c base64: Only run benchmark when "-t" is specified.
As the test is run during fate and the benchmark is useless for fate
this very slightly speeds up fate. Its also consistent with the other
tests.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-21 05:13:56 +01:00
Michael Niedermayer 57822f0660 base64: fix little typo
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-21 02:10:19 +01:00
Michael Niedermayer 01084336b7 base64: add a benchmark for a pure syntax check.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-21 00:32:52 +01:00
Michael Niedermayer ea4da94895 base64: simplify end handling in av_base64_encode()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-21 00:24:10 +01:00
Michael Niedermayer 112bca91b0 base64: optimize av_base64_encode()
This makes the code 2-3 times as fast

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-21 00:24:10 +01:00
Michael Niedermayer a41687c2d6 base64: add benchmark
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-21 00:24:10 +01:00
Reimar Döffinger d60d718c49 Slightly optimize base64 encode.
Move handling of last byte outside of innermost loop.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2012-01-20 23:28:31 +01:00
Reimar Döffinger 6af4c9814a Optimize output buffer size check in base64 decode.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2012-01-20 23:28:26 +01:00
Reimar Döffinger 686ba5f4ea Minor optimization of base64 decode.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2012-01-20 23:27:16 +01:00
Reimar Döffinger d086c1203c Add coverage exclusions for test code.
For some of the code e.g. doing timing measurements there is no
real point in running regression testing on it, thus it should
not be counted against coverage.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2011-12-05 20:05:44 +01:00
Howard Chu 784824a68c Use AV_BASE64_SIZE() macro
Originally committed as revision 23462 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-06-04 01:15:41 +00:00
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
2010-04-20 14:45:34 +00:00
Diego Biurrun 504ffed19f Mark non-exported functions in test and example programs as static.
Originally committed as revision 18259 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-03-31 09:32:59 +00:00
Stefano Sabatini ac76729c10 Cosmetics: "* out" -> "*out" for consistency with the other
parameters.

Originally committed as revision 17072 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-08 21:19:04 +00:00
Stefano Sabatini 5118bd441d Cosmetics: rename the "size" parameter of av_base64_encode() to "in_size".
Originally committed as revision 17071 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-08 21:16:36 +00:00
Stefano Sabatini 52ef50a080 Cosmetics: prefer out/in over buf/src for the parameter names of
av_base64_encode(), for consistency/readability reasons.

Originally committed as revision 17069 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-08 21:13:11 +00:00
Stefano Sabatini 61ccbc52ea Cosmetics: consistently prefer "size" over "len"/"length" for the
variable names.

Originally committed as revision 17067 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-08 21:08:42 +00:00
Stefano Sabatini 0d20c3fdad Make av_base64_encode() do not require the user to provide an
overallocated buffer where to put the encoded string.

See the thread:
"[PATCH] Improve documentation for libavutil/base64.h".

Originally committed as revision 17065 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-08 21:00:39 +00:00
Stefano Sabatini 21eff9ced7 Add a new test program for base64, based on that removed in r17024.
See the thread:
"[PATCH] remove unused and broken test program in libavutil/base64.c".

Originally committed as revision 17025 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-06 23:29:25 +00:00
Stefano Sabatini 33094be894 Remove broken test program.
Originally committed as revision 17024 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-02-06 23:24:17 +00:00
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
2009-02-01 02:00:19 +00:00
Diego Biurrun bfe3676feb spelling/grammar/consistency review part II
Originally committed as revision 16848 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-28 23:03:17 +00:00
Diego Biurrun 448887a6bb Make base64 test program compilable as a standard test program.
Originally committed as revision 16713 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-21 17:34:40 +00:00
Diego Biurrun 40f5cd89c9 Add void keyword to parameterless function declaration.
Originally committed as revision 16712 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-21 14:28:16 +00:00
Aurelien Jacobs 37d3e0667a uses FF_ARRAY_ELEMS() where appropriate
Originally committed as revision 15662 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-10-21 21:40:24 +00:00
Diego Biurrun ccd425e799 Remove unnecessary parentheses from return calls.
Originally committed as revision 13069 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-05-06 09:16:36 +00:00
Sigbjørn Skjæret 9ad5675f25 Add a couple of missing consts.
patch by Sigbjørn Skjæret, cisc broadpark no

Originally committed as revision 11528 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-01-14 22:10:19 +00:00
Luca Abeni 353fa898bb Reindent the code after last commit
Originally committed as revision 10958 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-11-08 11:59:39 +00:00
Luca Abeni cd250e581b Remove redundant "if(len)"
Originally committed as revision 10957 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-11-08 11:56:50 +00:00
Luca Abeni e76e2bbc09 Mark the source buffer as "const"
Originally committed as revision 10877 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-10-30 15:32:52 +00:00
Luca Barbato bd03c380ce expose av_base64_decode and av_base64_encode
Originally committed as revision 8448 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-03-19 00:48:47 +00:00
Luca Barbato 558b86a5d0 Reverting stray commit part II, r8156 had the base64 export patch mixed with the nutdec patch
Originally committed as revision 8158 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-02-28 03:40:23 +00:00
Luca Barbato 9fca9c0316 Reverting stray commit part I
Originally committed as revision 8157 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-02-28 03:37:54 +00:00
Luca Barbato bb0eb714bd get_packetheader() forgot to read the header_checksum in big packets
patch from Clemens Ladisch cladisch AT fastmail dot net
(stray base64 patch reverted in the next commits)

Originally committed as revision 8156 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-02-28 03:28:31 +00:00
Carl Eugen Hoyos 034ef0e8c3 Move base64.[ch] to libavutil.
patch by Carl Eugen Hoyos, cehoyos ag.or at

Originally committed as revision 7963 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-02-13 08:21:47 +00:00