Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
81d54531
Commit
81d54531
authored
Nov 15, 2019
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/av1dec: simplify annexb_probe()
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
27030681
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
av1dec.c
libavformat/av1dec.c
+13
-10
No files found.
libavformat/av1dec.c
View file @
81d54531
...
@@ -75,7 +75,7 @@ static int annexb_probe(const AVProbeData *p)
...
@@ -75,7 +75,7 @@ static int annexb_probe(const AVProbeData *p)
AVIOContext
pb
;
AVIOContext
pb
;
int64_t
obu_size
;
int64_t
obu_size
;
uint32_t
temporal_unit_size
,
frame_unit_size
,
obu_unit_size
;
uint32_t
temporal_unit_size
,
frame_unit_size
,
obu_unit_size
;
int
seq
=
0
,
frame_header
=
0
;
int
seq
=
0
;
int
ret
,
type
,
cnt
=
0
;
int
ret
,
type
,
cnt
=
0
;
ffio_init_context
(
&
pb
,
p
->
buf
,
p
->
buf_size
,
0
,
ffio_init_context
(
&
pb
,
p
->
buf
,
p
->
buf_size
,
0
,
...
@@ -123,22 +123,25 @@ static int annexb_probe(const AVProbeData *p)
...
@@ -123,22 +123,25 @@ static int annexb_probe(const AVProbeData *p)
return
0
;
return
0
;
cnt
+=
obu_unit_size
;
cnt
+=
obu_unit_size
;
if
(
type
==
AV1_OBU_SEQUENCE_HEADER
)
switch
(
type
)
{
case
AV1_OBU_SEQUENCE_HEADER
:
seq
=
1
;
seq
=
1
;
if
(
type
==
AV1_OBU_FRAME
||
type
==
AV1_OBU_FRAME_HEADER
)
{
if
(
frame_header
||
!
seq
)
return
0
;
frame_header
=
1
;
break
;
break
;
}
case
AV1_OBU_FRAME
:
if
(
type
==
AV1_OBU_TILE_GROUP
&&
!
frame_header
)
case
AV1_OBU_FRAME_HEADER
:
return
seq
?
AVPROBE_SCORE_EXTENSION
+
1
:
0
;
case
AV1_OBU_TILE_GROUP
:
case
AV1_OBU_TEMPORAL_DELIMITER
:
return
0
;
return
0
;
default:
break
;
}
temporal_unit_size
-=
obu_unit_size
+
ret
;
temporal_unit_size
-=
obu_unit_size
+
ret
;
frame_unit_size
-=
obu_unit_size
+
ret
;
frame_unit_size
-=
obu_unit_size
+
ret
;
}
while
(
!
frame_header
&&
frame_unit_size
);
}
while
(
frame_unit_size
);
return
frame_header
?
AVPROBE_SCORE_EXTENSION
+
1
:
0
;
return
0
;
}
}
static
int
annexb_read_header
(
AVFormatContext
*
s
)
static
int
annexb_read_header
(
AVFormatContext
*
s
)
...
...
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