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
b09c7eef
Commit
b09c7eef
authored
Sep 11, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dpcm: cosmetics: rename channel_number to ch
Make the code easier to read.
parent
f5e717f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
23 deletions
+23
-23
dpcm.c
libavcodec/dpcm.c
+23
-23
No files found.
libavcodec/dpcm.c
View file @
b09c7eef
...
...
@@ -168,7 +168,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx,
DPCMContext
*
s
=
avctx
->
priv_data
;
int
in
,
out
=
0
;
int
predictor
[
2
];
int
ch
annel_number
=
0
;
int
ch
=
0
;
short
*
output_samples
=
data
;
int
shift
[
2
];
unsigned
char
byte
;
...
...
@@ -195,12 +195,12 @@ static int dpcm_decode_frame(AVCodecContext *avctx,
/* decode the samples */
for
(
in
=
8
,
out
=
0
;
in
<
buf_size
;
in
++
,
out
++
)
{
predictor
[
ch
annel_number
]
+=
s
->
roq_square_array
[
buf
[
in
]];
predictor
[
ch
annel_number
]
=
av_clip_int16
(
predictor
[
channel_number
]);
output_samples
[
out
]
=
predictor
[
ch
annel_number
];
predictor
[
ch
]
+=
s
->
roq_square_array
[
buf
[
in
]];
predictor
[
ch
]
=
av_clip_int16
(
predictor
[
ch
]);
output_samples
[
out
]
=
predictor
[
ch
];
/* toggle channel */
ch
annel_number
^=
s
->
channels
-
1
;
ch
^=
s
->
channels
-
1
;
}
break
;
...
...
@@ -218,12 +218,12 @@ static int dpcm_decode_frame(AVCodecContext *avctx,
}
while
(
in
<
buf_size
)
{
predictor
[
ch
annel_number
]
+=
interplay_delta_table
[
buf
[
in
++
]];
predictor
[
ch
annel_number
]
=
av_clip_int16
(
predictor
[
channel_number
]);
output_samples
[
out
++
]
=
predictor
[
ch
annel_number
];
predictor
[
ch
]
+=
interplay_delta_table
[
buf
[
in
++
]];
predictor
[
ch
]
=
av_clip_int16
(
predictor
[
ch
]);
output_samples
[
out
++
]
=
predictor
[
ch
];
/* toggle channel */
ch
annel_number
^=
s
->
channels
-
1
;
ch
^=
s
->
channels
-
1
;
}
break
;
...
...
@@ -244,21 +244,21 @@ static int dpcm_decode_frame(AVCodecContext *avctx,
byte
=
buf
[
in
++
];
diff
=
(
byte
&
0xFC
)
<<
8
;
if
((
byte
&
0x03
)
==
3
)
shift
[
ch
annel_number
]
++
;
shift
[
ch
]
++
;
else
shift
[
ch
annel_number
]
-=
(
2
*
(
byte
&
3
));
shift
[
ch
]
-=
(
2
*
(
byte
&
3
));
/* saturate the shifter to a lower limit of 0 */
if
(
shift
[
ch
annel_number
]
<
0
)
shift
[
ch
annel_number
]
=
0
;
if
(
shift
[
ch
]
<
0
)
shift
[
ch
]
=
0
;
diff
>>=
shift
[
ch
annel_number
];
predictor
[
ch
annel_number
]
+=
diff
;
diff
>>=
shift
[
ch
];
predictor
[
ch
]
+=
diff
;
predictor
[
ch
annel_number
]
=
av_clip_int16
(
predictor
[
channel_number
]);
output_samples
[
out
++
]
=
predictor
[
ch
annel_number
];
predictor
[
ch
]
=
av_clip_int16
(
predictor
[
ch
]);
output_samples
[
out
++
]
=
predictor
[
ch
];
/* toggle channel */
ch
annel_number
^=
s
->
channels
-
1
;
ch
^=
s
->
channels
-
1
;
}
break
;
case
CODEC_ID_SOL_DPCM
:
...
...
@@ -283,12 +283,12 @@ static int dpcm_decode_frame(AVCodecContext *avctx,
while
(
in
<
buf_size
)
{
int
n
;
n
=
buf
[
in
++
];
if
(
n
&
0x80
)
s
->
sample
[
ch
annel_number
]
-=
s
->
sol_table
[
n
&
0x7F
];
else
s
->
sample
[
ch
annel_number
]
+=
s
->
sol_table
[
n
&
0x7F
];
s
->
sample
[
ch
annel_number
]
=
av_clip_int16
(
s
->
sample
[
channel_number
]);
output_samples
[
out
++
]
=
s
->
sample
[
ch
annel_number
];
if
(
n
&
0x80
)
s
->
sample
[
ch
]
-=
s
->
sol_table
[
n
&
0x7F
];
else
s
->
sample
[
ch
]
+=
s
->
sol_table
[
n
&
0x7F
];
s
->
sample
[
ch
]
=
av_clip_int16
(
s
->
sample
[
ch
]);
output_samples
[
out
++
]
=
s
->
sample
[
ch
];
/* toggle channel */
ch
annel_number
^=
s
->
channels
-
1
;
ch
^=
s
->
channels
-
1
;
}
}
break
;
...
...
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