summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ac3enc.c4
-rw-r--r--libavcodec/bitstream.c2
-rw-r--r--libavcodec/gif.c6
-rw-r--r--libavcodec/h261enc.c2
-rw-r--r--libavcodec/h263.c4
-rw-r--r--libavcodec/ljpegenc.c2
-rw-r--r--libavcodec/mjpegenc.c6
-rw-r--r--libavcodec/mpegaudioenc.c2
-rw-r--r--libavcodec/mpegvideo_enc.c8
-rw-r--r--libavcodec/put_bits.h2
-rw-r--r--libavcodec/wmaenc.c2
11 files changed, 20 insertions, 20 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index c00d9d63ba..e851cdbc5c 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -1117,10 +1117,10 @@ static int output_frame_end(AC3EncodeContext *s)
flush_put_bits(&s->pb);
/* add zero bytes to reach the frame size */
frame = s->pb.buf;
- n = 2 * s->frame_size - (pbBufPtr(&s->pb) - frame) - 2;
+ n = 2 * s->frame_size - (put_bits_ptr(&s->pb) - frame) - 2;
assert(n >= 0);
if(n>0)
- memset(pbBufPtr(&s->pb), 0, n);
+ memset(put_bits_ptr(&s->pb), 0, n);
/* Now we must compute both crcs : this is not so easy for crc1
because it is at the beginning of the data... */
diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index 267fc818ec..efb5a3bfdb 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -91,7 +91,7 @@ void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length)
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);
+ memcpy(put_bits_ptr(pb), src+i, 2*words-i);
skip_put_bytes(pb, 2*words-i);
}
diff --git a/libavcodec/gif.c b/libavcodec/gif.c
index 6ab00e14ee..8cd51c5b74 100644
--- a/libavcodec/gif.c
+++ b/libavcodec/gif.c
@@ -126,9 +126,9 @@ static int gif_image_write_image(uint8_t **bytestream,
put_bits(&p, 9, 0x101); /* end of stream */
flush_put_bits(&p);
}
- if(pbBufPtr(&p) - p.buf > 0) {
- bytestream_put_byte(bytestream, pbBufPtr(&p) - p.buf); /* byte count of the packet */
- bytestream_put_buffer(bytestream, p.buf, pbBufPtr(&p) - p.buf); /* the actual buffer */
+ if(put_bits_ptr(&p) - p.buf > 0) {
+ bytestream_put_byte(bytestream, put_bits_ptr(&p) - p.buf); /* byte count of the packet */
+ bytestream_put_buffer(bytestream, p.buf, put_bits_ptr(&p) - p.buf); /* the actual buffer */
p.buf_ptr = p.buf; /* dequeue the bytes off the bitstream */
}
left-=GIF_CHUNKS;
diff --git a/libavcodec/h261enc.c b/libavcodec/h261enc.c
index f24068820a..6a8565c509 100644
--- a/libavcodec/h261enc.c
+++ b/libavcodec/h261enc.c
@@ -55,7 +55,7 @@ void ff_h261_encode_picture_header(MpegEncContext * s, int picture_number){
align_put_bits(&s->pb);
/* Update the pointer to last GOB */
- s->ptr_lastgob = pbBufPtr(&s->pb);
+ s->ptr_lastgob = put_bits_ptr(&s->pb);
put_bits(&s->pb, 20, 0x10); /* PSC */
diff --git a/libavcodec/h263.c b/libavcodec/h263.c
index 2a945c6eda..6e6d156866 100644
--- a/libavcodec/h263.c
+++ b/libavcodec/h263.c
@@ -245,7 +245,7 @@ void h263_encode_picture_header(MpegEncContext * s, int picture_number)
align_put_bits(&s->pb);
/* Update the pointer to last GOB */
- s->ptr_lastgob = pbBufPtr(&s->pb);
+ s->ptr_lastgob = put_bits_ptr(&s->pb);
put_bits(&s->pb, 22, 0x20); /* PSC */
temp_ref= s->picture_number * (int64_t)coded_frame_rate * s->avctx->time_base.num / //FIXME use timestamp
(coded_frame_rate_base * (int64_t)s->avctx->time_base.den);
@@ -3053,7 +3053,7 @@ static inline void memsetw(short *tab, int val, int n)
void ff_mpeg4_init_partitions(MpegEncContext *s)
{
- uint8_t *start= pbBufPtr(&s->pb);
+ uint8_t *start= put_bits_ptr(&s->pb);
uint8_t *end= s->pb.buf_end;
int size= end - start;
int pb_size = (((intptr_t)start + size/3)&(~3)) - (intptr_t)start;
diff --git a/libavcodec/ljpegenc.c b/libavcodec/ljpegenc.c
index e53e07920f..6c9f058dce 100644
--- a/libavcodec/ljpegenc.c
+++ b/libavcodec/ljpegenc.c
@@ -181,7 +181,7 @@ static int encode_picture_lossless(AVCodecContext *avctx, unsigned char *buf, in
s->picture_number++;
flush_put_bits(&s->pb);
- return pbBufPtr(&s->pb) - s->pb.buf;
+ return put_bits_ptr(&s->pb) - s->pb.buf;
// return (put_bits_count(&f->pb)+7)/8;
}
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index bfab7cdcd4..8369e9c946 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -135,7 +135,7 @@ static void jpeg_table_header(MpegEncContext *s)
/* huffman table */
put_marker(p, DHT);
flush_put_bits(p);
- ptr = pbBufPtr(p);
+ ptr = put_bits_ptr(p);
put_bits(p, 16, 0); /* patched later */
size = 2;
size += put_huffman_table(s, 0, 0, ff_mjpeg_bits_dc_luminance,
@@ -174,7 +174,7 @@ static void jpeg_put_comments(MpegEncContext *s)
if(!(s->flags & CODEC_FLAG_BITEXACT)){
put_marker(p, COM);
flush_put_bits(p);
- ptr = pbBufPtr(p);
+ ptr = put_bits_ptr(p);
put_bits(p, 16, 0); /* patched later */
ff_put_string(p, LIBAVCODEC_IDENT, 1);
size = strlen(LIBAVCODEC_IDENT)+3;
@@ -186,7 +186,7 @@ static void jpeg_put_comments(MpegEncContext *s)
||s->avctx->pix_fmt == PIX_FMT_YUV444P){
put_marker(p, COM);
flush_put_bits(p);
- ptr = pbBufPtr(p);
+ ptr = put_bits_ptr(p);
put_bits(p, 16, 0); /* patched later */
ff_put_string(p, "CS=ITU601", 1);
size = strlen("CS=ITU601")+3;
diff --git a/libavcodec/mpegaudioenc.c b/libavcodec/mpegaudioenc.c
index 50a7b35120..de3081e2bf 100644
--- a/libavcodec/mpegaudioenc.c
+++ b/libavcodec/mpegaudioenc.c
@@ -781,7 +781,7 @@ static int MPA_encode_frame(AVCodecContext *avctx,
encode_frame(s, bit_alloc, padding);
s->nb_samples += MPA_FRAME_SIZE;
- return pbBufPtr(&s->pb) - s->pb.buf;
+ return put_bits_ptr(&s->pb) - s->pb.buf;
}
static av_cold int MPA_encode_close(AVCodecContext *avctx)
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 2500a410c6..cca2f7fe05 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1321,7 +1321,7 @@ vbv_retry:
s->total_bits += s->frame_bits;
avctx->frame_bits = s->frame_bits;
}else{
- assert((pbBufPtr(&s->pb) == s->pb.buf));
+ assert((put_bits_ptr(&s->pb) == s->pb.buf));
s->frame_bits=0;
}
assert((s->frame_bits&7)==0);
@@ -2111,7 +2111,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
}
assert((put_bits_count(&s->pb)&7) == 0);
- current_packet_size= pbBufPtr(&s->pb) - s->ptr_lastgob;
+ current_packet_size= put_bits_ptr(&s->pb) - s->ptr_lastgob;
if(s->avctx->error_rate && s->resync_mb_x + s->resync_mb_y > 0){
int r= put_bits_count(&s->pb)/8 + s->picture_number + 16 + s->mb_x + s->mb_y;
@@ -2121,7 +2121,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
#ifndef ALT_BITSTREAM_WRITER
s->pb.buf_ptr= s->ptr_lastgob;
#endif
- assert(pbBufPtr(&s->pb) == s->ptr_lastgob);
+ assert(put_bits_ptr(&s->pb) == s->ptr_lastgob);
}
}
@@ -2603,7 +2603,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
/* Send the last GOB if RTP */
if (s->avctx->rtp_callback) {
int number_mb = (mb_y - s->resync_mb_y)*s->mb_width - s->resync_mb_x;
- pdif = pbBufPtr(&s->pb) - s->ptr_lastgob;
+ pdif = put_bits_ptr(&s->pb) - s->ptr_lastgob;
/* Call the RTP callback to send the last GOB */
emms_c();
s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, pdif, number_mb);
diff --git a/libavcodec/put_bits.h b/libavcodec/put_bits.h
index 32b11f6445..2009a2be23 100644
--- a/libavcodec/put_bits.h
+++ b/libavcodec/put_bits.h
@@ -263,7 +263,7 @@ static inline void put_sbits(PutBitContext *pb, int bits, int32_t val)
* Returns the pointer to the byte where the bitstream writer will put
* the next bit.
*/
-static inline uint8_t* pbBufPtr(PutBitContext *s)
+static inline uint8_t* put_bits_ptr(PutBitContext *s)
{
#ifdef ALT_BITSTREAM_WRITER
return s->buf + (s->index>>3);
diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c
index 4977ab2a1e..a8ba6b0b66 100644
--- a/libavcodec/wmaenc.c
+++ b/libavcodec/wmaenc.c
@@ -380,7 +380,7 @@ static int encode_superframe(AVCodecContext *avctx,
put_bits(&s->pb, 8, 'N');
flush_put_bits(&s->pb);
- return pbBufPtr(&s->pb) - s->pb.buf;
+ return put_bits_ptr(&s->pb) - s->pb.buf;
}
AVCodec wmav1_encoder =