4a31d1
diff -urNp old/userguide/libnetpbm_ug.html new/userguide/libnetpbm_ug.html
4a31d1
--- old/userguide/libnetpbm_ug.html	2017-09-05 14:20:09.734743404 +0200
4a31d1
+++ new/userguide/libnetpbm_ug.html	2017-09-05 14:47:30.496705483 +0200
4a31d1
@@ -374,7 +374,7 @@ plain format.
4a31d1
 

Reference

4a31d1
 
4a31d1
 

The Libnetpbm Netpbm Image

4a31d1
-Processing Manual describes the the libnetpbm functions for
4a31d1
+Processing Manual describes the libnetpbm functions for
4a31d1
 processing image data.
4a31d1
 
4a31d1
 

The Libnetpbm Utility Manual

4a31d1
diff -urNp old/userguide/pamfunc.html new/userguide/pamfunc.html
4a31d1
--- old/userguide/pamfunc.html	2017-09-05 14:20:09.738743398 +0200
4a31d1
+++ new/userguide/pamfunc.html	2017-09-05 14:47:41.760644848 +0200
4a31d1
@@ -57,7 +57,7 @@ output image.
4a31d1
 and bit string (such as and with 01001000).  For the arithmetic functions, the
4a31d1
 function arguments and results are the fraction that a sample is of the
4a31d1
 maxval, i.e. normal interpretation of PAM tuples.  But for the bit string
4a31d1
-functions, the value is the the bit string whose value as a binary cipher is
4a31d1
+functions, the value is the bit string whose value as a binary cipher is
4a31d1
 the sample value, and the maxval indicates the width of the bit string.
4a31d1
 
4a31d1
 

Arithmetic functions

4a31d1
diff -urNp old/userguide/pbmtextps.html new/userguide/pbmtextps.html
4a31d1
--- old/userguide/pbmtextps.html	2017-09-05 14:20:09.736743401 +0200
4a31d1
+++ new/userguide/pbmtextps.html	2017-09-05 14:47:58.840553598 +0200
4a31d1
@@ -185,7 +185,7 @@ edge of the type.  See 
4a31d1
 
-ascent=n
4a31d1
 
-descent=n
4a31d1
 
4a31d1
-These options control the the margins added to the image, measured from
4a31d1
+These options control the margins added to the image, measured from
4a31d1
 the text baseline.  See Margins for details.
4a31d1
 
4a31d1
 

Sizes are in points, as a floating point number.

4a31d1
diff -urNp old/userguide/pbmtog3.html new/userguide/pbmtog3.html
4a31d1
--- old/userguide/pbmtog3.html	2017-09-05 14:20:09.735743403 +0200
4a31d1
+++ new/userguide/pbmtog3.html	2017-09-05 14:48:55.648255793 +0200
4a31d1
@@ -77,7 +77,7 @@ You cannot specify both.
4a31d1
 

HISTORY

4a31d1
 
4a31d1
 

Before Netpbm 10.79 (June 2017), there was a different program by the same

4a31d1
-name in Netpbm, which was written by by Paul Haeberli
4a31d1
+name in Netpbm, which was written by Paul Haeberli
4a31d1
 <paul@manray.sgi.com> in 1989
4a31d1
 and then modified extensively by others.
4a31d1
 
4a31d1
diff -urNp old/userguide/ppmtompeg.html new/userguide/ppmtompeg.html
4a31d1
--- old/userguide/ppmtompeg.html	2017-09-05 14:20:09.739743396 +0200
4a31d1
+++ new/userguide/ppmtompeg.html	1970-01-01 01:00:00.000000000 +0100
4a31d1
@@ -1,1291 +0,0 @@
4a31d1
-
4a31d1
-<HTML>
4a31d1
-<HEAD>
4a31d1
-<TITLE>Ppmtompeg User Manual</TITLE>
4a31d1
-</HEAD>
4a31d1
-<BODY>
4a31d1
-

Ppmtompeg

4a31d1
-Updated: 23 July 2006
4a31d1
-
4a31d1
-Table Of Contents
4a31d1
-
4a31d1
-

NAME

4a31d1
-ppmtompeg - encode an MPEG-1 bitstream
4a31d1
-
4a31d1
-

SYNOPSIS

4a31d1
-
4a31d1
-ppmtompeg
4a31d1
-[options]
4a31d1
-parameter-file
4a31d1
-
4a31d1
-

DESCRIPTION

4a31d1
-
4a31d1
-

This program is part of Netpbm.

4a31d1
-
4a31d1
-

ppmtompeg produces an MPEG-1 video stream. MPEG-1 is the

4a31d1
-first great video compression method, and is what is used in Video CDs
4a31d1
-(VCD).  ppmtompeg originated in the year 1995.  DVD uses a more
4a31d1
-advanced method, MPEG-2.  There is an even newer method called MPEG-4
4a31d1
-which is also called Divx.  I don't know where one finds that used.
4a31d1
-
4a31d1
-

There's technically a difference between a compression method for

4a31d1
-video and an actual file (stream) format for a movie, and I don't know
4a31d1
-if it can be validly said that the format of the stream
4a31d1
-ppmtompeg produces is MPEG-1.
4a31d1
-
4a31d1
-

Mencoder from the Mplayer

4a31d1
-package is probably superior for most video format generation
4a31d1
-needs, if for no other reason than that it is more popular.
4a31d1
-
4a31d1
-

The programming library PM2V

4a31d1
-generates MPEG-2 streams.
4a31d1
-
4a31d1
-

Use Mplayer (not part of Netpbm)

4a31d1
-to do the reverse conversion: to create a series of PNM files from an MPEG
4a31d1
-stream.
4a31d1
-
4a31d1
-

param_file is a parameter file which includes a list of

4a31d1
-input files and other parameters.  The file is described in detail
4a31d1
-below.
4a31d1
-
4a31d1
-

To understand this program, you need to understand something about

4a31d1
-the complex MPEG-1 format.  One source of information about this
4a31d1
-standard format is the section Introduction to MPEG in the 
4a31d1
-href="http://www.faqs.org/faqs/compression-faq">Compression FAQ.
4a31d1
-
4a31d1
-

OPTIONS

4a31d1
-
4a31d1
-

The -gop, -combine_gops, -frames, and

4a31d1
--combine_frames options are all mutually exclusive.
4a31d1
-
4a31d1
-
4a31d1
-
-stat stat_file
4a31d1
-
4a31d1
-
This option causes ppmtompeg to append the statistics that
4a31d1
-it write to Standard Output to the file stat_file as well.  The
4a31d1
-statistics use the following abbreviations: bits per block (bpb), bits
4a31d1
-per frame (bpf), seconds per frame (spf), and bits per second (bps).
4a31d1
-
4a31d1
-

These statistics include how many I, P, and B frames there were,

