[FFmpeg-cvslog] swr-test: add rates tables containing a new set of sample rates.

Michael Niedermayer git at videolan.org
Thu Apr 26 15:51:17 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Apr 26 09:57:02 2012 +0200| [b1519102f119a85decfcdd68815366edc10c7864] | committer: Michael Niedermayer

swr-test: add rates tables containing a new set of sample rates.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b1519102f119a85decfcdd68815366edc10c7864
---

 libswresample/swresample_test.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/libswresample/swresample_test.c b/libswresample/swresample_test.c
index 1742bd7..3bea91f 100644
--- a/libswresample/swresample_test.c
+++ b/libswresample/swresample_test.c
@@ -93,6 +93,15 @@ static const enum AVSampleFormat formats[] = {
     AV_SAMPLE_FMT_DBL,
 };
 
+static const int rates[] = {
+    8000,
+    11025,
+    16000,
+    22050,
+    32000,
+    48000,
+};
+
 uint64_t layouts[]={
     AV_CH_LAYOUT_MONO                    ,
     AV_CH_LAYOUT_STEREO                  ,
@@ -128,7 +137,6 @@ int main(int argc, char **argv){
     int in_sample_rate, out_sample_rate, ch ,i, in_ch_layout_index, out_ch_layout_index, osr, flush_count;
     uint64_t in_ch_layout, out_ch_layout;
     enum AVSampleFormat in_sample_fmt, out_sample_fmt;
-    int sample_rates[]={8000,11025,16000,22050,32000};
     uint8_t array_in[SAMPLES*8*8];
     uint8_t array_mid[SAMPLES*8*8*3];
     uint8_t array_out[SAMPLES*8*8+100];
@@ -142,8 +150,8 @@ int main(int argc, char **argv){
     struct SwrContext *backw_ctx= NULL;
 
     in_sample_rate=16000;
-    for(osr=0; osr<5; osr++){
-        out_sample_rate= sample_rates[osr];
+    for(osr=0; osr<FF_ARRAY_ELEMS(rates); osr++){
+        out_sample_rate= rates[osr];
         for(in_sample_fmt= AV_SAMPLE_FMT_U8; in_sample_fmt<=AV_SAMPLE_FMT_DBL; in_sample_fmt++){
             for(out_sample_fmt= AV_SAMPLE_FMT_U8; out_sample_fmt<=AV_SAMPLE_FMT_DBL; out_sample_fmt++){
                 for(in_ch_layout_index=0; layouts[in_ch_layout_index]; in_ch_layout_index++){



More information about the ffmpeg-cvslog mailing list