summaryrefslogtreecommitdiffstats
path: root/audio/format.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-06-16 20:57:43 +0200
committerwm4 <wm4@nowhere>2015-06-16 21:11:59 +0200
commit831d7c3c400b554484561bf912c1f9657f8192cd (patch)
tree7c3abe2dadd826f58ac316f9c35b56d9e869d760 /audio/format.h
parent488ebdb0d57b4e822e8dac4fac18dfe460b61ac6 (diff)
downloadmpv-831d7c3c400b554484561bf912c1f9657f8192cd.tar.bz2
mpv-831d7c3c400b554484561bf912c1f9657f8192cd.tar.xz
audio: remove S8, U16, U24, U32 formats
They are useless. Not only are they actually rarely in use; but libavcodec doesn't even output them, as libavcodec has no such sample formats for decoded audio. Even if it should happen that we actually still need them (e.g. if doing direct hardware output), there are better solutions. Swapping the sign is a fast and lossless operation and can be done inplace, so AO actually needing it could do this directly. If you wonder why we keep U8 instead of S8: because libavcodec does it.
Diffstat (limited to 'audio/format.h')
-rw-r--r--audio/format.h25
1 files changed, 9 insertions, 16 deletions
diff --git a/audio/format.h b/audio/format.h
index c4e269f2f5..060b191c2b 100644
--- a/audio/format.h
+++ b/audio/format.h
@@ -26,11 +26,6 @@
#include "misc/bstr.h"
-// Signed/unsigned
-#define AF_FORMAT_SI (0<<0) // Signed
-#define AF_FORMAT_US (1<<0) // Unsigned
-#define AF_FORMAT_SIGN_MASK (1<<0)
-
// Bits used
// Some code assumes they're sorted by size.
#define AF_FORMAT_8BIT (0<<1)
@@ -64,22 +59,18 @@
enum af_format {
AF_FORMAT_UNKNOWN = 0,
- AF_FORMAT_U8 = AF_FORMAT_I|AF_FORMAT_US|AF_FORMAT_8BIT,
- AF_FORMAT_S8 = AF_FORMAT_I|AF_FORMAT_SI|AF_FORMAT_8BIT,
- AF_FORMAT_U16 = AF_FORMAT_I|AF_FORMAT_US|AF_FORMAT_16BIT,
- AF_FORMAT_S16 = AF_FORMAT_I|AF_FORMAT_SI|AF_FORMAT_16BIT,
- AF_FORMAT_U24 = AF_FORMAT_I|AF_FORMAT_US|AF_FORMAT_24BIT,
- AF_FORMAT_S24 = AF_FORMAT_I|AF_FORMAT_SI|AF_FORMAT_24BIT,
- AF_FORMAT_U32 = AF_FORMAT_I|AF_FORMAT_US|AF_FORMAT_32BIT,
- AF_FORMAT_S32 = AF_FORMAT_I|AF_FORMAT_SI|AF_FORMAT_32BIT,
+ AF_FORMAT_U8 = AF_FORMAT_I|AF_FORMAT_8BIT,
+ AF_FORMAT_S16 = AF_FORMAT_I|AF_FORMAT_16BIT,
+ AF_FORMAT_S24 = AF_FORMAT_I|AF_FORMAT_24BIT,
+ AF_FORMAT_S32 = AF_FORMAT_I|AF_FORMAT_32BIT,
AF_FORMAT_FLOAT = AF_FORMAT_F|AF_FORMAT_32BIT,
AF_FORMAT_DOUBLE = AF_FORMAT_F|AF_FORMAT_64BIT,
// Planar variants
- AF_FORMAT_U8P = AF_INTP|AF_FORMAT_US|AF_FORMAT_8BIT,
- AF_FORMAT_S16P = AF_INTP|AF_FORMAT_SI|AF_FORMAT_16BIT,
- AF_FORMAT_S32P = AF_INTP|AF_FORMAT_SI|AF_FORMAT_32BIT,
+ AF_FORMAT_U8P = AF_INTP|AF_FORMAT_8BIT,
+ AF_FORMAT_S16P = AF_INTP|AF_FORMAT_16BIT,
+ AF_FORMAT_S32P = AF_INTP|AF_FORMAT_32BIT,
AF_FORMAT_FLOATP = AF_FLTP|AF_FORMAT_32BIT,
AF_FORMAT_DOUBLEP = AF_FLTP|AF_FORMAT_64BIT,
@@ -113,6 +104,8 @@ int af_fmt2bps(int format);
int af_fmt2bits(int format);
int af_fmt_change_bits(int format, int bits);
+bool af_fmt_unsigned(int format);
+
int af_fmt_to_planar(int format);
int af_fmt_from_planar(int format);