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
a4461664
Commit
a4461664
authored
May 09, 2007
by
Ramiro Polla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify ptr[0]; ptr++; to *ptr++
Originally committed as revision 8965 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
5a2f421a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
14 deletions
+7
-14
pcm.c
libavcodec/pcm.c
+7
-14
No files found.
libavcodec/pcm.c
View file @
a4461664
...
...
@@ -282,29 +282,25 @@ static int pcm_encode_frame(AVCodecContext *avctx,
case
CODEC_ID_PCM_S8
:
for
(;
n
>
0
;
n
--
)
{
v
=
*
samples
++
;
dst
[
0
]
=
v
>>
8
;
dst
++
;
*
dst
++
=
v
>>
8
;
}
break
;
case
CODEC_ID_PCM_U8
:
for
(;
n
>
0
;
n
--
)
{
v
=
*
samples
++
;
dst
[
0
]
=
(
v
>>
8
)
+
128
;
dst
++
;
*
dst
++
=
(
v
>>
8
)
+
128
;
}
break
;
case
CODEC_ID_PCM_ALAW
:
for
(;
n
>
0
;
n
--
)
{
v
=
*
samples
++
;
dst
[
0
]
=
linear_to_alaw
[(
v
+
32768
)
>>
2
];
dst
++
;
*
dst
++
=
linear_to_alaw
[(
v
+
32768
)
>>
2
];
}
break
;
case
CODEC_ID_PCM_MULAW
:
for
(;
n
>
0
;
n
--
)
{
v
=
*
samples
++
;
dst
[
0
]
=
linear_to_ulaw
[(
v
+
32768
)
>>
2
];
dst
++
;
*
dst
++
=
linear_to_ulaw
[(
v
+
32768
)
>>
2
];
}
break
;
default:
...
...
@@ -447,23 +443,20 @@ static int pcm_decode_frame(AVCodecContext *avctx,
case
CODEC_ID_PCM_S8
:
n
=
buf_size
;
for
(;
n
>
0
;
n
--
)
{
*
samples
++
=
src
[
0
]
<<
8
;
src
++
;
*
samples
++
=
*
src
++
<<
8
;
}
break
;
case
CODEC_ID_PCM_U8
:
n
=
buf_size
;
for
(;
n
>
0
;
n
--
)
{
*
samples
++
=
((
int
)
src
[
0
]
-
128
)
<<
8
;
src
++
;
*
samples
++
=
((
int
)
*
src
++
-
128
)
<<
8
;
}
break
;
case
CODEC_ID_PCM_ALAW
:
case
CODEC_ID_PCM_MULAW
:
n
=
buf_size
;
for
(;
n
>
0
;
n
--
)
{
*
samples
++
=
s
->
table
[
src
[
0
]];
src
++
;
*
samples
++
=
s
->
table
[
*
src
++
];
}
break
;
default:
...
...
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