diff options
author | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
---|---|---|
committer | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
commit | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/libvp6/include/Mp3Header.hpp | |
parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz |
Initial community commit
Diffstat (limited to 'Src/libvp6/include/Mp3Header.hpp')
-rw-r--r-- | Src/libvp6/include/Mp3Header.hpp | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/Src/libvp6/include/Mp3Header.hpp b/Src/libvp6/include/Mp3Header.hpp new file mode 100644 index 00000000..bfc72035 --- /dev/null +++ b/Src/libvp6/include/Mp3Header.hpp @@ -0,0 +1,63 @@ +#if !defined(MP3HEADER_HPP) +#define MP3HEADER_HPP + +#include <iosfwd> + +class Mp3Header +{ +public: + Mp3Header(unsigned long); + unsigned long id; + unsigned long layer; + unsigned long protectionBit; + unsigned long bitRateIndex; + unsigned long samplingFrequency; + unsigned long paddingBit; + unsigned long privateBit; + unsigned long mode; + unsigned long modeExtension; + unsigned long copyright; + unsigned long originalOrCopy; + unsigned long emphasis; + unsigned long nch; + unsigned long sampleRate; + unsigned long bitRate; + unsigned long frameSize; + unsigned short outFrameSize; + + enum { BITRATE_FREE = 0 }; + enum { MPEG_FORBIDDEN = -1}; + enum { SAMPLING_FREQUENCY_RESERVED = -1}; + + enum IdTypes + { + MPEG1 = 1, + MPEG2 = 2 + }; + + enum AudioMode + { + STEREO_MODE = 0, + JOINT_STEREO_MODE = 1, + DUAL_CHANNEL_MODE = 2, + SINGLE_CHANNEL_MODE = 3 + }; + + /* layer code, very bad design */ + enum AudioLayer + { + AUDIO_LAYER_1 = 3, + AUDIO_LAYER_2 = 2, + AUDIO_LAYER_3 = 1, + AUDIO_LAYER_RESERVED = 0 + }; + friend std::ostream& operator<<(std::ostream& os, const Mp3Header& mp3); + +private: + static const unsigned short samplingFrequencyTable[2][4]; + static const short m1BitRateTable[3][16]; + static const short m2BitRateTable[3][16]; + static const unsigned short outFrameSizes[2][4]; + +}; +#endif
\ No newline at end of file |