comparison aac.c @ 8283:ea8e4095d980 libavcodec

AAC: Unroll code within decode_spectrum_and_dequant(). Gives 12% net speed gain. Patch by Alex Converse (alex converse gmail com)
author superdump
date Tue, 09 Dec 2008 17:08:40 +0000
parents f4ead16781e4
children e1c0cd446955
comparison
equal deleted inserted replaced
8282:f4ead16781e4 8283:ea8e4095d980
782 cur_band_type - 1, index, ff_aac_spectral_sizes[cur_band_type - 1]); 782 cur_band_type - 1, index, ff_aac_spectral_sizes[cur_band_type - 1]);
783 return -1; 783 return -1;
784 } 784 }
785 vq_ptr = &ff_aac_codebook_vectors[cur_band_type - 1][index * dim]; 785 vq_ptr = &ff_aac_codebook_vectors[cur_band_type - 1][index * dim];
786 if (is_cb_unsigned) { 786 if (is_cb_unsigned) {
787 for (j = 0; j < dim; j++) 787 if (vq_ptr[0]) coef[coef_tmp_idx ] = 1 - 2*(int)get_bits1(gb);
788 if (vq_ptr[j]) 788 if (vq_ptr[1]) coef[coef_tmp_idx + 1] = 1 - 2*(int)get_bits1(gb);
789 coef[coef_tmp_idx + j] = 1 - 2*(int)get_bits1(gb); 789 if (dim == 4) {
790 if (vq_ptr[2]) coef[coef_tmp_idx + 2] = 1 - 2*(int)get_bits1(gb);
791 if (vq_ptr[3]) coef[coef_tmp_idx + 3] = 1 - 2*(int)get_bits1(gb);
792 }
790 }else { 793 }else {
791 for (j = 0; j < dim; j++) 794 coef[coef_tmp_idx ] = 1.0f;
792 coef[coef_tmp_idx + j] = 1.0f; 795 coef[coef_tmp_idx + 1] = 1.0f;
796 if (dim == 4) {
797 coef[coef_tmp_idx + 2] = 1.0f;
798 coef[coef_tmp_idx + 3] = 1.0f;
799 }
793 } 800 }
794 if (cur_band_type == ESC_BT) { 801 if (cur_band_type == ESC_BT) {
795 for (j = 0; j < 2; j++) { 802 for (j = 0; j < 2; j++) {
796 if (vq_ptr[j] == 64.0f) { 803 if (vq_ptr[j] == 64.0f) {
797 int n = 4; 804 int n = 4;
806 coef[coef_tmp_idx + j] *= cbrtf(n) * n; 813 coef[coef_tmp_idx + j] *= cbrtf(n) * n;
807 }else 814 }else
808 coef[coef_tmp_idx + j] *= vq_ptr[j]; 815 coef[coef_tmp_idx + j] *= vq_ptr[j];
809 } 816 }
810 }else 817 }else
811 for (j = 0; j < dim; j++) 818 {
812 coef[coef_tmp_idx + j] *= vq_ptr[j]; 819 coef[coef_tmp_idx ] *= vq_ptr[0];
813 for (j = 0; j < dim; j++) 820 coef[coef_tmp_idx + 1] *= vq_ptr[1];
814 coef[coef_tmp_idx + j] *= sf[idx]; 821 if (dim == 4) {
822 coef[coef_tmp_idx + 2] *= vq_ptr[2];
823 coef[coef_tmp_idx + 3] *= vq_ptr[3];
824 }
825 }
826 coef[coef_tmp_idx ] *= sf[idx];
827 coef[coef_tmp_idx + 1] *= sf[idx];
828 if (dim == 4) {
829 coef[coef_tmp_idx + 2] *= sf[idx];
830 coef[coef_tmp_idx + 3] *= sf[idx];
831 }
815 } 832 }
816 } 833 }
817 } 834 }
818 } 835 }
819 coef += ics->group_len[g]<<7; 836 coef += ics->group_len[g]<<7;