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
8572dbc5
Commit
8572dbc5
authored
Sep 13, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/ac3en: use FF_ALLOC(Z)_ARRAY()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
bcac0f40
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
23 deletions
+23
-23
ac3enc.c
libavcodec/ac3enc.c
+23
-23
No files found.
libavcodec/ac3enc.c
View file @
8572dbc5
...
...
@@ -2327,50 +2327,50 @@ static av_cold int allocate_buffers(AC3EncodeContext *s)
if
(
s
->
allocate_sample_buffers
(
s
))
goto
alloc_fail
;
FF_ALLOC_
OR_GOTO
(
avctx
,
s
->
bap_buffer
,
total_coefs
*
FF_ALLOC_
ARRAY_OR_GOTO
(
avctx
,
s
->
bap_buffer
,
total_coefs
,
sizeof
(
*
s
->
bap_buffer
),
alloc_fail
);
FF_ALLOC_
OR_GOTO
(
avctx
,
s
->
bap1_buffer
,
total_coefs
*
FF_ALLOC_
ARRAY_OR_GOTO
(
avctx
,
s
->
bap1_buffer
,
total_coefs
,
sizeof
(
*
s
->
bap1_buffer
),
alloc_fail
);
FF_ALLOCZ_
OR_GOTO
(
avctx
,
s
->
mdct_coef_buffer
,
total_coefs
*
FF_ALLOCZ_
ARRAY_OR_GOTO
(
avctx
,
s
->
mdct_coef_buffer
,
total_coefs
,
sizeof
(
*
s
->
mdct_coef_buffer
),
alloc_fail
);
FF_ALLOC_
OR_GOTO
(
avctx
,
s
->
exp_buffer
,
total_coefs
*
FF_ALLOC_
ARRAY_OR_GOTO
(
avctx
,
s
->
exp_buffer
,
total_coefs
,
sizeof
(
*
s
->
exp_buffer
),
alloc_fail
);
FF_ALLOC_
OR_GOTO
(
avctx
,
s
->
grouped_exp_buffer
,
channel_blocks
*
128
*
FF_ALLOC_
ARRAY_OR_GOTO
(
avctx
,
s
->
grouped_exp_buffer
,
channel_blocks
,
128
*
sizeof
(
*
s
->
grouped_exp_buffer
),
alloc_fail
);
FF_ALLOC_
OR_GOTO
(
avctx
,
s
->
psd_buffer
,
total_coefs
*
FF_ALLOC_
ARRAY_OR_GOTO
(
avctx
,
s
->
psd_buffer
,
total_coefs
,
sizeof
(
*
s
->
psd_buffer
),
alloc_fail
);
FF_ALLOC_
OR_GOTO
(
avctx
,
s
->
band_psd_buffer
,
channel_blocks
*
64
*
FF_ALLOC_
ARRAY_OR_GOTO
(
avctx
,
s
->
band_psd_buffer
,
channel_blocks
,
64
*
sizeof
(
*
s
->
band_psd_buffer
),
alloc_fail
);
FF_ALLOC_
OR_GOTO
(
avctx
,
s
->
mask_buffer
,
channel_blocks
*
64
*
FF_ALLOC_
ARRAY_OR_GOTO
(
avctx
,
s
->
mask_buffer
,
channel_blocks
,
64
*
sizeof
(
*
s
->
mask_buffer
),
alloc_fail
);
FF_ALLOC_
OR_GOTO
(
avctx
,
s
->
qmant_buffer
,
total_coefs
*
FF_ALLOC_
ARRAY_OR_GOTO
(
avctx
,
s
->
qmant_buffer
,
total_coefs
,
sizeof
(
*
s
->
qmant_buffer
),
alloc_fail
);
if
(
s
->
cpl_enabled
)
{
FF_ALLOC_
OR_GOTO
(
avctx
,
s
->
cpl_coord_exp_buffer
,
channel_blocks
*
16
*
FF_ALLOC_
ARRAY_OR_GOTO
(
avctx
,
s
->
cpl_coord_exp_buffer
,
channel_blocks
,
16
*
sizeof
(
*
s
->
cpl_coord_exp_buffer
),
alloc_fail
);
FF_ALLOC_
OR_GOTO
(
avctx
,
s
->
cpl_coord_mant_buffer
,
channel_blocks
*
16
*
FF_ALLOC_
ARRAY_OR_GOTO
(
avctx
,
s
->
cpl_coord_mant_buffer
,
channel_blocks
,
16
*
sizeof
(
*
s
->
cpl_coord_mant_buffer
),
alloc_fail
);
}
for
(
blk
=
0
;
blk
<
s
->
num_blocks
;
blk
++
)
{
AC3Block
*
block
=
&
s
->
blocks
[
blk
];
FF_ALLOCZ_
OR_GOTO
(
avctx
,
block
->
mdct_coef
,
channels
*
sizeof
(
*
block
->
mdct_coef
),
FF_ALLOCZ_
ARRAY_OR_GOTO
(
avctx
,
block
->
mdct_coef
,
channels
,
sizeof
(
*
block
->
mdct_coef
),
alloc_fail
);
FF_ALLOCZ_
OR_GOTO
(
avctx
,
block
->
exp
,
channels
*
sizeof
(
*
block
->
exp
),
FF_ALLOCZ_
ARRAY_OR_GOTO
(
avctx
,
block
->
exp
,
channels
,
sizeof
(
*
block
->
exp
),
alloc_fail
);
FF_ALLOCZ_
OR_GOTO
(
avctx
,
block
->
grouped_exp
,
channels
*
sizeof
(
*
block
->
grouped_exp
),
FF_ALLOCZ_
ARRAY_OR_GOTO
(
avctx
,
block
->
grouped_exp
,
channels
,
sizeof
(
*
block
->
grouped_exp
),
alloc_fail
);
FF_ALLOCZ_
OR_GOTO
(
avctx
,
block
->
psd
,
channels
*
sizeof
(
*
block
->
psd
),
FF_ALLOCZ_
ARRAY_OR_GOTO
(
avctx
,
block
->
psd
,
channels
,
sizeof
(
*
block
->
psd
),
alloc_fail
);
FF_ALLOCZ_
OR_GOTO
(
avctx
,
block
->
band_psd
,
channels
*
sizeof
(
*
block
->
band_psd
),
FF_ALLOCZ_
ARRAY_OR_GOTO
(
avctx
,
block
->
band_psd
,
channels
,
sizeof
(
*
block
->
band_psd
),
alloc_fail
);
FF_ALLOCZ_
OR_GOTO
(
avctx
,
block
->
mask
,
channels
*
sizeof
(
*
block
->
mask
),
FF_ALLOCZ_
ARRAY_OR_GOTO
(
avctx
,
block
->
mask
,
channels
,
sizeof
(
*
block
->
mask
),
alloc_fail
);
FF_ALLOCZ_
OR_GOTO
(
avctx
,
block
->
qmant
,
channels
*
sizeof
(
*
block
->
qmant
),
FF_ALLOCZ_
ARRAY_OR_GOTO
(
avctx
,
block
->
qmant
,
channels
,
sizeof
(
*
block
->
qmant
),
alloc_fail
);
if
(
s
->
cpl_enabled
)
{
FF_ALLOCZ_
OR_GOTO
(
avctx
,
block
->
cpl_coord_exp
,
channels
*
sizeof
(
*
block
->
cpl_coord_exp
),
FF_ALLOCZ_
ARRAY_OR_GOTO
(
avctx
,
block
->
cpl_coord_exp
,
channels
,
sizeof
(
*
block
->
cpl_coord_exp
),
alloc_fail
);
FF_ALLOCZ_
OR_GOTO
(
avctx
,
block
->
cpl_coord_mant
,
channels
*
sizeof
(
*
block
->
cpl_coord_mant
),
FF_ALLOCZ_
ARRAY_OR_GOTO
(
avctx
,
block
->
cpl_coord_mant
,
channels
,
sizeof
(
*
block
->
cpl_coord_mant
),
alloc_fail
);
}
...
...
@@ -2393,11 +2393,11 @@ static av_cold int allocate_buffers(AC3EncodeContext *s)
}
if
(
!
s
->
fixed_point
)
{
FF_ALLOCZ_
OR_GOTO
(
avctx
,
s
->
fixed_coef_buffer
,
total_coefs
*
FF_ALLOCZ_
ARRAY_OR_GOTO
(
avctx
,
s
->
fixed_coef_buffer
,
total_coefs
,
sizeof
(
*
s
->
fixed_coef_buffer
),
alloc_fail
);
for
(
blk
=
0
;
blk
<
s
->
num_blocks
;
blk
++
)
{
AC3Block
*
block
=
&
s
->
blocks
[
blk
];
FF_ALLOCZ_
OR_GOTO
(
avctx
,
block
->
fixed_coef
,
channels
*
FF_ALLOCZ_
ARRAY_OR_GOTO
(
avctx
,
block
->
fixed_coef
,
channels
,
sizeof
(
*
block
->
fixed_coef
),
alloc_fail
);
for
(
ch
=
0
;
ch
<
channels
;
ch
++
)
block
->
fixed_coef
[
ch
]
=
&
s
->
fixed_coef_buffer
[
AC3_MAX_COEFS
*
(
s
->
num_blocks
*
ch
+
blk
)];
...
...
@@ -2405,7 +2405,7 @@ static av_cold int allocate_buffers(AC3EncodeContext *s)
}
else
{
for
(
blk
=
0
;
blk
<
s
->
num_blocks
;
blk
++
)
{
AC3Block
*
block
=
&
s
->
blocks
[
blk
];
FF_ALLOCZ_
OR_GOTO
(
avctx
,
block
->
fixed_coef
,
channels
*
FF_ALLOCZ_
ARRAY_OR_GOTO
(
avctx
,
block
->
fixed_coef
,
channels
,
sizeof
(
*
block
->
fixed_coef
),
alloc_fail
);
for
(
ch
=
0
;
ch
<
channels
;
ch
++
)
block
->
fixed_coef
[
ch
]
=
(
int32_t
*
)
block
->
mdct_coef
[
ch
];
...
...
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