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
593af7cd
Commit
593af7cd
authored
Dec 23, 2008
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize esc removal code.
Originally committed as revision 16294 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
ffedb5c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
h264.c
libavcodec/h264.c
+11
-4
No files found.
libavcodec/h264.c
View file @
593af7cd
...
...
@@ -1423,21 +1423,28 @@ static const uint8_t *decode_nal(H264Context *h, const uint8_t *src, int *dst_le
}
//printf("decoding esc\n");
si
=
di
=
0
;
while
(
si
<
length
){
memcpy
(
dst
,
src
,
i
);
si
=
di
=
i
;
while
(
si
+
2
<
length
){
//remove escapes (very rare 1:2^22)
if
(
si
+
2
<
length
&&
src
[
si
]
==
0
&&
src
[
si
+
1
]
==
0
&&
src
[
si
+
2
]
<=
3
){
if
(
src
[
si
+
2
]
>
3
){
dst
[
di
++
]
=
src
[
si
++
];
dst
[
di
++
]
=
src
[
si
++
];
}
else
if
(
src
[
si
]
==
0
&&
src
[
si
+
1
]
==
0
){
if
(
src
[
si
+
2
]
==
3
){
//escape
dst
[
di
++
]
=
0
;
dst
[
di
++
]
=
0
;
si
+=
3
;
continue
;
}
else
//next start code
break
;
goto
nsc
;
}
dst
[
di
++
]
=
src
[
si
++
];
}
while
(
si
<
length
)
dst
[
di
++
]
=
src
[
si
++
];
nsc
:
memset
(
dst
+
di
,
0
,
FF_INPUT_BUFFER_PADDING_SIZE
);
...
...
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