comparison ac3dec.c @ 10323:1f5c4d2ce77f libavcodec

Simplify stereo rematrixing by only using one temporary variable. It is also about 1.8% faster on my system.
author jbr
date Wed, 30 Sep 2009 01:25:04 +0000
parents 6bca3f74d77d
children b5b58febcf68
comparison
equal deleted inserted replaced
10322:6bca3f74d77d 10323:1f5c4d2ce77f
602 */ 602 */
603 static void do_rematrixing(AC3DecodeContext *s) 603 static void do_rematrixing(AC3DecodeContext *s)
604 { 604 {
605 int bnd, i; 605 int bnd, i;
606 int end, bndend; 606 int end, bndend;
607 int tmp0, tmp1;
608 607
609 end = FFMIN(s->end_freq[1], s->end_freq[2]); 608 end = FFMIN(s->end_freq[1], s->end_freq[2]);
610 609
611 i = ff_ac3_rematrix_band_tab[0]; 610 i = ff_ac3_rematrix_band_tab[0];
612 for(bnd=0; bnd<s->num_rematrixing_bands; bnd++) { 611 for(bnd=0; bnd<s->num_rematrixing_bands; bnd++) {
613 if(s->rematrixing_flags[bnd]) { 612 if(s->rematrixing_flags[bnd]) {
614 bndend = FFMIN(end, ff_ac3_rematrix_band_tab[bnd+1]); 613 bndend = FFMIN(end, ff_ac3_rematrix_band_tab[bnd+1]);
615 for(; i<bndend; i++) { 614 for(; i<bndend; i++) {
616 tmp0 = s->fixed_coeffs[1][i]; 615 int tmp0 = s->fixed_coeffs[1][i];
617 tmp1 = s->fixed_coeffs[2][i]; 616 s->fixed_coeffs[1][i] -= s->fixed_coeffs[2][i];
618 s->fixed_coeffs[1][i] = tmp0 + tmp1; 617 s->fixed_coeffs[2][i] = tmp0 - s->fixed_coeffs[2][i];
619 s->fixed_coeffs[2][i] = tmp0 - tmp1;
620 } 618 }
621 } 619 }
622 } 620 }
623 } 621 }
624 622