Commit Graph

53 Commits

Author SHA1 Message Date
Rudolf Polzer 0fff1380b1 audio: clamp sample values in float->int format conversions
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.
2011-05-04 17:25:11 +03:00
reimar 33bc71f10d Add support for distinguishing between little- and big-endian SPDIF AC3
and converting between both.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30283 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-11 20:27:52 +00:00
diego e5751ced4f Replace WORDS_BIGENDIAN by HAVE_BIGENDIAN in all internal code.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29443 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-07-26 19:53:00 +00:00
diego 6e9cbdc104 whitespace cosmetics: Remove all trailing whitespace.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-05-13 02:58:57 +00:00
bircoph 42a792bbc7 Remove af_msg special-casing API in libaf.
Replace it by standard mp_msg message system.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29088 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-03-28 19:57:56 +00:00
diego 0c3d542dc7 WORDS_BIGENDIAN is defined/undefined, not 0/1.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28374 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-01-26 09:56:27 +00:00
diego 65ea2d93f8 Drop HAVE_LRINTF check, lrintf is used without checking in other places.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28372 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-01-26 09:54:14 +00:00
diego 7034529d9a Fix build: Add required header and adjust preprocessor check.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28368 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-01-25 23:55:21 +00:00
diego 5043110082 Rename libaf/af_format_alaw.c --> libaf/af_format_alaw.h and
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
2009-01-05 22:05:19 +00:00
diego 1a42f9781f Remove unnecessary local definition of _ISOC9X_SOURCE.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28271 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-01-05 21:55:19 +00:00
diego 8198c5f15e Replace informal license notices by standard license header
and add standard license header where missing.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28264 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-01-05 12:41:40 +00:00
diego 1e18468ce0 Remove useless #include.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26377 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-04-09 18:20:22 +00:00
uau 7deec05ea0 libaf: change filter input/output ratio calculations
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
2007-11-01 06:52:01 +00:00
reimar 15649d0f00 Fix loads of typos
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24581 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-09-19 15:44:09 +00:00
reimar e9ea243fbd Fix typo in comment
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24541 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-09-16 09:00:45 +00:00
reimar 6a09e8e2ed Replace implicit use of fast_memcpy via macro by explicit use to allow
for future optimization.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23475 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-06-05 14:27:54 +00:00
diego 42314cb0ba Remove unnecessary unistd.h include.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22766 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-03-20 09:53:31 +00:00
diego 7ee0eb4e19 Rename open to af_open so as not to conflict with a previous header definition.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22764 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-03-20 09:46:00 +00:00
uau e876e45030 Fix memory leaks.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22197 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-10 18:12:03 +00:00
reimar 18004d2d98 Hack around libavutil/bswap.h compilation problems due to always_inline undefined.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21523 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-12-07 11:58:07 +00:00
diego cac6c0eea2 Remove bswap.h, use libavutil/bswap.h instead.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21388 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-29 15:02:45 +00:00
nplourde cf332d16c2 reordering of #include to avoid clash with math.h and quicktime/*.h, patch by Crhis Roccati<roccati@pobox.com>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21369 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-28 23:13:08 +00:00
diego 8e2dea5f21 Unify include paths by adding -I.. to CFLAGS.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16983 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-11-13 18:28:44 +00:00
reimar 81827eb239 much simpler signed/unsigned conversion.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16665 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-10-04 21:49:56 +00:00
reimar b7f3811b29 Error out when invalid format is specified
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15312 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-05-01 09:02:25 +00:00
rfelker e6819bc591 100l for me, lrintf is better. now fixed so it should be prototyped, and should work even if there is no prototype
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14792 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-02-24 16:48:18 +00:00
rfelker 66b1d8c94b finally the dreaded white-noise-with-floats bug is fixed!!!!
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
2005-02-22 02:12:58 +00:00
alex f3cfe83983 move the format related stuff to format.c
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14749 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-02-21 16:41:15 +00:00
reimar 80ddeccff9 confusing mixture of typecasts and casted variable, removed typecasts
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14718 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-02-17 15:35:44 +00:00
reimar 8ee78e87ce always cancel down fractions (frac_t) to avoid overflows and playback
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
2005-01-08 21:34:06 +00:00
reimar ba2f41e733 af_fmt2str fixes (remove trailing space, call with size of buffer, not size-1)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14400 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-01-06 14:32:08 +00:00
alex c7ef86b09a af_bits2fmt and af_str2fmt_short, also removed the extra FORMAT_BPS control in format.c
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14336 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-01-03 18:59:16 +00:00
alex 3786faae53 accelerated conversions
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14273 b3059339-0415-0410-9bf9-f77b7e298cf2
2004-12-29 19:05:29 +00:00
alex e8739c6d92 af_fmt2str_short
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14264 b3059339-0415-0410-9bf9-f77b7e298cf2
2004-12-28 18:13:09 +00:00
rtognimp c3d77725cc 100l use right mask type when checking for input format
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14262 b3059339-0415-0410-9bf9-f77b7e298cf2
2004-12-28 02:00:23 +00:00
reimar 005478ea0c ensure af_fmt2str always return a 0 terminated string
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14257 b3059339-0415-0410-9bf9-f77b7e298cf2
2004-12-27 19:47:33 +00:00
alex 507121f7fe removing AFMT_ dependancy
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14246 b3059339-0415-0410-9bf9-f77b7e298cf2
2004-12-27 17:30:15 +00:00
reimar b74edb423d declare check_format and check_bps static, they are used nowhere else.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13990 b3059339-0415-0410-9bf9-f77b7e298cf2
2004-11-20 10:32:52 +00:00
reimar 275cd9923c using bswap.h for endianness conversion
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12487 b3059339-0415-0410-9bf9-f77b7e298cf2
2004-05-18 19:13:15 +00:00
reimar c5b739bf4a fix endian conversion for (curently unused) case where in buffer != out buffer
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12482 b3059339-0415-0410-9bf9-f77b7e298cf2
2004-05-16 16:21:33 +00:00
reimar 9a43e3adbe support for 24 bit pcm/wav files
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12479 b3059339-0415-0410-9bf9-f77b7e298cf2
2004-05-16 10:48:59 +00:00
rfelker 1b6f3ce516 more stupid crap
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12387 b3059339-0415-0410-9bf9-f77b7e298cf2
2004-05-01 20:16:54 +00:00
arpi 10a2ba079b export fmt2str()
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8995 b3059339-0415-0410-9bf9-f77b7e298cf2
2003-01-18 17:31:58 +00:00
anders 6adaa78ee9 Changes includes:
- 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
2002-12-28 13:59:53 +00:00
anders cce460d88b 10l
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8186 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-11-14 09:47:46 +00:00
anders f2de70140d Fixing segfault bug and addnig support for lrintf() in format conversion
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8181 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-11-13 09:09:50 +00:00
anders 66f4e56389 New features:
-- 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
2002-11-12 12:33:56 +00:00
anders 437aa67937 Adding commandline options for filters and fixing stupid bug in cfg
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7999 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-10-31 11:06:19 +00:00
jkeil e567bb25ae Fix for audio filters on big endian cpus. It's working now on Solaris SPARC &
x86


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7720 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-10-12 20:02:01 +00:00
anders 325df13922 Correcting counters and flags
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7712 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-10-11 04:23:52 +00:00