Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit a4e74e6

Browse files
daijhDuan, Xiande
authored andcommitted
Using pcm16b for pcm little endian codec.
Add pcm 48khz stereo payload type. Signed-off-by: jdai12 <[email protected]> Change-Id: I12d95f6a8fabbef740e8ab4719a941c49d4a283b Reviewed-on: https://git-ccr-1.devtools.intel.com/gerrit/56489 Reviewed-by: Duan, Xiande <[email protected]> Tested-by: Duan, Xiande <[email protected]>
1 parent 6f6f539 commit a4e74e6

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

webrtc/modules/audio_coding/acm2/acm_codec_database.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ bool IsOpusRateValid(int rate) {
5757
} // namespace
5858

5959
// Not yet used payload-types.
60-
// 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68,
60+
// 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68,
6161
// 67, 66, 65
6262

6363
const CodecInst ACMCodecDB::database_[] = {
@@ -75,6 +75,7 @@ const CodecInst ACMCodecDB::database_[] = {
7575
{111, "L16", 8000, 80, 2, 128000},
7676
{112, "L16", 16000, 160, 2, 256000},
7777
{113, "L16", 32000, 320, 2, 512000},
78+
{83, "L16", 48000, 480, 2, 768000},
7879
// G.711, PCM mu-law and A-law.
7980
// Mono
8081
{0, "PCMU", 8000, 160, 1, 64000},
@@ -133,6 +134,7 @@ const ACMCodecDB::CodecSettings ACMCodecDB::codec_settings_[] = {
133134
{4, {80, 160, 240, 320}, 0, 2},
134135
{4, {160, 320, 480, 640}, 0, 2},
135136
{2, {320, 640}, 0, 2},
137+
{2, {480, 960}, 0, 2},
136138
// G.711, PCM mu-law and A-law.
137139
// Mono
138140
{6, {80, 160, 240, 320, 400, 480}, 0, 2},
@@ -191,7 +193,7 @@ const NetEqDecoder ACMCodecDB::neteq_decoders_[] = {
191193
NetEqDecoder::kDecoderPCM16Bswb32kHz,
192194
// Stereo
193195
NetEqDecoder::kDecoderPCM16B_2ch, NetEqDecoder::kDecoderPCM16Bwb_2ch,
194-
NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch,
196+
NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch, NetEqDecoder::kDecoderPCM16Bswb48kHz_2ch,
195197
// G.711, PCM mu-las and A-law.
196198
// Mono
197199
NetEqDecoder::kDecoderPCMu, NetEqDecoder::kDecoderPCMa,

webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* in the file PATENTS. All contributing project authors may
88
* be found in the AUTHORS file in the root of the source tree.
99
*/
10+
#include <string.h>
1011

1112
#include "pcm16b.h"
1213

@@ -15,20 +16,28 @@
1516
size_t WebRtcPcm16b_Encode(const int16_t* speech,
1617
size_t len,
1718
uint8_t* encoded) {
19+
#if 0 // woogeen pcm16 littel endian
1820
size_t i;
1921
for (i = 0; i < len; ++i) {
2022
uint16_t s = speech[i];
2123
encoded[2 * i] = s >> 8;
2224
encoded[2 * i + 1] = s;
2325
}
26+
#else
27+
memcpy(encoded, speech, 2 * len);
28+
#endif
2429
return 2 * len;
2530
}
2631

2732
size_t WebRtcPcm16b_Decode(const uint8_t* encoded,
2833
size_t len,
2934
int16_t* speech) {
35+
#if 0 // woogeen pcm16 littel endian
3036
size_t i;
3137
for (i = 0; i < len / 2; ++i)
3238
speech[i] = encoded[2 * i] << 8 | encoded[2 * i + 1];
39+
#else
40+
memcpy(speech, encoded, len);
41+
#endif
3342
return len / 2;
3443
}

0 commit comments

Comments
 (0)