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
b4b9a64b
Commit
b4b9a64b
authored
Feb 12, 2015
by
zhaoxiu.zeng
Committed by
Michael Niedermayer
Feb 13, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/vc1: simplify vc1_split()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
b39ac9d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
vc1_parser.c
libavcodec/vc1_parser.c
+11
-12
No files found.
libavcodec/vc1_parser.c
View file @
b4b9a64b
...
...
@@ -29,6 +29,7 @@
#include "parser.h"
#include "vc1.h"
#include "get_bits.h"
#include "internal.h"
/** The maximum number of bytes of a sequence, entry point or
* frame header whose values we pay any attention to */
...
...
@@ -250,20 +251,18 @@ static int vc1_parse(AVCodecParserContext *s,
static
int
vc1_split
(
AVCodecContext
*
avctx
,
const
uint8_t
*
buf
,
int
buf_size
)
{
int
i
;
uint32_t
state
=
-
1
;
int
charged
=
0
;
uint32_t
state
=
-
1
;
int
charged
=
0
;
const
uint8_t
*
ptr
=
buf
,
*
end
=
buf
+
buf_size
;
for
(
i
=
0
;
i
<
buf_size
;
i
++
){
state
=
(
state
<<
8
)
|
buf
[
i
];
if
(
IS_MARKER
(
state
)){
if
(
state
==
VC1_CODE_SEQHDR
||
state
==
VC1_CODE_ENTRYPOINT
){
charged
=
1
;
}
else
if
(
charged
){
return
i
-
3
;
}
}
while
(
ptr
<
end
)
{
ptr
=
avpriv_find_start_code
(
ptr
,
end
,
&
state
);
if
(
state
==
VC1_CODE_SEQHDR
||
state
==
VC1_CODE_ENTRYPOINT
)
{
charged
=
1
;
}
else
if
(
charged
&&
IS_MARKER
(
state
))
return
ptr
-
4
-
buf
;
}
return
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