4a31d1
-and information about compression and quality.
4a31d1
-
4a31d1
-
4a31d1
-
-quiet num_seconds
4a31d1
-
4a31d1
-
causes ppmtompeg not to report remaining time more often
4a31d1
-than every num_seconds seconds (unless the time estimate rises,
4a31d1
-which will happen near the beginning of the run).  A negative value
4a31d1
-tells ppmtompeg not to report at all.  0 is the default
4a31d1
-(reports once after each frame).  Note that the time remaining is an
4a31d1
-estimate and does not take into account time to read in frames.
4a31d1
-
4a31d1
-
-realquiet
causes ppmtompeg to run silently,
4a31d1
-with the only screen output being errors.  Particularly useful when
4a31d1
-reading input from stdin.
4a31d1
-
4a31d1
-
4a31d1
--no_frame_summary
4a31d1
-
4a31d1
-
This option prevents ppmtompeg from printing a summary
4a31d1
-line for each frame
4a31d1
-
4a31d1
-
-float_dct
4a31d1
-
4a31d1
-
forces ppmtompeg to use a more accurate, yet more
4a31d1
-computationally expensive version of the DCT.
4a31d1
-
4a31d1
-
-gop gop_num
4a31d1
-
4a31d1
-causes ppmtompeg to encode only the numbered GOP (first GOP is 0).  The
4a31d1
-parameter file is the same as for normal usage.  The output file will be
4a31d1
-the normal output file with the suffix .gop.gop_num.
4a31d1
-ppmtompeg does not output any sequence information.
4a31d1
-
4a31d1
-
-combine_gops
4a31d1
-
4a31d1
-
causes ppmtompeg simply to combine some GOP files into a
4a31d1
-single MPEG output stream.  ppmtompeg inserts a sequence header
4a31d1
-and trailer.  In this case, the parameter file needs only to contain 
4a31d1
-the SIZE value, an output file, and perhaps a list of input GOP
4a31d1
-files (see below).
4a31d1
-
4a31d1
-If you don't supply a list of input GOP files is used, then
4a31d1
-ppmtompeg assumes you're using the same parameter file you used
4a31d1
-when you created the input (with the -gop option) and
4a31d1
-calculates the corresponding gop filenames itself.  If this is not the
4a31d1
-case, you can specify input GOP files in the same manner as normal
4a31d1
-input files -- except instead of using INPUT_DIR, INPUT, and
4a31d1
-END_INPUT, use GOP_INPUT_DIR, GOP_INPUT, and GOP_END_INPUT.  If no
4a31d1
-input GOP files are specified, then the default is to use the output
4a31d1
-file name with suffix .gop.gop_num, with gop_num
4a31d1
-starting from 0, as the input files.
4a31d1
-     
4a31d1
-

Thus, unless you're mixing and matching GOP files from different

4a31d1
-sources, you can simply use the same parameter file for creating the
4a31d1
-GOP files (-gop) and for later turning them into an MPEG stream
4a31d1
-(-combine_gops).
4a31d1
-     
4a31d1
-
4a31d1
-
-frames first_frame last_frame
4a31d1
-
4a31d1
-
This option causes ppmtompeg to encode only the frames numbered
4a31d1
-first_frame to last_frame, inclusive.  The parameter
4a31d1
-file is the same as for normal usage.  The output will be placed in
4a31d1
-separate files, one per frame, with the file names being the normal
4a31d1
-output file name with the suffix .frame.frame_num.  No
4a31d1
-GOP header information is output.  (Thus, the parameter file need not
4a31d1
-include the GOP_SIZE value)
4a31d1
-
4a31d1
-

Use ppmtompeg -combine_frames to combine these frames later into

4a31d1
-an MPEG stream.
4a31d1
-
4a31d1
-
4a31d1
-
-combine_frames
4a31d1
-
4a31d1
-
This option causes ppmtompeg simply to combine some
4a31d1
-individual MPEG frames (such as you might have created with an earlier
4a31d1
-run of ppmtompeg -frames) into a single MPEG stream.  Sequence
4a31d1
-and GOP headers are inserted appropriately.  In this case, the
4a31d1
-parameter file needs to contain only the SIZE value, the GOP_SIZE
4a31d1
-value, an output file, and perhaps a list of frame files (see below).
4a31d1
-
4a31d1
-

The parameter file may specify input frame files in the same manner

4a31d1
-as normal input files -- except instead of using INPUT_DIR, INPUT, and
4a31d1
-END_INPUT, use FRAME_INPUT_DIR, FRAME_INPUT, and FRAME_END_INPUT. If
4a31d1
-no input frame files are specified, then the default is to use the
4a31d1
-output file name with suffix .frame.frame_num, with
4a31d1
-frame_num starting from 0, as the input files.
4a31d1
-     
4a31d1
-
4a31d1
-
4a31d1
-
-nice
4a31d1
-
4a31d1
-
This option causes ppmtompeg to run any remote processes
4a31d1
-"nicely," i.e.  at low priority.  (This is relevant only if you are
4a31d1
-running ppmtompeg in parallel mode.  Otherwise, there are no
4a31d1
-remote processes).  See 'man nice.'
4a31d1
-
4a31d1
-
-max_machines num_machines
4a31d1
-
4a31d1
-
This option causes ppmtompeg to use no more than
4a31d1
-num_machines machines as slaves for use in parallel encoding.
4a31d1
-
4a31d1
-
-snr
4a31d1
-
4a31d1
-
This option causes ppmtompeg to include the signal-to-noise
4a31d1
-ratio in the reported statistics.  Prints SNR (Y U V) and peak SNR (Y
4a31d1
-U V) for each frame.  In summary, prints averages of luminance only
4a31d1
-(Y).  SNR is defined as 10*log(variance of original/variance of
4a31d1
-error).  Peak SNR is defined as 20*log(255/RMSE).  Note that
4a31d1
-ppmtompeg runs a little slower when you use this option.
4a31d1
-
4a31d1
-
-mse
4a31d1
-
4a31d1
-
This option causes ppmtompeg to report the mean squared
4a31d1
-error per block.  It also automatically reports the quality of the
4a31d1
-images, so there is no need to specify -snr then.
4a31d1
-
4a31d1
-
-bit_rate_info rate_file
4a31d1
-
4a31d1
-
This option makes ppmtompeg write bit rate information
4a31d1
-into the file rate_file.  Bit rate information is bits per frame, and
4a31d1
-also bits per I-frame-to-I-frame.
4a31d1
-
4a31d1
-
-mv_histogram
4a31d1
-
4a31d1
-
This option causes ppmtompeg to print a histogram of the
4a31d1
-motion vectors as part of statistics.  There are three histograms --
4a31d1
-one for P frame, one for forward B frame, and one for backward B frame
4a31d1
-motion vectors.
4a31d1
-
4a31d1
-

The output is in the form of a matrix, each entry corresponding to one

4a31d1
-motion vector in the search window. The center of the matrix
4a31d1
-represents (0,0) motion vectors.
4a31d1
-
4a31d1
-
-debug_sockets
4a31d1
-
4a31d1
-
This option causes ppmtompeg to print to Standard Output
4a31d1
-messages that narrate the communication between the machines when you run
4a31d1
-ppmtompeg in parallel mode.
4a31d1
-
4a31d1
-
-debug_machines
4a31d1
-
4a31d1
-
This option causes ppmtompeg to print to Standard Output
4a31d1
-messages that narrate the progress of the conversion on the various
4a31d1
-machines when you run ppmtompeg in parallel
4a31d1
-mode.
4a31d1
-     
4a31d1
-
4a31d1
-
4a31d1
-

PARAMETER FILE

4a31d1
-
4a31d1
-

The parameter file must contain the following

4a31d1
-lines (except when using the -combine_gops or -combine_frames
4a31d1
-options):
4a31d1
-
4a31d1
-
4a31d1
-
4a31d1
-
PATTERN pattern
4a31d1
-
4a31d1
-
This statement specifies the pattern (sequence) of I frames, P frames,
4a31d1
-and B frames.  pattern is just a sequence of the letters I, P, and
4a31d1
-B with nothing between.  Example:
4a31d1
-
4a31d1
-
4a31d1
-    PATTERN IBBPBBPBBPBBPBB
4a31d1
-     
4a31d1
-
4a31d1
-

See I Frames, P Frames, B Frames.

4a31d1
-
4a31d1
-
OUTPUT output file
4a31d1
-
This names the file where the output MPEG stream goes.
4a31d1
-     
4a31d1
-
INPUT_DIR directory
4a31d1
-
4a31d1
-
This statement tells where the input images (frames) come from.
4a31d1
-If each frame is in a separate file, directory is the directory
4a31d1
-where they all are.  You may use . to refer to the current 
4a31d1
-directory.  A null directory refers to the root directory of the
4a31d1
-system file tree.
4a31d1
-
4a31d1
-

