7eb914debb
Fix incorrect comment
...
Review URL: https://codereview.webrtc.org/1524663004
Cr-Commit-Position: refs/heads/master@{#11036}
2015-12-15 22:20:29 +00:00
288886b2ec
Pass audio to AudioEncoder::Encode() in an ArrayView
...
Instead of in separate pointer and size arguments.
Review URL: https://codereview.webrtc.org/1418423010
Cr-Commit-Position: refs/heads/master@{#10535}
2015-11-06 09:21:39 +00:00
c99ebc1490
Remove AudioEncoder methods SetMaxBitrate and SetMaxPayloadSize
...
And the corresponding ACM methods SetISACMaxRate and
SetISACMaxPayloadSize. They were only used in tests.
Review URL: https://codereview.webrtc.org/1311533010
Cr-Commit-Position: refs/heads/master@{#9903}
2015-09-09 07:54:10 +00:00
3f5f1c2ad3
Change return type of AudioEncoder::SetMaxPlaybackRate to void
...
There's no point in returning a status code, since the max playback rate
is only a suggestion that the encoder is free to disregard.
Review URL: https://codereview.webrtc.org/1332573003
Cr-Commit-Position: refs/heads/master@{#9900}
2015-09-09 06:15:41 +00:00
12cfc9b4da
Fold AudioEncoderMutable into AudioEncoder
...
It makes more sense to combine the two interfaces, since there wasn't
a clear line separating them. The result is a combined interface with
just over a dozen methods, half of which need to be implemented by
every subclass, while the other half have sensible (and trivial)
default implementations and are implemented only by the few subclasses
that need non-default behavior.
Review URL: https://codereview.webrtc.org/1322973004
Cr-Commit-Position: refs/heads/master@{#9894}
2015-09-08 12:57:59 +00:00
dce40cf804
Update a ton of audio code to use size_t more correctly and in general reduce
...
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org , pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 21:52:45 +00:00
3e89dbf458
Add AudioEncoder::GetTargetBitrate
...
The GetTargetBitrate implementation will return the
target bitrate of the codec. This may differ from the
desired target bitrate, as set by SetTargetBitrate, depending on implementation.
Tests are updated to exercise the new functionality.
R=kwiberg@webrtc.org
Review URL: https://codereview.webrtc.org/1184313002 .
Cr-Commit-Position: refs/heads/master@{#9461}
2015-06-18 12:58:46 +00:00
092041c1cd
Setting OPUS_SIGNAL_VOICE when enable DTX.
...
A better solution than forcing OPUS_APPLICATION_VOIP when enabling DTX has been found, which is to set OPUS_SIGNAL_VOICE.
This reduces the uncertainty of entering DTX over silence period of audio.
This CL contains the setup of OPUS_SIGNAL_VOICE and decoupling opus application mode with DTX.
BUG=4559
R=henrik.lundin@webrtc.org , henrika@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/46959004
Cr-Commit-Position: refs/heads/master@{#9168}
2015-05-11 10:19:36 +00:00
dcccab3ebb
New interface: AudioEncoderMutable
...
With implementations for all codecs. It has no users yet. This new
interface is the same as AudioEncoder (in fact it is a subclass) but
it allows changing some parameters after construction.
COAUTHOR=henrik.lundin@webrtc.org
BUG=4228
R=jmarusic@webrtc.org , minyue@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/51679004
Cr-Commit-Position: refs/heads/master@{#9149}
2015-05-07 10:35:18 +00:00
9afaee74ab
Reland 8749: AudioEncoder: return EncodedInfo from Encode() and EncodeInternal()
...
Old review at:
https://webrtc-codereview.appspot.com/43839004/
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/45769004
Cr-Commit-Position: refs/heads/master@{#8788}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8788 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-19 08:51:20 +00:00
019955d770
Revert 8749 "We changed Encode() and EncodeInternal() return typ..."
...
The reason is that this cl adds a static initializer so we can't roll webrtc into Chromium.
See audio_encoder.cc and 'sizes' regression here:
http://build.chromium.org/p/chromium/builders/Linux%20x64/builds/186
> We changed Encode() and EncodeInternal() return type from bool to void in this issue:
> https://webrtc-codereview.appspot.com/38279004/
> Now we don't have to pass EncodedInfo as output parameter, but can return it instead. This also adds the benefit of making clear that EncodeInternal() needs to fill in this info.
>
> R=kwiberg@webrtc.org
>
> Review URL: https://webrtc-codereview.appspot.com/43839004
TBR=jmarusic@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/49449004
Cr-Commit-Position: refs/heads/master@{#8772}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8772 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-18 06:38:40 +00:00
0cb612b43b
We changed Encode() and EncodeInternal() return type from bool to void in this issue:
...
https://webrtc-codereview.appspot.com/38279004/
Now we don't have to pass EncodedInfo as output parameter, but can return it instead. This also adds the benefit of making clear that EncodeInternal() needs to fill in this info.
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/43839004
Cr-Commit-Position: refs/heads/master@{#8749}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8749 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-17 12:13:13 +00:00
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
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
abbdd520b0
AudioEncoder: documentation fix
...
Follow-up to https://webrtc-codereview.appspot.com/38279004/
R=henrik.lundin@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/38309004
Cr-Commit-Position: refs/heads/master@{#8524}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8524 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-27 09:20:25 +00:00
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
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
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
f45c8ca88b
Reland r8248 "Introduce ACMGenericCodecWrapper"
...
This effectively reverts r8249.
This new class inherits from ACMGenericCodec. The purpose is to wrap
AudioEncoder objects into an ACMGenericCodec interface. This is a
temporary construction that will be used during the ACM redesign work.
BUG=4228
COAUTHOR=kwiberg@webrtc.org
TBR=tina.legrand@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/38919004
Cr-Commit-Position: refs/heads/master@{#8255}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8255 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-02-05 18:30:16 +00:00
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
c1c9291e9b
Make an AudioEncoder subclass for RED
...
This class only supports the simple case of payload duplication. That
is, one single encoder is used, and the redundant payload is a one-step
delayed payload.
BUG=3926
R=kjellander@webrtc.org , kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/31199004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7913 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-12-16 13:41:36 +00:00
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
8911bc52f1
Add AudioEncoder::Max10MsFramesInAPacket
...
BUG=3926
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/29179004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7834 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-12-08 21:15:55 +00:00
8dc21dc238
Rename internal AudioEncoder::Encode method to EncodeInternal
...
BUG=3926
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/28129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7801 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-12-03 20:36:03 +00:00
7f1dfa5b61
Adding a payload type to AudioEncoder objects
...
The type is set in the Config struct and is provided in the EncodedInfo
output struct from each Encode() call. The audio_decoder_unittest is
updated to verify correct propagation of the payload type.
BUG=3926
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/27299004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7780 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-12-02 12:08:39 +00:00
1db20a4180
Adding EncodedInfo struct to AudioEncoder::Encode
...
This struct will be expanded in future changes.
BUG=3926
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/31049004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7771 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-12-01 14:44:50 +00:00
decd9306ae
AudioEncoder: num_10ms_frames_per_packet -> Num10MsFramesInNextPacket
...
Rename this accessor function to reflect its new, slightly changed
meaning. The reason for the change is that some codecs (iSAC) vary the
number of 10 ms frames from packet to packet, and so can't return a
truly constant value.
BUG=3926
R=henrik.lundin@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/31849004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7556 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-29 08:38:50 +00:00
663fdd02fd
Make an AudioEncoder subclass for Opus
...
BUG=3926
R=henrik.lundin@webrtc.org , kjellander@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/23239004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7552 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-29 07:28:36 +00:00
def1e97ed2
Implement AudioEncoderPcmU/A classes and convert AudioDecoder tests
...
BUG=3926
R=kjellander@webrtc.org , kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/29799004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7481 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-21 12:48:29 +00:00
264e66f7a5
Add encoded_timestamp to AudioEncoder base class
...
BUG=3926
TBR=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/24029004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7464 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-16 21:16:07 +00:00
9ea6f8a84d
New interface class AudioEncoder
...
This class will be the base for new C++ wrapper classes for all
encoders.
BUG=3926
TBR=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/23999004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7463 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-16 11:26:24 +00:00