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
98f7b56b
Commit
98f7b56b
authored
Jul 06, 2007
by
Aurelien Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move ff_copy_bits to bitstream.c
Originally committed as revision 9503 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
3662aa76
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
25 deletions
+25
-25
bitstream.c
libavcodec/bitstream.c
+24
-0
bitstream.h
libavcodec/bitstream.h
+1
-0
mpegvideo.h
libavcodec/mpegvideo.h
+0
-1
mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+0
-24
No files found.
libavcodec/bitstream.c
View file @
98f7b56b
...
...
@@ -60,6 +60,30 @@ void ff_put_string(PutBitContext * pbc, char *s, int put_zero)
put_bits
(
pbc
,
8
,
0
);
}
void
ff_copy_bits
(
PutBitContext
*
pb
,
uint8_t
*
src
,
int
length
)
{
const
uint16_t
*
srcw
=
(
uint16_t
*
)
src
;
int
words
=
length
>>
4
;
int
bits
=
length
&
15
;
int
i
;
if
(
length
==
0
)
return
;
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
+
i
,
2
*
words
-
i
);
skip_put_bytes
(
pb
,
2
*
words
-
i
);
}
put_bits
(
pb
,
bits
,
be2me_16
(
srcw
[
words
])
>>
(
16
-
bits
));
}
/* VLC decoding */
//#define DEBUG_VLC
...
...
libavcodec/bitstream.h
View file @
98f7b56b
...
...
@@ -137,6 +137,7 @@ static inline void flush_put_bits(PutBitContext *s)
void
align_put_bits
(
PutBitContext
*
s
);
void
ff_put_string
(
PutBitContext
*
pbc
,
char
*
s
,
int
put_zero
);
void
ff_copy_bits
(
PutBitContext
*
pb
,
uint8_t
*
src
,
int
length
);
/* bit input */
/* buffer, buffer_end and size_in_bits must be present and used by every reader */
...
...
libavcodec/mpegvideo.h
View file @
98f7b56b
...
...
@@ -717,7 +717,6 @@ void MPV_common_init_armv4l(MpegEncContext *s);
void
MPV_common_init_ppc
(
MpegEncContext
*
s
);
#endif
extern
void
(
*
draw_edges
)(
uint8_t
*
buf
,
int
wrap
,
int
width
,
int
height
,
int
w
);
void
ff_copy_bits
(
PutBitContext
*
pb
,
uint8_t
*
src
,
int
length
);
void
ff_clean_intra_table_entries
(
MpegEncContext
*
s
);
void
ff_init_scantable
(
uint8_t
*
,
ScanTable
*
st
,
const
uint8_t
*
src_scantable
);
void
ff_draw_horiz_band
(
MpegEncContext
*
s
,
int
y
,
int
h
);
...
...
libavcodec/mpegvideo_enc.c
View file @
98f7b56b
...
...
@@ -1734,30 +1734,6 @@ static av_always_inline void encode_mb(MpegEncContext *s, int motion_x, int moti
else
encode_mb_internal
(
s
,
motion_x
,
motion_y
,
16
,
8
);
}
void
ff_copy_bits
(
PutBitContext
*
pb
,
uint8_t
*
src
,
int
length
)
{
const
uint16_t
*
srcw
=
(
uint16_t
*
)
src
;
int
words
=
length
>>
4
;
int
bits
=
length
&
15
;
int
i
;
if
(
length
==
0
)
return
;
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
+
i
,
2
*
words
-
i
);
skip_put_bytes
(
pb
,
2
*
words
-
i
);
}
put_bits
(
pb
,
bits
,
be2me_16
(
srcw
[
words
])
>>
(
16
-
bits
));
}
static
inline
void
copy_context_before_encode
(
MpegEncContext
*
d
,
MpegEncContext
*
s
,
int
type
){
int
i
;
...
...
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