Browse code

Scale rdft vissualization up by 2 so theres no unused space on the top but rather the unimportant high frequencies are cut off if the window is not a multiple of 2 high.

Originally committed as revision 21641 to svn://svn.ffmpeg.org/ffmpeg/trunk

Michael Niedermayer authored on 2010/02/05 20:25:58
Showing 1 changed files
... ...
@@ -868,7 +868,7 @@ static void video_audio_display(VideoState *s)
868 868
     }else{
869 869
         int rdft_bits, nb_freq;
870 870
         nb_display_channels= FFMIN(nb_display_channels, 2);
871
-        for(rdft_bits=1; (1<<rdft_bits)<=s->height; rdft_bits++)
871
+        for(rdft_bits=1; (1<<rdft_bits)<2*s->height; rdft_bits++)
872 872
             ;
873 873
         if(rdft_bits != s->rdft_bits){
874 874
             ff_rdft_end(&s->rdft);
... ...
@@ -890,7 +890,7 @@ static void video_audio_display(VideoState *s)
890 890
                 ff_rdft_calc(&s->rdft, data[ch]);
891 891
             }
892 892
             //least efficient way to do this, we should of course directly access it but its more than fast enough
893
-            for(y=0; y<nb_freq; y++){
893
+            for(y=0; y<s->height; y++){
894 894
                 double w= 1/sqrt(nb_freq);
895 895
                 int a= sqrt(w*sqrt(data[0][2*y+0]*data[0][2*y+0] + data[0][2*y+1]*data[0][2*y+1]));
896 896
                 int b= sqrt(w*sqrt(data[1][2*y+0]*data[1][2*y+0] + data[1][2*y+1]*data[1][2*y+1]));