Fix a couple of nits and update a few comments in forward_error_correction_internal.

Bug: None
Change-Id: Ie71ea6e98852360940b004fe051044d68c5b299d
Reviewed-on: https://webrtc-review.googlesource.com/71200
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22983}
This commit is contained in:
Ying Wang 2018-04-19 14:32:19 +02:00 committed by Commit Bot
parent f9deb7ab5f
commit 5987f2a9ae
3 changed files with 12 additions and 11 deletions

View File

@ -65,7 +65,7 @@ TEST(FecTable, TestRandomLookup) {
}
TEST(FecTable, TestRandomGenerated) {
FecMaskType fec_mask_type = webrtc::kFecMaskRandom;
FecMaskType fec_mask_type = kFecMaskRandom;
int num_media_packets = 15;
int num_fec_packets = 6;
size_t mask_size = sizeof(kMaskRandom15_6) / sizeof(uint8_t);
@ -73,7 +73,7 @@ TEST(FecTable, TestRandomGenerated) {
rtc::ArrayView<const uint8_t> mask =
mask_table.LookUp(num_media_packets, num_fec_packets);
EXPECT_EQ(mask.size(), mask_size);
for (size_t i = 0; i < mask_size; i++) {
for (size_t i = 0; i < mask_size; ++i) {
EXPECT_EQ(mask[i], kMaskRandom15_6[i]);
}
}

View File

@ -392,19 +392,18 @@ void UnequalProtectionMask(int num_media_packets,
}
// This algorithm is tailored to look up data in the |kPacketMaskRandomTbl| and
// |kPacketMaskBurstyTbl| tables.
// The format of those arrays is that they're essentially a 3 dimensional array
// with the following dimensions:
// * media packet
// * Size for kPacketMaskRandomTbl: 48
// |kPacketMaskBurstyTbl| tables. These tables only cover fec code for up to 12
// media packets. Starting from 13 media packets, the fec code will be generated
// at runtime. The format of those arrays is that they're essentially a 3
// dimensional array with the following dimensions: * media packet
// * Size for kPacketMaskRandomTbl: 12
// * Size for kPacketMaskBurstyTbl: 12
// * fec index
// * Size for both random and bursty table increases from 1 to number of rows.
// (i.e. 1-48, or 1-12 respectively).
// * Fec data (what actually gets returned)
// * Size for kPacketMaskRandomTbl:
// * For the first 16 entries: 2 * fec index (1 based)
// * For entries >= 17: 6 * fec index (1 based)
// * Size for kPacketMaskRandomTbl: 2 bytes.
// * For all entries: 2 * fec index (1 based)
// * Size for kPacketMaskBurstyTbl: 2 bytes.
// * For all entries: 2 * fec index (1 based)
rtc::ArrayView<const uint8_t> LookUpInFecTable(const uint8_t* table,

View File

@ -25,7 +25,9 @@ constexpr size_t kUlpfecMaxMediaPackets = 48;
constexpr size_t kUlpfecPacketMaskSizeLBitClear = 2;
constexpr size_t kUlpfecPacketMaskSizeLBitSet = 6;
// Packet code mask maximum length
// Packet code mask maximum length. kFECPacketMaskMaxSize = MaxNumFECPackets *
// (kUlpfecMaxMediaPackets / 8), and MaxNumFECPackets is equal to maximum number
// of media packets (kUlpfecMaxMediaPackets)
constexpr size_t kFECPacketMaskMaxSize = 288;
// Convenience constants.