diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-09-26 00:22:25 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-09-26 00:22:25 +0000 |
commit | fcb48651f4f1c6a0429be546ff03429412e1f4c2 (patch) | |
tree | 0cf7727c48067c7df0d49d5a76ce571d74744d26 /libavcodec/h263.c | |
parent | b560f4b65663380342c8cdf993d0a824b82e0bea (diff) | |
download | ffmpeg-fcb48651f4f1c6a0429be546ff03429412e1f4c2.tar.gz |
mpeg4 interlaced dct encoding
Originally committed as revision 971 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263.c')
-rw-r--r-- | libavcodec/h263.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c index 5bf7085f71..91de14df81 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -458,6 +458,13 @@ void mpeg4_encode_mb(MpegEncContext * s, put_bits(&s->pb, 1, 0); }else s->qscale -= s->dquant; + + if(!s->progressive_sequence){ + if(cbp) + put_bits(&s->pb, 1, s->interlaced_dct); + if(mb_type) // not diect mode + put_bits(&s->pb, 1, 0); // no interlaced ME yet + } if(interleaved_stats){ bits= get_bit_count(&s->pb); @@ -580,6 +587,12 @@ void mpeg4_encode_mb(MpegEncContext * s, put_bits(pb2, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]); if(s->dquant) put_bits(pb2, 2, dquant_code[s->dquant+2]); + + if(!s->progressive_sequence){ + if(cbp) + put_bits(pb2, 1, s->interlaced_dct); + put_bits(pb2, 1, 0); // no interlaced ME yet + } if(interleaved_stats){ bits= get_bit_count(&s->pb); @@ -701,6 +714,10 @@ void mpeg4_encode_mb(MpegEncContext * s, if(s->dquant) put_bits(dc_pb, 2, dquant_code[s->dquant+2]); + if(!s->progressive_sequence){ + put_bits(dc_pb, 1, s->interlaced_dct); + } + if(interleaved_stats){ bits= get_bit_count(&s->pb); s->misc_bits+= bits - s->last_bits; @@ -1511,7 +1528,7 @@ static void mpeg4_encode_vol_header(MpegEncContext * s) put_bits(&s->pb, 1, 1); /* marker bit */ put_bits(&s->pb, 13, s->height); /* vol height */ put_bits(&s->pb, 1, 1); /* marker bit */ - put_bits(&s->pb, 1, 0); /* interlace */ + put_bits(&s->pb, 1, s->progressive_sequence ? 0 : 1); put_bits(&s->pb, 1, 1); /* obmc disable */ if (vo_ver_id == 1) { put_bits(&s->pb, 1, s->vol_sprite_usage=0); /* sprite enable */ @@ -1586,6 +1603,10 @@ void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number) put_bits(&s->pb, 1, s->no_rounding); /* rounding type */ } put_bits(&s->pb, 3, 0); /* intra dc VLC threshold */ + if(!s->progressive_sequence){ + put_bits(&s->pb, 1, s->top_field_first); + put_bits(&s->pb, 1, s->alternate_scan); + } //FIXME sprite stuff put_bits(&s->pb, 5, s->qscale); @@ -4215,7 +4236,7 @@ int mpeg4_decode_picture_header(MpegEncContext * s) check_marker(&s->gb, "before time_increment"); time_increment= get_bits(&s->gb, s->time_increment_bits); -//printf(" type:%d incr:%d increment:%d\n", s->pict_type, time_incr, time_increment); +//printf(" type:%d modulo_time_base:%d increment:%d\n", s->pict_type, time_incr, time_increment); if(s->pict_type!=B_TYPE){ s->last_time_base= s->time_base; s->time_base+= time_incr; |