diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-08-26 20:14:28 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-08-26 20:14:28 +0000 |
commit | 22ddd60bc247c7487b4e91416d18da712415630a (patch) | |
tree | fcd6da64a474197e793bb91e4248bad0a81c51c4 /libavcodec/h263.c | |
parent | 922bc38d55995536e84db1b704fdccc140870d26 (diff) | |
download | ffmpeg-22ddd60bc247c7487b4e91416d18da712415630a.tar.gz |
fixing CODEC_FLAG_GLOBAL_HEADER
Originally committed as revision 2167 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263.c')
-rw-r--r-- | libavcodec/h263.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c index 46ed231ffd..c2659d6495 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -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 |