OLD | NEW |
1 /* Copyright (c) 2011 Xiph.Org Foundation | 1 /* Copyright (c) 2011 Xiph.Org Foundation |
2 Written by Jean-Marc Valin */ | 2 Written by Jean-Marc Valin */ |
3 /* | 3 /* |
4 Redistribution and use in source and binary forms, with or without | 4 Redistribution and use in source and binary forms, with or without |
5 modification, are permitted provided that the following conditions | 5 modification, are permitted provided that the following conditions |
6 are met: | 6 are met: |
7 | 7 |
8 - Redistributions of source code must retain the above copyright | 8 - Redistributions of source code must retain the above copyright |
9 notice, this list of conditions and the following disclaimer. | 9 notice, this list of conditions and the following disclaimer. |
10 | 10 |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 for (i=0;i<count;i++) | 212 for (i=0;i<count;i++) |
213 { | 213 { |
214 /* Using OPUS_MOVE() instead of OPUS_COPY() in case we're doing in-place | 214 /* Using OPUS_MOVE() instead of OPUS_COPY() in case we're doing in-place |
215 padding from opus_packet_pad or opus_packet_unpad(). */ | 215 padding from opus_packet_pad or opus_packet_unpad(). */ |
216 celt_assert(frames[i] + len[i] <= data || ptr <= frames[i]); | 216 celt_assert(frames[i] + len[i] <= data || ptr <= frames[i]); |
217 OPUS_MOVE(ptr, frames[i], len[i]); | 217 OPUS_MOVE(ptr, frames[i], len[i]); |
218 ptr += len[i]; | 218 ptr += len[i]; |
219 } | 219 } |
220 if (pad) | 220 if (pad) |
221 { | 221 { |
222 for (i=ptr-data;i<maxlen;i++) | 222 /* Fill padding with zeros. */ |
223 data[i] = 0; | 223 while (ptr<data+maxlen) |
| 224 *ptr++=0; |
224 } | 225 } |
225 return tot_size; | 226 return tot_size; |
226 } | 227 } |
227 | 228 |
228 opus_int32 opus_repacketizer_out_range(OpusRepacketizer *rp, int begin, int end,
unsigned char *data, opus_int32 maxlen) | 229 opus_int32 opus_repacketizer_out_range(OpusRepacketizer *rp, int begin, int end,
unsigned char *data, opus_int32 maxlen) |
229 { | 230 { |
230 return opus_repacketizer_out_range_impl(rp, begin, end, data, maxlen, 0, 0); | 231 return opus_repacketizer_out_range_impl(rp, begin, end, data, maxlen, 0, 0); |
231 } | 232 } |
232 | 233 |
233 opus_int32 opus_repacketizer_out(OpusRepacketizer *rp, unsigned char *data, opus
_int32 maxlen) | 234 opus_int32 opus_repacketizer_out(OpusRepacketizer *rp, unsigned char *data, opus
_int32 maxlen) |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 return ret; | 337 return ret; |
337 else | 338 else |
338 dst_len += ret; | 339 dst_len += ret; |
339 dst += ret; | 340 dst += ret; |
340 data += packet_offset; | 341 data += packet_offset; |
341 len -= packet_offset; | 342 len -= packet_offset; |
342 } | 343 } |
343 return dst_len; | 344 return dst_len; |
344 } | 345 } |
345 | 346 |
OLD | NEW |