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
a15d904a
Commit
a15d904a
authored
Nov 24, 2019
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: Replace get_bits_long() by get_bits() where possible
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
9a8471e3
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
23 additions
and
23 deletions
+23
-23
bgmc.c
libavcodec/bgmc.c
+1
-1
binkaudio.c
libavcodec/binkaudio.c
+1
-1
escape124.c
libavcodec/escape124.c
+1
-1
flac.c
libavcodec/flac.c
+2
-2
flvdec.c
libavcodec/flvdec.c
+1
-1
hevc_sei.c
libavcodec/hevc_sei.c
+2
-2
indeo5.c
libavcodec/indeo5.c
+2
-2
intelh263dec.c
libavcodec/intelh263dec.c
+1
-1
ivi.c
libavcodec/ivi.c
+1
-1
mjpegdec.c
libavcodec/mjpegdec.c
+1
-1
mlp_parse.c
libavcodec/mlp_parse.c
+1
-1
mpeg4videodec.c
libavcodec/mpeg4videodec.c
+1
-1
truemotion2.c
libavcodec/truemotion2.c
+1
-1
vp3.c
libavcodec/vp3.c
+5
-5
vp9.c
libavcodec/vp9.c
+2
-2
No files found.
libavcodec/bgmc.c
View file @
a15d904a
...
...
@@ -493,7 +493,7 @@ int ff_bgmc_decode_init(GetBitContext *gb, unsigned int *h,
*
h
=
TOP_VALUE
;
*
l
=
0
;
*
v
=
get_bits
_long
(
gb
,
VALUE_BITS
);
*
v
=
get_bits
(
gb
,
VALUE_BITS
);
return
0
;
}
...
...
libavcodec/binkaudio.c
View file @
a15d904a
...
...
@@ -153,7 +153,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
static
float
get_float
(
GetBitContext
*
gb
)
{
int
power
=
get_bits
(
gb
,
5
);
float
f
=
ldexpf
(
get_bits
_long
(
gb
,
23
),
power
-
23
);
float
f
=
ldexpf
(
get_bits
(
gb
,
23
),
power
-
23
);
if
(
get_bits1
(
gb
))
f
=
-
f
;
return
f
;
...
...
libavcodec/escape124.c
View file @
a15d904a
...
...
@@ -252,7 +252,7 @@ static int escape124_decode_frame(AVCodecContext *avctx,
if
(
i
==
2
)
{
// This codebook can be cut off at places other than
// powers of 2, leaving some of the entries undefined.
cb_size
=
get_bits
_long
(
&
gb
,
20
);
cb_size
=
get_bits
(
&
gb
,
20
);
if
(
!
cb_size
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid codebook size 0.
\n
"
);
return
AVERROR_INVALIDDATA
;
...
...
libavcodec/flac.c
View file @
a15d904a
...
...
@@ -217,9 +217,9 @@ int ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
}
skip_bits
(
&
gb
,
24
);
/* skip min frame size */
s
->
max_framesize
=
get_bits
_long
(
&
gb
,
24
);
s
->
max_framesize
=
get_bits
(
&
gb
,
24
);
s
->
samplerate
=
get_bits
_long
(
&
gb
,
20
);
s
->
samplerate
=
get_bits
(
&
gb
,
20
);
s
->
channels
=
get_bits
(
&
gb
,
3
)
+
1
;
s
->
bps
=
get_bits
(
&
gb
,
5
)
+
1
;
...
...
libavcodec/flvdec.c
View file @
a15d904a
...
...
@@ -30,7 +30,7 @@ int ff_flv_decode_picture_header(MpegEncContext *s)
int
format
,
width
,
height
;
/* picture header */
if
(
get_bits
_long
(
&
s
->
gb
,
17
)
!=
1
)
{
if
(
get_bits
(
&
s
->
gb
,
17
)
!=
1
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Bad picture start code
\n
"
);
return
AVERROR_INVALIDDATA
;
}
...
...
libavcodec/hevc_sei.c
View file @
a15d904a
...
...
@@ -76,8 +76,8 @@ static int decode_nal_sei_mastering_display_info(HEVCSEIMasteringDisplay *s, Get
static
int
decode_nal_sei_content_light_info
(
HEVCSEIContentLight
*
s
,
GetBitContext
*
gb
)
{
// Max and average light levels
s
->
max_content_light_level
=
get_bits
_long
(
gb
,
16
);
s
->
max_pic_average_light_level
=
get_bits
_long
(
gb
,
16
);
s
->
max_content_light_level
=
get_bits
(
gb
,
16
);
s
->
max_pic_average_light_level
=
get_bits
(
gb
,
16
);
// As this SEI message comes before the first frame that references it,
// initialize the flag to 2 and decrement on IRAP access unit so it
// persists for the coded video sequence (e.g., between two IRAPs)
...
...
libavcodec/indeo5.c
View file @
a15d904a
...
...
@@ -348,7 +348,7 @@ static int decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx)
if
(
ctx
->
frame_type
!=
FRAMETYPE_NULL
)
{
ctx
->
frame_flags
=
get_bits
(
&
ctx
->
gb
,
8
);
ctx
->
pic_hdr_size
=
(
ctx
->
frame_flags
&
1
)
?
get_bits
_long
(
&
ctx
->
gb
,
24
)
:
0
;
ctx
->
pic_hdr_size
=
(
ctx
->
frame_flags
&
1
)
?
get_bits
(
&
ctx
->
gb
,
24
)
:
0
;
ctx
->
checksum
=
(
ctx
->
frame_flags
&
0x10
)
?
get_bits
(
&
ctx
->
gb
,
16
)
:
0
;
...
...
@@ -392,7 +392,7 @@ static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band,
return
0
;
}
band
->
data_size
=
(
ctx
->
frame_flags
&
0x80
)
?
get_bits
_long
(
&
ctx
->
gb
,
24
)
:
0
;
band
->
data_size
=
(
ctx
->
frame_flags
&
0x80
)
?
get_bits
(
&
ctx
->
gb
,
24
)
:
0
;
band
->
inherit_mv
=
band_flags
&
2
;
band
->
inherit_qdelta
=
band_flags
&
8
;
...
...
libavcodec/intelh263dec.c
View file @
a15d904a
...
...
@@ -33,7 +33,7 @@ int ff_intel_h263_decode_picture_header(MpegEncContext *s)
}
/* picture header */
if
(
get_bits
_long
(
&
s
->
gb
,
22
)
!=
0x20
)
{
if
(
get_bits
(
&
s
->
gb
,
22
)
!=
0x20
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Bad picture start code
\n
"
);
return
-
1
;
}
...
...
libavcodec/ivi.c
View file @
a15d904a
...
...
@@ -476,7 +476,7 @@ static int ivi_dec_tile_data_size(GetBitContext *gb)
if
(
get_bits1
(
gb
))
{
len
=
get_bits
(
gb
,
8
);
if
(
len
==
255
)
len
=
get_bits
_long
(
gb
,
24
);
len
=
get_bits
(
gb
,
24
);
}
/* align the bitstream reader on the byte boundary */
...
...
libavcodec/mjpegdec.c
View file @
a15d904a
...
...
@@ -2049,7 +2049,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
unsigned
nummarkers
;
id
=
get_bits_long
(
&
s
->
gb
,
32
);
id2
=
get_bits
_long
(
&
s
->
gb
,
24
);
id2
=
get_bits
(
&
s
->
gb
,
24
);
len
-=
7
;
if
(
id
!=
AV_RB32
(
"PROF"
)
||
id2
!=
AV_RB24
(
"ILE"
))
{
av_log
(
s
->
avctx
,
AV_LOG_WARNING
,
"Invalid ICC_PROFILE header in APP2
\n
"
);
...
...
libavcodec/mlp_parse.c
View file @
a15d904a
...
...
@@ -102,7 +102,7 @@ int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb)
return
AVERROR_INVALIDDATA
;
}
if
(
get_bits
_long
(
gb
,
24
)
!=
0xf8726f
)
/* Sync words */
if
(
get_bits
(
gb
,
24
)
!=
0xf8726f
)
/* Sync words */
return
AVERROR_INVALIDDATA
;
mh
->
stream_type
=
get_bits
(
gb
,
8
);
...
...
libavcodec/mpeg4videodec.c
View file @
a15d904a
...
...
@@ -1001,7 +1001,7 @@ int ff_mpeg4_decode_partitions(Mpeg4DecContext *ctx)
if
(
s
->
pict_type
==
AV_PICTURE_TYPE_I
)
{
while
(
show_bits
(
&
s
->
gb
,
9
)
==
1
)
skip_bits
(
&
s
->
gb
,
9
);
if
(
get_bits
_long
(
&
s
->
gb
,
19
)
!=
DC_MARKER
)
{
if
(
get_bits
(
&
s
->
gb
,
19
)
!=
DC_MARKER
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"marker missing after first I partition at %d %d
\n
"
,
s
->
mb_x
,
s
->
mb_y
);
...
...
libavcodec/truemotion2.c
View file @
a15d904a
...
...
@@ -155,7 +155,7 @@ static int tm2_build_huff_table(TM2Context *ctx, TM2Codes *code)
huff
.
val_bits
=
get_bits
(
&
ctx
->
gb
,
5
);
huff
.
max_bits
=
get_bits
(
&
ctx
->
gb
,
5
);
huff
.
min_bits
=
get_bits
(
&
ctx
->
gb
,
5
);
huff
.
nodes
=
get_bits
_long
(
&
ctx
->
gb
,
17
);
huff
.
nodes
=
get_bits
(
&
ctx
->
gb
,
17
);
huff
.
num
=
0
;
/* check for correct codes parameters */
...
...
libavcodec/vp3.c
View file @
a15d904a
...
...
@@ -2967,7 +2967,7 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
AVRational
fps
,
aspect
;
s
->
theora_header
=
0
;
s
->
theora
=
get_bits
_long
(
gb
,
24
);
s
->
theora
=
get_bits
(
gb
,
24
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Theora bitstream version %X
\n
"
,
s
->
theora
);
if
(
!
s
->
theora
)
{
s
->
theora
=
1
;
...
...
@@ -2988,8 +2988,8 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
s
->
height
=
get_bits
(
gb
,
16
)
<<
4
;
if
(
s
->
theora
>=
0x030200
)
{
visible_width
=
get_bits
_long
(
gb
,
24
);
visible_height
=
get_bits
_long
(
gb
,
24
);
visible_width
=
get_bits
(
gb
,
24
);
visible_height
=
get_bits
(
gb
,
24
);
offset_x
=
get_bits
(
gb
,
8
);
/* offset x */
offset_y
=
get_bits
(
gb
,
8
);
/* offset y, from bottom */
...
...
@@ -3017,8 +3017,8 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
fps
.
den
,
fps
.
num
,
1
<<
30
);
}
aspect
.
num
=
get_bits
_long
(
gb
,
24
);
aspect
.
den
=
get_bits
_long
(
gb
,
24
);
aspect
.
num
=
get_bits
(
gb
,
24
);
aspect
.
den
=
get_bits
(
gb
,
24
);
if
(
aspect
.
num
&&
aspect
.
den
)
{
av_reduce
(
&
avctx
->
sample_aspect_ratio
.
num
,
&
avctx
->
sample_aspect_ratio
.
den
,
...
...
libavcodec/vp9.c
View file @
a15d904a
...
...
@@ -514,7 +514,7 @@ static int decode_frame_header(AVCodecContext *avctx,
s
->
s
.
h
.
use_last_frame_mvs
=
!
s
->
s
.
h
.
errorres
&&
!
last_invisible
;
if
(
s
->
s
.
h
.
keyframe
)
{
if
(
get_bits
_long
(
&
s
->
gb
,
24
)
!=
VP9_SYNCCODE
)
{
// synccode
if
(
get_bits
(
&
s
->
gb
,
24
)
!=
VP9_SYNCCODE
)
{
// synccode
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid sync code
\n
"
);
return
AVERROR_INVALIDDATA
;
}
...
...
@@ -530,7 +530,7 @@ static int decode_frame_header(AVCodecContext *avctx,
s
->
s
.
h
.
intraonly
=
s
->
s
.
h
.
invisible
?
get_bits1
(
&
s
->
gb
)
:
0
;
s
->
s
.
h
.
resetctx
=
s
->
s
.
h
.
errorres
?
0
:
get_bits
(
&
s
->
gb
,
2
);
if
(
s
->
s
.
h
.
intraonly
)
{
if
(
get_bits
_long
(
&
s
->
gb
,
24
)
!=
VP9_SYNCCODE
)
{
// synccode
if
(
get_bits
(
&
s
->
gb
,
24
)
!=
VP9_SYNCCODE
)
{
// synccode
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid sync code
\n
"
);
return
AVERROR_INVALIDDATA
;
}
...
...
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