From a512e578f3417573851e1acba7c46f08651c7a5c Mon Sep 17 00:00:00 2001 From: Josef Ridky Date: Mon, 4 Jun 2018 14:47:58 +0200 Subject: [PATCH] Resolves: #1585695 - backport unimplemented fixes from 10.79.00 --- netpbm-CAN-2005-2471.patch | 17 + netpbm-bmptopnm.patch | 11 + netpbm-cmuwtopbm.patch | 21 + netpbm-docfix.patch | 124 ++++ netpbm-fiasco-overflow.patch | 12 + netpbm-gcc4.patch | 22 + netpbm-glibc.patch | 13 + netpbm-manfix.patch | 184 +++++ netpbm-manual-pages.patch | 1343 ++++++++++++++++++++++++++++++++++ netpbm-multilib.patch | 11 + netpbm-pamtojpeg2k.patch | 11 + netpbm-ppmfadeusage.patch | 55 +- netpbm-time.patch | 21 + netpbm-xwdfix.patch | 11 + netpbm.spec | 18 +- 15 files changed, 1867 insertions(+), 7 deletions(-) create mode 100644 netpbm-CAN-2005-2471.patch create mode 100644 netpbm-bmptopnm.patch create mode 100644 netpbm-cmuwtopbm.patch create mode 100644 netpbm-docfix.patch create mode 100644 netpbm-fiasco-overflow.patch create mode 100644 netpbm-gcc4.patch create mode 100644 netpbm-glibc.patch create mode 100644 netpbm-manfix.patch create mode 100644 netpbm-manual-pages.patch create mode 100644 netpbm-multilib.patch create mode 100644 netpbm-pamtojpeg2k.patch create mode 100644 netpbm-time.patch create mode 100644 netpbm-xwdfix.patch diff --git a/netpbm-CAN-2005-2471.patch b/netpbm-CAN-2005-2471.patch new file mode 100644 index 0000000..ee9935f --- /dev/null +++ b/netpbm-CAN-2005-2471.patch @@ -0,0 +1,17 @@ +diff -up netpbm-10.56.03/converter/other/pstopnm.c.CAN-2005-2471 netpbm-10.56.03/converter/other/pstopnm.c +--- netpbm-10.56.03/converter/other/pstopnm.c.CAN-2005-2471 2011-11-09 09:18:00.000000000 +0100 ++++ netpbm-10.56.03/converter/other/pstopnm.c 2011-11-11 11:43:51.827409226 +0100 +@@ -747,11 +747,11 @@ execGhostscript(int const input + ghostscriptProg, arg0, + deviceopt, outfileopt, gopt, ropt, textalphabitsopt, + "-q", "-dNOPAUSE", +- "-dSAFER", "-"); ++ "-dPARANOIDSAFER", "-"); + } + + execl(ghostscriptProg, arg0, deviceopt, outfileopt, gopt, ropt, "-q", +- "-dNOPAUSE", "-dSAFER", "-", NULL); ++ "-dNOPAUSE", "-dPARANOIDSAFER", "-", NULL); + + pm_error("execl() of Ghostscript ('%s') failed, errno=%d (%s)", + ghostscriptProg, errno, strerror(errno)); diff --git a/netpbm-bmptopnm.patch b/netpbm-bmptopnm.patch new file mode 100644 index 0000000..9095427 --- /dev/null +++ b/netpbm-bmptopnm.patch @@ -0,0 +1,11 @@ +--- netpbm-10.35/converter/other/bmptopnm.c.bmptopnm 2007-01-29 13:08:46.000000000 +0100 ++++ netpbm-10.35/converter/other/bmptopnm.c 2007-01-29 13:32:21.000000000 +0100 +@@ -1262,7 +1262,7 @@ readBmp(FILE * const ifP, + xel ** const colormapP, + bool const verbose) { + +- xel * colormap; /* malloc'ed */ ++ xel * colormap = NULL; /* malloc'ed */ + unsigned int pos; + /* Current byte position in the BMP file */ + diff --git a/netpbm-cmuwtopbm.patch b/netpbm-cmuwtopbm.patch new file mode 100644 index 0000000..f5b328b --- /dev/null +++ b/netpbm-cmuwtopbm.patch @@ -0,0 +1,21 @@ +diff -up netpbm-10.61.01/converter/pbm/cmuwmtopbm.c.cmuwtopbmfix netpbm-10.61.01/converter/pbm/cmuwmtopbm.c +--- netpbm-10.61.01/converter/pbm/cmuwmtopbm.c.cmuwtopbmfix 2013-01-02 18:39:57.000000000 +0100 ++++ netpbm-10.61.01/converter/pbm/cmuwmtopbm.c 2013-01-03 05:41:36.024984241 +0100 +@@ -18,7 +18,7 @@ + This program does not check the pad bits at the end of each row. + */ + +- ++#include + #include "pbm.h" + + /*-------------------------- +@@ -42,7 +42,7 @@ readCmuwmHeader(FILE * const ifP + "CMU window manager header EOF / read error"; + uint32_t const cmuwmMagic = 0xf10040bb; + +- long l; ++ uint32_t l; + short s; + int rc; + diff --git a/netpbm-docfix.patch b/netpbm-docfix.patch new file mode 100644 index 0000000..33b3b77 --- /dev/null +++ b/netpbm-docfix.patch @@ -0,0 +1,124 @@ +diff -urNp old/userguide/cameratopam.html new/userguide/cameratopam.html +--- old/userguide/cameratopam.html 2017-09-05 09:05:16.000000000 +0200 ++++ new/userguide/cameratopam.html 2017-09-05 13:16:33.622352535 +0200 +@@ -25,10 +25,10 @@ cameratopam - convert raw camera image t + [-balance_camera] + [-red_scale=float] + [-blue_scale=float] +-[-brightness=fraction] ++[-bright=fraction] + [-no_clip_color] + [-rgb] +-[-secondary] ++[-use_secondary] + [-linear] + [-verbose] + +@@ -106,7 +106,7 @@ the default. +
Further adjust the color balance by multiplying the red and blue + channels by these values. Both default to 1.0. + +-
-brightness=float ++
-bright=float + +
Change the output brightness. Default is 1.0. + +@@ -114,14 +114,14 @@ channels by these values. Both default + +
By default, cameratoapm clips all colors to prevent pink + hues in the highlights. Combine this option with +--brightness=0.25 to leave the image data completely unclipped. ++-bright=0.25 to leave the image data completely unclipped. + +
-rgb + +
Write raw camera colors to the output file. By default, + cameratoapm converts to sRGB colorspace. + +-
-secondary ++
-use_secondary + +
For cameras based on the Fuji Super CCD SR, this option causes + cameratopam to use the secondary sensors, in effect +diff -urNp old/userguide/fiascotopnm.html new/userguide/fiascotopnm.html +--- old/userguide/fiascotopnm.html 2017-09-05 09:05:16.000000000 +0200 ++++ new/userguide/fiascotopnm.html 2017-09-05 13:32:51.810458154 +0200 +@@ -51,7 +51,7 @@ the output file(s) are written to the fi + this list. Otherwise, the current directory is used to store the + output file(s). + +-
-z, --fast ++
-r, --fast +
+ Decompress images in the 4:2:0 format; i.e., each chroma channel is + decompressed to an image of halved width and height. Use this option +@@ -83,7 +83,7 @@ given amount N. N is 1 (mi + is 70. When N=0, then the smoothing amount specified in the + FIASCO file is used (defined by the FIASCO coder). + +-
-F N, --fps=N ++
-F N, --framerate=N +
+ Set number of frames per second to N. When using this option, + the frame rate specified in the FIASCO file is overridden. +@@ -113,13 +113,8 @@ following methods (in the specified orde +
  • --config=name + + +-
    -h, --info +-
    +-Print brief help, then exit. +- +-
    -H, --help +-
    +-Print detailed help, then exit. ++
    -h, --help ++Print help, then exit. + + + +diff -urNp old/userguide/pamperspective.html new/userguide/pamperspective.html +--- old/userguide/pamperspective.html 2017-09-05 09:05:16.000000000 +0200 ++++ new/userguide/pamperspective.html 2017-09-05 13:23:15.869997105 +0200 +@@ -220,7 +220,7 @@ default rectangle as the "frame." The vi + a rectangle the axes of which are parallel to those of the frame. + +

    The frame options are additive. All the parts of the image +-specified by either margin options, --include_frame, or ++specified by either margin options, --frame_include, or + --include (or their defaults) are in the visible part. The + visible part is the smallest possible rectangle that contains the + parts specified those three ways. +diff -urNp old/converter/pbm/pbmtoepson.c new/converter/pbm/pbmtoepson.c +--- old/converter/pbm/pbmtoepson.c 2018-01-04 14:26:14.740024843 +0100 ++++ new/converter/pbm/pbmtoepson.c 2018-01-04 14:28:47.970518766 +0100 +@@ -75,7 +75,7 @@ parseCommandLine(int ar + &dpiSpec, 0); + OPTENT3(0, "adjacent", OPT_FLAG, NULL, + &adjacentSpec, 0); +- OPTENT3(0, "nonadjacent", OPT_FLAG, NULL, ++ OPTENT3(0, "noadjacent", OPT_FLAG, NULL, + &nonadjacentSpec, 0); + + opt.opt_table = option_def; +diff -urNp old/userguide/pbmtoepson.html new/userguide/pbmtoepson.html +--- old/userguide/pbmtoepson.html 2018-01-04 14:26:14.586024719 +0100 ++++ new/userguide/pbmtoepson.html 2018-01-04 14:27:56.466847698 +0100 +@@ -18,7 +18,7 @@ pbmtoepson - convert a PBM image into Ep + [-dpi=n] + [-protocol={escp9|escp}] + [-adjacent] +-[-nonadjacent] ++[-noadjacent] + + [pbmfile] + +@@ -74,7 +74,7 @@ print density for you consistent with yo +

    This option was new in Netpbm 10.23 (July 2004). + +

    -adjacent +-
    -nonadjacent ++
    -noadjacent + +
    These options determine whether the output uses "adjacent dot + printing" or not, whatever that is. diff --git a/netpbm-fiasco-overflow.patch b/netpbm-fiasco-overflow.patch new file mode 100644 index 0000000..850dbc3 --- /dev/null +++ b/netpbm-fiasco-overflow.patch @@ -0,0 +1,12 @@ +diff -up netpbm-10.47.09/converter/other/fiasco/lib/image.h.fiasco-overflow netpbm-10.47.09/converter/other/fiasco/lib/image.h +--- netpbm-10.47.09/converter/other/fiasco/lib/image.h.fiasco-overflow 2010-01-25 09:00:48.000000000 +0100 ++++ netpbm-10.47.09/converter/other/fiasco/lib/image.h 2010-01-27 10:29:48.000000000 +0100 +@@ -29,7 +29,7 @@ typedef struct image + * Image data + */ + { +- char id [7]; ++ char id [8]; + unsigned reference_count; + unsigned width; /* Width of the image */ + unsigned height; /* Height of the image */ diff --git a/netpbm-gcc4.patch b/netpbm-gcc4.patch new file mode 100644 index 0000000..3f51826 --- /dev/null +++ b/netpbm-gcc4.patch @@ -0,0 +1,22 @@ +diff -up netpbm-10.58.01/lib/pm.h.gcc4 netpbm-10.58.01/lib/pm.h +--- netpbm-10.58.01/lib/pm.h.gcc4 2012-04-09 19:08:08.885137097 +0200 ++++ netpbm-10.58.01/lib/pm.h 2012-04-09 19:08:08.894136984 +0200 +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + #include + #include + #include +diff -up netpbm-10.58.01/urt/rle.h.gcc4 netpbm-10.58.01/urt/rle.h +--- netpbm-10.58.01/urt/rle.h.gcc4 2012-04-09 19:08:08.000000000 +0200 ++++ netpbm-10.58.01/urt/rle.h 2012-04-09 19:08:39.137758887 +0200 +@@ -34,6 +34,7 @@ + #define RLE_H + + #include /* Declare FILE. */ ++#include + + enum rle_dispatch { + NO_DISPATCH = -1, diff --git a/netpbm-glibc.patch b/netpbm-glibc.patch new file mode 100644 index 0000000..4ae71e8 --- /dev/null +++ b/netpbm-glibc.patch @@ -0,0 +1,13 @@ +--- netpbm-10.35/converter/other/pnmtotiffcmyk.c.glibc 2006-09-18 12:20:06.000000000 +0200 ++++ netpbm-10.35/converter/other/pnmtotiffcmyk.c 2007-08-23 09:18:30.000000000 +0200 +@@ -974,8 +974,8 @@ int main( int argc, char **argv ) { + + if ( (err = parseOpts( argc, argv, rt )) ) goto exit ; + +- if ( (err = rt->in->open( rt->in, rt )) ) goto exit ; +- if ( (err = rt->out->open( rt->out, rt )) ) goto exit ; ++ if ( (err = (rt->in->open)( rt->in, rt )) ) goto exit ; ++ if ( (err = (rt->out->open)( rt->out, rt )) ) goto exit ; + + while ( rt->in->hasMore( rt->in ) ) { + if ( (err = rt->in->next( rt->in, &r, &g, &b )) ) goto exit ; diff --git a/netpbm-manfix.patch b/netpbm-manfix.patch new file mode 100644 index 0000000..54df85f --- /dev/null +++ b/netpbm-manfix.patch @@ -0,0 +1,184 @@ +diff -urNp old/userguide/avstopam.html new/userguide/avstopam.html +--- old/userguide/avstopam.html 2017-09-05 13:58:08.338559550 +0200 ++++ new/userguide/avstopam.html 2017-09-05 14:00:27.371039472 +0200 +@@ -1,8 +1,7 @@ + +- ++ + + Avstopam User Manual +- + + + +diff -urNp old/userguide/escp2topbm.html new/userguide/escp2topbm.html +--- old/userguide/escp2topbm.html 2017-09-05 13:58:08.335559561 +0200 ++++ new/userguide/escp2topbm.html 2017-09-05 14:01:20.226842694 +0200 +@@ -6,6 +6,7 @@ Updated: 14 July 2015 +
    + Table Of Contents + ++

    NAME

    + escp2topbm - convert an ESC/P2 printer file to a PBM image + +

    SYNOPSIS

    +diff -urNp old/userguide/faxformat.html new/userguide/faxformat.html +--- old/userguide/faxformat.html 2017-09-05 13:58:08.337559553 +0200 ++++ new/userguide/faxformat.html 2017-09-05 14:02:33.322571279 +0200 +@@ -5,10 +5,11 @@ + Updated: 03 December 2008 +
    + ++

    SYNOPSIS

    +

    This page, part of the Netpbm user's guide, + describes FAX formats in relation to Netpbm facilities. + +- ++

    DESCRIPTION

    +

    The ITU (formerly CCITT) publishes standards for operation of fax machines + (the idea is to provide a way to be sure that a fax machine is able to receive + a fax sent by another). These standards incidentally specify graphics file +diff -urNp old/userguide/pampaintspill.html new/userguide/pampaintspill.html +--- old/userguide/pampaintspill.html 2017-09-05 13:58:08.338559550 +0200 ++++ new/userguide/pampaintspill.html 2017-09-05 14:03:32.625351620 +0200 +@@ -1,8 +1,7 @@ + +- ++ + + Pampaintspill User Manual +- + + + +@@ -11,6 +10,7 @@ + +

    Table Of Contents

    + ++

    NAME

    +

    pampaintspill - smoothly spill colors into the background

    + +

    SYNOPSIS

    +diff -urNp old/userguide/pamrecolor.html new/userguide/pamrecolor.html +--- old/userguide/pamrecolor.html 2017-09-05 13:58:08.336559557 +0200 ++++ new/userguide/pamrecolor.html 2017-09-05 14:04:34.714122098 +0200 +@@ -1,8 +1,7 @@ +- ++ + + + Pamrecolor User Manual +- + + + +@@ -11,7 +10,7 @@ + +

    Updated: 31 July 2010

    + +-

    Table Of Contents

    ++

    Table Of Contents

    + + +

    NAME

    +diff -urNp old/userguide/pamsistoaglyph.html new/userguide/pamsistoaglyph.html +--- old/userguide/pamsistoaglyph.html 2017-09-05 13:58:08.334559565 +0200 ++++ new/userguide/pamsistoaglyph.html 2017-09-05 14:05:25.865944327 +0200 +@@ -1,8 +1,7 @@ + +- ++ + + Pamsistoaglyph User Manual +- + + + +diff -urNp old/userguide/pamstereogram.html new/userguide/pamstereogram.html +--- old/userguide/pamstereogram.html 2017-09-05 13:58:08.337559553 +0200 ++++ new/userguide/pamstereogram.html 2017-09-05 14:13:28.523959069 +0200 +@@ -1,5 +1,5 @@ +- +- ++ ++ + + Pamstereogram User Manual + +@@ -10,7 +10,7 @@ + +

    Updated: 19 June 2015

    + +-

    Table Of Contents

    ++

    Table Of Contents

    + + +

    NAME

    +diff -urNp old/userguide/pamtoavs.html new/userguide/pamtoavs.html +--- old/userguide/pamtoavs.html 2017-09-05 13:58:08.329559583 +0200 ++++ new/userguide/pamtoavs.html 2017-09-05 14:05:49.299863901 +0200 +@@ -1,5 +1,5 @@ + +- ++ + + Pamtoavs User Manual + +diff -urNp old/userguide/pamtooctaveimg.html new/userguide/pamtooctaveimg.html +--- old/userguide/pamtooctaveimg.html 2017-09-05 13:58:08.335559561 +0200 ++++ new/userguide/pamtooctaveimg.html 2017-09-05 14:06:21.825752356 +0200 +@@ -1,8 +1,7 @@ + +- ++ + + Pamtooctaveimg User Manual +- + + + +diff -urNp old/userguide/pnmflip.html new/userguide/pnmflip.html +--- old/userguide/pnmflip.html 2017-09-05 13:58:08.336559557 +0200 ++++ new/userguide/pnmflip.html 2017-09-05 14:07:15.065963977 +0200 +@@ -4,9 +4,11 @@ + +

    pnmflip

    +
    ++

    NAME

    +

    pnmflip was replaced in Netpbm 10.13 (December 2002) by + pamflip. + ++

    DESCRIPTION

    +

    pamflip is mostly backward compatible with pnmflip, + but works on PAM images too. + +diff -urNp old/userguide/pnmmercator.html new/userguide/pnmmercator.html +--- old/userguide/pnmmercator.html 2017-09-05 13:58:08.334559565 +0200 ++++ new/userguide/pnmmercator.html 2017-09-05 14:08:08.305214742 +0200 +@@ -1,7 +1,6 @@ +- ++ + + +- + PnmMercator User Manual + + +diff -urNp old/userguide/ppmtogif.html new/userguide/ppmtogif.html +--- old/userguide/ppmtogif.html 2017-09-05 13:58:08.337559553 +0200 ++++ new/userguide/ppmtogif.html 2017-09-05 14:09:51.450583126 +0200 +@@ -4,11 +4,14 @@ + +

    ppmtogif

    +
    ++

    NAME

    +

    ppmtogif was replaced in Netpbm 10.37 (December 2006) by + pamtogif. + ++

    SYNOPSIS

    +

    pamtogif is mostly backward compatible with ppmtogif. + ++

    DESCRIPTION

    +

    One way pamtogif is not backward compatible with ppmtogif + is that to specify a transparency (alpha) mask with ppmtogif, you + supply the transparency as a separate pseudo-PGM image and use the diff --git a/netpbm-manual-pages.patch b/netpbm-manual-pages.patch new file mode 100644 index 0000000..b5fbbea --- /dev/null +++ b/netpbm-manual-pages.patch @@ -0,0 +1,1343 @@ +diff -urNp old/userguide/libnetpbm_ug.html new/userguide/libnetpbm_ug.html +--- old/userguide/libnetpbm_ug.html 2017-09-05 14:20:09.734743404 +0200 ++++ new/userguide/libnetpbm_ug.html 2017-09-05 14:47:30.496705483 +0200 +@@ -374,7 +374,7 @@ plain format. +

    Reference

    + +

    The Libnetpbm Netpbm Image +-Processing Manual describes the the libnetpbm functions for ++Processing Manual describes the libnetpbm functions for + processing image data. + +

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

    Arithmetic functions

    +diff -urNp old/userguide/pbmtextps.html new/userguide/pbmtextps.html +--- old/userguide/pbmtextps.html 2017-09-05 14:20:09.736743401 +0200 ++++ new/userguide/pbmtextps.html 2017-09-05 14:47:58.840553598 +0200 +@@ -185,7 +185,7 @@ edge of the type. See Margins for details. + +

    Sizes are in points, as a floating point number. +diff -urNp old/userguide/pbmtog3.html new/userguide/pbmtog3.html +--- old/userguide/pbmtog3.html 2017-09-05 14:20:09.735743403 +0200 ++++ new/userguide/pbmtog3.html 2017-09-05 14:48:55.648255793 +0200 +@@ -77,7 +77,7 @@ You cannot specify both. +

    HISTORY

    + +

    Before Netpbm 10.79 (June 2017), there was a different program by the same +-name in Netpbm, which was written by by Paul Haeberli ++name in Netpbm, which was written by Paul Haeberli + <paul@manray.sgi.com> in 1989 + and then modified extensively by others. + +diff -urNp old/userguide/ppmtompeg.html new/userguide/ppmtompeg.html +--- old/userguide/ppmtompeg.html 2017-09-05 14:20:09.739743396 +0200 ++++ new/userguide/ppmtompeg.html 1970-01-01 01:00:00.000000000 +0100 +@@ -1,1291 +0,0 @@ +- +- +- +-Ppmtompeg User Manual +- +- +-

    Ppmtompeg

    +-Updated: 23 July 2006 +-
    +-Table Of Contents +- +-

    NAME

    +-ppmtompeg - encode an MPEG-1 bitstream +- +-

    SYNOPSIS

    +- +-ppmtompeg +-[options] +-parameter-file +- +-

    DESCRIPTION

    +- +-

    This program is part of Netpbm. +- +-

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

    There's technically a difference between a compression method for +-video and an actual file (stream) format for a movie, and I don't know +-if it can be validly said that the format of the stream +-ppmtompeg produces is MPEG-1. +- +-

    Mencoder from the Mplayer +-package is probably superior for most video format generation +-needs, if for no other reason than that it is more popular. +- +-

    The programming library PM2V +-generates MPEG-2 streams. +- +-

    Use Mplayer (not part of Netpbm) +-to do the reverse conversion: to create a series of PNM files from an MPEG +-stream. +- +-

    param_file is a parameter file which includes a list of +-input files and other parameters. The file is described in detail +-below. +- +-

    To understand this program, you need to understand something about +-the complex MPEG-1 format. One source of information about this +-standard format is the section Introduction to MPEG in the Compression FAQ. +- +-

    OPTIONS

    +- +-

    The -gop, -combine_gops, -frames, and +--combine_frames options are all mutually exclusive. +- +-

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

    These statistics include how many I, P, and B frames there were, +-and information about compression and quality. +- +- +-

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

    Thus, unless you're mixing and matching GOP files from different +-sources, you can simply use the same parameter file for creating the +-GOP files (-gop) and for later turning them into an MPEG stream +-(-combine_gops). +- +- +-

    -frames first_frame last_frame +- +-
    This option causes ppmtompeg to encode only the frames numbered +-first_frame to last_frame, inclusive. The parameter +-file is the same as for normal usage. The output will be placed in +-separate files, one per frame, with the file names being the normal +-output file name with the suffix .frame.frame_num. No +-GOP header information is output. (Thus, the parameter file need not +-include the GOP_SIZE value) +- +-

    Use ppmtompeg -combine_frames to combine these frames later into +-an MPEG stream. +- +- +-

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

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

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

    The output is in the form of a matrix, each entry corresponding to one +-motion vector in the search window. The center of the matrix +-represents (0,0) motion vectors. +- +-

    -debug_sockets +- +-
    This option causes ppmtompeg to print to Standard Output +-messages that narrate the communication between the machines when you run +-ppmtompeg in parallel mode. +- +-
    -debug_machines +- +-
    This option causes ppmtompeg to print to Standard Output +-messages that narrate the progress of the conversion on the various +-machines when you run ppmtompeg in parallel +-mode. +- +-
    +- +-

    PARAMETER FILE

    +- +-

    The parameter file must contain the following +-lines (except when using the -combine_gops or -combine_frames +-options): +- +-

    +- +-
    PATTERN pattern +- +-
    This statement specifies the pattern (sequence) of I frames, P frames, +-and B frames. pattern is just a sequence of the letters I, P, and +-B with nothing between. Example: +- +-
    +-    PATTERN IBBPBBPBBPBBPBB
    +-
    +- +-

    See I Frames, P Frames, B Frames. +- +-

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

    To have ppmtompeg read all the frames serially from Standard +-Input, specify +-

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

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

    Uniform zero-padding occurs, as well. For example, the line +-football.*.ppm [001-130] refers to the files football.001.ppm, +-football.002.ppm, ..., football.009.ppm, football.010.ppm, ..., +-football.130.ppm. +- +-

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

    Furthermore, a line may specify a shell command to execute to +-generate lines to be interpreted as described above, as if those lines +-were in the parameter file instead. Use back ticks, like in the +-Bourne Shell, like this: +- +-

    +-    `cat myfilelist`
    +-
    +- +-

    +-If input is from Standard Input (per the INPUT_DIR statement), +-ppmtompeg ignores the INPUT/END_INPUT block, but +-it still must be present. +- +-

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

    Otherwise, conversion_command is a shell command that causes +-an image in the format your specified with BASE_FILE_FORMAT to +-be written to Standard Output. ppmtompeg executes the command +-once for each line between INPUT and END_INPUT (which is +-normally, but not necessarily, a file name). In the conversion +-command, ppmtompeg replaces each '*' with the contents of that +-line. +- +- If you had a bunch of gif files, you might say: +-

    +-     INPUT_CONVERT giftopnm *
    +-     
    +- +- If you have a bunch of separate a.Y, a.U, and a.V files (where +- the U and V have already been subsampled), then you might say: +- +-
    +-     INPUT_CONVERT cat *.Y *.U *.V
    +-     
    +- +-

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

    +-     INPUT_CONVERT *
    +-     
    +- +-as described above. +- +-
    SIZE widthxheight +- +-
    +- +-

    width and height are the width and height of each +-frame in pixels. +- +-

    When ppmtompeg can get this information from the input image +-files, it ignores the SIZE parameter and you may omit it. +- +-

    When the image files are in YUV format, the files don't contain +-dimension information, so SIZE is required. +- +-

    When ppmtompeg is running in parallel mode, not all of the +-processes in the network have access to the image files, so +-SIZE is required and must give the same dimensions as the +-input image files. +- +-

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

    Normally, it makes sense to make your GOP size a multiple of your +-pattern length (the latter is determined by the PATTERN parameter file +-statement). +- +-

    See Group Of Pictures. +- +-

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

    The following lines are optional: +- +-

    +- +-
    FORCE_ENCODE_LAST_FRAME +- +-
    This statement is obsolete. It does nothing. +- +-

    Before Netpbm 10.26 (January 2005), ppmtompeg would drop +-trailing B frames from your movie, since a movie can't end with a B +-frame. (See I Frames, P Frames, B Frames. +-You would have to specify FORCE_ENCODE_LAST_FRAME to stop +-that from happening and get the same function that ppmtompeg +-has today. +- +- +-

    NIQTABLE +- +-
    This statement specifies a custom non-intra quantization table. +-If you don't specify this statement, ppmtompeg uses a default +-non-intra quantization table. +- +-

    +-The 8 lines immediately following NIQTABLE specify the quantization +-table. Each line defines a table row and consists of 8 integers, +-whitespace-delimited, which define the table columns. +- +-

    IQTABLE +- +-
    This is analogous to NIQTABLE, but for the intra quantization table. +- +-
    ASPECT_RATIO ratio +- +-
    This statement specifies the aspect ratio for ppmtompeg to +-specify in the MPEG output. I'm not sure what this is used for. +- +-

    ratio must be 1.0, 0.6735, 0.7031, 0.7615, 0.8055, 0.8437, +-0.8935, 0.9157, 0.9815, 1.0255, 1.0695, 1.0950, 1.1575, or 1.2015. +- +-

    FRAME_RATE rate +-
    This specifies the frame rate for ppmtompeg to specify in the +-MPEG output. Some players use this value to determine the playback rate. +- +-

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

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

    rate must be an integer. +- +-

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

    A Video Verifying Buffer is a buffer in which a decoder keeps the +-decoded bits in order to match the uneven speed of the decoding with +-the required constant playback speed. +- +-

    As ppmtompeg encodes the image, it simulates the decoding +-process in terms of how many bits would be in the VBV as each frame gets +-decoded, assuming a VBV of the size you indicate. +- +-

    If you specify the WARN_VBV_UNDERFLOW statement, +-ppmtompeg issues a warning each time the simulation underflows +-the buffer, which suggests that an underflow would occur on playback, +-which suggests the buffer is too small. +- +-

    If you specify the WARN_VBV_OVERFLOW statement, +-ppmtompeg issues a warning each time the simulation overflows +-the buffer, which suggests that an overflow would occur on playback, +-which suggests the buffer is too small. +- +-

    WARN_VBV_UNDERFLOW +-
    WARN_VBV_OVERFLOW +- +-
    See BUFFER_SIZE. +- +-

    These options were new in Netpbm 10.26 (January 2005). Before that, +-ppmtompeg issued the warnings always. +- +-

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

    If you specify FORCE_I_ALIGN, ppmtompeg will increase +-the test frames value enough to maintain the alignment. +- +-

    If there aren't enough frames for every slave to have the indicated +-number of test frames, ppmtompeg will give some slaves fewer. +- +- +-

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

    Smaller values of t increase communication, but improve load +-balancing. The default is 30 seconds. +- +-

    You may specify only one of PARALLEL_TIME_CHUNKS, PARALLEL_CHUNK_TAPER, +-and PARALLEL_PERFECT. PARALLEL_CHUNK_TAPER is usually best. +- +-

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

    You may specify only one of PARALLEL_TIME_CHUNKS, PARALLEL_CHUNK_TAPER, +-and PARALLEL_PERFECT. PARALLEL_CHUNK_TAPER is usually best. +- +- +-

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

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

    You may specify only one of PARALLEL_TIME_CHUNKS, PARALLEL_CHUNK_TAPER, +-and PARALLEL_PERFECT. PARALLEL_CHUNK_TAPER is usually best. +- +-

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

    Be sure to set up .rhosts files or SSH key authorizations +-where needed. Otherwise, you'll have to type in passwords. +- +-

    On some HP machines, rsh is the restricted shell, and you want +-to specify remsh. +- +-

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

    This document used to say there was an argument to +-FORCE_I_ALIGN which was the number of frames ppmtompeg +-would use (and was required to be a multiple of the pattern length). +-But ppmtompeg has apparently always ignored that argument, and +-it does now. +- +-

    KEEP_TEMP_FILES +- +-
    This statement causes ppmtompeg not to delete the temporary +-files it uses to transmit encoded frames to the combine server. This +-means you will be left with a file for each frame, the same as you +-would get with the -frames option. +- +-

    This is mostly useful for debugging. +- +-

    This works only if you're using a shared filesystem to communicate +-between the servers. +- +-

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

    +- +- +-

    Parameter File Notes

    +- +-

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

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

    Any number of spaces and tabs may come between each option and value. Lines +-beginning with # are ignored. Any other lines are ignored except for +-those between INPUT and END_INPUT. This allows you to use the same +-parameter file for normal usage and for -combine_gops and +--combine_frames. +- +-

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

    The statements may appear in any order, except that the order within +-a block statement (such as INPUT ... END INPUT) is significant. +- +-

    ppmtompeg is prepared to handle up to 16 B frames between +-reference frames when encoding with input from stdin. (To build a +-modified ppmtompeg with a higher limit, change the constant +-B_FRAME_RUN in frame.c and recompile). +- +-

    GENERAL USAGE INFORMATION

    +- +-

    Qscale

    +- +-

    The quantization scale values (qscale) give a trade-off between +-quality and compression. Using different Qscale values has very little +-effect on speed. The qscale values can be set separately for I, P, and +-B frames. +- +-

    You select the qscale values with the IQSCALE, +-PQSCALE, and BSCALE parameter file statements. +- +-

    A qscale value is an integer from 1 to 31. Larger numbers give +-better compression, but worse quality. In the following, the quality +-numbers are peak signal-to-noise ratio, defined as: +-signal-to-noise formula +-where MSE is the mean squared error. +- +- +-

    Flower garden tests: +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-
    Qscale vs Quality
    QscaleI FramesP FramesB Frames
    143.246.346.5
    632.634.634.3
    1128.629.530.0
    1626.326.828.6
    2124.725.027.9
    2623.523.927.5
    3122.623.027.3
    +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-
    Qscale vs Compression
    QscaleI FramesP FramesB Frames
    1222
    671015
    11111843
    16152997
    211941173
    262456256
    312873330
    +- +- +-

    Search Techniques

    +- +-

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

    There are 4 types of P frame search: Exhaustive, TwoLevel, +-SubSample, and Logarithmic. +- +-

    There are 3 types of B frame search: Exhaustive, Cross2, and +-Simple. +- +-The recommended search techniques are TwoLevel and Logarithmic for +-P frame search, and Cross2 and Simple for B frame search. Here are +-some numbers comparing the different search methods: +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-
    P frame Motion Vector Search (Normalized)
    TechniqueCompression1Speed 2Quality 3
    Exhaustive100010001000
    SubSample100824561000
    TwoLevel100932371000
    Logarithmic10858229998
    +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-
    B frame Motion Vector Search (Normalized)
    TechniqueCompression1Speed2Quality3
    Exhaustive100010001000
    Cross29751000996
    Simple9381765991
    +- +- 1Smaller numbers are better +-compression. +- +- 2Larger numbers mean faster +-execution. +- +- 3Larger numbers mean better quality. +- +-

    For some reason, Simple seems to give better compression, but it +-depends on the image sequence. +- +-

    Select the search techniques with the PSEARCH_ALG and +-BSEARCH_ALG parameter file statements. +- +- +- +-

    Group Of Pictures (GOP)

    +- +-

    A Group of Pictures (GOP) is a roughly independently decodable +-sequence of frames. An MPEG video stream is made of one or more +-GOP's. You may specify how many frames should be in each GOP with the +-GOP_SIZE parameter file statement. A GOP always starts with an +-I frame. +- +-

    Instead of encoding an entire sequence, you can encode a single +-GOP. To do this, use the -gop command option. You can later +-join the resulting GOP files at any time by running ppmtompeg +-with the -combine_gops command option. +- +- +-

    Slices

    +- +-

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

    Control the slice size with the SLICES_PER_FRAME parameter +-file statement. +- +-

    Some MPEG playback systems require that each slice consist of whole +-rows of macroblocks. If you are encoding for this kind of player, if +-the height of the image is H pixels, then you should set the +-SLICES_PER_FRAME to some number which divides H/16. For example, if +-the image is 240 pixels (15 macroblocks) high, then you should use +-only 15, 5, 3, or 1 slices per frame. +- +-

    Note: these MPEG playback systems are really wrong, since the MPEG +-standard says this doesn't have to be so. +- +- +- +-

    Search Window

    +- +-

    The search window is the window in which ppmtompeg searches +-for motion vectors. The window is a square. You can specify the size +-of the square, and whether to allow half-pixel motion vectors or not, +-with the RANGE and PIXEL parameter file statements. +- +-

    I Frames, P Frames, B Frames

    +- +-

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

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

    Note that the first frame of a movie must be described by an I +-frame (because there is no previous movie frame) and the last movie +-frame must be described by an I or P frame (because there is no +-subsequent movie frame). +- +-

    Beyond that, you can choose which frames are represented by which +-types. You specify a pattern, such as IBPBP and ppmtompeg +-simply repeats it over and over throughout the movie. The pattern +-affects speed, quality, and stream size. Here is a chart which shows +-some of the trade-offs: +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-
    Comparison of I/P/B Frames (Normalized)
    Frame TypeSizeSpeedQuality
    I frames100010001000
    P frames409609969
    B frames72260919
    +- +-(this is with constant qscale) +- +-

    A standard sequence is IBBPBBPBBPBBPBB. +- +-

    Select the sequence with the PATTERN parameter file statement. +- +-

    Since the last MPEG frame cannot be a B frame (see above), if the +-pattern you specify indicates a B frame for the last movie frame of +-the movie, ppmtompeg makes it an I frame instead. +- +-

    Before Netpbm 10.26 (January 2005), ppmtompeg instead drops +-the trailing B frames by default, and you need the +-FORCE_ENCODE_LAST_FRAME parameter file statement to make it do +-this. +- +-

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

    Specifying Input and Output Files

    +- +-

    Specify the input frame images with the INPUT_DIR, +-INPUT, END_INPUT, BASE_FILE_FORMAT, +-SIZE, YUV_FORMAT and INPUT_CONVERT parameter +-file statements. +- +-

    Specify the output file with the OUTPUT parameter file statement. +- +- +-

    Statistics

    +- +-

    ppmtompeg can generate a variety of statistics about the +-encoding. See the -stat, -snr, -mv_histogram, +--quiet, -no_frame_summary, and -bit_rate_info +-options. +- +- +-

    PARALLEL OPERATION

    +- +-

    You can run ppmtompeg on multiple machines at once, encoding +-the same MPEG stream. When you do, the machines are used as shown in +-the following diagram. We call this "parallel mode." +- +-

    ppmtompeg-par.gif +- +-

    To do parallel processing, put the statement +- +-

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

    +-machine user executable +- +-

    The executable is normally ppmtompeg (you may need to give +-the complete path if you've built for different architectures). If +-the machine does not have filesystem access to the input files, the line +-is: +- +-

    REMOTE machine user executable +-parameter file +- +-

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

    In general, you should use full path file names when describing +-executables and parameter files. This includes the parameter +-file argument on the original invocation of ppmtompeg. +- +-

    All file names must be the same on all systems (so if e.g. you're +-using an NFS filesystem, you must make sure it is mounted at the same +-mountpoint on all systems). +- +-

    Because not all of the processes involved in parallel operation +-have easy access to the input files, you must specify the SIZE +-parameter file statement when you do parallel operation. +- +-

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

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

    The various machines talk to each other over TCP connections. Each +-machine finds and binds to a free TCP port number and tells its +-partners the port number. These port numbers are at least 2048. +- +-

    Use the PARALLEL_TEST_FRAMES, PARALLEL_TIME_CHUNKS, and +-PARALLEL_PERFECT parameter file statements to control the way the +-master divides up work among the slaves. +- +-

    Use the -nice command option to cause all slave processes to run +-"nicely," i.e. as low priority processes. That way, this substantial and +-long-running CPU load will have minimal impact on other, possibly +-interactive, users of the systems. +- +-  +-

    SPEED

    +- +-

    Here is a look at ppmtompeg speed, in single-node (not parallel) +-operation: +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +-
    Compression Speed
    Machine TypeMacroblocks per second1
    HP 9000/755280
    DEC 3000/400247
    HP 9000/750191
    Sparc 10104
    DEC 500068
    +-1A macroblock is a 16x16 pixel square +- +-

    The measurements in the table are with inputs and outputs via a +-conventional locally attached filesystem. If you are using a network +-filesystem over a single 10 MB/s Ethernet, that constrains your speed more +-than your CPU speed. In that case, don't expect to get better than 4 +-or 5 frames per second no matter how fast your CPUs are. +- +-

    Network speed is even more of a bottleneck when the slaves do not +-have filesystem access to the input files -- i.e. you declare them +-REMOTE. +- +-

    Where I/O is the bottleneck, size of the input frames can make a big +-difference. So YUV input is better than PPM, and JPEG is better than +-both. +- +-

    When you're first trying to get parallel mode working, be sure to +-use the -debug_machines option so you can see what's going on. +-Also, -debug_sockets can help you diagnose communication +-problems. +- +- +-

    AUTHORS

    +- +- +- +-
    +-  +-

    Table Of Contents

    +- +- +- diff --git a/netpbm-multilib.patch b/netpbm-multilib.patch new file mode 100644 index 0000000..ea689bc --- /dev/null +++ b/netpbm-multilib.patch @@ -0,0 +1,11 @@ +diff -up netpbm-10.47.04/buildtools/endiangen.c.multilib netpbm-10.47.04/buildtools/endiangen.c +--- netpbm-10.47.04/buildtools/endiangen.c.multilib 2009-10-21 13:38:54.000000000 +0200 ++++ netpbm-10.47.04/buildtools/endiangen.c 2009-10-21 14:35:58.000000000 +0200 +@@ -87,7 +87,6 @@ main(int argc, char **argv) { + byteOrder() == ENDIAN_LITTLE ? "LITTLE_ENDIAN" : "BIG_ENDIAN"); + printf("#endif\n"); + printf("\n"); +- printf("#define BITS_PER_LONG %u\n", bitsPerLong()); + + return 0; + } diff --git a/netpbm-pamtojpeg2k.patch b/netpbm-pamtojpeg2k.patch new file mode 100644 index 0000000..9615ce7 --- /dev/null +++ b/netpbm-pamtojpeg2k.patch @@ -0,0 +1,11 @@ +diff -up netpbm-10.47.12/converter/other/jpeg2000/pamtojpeg2k.c.pamtojpeg2kfix netpbm-10.47.12/converter/other/jpeg2000/pamtojpeg2k.c +--- netpbm-10.47.12/converter/other/jpeg2000/pamtojpeg2k.c.pamtojpeg2kfix 2010-04-27 15:47:10.000000000 +0200 ++++ netpbm-10.47.12/converter/other/jpeg2000/pamtojpeg2k.c 2010-05-03 15:37:49.934269588 +0200 +@@ -518,7 +518,5 @@ main(int argc, char **argv) + + pm_close(ifP); + +- pm_close(stdout); +- + return 0; + } diff --git a/netpbm-ppmfadeusage.patch b/netpbm-ppmfadeusage.patch index f0e56ae..d48f5f5 100644 --- a/netpbm-ppmfadeusage.patch +++ b/netpbm-ppmfadeusage.patch @@ -1,8 +1,25 @@ -diff --git a/editor/ppmfade b/editor/ppmfade -index 5091651..23b3ecc 100755 ---- a/editor/ppmfade -+++ b/editor/ppmfade -@@ -113,6 +113,9 @@ for ($n = 0; $n < @ARGV; $n++) { +diff -urNp old/editor/ppmfade new/editor/ppmfade +--- old/editor/ppmfade 2017-11-01 11:47:49.869611402 +0100 ++++ new/editor/ppmfade 2017-11-01 11:53:25.524973342 +0100 +@@ -84,7 +84,7 @@ for ($n = 0; $n < @ARGV; $n++) { + if (-e $first_file) { + } else { + print "I can't find first file '$first_file'\n"; +- exit 20; ++ exit 1; + } + } elsif ($ARGV[$n] eq "-l") { + $n++; +@@ -92,7 +92,7 @@ for ($n = 0; $n < @ARGV; $n++) { + if (-e $last_file) { + } else { + print "I can't find last file '$last_file'\n"; +- exit 20; ++ exit 1; + } + } elsif ($ARGV[$n] eq "-base") { + $n++; +@@ -113,9 +113,12 @@ for ($n = 0; $n < @ARGV; $n++) { $mode = $BLOCK; } elsif ("$ARGV[$n]" eq "-mix") { $mode = $MIX; @@ -11,4 +28,30 @@ index 5091651..23b3ecc 100755 + exit 1; } else { print "Unknown argument: $ARGV[$n]\n"; - exit 100; +- exit 100; ++ exit 1; + } + } + # +@@ -134,18 +137,18 @@ if ($first_file ne "undefined") { + $width = $1; $height = $2; + } else { + print("Unrecognized results from pnmfile on $first_file.\n"); +- exit(50); ++ exit 1; + } + } elsif ($last_file ne "undefined") { + if ((`pnmfile $last_file` =~ m{\b(\d+)\sby\s(\d+)} )) { + $width = $1; $height = $2; + } else { + print("Unrecognized results from pnmfile on $first_file.\n"); +- exit(50); ++ exit 1; + } + } else { + print("ppmfade: You must specify -f or -l (or both)\n"); +- exit(90); ++ exit 1; + } + + print("Frames are " . $width . "W x " . $height . "H\n"); diff --git a/netpbm-time.patch b/netpbm-time.patch new file mode 100644 index 0000000..680bf88 --- /dev/null +++ b/netpbm-time.patch @@ -0,0 +1,21 @@ +diff -up netpbm-10.47.05/converter/other/fiasco/config.h.time netpbm-10.47.05/converter/other/fiasco/config.h +--- netpbm-10.47.05/converter/other/fiasco/config.h.time 2009-12-10 08:34:36.000000000 +0100 ++++ netpbm-10.47.05/converter/other/fiasco/config.h 2009-12-10 08:43:54.000000000 +0100 +@@ -19,7 +19,7 @@ + #define STDC_HEADERS 1 + + /* Define if you can safely include both and . */ +-#define TIME_WITH_SYS_TIME 1 ++/* #undef TIME_WITH_SYS_TIME */ + + /* Define if the X Window System is missing or not being used. */ + #define X_DISPLAY_MISSING 1 +@@ -75,7 +75,7 @@ + #define HAVE_STRING_H 1 + + /* Define if you have the header file. */ +-#define HAVE_SYS_TIME_H 1 ++/* #undef HAVE_SYS_TIME_H */ + + /* Define if you have the header file. */ + #define HAVE_UNISTD_H 1 diff --git a/netpbm-xwdfix.patch b/netpbm-xwdfix.patch new file mode 100644 index 0000000..88626c7 --- /dev/null +++ b/netpbm-xwdfix.patch @@ -0,0 +1,11 @@ +--- netpbm-10.35/converter/other/xwdtopnm.c.xwdfix 2006-09-18 13:24:50.000000000 +0200 ++++ netpbm-10.35/converter/other/xwdtopnm.c 2006-09-18 13:27:26.000000000 +0200 +@@ -945,7 +945,7 @@ getpix(pixelReader * const rdrP) { + unsigned long const bitsToTakeMask = lsbmask[nBitsToTake]; + /* E.g. if nbitsToTake is 4, this is 0x0000000F */ + +- unsigned long bitsToTake; ++ unsigned int bitsToTake; + /* The actual bits we take, in the 'nBitsToTake' low bits */ + + assert(nBitsToTake <= 32); diff --git a/netpbm.spec b/netpbm.spec index 0791b70..5a899bd 100644 --- a/netpbm.spec +++ b/netpbm.spec @@ -1,7 +1,7 @@ Summary: A library for handling different graphics file formats Name: netpbm Version: 10.82.00 -Release: 2%{?dist} +Release: 3%{?dist} # See copyright_summary for details License: BSD and GPLv2 and IJG and MIT and Public Domain URL: http://netpbm.sourceforge.net/ @@ -18,6 +18,19 @@ Patch2: netpbm-ppmfadeusage.patch Patch3: netpbm-noppmtompeg.patch Patch4: netpbm-CVE-2017-2587.patch Patch5: netpbm-python3.patch +Patch6: netpbm-time.patch +Patch7: netpbm-gcc4.patch +Patch8: netpbm-bmptopnm.patch +Patch9: netpbm-CAN-2005-2471.patch +Patch10: netpbm-xwdfix.patch +Patch11: netpbm-multilib.patch +Patch12: netpbm-glibc.patch +Patch13: netpbm-docfix.patch +Patch14: netpbm-fiasco-overflow.patch +Patch15: netpbm-cmuwtopbm.patch +Patch16: netpbm-pamtojpeg2k.patch +Patch17: netpbm-manfix.patch +Patch18: netpbm-manual-pages.patch BuildRequires: libjpeg-devel, libpng-devel, libtiff-devel, flex BuildRequires: libX11-devel, perl-generators, python3, jasper-devel, libxml2-devel %if (0%{?fedora} && 0%{?fedora} < 28) || (0%{?rhel} || 0%{?rhel} <= 7) @@ -212,6 +225,9 @@ popd %doc userguide/* %changelog +* Mon Jun 04 2018 Josef Ridky - 10.82.00-3 +- Backport unimplemented fixes from 10.79.00 (#1585695) + * Wed Apr 11 2018 Rafael Santos - 10.82.00-2 - Use standard Fedora build and linker flags (bug #1543858)