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
b6335c9f
Commit
b6335c9f
authored
Feb 14, 2004
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ff_copy_bits() optimization
Originally committed as revision 2777 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
842b556a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
mpegvideo.c
libavcodec/mpegvideo.c
+10
-5
No files found.
libavcodec/mpegvideo.c
View file @
b6335c9f
...
...
@@ -3732,21 +3732,26 @@ void ff_mpeg_flush(AVCodecContext *avctx){
#ifdef CONFIG_ENCODERS
void
ff_copy_bits
(
PutBitContext
*
pb
,
uint8_t
*
src
,
int
length
)
{
const
uint16_t
*
srcw
=
src
;
int
words
=
length
>>
4
;
int
bits
=
length
&
15
;
int
i
;
if
(
length
==
0
)
return
;
if
(
put_bits_count
(
pb
)
&
7
){
for
(
i
=
0
;
i
<
words
;
i
++
)
put_bits
(
pb
,
16
,
be2me_16
(((
uint16_t
*
)
src
)[
i
]));
if
(
words
<
16
){
for
(
i
=
0
;
i
<
words
;
i
++
)
put_bits
(
pb
,
16
,
be2me_16
(
srcw
[
i
]));
}
else
if
(
put_bits_count
(
pb
)
&
7
){
for
(
i
=
0
;
i
<
words
;
i
++
)
put_bits
(
pb
,
16
,
be2me_16
(
srcw
[
i
]));
}
else
{
for
(
i
=
0
;
put_bits_count
(
pb
)
&
31
;
i
++
)
put_bits
(
pb
,
8
,
src
[
i
]);
flush_put_bits
(
pb
);
memcpy
(
pbBufPtr
(
pb
),
src
,
2
*
words
);
skip_put_bytes
(
pb
,
2
*
words
);
memcpy
(
pbBufPtr
(
pb
),
src
+
i
,
2
*
words
-
i
);
skip_put_bytes
(
pb
,
2
*
words
-
i
);
}
put_bits
(
pb
,
bits
,
be2me_16
(
((
uint16_t
*
)
src
)
[
words
])
>>
(
16
-
bits
));
put_bits
(
pb
,
bits
,
be2me_16
(
srcw
[
words
])
>>
(
16
-
bits
));
}
static
inline
void
copy_context_before_encode
(
MpegEncContext
*
d
,
MpegEncContext
*
s
,
int
type
){
...
...
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