summaryrefslogtreecommitdiffstats
path: root/libaf/af_format.c
Commit message (Collapse)AuthorAgeFilesLines
* options, libaf: unify audio format name handlingwm42012-08-291-1/+1
| | | | | | | | | Remove the duplicated list of audio format names from m_option.c. Remove "long" audio format names, and let af_fmt2str() print the usual short format names. The long names were overly verbose, and were actually rarely user visible. The only difference between af_fmt2str() and af_fmt2str_short() is that the former prints unknown format values as hexadecimal string as fallback.
* Change <endian.h> include to <sys/types.h>wm42012-07-311-1/+1
| | | | | This seems to be more portable. Should fix compilation on OSX and FreeBSD. Apparently also works on MinGW-w64.
* Remove compile time/runtime CPU detection, and drop some platformswm42012-07-301-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mplayer had three ways of enabling CPU specific assembler routines: a) Enable them at compile time; crash if the CPU can't handle it. b) Enable them at compile time, but let the configure script detect your CPU. Your binary will only crash if you try to run it on a different system that has less features than yours. This was the default, I think. c) Runtime detection. The implementation of b) and c) suck. a) is not really feasible (it sucks for users). Remove all code related to this, and use libav's CPU detection instead. Now the configure script will always enable CPU specific features, and disable them at runtime if libav reports them not as available. One implication is that now the compiler is always expected to handle SSE (etc.) inline assembly at runtime, unless it's explicitly disabled. Only checks for x86 CPU specific features are kept, the rest is either unused or barely used. Get rid of all the dump -mpcu, -march etc. flags. Trust the compiler to select decent settings. Get rid of support for the following operating systems: - BSD/OS (some ancient BSD fork) - QNX (don't care) - BeOS (dead, Haiku support is still welcome) - AIX (don't care) - HP-UX (don't care) - OS/2 (dead, actual support has been removed a while ago) Remove the configure code for detecting the endianness. Instead, use the standard header <endian.h>, which can be used if _GNU_SOURCE or _BSD_SOURCE is defined. (Maybe these changes should have been in a separate commit.) Since this is a quite violent code removal orgy, and I'm testing only on x86 32 bit Linux, expect regressions.
* audio: clamp sample values in float->int format conversionsRudolf Polzer2011-05-041-4/+4
| | | | | | | | | Make af_format clamp float sample values to the range [-1, 1] before conversion to integer types. Before any out-of-range values wrapped around and caused nasty artifacts. This filter is used for all automatic format conversions; thus any decoder that outputs floats with possible out-of-range values would have been affected by the bad conversion if its output needed to be converted to integers for AO.
* Add support for distinguishing between little- and big-endian SPDIF AC3reimar2010-01-111-1/+3
| | | | | | | and converting between both. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30283 b3059339-0415-0410-9bf9-f77b7e298cf2
* Replace WORDS_BIGENDIAN by HAVE_BIGENDIAN in all internal code.diego2009-07-261-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29443 b3059339-0415-0410-9bf9-f77b7e298cf2
* whitespace cosmetics: Remove all trailing whitespace.diego2009-05-131-20/+20
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove af_msg special-casing API in libaf.bircoph2009-03-281-7/+7
| | | | | | | Replace it by standard mp_msg message system. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29088 b3059339-0415-0410-9bf9-f77b7e298cf2
* WORDS_BIGENDIAN is defined/undefined, not 0/1.diego2009-01-261-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28374 b3059339-0415-0410-9bf9-f77b7e298cf2
* Drop HAVE_LRINTF check, lrintf is used without checking in other places.diego2009-01-261-8/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28372 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix build: Add required header and adjust preprocessor check.diego2009-01-251-1/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28368 b3059339-0415-0410-9bf9-f77b7e298cf2
* Rename libaf/af_format_alaw.c --> libaf/af_format_alaw.h anddiego2009-01-051-2/+2
| | | | | | | | | libaf/af_format_ulaw.c --> libaf/af_format_ulaw.h. Both files are not compiled but used as standard headers, so there is no reason for them not be named like any other header file. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28273 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove unnecessary local definition of _ISOC9X_SOURCE.diego2009-01-051-3/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28271 b3059339-0415-0410-9bf9-f77b7e298cf2
* Replace informal license notices by standard license headerdiego2009-01-051-4/+21
| | | | | | | and add standard license header where missing. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28264 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove useless #include.diego2008-04-091-1/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26377 b3059339-0415-0410-9bf9-f77b7e298cf2
* libaf: change filter input/output ratio calculationsuau2007-11-011-5/+2
| | | | | | | | | | Change the audio filters to use a double instead of rationals for the ratio of output to input size. The rationals could overflow when calculating the overall ratio of a filter chain and gave no real advantage compared to doubles. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24916 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix loads of typosreimar2007-09-191-11/+11
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24581 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix typo in commentreimar2007-09-161-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24541 b3059339-0415-0410-9bf9-f77b7e298cf2
* Replace implicit use of fast_memcpy via macro by explicit use to allowreimar2007-06-051-1/+1
| | | | | | | for future optimization. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23475 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove unnecessary unistd.h include.diego2007-03-201-1/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22766 b3059339-0415-0410-9bf9-f77b7e298cf2
* Rename open to af_open so as not to conflict with a previous header definition.diego2007-03-201-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22764 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix memory leaks.uau2007-02-101-2/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22197 b3059339-0415-0410-9bf9-f77b7e298cf2
* Hack around libavutil/bswap.h compilation problems due to always_inline ↵reimar2006-12-071-1/+1
| | | | | | undefined. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21523 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove bswap.h, use libavutil/bswap.h instead.diego2006-11-291-1/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21388 b3059339-0415-0410-9bf9-f77b7e298cf2
* reordering of #include to avoid clash with math.h and quicktime/*.h, patch ↵nplourde2006-11-281-4/+4
| | | | | | by Crhis Roccati<roccati@pobox.com> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21369 b3059339-0415-0410-9bf9-f77b7e298cf2
* Unify include paths by adding -I.. to CFLAGS.diego2005-11-131-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16983 b3059339-0415-0410-9bf9-f77b7e298cf2
* much simpler signed/unsigned conversion.reimar2005-10-041-54/+16
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16665 b3059339-0415-0410-9bf9-f77b7e298cf2
* Error out when invalid format is specifiedreimar2005-05-011-0/+4
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15312 b3059339-0415-0410-9bf9-f77b7e298cf2
* 100l for me, lrintf is better. now fixed so it should be prototyped, and ↵rfelker2005-02-241-12/+23
| | | | | | should work even if there is no prototype git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14792 b3059339-0415-0410-9bf9-f77b7e298cf2
* finally the dreaded white-noise-with-floats bug is fixed!!!!rfelker2005-02-221-16/+8
| | | | | | | | | | | | | | the problem is that lrintf was not prototyped on some systems, but it's easier and faster just not to use it at all. looks like the cola goes to our friends the glibc developers for forgetting to put lrintf in math.h in some versions. :))) i'm sure there are other broken libcs too though. also fixed a minor bug in the int->float conversion where the range for float samples was exceeded... git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14759 b3059339-0415-0410-9bf9-f77b7e298cf2
* move the format related stuff to format.calex2005-02-211-201/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14749 b3059339-0415-0410-9bf9-f77b7e298cf2
* confusing mixture of typecasts and casted variable, removed typecastsreimar2005-02-171-10/+10
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14718 b3059339-0415-0410-9bf9-f77b7e298cf2
* always cancel down fractions (frac_t) to avoid overflows and playbackreimar2005-01-081-0/+1
| | | | | | | | problems (e.g. when using resample and equalizer filters together, see http://mplayerhq.hu/pipermail/mplayer-users/2004-December/050058.html) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14434 b3059339-0415-0410-9bf9-f77b7e298cf2
* af_fmt2str fixes (remove trailing space, call with size of buffer, not size-1)reimar2005-01-061-10/+13
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14400 b3059339-0415-0410-9bf9-f77b7e298cf2
* af_bits2fmt and af_str2fmt_short, also removed the extra FORMAT_BPS control ↵alex2005-01-031-36/+59
| | | | | | in format.c git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14336 b3059339-0415-0410-9bf9-f77b7e298cf2
* accelerated conversionsalex2004-12-291-6/+98
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14273 b3059339-0415-0410-9bf9-f77b7e298cf2
* af_fmt2str_shortalex2004-12-281-0/+33
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14264 b3059339-0415-0410-9bf9-f77b7e298cf2
* 100l use right mask type when checking for input formatrtognimp2004-12-281-9/+4
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14262 b3059339-0415-0410-9bf9-f77b7e298cf2
* ensure af_fmt2str always return a 0 terminated stringreimar2004-12-271-0/+5
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14257 b3059339-0415-0410-9bf9-f77b7e298cf2
* removing AFMT_ dependancyalex2004-12-271-12/+35
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14246 b3059339-0415-0410-9bf9-f77b7e298cf2
* declare check_format and check_bps static, they are used nowhere else.reimar2004-11-201-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13990 b3059339-0415-0410-9bf9-f77b7e298cf2
* using bswap.h for endianness conversionreimar2004-05-181-9/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12487 b3059339-0415-0410-9bf9-f77b7e298cf2
* fix endian conversion for (curently unused) case where in buffer != out bufferreimar2004-05-161-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12482 b3059339-0415-0410-9bf9-f77b7e298cf2
* support for 24 bit pcm/wav filesreimar2004-05-161-2/+79
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12479 b3059339-0415-0410-9bf9-f77b7e298cf2
* more stupid craprfelker2004-05-011-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12387 b3059339-0415-0410-9bf9-f77b7e298cf2
* export fmt2str()arpi2003-01-181-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8995 b3059339-0415-0410-9bf9-f77b7e298cf2
* Changes includes:anders2002-12-281-27/+47
| | | | | | | | | | | | | | | | | - Improved runtime control system - 3 New filter panning, compressor/limiter and a noise gate - The compressor/limiter and the noise gate are not yet finished - The panning filter does combined mixing and channel routing and can be used to down-mix from stereo to mono (for example) - Improvements to volume and channel - volume now has a very good soft clipping using sin() - channel can handle generic routing of audio data - Conversion of all filters to handle floating point data - Cleanup of message printing - Fix for the sig 11 bug reported by Denes git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8608 b3059339-0415-0410-9bf9-f77b7e298cf2
* 10landers2002-11-141-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8186 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fixing segfault bug and addnig support for lrintf() in format conversionanders2002-11-131-39/+55
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8181 b3059339-0415-0410-9bf9-f77b7e298cf2
* New features:anders2002-11-121-201/+356
| | | | | | | | | | | | | | | | -- Support for runtime cpu detection -- Stand alone compile of libaf -- Unlimited number of channels (compiletime switch) -- Sample format defined by bit-fields -- New formats: float, A-Law and mu-law -- Format conversion set in human readable format i.e. format=4:us_be to set 32 bit unsigned big endian output -- Format reporting in human readable format -- Volume control has only one parameter for setting the volume i.e. volume=-10.0:1:0:1 to set atenuation = -10dB git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8168 b3059339-0415-0410-9bf9-f77b7e298cf2
* Adding commandline options for filters and fixing stupid bug in cfganders2002-10-311-0/+5
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7999 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix for audio filters on big endian cpus. It's working now on Solaris SPARC &jkeil2002-10-121-4/+12
| | | | | | | x86 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7720 b3059339-0415-0410-9bf9-f77b7e298cf2
* Correcting counters and flagsanders2002-10-111-9/+9
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7712 b3059339-0415-0410-9bf9-f77b7e298cf2
* Adding Support for non-reentrant audio filtersanders2002-10-061-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7616 b3059339-0415-0410-9bf9-f77b7e298cf2
* Adding support for multiple audio streams and removing annoying message from ↵anders2002-10-011-1/+1
| | | | | | resample and format git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7572 b3059339-0415-0410-9bf9-f77b7e298cf2
* Adding new audio output filter layer libafanders2002-10-011-0/+291
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7569 b3059339-0415-0410-9bf9-f77b7e298cf2