changeset 676:c3bdb00a98a9 libavcodec

dont store version for bit-exact tests
author michaelni
date Sat, 14 Sep 2002 22:07:35 +0000
parents 9008cbe229ce
children 0ed44dd02bbf
files dsputil.c h263.c mjpeg.c mpegvideo.h
diffstat 4 files changed, 25 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/dsputil.c	Sat Sep 14 19:00:09 2002 +0000
+++ b/dsputil.c	Sat Sep 14 22:07:35 2002 +0000
@@ -44,6 +44,8 @@
 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 @@
 /* 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
--- a/h263.c	Sat Sep 14 19:00:09 2002 +0000
+++ b/h263.c	Sat Sep 14 22:07:35 2002 +0000
@@ -1420,14 +1420,17 @@
         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 */
--- a/mjpeg.c	Sat Sep 14 19:00:09 2002 +0000
+++ b/mjpeg.c	Sat Sep 14 22:07:35 2002 +0000
@@ -390,16 +390,18 @@
     }
 
     /* 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)
--- a/mpegvideo.h	Sat Sep 14 19:00:09 2002 +0000
+++ b/mpegvideo.h	Sat Sep 14 22:07:35 2002 +0000
@@ -496,6 +496,8 @@
 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);