From 8c0ff5d5c28df0cda89f31cda2df2fcdf8fd85bb Mon Sep 17 00:00:00 2001 From: Roman Shaposhnik Date: Thu, 24 Apr 2003 03:59:33 +0000 Subject: [PATCH] * Making AVI encoding predictable (all JUNK chunks are filled with 0) * Updating regression refs * Making server-regression.sh work on Solaris Originally committed as revision 1818 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/avienc.c | 6 ++-- tests/ffmpeg.regression.ref | 22 +++++++-------- tests/ffserver.regression.ref | 52 +++++++++++++++++------------------ tests/rotozoom.regression.ref | 22 +++++++-------- tests/server-regression.sh | 13 +++++++-- 5 files changed, 62 insertions(+), 53 deletions(-) diff --git a/libavformat/avienc.c b/libavformat/avienc.c index bee61db113..04be25b917 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -416,10 +416,11 @@ static int avi_write_header(AVFormatContext *s) if (!url_is_streamed(pb)) { unsigned char tag[5]; + int j; /* Starting to lay out AVI OpenDML master index. * We want to make it JUNK entry for now, since we'd - * like to get away without making AVI and OpenDML one + * like to get away without making AVI an OpenDML one * for compatibility reasons. */ avi->indexes[i].entry = avi->indexes[i].ents_allocated = 0; @@ -432,7 +433,8 @@ static int avi_write_header(AVFormatContext *s) /* dwChunkId */ put_le64(pb, 0); /* dwReserved[3] put_le32(pb, 0); Must be 0. */ - url_fskip(pb, AVI_MASTER_INDEX_SIZE * 4 * 4); + for (j=0; j < AVI_MASTER_INDEX_SIZE * 2; j++) + put_le64(pb, 0); end_tag(pb, avi->indexes[i].indx_start); } diff --git a/tests/ffmpeg.regression.ref b/tests/ffmpeg.regression.ref index 38fe8ed673..a9406b6aa0 100644 --- a/tests/ffmpeg.regression.ref +++ b/tests/ffmpeg.regression.ref @@ -2,40 +2,40 @@ ffmpeg regression test dda0ba041aef50a5101884291c06d4d9 *./data/a-mpeg1.mpg 6713259d72260740bbddaea30631ea18 *./data/out.yuv stddev: 7.58 bytes:7299072 -60ead0315f310d7dd70e90fccf9cc64f *./data/a-msmpeg4v2.avi +d0dc46dd831398237a690ebbeff18b64 *./data/a-msmpeg4v2.avi 712aa6c959d1d90a78fe98657cbff19c *./data/out.yuv stddev: 8.11 bytes:7602176 -04c274a5e33e4ed672c96b55424a9f96 *./data/a-msmpeg4.avi +dae855177b45cbe6e40c6777f95095ef *./data/a-msmpeg4.avi 8786aa956838234fe3e48d0ef8cbd46c *./data/out.yuv stddev: 8.12 bytes:7602176 -fb7fb2dc6ac9b3b5f86a1312247e7ff1 *./data/a-wmv1.avi +6633a1111c734c9156729b8b7e198c17 *./data/a-wmv1.avi 7261e23fd8ad1de6efee022051b936be *./data/out.yuv stddev: 8.10 bytes:7602176 -b308178b516a268b69a8c4163b765388 *./data/a-wmv2.avi +30dcbbe391149d981162a1f4727c43d6 *./data/a-wmv2.avi 7261e23fd8ad1de6efee022051b936be *./data/out.yuv stddev: 8.10 bytes:7602176 -99bb47379a5323bb7622d584b074e727 *./data/a-h263.avi +4bf9df20cdeb1aa01115761642b4e80b *./data/a-h263.avi 545df74e0aa443499600faedd10a7065 *./data/out.yuv stddev: 8.18 bytes:7602176 -4a8c50bf0483b1bec7c7c3bbc3bbb2a6 *./data/a-h263p.avi +496df9fe47c457144aac4178c960ad66 *./data/a-h263p.avi 79649b61321beaaaa6413af8c18e4696 *./data/out.yuv stddev: 2.05 bytes:7602176 -ce7d9918b3d140acaedd249b2796a1de *./data/a-odivx.avi +170cc33e7a786288d0e190aba76ce255 *./data/a-odivx.avi c753223d02441b59704c9859dbd7ff30 *./data/out.yuv stddev: 8.01 bytes:7602176 -c2bae3180c0b3b7e9fcc34b2f01855ad *./data/a-huffyuv.avi +5704a082cc5c5970620123ae20566286 *./data/a-huffyuv.avi 799d3db687f6cdd7a837ec156efc171f *./data/out.yuv stddev: 0.00 bytes:7602176 -306b8506ef8761e971d8e77bd8701b72 *./data/a-mpeg4-rc.avi +6a359baea7b8b22d4a77ea1415c08d9b *./data/a-mpeg4-rc.avi 580000bfe2d4359d9aa9a9415f953b3b *./data/out.yuv stddev: 10.53 bytes:7145472 -7fce203812794223bd238ad027522071 *./data/a-mpeg4-adv.avi +2cbab98ebef5fbd229c66fb6435bf9a2 *./data/a-mpeg4-adv.avi b54262af56f6681186fa2c44e4ef6ec7 *./data/out.yuv stddev: 7.32 bytes:7602176 a38cb11e3035a280f3dad3ccdff5997b *./data/a-mpeg1b.mpg da8e21c7b78b7a25558dc319524b91d8 *./data/out.yuv stddev: 6.32 bytes:6842368 -e9d0481d7b274de05a743ed3a87b70e1 *./data/a-mjpeg.avi +07042f42b3119c39eb26537a84a451df *./data/a-mjpeg.avi f23a9e50a559e174766ee808c48fea22 *./data/out.yuv stddev: 8.87 bytes:7602176 4b37703d3dc03873f99603165c0fe11e *./data/a-rv10.rm diff --git a/tests/ffserver.regression.ref b/tests/ffserver.regression.ref index c5dae8ad71..fe230fff5a 100644 --- a/tests/ffserver.regression.ref +++ b/tests/ffserver.regression.ref @@ -1,42 +1,42 @@ ad56436a2fc29b0a55d3a62489942b0d ff-a-ac3.rm 8b40455c66bcc5d2d9d7fabe2a907c68 ff-a-ac3.rm.asf -94f2f61e8659be78fa0f2bc6754737ee ff-a-h263.avi -961eef00cacc72023ccb7c0ccd45b01a ff-a-h263.avi.asf -04c7bc584ad25b96f759b8cfd5404b60 ff-a-h263p.avi -769f66c899f803313eddc3b1ca615838 ff-a-h263p.avi.asf -e770f6a63bc6cf5647499c5a9be0a675 ff-a-huffyuv.avi -badd655491442b9a0d9c71ccca62631c ff-a-huffyuv.avi.asf -3df0c33223dbf896760fc172c26e4e99 ff-a-mjpeg.avi -429749940ed2028a60c6a8e10d125279 ff-a-mjpeg.avi.asf +11a9dd761a72cf22dcb65d6378cbe2f5 ff-a-h263.avi +d12b6fa49112aca986755f5152b6ebe3 ff-a-h263.avi.asf +444935c2ef8be07b474ca509f4694808 ff-a-h263p.avi +a768a163bb74348ace83e0420a4daa39 ff-a-h263p.avi.asf +d65e24f867c9b29e602d244ed8ecec57 ff-a-huffyuv.avi +7c691cce798dd137be49772298b461db ff-a-huffyuv.avi.asf +545b8ca61487f1c92d0c6d97d122470a ff-a-mjpeg.avi +c6359a17e4aaa7012adeb9998ee5caa1 ff-a-mjpeg.avi.asf 21f8ff9f1daacd9133683bb4ea0f50a4 ff-a-mp2.mp2 c593b98f0970f7d4ae2be3a7e82aa0f7 ff-a-mp2.mp2.asf -9ab166f4abec4d9ba87b3c643276646e ff-a-mpeg1b.mpg -fc49dd5c8fcca8692da120c047608286 ff-a-mpeg1b.mpg.asf 2f67a20f4e2d122054ba4d2eb4e234fd ff-a-mpeg1.mpg dec5676b79535bb87c268d0633fc37f1 ff-a-mpeg1.mpg.asf -8ddec0df3b7b189ed93a83dcaf1da80d ff-a-mpeg4-adv.avi -0d9bfd72cb03fcc7ba710040df5aee82 ff-a-mpeg4-adv.avi.asf -2aa1de5c814160fdf4ccb1340bc64b14 ff-a-mpeg4-rc.avi -2f15bf508e0a55fffbd34c62e1bda8f3 ff-a-mpeg4-rc.avi.asf -1019dd8a6b47f9ddf82b3b462da18a45 ff-a-msmpeg4.avi -7de436541a61169c64bb9b3973813aa9 ff-a-msmpeg4.avi.asf -c0fcf607b3c7671269a43fc4d9fda6c9 ff-a-msmpeg4v2.avi -eb0a4e4d51a7595dcaf7678dc3439fc7 ff-a-msmpeg4v2.avi.asf -230824defe495692532ac1ee0f0a5923 ff-a-odivx.avi -130bebe6f4c218b36945aafd9a3b037f ff-a-odivx.avi.asf +9ab166f4abec4d9ba87b3c643276646e ff-a-mpeg1b.mpg +fc49dd5c8fcca8692da120c047608286 ff-a-mpeg1b.mpg.asf +cd4eb69ff359bc1be5c1173b4374e1a5 ff-a-mpeg4-adv.avi +f9069f8c07e8b378bfbc6a6a9d560a42 ff-a-mpeg4-adv.avi.asf +a6d61190cac45d8377b639d966941a89 ff-a-mpeg4-rc.avi +5b890b0e31a6229b1f3ca3512a678a93 ff-a-mpeg4-rc.avi.asf +5e165979319d7835de323225b582c613 ff-a-msmpeg4.avi +dd8f6a27791695faf8ca9e51f4c7f26d ff-a-msmpeg4.avi.asf +fd81fea47a391e3123110f6503a732cd ff-a-msmpeg4v2.avi +9d9cbd7c5345337c79a5ff61efc6c608 ff-a-msmpeg4v2.avi.asf +5c63e5ea93bc5e6f117406a65c529900 ff-a-odivx.avi +56d02bfe6e0321e4c8e849dcae9c677c ff-a-odivx.avi.asf 06fecb22d2b7570121ce342f09f58000 ff-a-rv10.rm b5972d167cddd0dc1204feddfcea35fd ff-a-rv10.rm.asf -e3ad78406c4e84a74ef64bfc819aff7b ff-a-wmv1.avi -cb18df1d019f3a8e8615eec58e357e15 ff-a-wmv1.avi.asf -a49f6b185a5e76e82013d944b3aa51c4 ff-a-wmv2.avi -6b23082933279132bd9a6cf97fbd5ee0 ff-a-wmv2.avi.asf +81777ac3db5a833c6ca3a0ff4db5a416 ff-a-wmv1.avi +56d2d8fc9c017b55df591185fbbd8093 ff-a-wmv1.avi.asf +4e19daf1395aaf3acd244d385ec533f0 ff-a-wmv2.avi +4096411f6a06d51693536a79233ff441 ff-a-wmv2.avi.asf 7ea4698fdd7fac1a16d4b99a55350612 ff-test_h.asf -a461e8805caa6d3793f163f73ac632ab ff-test_h.avi +8e9c92e3e8e601e33824e0c6a6d65b5a ff-test_h.avi 25efaa1650a9e16791d4c45f440fbb37 ff-test_h.mpg 8d887b4f8c99990724718c76f49d1715 ff-test_h.rm 574134f491d5ad8a2cf2c42673f2b29b ff-test.jpg b02019f2b2c87b35daa35913e759b46d ff-test_l.asf -379020eaa40200e8f09e6e8dc0409ba4 ff-test_l.avi +66d20641acabf714a17c8415e832ad75 ff-test_l.avi cbfff532fcd765e3976c40b7add94c64 ff-test_l.mpg eaf874a84f6db9407c4edad1760f8760 ff-test_l.rm 4913a7aa7acb917df1817b4b8d1b2356 ff-test.mjpg diff --git a/tests/rotozoom.regression.ref b/tests/rotozoom.regression.ref index c2e28c2e5f..67130296fa 100644 --- a/tests/rotozoom.regression.ref +++ b/tests/rotozoom.regression.ref @@ -2,40 +2,40 @@ ffmpeg regression test 1738d12380be0d8aa20d08e178349299 *./data/a-mpeg1.mpg 0cf790edd0f4c5cf993c2d59211b9de2 *./data/out.yuv stddev: 4.91 bytes:7299072 -bd0a8e71b47f6a7e1a3b7d66174b5c6e *./data/a-msmpeg4v2.avi +14db391f167b52b21a983157b410affc *./data/a-msmpeg4v2.avi fc8881e0904af9491d5fa0163183954b *./data/out.yuv stddev: 5.29 bytes:7602176 -6d86b5016bdca1770135fcdd77af4b0b *./data/a-msmpeg4.avi +484b4dccac1e552f0f29971f4a066598 *./data/a-msmpeg4.avi dd82e8badc40ad5f76b0ffc1d6945b1c *./data/out.yuv stddev: 5.29 bytes:7602176 -3a2b23230f5725aa5ef2eabb594cd076 *./data/a-wmv1.avi +d63c0cbb6d845bfd8e2735b4ea733a53 *./data/a-wmv1.avi 407c23671e7c7265c19c91966dbba317 *./data/out.yuv stddev: 5.29 bytes:7602176 -894207107bdeed1035eea80d1c4c6df2 *./data/a-wmv2.avi +ba4616dc4db0db636a7c26bc8f2de04e *./data/a-wmv2.avi 407c23671e7c7265c19c91966dbba317 *./data/out.yuv stddev: 5.29 bytes:7602176 -8595d8d211955cbabf4826b31f31f313 *./data/a-h263.avi +f980b5e38c4b919fbe5b660fe12fcf1a *./data/a-h263.avi 8bcc9f78373ec424e864b40734e124ba *./data/out.yuv stddev: 5.41 bytes:7602176 -e6457c7acacd0e5831a221b9dbcba38a *./data/a-h263p.avi +c7683a914f7377dd0d3c2d0be6892fe9 *./data/a-h263p.avi a63dcff871fd46481a4a7260aebbcdb5 *./data/out.yuv stddev: 1.89 bytes:7602176 -5078410b96832668ca82914c916e2bb1 *./data/a-odivx.avi +ea8c6216f605c3e581de70a39463aa48 *./data/a-odivx.avi 675ae0065619a2a73682f6a51ebf72d4 *./data/out.yuv stddev: 5.28 bytes:7602176 -9228e431ace33a47e82f3a3a117bf053 *./data/a-huffyuv.avi +242a7a18c2793e115007bc163861ef4e *./data/a-huffyuv.avi dde5895817ad9d219f79a52d0bdfb001 *./data/out.yuv stddev: 0.00 bytes:7602176 -1cf2ebe199f4db19ab7357c485577d7e *./data/a-mpeg4-rc.avi +2a9ee5a50073e3c5c25653f83d2b78ae *./data/a-mpeg4-rc.avi 6851f0023a361b2b088d115f6d42d03e *./data/out.yuv stddev: 5.12 bytes:7145472 -80b436826a1ed11b0479399f8bdf531d *./data/a-mpeg4-adv.avi +aeb300900461bdf9e0321934aa6dcc93 *./data/a-mpeg4-adv.avi e465df12f2c8a6492a6ec0b1bddc1d0d *./data/out.yuv stddev: 4.97 bytes:7602176 2ec827a941ee8e82911280405987f8ef *./data/a-mpeg1b.mpg 145c3741d70bc40d5c93de709aca70ee *./data/out.yuv stddev: 4.12 bytes:6842368 -b9c68a20e7dacbd1c47e770f57ebec66 *./data/a-mjpeg.avi +e9218a1db885fe0262e88f9df630307d *./data/a-mjpeg.avi a365b4da246ad68caf96b702b7f961a1 *./data/out.yuv stddev: 4.76 bytes:7602176 1b46671251277c14f3a24a034648c458 *./data/a-rv10.rm diff --git a/tests/server-regression.sh b/tests/server-regression.sh index e83df6041c..0e612716dd 100755 --- a/tests/server-regression.sh +++ b/tests/server-regression.sh @@ -1,5 +1,12 @@ #!/bin/bash - +# Even in the 21st century some diffs are not supporting -u. +diff -u $0 $0 > /dev/null 2>&1 +if [ $? -eq 0 ]; then + diff_cmd="diff -u" +else + diff_cmd="diff" +fi + # Make sure that the data directory exists mkdir -p data @@ -22,7 +29,7 @@ sleep 2 if [ `expr match $file "a-*"` -ne 0 ]; then wget $WGET_OPTIONS --output-document=- http://localhost:9999/$file > ff-$file & else - wget $WGET_OPTIONS --output-document=- http://localhost:9999/$file?date=19700101T000000Z | head --bytes=100000 > ff-$file & + wget $WGET_OPTIONS --output-document=- http://localhost:9999/$file?date=19700101T000000Z | dd bs=1 count=100000 > ff-$file 2>/dev/null & fi MDFILES="$MDFILES ff-$file" done @@ -32,7 +39,7 @@ sleep 2 ) kill $FFSERVER_PID wait > /dev/null 2>&1 -if diff -u data/ffserver.regression $1 ; then +if $diff_cmd data/ffserver.regression $1 ; then echo echo Server regression test succeeded. exit 0