comparison adpcm.c @ 6592:1d4e5e8d8012 libavcodec

ILP64 fixes (untested)
author michael
date Sun, 13 Apr 2008 16:11:36 +0000
parents 01bea2407628
children 372ad1fe174d
comparison
equal deleted inserted replaced
6591:45bcfc54aa80 6592:1d4e5e8d8012
1213 shift_left = (*src >> 4 ) + 8; 1213 shift_left = (*src >> 4 ) + 8;
1214 shift_right = (*src & 0x0F) + 8; 1214 shift_right = (*src & 0x0F) + 8;
1215 src++; 1215 src++;
1216 1216
1217 for (count2 = 0; count2 < 28; count2++) { 1217 for (count2 = 0; count2 < 28; count2++) {
1218 next_left_sample = (((*src & 0xF0) << 24) >> shift_left); 1218 next_left_sample = (int32_t)((*src & 0xF0) << 24) >> shift_left;
1219 next_right_sample = (((*src & 0x0F) << 28) >> shift_right); 1219 next_right_sample = (int32_t)((*src & 0x0F) << 28) >> shift_right;
1220 src++; 1220 src++;
1221 1221
1222 next_left_sample = (next_left_sample + 1222 next_left_sample = (next_left_sample +
1223 (current_left_sample * coeff1l) + 1223 (current_left_sample * coeff1l) +
1224 (previous_left_sample * coeff2l) + 0x80) >> 8; 1224 (previous_left_sample * coeff2l) + 0x80) >> 8;
1287 coeff2 = ea_adpcm_table[(*srcC>>4) + 4]; 1287 coeff2 = ea_adpcm_table[(*srcC>>4) + 4];
1288 shift = (*srcC++ & 0x0F) + 8; 1288 shift = (*srcC++ & 0x0F) + 8;
1289 1289
1290 for (count2=0; count2<28; count2++) { 1290 for (count2=0; count2<28; count2++) {
1291 if (count2 & 1) 1291 if (count2 & 1)
1292 next_sample = ((*srcC++ & 0x0F) << 28) >> shift; 1292 next_sample = (int32_t)((*srcC++ & 0x0F) << 28) >> shift;
1293 else 1293 else
1294 next_sample = ((*srcC & 0xF0) << 24) >> shift; 1294 next_sample = (int32_t)((*srcC & 0xF0) << 24) >> shift;
1295 1295
1296 next_sample += (current_sample * coeff1) + 1296 next_sample += (current_sample * coeff1) +
1297 (previous_sample * coeff2); 1297 (previous_sample * coeff2);
1298 next_sample = av_clip_int16(next_sample >> 8); 1298 next_sample = av_clip_int16(next_sample >> 8);
1299 1299
1334 1334
1335 for (m=2; m<32; m+=2) { 1335 for (m=2; m<32; m+=2) {
1336 s = &samples[m*avctx->channels + channel]; 1336 s = &samples[m*avctx->channels + channel];
1337 for (n=0; n<4; n++, src++, s+=32*avctx->channels) { 1337 for (n=0; n<4; n++, src++, s+=32*avctx->channels) {
1338 for (s2=s, i=0; i<8; i+=4, s2+=avctx->channels) { 1338 for (s2=s, i=0; i<8; i+=4, s2+=avctx->channels) {
1339 int level = ((*src & (0xF0>>i)) << (24+i)) >> shift[n]; 1339 int level = (int32_t)((*src & (0xF0>>i)) << (24+i)) >> shift[n];
1340 int pred = s2[-1*avctx->channels] * coeff[0][n] 1340 int pred = s2[-1*avctx->channels] * coeff[0][n]
1341 + s2[-2*avctx->channels] * coeff[1][n]; 1341 + s2[-2*avctx->channels] * coeff[1][n];
1342 s2[0] = av_clip_int16((level + pred + 0x80) >> 8); 1342 s2[0] = av_clip_int16((level + pred + 0x80) >> 8);
1343 } 1343 }
1344 } 1344 }