Changeset 2605
- Timestamp:
- Apr 15, 2009 5:56:17 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/test/mips_test.c
r2429 r2605 379 379 K8 = 1, 380 380 K16 = 2, 381 K32 = 4, 381 382 }; 382 383 … … 678 679 pj_status_t (*codec_deinit)(); 679 680 pj_uint8_t pkt[640]; 680 pj_uint16_t pcm[320 ];681 pj_uint16_t pcm[32000 * PTIME / 1000]; 681 682 }; 682 683 … … 878 879 return codec_encode_decode(pool, "g722", &pjmedia_codec_g722_init, 879 880 &pjmedia_codec_g722_deinit, 881 clock_rate, channel_count, 882 samples_per_frame, flags, te); 883 } 884 885 /* G.722.1 benchmark benchmark */ 886 static pjmedia_port* g7221_encode_decode(pj_pool_t *pool, 887 unsigned clock_rate, 888 unsigned channel_count, 889 unsigned samples_per_frame, 890 unsigned flags, 891 struct test_entry *te) 892 { 893 return codec_encode_decode(pool, "g7221/16000", 894 &pjmedia_codec_g7221_init, 895 &pjmedia_codec_g7221_deinit, 896 clock_rate, channel_count, 897 samples_per_frame, flags, te); 898 } 899 900 /* G.722.1 Annex C benchmark benchmark */ 901 static pjmedia_port* g7221c_encode_decode(pj_pool_t *pool, 902 unsigned clock_rate, 903 unsigned channel_count, 904 unsigned samples_per_frame, 905 unsigned flags, 906 struct test_entry *te) 907 { 908 return codec_encode_decode(pool, "g7221/32000", 909 &pjmedia_codec_g7221_init, 910 &pjmedia_codec_g7221_deinit, 880 911 clock_rate, channel_count, 881 912 samples_per_frame, flags, te); … … 1908 1939 } 1909 1940 1941 /* G722.1 stream */ 1942 static pjmedia_port* create_stream_g7221( pj_pool_t *pool, 1943 unsigned clock_rate, 1944 unsigned channel_count, 1945 unsigned samples_per_frame, 1946 unsigned flags, 1947 struct test_entry *te) 1948 { 1949 return create_stream(pool, "g7221/16000", &pjmedia_codec_g7221_init, 1950 &pjmedia_codec_g7221_deinit, 1951 PJ_FALSE, PJ_FALSE, PJ_FALSE, 1952 clock_rate, channel_count, 1953 samples_per_frame, flags, te); 1954 } 1955 1956 /* G722.1 Annex C stream */ 1957 static pjmedia_port* create_stream_g7221c( pj_pool_t *pool, 1958 unsigned clock_rate, 1959 unsigned channel_count, 1960 unsigned samples_per_frame, 1961 unsigned flags, 1962 struct test_entry *te) 1963 { 1964 return create_stream(pool, "g7221/32000", &pjmedia_codec_g7221_init, 1965 &pjmedia_codec_g7221_deinit, 1966 PJ_FALSE, PJ_FALSE, PJ_FALSE, 1967 clock_rate, channel_count, 1968 samples_per_frame, flags, te); 1969 } 1910 1970 1911 1971 /***************************************************************************/ … … 2138 2198 pj_timestamp t0, t1; 2139 2199 unsigned j, samples_per_frame; 2140 pj_int16_t pcm[ 16000 * PTIME / 1000];2200 pj_int16_t pcm[32000 * PTIME / 1000]; 2141 2201 pjmedia_port *gen_port; 2142 2202 pj_status_t status; … … 2276 2336 { "tone generator with single freq", OP_GET, K8|K16, &create_tonegen1}, 2277 2337 { "tone generator with dual freq", OP_GET, K8|K16, &create_tonegen2}, 2338 #if PJMEDIA_HAS_G711_CODEC 2278 2339 { "codec encode/decode - G.711", OP_PUT, K8, &g711_encode_decode}, 2340 #endif 2341 #if PJMEDIA_HAS_G722_CODEC 2279 2342 { "codec encode/decode - G.722", OP_PUT, K16, &g722_encode_decode}, 2343 #endif 2344 #if PJMEDIA_HAS_GSM_CODEC 2280 2345 { "codec encode/decode - GSM", OP_PUT, K8, &gsm_encode_decode}, 2346 #endif 2347 #if PJMEDIA_HAS_ILBC_CODEC 2281 2348 { "codec encode/decode - iLBC", OP_PUT, K8, &ilbc_encode_decode}, 2349 #endif 2350 #if PJMEDIA_HAS_SPEEX_CODEC 2282 2351 { "codec encode/decode - Speex 8Khz", OP_PUT, K8, &speex8_encode_decode}, 2283 2352 { "codec encode/decode - Speex 16Khz", OP_PUT, K16, &speex16_encode_decode}, 2284 #if defined(PJMEDIA_HAS_L16_CODEC) && PJMEDIA_HAS_L16_CODEC!=0 2353 #endif 2354 #if PJMEDIA_HAS_G7221_CODEC 2355 { "codec encode/decode - G.722.1", OP_PUT, K16, &g7221_encode_decode}, 2356 { "codec encode/decode - G.722.1c", OP_PUT, K32, &g7221c_encode_decode}, 2357 #endif 2358 #if PJMEDIA_HAS_L16_CODEC 2285 2359 { "codec encode/decode - L16/8000/1", OP_PUT, K8, &l16_8_encode_decode}, 2286 2360 { "codec encode/decode - L16/16000/1", OP_PUT, K16, &l16_16_encode_decode}, 2287 2361 #endif 2362 #if PJMEDIA_HAS_G711_CODEC 2288 2363 { "stream TX/RX - G.711", OP_PUT_GET, K8, &create_stream_pcmu}, 2289 2364 { "stream TX/RX - G.711 SRTP 32bit", OP_PUT_GET, K8, &create_stream_pcmu_srtp32_no_auth}, … … 2291 2366 { "stream TX/RX - G.711 SRTP 80bit", OP_PUT_GET, K8, &create_stream_pcmu_srtp80_no_auth}, 2292 2367 { "stream TX/RX - G.711 SRTP 80bit +auth", OP_PUT_GET, K8, &create_stream_pcmu_srtp80_with_auth}, 2368 #endif 2369 #if PJMEDIA_HAS_G722_CODEC 2293 2370 { "stream TX/RX - G.722", OP_PUT_GET, K16, &create_stream_g722}, 2371 #endif 2372 #if PJMEDIA_HAS_GSM_CODEC 2294 2373 { "stream TX/RX - GSM", OP_PUT_GET, K8, &create_stream_gsm}, 2295 2374 { "stream TX/RX - GSM SRTP 32bit", OP_PUT_GET, K8, &create_stream_gsm_srtp32_no_auth}, … … 2297 2376 { "stream TX/RX - GSM SRTP 80bit", OP_PUT_GET, K8, &create_stream_gsm_srtp80_no_auth}, 2298 2377 { "stream TX/RX - GSM SRTP 80bit + auth", OP_PUT_GET, K8, &create_stream_gsm_srtp80_with_auth}, 2378 #endif 2379 #if PJMEDIA_HAS_G7221_CODEC 2380 { "stream TX/RX - G.722.1", OP_PUT_GET, K16, &create_stream_g7221}, 2381 { "stream TX/RX - G.722.1c", OP_PUT_GET, K32, &create_stream_g7221c}, 2382 #endif 2299 2383 }; 2300 unsigned i, c, k[2] = {K8, K16}, clock_rates[2] = {8000, 16000}; 2384 2385 unsigned i, c, k[3] = {K8, K16, K32}, clock_rates[3] = {8000, 16000, 32000}; 2301 2386 2302 2387 PJ_LOG(3,(THIS_FILE, "MIPS test, with CPU=%dMhz, %6.1f MIPS", CPU_MHZ, CPU_IPS / 1000000));
Note: See TracChangeset
for help on using the changeset viewer.