To have ppmtompeg read all the frames serially from Standard

4a31d1
-Input, specify
4a31d1
-
4a31d1
-    INPUT_DIR stdin
4a31d1
-
4a31d1
-
4a31d1
-
INPUT
4a31d1
-
4a31d1
-This line must be followed by a list of the input files (in display order)
4a31d1
-and then the line END_INPUT.
4a31d1
-
4a31d1
-

There are three types of lines between INPUT and END_INPUT. First,

4a31d1
-a line may simply be the name of an input file.  Second, the line
4a31d1
-may be of the form single_star_expr
4a31d1
-[x-y].
4a31d1
-single_star_expr can have a single * in it.  It is
4a31d1
-replaced by all the numbers between x and y inclusive.  So, for
4a31d1
-example, the line tennis*.ppm [12-15] refers to the files
4a31d1
-tennis12.ppm, tennis13.ppm, tennis14.ppm, tennis15.ppm.
4a31d1
-
4a31d1
-

Uniform zero-padding occurs, as well. For example, the line

4a31d1
-football.*.ppm [001-130] refers to the files football.001.ppm,
4a31d1
-football.002.ppm, ..., football.009.ppm, football.010.ppm, ...,
4a31d1
-football.130.ppm.
4a31d1
-
4a31d1
-

The third type of line is: single_star_expr

4a31d1
-[x-y+s], where the
4a31d1
-line is treated exactly as above, except that we skip by s.  Thus, the
4a31d1
-line football.*.ppm [001-130+4] refers to the files
4a31d1
-football.001.ppm, football.005.ppm, football.009.ppm,
4a31d1
-football.013.ppm, etc.
4a31d1
-
4a31d1
-

Furthermore, a line may specify a shell command to execute to

4a31d1
-generate lines to be interpreted as described above, as if those lines
4a31d1
-were in the parameter file instead.  Use back ticks, like in the
4a31d1
-Bourne Shell, like this:
4a31d1
-
4a31d1
-
4a31d1
-    `cat myfilelist`
4a31d1
-
4a31d1
-
4a31d1
-

4a31d1
-If input is from Standard Input (per the INPUT_DIR statement), 
4a31d1
-ppmtompeg ignores the INPUT/END_INPUT block, but
4a31d1
-it still must be present.
4a31d1
-     
4a31d1
-
BASE_FILE_FORMAT {PPM | PNM | YUV |
4a31d1
-     JPEG | JMOVIE}
4a31d1
-
4a31d1
-
ppmtompeg must convert all input files to one of the
4a31d1
-following formats as a first step of processing: PNM, YUV, JPEG(v4),
4a31d1
-or JMOVIE.  (The conversion may be trivial if your input files are
4a31d1
-already in one of these formats).  This line specifies which of the
4a31d1
-four formats.  PPM is actually a subset of PNM.  The separate
4a31d1
-specification is allowed for backward compatibility.  Use PNM instead
4a31d1
-of PPM in new applications.
4a31d1
-
4a31d1
-
INPUT_CONVERT conversion_command
4a31d1
-
4a31d1
-
You must specify how to convert a file to the base file format.
4a31d1
-If no conversion is necessary, then you would just say:
4a31d1
-
4a31d1
-     
4a31d1
-     INPUT_CONVERT *
4a31d1
-     
4a31d1
-     
4a31d1
-

Otherwise, conversion_command is a shell command that causes

4a31d1
-an image in the format your specified with BASE_FILE_FORMAT to
4a31d1
-be written to Standard Output.  ppmtompeg executes the command
4a31d1
-once for each line between INPUT and END_INPUT (which is
4a31d1
-normally, but not necessarily, a file name).  In the conversion
4a31d1
-command, ppmtompeg replaces each '*' with the contents of that
4a31d1
-line.
4a31d1
-     
4a31d1
-     If you had a bunch of gif files, you might say:
4a31d1
-     
4a31d1
-     INPUT_CONVERT giftopnm *
4a31d1
-     
4a31d1
-
4a31d1
-     If you have a bunch of separate a.Y, a.U, and a.V files (where
4a31d1
-     the U and V have already been subsampled), then you might say:
4a31d1
-
4a31d1
-     
4a31d1
-     INPUT_CONVERT cat *.Y *.U *.V
4a31d1
-     
4a31d1
-
4a31d1
-

Input conversion is not allowed with input from stdin, so use

4a31d1
-
4a31d1
-     
4a31d1
-     INPUT_CONVERT *
4a31d1
-     
4a31d1
-
4a31d1
-as described above.
4a31d1
-     
4a31d1
-
SIZE widthxheight
4a31d1
-
4a31d1
-
4a31d1
-
4a31d1
-

width and height are the width and height of each

4a31d1
-frame in pixels.
4a31d1
-
4a31d1
-

When ppmtompeg can get this information from the input image

4a31d1
-files, it ignores the SIZE parameter and you may omit it.
4a31d1
-
4a31d1
-

When the image files are in YUV format, the files don't contain

4a31d1
-dimension information, so SIZE is required.
4a31d1
-
4a31d1
-

When ppmtompeg is running in parallel mode, not all of the

4a31d1
-processes in the network have access to the image files, so
4a31d1
-SIZE is required and must give the same dimensions as the
4a31d1
-input image files.
4a31d1
-
4a31d1
-
YUV_SIZE widthxheight
4a31d1
-
4a31d1
-
This is an obsolete synonym of SIZE.
4a31d1
-
4a31d1
-
YUV_FORMAT {ABEKAS | PHILLIPS | UCB |
4a31d1
-                      EYUV | pattern}
4a31d1
-
4a31d1
-
This is meaningful only when BASE_FILE_FORMAT specifies
4a31d1
-YUV format, and then it is required.  It specifies the sub-format of
4a31d1
-the YUV class.
4a31d1
-
4a31d1
-
4a31d1
-
GOP_SIZE n
4a31d1
-
4a31d1
-
n is the number of frames in a Group of Pictures. Except that
4a31d1
-because a GOP must start with an I frame, ppmtompeg makes a GOP as
4a31d1
-much longer than n as it has to to make the next GOP start with an
4a31d1
-I frame. 
4a31d1
-
4a31d1
-

Normally, it makes sense to make your GOP size a multiple of your

4a31d1
-pattern length (the latter is determined by the PATTERN parameter file
4a31d1
-statement).
4a31d1
-
4a31d1
-

See Group Of Pictures.

