• Home
  • Raw
  • Download

Lines Matching refs:size

77 search(PyInt16 val, PyInt16 *table, int size)  in search()  argument
81 for (i = 0; i < size; i++) { in search()
85 return (size); in search()
322 audioop_check_size(int size) in audioop_check_size() argument
324 if (size != 1 && size != 2 && size != 4) { in audioop_check_size()
333 audioop_check_parameters(int len, int size) in audioop_check_parameters() argument
335 if (!audioop_check_size(size)) in audioop_check_parameters()
337 if (len % size != 0) { in audioop_check_parameters()
348 int len, size, val = 0; in audioop_getsample() local
351 if ( !PyArg_ParseTuple(args, "s#ii:getsample", &cp, &len, &size, &i) ) in audioop_getsample()
353 if (!audioop_check_parameters(len, size)) in audioop_getsample()
355 if ( i < 0 || i >= len/size ) { in audioop_getsample()
359 if ( size == 1 ) val = (int)*CHARP(cp, i); in audioop_getsample()
360 else if ( size == 2 ) val = (int)*SHORTP(cp, i*2); in audioop_getsample()
361 else if ( size == 4 ) val = (int)*LONGP(cp, i*4); in audioop_getsample()
369 int len, size, val = 0; in audioop_max() local
373 if ( !PyArg_ParseTuple(args, "s#i:max", &cp, &len, &size) ) in audioop_max()
375 if (!audioop_check_parameters(len, size)) in audioop_max()
377 for ( i=0; i<len; i+= size) { in audioop_max()
378 if ( size == 1 ) val = (int)*CHARP(cp, i); in audioop_max()
379 else if ( size == 2 ) val = (int)*SHORTP(cp, i); in audioop_max()
380 else if ( size == 4 ) val = (int)*LONGP(cp, i); in audioop_max()
395 int len, size, val = 0; in audioop_minmax() local
401 if (!PyArg_ParseTuple(args, "s#i:minmax", &cp, &len, &size)) in audioop_minmax()
403 if (!audioop_check_parameters(len, size)) in audioop_minmax()
405 for (i = 0; i < len; i += size) { in audioop_minmax()
406 if (size == 1) val = (int) *CHARP(cp, i); in audioop_minmax()
407 else if (size == 2) val = (int) *SHORTP(cp, i); in audioop_minmax()
408 else if (size == 4) val = (int) *LONGP(cp, i); in audioop_minmax()
419 int len, size, val = 0; in audioop_avg() local
423 if ( !PyArg_ParseTuple(args, "s#i:avg", &cp, &len, &size) ) in audioop_avg()
425 if (!audioop_check_parameters(len, size)) in audioop_avg()
427 for ( i=0; i<len; i+= size) { in audioop_avg()
428 if ( size == 1 ) val = (int)*CHARP(cp, i); in audioop_avg()
429 else if ( size == 2 ) val = (int)*SHORTP(cp, i); in audioop_avg()
430 else if ( size == 4 ) val = (int)*LONGP(cp, i); in audioop_avg()
436 val = (int)floor(avg / (double)(len/size)); in audioop_avg()
444 int len, size, val = 0; in audioop_rms() local
449 if ( !PyArg_ParseTuple(args, "s#i:rms", &cp, &len, &size) ) in audioop_rms()
451 if (!audioop_check_parameters(len, size)) in audioop_rms()
453 for ( i=0; i<len; i+= size) { in audioop_rms()
454 if ( size == 1 ) val = (int)*CHARP(cp, i); in audioop_rms()
455 else if ( size == 2 ) val = (int)*SHORTP(cp, i); in audioop_rms()
456 else if ( size == 4 ) val = (int)*LONGP(cp, i); in audioop_rms()
462 res = (unsigned int)sqrt(sum_squares / (double)(len/size)); in audioop_rms()
653 int len, size, val = 0, prevval = 0, prevextremevalid = 0, in audioop_avgpp() local
660 if ( !PyArg_ParseTuple(args, "s#i:avgpp", &cp, &len, &size) ) in audioop_avgpp()
662 if (!audioop_check_parameters(len, size)) in audioop_avgpp()
664 if (len <= size*2) in audioop_avgpp()
666 if ( size == 1 ) prevval = (int)*CHARP(cp, 0); in audioop_avgpp()
667 else if ( size == 2 ) prevval = (int)*SHORTP(cp, 0); in audioop_avgpp()
668 else if ( size == 4 ) prevval = (int)*LONGP(cp, 0); in audioop_avgpp()
670 for ( i=size; i<len; i+= size) { in audioop_avgpp()
671 if ( size == 1 ) val = (int)*CHARP(cp, i); in audioop_avgpp()
672 else if ( size == 2 ) val = (int)*SHORTP(cp, i); in audioop_avgpp()
673 else if ( size == 4 ) val = (int)*LONGP(cp, i); in audioop_avgpp()
705 int len, size, val = 0, prevval = 0, prevextremevalid = 0, in audioop_maxpp() local
711 if ( !PyArg_ParseTuple(args, "s#i:maxpp", &cp, &len, &size) ) in audioop_maxpp()
713 if (!audioop_check_parameters(len, size)) in audioop_maxpp()
715 if (len <= size) in audioop_maxpp()
717 if ( size == 1 ) prevval = (int)*CHARP(cp, 0); in audioop_maxpp()
718 else if ( size == 2 ) prevval = (int)*SHORTP(cp, 0); in audioop_maxpp()
719 else if ( size == 4 ) prevval = (int)*LONGP(cp, 0); in audioop_maxpp()
721 for ( i=size; i<len; i+= size) { in audioop_maxpp()
722 if ( size == 1 ) val = (int)*CHARP(cp, i); in audioop_maxpp()
723 else if ( size == 2 ) val = (int)*SHORTP(cp, i); in audioop_maxpp()
724 else if ( size == 4 ) val = (int)*LONGP(cp, i); in audioop_maxpp()
758 int len, size, val = 0; in audioop_cross() local
762 if ( !PyArg_ParseTuple(args, "s#i:cross", &cp, &len, &size) ) in audioop_cross()
764 if (!audioop_check_parameters(len, size)) in audioop_cross()
768 for ( i=0; i<len; i+= size) { in audioop_cross()
769 if ( size == 1 ) val = ((int)*CHARP(cp, i)) >> 7; in audioop_cross()
770 else if ( size == 2 ) val = ((int)*SHORTP(cp, i)) >> 15; in audioop_cross()
771 else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 31; in audioop_cross()
783 int len, size, val = 0; in audioop_mul() local
788 if ( !PyArg_ParseTuple(args, "s#id:mul", &cp, &len, &size, &factor ) ) in audioop_mul()
790 if (!audioop_check_parameters(len, size)) in audioop_mul()
793 maxval = (double) maxvals[size]; in audioop_mul()
794 minval = (double) minvals[size]; in audioop_mul()
802 for ( i=0; i < len; i += size ) { in audioop_mul()
803 if ( size == 1 ) val = (int)*CHARP(cp, i); in audioop_mul()
804 else if ( size == 2 ) val = (int)*SHORTP(cp, i); in audioop_mul()
805 else if ( size == 4 ) val = (int)*LONGP(cp, i); in audioop_mul()
808 if ( size == 1 ) *CHARP(ncp, i) = (signed char)val; in audioop_mul()
809 else if ( size == 2 ) *SHORTP(ncp, i) = (short)val; in audioop_mul()
810 else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)val; in audioop_mul()
819 int len, size, val1 = 0, val2 = 0; in audioop_tomono() local
825 &cp, &len, &size, &fac1, &fac2 ) ) in audioop_tomono()
827 if (!audioop_check_parameters(len, size)) in audioop_tomono()
829 if (((len / size) & 1) != 0) { in audioop_tomono()
834 maxval = (double) maxvals[size]; in audioop_tomono()
835 minval = (double) minvals[size]; in audioop_tomono()
843 for ( i=0; i < len; i += size*2 ) { in audioop_tomono()
844 if ( size == 1 ) val1 = (int)*CHARP(cp, i); in audioop_tomono()
845 else if ( size == 2 ) val1 = (int)*SHORTP(cp, i); in audioop_tomono()
846 else if ( size == 4 ) val1 = (int)*LONGP(cp, i); in audioop_tomono()
847 if ( size == 1 ) val2 = (int)*CHARP(cp, i+1); in audioop_tomono()
848 else if ( size == 2 ) val2 = (int)*SHORTP(cp, i+2); in audioop_tomono()
849 else if ( size == 4 ) val2 = (int)*LONGP(cp, i+4); in audioop_tomono()
852 if ( size == 1 ) *CHARP(ncp, i/2) = (signed char)val1; in audioop_tomono()
853 else if ( size == 2 ) *SHORTP(ncp, i/2) = (short)val1; in audioop_tomono()
854 else if ( size == 4 ) *LONGP(ncp, i/2)= (Py_Int32)val1; in audioop_tomono()
863 int len, size, val1, val2, val = 0; in audioop_tostereo() local
869 &cp, &len, &size, &fac1, &fac2 ) ) in audioop_tostereo()
871 if (!audioop_check_parameters(len, size)) in audioop_tostereo()
874 maxval = (double) maxvals[size]; in audioop_tostereo()
875 minval = (double) minvals[size]; in audioop_tostereo()
889 for ( i=0; i < len; i += size ) { in audioop_tostereo()
890 if ( size == 1 ) val = (int)*CHARP(cp, i); in audioop_tostereo()
891 else if ( size == 2 ) val = (int)*SHORTP(cp, i); in audioop_tostereo()
892 else if ( size == 4 ) val = (int)*LONGP(cp, i); in audioop_tostereo()
900 if ( size == 1 ) *CHARP(ncp, i*2) = (signed char)val1; in audioop_tostereo()
901 else if ( size == 2 ) *SHORTP(ncp, i*2) = (short)val1; in audioop_tostereo()
902 else if ( size == 4 ) *LONGP(ncp, i*2) = (Py_Int32)val1; in audioop_tostereo()
904 if ( size == 1 ) *CHARP(ncp, i*2+1) = (signed char)val2; in audioop_tostereo()
905 else if ( size == 2 ) *SHORTP(ncp, i*2+2) = (short)val2; in audioop_tostereo()
906 else if ( size == 4 ) *LONGP(ncp, i*2+4) = (Py_Int32)val2; in audioop_tostereo()
915 int len1, len2, size, val1 = 0, val2 = 0, minval, maxval, newval; in audioop_add() local
920 &cp1, &len1, &cp2, &len2, &size ) ) in audioop_add()
922 if (!audioop_check_parameters(len1, size)) in audioop_add()
929 maxval = maxvals[size]; in audioop_add()
930 minval = minvals[size]; in audioop_add()
937 for ( i=0; i < len1; i += size ) { in audioop_add()
938 if ( size == 1 ) val1 = (int)*CHARP(cp1, i); in audioop_add()
939 else if ( size == 2 ) val1 = (int)*SHORTP(cp1, i); in audioop_add()
940 else if ( size == 4 ) val1 = (int)*LONGP(cp1, i); in audioop_add()
942 if ( size == 1 ) val2 = (int)*CHARP(cp2, i); in audioop_add()
943 else if ( size == 2 ) val2 = (int)*SHORTP(cp2, i); in audioop_add()
944 else if ( size == 4 ) val2 = (int)*LONGP(cp2, i); in audioop_add()
946 if (size < 4) { in audioop_add()
960 if ( size == 1 ) *CHARP(ncp, i) = (signed char)newval; in audioop_add()
961 else if ( size == 2 ) *SHORTP(ncp, i) = (short)newval; in audioop_add()
962 else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)newval; in audioop_add()
971 int len, size; in audioop_bias() local
978 &cp, &len, &size , &bias) ) in audioop_bias()
981 if (!audioop_check_parameters(len, size)) in audioop_bias()
989 mask = masks[size]; in audioop_bias()
991 for ( i=0; i < len; i += size ) { in audioop_bias()
992 if ( size == 1 ) val = (unsigned int)(unsigned char)*CHARP(cp, i); in audioop_bias()
993 else if ( size == 2 ) val = (unsigned int)(unsigned short)*SHORTP(cp, i); in audioop_bias()
994 else if ( size == 4 ) val = (unsigned int)(Py_UInt32)*LONGP(cp, i); in audioop_bias()
1000 if ( size == 1 ) *CHARP(ncp, i) = (signed char)(unsigned char)val; in audioop_bias()
1001 else if ( size == 2 ) *SHORTP(ncp, i) = (short)(unsigned short)val; in audioop_bias()
1002 else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(Py_UInt32)val; in audioop_bias()
1012 int len, size, val = 0; in audioop_reverse() local
1017 &cp, &len, &size) ) in audioop_reverse()
1020 if (!audioop_check_parameters(len, size)) in audioop_reverse()
1028 for ( i=0; i < len; i += size ) { in audioop_reverse()
1029 if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 24; in audioop_reverse()
1030 else if ( size == 2 ) val = ((int)*SHORTP(cp, i)) << 16; in audioop_reverse()
1031 else if ( size == 4 ) val = (int)*LONGP(cp, i); in audioop_reverse()
1033 j = len - i - size; in audioop_reverse()
1035 if ( size == 1 ) *CHARP(ncp, j) = (signed char)(val >> 24); in audioop_reverse()
1036 else if ( size == 2 ) *SHORTP(ncp, j) = (short)(val >> 16); in audioop_reverse()
1037 else if ( size == 4 ) *LONGP(ncp, j) = (Py_Int32)val; in audioop_reverse()
1047 int len, size, size2, val = 0; in audioop_lin2lin() local
1052 &cp, &len, &size, &size2) ) in audioop_lin2lin()
1055 if (!audioop_check_parameters(len, size)) in audioop_lin2lin()
1060 if (len/size > INT_MAX/size2) { in audioop_lin2lin()
1065 rv = PyString_FromStringAndSize(NULL, (len/size)*size2); in audioop_lin2lin()
1070 for ( i=0, j=0; i < len; i += size, j += size2 ) { in audioop_lin2lin()
1071 if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 24; in audioop_lin2lin()
1072 else if ( size == 2 ) val = ((int)*SHORTP(cp, i)) << 16; in audioop_lin2lin()
1073 else if ( size == 4 ) val = (int)*LONGP(cp, i); in audioop_lin2lin()
1097 int len, size, nchannels, inrate, outrate, weightA, weightB; in audioop_ratecv() local
1104 if (!PyArg_ParseTuple(args, "s#iiiiO|ii:ratecv", &cp, &len, &size, in audioop_ratecv()
1108 if (!audioop_check_size(size)) in audioop_ratecv()
1114 bytes_per_frame = size * nchannels; in audioop_ratecv()
1115 if (bytes_per_frame / nchannels != size) { in audioop_ratecv()
1248 if (size == 1) in audioop_ratecv()
1250 else if (size == 2) in audioop_ratecv()
1252 else if (size == 4) in audioop_ratecv()
1254 cp += size; in audioop_ratecv()
1269 if (size == 1) in audioop_ratecv()
1271 else if (size == 2) in audioop_ratecv()
1273 else if (size == 4) in audioop_ratecv()
1275 ncp += size; in audioop_ratecv()
1293 int len, size, val = 0; in audioop_lin2ulaw() local
1298 &cp, &len, &size) ) in audioop_lin2ulaw()
1301 if (!audioop_check_parameters(len, size)) in audioop_lin2ulaw()
1304 rv = PyString_FromStringAndSize(NULL, len/size); in audioop_lin2ulaw()
1309 for ( i=0; i < len; i += size ) { in audioop_lin2ulaw()
1310 if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; in audioop_lin2ulaw()
1311 else if ( size == 2 ) val = (int)*SHORTP(cp, i); in audioop_lin2ulaw()
1312 else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; in audioop_lin2ulaw()
1325 int len, size, val; in audioop_ulaw2lin() local
1330 &cp, &len, &size) ) in audioop_ulaw2lin()
1333 if (!audioop_check_size(size)) in audioop_ulaw2lin()
1336 if (len > INT_MAX/size) { in audioop_ulaw2lin()
1341 rv = PyString_FromStringAndSize(NULL, len*size); in audioop_ulaw2lin()
1346 for ( i=0; i < len*size; i += size ) { in audioop_ulaw2lin()
1350 if ( size == 1 ) *CHARP(ncp, i) = (signed char)(val >> 8); in audioop_ulaw2lin()
1351 else if ( size == 2 ) *SHORTP(ncp, i) = (short)(val); in audioop_ulaw2lin()
1352 else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(val<<16); in audioop_ulaw2lin()
1362 int len, size, val = 0; in audioop_lin2alaw() local
1367 &cp, &len, &size) ) in audioop_lin2alaw()
1370 if (!audioop_check_parameters(len, size)) in audioop_lin2alaw()
1373 rv = PyString_FromStringAndSize(NULL, len/size); in audioop_lin2alaw()
1378 for ( i=0; i < len; i += size ) { in audioop_lin2alaw()
1379 if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; in audioop_lin2alaw()
1380 else if ( size == 2 ) val = (int)*SHORTP(cp, i); in audioop_lin2alaw()
1381 else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; in audioop_lin2alaw()
1394 int len, size, val; in audioop_alaw2lin() local
1399 &cp, &len, &size) ) in audioop_alaw2lin()
1402 if (!audioop_check_size(size)) in audioop_alaw2lin()
1405 if (len > INT_MAX/size) { in audioop_alaw2lin()
1410 rv = PyString_FromStringAndSize(NULL, len*size); in audioop_alaw2lin()
1415 for ( i=0; i < len*size; i += size ) { in audioop_alaw2lin()
1419 if ( size == 1 ) *CHARP(ncp, i) = (signed char)(val >> 8); in audioop_alaw2lin()
1420 else if ( size == 2 ) *SHORTP(ncp, i) = (short)(val); in audioop_alaw2lin()
1421 else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(val<<16); in audioop_alaw2lin()
1431 int len, size, val = 0, step, valpred, delta, in audioop_lin2adpcm() local
1437 &cp, &len, &size, &state) ) in audioop_lin2adpcm()
1440 if (!audioop_check_parameters(len, size)) in audioop_lin2adpcm()
1462 str = PyString_FromStringAndSize(NULL, len/(size*2)); in audioop_lin2adpcm()
1470 for ( i=0; i < len; i += size ) { in audioop_lin2adpcm()
1471 if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; in audioop_lin2adpcm()
1472 else if ( size == 2 ) val = (int)*SHORTP(cp, i); in audioop_lin2adpcm()
1473 else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; in audioop_lin2adpcm()
1547 int len, size, valpred, step, delta, index, sign, vpdiff; in audioop_adpcm2lin() local
1552 &cp, &len, &size, &state) ) in audioop_adpcm2lin()
1555 if (!audioop_check_size(size)) in audioop_adpcm2lin()
1577 if (len > (INT_MAX/2)/size) { in audioop_adpcm2lin()
1582 str = PyString_FromStringAndSize(NULL, len*size*2); in audioop_adpcm2lin()
1590 for ( i=0; i < len*size*2; i += size ) { in audioop_adpcm2lin()
1635 if ( size == 1 ) *CHARP(ncp, i) = (signed char)(valpred >> 8); in audioop_adpcm2lin()
1636 else if ( size == 2 ) *SHORTP(ncp, i) = (short)(valpred); in audioop_adpcm2lin()
1637 else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(valpred<<16); in audioop_adpcm2lin()