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
fa66237b
Commit
fa66237b
authored
Jan 11, 2016
by
Andreas Cadhalpun
Committed by
Luca Barbato
Jan 11, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: Use get_bitsz where needed
Signed-off-by:
Luca Barbato
<
lu_zero@gentoo.org
>
parent
62825236
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
15 deletions
+11
-15
atrac3plus.c
libavcodec/atrac3plus.c
+5
-8
escape124.c
libavcodec/escape124.c
+1
-1
wavpack.c
libavcodec/wavpack.c
+1
-1
wmalosslessdec.c
libavcodec/wmalosslessdec.c
+3
-4
wmaprodec.c
libavcodec/wmaprodec.c
+1
-1
No files found.
libavcodec/atrac3plus.c
View file @
fa66237b
...
...
@@ -39,9 +39,6 @@ static VLC spec_vlc_tabs[112];
static
VLC
gain_vlc_tabs
[
11
];
static
VLC
tone_vlc_tabs
[
7
];
#define GET_DELTA(gb, delta_bits) \
((delta_bits) ? get_bits((gb), (delta_bits)) : 0)
/**
* Generate canonical VLC table from given descriptor.
*
...
...
@@ -384,7 +381,7 @@ static int decode_channel_wordlen(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
chan
->
qu_wordlen
[
i
]
=
get_bits
(
gb
,
3
);
for
(
i
=
pos
;
i
<
chan
->
num_coded_vals
;
i
++
)
chan
->
qu_wordlen
[
i
]
=
(
min_val
+
GET_DELTA
(
gb
,
delta_bits
))
&
7
;
chan
->
qu_wordlen
[
i
]
=
(
min_val
+
get_bitsz
(
gb
,
delta_bits
))
&
7
;
}
}
break
;
...
...
@@ -516,7 +513,7 @@ static int decode_channel_sf_idx(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
/* all others are: min_val + delta */
for
(
i
=
num_long_vals
;
i
<
ctx
->
used_quant_units
;
i
++
)
chan
->
qu_sf_idx
[
i
]
=
(
chan
->
qu_sf_idx
[
i
]
+
min_val
+
GET_DELTA
(
gb
,
delta_bits
))
&
0x3F
;
get_bitsz
(
gb
,
delta_bits
))
&
0x3F
;
}
else
{
num_long_vals
=
get_bits
(
gb
,
5
);
delta_bits
=
get_bits
(
gb
,
3
);
...
...
@@ -534,7 +531,7 @@ static int decode_channel_sf_idx(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
/* all others are: min_val + delta */
for
(
i
=
num_long_vals
;
i
<
ctx
->
used_quant_units
;
i
++
)
chan
->
qu_sf_idx
[
i
]
=
(
min_val
+
GET_DELTA
(
gb
,
delta_bits
))
&
0x3F
;
get_bitsz
(
gb
,
delta_bits
))
&
0x3F
;
}
}
break
;
...
...
@@ -1014,7 +1011,7 @@ static int decode_gainc_npoints(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
min_val
=
get_bits
(
gb
,
3
);
for
(
i
=
0
;
i
<
coded_subbands
;
i
++
)
{
chan
->
gain_data
[
i
].
num_points
=
min_val
+
GET_DELTA
(
gb
,
delta_bits
);
chan
->
gain_data
[
i
].
num_points
=
min_val
+
get_bitsz
(
gb
,
delta_bits
);
if
(
chan
->
gain_data
[
i
].
num_points
>
7
)
return
AVERROR_INVALIDDATA
;
}
...
...
@@ -1134,7 +1131,7 @@ static int decode_gainc_levels(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
for
(
sb
=
0
;
sb
<
coded_subbands
;
sb
++
)
for
(
i
=
0
;
i
<
chan
->
gain_data
[
sb
].
num_points
;
i
++
)
{
chan
->
gain_data
[
sb
].
lev_code
[
i
]
=
min_val
+
GET_DELTA
(
gb
,
delta_bits
);
chan
->
gain_data
[
sb
].
lev_code
[
i
]
=
min_val
+
get_bitsz
(
gb
,
delta_bits
);
if
(
chan
->
gain_data
[
sb
].
lev_code
[
i
]
>
15
)
return
AVERROR_INVALIDDATA
;
}
...
...
libavcodec/escape124.c
View file @
fa66237b
...
...
@@ -159,7 +159,7 @@ static MacroBlock decode_macroblock(Escape124Context* s, GetBitContext* gb,
// depth = 0 means that this shouldn't read any bits;
// in theory, this is the same as get_bits(gb, 0), but
// that doesn't actually work.
block_index
=
depth
?
get_bits
(
gb
,
depth
)
:
0
;
block_index
=
get_bitsz
(
gb
,
depth
)
;
if
(
*
codebook_index
==
1
)
{
block_index
+=
superblock_index
<<
s
->
codebooks
[
1
].
depth
;
...
...
libavcodec/wavpack.c
View file @
fa66237b
...
...
@@ -248,7 +248,7 @@ static av_always_inline int get_tail(GetBitContext *gb, int k)
return
0
;
p
=
av_log2
(
k
);
e
=
(
1
<<
(
p
+
1
))
-
k
-
1
;
res
=
p
?
get_bits
(
gb
,
p
)
:
0
;
res
=
get_bitsz
(
gb
,
p
)
;
if
(
res
>=
e
)
res
=
(
res
<<
1
)
-
e
+
get_bits1
(
gb
);
return
res
;
...
...
libavcodec/wmalosslessdec.c
View file @
fa66237b
...
...
@@ -411,8 +411,7 @@ static void decode_ac_filter(WmallDecodeCtx *s)
s
->
acfilter_scaling
=
get_bits
(
&
s
->
gb
,
4
);
for
(
i
=
0
;
i
<
s
->
acfilter_order
;
i
++
)
s
->
acfilter_coeffs
[
i
]
=
(
s
->
acfilter_scaling
?
get_bits
(
&
s
->
gb
,
s
->
acfilter_scaling
)
:
0
)
+
1
;
s
->
acfilter_coeffs
[
i
]
=
get_bitsz
(
&
s
->
gb
,
s
->
acfilter_scaling
)
+
1
;
}
static
void
decode_mclms
(
WmallDecodeCtx
*
s
)
...
...
@@ -425,7 +424,7 @@ static void decode_mclms(WmallDecodeCtx *s)
if
(
1
<<
cbits
<
s
->
mclms_scaling
+
1
)
cbits
++
;
send_coef_bits
=
(
cbits
?
get_bits
(
&
s
->
gb
,
cbits
)
:
0
)
+
2
;
send_coef_bits
=
get_bitsz
(
&
s
->
gb
,
cbits
)
+
2
;
for
(
i
=
0
;
i
<
s
->
mclms_order
*
s
->
num_channels
*
s
->
num_channels
;
i
++
)
s
->
mclms_coeffs
[
i
]
=
get_bits
(
&
s
->
gb
,
send_coef_bits
);
...
...
@@ -471,7 +470,7 @@ static int decode_cdlms(WmallDecodeCtx *s)
if
((
1
<<
cbits
)
<
s
->
cdlms
[
c
][
i
].
scaling
+
1
)
cbits
++
;
s
->
cdlms
[
c
][
i
].
bitsend
=
get_bits
(
&
s
->
gb
,
cbits
)
+
2
;
s
->
cdlms
[
c
][
i
].
bitsend
=
get_bits
z
(
&
s
->
gb
,
cbits
)
+
2
;
shift_l
=
32
-
s
->
cdlms
[
c
][
i
].
bitsend
;
shift_r
=
32
-
s
->
cdlms
[
c
][
i
].
scaling
-
2
;
for
(
j
=
0
;
j
<
s
->
cdlms
[
c
][
i
].
coefsend
;
j
++
)
...
...
libavcodec/wmaprodec.c
View file @
fa66237b
...
...
@@ -1145,7 +1145,7 @@ static int decode_subframe(WMAProDecodeCtx *s)
int
num_fill_bits
;
if
(
!
(
num_fill_bits
=
get_bits
(
&
s
->
gb
,
2
)))
{
int
len
=
get_bits
(
&
s
->
gb
,
4
);
num_fill_bits
=
get_bits
(
&
s
->
gb
,
len
)
+
1
;
num_fill_bits
=
get_bits
z
(
&
s
->
gb
,
len
)
+
1
;
}
if
(
num_fill_bits
>=
0
)
{
...
...
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