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

Side by Side Diff: webrtc/modules/rtp_rtcp/test/testFec/test_packet_masks_metrics.cc

Issue 2260803002: Generalize FEC header formatting. (pt. 4) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Feedback response. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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];
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 = (num_media_packets > 16)
danilchap 2016/08/25 17:49:15 may be use internal::PacketMaskSize(num_media_pack
brandtr 2016/08/26 11:22:23 Done.
738 (num_media_packets > 16) ? kMaskSizeLBitSet : kMaskSizeLBitClear; 739 ? kUlpfecPacketMaskSizeLBitSet
740 : kUlpfecPacketMaskSizeLBitClear;
739 internal::PacketMaskTable mask_table(fec_mask_type, num_media_packets); 741 internal::PacketMaskTable mask_table(fec_mask_type, num_media_packets);
740 for (int num_fec_packets = 1; num_fec_packets <= num_media_packets; 742 for (int num_fec_packets = 1; num_fec_packets <= num_media_packets;
741 num_fec_packets++) { 743 num_fec_packets++) {
742 memset(packet_mask, 0, num_media_packets * mask_bytes_fec_packet); 744 memset(packet_mask, 0, num_media_packets * mask_bytes_fec_packet);
743 memcpy(packet_mask, mask_table.fec_packet_mask_table() 745 memcpy(packet_mask, mask_table.fec_packet_mask_table()
744 [num_media_packets - 1][num_fec_packets - 1], 746 [num_media_packets - 1][num_fec_packets - 1],
745 num_fec_packets * mask_bytes_fec_packet); 747 num_fec_packets * mask_bytes_fec_packet);
746 // Convert to bit mask. 748 // Convert to bit mask.
747 GetPacketMaskConvertToBitMask(packet_mask, 749 GetPacketMaskConvertToBitMask(packet_mask,
748 num_media_packets, 750 num_media_packets,
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 recovery_rate_per_loss[loss_number], 1075 recovery_rate_per_loss[loss_number],
1074 kRecoveryRateXorRandom[2]); 1076 kRecoveryRateXorRandom[2]);
1075 EXPECT_GE(kMetricsXorBursty[code_index]. 1077 EXPECT_GE(kMetricsXorBursty[code_index].
1076 recovery_rate_per_loss[loss_number], 1078 recovery_rate_per_loss[loss_number],
1077 kRecoveryRateXorBursty[2]); 1079 kRecoveryRateXorBursty[2]);
1078 } 1080 }
1079 } 1081 }
1080 } 1082 }
1081 1083
1082 } // namespace webrtc 1084 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698