aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-09-20 15:22:24 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-09-20 15:22:24 +0000
commit1dbb6d9026e75e1df2ebd919f071d9a872984a80 (patch)
treeaa050bd2ccebc328d2ea412e329927edb77fef47
parent084c726ba306eb19077ac525764acec6c110f1d4 (diff)
downloadffmpeg-1dbb6d9026e75e1df2ebd919f071d9a872984a80.tar.gz
regression test for ratecontrol & adv mpeg4 stuff
Originally committed as revision 962 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--ffmpeg.c17
-rw-r--r--tests/ffmpeg.regression.ref4
-rwxr-xr-xtests/regression.sh22
3 files changed, 43 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 4d8c436faa..2adaadba1d 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -117,6 +117,8 @@ static int do_deinterlace = 0;
static int workaround_bugs = 0;
static int error_resilience = 0;
static int dct_algo = 0;
+static int use_part = 0;
+static int packet_size = 0;
static int gop_size = 12;
static int intra_only = 0;
@@ -1570,6 +1572,11 @@ void opt_i_qoffset(const char *arg)
video_i_qoffset = atof(arg);
}
+void opt_packet_size(const char *arg)
+{
+ packet_size= atoi(arg);
+}
+
void opt_audio_bitrate(const char *arg)
{
audio_bit_rate = atoi(arg) * 1000;
@@ -1886,6 +1893,10 @@ void opt_output_file(const char *filename)
video_enc->flags |= CODEC_FLAG_4MV;
}
+ if(use_part)
+ video_enc->flags |= CODEC_FLAG_PART;
+
+
if (b_frames) {
if (codec_id != CODEC_ID_MPEG4) {
fprintf(stderr, "\nB frames encoding only supported by MPEG-4.\n");
@@ -1911,6 +1922,10 @@ void opt_output_file(const char *filename)
video_enc->i_quant_offset = video_i_qoffset;
video_enc->b_quant_offset = video_b_qoffset;
video_enc->dct_algo = dct_algo;
+ if(packet_size){
+ video_enc->rtp_mode= 1;
+ video_enc->rtp_payload_size= packet_size;
+ }
if (do_psnr)
video_enc->get_psnr = 1;
@@ -2276,7 +2291,9 @@ const OptionDef options[] = {
{ "bf", HAS_ARG | OPT_EXPERT, {(void*)opt_b_frames}, "use 'frames' B frames (only MPEG-4)", "frames" },
{ "hq", OPT_BOOL | OPT_EXPERT, {(void*)&use_hq}, "activate high quality settings" },
{ "4mv", OPT_BOOL | OPT_EXPERT, {(void*)&use_4mv}, "use four motion vector by macroblock (only MPEG-4)" },
+ { "part", OPT_BOOL | OPT_EXPERT, {(void*)&use_part}, "use data partitioning (only MPEG-4)" },
{ "bug", HAS_ARG | OPT_EXPERT, {(void*)opt_workaround_bugs}, "workaround not auto detected encoder bugs", "param" },
+ { "ps", HAS_ARG | OPT_EXPERT, {(void*)opt_packet_size}, "packet size", "size in bits" },
{ "sameq", OPT_BOOL, {(void*)&same_quality},
"use same video quality as source (implies VBR)" },
/* audio options */
diff --git a/tests/ffmpeg.regression.ref b/tests/ffmpeg.regression.ref
index 7dd3014fa2..bcb107b35f 100644
--- a/tests/ffmpeg.regression.ref
+++ b/tests/ffmpeg.regression.ref
@@ -11,6 +11,10 @@ abe11239875a32f00fa2910828bba4fb *./data/a-h263.avi
c1f6c8ee7a24d8345deddf1a24ca3756 *./data/out.yuv
440192aca11c310e01168ec24ea7807e *./data/a-odivx.avi
145c98a175e760f8ba1997edf15b2964 *./data/out.yuv
+e68a6f6f8a228605cc4b131b100e06df *./data/a-mpeg4-rc.avi
+d63755afb8a7bb851d1da7a54786acbb *./data/out.yuv
+f5f44dad09c2d4d16524e539645f693c *./data/a-mpeg4-adv.avi
+d0f077a3b42367d7432b73c0ddad7438 *./data/out.yuv
2846c8e3d97d7395eb746bfce44e0443 *./data/a-mjpeg.avi
278033451d7a6bfeb8339abbe4228499 *./data/out.yuv
202adaf59c09d703b55fc7dd95eace25 *./data/a-rv10.rm
diff --git a/tests/regression.sh b/tests/regression.sh
index cd64d398f2..081f58c33e 100755
--- a/tests/regression.sh
+++ b/tests/regression.sh
@@ -29,6 +29,8 @@ else
do_rv10=y
do_mp2=y
do_ac3=y
+ do_rc=y
+ do_mpeg4adv=y
fi
@@ -134,6 +136,26 @@ do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
fi
###################################
+if [ -n "$do_rc" ] ; then
+# mpeg4 rate control
+file=${outfile}mpeg4-rc.avi
+do_ffmpeg $file -y -b 400 -bf 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
+
+# mpeg4 rate control decoding
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+fi
+
+###################################
+if [ -n "$do_mpeg4adv" ] ; then
+# mpeg4
+file=${outfile}mpeg4-adv.avi
+do_ffmpeg $file -y -qscale 9 -4mv -hq -part -ps 1000 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
+
+# mpeg4 decoding
+do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
+fi
+
+###################################
if [ -n "$do_mjpeg" ] ; then
# mjpeg
file=${outfile}mjpeg.avi