/*
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
*
- * This file is part of FFmpeg.
+ * This file is part of Libav.
*
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
* If 0, you must swap the CRC parameter and the result of av_crc
* if you need the standard representation (can be simplified in
* most cases to e.g. bswap16):
- * bswap_32(crc << (32-bits))
+ * av_bswap32(crc << (32-bits))
* @param bits number of bits for the CRC
* @param poly generator polynomial without the x**bits coefficient, in the
* representation as specified by le
* @return <0 on failure
*/
int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size){
- int i, j;
+ unsigned i, j;
uint32_t c;
if (bits < 8 || bits > 32 || poly >= (1LL<<bits))
} else {
for (c = i << 24, j = 0; j < 8; j++)
c = (c<<1) ^ ((poly<<(32-bits)) & (((int32_t)c)>>31) );
- ctx[i] = bswap_32(c);
+ ctx[i] = av_bswap32(c);
}
}
ctx[256]=1;
crc = ctx[((uint8_t)crc) ^ *buffer++] ^ (crc >> 8);
while(buffer<end-3){
- crc ^= le2ne_32(*(const uint32_t*)buffer); buffer+=4;
+ crc ^= av_le2ne32(*(const uint32_t*)buffer); buffer+=4;
crc = ctx[3*256 + ( crc &0xFF)]
^ctx[2*256 + ((crc>>8 )&0xFF)]
^ctx[1*256 + ((crc>>16)&0xFF)]