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
9f51c682
Commit
9f51c682
authored
Oct 17, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: use avpriv_ prefix for ff_copy_bits and align_put_bits.
They are used in lavf.
parent
6f89efea
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
38 additions
and
38 deletions
+38
-38
aacenc.c
libavcodec/aacenc.c
+1
-1
asv1.c
libavcodec/asv1.c
+1
-1
bitstream.c
libavcodec/bitstream.c
+2
-2
cljr.c
libavcodec/cljr.c
+1
-1
flvenc.c
libavcodec/flvenc.c
+1
-1
h261enc.c
libavcodec/h261enc.c
+1
-1
ituh263enc.c
libavcodec/ituh263enc.c
+1
-1
jpeglsenc.c
libavcodec/jpeglsenc.c
+1
-1
mpeg12enc.c
libavcodec/mpeg12enc.c
+1
-1
mpeg4audio.c
libavcodec/mpeg4audio.c
+1
-1
mpeg4videoenc.c
libavcodec/mpeg4videoenc.c
+2
-2
mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+5
-5
msmpeg4.c
libavcodec/msmpeg4.c
+1
-1
put_bits.h
libavcodec/put_bits.h
+4
-4
rv10enc.c
libavcodec/rv10enc.c
+1
-1
svq1enc.c
libavcodec/svq1enc.c
+2
-2
vcr1.c
libavcodec/vcr1.c
+1
-1
wmaenc.c
libavcodec/wmaenc.c
+2
-2
wmaprodec.c
libavcodec/wmaprodec.c
+2
-2
wmavoice.c
libavcodec/wmavoice.c
+2
-2
xsubenc.c
libavcodec/xsubenc.c
+2
-2
latmenc.c
libavformat/latmenc.c
+3
-3
No files found.
libavcodec/aacenc.c
View file @
9f51c682
...
...
@@ -482,7 +482,7 @@ static void put_bitstream_info(AVCodecContext *avctx, AACEncContext *s,
put_bits
(
&
s
->
pb
,
8
,
namelen
-
16
);
put_bits
(
&
s
->
pb
,
4
,
0
);
//extension type - filler
padbits
=
8
-
(
put_bits_count
(
&
s
->
pb
)
&
7
);
align_put_bits
(
&
s
->
pb
);
a
vpriv_a
lign_put_bits
(
&
s
->
pb
);
for
(
i
=
0
;
i
<
namelen
-
2
;
i
++
)
put_bits
(
&
s
->
pb
,
8
,
name
[
i
]);
put_bits
(
&
s
->
pb
,
12
-
padbits
,
0
);
...
...
libavcodec/asv1.c
View file @
9f51c682
...
...
@@ -497,7 +497,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
}
emms_c
();
align_put_bits
(
&
a
->
pb
);
a
vpriv_a
lign_put_bits
(
&
a
->
pb
);
while
(
put_bits_count
(
&
a
->
pb
)
&
31
)
put_bits
(
&
a
->
pb
,
8
,
0
);
...
...
libavcodec/bitstream.c
View file @
9f51c682
...
...
@@ -41,7 +41,7 @@ const uint8_t ff_log2_run[41]={
24
,
};
void
align_put_bits
(
PutBitContext
*
s
)
void
a
vpriv_a
lign_put_bits
(
PutBitContext
*
s
)
{
put_bits
(
s
,
s
->
bit_left
&
7
,
0
);
}
...
...
@@ -56,7 +56,7 @@ void ff_put_string(PutBitContext *pb, const char *string, int terminate_string)
put_bits
(
pb
,
8
,
0
);
}
void
ff
_copy_bits
(
PutBitContext
*
pb
,
const
uint8_t
*
src
,
int
length
)
void
avpriv
_copy_bits
(
PutBitContext
*
pb
,
const
uint8_t
*
src
,
int
length
)
{
int
words
=
length
>>
4
;
int
bits
=
length
&
15
;
...
...
libavcodec/cljr.c
View file @
9f51c682
...
...
@@ -105,7 +105,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
emms_c
();
align_put_bits
(
&
a
->
pb
);
a
vpriv_a
lign_put_bits
(
&
a
->
pb
);
while
(
get_bit_count
(
&
a
->
pb
)
&
31
)
put_bits
(
&
a
->
pb
,
8
,
0
);
...
...
libavcodec/flvenc.c
View file @
9f51c682
...
...
@@ -25,7 +25,7 @@ void ff_flv_encode_picture_header(MpegEncContext * s, int picture_number)
{
int
format
;
align_put_bits
(
&
s
->
pb
);
a
vpriv_a
lign_put_bits
(
&
s
->
pb
);
put_bits
(
&
s
->
pb
,
17
,
1
);
put_bits
(
&
s
->
pb
,
5
,
(
s
->
h263_flv
-
1
));
/* 0: h263 escape codes 1: 11-bit escape codes */
...
...
libavcodec/h261enc.c
View file @
9f51c682
...
...
@@ -53,7 +53,7 @@ void ff_h261_encode_picture_header(MpegEncContext * s, int picture_number){
H261Context
*
h
=
(
H261Context
*
)
s
;
int
format
,
temp_ref
;
align_put_bits
(
&
s
->
pb
);
a
vpriv_a
lign_put_bits
(
&
s
->
pb
);
/* Update the pointer to last GOB */
s
->
ptr_lastgob
=
put_bits_ptr
(
&
s
->
pb
);
...
...
libavcodec/ituh263enc.c
View file @
9f51c682
...
...
@@ -126,7 +126,7 @@ void h263_encode_picture_header(MpegEncContext * s, int picture_number)
coded_frame_rate
=
1800000
;
coded_frame_rate_base
=
(
1000
+
best_clock_code
)
*
best_divisor
;
align_put_bits
(
&
s
->
pb
);
a
vpriv_a
lign_put_bits
(
&
s
->
pb
);
/* Update the pointer to last GOB */
s
->
ptr_lastgob
=
put_bits_ptr
(
&
s
->
pb
);
...
...
libavcodec/jpeglsenc.c
View file @
9f51c682
...
...
@@ -357,7 +357,7 @@ static int encode_picture_ls(AVCodecContext *avctx, unsigned char *buf, int buf_
put_bits
(
&
pb
,
8
,
v
);
}
}
align_put_bits
(
&
pb
);
a
vpriv_a
lign_put_bits
(
&
pb
);
av_free
(
buf2
);
/* End of image */
...
...
libavcodec/mpeg12enc.c
View file @
9f51c682
...
...
@@ -192,7 +192,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
static
void
put_header
(
MpegEncContext
*
s
,
int
header
)
{
align_put_bits
(
&
s
->
pb
);
a
vpriv_a
lign_put_bits
(
&
s
->
pb
);
put_bits
(
&
s
->
pb
,
16
,
header
>>
16
);
put_sbits
(
&
s
->
pb
,
16
,
header
);
}
...
...
libavcodec/mpeg4audio.c
View file @
9f51c682
...
...
@@ -173,7 +173,7 @@ int avpriv_copy_pce_data(PutBitContext *pb, GetBitContext *gb)
copy_bits
(
pb
,
gb
,
16
);
if
(
bits
)
copy_bits
(
pb
,
gb
,
bits
);
align_put_bits
(
pb
);
a
vpriv_a
lign_put_bits
(
pb
);
align_get_bits
(
gb
);
comment_size
=
copy_bits
(
pb
,
gb
,
8
);
for
(;
comment_size
>
0
;
comment_size
--
)
...
...
libavcodec/mpeg4videoenc.c
View file @
9f51c682
...
...
@@ -1258,8 +1258,8 @@ void ff_mpeg4_merge_partitions(MpegEncContext *s)
flush_put_bits
(
&
s
->
tex_pb
);
set_put_bits_buffer_size
(
&
s
->
pb
,
s
->
pb2
.
buf_end
-
s
->
pb
.
buf
);
ff
_copy_bits
(
&
s
->
pb
,
s
->
pb2
.
buf
,
pb2_len
);
ff
_copy_bits
(
&
s
->
pb
,
s
->
tex_pb
.
buf
,
tex_pb_len
);
avpriv
_copy_bits
(
&
s
->
pb
,
s
->
pb2
.
buf
,
pb2_len
);
avpriv
_copy_bits
(
&
s
->
pb
,
s
->
tex_pb
.
buf
,
tex_pb_len
);
s
->
last_bits
=
put_bits_count
(
&
s
->
pb
);
}
...
...
libavcodec/mpegvideo_enc.c
View file @
9f51c682
...
...
@@ -2044,7 +2044,7 @@ static void write_slice_end(MpegEncContext *s){
ff_mjpeg_encode_stuffing
(
&
s
->
pb
);
}
align_put_bits
(
&
s
->
pb
);
a
vpriv_a
lign_put_bits
(
&
s
->
pb
);
flush_put_bits
(
&
s
->
pb
);
if
((
s
->
flags
&
CODEC_FLAG_PASS1
)
&&
!
s
->
partitioned_frame
)
...
...
@@ -2480,18 +2480,18 @@ static int encode_thread(AVCodecContext *c, void *arg){
pb_bits_count
=
put_bits_count
(
&
s
->
pb
);
flush_put_bits
(
&
s
->
pb
);
ff
_copy_bits
(
&
backup_s
.
pb
,
bit_buf
[
next_block
^
1
],
pb_bits_count
);
avpriv
_copy_bits
(
&
backup_s
.
pb
,
bit_buf
[
next_block
^
1
],
pb_bits_count
);
s
->
pb
=
backup_s
.
pb
;
if
(
s
->
data_partitioning
){
pb2_bits_count
=
put_bits_count
(
&
s
->
pb2
);
flush_put_bits
(
&
s
->
pb2
);
ff
_copy_bits
(
&
backup_s
.
pb2
,
bit_buf2
[
next_block
^
1
],
pb2_bits_count
);
avpriv
_copy_bits
(
&
backup_s
.
pb2
,
bit_buf2
[
next_block
^
1
],
pb2_bits_count
);
s
->
pb2
=
backup_s
.
pb2
;
tex_pb_bits_count
=
put_bits_count
(
&
s
->
tex_pb
);
flush_put_bits
(
&
s
->
tex_pb
);
ff
_copy_bits
(
&
backup_s
.
tex_pb
,
bit_buf_tex
[
next_block
^
1
],
tex_pb_bits_count
);
avpriv
_copy_bits
(
&
backup_s
.
tex_pb
,
bit_buf_tex
[
next_block
^
1
],
tex_pb_bits_count
);
s
->
tex_pb
=
backup_s
.
tex_pb
;
}
s
->
last_bits
=
put_bits_count
(
&
s
->
pb
);
...
...
@@ -2714,7 +2714,7 @@ static void merge_context_after_encode(MpegEncContext *dst, MpegEncContext *src)
assert
(
put_bits_count
(
&
src
->
pb
)
%
8
==
0
);
assert
(
put_bits_count
(
&
dst
->
pb
)
%
8
==
0
);
ff
_copy_bits
(
&
dst
->
pb
,
src
->
pb
.
buf
,
put_bits_count
(
&
src
->
pb
));
avpriv
_copy_bits
(
&
dst
->
pb
,
src
->
pb
.
buf
,
put_bits_count
(
&
src
->
pb
));
flush_put_bits
(
&
dst
->
pb
);
}
...
...
libavcodec/msmpeg4.c
View file @
9f51c682
...
...
@@ -351,7 +351,7 @@ void msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
{
find_best_tables
(
s
);
align_put_bits
(
&
s
->
pb
);
a
vpriv_a
lign_put_bits
(
&
s
->
pb
);
put_bits
(
&
s
->
pb
,
2
,
s
->
pict_type
-
1
);
put_bits
(
&
s
->
pb
,
5
,
s
->
qscale
);
...
...
libavcodec/put_bits.h
View file @
9f51c682
...
...
@@ -97,14 +97,14 @@ static inline void flush_put_bits(PutBitContext *s)
}
#ifdef BITSTREAM_WRITER_LE
#define align_put_bits align_put_bits_unsupported_here
#define a
vpriv_a
lign_put_bits align_put_bits_unsupported_here
#define ff_put_string ff_put_string_unsupported_here
#define
ff_copy_bits ff
_copy_bits_unsupported_here
#define
avpriv_copy_bits avpriv
_copy_bits_unsupported_here
#else
/**
* Pad the bitstream with zeros up to the next byte boundary.
*/
void
align_put_bits
(
PutBitContext
*
s
);
void
a
vpriv_a
lign_put_bits
(
PutBitContext
*
s
);
/**
* Put the string string in the bitstream.
...
...
@@ -118,7 +118,7 @@ void ff_put_string(PutBitContext *pb, const char *string, int terminate_string);
*
* @param length the number of bits of src to copy
*/
void
ff
_copy_bits
(
PutBitContext
*
pb
,
const
uint8_t
*
src
,
int
length
);
void
avpriv
_copy_bits
(
PutBitContext
*
pb
,
const
uint8_t
*
src
,
int
length
);
#endif
/**
...
...
libavcodec/rv10enc.c
View file @
9f51c682
...
...
@@ -32,7 +32,7 @@ void rv10_encode_picture_header(MpegEncContext *s, int picture_number)
{
int
full_frame
=
0
;
align_put_bits
(
&
s
->
pb
);
a
vpriv_a
lign_put_bits
(
&
s
->
pb
);
put_bits
(
&
s
->
pb
,
1
,
1
);
/* marker */
...
...
libavcodec/svq1enc.c
View file @
9f51c682
...
...
@@ -461,7 +461,7 @@ static int svq1_encode_plane(SVQ1Context *s, int plane, unsigned char *src_plane
s
->
rd_total
+=
score
[
best
];
for
(
i
=
5
;
i
>=
0
;
i
--
){
ff
_copy_bits
(
&
s
->
pb
,
reorder_buffer
[
best
][
i
],
count
[
best
][
i
]);
avpriv
_copy_bits
(
&
s
->
pb
,
reorder_buffer
[
best
][
i
],
count
[
best
][
i
]);
}
if
(
best
==
0
){
s
->
dsp
.
put_pixels_tab
[
0
][
0
](
decoded
,
temp
,
stride
,
16
);
...
...
@@ -540,7 +540,7 @@ static int svq1_encode_frame(AVCodecContext *avctx, unsigned char *buf,
return
-
1
;
}
// align_put_bits(&s->pb);
// a
vpriv_a
lign_put_bits(&s->pb);
while
(
put_bits_count
(
&
s
->
pb
)
&
31
)
put_bits
(
&
s
->
pb
,
1
,
0
);
...
...
libavcodec/vcr1.c
View file @
9f51c682
...
...
@@ -132,7 +132,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
emms_c
();
align_put_bits
(
&
a
->
pb
);
a
vpriv_a
lign_put_bits
(
&
a
->
pb
);
while
(
get_bit_count
(
&
a
->
pb
)
&
31
)
put_bits
(
&
a
->
pb
,
8
,
0
);
...
...
libavcodec/wmaenc.c
View file @
9f51c682
...
...
@@ -311,7 +311,7 @@ static int encode_block(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE],
put_bits
(
&
s
->
pb
,
s
->
coef_vlcs
[
tindex
]
->
huffbits
[
1
],
s
->
coef_vlcs
[
tindex
]
->
huffcodes
[
1
]);
}
if
(
s
->
version
==
1
&&
s
->
nb_channels
>=
2
)
{
align_put_bits
(
&
s
->
pb
);
a
vpriv_a
lign_put_bits
(
&
s
->
pb
);
}
}
return
0
;
...
...
@@ -327,7 +327,7 @@ static int encode_frame(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE],
return
INT_MAX
;
}
align_put_bits
(
&
s
->
pb
);
a
vpriv_a
lign_put_bits
(
&
s
->
pb
);
return
put_bits_count
(
&
s
->
pb
)
/
8
-
s
->
block_align
;
}
...
...
libavcodec/wmaprodec.c
View file @
9f51c682
...
...
@@ -1446,14 +1446,14 @@ static void save_bits(WMAProDecodeCtx *s, GetBitContext* gb, int len,
s
->
num_saved_bits
+=
len
;
if
(
!
append
)
{
ff
_copy_bits
(
&
s
->
pb
,
gb
->
buffer
+
(
get_bits_count
(
gb
)
>>
3
),
avpriv
_copy_bits
(
&
s
->
pb
,
gb
->
buffer
+
(
get_bits_count
(
gb
)
>>
3
),
s
->
num_saved_bits
);
}
else
{
int
align
=
8
-
(
get_bits_count
(
gb
)
&
7
);
align
=
FFMIN
(
align
,
len
);
put_bits
(
&
s
->
pb
,
align
,
get_bits
(
gb
,
align
));
len
-=
align
;
ff
_copy_bits
(
&
s
->
pb
,
gb
->
buffer
+
(
get_bits_count
(
gb
)
>>
3
),
len
);
avpriv
_copy_bits
(
&
s
->
pb
,
gb
->
buffer
+
(
get_bits_count
(
gb
)
>>
3
),
len
);
}
skip_bits_long
(
gb
,
len
);
...
...
libavcodec/wmavoice.c
View file @
9f51c682
...
...
@@ -1872,7 +1872,7 @@ static int parse_packet_header(WMAVoiceContext *s)
* @param size size of the source data, in bytes
* @param gb bit I/O context specifying the current position in the source.
* data. This function might use this to align the bit position to
* a whole-byte boundary before calling #
ff
_copy_bits() on aligned
* a whole-byte boundary before calling #
avpriv
_copy_bits() on aligned
* source data
* @param nbits the amount of bits to copy from source to target
*
...
...
@@ -1893,7 +1893,7 @@ static void copy_bits(PutBitContext *pb,
rmn_bits
&=
7
;
rmn_bytes
>>=
3
;
if
((
rmn_bits
=
FFMIN
(
rmn_bits
,
nbits
))
>
0
)
put_bits
(
pb
,
rmn_bits
,
get_bits
(
gb
,
rmn_bits
));
ff
_copy_bits
(
pb
,
data
+
size
-
rmn_bytes
,
avpriv
_copy_bits
(
pb
,
data
+
size
-
rmn_bytes
,
FFMIN
(
nbits
-
rmn_bits
,
rmn_bytes
<<
3
));
}
...
...
libavcodec/xsubenc.c
View file @
9f51c682
...
...
@@ -90,7 +90,7 @@ static int xsub_encode_rle(PutBitContext *pb, const uint8_t *bitmap,
if
(
color
!=
PADDING_COLOR
&&
(
PADDING
+
(
w
&
1
)))
put_xsub_rle
(
pb
,
PADDING
+
(
w
&
1
),
PADDING_COLOR
);
align_put_bits
(
pb
);
a
vpriv_a
lign_put_bits
(
pb
);
bitmap
+=
linesize
;
}
...
...
@@ -194,7 +194,7 @@ static int xsub_encode(AVCodecContext *avctx, unsigned char *buf,
// Enforce total height to be be multiple of 2
if
(
h
->
rects
[
0
]
->
h
&
1
)
{
put_xsub_rle
(
&
pb
,
h
->
rects
[
0
]
->
w
,
PADDING_COLOR
);
align_put_bits
(
&
pb
);
a
vpriv_a
lign_put_bits
(
&
pb
);
}
flush_put_bits
(
&
pb
);
...
...
libavformat/latmenc.c
View file @
9f51c682
...
...
@@ -106,9 +106,9 @@ static int latm_write_frame_header(AVFormatContext *s, PutBitContext *bs)
/* AudioSpecificConfig */
if
(
ctx
->
object_type
==
AOT_ALS
)
{
header_size
=
avctx
->
extradata_size
-
(
ctx
->
off
+
7
)
>>
3
;
ff
_copy_bits
(
bs
,
&
avctx
->
extradata
[
ctx
->
off
],
header_size
);
avpriv
_copy_bits
(
bs
,
&
avctx
->
extradata
[
ctx
->
off
],
header_size
);
}
else
{
ff
_copy_bits
(
bs
,
avctx
->
extradata
,
ctx
->
off
+
3
);
avpriv
_copy_bits
(
bs
,
avctx
->
extradata
,
ctx
->
off
+
3
);
if
(
!
ctx
->
channel_conf
)
{
avpriv_copy_pce_data
(
bs
,
&
gb
);
...
...
@@ -161,7 +161,7 @@ static int latm_write_packet(AVFormatContext *s, AVPacket *pkt)
for
(
i
=
0
;
i
<
pkt
->
size
;
i
++
)
put_bits
(
&
bs
,
8
,
pkt
->
data
[
i
]);
align_put_bits
(
&
bs
);
a
vpriv_a
lign_put_bits
(
&
bs
);
flush_put_bits
(
&
bs
);
len
=
put_bits_count
(
&
bs
)
>>
3
;
...
...
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