Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
e694831f
Commit
e694831f
authored
Oct 27, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cook: avoid hardcoded sizes in sizeof()
parent
776e9815
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
cook.c
libavcodec/cook.c
+11
-10
No files found.
libavcodec/cook.c
View file @
e694831f
...
...
@@ -215,7 +215,7 @@ static av_cold int init_cook_mlt(COOKContext *q) {
int
j
;
int
mlt_size
=
q
->
samples_per_channel
;
if
((
q
->
mlt_window
=
av_malloc
(
sizeof
(
float
)
*
mlt_size
))
==
0
)
if
((
q
->
mlt_window
=
av_malloc
(
mlt_size
*
sizeof
(
*
q
->
mlt_window
)
))
==
0
)
return
-
1
;
/* Initialize the MLT window: simple sine window. */
...
...
@@ -405,9 +405,9 @@ static void categorize(COOKContext *q, COOKSubpacket *p, int* quant_index_table,
//av_log(q->avctx, AV_LOG_ERROR, "bits_left = %d\n",bits_left);
}
memset
(
&
exp_index1
,
0
,
102
*
sizeof
(
int
));
memset
(
&
exp_index2
,
0
,
102
*
sizeof
(
int
));
memset
(
&
tmp_categorize_array
,
0
,
128
*
2
*
sizeof
(
int
));
memset
(
&
exp_index1
,
0
,
sizeof
(
exp_index1
));
memset
(
&
exp_index2
,
0
,
sizeof
(
exp_index2
));
memset
(
&
tmp_categorize_array
,
0
,
sizeof
(
tmp_categorize_array
));
bias
=-
32
;
...
...
@@ -628,8 +628,8 @@ static void mono_decode(COOKContext *q, COOKSubpacket *p, float* mlt_buffer) {
int
quant_index_table
[
102
];
int
category
[
128
];
memset
(
&
category
,
0
,
128
*
sizeof
(
int
));
memset
(
&
category_index
,
0
,
128
*
sizeof
(
int
));
memset
(
&
category
,
0
,
sizeof
(
category
));
memset
(
&
category_index
,
0
,
sizeof
(
category_index
));
decode_envelope
(
q
,
p
,
quant_index_table
);
q
->
num_vectors
=
get_bits
(
&
q
->
gb
,
p
->
log2_numvector_size
);
...
...
@@ -728,7 +728,8 @@ static void imlt_gain(COOKContext *q, float *inbuffer,
}
/* Save away the current to be previous block. */
memcpy
(
previous_buffer
,
buffer0
,
sizeof
(
float
)
*
q
->
samples_per_channel
);
memcpy
(
previous_buffer
,
buffer0
,
q
->
samples_per_channel
*
sizeof
(
*
previous_buffer
));
}
...
...
@@ -806,11 +807,11 @@ static void joint_decode(COOKContext *q, COOKSubpacket *p, float* mlt_buffer1,
const
float
*
cplscale
;
memset
(
decouple_tab
,
0
,
sizeof
(
decouple_tab
));
memset
(
decode_buffer
,
0
,
sizeof
(
decode_buffer
));
memset
(
decode_buffer
,
0
,
sizeof
(
q
->
decode_buffer_0
));
/* Make sure the buffers are zeroed out. */
memset
(
mlt_buffer1
,
0
,
1024
*
sizeof
(
float
));
memset
(
mlt_buffer2
,
0
,
1024
*
sizeof
(
float
));
memset
(
mlt_buffer1
,
0
,
1024
*
sizeof
(
*
mlt_buffer1
));
memset
(
mlt_buffer2
,
0
,
1024
*
sizeof
(
*
mlt_buffer2
));
decouple_info
(
q
,
p
,
decouple_tab
);
mono_decode
(
q
,
p
,
decode_buffer
);
...
...
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