diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-03-23 11:39:38 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-03-23 11:39:38 +0000 |
commit | 59fa3f96f48d12e189492ca3670991f91c316d4e (patch) | |
tree | ae48ff025bfcbbbbaadd39eb2dc5f507ab5f8b3a /libavcodec/h263.c | |
parent | 0d23cb8439955db47c53081726df3e217632ed6c (diff) | |
download | ffmpeg-59fa3f96f48d12e189492ca3670991f91c316d4e.tar.gz |
support omiting various headers in mpeg4 as WMP seems to have difficulty with them
based upon 27_WMP_compatibility_with_ISOMPEG4.patch by (Calcium | calcium nurs or jp)
indention fixed
uses workaround_bugs instead of strict_std_compliancy as WMP is not the reference implementation
Originally committed as revision 4069 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263.c')
-rw-r--r-- | libavcodec/h263.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c index 645c9b9dba..32c1b94b34 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -2021,7 +2021,8 @@ void h263_encode_init(MpegEncContext *s) s->avctx->extradata= av_malloc(1024); init_put_bits(&s->pb, s->avctx->extradata, 1024); - mpeg4_encode_visual_object_header(s); + if(!(s->workaround_bugs & FF_BUG_MS)) + mpeg4_encode_visual_object_header(s); mpeg4_encode_vol_header(s, 0, 0); // ff_mpeg4_stuffing(&s->pb); ? @@ -2320,9 +2321,13 @@ static void mpeg4_encode_vol_header(MpegEncContext * s, int vo_number, int vol_n put_bits(&s->pb, 1, 0); /* random access vol */ put_bits(&s->pb, 8, s->vo_type); /* video obj type indication */ - put_bits(&s->pb, 1, 1); /* is obj layer id= yes */ - put_bits(&s->pb, 4, vo_ver_id); /* is obj layer ver id */ - put_bits(&s->pb, 3, 1); /* is obj layer priority */ + if(s->workaround_bugs & FF_BUG_MS) { + put_bits(&s->pb, 1, 0); /* is obj layer id= no */ + } else { + put_bits(&s->pb, 1, 1); /* is obj layer id= yes */ + put_bits(&s->pb, 4, vo_ver_id); /* is obj layer ver id */ + put_bits(&s->pb, 3, 1); /* is obj layer priority */ + } aspect_to_info(s, s->avctx->sample_aspect_ratio); @@ -2332,10 +2337,14 @@ static void mpeg4_encode_vol_header(MpegEncContext * s, int vo_number, int vol_n put_bits(&s->pb, 8, s->avctx->sample_aspect_ratio.den); } - put_bits(&s->pb, 1, 1); /* vol control parameters= yes */ - put_bits(&s->pb, 2, 1); /* chroma format YUV 420/YV12 */ - put_bits(&s->pb, 1, s->low_delay); - put_bits(&s->pb, 1, 0); /* vbv parameters= no */ + if(s->workaround_bugs & FF_BUG_MS) { // + put_bits(&s->pb, 1, 0); /* vol control parameters= no @@@ */ + } else { + put_bits(&s->pb, 1, 1); /* vol control parameters= yes */ + put_bits(&s->pb, 2, 1); /* chroma format YUV 420/YV12 */ + put_bits(&s->pb, 1, s->low_delay); + put_bits(&s->pb, 1, 0); /* vbv parameters= no */ + } put_bits(&s->pb, 2, RECT_SHAPE); /* vol shape= rectangle */ put_bits(&s->pb, 1, 1); /* marker bit */ @@ -2405,7 +2414,8 @@ void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number) if(s->strict_std_compliance < 2 || picture_number==0) //HACK, the reference sw is buggy mpeg4_encode_vol_header(s, 0, 0); } - mpeg4_encode_gop_header(s); + if(!(s->workaround_bugs & FF_BUG_MS)) + mpeg4_encode_gop_header(s); } s->partitioned_frame= s->data_partitioning && s->pict_type!=B_TYPE; |