comparison adpcm.c @ 5834:1edffbe7d57d libavcodec

Remove unnecessary guarding &=0x0f around adpcm_ima_compress_sample(). patch by Timofei, tim ipi.ac ru Date: Mon, 15 Oct 2007 19:55:29 +0400 Subject: [FFmpeg-devel] [PATCH] adpcm-ima-wav header and codec
author diego
date Wed, 17 Oct 2007 23:02:35 +0000
parents 38f220befc32
children 342ab05e7d05
comparison
equal deleted inserted replaced
5833:dfd34e7f243f 5834:1edffbe7d57d
481 *dst++ = buf[1][8*i+6] | (buf[1][8*i+7] << 4); 481 *dst++ = buf[1][8*i+6] | (buf[1][8*i+7] << 4);
482 } 482 }
483 } 483 }
484 } else 484 } else
485 for (; n>0; n--) { 485 for (; n>0; n--) {
486 *dst = adpcm_ima_compress_sample(&c->status[0], samples[0]) & 0x0F; 486 *dst = adpcm_ima_compress_sample(&c->status[0], samples[0]);
487 *dst |= (adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels]) << 4) & 0xF0; 487 *dst |= adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels]) << 4;
488 dst++; 488 dst++;
489 *dst = adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 2]) & 0x0F; 489 *dst = adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 2]);
490 *dst |= (adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 3]) << 4) & 0xF0; 490 *dst |= adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 3]) << 4;
491 dst++; 491 dst++;
492 *dst = adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 4]) & 0x0F; 492 *dst = adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 4]);
493 *dst |= (adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 5]) << 4) & 0xF0; 493 *dst |= adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 5]) << 4;
494 dst++; 494 dst++;
495 *dst = adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 6]) & 0x0F; 495 *dst = adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 6]);
496 *dst |= (adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 7]) << 4) & 0xF0; 496 *dst |= adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 7]) << 4;
497 dst++; 497 dst++;
498 /* right channel */ 498 /* right channel */
499 if (avctx->channels == 2) { 499 if (avctx->channels == 2) {
500 *dst = adpcm_ima_compress_sample(&c->status[1], samples[1]); 500 *dst = adpcm_ima_compress_sample(&c->status[1], samples[1]);
501 *dst |= adpcm_ima_compress_sample(&c->status[1], samples[3]) << 4; 501 *dst |= adpcm_ima_compress_sample(&c->status[1], samples[3]) << 4;
542 if (avctx->channels == 2) 542 if (avctx->channels == 2)
543 put_bits(&pb, 4, buf[1][i]); 543 put_bits(&pb, 4, buf[1][i]);
544 } 544 }
545 } else { 545 } else {
546 for (i=1; i<avctx->frame_size; i++) { 546 for (i=1; i<avctx->frame_size; i++) {
547 put_bits(&pb, 4, adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels*i]) & 0xF); 547 put_bits(&pb, 4, adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels*i]));
548 if (avctx->channels == 2) 548 if (avctx->channels == 2)
549 put_bits(&pb, 4, adpcm_ima_compress_sample(&c->status[1], samples[2*i+1]) & 0xF); 549 put_bits(&pb, 4, adpcm_ima_compress_sample(&c->status[1], samples[2*i+1]));
550 } 550 }
551 } 551 }
552 flush_put_bits(&pb); 552 flush_put_bits(&pb);
553 dst += put_bits_count(&pb)>>3; 553 dst += put_bits_count(&pb)>>3;
554 break; 554 break;