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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/forward_error_correction.h

Issue 2269893002: Move InsertZeroColumns and CopyColumn to ::internal. (pt. 1) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Review 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
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/forward_error_correction.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 // Analyzes |media_packets| for holes in the sequence and inserts zero columns 222 // Analyzes |media_packets| for holes in the sequence and inserts zero columns
223 // into the |packet_mask| where those holes are found. Zero columns means that 223 // into the |packet_mask| where those holes are found. Zero columns means that
224 // those packets will have no protection. 224 // those packets will have no protection.
225 // Returns the number of bits used for one row of the new packet mask. 225 // Returns the number of bits used for one row of the new packet mask.
226 // Requires that |packet_mask| has at least 6 * |num_fec_packets| bytes 226 // Requires that |packet_mask| has at least 6 * |num_fec_packets| bytes
227 // allocated. 227 // allocated.
228 int InsertZerosInBitMasks(const PacketList& media_packets, 228 int InsertZerosInBitMasks(const PacketList& media_packets,
229 uint8_t* packet_mask, int num_mask_bytes, 229 uint8_t* packet_mask, int num_mask_bytes,
230 int num_fec_packets); 230 int num_fec_packets);
231 231
232 // Inserts |num_zeros| zero columns into |new_mask| at position
233 // |new_bit_index|. If the current byte of |new_mask| can't fit all zeros, the
234 // byte will be filled with zeros from |new_bit_index|, but the next byte will
235 // be untouched.
236 static void InsertZeroColumns(int num_zeros, uint8_t* new_mask,
237 int new_mask_bytes, int num_fec_packets,
238 int new_bit_index);
239
240 // Copies the left most bit column from the byte pointed to by
241 // |old_bit_index| in |old_mask| to the right most column of the byte pointed
242 // to by |new_bit_index| in |new_mask|. |old_mask_bytes| and |new_mask_bytes|
243 // represent the number of bytes used per row for each mask. |num_fec_packets|
244 // represent the number of rows of the masks.
245 // The copied bit is shifted out from |old_mask| and is shifted one step to
246 // the left in |new_mask|. |new_mask| will contain "xxxx xxn0" after this
247 // operation, where x are previously inserted bits and n is the new bit.
248 static void CopyColumn(uint8_t* new_mask, int new_mask_bytes,
249 uint8_t* old_mask, int old_mask_bytes,
250 int num_fec_packets, int new_bit_index,
251 int old_bit_index);
252 232
253 void GenerateFecUlpHeaders(const PacketList& media_packets, 233 void GenerateFecUlpHeaders(const PacketList& media_packets,
254 uint8_t* packet_mask, int num_fec_packets, 234 uint8_t* packet_mask, int num_fec_packets,
255 bool l_bit); 235 bool l_bit);
256 236
257 void GenerateFecBitStrings(const PacketList& media_packets, 237 void GenerateFecBitStrings(const PacketList& media_packets,
258 uint8_t* packet_mask, int num_fec_packets, 238 uint8_t* packet_mask, int num_fec_packets,
259 bool l_bit); 239 bool l_bit);
260 240
261 // Inserts the |received_packets| into the internal received FEC packet list 241 // Inserts the |received_packets| into the internal received FEC packet list
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 ReceivedFecPacketList received_fec_packets_; 301 ReceivedFecPacketList received_fec_packets_;
322 302
323 // Arrays used to avoid dynamically allocating memory when generating 303 // Arrays used to avoid dynamically allocating memory when generating
324 // the packet masks in the ULPFEC headers. 304 // the packet masks in the ULPFEC headers.
325 // (There are never more than |kMaxMediaPackets| FEC packets generated.) 305 // (There are never more than |kMaxMediaPackets| FEC packets generated.)
326 uint8_t packet_mask_[kMaxMediaPackets * kMaskSizeLBitSet]; 306 uint8_t packet_mask_[kMaxMediaPackets * kMaskSizeLBitSet];
327 uint8_t tmp_packet_mask_[kMaxMediaPackets * kMaskSizeLBitSet]; 307 uint8_t tmp_packet_mask_[kMaxMediaPackets * kMaskSizeLBitSet];
328 }; 308 };
329 } // namespace webrtc 309 } // namespace webrtc
330 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_FORWARD_ERROR_CORRECTION_H_ 310 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_FORWARD_ERROR_CORRECTION_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/forward_error_correction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698