mirror of
https://github.com/google/liblc3.git
synced 2026-06-01 09:27:01 +00:00
fix: Remove use of deprecated int numpy attribute
This commit is contained in:
+3
-3
@@ -345,7 +345,7 @@ class SnsSynthesis(Sns):
|
||||
|
||||
def deenum_mpvq(self, index, ls, npulses, n):
|
||||
|
||||
y = np.zeros(n, dtype=np.int)
|
||||
y = np.zeros(n, dtype=np.intc)
|
||||
pos = 0
|
||||
|
||||
for i in range(len(y)-1, -1, -1):
|
||||
@@ -374,14 +374,14 @@ class SnsSynthesis(Sns):
|
||||
|
||||
## 3.7.4.2.1-2 SNS VQ Decoding
|
||||
|
||||
y = np.empty(16, dtype=np.int)
|
||||
y = np.empty(16, dtype=np.intc)
|
||||
|
||||
if self.shape == 0:
|
||||
y[:10] = self.deenum_mpvq(self.idx_a, self.ls_a, 10, 10)
|
||||
y[10:] = self.deenum_mpvq(self.idx_b, self.ls_b, 1, 6)
|
||||
elif self.shape == 1:
|
||||
y[:10] = self.deenum_mpvq(self.idx_a, self.ls_a, 10, 10)
|
||||
y[10:] = np.zeros(6, dtype=np.int)
|
||||
y[10:] = np.zeros(6, dtype=np.intc)
|
||||
elif self.shape == 2:
|
||||
y = self.deenum_mpvq(self.idx_a, self.ls_a, 8, 16)
|
||||
elif self.shape == 3:
|
||||
|
||||
+3
-3
@@ -444,7 +444,7 @@ class SpectrumSynthesis(SpectrumQuantization):
|
||||
x = np.zeros(T.NE[self.dt][self.sr])
|
||||
rate = 512 if nbytes > 20 * (1 + self.sr) else 0
|
||||
|
||||
levs = np.zeros(len(x), dtype=np.int)
|
||||
levs = np.zeros(len(x), dtype=np.intc)
|
||||
c = 0
|
||||
|
||||
for n in range(0, self.lastnz, 2):
|
||||
@@ -540,7 +540,7 @@ class SpectrumSynthesis(SpectrumQuantization):
|
||||
|
||||
### Set residual and noise
|
||||
|
||||
nf_seed = sum(abs(x.astype(np.int)) * range(len(x)))
|
||||
nf_seed = sum(abs(x.astype(np.intc)) * range(len(x)))
|
||||
|
||||
zero_frame = (self.lastnz <= 2 and x[0] == 0 and x[1] == 0
|
||||
and self.g_idx <= 0 and f_nf >= 7)
|
||||
@@ -766,7 +766,7 @@ def check_appendix_c(dt):
|
||||
'nfilters' : C.NUM_TNS_FILTERS[dt][i],
|
||||
'lpc_weighting' : [ True, True ],
|
||||
'rc_order' : [ C.RC_ORDER[dt][i][0], 0 ],
|
||||
'rc' : [ C.RC_I_1[dt][i] - 8, np.zeros(8, dtype = np.int) ]
|
||||
'rc' : [ C.RC_I_1[dt][i] - 8, np.zeros(8, dtype = np.intc) ]
|
||||
}
|
||||
|
||||
(x, xq, side) = lc3.spec_analyze(dt, sr, C.NBYTES[dt],
|
||||
|
||||
+4
-4
@@ -187,8 +187,8 @@ class TnsAnalysis(Tns):
|
||||
|
||||
self.nfilters = len(Tns.SUB_LIM[self.dt][bw])
|
||||
self.lpc_weighting = nbytes * 8 < 48 * T.DT_MS[self.dt]
|
||||
self.rc_order = np.zeros(2, dtype=np.int)
|
||||
self.rc = np.zeros((2, 8), dtype=np.int)
|
||||
self.rc_order = np.zeros(2, dtype=np.intc)
|
||||
self.rc = np.zeros((2, 8), dtype=np.intc)
|
||||
|
||||
for f in range(self.nfilters):
|
||||
|
||||
@@ -259,8 +259,8 @@ class TnsSynthesis(Tns):
|
||||
|
||||
self.nfilters = len(Tns.SUB_LIM[self.dt][bw])
|
||||
self.lpc_weighting = nbytes * 8 < 48 * T.DT_MS[self.dt]
|
||||
self.rc_order = np.zeros(2, dtype=np.int)
|
||||
self.rc = 8 * np.ones((2, 8), dtype=np.int)
|
||||
self.rc_order = np.zeros(2, dtype=np.intc)
|
||||
self.rc = 8 * np.ones((2, 8), dtype=np.intc)
|
||||
|
||||
for f in range(self.nfilters):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user