Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
32c61400
Commit
32c61400
authored
Feb 06, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apedec: use sizeof(field) instead of sizeof(type)
parent
21449410
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
apedec.c
libavcodec/apedec.c
+10
-8
No files found.
libavcodec/apedec.c
View file @
32c61400
...
@@ -474,8 +474,8 @@ static void entropy_decode(APEContext *ctx, int blockstodecode, int stereo)
...
@@ -474,8 +474,8 @@ static void entropy_decode(APEContext *ctx, int blockstodecode, int stereo)
if
(
ctx
->
frameflags
&
APE_FRAMECODE_STEREO_SILENCE
)
{
if
(
ctx
->
frameflags
&
APE_FRAMECODE_STEREO_SILENCE
)
{
/* We are pure silence, just memset the output buffer. */
/* We are pure silence, just memset the output buffer. */
memset
(
decoded0
,
0
,
blockstodecode
*
sizeof
(
int32_t
));
memset
(
decoded0
,
0
,
blockstodecode
*
sizeof
(
*
decoded0
));
memset
(
decoded1
,
0
,
blockstodecode
*
sizeof
(
int32_t
));
memset
(
decoded1
,
0
,
blockstodecode
*
sizeof
(
*
decoded1
));
}
else
{
}
else
{
while
(
blockstodecode
--
)
{
while
(
blockstodecode
--
)
{
*
decoded0
++
=
ape_decode_value
(
ctx
,
&
ctx
->
riceY
);
*
decoded0
++
=
ape_decode_value
(
ctx
,
&
ctx
->
riceY
);
...
@@ -525,7 +525,7 @@ static void init_predictor_decoder(APEContext *ctx)
...
@@ -525,7 +525,7 @@ static void init_predictor_decoder(APEContext *ctx)
APEPredictor
*
p
=
&
ctx
->
predictor
;
APEPredictor
*
p
=
&
ctx
->
predictor
;
/* Zero the history buffers */
/* Zero the history buffers */
memset
(
p
->
historybuffer
,
0
,
PREDICTOR_SIZE
*
sizeof
(
int32_t
));
memset
(
p
->
historybuffer
,
0
,
PREDICTOR_SIZE
*
sizeof
(
*
p
->
historybuffer
));
p
->
buf
=
p
->
historybuffer
;
p
->
buf
=
p
->
historybuffer
;
/* Initialize and zero the coefficients */
/* Initialize and zero the coefficients */
...
@@ -610,7 +610,8 @@ static void predictor_decode_stereo(APEContext *ctx, int count)
...
@@ -610,7 +610,8 @@ static void predictor_decode_stereo(APEContext *ctx, int count)
/* Have we filled the history buffer? */
/* Have we filled the history buffer? */
if
(
p
->
buf
==
p
->
historybuffer
+
HISTORY_SIZE
)
{
if
(
p
->
buf
==
p
->
historybuffer
+
HISTORY_SIZE
)
{
memmove
(
p
->
historybuffer
,
p
->
buf
,
PREDICTOR_SIZE
*
sizeof
(
int32_t
));
memmove
(
p
->
historybuffer
,
p
->
buf
,
PREDICTOR_SIZE
*
sizeof
(
*
p
->
historybuffer
));
p
->
buf
=
p
->
historybuffer
;
p
->
buf
=
p
->
historybuffer
;
}
}
}
}
...
@@ -650,7 +651,8 @@ static void predictor_decode_mono(APEContext *ctx, int count)
...
@@ -650,7 +651,8 @@ static void predictor_decode_mono(APEContext *ctx, int count)
/* Have we filled the history buffer? */
/* Have we filled the history buffer? */
if
(
p
->
buf
==
p
->
historybuffer
+
HISTORY_SIZE
)
{
if
(
p
->
buf
==
p
->
historybuffer
+
HISTORY_SIZE
)
{
memmove
(
p
->
historybuffer
,
p
->
buf
,
PREDICTOR_SIZE
*
sizeof
(
int32_t
));
memmove
(
p
->
historybuffer
,
p
->
buf
,
PREDICTOR_SIZE
*
sizeof
(
*
p
->
historybuffer
));
p
->
buf
=
p
->
historybuffer
;
p
->
buf
=
p
->
historybuffer
;
}
}
...
@@ -668,8 +670,8 @@ static void do_init_filter(APEFilter *f, int16_t *buf, int order)
...
@@ -668,8 +670,8 @@ static void do_init_filter(APEFilter *f, int16_t *buf, int order)
f
->
delay
=
f
->
historybuffer
+
order
*
2
;
f
->
delay
=
f
->
historybuffer
+
order
*
2
;
f
->
adaptcoeffs
=
f
->
historybuffer
+
order
;
f
->
adaptcoeffs
=
f
->
historybuffer
+
order
;
memset
(
f
->
historybuffer
,
0
,
(
order
*
2
)
*
sizeof
(
int16_t
));
memset
(
f
->
historybuffer
,
0
,
(
order
*
2
)
*
sizeof
(
*
f
->
historybuffer
));
memset
(
f
->
coeffs
,
0
,
order
*
sizeof
(
int16_t
));
memset
(
f
->
coeffs
,
0
,
order
*
sizeof
(
*
f
->
coeffs
));
f
->
avg
=
0
;
f
->
avg
=
0
;
}
}
...
@@ -725,7 +727,7 @@ static void do_apply_filter(APEContext *ctx, int version, APEFilter *f,
...
@@ -725,7 +727,7 @@ static void do_apply_filter(APEContext *ctx, int version, APEFilter *f,
/* Have we filled the history buffer? */
/* Have we filled the history buffer? */
if
(
f
->
delay
==
f
->
historybuffer
+
HISTORY_SIZE
+
(
order
*
2
))
{
if
(
f
->
delay
==
f
->
historybuffer
+
HISTORY_SIZE
+
(
order
*
2
))
{
memmove
(
f
->
historybuffer
,
f
->
delay
-
(
order
*
2
),
memmove
(
f
->
historybuffer
,
f
->
delay
-
(
order
*
2
),
(
order
*
2
)
*
sizeof
(
int16_t
));
(
order
*
2
)
*
sizeof
(
*
f
->
historybuffer
));
f
->
delay
=
f
->
historybuffer
+
order
*
2
;
f
->
delay
=
f
->
historybuffer
+
order
*
2
;
f
->
adaptcoeffs
=
f
->
historybuffer
+
order
;
f
->
adaptcoeffs
=
f
->
historybuffer
+
order
;
}
}
...
...
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