Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 723 fprintf(fp_mask_, "\n"); | 723 fprintf(fp_mask_, "\n"); |
| 724 } | 724 } |
| 725 fprintf(fp_mask_, "\n"); | 725 fprintf(fp_mask_, "\n"); |
| 726 } | 726 } |
| 727 | 727 |
| 728 int ProcessXORPacketMasks(CodeType code_type, | 728 int ProcessXORPacketMasks(CodeType code_type, |
| 729 FecMaskType fec_mask_type) { | 729 FecMaskType fec_mask_type) { |
| 730 int code_index = 0; | 730 int code_index = 0; |
| 731 // Maximum number of media packets allowed for the mask type. | 731 // Maximum number of media packets allowed for the mask type. |
| 732 const int packet_mask_max = kMaxMediaPackets[fec_mask_type]; | 732 const int packet_mask_max = kMaxMediaPackets[fec_mask_type]; |
| 733 uint8_t* packet_mask = new uint8_t[packet_mask_max * kMaskSizeLBitSet]; | 733 uint8_t* packet_mask = |
| 734 new uint8_t[packet_mask_max * kUlpfecPacketMaskSizeLBitSet]; | |
|
danilchap
2016/08/29 12:26:03
kUlpfecMaxPacketMaskSize probably make more sense
brandtr
2016/08/30 07:12:42
Done.
| |
| 734 // Loop through codes up to |kMaxMediaPacketsTest|. | 735 // Loop through codes up to |kMaxMediaPacketsTest|. |
| 735 for (int num_media_packets = 1; num_media_packets <= kMaxMediaPacketsTest; | 736 for (int num_media_packets = 1; num_media_packets <= kMaxMediaPacketsTest; |
| 736 num_media_packets++) { | 737 num_media_packets++) { |
| 737 const int mask_bytes_fec_packet = | 738 const int mask_bytes_fec_packet = |
| 738 (num_media_packets > 16) ? kMaskSizeLBitSet : kMaskSizeLBitClear; | 739 internal::PacketMaskSize(num_media_packets); |
| 739 internal::PacketMaskTable mask_table(fec_mask_type, num_media_packets); | 740 internal::PacketMaskTable mask_table(fec_mask_type, num_media_packets); |
| 740 for (int num_fec_packets = 1; num_fec_packets <= num_media_packets; | 741 for (int num_fec_packets = 1; num_fec_packets <= num_media_packets; |
| 741 num_fec_packets++) { | 742 num_fec_packets++) { |
| 742 memset(packet_mask, 0, num_media_packets * mask_bytes_fec_packet); | 743 memset(packet_mask, 0, num_media_packets * mask_bytes_fec_packet); |
| 743 memcpy(packet_mask, mask_table.fec_packet_mask_table() | 744 memcpy(packet_mask, mask_table.fec_packet_mask_table() |
| 744 [num_media_packets - 1][num_fec_packets - 1], | 745 [num_media_packets - 1][num_fec_packets - 1], |
| 745 num_fec_packets * mask_bytes_fec_packet); | 746 num_fec_packets * mask_bytes_fec_packet); |
| 746 // Convert to bit mask. | 747 // Convert to bit mask. |
| 747 GetPacketMaskConvertToBitMask(packet_mask, | 748 GetPacketMaskConvertToBitMask(packet_mask, |
| 748 num_media_packets, | 749 num_media_packets, |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1073 recovery_rate_per_loss[loss_number], | 1074 recovery_rate_per_loss[loss_number], |
| 1074 kRecoveryRateXorRandom[2]); | 1075 kRecoveryRateXorRandom[2]); |
| 1075 EXPECT_GE(kMetricsXorBursty[code_index]. | 1076 EXPECT_GE(kMetricsXorBursty[code_index]. |
| 1076 recovery_rate_per_loss[loss_number], | 1077 recovery_rate_per_loss[loss_number], |
| 1077 kRecoveryRateXorBursty[2]); | 1078 kRecoveryRateXorBursty[2]); |
| 1078 } | 1079 } |
| 1079 } | 1080 } |
| 1080 } | 1081 } |
| 1081 | 1082 |
| 1082 } // namespace webrtc | 1083 } // namespace webrtc |
| OLD | NEW |