diff --git a/webrtc/common_audio/signal_processing/webrtc_fft_t_1024_8.c b/webrtc/common_audio/signal_processing/webrtc_fft_t_1024_8.c deleted file mode 100644 index b58738052..000000000 --- a/webrtc/common_audio/signal_processing/webrtc_fft_t_1024_8.c +++ /dev/null @@ -1,704 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/* - * This file contains the Q14 radix-8 tables used in ARM9e optimizations. - * - */ - -extern const int s_Q14S_8; -const int s_Q14S_8 = 1024; -extern const unsigned short t_Q14S_8[2032]; -const unsigned short t_Q14S_8[2032] = { - 0x4000,0x0000 ,0x4000,0x0000 ,0x4000,0x0000 , - 0x22a3,0x187e ,0x3249,0x0c7c ,0x11a8,0x238e , - 0x0000,0x2d41 ,0x22a3,0x187e ,0xdd5d,0x3b21 , - 0xdd5d,0x3b21 ,0x11a8,0x238e ,0xb4be,0x3ec5 , - 0xc000,0x4000 ,0x0000,0x2d41 ,0xa57e,0x2d41 , - 0xac61,0x3b21 ,0xee58,0x3537 ,0xb4be,0x0c7c , - 0xa57e,0x2d41 ,0xdd5d,0x3b21 ,0xdd5d,0xe782 , - 0xac61,0x187e ,0xcdb7,0x3ec5 ,0x11a8,0xcac9 , - 0x4000,0x0000 ,0x4000,0x0000 ,0x4000,0x0000 , - 0x396b,0x0646 ,0x3cc8,0x0324 ,0x35eb,0x0964 , - 0x3249,0x0c7c ,0x396b,0x0646 ,0x2aaa,0x1294 , - 0x2aaa,0x1294 ,0x35eb,0x0964 ,0x1e7e,0x1b5d , - 0x22a3,0x187e ,0x3249,0x0c7c ,0x11a8,0x238e , - 0x1a46,0x1e2b ,0x2e88,0x0f8d ,0x0471,0x2afb , - 0x11a8,0x238e ,0x2aaa,0x1294 ,0xf721,0x3179 , - 0x08df,0x289a ,0x26b3,0x1590 ,0xea02,0x36e5 , - 0x0000,0x2d41 ,0x22a3,0x187e ,0xdd5d,0x3b21 , - 0xf721,0x3179 ,0x1e7e,0x1b5d ,0xd178,0x3e15 , - 0xee58,0x3537 ,0x1a46,0x1e2b ,0xc695,0x3fb1 , - 0xe5ba,0x3871 ,0x15fe,0x20e7 ,0xbcf0,0x3fec , - 0xdd5d,0x3b21 ,0x11a8,0x238e ,0xb4be,0x3ec5 , - 0xd556,0x3d3f ,0x0d48,0x2620 ,0xae2e,0x3c42 , - 0xcdb7,0x3ec5 ,0x08df,0x289a ,0xa963,0x3871 , - 0xc695,0x3fb1 ,0x0471,0x2afb ,0xa678,0x3368 , - 0xc000,0x4000 ,0x0000,0x2d41 ,0xa57e,0x2d41 , - 0xba09,0x3fb1 ,0xfb8f,0x2f6c ,0xa678,0x2620 , - 0xb4be,0x3ec5 ,0xf721,0x3179 ,0xa963,0x1e2b , - 0xb02d,0x3d3f ,0xf2b8,0x3368 ,0xae2e,0x1590 , - 0xac61,0x3b21 ,0xee58,0x3537 ,0xb4be,0x0c7c , - 0xa963,0x3871 ,0xea02,0x36e5 ,0xbcf0,0x0324 , - 0xa73b,0x3537 ,0xe5ba,0x3871 ,0xc695,0xf9ba , - 0xa5ed,0x3179 ,0xe182,0x39db ,0xd178,0xf073 , - 0xa57e,0x2d41 ,0xdd5d,0x3b21 ,0xdd5d,0xe782 , - 0xa5ed,0x289a ,0xd94d,0x3c42 ,0xea02,0xdf19 , - 0xa73b,0x238e ,0xd556,0x3d3f ,0xf721,0xd766 , - 0xa963,0x1e2b ,0xd178,0x3e15 ,0x0471,0xd094 , - 0xac61,0x187e ,0xcdb7,0x3ec5 ,0x11a8,0xcac9 , - 0xb02d,0x1294 ,0xca15,0x3f4f ,0x1e7e,0xc625 , - 0xb4be,0x0c7c ,0xc695,0x3fb1 ,0x2aaa,0xc2c1 , - 0xba09,0x0646 ,0xc338,0x3fec ,0x35eb,0xc0b1 , - 0x4000,0x0000 ,0x4000,0x0000 ,0x4000,0x0000 , - 0x3e69,0x0192 ,0x3f36,0x00c9 ,0x3d9a,0x025b , - 0x3cc8,0x0324 ,0x3e69,0x0192 ,0x3b1e,0x04b5 , - 0x3b1e,0x04b5 ,0x3d9a,0x025b ,0x388e,0x070e , - 0x396b,0x0646 ,0x3cc8,0x0324 ,0x35eb,0x0964 , - 0x37af,0x07d6 ,0x3bf4,0x03ed ,0x3334,0x0bb7 , - 0x35eb,0x0964 ,0x3b1e,0x04b5 ,0x306c,0x0e06 , - 0x341e,0x0af1 ,0x3a46,0x057e ,0x2d93,0x1050 , - 0x3249,0x0c7c ,0x396b,0x0646 ,0x2aaa,0x1294 , - 0x306c,0x0e06 ,0x388e,0x070e ,0x27b3,0x14d2 , - 0x2e88,0x0f8d ,0x37af,0x07d6 ,0x24ae,0x1709 , - 0x2c9d,0x1112 ,0x36ce,0x089d ,0x219c,0x1937 , - 0x2aaa,0x1294 ,0x35eb,0x0964 ,0x1e7e,0x1b5d , - 0x28b2,0x1413 ,0x3505,0x0a2b ,0x1b56,0x1d79 , - 0x26b3,0x1590 ,0x341e,0x0af1 ,0x1824,0x1f8c , - 0x24ae,0x1709 ,0x3334,0x0bb7 ,0x14ea,0x2193 , - 0x22a3,0x187e ,0x3249,0x0c7c ,0x11a8,0x238e , - 0x2093,0x19ef ,0x315b,0x0d41 ,0x0e61,0x257e , - 0x1e7e,0x1b5d ,0x306c,0x0e06 ,0x0b14,0x2760 , - 0x1c64,0x1cc6 ,0x2f7b,0x0eca ,0x07c4,0x2935 , - 0x1a46,0x1e2b ,0x2e88,0x0f8d ,0x0471,0x2afb , - 0x1824,0x1f8c ,0x2d93,0x1050 ,0x011c,0x2cb2 , - 0x15fe,0x20e7 ,0x2c9d,0x1112 ,0xfdc7,0x2e5a , - 0x13d5,0x223d ,0x2ba4,0x11d3 ,0xfa73,0x2ff2 , - 0x11a8,0x238e ,0x2aaa,0x1294 ,0xf721,0x3179 , - 0x0f79,0x24da ,0x29af,0x1354 ,0xf3d2,0x32ef , - 0x0d48,0x2620 ,0x28b2,0x1413 ,0xf087,0x3453 , - 0x0b14,0x2760 ,0x27b3,0x14d2 ,0xed41,0x35a5 , - 0x08df,0x289a ,0x26b3,0x1590 ,0xea02,0x36e5 , - 0x06a9,0x29ce ,0x25b1,0x164c ,0xe6cb,0x3812 , - 0x0471,0x2afb ,0x24ae,0x1709 ,0xe39c,0x392b , - 0x0239,0x2c21 ,0x23a9,0x17c4 ,0xe077,0x3a30 , - 0x0000,0x2d41 ,0x22a3,0x187e ,0xdd5d,0x3b21 , - 0xfdc7,0x2e5a ,0x219c,0x1937 ,0xda4f,0x3bfd , - 0xfb8f,0x2f6c ,0x2093,0x19ef ,0xd74e,0x3cc5 , - 0xf957,0x3076 ,0x1f89,0x1aa7 ,0xd45c,0x3d78 , - 0xf721,0x3179 ,0x1e7e,0x1b5d ,0xd178,0x3e15 , - 0xf4ec,0x3274 ,0x1d72,0x1c12 ,0xcea5,0x3e9d , - 0xf2b8,0x3368 ,0x1c64,0x1cc6 ,0xcbe2,0x3f0f , - 0xf087,0x3453 ,0x1b56,0x1d79 ,0xc932,0x3f6b , - 0xee58,0x3537 ,0x1a46,0x1e2b ,0xc695,0x3fb1 , - 0xec2b,0x3612 ,0x1935,0x1edc ,0xc40c,0x3fe1 , - 0xea02,0x36e5 ,0x1824,0x1f8c ,0xc197,0x3ffb , - 0xe7dc,0x37b0 ,0x1711,0x203a ,0xbf38,0x3fff , - 0xe5ba,0x3871 ,0x15fe,0x20e7 ,0xbcf0,0x3fec , - 0xe39c,0x392b ,0x14ea,0x2193 ,0xbabf,0x3fc4 , - 0xe182,0x39db ,0x13d5,0x223d ,0xb8a6,0x3f85 , - 0xdf6d,0x3a82 ,0x12bf,0x22e7 ,0xb6a5,0x3f30 , - 0xdd5d,0x3b21 ,0x11a8,0x238e ,0xb4be,0x3ec5 , - 0xdb52,0x3bb6 ,0x1091,0x2435 ,0xb2f2,0x3e45 , - 0xd94d,0x3c42 ,0x0f79,0x24da ,0xb140,0x3daf , - 0xd74e,0x3cc5 ,0x0e61,0x257e ,0xafa9,0x3d03 , - 0xd556,0x3d3f ,0x0d48,0x2620 ,0xae2e,0x3c42 , - 0xd363,0x3daf ,0x0c2e,0x26c1 ,0xacd0,0x3b6d , - 0xd178,0x3e15 ,0x0b14,0x2760 ,0xab8e,0x3a82 , - 0xcf94,0x3e72 ,0x09fa,0x27fe ,0xaa6a,0x3984 , - 0xcdb7,0x3ec5 ,0x08df,0x289a ,0xa963,0x3871 , - 0xcbe2,0x3f0f ,0x07c4,0x2935 ,0xa87b,0x374b , - 0xca15,0x3f4f ,0x06a9,0x29ce ,0xa7b1,0x3612 , - 0xc851,0x3f85 ,0x058d,0x2a65 ,0xa705,0x34c6 , - 0xc695,0x3fb1 ,0x0471,0x2afb ,0xa678,0x3368 , - 0xc4e2,0x3fd4 ,0x0355,0x2b8f ,0xa60b,0x31f8 , - 0xc338,0x3fec ,0x0239,0x2c21 ,0xa5bc,0x3076 , - 0xc197,0x3ffb ,0x011c,0x2cb2 ,0xa58d,0x2ee4 , - 0xc000,0x4000 ,0x0000,0x2d41 ,0xa57e,0x2d41 , - 0xbe73,0x3ffb ,0xfee4,0x2dcf ,0xa58d,0x2b8f , - 0xbcf0,0x3fec ,0xfdc7,0x2e5a ,0xa5bc,0x29ce , - 0xbb77,0x3fd4 ,0xfcab,0x2ee4 ,0xa60b,0x27fe , - 0xba09,0x3fb1 ,0xfb8f,0x2f6c ,0xa678,0x2620 , - 0xb8a6,0x3f85 ,0xfa73,0x2ff2 ,0xa705,0x2435 , - 0xb74d,0x3f4f ,0xf957,0x3076 ,0xa7b1,0x223d , - 0xb600,0x3f0f ,0xf83c,0x30f9 ,0xa87b,0x203a , - 0xb4be,0x3ec5 ,0xf721,0x3179 ,0xa963,0x1e2b , - 0xb388,0x3e72 ,0xf606,0x31f8 ,0xaa6a,0x1c12 , - 0xb25e,0x3e15 ,0xf4ec,0x3274 ,0xab8e,0x19ef , - 0xb140,0x3daf ,0xf3d2,0x32ef ,0xacd0,0x17c4 , - 0xb02d,0x3d3f ,0xf2b8,0x3368 ,0xae2e,0x1590 , - 0xaf28,0x3cc5 ,0xf19f,0x33df ,0xafa9,0x1354 , - 0xae2e,0x3c42 ,0xf087,0x3453 ,0xb140,0x1112 , - 0xad41,0x3bb6 ,0xef6f,0x34c6 ,0xb2f2,0x0eca , - 0xac61,0x3b21 ,0xee58,0x3537 ,0xb4be,0x0c7c , - 0xab8e,0x3a82 ,0xed41,0x35a5 ,0xb6a5,0x0a2b , - 0xaac8,0x39db ,0xec2b,0x3612 ,0xb8a6,0x07d6 , - 0xaa0f,0x392b ,0xeb16,0x367d ,0xbabf,0x057e , - 0xa963,0x3871 ,0xea02,0x36e5 ,0xbcf0,0x0324 , - 0xa8c5,0x37b0 ,0xe8ef,0x374b ,0xbf38,0x00c9 , - 0xa834,0x36e5 ,0xe7dc,0x37b0 ,0xc197,0xfe6e , - 0xa7b1,0x3612 ,0xe6cb,0x3812 ,0xc40c,0xfc13 , - 0xa73b,0x3537 ,0xe5ba,0x3871 ,0xc695,0xf9ba , - 0xa6d3,0x3453 ,0xe4aa,0x38cf ,0xc932,0xf763 , - 0xa678,0x3368 ,0xe39c,0x392b ,0xcbe2,0xf50f , - 0xa62c,0x3274 ,0xe28e,0x3984 ,0xcea5,0xf2bf , - 0xa5ed,0x3179 ,0xe182,0x39db ,0xd178,0xf073 , - 0xa5bc,0x3076 ,0xe077,0x3a30 ,0xd45c,0xee2d , - 0xa599,0x2f6c ,0xdf6d,0x3a82 ,0xd74e,0xebed , - 0xa585,0x2e5a ,0xde64,0x3ad3 ,0xda4f,0xe9b4 , - 0xa57e,0x2d41 ,0xdd5d,0x3b21 ,0xdd5d,0xe782 , - 0xa585,0x2c21 ,0xdc57,0x3b6d ,0xe077,0xe559 , - 0xa599,0x2afb ,0xdb52,0x3bb6 ,0xe39c,0xe33a , - 0xa5bc,0x29ce ,0xda4f,0x3bfd ,0xe6cb,0xe124 , - 0xa5ed,0x289a ,0xd94d,0x3c42 ,0xea02,0xdf19 , - 0xa62c,0x2760 ,0xd84d,0x3c85 ,0xed41,0xdd19 , - 0xa678,0x2620 ,0xd74e,0x3cc5 ,0xf087,0xdb26 , - 0xa6d3,0x24da ,0xd651,0x3d03 ,0xf3d2,0xd93f , - 0xa73b,0x238e ,0xd556,0x3d3f ,0xf721,0xd766 , - 0xa7b1,0x223d ,0xd45c,0x3d78 ,0xfa73,0xd59b , - 0xa834,0x20e7 ,0xd363,0x3daf ,0xfdc7,0xd3df , - 0xa8c5,0x1f8c ,0xd26d,0x3de3 ,0x011c,0xd231 , - 0xa963,0x1e2b ,0xd178,0x3e15 ,0x0471,0xd094 , - 0xaa0f,0x1cc6 ,0xd085,0x3e45 ,0x07c4,0xcf07 , - 0xaac8,0x1b5d ,0xcf94,0x3e72 ,0x0b14,0xcd8c , - 0xab8e,0x19ef ,0xcea5,0x3e9d ,0x0e61,0xcc21 , - 0xac61,0x187e ,0xcdb7,0x3ec5 ,0x11a8,0xcac9 , - 0xad41,0x1709 ,0xcccc,0x3eeb ,0x14ea,0xc983 , - 0xae2e,0x1590 ,0xcbe2,0x3f0f ,0x1824,0xc850 , - 0xaf28,0x1413 ,0xcafb,0x3f30 ,0x1b56,0xc731 , - 0xb02d,0x1294 ,0xca15,0x3f4f ,0x1e7e,0xc625 , - 0xb140,0x1112 ,0xc932,0x3f6b ,0x219c,0xc52d , - 0xb25e,0x0f8d ,0xc851,0x3f85 ,0x24ae,0xc44a , - 0xb388,0x0e06 ,0xc772,0x3f9c ,0x27b3,0xc37b , - 0xb4be,0x0c7c ,0xc695,0x3fb1 ,0x2aaa,0xc2c1 , - 0xb600,0x0af1 ,0xc5ba,0x3fc4 ,0x2d93,0xc21d , - 0xb74d,0x0964 ,0xc4e2,0x3fd4 ,0x306c,0xc18e , - 0xb8a6,0x07d6 ,0xc40c,0x3fe1 ,0x3334,0xc115 , - 0xba09,0x0646 ,0xc338,0x3fec ,0x35eb,0xc0b1 , - 0xbb77,0x04b5 ,0xc266,0x3ff5 ,0x388e,0xc064 , - 0xbcf0,0x0324 ,0xc197,0x3ffb ,0x3b1e,0xc02c , - 0xbe73,0x0192 ,0xc0ca,0x3fff ,0x3d9a,0xc00b , - 0x4000,0x0000 ,0x3f9b,0x0065 ,0x3f36,0x00c9 , - 0x3ed0,0x012e ,0x3e69,0x0192 ,0x3e02,0x01f7 , - 0x3d9a,0x025b ,0x3d31,0x02c0 ,0x3cc8,0x0324 , - 0x3c5f,0x0388 ,0x3bf4,0x03ed ,0x3b8a,0x0451 , - 0x3b1e,0x04b5 ,0x3ab2,0x051a ,0x3a46,0x057e , - 0x39d9,0x05e2 ,0x396b,0x0646 ,0x38fd,0x06aa , - 0x388e,0x070e ,0x381f,0x0772 ,0x37af,0x07d6 , - 0x373f,0x0839 ,0x36ce,0x089d ,0x365d,0x0901 , - 0x35eb,0x0964 ,0x3578,0x09c7 ,0x3505,0x0a2b , - 0x3492,0x0a8e ,0x341e,0x0af1 ,0x33a9,0x0b54 , - 0x3334,0x0bb7 ,0x32bf,0x0c1a ,0x3249,0x0c7c , - 0x31d2,0x0cdf ,0x315b,0x0d41 ,0x30e4,0x0da4 , - 0x306c,0x0e06 ,0x2ff4,0x0e68 ,0x2f7b,0x0eca , - 0x2f02,0x0f2b ,0x2e88,0x0f8d ,0x2e0e,0x0fee , - 0x2d93,0x1050 ,0x2d18,0x10b1 ,0x2c9d,0x1112 , - 0x2c21,0x1173 ,0x2ba4,0x11d3 ,0x2b28,0x1234 , - 0x2aaa,0x1294 ,0x2a2d,0x12f4 ,0x29af,0x1354 , - 0x2931,0x13b4 ,0x28b2,0x1413 ,0x2833,0x1473 , - 0x27b3,0x14d2 ,0x2733,0x1531 ,0x26b3,0x1590 , - 0x2632,0x15ee ,0x25b1,0x164c ,0x252f,0x16ab , - 0x24ae,0x1709 ,0x242b,0x1766 ,0x23a9,0x17c4 , - 0x2326,0x1821 ,0x22a3,0x187e ,0x221f,0x18db , - 0x219c,0x1937 ,0x2117,0x1993 ,0x2093,0x19ef , - 0x200e,0x1a4b ,0x1f89,0x1aa7 ,0x1f04,0x1b02 , - 0x1e7e,0x1b5d ,0x1df8,0x1bb8 ,0x1d72,0x1c12 , - 0x1ceb,0x1c6c ,0x1c64,0x1cc6 ,0x1bdd,0x1d20 , - 0x1b56,0x1d79 ,0x1ace,0x1dd3 ,0x1a46,0x1e2b , - 0x19be,0x1e84 ,0x1935,0x1edc ,0x18ad,0x1f34 , - 0x1824,0x1f8c ,0x179b,0x1fe3 ,0x1711,0x203a , - 0x1688,0x2091 ,0x15fe,0x20e7 ,0x1574,0x213d , - 0x14ea,0x2193 ,0x145f,0x21e8 ,0x13d5,0x223d , - 0x134a,0x2292 ,0x12bf,0x22e7 ,0x1234,0x233b , - 0x11a8,0x238e ,0x111d,0x23e2 ,0x1091,0x2435 , - 0x1005,0x2488 ,0x0f79,0x24da ,0x0eed,0x252c , - 0x0e61,0x257e ,0x0dd4,0x25cf ,0x0d48,0x2620 , - 0x0cbb,0x2671 ,0x0c2e,0x26c1 ,0x0ba1,0x2711 , - 0x0b14,0x2760 ,0x0a87,0x27af ,0x09fa,0x27fe , - 0x096d,0x284c ,0x08df,0x289a ,0x0852,0x28e7 , - 0x07c4,0x2935 ,0x0736,0x2981 ,0x06a9,0x29ce , - 0x061b,0x2a1a ,0x058d,0x2a65 ,0x04ff,0x2ab0 , - 0x0471,0x2afb ,0x03e3,0x2b45 ,0x0355,0x2b8f , - 0x02c7,0x2bd8 ,0x0239,0x2c21 ,0x01aa,0x2c6a , - 0x011c,0x2cb2 ,0x008e,0x2cfa ,0x0000,0x2d41 , - 0xff72,0x2d88 ,0xfee4,0x2dcf ,0xfe56,0x2e15 , - 0xfdc7,0x2e5a ,0xfd39,0x2e9f ,0xfcab,0x2ee4 , - 0xfc1d,0x2f28 ,0xfb8f,0x2f6c ,0xfb01,0x2faf , - 0xfa73,0x2ff2 ,0xf9e5,0x3034 ,0xf957,0x3076 , - 0xf8ca,0x30b8 ,0xf83c,0x30f9 ,0xf7ae,0x3139 , - 0xf721,0x3179 ,0xf693,0x31b9 ,0xf606,0x31f8 , - 0xf579,0x3236 ,0xf4ec,0x3274 ,0xf45f,0x32b2 , - 0xf3d2,0x32ef ,0xf345,0x332c ,0xf2b8,0x3368 , - 0xf22c,0x33a3 ,0xf19f,0x33df ,0xf113,0x3419 , - 0xf087,0x3453 ,0xeffb,0x348d ,0xef6f,0x34c6 , - 0xeee3,0x34ff ,0xee58,0x3537 ,0xedcc,0x356e , - 0xed41,0x35a5 ,0xecb6,0x35dc ,0xec2b,0x3612 , - 0xeba1,0x3648 ,0xeb16,0x367d ,0xea8c,0x36b1 , - 0xea02,0x36e5 ,0xe978,0x3718 ,0xe8ef,0x374b , - 0xe865,0x377e ,0xe7dc,0x37b0 ,0xe753,0x37e1 , - 0xe6cb,0x3812 ,0xe642,0x3842 ,0xe5ba,0x3871 , - 0xe532,0x38a1 ,0xe4aa,0x38cf ,0xe423,0x38fd , - 0xe39c,0x392b ,0xe315,0x3958 ,0xe28e,0x3984 , - 0xe208,0x39b0 ,0xe182,0x39db ,0xe0fc,0x3a06 , - 0xe077,0x3a30 ,0xdff2,0x3a59 ,0xdf6d,0x3a82 , - 0xdee9,0x3aab ,0xde64,0x3ad3 ,0xdde1,0x3afa , - 0xdd5d,0x3b21 ,0xdcda,0x3b47 ,0xdc57,0x3b6d , - 0xdbd5,0x3b92 ,0xdb52,0x3bb6 ,0xdad1,0x3bda , - 0xda4f,0x3bfd ,0xd9ce,0x3c20 ,0xd94d,0x3c42 , - 0xd8cd,0x3c64 ,0xd84d,0x3c85 ,0xd7cd,0x3ca5 , - 0xd74e,0x3cc5 ,0xd6cf,0x3ce4 ,0xd651,0x3d03 , - 0xd5d3,0x3d21 ,0xd556,0x3d3f ,0xd4d8,0x3d5b , - 0xd45c,0x3d78 ,0xd3df,0x3d93 ,0xd363,0x3daf , - 0xd2e8,0x3dc9 ,0xd26d,0x3de3 ,0xd1f2,0x3dfc , - 0xd178,0x3e15 ,0xd0fe,0x3e2d ,0xd085,0x3e45 , - 0xd00c,0x3e5c ,0xcf94,0x3e72 ,0xcf1c,0x3e88 , - 0xcea5,0x3e9d ,0xce2e,0x3eb1 ,0xcdb7,0x3ec5 , - 0xcd41,0x3ed8 ,0xcccc,0x3eeb ,0xcc57,0x3efd , - 0xcbe2,0x3f0f ,0xcb6e,0x3f20 ,0xcafb,0x3f30 , - 0xca88,0x3f40 ,0xca15,0x3f4f ,0xc9a3,0x3f5d , - 0xc932,0x3f6b ,0xc8c1,0x3f78 ,0xc851,0x3f85 , - 0xc7e1,0x3f91 ,0xc772,0x3f9c ,0xc703,0x3fa7 , - 0xc695,0x3fb1 ,0xc627,0x3fbb ,0xc5ba,0x3fc4 , - 0xc54e,0x3fcc ,0xc4e2,0x3fd4 ,0xc476,0x3fdb , - 0xc40c,0x3fe1 ,0xc3a1,0x3fe7 ,0xc338,0x3fec , - 0xc2cf,0x3ff1 ,0xc266,0x3ff5 ,0xc1fe,0x3ff8 , - 0xc197,0x3ffb ,0xc130,0x3ffd ,0xc0ca,0x3fff , - 0xc065,0x4000 ,0xc000,0x4000 ,0xbf9c,0x4000 , - 0xbf38,0x3fff ,0xbed5,0x3ffd ,0xbe73,0x3ffb , - 0xbe11,0x3ff8 ,0xbdb0,0x3ff5 ,0xbd50,0x3ff1 , - 0xbcf0,0x3fec ,0xbc91,0x3fe7 ,0xbc32,0x3fe1 , - 0xbbd4,0x3fdb ,0xbb77,0x3fd4 ,0xbb1b,0x3fcc , - 0xbabf,0x3fc4 ,0xba64,0x3fbb ,0xba09,0x3fb1 , - 0xb9af,0x3fa7 ,0xb956,0x3f9c ,0xb8fd,0x3f91 , - 0xb8a6,0x3f85 ,0xb84f,0x3f78 ,0xb7f8,0x3f6b , - 0xb7a2,0x3f5d ,0xb74d,0x3f4f ,0xb6f9,0x3f40 , - 0xb6a5,0x3f30 ,0xb652,0x3f20 ,0xb600,0x3f0f , - 0xb5af,0x3efd ,0xb55e,0x3eeb ,0xb50e,0x3ed8 , - 0xb4be,0x3ec5 ,0xb470,0x3eb1 ,0xb422,0x3e9d , - 0xb3d5,0x3e88 ,0xb388,0x3e72 ,0xb33d,0x3e5c , - 0xb2f2,0x3e45 ,0xb2a7,0x3e2d ,0xb25e,0x3e15 , - 0xb215,0x3dfc ,0xb1cd,0x3de3 ,0xb186,0x3dc9 , - 0xb140,0x3daf ,0xb0fa,0x3d93 ,0xb0b5,0x3d78 , - 0xb071,0x3d5b ,0xb02d,0x3d3f ,0xafeb,0x3d21 , - 0xafa9,0x3d03 ,0xaf68,0x3ce4 ,0xaf28,0x3cc5 , - 0xaee8,0x3ca5 ,0xaea9,0x3c85 ,0xae6b,0x3c64 , - 0xae2e,0x3c42 ,0xadf2,0x3c20 ,0xadb6,0x3bfd , - 0xad7b,0x3bda ,0xad41,0x3bb6 ,0xad08,0x3b92 , - 0xacd0,0x3b6d ,0xac98,0x3b47 ,0xac61,0x3b21 , - 0xac2b,0x3afa ,0xabf6,0x3ad3 ,0xabc2,0x3aab , - 0xab8e,0x3a82 ,0xab5b,0x3a59 ,0xab29,0x3a30 , - 0xaaf8,0x3a06 ,0xaac8,0x39db ,0xaa98,0x39b0 , - 0xaa6a,0x3984 ,0xaa3c,0x3958 ,0xaa0f,0x392b , - 0xa9e3,0x38fd ,0xa9b7,0x38cf ,0xa98d,0x38a1 , - 0xa963,0x3871 ,0xa93a,0x3842 ,0xa912,0x3812 , - 0xa8eb,0x37e1 ,0xa8c5,0x37b0 ,0xa89f,0x377e , - 0xa87b,0x374b ,0xa857,0x3718 ,0xa834,0x36e5 , - 0xa812,0x36b1 ,0xa7f1,0x367d ,0xa7d0,0x3648 , - 0xa7b1,0x3612 ,0xa792,0x35dc ,0xa774,0x35a5 , - 0xa757,0x356e ,0xa73b,0x3537 ,0xa71f,0x34ff , - 0xa705,0x34c6 ,0xa6eb,0x348d ,0xa6d3,0x3453 , - 0xa6bb,0x3419 ,0xa6a4,0x33df ,0xa68e,0x33a3 , - 0xa678,0x3368 ,0xa664,0x332c ,0xa650,0x32ef , - 0xa63e,0x32b2 ,0xa62c,0x3274 ,0xa61b,0x3236 , - 0xa60b,0x31f8 ,0xa5fb,0x31b9 ,0xa5ed,0x3179 , - 0xa5e0,0x3139 ,0xa5d3,0x30f9 ,0xa5c7,0x30b8 , - 0xa5bc,0x3076 ,0xa5b2,0x3034 ,0xa5a9,0x2ff2 , - 0xa5a1,0x2faf ,0xa599,0x2f6c ,0xa593,0x2f28 , - 0xa58d,0x2ee4 ,0xa588,0x2e9f ,0xa585,0x2e5a , - 0xa581,0x2e15 ,0xa57f,0x2dcf ,0xa57e,0x2d88 , - 0xa57e,0x2d41 ,0xa57e,0x2cfa ,0xa57f,0x2cb2 , - 0xa581,0x2c6a ,0xa585,0x2c21 ,0xa588,0x2bd8 , - 0xa58d,0x2b8f ,0xa593,0x2b45 ,0xa599,0x2afb , - 0xa5a1,0x2ab0 ,0xa5a9,0x2a65 ,0xa5b2,0x2a1a , - 0xa5bc,0x29ce ,0xa5c7,0x2981 ,0xa5d3,0x2935 , - 0xa5e0,0x28e7 ,0xa5ed,0x289a ,0xa5fb,0x284c , - 0xa60b,0x27fe ,0xa61b,0x27af ,0xa62c,0x2760 , - 0xa63e,0x2711 ,0xa650,0x26c1 ,0xa664,0x2671 , - 0xa678,0x2620 ,0xa68e,0x25cf ,0xa6a4,0x257e , - 0xa6bb,0x252c ,0xa6d3,0x24da ,0xa6eb,0x2488 , - 0xa705,0x2435 ,0xa71f,0x23e2 ,0xa73b,0x238e , - 0xa757,0x233b ,0xa774,0x22e7 ,0xa792,0x2292 , - 0xa7b1,0x223d ,0xa7d0,0x21e8 ,0xa7f1,0x2193 , - 0xa812,0x213d ,0xa834,0x20e7 ,0xa857,0x2091 , - 0xa87b,0x203a ,0xa89f,0x1fe3 ,0xa8c5,0x1f8c , - 0xa8eb,0x1f34 ,0xa912,0x1edc ,0xa93a,0x1e84 , - 0xa963,0x1e2b ,0xa98d,0x1dd3 ,0xa9b7,0x1d79 , - 0xa9e3,0x1d20 ,0xaa0f,0x1cc6 ,0xaa3c,0x1c6c , - 0xaa6a,0x1c12 ,0xaa98,0x1bb8 ,0xaac8,0x1b5d , - 0xaaf8,0x1b02 ,0xab29,0x1aa7 ,0xab5b,0x1a4b , - 0xab8e,0x19ef ,0xabc2,0x1993 ,0xabf6,0x1937 , - 0xac2b,0x18db ,0xac61,0x187e ,0xac98,0x1821 , - 0xacd0,0x17c4 ,0xad08,0x1766 ,0xad41,0x1709 , - 0xad7b,0x16ab ,0xadb6,0x164c ,0xadf2,0x15ee , - 0xae2e,0x1590 ,0xae6b,0x1531 ,0xaea9,0x14d2 , - 0xaee8,0x1473 ,0xaf28,0x1413 ,0xaf68,0x13b4 , - 0xafa9,0x1354 ,0xafeb,0x12f4 ,0xb02d,0x1294 , - 0xb071,0x1234 ,0xb0b5,0x11d3 ,0xb0fa,0x1173 , - 0xb140,0x1112 ,0xb186,0x10b1 ,0xb1cd,0x1050 , - 0xb215,0x0fee ,0xb25e,0x0f8d ,0xb2a7,0x0f2b , - 0xb2f2,0x0eca ,0xb33d,0x0e68 ,0xb388,0x0e06 , - 0xb3d5,0x0da4 ,0xb422,0x0d41 ,0xb470,0x0cdf , - 0xb4be,0x0c7c ,0xb50e,0x0c1a ,0xb55e,0x0bb7 , - 0xb5af,0x0b54 ,0xb600,0x0af1 ,0xb652,0x0a8e , - 0xb6a5,0x0a2b ,0xb6f9,0x09c7 ,0xb74d,0x0964 , - 0xb7a2,0x0901 ,0xb7f8,0x089d ,0xb84f,0x0839 , - 0xb8a6,0x07d6 ,0xb8fd,0x0772 ,0xb956,0x070e , - 0xb9af,0x06aa ,0xba09,0x0646 ,0xba64,0x05e2 , - 0xbabf,0x057e ,0xbb1b,0x051a ,0xbb77,0x04b5 , - 0xbbd4,0x0451 ,0xbc32,0x03ed ,0xbc91,0x0388 , - 0xbcf0,0x0324 ,0xbd50,0x02c0 ,0xbdb0,0x025b , - 0xbe11,0x01f7 ,0xbe73,0x0192 ,0xbed5,0x012e , - 0xbf38,0x00c9 ,0xbf9c,0x0065 }; - - -extern const int s_Q14R_8; -const int s_Q14R_8 = 1024; -extern const unsigned short t_Q14R_8[2032]; -const unsigned short t_Q14R_8[2032] = { - 0x4000,0x0000 ,0x4000,0x0000 ,0x4000,0x0000 , - 0x3b21,0x187e ,0x3ec5,0x0c7c ,0x3537,0x238e , - 0x2d41,0x2d41 ,0x3b21,0x187e ,0x187e,0x3b21 , - 0x187e,0x3b21 ,0x3537,0x238e ,0xf384,0x3ec5 , - 0x0000,0x4000 ,0x2d41,0x2d41 ,0xd2bf,0x2d41 , - 0xe782,0x3b21 ,0x238e,0x3537 ,0xc13b,0x0c7c , - 0xd2bf,0x2d41 ,0x187e,0x3b21 ,0xc4df,0xe782 , - 0xc4df,0x187e ,0x0c7c,0x3ec5 ,0xdc72,0xcac9 , - 0x4000,0x0000 ,0x4000,0x0000 ,0x4000,0x0000 , - 0x3fb1,0x0646 ,0x3fec,0x0324 ,0x3f4f,0x0964 , - 0x3ec5,0x0c7c ,0x3fb1,0x0646 ,0x3d3f,0x1294 , - 0x3d3f,0x1294 ,0x3f4f,0x0964 ,0x39db,0x1b5d , - 0x3b21,0x187e ,0x3ec5,0x0c7c ,0x3537,0x238e , - 0x3871,0x1e2b ,0x3e15,0x0f8d ,0x2f6c,0x2afb , - 0x3537,0x238e ,0x3d3f,0x1294 ,0x289a,0x3179 , - 0x3179,0x289a ,0x3c42,0x1590 ,0x20e7,0x36e5 , - 0x2d41,0x2d41 ,0x3b21,0x187e ,0x187e,0x3b21 , - 0x289a,0x3179 ,0x39db,0x1b5d ,0x0f8d,0x3e15 , - 0x238e,0x3537 ,0x3871,0x1e2b ,0x0646,0x3fb1 , - 0x1e2b,0x3871 ,0x36e5,0x20e7 ,0xfcdc,0x3fec , - 0x187e,0x3b21 ,0x3537,0x238e ,0xf384,0x3ec5 , - 0x1294,0x3d3f ,0x3368,0x2620 ,0xea70,0x3c42 , - 0x0c7c,0x3ec5 ,0x3179,0x289a ,0xe1d5,0x3871 , - 0x0646,0x3fb1 ,0x2f6c,0x2afb ,0xd9e0,0x3368 , - 0x0000,0x4000 ,0x2d41,0x2d41 ,0xd2bf,0x2d41 , - 0xf9ba,0x3fb1 ,0x2afb,0x2f6c ,0xcc98,0x2620 , - 0xf384,0x3ec5 ,0x289a,0x3179 ,0xc78f,0x1e2b , - 0xed6c,0x3d3f ,0x2620,0x3368 ,0xc3be,0x1590 , - 0xe782,0x3b21 ,0x238e,0x3537 ,0xc13b,0x0c7c , - 0xe1d5,0x3871 ,0x20e7,0x36e5 ,0xc014,0x0324 , - 0xdc72,0x3537 ,0x1e2b,0x3871 ,0xc04f,0xf9ba , - 0xd766,0x3179 ,0x1b5d,0x39db ,0xc1eb,0xf073 , - 0xd2bf,0x2d41 ,0x187e,0x3b21 ,0xc4df,0xe782 , - 0xce87,0x289a ,0x1590,0x3c42 ,0xc91b,0xdf19 , - 0xcac9,0x238e ,0x1294,0x3d3f ,0xce87,0xd766 , - 0xc78f,0x1e2b ,0x0f8d,0x3e15 ,0xd505,0xd094 , - 0xc4df,0x187e ,0x0c7c,0x3ec5 ,0xdc72,0xcac9 , - 0xc2c1,0x1294 ,0x0964,0x3f4f ,0xe4a3,0xc625 , - 0xc13b,0x0c7c ,0x0646,0x3fb1 ,0xed6c,0xc2c1 , - 0xc04f,0x0646 ,0x0324,0x3fec ,0xf69c,0xc0b1 , - 0x4000,0x0000 ,0x4000,0x0000 ,0x4000,0x0000 , - 0x3ffb,0x0192 ,0x3fff,0x00c9 ,0x3ff5,0x025b , - 0x3fec,0x0324 ,0x3ffb,0x0192 ,0x3fd4,0x04b5 , - 0x3fd4,0x04b5 ,0x3ff5,0x025b ,0x3f9c,0x070e , - 0x3fb1,0x0646 ,0x3fec,0x0324 ,0x3f4f,0x0964 , - 0x3f85,0x07d6 ,0x3fe1,0x03ed ,0x3eeb,0x0bb7 , - 0x3f4f,0x0964 ,0x3fd4,0x04b5 ,0x3e72,0x0e06 , - 0x3f0f,0x0af1 ,0x3fc4,0x057e ,0x3de3,0x1050 , - 0x3ec5,0x0c7c ,0x3fb1,0x0646 ,0x3d3f,0x1294 , - 0x3e72,0x0e06 ,0x3f9c,0x070e ,0x3c85,0x14d2 , - 0x3e15,0x0f8d ,0x3f85,0x07d6 ,0x3bb6,0x1709 , - 0x3daf,0x1112 ,0x3f6b,0x089d ,0x3ad3,0x1937 , - 0x3d3f,0x1294 ,0x3f4f,0x0964 ,0x39db,0x1b5d , - 0x3cc5,0x1413 ,0x3f30,0x0a2b ,0x38cf,0x1d79 , - 0x3c42,0x1590 ,0x3f0f,0x0af1 ,0x37b0,0x1f8c , - 0x3bb6,0x1709 ,0x3eeb,0x0bb7 ,0x367d,0x2193 , - 0x3b21,0x187e ,0x3ec5,0x0c7c ,0x3537,0x238e , - 0x3a82,0x19ef ,0x3e9d,0x0d41 ,0x33df,0x257e , - 0x39db,0x1b5d ,0x3e72,0x0e06 ,0x3274,0x2760 , - 0x392b,0x1cc6 ,0x3e45,0x0eca ,0x30f9,0x2935 , - 0x3871,0x1e2b ,0x3e15,0x0f8d ,0x2f6c,0x2afb , - 0x37b0,0x1f8c ,0x3de3,0x1050 ,0x2dcf,0x2cb2 , - 0x36e5,0x20e7 ,0x3daf,0x1112 ,0x2c21,0x2e5a , - 0x3612,0x223d ,0x3d78,0x11d3 ,0x2a65,0x2ff2 , - 0x3537,0x238e ,0x3d3f,0x1294 ,0x289a,0x3179 , - 0x3453,0x24da ,0x3d03,0x1354 ,0x26c1,0x32ef , - 0x3368,0x2620 ,0x3cc5,0x1413 ,0x24da,0x3453 , - 0x3274,0x2760 ,0x3c85,0x14d2 ,0x22e7,0x35a5 , - 0x3179,0x289a ,0x3c42,0x1590 ,0x20e7,0x36e5 , - 0x3076,0x29ce ,0x3bfd,0x164c ,0x1edc,0x3812 , - 0x2f6c,0x2afb ,0x3bb6,0x1709 ,0x1cc6,0x392b , - 0x2e5a,0x2c21 ,0x3b6d,0x17c4 ,0x1aa7,0x3a30 , - 0x2d41,0x2d41 ,0x3b21,0x187e ,0x187e,0x3b21 , - 0x2c21,0x2e5a ,0x3ad3,0x1937 ,0x164c,0x3bfd , - 0x2afb,0x2f6c ,0x3a82,0x19ef ,0x1413,0x3cc5 , - 0x29ce,0x3076 ,0x3a30,0x1aa7 ,0x11d3,0x3d78 , - 0x289a,0x3179 ,0x39db,0x1b5d ,0x0f8d,0x3e15 , - 0x2760,0x3274 ,0x3984,0x1c12 ,0x0d41,0x3e9d , - 0x2620,0x3368 ,0x392b,0x1cc6 ,0x0af1,0x3f0f , - 0x24da,0x3453 ,0x38cf,0x1d79 ,0x089d,0x3f6b , - 0x238e,0x3537 ,0x3871,0x1e2b ,0x0646,0x3fb1 , - 0x223d,0x3612 ,0x3812,0x1edc ,0x03ed,0x3fe1 , - 0x20e7,0x36e5 ,0x37b0,0x1f8c ,0x0192,0x3ffb , - 0x1f8c,0x37b0 ,0x374b,0x203a ,0xff37,0x3fff , - 0x1e2b,0x3871 ,0x36e5,0x20e7 ,0xfcdc,0x3fec , - 0x1cc6,0x392b ,0x367d,0x2193 ,0xfa82,0x3fc4 , - 0x1b5d,0x39db ,0x3612,0x223d ,0xf82a,0x3f85 , - 0x19ef,0x3a82 ,0x35a5,0x22e7 ,0xf5d5,0x3f30 , - 0x187e,0x3b21 ,0x3537,0x238e ,0xf384,0x3ec5 , - 0x1709,0x3bb6 ,0x34c6,0x2435 ,0xf136,0x3e45 , - 0x1590,0x3c42 ,0x3453,0x24da ,0xeeee,0x3daf , - 0x1413,0x3cc5 ,0x33df,0x257e ,0xecac,0x3d03 , - 0x1294,0x3d3f ,0x3368,0x2620 ,0xea70,0x3c42 , - 0x1112,0x3daf ,0x32ef,0x26c1 ,0xe83c,0x3b6d , - 0x0f8d,0x3e15 ,0x3274,0x2760 ,0xe611,0x3a82 , - 0x0e06,0x3e72 ,0x31f8,0x27fe ,0xe3ee,0x3984 , - 0x0c7c,0x3ec5 ,0x3179,0x289a ,0xe1d5,0x3871 , - 0x0af1,0x3f0f ,0x30f9,0x2935 ,0xdfc6,0x374b , - 0x0964,0x3f4f ,0x3076,0x29ce ,0xddc3,0x3612 , - 0x07d6,0x3f85 ,0x2ff2,0x2a65 ,0xdbcb,0x34c6 , - 0x0646,0x3fb1 ,0x2f6c,0x2afb ,0xd9e0,0x3368 , - 0x04b5,0x3fd4 ,0x2ee4,0x2b8f ,0xd802,0x31f8 , - 0x0324,0x3fec ,0x2e5a,0x2c21 ,0xd632,0x3076 , - 0x0192,0x3ffb ,0x2dcf,0x2cb2 ,0xd471,0x2ee4 , - 0x0000,0x4000 ,0x2d41,0x2d41 ,0xd2bf,0x2d41 , - 0xfe6e,0x3ffb ,0x2cb2,0x2dcf ,0xd11c,0x2b8f , - 0xfcdc,0x3fec ,0x2c21,0x2e5a ,0xcf8a,0x29ce , - 0xfb4b,0x3fd4 ,0x2b8f,0x2ee4 ,0xce08,0x27fe , - 0xf9ba,0x3fb1 ,0x2afb,0x2f6c ,0xcc98,0x2620 , - 0xf82a,0x3f85 ,0x2a65,0x2ff2 ,0xcb3a,0x2435 , - 0xf69c,0x3f4f ,0x29ce,0x3076 ,0xc9ee,0x223d , - 0xf50f,0x3f0f ,0x2935,0x30f9 ,0xc8b5,0x203a , - 0xf384,0x3ec5 ,0x289a,0x3179 ,0xc78f,0x1e2b , - 0xf1fa,0x3e72 ,0x27fe,0x31f8 ,0xc67c,0x1c12 , - 0xf073,0x3e15 ,0x2760,0x3274 ,0xc57e,0x19ef , - 0xeeee,0x3daf ,0x26c1,0x32ef ,0xc493,0x17c4 , - 0xed6c,0x3d3f ,0x2620,0x3368 ,0xc3be,0x1590 , - 0xebed,0x3cc5 ,0x257e,0x33df ,0xc2fd,0x1354 , - 0xea70,0x3c42 ,0x24da,0x3453 ,0xc251,0x1112 , - 0xe8f7,0x3bb6 ,0x2435,0x34c6 ,0xc1bb,0x0eca , - 0xe782,0x3b21 ,0x238e,0x3537 ,0xc13b,0x0c7c , - 0xe611,0x3a82 ,0x22e7,0x35a5 ,0xc0d0,0x0a2b , - 0xe4a3,0x39db ,0x223d,0x3612 ,0xc07b,0x07d6 , - 0xe33a,0x392b ,0x2193,0x367d ,0xc03c,0x057e , - 0xe1d5,0x3871 ,0x20e7,0x36e5 ,0xc014,0x0324 , - 0xe074,0x37b0 ,0x203a,0x374b ,0xc001,0x00c9 , - 0xdf19,0x36e5 ,0x1f8c,0x37b0 ,0xc005,0xfe6e , - 0xddc3,0x3612 ,0x1edc,0x3812 ,0xc01f,0xfc13 , - 0xdc72,0x3537 ,0x1e2b,0x3871 ,0xc04f,0xf9ba , - 0xdb26,0x3453 ,0x1d79,0x38cf ,0xc095,0xf763 , - 0xd9e0,0x3368 ,0x1cc6,0x392b ,0xc0f1,0xf50f , - 0xd8a0,0x3274 ,0x1c12,0x3984 ,0xc163,0xf2bf , - 0xd766,0x3179 ,0x1b5d,0x39db ,0xc1eb,0xf073 , - 0xd632,0x3076 ,0x1aa7,0x3a30 ,0xc288,0xee2d , - 0xd505,0x2f6c ,0x19ef,0x3a82 ,0xc33b,0xebed , - 0xd3df,0x2e5a ,0x1937,0x3ad3 ,0xc403,0xe9b4 , - 0xd2bf,0x2d41 ,0x187e,0x3b21 ,0xc4df,0xe782 , - 0xd1a6,0x2c21 ,0x17c4,0x3b6d ,0xc5d0,0xe559 , - 0xd094,0x2afb ,0x1709,0x3bb6 ,0xc6d5,0xe33a , - 0xcf8a,0x29ce ,0x164c,0x3bfd ,0xc7ee,0xe124 , - 0xce87,0x289a ,0x1590,0x3c42 ,0xc91b,0xdf19 , - 0xcd8c,0x2760 ,0x14d2,0x3c85 ,0xca5b,0xdd19 , - 0xcc98,0x2620 ,0x1413,0x3cc5 ,0xcbad,0xdb26 , - 0xcbad,0x24da ,0x1354,0x3d03 ,0xcd11,0xd93f , - 0xcac9,0x238e ,0x1294,0x3d3f ,0xce87,0xd766 , - 0xc9ee,0x223d ,0x11d3,0x3d78 ,0xd00e,0xd59b , - 0xc91b,0x20e7 ,0x1112,0x3daf ,0xd1a6,0xd3df , - 0xc850,0x1f8c ,0x1050,0x3de3 ,0xd34e,0xd231 , - 0xc78f,0x1e2b ,0x0f8d,0x3e15 ,0xd505,0xd094 , - 0xc6d5,0x1cc6 ,0x0eca,0x3e45 ,0xd6cb,0xcf07 , - 0xc625,0x1b5d ,0x0e06,0x3e72 ,0xd8a0,0xcd8c , - 0xc57e,0x19ef ,0x0d41,0x3e9d ,0xda82,0xcc21 , - 0xc4df,0x187e ,0x0c7c,0x3ec5 ,0xdc72,0xcac9 , - 0xc44a,0x1709 ,0x0bb7,0x3eeb ,0xde6d,0xc983 , - 0xc3be,0x1590 ,0x0af1,0x3f0f ,0xe074,0xc850 , - 0xc33b,0x1413 ,0x0a2b,0x3f30 ,0xe287,0xc731 , - 0xc2c1,0x1294 ,0x0964,0x3f4f ,0xe4a3,0xc625 , - 0xc251,0x1112 ,0x089d,0x3f6b ,0xe6c9,0xc52d , - 0xc1eb,0x0f8d ,0x07d6,0x3f85 ,0xe8f7,0xc44a , - 0xc18e,0x0e06 ,0x070e,0x3f9c ,0xeb2e,0xc37b , - 0xc13b,0x0c7c ,0x0646,0x3fb1 ,0xed6c,0xc2c1 , - 0xc0f1,0x0af1 ,0x057e,0x3fc4 ,0xefb0,0xc21d , - 0xc0b1,0x0964 ,0x04b5,0x3fd4 ,0xf1fa,0xc18e , - 0xc07b,0x07d6 ,0x03ed,0x3fe1 ,0xf449,0xc115 , - 0xc04f,0x0646 ,0x0324,0x3fec ,0xf69c,0xc0b1 , - 0xc02c,0x04b5 ,0x025b,0x3ff5 ,0xf8f2,0xc064 , - 0xc014,0x0324 ,0x0192,0x3ffb ,0xfb4b,0xc02c , - 0xc005,0x0192 ,0x00c9,0x3fff ,0xfda5,0xc00b , - 0x4000,0x0000 ,0x4000,0x0065 ,0x3fff,0x00c9 , - 0x3ffd,0x012e ,0x3ffb,0x0192 ,0x3ff8,0x01f7 , - 0x3ff5,0x025b ,0x3ff1,0x02c0 ,0x3fec,0x0324 , - 0x3fe7,0x0388 ,0x3fe1,0x03ed ,0x3fdb,0x0451 , - 0x3fd4,0x04b5 ,0x3fcc,0x051a ,0x3fc4,0x057e , - 0x3fbb,0x05e2 ,0x3fb1,0x0646 ,0x3fa7,0x06aa , - 0x3f9c,0x070e ,0x3f91,0x0772 ,0x3f85,0x07d6 , - 0x3f78,0x0839 ,0x3f6b,0x089d ,0x3f5d,0x0901 , - 0x3f4f,0x0964 ,0x3f40,0x09c7 ,0x3f30,0x0a2b , - 0x3f20,0x0a8e ,0x3f0f,0x0af1 ,0x3efd,0x0b54 , - 0x3eeb,0x0bb7 ,0x3ed8,0x0c1a ,0x3ec5,0x0c7c , - 0x3eb1,0x0cdf ,0x3e9d,0x0d41 ,0x3e88,0x0da4 , - 0x3e72,0x0e06 ,0x3e5c,0x0e68 ,0x3e45,0x0eca , - 0x3e2d,0x0f2b ,0x3e15,0x0f8d ,0x3dfc,0x0fee , - 0x3de3,0x1050 ,0x3dc9,0x10b1 ,0x3daf,0x1112 , - 0x3d93,0x1173 ,0x3d78,0x11d3 ,0x3d5b,0x1234 , - 0x3d3f,0x1294 ,0x3d21,0x12f4 ,0x3d03,0x1354 , - 0x3ce4,0x13b4 ,0x3cc5,0x1413 ,0x3ca5,0x1473 , - 0x3c85,0x14d2 ,0x3c64,0x1531 ,0x3c42,0x1590 , - 0x3c20,0x15ee ,0x3bfd,0x164c ,0x3bda,0x16ab , - 0x3bb6,0x1709 ,0x3b92,0x1766 ,0x3b6d,0x17c4 , - 0x3b47,0x1821 ,0x3b21,0x187e ,0x3afa,0x18db , - 0x3ad3,0x1937 ,0x3aab,0x1993 ,0x3a82,0x19ef , - 0x3a59,0x1a4b ,0x3a30,0x1aa7 ,0x3a06,0x1b02 , - 0x39db,0x1b5d ,0x39b0,0x1bb8 ,0x3984,0x1c12 , - 0x3958,0x1c6c ,0x392b,0x1cc6 ,0x38fd,0x1d20 , - 0x38cf,0x1d79 ,0x38a1,0x1dd3 ,0x3871,0x1e2b , - 0x3842,0x1e84 ,0x3812,0x1edc ,0x37e1,0x1f34 , - 0x37b0,0x1f8c ,0x377e,0x1fe3 ,0x374b,0x203a , - 0x3718,0x2091 ,0x36e5,0x20e7 ,0x36b1,0x213d , - 0x367d,0x2193 ,0x3648,0x21e8 ,0x3612,0x223d , - 0x35dc,0x2292 ,0x35a5,0x22e7 ,0x356e,0x233b , - 0x3537,0x238e ,0x34ff,0x23e2 ,0x34c6,0x2435 , - 0x348d,0x2488 ,0x3453,0x24da ,0x3419,0x252c , - 0x33df,0x257e ,0x33a3,0x25cf ,0x3368,0x2620 , - 0x332c,0x2671 ,0x32ef,0x26c1 ,0x32b2,0x2711 , - 0x3274,0x2760 ,0x3236,0x27af ,0x31f8,0x27fe , - 0x31b9,0x284c ,0x3179,0x289a ,0x3139,0x28e7 , - 0x30f9,0x2935 ,0x30b8,0x2981 ,0x3076,0x29ce , - 0x3034,0x2a1a ,0x2ff2,0x2a65 ,0x2faf,0x2ab0 , - 0x2f6c,0x2afb ,0x2f28,0x2b45 ,0x2ee4,0x2b8f , - 0x2e9f,0x2bd8 ,0x2e5a,0x2c21 ,0x2e15,0x2c6a , - 0x2dcf,0x2cb2 ,0x2d88,0x2cfa ,0x2d41,0x2d41 , - 0x2cfa,0x2d88 ,0x2cb2,0x2dcf ,0x2c6a,0x2e15 , - 0x2c21,0x2e5a ,0x2bd8,0x2e9f ,0x2b8f,0x2ee4 , - 0x2b45,0x2f28 ,0x2afb,0x2f6c ,0x2ab0,0x2faf , - 0x2a65,0x2ff2 ,0x2a1a,0x3034 ,0x29ce,0x3076 , - 0x2981,0x30b8 ,0x2935,0x30f9 ,0x28e7,0x3139 , - 0x289a,0x3179 ,0x284c,0x31b9 ,0x27fe,0x31f8 , - 0x27af,0x3236 ,0x2760,0x3274 ,0x2711,0x32b2 , - 0x26c1,0x32ef ,0x2671,0x332c ,0x2620,0x3368 , - 0x25cf,0x33a3 ,0x257e,0x33df ,0x252c,0x3419 , - 0x24da,0x3453 ,0x2488,0x348d ,0x2435,0x34c6 , - 0x23e2,0x34ff ,0x238e,0x3537 ,0x233b,0x356e , - 0x22e7,0x35a5 ,0x2292,0x35dc ,0x223d,0x3612 , - 0x21e8,0x3648 ,0x2193,0x367d ,0x213d,0x36b1 , - 0x20e7,0x36e5 ,0x2091,0x3718 ,0x203a,0x374b , - 0x1fe3,0x377e ,0x1f8c,0x37b0 ,0x1f34,0x37e1 , - 0x1edc,0x3812 ,0x1e84,0x3842 ,0x1e2b,0x3871 , - 0x1dd3,0x38a1 ,0x1d79,0x38cf ,0x1d20,0x38fd , - 0x1cc6,0x392b ,0x1c6c,0x3958 ,0x1c12,0x3984 , - 0x1bb8,0x39b0 ,0x1b5d,0x39db ,0x1b02,0x3a06 , - 0x1aa7,0x3a30 ,0x1a4b,0x3a59 ,0x19ef,0x3a82 , - 0x1993,0x3aab ,0x1937,0x3ad3 ,0x18db,0x3afa , - 0x187e,0x3b21 ,0x1821,0x3b47 ,0x17c4,0x3b6d , - 0x1766,0x3b92 ,0x1709,0x3bb6 ,0x16ab,0x3bda , - 0x164c,0x3bfd ,0x15ee,0x3c20 ,0x1590,0x3c42 , - 0x1531,0x3c64 ,0x14d2,0x3c85 ,0x1473,0x3ca5 , - 0x1413,0x3cc5 ,0x13b4,0x3ce4 ,0x1354,0x3d03 , - 0x12f4,0x3d21 ,0x1294,0x3d3f ,0x1234,0x3d5b , - 0x11d3,0x3d78 ,0x1173,0x3d93 ,0x1112,0x3daf , - 0x10b1,0x3dc9 ,0x1050,0x3de3 ,0x0fee,0x3dfc , - 0x0f8d,0x3e15 ,0x0f2b,0x3e2d ,0x0eca,0x3e45 , - 0x0e68,0x3e5c ,0x0e06,0x3e72 ,0x0da4,0x3e88 , - 0x0d41,0x3e9d ,0x0cdf,0x3eb1 ,0x0c7c,0x3ec5 , - 0x0c1a,0x3ed8 ,0x0bb7,0x3eeb ,0x0b54,0x3efd , - 0x0af1,0x3f0f ,0x0a8e,0x3f20 ,0x0a2b,0x3f30 , - 0x09c7,0x3f40 ,0x0964,0x3f4f ,0x0901,0x3f5d , - 0x089d,0x3f6b ,0x0839,0x3f78 ,0x07d6,0x3f85 , - 0x0772,0x3f91 ,0x070e,0x3f9c ,0x06aa,0x3fa7 , - 0x0646,0x3fb1 ,0x05e2,0x3fbb ,0x057e,0x3fc4 , - 0x051a,0x3fcc ,0x04b5,0x3fd4 ,0x0451,0x3fdb , - 0x03ed,0x3fe1 ,0x0388,0x3fe7 ,0x0324,0x3fec , - 0x02c0,0x3ff1 ,0x025b,0x3ff5 ,0x01f7,0x3ff8 , - 0x0192,0x3ffb ,0x012e,0x3ffd ,0x00c9,0x3fff , - 0x0065,0x4000 ,0x0000,0x4000 ,0xff9b,0x4000 , - 0xff37,0x3fff ,0xfed2,0x3ffd ,0xfe6e,0x3ffb , - 0xfe09,0x3ff8 ,0xfda5,0x3ff5 ,0xfd40,0x3ff1 , - 0xfcdc,0x3fec ,0xfc78,0x3fe7 ,0xfc13,0x3fe1 , - 0xfbaf,0x3fdb ,0xfb4b,0x3fd4 ,0xfae6,0x3fcc , - 0xfa82,0x3fc4 ,0xfa1e,0x3fbb ,0xf9ba,0x3fb1 , - 0xf956,0x3fa7 ,0xf8f2,0x3f9c ,0xf88e,0x3f91 , - 0xf82a,0x3f85 ,0xf7c7,0x3f78 ,0xf763,0x3f6b , - 0xf6ff,0x3f5d ,0xf69c,0x3f4f ,0xf639,0x3f40 , - 0xf5d5,0x3f30 ,0xf572,0x3f20 ,0xf50f,0x3f0f , - 0xf4ac,0x3efd ,0xf449,0x3eeb ,0xf3e6,0x3ed8 , - 0xf384,0x3ec5 ,0xf321,0x3eb1 ,0xf2bf,0x3e9d , - 0xf25c,0x3e88 ,0xf1fa,0x3e72 ,0xf198,0x3e5c , - 0xf136,0x3e45 ,0xf0d5,0x3e2d ,0xf073,0x3e15 , - 0xf012,0x3dfc ,0xefb0,0x3de3 ,0xef4f,0x3dc9 , - 0xeeee,0x3daf ,0xee8d,0x3d93 ,0xee2d,0x3d78 , - 0xedcc,0x3d5b ,0xed6c,0x3d3f ,0xed0c,0x3d21 , - 0xecac,0x3d03 ,0xec4c,0x3ce4 ,0xebed,0x3cc5 , - 0xeb8d,0x3ca5 ,0xeb2e,0x3c85 ,0xeacf,0x3c64 , - 0xea70,0x3c42 ,0xea12,0x3c20 ,0xe9b4,0x3bfd , - 0xe955,0x3bda ,0xe8f7,0x3bb6 ,0xe89a,0x3b92 , - 0xe83c,0x3b6d ,0xe7df,0x3b47 ,0xe782,0x3b21 , - 0xe725,0x3afa ,0xe6c9,0x3ad3 ,0xe66d,0x3aab , - 0xe611,0x3a82 ,0xe5b5,0x3a59 ,0xe559,0x3a30 , - 0xe4fe,0x3a06 ,0xe4a3,0x39db ,0xe448,0x39b0 , - 0xe3ee,0x3984 ,0xe394,0x3958 ,0xe33a,0x392b , - 0xe2e0,0x38fd ,0xe287,0x38cf ,0xe22d,0x38a1 , - 0xe1d5,0x3871 ,0xe17c,0x3842 ,0xe124,0x3812 , - 0xe0cc,0x37e1 ,0xe074,0x37b0 ,0xe01d,0x377e , - 0xdfc6,0x374b ,0xdf6f,0x3718 ,0xdf19,0x36e5 , - 0xdec3,0x36b1 ,0xde6d,0x367d ,0xde18,0x3648 , - 0xddc3,0x3612 ,0xdd6e,0x35dc ,0xdd19,0x35a5 , - 0xdcc5,0x356e ,0xdc72,0x3537 ,0xdc1e,0x34ff , - 0xdbcb,0x34c6 ,0xdb78,0x348d ,0xdb26,0x3453 , - 0xdad4,0x3419 ,0xda82,0x33df ,0xda31,0x33a3 , - 0xd9e0,0x3368 ,0xd98f,0x332c ,0xd93f,0x32ef , - 0xd8ef,0x32b2 ,0xd8a0,0x3274 ,0xd851,0x3236 , - 0xd802,0x31f8 ,0xd7b4,0x31b9 ,0xd766,0x3179 , - 0xd719,0x3139 ,0xd6cb,0x30f9 ,0xd67f,0x30b8 , - 0xd632,0x3076 ,0xd5e6,0x3034 ,0xd59b,0x2ff2 , - 0xd550,0x2faf ,0xd505,0x2f6c ,0xd4bb,0x2f28 , - 0xd471,0x2ee4 ,0xd428,0x2e9f ,0xd3df,0x2e5a , - 0xd396,0x2e15 ,0xd34e,0x2dcf ,0xd306,0x2d88 , - 0xd2bf,0x2d41 ,0xd278,0x2cfa ,0xd231,0x2cb2 , - 0xd1eb,0x2c6a ,0xd1a6,0x2c21 ,0xd161,0x2bd8 , - 0xd11c,0x2b8f ,0xd0d8,0x2b45 ,0xd094,0x2afb , - 0xd051,0x2ab0 ,0xd00e,0x2a65 ,0xcfcc,0x2a1a , - 0xcf8a,0x29ce ,0xcf48,0x2981 ,0xcf07,0x2935 , - 0xcec7,0x28e7 ,0xce87,0x289a ,0xce47,0x284c , - 0xce08,0x27fe ,0xcdca,0x27af ,0xcd8c,0x2760 , - 0xcd4e,0x2711 ,0xcd11,0x26c1 ,0xccd4,0x2671 , - 0xcc98,0x2620 ,0xcc5d,0x25cf ,0xcc21,0x257e , - 0xcbe7,0x252c ,0xcbad,0x24da ,0xcb73,0x2488 , - 0xcb3a,0x2435 ,0xcb01,0x23e2 ,0xcac9,0x238e , - 0xca92,0x233b ,0xca5b,0x22e7 ,0xca24,0x2292 , - 0xc9ee,0x223d ,0xc9b8,0x21e8 ,0xc983,0x2193 , - 0xc94f,0x213d ,0xc91b,0x20e7 ,0xc8e8,0x2091 , - 0xc8b5,0x203a ,0xc882,0x1fe3 ,0xc850,0x1f8c , - 0xc81f,0x1f34 ,0xc7ee,0x1edc ,0xc7be,0x1e84 , - 0xc78f,0x1e2b ,0xc75f,0x1dd3 ,0xc731,0x1d79 , - 0xc703,0x1d20 ,0xc6d5,0x1cc6 ,0xc6a8,0x1c6c , - 0xc67c,0x1c12 ,0xc650,0x1bb8 ,0xc625,0x1b5d , - 0xc5fa,0x1b02 ,0xc5d0,0x1aa7 ,0xc5a7,0x1a4b , - 0xc57e,0x19ef ,0xc555,0x1993 ,0xc52d,0x1937 , - 0xc506,0x18db ,0xc4df,0x187e ,0xc4b9,0x1821 , - 0xc493,0x17c4 ,0xc46e,0x1766 ,0xc44a,0x1709 , - 0xc426,0x16ab ,0xc403,0x164c ,0xc3e0,0x15ee , - 0xc3be,0x1590 ,0xc39c,0x1531 ,0xc37b,0x14d2 , - 0xc35b,0x1473 ,0xc33b,0x1413 ,0xc31c,0x13b4 , - 0xc2fd,0x1354 ,0xc2df,0x12f4 ,0xc2c1,0x1294 , - 0xc2a5,0x1234 ,0xc288,0x11d3 ,0xc26d,0x1173 , - 0xc251,0x1112 ,0xc237,0x10b1 ,0xc21d,0x1050 , - 0xc204,0x0fee ,0xc1eb,0x0f8d ,0xc1d3,0x0f2b , - 0xc1bb,0x0eca ,0xc1a4,0x0e68 ,0xc18e,0x0e06 , - 0xc178,0x0da4 ,0xc163,0x0d41 ,0xc14f,0x0cdf , - 0xc13b,0x0c7c ,0xc128,0x0c1a ,0xc115,0x0bb7 , - 0xc103,0x0b54 ,0xc0f1,0x0af1 ,0xc0e0,0x0a8e , - 0xc0d0,0x0a2b ,0xc0c0,0x09c7 ,0xc0b1,0x0964 , - 0xc0a3,0x0901 ,0xc095,0x089d ,0xc088,0x0839 , - 0xc07b,0x07d6 ,0xc06f,0x0772 ,0xc064,0x070e , - 0xc059,0x06aa ,0xc04f,0x0646 ,0xc045,0x05e2 , - 0xc03c,0x057e ,0xc034,0x051a ,0xc02c,0x04b5 , - 0xc025,0x0451 ,0xc01f,0x03ed ,0xc019,0x0388 , - 0xc014,0x0324 ,0xc00f,0x02c0 ,0xc00b,0x025b , - 0xc008,0x01f7 ,0xc005,0x0192 ,0xc003,0x012e , - 0xc001,0x00c9 ,0xc000,0x0065 }; diff --git a/webrtc/common_audio/signal_processing/webrtc_fft_t_rad.c b/webrtc/common_audio/signal_processing/webrtc_fft_t_rad.c deleted file mode 100644 index 13fbd9f53..000000000 --- a/webrtc/common_audio/signal_processing/webrtc_fft_t_rad.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - - -/* - * This file contains the Q14 radix-2 tables used in ARM9E optimization routines. - * - */ - -extern const unsigned short t_Q14S_rad8[2]; -const unsigned short t_Q14S_rad8[2] = { 0x0000,0x2d41 }; - -//extern const int t_Q30S_rad8[2]; -//const int t_Q30S_rad8[2] = { 0x00000000,0x2d413ccd }; - -extern const unsigned short t_Q14R_rad8[2]; -const unsigned short t_Q14R_rad8[2] = { 0x2d41,0x2d41 }; - -//extern const int t_Q30R_rad8[2]; -//const int t_Q30R_rad8[2] = { 0x2d413ccd,0x2d413ccd }; diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/transform.h b/webrtc/modules/audio_coding/codecs/isac/fix/source/transform.h deleted file mode 100644 index 564385e27..000000000 --- a/webrtc/modules/audio_coding/codecs/isac/fix/source/transform.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_SOURCE_TRANSFORM_H_ -#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_SOURCE_TRANSFORM_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "webrtc/modules/audio_coding/codecs/isac/fix/source/settings.h" -#include "webrtc/typedefs.h" - -/* Cosine table 1 in Q14 */ -extern const int16_t kCosTab1[FRAMESAMPLES/2]; - -/* Sine table 1 in Q14 */ -extern const int16_t kSinTab1[FRAMESAMPLES/2]; - -/* Cosine table 2 in Q14 */ -extern const int16_t kCosTab2[FRAMESAMPLES/4]; - -/* Sine table 2 in Q14 */ -extern const int16_t kSinTab2[FRAMESAMPLES/4]; - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_SOURCE_TRANSFORM_H_ */ diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/test/ISACHist.cc b/webrtc/modules/audio_coding/codecs/isac/fix/test/ISACHist.cc deleted file mode 100644 index 753acd7e6..000000000 --- a/webrtc/modules/audio_coding/codecs/isac/fix/test/ISACHist.cc +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include -#include - -//#include "isac_codec.h" -//#include "isac_structs.h" -#include "isacfix.h" - - -#define NUM_CODECS 1 - -int main(int argc, char* argv[]) -{ - FILE *inFileList; - FILE *audioFile; - FILE *outFile; - char audioFileName[501]; - short audioBuff[960]; - short encoded[600]; - short startAudio; - short encodedLen; - ISACFIX_MainStruct *isac_struct; - unsigned long int hist[601]; - - // reset the histogram - for(short n=0; n < 601; n++) - { - hist[n] = 0; - } - - - inFileList = fopen(argv[1], "r"); - if(inFileList == NULL) - { - printf("Could not open the input file.\n"); - getchar(); - exit(-1); - } - outFile = fopen(argv[2], "w"); - if(outFile == NULL) - { - printf("Could not open the histogram file.\n"); - getchar(); - exit(-1); - } - - short frameSizeMsec = 30; - if(argc > 3) - { - frameSizeMsec = atoi(argv[3]); - } - - short audioOffset = 0; - if(argc > 4) - { - audioOffset = atoi(argv[4]); - } - int ok; - ok = WebRtcIsacfix_Create(&isac_struct); - // instantaneous mode - ok |= WebRtcIsacfix_EncoderInit(isac_struct, 1); - // is not used but initialize - ok |= WebRtcIsacfix_DecoderInit(isac_struct); - ok |= WebRtcIsacfix_Control(isac_struct, 32000, frameSizeMsec); - - if(ok != 0) - { - printf("\nProblem in seting up iSAC\n"); - exit(-1); - } - - while( fgets(audioFileName, 500, inFileList) != NULL ) - { - // remove trailing white-spaces and any Cntrl character - if(strlen(audioFileName) == 0) - { - continue; - } - short n = strlen(audioFileName) - 1; - while(isspace(audioFileName[n]) || iscntrl(audioFileName[n])) - { - audioFileName[n] = '\0'; - n--; - if(n < 0) - { - break; - } - } - - // remove leading spaces - if(strlen(audioFileName) == 0) - { - continue; - } - n = 0; - while((isspace(audioFileName[n]) || iscntrl(audioFileName[n])) && - (audioFileName[n] != '\0')) - { - n++; - } - memmove(audioFileName, &audioFileName[n], 500 - n); - if(strlen(audioFileName) == 0) - { - continue; - } - audioFile = fopen(audioFileName, "rb"); - if(audioFile == NULL) - { - printf("\nCannot open %s!!!!!\n", audioFileName); - exit(0); - } - - if(audioOffset > 0) - { - fseek(audioFile, (audioOffset<<1), SEEK_SET); - } - - while(fread(audioBuff, sizeof(short), (480*frameSizeMsec/30), audioFile) >= (480*frameSizeMsec/30)) - { - startAudio = 0; - do - { - encodedLen = WebRtcIsacfix_Encode(isac_struct, - &audioBuff[startAudio], encoded); - startAudio += 160; - } while(encodedLen == 0); - - if(encodedLen < 0) - { - printf("\nEncoding Error!!!\n"); - exit(0); - } - hist[encodedLen]++; - } - fclose(audioFile); - } - fclose(inFileList); - unsigned long totalFrames = 0; - for(short n=0; n < 601; n++) - { - totalFrames += hist[n]; - fprintf(outFile, "%10lu\n", hist[n]); - } - fclose(outFile); - - short topTenCntr = 0; - printf("\nTotal number of Frames %lu\n\n", totalFrames); - printf("Payload Len # occurences\n"); - printf("=========== ============\n"); - - for(short n = 600; (n >= 0) && (topTenCntr < 10); n--) - { - if(hist[n] > 0) - { - topTenCntr++; - printf(" %3d %3d\n", n, hist[n]); - } - } - WebRtcIsacfix_Free(isac_struct); - return 0; -} - diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/test/Isac_test.cc b/webrtc/modules/audio_coding/codecs/isac/fix/test/Isac_test.cc deleted file mode 100644 index 61d79e433..000000000 --- a/webrtc/modules/audio_coding/codecs/isac/fix/test/Isac_test.cc +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -/****************************************************************** - Stand Alone test application for ISACFIX and ISAC LC - -******************************************************************/ - -#include -#include -#include -#include "typedefs.h" - -#include "isacfix.h" -ISACFIX_MainStruct *ISACfix_inst; - -#define FS 16000 - - -typedef struct { - uint32_t arrival_time; /* samples */ - uint32_t sample_count; /* samples */ - uint16_t rtp_number; -} BottleNeckModel; - -void get_arrival_time(int current_framesamples, /* samples */ - int packet_size, /* bytes */ - int bottleneck, /* excluding headers; bits/s */ - BottleNeckModel *BN_data) -{ - const int HeaderSize = 35; - int HeaderRate; - - HeaderRate = HeaderSize * 8 * FS / current_framesamples; /* bits/s */ - - /* everything in samples */ - BN_data->sample_count = BN_data->sample_count + current_framesamples; - - BN_data->arrival_time += ((packet_size + HeaderSize) * 8 * FS) / (bottleneck + HeaderRate); - - if (BN_data->arrival_time < BN_data->sample_count) - BN_data->arrival_time = BN_data->sample_count; - - BN_data->rtp_number++; -} - -/* -#ifdef __cplusplus -extern "C" { -#endif -*/ -int main(int argc, char* argv[]){ - - /* Parameters */ - FILE *pInFile, *pOutFile, *pChcFile; - int8_t inFile[40]; - int8_t outFile[40]; - int8_t chcFile[40]; - int8_t codec[10]; - int16_t bitrt, spType, size; - uint16_t frameLen; - int16_t sigOut[1000], sigIn[1000]; - uint16_t bitStream[500]; /* double to 32 kbps for 60 ms */ - - int16_t chc, ok; - int noOfCalls, cdlen; - int16_t noOfLostFrames; - int err, errtype; - - BottleNeckModel BN_data; - - int totalbits =0; - int totalsmpls =0; - - /*End Parameters*/ - - - if ((argc==6)||(argc==7) ){ - - strcpy(codec,argv[5]); - - if(argc==7){ - if (!_stricmp("isac",codec)){ - bitrt = atoi(argv[6]); - if ( (bitrt<10000)&&(bitrt>32000)){ - printf("Error: Supported bit rate in the range 10000-32000 bps!\n"); - exit(-1); - } - - }else{ - printf("Error: Codec not recognized. Check spelling!\n"); - exit(-1); - } - - } else { - printf("Error: Codec not recognized. Check spelling!\n"); - exit(-1); - } - } else { - printf("Error: Wrong number of input parameter!\n\n"); - exit(-1); - } - - frameLen = atoi(argv[4]); - strcpy(chcFile,argv[3]); - strcpy(outFile,argv[2]); - strcpy(inFile,argv[1]); - - /* Open file streams */ - if( (pInFile = fopen(inFile,"rb")) == NULL ) { - printf( "Error: Did not find input file!\n" ); - exit(-1); - } - strcat(outFile,"_"); - strcat(outFile, argv[4]); - strcat(outFile,"_"); - strcat(outFile, codec); - - if (argc==7){ - strcat(outFile,"_"); - strcat(outFile, argv[6]); - } - if (_stricmp("none", chcFile)){ - strcat(outFile,"_"); - strcat(outFile, "plc"); - } - - strcat(outFile, ".otp"); - - if (_stricmp("none", chcFile)){ - if( (pChcFile = fopen(chcFile,"rb")) == NULL ) { - printf( "Error: Did not find channel file!\n" ); - exit(-1); - } - } - /******************************************************************/ - if (!_stricmp("isac", codec)){ /* ISAC */ - if ((frameLen!=480)&&(frameLen!=960)) { - printf("Error: ISAC only supports 480 and 960 samples per frame (not %d)\n", frameLen); - exit(-1); - } - if( (pOutFile = fopen(outFile,"wb")) == NULL ) { - printf( "Could not open output file!\n" ); - exit(-1); - } - ok=WebRtcIsacfix_Create(&ISACfix_inst); - if (ok!=0) { - printf("Couldn't allocate memory for iSAC fix instance\n"); - exit(-1); - } - - BN_data.arrival_time = 0; - BN_data.sample_count = 0; - BN_data.rtp_number = 0; - - WebRtcIsacfix_EncoderInit(ISACfix_inst,1); - WebRtcIsacfix_DecoderInit(ISACfix_inst); - err = WebRtcIsacfix_Control(ISACfix_inst, bitrt, (frameLen>>4)); - if (err < 0) { - /* exit if returned with error */ - errtype=WebRtcIsacfix_GetErrorCode(ISACfix_inst); - printf("\n\n Error in initialization: %d.\n\n", errtype); - exit(EXIT_FAILURE); - } - /* loop over frame */ - while (fread(sigIn,sizeof(int16_t),frameLen,pInFile) == frameLen) { - - noOfCalls=0; - cdlen=0; - while (cdlen<=0) { - cdlen=WebRtcIsacfix_Encode(ISACfix_inst,&sigIn[noOfCalls*160],(int16_t*)bitStream); - if(cdlen==-1){ - errtype=WebRtcIsacfix_GetErrorCode(ISACfix_inst); - printf("\n\nError in encoder: %d.\n\n", errtype); - exit(-1); - } - noOfCalls++; - } - - - if(_stricmp("none", chcFile)){ - if (fread(&chc,sizeof(int16_t),1,pChcFile)!=1) /* packet may be lost */ - break; - } else { - chc = 1; /* packets never lost */ - } - - /* simulate packet handling through NetEq and the modem */ - get_arrival_time(frameLen, cdlen, bitrt, &BN_data); - - if (chc){ /* decode */ - - err = WebRtcIsacfix_UpdateBwEstimate1(ISACfix_inst, - bitStream, - cdlen, - BN_data.rtp_number, - BN_data.arrival_time); - - if (err < 0) { - /* exit if returned with error */ - errtype=WebRtcIsacfix_GetErrorCode(ISACfix_inst); - printf("\n\nError in decoder: %d.\n\n", errtype); - exit(EXIT_FAILURE); - } - size = WebRtcIsacfix_Decode(ISACfix_inst, bitStream, cdlen, sigOut, &spType); - if(size<=0){ - /* exit if returned with error */ - errtype=WebRtcIsacfix_GetErrorCode(ISACfix_inst); - printf("\n\nError in decoder: %d.\n\n", errtype); - exit(-1); - } - } else { /* PLC */ - if (frameLen == 480){ - noOfLostFrames = 1; - } else{ - noOfLostFrames = 2; - } - size = WebRtcIsacfix_DecodePlc(ISACfix_inst, sigOut, noOfLostFrames ); - if(size<=0){ - errtype=WebRtcIsacfix_GetErrorCode(ISACfix_inst); - printf("\n\nError in decoder: %d.\n\n", errtype); - exit(-1); - } - } - - /* Write decoded speech to file */ - fwrite(sigOut,sizeof(short),size,pOutFile); - - totalbits += 8 * cdlen; - totalsmpls += size; - - } - /******************************************************************/ - } - -// printf("\n\ntotal bits = %d bits", totalbits); - printf("\nmeasured average bitrate = %0.3f kbits/s", (double)totalbits * 16 / totalsmpls); - printf("\n"); - - - fclose(pInFile); - fclose(pOutFile); - if (_stricmp("none", chcFile)){ - fclose(pChcFile); - } - - if (!_stricmp("isac", codec)){ - WebRtcIsacfix_Free(ISACfix_inst); - } - - return 0; - -} diff --git a/webrtc/modules/audio_conference_mixer/test/FunctionTest/functionTest.cc b/webrtc/modules/audio_conference_mixer/test/FunctionTest/functionTest.cc deleted file mode 100644 index 3211b3c48..000000000 --- a/webrtc/modules/audio_conference_mixer/test/FunctionTest/functionTest.cc +++ /dev/null @@ -1,1103 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include - -#include "webrtc/common_audio/vad/include/webrtc_vad.h" -#include "webrtc/modules/audio_conference_mixer/test/FunctionTest/functionTest.h" -#include "webrtc/system_wrappers/interface/event_wrapper.h" -#include "webrtc/system_wrappers/interface/thread_wrapper.h" -#include "webrtc/system_wrappers/interface/trace.h" - -#if (defined(WEBRTC_LINUX) || defined(WEBRTC_MAC)) - #include - #define MY_PERMISSION_MASK S_IRWXU | S_IRWXG | S_IRWXO - #define MKDIR(directory) mkdir(directory,MY_PERMISSION_MASK) -#else // defined(WINDOWS) - #include - #define MKDIR(directory) mkdir(directory) -#endif - -int main(int /*argc*/, char* /*argv[]*/) -{ - // Initialize random number generator - //unsigned int seed = 1220716312; // just a seed that can be used - unsigned int seed = (unsigned)time( NULL ); - srand(seed); - std::cout << "Starting function test. Seed = " << seed << std::endl; - std::cout << "Press enter to continue" << std::endl; - getchar(); - MixerWrapper* testInstance1 = MixerWrapper::CreateMixerWrapper(); - MixerWrapper* testInstance2 = MixerWrapper::CreateMixerWrapper(); - if((testInstance1 == NULL) || - (testInstance2 == NULL)) - { - assert(false); - return 0; - } - - char versionString[256] = ""; - uint32_t remainingBufferInBytes = 256; - uint32_t position = 0; - AudioConferenceMixer::GetVersion(versionString,remainingBufferInBytes,position); - - int read = 1; - while(read != 0) - { - std::cout << versionString << std::endl; - std::cout << "--------Menu-----------" << std::endl; - std::cout << std::endl; - std::cout << "0. Quit" << std::endl; - std::cout << "2. StartMixing" << std::endl; - std::cout << "3. StopMixing" << std::endl; - std::cout << "4. Create participant(s)" << std::endl; - std::cout << "5. Delete participant(s)" << std::endl; - std::cout << "6. List participants " << std::endl; - std::cout << "7. Print mix status " << std::endl; - std::cout << "8. Run identical scenario:" << std::endl; - std::cout << " a. 1 VIP, 3 regular, amount of mixed = 3" << std::endl; - std::cout << " b. 1 anonymous, 3 regular, amount of mixed = 2" << std::endl; - scanf("%i",&read); - getchar(); - MixerParticipant::ParticipantType participantType; - int option = 0; - uint32_t id = 0; - ListItem* item = NULL; - ListWrapper participants; - if(read == 0) - { - // donothing - } - else if(read == 1) - { - } - else if(read == 2) - { - testInstance1->StartMixing(); - } - else if(read == 3) - { - testInstance1->StopMixing(); - } - else if(read == 4) - { - while(true) - { - std::cout << "VIP(music) = " << MixerParticipant::VIP << std::endl; - std::cout << "Regular(speech) = " << MixerParticipant::REGULAR << std::endl; - std::cout << "Anonymous(music) = " << MixerParticipant::MIXED_ANONYMOUS << std::endl; - std::cout << "Select type of participant: "; - scanf("%i",&option); - if(option == MixerParticipant::VIP || - option == MixerParticipant::REGULAR || - option == MixerParticipant::MIXED_ANONYMOUS) - { - break; - } - } - participantType = (MixerParticipant::ParticipantType)option; - testInstance1->CreateParticipant(participantType); - } - else if(read == 5) - { - std::cout << "Select participant to delete: "; - scanf("%i",&option); - id = option; - testInstance1->DeleteParticipant(id); - break; - } - else if(read == 6) - { - testInstance1->GetParticipantList(participants); - item = participants.First(); - std::cout << "The following participants have been created: " << std::endl; - while(item) - { - uint32_t id = item->GetUnsignedItem(); - std::cout << id; - item = participants.Next(item); - if(item != NULL) - { - std::cout << ", "; - } - else - { - std::cout << std::endl; - } - } - } - else if(read == 7) - { - std::cout << "-------------Mixer Status-------------" << std::endl; - testInstance1->PrintStatus(); - testInstance2->PrintStatus(); - std::cout << "Press enter to continue"; - getchar(); - std::cout << std::endl; - std::cout << std::endl; - } - else if(read == 8) - { - const int32_t amountOfParticipants = 4; - MixerParticipant::ParticipantType instance1Participants[] = - {MixerParticipant::VIP, - MixerParticipant::REGULAR, - MixerParticipant::REGULAR, - MixerParticipant::REGULAR}; - MixerParticipant::ParticipantType instance2Participants[] = - {MixerParticipant::MIXED_ANONYMOUS, - MixerParticipant::REGULAR, - MixerParticipant::REGULAR, - MixerParticipant::REGULAR}; - for(int32_t i = 0; i < amountOfParticipants; i++) - { - int32_t startPosition = 0; - GenerateRandomPosition(startPosition); - testInstance1->CreateParticipant(instance1Participants[i],startPosition); - testInstance2->CreateParticipant(instance2Participants[i],startPosition); - } - bool success = true; - success = testInstance1->StartMixing(); - assert(success); - success = testInstance2->StartMixing(2); - assert(success); - } - } - - std::cout << "Press enter to stop" << std::endl; - getchar(); - delete testInstance1; - delete testInstance2; - return 0; -} - -FileWriter::FileWriter() - : - _file(NULL) -{ -} - -FileWriter::~FileWriter() -{ - if(_file) - { - fclose(_file); - } -} - -bool -FileWriter::SetFileName( - const char* fileName) -{ - if(_file) - { - fclose(_file); - } - _file = fopen(fileName,"wb"); - return _file != NULL; -} - -bool -FileWriter::WriteToFile( - const AudioFrame& audioFrame) -{ - int32_t written = - static_cast(fwrite(audioFrame.data_, sizeof(int16_t), - audioFrame.samples_per_channel_, _file)); - // Do not flush buffers since that will add (a lot of) delay - return written == audioFrame.samples_per_channel_; -} - -FileReader::FileReader() - : - _frequency(kDefaultFrequency), - _sampleSize((_frequency*kProcessPeriodicityInMs)/1000), - _timeStamp(0), - _file(NULL), - _vadInstr(NULL), - _automaticVad(false), - _vad(false) -{ - if(WebRtcVad_Create(&_vadInstr) == 0) - { - if(WebRtcVad_Init(_vadInstr) != 0) - { - assert(false); - WebRtcVad_Free(_vadInstr); - _vadInstr = NULL; - } - } - else - { - assert(false); - } -} - -FileReader::~FileReader() -{ - if(_file) - { - fclose(_file); - } - if(_vadInstr) - { - WebRtcVad_Free(_vadInstr); - } -} - -bool -FileReader::SetFileName( - const char* fileName) -{ - if(_file) - { - fclose(_file); - } - _file = fopen(fileName,"rb"); - return _file != NULL; -} - -bool -FileReader::ReadFromFile( - AudioFrame& audioFrame) -{ - - int16_t buffer[AudioFrame::kMaxDataSizeSamples]; - LoopedFileRead(buffer,AudioFrame::kMaxDataSizeSamples,_sampleSize,_file); - - bool vad = false; - GetVAD(buffer,_sampleSize,vad); - AudioFrame::VADActivity activity = vad ? AudioFrame::kVadActive : - AudioFrame::kVadPassive; - - _volumeCalculator.ComputeLevel(buffer,_sampleSize); - const int32_t level = _volumeCalculator.GetLevel(); - return audioFrame.UpdateFrame( -1, - _timeStamp, - buffer, - _sampleSize, - _frequency, - AudioFrame::kNormalSpeech, - activity, - 0, - level) == 0; - -} - -bool -FileReader::FastForwardFile( - const int32_t samples) -{ - int16_t* tempBuffer = new int16_t[samples]; - bool success = LoopedFileRead(tempBuffer,samples,samples,_file); - delete[] tempBuffer; - return success; -} - -bool -FileReader::EnableAutomaticVAD( - bool enable, - int mode) -{ - if(!_automaticVad && - enable) - { - if(WebRtcVad_Init(_vadInstr) == -1) - { - return false; - } - } - WebRtcVad_set_mode(_vadInstr,mode); - _automaticVad = enable; - return true; -} - -bool -FileReader::SetVAD( - bool vad) -{ - if(_automaticVad) - { - return false; - } - _vad = vad; - return true; -} - -bool -FileReader::GetVAD( - int16_t* buffer, - uint8_t bufferLengthInSamples, - bool& vad) -{ - if(_automaticVad) - { - int16_t result = WebRtcVad_Process(_vadInstr,_frequency,buffer,bufferLengthInSamples); - if(result == -1) - { - assert(false); - return false; - } - _vad = vad = (result == 1); - } - vad = _vad; - return true; -} - -MixerParticipant* -MixerParticipant::CreateParticipant( - const uint32_t id, - ParticipantType participantType, - const int32_t startPosition, - char* outputPath) -{ - if(participantType == RANDOM) - { - participantType = (ParticipantType)(rand() % 3); - } - MixerParticipant* participant = new MixerParticipant(id,participantType); - // Randomize the start position so we only need one input file - // assume file is smaller than 1 minute wideband = 60 * 16000 - // Always start at a multiple of 10ms wideband - if(!participant->InitializeFileReader(startPosition) || - !participant->InitializeFileWriter(outputPath)) - { - delete participant; - return NULL; - } - return participant; -} - -MixerParticipant::MixerParticipant( - const uint32_t id, - ParticipantType participantType) - : - _id(id), - _participantType(participantType), - _fileReader(), - _fileWriter() -{ -} - -MixerParticipant::~MixerParticipant() -{ -} - -int32_t -MixerParticipant::GetAudioFrame( - const int32_t /*id*/, - AudioFrame& audioFrame) -{ - if(!_fileReader.ReadFromFile(audioFrame)) - { - return -1; - } - audioFrame._id = _id; - return 0; -} - -int32_t -MixerParticipant::MixedAudioFrame( - const AudioFrame& audioFrame) -{ - return _fileWriter.WriteToFile(audioFrame); -} - -int32_t -MixerParticipant::GetParticipantType( - ParticipantType& participantType) -{ - participantType = _participantType; - return 0; -} - -bool -MixerParticipant::InitializeFileReader( - const int32_t startPositionInSamples) -{ - char fileName[128] = ""; - if(_participantType == REGULAR) - { - sprintf(fileName,"convFile.pcm"); - } - else - { - sprintf(fileName,"musicFile.pcm"); - } - if(!_fileReader.SetFileName(fileName)) - { - return false; - } - if(!_fileReader.EnableAutomaticVAD(true,2)) - { - assert(false); - } - return _fileReader.FastForwardFile(startPositionInSamples); -} - -bool -MixerParticipant::InitializeFileWriter( - char* outputPath) -{ - const int32_t stringsize = 128; - char fileName[stringsize] = ""; - strncpy(fileName,outputPath,stringsize); - fileName[stringsize-1] = '\0'; - - char tempName[stringsize]; - tempName[0] = '\0'; - sprintf(tempName,"outputFile%d.pcm",(int)_id); - strncat(fileName,tempName,(stringsize - strlen(fileName))); - fileName[stringsize-1] = '\0'; - - return _fileWriter.SetFileName(fileName); -} - -StatusReceiver::StatusReceiver( - const int32_t id) - : - _id(id), - _mixedParticipants(NULL), - _mixedParticipantsAmount(0), - _mixedParticipantsSize(0), - _vadPositiveParticipants(NULL), - _vadPositiveParticipantsAmount(0), - _vadPositiveParticipantsSize(0), - _mixedAudioLevel(0) -{ -} - -StatusReceiver::~StatusReceiver() -{ - delete[] _mixedParticipants; - delete[] _vadPositiveParticipants; -} - -void -StatusReceiver::MixedParticipants( - const int32_t id, - const ParticipantStatistics* participantStatistics, - const uint32_t size) -{ - if(id != _id) - { - assert(false); - } - if(_mixedParticipantsSize < size) - { - delete[] _mixedParticipants; - _mixedParticipantsSize = size; - _mixedParticipants = new ParticipantStatistics[size]; - } - _mixedParticipantsAmount = size; - memcpy(_mixedParticipants,participantStatistics,sizeof(ParticipantStatistics)*size); -} - -void -StatusReceiver::VADPositiveParticipants( - const int32_t id, - const ParticipantStatistics* participantStatistics, - const uint32_t size) -{ - if(id != _id) - { - assert(false); - } - - if(_vadPositiveParticipantsSize < size) - { - delete[] _vadPositiveParticipants; - _vadPositiveParticipantsSize = size; - _vadPositiveParticipants = new ParticipantStatistics[size]; - } - _vadPositiveParticipantsAmount = size; - memcpy(_vadPositiveParticipants,participantStatistics,sizeof(ParticipantStatistics)*size); -} - -void -StatusReceiver::MixedAudioLevel( - const int32_t id, - const uint32_t level) -{ - if(id != _id) - { - assert(false); - } - _mixedAudioLevel = level; -} - -void -StatusReceiver::PrintMixedParticipants() -{ - std::cout << "Mixed participants" << std::endl; - if(_mixedParticipantsAmount == 0) - { - std::cout << "N/A" << std::endl; - } - for(uint16_t i = 0; i < _mixedParticipantsAmount; i++) - { - std::cout << i + 1 << ". Participant " << _mixedParticipants[i].participant << ": level = " << _mixedParticipants[i].level << std::endl; - } -} - -void -StatusReceiver::PrintVadPositiveParticipants() -{ - std::cout << "VAD positive participants" << std::endl; - if(_mixedParticipantsAmount == 0) - { - std::cout << "N/A" << std::endl; - } - for(uint16_t i = 0; i < _mixedParticipantsAmount; i++) - { - std::cout << i + 1 << ". Participant " << _mixedParticipants[i].participant << ": level = " << _mixedParticipants[i].level << std::endl; - } -} - -void -StatusReceiver::PrintMixedAudioLevel() -{ - std::cout << "Mixed audio level = " << _mixedAudioLevel << std::endl; -} - -int32_t MixerWrapper::_mixerWrapperIdCounter = 0; - -MixerWrapper::MixerWrapper() - : - _processThread(NULL), - _threadId(0), - _firstProcessCall(true), - _previousTime(), - _periodicityInTicks(TickTime::MillisecondsToTicks(FileReader::kProcessPeriodicityInMs)), - _synchronizationEvent(EventWrapper::Create()), - _freeItemIds(), - _itemIdCounter(0), - _mixerParticipants(), - _mixerWrappererId(_mixerWrapperIdCounter++), - _instanceOutputPath(), - _trace(NULL), - _statusReceiver(_mixerWrappererId), - _generalAudioWriter() -{ - sprintf(_instanceOutputPath,"instance%d/",(int)_mixerWrappererId); - MKDIR(_instanceOutputPath); - _mixer = AudioConferenceMixer::CreateAudioConferenceMixer( - _mixerWrappererId); - if(_mixer != NULL) - { - bool success = true; - - success = _mixer->RegisterMixedStreamCallback(*this) == 0; - assert(success); - success = _mixer->RegisterMixedStreamCallback(*this) == -1; - assert(success); - success = _mixer->UnRegisterMixedStreamCallback() == 0; - assert(success); - success = _mixer->UnRegisterMixedStreamCallback() == -1; - assert(success); - success = _mixer->RegisterMixedStreamCallback(*this) == 0; - assert(success); - - success = _mixer->RegisterMixerStatusCallback(_statusReceiver,2) == 0; - assert(success); - success = _mixer->RegisterMixerStatusCallback(_statusReceiver,1) == -1; - assert(success); - success = _mixer->UnRegisterMixerStatusCallback() == 0; - assert(success); - success = _mixer->UnRegisterMixerStatusCallback() == -1; - assert(success); - success = _mixer->RegisterMixerStatusCallback(_statusReceiver,1) == 0; - assert(success); - } - else - { - assert(false); - std::cout << "Failed to create mixer instance"; - } -} - -MixerWrapper* -MixerWrapper::CreateMixerWrapper() -{ - MixerWrapper* mixerWrapper = new MixerWrapper(); - if(!mixerWrapper->InitializeFileWriter()) - { - delete mixerWrapper; - return NULL; - } - return mixerWrapper; -} - -MixerWrapper::~MixerWrapper() -{ - StopMixing(); - ClearAllItemIds(); - _synchronizationEvent->StopTimer(); - delete _synchronizationEvent; - delete _mixer; -} - -bool -MixerWrapper::CreateParticipant( - MixerParticipant::ParticipantType participantType) -{ - int32_t startPosition = 0; - GenerateRandomPosition(startPosition); - return CreateParticipant(participantType,startPosition); -} - -bool -MixerWrapper::CreateParticipant( - MixerParticipant::ParticipantType participantType, - const int32_t startPosition) -{ - uint32_t id; - if(!GetFreeItemIds(id)) - { - return false; - } - - MixerParticipant* participant = MixerParticipant::CreateParticipant(id,participantType,startPosition,_instanceOutputPath); - if(!participant) - { - return false; - } - if(_mixerParticipants.Insert(id,static_cast(participant)) != 0) - { - delete participant; - return false; - } - if(!StartMixingParticipant(id)) - { - DeleteParticipant(id); - return false; - } - return true; -} - -bool -MixerWrapper::DeleteParticipant( - const uint32_t id) -{ - bool success = StopMixingParticipant(id); - if(!success) - { - assert(false); - return false; - } - MapItem* item = _mixerParticipants.Find(id); - if(item == NULL) - { - return false; - } - MixerParticipant* participant = static_cast(item->GetItem()); - delete participant; - _mixerParticipants.Erase(item); - AddFreeItemIds(id); - return true; -} - -bool -MixerWrapper::StartMixing( - const uint32_t mixedParticipants) -{ - if(_processThread) - { - return false; - } - if(_mixer->SetAmountOfMixedParticipants(mixedParticipants) != 0) - { - assert(false); - } - uint32_t mixedParticipantsTest = 0; - _mixer->AmountOfMixedParticipants(mixedParticipantsTest); - assert(mixedParticipantsTest == mixedParticipants); - - if(!_synchronizationEvent->StartTimer(true,10)) - { - assert(false); - return false; - } - _processThread = ThreadWrapper::CreateThread(Process, this, kLowPriority); - if(!_processThread->Start(_threadId)) - { - delete _processThread; - _processThread = NULL; - assert(false); - return false; - } - - return true; -} - -bool -MixerWrapper::StopMixing() -{ - while(_processThread && - !_processThread->Stop()) - {} - _synchronizationEvent->StopTimer(); - - delete _processThread; - _processThread = NULL; - return true; -} - -void -MixerWrapper::NewMixedAudio( - const int32_t id, - const AudioFrame& generalAudioFrame, - const AudioFrame** uniqueAudioFrames, - const uint32_t size) -{ - if(id < 0) - { - assert(false); - } - // Store the general audio - _generalAudioWriter.WriteToFile(generalAudioFrame); - - // Send the unique audio frames to its corresponding participants - ListWrapper uniqueAudioFrameList; - for(uint32_t i = 0; i < size; i++) - { - uint32_t id = (uniqueAudioFrames[i])->_id; - MapItem* resultItem = _mixerParticipants.Find(id); - if(resultItem == NULL) - { - assert(false); - continue; - } - MixerParticipant* participant = static_cast(resultItem->GetItem()); - participant->MixedAudioFrame(*(uniqueAudioFrames[i])); - uniqueAudioFrameList.PushBack(resultItem->GetItem()); - } - - // Send the general audio frames to the remaining participants - MapItem* item = _mixerParticipants.First(); - while(item) - { - bool isUnique = false; - ListItem* compareItem = uniqueAudioFrameList.First(); - while(compareItem) - { - if(compareItem->GetItem() == item->GetItem()) - { - isUnique = true; - break; - } - compareItem = uniqueAudioFrameList.Next(compareItem); - } - if(!isUnique) - { - MixerParticipant* participant = static_cast(item->GetItem()); - participant->MixedAudioFrame(generalAudioFrame); - } - item = _mixerParticipants.Next(item); - } -} - -bool -MixerWrapper::GetParticipantList( - ListWrapper& participants) -{ - MapItem* item = _mixerParticipants.First(); - while(item) - { - participants.PushBack(item->GetId()); - item = _mixerParticipants.Next(item); - } - return true; -} - -void -MixerWrapper::PrintStatus() -{ - std::cout << "instance " << _mixerWrappererId << std::endl; - std::cout << std::endl; - _statusReceiver.PrintMixedParticipants(); - std::cout << std::endl; - _statusReceiver.PrintVadPositiveParticipants(); - std::cout << std::endl; - _statusReceiver.PrintMixedAudioLevel(); - std::cout << "---------------------------------------" << std::endl; -} - -bool -MixerWrapper::InitializeFileWriter() -{ - const int32_t stringsize = 128; - char fileName[stringsize] = ""; - strncpy(fileName,_instanceOutputPath,stringsize); - fileName[stringsize-1] = '\0'; - - strncat(fileName,"generalOutputFile.pcm",(stringsize - strlen(fileName))); - fileName[stringsize-1] = '\0'; - return _generalAudioWriter.SetFileName(fileName); -} - -bool -MixerWrapper::Process( - void* instance) -{ - MixerWrapper* mixerWrapper = static_cast(instance); - return mixerWrapper->Process(); -} - -bool -MixerWrapper::Process() -{ - switch(_synchronizationEvent->Wait(1000)) - { - case kEventSignaled: - // Normal operation, ~10 ms has passed - break; - case kEventError: - // Error occured end the thread and throw an assertion - assert(false); - return false; - case kEventTimeout: - // One second has passed without a timeout something is wrong - // end the thread and throw an assertion - assert(false); - return false; - } - int32_t processOfset = 0; - const TickTime currentTime = TickTime::Now(); - if(_firstProcessCall) - { - _previousTime = TickTime::Now(); - _firstProcessCall = false; - } - else - { - TickInterval deltaTime = (currentTime - _previousTime); - _previousTime += _periodicityInTicks; - processOfset = (int32_t) deltaTime.Milliseconds(); - processOfset -= FileReader::kProcessPeriodicityInMs; - } - - _mixer->Process(); - int32_t timeUntilNextProcess = _mixer->TimeUntilNextProcess(); - if(processOfset > FileReader::kProcessPeriodicityInMs) - { - std::cout << "Performance Warning: Process running " << processOfset << " too slow" << std::endl; - _previousTime = currentTime; - if(timeUntilNextProcess > 0) - { - std::cout << "Performance Warning: test performance and module performance missmatch" << std::endl; - } - } - else if(processOfset < -FileReader::kProcessPeriodicityInMs) - { - std::cout << "Performance Warning: Process running " << -processOfset << " too fast" << std::endl; - _previousTime = currentTime; - if(timeUntilNextProcess < FileReader::kProcessPeriodicityInMs) - { - std::cout << "Performance Warning: test performance and module performance missmatch" << std::endl; - } - } - return true; -} - - -bool -MixerWrapper::StartMixingParticipant( - const uint32_t id) -{ - MapItem* item = _mixerParticipants.Find(id); - if(item == NULL) - { - return false; - } - MixerParticipant* participant = static_cast(item->GetItem()); - MixerParticipant::ParticipantType participantType = MixerParticipant::REGULAR; - participant->GetParticipantType(participantType); - if(participantType == MixerParticipant::MIXED_ANONYMOUS) - { - bool anonymouslyMixed = false; - bool success = _mixer->SetAnonymousMixabilityStatus(*participant,true) == 0; - assert(success); - success = _mixer->AnonymousMixabilityStatus(*participant,anonymouslyMixed) == 0; - assert(success); - assert(anonymouslyMixed); - success = _mixer->SetAnonymousMixabilityStatus(*participant,true) == -1; - assert(success); - success = _mixer->SetAnonymousMixabilityStatus(*participant,false) == 0; - assert(success); - success = _mixer->AnonymousMixabilityStatus(*participant,anonymouslyMixed) == 0; - assert(success); - assert(!anonymouslyMixed); - success = _mixer->SetAnonymousMixabilityStatus(*participant,false) == -1; - assert(success); - success = _mixer->SetAnonymousMixabilityStatus(*participant,true) == 0; - assert(success); - success = _mixer->AnonymousMixabilityStatus(*participant,anonymouslyMixed) == 0; - assert(success); - assert(anonymouslyMixed); - return success; - } - uint32_t previousAmountOfMixableParticipants = 0; - bool success = _mixer->AmountOfMixables(previousAmountOfMixableParticipants) == 0; - assert(success); - - success = _mixer->SetMixabilityStatus(*participant,true) == 0; - assert(success); - success = _mixer->SetMixabilityStatus(*participant,true) == -1; - assert(success); - success = _mixer->SetMixabilityStatus(*participant,false) == 0; - assert(success); - success = _mixer->SetMixabilityStatus(*participant,false) == -1; - assert(success); - success = _mixer->SetMixabilityStatus(*participant,true) == 0; - assert(success); - if(!success) - { - return false; - } - - uint32_t currentAmountOfMixableParticipants = 0; - success = _mixer->AmountOfMixables(currentAmountOfMixableParticipants) == 0; - assert(currentAmountOfMixableParticipants == previousAmountOfMixableParticipants + 1); - - bool mixable = true; - success = _mixer->MixabilityStatus(*participant,mixable) == 0; - assert(success); - assert(mixable); - if(participantType == MixerParticipant::REGULAR) - { - return true; - } - bool IsVIP = false; - success = _mixer->SetVIPStatus(*participant,true) == 0; - assert(success); - success = _mixer->VIPStatus(*participant,IsVIP) == 0; - assert(success); - assert(IsVIP); - success = _mixer->SetVIPStatus(*participant,true) == -1; - assert(success); - success = _mixer->SetVIPStatus(*participant,false) == 0; - assert(success); - success = _mixer->VIPStatus(*participant,IsVIP) == 0; - assert(success); - assert(!IsVIP); - success = _mixer->SetVIPStatus(*participant,false) == -1; - assert(success); - success = _mixer->SetVIPStatus(*participant,true) == 0; - assert(success); - success = _mixer->VIPStatus(*participant,IsVIP) == 0; - assert(success); - assert(IsVIP); - assert(success); - return success; -} - -bool -MixerWrapper::StopMixingParticipant( - const uint32_t id) -{ - MapItem* item = _mixerParticipants.Find(id); - if(item == NULL) - { - return false; - } - MixerParticipant* participant = static_cast(item->GetItem()); - bool success = false; - uint32_t previousAmountOfMixableParticipants = 0; - success = _mixer->AmountOfMixables(previousAmountOfMixableParticipants) == 0; - assert(success); - success = _mixer->SetMixabilityStatus(*participant,false) == 0; - assert(success); - uint32_t currentAmountOfMixableParticipants = 0; - success = _mixer->AmountOfMixables(currentAmountOfMixableParticipants) == 0; - assert(success); - assert(success ? currentAmountOfMixableParticipants == previousAmountOfMixableParticipants -1 : - currentAmountOfMixableParticipants == previousAmountOfMixableParticipants); - return success; -} - -bool -MixerWrapper::GetFreeItemIds( - uint32_t& itemId) -{ - if(!_freeItemIds.Empty()) - { - ListItem* item = _freeItemIds.First(); - uint32_t* id = static_cast(item->GetItem()); - itemId = *id; - delete id; - return true; - } - if(_itemIdCounter == (uint32_t) -1) - { - return false; - } - itemId = _itemIdCounter++; - return true; -} - -void -MixerWrapper::AddFreeItemIds( - const uint32_t itemId) -{ - uint32_t* id = new uint32_t; - *id = itemId; - _freeItemIds.PushBack(static_cast(id)); -} - -void -MixerWrapper::ClearAllItemIds() -{ - ListItem* item = _freeItemIds.First(); - while(item != NULL) - { - uint32_t* id = static_cast(item->GetItem()); - delete id; - _freeItemIds.Erase(item); - item = _freeItemIds.First(); - } -} - -bool -LoopedFileRead( - int16_t* buffer, - uint32_t bufferSizeInSamples, - uint32_t samplesToRead, - FILE* file) -{ - if(bufferSizeInSamples < samplesToRead) - { - return false; - } - uint32_t gottenSamples = static_cast( - fread(buffer, sizeof(int16_t), samplesToRead, file)); - if(gottenSamples != samplesToRead) - { - uint32_t missingSamples = samplesToRead - gottenSamples; - fseek(file,0,0); - gottenSamples += - static_cast(fread(&buffer[gottenSamples], sizeof(int16_t), - missingSamples, file)); - } - if(gottenSamples != samplesToRead) - { - return false; - } - return true; -} - -void -GenerateRandomPosition( - int32_t& startPosition) -{ - startPosition = (rand() % (60*16000/160)) * 160; -} diff --git a/webrtc/modules/audio_conference_mixer/test/FunctionTest/functionTest.h b/webrtc/modules/audio_conference_mixer/test/FunctionTest/functionTest.h deleted file mode 100644 index 3b05c7439..000000000 --- a/webrtc/modules/audio_conference_mixer/test/FunctionTest/functionTest.h +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_MODULES_AUDIO_CONFERENCE_MIXER_TEST_FUNCTIONTEST_FUNCTIONTEST_H_ -#define WEBRTC_MODULES_AUDIO_CONFERENCE_MIXER_TEST_FUNCTIONTEST_FUNCTIONTEST_H_ - -#include "webrtc/modules/audio_conference_mixer/interface/audio_conference_mixer.h" -#include "webrtc/modules/audio_conference_mixer/interface/audio_conference_mixer_defines.h" -#include "webrtc/modules/audio_conference_mixer/source/level_indicator.h" -#include "webrtc/modules/interface/module_common_types.h" -#include "webrtc/system_wrappers/interface/list_wrapper.h" -#include "webrtc/system_wrappers/interface/map_wrapper.h" -#include "webrtc/system_wrappers/interface/tick_util.h" - -namespace webrtc { -class EventWrapper; -class ThreadWrapper; -class Trace; -} -struct WebRtcVadInst; - -class FileWriter -{ -public: - FileWriter(); - ~FileWriter(); - - bool SetFileName( - const char* fileName); - - bool WriteToFile( - const AudioFrame& audioFrame); -private: - FILE* _file; -}; - -class FileReader -{ -public: - enum {kProcessPeriodicityInMs = 10}; - enum Frequency - { - kNbInHz = 8000, - kWbInHz = 16000, - kDefaultFrequency = kWbInHz - }; - - FileReader(); - ~FileReader(); - - bool SetFileName( - const char* fileName); - - bool ReadFromFile( - AudioFrame& audioFrame); - - bool FastForwardFile( - const int32_t samples); - - bool EnableAutomaticVAD( - bool enable, - int mode); - - bool SetVAD( - bool vad); -private: - bool GetVAD( - int16_t* buffer, - uint8_t bufferLengthInSamples, - bool& vad); - - Frequency _frequency; - uint8_t _sampleSize; - - uint32_t _timeStamp; - - FILE* _file; - - WebRtcVadInst* _vadInstr; - bool _automaticVad; - bool _vad; - - LevelIndicator _volumeCalculator; -}; - -class MixerParticipant : public MixerParticipant -{ -public: - enum ParticipantType - { - VIP = 0, - REGULAR = 1, - MIXED_ANONYMOUS = 2, - RANDOM = 3 - }; - - static MixerParticipant* CreateParticipant( - const uint32_t id, - ParticipantType participantType, - const int32_t startPosition, - char* outputPath); - ~MixerParticipant(); - - int32_t GetAudioFrame( - const int32_t id, - AudioFrame& audioFrame); - - int32_t MixedAudioFrame( - const AudioFrame& audioFrame); - - int32_t GetParticipantType( - ParticipantType& participantType); -private: - MixerParticipant( - const uint32_t id, - ParticipantType participantType); - - bool InitializeFileReader( - const int32_t startPositionInSamples); - - bool InitializeFileWriter( - char* outputPath); - - uint32_t _id; - ParticipantType _participantType; - - FileReader _fileReader; - FileWriter _fileWriter; -}; - -class StatusReceiver : public AudioMixerStatusReceiver -{ -public: - StatusReceiver( - const int32_t id); - ~StatusReceiver(); - - void MixedParticipants( - const int32_t id, - const ParticipantStatistics* participantStatistics, - const uint32_t size); - - void VADPositiveParticipants( - const int32_t id, - const ParticipantStatistics* participantStatistics, - const uint32_t size); - - void MixedAudioLevel( - const int32_t id, - const uint32_t level); - - void PrintMixedParticipants(); - - void PrintVadPositiveParticipants(); - - void PrintMixedAudioLevel(); -private: - int32_t _id; - - ParticipantStatistics* _mixedParticipants; - uint32_t _mixedParticipantsAmount; - uint32_t _mixedParticipantsSize; - - ParticipantStatistics* _vadPositiveParticipants; - uint32_t _vadPositiveParticipantsAmount; - uint32_t _vadPositiveParticipantsSize; - - uint32_t _mixedAudioLevel; -}; - -class MixerWrapper : public AudioMixerOutputReceiver -{ -public: - static MixerWrapper* CreateMixerWrapper(); - ~MixerWrapper(); - - bool SetMixFrequency( - const AudioConferenceMixer::Frequency frequency); - - bool CreateParticipant( - MixerParticipant::ParticipantType participantType); - - bool CreateParticipant( - MixerParticipant::ParticipantType participantType, - const int32_t startPosition); - - bool DeleteParticipant( - const uint32_t id); - - bool StartMixing( - const uint32_t mixedParticipants = AudioConferenceMixer::kDefaultAmountOfMixedParticipants); - - bool StopMixing(); - - void NewMixedAudio( - const int32_t id, - const AudioFrame& generalAudioFrame, - const AudioFrame** uniqueAudioFrames, - const uint32_t size); - - bool GetParticipantList( - ListWrapper& participants); - - void PrintStatus(); -private: - MixerWrapper(); - - bool InitializeFileWriter(); - - static bool Process( - void* instance); - - bool Process(); - - bool StartMixingParticipant( - const uint32_t id); - - bool StopMixingParticipant( - const uint32_t id); - - bool GetFreeItemIds( - uint32_t& itemId); - - void AddFreeItemIds( - const uint32_t itemId); - - void ClearAllItemIds(); - - webrtc::ThreadWrapper* _processThread; - unsigned int _threadId; - - // Performance hooks - enum{WARNING_COUNTER = 100}; - - bool _firstProcessCall; - TickTime _previousTime; // Tick time of previous process - const int64_t _periodicityInTicks; // Periodicity - - webrtc::EventWrapper* _synchronizationEvent; - - ListWrapper _freeItemIds; - uint32_t _itemIdCounter; - - MapWrapper _mixerParticipants; - - static int32_t _mixerWrapperIdCounter; - int32_t _mixerWrappererId; - char _instanceOutputPath[128]; - - webrtc::Trace* _trace; - AudioConferenceMixer* _mixer; - - StatusReceiver _statusReceiver; - - FileWriter _generalAudioWriter; -}; - -bool -LoopedFileRead( - int16_t* buffer, - uint32_t bufferSizeInSamples, - uint32_t samplesToRead, - FILE* file); - -void -GenerateRandomPosition( - int32_t& startPosition); - -#endif // WEBRTC_MODULES_AUDIO_CONFERENCE_MIXER_TEST_FUNCTIONTEST_FUNCTIONTEST_H_ diff --git a/webrtc/modules/audio_device/test/android/audio_device_android_test/jni/audio_device_android_test.cc b/webrtc/modules/audio_device/test/android/audio_device_android_test/jni/audio_device_android_test.cc deleted file mode 100644 index 9e4c62c5a..000000000 --- a/webrtc/modules/audio_device/test/android/audio_device_android_test/jni/audio_device_android_test.cc +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include // memset - -#include "webrtc/modules/audio_device/test/android/audio_device_android_test/jni/org_webrtc_voiceengine_test_AudioDeviceAndroidTest.h" - -#include "webrtc/modules/audio_device/main/interface/audio_device.h" - -#define LOG_TAG "WebRTC ADM Native" - -void api_test(); -void func_test(int); - -typedef struct -{ - // Other - JavaVM* jvm; -} AdmData; - -static AdmData admData; - -jint JNI_OnLoad(JavaVM* vm, void* /*reserved*/) -{ - if (!vm) - { - __android_log_write(ANDROID_LOG_ERROR, LOG_TAG, - "JNI_OnLoad did not receive a valid VM pointer"); - return -1; - } - - // Get JNI - JNIEnv* env; - if (JNI_OK != vm->GetEnv(reinterpret_cast (&env), - JNI_VERSION_1_4)) - { - __android_log_write(ANDROID_LOG_ERROR, LOG_TAG, - "JNI_OnLoad could not get JNI env"); - return -1; - } - - // Get class to register the native functions with - // jclass regClass = - // env->FindClass("org/webrtc/voiceengine/test/AudioDeviceAndroidTest"); - // if (!regClass) { - // return -1; // Exception thrown - // } - - // Register native functions - // JNINativeMethod methods[1]; - // methods[0].name = NULL; - // methods[0].signature = NULL; - // methods[0].fnPtr = NULL; - // if (JNI_OK != env->RegisterNatives(regClass, methods, 1)) - // { - // return -1; - // } - - // Init VoiceEngine data - memset(&admData, 0, sizeof(admData)); - - // Store the JVM - admData.jvm = vm; - - return JNI_VERSION_1_4; -} - -JNIEXPORT jboolean JNICALL -Java_org_webrtc_voiceengine_test_AudioDeviceAndroidTest_NativeInit(JNIEnv * env, - jclass) -{ - // Look up and cache any interesting class, field and method IDs for - // any used java class here - - return true; -} - -JNIEXPORT jint JNICALL -Java_org_webrtc_voiceengine_test_AudioDeviceAndroidTest_RunTest(JNIEnv *env, - jobject context, - jint test) -{ - // Set instance independent Java objects - webrtc::AudioDeviceModule::SetAndroidObjects(admData.jvm, env, context); - - // Start test - if (0 == test) - { - api_test(); - } - else - { - func_test(test); - } - - // Clear instance independent Java objects - webrtc::AudioDeviceModule::SetAndroidObjects(NULL, NULL, NULL); - - return 0; -} diff --git a/webrtc/modules/audio_device/test/android/audio_device_android_test/jni/org_webrtc_voiceengine_test_AudioDeviceAndroidTest.h b/webrtc/modules/audio_device/test/android/audio_device_android_test/jni/org_webrtc_voiceengine_test_AudioDeviceAndroidTest.h deleted file mode 100644 index 5cbc56fb8..000000000 --- a/webrtc/modules/audio_device/test/android/audio_device_android_test/jni/org_webrtc_voiceengine_test_AudioDeviceAndroidTest.h +++ /dev/null @@ -1,29 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_webrtc_voiceengine_test_AudioDeviceAndroidTest */ - -#ifndef _Included_org_webrtc_voiceengine_test_AudioDeviceAndroidTest -#define _Included_org_webrtc_voiceengine_test_AudioDeviceAndroidTest -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_webrtc_voiceengine_test_AudioDeviceAndroidTest - * Method: NativeInit - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_org_webrtc_voiceengine_test_AudioDeviceAndroidTest_NativeInit - (JNIEnv *, jclass); - -/* - * Class: org_webrtc_voiceengine_test_AudioDeviceAndroidTest - * Method: RunTest - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_webrtc_voiceengine_test_AudioDeviceAndroidTest_RunTest - (JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWEConvergenceTest.cc b/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWEConvergenceTest.cc deleted file mode 100644 index 5040bea59..000000000 --- a/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWEConvergenceTest.cc +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWEConvergenceTest.h" - -#include -#include - -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/TestLoadGenerator.h" -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/TestSenderReceiver.h" -#include "webrtc/system_wrappers/interface/event_wrapper.h" -#include "webrtc/system_wrappers/interface/thread_wrapper.h" -#include "webrtc/system_wrappers/interface/tick_util.h" - - -BWEConvergenceTestUp::BWEConvergenceTestUp(std::string testName, int startRateKbps, int availBWkbps) -: -_availBWkbps(availBWkbps), -BWEOneWayTest(testName, startRateKbps) -{ -} - - -BWEConvergenceTestUp::~BWEConvergenceTestUp() -{ - if (_gen) - { - delete _gen; - _gen = NULL; - } -} - - -int BWEConvergenceTestUp::Init(std::string ip, uint16_t port) -{ - // create the load generator object - const int rtpSampleRate = 90000; - const int frameRate = 30; - const double spreadFactor = 0.2; - - if (_master) - { - _gen = new CBRFixFRGenerator(_sendrec, _startRateKbps, rtpSampleRate, frameRate, spreadFactor); - if (!_gen) - { - return (-1); - } - } - - return BWEOneWayTest::Init(ip, port); -} - - -bool BWEConvergenceTestUp::StoppingCriterionMaster() -{ - return ((_sendrec->BitrateSent() / 1000.0) > (0.9 * _availBWkbps)); -} diff --git a/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWEConvergenceTest.h b/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWEConvergenceTest.h deleted file mode 100644 index 9d5fea6b6..000000000 --- a/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWEConvergenceTest.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_BWECONVERGENCETEST_H_ -#define WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_BWECONVERGENCETEST_H_ - -#include - -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETestBase.h" -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/TestSenderReceiver.h" -#include "webrtc/typedefs.h" - -class BWEConvergenceTestUp : public BWEOneWayTest -{ -public: - BWEConvergenceTestUp(std::string testName, int startRateKbps, int availBWkbps); - virtual ~BWEConvergenceTestUp(); - - virtual int Init(std::string ip, uint16_t port); - -protected: - virtual bool StoppingCriterionMaster(); - -private: - int _availBWkbps; -}; - - -#endif // WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_BWECONVERGENCETEST_H_ diff --git a/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWEStabilityTest.cc b/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWEStabilityTest.cc deleted file mode 100644 index 21996cd63..000000000 --- a/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWEStabilityTest.cc +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWEStabilityTest.h" - -#include - -#include - -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/TestLoadGenerator.h" -#include "webrtc/system_wrappers/interface/critical_section_wrapper.h" -#include "webrtc/system_wrappers/interface/tick_util.h" - - -BWEStabilityTest::BWEStabilityTest(std::string testName, int rateKbps, int testDurationSeconds) -: -_testDurationSeconds(testDurationSeconds), -BWEOneWayTest(testName, rateKbps) -{ -} - - -BWEStabilityTest::~BWEStabilityTest() -{ - if (_gen) - { - delete _gen; - _gen = NULL; - } -} - - -int BWEStabilityTest::Init(std::string ip, uint16_t port) -{ - // create the load generator object - const int rtpSampleRate = 90000; - const int frameRate = 30; - const double spreadFactor = 0.2; - const double keyToDeltaRatio = 7; - const int keyFramePeriod = 300; - - if (_master) - { - _gen = new CBRFixFRGenerator(_sendrec, _startRateKbps, rtpSampleRate, frameRate, spreadFactor); - //_gen = new PeriodicKeyFixFRGenerator(_sendrec, _startRateKbps, rtpSampleRate, frameRate, - // spreadFactor, keyToDeltaRatio, keyFramePeriod); - if (!_gen) - { - return (-1); - } - - } - - return BWEOneWayTest::Init(ip, port); -} - - -void BWEStabilityTest::Report(std::fstream &log) -{ - // cannot report on a running test - if(_running) return; - - BWETest::Report(log); - - CriticalSectionScoped cs(_statCritSect); - - log << "Bitrate statistics\n"; - log << "\tAverage = " << _rateVecKbps.Mean() << " kbps\n"; - log << "\tMin = " << _rateVecKbps.Min() << " kbps\n"; - log << "\tMax = " << _rateVecKbps.Max() << " kbps\n"; - log << "\tStd = " << _rateVecKbps.Std() << " kbps\n"; - -} - - -bool BWEStabilityTest::StoppingCriterionMaster() -{ - return (TickTime::MillisecondTimestamp() - _startTimeMs >= _testDurationSeconds * 1000); -} diff --git a/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWEStabilityTest.h b/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWEStabilityTest.h deleted file mode 100644 index d5920dbad..000000000 --- a/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWEStabilityTest.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_BWESTABILITYTEST_H_ -#define WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_BWESTABILITYTEST_H_ - -#include - -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETestBase.h" -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/TestSenderReceiver.h" -#include "webrtc/typedefs.h" - -class BWEStabilityTest : public BWEOneWayTest -{ -public: - BWEStabilityTest(std::string testName, int rateKbps, int testDurationSeconds); - virtual ~BWEStabilityTest(); - - virtual int Init(std::string ip, uint16_t port); - virtual void Report(std::fstream &log); - -protected: - virtual bool StoppingCriterionMaster(); - -private: - int _testDurationSeconds; -}; - - -#endif // WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_BWESTABILITYTEST_H_ diff --git a/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETestBase.cc b/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETestBase.cc deleted file mode 100644 index bb67b0714..000000000 --- a/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETestBase.cc +++ /dev/null @@ -1,453 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETestBase.h" - -#include // sort -#include -#include -#include -#include - -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/TestLoadGenerator.h" -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/TestSenderReceiver.h" -#include "webrtc/system_wrappers/interface/critical_section_wrapper.h" -#include "webrtc/system_wrappers/interface/event_wrapper.h" -#include "webrtc/system_wrappers/interface/thread_wrapper.h" -#include "webrtc/system_wrappers/interface/tick_util.h" - - -double StatVec::Mean() -{ - double sum = 0; - - // sanity - if (size() <= 0) return (0); - - std::vector::iterator it; - for (it = begin(); it < end(); ++it) - { - sum += (*it); - } - - return (sum / size()); -} - -double StatVec::Variance() -{ - double sumSqaure = 0; - double sum = 0; - - std::vector::iterator it; - for (it = begin(); it < end(); ++it) - { - sum += (*it); - sumSqaure += (*it) * (*it); - } - - // Normalizes by N-1. This produces the best unbiased estimate of the - // variance if X is a sample from a normal distribution. - int M = static_cast (size() - 1); - - if (M > 0) - { - double var = (sumSqaure / M) - (sum / (M+1)) * (sum / M); - assert(var >= 0); - return (var); - } - else - { - return (0); - } -} - -double StatVec::Std() -{ - return (sqrt(Variance())); -} - -double StatVec::Max() -{ - // sanity - if (size() <= 0) return (0); - - std::vector::iterator it = begin(); - double maxVal = (*it); - ++it; - - for (; it < end(); ++it) - { - if ((*it) > maxVal) maxVal = (*it); - } - - return (maxVal); -} - -double StatVec::Min() -{ - // sanity - if (size() <= 0) return (0); - - std::vector::iterator it = begin(); - double minVal = (*it); - ++it; - - for (; it < end(); ++it) - { - if ((*it) < minVal) minVal = (*it); - } - - return (minVal); -} - -double StatVec::Median() -{ - double median; - - // sanity - if (size() <= 0) return (0); - - // sort the vector - sort(begin(), end()); - - if ((size() % 2) == 0) - { - // even size; use average of two center elements - median = (at(size()/2 - 1) + at(size()/2)) / 2.0; - } - else - { - // odd size; take center element - median = at(size()/2); - } - - return (median); -} - -double StatVec::Percentile(double p) -{ - // sanity - if (size() <= 0) return (0); - - // sort the vector - sort(begin(), end()); - - int rank = static_cast (((size() - 1) * p) / 100 + 0.5); // between 1 and size() - rank -= 1; // between 0 and size()-1 - - assert(rank >= 0); - assert(rank < static_cast(size())); - - return (at(rank)); -} - -void StatVec::Export(std::fstream &file, bool colVec /*= false*/) -{ - // sanity - if (size() <= 0) return; - - std::string separator; - if (colVec) separator = "\n"; - else separator = ", "; - - std::vector::iterator it = begin(); - file << (*it); - ++it; - - for (; it < end(); ++it) - { - file << separator << (*it); - } - - file << std::endl; -} - - -bool BWETestProcThreadFunction(void *obj) -{ - if (obj == NULL) - { - return false; - } - BWETest *theObj = static_cast(obj); - - theObj->ProcLoop(); - - theObj->Stop(); - - return(true); -} - - -BWETest::BWETest(std::string testName, int startRateKbps): -_testName(testName), -_startRateKbps(startRateKbps), -_master(false), -_sendrec(NULL), -_gen(NULL), -_initialized(false), -_started(false), -_running(false), -_eventPtr(NULL), -_procThread(NULL), -_startTimeMs(-1), -_stopTimeMs(-1), -_statCritSect(CriticalSectionWrapper::CreateCriticalSection()) -{ - _sendrec = new TestSenderReceiver(); -} - - -BWETest::~BWETest() -{ - if (_running) - { - Stop(); - } - - _statCritSect->Enter(); - delete &_statCritSect; - - if (_sendrec) - { - delete _sendrec; - _sendrec = NULL; - } -} - - -bool BWETest::SetMaster(bool isMaster /*= true*/) -{ - if (!_initialized) - { - // Can only set status before initializing. - _master = isMaster; - } - - return (_master); -} - - -int BWETest::Init(std::string ip, uint16_t port) -{ - if (_initialized) - { - // cannot init twice - return (-1); - } - - if (!_sendrec) - { - throw "SenderReceiver must be created"; - exit(1); - } - - if (_started) - { - // cannot init after start - return (-1); - } - - // initialize receiver port (for feedback) - _sendrec->InitReceiver(port); - - // initialize sender - _sendrec->SetLoadGenerator(_gen); - _sendrec->InitSender(_startRateKbps, ip.c_str(), port); - //_gen->Start(); - - _sendrec->SetCallback(this); - - _initialized = true; - - return 0; -} - - -bool BWETest::Start() -{ - if (!_initialized) - { - // must init first - return (false); - } - if (_started) - { - // already started, do nothing - return (true); - } - - if (_sendrec->Start() != 0) - { - // failed - return (false); - } - - if (_gen) - { - if (_gen->Start() != 0) - { - // failed - return (false); - } - } - - _eventPtr = EventWrapper::Create(); - - _startTimeMs = TickTime::MillisecondTimestamp(); - _started = true; - _running = true; - - return (true); -} - - -bool BWETest::Stop() -{ - if (_procThread) - { - _stopTimeMs = TickTime::MillisecondTimestamp(); - _procThread->SetNotAlive(); - _running = false; - _eventPtr->Set(); - - while (!_procThread->Stop()) - { - ; - } - - delete _procThread; - _procThread = NULL; - - } - - if (_eventPtr) - { - delete _eventPtr; - _eventPtr = NULL; - } - - _procThread = NULL; - - if(_gen) - { - _gen->Stop(); - } - - return(true); -} - - -bool BWETest::ProcLoop(void) -{ - bool receiving = false; - - // no critSect - while (_running) - { - - // check stopping criterions - if (_master && StoppingCriterionMaster()) - { - printf("StoppingCriterionMaster()\n"); - _stopTimeMs = TickTime::MillisecondTimestamp(); - _running = false; - } - else if (!_master && StoppingCriterionSlave()) - { - printf("StoppingCriterionSlave()\n"); - _running = false; - } - - // wait - _eventPtr->Wait(1000); // 1000 ms - - } - - return true; -} - - -void BWETest::Report(std::fstream &log) -{ - // cannot report on a running test - if(_running) return; - - CriticalSectionScoped cs(_statCritSect); - - log << "\n\n*** Test name = " << _testName << "\n"; - log << "Execution time = " << static_cast(_stopTimeMs - _startTimeMs) / 1000 << " s\n"; - log << "\n"; - log << "RTT statistics\n"; - log << "\tMin = " << _rttVecMs.Min() << " ms\n"; - log << "\tMax = " << _rttVecMs.Max() << " ms\n"; - log << "\n"; - log << "Loss statistics\n"; - log << "\tAverage = " << _lossVec.Mean() << "%\n"; - log << "\tMax = " << _lossVec.Max() << "%\n"; - - log << "\n" << "Rates" << "\n"; - _rateVecKbps.Export(log); - - log << "\n" << "RTT" << "\n"; - _rttVecMs.Export(log); - -} - - -// SenderReceiver callback -void BWETest::OnOnNetworkChanged(const uint32_t bitrateTargetBps, - const uint8_t fractionLost, - const uint16_t roundTripTimeMs, - const uint32_t jitterMS, - const uint16_t bwEstimateKbitMin, - const uint16_t bwEstimateKbitMax) -{ - CriticalSectionScoped cs(_statCritSect); - - // bitrate statistics - int32_t newBitrateKbps = bitrateTargetBps/1000; - - _rateVecKbps.push_back(newBitrateKbps); - _rttVecMs.push_back(roundTripTimeMs); - _lossVec.push_back(static_cast(fractionLost) / 255.0); -} - - -int BWEOneWayTest::Init(std::string ip, uint16_t port) -{ - - if (!_master) - { - // Use timeout stopping criterion by default for receiver - UseRecvTimeout(); - } - - return (BWETest::Init(ip, port)); - -} - - -bool BWEOneWayTest::Start() -{ - bool ret = BWETest::Start(); - - if (!_master) - { - // send one dummy RTP packet to enable RTT measurements - const uint8_t dummy = 0; - //_gen->sendPayload(TickTime::MillisecondTimestamp(), &dummy, 0); - _sendrec->SendOutgoingData( - static_cast(TickTime::MillisecondTimestamp()*90), - &dummy, 1, webrtc::kVideoFrameDelta); - } - - return ret; -} diff --git a/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETestBase.h b/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETestBase.h deleted file mode 100644 index 607eec477..000000000 --- a/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETestBase.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_BWETESTBASE_H_ -#define WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_BWETESTBASE_H_ - -#include -#include - -#include "webrtc/typedefs.h" - -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/TestSenderReceiver.h" - - -class StatVec : public std::vector -{ -public: - double Mean(); - double Variance(); - double Std(); - double Max(); - double Min(); - double Median(); - double Percentile(double p); // 0 <= p <= 100% - void Export(std::fstream &file, bool colVec = false); -}; - - -class BWETest : public SendRecCB -{ -public: - BWETest(std::string testName, int startRateKbps); - virtual ~BWETest(); - - bool SetMaster(bool isMaster = true); - void UseRecvTimeout() { _sendrec->SetPacketTimeout(1000); }; - virtual int Init(std::string ip, uint16_t port); - virtual bool Start(); - virtual bool Stop(); - bool ProcLoop(void); - virtual void Report(std::fstream &log); - std::string TestName() { return (_testName); }; - - // SenderReceiver callback - virtual void OnOnNetworkChanged(const uint32_t bitrateTargetBps, - const uint8_t fractionLost, - const uint16_t roundTripTimeMs, - const uint32_t jitterMS, - const uint16_t bwEstimateKbitMin, - const uint16_t bwEstimateKbitMax); - - -protected: - virtual bool StoppingCriterionMaster() = 0; - virtual bool StoppingCriterionSlave() { return (_sendrec->timeOutTriggered()); }; - - TestSenderReceiver * _sendrec; - TestLoadGenerator * _gen; - - std::string _testName; - int _startRateKbps; - bool _master; - bool _initialized; - bool _started; - bool _running; - EventWrapper *_eventPtr; - ThreadWrapper* _procThread; - int64_t _startTimeMs; - int64_t _stopTimeMs; - - // Statistics, protected by separate CritSect - CriticalSectionWrapper* _statCritSect; - StatVec _rateVecKbps; - StatVec _rttVecMs; - StatVec _lossVec; -}; - - -class BWEOneWayTest : public BWETest -{ -public: - BWEOneWayTest(std::string testName, int startRateKbps) : - BWETest(testName, startRateKbps) {}; - - virtual int Init(std::string ip, uint16_t port); - virtual bool Start(); - -protected: - virtual bool StoppingCriterionSlave() {return ( _sendrec->timeOutTriggered()); }; - -private: - -}; - -#endif // WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_BWETESTBASE_H_ diff --git a/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETester.cc b/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETester.cc deleted file mode 100644 index 28912726b..000000000 --- a/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETester.cc +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// BWETester.cpp : Defines the entry point for the console application. -// - -#include - -#include -#include -#include - -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWEConvergenceTest.h" -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWEStabilityTest.h" -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETwoWayLimitFinding.h" -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/MatlabPlot.h" -#include "webrtc/system_wrappers/interface/event_wrapper.h" -#include "webrtc/system_wrappers/interface/trace.h" - -#ifdef MATLAB -MatlabEngine eng; -#endif - -class testContainer -{ -public: - testContainer(BWETest *test, bool waitForKeyStroke, int delayStartSec, - std::string instruction) : - _test(test), - _waitMaster(waitForKeyStroke), - _waitSlave(waitForKeyStroke), - _delayMaster(delayStartSec), - _delaySlave(delayStartSec), - _instr(instruction) {}; - - testContainer(BWETest *test, - bool waitForKeyStrokeMaster, - bool waitForKeyStrokeSlave, - int delayStartSecMaster, - int delayStartSecSlave, - std::string instruction) : - _test(test), - _waitMaster(waitForKeyStrokeMaster), - _waitSlave(waitForKeyStrokeSlave), - _delayMaster(delayStartSecMaster), - _delaySlave(delayStartSecSlave), - _instr(instruction) {}; - - ~testContainer() { if(_test) delete _test; _test = NULL; }; - - BWETest *_test; - bool _waitMaster; - bool _waitSlave; - int _delayMaster; - int _delaySlave; - std::string _instr; -}; - -// This is were the test cases are created. -// Syntax: -// tests->push_back(new testContainer( -// new _BWETestConstructor_, // constructor for the test case -// _wait_, // wait for user key press before start -// _delay_, // delay test start (after a key press if enabled) -// "Intruction to user.")); // message to show in console before starting -// -// Or: -// tests->push_back(new testContainer( -// new _BWETestConstructor_, // constructor for the test case -// _waitMaster_, // master will wait for user key press before start -// _waitSlave_, // slave will wait for user key press before start -// _delayMaster_, // delay master test start (after a key press if enabled) -// _delaySlave_, // delay slave test start (after a key press if enabled) -// "Intruction to user.")); // message to show in console before starting -// -// Valid test cases are: -// BWEConvergenceTestUp -// BWEStabilityTest -// BWETwoWayLimitFinding - - -void PopulateTests(std::vector* tests, bool isMaster) -{ - tests->push_back(new testContainer( - new BWEStabilityTest("Stability", 400, 5*60), - true, true, - 0, 0, - "Set bandwidth limit to 512 kbps")); - - tests->push_back(new testContainer( - new BWEStabilityTest("Stability", 4000, 5*60), - true, true, - 0, 0, - "Set bandwidth limit to 5120 kbps")); - - tests->push_back(new testContainer( - new BWEStabilityTest("Stability", 400, 5*60), - true, true, - 0, 0, - "Set bandwidth limit to 512 kbps and a normal distributed delay\ - with mean 100 ms and std dev 15 ms")); - - tests->push_back(new testContainer( - new BWEConvergenceTestUp("Convergence 256->512", 256, 512), - true, - 0, - "Set bandwith limit to 512 kbps")); - - tests->push_back(new testContainer( - new BWEConvergenceTestUp("Convergence 1024->5120", 1024, 5120), - true, - 0, - "Set bandwith limit to 5120 kbps")); - - tests->push_back(new testContainer( - new BWETwoWayLimitFinding("Asymmetric limit finding {1024, 2048} kbps", - 500, 1024, - 500, 2048, - isMaster), - true, - 0, - "Set bandwith limit to {1024, 2048} kbps asymmetric")); - - tests->push_back(new testContainer( - new BWETwoWayLimitFinding("Symmetric limit finding {1024, 1024} kbps", - 500, 1024, - 500, 1024, - isMaster), - true, - 0, - "Set bandwith limit to 1024 kbps symmetric")); -} - - -int main(int argc, char* argv[]) -{ - - bool isMaster = false; - uint16_t port; - std::string ip; - std::fstream log; - log.open("TestLog.txt", std::fstream::out | std::fstream::app); - - log << "\n\nBWE TESTER\n"; - - time_t t = time(0); // get time now - struct tm * now = localtime( & t ); - log << (now->tm_year + 1900) << '-' - << (now->tm_mon + 1) << '-' - << now->tm_mday << " " - << now->tm_hour << ":" << now->tm_min - << "\n"; - - if (argc == 4) - { - // read IP - ip = argv[1]; - - // read port - port = atoi(argv[2]); - - // read master/slave - isMaster = (atoi(argv[3]) != 0); - - std::cout << "Destination: " << ip << "\n"; - log << "Destination: " << ip << "\n"; - std::cout << "Port: " << port << "\n"; - log << "Port: " << port << "\n"; - if (isMaster) - { - std::cout << "Master\n"; - log << "Master\n"; - } - else - { - std::cout << "Slave\n"; - log << "Slave\n"; - } - - } - else - { - printf("Usage\nBWETester dstIP port master\n"); - exit(1); - } - - std::vector tests; - PopulateTests(&tests, isMaster); - - int testIndex = 0; - EventWrapper* event = EventWrapper::Create(); - std::vector::iterator it; - for (it=tests.begin() ; it < tests.end(); it++) - { - ++testIndex; - - BWETest *theTest = (*it)->_test; - - if (theTest) - { - std::cout << "\nTest " << testIndex << ": " << theTest->TestName() << "\n"; - } - - // Print instructions - std::cout << "--> " << (*it)->_instr << std::endl; - - if ((isMaster && (*it)->_waitMaster) - || (!isMaster && (*it)->_waitSlave)) - { - // Wait for a key press - std::cout << "Press enter to start test\n"; - getc(stdin); - } - - if (isMaster) - { - if ((*it)->_delayMaster > 0) - { - // Wait - std::cout << "Test starting in " - << (*it)->_delayMaster - << " seconds" << std::endl; - event->Wait((*it)->_delayMaster * 1000); - } - } - else - { - if ((*it)->_delaySlave > 0) - { - // Wait - std::cout << "Test starting in " - << (*it)->_delaySlave - << " seconds" << std::endl; - event->Wait((*it)->_delaySlave * 1000); - } - } - - // Start execution - if (theTest) - { - theTest->SetMaster(isMaster); - if (theTest->Init(ip, port) != 0) - { - throw "Error initializing sender"; - exit (1); - } - - theTest->Start(); - theTest->ProcLoop(); - theTest->Stop(); - theTest->Report(log); - log << std::flush; - } - - delete (*it); // deletes the test too - } - delete event; - event = NULL; - - log.close(); - return (0); -} diff --git a/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETwoWayLimitFinding.cc b/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETwoWayLimitFinding.cc deleted file mode 100644 index 25480b59d..000000000 --- a/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETwoWayLimitFinding.cc +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETwoWayLimitFinding.h" -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/TestLoadGenerator.h" - - -BWETwoWayLimitFinding::BWETwoWayLimitFinding( - std::string testName, - int masterStartRateKbps, int masterAvailBWkbps, - int slaveStartRateKbps, int slaveAvailBWkbps, - bool isMaster /*= false*/) - : -BWETest(testName, (isMaster ? masterStartRateKbps : slaveStartRateKbps)), -_availBWkbps(isMaster ? masterAvailBWkbps : slaveAvailBWkbps), -_incomingAvailBWkbps(isMaster ? slaveAvailBWkbps : masterAvailBWkbps), -_forwLimitReached(false), -_revLimitReached(false) -{ - _master = isMaster; -} - - -BWETwoWayLimitFinding::~BWETwoWayLimitFinding() -{ - if (_gen) - { - delete _gen; - _gen = NULL; - } -} - - -int BWETwoWayLimitFinding::Init(std::string ip, uint16_t port) -{ - // create the load generator object - const int rtpSampleRate = 90000; - const int frameRate = 30; - const double spreadFactor = 0.2; - - _gen = new CBRFixFRGenerator(_sendrec, _startRateKbps, rtpSampleRate, frameRate, spreadFactor); - if (!_gen) - { - return (-1); - } - - if (!_master) UseRecvTimeout(); // slave shuts down when incoming stream dies - - return BWETest::Init(ip, port); -} - - -bool BWETwoWayLimitFinding::StoppingCriterionMaster() -{ - if ((_sendrec->BitrateSent() / 1000.0) > (0.95 * _availBWkbps)) - { - _forwLimitReached = true; - } - - int32_t revRateKbps = _sendrec->ReceiveBitrateKbps(); - if (revRateKbps > (0.95 * _incomingAvailBWkbps)) - { - _revLimitReached = true; - } - - return (_forwLimitReached && _revLimitReached); -} diff --git a/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETwoWayLimitFinding.h b/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETwoWayLimitFinding.h deleted file mode 100644 index 617b81ae0..000000000 --- a/webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETwoWayLimitFinding.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_BWETWOWAYLIMITFINDING_H_ -#define WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_BWETWOWAYLIMITFINDING_H_ - -#include "webrtc/modules/rtp_rtcp/test/BWEStandAlone/BWETestBase.h" - -class BWETwoWayLimitFinding : public BWETest -{ -public: - BWETwoWayLimitFinding(std::string testName, - int masterStartRateKbps, int masterAvailBWkbps, - int slaveStartRateKbps, int slaveAvailBWkbps, - bool isMaster = false); - - virtual ~BWETwoWayLimitFinding(); - - virtual int Init(std::string ip, uint16_t port); - -protected: - virtual bool StoppingCriterionMaster(); - //virtual bool StoppingCriterionSlave(); - -private: - int _availBWkbps; - int _incomingAvailBWkbps; - bool _forwLimitReached; - bool _revLimitReached; - -}; - - -#endif // WEBRTC_MODULES_RTP_RTCP_TEST_BWESTANDALONE_BWETWOWAYLIMITFINDING_H_ diff --git a/webrtc/modules/rtp_rtcp/test/testTMMBR/testTMMBR.cc b/webrtc/modules/rtp_rtcp/test/testTMMBR/testTMMBR.cc deleted file mode 100644 index cd78610b7..000000000 --- a/webrtc/modules/rtp_rtcp/test/testTMMBR/testTMMBR.cc +++ /dev/null @@ -1,1035 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include - -#include -#include - -#include - -#include "webrtc/common_types.h" -#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h" -#include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" -#include "webrtc/modules/rtp_rtcp/source/tmmbr_help.h" - -#define TEST_STR "Test TMMBR." -#define TEST_PASSED() std::cerr << TEST_STR << " : [OK]" << std::endl -#define PRINT_LINE std::cout << "------------------------------------------" << std::endl; - - -const int maxFileLen = 200; -uint8_t* dataFile[maxFileLen]; - - -struct InputSet -{ - uint32_t TMMBR; - uint32_t packetOH; - uint32_t SSRC; -}; - -const InputSet set0 = {220, 80, 11111}; // bitRate, packetOH, ssrc -const InputSet set1 = {180, 90, 22222}; -const InputSet set2 = {100, 210, 33333}; -const InputSet set3 = { 35, 40, 44444}; -const InputSet set4 = { 40, 60, 55555}; -const InputSet set4_1 = {100, 60, 55555}; -const InputSet set4_2 = { 10, 60, 55555}; -const InputSet set5 = {200, 40, 66666}; -const InputSet set00 = { 0, 40, 66666}; - -const int maxBitrate = 230; // if this is lower than max in the list above test should fail - -void Verify(TMMBRSet* boundingSet, int index, InputSet set) -{ - assert(boundingSet->ptrTmmbrSet[index] == set.TMMBR); - assert(boundingSet->ptrPacketOHSet[index] == set.packetOH); - assert(boundingSet->ptrSsrcSet[index] == set.SSRC); -}; - -int ParseRTCPPacket(const void *data, int len, TMMBRSet*& boundingSet) -{ - int numItems = -1; - RTCPUtility::RTCPParserV2 rtcpParser((const uint8_t*)data, len, true); - RTCPUtility::RTCPPacketTypes pktType = rtcpParser.Begin(); - while (pktType != RTCPUtility::kRtcpNotValidCode) - { - const RTCPUtility::RTCPPacket& rtcpPacket = rtcpParser.Packet(); - if (pktType == RTCPUtility::kRtcpRtpfbTmmbnCode) - { - assert(0 == rtcpPacket.TMMBN.SenderSSRC); - assert(0 == rtcpPacket.TMMBN.MediaSSRC); - numItems = 0; - } - if (pktType == RTCPUtility::kRtcpRtpfbTmmbnItemCode) - { - boundingSet->ptrTmmbrSet[numItems] = rtcpPacket.TMMBNItem.MaxTotalMediaBitRate; - boundingSet->ptrPacketOHSet[numItems] = rtcpPacket.TMMBNItem.MeasuredOverhead; - boundingSet->ptrSsrcSet[numItems] = rtcpPacket.TMMBNItem.SSRC; - ++numItems; - } - pktType = rtcpParser.Iterate(); - } - return numItems; -}; - -int32_t GetFile(char* fileName) -{ - if (!fileName[0]) - { - return 0; - } - - FILE* openFile = fopen(fileName, "rb"); - assert(openFile != NULL); - fseek(openFile, 0, SEEK_END); - int len = (int16_t)(ftell(openFile)); - rewind(openFile); - assert(len > 0 && len < maxFileLen); - fread(dataFile, 1, len, openFile); - fclose(openFile); - return len; -}; - - -class LoopBackTransport2 : public webrtc::Transport, private TMMBRHelp -{ -public: - LoopBackTransport2(RtpRtcp* rtpRtcpModule) : - TMMBRHelp(false), - _rtpRtcpModule(rtpRtcpModule), - _cnt(0) - { - } - virtual int SendPacket(int channel, const void *data, int len) - { - if( 0 == _rtpRtcpModule->IncomingPacket((const uint8_t*)data, len)) - { - return len; - } - return -1; - } - virtual int SendRTCPPacket(int channel, const void *data, int len) - { - char fileName[256] = {0}; - TMMBRSet* boundingSet = BoundingSet(); - boundingSet->VerifyAndAllocateSet(3); - - if (_cnt == 0) - { - // TMMBN {} - // TMMBN {} - // TMMBN {} - // TMMBN {2,4,0} -> {4,2} - assert(2 == ParseRTCPPacket(data, len, boundingSet)); - Verify(boundingSet, 0, set4); - Verify(boundingSet, 1, set2); - - strcpy(fileName, "RTCPPacketTMMBR3.bin"); - } - - ++_cnt; - - // Get stored rtcp packet w/ TMMBR - len = GetFile(fileName); - if (len == 0) - { - return 1; - } - - // Send in bitrate request - if(_rtpRtcpModule->IncomingPacket((const uint8_t*)dataFile, len) == 0) - { - return len; - } - return -1; - } - RtpRtcp* _rtpRtcpModule; - uint32_t _cnt; -}; - - -class LoopBackTransportVideo : public webrtc::Transport, private TMMBRHelp -{ -public: - LoopBackTransportVideo(RtpRtcp* rtpRtcpModule) : - TMMBRHelp(false), - _rtpRtcpModule(rtpRtcpModule), - _cnt(0) - { - } - virtual int SendPacket(int channel, const void *data, int len) - { - if(_rtpRtcpModule->IncomingPacket((const uint8_t*)data, len)== 0) - { - return len; - } - return -1; - } - virtual int SendRTCPPacket(int channel, const void *data, int len) - { - char fileName[256] = {0}; - TMMBRSet* boundingSet = BoundingSet(); - boundingSet->VerifyAndAllocateSet(3); - - if (_cnt == 0) - { - strcpy(fileName, "RTCPPacketTMMBR0.bin"); - } - else if (_cnt == 1) - { - // TMMBN {0} -> {0} - assert(1 == ParseRTCPPacket(data, len, boundingSet)); - Verify(boundingSet, 0, set0); - - strcpy(fileName, "RTCPPacketTMMBR1.bin"); - } - else if (_cnt == 2) - { - // TMMBN {0,1} -> {1} - assert(1 == ParseRTCPPacket(data, len, boundingSet)); - Verify(boundingSet, 0, set1); - - strcpy(fileName, "RTCPPacketTMMBR2.bin"); - } - else if (_cnt == 3) - { - // TMMBN {0,1,2} -> {2} - assert(1 == ParseRTCPPacket(data, len, boundingSet)); - Verify(boundingSet, 0, set2); - - strcpy(fileName, "RTCPPacketTMMBR3.bin"); - } - else if (_cnt == 4) - { - // TMMBN {0,1,2,3} -> {3,2} - assert(2 == ParseRTCPPacket(data, len, boundingSet)); - Verify(boundingSet, 0, set3); - Verify(boundingSet, 1, set2); - - strcpy(fileName, "RTCPPacketTMMBR4.bin"); - } - else if (_cnt == 5) - { - // TMMBN {0,1,2,3,4} -> {3,4,2} - assert(3 == ParseRTCPPacket(data, len, boundingSet)); - Verify(boundingSet, 0, set3); - Verify(boundingSet, 1, set4); - Verify(boundingSet, 2, set2); - - strcpy(fileName, "RTCPPacketTMMBR5.bin"); - } - else if (_cnt == 6) - { - // TMMBN {0,1,2,3,4,5} -> {3,4,2} - assert(3 == ParseRTCPPacket(data, len, boundingSet)); - Verify(boundingSet, 0, set3); - Verify(boundingSet, 1, set4); - Verify(boundingSet, 2, set2); - - strcpy(fileName, "RTCPPacketTMMBR4_2.bin"); - } - else if (_cnt == 7) - { - // TMMBN {0,1,2,3,4_2,5} -> {4_2} - assert(1 == ParseRTCPPacket(data, len, boundingSet)); - Verify(boundingSet, 0, set4_2); - - ++_cnt; - ::Sleep(5*RTCP_INTERVAL_AUDIO_MS + 1000); // time out receiver - _rtpRtcpModule->Process(); // SendRTCP() (_cnt == 8) - // a receiver has timed out -> UpdateTMMBR() - } - else if (_cnt == 8) - { - // No TMMBN in this packet - assert(-1 == ParseRTCPPacket(data, len, boundingSet)); - } - else if (_cnt == 10) - { - // TMMBN {} -> {}, empty set - assert(0 == ParseRTCPPacket(data, len, boundingSet)); - - strcpy(fileName, "RTCPPacketTMMBR2.bin"); - } - else if (_cnt == 11) - { - // TMMBN {2} -> {2} - assert(1 == ParseRTCPPacket(data, len, boundingSet)); - Verify(boundingSet, 0, set2); - } - else if (_cnt == 12) // ----- multi module ------------- - { - // No TMMBN in this packet - assert(-1 == ParseRTCPPacket(data, len, boundingSet)); - - strcpy(fileName, "RTCPPacketTMMBR4.bin"); - } - else if (_cnt == 13) - { - // TMMBN {} - // TMMBN {} - // TMMBN {} - // TMMBN {2,4} -> {4,2} - assert(2 == ParseRTCPPacket(data, len, boundingSet)); - Verify(boundingSet, 0, set4); - Verify(boundingSet, 1, set2); - - strcpy(fileName, "RTCPPacketTMMBR0.bin"); - } - else if (_cnt == 14) - { - // TMMBN {} - // TMMBN {3} - // TMMBN {} - // TMMBN {2,4,0} -> {3,4,2} - assert(3 == ParseRTCPPacket(data, len, boundingSet)); - Verify(boundingSet, 0, set3); - Verify(boundingSet, 1, set4); - Verify(boundingSet, 2, set2); - - strcpy(fileName, "RTCPPacketTMMBR1.bin"); - } - //else if (_cnt == 15) - //{ - // // TMMBN {} - // // TMMBN {} - // // TMMBN {} - // // TMMBN {2,4,0,1} -> {4,2} - // //assert(2 == ParseRTCPPacket(data, len, boundingSet)); - // //Verify(boundingSet, 0, set4); - // //Verify(boundingSet, 1, set2); - //} - //else if (_cnt == 15) - //{ - // // No TMMBN in this packet - // assert(-1 == ParseRTCPPacket(data, len, boundingSet)); - //} - else if (_cnt == 15) - { - // TMMBN {} - // TMMBN {} - // TMMBN {} - // TMMBN {} -> {}, empty set - assert(0 == ParseRTCPPacket(data, len, boundingSet)); - } - - ++_cnt; - - // Get stored rtcp packet w/ TMMBR - len = GetFile(fileName); - if (len == 0) - { - return 1; - } - - // Send in bitrate request - if( 0 == _rtpRtcpModule->IncomingPacket((const uint8_t*)dataFile, len)) - { - return len; - } - return -1; - } - - RtpRtcp* _rtpRtcpModule; - uint32_t _cnt; -}; - -class TestTMMBR : private TMMBRHelp -{ -public: - TestTMMBR() : TMMBRHelp(false) {}; - - void Add(TMMBRSet* candidateSet, int index, InputSet set) - { - candidateSet->ptrTmmbrSet[index] = set.TMMBR; - candidateSet->ptrPacketOHSet[index] = set.packetOH; - candidateSet->ptrSsrcSet[index] = set.SSRC; - }; - - void Start() - { - // Get sets - TMMBRSet* candidateSet = CandidateSet(); - assert(0 == candidateSet->sizeOfSet); - TMMBRSet* boundingSet = BoundingSet(); - assert(0 == boundingSet->sizeOfSet); - TMMBRSet* boundingSetToSend = BoundingSetToSend(); - assert(0 == boundingSetToSend->sizeOfSet); - - int32_t numBoundingSet = FindTMMBRBoundingSet(boundingSet); - assert(0 == numBoundingSet); // should be empty - - assert( 0 == SetTMMBRBoundingSetToSend(NULL,0)); // ok to send empty set - assert( 0 == SetTMMBRBoundingSetToSend(boundingSet,0)); // ok to send empty set - - uint32_t minBitrateKbit = 0; - uint32_t maxBitrateKbit = 0; - assert(-1 == CalcMinMaxBitRate(0, 0, 1, false, minBitrateKbit, maxBitrateKbit)); // no bounding set - - // --------------------------------- - // Test candidate set {0} -> {0} - // --------------------------------- - candidateSet = VerifyAndAllocateCandidateSet(1); - assert(1 == candidateSet->sizeOfSet); - Add(candidateSet, 0, set0); - - // Find bounding set - numBoundingSet = FindTMMBRBoundingSet(boundingSet); - assert(1 == numBoundingSet); - Verify(boundingSet, 0, set0); - - // Is owner of set - assert(!IsOwner(set0.SSRC, 0)); // incorrect length - assert(!IsOwner(set1.SSRC, 100)); // incorrect length - - assert( IsOwner(set0.SSRC, numBoundingSet)); - assert(!IsOwner(set1.SSRC, numBoundingSet)); - assert(!IsOwner(set2.SSRC, numBoundingSet)); - - // Set boundingSet to send - assert(0 == SetTMMBRBoundingSetToSend(boundingSet, maxBitrate)); - - // Get boundingSet to send - boundingSetToSend = BoundingSetToSend(); - assert(boundingSetToSend->sizeOfSet == numBoundingSet); - Verify(boundingSetToSend, 0, set0); - - // Get net bitrate depending on packet rate - assert( 0 == CalcMinMaxBitRate(0, numBoundingSet, false,0, minBitrateKbit, maxBitrateKbit)); - assert(set0.TMMBR == minBitrateKbit); - assert(set0.TMMBR == maxBitrateKbit); - assert(0 == CalcMinMaxBitRate(0, 100, false,0, minBitrateKbit, maxBitrateKbit)); // incorrect length - assert(set0.TMMBR == minBitrateKbit); - assert(set0.TMMBR == maxBitrateKbit); - - // --------------------------------- - // Test candidate set {0,1} -> {1} - // --------------------------------- - candidateSet = VerifyAndAllocateCandidateSet(2); - assert(2 == candidateSet->sizeOfSet); - Add(candidateSet, 0, set0); - Add(candidateSet, 1, set1); - - // Find bounding set - numBoundingSet = FindTMMBRBoundingSet(boundingSet); - assert(1 == numBoundingSet); - Verify(boundingSet, 0, set1); - - // Is owner of set - assert(!IsOwner(set0.SSRC, numBoundingSet)); - assert( IsOwner(set1.SSRC, numBoundingSet)); - assert(!IsOwner(set2.SSRC, numBoundingSet)); - - // Set boundingSet to send - assert(0 == SetTMMBRBoundingSetToSend(boundingSet, maxBitrate)); - - // Get boundingSet to send - boundingSetToSend = BoundingSetToSend(); - assert(boundingSetToSend->sizeOfSet == numBoundingSet); - Verify(boundingSetToSend, 0, set1); - - // Get net bitrate depending on packet rate - assert(0 == CalcMinMaxBitRate(0, numBoundingSet, true,0, minBitrateKbit, maxBitrateKbit)); - assert(set1.TMMBR == minBitrateKbit); - assert(set0.TMMBR == maxBitrateKbit); - - // --------------------------------- - // Test candidate set {0,1,2} -> {2} - // --------------------------------- - candidateSet = VerifyAndAllocateCandidateSet(3); - assert(3 == candidateSet->sizeOfSet); - Add(candidateSet, 0, set0); - Add(candidateSet, 1, set1); - Add(candidateSet, 2, set2); - - // Find bounding set - numBoundingSet = FindTMMBRBoundingSet(boundingSet); - assert(1 == numBoundingSet); - Verify(boundingSet, 0, set2); - - // Is owner of set - assert(!IsOwner(set0.SSRC, numBoundingSet)); - assert(!IsOwner(set1.SSRC, numBoundingSet)); - assert( IsOwner(set2.SSRC, numBoundingSet)); - - // Set boundingSet to send - assert(0 == SetTMMBRBoundingSetToSend(boundingSet, maxBitrate)); - - // Get boundingSet to send - boundingSetToSend = BoundingSetToSend(); - assert(boundingSetToSend->sizeOfSet == numBoundingSet); - Verify(boundingSetToSend, 0, set2); - - // Get net bitrate depending on packet rate - assert(0 == CalcMinMaxBitRate(0, numBoundingSet, true,0, minBitrateKbit, maxBitrateKbit)); - assert(set2.TMMBR == minBitrateKbit); - assert(set0.TMMBR == maxBitrateKbit); - - // --------------------------------- - // Test candidate set {0,1,2,3} -> {3,2} - // --------------------------------- - candidateSet = VerifyAndAllocateCandidateSet(4); - assert(4 == candidateSet->sizeOfSet); - Add(candidateSet, 0, set0); - Add(candidateSet, 1, set1); - Add(candidateSet, 2, set2); - Add(candidateSet, 3, set3); - - // Find bounding set - numBoundingSet = FindTMMBRBoundingSet(boundingSet); - assert(2 == numBoundingSet); - Verify(boundingSet, 0, set3); - Verify(boundingSet, 1, set2); - - // Is owner of set - assert(!IsOwner(set0.SSRC, numBoundingSet)); - assert(!IsOwner(set1.SSRC, numBoundingSet)); - assert( IsOwner(set2.SSRC, numBoundingSet)); - assert( IsOwner(set3.SSRC, numBoundingSet)); - - // Set boundingSet to send - assert(0 == SetTMMBRBoundingSetToSend(boundingSet, maxBitrate)); - - // Get boundingSet to send - boundingSetToSend = BoundingSetToSend(); - assert(boundingSetToSend->sizeOfSet == numBoundingSet); - Verify(boundingSetToSend, 0, set3); - Verify(boundingSetToSend, 1, set2); - - // Get net bitrate depending on packet rate - assert(0 == CalcMinMaxBitRate(0, numBoundingSet, true,0, minBitrateKbit, maxBitrateKbit)); - assert(set3.TMMBR == minBitrateKbit); - assert(set0.TMMBR == maxBitrateKbit); - - // --------------------------------- - // Test candidate set {0,1,2,3,4} -> {3,4,2} - // --------------------------------- - candidateSet = VerifyAndAllocateCandidateSet(5); - assert(5 == candidateSet->sizeOfSet); - Add(candidateSet, 0, set0); - Add(candidateSet, 1, set1); - Add(candidateSet, 2, set2); - Add(candidateSet, 3, set3); - Add(candidateSet, 4, set4); - - // Find bounding set - numBoundingSet = FindTMMBRBoundingSet(boundingSet); - assert(3 == numBoundingSet); - Verify(boundingSet, 0, set3); - Verify(boundingSet, 1, set4); - Verify(boundingSet, 2, set2); - - // Is owner of set - assert(!IsOwner(set0.SSRC, numBoundingSet)); - assert(!IsOwner(set1.SSRC, numBoundingSet)); - assert( IsOwner(set2.SSRC, numBoundingSet)); - assert( IsOwner(set3.SSRC, numBoundingSet)); - assert( IsOwner(set4.SSRC, numBoundingSet)); - - // Set boundingSet to send - assert(0 == SetTMMBRBoundingSetToSend(boundingSet, maxBitrate)); - - // Get boundingSet to send - boundingSetToSend = BoundingSetToSend(); - assert(boundingSetToSend->sizeOfSet == numBoundingSet); - Verify(boundingSetToSend, 0, set3); - Verify(boundingSetToSend, 1, set4); - Verify(boundingSetToSend, 2, set2); - - // Get net bitrate depending on packet rate - assert(0 == CalcMinMaxBitRate(0,numBoundingSet, true,0, minBitrateKbit, maxBitrateKbit)); - assert(set3.TMMBR == minBitrateKbit); - assert(set0.TMMBR == maxBitrateKbit); - - // --------------------------------- - // Test candidate set {0,1,2,3,4,5} -> {3,4,2} - // --------------------------------- - candidateSet = VerifyAndAllocateCandidateSet(6); - assert(6 == candidateSet->sizeOfSet); - Add(candidateSet, 0, set0); - Add(candidateSet, 1, set1); - Add(candidateSet, 2, set2); - Add(candidateSet, 3, set3); - Add(candidateSet, 4, set4); - Add(candidateSet, 5, set5); - - // Find bounding set - numBoundingSet = FindTMMBRBoundingSet(boundingSet); - assert(3 == numBoundingSet); - Verify(boundingSet, 0, set3); - Verify(boundingSet, 1, set4); - Verify(boundingSet, 2, set2); - - // Is owner of set - assert(!IsOwner(set0.SSRC, numBoundingSet)); - assert(!IsOwner(set1.SSRC, numBoundingSet)); - assert( IsOwner(set2.SSRC, numBoundingSet)); - assert( IsOwner(set3.SSRC, numBoundingSet)); - assert( IsOwner(set4.SSRC, numBoundingSet)); - assert(!IsOwner(set5.SSRC, numBoundingSet)); - - // Set boundingSet to send - assert(0 == SetTMMBRBoundingSetToSend(boundingSet, maxBitrate)); - - // Get boundingSet to send - boundingSetToSend = BoundingSetToSend(); - assert(boundingSetToSend->sizeOfSet == numBoundingSet); - Verify(boundingSetToSend, 0, set3); - Verify(boundingSetToSend, 1, set4); - Verify(boundingSetToSend, 2, set2); - - // Get net bitrate depending on packet rate - assert(0 == CalcMinMaxBitRate(0,numBoundingSet, true,0, minBitrateKbit, maxBitrateKbit)); - assert(set3.TMMBR == minBitrateKbit); - assert(set0.TMMBR == maxBitrateKbit); - - - // --------------------------------- - // Test candidate set {1,2,3,4,5} -> {3,4,2} - // --------------------------------- - candidateSet = VerifyAndAllocateCandidateSet(5); - assert(6 == candidateSet->sizeOfSet); - Add(candidateSet, 0, set1); - Add(candidateSet, 1, set2); - Add(candidateSet, 2, set3); - Add(candidateSet, 3, set4); - Add(candidateSet, 4, set5); - - // Find bounding set - numBoundingSet = FindTMMBRBoundingSet(boundingSet); - assert(3 == numBoundingSet); - Verify(boundingSet, 0, set3); - Verify(boundingSet, 1, set4); - Verify(boundingSet, 2, set2); - - // Is owner of set - assert(!IsOwner(set0.SSRC, numBoundingSet)); - assert(!IsOwner(set1.SSRC, numBoundingSet)); - assert( IsOwner(set2.SSRC, numBoundingSet)); - assert( IsOwner(set3.SSRC, numBoundingSet)); - assert( IsOwner(set4.SSRC, numBoundingSet)); - assert(!IsOwner(set5.SSRC, numBoundingSet)); - - // Set boundingSet to send - assert(0 == SetTMMBRBoundingSetToSend(boundingSet, maxBitrate)); - - // Get boundingSet to send - boundingSetToSend = BoundingSetToSend(); - assert(boundingSetToSend->sizeOfSet == numBoundingSet); - Verify(boundingSetToSend, 0, set3); - Verify(boundingSetToSend, 1, set4); - Verify(boundingSetToSend, 2, set2); - - // Get net bitrate depending on packet rate - assert(0 == CalcMinMaxBitRate(0,numBoundingSet, true,0, minBitrateKbit, maxBitrateKbit)); - assert(set3.TMMBR == minBitrateKbit); - assert(set5.TMMBR == maxBitrateKbit); - - - // --------------------------------- - // Test candidate set {1,3,4,5} -> {3,4} - // --------------------------------- - candidateSet = VerifyAndAllocateCandidateSet(4); - assert(6 == candidateSet->sizeOfSet); - Add(candidateSet, 0, set1); - Add(candidateSet, 1, set3); - Add(candidateSet, 2, set4); - Add(candidateSet, 3, set5); - - // Find bounding set - numBoundingSet = FindTMMBRBoundingSet(boundingSet); - assert(2 == numBoundingSet); - Verify(boundingSet, 0, set3); - Verify(boundingSet, 1, set4); - - // Is owner of set - assert(!IsOwner(set0.SSRC, numBoundingSet)); - assert(!IsOwner(set1.SSRC, numBoundingSet)); - assert(!IsOwner(set2.SSRC, numBoundingSet)); - assert( IsOwner(set3.SSRC, numBoundingSet)); - assert( IsOwner(set4.SSRC, numBoundingSet)); - assert(!IsOwner(set5.SSRC, numBoundingSet)); - - // Set boundingSet to send - assert(0 == SetTMMBRBoundingSetToSend(boundingSet, maxBitrate)); - - // Get boundingSet to send - boundingSetToSend = BoundingSetToSend(); - Verify(boundingSetToSend, 0, set3); - Verify(boundingSetToSend, 1, set4); - - // Get net bitrate depending on packet rate - assert(0 == CalcMinMaxBitRate(0, numBoundingSet,true,0, minBitrateKbit, maxBitrateKbit)); - assert(set3.TMMBR == minBitrateKbit); - assert(set5.TMMBR == maxBitrateKbit); - - // --------------------------------- - // Test candidate set {1,2,4,5} -> {4,2} - // --------------------------------- - candidateSet = VerifyAndAllocateCandidateSet(4); - assert(6 == candidateSet->sizeOfSet); - Add(candidateSet, 0, set1); - Add(candidateSet, 1, set2); - Add(candidateSet, 2, set4); - Add(candidateSet, 3, set5); - - // Find bounding set - numBoundingSet = FindTMMBRBoundingSet(boundingSet); - assert(2 == numBoundingSet); - Verify(boundingSet, 0, set4); - Verify(boundingSet, 1, set2); - - // Is owner of set - assert(!IsOwner(set0.SSRC, numBoundingSet)); - assert(!IsOwner(set1.SSRC, numBoundingSet)); - assert( IsOwner(set2.SSRC, numBoundingSet)); - assert(!IsOwner(set3.SSRC, numBoundingSet)); - assert( IsOwner(set4.SSRC, numBoundingSet)); - assert(!IsOwner(set5.SSRC, numBoundingSet)); - - // Set boundingSet to send - assert(0 == SetTMMBRBoundingSetToSend(boundingSet, maxBitrate)); - - // Get boundingSet to send - boundingSetToSend = BoundingSetToSend(); - Verify(boundingSetToSend, 0, set4); - Verify(boundingSetToSend, 1, set2); - - // Get net bitrate depending on packet rate - assert(0 == CalcMinMaxBitRate(0, numBoundingSet, true,0, minBitrateKbit, maxBitrateKbit)); - assert(set4.TMMBR == minBitrateKbit); - assert(set5.TMMBR == maxBitrateKbit); - - // --------------------------------- - // Test candidate set {1,2,3,5} -> {3,2} - // --------------------------------- - candidateSet = VerifyAndAllocateCandidateSet(4); - assert(6 == candidateSet->sizeOfSet); - Add(candidateSet, 0, set1); - Add(candidateSet, 1, set2); - Add(candidateSet, 2, set3); - Add(candidateSet, 3, set5); - - // Find bounding set - numBoundingSet = FindTMMBRBoundingSet(boundingSet); - assert(2 == numBoundingSet); - Verify(boundingSet, 0, set3); - Verify(boundingSet, 1, set2); - - // Is owner of set - assert(!IsOwner(set0.SSRC, numBoundingSet)); - assert(!IsOwner(set1.SSRC, numBoundingSet)); - assert( IsOwner(set2.SSRC, numBoundingSet)); - assert( IsOwner(set3.SSRC, numBoundingSet)); - assert(!IsOwner(set4.SSRC, numBoundingSet)); - assert(!IsOwner(set5.SSRC, numBoundingSet)); - - // Set boundingSet to send - assert(0 == SetTMMBRBoundingSetToSend(boundingSet, maxBitrate)); - - // Get boundingSet to send - boundingSetToSend = BoundingSetToSend(); - Verify(boundingSetToSend, 0, set3); - Verify(boundingSetToSend, 1, set2); - - // Get net bitrate depending on packet rate - assert(0 == CalcMinMaxBitRate(0, numBoundingSet, true,0, minBitrateKbit, maxBitrateKbit)); - assert(set3.TMMBR == minBitrateKbit); - assert(set5.TMMBR == maxBitrateKbit); - - // --------------------------------- - // Test candidate set {1,2,3,4_1,5} -> {3,2} - // --------------------------------- - candidateSet = VerifyAndAllocateCandidateSet(5); - assert(6 == candidateSet->sizeOfSet); - Add(candidateSet, 0, set1); - Add(candidateSet, 1, set2); - Add(candidateSet, 2, set3); - Add(candidateSet, 3, set4_1); - Add(candidateSet, 4, set5); - - // Find bounding set - numBoundingSet = FindTMMBRBoundingSet(boundingSet); - assert(2 == numBoundingSet); - Verify(boundingSet, 0, set3); - Verify(boundingSet, 1, set2); - - // Is owner of set - assert(!IsOwner(set0.SSRC, numBoundingSet)); - assert(!IsOwner(set1.SSRC, numBoundingSet)); - assert( IsOwner(set2.SSRC, numBoundingSet)); - assert( IsOwner(set3.SSRC, numBoundingSet)); - assert(!IsOwner(set4.SSRC, numBoundingSet)); - assert(!IsOwner(set5.SSRC, numBoundingSet)); - - // Set boundingSet to send - assert(0 == SetTMMBRBoundingSetToSend(boundingSet, maxBitrate)); - - // Get boundingSet to send - boundingSetToSend = BoundingSetToSend(); - Verify(boundingSetToSend, 0, set3); - Verify(boundingSetToSend, 1, set2); - - // Get net bitrate depending on packet rate - assert(0 == CalcMinMaxBitRate(0, numBoundingSet, true,0, minBitrateKbit, maxBitrateKbit)); - assert(set3.TMMBR == minBitrateKbit); - assert(set5.TMMBR == maxBitrateKbit); - - // --------------------------------- - // Test candidate set {1,2,3,4_2,5} -> {4_2} - // --------------------------------- - candidateSet = VerifyAndAllocateCandidateSet(5); - assert(6 == candidateSet->sizeOfSet); - Add(candidateSet, 0, set1); - Add(candidateSet, 1, set2); - Add(candidateSet, 2, set3); - Add(candidateSet, 3, set4_2); - Add(candidateSet, 4, set5); - - // Find bounding set - numBoundingSet = FindTMMBRBoundingSet(boundingSet); - assert(1 == numBoundingSet); - Verify(boundingSet, 0, set4_2); - - // Is owner of set - assert(!IsOwner(set0.SSRC, numBoundingSet)); - assert(!IsOwner(set1.SSRC, numBoundingSet)); - assert(!IsOwner(set2.SSRC, numBoundingSet)); - assert(!IsOwner(set3.SSRC, numBoundingSet)); - assert( IsOwner(set4.SSRC, numBoundingSet)); - assert(!IsOwner(set5.SSRC, numBoundingSet)); - - // Set boundingSet to send - assert(0 == SetTMMBRBoundingSetToSend(boundingSet, maxBitrate)); - - // Get boundingSet to send - boundingSetToSend = BoundingSetToSend(); - Verify(boundingSetToSend, 0, set4_2); - - // Get net bitrate depending on packet rate - assert(0 == CalcMinMaxBitRate(0, numBoundingSet, true,0, minBitrateKbit, maxBitrateKbit)); - assert(MIN_VIDEO_BW_MANAGEMENT_BITRATE == minBitrateKbit); - assert(set5.TMMBR == maxBitrateKbit); - - // --------------------------------- - // Test candidate set {} -> {} - // --------------------------------- - candidateSet = VerifyAndAllocateCandidateSet(0); - assert(6 == candidateSet->sizeOfSet); - - // Find bounding set - numBoundingSet = FindTMMBRBoundingSet(boundingSet); - assert(0 == numBoundingSet); - - // Is owner of set - assert(!IsOwner(set0.SSRC, numBoundingSet)); - assert(!IsOwner(set1.SSRC, numBoundingSet)); - assert(!IsOwner(set2.SSRC, numBoundingSet)); - assert(!IsOwner(set3.SSRC, numBoundingSet)); - assert(!IsOwner(set4.SSRC, numBoundingSet)); - assert(!IsOwner(set5.SSRC, numBoundingSet)); - - // Set boundingSet to send - assert(0 == SetTMMBRBoundingSetToSend(boundingSet, maxBitrate)); - - // Get boundingSet to send - boundingSetToSend = BoundingSetToSend(); - - // Get net bitrate depending on packet rate - assert(-1 == CalcMinMaxBitRate(0,numBoundingSet, true,0, minBitrateKbit, maxBitrateKbit)); - - // --------------------------------- - // Test candidate set {x0,5} -> {5} - // --------------------------------- - candidateSet = VerifyAndAllocateCandidateSet(2); - assert(6 == candidateSet->sizeOfSet); - Add(candidateSet, 0, set00); - Add(candidateSet, 1, set5); - - // Find bounding set - numBoundingSet = FindTMMBRBoundingSet(boundingSet); - assert(1 == numBoundingSet); - Verify(boundingSet, 0, set5); - - // Is owner of set - assert(!IsOwner(set0.SSRC, numBoundingSet)); - assert(!IsOwner(set1.SSRC, numBoundingSet)); - assert(!IsOwner(set2.SSRC, numBoundingSet)); - assert(!IsOwner(set3.SSRC, numBoundingSet)); - assert(!IsOwner(set4.SSRC, numBoundingSet)); - assert( IsOwner(set5.SSRC, numBoundingSet)); - - // Set boundingSet to send - assert(0 == SetTMMBRBoundingSetToSend(boundingSet, maxBitrate)); - - // Get boundingSet to send - boundingSetToSend = BoundingSetToSend(); - Verify(boundingSetToSend, 0, set5); - - // Get net bitrate depending on packet rate - assert(0 == CalcMinMaxBitRate(0,numBoundingSet, true,0, minBitrateKbit, maxBitrateKbit)); - assert(set5.TMMBR == minBitrateKbit); - assert(set5.TMMBR == maxBitrateKbit); - - // --------------------------------- - // Test candidate set {x0,4,2} -> {4,2} - // --------------------------------- - candidateSet = VerifyAndAllocateCandidateSet(3); - assert(6 == candidateSet->sizeOfSet); - Add(candidateSet, 0, set00); - Add(candidateSet, 1, set4); - Add(candidateSet, 2, set2); - - // Find bounding set - numBoundingSet = FindTMMBRBoundingSet(boundingSet); - assert(2 == numBoundingSet); - Verify(boundingSet, 0, set4); - Verify(boundingSet, 1, set2); - - // Is owner of set - assert(!IsOwner(set0.SSRC, numBoundingSet)); - assert(!IsOwner(set1.SSRC, numBoundingSet)); - assert( IsOwner(set2.SSRC, numBoundingSet)); - assert(!IsOwner(set3.SSRC, numBoundingSet)); - assert( IsOwner(set4.SSRC, numBoundingSet)); - assert(!IsOwner(set5.SSRC, numBoundingSet)); - - // Set boundingSet to send - assert(0 == SetTMMBRBoundingSetToSend(boundingSet, maxBitrate)); - - // Get boundingSet to send - boundingSetToSend = BoundingSetToSend(); - Verify(boundingSetToSend, 0, set4); - Verify(boundingSetToSend, 1, set2); - - // Get net bitrate depending on packet rate - assert(0 == CalcMinMaxBitRate(0,numBoundingSet, true,0, minBitrateKbit, maxBitrateKbit)); - assert(set4.TMMBR == minBitrateKbit); - assert(set2.TMMBR == maxBitrateKbit); - }; -}; - -class NULLDataZink: public RtpData -{ - virtual int32_t OnReceivedPayloadData(const uint8_t* payloadData, - const uint16_t payloadSize, - const webrtc::WebRtcRTPHeader* rtpHeader, - const uint8_t* incomingRtpPacket, - const uint16_t incomingRtpPacketLengt) - { - return 0; - }; -}; - - -int _tmain(int argc, _TCHAR* argv[]) -{ - - std::string str; - std::cout << "------------------------" << std::endl; - std::cout << "------ Test TMMBR ------" << std::endl; - std::cout << "------------------------" << std::endl; - std::cout << " " << std::endl; - - // -------------------- - // Test TMMBRHelp class - // -------------------- - TestTMMBR test; - test.Start(); - - printf("TMMBRHelp-class test done.\n"); - - // ------------------------ - // Test TMMBR single module - // ------------------------ - RtpRtcp* rtpRtcpModuleVideo = RtpRtcp::CreateRtpRtcp(0, false); - - LoopBackTransportVideo* myLoopBackTransportVideo = new LoopBackTransportVideo(rtpRtcpModuleVideo); - assert(0 == rtpRtcpModuleVideo->RegisterSendTransport(myLoopBackTransportVideo)); - - assert(false == rtpRtcpModuleVideo->TMMBR()); - rtpRtcpModuleVideo->SetTMMBRStatus(true); - assert(true == rtpRtcpModuleVideo->TMMBR()); - - assert(0 == rtpRtcpModuleVideo->RegisterSendPayload( "I420", 96)); - assert(0 == rtpRtcpModuleVideo->RegisterReceivePayload( "I420", 96)); - - // send a RTP packet with SSRC 11111 to get 11111 as the received SSRC - assert(0 == rtpRtcpModuleVideo->SetSSRC(11111)); - const uint8_t testStream[9] = "testtest"; - assert(0 == rtpRtcpModuleVideo->RegisterIncomingDataCallback(new NULLDataZink())); // needed to avoid error from parsing the incoming stream - assert(0 == rtpRtcpModuleVideo->SendOutgoingData(webrtc::kVideoFrameKey,96, 0, testStream, 8)); - - // set the SSRC to 0 - assert(0 == rtpRtcpModuleVideo->SetSSRC(0)); - - // - assert(0 == rtpRtcpModuleVideo->SetRTCPStatus(kRtcpCompound)); - - assert(0 == rtpRtcpModuleVideo->SendRTCP()); // -> incoming TMMBR {0} // should this make us remember a TMMBR? - assert(0 == rtpRtcpModuleVideo->SendRTCP()); // -> incoming TMMBR {1}, verify TMMBN {0} - assert(0 == rtpRtcpModuleVideo->SendRTCP()); // -> incoming TMMBR {2}, verify TMMBN {1} - assert(0 == rtpRtcpModuleVideo->SendRTCP()); // -> incoming TMMBR {3}, verify TMMBN {2} - assert(0 == rtpRtcpModuleVideo->SendRTCP()); // -> incoming TMMBR {4}, verify TMMBN {3,2} - assert(0 == rtpRtcpModuleVideo->SendRTCP()); // -> incoming TMMBR {5}, verify TMMBN {3,4,2} - assert(0 == rtpRtcpModuleVideo->SendRTCP()); // -> incoming TMMBR {4_2}, verify TMMBN {3,4,2} - assert(0 == rtpRtcpModuleVideo->SendRTCP()); // -> time out receivers, verify TMMBN {4_2} - assert(0 == rtpRtcpModuleVideo->SendRTCP()); // -> incoming TMMBR {2} - assert(0 == rtpRtcpModuleVideo->SendRTCP()); // -> verify TMMBN {2} - - printf("Single module test done.\n"); - - // ------------------------ - // Test TMMBR multi module - // ------------------------ - RtpRtcp* rtpRtcpModuleVideoDef = RtpRtcp::CreateRtpRtcp(10, false); - assert(0 == rtpRtcpModuleVideo->RegisterDefaultModule(rtpRtcpModuleVideoDef)); - - RtpRtcp* rtpRtcpModuleVideo1 = RtpRtcp::CreateRtpRtcp(1, false); - assert(0 == rtpRtcpModuleVideo1->RegisterDefaultModule(rtpRtcpModuleVideoDef)); - - RtpRtcp* rtpRtcpModuleVideo2 = RtpRtcp::CreateRtpRtcp(2, false); - assert(0 == rtpRtcpModuleVideo2->RegisterDefaultModule(rtpRtcpModuleVideoDef)); - - RtpRtcp* rtpRtcpModuleVideo3 = RtpRtcp::CreateRtpRtcp(3, false); - assert(0 == rtpRtcpModuleVideo3->RegisterDefaultModule(rtpRtcpModuleVideoDef)); - - LoopBackTransport2* myLoopBackTransport2 = new LoopBackTransport2(rtpRtcpModuleVideo2); - assert(0 == rtpRtcpModuleVideo2->RegisterSendTransport(myLoopBackTransport2)); - - assert(0 == rtpRtcpModuleVideo2->SetRTCPStatus(kRtcpCompound)); - - // set the SSRC to 0 - assert(0 == rtpRtcpModuleVideo2->SetSSRC(0)); - - assert(0 == rtpRtcpModuleVideo->SendRTCP()); // -> incoming TMMBR {4}, verify no TMMBN in this packet - assert(0 == rtpRtcpModuleVideo->SendRTCP()); // -> incoming TMMBR {0}, verify TMMBN {4,2} - assert(0 == rtpRtcpModuleVideo2->SendRTCP()); // -> incoming TMMBR {3}, verify TMMBN {4,2} - assert(0 == rtpRtcpModuleVideo->SendRTCP()); // -> incoming TMMBR {1}, verify TMMBN {3,4,2} - ::Sleep(5*RTCP_INTERVAL_AUDIO_MS + 1000); - rtpRtcpModuleVideo2->Process(); // time out receiver2 -> UpdateTMMBR() - assert(0 == rtpRtcpModuleVideo->SendRTCP()); // verify TMMBN {} - - printf("Multi module test done.\n"); - - - RtpRtcp::DestroyRtpRtcp(rtpRtcpModuleVideo); - RtpRtcp::DestroyRtpRtcp(rtpRtcpModuleVideo1); - RtpRtcp::DestroyRtpRtcp(rtpRtcpModuleVideo2); - RtpRtcp::DestroyRtpRtcp(rtpRtcpModuleVideo3); - RtpRtcp::DestroyRtpRtcp(rtpRtcpModuleVideoDef); - - TEST_PASSED(); - ::Sleep(5000); - - return 0; -} diff --git a/webrtc/modules/video_capture/mac/video_capture_mac.h b/webrtc/modules/video_capture/mac/video_capture_mac.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/webrtc/modules/video_coding/main/test/jitter_estimate_test.cc b/webrtc/modules/video_coding/main/test/jitter_estimate_test.cc deleted file mode 100644 index 25ef686ef..000000000 --- a/webrtc/modules/video_coding/main/test/jitter_estimate_test.cc +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include -#include "JitterEstimateTest.h" - -using namespace webrtc; - -JitterEstimateTest::JitterEstimateTest(unsigned int frameRate) : -_frameRate(frameRate), -_capacity(2000), -_rate(500), -_jitter(5, 0), -_keyFrameRate(1.0), -_deltaFrameSize(10000, 1e6), -_counter(0), -_lossrate(0.0) -{ - // Assign to random value between 0 and max of unsigned int - _seed = static_cast(time(0)); - srand(_seed); - _prevTimestamp = static_cast((std::rand() + 1.0)/(RAND_MAX + 1.0)*(pow((float) 2, (long) sizeof(unsigned int)*8)-1)); - _prevWallClock = VCMTickTime::MillisecondTimestamp(); -} - -FrameSample -JitterEstimateTest::GenerateFrameSample() -{ - double increment = 1.0/_frameRate; - unsigned int frameSize = static_cast(_deltaFrameSize.RandValue()); - bool keyFrame = false; - bool resent = false; - _prevTimestamp += static_cast(90000*increment + 0.5); - double deltaFrameRate = _frameRate - _keyFrameRate; - double ratio = deltaFrameRate/static_cast(_keyFrameRate); - if (ratio < 1.0) - { - ratio = 1.0/ratio; - if (_counter >= ratio) - _counter = 0; - else - { - _counter++; - frameSize += static_cast(3*_deltaFrameSize.GetAverage()); - keyFrame = true; - } - } - else - { - if (_counter >= ratio) - { - frameSize += static_cast(3*_deltaFrameSize.GetAverage()); - _counter = 0; - keyFrame = true; - } - else - _counter++; - } - int64_t jitter = static_cast(_jitter.RandValue() + 1.0/_capacity * frameSize + 0.5); - _prevWallClock += static_cast(1000*increment + 0.5); - double rndValue = RandUniform(); - resent = (rndValue < _lossrate); - //printf("rndValue = %f\n", rndValue); - return FrameSample(_prevTimestamp, _prevWallClock + jitter, frameSize, keyFrame, resent); -} - -void -JitterEstimateTest::SetCapacity(unsigned int c) -{ - _capacity = c; -} - -void -JitterEstimateTest::SetRate(unsigned int r) -{ - _rate = r; -} - -void -JitterEstimateTest::SetJitter(double m, double v) -{ - _jitter.SetParams(m, v); -} - -void -JitterEstimateTest::SetFrameSizeStats(double m, double v) -{ - _deltaFrameSize.SetParams(m, v); -} - -void -JitterEstimateTest::SetKeyFrameRate(int rate) -{ - _keyFrameRate = rate; -} - -void -JitterEstimateTest::SetLossRate(double rate) -{ - _lossrate = rate; -} diff --git a/webrtc/modules/video_coding/main/test/release_test.cc b/webrtc/modules/video_coding/main/test/release_test.cc deleted file mode 100644 index 8e3a0734c..000000000 --- a/webrtc/modules/video_coding/main/test/release_test.cc +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "ReleaseTest.h" -#include "ReceiverTests.h" -#include "TestMacros.h" -#include "MediaOptTest.h" -#include "CodecDataBaseTest.h" -#include "GenericCodecTest.h" - - - - -int ReleaseTest() -{ - printf("VCM RELEASE TESTS \n\n"); - - // Automatic tests - - printf("Testing receive side timing...\n"); - TEST(ReceiverTimingTests() == 0); - - printf("Testing jitter buffer...\n"); - TEST(JitterBufferTest() == 0); - - printf("Testing Codec Data Base...\n"); - TEST(CodecDBTest() == 0); - - printf("Testing Media Optimization....\n"); - TEST(VCMMediaOptTest(1) == 0); - - // Tests requiring verification - - printf("Testing Multi thread send-receive....\n"); - TEST(MTRxTxTest() == 0); - printf("Verify by viewing output file MTRxTx_out.yuv \n"); - - return 0; -} \ No newline at end of file diff --git a/webrtc/modules/video_coding/main/test/release_test_pt2.cc b/webrtc/modules/video_coding/main/test/release_test_pt2.cc deleted file mode 100644 index 5ff48e593..000000000 --- a/webrtc/modules/video_coding/main/test/release_test_pt2.cc +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "ReleaseTest.h" -#include "ReceiverTests.h" -#include "TestMacros.h" -#include "MediaOptTest.h" -#include "CodecDataBaseTest.h" -#include "GenericCodecTest.h" - - - - -int ReleaseTestPart2() -{ - printf("Verify that TICK_TIME_DEBUG and EVENT_DEBUG are uncommented"); - // Tests requiring verification - - printf("Testing Generic Codecs...\n"); - TEST(VCMGenericCodecTest() == 0); - printf("Verify by viewing output file GCTest_out.yuv \n"); - - return 0; -} \ No newline at end of file