summaryrefslogtreecommitdiff
path: root/multimedia/mjpegtools
diff options
context:
space:
mode:
authoradam <adam@pkgsrc.org>2012-07-07 15:49:00 +0000
committeradam <adam@pkgsrc.org>2012-07-07 15:49:00 +0000
commit0f8f4bd4d4345a6584444d645a107e9b46d62a7f (patch)
tree03375caf13ccc251fb7ebb6f84bd3d85c3859ab4 /multimedia/mjpegtools
parent670cb4e070e461736dae2b220243f97bd8d70bc5 (diff)
downloadpkgsrc-0f8f4bd4d4345a6584444d645a107e9b46d62a7f.tar.gz
Changes 2.0.0:
* a lot of small patches and fixes
Diffstat (limited to 'multimedia/mjpegtools')
-rw-r--r--multimedia/mjpegtools/Makefile28
-rw-r--r--multimedia/mjpegtools/PLIST7
-rw-r--r--multimedia/mjpegtools/distinfo19
-rw-r--r--multimedia/mjpegtools/options.mk4
-rw-r--r--multimedia/mjpegtools/patches/patch-aa10
-rw-r--r--multimedia/mjpegtools/patches/patch-ab13
-rw-r--r--multimedia/mjpegtools/patches/patch-ac525
-rw-r--r--multimedia/mjpegtools/patches/patch-ad53
-rw-r--r--multimedia/mjpegtools/patches/patch-ae46
-rw-r--r--multimedia/mjpegtools/patches/patch-af15
-rw-r--r--multimedia/mjpegtools/patches/patch-lavtools_Makefile.in14
-rw-r--r--multimedia/mjpegtools/patches/patch-lavtools_jpegutils.c27
-rw-r--r--multimedia/mjpegtools/patches/patch-y4mdenoise_MotionSearcher.hh15
-rw-r--r--multimedia/mjpegtools/patches/patch-y4mdenoise_Region2D.hh31
14 files changed, 60 insertions, 747 deletions
diff --git a/multimedia/mjpegtools/Makefile b/multimedia/mjpegtools/Makefile
index 7cfea76cbf5..93f907ca351 100644
--- a/multimedia/mjpegtools/Makefile
+++ b/multimedia/mjpegtools/Makefile
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.51 2011/03/06 16:36:50 wiz Exp $
+# $NetBSD: Makefile,v 1.52 2012/07/07 15:49:00 adam Exp $
-DISTNAME= mjpegtools-1.9.0
-PKGREVISION= 6
+DISTNAME= mjpegtools-2.0.0
CATEGORIES= multimedia
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=mjpeg/}
@@ -16,25 +15,26 @@ CONFLICTS+= mplex-[0-9]*
DEPENDS+= toolame>=02l:../../audio/toolame
BUILD_DEPENDS+= nasm>=0.98:../../devel/nasm
-USE_TOOLS+= gmake
-USE_TOOLS+= bash:run pkg-config
-
USE_LANGUAGES= c c++
-
USE_LIBTOOL= yes
-SHLIBTOOL_OVERRIDE= # empty
-PKGCONFIG_OVERRIDE= mjpegtools.pc.in
-INFO_FILES= yes
-
+USE_TOOLS+= bash:run gmake pkg-config
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --without-libquicktime
CONFIGURE_ARGS+= --enable-large-file
CONFIGURE_ARGS+= --with-lame-includes=${BUILDLINK_PREFIX.lame}
+SHLIBTOOL_OVERRIDE= # empty
+PKGCONFIG_OVERRIDE= mjpegtools.pc.in
+INFO_FILES= yes
+
.include "../../mk/bsd.prefs.mk"
-.if ${OPSYS} == Darwin
+.if ${OPSYS} == "Darwin"
CONFIGURE_ARGS+= --disable-sdltest
+CONFIGURE_ENV+= mjt_cv_extern___progname=no
+.else
+.include "../../x11/libXxf86dga/buildlink3.mk"
+.include "../../mk/oss.buildlink3.mk"
.endif
BUILDLINK_TRANSFORM+= rm:-laudio
@@ -43,9 +43,7 @@ BUILDLINK_TRANSFORM+= rm:-laudio
.include "../../audio/lame/buildlink3.mk"
.include "../../devel/SDL/buildlink3.mk"
-.include "../../mk/jpeg.buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
-.include "../../x11/libXxf86dga/buildlink3.mk"
-.include "../../mk/oss.buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/multimedia/mjpegtools/PLIST b/multimedia/mjpegtools/PLIST
index e39c200671a..28521eb173e 100644
--- a/multimedia/mjpegtools/PLIST
+++ b/multimedia/mjpegtools/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.12 2009/06/14 18:08:08 joerg Exp $
+@comment $NetBSD: PLIST,v 1.13 2012/07/07 15:49:00 adam Exp $
bin/anytovcd.sh
bin/jpeg2yuv
bin/lav2avi.sh
@@ -73,9 +73,8 @@ include/mjpegtools/mpeg2enc/mpeg2encoder.hh
include/mjpegtools/mpeg2enc/mpeg2encoptions.hh
include/mjpegtools/mpeg2enc/mpeg2encparams.h
include/mjpegtools/mpeg2enc/mpeg2syntaxcodes.h
-include/mjpegtools/mpeg2enc/ontheflyratectl.hh
-include/mjpegtools/mpeg2enc/pass1ratectl.hh
-include/mjpegtools/mpeg2enc/pass2ratectl.hh
+include/mjpegtools/mpeg2enc/ontheflyratectlpass1.hh
+include/mjpegtools/mpeg2enc/ontheflyratectlpass2.hh
include/mjpegtools/mpeg2enc/picture.hh
include/mjpegtools/mpeg2enc/picturereader.hh
include/mjpegtools/mpeg2enc/predict_ref.h
diff --git a/multimedia/mjpegtools/distinfo b/multimedia/mjpegtools/distinfo
index 6e38153211e..8d290f0e49b 100644
--- a/multimedia/mjpegtools/distinfo
+++ b/multimedia/mjpegtools/distinfo
@@ -1,13 +1,8 @@
-$NetBSD: distinfo,v 1.25 2012/01/23 08:09:36 joerg Exp $
+$NetBSD: distinfo,v 1.26 2012/07/07 15:49:00 adam Exp $
-SHA1 (mjpegtools-1.9.0.tar.gz) = 1701233354c7ea86b5b7808c4dd5d03a71118e48
-RMD160 (mjpegtools-1.9.0.tar.gz) = 79e0eb4bce468bb8f12da336e29abe8fab390a5f
-Size (mjpegtools-1.9.0.tar.gz) = 1718063 bytes
-SHA1 (patch-aa) = 64c2bd92b206060fbaa95a932f0ea18aec17b127
-SHA1 (patch-ab) = 5fc460db1593afb1f99422003db86e6b7cfc8eb9
-SHA1 (patch-ac) = 79a5324816b8fe7c371c29e4291ccee92a35e99f
-SHA1 (patch-ad) = 2a6f33fdc9c240d1c5c1172710db7ed95b1fc5a8
-SHA1 (patch-ae) = 98bfbaccd8dc79582a32ffbc8dba7b6c039c0373
-SHA1 (patch-af) = db90227d0732220123e5900049cf5f3e961432a2
-SHA1 (patch-lavtools_jpegutils.c) = b81357746465a782ae89bd41c26eaa5a5b4cd07d
-SHA1 (patch-y4mdenoise_Region2D.hh) = 9e2fe647f04be0c20ab23ae9200bc736a71b2bcd
+SHA1 (mjpegtools-2.0.0.tar.gz) = f411e8573d446711dbe8455a6ae9257e1afe1e70
+RMD160 (mjpegtools-2.0.0.tar.gz) = 454e23bedb2bd592912a546d0621b5c3662c3bb2
+Size (mjpegtools-2.0.0.tar.gz) = 1749671 bytes
+SHA1 (patch-aa) = 0c46a6a6d5f7e5103cdcc51e03f9d109900cb37b
+SHA1 (patch-lavtools_Makefile.in) = 1f67844db005e16e4ba2bfc5d5fca552ca9a4aff
+SHA1 (patch-y4mdenoise_MotionSearcher.hh) = 005783ee930add3897041778a9d3b3817e18cce2
diff --git a/multimedia/mjpegtools/options.mk b/multimedia/mjpegtools/options.mk
index 6b9d870bc37..9383e496f6e 100644
--- a/multimedia/mjpegtools/options.mk
+++ b/multimedia/mjpegtools/options.mk
@@ -1,9 +1,9 @@
-# $NetBSD: options.mk,v 1.5 2008/09/07 00:35:12 bjs Exp $
+# $NetBSD: options.mk,v 1.6 2012/07/07 15:49:00 adam Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.mjpegtools
PKG_SUPPORTED_OPTIONS= dv simd
PKG_SUGGESTED_OPTIONS= dv
-PKG_OPTIONS_LEGACY_OPTS= mjpegtools-simd:simd
+PKG_OPTIONS_LEGACY_OPTS+= mjpegtools-simd:simd
.include "../../mk/bsd.options.mk"
diff --git a/multimedia/mjpegtools/patches/patch-aa b/multimedia/mjpegtools/patches/patch-aa
index 61f7cc1e121..872d085590d 100644
--- a/multimedia/mjpegtools/patches/patch-aa
+++ b/multimedia/mjpegtools/patches/patch-aa
@@ -1,9 +1,11 @@
-$NetBSD: patch-aa,v 1.7 2009/01/08 17:21:36 wiz Exp $
+$NetBSD: patch-aa,v 1.8 2012/07/07 15:49:00 adam Exp $
---- configure.orig 2009-01-06 07:49:27.000000000 +0100
+Avoid CPU flags
+
+--- configure.orig 2011-05-21 12:45:05.000000000 +0000
+++ configure
-@@ -25986,7 +25986,6 @@ if test x$have_x86cpu = xtrue -o x$have_
- echo $ECHO_N "checking sub-architecture settings... $ECHO_C" >&6; }
+@@ -18418,7 +18418,6 @@ if test x$have_x86cpu = xtrue -o x$have_
+ $as_echo_n "checking sub-architecture settings... " >&6; }
if test x$have_x86cpu = xtrue; then
host_mod_cpu=`echo $host_cpu | tr _ -`
- ARCHFLAGS="-march=$host_mod_cpu -mcpu=$host_mod_cpu"
diff --git a/multimedia/mjpegtools/patches/patch-ab b/multimedia/mjpegtools/patches/patch-ab
deleted file mode 100644
index a6966ddc9f1..00000000000
--- a/multimedia/mjpegtools/patches/patch-ab
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-ab,v 1.6 2006/06/21 18:29:18 drochner Exp $
-
---- utils/cpu_accel.c.orig 2006-06-21 20:18:47.000000000 +0200
-+++ utils/cpu_accel.c
-@@ -117,7 +117,7 @@ static int x86_accel (void)
- /* Slightly weirdified cpuid that preserves the ebx and edi required
- by gcc for PIC offset table and frame pointer */
-
--#ifdef __LP64__
-+#if defined(__LP64__) || defined(_LP64)
- # define REG_b "rbx"
- # define REG_S "rsi"
- #else
diff --git a/multimedia/mjpegtools/patches/patch-ac b/multimedia/mjpegtools/patches/patch-ac
deleted file mode 100644
index 2aacb18e200..00000000000
--- a/multimedia/mjpegtools/patches/patch-ac
+++ /dev/null
@@ -1,525 +0,0 @@
-$NetBSD: patch-ac,v 1.11 2011/02/10 17:06:27 wiz Exp $
-
-Fix build with png-1.5, from John Bowler <jbowler@acm.org>.
-https://sourceforge.net/tracker/?func=detail&aid=3177485&group_id=5776&atid=105776
-
---- lavtools/png2yuv.c.orig 2007-11-08 17:31:50.000000000 +0000
-+++ lavtools/png2yuv.c
-@@ -49,12 +49,9 @@ png2yuv
-
- #include "subsample.h"
- #include "colorspace.h"
--//#include "mplexconsts.hh"
-
- #define DEFAULT_CHROMA_MODE Y4M_CHROMA_420JPEG
-
--#define MAXPIXELS (2800*1152) /**< Maximum size of final image */
--
- typedef struct _parameters
- {
- char *pngformatstr;
-@@ -70,14 +67,10 @@ typedef struct _parameters
- int ss_mode; /**< subsampling mode (based on ssm_id from subsample.h) */
-
- int new_width; /// new MPEG2 width, in case the original one is uneven
-+ int new_height; /// new MPEG2 width, in case the original one is uneven
- } parameters_t;
-
-
--struct _parameters *sh_param;
--png_structp png_ptr;
--png_infop info_ptr, end_info;
--uint8_t *raw0, *raw1, *raw2; /* buffer for RGB first, and then Y/Cb/Cr planes of decoded PNG */
--
- /*
- * The User Interface parts
- */
-@@ -152,8 +145,6 @@ static void parse_commandline(int argc,
- param->interleave = -1;
- param->verbose = 1;
- param->ss_mode = DEFAULT_CHROMA_MODE;
-- //param->mza_filename = NULL;
-- //param->make_z_alpha = 0;
-
- /* parse options */
- for (;;) {
-@@ -240,93 +231,43 @@ static void parse_commandline(int argc,
- }
- }
-
--void png_separation(png_structp png_ptr, png_row_infop row_info, png_bytep data)
--{
-- int row_nr = png_ptr->row_number; // internal variable ?
-- int i, width = row_info->width;
-- int new_width = sh_param->new_width;
--
-- /* contents of row_info:
-- * png_uint_32 width width of row
-- * png_uint_32 rowbytes number of bytes in row
-- * png_byte color_type color type of pixels
-- * png_byte bit_depth bit depth of samples
-- * png_byte channels number of channels (1-4)
-- * png_byte pixel_depth bits per pixel (depth*channels)
-- */
--
-- //mjpeg_debug("PNG YUV transformation callback; color_type is %d row_number %d\n",
-- // row_info->color_type, row_nr);
--
-- if(row_info->color_type == PNG_COLOR_TYPE_GRAY) // only Z available
-- {
-- //mjpeg_debug("Grayscale to YUV, row %d", row_nr);
-- for (i = 0; i < width; i++)
-- {
-- raw0[i + row_nr * new_width] = data[i];
-- raw1[i + row_nr * new_width] = data[i];
-- raw2[i + row_nr * new_width] = data[i];
-- }
-- return;
-- }
--
-- if(row_info->color_type == PNG_COLOR_TYPE_RGB) // Z and Alpha available
-- {
-- //mjpeg_info("RGB to YUV, row %d", row_nr);
-- for (i = 0; i < width; i++)
-- {
-- raw0[i + row_nr * new_width] = data[i*3];
-- raw1[i + row_nr * new_width] = data[i*3 + 1];
-- raw2[i + row_nr * new_width] = data[i*3 + 2];
-- }
-- return;
-- }
--
-- mjpeg_error_exit1("mpegz: UNKNOWN COLOR FORMAT %d in PNG transformation !\n", row_info->color_type);
--}
--
-
- /*
- * The file handling parts
- */
- /**
- Reads one PNG file.
--@param process Process the image data (0 for initial parameter determination)
-+@param process Process the image data (NULL for initial parameter determination)
- @returns -1 on failure, 1 on sucess
-+@on success returns RGB data in the second, yuv, parameter
- */
--int decode_png(const char *pngname, int process, parameters_t *param)
-+int decode_png(const char *pngname, uint8_t *yuv[], parameters_t *param)
- {
-- int num_pass = 1;
-- int bit_depth, color_type;
-+ png_structp png_ptr;
-+ png_infop info_ptr;
- FILE *pngfile;
-- //png_byte hdptr[8];
--
-- /* Now open this PNG file, and examine its header to retrieve the
-- YUV4MPEG info that shall be written */
-- pngfile = fopen(pngname, "rb");
-- if (!pngfile)
-- {
-- perror("PNG file open failed:");
-- return -1;
-- }
-
-- //fread(hdptr, 1, 8, pngfile);
-+ /* libpng needs two structs - a png_struct and a png_info, there is no
-+ * need to make the third, another png_info, because that is only used
-+ * to store data (such as textual information) that can come after the
-+ * PNG image. This code only cares about the image.
-+ */
-+ info_ptr = NULL;
-+ pngfile = NULL;
-+ png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
-+ if (!png_ptr)
-+ mjpeg_error_exit1("%s: Could not allocate PNG read struct !", pngname);
-
--#if 0
-- bool is_png = !png_sig_cmp(hdptr, 0, 8);
-- if (!is_png)
-+ /* This needs to be done immediately after creation of the png_struct
-+ * because storage allocation failures will longjmp back to here:
-+ */
-+ if (setjmp(png_jmpbuf(png_ptr)))
- {
-- mjpeg_error("%s is _no_ PNG file !\n");
-+ png_destroy_read_struct(&png_ptr, &info_ptr, 0);
-+ if (pngfile) (void)fclose(pngfile);
-+ mjpeg_error("%s: Corrupted PNG file !", pngname);
- return -1;
- }
--#endif
--
-- png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
-- if (!png_ptr)
-- mjpeg_error_exit1("%s: Could not allocate PNG read struct !", pngname);
--
-- png_init_io(png_ptr, pngfile);
-- //png_set_sig_bytes(png_ptr, 8);
-
- info_ptr = png_create_info_struct(png_ptr);
- if (!info_ptr)
-@@ -336,79 +277,101 @@ int decode_png(const char *pngname, int
- mjpeg_error_exit1("%s: Could not allocate PNG info struct !", pngname);
- }
-
-- end_info = png_create_info_struct(png_ptr);
-- if (!end_info)
-+ /* Now open this PNG file, and examine its header to retrieve the
-+ YUV4MPEG info that shall be written */
-+ pngfile = fopen(pngname, "rb");
-+ if (!pngfile)
- {
-- png_destroy_read_struct(&png_ptr, &info_ptr,
-- (png_infopp)NULL);
-- mjpeg_error_exit1("%s: Could not allocate PNG end info struct !", pngname);
-+ perror(pngname);
-+ png_error(png_ptr, "PNG file open failed");
- }
--
-- if (setjmp(png_jmpbuf(png_ptr)))
-+
-+ png_init_io(png_ptr, pngfile);
-+
-+ if (yuv)
- {
-- png_destroy_read_struct(&png_ptr, &info_ptr,
-- &end_info);
-- mjpeg_error("%s: Corrupted PNG file !", pngname);
-- return -1;
-+ png_uint_32 nr, input_height, input_width, output_height, output_width;
-+ uint8_t *r, *g, *b;
-+ png_bytepp rows;
-+
-+ /* The code uses png_read_png to obtain a complete buffered copy of the
-+ * PNG file reduced (or expanded) to 8 bit RGB. This is a little wasteful
-+ * in the case of a non-interlaced image - the code could work row by
-+ * row without buffering the whole image - but the interlaced case is
-+ * almost impossible to handle this way so it is better to be simple and
-+ * correct.
-+ */
-+# if PNG_LIBPNG_VER >= 10500 && PNG_LIBPNG_VER < 10502
-+ /* There is a bug in 1.5 before 1.5.2 which causes png_read_png to
-+ * whine most terribly on interlaced images, this stops it:
-+ */
-+ (void)png_set_interlace_handling(png_ptr);
-+# endif
-+ png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_STRIP_16 |
-+ PNG_TRANSFORM_STRIP_ALPHA | PNG_TRANSFORM_EXPAND |
-+ PNG_TRANSFORM_GRAY_TO_RGB /* requires libpng 1.4 or later */, 0);
-+
-+ /* And return the separated data to the parameters. */
-+ rows = png_get_rows(png_ptr, info_ptr);
-+
-+ /* Since the PNG files for the frames are separate the actual PNG file
-+ * that was read could be unrelated - a random width and height. Because
-+ * the output may be interleaved the output height may be twice the input
-+ * PNG height. Because the MPEG code requires an even width the output
-+ * width may be one more than the original frame width.
-+ *
-+ * For the interleaving the PNG data is smashed into the lower half of
-+ * the yuv rows. For the other cases the input data is cropped or
-+ * top-lefted as appropriate.
-+ */
-+ output_height = param->new_height;
-+
-+ input_height = png_get_image_height(png_ptr, info_ptr);
-+ if (input_height > output_height)
-+ input_height = output_height;
-+
-+ output_width = param->new_width;
-+
-+ input_width = png_get_image_width(png_ptr, info_ptr);
-+ if (input_width > output_width)
-+ input_width = output_width;
-+
-+ /* Breaking up the RGB data is not hard to do, the separated channels are
-+ * simply packed into the three raw yuv arrays with new_width values per
-+ * row.
-+ */
-+ r = yuv[0];
-+ g = yuv[1];
-+ b = yuv[2];
-+ for (nr=0; nr<input_height; ++nr)
-+ {
-+ png_uint_32 nc;
-+ png_bytep row = *rows++;
-+
-+ for (nc=0; nc<input_width; ++nc)
-+ {
-+ *r++ = *row++;
-+ *g++ = *row++;
-+ *b++ = *row++;
-+ }
-+
-+ /* Pad the output: */
-+ for (; nc<output_width; ++nc)
-+ *r++ = *g++ = *b++ = 0;
-+ }
- }
--
-- if (process)
-- png_set_read_user_transform_fn(png_ptr, png_separation);
-- png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_STRIP_16 | PNG_TRANSFORM_STRIP_ALPHA, NULL);
--
-- if (png_get_IHDR(png_ptr, info_ptr, &param->width, &param->height, &bit_depth,
-- // &color_type, &interlace_type, &compression_type, &filter_type))
-- &color_type, NULL, NULL, NULL))
-- num_pass = png_set_interlace_handling(png_ptr);
- else
-- mjpeg_error_exit1("PNG header reading failed !!\n");
--#if 0
-- mjpeg_info("Reading info struct...\n");
-- png_read_info(png_ptr, info_ptr);
-- mjpeg_info("Done...\n");
--
-- if (png_get_IHDR(png_ptr, info_ptr, &param->width, &param->height, &bit_depth,
-- // &color_type, &interlace_type, &compression_type, &filter_type))
-- &color_type, NULL, NULL, NULL))
-- num_pass = png_set_interlace_handling(png_ptr);
-- else
-- mjpeg_error_exit1("PNG header reading failed !!\n");
--
-- if (process)
- {
-- printf("%d passes needed\n\n", num_pass);
--
-- if (bit_depth != 8 && bit_depth != 16)
-- {
-- mjpeg_error_exit1("Invalid bit_depth %d, only 8 and 16 bit allowed !!\n", bit_depth);
-- }
--
-- png_set_strip_16(png_ptr); // always has to strip the 16bit input, MPEG can't handle it
-- png_set_strip_alpha(png_ptr); // Alpha can't be processed until Z/Alpha is integrated
--
-- printf("\nAllocating row buffer...");
-- png_set_read_user_transform_fn(png_ptr, png_separation);
-- png_bytep row_buf = (png_bytep)png_malloc(png_ptr,
-- png_get_rowbytes(png_ptr, info_ptr));
--
-- for (int n=0; n < num_pass; n++)
-- for (int y=0; y < sh_param->height; y++)
-- {
-- printf("Writing row data for pass %d\n", n);
-- png_read_rows(png_ptr, (png_bytepp)&row_buf, NULL, 1);
-- }
--
-- png_free(png_ptr, row_buf);
-- }
-- png_read_end(png_ptr, info_ptr);
--#endif
-- if (setjmp(png_ptr->jmpbuf)) {
-- png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
-- return 2;
-+ /* Just return the image width and height in *param */
-+ png_read_info(png_ptr, info_ptr);
-+
-+ param->width = png_get_image_width(png_ptr, info_ptr);
-+ param->height = png_get_image_height(png_ptr, info_ptr);
- }
-
-+ /* Successful exit: */
-+ png_destroy_read_struct(&png_ptr, &info_ptr, 0);
- fclose(pngfile);
--
- return 1;
- }
-
-@@ -419,13 +382,17 @@ int decode_png(const char *pngname, int
- */
- static int init_parse_files(parameters_t *param)
- {
-- char pngname[255];
-+ char pngname[PATH_MAX+1]; /* See POSIX 1003.1 section 2.9.5 */
-
- snprintf(pngname, sizeof(pngname),
- param->pngformatstr, param->begin);
- mjpeg_debug("Analyzing %s to get the right pic params", pngname);
-
-- if (decode_png(pngname, 0, param) == -1)
-+ /* The first frame (the param->begin frame) determines the height and
-+ * width of the output. Passing NULL instead of yuv (see below) causes
-+ * decode_png to fill in param with the image dimensions.
-+ */
-+ if (decode_png(pngname, NULL, param) == -1)
- mjpeg_error_exit1("Reading of %s failed.\n", pngname);
-
- mjpeg_info("Image dimensions are %ux%u",
-@@ -455,6 +422,7 @@ static int init_parse_files(parameters_t
-
- if (!(param->interleave) && (param->interlace != Y4M_ILACE_NONE))
- {
-+ /* So the height in 'param' might be twice the PNG input height:*/
- param->height *= 2;
- mjpeg_info("Non-interleaved fields (image height doubled)");
- }
-@@ -466,33 +434,29 @@ static int init_parse_files(parameters_t
- static int generate_YUV4MPEG(parameters_t *param)
- {
- uint32_t frame;
-- //size_t pngsize;
-- char pngname[FILENAME_MAX];
-- uint8_t *yuv[3]; /* buffer for Y/U/V planes of decoded PNG */
-+ uint8_t *yuv[3]; /* Buffers, initially for R,G,B then Y,Cb,Cr */
- y4m_stream_info_t streaminfo;
- y4m_frame_info_t frameinfo;
-
-- if ((param->width % 2) == 0)
-- param->new_width = param->width;
-- else
-- {
-- param->new_width = ((param->width >> 1) + 1) << 1;
-- printf("Setting new, even image width %d", param->new_width);
-- }
-+ /* Make the output even, so the output may be one larger than the
-+ * original PNG image width.
-+ */
-+ param->new_width = param->width + (param->width & 1);
-+ param->new_height = param->height + (param->height & 1);
-
- mjpeg_info("Now generating YUV4MPEG stream.");
- y4m_init_stream_info(&streaminfo);
- y4m_init_frame_info(&frameinfo);
-
- y4m_si_set_width(&streaminfo, param->new_width);
-- y4m_si_set_height(&streaminfo, param->height);
-+ y4m_si_set_height(&streaminfo, param->new_height);
- y4m_si_set_interlace(&streaminfo, param->interlace);
- y4m_si_set_framerate(&streaminfo, param->framerate);
- y4m_si_set_chroma(&streaminfo, param->ss_mode);
-
-- yuv[0] = (uint8_t *)malloc(param->new_width * param->height * sizeof(yuv[0][0]));
-- yuv[1] = (uint8_t *)malloc(param->new_width * param->height * sizeof(yuv[1][0]));
-- yuv[2] = (uint8_t *)malloc(param->new_width * param->height * sizeof(yuv[2][0]));
-+ yuv[0] = (uint8_t *)malloc(param->new_width * param->new_height * sizeof(yuv[0][0]));
-+ yuv[1] = (uint8_t *)malloc(param->new_width * param->new_height * sizeof(yuv[1][0]));
-+ yuv[2] = (uint8_t *)malloc(param->new_width * param->new_height * sizeof(yuv[2][0]));
-
- y4m_write_stream_header(STDOUT_FILENO, &streaminfo);
-
-@@ -500,15 +464,13 @@ static int generate_YUV4MPEG(parameters_
- (frame < param->numframes + param->begin) || (param->numframes == -1);
- frame++)
- {
-- // if (frame < 25)
-- // else
-- //snprintf(pngname, sizeof(pngname), param->pngformatstr, frame - 25);
-+ char pngname[PATH_MAX+1];
- snprintf(pngname, sizeof(pngname), param->pngformatstr, frame);
-
-- raw0 = yuv[0];
-- raw1 = yuv[1];
-- raw2 = yuv[2];
-- if (decode_png(pngname, 1, param) == -1)
-+ /* decode_png reads the PNG into the yuv buffers as r,g,b [0..255]
-+ * values.
-+ */
-+ if (decode_png(pngname, yuv, param) == -1)
- {
- mjpeg_info("Read from '%s' failed: %s", pngname, strerror(errno));
- if (param->numframes == -1)
-@@ -523,79 +485,18 @@ static int generate_YUV4MPEG(parameters_
- }
- else
- {
--#if 0
-- mjpeg_debug("Preparing frame");
--
-- /* Now open this PNG file, and examine its header to retrieve the
-- YUV4MPEG info that shall be written */
--
-- if ((param->interlace == Y4M_ILACE_NONE) || (param->interleave == 1))
-- {
-- mjpeg_info("Processing non-interlaced/interleaved %s.",
-- pngname, pngsize);
--
-- decode_png(imagedata, 0, 420, yuv[0], yuv[1], yuv[2],
-- param->width, param->height, param->new_width);
--
--#if 0
-- if (param->make_z_alpha)
-- {
-- mjpeg_info("Writing Z/Alpha data.\n");
-- za_write(real_z_imagemap, param->width, param->height,z_alpha_fp,frame);
-- }
--#endif
-- }
-- else
-- {
-- mjpeg_error_exit1("Can't handle interlaced PNG information (yet) since there is no standard for it.\n"
-- "Use interleaved mode (-L option) to create interlaced material.");
--
-- switch (param->interlace)
-- {
-- case Y4M_ILACE_TOP_FIRST:
-- mjpeg_info("Processing interlaced, top-first %s", pngname);
--#if 0
-- decode_jpeg_raw(jpegdata, jpegsize,
-- Y4M_ILACE_TOP_FIRST,
-- 420, param->width, param->height,
-- yuv[0], yuv[1], yuv[2]);
--#endif
-- break;
-- case Y4M_ILACE_BOTTOM_FIRST:
-- mjpeg_info("Processing interlaced, bottom-first %s", pngname);
--#if 0
-- decode_jpeg_raw(jpegdata, jpegsize,
-- Y4M_ILACE_BOTTOM_FIRST,
-- 420, param->width, param->height,
-- yuv[0], yuv[1], yuv[2]);
--#endif
-- break;
-- default:
-- mjpeg_error_exit1("FATAL logic error?!?");
-- break;
-- }
-- }
--#endif
- mjpeg_debug("Converting frame to YUV format.");
- /* Transform colorspace, then subsample (in place) */
-- convert_RGB_to_YCbCr(yuv, param->height * param->new_width);
-- chroma_subsample(param->ss_mode, yuv, param->new_width, param->height);
-+ convert_RGB_to_YCbCr(yuv, param->new_height * param->new_width);
-+ chroma_subsample(param->ss_mode, yuv, param->new_width, param->new_height);
-
- mjpeg_debug("Frame decoded, now writing to output stream.");
- }
--
-+
- mjpeg_debug("Frame decoded, now writing to output stream.");
- y4m_write_frame(STDOUT_FILENO, &streaminfo, &frameinfo, yuv);
- }
-
--#if 0
-- if (param->make_z_alpha)
-- {
-- za_write_end(z_alpha_fp);
-- fclose(z_alpha_fp);
-- }
--#endif
--
- y4m_fini_stream_info(&streaminfo);
- y4m_fini_frame_info(&frameinfo);
- free(yuv[0]);
-@@ -614,7 +515,6 @@ static int generate_YUV4MPEG(parameters_
- int main(int argc, char ** argv)
- {
- parameters_t param;
-- sh_param = &param;
-
- y4m_accept_extensions(1);
-
-@@ -632,13 +532,3 @@ int main(int argc, char ** argv)
-
- return 0;
- }
--
--
--
--
--
--
--
--
--
--
diff --git a/multimedia/mjpegtools/patches/patch-ad b/multimedia/mjpegtools/patches/patch-ad
deleted file mode 100644
index 447d0698d13..00000000000
--- a/multimedia/mjpegtools/patches/patch-ad
+++ /dev/null
@@ -1,53 +0,0 @@
-$NetBSD: patch-ad,v 1.4 2009/01/08 17:21:36 wiz Exp $
-
---- scripts/lav2mpeg.orig 2006-07-01 06:46:14.000000000 +0200
-+++ scripts/lav2mpeg
-@@ -106,10 +106,10 @@ getTimeDiff() {
- }
-
- doStep() {
-- if [ "$LOGCOMMANDS" == "0" ]; then
-+ if [ "$LOGCOMMANDS" = "0" ]; then
- echo "COMMAND=${step[$count]}"
- fi
-- if [ "$LOGONLY" == "" ]; then
-+ if [ "$LOGONLY" = "" ]; then
- eval ${step[$count]}
- fi
- }
-@@ -174,7 +174,7 @@ printDebugInfo() {
- logIt "downscale=$downscaling"
- }
-
--if [ $# -eq 0 -o "$1" == "--help" -o "$1" = "-h" ]; then
-+if [ $# -eq 0 -o "$1" = "--help" -o "$1" = "-h" ]; then
- usage;
- exit 1
- fi
-@@ -268,7 +268,7 @@ logIt "$infostr"
- # lavinfo should set up video_frames, video_width
- # video_height, video_inter, video_norm, audio_chans
- eval $($LAVINFO $@ | grep "=") # grep for = to remove Warnings
--if [ "$video_frames" == "" ]; then
-+if [ "$video_frames" = "" ]; then
- logIt "'lavinfo $@' died! exiting"
- logIt " maybe you don't have lavinfo. or your input flags were wrong"
- logIt " input files must be the last input on the command line"
-@@ -348,7 +348,7 @@ else
- fi
-
- # set up the audio
--if [ "$userstereo" == "" ]; then
-+if [ "$userstereo" = "" ]; then
- stereo=${audio_chans:-0}
- else
- stereo=$userstereo
-@@ -401,7 +401,7 @@ if [ $video_width -gt $output_width -o $
- fi
- fi
-
--if [ "$video_inter" == "1" ]; then
-+if [ "$video_inter" = "1" ]; then
- yuvdenoise_flags="$yuvdenoise_flags -F"
- fi
-
diff --git a/multimedia/mjpegtools/patches/patch-ae b/multimedia/mjpegtools/patches/patch-ae
deleted file mode 100644
index 1314adc467e..00000000000
--- a/multimedia/mjpegtools/patches/patch-ae
+++ /dev/null
@@ -1,46 +0,0 @@
-$NetBSD: patch-ae,v 1.5 2009/01/08 17:21:36 wiz Exp $
-
---- scripts/lavtc.sh.orig 2008-05-05 16:28:44.000000000 +0200
-+++ scripts/lavtc.sh
-@@ -424,7 +424,7 @@ setDeinterlaceArgs ()
- #
- inputFile="${inFile}"
- inputVideoCodec="lav"
-- if [[ ${videoIsInterlaced} == 0 || ${deinterlacer=none} == "none" ]] ; then
-+ if [[ ${videoIsInterlaced} = 0 || ${deinterlacer=none} = "none" ]] ; then
- deinterlacerText="No deinterlacing"
- setFlipArgs
- elif [ ${deinterlacer} = "smart" ] ; then
-@@ -663,8 +663,8 @@ setVideoBW
- log_info "encoding ${inFile}"
- log_info "input video: ${videoWidth}x${videoHeight}"
- log_info "input total length: ${totalFrames} frames (${videoSeconds} seconds)"
-- log_info "deinterlace type: ${deinterlacer} (input is " `if [[ ${videoIsInterlaced} == 0 ]] ; then echo -n "not " ; fi ` " interlaced)"
-- if [[ ${audioInChannels} == 0 ]] ; then
-+ log_info "deinterlace type: ${deinterlacer} (input is " `if [[ ${videoIsInterlaced} = 0 ]] ; then echo -n "not " ; fi ` " interlaced)"
-+ if [[ ${audioInChannels} = 0 ]] ; then
- log_info "no audio on input"
- else
- log_info "input audio: ${audioInRate},${audioInBits},${audioInChannels}"
-@@ -748,7 +748,7 @@ do
- else
- corrector="cat"
- fi
-- if [ ${deinterlacer} == "kineco" ] ; then
-+ if [ ${deinterlacer} = "kineco" ] ; then
- deinterlaceCmd="yuvkineco -F 1 "
- else
- deinterlaceCmd="yuvdenoise -I -v 0 "
-@@ -757,10 +757,10 @@ do
- log_debug "lav2yuv ${inFile} | ${corrector} | ${deinterlaceCmd} > ${fifo} &"
- lav2yuv ${inFile} | ${corrector} | ${deinterlaceCmd} > ${fifo} &
- fi
-- if [[ "${audioInChannels}" == 0 ]] ; then
-+ if [[ "${audioInChannels}" = 0 ]] ; then
- inputAudioCodec=",null"
- outputAudioCodec=",null"
-- elif [[ ${pass} == 2 ]] ; then
-+ elif [[ ${pass} = 2 ]] ; then
- inputAudioCodec=",lav"
- fi
- inputCodecArgs="-x ${inputVideoCodec}${inputAudioCodec}"
diff --git a/multimedia/mjpegtools/patches/patch-af b/multimedia/mjpegtools/patches/patch-af
deleted file mode 100644
index 3f1b455476b..00000000000
--- a/multimedia/mjpegtools/patches/patch-af
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-af,v 1.4 2011/01/29 20:31:19 markd Exp $
-
-Fix build with gcc4.5
-
---- mplex/lpcmstrm_in.cpp.orig 2011-01-24 10:42:48.023875210 +0000
-+++ mplex/lpcmstrm_in.cpp
-@@ -53,7 +53,7 @@ LPCMStream::LPCMStream(IBitStream &ibs,
-
- bool LPCMStream::Probe(IBitStream &bs )
- {
-- char *last_dot = strrchr( bs.StreamName(), '.' );
-+ const char *last_dot = strrchr( bs.StreamName(), '.' );
- return
- last_dot != NULL
- && strcmp( last_dot+1, "lpcm") == 0;
diff --git a/multimedia/mjpegtools/patches/patch-lavtools_Makefile.in b/multimedia/mjpegtools/patches/patch-lavtools_Makefile.in
new file mode 100644
index 00000000000..7baf3355347
--- /dev/null
+++ b/multimedia/mjpegtools/patches/patch-lavtools_Makefile.in
@@ -0,0 +1,14 @@
+$NetBSD: patch-lavtools_Makefile.in,v 1.1 2012/07/07 15:49:01 adam Exp $
+
+Linking against X11 out of the blue is not clean, especially on Mac OS X
+
+--- lavtools/Makefile.in.orig 2012-07-07 13:01:12.000000000 +0000
++++ lavtools/Makefile.in
+@@ -42,7 +42,6 @@ host_triplet = @host@
+ @HAVE_V4L_TRUE@am__append_2 = liblavrec.la
+ @HAVE_V4L_OR_SDL_TRUE@am__append_3 = liblavplay.la
+ @HAVE_V4L_TRUE@am__append_4 = ${X_LIBS}
+-@HAVE_SDL_TRUE@am__append_5 = -lX11
+ bin_PROGRAMS = mjpeg_simd_helper$(EXEEXT) lav2wav$(EXEEXT) \
+ lav2yuv$(EXEEXT) lavaddwav$(EXEEXT) lavtrans$(EXEEXT) \
+ ypipe$(EXEEXT) yuv2lav$(EXEEXT) transist.flt$(EXEEXT) \
diff --git a/multimedia/mjpegtools/patches/patch-lavtools_jpegutils.c b/multimedia/mjpegtools/patches/patch-lavtools_jpegutils.c
deleted file mode 100644
index 1cee5df061e..00000000000
--- a/multimedia/mjpegtools/patches/patch-lavtools_jpegutils.c
+++ /dev/null
@@ -1,27 +0,0 @@
-$NetBSD: patch-lavtools_jpegutils.c,v 1.1 2011/02/10 17:13:10 wiz Exp $
-
-Fix segmentation fault with jpeg-7 and above where dinfo.do_fancy_upsampling isn't set by default to FALSE anymore.
-
-Patch by: Salah Coronya
-
-http://bugs.gentoo.org/show_bug.cgi?id=293919
-https://sourceforge.net/tracker/?func=detail&aid=2937874&group_id=5776&atid=105776
-
---- lavtools/jpegutils.c
-+++ lavtools/jpegutils.c
-@@ -502,6 +502,7 @@
-
- jpeg_read_header (&dinfo, TRUE);
- dinfo.raw_data_out = TRUE;
-+ dinfo.do_fancy_upsampling = FALSE;
- dinfo.out_color_space = JCS_YCbCr;
- dinfo.dct_method = JDCT_IFAST;
- guarantee_huff_tables(&dinfo);
-@@ -599,6 +600,7 @@
- if (field > 0) {
- jpeg_read_header (&dinfo, TRUE);
- dinfo.raw_data_out = TRUE;
-+ dinfo.do_fancy_upsampling = FALSE;
- dinfo.out_color_space = JCS_YCbCr;
- dinfo.dct_method = JDCT_IFAST;
- jpeg_start_decompress (&dinfo);
diff --git a/multimedia/mjpegtools/patches/patch-y4mdenoise_MotionSearcher.hh b/multimedia/mjpegtools/patches/patch-y4mdenoise_MotionSearcher.hh
new file mode 100644
index 00000000000..55141fb8d15
--- /dev/null
+++ b/multimedia/mjpegtools/patches/patch-y4mdenoise_MotionSearcher.hh
@@ -0,0 +1,15 @@
+$NetBSD: patch-y4mdenoise_MotionSearcher.hh,v 1.1 2012/07/07 15:49:01 adam Exp $
+
+Fix C++ error
+
+--- y4mdenoise/MotionSearcher.hh.orig 2012-07-07 13:03:45.000000000 +0000
++++ y4mdenoise/MotionSearcher.hh
+@@ -2196,7 +2196,7 @@ MotionSearcher<PIXEL_NUM,DIM,PIXEL_TOL,P
+ {
+ // This region is too small to be bothered with.
+ // Just get rid of it.
+- DeleteRegion (a_pRegion);
++ this->DeleteRegion (a_pRegion);
+ }
+ else
+ {
diff --git a/multimedia/mjpegtools/patches/patch-y4mdenoise_Region2D.hh b/multimedia/mjpegtools/patches/patch-y4mdenoise_Region2D.hh
deleted file mode 100644
index 9420aa690c8..00000000000
--- a/multimedia/mjpegtools/patches/patch-y4mdenoise_Region2D.hh
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-y4mdenoise_Region2D.hh,v 1.1 2012/01/23 08:09:36 joerg Exp $
-
---- y4mdenoise/Region2D.hh.orig 2012-01-23 01:52:49.000000000 +0000
-+++ y4mdenoise/Region2D.hh
-@@ -381,7 +381,7 @@ Region2D<INDEX,SIZE>::Assign (Status_t &
- assert (a_reStatus == g_kNoError);
-
- // Assign the other region's extents to ourselves.
-- Region2D<INDEX,SIZE>::Clear();
-+ this->Clear();
- for (typename REGION::ConstIterator itHere = a_rOther.Begin();
- itHere != a_rOther.End();
- ++itHere)
-@@ -754,7 +754,7 @@ Region2D<INDEX,SIZE>::FloodFill (Status_
- a_rControl.m_oToDo.Assign (a_reStatus, *this);
- if (a_reStatus != g_kNoError)
- return;
-- Region2D<INDEX,SIZE>::Clear();
-+ this->Clear();
- }
- }
- else
-@@ -889,7 +889,7 @@ Region2D<INDEX,SIZE>::MakeBorder (Status
- assert (a_reStatus == g_kNoError);
-
- // Start with an empty region.
-- Region2D<INDEX,SIZE>::Clear();
-+ this->Clear();
-
- // For every extent in the other region, add every surrounding
- // extent. That creates a region that looks like the other region,