|
|
|
@ -69,6 +69,8 @@ static int h263_pred_dc(MpegEncContext * s, int n, uint16_t **dc_val_ptr); |
|
|
|
|
#ifdef CONFIG_ENCODERS |
|
|
|
|
static void mpeg4_inv_pred_ac(MpegEncContext * s, DCTELEM *block, int n, |
|
|
|
|
int dir); |
|
|
|
|
static void mpeg4_encode_visual_object_header(MpegEncContext * s); |
|
|
|
|
static void mpeg4_encode_vol_header(MpegEncContext * s, int vo_number, int vol_number); |
|
|
|
|
#endif //CONFIG_ENCODERS
|
|
|
|
|
static void mpeg4_decode_sprite_trajectory(MpegEncContext * s); |
|
|
|
|
static inline int ff_mpeg4_pred_dc(MpegEncContext * s, int n, uint16_t **dc_val_ptr, int *dir_ptr); |
|
|
|
@ -1579,6 +1581,19 @@ void h263_encode_init(MpegEncContext *s) |
|
|
|
|
s->luma_dc_vlc_length= uni_DCtab_lum_len; |
|
|
|
|
s->chroma_dc_vlc_length= uni_DCtab_chrom_len; |
|
|
|
|
s->ac_esc_length= 7+2+1+6+1+12+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); |
|
|
|
|
|
|
|
|
|
mpeg4_encode_visual_object_header(s); |
|
|
|
|
mpeg4_encode_vol_header(s, 0, 0); |
|
|
|
|
|
|
|
|
|
// ff_mpeg4_stuffing(&s->pb); ?
|
|
|
|
|
flush_put_bits(&s->pb); |
|
|
|
|
s->avctx->extradata_size= (get_bit_count(&s->pb)+7)>>3; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
case CODEC_ID_H263P: |
|
|
|
|
s->fcode_tab= umv_fcode_tab; |
|
|
|
@ -1715,13 +1730,6 @@ void ff_mpeg4_stuffing(PutBitContext * pbc) |
|
|
|
|
void ff_set_mpeg4_time(MpegEncContext * s, int picture_number){ |
|
|
|
|
int time_div, time_mod; |
|
|
|
|
|
|
|
|
|
if(s->pict_type==I_TYPE){ //we will encode a vol header
|
|
|
|
|
int dummy; |
|
|
|
|
av_reduce(&s->time_increment_resolution, &dummy, s->avctx->frame_rate, s->avctx->frame_rate_base, (1<<16)-1); |
|
|
|
|
|
|
|
|
|
s->time_increment_bits = av_log2(s->time_increment_resolution - 1) + 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(s->current_picture.pts) |
|
|
|
|
s->time= (s->current_picture.pts*s->time_increment_resolution + 500*1000)/(1000*1000); |
|
|
|
|
else |
|
|
|
|