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

Issue 2281453002: Moved codec-specific audio packet splitting into decoders. (Closed)

Created:
4 years, 3 months ago by ossu
Modified:
4 years, 3 months ago
Reviewers:
kwiberg-webrtc
CC:
webrtc-reviews_webrtc.org, kwiberg-webrtc, tlegrand-webrtc, tterriberry_mozilla.com, audio-team_agora.io, hlundin-webrtc, peah-webrtc, minyue-webrtc
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Moved codec-specific audio packet splitting into decoders. There's still some code run specifically for Opus w/ FEC. Will investigate on how to move that as well. Closed in favor of https://codereview.webrtc.org/2326003002, which solves the same problem more neatly. BUG=webrtc:5805

Patch Set 1 #

Total comments: 32
Unified diffs Side-by-side diffs Delta from patch set Stats (+246 lines, -233 lines) Patch
M webrtc/modules/audio_coding/codecs/audio_decoder.h View 4 chunks +23 lines, -1 line 8 comments Download
M webrtc/modules/audio_coding/codecs/audio_decoder.cc View 2 chunks +43 lines, -0 lines 10 comments Download
M webrtc/modules/audio_coding/codecs/g711/audio_decoder_pcm.h View 2 chunks +4 lines, -0 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/g711/audio_decoder_pcm.cc View 2 chunks +12 lines, -0 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/g722/audio_decoder_g722.h View 2 chunks +4 lines, -0 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/g722/audio_decoder_g722.cc View 2 chunks +17 lines, -0 lines 3 comments Download
M webrtc/modules/audio_coding/codecs/ilbc/audio_decoder_ilbc.h View 1 chunk +2 lines, -0 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/ilbc/audio_decoder_ilbc.cc View 2 chunks +40 lines, -0 lines 3 comments Download
M webrtc/modules/audio_coding/codecs/pcm16b/audio_decoder_pcm16b.h View 1 chunk +2 lines, -0 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/pcm16b/audio_decoder_pcm16b.cc View 1 chunk +11 lines, -0 lines 1 comment Download
M webrtc/modules/audio_coding/neteq/payload_splitter.h View 2 chunks +3 lines, -19 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/payload_splitter.cc View 1 chunk +39 lines, -200 lines 4 comments Download
M webrtc/modules/audio_coding/neteq/payload_splitter_unittest.cc View 6 chunks +46 lines, -13 lines 3 comments Download

Depends on Patchset:

Messages

Total messages: 6 (2 generated)
ossu
This is the work I've done so far in moving audio packet splitting from NetEq ...
4 years, 3 months ago (2016-08-25 10:49:15 UTC) #2
kwiberg-webrtc
https://codereview.webrtc.org/2281453002/diff/1/webrtc/modules/audio_coding/codecs/audio_decoder.cc File webrtc/modules/audio_coding/codecs/audio_decoder.cc (right): https://codereview.webrtc.org/2281453002/diff/1/webrtc/modules/audio_coding/codecs/audio_decoder.cc#newcode107 webrtc/modules/audio_coding/codecs/audio_decoder.cc:107: uint32_t timestamps_per_ms) { This is the sort of function ...
4 years, 3 months ago (2016-08-26 12:39:25 UTC) #3
ossu
I'll do another pass over this CL. Specifically, I think SplitBySamples should be moved out ...
4 years, 3 months ago (2016-08-26 13:05:30 UTC) #4
kwiberg-webrtc
4 years, 3 months ago (2016-08-26 22:05:13 UTC) #5
https://codereview.webrtc.org/2281453002/diff/1/webrtc/modules/audio_coding/c...
File webrtc/modules/audio_coding/codecs/audio_decoder.cc (right):

https://codereview.webrtc.org/2281453002/diff/1/webrtc/modules/audio_coding/c...
webrtc/modules/audio_coding/codecs/audio_decoder.cc:107: uint32_t
timestamps_per_ms) {
On 2016/08/26 13:05:29, ossu wrote:
> On 2016/08/26 12:39:24, kwiberg-webrtc wrote:
> > This is the sort of function that should have a unit test.
> 
> It does. Several of them even.
> Though, granted, it's not tested by calling SplitBySamples directly, but the
> same way it was tested before: by setting up codecs with known splits and
> testing the splitting on them.

It's arguably not a unit test of this function in that case. :-) But that's
certainly much better than nothing.

https://codereview.webrtc.org/2281453002/diff/1/webrtc/modules/audio_coding/c...
webrtc/modules/audio_coding/codecs/audio_decoder.cc:114: size_t min_chunk_size =
bytes_per_ms * 20;
On 2016/08/26 13:05:29, ossu wrote:
> On 2016/08/26 12:39:24, kwiberg-webrtc wrote:
> > const
> 
> Hey, don't blame me, I just clean up around here! :)

Yeah, I think I wrote this comment before I realized that you'd just moved this
code from somewhere else.

https://codereview.webrtc.org/2281453002/diff/1/webrtc/modules/audio_coding/c...
webrtc/modules/audio_coding/codecs/audio_decoder.cc:119: split_size_bytes >>= 1;
On 2016/08/26 13:05:29, ossu wrote:
> On 2016/08/26 12:39:24, kwiberg-webrtc wrote:
> > Less cleverly written as split_size_bytes /= 2;
> > 
> > I'm sure there's a way to do this without looping, but we can leave that
> > optimization for another day...
> 
> Yeah, I mean the code can be improved but I've aimed to change as little as
> possible during the restructuring. I could simplify it in a separate CL and if
> something breaks, we know it's not due to moving stuff around, but due to the
> cleanup.

sgtm.

https://codereview.webrtc.org/2281453002/diff/1/webrtc/modules/audio_coding/c...
File webrtc/modules/audio_coding/codecs/audio_decoder.h (right):

https://codereview.webrtc.org/2281453002/diff/1/webrtc/modules/audio_coding/c...
webrtc/modules/audio_coding/codecs/audio_decoder.h:91: size_t payload_len)
const;
On 2016/08/26 13:05:29, ossu wrote:
> On 2016/08/26 12:39:24, kwiberg-webrtc wrote:
> > Consider using a single rtc::ArrayView<const uint8_t> argument instead.
> 
> I've used this since it's how the rest of the API looks. An ArrayView is
better,
> but not at the cost of conformance, IMO.

That's unavoidable if you want a gradual shift from old to new style. But
switching everything at once is problematic in other ways, as is not switching.

https://codereview.webrtc.org/2281453002/diff/1/webrtc/modules/audio_coding/n...
File webrtc/modules/audio_coding/neteq/payload_splitter_unittest.cc (right):

https://codereview.webrtc.org/2281453002/diff/1/webrtc/modules/audio_coding/n...
webrtc/modules/audio_coding/neteq/payload_splitter_unittest.cc:158:
ASSERT_EQ(payload_value, packet->payload[i]);
On 2016/08/26 13:05:30, ossu wrote:
> On 2016/08/26 12:39:25, kwiberg-webrtc wrote:
> > The caller of VerifyPacket doesn't call ASSERT/EXPECT_NO_FATAL_FAILURES, so
> it's
> > probably better to just EXPECT. See
> >
>
https://github.com/google/googletest/blob/master/googletest/docs/AdvancedGuid....
> 
> Well you'll get one roughly one trillion errors during a failing test, rather
> than only the first one. The line just before the for-loop does ASSERT_FALSE,
so
> an assert could already happen.

OK. But then the callers ought to use ASSERT_NO_FATAL_FAILURES.

Powered by Google App Engine
This is Rietveld 408576698