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
3b5ad8fb
Commit
3b5ad8fb
authored
Feb 13, 2015
by
Zhaoxiu Zeng
Committed by
Michael Niedermayer
Feb 14, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/parser: optimize ff_mpeg4video_split()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
ba22295e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
parser.c
libavcodec/parser.c
+6
-4
No files found.
libavcodec/parser.c
View file @
3b5ad8fb
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include "libavutil/mem.h"
#include "libavutil/mem.h"
#include "parser.h"
#include "parser.h"
#include "internal.h"
static
AVCodecParser
*
av_first_parser
=
NULL
;
static
AVCodecParser
*
av_first_parser
=
NULL
;
...
@@ -308,13 +309,14 @@ void ff_parse_close(AVCodecParserContext *s)
...
@@ -308,13 +309,14 @@ void ff_parse_close(AVCodecParserContext *s)
int
ff_mpeg4video_split
(
AVCodecContext
*
avctx
,
const
uint8_t
*
buf
,
int
buf_size
)
int
ff_mpeg4video_split
(
AVCodecContext
*
avctx
,
const
uint8_t
*
buf
,
int
buf_size
)
{
{
int
i
;
uint32_t
state
=
-
1
;
uint32_t
state
=
-
1
;
const
uint8_t
*
ptr
=
buf
,
*
end
=
buf
+
buf_size
;
for
(
i
=
0
;
i
<
buf_size
;
i
++
)
{
while
(
ptr
<
end
)
{
state
=
state
<<
8
|
buf
[
i
]
;
ptr
=
avpriv_find_start_code
(
ptr
,
end
,
&
state
)
;
if
(
state
==
0x1B3
||
state
==
0x1B6
)
if
(
state
==
0x1B3
||
state
==
0x1B6
)
return
i
-
3
;
return
ptr
-
4
-
buf
;
}
}
return
0
;
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