Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
8be17409
Kaydet (Commit)
8be17409
authored
Eyl 11, 2016
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use uint16_t instead of short in audioop.
üst
5f1a5187
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
audioop.c
Modules/audioop.c
+14
-14
No files found.
Modules/audioop.c
Dosyayı görüntüle @
8be17409
...
@@ -240,7 +240,7 @@ static unsigned char
...
@@ -240,7 +240,7 @@ static unsigned char
st_linear2alaw
(
int16_t
pcm_val
)
/* 2's complement (13-bit range) */
st_linear2alaw
(
int16_t
pcm_val
)
/* 2's complement (13-bit range) */
{
{
int16_t
mask
;
int16_t
mask
;
short
seg
;
int16_t
seg
;
unsigned
char
aval
;
unsigned
char
aval
;
/* A-law using even bit inversion */
/* A-law using even bit inversion */
...
@@ -294,7 +294,7 @@ static const int stepsizeTable[89] = {
...
@@ -294,7 +294,7 @@ static const int stepsizeTable[89] = {
#define GETINT8(cp, i) GETINTX(signed char, (cp), (i))
#define GETINT8(cp, i) GETINTX(signed char, (cp), (i))
#define GETINT16(cp, i) GETINTX(
shor
t, (cp), (i))
#define GETINT16(cp, i) GETINTX(
int16_
t, (cp), (i))
#define GETINT32(cp, i) GETINTX(int32_t, (cp), (i))
#define GETINT32(cp, i) GETINTX(int32_t, (cp), (i))
#if WORDS_BIGENDIAN
#if WORDS_BIGENDIAN
...
@@ -311,7 +311,7 @@ static const int stepsizeTable[89] = {
...
@@ -311,7 +311,7 @@ static const int stepsizeTable[89] = {
#define SETINT8(cp, i, val) SETINTX(signed char, (cp), (i), (val))
#define SETINT8(cp, i, val) SETINTX(signed char, (cp), (i), (val))
#define SETINT16(cp, i, val) SETINTX(
shor
t, (cp), (i), (val))
#define SETINT16(cp, i, val) SETINTX(
int16_
t, (cp), (i), (val))
#define SETINT32(cp, i, val) SETINTX(int32_t, (cp), (i), (val))
#define SETINT32(cp, i, val) SETINTX(int32_t, (cp), (i), (val))
#if WORDS_BIGENDIAN
#if WORDS_BIGENDIAN
...
@@ -542,7 +542,7 @@ audioop_rms_impl(PyObject *module, Py_buffer *fragment, int width)
...
@@ -542,7 +542,7 @@ audioop_rms_impl(PyObject *module, Py_buffer *fragment, int width)
return
PyLong_FromUnsignedLong
(
res
);
return
PyLong_FromUnsignedLong
(
res
);
}
}
static
double
_sum2
(
const
short
*
a
,
const
shor
t
*
b
,
Py_ssize_t
len
)
static
double
_sum2
(
const
int16_t
*
a
,
const
int16_
t
*
b
,
Py_ssize_t
len
)
{
{
Py_ssize_t
i
;
Py_ssize_t
i
;
double
sum
=
0
.
0
;
double
sum
=
0
.
0
;
...
@@ -600,7 +600,7 @@ audioop_findfit_impl(PyObject *module, Py_buffer *fragment,
...
@@ -600,7 +600,7 @@ audioop_findfit_impl(PyObject *module, Py_buffer *fragment,
Py_buffer
*
reference
)
Py_buffer
*
reference
)
/*[clinic end generated code: output=5752306d83cbbada input=62c305605e183c9a]*/
/*[clinic end generated code: output=5752306d83cbbada input=62c305605e183c9a]*/
{
{
const
shor
t
*
cp1
,
*
cp2
;
const
int16_
t
*
cp1
,
*
cp2
;
Py_ssize_t
len1
,
len2
;
Py_ssize_t
len1
,
len2
;
Py_ssize_t
j
,
best_j
;
Py_ssize_t
j
,
best_j
;
double
aj_m1
,
aj_lm1
;
double
aj_m1
,
aj_lm1
;
...
@@ -610,9 +610,9 @@ audioop_findfit_impl(PyObject *module, Py_buffer *fragment,
...
@@ -610,9 +610,9 @@ audioop_findfit_impl(PyObject *module, Py_buffer *fragment,
PyErr_SetString
(
AudioopError
,
"Strings should be even-sized"
);
PyErr_SetString
(
AudioopError
,
"Strings should be even-sized"
);
return
NULL
;
return
NULL
;
}
}
cp1
=
(
const
shor
t
*
)
fragment
->
buf
;
cp1
=
(
const
int16_
t
*
)
fragment
->
buf
;
len1
=
fragment
->
len
>>
1
;
len1
=
fragment
->
len
>>
1
;
cp2
=
(
const
shor
t
*
)
reference
->
buf
;
cp2
=
(
const
int16_
t
*
)
reference
->
buf
;
len2
=
reference
->
len
>>
1
;
len2
=
reference
->
len
>>
1
;
if
(
len1
<
len2
)
{
if
(
len1
<
len2
)
{
...
@@ -669,7 +669,7 @@ audioop_findfactor_impl(PyObject *module, Py_buffer *fragment,
...
@@ -669,7 +669,7 @@ audioop_findfactor_impl(PyObject *module, Py_buffer *fragment,
Py_buffer
*
reference
)
Py_buffer
*
reference
)
/*[clinic end generated code: output=14ea95652c1afcf8 input=816680301d012b21]*/
/*[clinic end generated code: output=14ea95652c1afcf8 input=816680301d012b21]*/
{
{
const
shor
t
*
cp1
,
*
cp2
;
const
int16_
t
*
cp1
,
*
cp2
;
Py_ssize_t
len
;
Py_ssize_t
len
;
double
sum_ri_2
,
sum_aij_ri
,
result
;
double
sum_ri_2
,
sum_aij_ri
,
result
;
...
@@ -681,8 +681,8 @@ audioop_findfactor_impl(PyObject *module, Py_buffer *fragment,
...
@@ -681,8 +681,8 @@ audioop_findfactor_impl(PyObject *module, Py_buffer *fragment,
PyErr_SetString
(
AudioopError
,
"Samples should be same size"
);
PyErr_SetString
(
AudioopError
,
"Samples should be same size"
);
return
NULL
;
return
NULL
;
}
}
cp1
=
(
const
shor
t
*
)
fragment
->
buf
;
cp1
=
(
const
int16_
t
*
)
fragment
->
buf
;
cp2
=
(
const
shor
t
*
)
reference
->
buf
;
cp2
=
(
const
int16_
t
*
)
reference
->
buf
;
len
=
fragment
->
len
>>
1
;
len
=
fragment
->
len
>>
1
;
sum_ri_2
=
_sum2
(
cp2
,
cp2
,
len
);
sum_ri_2
=
_sum2
(
cp2
,
cp2
,
len
);
sum_aij_ri
=
_sum2
(
cp1
,
cp2
,
len
);
sum_aij_ri
=
_sum2
(
cp1
,
cp2
,
len
);
...
@@ -711,7 +711,7 @@ audioop_findmax_impl(PyObject *module, Py_buffer *fragment,
...
@@ -711,7 +711,7 @@ audioop_findmax_impl(PyObject *module, Py_buffer *fragment,
Py_ssize_t
length
)
Py_ssize_t
length
)
/*[clinic end generated code: output=f008128233523040 input=2f304801ed42383c]*/
/*[clinic end generated code: output=f008128233523040 input=2f304801ed42383c]*/
{
{
const
shor
t
*
cp1
;
const
int16_
t
*
cp1
;
Py_ssize_t
len1
;
Py_ssize_t
len1
;
Py_ssize_t
j
,
best_j
;
Py_ssize_t
j
,
best_j
;
double
aj_m1
,
aj_lm1
;
double
aj_m1
,
aj_lm1
;
...
@@ -721,7 +721,7 @@ audioop_findmax_impl(PyObject *module, Py_buffer *fragment,
...
@@ -721,7 +721,7 @@ audioop_findmax_impl(PyObject *module, Py_buffer *fragment,
PyErr_SetString
(
AudioopError
,
"Strings should be even-sized"
);
PyErr_SetString
(
AudioopError
,
"Strings should be even-sized"
);
return
NULL
;
return
NULL
;
}
}
cp1
=
(
const
shor
t
*
)
fragment
->
buf
;
cp1
=
(
const
int16_
t
*
)
fragment
->
buf
;
len1
=
fragment
->
len
>>
1
;
len1
=
fragment
->
len
>>
1
;
if
(
length
<
0
||
len1
<
length
)
{
if
(
length
<
0
||
len1
<
length
)
{
...
@@ -1122,7 +1122,7 @@ audioop_bias_impl(PyObject *module, Py_buffer *fragment, int width, int bias)
...
@@ -1122,7 +1122,7 @@ audioop_bias_impl(PyObject *module, Py_buffer *fragment, int width, int bias)
if
(
width
==
1
)
if
(
width
==
1
)
val
=
GETINTX
(
unsigned
char
,
fragment
->
buf
,
i
);
val
=
GETINTX
(
unsigned
char
,
fragment
->
buf
,
i
);
else
if
(
width
==
2
)
else
if
(
width
==
2
)
val
=
GETINTX
(
u
nsigned
shor
t
,
fragment
->
buf
,
i
);
val
=
GETINTX
(
u
int16_
t
,
fragment
->
buf
,
i
);
else
if
(
width
==
3
)
else
if
(
width
==
3
)
val
=
((
unsigned
int
)
GETINT24
(
fragment
->
buf
,
i
))
&
0xffffffu
;
val
=
((
unsigned
int
)
GETINT24
(
fragment
->
buf
,
i
))
&
0xffffffu
;
else
{
else
{
...
@@ -1137,7 +1137,7 @@ audioop_bias_impl(PyObject *module, Py_buffer *fragment, int width, int bias)
...
@@ -1137,7 +1137,7 @@ audioop_bias_impl(PyObject *module, Py_buffer *fragment, int width, int bias)
if
(
width
==
1
)
if
(
width
==
1
)
SETINTX
(
unsigned
char
,
ncp
,
i
,
val
);
SETINTX
(
unsigned
char
,
ncp
,
i
,
val
);
else
if
(
width
==
2
)
else
if
(
width
==
2
)
SETINTX
(
u
nsigned
shor
t
,
ncp
,
i
,
val
);
SETINTX
(
u
int16_
t
,
ncp
,
i
,
val
);
else
if
(
width
==
3
)
else
if
(
width
==
3
)
SETINT24
(
ncp
,
i
,
(
int
)
val
);
SETINT24
(
ncp
,
i
,
(
int
)
val
);
else
{
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment