diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 9ee585c4d7..eb8592352e 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -44,6 +44,8 @@ op_pixels_abs_func pix_abs8x8_x2; op_pixels_abs_func pix_abs8x8_y2; op_pixels_abs_func pix_abs8x8_xy2; +int ff_bit_exact=0; + UINT8 cropTbl[256 + 2 * MAX_NEG_CROP]; UINT32 squareTbl[512]; @@ -1697,6 +1699,7 @@ void dsputil_init(void) /* remove any non bit exact operation (testing purpose) */ void avcodec_set_bit_exact(void) { + ff_bit_exact=1; #ifdef HAVE_MMX dsputil_set_bit_exact_mmx(); #endif diff --git a/libavcodec/h263.c b/libavcodec/h263.c index 5ccb343181..c9a0a9d308 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -1420,14 +1420,17 @@ static void mpeg4_encode_vol_header(MpegEncContext * s) put_bits(&s->pb, 1, 0); /* reduced res vop */ } put_bits(&s->pb, 1, 0); /* scalability */ - + ff_mpeg4_stuffing(&s->pb); - put_bits(&s->pb, 16, 0); - put_bits(&s->pb, 16, 0x1B2); /* user_data */ - sprintf(buf, "FFmpeg%sb%s", FFMPEG_VERSION, LIBAVCODEC_BUILD_STR); - put_string(&s->pb, buf); - ff_mpeg4_stuffing(&s->pb); + /* user data */ + if(!ff_bit_exact){ + put_bits(&s->pb, 16, 0); + put_bits(&s->pb, 16, 0x1B2); /* user_data */ + sprintf(buf, "FFmpeg%sb%s", FFMPEG_VERSION, LIBAVCODEC_BUILD_STR); + put_string(&s->pb, buf); + ff_mpeg4_stuffing(&s->pb); + } } /* write mpeg4 VOP header */ diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c index cfd5307fbb..6cfd83160e 100644 --- a/libavcodec/mjpeg.c +++ b/libavcodec/mjpeg.c @@ -390,16 +390,18 @@ static void jpeg_put_comments(MpegEncContext *s) } /* comment */ - put_marker(p, COM); - flush_put_bits(p); - ptr = pbBufPtr(p); - put_bits(p, 16, 0); /* patched later */ + if(!ff_bit_exact){ + put_marker(p, COM); + flush_put_bits(p); + ptr = pbBufPtr(p); + put_bits(p, 16, 0); /* patched later */ #define MJPEG_VERSION "FFmpeg" LIBAVCODEC_VERSION "b" LIBAVCODEC_BUILD_STR - put_string(p, MJPEG_VERSION); - size = strlen(MJPEG_VERSION)+3; + put_string(p, MJPEG_VERSION); + size = strlen(MJPEG_VERSION)+3; #undef MJPEG_VERSION - ptr[0] = size >> 8; - ptr[1] = size; + ptr[0] = size >> 8; + ptr[1] = size; + } } void mjpeg_picture_header(MpegEncContext *s) diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index ee184b1406..2caccce8a8 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -496,6 +496,8 @@ void ff_conceal_past_errors(MpegEncContext *s, int conceal_all); void ff_copy_bits(PutBitContext *pb, UINT8 *src, int length); void ff_clean_intra_table_entries(MpegEncContext *s); +extern int ff_bit_exact; + /* motion_est.c */ void ff_estimate_p_frame_motion(MpegEncContext * s, int mb_x, int mb_y); diff --git a/tests/ffmpeg.regression.ref b/tests/ffmpeg.regression.ref index e02c487cac..7dd3014fa2 100644 --- a/tests/ffmpeg.regression.ref +++ b/tests/ffmpeg.regression.ref @@ -9,9 +9,9 @@ ffmpeg regression test 3ed8e11a8a8147c3e7d736593fccae79 *./data/out.yuv abe11239875a32f00fa2910828bba4fb *./data/a-h263.avi c1f6c8ee7a24d8345deddf1a24ca3756 *./data/out.yuv -0c1d8af40b0b11b89fd7f9436faf62e2 *./data/a-odivx.avi +440192aca11c310e01168ec24ea7807e *./data/a-odivx.avi 145c98a175e760f8ba1997edf15b2964 *./data/out.yuv -44d77cfad95830f10582275f69afe788 *./data/a-mjpeg.avi +2846c8e3d97d7395eb746bfce44e0443 *./data/a-mjpeg.avi 278033451d7a6bfeb8339abbe4228499 *./data/out.yuv 202adaf59c09d703b55fc7dd95eace25 *./data/a-rv10.rm c1f6c8ee7a24d8345deddf1a24ca3756 *./data/out.yuv