comparison trau-decode/amr8-common.c @ 106:028307356ba9

trau-decode: new program trau-amr8-dump
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 21 Nov 2025 06:37:46 +0000
parents 699afc9ef063
children b3ebfbeee32b
comparison
equal deleted inserted replaced
105:699afc9ef063 106:028307356ba9
56 static const uint8_t params_sid[] = {3, 8, 9, 9, 6, 0}; 56 static const uint8_t params_sid[] = {3, 8, 9, 9, 6, 0};
57 57
58 static const ubit_t bit8_0[8] = { 0, }; 58 static const ubit_t bit8_0[8] = { 0, };
59 59
60 /*!< check sync pattern for AMR No_Speech + low bit rate */ 60 /*!< check sync pattern for AMR No_Speech + low bit rate */
61 static bool is_amr_low(const ubit_t *bits) 61 bool is_amr_low(const ubit_t *bits)
62 { 62 {
63 int i; 63 int i;
64 64
65 /* TS 08.61 Section 6.8.2.1.2 */ 65 /* TS 08.61 Section 6.8.2.1.2 */
66 if (memcmp(bits, bit8_0, sizeof(bit8_0))) 66 if (memcmp(bits, bit8_0, sizeof(bit8_0)))
77 } 77 }
78 return true; 78 return true;
79 } 79 }
80 80
81 /*!< check sync pattern for AMR 6.7kBit/s */ 81 /*!< check sync pattern for AMR 6.7kBit/s */
82 static bool is_amr_67(const ubit_t *bits) 82 bool is_amr_67(const ubit_t *bits)
83 { 83 {
84 int i; 84 int i;
85 85
86 /* TS 08.61 Section 6.8.2.1.3 */ 86 /* TS 08.61 Section 6.8.2.1.3 */
87 if (memcmp(bits, bit8_0, sizeof(bit8_0))) 87 if (memcmp(bits, bit8_0, sizeof(bit8_0)))
102 } 102 }
103 return true; 103 return true;
104 } 104 }
105 105
106 /*!< check sync pattern for AMR 7.4kBit/s */ 106 /*!< check sync pattern for AMR 7.4kBit/s */
107 static bool is_amr_74(const ubit_t *bits) 107 bool is_amr_74(const ubit_t *bits)
108 { 108 {
109 if (bits[0] != 0 || bits[1] != 0 || bits[2] != 1) 109 if (bits[0] != 0 || bits[1] != 0 || bits[2] != 1)
110 return false; 110 return false;
111 if (bits[8] != 0) 111 if (bits[8] != 0)
112 return false; 112 return false;