Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
7d5aaa04
Commit
7d5aaa04
authored
17 years ago
by
Ramiro Polla
Browse files
Options
Downloads
Patches
Plain Diff
Factorize usum
Originally committed as revision 8960 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
13dec857
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/pcm.c
+4
-2
4 additions, 2 deletions
libavcodec/pcm.c
with
4 additions
and
2 deletions
libavcodec/pcm.c
+
4
−
2
View file @
7d5aaa04
...
@@ -169,12 +169,13 @@ static int pcm_encode_close(AVCodecContext *avctx)
...
@@ -169,12 +169,13 @@ static int pcm_encode_close(AVCodecContext *avctx)
*/
*/
static
inline
void
encode_from16
(
int
bps
,
int
le
,
int
us
,
static
inline
void
encode_from16
(
int
bps
,
int
le
,
int
us
,
short
**
samples
,
uint8_t
**
dst
,
int
n
)
{
short
**
samples
,
uint8_t
**
dst
,
int
n
)
{
int
usum
=
us
?
0x8000
:
0
;
if
(
bps
>
2
)
if
(
bps
>
2
)
memset
(
*
dst
,
0
,
n
*
bps
);
memset
(
*
dst
,
0
,
n
*
bps
);
if
(
le
)
*
dst
+=
bps
-
2
;
if
(
le
)
*
dst
+=
bps
-
2
;
for
(;
n
>
0
;
n
--
)
{
for
(;
n
>
0
;
n
--
)
{
register
int
v
=
*
(
*
samples
)
++
;
register
int
v
=
*
(
*
samples
)
++
;
if
(
us
)
v
+=
0x8000
;
v
+=
usum
;
(
*
dst
)[
le
]
=
v
>>
8
;
(
*
dst
)[
le
]
=
v
>>
8
;
(
*
dst
)[
1
-
le
]
=
v
;
(
*
dst
)[
1
-
le
]
=
v
;
*
dst
+=
bps
;
*
dst
+=
bps
;
...
@@ -361,10 +362,11 @@ static int pcm_decode_init(AVCodecContext * avctx)
...
@@ -361,10 +362,11 @@ static int pcm_decode_init(AVCodecContext * avctx)
static
inline
void
decode_to16
(
int
bps
,
int
le
,
int
us
,
static
inline
void
decode_to16
(
int
bps
,
int
le
,
int
us
,
uint8_t
**
src
,
short
**
samples
,
int
src_len
)
uint8_t
**
src
,
short
**
samples
,
int
src_len
)
{
{
int
usum
=
us
?
-
0x8000
:
0
;
register
int
n
=
src_len
/
bps
;
register
int
n
=
src_len
/
bps
;
if
(
le
)
*
src
+=
bps
-
2
;
if
(
le
)
*
src
+=
bps
-
2
;
for
(;
n
>
0
;
n
--
)
{
for
(;
n
>
0
;
n
--
)
{
*
(
*
samples
)
++
=
((
*
src
)[
le
]
<<
8
|
(
*
src
)[
1
-
le
])
-
(
us
?
0x8000
:
0
)
;
*
(
*
samples
)
++
=
((
*
src
)[
le
]
<<
8
|
(
*
src
)[
1
-
le
])
+
usum
;
*
src
+=
bps
;
*
src
+=
bps
;
}
}
if
(
le
)
*
src
-=
bps
-
2
;
if
(
le
)
*
src
-=
bps
-
2
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment