diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-08-22 22:18:08 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-08-22 22:18:08 +0000 |
commit | d6eb3c500aeab8ae9f138f8eb70d045ac47100ee (patch) | |
tree | 1c3e18cdbf6b7b644fd64ac29bac67cf6c25d84d /libavcodec/h263.c | |
parent | c3bf0288c9bc119e41818fc4b94290d54c4bc5cb (diff) | |
download | ffmpeg-d6eb3c500aeab8ae9f138f8eb70d045ac47100ee.tar.gz |
custom quant matrix encoding support
Originally committed as revision 2135 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263.c')
-rw-r--r-- | libavcodec/h263.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c index ec30214031..592e92c7b1 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -1859,7 +1859,11 @@ static void mpeg4_encode_vol_header(MpegEncContext * s, int vo_number, int vol_n s->quant_precision=5; put_bits(&s->pb, 1, 0); /* not 8 bit == false */ put_bits(&s->pb, 1, s->mpeg_quant); /* quant type= (0=h263 style)*/ - if(s->mpeg_quant) put_bits(&s->pb, 2, 0); /* no custom matrixes */ + + if(s->mpeg_quant){ + ff_write_quant_matrix(&s->pb, s->avctx->intra_matrix); + ff_write_quant_matrix(&s->pb, s->avctx->inter_matrix); + } if (vo_ver_id != 1) put_bits(&s->pb, 1, s->quarter_sample); @@ -4551,14 +4555,15 @@ static int decode_vol_header(MpegEncContext *s, GetBitContext *gb){ skip_bits(gb, 4); //video_object_layer_shape_extension } - skip_bits1(gb); /* marker */ + check_marker(gb, "before time_increment_resolution"); s->time_increment_resolution = get_bits(gb, 16); s->time_increment_bits = av_log2(s->time_increment_resolution - 1) + 1; if (s->time_increment_bits < 1) s->time_increment_bits = 1; - skip_bits1(gb); /* marker */ + + check_marker(gb, "before fixed_vop_rate"); if (get_bits1(gb) != 0) { /* fixed_vop_rate */ skip_bits(gb, s->time_increment_bits); @@ -4648,8 +4653,8 @@ static int decode_vol_header(MpegEncContext *s, GetBitContext *gb){ /* replicate last value */ for(; i<64; i++){ int j= s->dsp.idct_permutation[ ff_zigzag_direct[i] ]; - s->intra_matrix[j]= v; - s->chroma_intra_matrix[j]= v; + s->intra_matrix[j]= last; + s->chroma_intra_matrix[j]= last; } } @@ -4842,7 +4847,10 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){ printf("my guess is %d bits ;)\n",s->time_increment_bits); } - time_increment= get_bits(gb, s->time_increment_bits); + if(IS_3IV1) time_increment= get_bits1(gb); //FIXME investigate further + else time_increment= get_bits(gb, s->time_increment_bits); + +// printf("%d %X\n", s->time_increment_bits, 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; |