ARM: libswresample: NEON optimised generic fltp to s16 conversion
[ffmpeg.git] / libswresample / arm / audio_convert_init.c
index a52ea5a..9fdb174 100644 (file)
@@ -28,6 +28,7 @@
 
 void swri_oldapi_conv_flt_to_s16_neon(int16_t *dst, const float *src, int len);
 void swri_oldapi_conv_fltp_to_s16_2ch_neon(int16_t *dst, float *const *src, int len, int channels);
+void swri_oldapi_conv_fltp_to_s16_nch_neon(int16_t *dst, float *const *src, int len, int channels);
 
 static void conv_flt_to_s16_neon(uint8_t **dst, const uint8_t **src, int len){
     swri_oldapi_conv_flt_to_s16_neon((int16_t*)*dst, (const float*)*src, len);
@@ -37,6 +38,12 @@ static void conv_fltp_to_s16_2ch_neon(uint8_t **dst, const uint8_t **src, int le
     swri_oldapi_conv_fltp_to_s16_2ch_neon((int16_t*)*dst, (float *const*)src, len, 2);
 }
 
+static void conv_fltp_to_s16_nch_neon(uint8_t **dst, const uint8_t **src, int len){
+    int channels;
+    for(channels=3; channels<SWR_CH_MAX && src[channels]; channels++)
+        ;
+    swri_oldapi_conv_fltp_to_s16_nch_neon((int16_t*)*dst, (float *const*)src, len, channels);
+}
 
 av_cold void swri_audio_convert_init_arm(struct AudioConvert *ac,
                                        enum AVSampleFormat out_fmt,
@@ -52,5 +59,7 @@ av_cold void swri_audio_convert_init_arm(struct AudioConvert *ac,
             ac->simd_f = conv_flt_to_s16_neon;
         if(out_fmt == AV_SAMPLE_FMT_S16 && in_fmt == AV_SAMPLE_FMT_FLTP && channels == 2)
             ac->simd_f = conv_fltp_to_s16_2ch_neon;
+        if(out_fmt == AV_SAMPLE_FMT_S16 && in_fmt == AV_SAMPLE_FMT_FLTP && channels >  2)
+            ac->simd_f = conv_fltp_to_s16_nch_neon;
     }
 }