4a31d1
-
4a31d1
-
SLICES_PER_FRAME n
4a31d1
-
n is roughly the number of slices per frame. Note, at
4a31d1
-least one MPEG player may complain if slices do not start at the left
4a31d1
-side of an image.  To ensure this does not happen, make sure the
4a31d1
-number of rows is divisible by SLICES_PER_FRAME.
4a31d1
-
4a31d1
-
PIXEL {FULL | HALF}
4a31d1
-
4a31d1
-
use half-pixel motion vectors, or just full-pixel ones It is
4a31d1
-usually important that you use half-pixel motion vectors, because it
4a31d1
-results in both better quality and better compression.
4a31d1
-     
4a31d1
-
4a31d1
-
RANGE n
4a31d1
-
Use a search range of n pixels in each of the four directions
4a31d1
-from a subject pixel.  (So the search window is a square n*2 pixels
4a31d1
-on a side).
4a31d1
-
4a31d1
-
PSEARCH_ALG {EXHAUSTIVE | TWOLEVEL |
4a31d1
-     SUBSAMPLE | LOGARITHMIC}
4a31d1
-
4a31d1
-
This statement tells ppmtompeg what kind of search
4a31d1
-    technique (algorithm) to use for P frames.  You select the desired
4a31d1
-    combination of speed and compression.  EXHAUSTIVE gives the
4a31d1
-    best compression, but LOGARITHMIC is the fastest.
4a31d1
-    TWOLEVEL is an exhaustive full-pixel search, followed by a
4a31d1
-    local half- pixel search around the best full-pixel vector (the
4a31d1
-    PIXEL option is ignored for this search technique).
4a31d1
-
4a31d1
-
BSEARCH_ALG {SIMPLE | CROSS2 | EXHAUSTIVE}
4a31d1
-
4a31d1
-
This statement tells ppmtompeg what kind of search
4a31d1
-    technique (algorithm) to use for B frames.  SIMPLE means
4a31d1
-    find best forward and backward vectors, then interpolate.
4a31d1
-    CROSS2 means find those two vectors, then see what backward
4a31d1
-    vector best matches the best forward vector, and vice versa.
4a31d1
-    EXHAUSTIVE does an n-squared search and is
4a31d1
-    extremely slow in relation to the others (CROSS2
4a31d1
-    is about half as fast as SIMPLE).
4a31d1
-
4a31d1
-
IQSCALE n
4a31d1
-
Use n as the qscale for I frames.
4a31d1
-     See Qscale.
4a31d1
-
4a31d1
-
PQSCALE n
4a31d1
-
Use n as the qscale for P frames.
4a31d1
-     See Qscale.
4a31d1
-
4a31d1
-
BQSCALE n
4a31d1
-
Use n as the qscale for B frames.
4a31d1
-     See Qscale.
4a31d1
-
4a31d1
-
REFERENCE_FRAME {ORIGINAL | DECODED}
This
4a31d1
-statement determines whether ppmtompeg uses the original images
4a31d1
-or the decoded images when computing motion vectors.  Using decoded
4a31d1
-images is more accurate and should increase the playback quality of
4a31d1
-the output, but it makes the encoding take longer and seems to give
4a31d1
-worse compression.  It also causes some complications with parallel
4a31d1
-encoding. (see the section on parallel encoding).  One thing you can
4a31d1
-do as a trade-off is select ORIGINAL here, and lower the
4a31d1
-qscale (see QSCALE if the quality is not good enough.
4a31d1
-
4a31d1
-
4a31d1
-summary="comparison of original to decoded">
4a31d1
-  <caption>Original or Decoded? (Normalized)</caption>
4a31d1
-
4a31d1
-
4a31d1
-  
4a31d1
-    Reference
4a31d1
-    Compression
4a31d1
-    Speed
4a31d1
-    Quality I
4a31d1
-    Quality P
4a31d1
-    Quality B
4a31d1
-    
4a31d1
-  
4a31d1
-    Decoded
4a31d1
-    1000
4a31d1
-    1000
4a31d1
-    1000
4a31d1
-    969
4a31d1
-    919
4a31d1
-    
4a31d1
-  
4a31d1
-    Original
4a31d1
-    885
4a31d1
-    1373
4a31d1
-    1000
4a31d1
-    912
4a31d1
-    884
4a31d1
-    
4a31d1
-  
4a31d1
-
4a31d1
-
4a31d1
-
4a31d1
-
4a31d1
-     
4a31d1
-

The following lines are optional:

4a31d1
-
4a31d1
-
4a31d1
-
4a31d1
-
FORCE_ENCODE_LAST_FRAME
4a31d1
-
4a31d1
-
This statement is obsolete. It does nothing.
4a31d1
-
4a31d1
-

Before Netpbm 10.26 (January 2005), ppmtompeg would drop

4a31d1
-trailing B frames from your movie, since a movie can't end with a B
4a31d1
-frame.  (See I Frames, P Frames, B Frames.
4a31d1
-You would have to specify FORCE_ENCODE_LAST_FRAME to stop
4a31d1
-that from happening and get the same function that ppmtompeg
4a31d1
-has today.
4a31d1
-
4a31d1
-
4a31d1
-
NIQTABLE
4a31d1
-
4a31d1
-
This statement specifies a custom non-intra quantization table.
4a31d1
-If you don't specify this statement, ppmtompeg uses a default
4a31d1
-non-intra quantization table.
4a31d1
-
4a31d1
-

4a31d1
-The 8 lines immediately following NIQTABLE specify the quantization
4a31d1
-table.  Each line defines a table row and consists of 8 integers,
4a31d1
-whitespace-delimited, which define the table columns.
4a31d1
-
4a31d1
-
IQTABLE
4a31d1
-
4a31d1
-
This is analogous to NIQTABLE, but for the intra quantization table.
4a31d1
-
4a31d1
-
ASPECT_RATIO ratio
4a31d1
-
4a31d1
-
This statement specifies the aspect ratio for ppmtompeg to
4a31d1
-specify in the MPEG output.  I'm not sure what this is used for.
4a31d1
-
4a31d1
-

ratio must be 1.0, 0.6735, 0.7031, 0.7615, 0.8055, 0.8437,

4a31d1
-0.8935, 0.9157, 0.9815, 1.0255, 1.0695, 1.0950, 1.1575, or 1.2015.
4a31d1
-
4a31d1
-
FRAME_RATE rate
4a31d1
-
This specifies the frame rate for ppmtompeg to specify in the
4a31d1
-MPEG output.  Some players use this value to determine the playback rate.
4a31d1
-
4a31d1
-

rate must be 23.976, 24, 25, 29.97, 30, 50, 59.94, or 60.

4a31d1
-
4a31d1
-
BIT_RATE rate
4a31d1
-
This specifies the bit rate for Constant Bit Rate (CBR) encoding.
4a31d1
-
4a31d1
-

rate must be an integer.

4a31d1
-
4a31d1
-
BUFFER_SIZE size
4a31d1
-
4a31d1
-
This specifies the value
4a31d1
-ppmtompeg is to specify in the MPEG output for the Video
4a31d1
-Buffering Verifier (VBV) buffer size needed to decode the sequence.
4a31d1
-
4a31d1
-

A Video Verifying Buffer is a buffer in which a decoder keeps the

4a31d1
-decoded bits in order to match the uneven speed of the decoding with
4a31d1
-the required constant playback speed.
4a31d1
-
4a31d1
-

As ppmtompeg encodes the image, it simulates the decoding

4a31d1
-process in terms of how many bits would be in the VBV as each frame gets
4a31d1
-decoded, assuming a VBV of the size you indicate.  
4a31d1
-
4a31d1
-

If you specify the WARN_VBV_UNDERFLOW statement,

4a31d1
-ppmtompeg issues a warning each time the simulation underflows
4a31d1
-the buffer, which suggests that an underflow would occur on playback,
4a31d1
-which suggests the buffer is too small.
4a31d1
-
4a31d1
-

If you specify the WARN_VBV_OVERFLOW statement,

4a31d1
-ppmtompeg issues a warning each time the simulation overflows
4a31d1
-the buffer, which suggests that an overflow would occur on playback,
4a31d1
-which suggests the buffer is too small.
4a31d1
-
4a31d1
-
WARN_VBV_UNDERFLOW
4a31d1
-
WARN_VBV_OVERFLOW
4a31d1
-
4a31d1
-
See BUFFER_SIZE.
4a31d1
-
4a31d1
-

These options were new in Netpbm 10.26 (January 2005). Before that,

4a31d1
-ppmtompeg issued the warnings always.
4a31d1
-
4a31d1
-
4a31d1
-
4a31d1
-
4a31d1
-The following statements apply only to parallel operation:
4a31d1
-
4a31d1
-
4a31d1
-
4a31d1
-
PARALLEL
4a31d1
-
4a31d1
-
This statement, paired with END PARALLEL, is what causes
4a31d1
-ppmtompeg to operate in parallel mode.  See 
4a31d1
-href="#parallel">Parallel Operation.
4a31d1
-
4a31d1
-
END PARALLEL
4a31d1
-
4a31d1
-
This goes with PARALLEL.
4a31d1
-
4a31d1
-
PARALLEL_TEST_FRAMES n
4a31d1
-
4a31d1
-
The master starts off by measuring each slave's speed. It does
4a31d1
-this by giving each slave n frames to encode and noting how
4a31d1
-long the slave takes to finish.  These are not just test frames,
4a31d1
-though -- they're real frames and the results become part of the
4a31d1
-output.
4a31d1
-ppmtompeg is old and measures time in undivided seconds, so
4a31d1
-to get useful timings, specify enough frames that it will take at
4a31d1
-least 5 seconds to process them.  The default is 10.
4a31d1
-
4a31d1
-

If you specify FORCE_I_ALIGN, ppmtompeg will increase

4a31d1
-the test frames value enough to maintain the alignment.
4a31d1
-
4a31d1
-

If there aren't enough frames for every slave to have the indicated

4a31d1
-number of test frames, ppmtompeg will give some slaves fewer.
4a31d1
-
4a31d1
-
4a31d1
-
PARALLEL_TIME_CHUNKS t
4a31d1
-
4a31d1
-
When you specify this statement, the master attempts to feed work
4a31d1
-to the slaves in chunks that take t seconds to process.  It uses
4a31d1
-the speed measurement it made when it started up (see PARALLEL_TEST_FRAMES)
4a31d1
-to decide how many frames to put in the chunk.  This statement obviously
4a31d1
-doesn't affect the first batch of work sent to each slave, which is the
4a31d1
-one used to measure the slave's speed.
4a31d1
-
4a31d1
-

Smaller values of t increase communication, but improve load

4a31d1
-balancing.  The default is 30 seconds.
4a31d1
-
4a31d1
-

You may specify only one of PARALLEL_TIME_CHUNKS, PARALLEL_CHUNK_TAPER,

4a31d1
-and PARALLEL_PERFECT.  PARALLEL_CHUNK_TAPER is usually best.
4a31d1
-
4a31d1
-
PARALLEL_CHUNK_TAPER
4a31d1
-
4a31d1
-
When you specify this statement, the master distributes work like
4a31d1
-with PARALLEL_TIME_CHUNKS, except that the master chooses the number
4a31d1
-of seconds for the chunks.  It starts with a large number and, as it
4a31d1
-gets closer to finishing the job, reduces it.  That way, it reduces
4a31d1
-scheduling overhead when precise scheduling isn't helpful, but still
4a31d1
-prevents a slave from finishing early after all the work has already
4a31d1
-been handed out to the other slaves, and then sitting idle while
4a31d1
-there's still work to do.
4a31d1
-
4a31d1
-

You may specify only one of PARALLEL_TIME_CHUNKS, PARALLEL_CHUNK_TAPER,

4a31d1
-and PARALLEL_PERFECT.  PARALLEL_CHUNK_TAPER is usually best.
4a31d1
-
4a31d1
-
4a31d1
-
PARALLEL_PERFECT
4a31d1
-
4a31d1
-
If this statement is present, ppmtompeg schedules on the
4a31d1
-assumption that each machine is about the same speed.  The master will
4a31d1
-simply divide up the frames evenly between the slaves -- each
4a31d1
-slave gets the same number of frames.  If some slaves are faster than
4a31d1
-others, they will finish first and remain idle while the slower slaves
4a31d1
-continue.  
4a31d1
-
4a31d1
-

This has the advantage of minimal scheduling overhead. Where slaves

4a31d1
-have different speeds, though, it makes inefficient use of the fast
4a31d1
-ones.  Where slaves are the same speed, it also has the disadvantage
4a31d1
-that they all finish at the same time and feed their output to the
4a31d1
-single Combine Server in a burst, which makes less efficient use of
4a31d1
-the Combine Server and thus can increase the total elapsed time.
4a31d1
-
4a31d1
-

You may specify only one of PARALLEL_TIME_CHUNKS, PARALLEL_CHUNK_TAPER,

4a31d1
-and PARALLEL_PERFECT.  PARALLEL_CHUNK_TAPER is usually best.
4a31d1
-
4a31d1
-
RSH remote_shell_command
4a31d1
-
4a31d1
-
ppmtompeg executes the shell command
4a31d1
-remote_shell_command to start a process on another machine.
4a31d1
-The default command is rsh, and whatever command you specify
4a31d1
-must have compatible semantics.  ssh is usually compatible.
4a31d1
-The command ppmtompeg uses is one like this:
4a31d1
-ssh remote.host.com -l username shellcommand.
4a31d1
-
4a31d1
-

Be sure to set up .rhosts files or SSH key authorizations

4a31d1
-where needed.  Otherwise, you'll have to type in passwords.
4a31d1
-
4a31d1
-

On some HP machines, rsh is the restricted shell, and you want

4a31d1
-to specify remsh.
4a31d1
-
4a31d1
-
FORCE_I_ALIGN
4a31d1
-
4a31d1
-
This statement forces each slave to encode a chunk of frames which
4a31d1
-is a multiple of the pattern length (see PATTERN).  Since the
4a31d1
-first frame in any pattern is an I frame, this forces each chunk
4a31d1
-encoded by a slave to begin with an I frame.
4a31d1
-
4a31d1
-

This document used to say there was an argument to

4a31d1
-FORCE_I_ALIGN which was the number of frames ppmtompeg
4a31d1
-would use (and was required to be a multiple of the pattern length).
4a31d1
-But ppmtompeg has apparently always ignored that argument, and
4a31d1
-it does now.
4a31d1
-
4a31d1
-
KEEP_TEMP_FILES
4a31d1
-
4a31d1
-
This statement causes ppmtompeg not to delete the temporary
4a31d1
-files it uses to transmit encoded frames to the combine server.  This
4a31d1
-means you will be left with a file for each frame, the same as you
4a31d1
-would get with the -frames option.  
4a31d1
-
4a31d1
-

This is mostly useful for debugging.

4a31d1
-
4a31d1
-

This works only if you're using a shared filesystem to communicate

4a31d1
-between the servers.
4a31d1
-
4a31d1
-

This option was new in Netpbm 10.26 (January 2005).

4a31d1
-
4a31d1
-
4a31d1
-
4a31d1
-
4a31d1
-

Parameter File Notes

4a31d1
-
4a31d1
-

If you use the -combine_gops option, then you need to specify

4a31d1
-only the SIZE and OUTPUT values in the parameter file.  In
4a31d1
-addition, the parameter file may specify input GOP files in the same
4a31d1
-manner as normal input files -- except instead of using INPUT_DIR,
4a31d1
-INPUT, and END_INPUT, use GOP_INPUT_DIR, GOP_INPUT, and GOP_END_INPUT.
4a31d1
-If you specify no input GOP files, then ppmtompeg uses by default the
4a31d1
-output file name with suffix .gop.gop_num, with gop_num
4a31d1
-starting from 0, as the input files. 
4a31d1
-
4a31d1
-

If you use the -combine_frames option, then you need to

4a31d1
-specify only the SIZE, GOP_SIZE, and OUTPUT values in the
4a31d1
-parameter file.  In addition, the parameter file may specify input
4a31d1
-frame files in the same manner as normal input files -- except instead
4a31d1
-of using INPUT_DIR, INPUT, and END_INPUT, use FRAME_INPUT_DIR,
4a31d1
-FRAME_INPUT, and FRAME_END_INPUT.  If no input frame files are
4a31d1
-specified, then the default is to use the output file name with suffix
4a31d1
-.frame.frame_num, with frame_num starting from 0,
4a31d1
-as the input files.
4a31d1
-
4a31d1
-

Any number of spaces and tabs may come between each option and value. Lines

4a31d1
-beginning with # are ignored.  Any other lines are ignored except for
4a31d1
-those between INPUT and END_INPUT.  This allows you to use the same
4a31d1
-parameter file for normal usage and for -combine_gops and
4a31d1
--combine_frames.
4a31d1
-
4a31d1
-

The file format is case-sensitive so all keywords should be in

4a31d1
-upper case.
4a31d1
-
4a31d1
-

The statements may appear in any order, except that the order within

4a31d1
-a block statement (such as INPUT ... END INPUT) is significant.
4a31d1
-
4a31d1
-

ppmtompeg is prepared to handle up to 16 B frames between

4a31d1
-reference frames when encoding with input from stdin.  (To build a
4a31d1
-modified ppmtompeg with a higher limit, change the constant
4a31d1
-B_FRAME_RUN in frame.c and recompile).
4a31d1
-
4a31d1
-

GENERAL USAGE INFORMATION

4a31d1
-
4a31d1
-

Qscale

4a31d1
-
4a31d1
-

The quantization scale values (qscale) give a trade-off between

4a31d1
-quality and compression.  Using different Qscale values has very little
4a31d1
-effect on speed.  The qscale values can be set separately for I, P, and
4a31d1
-B frames.
4a31d1
-
4a31d1
-

You select the qscale values with the IQSCALE,

4a31d1
-PQSCALE, and BSCALE parameter file statements.
4a31d1
-
4a31d1
-

A qscale value is an integer from 1 to 31. Larger numbers give

4a31d1
-better compression, but worse quality.  In the following, the quality
4a31d1
-numbers are peak signal-to-noise ratio, defined as:
4a31d1
-signal-to-noise formula
4a31d1
-where MSE is the mean squared error.
4a31d1
-     
4a31d1
-
4a31d1
-

Flower garden tests:

4a31d1
-
4a31d1
-
4a31d1
-  <caption>Qscale vs Quality</caption>
4a31d1
-
4a31d1
-
4a31d1
-  
4a31d1
-    Qscale
4a31d1
-    I Frames
4a31d1
-    P Frames
4a31d1
-    B Frames
4a31d1
-    
4a31d1
-  
4a31d1
-    1
4a31d1
-    43.2
4a31d1
-    46.3
4a31d1
-    46.5
4a31d1
-    
4a31d1
-  
4a31d1
-    6
4a31d1
-    32.6
4a31d1
-    34.6
4a31d1
-    34.3
4a31d1
-    
4a31d1
-  
4a31d1
-    11
4a31d1
-    28.6
4a31d1
-    29.5
4a31d1
-    30.0
4a31d1
-    
4a31d1
-  
4a31d1
-    16
4a31d1
-    26.3
4a31d1
-    26.8
4a31d1
-    28.6
4a31d1
-    
4a31d1
-  
4a31d1
-    21
4a31d1
-    24.7
4a31d1
-    25.0
4a31d1
-    27.9
4a31d1
-    
4a31d1
-  
4a31d1
-    26
4a31d1
-    23.5
4a31d1
-    23.9
4a31d1
-    27.5
4a31d1
-    
4a31d1
-  
4a31d1
-    31
4a31d1
-    22.6
4a31d1
-    23.0
4a31d1
-    27.3
4a31d1
-    
4a31d1
-
4a31d1
-
4a31d1
-
4a31d1
-summary="Qscale vs Compression">
4a31d1
-  <caption>Qscale vs Compression</caption>
4a31d1
-
4a31d1
-
4a31d1
-  
4a31d1
-    Qscale
4a31d1
-    I Frames
4a31d1
-    P Frames
4a31d1
-    B Frames
4a31d1
-    
4a31d1
-  
4a31d1
-    1
4a31d1
-    2
4a31d1
-    2
4a31d1
-    2
4a31d1
-    
4a31d1
-  
4a31d1
-    6
4a31d1
-    7
4a31d1
-    10
4a31d1
-    15
4a31d1
-    
4a31d1
-  
4a31d1
-    11
4a31d1
-    11
4a31d1
-    18
4a31d1
-    43
4a31d1
-    
4a31d1
-  
4a31d1
-    16
4a31d1
-    15
4a31d1
-    29
4a31d1
-    97
4a31d1
-    
4a31d1
-  
4a31d1
-    21
4a31d1
-    19
4a31d1
-    41
4a31d1
-    173
4a31d1
-    
4a31d1
-  
4a31d1
-    26
4a31d1
-    24
4a31d1
-    56
4a31d1
-    256
4a31d1
-    
4a31d1
-  
4a31d1
-    31
4a31d1
-    28
4a31d1
-    73
4a31d1
-    330
4a31d1
-    
4a31d1
-
4a31d1
-
4a31d1
-
4a31d1
-

Search Techniques

4a31d1
-     
4a31d1
-

There are several different motion vector search techniques

4a31d1
-available.  There are different techniques available for P frame
4a31d1
-search and B frame search. Using different search techniques present
4a31d1
-little difference in quality, but a large difference in compression
4a31d1
-and speed.
4a31d1
-     
4a31d1
-

There are 4 types of P frame search: Exhaustive, TwoLevel,

4a31d1
-SubSample, and Logarithmic.
4a31d1
-     
4a31d1
-

There are 3 types of B frame search: Exhaustive, Cross2, and

4a31d1
-Simple.
4a31d1
-     
4a31d1
-The recommended search techniques are TwoLevel and Logarithmic for
4a31d1
-P frame search, and Cross2 and Simple for B frame search. Here are
4a31d1
-some numbers comparing the different search methods:
4a31d1
-     
4a31d1
-
4a31d1
-summary="P frame motion vector search">
4a31d1
-  <caption>P frame Motion Vector Search (Normalized)</caption>
4a31d1
-
4a31d1
-
4a31d1
-  
4a31d1
-    Technique
4a31d1
-    Compression<sup>1</sup>
4a31d1
-    Speed      <sup>2</sup>
4a31d1
-    Quality    <sup>3</sup>
4a31d1
-    
4a31d1
-  
4a31d1
-    Exhaustive
4a31d1
-    1000
4a31d1
-    1000
4a31d1
-    1000
4a31d1
-    
4a31d1
-  
4a31d1
-    SubSample
4a31d1
-    1008
4a31d1
-    2456
4a31d1
-    1000
4a31d1
-    
4a31d1
-  
4a31d1
-    TwoLevel
4a31d1
-    1009
4a31d1
-    3237
4a31d1
-    1000
4a31d1
-    
4a31d1
-  
4a31d1
-    Logarithmic
4a31d1
-    1085
4a31d1
-    8229
4a31d1
-    998
4a31d1
-    
4a31d1
-
4a31d1
-
4a31d1
-
4a31d1
-summary="B frame motion vector search">
4a31d1
-  <caption>B frame Motion Vector Search (Normalized)</caption>
4a31d1
-
4a31d1
-
4a31d1
-  
4a31d1
-    Technique
4a31d1
-    Compression<sup>1</sup>
4a31d1
-    Speed<sup>2</sup>
4a31d1
-    Quality<sup>3</sup>
4a31d1
-    
4a31d1
-  
4a31d1
-    Exhaustive
4a31d1
-    1000
4a31d1
-    1000
4a31d1
-    1000
4a31d1
-    
4a31d1
-  
4a31d1
-    Cross2
4a31d1
-    975
4a31d1
-    1000
4a31d1
-    996
4a31d1
-    
4a31d1
-  
4a31d1
-    Simple
4a31d1
-    938
4a31d1
-    1765
4a31d1
-    991
4a31d1
-    
4a31d1
-
4a31d1
-
4a31d1
- <sup>1</sup>Smaller numbers are better
4a31d1
-compression.
4a31d1
-
4a31d1
- <sup>2</sup>Larger numbers mean faster
4a31d1
-execution.
4a31d1
-
4a31d1
- <sup>3</sup>Larger numbers mean better quality.
4a31d1
-
4a31d1
-

For some reason, Simple seems to give better compression, but it

4a31d1
-depends on the image sequence.
4a31d1
-
4a31d1
-

Select the search techniques with the PSEARCH_ALG and

4a31d1
-BSEARCH_ALG parameter file statements.
4a31d1
-
4a31d1
-
4a31d1
-
4a31d1
-

Group Of Pictures (GOP)

4a31d1
-
4a31d1
-

A Group of Pictures (GOP) is a roughly independently decodable

4a31d1
-sequence of frames.  An MPEG video stream is made of one or more
4a31d1
-GOP's.  You may specify how many frames should be in each GOP with the
4a31d1
-GOP_SIZE parameter file statement.  A GOP always starts with an
4a31d1
-I frame.
4a31d1
-
4a31d1
-

Instead of encoding an entire sequence, you can encode a single

4a31d1
-GOP.  To do this, use the -gop command option.  You can later
4a31d1
-join the resulting GOP files at any time by running ppmtompeg
4a31d1
-with the -combine_gops command option.
4a31d1
-     
4a31d1
-     
4a31d1
-

Slices

4a31d1
-
4a31d1
-

A slice is an independently decodable unit in a frame. It can be

4a31d1
-as small as one macroblock, or it can be as big as the entire frame.
4a31d1
-Barring transmission error, adding slices does not change quality or
4a31d1
-speed; the only effect is slightly worse compression.  More slices are
4a31d1
-used for noisy transmission so that errors are more recoverable. Since
4a31d1
-usually errors are not such a problem, we usually just use one slice
4a31d1
-per frame.
4a31d1
-     
4a31d1
-

Control the slice size with the SLICES_PER_FRAME parameter

4a31d1
-file statement.
4a31d1
-
4a31d1
-

Some MPEG playback systems require that each slice consist of whole

4a31d1
-rows of macroblocks.  If you are encoding for this kind of player, if
4a31d1
-the height of the image is H pixels, then you should set the
4a31d1
-SLICES_PER_FRAME to some number which divides H/16.  For example, if
4a31d1
-the image is 240 pixels (15 macroblocks) high, then you should use
4a31d1
-only 15, 5, 3, or 1 slices per frame.
4a31d1
-     
4a31d1
-

Note: these MPEG playback systems are really wrong, since the MPEG

4a31d1
-standard says this doesn't have to be so.
4a31d1
-
4a31d1
-
4a31d1
-
4a31d1
-

Search Window

4a31d1
-     
4a31d1
-

The search window is the window in which ppmtompeg searches

4a31d1
-for motion vectors.  The window is a square.  You can specify the size
4a31d1
-of the square, and whether to allow half-pixel motion vectors or not,
4a31d1
-with the RANGE and PIXEL parameter file statements.
4a31d1
-
4a31d1
-

I Frames, P Frames, B Frames

4a31d1
-
4a31d1
-

In MPEG-1, a movie is represented as a sequence of MPEG frames,

4a31d1
-each of which is an I Frame, a P Frame, or a B Frame.  Each represents
4a31d1
-an actual frame of the movie (don't get confused by the dual use of
4a31d1
-the word "frame."  A movie frame is a graphical image.  An MPEG frame
4a31d1
-is a set of data that describes a movie frame).
4a31d1
-
4a31d1
-

An I frame ("intra" frame) describes a movie frame in isolation --

4a31d1
-without respect to any other frame in the movie.  A P frame
4a31d1
-("predictive" frame) describes a movie frame by describing how it
4a31d1
-differs from the movie frame described by the latest preceding I  or
4a31d1
-P frame.  A B frame ("bidirectional" frame) describes a movie frame by
4a31d1
-describing how it differs from the movie frames described by the
4a31d1
-nearest I or P frame before and after it.
4a31d1
-
4a31d1
-

Note that the first frame of a movie must be described by an I

4a31d1
-frame (because there is no previous movie frame) and the last movie
4a31d1
-frame must be described by an I or P frame (because there is no
4a31d1
-subsequent movie frame).
4a31d1
-
4a31d1
-

Beyond that, you can choose which frames are represented by which

4a31d1
-types.  You specify a pattern, such as IBPBP and ppmtompeg
4a31d1
-simply repeats it over and over throughout the movie.  The pattern
4a31d1
-affects speed, quality, and stream size.  Here is a chart which shows
4a31d1
-some of the trade-offs:
4a31d1
-
4a31d1
-
4a31d1
-summary="Comparison of I/P/B Frames">
4a31d1
-  <caption>Comparison of I/P/B Frames (Normalized)</caption>
4a31d1
-
4a31d1
-
4a31d1
-  
4a31d1
-    Frame Type
4a31d1
-    Size
4a31d1
-    Speed
4a31d1
-    Quality
4a31d1
-    
4a31d1
-  
4a31d1
-    I frames
4a31d1
-    1000
4a31d1
-    1000
4a31d1
-    1000
4a31d1
-    
4a31d1
-  
4a31d1
-    P frames
4a31d1
-    409
4a31d1
-    609
4a31d1
-    969
4a31d1
-    
4a31d1
-  
4a31d1
-    B frames
4a31d1
-    72
4a31d1
-    260
4a31d1
-    919
4a31d1
-    
4a31d1
-  
4a31d1
-
4a31d1
-(this is with constant qscale)
4a31d1
-     
4a31d1
-

A standard sequence is IBBPBBPBBPBBPBB.

4a31d1
-     
4a31d1
-

Select the sequence with the PATTERN parameter file statement.

4a31d1
-
4a31d1
-

Since the last MPEG frame cannot be a B frame (see above), if the

4a31d1
-pattern you specify indicates a B frame for the last movie frame of
4a31d1
-the movie, ppmtompeg makes it an I frame instead.
4a31d1
-
4a31d1
-

Before Netpbm 10.26 (January 2005), ppmtompeg instead drops

4a31d1
-the trailing B frames by default, and you need the
4a31d1
-FORCE_ENCODE_LAST_FRAME parameter file statement to make it do
4a31d1
-this.
4a31d1
-
4a31d1
-

The MPEG frames don't appear in the MPEG-1 stream in the same order that

4a31d1
-the corresponding movie frames appear in the movie -- the B frames come after
4a31d1
-the I and P frames on which they are based.  For example, if the movie is
4a31d1
-4 frames that you will represent with the pattern IBBP, the MPEG-1 stream
4a31d1
-will start with an I frame describing movie frame 0.  The next frame in
4a31d1
-the MPEG-1 stream is a P frame describing movie frame 3.  The last two
4a31d1
-frames in the MPEG-1 stream are B frames describing movie frames 1 and 2,
4a31d1
-respectively.
4a31d1
-
4a31d1
-
4a31d1
-

Specifying Input and Output Files

4a31d1
-
4a31d1
-

Specify the input frame images with the INPUT_DIR,

4a31d1
-INPUT, END_INPUT, BASE_FILE_FORMAT,
4a31d1
-SIZE, YUV_FORMAT and INPUT_CONVERT parameter
4a31d1
-file statements.
4a31d1
-
4a31d1
-

Specify the output file with the OUTPUT parameter file statement.

4a31d1
-
4a31d1
-
4a31d1
-

Statistics

4a31d1
-
4a31d1
-

ppmtompeg can generate a variety of statistics about the

4a31d1
-encoding.  See the -stat, -snr, -mv_histogram,
4a31d1
--quiet, -no_frame_summary, and -bit_rate_info
4a31d1
-options.
4a31d1
-     
4a31d1
-
4a31d1
-

PARALLEL OPERATION

4a31d1
-
4a31d1
-

You can run ppmtompeg on multiple machines at once, encoding

4a31d1
-the same MPEG stream.  When you do, the machines are used as shown in
4a31d1
-the following diagram.  We call this "parallel mode."
4a31d1
-
4a31d1
-

ppmtompeg-par.gif

4a31d1
-
4a31d1
-

To do parallel processing, put the statement

4a31d1
-
4a31d1
-
4a31d1
-    PARALLEL
4a31d1
-
4a31d1
-
4a31d1
-in the parameter file, followed by a listing of the machines, one
4a31d1
-machine per line, then
4a31d1
-
4a31d1
-
4a31d1
-    END_PARALLEL
4a31d1
-
4a31d1
-
4a31d1
-Each of the machine lines must be in one of two forms.  If the machine
4a31d1
-has filesystem access to the input files, then the line is:
4a31d1
-
4a31d1
-

4a31d1
-machine user executable
4a31d1
-
4a31d1
-

The executable is normally ppmtompeg (you may need to give

4a31d1
-the complete path if you've built for different architectures).  If
4a31d1
-the machine does not have filesystem access to the input files, the line
4a31d1
-is:
4a31d1
-
4a31d1
-

REMOTE machine user executable

4a31d1
-parameter file
4a31d1
-
4a31d1
-

The -max_machines command option limits the number of

4a31d1
-machines ppmtompeg will use.  If you specify more machines in
4a31d1
-the parameter file than -max_machines allows, ppmtompeg
4a31d1
-uses only the machines listed first.  This is handy if you want to
4a31d1
-experiment with different amounts of parallelism.
4a31d1
-
4a31d1
-

In general, you should use full path file names when describing

4a31d1
-executables and parameter files.  This includes the parameter
4a31d1
-file argument on the original invocation of ppmtompeg.
4a31d1
-
4a31d1
-

All file names must be the same on all systems (so if e.g. you're

4a31d1
-using an NFS filesystem, you must make sure it is mounted at the same
4a31d1
-mountpoint on all systems).
4a31d1
-
4a31d1
-

Because not all of the processes involved in parallel operation

4a31d1
-have easy access to the input files, you must specify the SIZE
4a31d1
-parameter file statement when you do parallel operation.
4a31d1
-
4a31d1
-

The machine on which you originally invoke ppmtompeg is the

4a31d1
-master machine.  It hosts a "combine server,", a
4a31d1
-"decode server," and a number of "i/o servers,"
4a31d1
-all as separate processes.  The other machines in the network (listed
4a31d1
-in the parameter file) are slave machines.  Each hosts a single
4a31d1
-process that continuously requests work from the master and does it.
4a31d1
-The slave process does the computation to encode MPEG frames.  It
4a31d1
-processes frames in batches identified by the master.
4a31d1
-
4a31d1
-

The master uses a remote shell command to start a process on a

4a31d1
-slave machine.  By default, it uses an rsh shell command to do
4a31d1
-this.  But use the RSH parameter file statement to control
4a31d1
-this.  The shell command the master executes remotely is
4a31d1
-ppmtompeg, but with options to indicate that it is to perform
4a31d1
-slave functions.
4a31d1
-
4a31d1
-

The various machines talk to each other over TCP connections. Each

4a31d1
-machine finds and binds to a free TCP port number and tells its
4a31d1
-partners the port number.  These port numbers are at least 2048.
4a31d1
-
4a31d1
-

Use the PARALLEL_TEST_FRAMES, PARALLEL_TIME_CHUNKS, and

4a31d1
-PARALLEL_PERFECT parameter file statements to control the way the
4a31d1
-master divides up work among the slaves.
4a31d1
-
4a31d1
-

Use the -nice command option to cause all slave processes to run

4a31d1
-"nicely," i.e. as low priority processes.  That way, this substantial and
4a31d1
-long-running CPU load will have minimal impact on other, possibly
4a31d1
-interactive, users of the systems.
4a31d1
-
4a31d1
- 
4a31d1
-

SPEED

4a31d1
-
4a31d1
-

Here is a look at ppmtompeg speed, in single-node (not parallel)

4a31d1
-operation:
4a31d1
-
4a31d1
-
4a31d1
-  <caption>Compression Speed</caption>
4a31d1
-
4a31d1
-
4a31d1
-  
4a31d1
-    Machine Type
4a31d1
-    Macroblocks per second<sup>1</sup>
4a31d1
-    
4a31d1
-  
4a31d1
-    HP 9000/755
4a31d1
-    280
4a31d1
-    
4a31d1
-  
4a31d1
-    DEC 3000/400
4a31d1
-    247
4a31d1
-    
4a31d1
-  
4a31d1
-    HP 9000/750
4a31d1
-    191
4a31d1
-    
4a31d1
-  
4a31d1
-    Sparc 10
4a31d1
-    104
4a31d1
-    
4a31d1
-  
4a31d1
-    DEC 5000
4a31d1
-    68
4a31d1
-    
4a31d1
-
4a31d1
-<sup>1</sup>A macroblock is a 16x16 pixel square
4a31d1
-
4a31d1
-

The measurements in the table are with inputs and outputs via a

4a31d1
-conventional locally attached filesystem.  If you are using a network
4a31d1
-filesystem over a single 10 MB/s Ethernet, that constrains your speed more
4a31d1
-than your CPU speed.  In that case, don't expect to get better than 4
4a31d1
-or 5 frames per second no matter how fast your CPUs are.
4a31d1
-
4a31d1
-

Network speed is even more of a bottleneck when the slaves do not

4a31d1
-have filesystem access to the input files -- i.e. you declare them
4a31d1
-REMOTE.
4a31d1
-
4a31d1
-

Where I/O is the bottleneck, size of the input frames can make a big

4a31d1
-difference.  So YUV input is better than PPM, and JPEG is better than
4a31d1
-both.
4a31d1
-
4a31d1
-

When you're first trying to get parallel mode working, be sure to

4a31d1
-use the -debug_machines option so you can see what's going on.
4a31d1
-Also, -debug_sockets can help you diagnose communication
4a31d1
-problems.
4a31d1
-
4a31d1
-
4a31d1
-

AUTHORS

4a31d1
-
4a31d1
-
    4a31d1
    -
    4a31d1
    -
  • Kevin Gong - University of California, Berkeley,
  • 4a31d1
    -HREF="mailto:keving@cs.berkeley.edu">keving@cs.berkeley.edu
    4a31d1
    -
    4a31d1
    -
  • Ketan Patel - University of California, Berkeley,
  • 4a31d1
    -HREF="mailto:kpatel@cs.berkeley.edu">kpatel@cs.berkeley.edu
    4a31d1
    -
    4a31d1
    -
  • Dan Wallach - University of California, Berkeley,
  • 4a31d1
    -HREF="mailto:dwallach@cs.berkeley.edu">dwallach@cs.berkeley.edu
    4a31d1
    -
    4a31d1
    -
  • Darryl Brown - University of California, Berkeley,
  • 4a31d1
    -HREF="mailto:darryl@cs.berkeley.edu">darryl@cs.berkeley.edu
    4a31d1
    -
    4a31d1
    -
  • Eugene Hung - University of California, Berkeley,
  • 4a31d1
    -HREF="mailto:eyhung@cs.berkeley.edu">eyhung@cs.berkeley.edu
    4a31d1
    -
    4a31d1
    -
  • Steve Smoot - University of California, Berkeley,
  • 4a31d1
    -HREF="mailto:smoot@cs.berkeley.edu">smoot@cs.berkeley.edu
    4a31d1
    -
    4a31d1
    -
    4a31d1
    -
    4a31d1
    -
    4a31d1
    - 
    4a31d1
    -

    Table Of Contents

    4a31d1
    -
      4a31d1
      -
    • SYNOPSIS
    • 4a31d1
      -
    • DESCRIPTION
    • 4a31d1
      -
    • OPTIONS
    • 4a31d1
      -
    • PARAMETER FILE
    • 4a31d1
      -
    • GENERAL USAGE INFORMATION
    • 4a31d1
      -
    • PARALLEL OPERATION
    • 4a31d1
      -
    • SPEED
    • 4a31d1
      -
    • AUTHORS
    • 4a31d1
      -
      4a31d1
      -</BODY>
      4a31d1
      -</HTML>