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
9b888fb1
Commit
9b888fb1
authored
Apr 18, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/roqvideoenc: use av_malloc(z)_array()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
591c0c26
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
roqvideoenc.c
libavcodec/roqvideoenc.c
+10
-10
No files found.
libavcodec/roqvideoenc.c
View file @
9b888fb1
...
...
@@ -249,7 +249,7 @@ static void create_cel_evals(RoqContext *enc, RoqTempdata *tempData)
{
int
n
=
0
,
x
,
y
,
i
;
tempData
->
cel_evals
=
av_malloc
(
enc
->
width
*
enc
->
height
/
64
*
sizeof
(
CelEvaluation
));
tempData
->
cel_evals
=
av_malloc
_array
(
enc
->
width
*
enc
->
height
/
64
,
sizeof
(
CelEvaluation
));
/* Map to the ROQ quadtree order */
for
(
y
=
0
;
y
<
enc
->
height
;
y
+=
16
)
...
...
@@ -799,11 +799,11 @@ static void generate_codebook(RoqContext *enc, RoqTempdata *tempdata,
int
i
,
j
,
k
;
int
c_size
=
size
*
size
/
4
;
int
*
buf
;
int
*
codebook
=
av_malloc
(
6
*
c_size
*
cbsize
*
sizeof
(
int
));
int
*
codebook
=
av_malloc
_array
(
6
*
c_size
,
cbsize
*
sizeof
(
int
));
int
*
closest_cb
;
if
(
size
==
4
)
closest_cb
=
av_malloc
(
6
*
c_size
*
inputCount
*
sizeof
(
int
));
closest_cb
=
av_malloc
_array
(
6
*
c_size
,
inputCount
*
sizeof
(
int
));
else
closest_cb
=
tempdata
->
closest_cb2
;
...
...
@@ -834,8 +834,8 @@ static void generate_new_codebooks(RoqContext *enc, RoqTempdata *tempData)
int
max
=
enc
->
width
*
enc
->
height
/
16
;
uint8_t
mb2
[
3
*
4
];
roq_cell
*
results4
=
av_malloc
(
sizeof
(
roq_cell
)
*
MAX_CBS_4x4
*
4
);
uint8_t
*
yuvClusters
=
av_malloc
(
sizeof
(
int
)
*
max
*
6
*
4
);
int
*
points
=
av_malloc
(
max
*
6
*
4
*
sizeof
(
int
));
uint8_t
*
yuvClusters
=
av_malloc
_array
(
max
,
sizeof
(
int
)
*
6
*
4
);
int
*
points
=
av_malloc
_array
(
max
,
6
*
4
*
sizeof
(
int
));
int
bias
;
/* Subsample YUV data */
...
...
@@ -852,7 +852,7 @@ static void generate_new_codebooks(RoqContext *enc, RoqTempdata *tempData)
codebooks
->
numCB4
=
(
enc
->
quake3_compat
?
MAX_CBS_4x4
-
1
:
MAX_CBS_4x4
);
tempData
->
closest_cb2
=
av_malloc
(
max
*
4
*
sizeof
(
int
));
tempData
->
closest_cb2
=
av_malloc
_array
(
max
,
4
*
sizeof
(
int
));
/* Create 2x2 codebooks */
generate_codebook
(
enc
,
tempData
,
points
,
max
*
4
,
enc
->
cb2x2
,
2
,
MAX_CBS_2x2
);
...
...
@@ -985,16 +985,16 @@ static av_cold int roq_encode_init(AVCodecContext *avctx)
enc
->
tmpData
=
av_malloc
(
sizeof
(
RoqTempdata
));
enc
->
this_motion4
=
av_mallocz
((
enc
->
width
*
enc
->
height
/
16
)
*
sizeof
(
motion_vect
));
av_mallocz
_array
((
enc
->
width
*
enc
->
height
/
16
),
sizeof
(
motion_vect
));
enc
->
last_motion4
=
av_malloc
((
enc
->
width
*
enc
->
height
/
16
)
*
sizeof
(
motion_vect
));
av_malloc
_array
((
enc
->
width
*
enc
->
height
/
16
),
sizeof
(
motion_vect
));
enc
->
this_motion8
=
av_mallocz
((
enc
->
width
*
enc
->
height
/
64
)
*
sizeof
(
motion_vect
));
av_mallocz
_array
((
enc
->
width
*
enc
->
height
/
64
),
sizeof
(
motion_vect
));
enc
->
last_motion8
=
av_malloc
((
enc
->
width
*
enc
->
height
/
64
)
*
sizeof
(
motion_vect
));
av_malloc
_array
((
enc
->
width
*
enc
->
height
/
64
),
sizeof
(
motion_vect
));
return
0
;
}
...
...
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