Commit graph

10 commits

Author SHA1 Message Date
jmarusic@webrtc.org
51ccf37638 AudioEncoder: add method MaxEncodedBytes
Added method AudioEncoder::MaxEncodedBytes() and provided implementations in derived encoders. This method returns the number of bytes that can be produced by the encoder at each Encode() call.
Unit tests were updated to use the new method.
Buffer allocation was not changed in AudioCodingModuleImpl::Encode(). It will be done after additional investigation.
Other refactoring work that was done, that may not be obvious why:
1. Moved some code into AudioEncoderCng::EncodePassive() to make it more consistent with EncodeActive().
2. Changed the order of NumChannels() and  RtpTimestampRateHz() declarations in AudioEncoderG722 and AudioEncoderCopyRed classes. It just bothered me that the order was not the same as in AudioEncoder class and its other derived classes.

R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/40259005

Cr-Commit-Position: refs/heads/master@{#8671}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8671 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-10 15:42:21 +00:00
henrik.lundin@webrtc.org
c86bbbaa93 Add speech flag to EncodedInfo
The flag indicates if the encoded bitstream is speech or comfort noise.

COAUTHOR=kwiberg@webrtc.org
R=jmarusic@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/42629004

Cr-Commit-Position: refs/heads/master@{#8598}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8598 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-04 16:03:19 +00:00
jmarusic@webrtc.org
b1f0de30be AudioEncoder: change Encode and EncodeInternal return type to void
After code cleanup done on issues:
https://webrtc-codereview.appspot.com/34259004/
https://webrtc-codereview.appspot.com/43409004/
https://webrtc-codereview.appspot.com/34309004/
https://webrtc-codereview.appspot.com/34309004/
https://webrtc-codereview.appspot.com/36209004/
https://webrtc-codereview.appspot.com/40899004/
https://webrtc-codereview.appspot.com/39279004/
https://webrtc-codereview.appspot.com/42099005/
and the similar work done for AudioEncoderDecoderIsacT,  methods AudioEncoder::Encode and AudioEncoder::EncodeInternal will always succeed. Therefore, there is no need for them to return bool value that represents success or failure.

R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/38279004

Cr-Commit-Position: refs/heads/master@{#8518}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8518 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-26 15:38:46 +00:00
jmarusic@webrtc.org
f88791d783 AudioEncoderCng: CHECK that encode calls don't fail
Calls to WebRtcCng_Encode, AudioEncoder::Encode and Vad::VoiceActivity fail only if fed bad input, so instead of handling failure, we can just CHECK. This also makes it unnecessary for methods AudioEncoderCng::EncodePassive and AudioEncoderCng::EncodeActive to return a value, so we can make them void.

R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/39279004

Cr-Commit-Position: refs/heads/master@{#8475}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8475 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-24 14:59:19 +00:00
kwiberg@webrtc.org
0521127779 AudioEncoder: Rename virtual accessors to CamelCase
Although sample_rate_hz(), num_channels(), and rtp_timestamp_rate_hz()
are simple accessors for almost all implementations of AudioEncoder,
they are virtual and not guaranteed to be just simple accessors. Thus,
it makes more sense to use the normal CamelCase naming scheme.

BUG=4235
R=henrik.lundin@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/34239004

Cr-Commit-Position: refs/heads/master@{#8407}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8407 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-18 12:01:13 +00:00
henrik.lundin@webrtc.org
bb1219eca3 Add a unit test for callbacks with empty frames and fix bug in code
This change adds a couple of new tests that verify that callbacks
with frame type kFrameEmpty are sent in between comfort noise packets.
This used to be the case until r8268, and with the fix included in
this CL is once again so.

COAUTHOR=kwiberg@webrtc.org
R=minyue@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/37229004

Cr-Commit-Position: refs/heads/master@{#8353}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8353 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-12 15:53:55 +00:00
henrik.lundin@webrtc.org
8bb32d600b Minor updates to AudioEncoderCng
Removing sample_rate_hz_ from AudioEncoderCng and from the config
struct. The sample rate will now be read from the underlying speech
codec.

BUG=3926
COAUTHOR:kwiberg@webrtc.org

R=tina.legrand@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/40559004

Cr-Commit-Position: refs/heads/master@{#8173}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8173 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-01-27 20:54:22 +00:00
henrik.lundin@webrtc.org
478cedc055 Add new methods to AudioEncoder interface
The following three methods are added:
rtp_timestamp_rate_hz()
SetTargetBitrate()
SetProjectedPacketLossRate()

Default implementations are provided, and a few overrides are
implemented. AudioEncoderCopyRed and AudioEncoderCng propagate the new
methods to the underlying speech codec.

BUG=3926
COAUTHOR:kwiberg@webrtc.org

R=tina.legrand@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/34049004

Cr-Commit-Position: refs/heads/master@{#8171}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8171 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-01-27 18:25:40 +00:00
henrik.lundin@webrtc.org
3b79daff14 Moving encoded_bytes into EncodedInfo
BUG=3926
R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/35469004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7883 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-12-12 13:31:24 +00:00
henrik.lundin@webrtc.org
ff1a3e36bd Make an AudioEncoder subclass for comfort noise
BUG=3926
R=bjornv@webrtc.org, kjellander@webrtc.org, kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/31129004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7857 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-12-10 07:29:08 +00:00