diff options
Diffstat (limited to 'apps/codecs/libmad/frame.h')
-rw-r--r-- | apps/codecs/libmad/frame.h | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/apps/codecs/libmad/frame.h b/apps/codecs/libmad/frame.h index d2d6dca3ef..4d23107d76 100644 --- a/apps/codecs/libmad/frame.h +++ b/apps/codecs/libmad/frame.h | |||
@@ -27,41 +27,41 @@ | |||
27 | # include "stream.h" | 27 | # include "stream.h" |
28 | 28 | ||
29 | enum mad_layer { | 29 | enum mad_layer { |
30 | MAD_LAYER_I = 1, /* Layer I */ | 30 | MAD_LAYER_I = 1, /* Layer I */ |
31 | MAD_LAYER_II = 2, /* Layer II */ | 31 | MAD_LAYER_II = 2, /* Layer II */ |
32 | MAD_LAYER_III = 3 /* Layer III */ | 32 | MAD_LAYER_III = 3 /* Layer III */ |
33 | }; | 33 | }; |
34 | 34 | ||
35 | enum mad_mode { | 35 | enum mad_mode { |
36 | MAD_MODE_SINGLE_CHANNEL = 0, /* single channel */ | 36 | MAD_MODE_SINGLE_CHANNEL = 0, /* single channel */ |
37 | MAD_MODE_DUAL_CHANNEL = 1, /* dual channel */ | 37 | MAD_MODE_DUAL_CHANNEL = 1, /* dual channel */ |
38 | MAD_MODE_JOINT_STEREO = 2, /* joint (MS/intensity) stereo */ | 38 | MAD_MODE_JOINT_STEREO = 2, /* joint (MS/intensity) stereo */ |
39 | MAD_MODE_STEREO = 3 /* normal LR stereo */ | 39 | MAD_MODE_STEREO = 3 /* normal LR stereo */ |
40 | }; | 40 | }; |
41 | 41 | ||
42 | enum mad_emphasis { | 42 | enum mad_emphasis { |
43 | MAD_EMPHASIS_NONE = 0, /* no emphasis */ | 43 | MAD_EMPHASIS_NONE = 0, /* no emphasis */ |
44 | MAD_EMPHASIS_50_15_US = 1, /* 50/15 microseconds emphasis */ | 44 | MAD_EMPHASIS_50_15_US = 1, /* 50/15 microseconds emphasis */ |
45 | MAD_EMPHASIS_CCITT_J_17 = 3, /* CCITT J.17 emphasis */ | 45 | MAD_EMPHASIS_CCITT_J_17 = 3, /* CCITT J.17 emphasis */ |
46 | MAD_EMPHASIS_RESERVED = 2 /* unknown emphasis */ | 46 | MAD_EMPHASIS_RESERVED = 2 /* unknown emphasis */ |
47 | }; | 47 | }; |
48 | 48 | ||
49 | struct mad_header { | 49 | struct mad_header { |
50 | enum mad_layer layer; /* audio layer (1, 2, or 3) */ | 50 | enum mad_layer layer; /* audio layer (1, 2, or 3) */ |
51 | enum mad_mode mode; /* channel mode (see above) */ | 51 | enum mad_mode mode; /* channel mode (see above) */ |
52 | int mode_extension; /* additional mode info */ | 52 | int mode_extension; /* additional mode info */ |
53 | enum mad_emphasis emphasis; /* de-emphasis to use (see above) */ | 53 | enum mad_emphasis emphasis; /* de-emphasis to use (see above) */ |
54 | 54 | ||
55 | unsigned long bitrate; /* stream bitrate (bps) */ | 55 | unsigned long bitrate; /* stream bitrate (bps) */ |
56 | unsigned int samplerate; /* sampling frequency (Hz) */ | 56 | unsigned int samplerate; /* sampling frequency (Hz) */ |
57 | 57 | ||
58 | unsigned short crc_check; /* frame CRC accumulator */ | 58 | unsigned short crc_check; /* frame CRC accumulator */ |
59 | unsigned short crc_target; /* final target CRC checksum */ | 59 | unsigned short crc_target; /* final target CRC checksum */ |
60 | 60 | ||
61 | int flags; /* flags (see below) */ | 61 | int flags; /* flags (see below) */ |
62 | int private_bits; /* private bits (see below) */ | 62 | int private_bits; /* private bits (see below) */ |
63 | 63 | ||
64 | mad_timer_t duration; /* audio playing time of frame */ | 64 | mad_timer_t duration; /* audio playing time of frame */ |
65 | }; | 65 | }; |
66 | 66 | ||
67 | struct mad_frame { | 67 | struct mad_frame { |
@@ -76,33 +76,33 @@ struct mad_frame { | |||
76 | mad_fixed_t (*overlap)[2][32][18]; /* Layer III block overlap data */ | 76 | mad_fixed_t (*overlap)[2][32][18]; /* Layer III block overlap data */ |
77 | }; | 77 | }; |
78 | 78 | ||
79 | # define MAD_NCHANNELS(header) ((header)->mode ? 2 : 1) | 79 | # define MAD_NCHANNELS(header) ((header)->mode ? 2 : 1) |
80 | # define MAD_NSBSAMPLES(header) \ | 80 | # define MAD_NSBSAMPLES(header) \ |
81 | ((header)->layer == MAD_LAYER_I ? 12 : \ | 81 | ((header)->layer == MAD_LAYER_I ? 12 : \ |
82 | (((header)->layer == MAD_LAYER_III && \ | 82 | (((header)->layer == MAD_LAYER_III && \ |
83 | ((header)->flags & MAD_FLAG_LSF_EXT)) ? 18 : 36)) | 83 | ((header)->flags & MAD_FLAG_LSF_EXT)) ? 18 : 36)) |
84 | 84 | ||
85 | enum { | 85 | enum { |
86 | MAD_FLAG_NPRIVATE_III = 0x0007, /* number of Layer III private bits */ | 86 | MAD_FLAG_NPRIVATE_III = 0x0007, /* number of Layer III private bits */ |
87 | MAD_FLAG_INCOMPLETE = 0x0008, /* header but not data is decoded */ | 87 | MAD_FLAG_INCOMPLETE = 0x0008, /* header but not data is decoded */ |
88 | 88 | ||
89 | MAD_FLAG_PROTECTION = 0x0010, /* frame has CRC protection */ | 89 | MAD_FLAG_PROTECTION = 0x0010, /* frame has CRC protection */ |
90 | MAD_FLAG_COPYRIGHT = 0x0020, /* frame is copyright */ | 90 | MAD_FLAG_COPYRIGHT = 0x0020, /* frame is copyright */ |
91 | MAD_FLAG_ORIGINAL = 0x0040, /* frame is original (else copy) */ | 91 | MAD_FLAG_ORIGINAL = 0x0040, /* frame is original (else copy) */ |
92 | MAD_FLAG_PADDING = 0x0080, /* frame has additional slot */ | 92 | MAD_FLAG_PADDING = 0x0080, /* frame has additional slot */ |
93 | 93 | ||
94 | MAD_FLAG_I_STEREO = 0x0100, /* uses intensity joint stereo */ | 94 | MAD_FLAG_I_STEREO = 0x0100, /* uses intensity joint stereo */ |
95 | MAD_FLAG_MS_STEREO = 0x0200, /* uses middle/side joint stereo */ | 95 | MAD_FLAG_MS_STEREO = 0x0200, /* uses middle/side joint stereo */ |
96 | MAD_FLAG_FREEFORMAT = 0x0400, /* uses free format bitrate */ | 96 | MAD_FLAG_FREEFORMAT = 0x0400, /* uses free format bitrate */ |
97 | 97 | ||
98 | MAD_FLAG_LSF_EXT = 0x1000, /* lower sampling freq. extension */ | 98 | MAD_FLAG_LSF_EXT = 0x1000, /* lower sampling freq. extension */ |
99 | MAD_FLAG_MC_EXT = 0x2000, /* multichannel audio extension */ | 99 | MAD_FLAG_MC_EXT = 0x2000, /* multichannel audio extension */ |
100 | MAD_FLAG_MPEG_2_5_EXT = 0x4000 /* MPEG 2.5 (unofficial) extension */ | 100 | MAD_FLAG_MPEG_2_5_EXT = 0x4000 /* MPEG 2.5 (unofficial) extension */ |
101 | }; | 101 | }; |
102 | 102 | ||
103 | enum { | 103 | enum { |
104 | MAD_PRIVATE_HEADER = 0x0100, /* header private bit */ | 104 | MAD_PRIVATE_HEADER = 0x0100, /* header private bit */ |
105 | MAD_PRIVATE_III = 0x001f /* Layer III private bits (up to 5) */ | 105 | MAD_PRIVATE_III = 0x001f /* Layer III private bits (up to 5) */ |
106 | }; | 106 | }; |
107 | 107 | ||
108 | void mad_header_init(struct mad_header *); | 108 | void mad_header_init(struct mad_header *); |