Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1569)

Unified Diff: webrtc/modules/audio_coding/codecs/g722/audio_decoder_g722.cc

Issue 2326003002: Moved codec-specific audio packet splitting into decoders. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/codecs/g722/audio_decoder_g722.cc
diff --git a/webrtc/modules/audio_coding/codecs/g722/audio_decoder_g722.cc b/webrtc/modules/audio_coding/codecs/g722/audio_decoder_g722.cc
index 379293b748b043985488e180934c2dd5c9baf060..5dc110b63f0f07b4ab58789b27f8b4f61ae97431 100644
--- a/webrtc/modules/audio_coding/codecs/g722/audio_decoder_g722.cc
+++ b/webrtc/modules/audio_coding/codecs/g722/audio_decoder_g722.cc
@@ -13,6 +13,7 @@
#include <string.h>
#include "webrtc/base/checks.h"
+#include "webrtc/modules/audio_coding/codecs/split_by_samples.h"
#include "webrtc/modules/audio_coding/codecs/g722/g722_interface.h"
namespace webrtc {
@@ -47,6 +48,11 @@ void AudioDecoderG722::Reset() {
WebRtcG722_DecoderInit(dec_state_);
}
+std::vector<AudioDecoder::PacketSplit> AudioDecoderG722::SplitPacket(
+ rtc::ArrayView<const uint8_t> payload) const {
+ return internal::SplitBySamples(payload, 8, 16);
+}
+
int AudioDecoderG722::PacketDuration(const uint8_t* encoded,
size_t encoded_len) const {
// 1/2 encoded byte per sample per channel.
@@ -117,6 +123,11 @@ void AudioDecoderG722Stereo::Reset() {
WebRtcG722_DecoderInit(dec_state_right_);
}
+std::vector<AudioDecoder::PacketSplit> AudioDecoderG722Stereo::SplitPacket(
+ rtc::ArrayView<const uint8_t> payload) const {
+ return internal::SplitBySamples(payload, 2 * 8, 16);
+}
+
// Split the stereo packet and place left and right channel after each other
// in the output array.
void AudioDecoderG722Stereo::SplitStereoPacket(const uint8_t* encoded,

Powered by Google App Engine
This is Rietveld 408576698