| @@ -29,6 +29,10 @@ · 28 unmodified lines |
| 29 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 29 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 30 | */ | 30 | */ |
| 31 | | 31 | |
| | 32 | /* We use several quantization functions here (Q31, Q30), |
| | 33 | * for which we need this to be defined for them to work as expected. */ |
| | 34 | #define USE_FIXED 1 |
| | 35 | |
| 32 | #include <limits.h> | 36 | #include <limits.h> |
| 33 | #include <stddef.h> | 37 | #include <stddef.h> |
| 34 | | 38 | |
| @@ -184,8 +188,8 @@ static int frame_configure_elements(AVCodecContext *avctx) · 149 unmodified lines |
| 184 | for (id = 0; id < MAX_ELEM_ID; id++) { | 188 | for (id = 0; id < MAX_ELEM_ID; id++) { |
| 185 | ChannelElement *che = ac->che[type][id]; | 189 | ChannelElement *che = ac->che[type][id]; |
| 186 | if (che) { | 190 | if (che) { |
| 187 | che->ch[0].AAC_RENAME(output) = che->ch[0].AAC_RENAME(ret_buf); | 191 | che->ch[0].output = che->ch[0].ret_buf; |
| 188 | che->ch[1].AAC_RENAME(output) = che->ch[1].AAC_RENAME(ret_buf); | 192 | che->ch[1].output = che->ch[1].ret_buf; |
| 189 | } | 193 | } |
| 190 | } | 194 | } |
| 191 | } | 195 | } |
| @@ -202,7 +206,7 @@ static int frame_configure_elements(AVCodecContext *avctx) · 10 unmodified lines |
| 202 | /* map output channel pointers to AVFrame data */ | 206 | /* map output channel pointers to AVFrame data */ |
| 203 | for (ch = 0; ch < avctx->ch_layout.nb_channels; ch++) { | 207 | for (ch = 0; ch < avctx->ch_layout.nb_channels; ch++) { |
| 204 | if (ac->output_element[ch]) | 208 | if (ac->output_element[ch]) |
| 205 | ac->output_element[ch]->AAC_RENAME(output) = (INTFLOAT *)ac->frame->extended_data[ch]; | 209 | ac->output_element[ch]->output = (void *)ac->frame->extended_data[ch]; |
| 206 | } | 210 | } |
| 207 | | 211 | |
| 208 | return 0; | 212 | return 0; |
| @@ -1107,9 +1111,6 @@ static int sample_rate_idx (int rate) · 898 unmodified lines |
| 1107 | | 1111 | |
| 1108 | static av_cold void aac_static_table_init(void) | 1112 | static av_cold void aac_static_table_init(void) |
| 1109 | { | 1113 | { |
| 1110 | ff_aac_sbr_init(); | | |
| 1111 | ff_aac_sbr_init_fixed(); | | |
| 1112 | | | |
| 1113 | ff_aacdec_common_init_once(); | 1114 | ff_aacdec_common_init_once(); |
| 1114 | } | 1115 | } |
| 1115 | static AVOnce aac_table_init = AV_ONCE_INIT; | 1116 | static AVOnce aac_table_init = AV_ONCE_INIT; |
| @@ -1118,8 +1119,8 @@ static av_cold int decode_close(AVCodecContext *avctx) · 2 unmodified lines |
| 1118 | { | 1119 | { |
| 1119 | AACDecContext *ac = avctx->priv_data; | 1120 | AACDecContext *ac = avctx->priv_data; |
| 1120 | int is_fixed = ac->is_fixed; | 1121 | int is_fixed = ac->is_fixed; |
| 1121 | void (*sbr_close)(ChannelElement *che) = is_fixed ? RENAME_FIXED(ff_aac_sbr_ctx_close) | 1122 | void (*sbr_close)(ChannelElement *che) = is_fixed ? ff_aac_sbr_ctx_close_fixed : |
| 1122 | : ff_aac_sbr_ctx_close; | 1123 | ff_aac_sbr_ctx_close; |
| 1123 | | 1124 | |
| 1124 | for (int type = 0; type < FF_ARRAY_ELEMS(ac->che); type++) { | 1125 | for (int type = 0; type < FF_ARRAY_ELEMS(ac->che); type++) { |
| 1125 | for (int i = 0; i < MAX_ELEM_ID; i++) { | 1126 | for (int i = 0; i < MAX_ELEM_ID; i++) { |
| @@ -2069,10 +2070,10 @@ static void spectral_to_sample(AACDecContext *ac, int samples) · 943 unmodified lines |
| 2069 | } | 2070 | } |
| 2070 | } | 2071 | } |
| 2071 | if (che->ch[0].tns.present) | 2072 | if (che->ch[0].tns.present) |
| 2072 | ac->dsp.apply_tns(che->ch[0].AAC_RENAME(coeffs), | 2073 | ac->dsp.apply_tns(che->ch[0].coeffs, |
| 2073 | &che->ch[0].tns, &che->ch[0].ics, 1); | 2074 | &che->ch[0].tns, &che->ch[0].ics, 1); |
| 2074 | if (che->ch[1].tns.present) | 2075 | if (che->ch[1].tns.present) |
| 2075 | ac->dsp.apply_tns(che->ch[1].AAC_RENAME(coeffs), | 2076 | ac->dsp.apply_tns(che->ch[1].coeffs, |
| 2076 | &che->ch[1].tns, &che->ch[1].ics, 1); | 2077 | &che->ch[1].tns, &che->ch[1].ics, 1); |
| 2077 | if (type <= TYPE_CPE) | 2078 | if (type <= TYPE_CPE) |
| 2078 | apply_channel_coupling(ac, che, type, i, BETWEEN_TNS_AND_IMDCT, ac->dsp.apply_dependent_coupling); | 2079 | apply_channel_coupling(ac, che, type, i, BETWEEN_TNS_AND_IMDCT, ac->dsp.apply_dependent_coupling); |
| @@ -2088,12 +2089,12 @@ static void spectral_to_sample(AACDecContext *ac, int samples) · 9 unmodified lines |
| 2088 | if (ac->oc[1].m4ac.sbr > 0) { | 2089 | if (ac->oc[1].m4ac.sbr > 0) { |
| 2089 | if (ac->is_fixed) | 2090 | if (ac->is_fixed) |
| 2090 | ff_aac_sbr_apply_fixed(ac, che, type, | 2091 | ff_aac_sbr_apply_fixed(ac, che, type, |
| 2091 | che->ch[0].AAC_RENAME(output), | 2092 | (void *)che->ch[0].output, |
| 2092 | che->ch[1].AAC_RENAME(output)); | 2093 | (void *)che->ch[1].output); |
| 2093 | else | 2094 | else |
| 2094 | ff_aac_sbr_apply(ac, che, type, | 2095 | ff_aac_sbr_apply(ac, che, type, |
| 2095 | che->ch[0].AAC_RENAME(output), | 2096 | (void *)che->ch[0].output, |
| 2096 | che->ch[1].AAC_RENAME(output)); | 2097 | (void *)che->ch[1].output); |
| 2097 | } | 2098 | } |
| 2098 | } | 2099 | } |
| 2099 | if (type <= TYPE_CCE) | 2100 | if (type <= TYPE_CCE) |