Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Mark Harris
Opus
Commits
38688317
Unverified
Commit
38688317
authored
Oct 04, 2016
by
Jean-Marc Valin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing some opus_int vs opus_int32 mismatches
Reported by Mark Warner.
parent
ae5f5cc1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
12 deletions
+15
-12
silk/fixed/pitch_analysis_core_FIX.c
silk/fixed/pitch_analysis_core_FIX.c
+2
-2
silk/quant_LTP_gains.c
silk/quant_LTP_gains.c
+2
-1
src/opus_decoder.c
src/opus_decoder.c
+1
-1
src/opus_demo.c
src/opus_demo.c
+1
-1
src/opus_multistream_decoder.c
src/opus_multistream_decoder.c
+2
-1
tests/test_opus_decode.c
tests/test_opus_decode.c
+3
-3
tests/test_opus_encode.c
tests/test_opus_encode.c
+4
-3
No files found.
silk/fixed/pitch_analysis_core_FIX.c
View file @
38688317
...
...
@@ -103,8 +103,8 @@ opus_int silk_pitch_analysis_core( /* O Voicing estimate: 0
VARDECL
(
opus_int16
,
C
);
VARDECL
(
opus_int32
,
xcorr32
);
const
opus_int16
*
target_ptr
,
*
basis_ptr
;
opus_int32
cross_corr
,
normalizer
,
energy
,
shift
,
energy_basis
,
energy_target
;
opus_int
d_srch
[
PE_D_SRCH_LENGTH
],
Cmax
,
length_d_srch
,
length_d_comp
;
opus_int32
cross_corr
,
normalizer
,
energy
,
energy_basis
,
energy_target
;
opus_int
d_srch
[
PE_D_SRCH_LENGTH
],
Cmax
,
length_d_srch
,
length_d_comp
,
shift
;
VARDECL
(
opus_int16
,
d_comp
);
opus_int32
sum
,
threshold
,
lag_counter
;
opus_int
CBimax
,
CBimax_new
,
CBimax_old
,
lag
,
start_lag
,
end_lag
,
lag_new
;
...
...
silk/quant_LTP_gains.c
View file @
38688317
...
...
@@ -52,7 +52,8 @@ void silk_quant_LTP_gains(
const
opus_uint8
*
cbk_gain_ptr_Q7
;
const
opus_int32
*
XX_Q17_ptr
,
*
xX_Q17_ptr
;
opus_int32
res_nrg_Q15_subfr
,
res_nrg_Q15
,
rate_dist_Q7_subfr
,
rate_dist_Q7
,
min_rate_dist_Q7
;
opus_int32
sum_log_gain_tmp_Q7
,
best_sum_log_gain_Q7
,
max_gain_Q7
,
gain_Q7
;
opus_int32
sum_log_gain_tmp_Q7
,
best_sum_log_gain_Q7
,
max_gain_Q7
;
opus_int
gain_Q7
;
/***************************************************/
/* iterate over different codebooks with different */
...
...
src/opus_decoder.c
View file @
38688317
...
...
@@ -891,7 +891,7 @@ int opus_decoder_ctl(OpusDecoder *st, int request, ...)
break
;
case
OPUS_GET_LAST_PACKET_DURATION_REQUEST
:
{
opus_
u
int32
*
value
=
va_arg
(
ap
,
opus_
u
int32
*
);
opus_int32
*
value
=
va_arg
(
ap
,
opus_int32
*
);
if
(
!
value
)
{
goto
bad_arg
;
...
...
src/opus_demo.c
View file @
38688317
...
...
@@ -765,7 +765,7 @@ int main(int argc, char *argv[])
}
tot_samples
+=
nb_encoded
;
}
else
{
int
output_samples
;
opus_
int
32
output_samples
;
lost
=
len
[
toggle
]
==
0
||
(
packet_loss_perc
>
0
&&
rand
()
%
100
<
packet_loss_perc
);
if
(
lost
)
opus_decoder_ctl
(
dec
,
OPUS_GET_LAST_PACKET_DURATION
(
&
output_samples
));
...
...
src/opus_multistream_decoder.c
View file @
38688317
...
...
@@ -237,7 +237,8 @@ static int opus_multistream_decode_native(
for
(
s
=
0
;
s
<
st
->
layout
.
nb_streams
;
s
++
)
{
OpusDecoder
*
dec
;
int
packet_offset
,
ret
;
opus_int32
packet_offset
;
int
ret
;
dec
=
(
OpusDecoder
*
)
ptr
;
ptr
+=
(
s
<
st
->
layout
.
nb_coupled_streams
)
?
align
(
coupled_size
)
:
align
(
mono_size
);
...
...
tests/test_opus_decode.c
View file @
38688317
...
...
@@ -104,7 +104,7 @@ int test_decoder_code0(int no_fuzz)
int
factor
=
48000
/
fsv
[
t
>>
1
];
for
(
fec
=
0
;
fec
<
2
;
fec
++
)
{
int
dur
;
opus_
int
32
dur
;
/*Test PLC on a fresh decoder*/
out_samples
=
opus_decode
(
dec
[
t
],
0
,
0
,
outbuf
,
120
/
factor
,
fec
);
if
(
out_samples
!=
120
/
factor
)
test_failed
();
...
...
@@ -160,7 +160,7 @@ int test_decoder_code0(int no_fuzz)
/*Count code 0 tests*/
for
(
i
=
0
;
i
<
64
;
i
++
)
{
int
dur
;
opus_
int
32
dur
;
int
j
,
expected
[
5
*
2
];
packet
[
0
]
=
i
<<
2
;
packet
[
1
]
=
255
;
...
...
@@ -314,7 +314,7 @@ int test_decoder_code0(int no_fuzz)
if
(
opus_decode
(
decbak
,
0
,
0
,
outbuf
,
MAX_FRAME_SAMP
,
0
)
<
20
)
test_failed
();
for
(
t
=
0
;
t
<
5
*
2
;
t
++
)
{
int
dur
;
opus_
int
32
dur
;
out_samples
=
opus_decode
(
dec
[
t
],
packet
,
plen
+
1
,
outbuf
,
MAX_FRAME_SAMP
,
0
);
if
(
out_samples
!=
expected
[
t
])
test_failed
();
if
(
t
==
0
)
dec_final_range2
=
dec_final_range1
;
...
...
tests/test_opus_encode.c
View file @
38688317
...
...
@@ -265,8 +265,8 @@ int run_test1(int no_fuzz)
static
const
char
*
mstrings
[
3
]
=
{
" LP"
,
"Hybrid"
,
" MDCT"
};
unsigned
char
mapping
[
256
]
=
{
0
,
1
,
255
};
unsigned
char
db62
[
36
];
opus_int32
i
;
int
rc
,
j
,
err
;
opus_int32
i
,
j
;
int
rc
,
err
;
OpusEncoder
*
enc
;
OpusMSEncoder
*
MSenc
;
OpusDecoder
*
dec
;
...
...
@@ -482,7 +482,8 @@ int run_test1(int no_fuzz)
if
(
opus_multistream_encoder_ctl
(
MSenc
,
OPUS_SET_BITRATE
(
rate
))
!=
OPUS_OK
)
test_failed
();
count
=
i
=
0
;
do
{
int
pred
,
len
,
out_samples
,
frame_size
,
loss
;
int
len
,
out_samples
,
frame_size
,
loss
;
opus_int32
pred
;
if
(
opus_multistream_encoder_ctl
(
MSenc
,
OPUS_GET_PREDICTION_DISABLED
(
&
pred
))
!=
OPUS_OK
)
test_failed
();
if
(
opus_multistream_encoder_ctl
(
MSenc
,
OPUS_SET_PREDICTION_DISABLED
((
int
)(
fast_rand
()
&
15
)
<
(
pred
?
11
:
4
)))
!=
OPUS_OK
)
test_failed
();
frame_size
=
frame
[
j
];
...
...
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