[FFmpeg-devel] CNG (consistent noise generation) patch for AC-3 decoder
James Almer
jamrial at gmail.com
Sun Sep 4 00:00:11 EEST 2016
On 9/3/2016 11:07 AM, James Almer wrote:
>> > +
>> > + /* avoid integer overflow in the loop below. */
>> > + if (length > (UINT_MAX / 128U)) return AVERROR(EINVAL);
>> > +
>> > + /* across 64 segments of the incoming data,
>> > + * do a running crc of each segment and store the crc as the state for that slot.
>> > + * this works even if the length of the segment is 0 bytes. */
>> > + beg = 0;
>> > + for (segm = 0;segm < 64;segm++) {
>> > + end = (((segm + 1) * length) / 64);
>> > + crc = av_crc(avcrc, crc, data + beg, end - beg);
> The thing about speed made me wonder, wouldn't using adler32 be faster?
Nevermind, probably not a good idea. adler32 wouldn't be a good seed
for lfg.
More information about the ffmpeg-devel
mailing list