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
b6e9c23d
Commit
b6e9c23d
authored
Feb 14, 2020
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/pcm_tablegen: nits, reindent
parent
e1c84856
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
pcm_tablegen.h
libavcodec/pcm_tablegen.h
+26
-26
No files found.
libavcodec/pcm_tablegen.h
View file @
b6e9c23d
...
...
@@ -45,48 +45,48 @@
/* alaw2linear() - Convert an A-law value to 16-bit linear PCM */
static
av_cold
int
alaw2linear
(
unsigned
char
a_val
)
{
int
t
;
int
seg
;
int
t
;
int
seg
;
a_val
^=
0x55
;
a_val
^=
0x55
;
t
=
a_val
&
QUANT_MASK
;
seg
=
((
unsigned
)
a_val
&
SEG_MASK
)
>>
SEG_SHIFT
;
if
(
seg
)
t
=
(
t
+
t
+
1
+
32
)
<<
(
seg
+
2
);
else
t
=
(
t
+
t
+
1
)
<<
3
;
t
=
a_val
&
QUANT_MASK
;
seg
=
((
unsigned
)
a_val
&
SEG_MASK
)
>>
SEG_SHIFT
;
if
(
seg
)
t
=
(
t
+
t
+
1
+
32
)
<<
(
seg
+
2
);
else
t
=
(
t
+
t
+
1
)
<<
3
;
return
(
a_val
&
SIGN_BIT
)
?
t
:
-
t
;
return
(
a_val
&
SIGN_BIT
)
?
t
:
-
t
;
}
static
av_cold
int
ulaw2linear
(
unsigned
char
u_val
)
{
int
t
;
int
t
;
/* Complement to obtain normal u-law value. */
u_val
=
~
u_val
;
/* Complement to obtain normal u-law value. */
u_val
=
~
u_val
;
/*
* Extract and bias the quantization bits. Then
* shift up by the segment number and subtract out the bias.
*/
t
=
((
u_val
&
QUANT_MASK
)
<<
3
)
+
BIAS
;
t
<<=
((
unsigned
)
u_val
&
SEG_MASK
)
>>
SEG_SHIFT
;
/*
* Extract and bias the quantization bits. Then
* shift up by the segment number and subtract out the bias.
*/
t
=
((
u_val
&
QUANT_MASK
)
<<
3
)
+
BIAS
;
t
<<=
((
unsigned
)
u_val
&
SEG_MASK
)
>>
SEG_SHIFT
;
return
(
u_val
&
SIGN_BIT
)
?
(
BIAS
-
t
)
:
(
t
-
BIAS
);
return
(
u_val
&
SIGN_BIT
)
?
(
BIAS
-
t
)
:
(
t
-
BIAS
);
}
static
av_cold
int
vidc2linear
(
unsigned
char
u_val
)
{
int
t
;
int
t
;
/*
* Extract and bias the quantization bits. Then
* shift up by the segment number and subtract out the bias.
*/
t
=
(((
u_val
&
VIDC_QUANT_MASK
)
>>
VIDC_QUANT_SHIFT
)
<<
3
)
+
BIAS
;
t
<<=
((
unsigned
)
u_val
&
VIDC_SEG_MASK
)
>>
VIDC_SEG_SHIFT
;
/*
* Extract and bias the quantization bits. Then
* shift up by the segment number and subtract out the bias.
*/
t
=
(((
u_val
&
VIDC_QUANT_MASK
)
>>
VIDC_QUANT_SHIFT
)
<<
3
)
+
BIAS
;
t
<<=
((
unsigned
)
u_val
&
VIDC_SEG_MASK
)
>>
VIDC_SEG_SHIFT
;
return
(
u_val
&
VIDC_SIGN_BIT
)
?
(
BIAS
-
t
)
:
(
t
-
BIAS
);
return
(
u_val
&
VIDC_SIGN_BIT
)
?
(
BIAS
-
t
)
:
(
t
-
BIAS
);
}
#if CONFIG_HARDCODED_TABLES
...
...
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