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
67a3b67c
Commit
67a3b67c
authored
Sep 28, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm_zork: use AV_SAMPLE_FMT_U8 instead of shifting all samples by 8.
parent
06af335a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
pcm.c
libavcodec/pcm.c
+11
-11
No files found.
libavcodec/pcm.c
View file @
67a3b67c
...
...
@@ -172,10 +172,11 @@ static int pcm_encode_frame(AVCodecContext *avctx,
dst
+=
n
*
sample_size
;
break
;
case
CODEC_ID_PCM_ZORK
:
for
(;
n
>
0
;
n
--
)
{
v
=
*
samples
++
>>
8
;
if
(
v
<
0
)
v
=
-
v
;
else
v
+=
128
;
srcu8
=
data
;
for
(;
n
>
0
;
n
--
)
{
v
=
*
srcu8
++
;
if
(
v
<
128
)
v
=
128
-
v
;
*
dst
++
=
v
;
}
break
;
...
...
@@ -387,12 +388,11 @@ static int pcm_decode_frame(AVCodecContext *avctx,
samples
+=
n
*
sample_size
;
break
;
case
CODEC_ID_PCM_ZORK
:
for
(;
n
>
0
;
n
--
)
{
int
x
=
*
src
++
;
if
(
x
&
128
)
x
-=
128
;
else
x
=
-
x
;
AV_WN16A
(
samples
,
x
<<
8
);
samples
+=
2
;
for
(;
n
>
0
;
n
--
)
{
int
v
=
*
src
++
;
if
(
v
<
128
)
v
=
128
-
v
;
*
samples
++
=
v
;
}
break
;
case
CODEC_ID_PCM_ALAW
:
...
...
@@ -518,4 +518,4 @@ PCM_CODEC (CODEC_ID_PCM_U24BE, AV_SAMPLE_FMT_S32, pcm_u24be, "PCM unsigned 24-b
PCM_CODEC
(
CODEC_ID_PCM_U24LE
,
AV_SAMPLE_FMT_S32
,
pcm_u24le
,
"PCM unsigned 24-bit little-endian"
);
PCM_CODEC
(
CODEC_ID_PCM_U32BE
,
AV_SAMPLE_FMT_S32
,
pcm_u32be
,
"PCM unsigned 32-bit big-endian"
);
PCM_CODEC
(
CODEC_ID_PCM_U32LE
,
AV_SAMPLE_FMT_S32
,
pcm_u32le
,
"PCM unsigned 32-bit little-endian"
);
PCM_CODEC
(
CODEC_ID_PCM_ZORK
,
AV_SAMPLE_FMT_
S16
,
pcm_zork
,
"PCM Zork"
);
PCM_CODEC
(
CODEC_ID_PCM_ZORK
,
AV_SAMPLE_FMT_
U8
,
pcm_zork
,
"PCM Zork"
);
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