/* output the AC3 frame header */
static void output_frame_header(AC3EncodeContext *s, unsigned char *frame)
{
- init_put_bits(&s->pb, frame, AC3_MAX_CODED_FRAME_SIZE, NULL, NULL);
+ init_put_bits(&s->pb, frame, AC3_MAX_CODED_FRAME_SIZE);
put_bits(&s->pb, 16, 0x0b77); /* frame header */
put_bits(&s->pb, 16, 0); /* crc1: will be filled later */
int size;
int mb_x, mb_y;
- init_put_bits(&a->pb, buf, buf_size, NULL, NULL);
+ init_put_bits(&a->pb, buf, buf_size);
*p = *pict;
p->pict_type= I_TYPE;
* @param buf_size size of buf in bits
*/
void ff_init_cabac_encoder(CABACContext *c, uint8_t *buf, int buf_size){
- init_put_bits(&c->pb, buf, buf_size, NULL, NULL);
+ init_put_bits(&c->pb, buf, buf_size);
c->low= 0;
c->range= 0x1FE;
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
};
-void init_put_bits(PutBitContext *s,
- uint8_t *buffer, int buffer_size,
- void *opaque,
- void (*write_data)(void *, uint8_t *, int))
+void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
{
s->buf = buffer;
s->buf_end = s->buf + buffer_size;
s->data_out_size = 0;
- if(write_data!=NULL)
- {
- fprintf(stderr, "write Data callback is not supported\n");
- }
#ifdef ALT_BITSTREAM_WRITER
s->index=0;
((uint32_t*)(s->buf))[0]=0;
int64_t data_out_size; /* in bytes */
} PutBitContext;
-void init_put_bits(PutBitContext *s,
- uint8_t *buffer, int buffer_size,
- void *opaque,
- void (*write_data)(void *, uint8_t *, int));
+void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size);
int64_t get_bit_count(PutBitContext *s); /* XXX: change function name */
void align_put_bits(PutBitContext *s);
buf_ptr = buf_ptr1;
block1 = &s->block[0][0];
mb1 = mb_data;
- init_put_bits(&vs_pb, vs_bit_buffer, 5 * 80, NULL, NULL);
+ init_put_bits(&vs_pb, vs_bit_buffer, 5 * 80);
vs_bit_count = 0;
for(mb_index = 0; mb_index < 5; mb_index++) {
/* skip header */
quant = buf_ptr[3] & 0x0f;
buf_ptr += 4;
- init_put_bits(&pb, mb_bit_buffer, 80, NULL, NULL);
+ init_put_bits(&pb, mb_bit_buffer, 80);
mb_bit_count = 0;
mb = mb1;
block = block1;
uint8_t* p = dif + i*80 + 4;
for (j=0; j<6; j++) {
enc_blk->qno = QNO;
- init_put_bits(&enc_blk->pb, p, block_sizes[j]/8, NULL, NULL);
+ init_put_bits(&enc_blk->pb, p, block_sizes[j]/8);
enc_blk++;
p += block_sizes[j]/8;
}
}
- init_put_bits(&extra_vs, extra_vs_data, sizeof(extra_vs_data), NULL, NULL);
+ init_put_bits(&extra_vs, extra_vs_data, sizeof(extra_vs_data));
free_vs_bits = 0;
enc_blk = &enc_blks[0];
for (i=0; i<5; i++) {
EncBlockInfo* enc_blk2 = enc_blk;
int free_mb_bits = 0;
- init_put_bits(&extra_mb, extra_mb_data, sizeof(extra_mb_data), NULL, NULL);
+ init_put_bits(&extra_mb, extra_mb_data, sizeof(extra_mb_data));
dif[i*80 + 3] = enc_blk->qno;
for (j=0; j<6; j++) {
if(!f->ac){
used_count += put_cabac_terminate(c, 1);
//printf("pos=%d\n", used_count);
- init_put_bits(&f->pb, buf + used_count, buf_size - used_count, NULL, NULL);
+ init_put_bits(&f->pb, buf + used_count, buf_size - used_count);
}
if(1){
if(s->flags & CODEC_FLAG_GLOBAL_HEADER){
s->avctx->extradata= av_malloc(1024);
- init_put_bits(&s->pb, s->avctx->extradata, 1024, NULL, NULL);
+ init_put_bits(&s->pb, s->avctx->extradata, 1024);
mpeg4_encode_visual_object_header(s);
mpeg4_encode_vol_header(s, 0, 0);
void ff_mpeg4_init_partitions(MpegEncContext *s)
{
- init_put_bits(&s->tex_pb, s->tex_pb_buffer, PB_BUFFER_SIZE, NULL, NULL);
- init_put_bits(&s->pb2 , s->pb2_buffer , PB_BUFFER_SIZE, NULL, NULL);
+ init_put_bits(&s->tex_pb, s->tex_pb_buffer, PB_BUFFER_SIZE);
+ init_put_bits(&s->pb2 , s->pb2_buffer , PB_BUFFER_SIZE);
}
void ff_mpeg4_merge_partitions(MpegEncContext *s)
dsputil_init(&dsp, &avctx);
- init_put_bits(&pb, temp, SIZE, NULL, NULL);
+ init_put_bits(&pb, temp, SIZE);
printf("testing unsigned exp golomb\n");
for(i=0; i<COUNT; i++){
START_TIMER
AVFrame * const p= &s->picture;
int i, size;
- init_put_bits(&s->pb, buf, buf_size, NULL, NULL);
+ init_put_bits(&s->pb, buf, buf_size);
*p = *pict;
p->pict_type= FF_I_TYPE;
AVFrame * const p= (AVFrame*)&s->current_picture;
const int predictor= avctx->prediction_method+1;
- init_put_bits(&s->pb, buf, buf_size, NULL, NULL);
+ init_put_bits(&s->pb, buf, buf_size);
*p = *pict;
p->pict_type= FF_I_TYPE;
}
compute_bit_allocation(s, smr, bit_alloc, &padding);
- init_put_bits(&s->pb, frame, MPA_MAX_CODED_FRAME_SIZE, NULL, NULL);
+ init_put_bits(&s->pb, frame, MPA_MAX_CODED_FRAME_SIZE);
encode_frame(s, bit_alloc, padding);
return -1;
}
- init_put_bits(&s->pb, buf, buf_size, NULL, NULL);
+ init_put_bits(&s->pb, buf, buf_size);
s->picture_in_gop_number++;
PutBitContext pb[2], pb2[2], tex_pb[2];
for(i=0; i<2; i++){
- init_put_bits(&pb [i], bit_buf [i], 3000, NULL, NULL);
- init_put_bits(&pb2 [i], bit_buf2 [i], 3000, NULL, NULL);
- init_put_bits(&tex_pb[i], bit_buf_tex[i], 3000, NULL, NULL);
+ init_put_bits(&pb [i], bit_buf [i], 3000);
+ init_put_bits(&pb2 [i], bit_buf2 [i], 3000);
+ init_put_bits(&tex_pb[i], bit_buf_tex[i], 3000);
}
s->picture_number = picture_number;