OLD | NEW |
1 /* Copyright (c) 2007-2008 CSIRO | 1 /* Copyright (c) 2007-2008 CSIRO |
2 Copyright (c) 2007-2009 Xiph.Org Foundation | 2 Copyright (c) 2007-2009 Xiph.Org Foundation |
3 Written by Jean-Marc Valin */ | 3 Written by Jean-Marc Valin */ |
4 /* | 4 /* |
5 Redistribution and use in source and binary forms, with or without | 5 Redistribution and use in source and binary forms, with or without |
6 modification, are permitted provided that the following conditions | 6 modification, are permitted provided that the following conditions |
7 are met: | 7 are met: |
8 | 8 |
9 - Redistributions of source code must retain the above copyright | 9 - Redistributions of source code must retain the above copyright |
10 notice, this list of conditions and the following disclaimer. | 10 notice, this list of conditions and the following disclaimer. |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 newsize = rand()%6; | 630 newsize = rand()%6; |
631 switch(newsize) | 631 switch(newsize) |
632 { | 632 { |
633 case 0: newsize=sampling_rate/400; break; | 633 case 0: newsize=sampling_rate/400; break; |
634 case 1: newsize=sampling_rate/200; break; | 634 case 1: newsize=sampling_rate/200; break; |
635 case 2: newsize=sampling_rate/100; break; | 635 case 2: newsize=sampling_rate/100; break; |
636 case 3: newsize=sampling_rate/50; break; | 636 case 3: newsize=sampling_rate/50; break; |
637 case 4: newsize=sampling_rate/25; break; | 637 case 4: newsize=sampling_rate/25; break; |
638 case 5: newsize=3*sampling_rate/50; break; | 638 case 5: newsize=3*sampling_rate/50; break; |
639 } | 639 } |
640 while (newsize < sampling_rate/25 && bitrate_bps-fabs(sweep_bps) <=
3*12*sampling_rate/newsize) | 640 while (newsize < sampling_rate/25 && bitrate_bps-abs(sweep_bps) <= 3
*12*sampling_rate/newsize) |
641 newsize*=2; | 641 newsize*=2; |
642 if (newsize < sampling_rate/100 && frame_size >= sampling_rate/100) | 642 if (newsize < sampling_rate/100 && frame_size >= sampling_rate/100) |
643 { | 643 { |
644 opus_encoder_ctl(enc, OPUS_SET_FORCE_MODE(MODE_CELT_ONLY)); | 644 opus_encoder_ctl(enc, OPUS_SET_FORCE_MODE(MODE_CELT_ONLY)); |
645 delayed_celt=1; | 645 delayed_celt=1; |
646 } else { | 646 } else { |
647 frame_size = newsize; | 647 frame_size = newsize; |
648 } | 648 } |
649 } | 649 } |
650 if (random_fec && rand()%30==0) | 650 if (random_fec && rand()%30==0) |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 free(data[0]); | 876 free(data[0]); |
877 if (use_inbandfec) | 877 if (use_inbandfec) |
878 free(data[1]); | 878 free(data[1]); |
879 fclose(fin); | 879 fclose(fin); |
880 fclose(fout); | 880 fclose(fout); |
881 free(in); | 881 free(in); |
882 free(out); | 882 free(out); |
883 free(fbytes); | 883 free(fbytes); |
884 return EXIT_SUCCESS; | 884 return EXIT_SUCCESS; |
885 } | 885 } |
OLD | NEW |