summaryrefslogtreecommitdiffstats
path: root/debian/transcode/transcode-1.1.7/export
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2020-09-11 14:38:47 +0900
committerMichele Calgaro <[email protected]>2020-09-11 14:38:47 +0900
commit884c8093d63402a1ad0b502244b791e3c6782be3 (patch)
treea600d4ab0d431a2bdfe4c15b70df43c14fbd8dd0 /debian/transcode/transcode-1.1.7/export
parent14e1aa2006796f147f3f4811fb908a6b01e79253 (diff)
downloadextra-dependencies-884c8093d63402a1ad0b502244b791e3c6782be3.tar.gz
extra-dependencies-884c8093d63402a1ad0b502244b791e3c6782be3.zip
Added debian extra dependency packages.
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'debian/transcode/transcode-1.1.7/export')
-rw-r--r--debian/transcode/transcode-1.1.7/export/Makefile.am216
-rw-r--r--debian/transcode/transcode-1.1.7/export/Makefile.in1312
-rw-r--r--debian/transcode/transcode-1.1.7/export/aud_aux.c1215
-rw-r--r--debian/transcode/transcode-1.1.7/export/aud_aux.h37
-rw-r--r--debian/transcode/transcode-1.1.7/export/divx4_vbr.c434
-rw-r--r--debian/transcode/transcode-1.1.7/export/divx5_encore2.h175
-rw-r--r--debian/transcode/transcode-1.1.7/export/dvd-ntsc.cfg19
-rw-r--r--debian/transcode/transcode-1.1.7/export/dvd-pal.cfg19
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_ac3.c205
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_def.h116
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_divx5.c778
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_dv.c257
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_dvraw.c334
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_ffmpeg.c1831
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_im.c254
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_jpg.c349
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_lame.c259
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_lzo.c297
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_mov.c801
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_mp2.c258
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_mp2enc.c254
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_mpeg2enc.c468
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_null.c97
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_ogg.c230
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_pcm.c293
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_ppm.c278
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_pvm.c1076
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_pvn.c373
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_raw.c466
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_tcaud.c96
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_toolame.c235
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_wav.c153
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_xvid4.c1335
-rw-r--r--debian/transcode/transcode-1.1.7/export/export_yuv4mpeg.c266
-rw-r--r--debian/transcode/transcode-1.1.7/export/ffmpeg_cfg.c243
-rw-r--r--debian/transcode/transcode-1.1.7/export/ffmpeg_cfg.h108
-rw-r--r--debian/transcode/transcode-1.1.7/export/svcd-ntsc.cfg19
-rw-r--r--debian/transcode/transcode-1.1.7/export/svcd-pal.cfg19
-rw-r--r--debian/transcode/transcode-1.1.7/export/vbr.h43
-rw-r--r--debian/transcode/transcode-1.1.7/export/vcd-ntsc.cfg19
-rw-r--r--debian/transcode/transcode-1.1.7/export/vcd-pal.cfg19
-rw-r--r--debian/transcode/transcode-1.1.7/export/xvcd-ntsc.cfg19
-rw-r--r--debian/transcode/transcode-1.1.7/export/xvcd-pal.cfg19
-rw-r--r--debian/transcode/transcode-1.1.7/export/xvid4.cfg510
-rw-r--r--debian/transcode/transcode-1.1.7/export/xvid4.h776
45 files changed, 16580 insertions, 0 deletions
diff --git a/debian/transcode/transcode-1.1.7/export/Makefile.am b/debian/transcode/transcode-1.1.7/export/Makefile.am
new file mode 100644
index 00000000..d7877d6e
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/Makefile.am
@@ -0,0 +1,216 @@
+# # Process this file with automake to produce Makefile.in.
+
+AM_CPPFLAGS = \
+ $(PTHREAD_CFLAGS) \
+ -DMOD_PATH=\"$(MOD_PATH)\" \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/src
+
+pkgdir = $(MOD_PATH)
+
+if HAVE_LIBDV
+EXPORT_DV = export_dv.la
+EXPORT_DVRAW = export_dvraw.la
+endif
+
+if HAVE_FFMPEG
+EXPORT_FFMPEG = export_ffmpeg.la
+endif
+
+if HAVE_IMAGEMAGICK
+EXPORT_IM = export_im.la
+endif
+
+if HAVE_LIBJPEG
+EXPORT_JPG = export_jpg.la
+endif
+
+if HAVE_LZO
+EXPORT_LZO = export_lzo.la
+endif
+
+if HAVE_LIBQUICKTIME
+EXPORT_MOV = export_mov.la
+endif
+
+if HAVE_MJPEGTOOLS
+EXPORT_MP2ENC = export_mp2enc.la
+EXPORT_MPEG2ENC = export_mpeg2enc.la
+EXPORT_YUV4MPEG = export_yuv4mpeg.la
+endif
+
+if HAVE_PVM3
+EXPORT_PVM = export_pvm.la
+endif
+
+pkg_LTLIBRARIES = \
+ export_ac3.la \
+ export_divx5.la \
+ $(EXPORT_DV) \
+ $(EXPORT_DVRAW) \
+ $(EXPORT_FFMPEG) \
+ $(EXPORT_IM) \
+ $(EXPORT_JPG) \
+ export_lame.la \
+ $(EXPORT_LZO) \
+ $(EXPORT_MOV) \
+ export_mp2.la \
+ $(EXPORT_MP2ENC) \
+ $(EXPORT_MPEG2ENC) \
+ export_null.la \
+ export_ogg.la \
+ export_pcm.la \
+ export_ppm.la \
+ $(EXPORT_PVM) \
+ export_pvn.la \
+ export_raw.la \
+ export_tcaud.la \
+ export_toolame.la \
+ export_wav.la \
+ export_xvid4.la \
+ $(EXPORT_YUV4MPEG)
+
+export_ac3_la_SOURCES = export_ac3.c
+export_ac3_la_LDFLAGS = -module -avoid-version
+
+export_divx5_la_SOURCES = export_divx5.c aud_aux.c divx4_vbr.c
+export_divx5_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBAVCODEC_CFLAGS) $(LAME_CFLAGS)
+export_divx5_la_LDFLAGS = -module -avoid-version
+export_divx5_la_LIBADD = $(LIBAVCODEC_LIBS) $(LAME_LIBS)
+
+export_dv_la_SOURCES = export_dv.c aud_aux.c
+export_dv_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBDV_CFLAGS) $(LIBAVCODEC_CFLAGS) $(LAME_CFLAGS)
+export_dv_la_LDFLAGS = -module -avoid-version
+export_dv_la_LIBADD = $(LIBDV_LIBS) $(LIBAVCODEC_LIBS) $(LAME_LIBS)
+
+export_dvraw_la_SOURCES = export_dvraw.c
+export_dvraw_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBDV_CFLAGS)
+export_dvraw_la_LDFLAGS = -module -avoid-version
+export_dvraw_la_LIBADD = $(LIBDV_LIBS) -lm
+
+export_ffmpeg_la_SOURCES = export_ffmpeg.c aud_aux.c ffmpeg_cfg.c
+export_ffmpeg_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBAVCODEC_CFLAGS) $(LAME_CFLAGS)
+export_ffmpeg_la_LDFLAGS = -module -avoid-version
+export_ffmpeg_la_LIBADD = $(LIBAVCODEC_LIBS) $(LAME_LIBS)
+
+export_im_la_SOURCES = export_im.c
+export_im_la_CPPFLAGS = $(AM_CPPFLAGS) $(IMAGEMAGICK_CFLAGS)
+export_im_la_LDFLAGS = -module -avoid-version
+export_im_la_LIBADD = $(IMAGEMAGICK_LIBS) -lm
+
+export_jpg_la_SOURCES = export_jpg.c
+export_jpg_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBJPEG_CFLAGS)
+export_jpg_la_LDFLAGS = -module -avoid-version
+export_jpg_la_LIBADD = $(LIBJPEG_LIBS) -lm
+
+export_lame_la_SOURCES = export_lame.c
+export_lame_la_LDFLAGS = -module -avoid-version
+
+export_lzo_la_SOURCES = export_lzo.c aud_aux.c
+export_lzo_la_CPPFLAGS = $(AM_CPPFLAGS) $(LZO_CFLAGS) $(LIBAVCODEC_CFLAGS) $(LAME_CFLAGS)
+export_lzo_la_LDFLAGS = -module -avoid-version
+export_lzo_la_LIBADD = $(LZO_LIBS) $(LIBAVCODEC_LIBS) $(LAME_LIBS)
+
+export_mov_la_SOURCES = export_mov.c
+export_mov_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBQUICKTIME_CFLAGS)
+export_mov_la_LDFLAGS = -module -avoid-version
+export_mov_la_LIBADD = $(LIBQUICKTIME_LIBS) -lm
+
+export_mp2_la_SOURCES = export_mp2.c
+export_mp2_la_LDFLAGS = -module -avoid-version
+
+export_mp2enc_la_SOURCES = export_mp2enc.c
+export_mp2enc_la_CPPFLAGS = $(AM_CPPFLAGS) $(MJPEGTOOLS_CFLAGS)
+export_mp2enc_la_LDFLAGS = -module -avoid-version
+export_mp2enc_la_LIBADD = -lm
+
+export_mpeg2enc_la_SOURCES = export_mpeg2enc.c
+export_mpeg2enc_la_CPPFLAGS = $(AM_CPPFLAGS) $(MJPEGTOOLS_CFLAGS)
+export_mpeg2enc_la_LDFLAGS = -module -avoid-version
+export_mpeg2enc_la_LIBADD = $(MJPEGTOOLS_LIBS) -lm
+
+export_null_la_SOURCES = export_null.c
+export_null_la_LDFLAGS = -module -avoid-version
+
+export_ogg_la_SOURCES = export_ogg.c
+export_ogg_la_LDFLAGS = -module -avoid-version
+
+export_pcm_la_SOURCES = export_pcm.c
+export_pcm_la_LDFLAGS = -module -avoid-version
+
+export_ppm_la_SOURCES = export_ppm.c aud_aux.c
+export_ppm_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBAVCODEC_CFLAGS) $(LAME_CFLAGS)
+export_ppm_la_LDFLAGS = -module -avoid-version
+export_ppm_la_LIBADD = $(LIBAVCODEC_LIBS) $(LAME_LIBS)
+
+export_pvm_la_SOURCES = export_pvm.c ../pvm3/pvm_interface.c ../pvm3/pvm_parser.c ../pvm3/external_codec.c ../pvm3/vob_pack_unpack.c
+export_pvm_la_CPPFLAGS = $(AM_CPPFLAGS) $(PVM3_CFLAGS)
+export_pvm_la_LDFLAGS = -module -avoid-version
+
+export_pvn_la_SOURCES = export_pvn.c
+export_pvn_la_LDFLAGS = -module -avoid-version
+
+export_raw_la_SOURCES = export_raw.c aud_aux.c
+export_raw_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBAVCODEC_CFLAGS) $(LAME_CFLAGS)
+export_raw_la_LDFLAGS = -module -avoid-version
+export_raw_la_LIBADD = $(LIBAVCODEC_LIBS) $(LAME_LIBS)
+
+export_tcaud_la_SOURCES = export_tcaud.c aud_aux.c
+export_tcaud_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBAVCODEC_CFLAGS) $(LAME_CFLAGS)
+export_tcaud_la_LDFLAGS = -module -avoid-version
+export_tcaud_la_LIBADD = $(LIBAVCODEC_LIBS) $(LAME_LIBS)
+
+export_toolame_la_SOURCES = export_toolame.c
+export_toolame_la_LDFLAGS = -module -avoid-version
+
+export_wav_la_SOURCES = export_wav.c
+export_wav_la_LDFLAGS = -module -avoid-version
+export_wav_la_LIBADD = -lm
+
+export_xvid4_la_SOURCES = export_xvid4.c aud_aux.c
+export_xvid4_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBAVCODEC_CFLAGS) $(LAME_CFLAGS)
+export_xvid4_la_LDFLAGS = -module -avoid-version
+export_xvid4_la_LIBADD = $(LIBAVCODEC_LIBS) $(LAME_LIBS)
+
+export_yuv4mpeg_la_SOURCES = export_yuv4mpeg.c aud_aux.c
+export_yuv4mpeg_la_CPPFLAGS = $(AM_CPPFLAGS) $(MJPEGTOOLS_CFLAGS) $(LIBAVCODEC_CFLAGS) $(LAME_CFLAGS)
+export_yuv4mpeg_la_LDFLAGS = -module -avoid-version
+export_yuv4mpeg_la_LIBADD = $(MJPEGTOOLS_LIBS) $(LIBAVCODEC_LIBS) $(LAME_LIBS)
+
+EXTRA_DIST = \
+ aud_aux.h \
+ divx5_encore2.h \
+ export_def.h \
+ ffmpeg_cfg.h \
+ vbr.h \
+ xvid4.h \
+ xvid4.cfg
+
+if ENABLE_EXPERIMENTAL
+PROFILES = \
+ dvd-pal.cfg \
+ dvd-ntsc.cfg \
+ vcd-pal.cfg \
+ vcd-ntsc.cfg \
+ svcd-pal.cfg \
+ svcd-ntsc.cfg \
+ xvcd-pal.cfg \
+ xvcd-ntsc.cfg
+endif
+
+pkg_DATA = xvid4.cfg $(PROFILES)
+
+if ENABLE_EXPERIMENTAL
+install-exec-hook:
+ @mkdir -p $(DESTDIR)$(MOD_PATH)
+ @rm -f $(DESTDIR)$(MOD_PATH)/export_xvid.so
+ @$(LN_S) export_xvid4.so $(DESTDIR)$(MOD_PATH)/export_xvid.so
+ @mkdir -p $(DESTDIR)$(PROF_PATH)
+ @cp $(PROFILES) $(DESTDIR)$(PROF_PATH)
+else
+install-exec-hook:
+ @mkdir -p $(DESTDIR)$(MOD_PATH)
+ @rm -f $(DESTDIR)$(MOD_PATH)/export_xvid.so
+ @$(LN_S) export_xvid4.so $(DESTDIR)$(MOD_PATH)/export_xvid.so
+endif
+
diff --git a/debian/transcode/transcode-1.1.7/export/Makefile.in b/debian/transcode/transcode-1.1.7/export/Makefile.in
new file mode 100644
index 00000000..e90440a6
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/Makefile.in
@@ -0,0 +1,1312 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# # Process this file with automake to produce Makefile.in.
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = export
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(pkgdir)" "$(DESTDIR)$(pkgdir)"
+LTLIBRARIES = $(pkg_LTLIBRARIES)
+export_ac3_la_LIBADD =
+am_export_ac3_la_OBJECTS = export_ac3.lo
+export_ac3_la_OBJECTS = $(am_export_ac3_la_OBJECTS)
+export_ac3_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_ac3_la_LDFLAGS) $(LDFLAGS) -o $@
+am__DEPENDENCIES_1 =
+export_divx5_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+am_export_divx5_la_OBJECTS = export_divx5_la-export_divx5.lo \
+ export_divx5_la-aud_aux.lo export_divx5_la-divx4_vbr.lo
+export_divx5_la_OBJECTS = $(am_export_divx5_la_OBJECTS)
+export_divx5_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_divx5_la_LDFLAGS) $(LDFLAGS) -o $@
+export_dv_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+am_export_dv_la_OBJECTS = export_dv_la-export_dv.lo \
+ export_dv_la-aud_aux.lo
+export_dv_la_OBJECTS = $(am_export_dv_la_OBJECTS)
+export_dv_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_dv_la_LDFLAGS) $(LDFLAGS) -o $@
+@HAVE_LIBDV_TRUE@am_export_dv_la_rpath = -rpath $(pkgdir)
+export_dvraw_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_export_dvraw_la_OBJECTS = export_dvraw_la-export_dvraw.lo
+export_dvraw_la_OBJECTS = $(am_export_dvraw_la_OBJECTS)
+export_dvraw_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_dvraw_la_LDFLAGS) $(LDFLAGS) -o $@
+@HAVE_LIBDV_TRUE@am_export_dvraw_la_rpath = -rpath $(pkgdir)
+export_ffmpeg_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+am_export_ffmpeg_la_OBJECTS = export_ffmpeg_la-export_ffmpeg.lo \
+ export_ffmpeg_la-aud_aux.lo export_ffmpeg_la-ffmpeg_cfg.lo
+export_ffmpeg_la_OBJECTS = $(am_export_ffmpeg_la_OBJECTS)
+export_ffmpeg_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_ffmpeg_la_LDFLAGS) $(LDFLAGS) -o $@
+@HAVE_FFMPEG_TRUE@am_export_ffmpeg_la_rpath = -rpath $(pkgdir)
+export_im_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_export_im_la_OBJECTS = export_im_la-export_im.lo
+export_im_la_OBJECTS = $(am_export_im_la_OBJECTS)
+export_im_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_im_la_LDFLAGS) $(LDFLAGS) -o $@
+@HAVE_IMAGEMAGICK_TRUE@am_export_im_la_rpath = -rpath $(pkgdir)
+export_jpg_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_export_jpg_la_OBJECTS = export_jpg_la-export_jpg.lo
+export_jpg_la_OBJECTS = $(am_export_jpg_la_OBJECTS)
+export_jpg_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_jpg_la_LDFLAGS) $(LDFLAGS) -o $@
+@HAVE_LIBJPEG_TRUE@am_export_jpg_la_rpath = -rpath $(pkgdir)
+export_lame_la_LIBADD =
+am_export_lame_la_OBJECTS = export_lame.lo
+export_lame_la_OBJECTS = $(am_export_lame_la_OBJECTS)
+export_lame_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_lame_la_LDFLAGS) $(LDFLAGS) -o $@
+export_lzo_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+am_export_lzo_la_OBJECTS = export_lzo_la-export_lzo.lo \
+ export_lzo_la-aud_aux.lo
+export_lzo_la_OBJECTS = $(am_export_lzo_la_OBJECTS)
+export_lzo_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_lzo_la_LDFLAGS) $(LDFLAGS) -o $@
+@HAVE_LZO_TRUE@am_export_lzo_la_rpath = -rpath $(pkgdir)
+export_mov_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_export_mov_la_OBJECTS = export_mov_la-export_mov.lo
+export_mov_la_OBJECTS = $(am_export_mov_la_OBJECTS)
+export_mov_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_mov_la_LDFLAGS) $(LDFLAGS) -o $@
+@HAVE_LIBQUICKTIME_TRUE@am_export_mov_la_rpath = -rpath $(pkgdir)
+export_mp2_la_LIBADD =
+am_export_mp2_la_OBJECTS = export_mp2.lo
+export_mp2_la_OBJECTS = $(am_export_mp2_la_OBJECTS)
+export_mp2_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_mp2_la_LDFLAGS) $(LDFLAGS) -o $@
+export_mp2enc_la_DEPENDENCIES =
+am_export_mp2enc_la_OBJECTS = export_mp2enc_la-export_mp2enc.lo
+export_mp2enc_la_OBJECTS = $(am_export_mp2enc_la_OBJECTS)
+export_mp2enc_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_mp2enc_la_LDFLAGS) $(LDFLAGS) -o $@
+@HAVE_MJPEGTOOLS_TRUE@am_export_mp2enc_la_rpath = -rpath $(pkgdir)
+export_mpeg2enc_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_export_mpeg2enc_la_OBJECTS = export_mpeg2enc_la-export_mpeg2enc.lo
+export_mpeg2enc_la_OBJECTS = $(am_export_mpeg2enc_la_OBJECTS)
+export_mpeg2enc_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_mpeg2enc_la_LDFLAGS) $(LDFLAGS) -o $@
+@HAVE_MJPEGTOOLS_TRUE@am_export_mpeg2enc_la_rpath = -rpath $(pkgdir)
+export_null_la_LIBADD =
+am_export_null_la_OBJECTS = export_null.lo
+export_null_la_OBJECTS = $(am_export_null_la_OBJECTS)
+export_null_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_null_la_LDFLAGS) $(LDFLAGS) -o $@
+export_ogg_la_LIBADD =
+am_export_ogg_la_OBJECTS = export_ogg.lo
+export_ogg_la_OBJECTS = $(am_export_ogg_la_OBJECTS)
+export_ogg_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_ogg_la_LDFLAGS) $(LDFLAGS) -o $@
+export_pcm_la_LIBADD =
+am_export_pcm_la_OBJECTS = export_pcm.lo
+export_pcm_la_OBJECTS = $(am_export_pcm_la_OBJECTS)
+export_pcm_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_pcm_la_LDFLAGS) $(LDFLAGS) -o $@
+export_ppm_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+am_export_ppm_la_OBJECTS = export_ppm_la-export_ppm.lo \
+ export_ppm_la-aud_aux.lo
+export_ppm_la_OBJECTS = $(am_export_ppm_la_OBJECTS)
+export_ppm_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_ppm_la_LDFLAGS) $(LDFLAGS) -o $@
+export_pvm_la_LIBADD =
+am_export_pvm_la_OBJECTS = export_pvm_la-export_pvm.lo \
+ export_pvm_la-pvm_interface.lo export_pvm_la-pvm_parser.lo \
+ export_pvm_la-external_codec.lo \
+ export_pvm_la-vob_pack_unpack.lo
+export_pvm_la_OBJECTS = $(am_export_pvm_la_OBJECTS)
+export_pvm_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_pvm_la_LDFLAGS) $(LDFLAGS) -o $@
+@HAVE_PVM3_TRUE@am_export_pvm_la_rpath = -rpath $(pkgdir)
+export_pvn_la_LIBADD =
+am_export_pvn_la_OBJECTS = export_pvn.lo
+export_pvn_la_OBJECTS = $(am_export_pvn_la_OBJECTS)
+export_pvn_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_pvn_la_LDFLAGS) $(LDFLAGS) -o $@
+export_raw_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+am_export_raw_la_OBJECTS = export_raw_la-export_raw.lo \
+ export_raw_la-aud_aux.lo
+export_raw_la_OBJECTS = $(am_export_raw_la_OBJECTS)
+export_raw_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_raw_la_LDFLAGS) $(LDFLAGS) -o $@
+export_tcaud_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+am_export_tcaud_la_OBJECTS = export_tcaud_la-export_tcaud.lo \
+ export_tcaud_la-aud_aux.lo
+export_tcaud_la_OBJECTS = $(am_export_tcaud_la_OBJECTS)
+export_tcaud_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_tcaud_la_LDFLAGS) $(LDFLAGS) -o $@
+export_toolame_la_LIBADD =
+am_export_toolame_la_OBJECTS = export_toolame.lo
+export_toolame_la_OBJECTS = $(am_export_toolame_la_OBJECTS)
+export_toolame_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_toolame_la_LDFLAGS) $(LDFLAGS) -o $@
+export_wav_la_DEPENDENCIES =
+am_export_wav_la_OBJECTS = export_wav.lo
+export_wav_la_OBJECTS = $(am_export_wav_la_OBJECTS)
+export_wav_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_wav_la_LDFLAGS) $(LDFLAGS) -o $@
+export_xvid4_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+am_export_xvid4_la_OBJECTS = export_xvid4_la-export_xvid4.lo \
+ export_xvid4_la-aud_aux.lo
+export_xvid4_la_OBJECTS = $(am_export_xvid4_la_OBJECTS)
+export_xvid4_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_xvid4_la_LDFLAGS) $(LDFLAGS) -o $@
+export_yuv4mpeg_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+am_export_yuv4mpeg_la_OBJECTS = export_yuv4mpeg_la-export_yuv4mpeg.lo \
+ export_yuv4mpeg_la-aud_aux.lo
+export_yuv4mpeg_la_OBJECTS = $(am_export_yuv4mpeg_la_OBJECTS)
+export_yuv4mpeg_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(export_yuv4mpeg_la_LDFLAGS) $(LDFLAGS) -o $@
+@HAVE_MJPEGTOOLS_TRUE@am_export_yuv4mpeg_la_rpath = -rpath $(pkgdir)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/autotools/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(export_ac3_la_SOURCES) $(export_divx5_la_SOURCES) \
+ $(export_dv_la_SOURCES) $(export_dvraw_la_SOURCES) \
+ $(export_ffmpeg_la_SOURCES) $(export_im_la_SOURCES) \
+ $(export_jpg_la_SOURCES) $(export_lame_la_SOURCES) \
+ $(export_lzo_la_SOURCES) $(export_mov_la_SOURCES) \
+ $(export_mp2_la_SOURCES) $(export_mp2enc_la_SOURCES) \
+ $(export_mpeg2enc_la_SOURCES) $(export_null_la_SOURCES) \
+ $(export_ogg_la_SOURCES) $(export_pcm_la_SOURCES) \
+ $(export_ppm_la_SOURCES) $(export_pvm_la_SOURCES) \
+ $(export_pvn_la_SOURCES) $(export_raw_la_SOURCES) \
+ $(export_tcaud_la_SOURCES) $(export_toolame_la_SOURCES) \
+ $(export_wav_la_SOURCES) $(export_xvid4_la_SOURCES) \
+ $(export_yuv4mpeg_la_SOURCES)
+DIST_SOURCES = $(export_ac3_la_SOURCES) $(export_divx5_la_SOURCES) \
+ $(export_dv_la_SOURCES) $(export_dvraw_la_SOURCES) \
+ $(export_ffmpeg_la_SOURCES) $(export_im_la_SOURCES) \
+ $(export_jpg_la_SOURCES) $(export_lame_la_SOURCES) \
+ $(export_lzo_la_SOURCES) $(export_mov_la_SOURCES) \
+ $(export_mp2_la_SOURCES) $(export_mp2enc_la_SOURCES) \
+ $(export_mpeg2enc_la_SOURCES) $(export_null_la_SOURCES) \
+ $(export_ogg_la_SOURCES) $(export_pcm_la_SOURCES) \
+ $(export_ppm_la_SOURCES) $(export_pvm_la_SOURCES) \
+ $(export_pvn_la_SOURCES) $(export_raw_la_SOURCES) \
+ $(export_tcaud_la_SOURCES) $(export_toolame_la_SOURCES) \
+ $(export_wav_la_SOURCES) $(export_xvid4_la_SOURCES) \
+ $(export_yuv4mpeg_la_SOURCES)
+DATA = $(pkg_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+A52_CFLAGS = @A52_CFLAGS@
+A52_LIBS = @A52_LIBS@
+ACLIB_LIBS = @ACLIB_LIBS@
+ACLOCAL = @ACLOCAL@
+ALTIVEC_CFLAGS = @ALTIVEC_CFLAGS@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AVILIB_LIBS = @AVILIB_LIBS@
+AWK = @AWK@
+BSDAV_CFLAGS = @BSDAV_CFLAGS@
+BSDAV_LIBS = @BSDAV_LIBS@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXXCPP = @CXXCPP@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLDARWIN_CFLAGS = @DLDARWIN_CFLAGS@
+DLDARWIN_LIBS = @DLDARWIN_LIBS@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FAAC_CFLAGS = @FAAC_CFLAGS@
+FAAC_LIBS = @FAAC_LIBS@
+FGREP = @FGREP@
+FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@
+FREETYPE2_LIBS = @FREETYPE2_LIBS@
+GREP = @GREP@
+IBP_LIBS = @IBP_LIBS@
+ICONV_CFLAGS = @ICONV_CFLAGS@
+ICONV_LIBS = @ICONV_LIBS@
+IMAGEMAGICK_CFLAGS = @IMAGEMAGICK_CFLAGS@
+IMAGEMAGICK_LIBS = @IMAGEMAGICK_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LAME_CFLAGS = @LAME_CFLAGS@
+LAME_LIBS = @LAME_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBAVCODEC_CFLAGS = @LIBAVCODEC_CFLAGS@
+LIBAVCODEC_LIBS = @LIBAVCODEC_LIBS@
+LIBAVFORMAT_CFLAGS = @LIBAVFORMAT_CFLAGS@
+LIBAVFORMAT_LIBS = @LIBAVFORMAT_LIBS@
+LIBDVDREAD_CFLAGS = @LIBDVDREAD_CFLAGS@
+LIBDVDREAD_LIBS = @LIBDVDREAD_LIBS@
+LIBDV_CFLAGS = @LIBDV_CFLAGS@
+LIBDV_LIBS = @LIBDV_LIBS@
+LIBJPEG_CFLAGS = @LIBJPEG_CFLAGS@
+LIBJPEG_LIBS = @LIBJPEG_LIBS@
+LIBMPEG2CONVERT_CFLAGS = @LIBMPEG2CONVERT_CFLAGS@
+LIBMPEG2CONVERT_LIBS = @LIBMPEG2CONVERT_LIBS@
+LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
+LIBMPEG2_LIBS = @LIBMPEG2_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBPOSTPROC_CFLAGS = @LIBPOSTPROC_CFLAGS@
+LIBPOSTPROC_LIBS = @LIBPOSTPROC_LIBS@
+LIBQUICKTIME_CFLAGS = @LIBQUICKTIME_CFLAGS@
+LIBQUICKTIME_LIBS = @LIBQUICKTIME_LIBS@
+LIBS = @LIBS@
+LIBTCAUDIO_LIBS = @LIBTCAUDIO_LIBS@
+LIBTCVIDEO_LIBS = @LIBTCVIDEO_LIBS@
+LIBTC_LIBS = @LIBTC_LIBS@
+LIBTOOL = @LIBTOOL@
+LIBV4L2_CFLAGS = @LIBV4L2_CFLAGS@
+LIBV4L2_LIBS = @LIBV4L2_LIBS@
+LIBV4LCONVERT_CFLAGS = @LIBV4LCONVERT_CFLAGS@
+LIBV4LCONVERT_LIBS = @LIBV4LCONVERT_LIBS@
+LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
+LIBXML2_LIBS = @LIBXML2_LIBS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LZO_CFLAGS = @LZO_CFLAGS@
+LZO_LIBS = @LZO_LIBS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MJPEGTOOLS_CFLAGS = @MJPEGTOOLS_CFLAGS@
+MJPEGTOOLS_LIBS = @MJPEGTOOLS_LIBS@
+MKDIR_P = @MKDIR_P@
+MOD_PATH = @MOD_PATH@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OGG_CFLAGS = @OGG_CFLAGS@
+OGG_LIBS = @OGG_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PATH_TO_AWK = @PATH_TO_AWK@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PROF_PATH = @PROF_PATH@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+PVM3_CFLAGS = @PVM3_CFLAGS@
+PVM3_LIBS = @PVM3_LIBS@
+PVM3_PVMGS = @PVM3_PVMGS@
+RANLIB = @RANLIB@
+SDL_CFLAGS = @SDL_CFLAGS@
+SDL_LIBS = @SDL_LIBS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIMD_FLAGS = @SIMD_FLAGS@
+STRIP = @STRIP@
+THEORA_CFLAGS = @THEORA_CFLAGS@
+THEORA_LIBS = @THEORA_LIBS@
+USE_DLDARWIN = @USE_DLDARWIN@
+VERSION = @VERSION@
+VORBIS_CFLAGS = @VORBIS_CFLAGS@
+VORBIS_LIBS = @VORBIS_LIBS@
+WAVLIB_LIBS = @WAVLIB_LIBS@
+X264_CFLAGS = @X264_CFLAGS@
+X264_LIBS = @X264_LIBS@
+XIO_CFLAGS = @XIO_CFLAGS@
+XIO_LIBS = @XIO_LIBS@
+XMKMF = @XMKMF@
+XVID_CFLAGS = @XVID_CFLAGS@
+XVID_LIBS = @XVID_LIBS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+a52_config = @a52_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+bsdav_config = @bsdav_config@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+faac_config = @faac_config@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+iconv_config = @iconv_config@
+imagemagick_config = @imagemagick_config@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+lame_config = @lame_config@
+libdir = @libdir@
+libdvdread_config = @libdvdread_config@
+libexecdir = @libexecdir@
+libjpeg_config = @libjpeg_config@
+libjpegmmx_config = @libjpegmmx_config@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lzo_config = @lzo_config@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pvm3_config = @pvm3_config@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+x_includes = @x_includes@
+x_libraries = @x_libraries@
+xvid_config = @xvid_config@
+AM_CPPFLAGS = \
+ $(PTHREAD_CFLAGS) \
+ -DMOD_PATH=\"$(MOD_PATH)\" \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/src
+
+pkgdir = $(MOD_PATH)
+@HAVE_LIBDV_TRUE@EXPORT_DV = export_dv.la
+@HAVE_LIBDV_TRUE@EXPORT_DVRAW = export_dvraw.la
+@HAVE_FFMPEG_TRUE@EXPORT_FFMPEG = export_ffmpeg.la
+@HAVE_IMAGEMAGICK_TRUE@EXPORT_IM = export_im.la
+@HAVE_LIBJPEG_TRUE@EXPORT_JPG = export_jpg.la
+@HAVE_LZO_TRUE@EXPORT_LZO = export_lzo.la
+@HAVE_LIBQUICKTIME_TRUE@EXPORT_MOV = export_mov.la
+@HAVE_MJPEGTOOLS_TRUE@EXPORT_MP2ENC = export_mp2enc.la
+@HAVE_MJPEGTOOLS_TRUE@EXPORT_MPEG2ENC = export_mpeg2enc.la
+@HAVE_MJPEGTOOLS_TRUE@EXPORT_YUV4MPEG = export_yuv4mpeg.la
+@HAVE_PVM3_TRUE@EXPORT_PVM = export_pvm.la
+pkg_LTLIBRARIES = \
+ export_ac3.la \
+ export_divx5.la \
+ $(EXPORT_DV) \
+ $(EXPORT_DVRAW) \
+ $(EXPORT_FFMPEG) \
+ $(EXPORT_IM) \
+ $(EXPORT_JPG) \
+ export_lame.la \
+ $(EXPORT_LZO) \
+ $(EXPORT_MOV) \
+ export_mp2.la \
+ $(EXPORT_MP2ENC) \
+ $(EXPORT_MPEG2ENC) \
+ export_null.la \
+ export_ogg.la \
+ export_pcm.la \
+ export_ppm.la \
+ $(EXPORT_PVM) \
+ export_pvn.la \
+ export_raw.la \
+ export_tcaud.la \
+ export_toolame.la \
+ export_wav.la \
+ export_xvid4.la \
+ $(EXPORT_YUV4MPEG)
+
+export_ac3_la_SOURCES = export_ac3.c
+export_ac3_la_LDFLAGS = -module -avoid-version
+export_divx5_la_SOURCES = export_divx5.c aud_aux.c divx4_vbr.c
+export_divx5_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBAVCODEC_CFLAGS) $(LAME_CFLAGS)
+export_divx5_la_LDFLAGS = -module -avoid-version
+export_divx5_la_LIBADD = $(LIBAVCODEC_LIBS) $(LAME_LIBS)
+export_dv_la_SOURCES = export_dv.c aud_aux.c
+export_dv_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBDV_CFLAGS) $(LIBAVCODEC_CFLAGS) $(LAME_CFLAGS)
+export_dv_la_LDFLAGS = -module -avoid-version
+export_dv_la_LIBADD = $(LIBDV_LIBS) $(LIBAVCODEC_LIBS) $(LAME_LIBS)
+export_dvraw_la_SOURCES = export_dvraw.c
+export_dvraw_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBDV_CFLAGS)
+export_dvraw_la_LDFLAGS = -module -avoid-version
+export_dvraw_la_LIBADD = $(LIBDV_LIBS) -lm
+export_ffmpeg_la_SOURCES = export_ffmpeg.c aud_aux.c ffmpeg_cfg.c
+export_ffmpeg_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBAVCODEC_CFLAGS) $(LAME_CFLAGS)
+export_ffmpeg_la_LDFLAGS = -module -avoid-version
+export_ffmpeg_la_LIBADD = $(LIBAVCODEC_LIBS) $(LAME_LIBS)
+export_im_la_SOURCES = export_im.c
+export_im_la_CPPFLAGS = $(AM_CPPFLAGS) $(IMAGEMAGICK_CFLAGS)
+export_im_la_LDFLAGS = -module -avoid-version
+export_im_la_LIBADD = $(IMAGEMAGICK_LIBS) -lm
+export_jpg_la_SOURCES = export_jpg.c
+export_jpg_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBJPEG_CFLAGS)
+export_jpg_la_LDFLAGS = -module -avoid-version
+export_jpg_la_LIBADD = $(LIBJPEG_LIBS) -lm
+export_lame_la_SOURCES = export_lame.c
+export_lame_la_LDFLAGS = -module -avoid-version
+export_lzo_la_SOURCES = export_lzo.c aud_aux.c
+export_lzo_la_CPPFLAGS = $(AM_CPPFLAGS) $(LZO_CFLAGS) $(LIBAVCODEC_CFLAGS) $(LAME_CFLAGS)
+export_lzo_la_LDFLAGS = -module -avoid-version
+export_lzo_la_LIBADD = $(LZO_LIBS) $(LIBAVCODEC_LIBS) $(LAME_LIBS)
+export_mov_la_SOURCES = export_mov.c
+export_mov_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBQUICKTIME_CFLAGS)
+export_mov_la_LDFLAGS = -module -avoid-version
+export_mov_la_LIBADD = $(LIBQUICKTIME_LIBS) -lm
+export_mp2_la_SOURCES = export_mp2.c
+export_mp2_la_LDFLAGS = -module -avoid-version
+export_mp2enc_la_SOURCES = export_mp2enc.c
+export_mp2enc_la_CPPFLAGS = $(AM_CPPFLAGS) $(MJPEGTOOLS_CFLAGS)
+export_mp2enc_la_LDFLAGS = -module -avoid-version
+export_mp2enc_la_LIBADD = -lm
+export_mpeg2enc_la_SOURCES = export_mpeg2enc.c
+export_mpeg2enc_la_CPPFLAGS = $(AM_CPPFLAGS) $(MJPEGTOOLS_CFLAGS)
+export_mpeg2enc_la_LDFLAGS = -module -avoid-version
+export_mpeg2enc_la_LIBADD = $(MJPEGTOOLS_LIBS) -lm
+export_null_la_SOURCES = export_null.c
+export_null_la_LDFLAGS = -module -avoid-version
+export_ogg_la_SOURCES = export_ogg.c
+export_ogg_la_LDFLAGS = -module -avoid-version
+export_pcm_la_SOURCES = export_pcm.c
+export_pcm_la_LDFLAGS = -module -avoid-version
+export_ppm_la_SOURCES = export_ppm.c aud_aux.c
+export_ppm_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBAVCODEC_CFLAGS) $(LAME_CFLAGS)
+export_ppm_la_LDFLAGS = -module -avoid-version
+export_ppm_la_LIBADD = $(LIBAVCODEC_LIBS) $(LAME_LIBS)
+export_pvm_la_SOURCES = export_pvm.c ../pvm3/pvm_interface.c ../pvm3/pvm_parser.c ../pvm3/external_codec.c ../pvm3/vob_pack_unpack.c
+export_pvm_la_CPPFLAGS = $(AM_CPPFLAGS) $(PVM3_CFLAGS)
+export_pvm_la_LDFLAGS = -module -avoid-version
+export_pvn_la_SOURCES = export_pvn.c
+export_pvn_la_LDFLAGS = -module -avoid-version
+export_raw_la_SOURCES = export_raw.c aud_aux.c
+export_raw_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBAVCODEC_CFLAGS) $(LAME_CFLAGS)
+export_raw_la_LDFLAGS = -module -avoid-version
+export_raw_la_LIBADD = $(LIBAVCODEC_LIBS) $(LAME_LIBS)
+export_tcaud_la_SOURCES = export_tcaud.c aud_aux.c
+export_tcaud_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBAVCODEC_CFLAGS) $(LAME_CFLAGS)
+export_tcaud_la_LDFLAGS = -module -avoid-version
+export_tcaud_la_LIBADD = $(LIBAVCODEC_LIBS) $(LAME_LIBS)
+export_toolame_la_SOURCES = export_toolame.c
+export_toolame_la_LDFLAGS = -module -avoid-version
+export_wav_la_SOURCES = export_wav.c
+export_wav_la_LDFLAGS = -module -avoid-version
+export_wav_la_LIBADD = -lm
+export_xvid4_la_SOURCES = export_xvid4.c aud_aux.c
+export_xvid4_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBAVCODEC_CFLAGS) $(LAME_CFLAGS)
+export_xvid4_la_LDFLAGS = -module -avoid-version
+export_xvid4_la_LIBADD = $(LIBAVCODEC_LIBS) $(LAME_LIBS)
+export_yuv4mpeg_la_SOURCES = export_yuv4mpeg.c aud_aux.c
+export_yuv4mpeg_la_CPPFLAGS = $(AM_CPPFLAGS) $(MJPEGTOOLS_CFLAGS) $(LIBAVCODEC_CFLAGS) $(LAME_CFLAGS)
+export_yuv4mpeg_la_LDFLAGS = -module -avoid-version
+export_yuv4mpeg_la_LIBADD = $(MJPEGTOOLS_LIBS) $(LIBAVCODEC_LIBS) $(LAME_LIBS)
+EXTRA_DIST = \
+ aud_aux.h \
+ divx5_encore2.h \
+ export_def.h \
+ ffmpeg_cfg.h \
+ vbr.h \
+ xvid4.h \
+ xvid4.cfg
+
+@ENABLE_EXPERIMENTAL_TRUE@PROFILES = \
+@ENABLE_EXPERIMENTAL_TRUE@ dvd-pal.cfg \
+@ENABLE_EXPERIMENTAL_TRUE@ dvd-ntsc.cfg \
+@ENABLE_EXPERIMENTAL_TRUE@ vcd-pal.cfg \
+@ENABLE_EXPERIMENTAL_TRUE@ vcd-ntsc.cfg \
+@ENABLE_EXPERIMENTAL_TRUE@ svcd-pal.cfg \
+@ENABLE_EXPERIMENTAL_TRUE@ svcd-ntsc.cfg \
+@ENABLE_EXPERIMENTAL_TRUE@ xvcd-pal.cfg \
+@ENABLE_EXPERIMENTAL_TRUE@ xvcd-ntsc.cfg
+
+pkg_DATA = xvid4.cfg $(PROFILES)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu export/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu export/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkgLTLIBRARIES: $(pkg_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(pkgdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdir)"
+ @list='$(pkg_LTLIBRARIES)'; test -n "$(pkgdir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkgdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkgdir)"; \
+ }
+
+uninstall-pkgLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkg_LTLIBRARIES)'; test -n "$(pkgdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkgdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkgdir)/$$f"; \
+ done
+
+clean-pkgLTLIBRARIES:
+ -test -z "$(pkg_LTLIBRARIES)" || rm -f $(pkg_LTLIBRARIES)
+ @list='$(pkg_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+export_ac3.la: $(export_ac3_la_OBJECTS) $(export_ac3_la_DEPENDENCIES)
+ $(export_ac3_la_LINK) -rpath $(pkgdir) $(export_ac3_la_OBJECTS) $(export_ac3_la_LIBADD) $(LIBS)
+export_divx5.la: $(export_divx5_la_OBJECTS) $(export_divx5_la_DEPENDENCIES)
+ $(export_divx5_la_LINK) -rpath $(pkgdir) $(export_divx5_la_OBJECTS) $(export_divx5_la_LIBADD) $(LIBS)
+export_dv.la: $(export_dv_la_OBJECTS) $(export_dv_la_DEPENDENCIES)
+ $(export_dv_la_LINK) $(am_export_dv_la_rpath) $(export_dv_la_OBJECTS) $(export_dv_la_LIBADD) $(LIBS)
+export_dvraw.la: $(export_dvraw_la_OBJECTS) $(export_dvraw_la_DEPENDENCIES)
+ $(export_dvraw_la_LINK) $(am_export_dvraw_la_rpath) $(export_dvraw_la_OBJECTS) $(export_dvraw_la_LIBADD) $(LIBS)
+export_ffmpeg.la: $(export_ffmpeg_la_OBJECTS) $(export_ffmpeg_la_DEPENDENCIES)
+ $(export_ffmpeg_la_LINK) $(am_export_ffmpeg_la_rpath) $(export_ffmpeg_la_OBJECTS) $(export_ffmpeg_la_LIBADD) $(LIBS)
+export_im.la: $(export_im_la_OBJECTS) $(export_im_la_DEPENDENCIES)
+ $(export_im_la_LINK) $(am_export_im_la_rpath) $(export_im_la_OBJECTS) $(export_im_la_LIBADD) $(LIBS)
+export_jpg.la: $(export_jpg_la_OBJECTS) $(export_jpg_la_DEPENDENCIES)
+ $(export_jpg_la_LINK) $(am_export_jpg_la_rpath) $(export_jpg_la_OBJECTS) $(export_jpg_la_LIBADD) $(LIBS)
+export_lame.la: $(export_lame_la_OBJECTS) $(export_lame_la_DEPENDENCIES)
+ $(export_lame_la_LINK) -rpath $(pkgdir) $(export_lame_la_OBJECTS) $(export_lame_la_LIBADD) $(LIBS)
+export_lzo.la: $(export_lzo_la_OBJECTS) $(export_lzo_la_DEPENDENCIES)
+ $(export_lzo_la_LINK) $(am_export_lzo_la_rpath) $(export_lzo_la_OBJECTS) $(export_lzo_la_LIBADD) $(LIBS)
+export_mov.la: $(export_mov_la_OBJECTS) $(export_mov_la_DEPENDENCIES)
+ $(export_mov_la_LINK) $(am_export_mov_la_rpath) $(export_mov_la_OBJECTS) $(export_mov_la_LIBADD) $(LIBS)
+export_mp2.la: $(export_mp2_la_OBJECTS) $(export_mp2_la_DEPENDENCIES)
+ $(export_mp2_la_LINK) -rpath $(pkgdir) $(export_mp2_la_OBJECTS) $(export_mp2_la_LIBADD) $(LIBS)
+export_mp2enc.la: $(export_mp2enc_la_OBJECTS) $(export_mp2enc_la_DEPENDENCIES)
+ $(export_mp2enc_la_LINK) $(am_export_mp2enc_la_rpath) $(export_mp2enc_la_OBJECTS) $(export_mp2enc_la_LIBADD) $(LIBS)
+export_mpeg2enc.la: $(export_mpeg2enc_la_OBJECTS) $(export_mpeg2enc_la_DEPENDENCIES)
+ $(export_mpeg2enc_la_LINK) $(am_export_mpeg2enc_la_rpath) $(export_mpeg2enc_la_OBJECTS) $(export_mpeg2enc_la_LIBADD) $(LIBS)
+export_null.la: $(export_null_la_OBJECTS) $(export_null_la_DEPENDENCIES)
+ $(export_null_la_LINK) -rpath $(pkgdir) $(export_null_la_OBJECTS) $(export_null_la_LIBADD) $(LIBS)
+export_ogg.la: $(export_ogg_la_OBJECTS) $(export_ogg_la_DEPENDENCIES)
+ $(export_ogg_la_LINK) -rpath $(pkgdir) $(export_ogg_la_OBJECTS) $(export_ogg_la_LIBADD) $(LIBS)
+export_pcm.la: $(export_pcm_la_OBJECTS) $(export_pcm_la_DEPENDENCIES)
+ $(export_pcm_la_LINK) -rpath $(pkgdir) $(export_pcm_la_OBJECTS) $(export_pcm_la_LIBADD) $(LIBS)
+export_ppm.la: $(export_ppm_la_OBJECTS) $(export_ppm_la_DEPENDENCIES)
+ $(export_ppm_la_LINK) -rpath $(pkgdir) $(export_ppm_la_OBJECTS) $(export_ppm_la_LIBADD) $(LIBS)
+export_pvm.la: $(export_pvm_la_OBJECTS) $(export_pvm_la_DEPENDENCIES)
+ $(export_pvm_la_LINK) $(am_export_pvm_la_rpath) $(export_pvm_la_OBJECTS) $(export_pvm_la_LIBADD) $(LIBS)
+export_pvn.la: $(export_pvn_la_OBJECTS) $(export_pvn_la_DEPENDENCIES)
+ $(export_pvn_la_LINK) -rpath $(pkgdir) $(export_pvn_la_OBJECTS) $(export_pvn_la_LIBADD) $(LIBS)
+export_raw.la: $(export_raw_la_OBJECTS) $(export_raw_la_DEPENDENCIES)
+ $(export_raw_la_LINK) -rpath $(pkgdir) $(export_raw_la_OBJECTS) $(export_raw_la_LIBADD) $(LIBS)
+export_tcaud.la: $(export_tcaud_la_OBJECTS) $(export_tcaud_la_DEPENDENCIES)
+ $(export_tcaud_la_LINK) -rpath $(pkgdir) $(export_tcaud_la_OBJECTS) $(export_tcaud_la_LIBADD) $(LIBS)
+export_toolame.la: $(export_toolame_la_OBJECTS) $(export_toolame_la_DEPENDENCIES)
+ $(export_toolame_la_LINK) -rpath $(pkgdir) $(export_toolame_la_OBJECTS) $(export_toolame_la_LIBADD) $(LIBS)
+export_wav.la: $(export_wav_la_OBJECTS) $(export_wav_la_DEPENDENCIES)
+ $(export_wav_la_LINK) -rpath $(pkgdir) $(export_wav_la_OBJECTS) $(export_wav_la_LIBADD) $(LIBS)
+export_xvid4.la: $(export_xvid4_la_OBJECTS) $(export_xvid4_la_DEPENDENCIES)
+ $(export_xvid4_la_LINK) -rpath $(pkgdir) $(export_xvid4_la_OBJECTS) $(export_xvid4_la_LIBADD) $(LIBS)
+export_yuv4mpeg.la: $(export_yuv4mpeg_la_OBJECTS) $(export_yuv4mpeg_la_DEPENDENCIES)
+ $(export_yuv4mpeg_la_LINK) $(am_export_yuv4mpeg_la_rpath) $(export_yuv4mpeg_la_OBJECTS) $(export_yuv4mpeg_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_ac3.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_divx5_la-aud_aux.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_divx5_la-divx4_vbr.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_divx5_la-export_divx5.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_dv_la-aud_aux.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_dv_la-export_dv.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_dvraw_la-export_dvraw.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_ffmpeg_la-aud_aux.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_ffmpeg_la-export_ffmpeg.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_ffmpeg_la-ffmpeg_cfg.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_im_la-export_im.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_jpg_la-export_jpg.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_lame.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_lzo_la-aud_aux.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_lzo_la-export_lzo.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_mov_la-export_mov.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_mp2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_mp2enc_la-export_mp2enc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_mpeg2enc_la-export_mpeg2enc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_null.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_ogg.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_pcm.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_ppm_la-aud_aux.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_ppm_la-export_ppm.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_pvm_la-export_pvm.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_pvm_la-external_codec.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_pvm_la-pvm_interface.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_pvm_la-pvm_parser.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_pvm_la-vob_pack_unpack.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_pvn.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_raw_la-aud_aux.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_raw_la-export_raw.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_tcaud_la-aud_aux.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_tcaud_la-export_tcaud.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_toolame.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_wav.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_xvid4_la-aud_aux.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_xvid4_la-export_xvid4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_yuv4mpeg_la-aud_aux.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_yuv4mpeg_la-export_yuv4mpeg.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+export_divx5_la-export_divx5.lo: export_divx5.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_divx5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_divx5_la-export_divx5.lo -MD -MP -MF $(DEPDIR)/export_divx5_la-export_divx5.Tpo -c -o export_divx5_la-export_divx5.lo `test -f 'export_divx5.c' || echo '$(srcdir)/'`export_divx5.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_divx5_la-export_divx5.Tpo $(DEPDIR)/export_divx5_la-export_divx5.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='export_divx5.c' object='export_divx5_la-export_divx5.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_divx5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_divx5_la-export_divx5.lo `test -f 'export_divx5.c' || echo '$(srcdir)/'`export_divx5.c
+
+export_divx5_la-aud_aux.lo: aud_aux.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_divx5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_divx5_la-aud_aux.lo -MD -MP -MF $(DEPDIR)/export_divx5_la-aud_aux.Tpo -c -o export_divx5_la-aud_aux.lo `test -f 'aud_aux.c' || echo '$(srcdir)/'`aud_aux.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_divx5_la-aud_aux.Tpo $(DEPDIR)/export_divx5_la-aud_aux.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='aud_aux.c' object='export_divx5_la-aud_aux.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_divx5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_divx5_la-aud_aux.lo `test -f 'aud_aux.c' || echo '$(srcdir)/'`aud_aux.c
+
+export_divx5_la-divx4_vbr.lo: divx4_vbr.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_divx5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_divx5_la-divx4_vbr.lo -MD -MP -MF $(DEPDIR)/export_divx5_la-divx4_vbr.Tpo -c -o export_divx5_la-divx4_vbr.lo `test -f 'divx4_vbr.c' || echo '$(srcdir)/'`divx4_vbr.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_divx5_la-divx4_vbr.Tpo $(DEPDIR)/export_divx5_la-divx4_vbr.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='divx4_vbr.c' object='export_divx5_la-divx4_vbr.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_divx5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_divx5_la-divx4_vbr.lo `test -f 'divx4_vbr.c' || echo '$(srcdir)/'`divx4_vbr.c
+
+export_dv_la-export_dv.lo: export_dv.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_dv_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_dv_la-export_dv.lo -MD -MP -MF $(DEPDIR)/export_dv_la-export_dv.Tpo -c -o export_dv_la-export_dv.lo `test -f 'export_dv.c' || echo '$(srcdir)/'`export_dv.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_dv_la-export_dv.Tpo $(DEPDIR)/export_dv_la-export_dv.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='export_dv.c' object='export_dv_la-export_dv.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_dv_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_dv_la-export_dv.lo `test -f 'export_dv.c' || echo '$(srcdir)/'`export_dv.c
+
+export_dv_la-aud_aux.lo: aud_aux.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_dv_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_dv_la-aud_aux.lo -MD -MP -MF $(DEPDIR)/export_dv_la-aud_aux.Tpo -c -o export_dv_la-aud_aux.lo `test -f 'aud_aux.c' || echo '$(srcdir)/'`aud_aux.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_dv_la-aud_aux.Tpo $(DEPDIR)/export_dv_la-aud_aux.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='aud_aux.c' object='export_dv_la-aud_aux.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_dv_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_dv_la-aud_aux.lo `test -f 'aud_aux.c' || echo '$(srcdir)/'`aud_aux.c
+
+export_dvraw_la-export_dvraw.lo: export_dvraw.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_dvraw_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_dvraw_la-export_dvraw.lo -MD -MP -MF $(DEPDIR)/export_dvraw_la-export_dvraw.Tpo -c -o export_dvraw_la-export_dvraw.lo `test -f 'export_dvraw.c' || echo '$(srcdir)/'`export_dvraw.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_dvraw_la-export_dvraw.Tpo $(DEPDIR)/export_dvraw_la-export_dvraw.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='export_dvraw.c' object='export_dvraw_la-export_dvraw.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_dvraw_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_dvraw_la-export_dvraw.lo `test -f 'export_dvraw.c' || echo '$(srcdir)/'`export_dvraw.c
+
+export_ffmpeg_la-export_ffmpeg.lo: export_ffmpeg.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_ffmpeg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_ffmpeg_la-export_ffmpeg.lo -MD -MP -MF $(DEPDIR)/export_ffmpeg_la-export_ffmpeg.Tpo -c -o export_ffmpeg_la-export_ffmpeg.lo `test -f 'export_ffmpeg.c' || echo '$(srcdir)/'`export_ffmpeg.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_ffmpeg_la-export_ffmpeg.Tpo $(DEPDIR)/export_ffmpeg_la-export_ffmpeg.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='export_ffmpeg.c' object='export_ffmpeg_la-export_ffmpeg.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_ffmpeg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_ffmpeg_la-export_ffmpeg.lo `test -f 'export_ffmpeg.c' || echo '$(srcdir)/'`export_ffmpeg.c
+
+export_ffmpeg_la-aud_aux.lo: aud_aux.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_ffmpeg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_ffmpeg_la-aud_aux.lo -MD -MP -MF $(DEPDIR)/export_ffmpeg_la-aud_aux.Tpo -c -o export_ffmpeg_la-aud_aux.lo `test -f 'aud_aux.c' || echo '$(srcdir)/'`aud_aux.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_ffmpeg_la-aud_aux.Tpo $(DEPDIR)/export_ffmpeg_la-aud_aux.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='aud_aux.c' object='export_ffmpeg_la-aud_aux.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_ffmpeg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_ffmpeg_la-aud_aux.lo `test -f 'aud_aux.c' || echo '$(srcdir)/'`aud_aux.c
+
+export_ffmpeg_la-ffmpeg_cfg.lo: ffmpeg_cfg.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_ffmpeg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_ffmpeg_la-ffmpeg_cfg.lo -MD -MP -MF $(DEPDIR)/export_ffmpeg_la-ffmpeg_cfg.Tpo -c -o export_ffmpeg_la-ffmpeg_cfg.lo `test -f 'ffmpeg_cfg.c' || echo '$(srcdir)/'`ffmpeg_cfg.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_ffmpeg_la-ffmpeg_cfg.Tpo $(DEPDIR)/export_ffmpeg_la-ffmpeg_cfg.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ffmpeg_cfg.c' object='export_ffmpeg_la-ffmpeg_cfg.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_ffmpeg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_ffmpeg_la-ffmpeg_cfg.lo `test -f 'ffmpeg_cfg.c' || echo '$(srcdir)/'`ffmpeg_cfg.c
+
+export_im_la-export_im.lo: export_im.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_im_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_im_la-export_im.lo -MD -MP -MF $(DEPDIR)/export_im_la-export_im.Tpo -c -o export_im_la-export_im.lo `test -f 'export_im.c' || echo '$(srcdir)/'`export_im.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_im_la-export_im.Tpo $(DEPDIR)/export_im_la-export_im.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='export_im.c' object='export_im_la-export_im.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_im_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_im_la-export_im.lo `test -f 'export_im.c' || echo '$(srcdir)/'`export_im.c
+
+export_jpg_la-export_jpg.lo: export_jpg.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_jpg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_jpg_la-export_jpg.lo -MD -MP -MF $(DEPDIR)/export_jpg_la-export_jpg.Tpo -c -o export_jpg_la-export_jpg.lo `test -f 'export_jpg.c' || echo '$(srcdir)/'`export_jpg.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_jpg_la-export_jpg.Tpo $(DEPDIR)/export_jpg_la-export_jpg.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='export_jpg.c' object='export_jpg_la-export_jpg.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_jpg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_jpg_la-export_jpg.lo `test -f 'export_jpg.c' || echo '$(srcdir)/'`export_jpg.c
+
+export_lzo_la-export_lzo.lo: export_lzo.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_lzo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_lzo_la-export_lzo.lo -MD -MP -MF $(DEPDIR)/export_lzo_la-export_lzo.Tpo -c -o export_lzo_la-export_lzo.lo `test -f 'export_lzo.c' || echo '$(srcdir)/'`export_lzo.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_lzo_la-export_lzo.Tpo $(DEPDIR)/export_lzo_la-export_lzo.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='export_lzo.c' object='export_lzo_la-export_lzo.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_lzo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_lzo_la-export_lzo.lo `test -f 'export_lzo.c' || echo '$(srcdir)/'`export_lzo.c
+
+export_lzo_la-aud_aux.lo: aud_aux.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_lzo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_lzo_la-aud_aux.lo -MD -MP -MF $(DEPDIR)/export_lzo_la-aud_aux.Tpo -c -o export_lzo_la-aud_aux.lo `test -f 'aud_aux.c' || echo '$(srcdir)/'`aud_aux.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_lzo_la-aud_aux.Tpo $(DEPDIR)/export_lzo_la-aud_aux.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='aud_aux.c' object='export_lzo_la-aud_aux.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_lzo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_lzo_la-aud_aux.lo `test -f 'aud_aux.c' || echo '$(srcdir)/'`aud_aux.c
+
+export_mov_la-export_mov.lo: export_mov.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_mov_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_mov_la-export_mov.lo -MD -MP -MF $(DEPDIR)/export_mov_la-export_mov.Tpo -c -o export_mov_la-export_mov.lo `test -f 'export_mov.c' || echo '$(srcdir)/'`export_mov.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_mov_la-export_mov.Tpo $(DEPDIR)/export_mov_la-export_mov.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='export_mov.c' object='export_mov_la-export_mov.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_mov_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_mov_la-export_mov.lo `test -f 'export_mov.c' || echo '$(srcdir)/'`export_mov.c
+
+export_mp2enc_la-export_mp2enc.lo: export_mp2enc.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_mp2enc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_mp2enc_la-export_mp2enc.lo -MD -MP -MF $(DEPDIR)/export_mp2enc_la-export_mp2enc.Tpo -c -o export_mp2enc_la-export_mp2enc.lo `test -f 'export_mp2enc.c' || echo '$(srcdir)/'`export_mp2enc.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_mp2enc_la-export_mp2enc.Tpo $(DEPDIR)/export_mp2enc_la-export_mp2enc.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='export_mp2enc.c' object='export_mp2enc_la-export_mp2enc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_mp2enc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_mp2enc_la-export_mp2enc.lo `test -f 'export_mp2enc.c' || echo '$(srcdir)/'`export_mp2enc.c
+
+export_mpeg2enc_la-export_mpeg2enc.lo: export_mpeg2enc.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_mpeg2enc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_mpeg2enc_la-export_mpeg2enc.lo -MD -MP -MF $(DEPDIR)/export_mpeg2enc_la-export_mpeg2enc.Tpo -c -o export_mpeg2enc_la-export_mpeg2enc.lo `test -f 'export_mpeg2enc.c' || echo '$(srcdir)/'`export_mpeg2enc.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_mpeg2enc_la-export_mpeg2enc.Tpo $(DEPDIR)/export_mpeg2enc_la-export_mpeg2enc.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='export_mpeg2enc.c' object='export_mpeg2enc_la-export_mpeg2enc.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_mpeg2enc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_mpeg2enc_la-export_mpeg2enc.lo `test -f 'export_mpeg2enc.c' || echo '$(srcdir)/'`export_mpeg2enc.c
+
+export_ppm_la-export_ppm.lo: export_ppm.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_ppm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_ppm_la-export_ppm.lo -MD -MP -MF $(DEPDIR)/export_ppm_la-export_ppm.Tpo -c -o export_ppm_la-export_ppm.lo `test -f 'export_ppm.c' || echo '$(srcdir)/'`export_ppm.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_ppm_la-export_ppm.Tpo $(DEPDIR)/export_ppm_la-export_ppm.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='export_ppm.c' object='export_ppm_la-export_ppm.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_ppm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_ppm_la-export_ppm.lo `test -f 'export_ppm.c' || echo '$(srcdir)/'`export_ppm.c
+
+export_ppm_la-aud_aux.lo: aud_aux.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_ppm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_ppm_la-aud_aux.lo -MD -MP -MF $(DEPDIR)/export_ppm_la-aud_aux.Tpo -c -o export_ppm_la-aud_aux.lo `test -f 'aud_aux.c' || echo '$(srcdir)/'`aud_aux.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_ppm_la-aud_aux.Tpo $(DEPDIR)/export_ppm_la-aud_aux.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='aud_aux.c' object='export_ppm_la-aud_aux.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_ppm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_ppm_la-aud_aux.lo `test -f 'aud_aux.c' || echo '$(srcdir)/'`aud_aux.c
+
+export_pvm_la-export_pvm.lo: export_pvm.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_pvm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_pvm_la-export_pvm.lo -MD -MP -MF $(DEPDIR)/export_pvm_la-export_pvm.Tpo -c -o export_pvm_la-export_pvm.lo `test -f 'export_pvm.c' || echo '$(srcdir)/'`export_pvm.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_pvm_la-export_pvm.Tpo $(DEPDIR)/export_pvm_la-export_pvm.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='export_pvm.c' object='export_pvm_la-export_pvm.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_pvm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_pvm_la-export_pvm.lo `test -f 'export_pvm.c' || echo '$(srcdir)/'`export_pvm.c
+
+export_pvm_la-pvm_interface.lo: ../pvm3/pvm_interface.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_pvm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_pvm_la-pvm_interface.lo -MD -MP -MF $(DEPDIR)/export_pvm_la-pvm_interface.Tpo -c -o export_pvm_la-pvm_interface.lo `test -f '../pvm3/pvm_interface.c' || echo '$(srcdir)/'`../pvm3/pvm_interface.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_pvm_la-pvm_interface.Tpo $(DEPDIR)/export_pvm_la-pvm_interface.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../pvm3/pvm_interface.c' object='export_pvm_la-pvm_interface.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_pvm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_pvm_la-pvm_interface.lo `test -f '../pvm3/pvm_interface.c' || echo '$(srcdir)/'`../pvm3/pvm_interface.c
+
+export_pvm_la-pvm_parser.lo: ../pvm3/pvm_parser.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_pvm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_pvm_la-pvm_parser.lo -MD -MP -MF $(DEPDIR)/export_pvm_la-pvm_parser.Tpo -c -o export_pvm_la-pvm_parser.lo `test -f '../pvm3/pvm_parser.c' || echo '$(srcdir)/'`../pvm3/pvm_parser.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_pvm_la-pvm_parser.Tpo $(DEPDIR)/export_pvm_la-pvm_parser.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../pvm3/pvm_parser.c' object='export_pvm_la-pvm_parser.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_pvm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_pvm_la-pvm_parser.lo `test -f '../pvm3/pvm_parser.c' || echo '$(srcdir)/'`../pvm3/pvm_parser.c
+
+export_pvm_la-external_codec.lo: ../pvm3/external_codec.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_pvm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_pvm_la-external_codec.lo -MD -MP -MF $(DEPDIR)/export_pvm_la-external_codec.Tpo -c -o export_pvm_la-external_codec.lo `test -f '../pvm3/external_codec.c' || echo '$(srcdir)/'`../pvm3/external_codec.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_pvm_la-external_codec.Tpo $(DEPDIR)/export_pvm_la-external_codec.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../pvm3/external_codec.c' object='export_pvm_la-external_codec.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_pvm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_pvm_la-external_codec.lo `test -f '../pvm3/external_codec.c' || echo '$(srcdir)/'`../pvm3/external_codec.c
+
+export_pvm_la-vob_pack_unpack.lo: ../pvm3/vob_pack_unpack.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_pvm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_pvm_la-vob_pack_unpack.lo -MD -MP -MF $(DEPDIR)/export_pvm_la-vob_pack_unpack.Tpo -c -o export_pvm_la-vob_pack_unpack.lo `test -f '../pvm3/vob_pack_unpack.c' || echo '$(srcdir)/'`../pvm3/vob_pack_unpack.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_pvm_la-vob_pack_unpack.Tpo $(DEPDIR)/export_pvm_la-vob_pack_unpack.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../pvm3/vob_pack_unpack.c' object='export_pvm_la-vob_pack_unpack.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_pvm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_pvm_la-vob_pack_unpack.lo `test -f '../pvm3/vob_pack_unpack.c' || echo '$(srcdir)/'`../pvm3/vob_pack_unpack.c
+
+export_raw_la-export_raw.lo: export_raw.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_raw_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_raw_la-export_raw.lo -MD -MP -MF $(DEPDIR)/export_raw_la-export_raw.Tpo -c -o export_raw_la-export_raw.lo `test -f 'export_raw.c' || echo '$(srcdir)/'`export_raw.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_raw_la-export_raw.Tpo $(DEPDIR)/export_raw_la-export_raw.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='export_raw.c' object='export_raw_la-export_raw.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_raw_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_raw_la-export_raw.lo `test -f 'export_raw.c' || echo '$(srcdir)/'`export_raw.c
+
+export_raw_la-aud_aux.lo: aud_aux.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_raw_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_raw_la-aud_aux.lo -MD -MP -MF $(DEPDIR)/export_raw_la-aud_aux.Tpo -c -o export_raw_la-aud_aux.lo `test -f 'aud_aux.c' || echo '$(srcdir)/'`aud_aux.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_raw_la-aud_aux.Tpo $(DEPDIR)/export_raw_la-aud_aux.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='aud_aux.c' object='export_raw_la-aud_aux.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_raw_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_raw_la-aud_aux.lo `test -f 'aud_aux.c' || echo '$(srcdir)/'`aud_aux.c
+
+export_tcaud_la-export_tcaud.lo: export_tcaud.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_tcaud_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_tcaud_la-export_tcaud.lo -MD -MP -MF $(DEPDIR)/export_tcaud_la-export_tcaud.Tpo -c -o export_tcaud_la-export_tcaud.lo `test -f 'export_tcaud.c' || echo '$(srcdir)/'`export_tcaud.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_tcaud_la-export_tcaud.Tpo $(DEPDIR)/export_tcaud_la-export_tcaud.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='export_tcaud.c' object='export_tcaud_la-export_tcaud.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_tcaud_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_tcaud_la-export_tcaud.lo `test -f 'export_tcaud.c' || echo '$(srcdir)/'`export_tcaud.c
+
+export_tcaud_la-aud_aux.lo: aud_aux.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_tcaud_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_tcaud_la-aud_aux.lo -MD -MP -MF $(DEPDIR)/export_tcaud_la-aud_aux.Tpo -c -o export_tcaud_la-aud_aux.lo `test -f 'aud_aux.c' || echo '$(srcdir)/'`aud_aux.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_tcaud_la-aud_aux.Tpo $(DEPDIR)/export_tcaud_la-aud_aux.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='aud_aux.c' object='export_tcaud_la-aud_aux.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_tcaud_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_tcaud_la-aud_aux.lo `test -f 'aud_aux.c' || echo '$(srcdir)/'`aud_aux.c
+
+export_xvid4_la-export_xvid4.lo: export_xvid4.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_xvid4_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_xvid4_la-export_xvid4.lo -MD -MP -MF $(DEPDIR)/export_xvid4_la-export_xvid4.Tpo -c -o export_xvid4_la-export_xvid4.lo `test -f 'export_xvid4.c' || echo '$(srcdir)/'`export_xvid4.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_xvid4_la-export_xvid4.Tpo $(DEPDIR)/export_xvid4_la-export_xvid4.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='export_xvid4.c' object='export_xvid4_la-export_xvid4.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_xvid4_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_xvid4_la-export_xvid4.lo `test -f 'export_xvid4.c' || echo '$(srcdir)/'`export_xvid4.c
+
+export_xvid4_la-aud_aux.lo: aud_aux.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_xvid4_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_xvid4_la-aud_aux.lo -MD -MP -MF $(DEPDIR)/export_xvid4_la-aud_aux.Tpo -c -o export_xvid4_la-aud_aux.lo `test -f 'aud_aux.c' || echo '$(srcdir)/'`aud_aux.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_xvid4_la-aud_aux.Tpo $(DEPDIR)/export_xvid4_la-aud_aux.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='aud_aux.c' object='export_xvid4_la-aud_aux.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_xvid4_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_xvid4_la-aud_aux.lo `test -f 'aud_aux.c' || echo '$(srcdir)/'`aud_aux.c
+
+export_yuv4mpeg_la-export_yuv4mpeg.lo: export_yuv4mpeg.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_yuv4mpeg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_yuv4mpeg_la-export_yuv4mpeg.lo -MD -MP -MF $(DEPDIR)/export_yuv4mpeg_la-export_yuv4mpeg.Tpo -c -o export_yuv4mpeg_la-export_yuv4mpeg.lo `test -f 'export_yuv4mpeg.c' || echo '$(srcdir)/'`export_yuv4mpeg.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_yuv4mpeg_la-export_yuv4mpeg.Tpo $(DEPDIR)/export_yuv4mpeg_la-export_yuv4mpeg.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='export_yuv4mpeg.c' object='export_yuv4mpeg_la-export_yuv4mpeg.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_yuv4mpeg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_yuv4mpeg_la-export_yuv4mpeg.lo `test -f 'export_yuv4mpeg.c' || echo '$(srcdir)/'`export_yuv4mpeg.c
+
+export_yuv4mpeg_la-aud_aux.lo: aud_aux.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_yuv4mpeg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT export_yuv4mpeg_la-aud_aux.lo -MD -MP -MF $(DEPDIR)/export_yuv4mpeg_la-aud_aux.Tpo -c -o export_yuv4mpeg_la-aud_aux.lo `test -f 'aud_aux.c' || echo '$(srcdir)/'`aud_aux.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/export_yuv4mpeg_la-aud_aux.Tpo $(DEPDIR)/export_yuv4mpeg_la-aud_aux.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='aud_aux.c' object='export_yuv4mpeg_la-aud_aux.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(export_yuv4mpeg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o export_yuv4mpeg_la-aud_aux.lo `test -f 'aud_aux.c' || echo '$(srcdir)/'`aud_aux.c
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-pkgDATA: $(pkg_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(pkgdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdir)"
+ @list='$(pkg_DATA)'; test -n "$(pkgdir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdir)" || exit $$?; \
+ done
+
+uninstall-pkgDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkg_DATA)'; test -n "$(pkgdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(pkgdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(pkgdir)" && rm -f $$files
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(pkgdir)" "$(DESTDIR)$(pkgdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkgLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-pkgDATA install-pkgLTLIBRARIES
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkgDATA uninstall-pkgLTLIBRARIES
+
+.MAKE: install-am install-exec-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-pkgLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-exec-hook \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-pkgDATA \
+ install-pkgLTLIBRARIES install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-pkgDATA \
+ uninstall-pkgLTLIBRARIES
+
+
+@ENABLE_EXPERIMENTAL_TRUE@install-exec-hook:
+@ENABLE_EXPERIMENTAL_TRUE@ @mkdir -p $(DESTDIR)$(MOD_PATH)
+@ENABLE_EXPERIMENTAL_TRUE@ @rm -f $(DESTDIR)$(MOD_PATH)/export_xvid.so
+@ENABLE_EXPERIMENTAL_TRUE@ @$(LN_S) export_xvid4.so $(DESTDIR)$(MOD_PATH)/export_xvid.so
+@ENABLE_EXPERIMENTAL_TRUE@ @mkdir -p $(DESTDIR)$(PROF_PATH)
+@ENABLE_EXPERIMENTAL_TRUE@ @cp $(PROFILES) $(DESTDIR)$(PROF_PATH)
+@ENABLE_EXPERIMENTAL_FALSE@install-exec-hook:
+@ENABLE_EXPERIMENTAL_FALSE@ @mkdir -p $(DESTDIR)$(MOD_PATH)
+@ENABLE_EXPERIMENTAL_FALSE@ @rm -f $(DESTDIR)$(MOD_PATH)/export_xvid.so
+@ENABLE_EXPERIMENTAL_FALSE@ @$(LN_S) export_xvid4.so $(DESTDIR)$(MOD_PATH)/export_xvid.so
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/debian/transcode/transcode-1.1.7/export/aud_aux.c b/debian/transcode/transcode-1.1.7/export/aud_aux.c
new file mode 100644
index 00000000..8ca4421c
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/aud_aux.c
@@ -0,0 +1,1215 @@
+/*
+ * aud_aux.c
+ *
+ * Copyright (C) Thomas Oestreich - June 2001
+ * Copyright (C) Nicolas LAURENT - August 2003
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include "transcode.h"
+#include "aud_aux.h"
+
+#include "libtc/libtc.h"
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <assert.h>
+
+#ifdef HAVE_LAME
+#ifdef HAVE_LAME_INC
+#include <lame/lame.h>
+#else
+#include <lame.h>
+#endif
+#endif
+
+#ifdef HAVE_FFMPEG
+#include "libtc/tcavcodec.h"
+
+
+static AVCodec *mpa_codec = NULL;
+static AVCodecContext mpa_ctx;
+static char *mpa_buf = NULL;
+static int mpa_buf_ptr = 0;
+static int mpa_bytes_ps, mpa_bytes_pf;
+
+#endif
+
+/*
+ * Capabilities:
+ *
+ * +-------------------------------+
+ * | Output |
+ * +-------------------------------+
+ * | PCM | MP2 | MP3 | AC3 |
+ * +---+-------+-------+-------+-------+-------+
+ * | I | PCM | X | X | X | X |
+ * | n +-------+-------+-------+-------+-------+
+ * | p | MP2 | | X | | |
+ * | u +-------+-------+-------+-------+-------+
+ * | t | MP3 | | | X | |
+ * | +-------+-------+-------+-------+-------+
+ * | | AC3 | | | | X |
+ * +---+---------------------------------------+
+ *
+ */
+
+
+/*-----------------------------------------------------------------------------
+ G L O B A L V A R I A B L E S
+-----------------------------------------------------------------------------*/
+
+#define MP3_CHUNK_SZ (2*1152)
+
+static int verbose_flag=TC_DEBUG;
+#define IS_AUDIO_MONO (avi_aud_chan == 1)
+#ifdef HAVE_LAME
+#define IS_VBR (lame_get_VBR(lgf) != vbr_off)
+#endif
+
+/* Output buffer */
+#define OUTPUT_SIZE SIZE_PCM_FRAME
+static char *output = NULL;
+#ifdef HAVE_LAME
+static int output_len = 0;
+#endif
+
+/* Input buffer */
+#define INPUT_SIZE SIZE_PCM_FRAME
+static char *input = NULL;
+#ifdef HAVE_LAME
+static int input_len = 0;
+#endif
+
+/* encoder */
+static int (*tc_audio_encode_function)(char *, int, avi_t *)=NULL;
+#ifdef HAVE_LAME
+static lame_global_flags *lgf;
+#endif
+static int lame_flush=0;
+static int bitrate=0;
+
+/* output stream */
+static avi_t *avifile2=NULL;
+static FILE *fd=NULL;
+static int is_pipe = 0;
+
+// AVI file information for subsequent calls of open routine:
+static int avi_aud_codec, avi_aud_bitrate;
+static long avi_aud_rate;
+static int avi_aud_chan, avi_aud_bits;
+
+/*-----------------------------------------------------------------------------
+ P R O T O T Y P E S
+-----------------------------------------------------------------------------*/
+
+static int tc_audio_init_ffmpeg(vob_t *vob, int o_codec);
+static int tc_audio_init_lame(vob_t *vob, int o_codec);
+static int tc_audio_init_raw(vob_t *vob);
+static int tc_audio_write(char *buffer, size_t size, avi_t *avifile);
+static int tc_audio_encode_ffmpeg(char *aud_buffer, int aud_size, avi_t *avifile);
+static int tc_audio_encode_mp3(char *aud_buffer, int aud_size, avi_t *avifile);
+static int tc_audio_pass_through(char *aud_buffer, int aud_size, avi_t *avifile);
+static int tc_audio_pass_through_ac3(char *aud_buffer, int aud_size, avi_t *avifile);
+static int tc_audio_pass_through_pcm(char *aud_buffer, int aud_size, avi_t *avifile);
+static int tc_audio_mute(char *aud_buffer, int aud_size, avi_t *avifile);
+#ifdef HAVE_LAME
+static char * lame_error2str(int error);
+static void no_debug(const char *format, va_list ap) {return;}
+static int tc_get_mp3_header(unsigned char* hbuf, int* chans, int* srate);
+#endif
+
+/**
+ * Init Lame Encoder
+ *
+ * @param vob
+ *
+ * @return TC_EXPORT_OK or TC_EXPORT_ERROR
+ */
+static int tc_audio_init_lame(vob_t *vob, int o_codec)
+{
+ static int initialized=0;
+ int res = TC_EXPORT_ERROR;
+
+ if (!initialized)
+ if (verbose_flag & TC_DEBUG)
+ tc_info("Audio: using new version");
+
+ if(initialized==0)
+ {
+#ifdef HAVE_LAME
+ int preset = 0;
+ lgf=lame_init();
+ if(lgf<0)
+ {
+ tc_warn("Lame encoder init failed.");
+ return(TC_EXPORT_ERROR);
+ }
+
+ if(!(verbose_flag & TC_DEBUG)) lame_set_msgf (lgf, no_debug);
+ if(!(verbose_flag & TC_DEBUG)) lame_set_debugf(lgf, no_debug);
+ if(!(verbose_flag & TC_DEBUG)) lame_set_errorf(lgf, no_debug);
+
+ lame_set_bWriteVbrTag(lgf, 0);
+ lame_set_quality(lgf, vob->mp3quality);
+
+ /* Setting bitrate */
+ if(vob->a_vbr)
+ { /* VBR */
+ lame_set_VBR(lgf, vob->a_vbr);
+ /* 1 = best vbr q 6=~128k */
+ lame_set_VBR_q(lgf, vob->mp3quality);
+ /*
+ * if(vob->mp3bitrate>0)
+ * lame_set_VBR_mean_bitrate_kbps(
+ * lgf,
+ * vob->mp3bitrate);
+ */
+ } else {
+ lame_set_VBR(lgf, 0);
+ lame_set_brate(lgf, vob->mp3bitrate);
+ }
+
+ /* Playing with bitreservoir */
+ if(vob->bitreservoir == TC_FALSE)
+ lame_set_disable_reservoir(lgf, 1);
+
+ /* Mono / Sterero ? */
+ if (IS_AUDIO_MONO)
+ {
+ lame_set_num_channels(lgf, avi_aud_chan);
+ lame_set_mode(lgf, MONO);
+ } else {
+ lame_set_num_channels(lgf, 2);
+ lame_set_mode(lgf, JOINT_STEREO);
+ }
+ /* Overide defaults */
+ if (vob->mp3mode==1)
+ lame_set_mode(lgf, STEREO);
+ if (vob->mp3mode==2)
+ lame_set_mode(lgf, MONO);
+
+ /* sample rate */
+ lame_set_in_samplerate(lgf, vob->a_rate);
+ lame_set_out_samplerate(lgf, avi_aud_rate);
+
+ /* Optimisations */
+ if(tc_accel & AC_MMX)
+ lame_set_asm_optimizations(lgf, MMX, 1);
+
+ if(tc_accel & AC_3DNOW)
+ lame_set_asm_optimizations(lgf, AMD_3DNOW, 1);
+
+ if(tc_accel & AC_SSE)
+ lame_set_asm_optimizations(lgf, SSE, 1);
+
+
+ /* Preset stuff */
+ if (vob->lame_preset && strlen (vob->lame_preset))
+ {
+ char *c = strchr (vob->lame_preset, ',');
+ int fast = 0;
+
+ if (c && *c && *(c+1)) {
+ if (strcmp(c+1, "fast"))
+ {
+ *c = '\0';
+ fast = 1;
+ }
+ }
+
+ if (strcmp (vob->lame_preset, "standard") == 0)
+ {
+ preset = fast?STANDARD_FAST:STANDARD;
+ vob->a_vbr = 1;
+ }
+ else if (strcmp (vob->lame_preset, "medium") == 0)
+ {
+ preset = fast?MEDIUM_FAST:MEDIUM;
+ vob->a_vbr = 1;
+ }
+ else if (strcmp (vob->lame_preset, "extreme") == 0)
+ {
+ preset = fast?EXTREME_FAST:EXTREME;
+ vob->a_vbr = 1;
+ }
+ else if (strcmp (vob->lame_preset, "insane") == 0) {
+ preset = INSANE;
+ vob->a_vbr = 1;
+ }
+ else if ( atoi(vob->lame_preset) != 0)
+ {
+ vob->a_vbr = 1;
+ preset = atoi(vob->lame_preset);
+ avi_aud_bitrate = preset;
+ }
+ else
+ tc_warn("Lame preset `%s' not supported. "
+ "Falling back defaults.",
+ vob->lame_preset);
+
+ if (fast == 1)
+ *c = ',';
+
+ if (preset)
+ {
+ if (verbose_flag & TC_DEBUG)
+ tc_info("Using Lame preset `%s'.",
+ vob->lame_preset);
+ lame_set_preset(lgf, preset);
+ }
+ }
+
+ /* Init Lame ! */
+ lame_init_params(lgf);
+ if(verbose_flag)
+ tc_info("Audio: using lame-%s",
+ get_lame_version());
+ if (verbose_flag & TC_DEBUG) {
+ tc_info("Lame config: PCM -> %s",
+ (o_codec==CODEC_MP3)?"MP3":"MP2");
+ tc_info(" bitrate : %d kbit/s",
+ vob->mp3bitrate);
+ tc_info(" ouput samplerate: %d Hz",
+ (vob->mp3frequency>0)?vob->mp3frequency:vob->a_rate);
+ }
+ /* init lame encoder only on first call */
+ initialized = 1;
+ res = TC_EXPORT_OK;
+
+#else /* HAVE_LAME */
+ tc_warn("No Lame support available!");
+#endif /* HAVE_LAME */
+ }
+
+ return res;
+}
+
+
+
+/**
+ * Init FFMPEG AUDIO Encoder
+ *
+ * @param vob
+ *
+ * @return TC_EXPORT_OK or TC_EXPORT_ERROR
+ */
+static int tc_audio_init_ffmpeg(vob_t *vob, int o_codec)
+{
+ int init_ret = TC_EXPORT_ERROR;
+#ifdef HAVE_FFMPEG
+ unsigned long codeid = 0;
+ int ret = 0;
+
+ TC_INIT_LIBAVCODEC;
+
+ switch (o_codec) {
+ case 0x50:
+ codeid = CODEC_ID_MP2;
+ break;
+ case 0x2000:
+ codeid = CODEC_ID_AC3;
+ break;
+ default:
+ tc_warn("cannot init ffmpeg with %x", o_codec);
+ }
+
+ //-- get it --
+ mpa_codec = avcodec_find_encoder(codeid);
+ if (!mpa_codec) {
+ tc_log_warn("encode_ffmpeg", "mpa codec not found !");
+ return(TC_EXPORT_ERROR);
+ }
+
+ // OPEN
+
+ //-- set parameters (bitrate, channels and sample-rate) --
+ //--------------------------------------------------------
+ avcodec_get_context_defaults(&mpa_ctx);
+#if LIBAVCODEC_VERSION_MAJOR < 53
+ mpa_ctx.codec_type = CODEC_TYPE_AUDIO;
+#else
+ mpa_ctx.codec_type = AVMEDIA_TYPE_AUDIO;
+#endif
+ mpa_ctx.bit_rate = vob->mp3bitrate * 1000; // bitrate dest.
+ mpa_ctx.channels = vob->dm_chan; // channels
+ mpa_ctx.sample_rate = vob->a_rate;
+
+ //-- open codec --
+ //----------------
+ TC_LOCK_LIBAVCODEC;
+ ret = avcodec_open(&mpa_ctx, mpa_codec);
+ TC_UNLOCK_LIBAVCODEC;
+ if (ret < 0) {
+ tc_warn("tc_audio_init_ffmpeg: could not open %s codec !",
+ (codeid == CODEC_ID_MP2) ?"mpa" :"ac3");
+ return(TC_EXPORT_ERROR);
+ }
+
+ //-- bytes per sample and bytes per frame --
+ mpa_bytes_ps = mpa_ctx.channels * vob->dm_bits/8;
+ mpa_bytes_pf = mpa_ctx.frame_size * mpa_bytes_ps;
+
+ //-- create buffer to hold 1 frame --
+ mpa_buf = malloc(mpa_bytes_pf);
+ mpa_buf_ptr = 0;
+ init_ret = TC_EXPORT_OK;
+
+#else /* HAVE_FFMPEG */
+ tc_warn("No FFmpeg support available!");
+#endif /* HAVE_FFMPEG */
+
+ return init_ret;
+
+}
+
+
+/**
+ * Init audio encoder RAW -> *
+ *
+ * @param vob
+ *
+ * @return TC_EXPORT_OK or TC_EXPORT_ERROR
+ */
+static int tc_audio_init_raw(vob_t *vob)
+{
+ if(vob->pass_flag & TC_AUDIO)
+ {
+ avi_t *avifile;
+
+ avifile = AVI_open_input_file(vob->audio_in_file, 1);
+ if(avifile != NULL)
+ {
+ /* set correct pass-through track: */
+ AVI_set_audio_track(avifile, vob->a_track);
+
+ /*
+ * small hack to fix incorrect samplerates caused by
+ * transcode < 0.5.0-20011109
+ */
+ if (vob->mp3frequency==0)
+ vob->mp3frequency=AVI_audio_rate(avifile);
+
+ avi_aud_rate = vob->mp3frequency;
+ avi_aud_chan = AVI_audio_channels(avifile);
+ avi_aud_bits = AVI_audio_bits(avifile);
+ avi_aud_codec = AVI_audio_format(avifile);
+ avi_aud_bitrate = AVI_audio_mp3rate(avifile);
+
+ AVI_close(avifile);
+ } else {
+ AVI_print_error("avi open error");
+ return(TC_EXPORT_ERROR);
+ }
+ } else
+ tc_audio_encode_function=tc_audio_mute;
+
+ return(TC_EXPORT_OK);
+}
+
+
+/**
+ * init audio encoder
+ *
+ * @param vob
+ * @param v is TC_DEBUG for verbose output or 0
+ *
+ * @return TC_EXPORT_OK or TC_EXPORT_ERROR
+ */
+
+int tc_audio_init(vob_t *vob, int v)
+{
+ int ret=TC_EXPORT_OK;
+ int sample_size;
+ verbose_flag=v;
+
+ /* Default */
+ avi_aud_bitrate = vob->mp3bitrate;
+ avi_aud_codec = vob->ex_a_codec;
+
+ avi_aud_bits=vob->dm_bits;
+ avi_aud_chan=vob->dm_chan;
+ avi_aud_rate=(vob->mp3frequency != 0)?vob->mp3frequency:vob->a_rate;
+
+ lame_flush=vob->encoder_flush;
+
+ /* For encoding */
+ sample_size = avi_aud_bits * 8 * avi_aud_chan;
+
+ /*
+ * Sanity checks
+ */
+ if((sample_size == 0) &&
+ (vob->im_a_codec != CODEC_NULL))
+ {
+ tc_warn("Zero sample size detected for audio format `0x%x'. "
+ "Muting.", vob->im_a_codec);
+ tc_audio_encode_function=tc_audio_mute;
+ return(TC_EXPORT_OK);
+ }
+
+ output = malloc (OUTPUT_SIZE);
+ input = malloc (INPUT_SIZE);
+ if (!output || !input) {
+ tc_log_error(__FILE__, "(%s:%d) Out of memory", __FILE__, __LINE__);
+ return (TC_EXPORT_ERROR);
+ }
+
+
+ /* paranoia... */
+ memset (output, 0, OUTPUT_SIZE);
+ memset (input, 0, INPUT_SIZE);
+
+ if (verbose_flag & TC_DEBUG)
+ tc_info("Audio submodule in=0x%x out=0x%x", vob->im_a_codec, vob->ex_a_codec);
+
+ switch(vob->im_a_codec)
+ {
+ case CODEC_PCM:
+ switch(vob->ex_a_codec)
+ {
+ case CODEC_NULL:
+ tc_audio_encode_function = tc_audio_mute;
+ break;
+
+ case CODEC_MP3:
+ ret=tc_audio_init_lame(vob, vob->ex_a_codec);
+ tc_audio_encode_function = tc_audio_encode_mp3;
+ break;
+
+ case CODEC_PCM:
+ tc_info("PCM -> PCM");
+ /* adjust bitrate with magic ! */
+ avi_aud_bitrate=(vob->a_rate*4)/1000*8;
+ tc_audio_encode_function = tc_audio_pass_through_pcm;
+ break;
+
+ case CODEC_MP2:
+ tc_info("PCM -> MP2");
+ ret=tc_audio_init_ffmpeg(vob, vob->ex_a_codec);
+ tc_audio_encode_function = tc_audio_encode_ffmpeg;
+ break;
+
+ case CODEC_AC3:
+ tc_info("PCM -> AC3");
+ ret=tc_audio_init_ffmpeg(vob, vob->ex_a_codec);
+ tc_audio_encode_function = tc_audio_encode_ffmpeg;
+ break;
+
+ default:
+ tc_warn("Conversion not supported (in=0x%x out=0x%x)",
+ vob->im_a_codec, vob->ex_a_codec);
+ ret=TC_EXPORT_ERROR;
+ break;
+ }
+ break;
+
+ case CODEC_MP2:
+ case CODEC_MP3: /* only pass through supported */
+ switch(vob->ex_a_codec)
+ {
+ case CODEC_NULL:
+ tc_audio_encode_function = tc_audio_mute;
+ break;
+
+ case CODEC_MP2:
+ case CODEC_MP3:
+ tc_audio_encode_function = tc_audio_pass_through;
+ break;
+
+ default:
+ tc_warn("Conversion not supported (in=x0%x out=x0%x)",
+ vob->im_a_codec, vob->ex_a_codec);
+ ret=TC_EXPORT_ERROR;
+ break;
+ }
+ break;
+
+ case CODEC_AC3: /* only pass through supported */
+ switch(vob->ex_a_codec)
+ {
+ case CODEC_NULL:
+ tc_audio_encode_function = tc_audio_mute;
+ break;
+
+ case CODEC_AC3:
+ tc_info("AC3->AC3");
+ if (vob->audio_file_flag) {
+ tc_audio_encode_function = tc_audio_pass_through;
+ } else {
+ tc_audio_encode_function = tc_audio_pass_through_ac3;
+ }
+ /*
+ *the bitrate can only be determined in the encoder
+ * section. `bitrate_flags' will be set to 1 after
+ * bitrate is determined.
+ */
+ break;
+ default:
+ tc_warn("Conversion not supported (in=0x%x out=0x%x)",
+ vob->im_a_codec, vob->ex_a_codec);
+ ret=TC_EXPORT_ERROR;
+ break;
+ }
+ break;
+
+ case CODEC_NULL: /* no audio requested */
+ tc_audio_encode_function = tc_audio_mute;
+ break;
+
+ case CODEC_RAW: /* pass-through mode */
+ tc_audio_encode_function = tc_audio_pass_through;
+ ret=tc_audio_init_raw(vob);
+ break;
+
+ default:
+ tc_warn("Conversion not supported (in=x0%x out=x0%x)",
+ vob->im_a_codec, vob->ex_a_codec);
+ ret=TC_EXPORT_ERROR;
+ break;
+ }
+
+ return(ret);
+}
+
+
+/**
+ * open audio output file
+ *
+ * @param vob
+ * @param avifile
+ *
+ * @return TC_EXPORT_OK or TC_EXPORT_ERROR
+ */
+int tc_audio_open(vob_t *vob, avi_t *avifile)
+{
+ if (tc_audio_encode_function != tc_audio_mute)
+ {
+ if(vob->audio_file_flag)
+ {
+ if(! fd)
+ {
+ if (vob->audio_out_file[0] == '|')
+ {
+ fd = popen(vob->audio_out_file+1, "w");
+ if (! fd)
+ {
+ tc_warn("Cannot popen() audio "
+ "file `%s'",
+ vob->audio_out_file+1);
+ return(TC_EXPORT_ERROR);
+ }
+ is_pipe = 1;
+ } else {
+ fd = fopen(vob->audio_out_file, "w");
+ if (! fd)
+ {
+ tc_warn("Cannot open() audio "
+ "file `%s'",
+ vob->audio_out_file);
+ return(TC_EXPORT_ERROR);
+ }
+ }
+ }
+
+ if (verbose_flag & TC_DEBUG)
+ tc_info("Sending audio output to %s",
+ vob->audio_out_file);
+ } else {
+
+ if(avifile==NULL)
+ {
+ tc_audio_encode_function = tc_audio_mute;
+ tc_info("No option `-m' found. Muting sound.");
+ return(TC_EXPORT_OK);
+ }
+
+ AVI_set_audio(avifile,
+ avi_aud_chan,
+ avi_aud_rate,
+ avi_aud_bits,
+ avi_aud_codec,
+ avi_aud_bitrate);
+ AVI_set_audio_vbr(avifile, vob->a_vbr);
+
+ if (vob->avi_comment_fd > 0)
+ AVI_set_comment_fd(avifile,
+ vob->avi_comment_fd);
+
+ if(avifile2 == NULL)
+ avifile2 = avifile; /* save for close */
+
+ if (verbose_flag & TC_DEBUG)
+ tc_info("AVI stream: format=0x%x, rate=%ld Hz, "
+ "bits=%d, channels=%d, bitrate=%d",
+ avi_aud_codec,
+ avi_aud_rate,
+ avi_aud_bits,
+ avi_aud_chan,
+ avi_aud_bitrate);
+ }
+ }
+
+ return(TC_EXPORT_OK);
+}
+
+
+/**
+ * Write audio data to output stream
+ */
+static int tc_audio_write(char *buffer, size_t size, avi_t *avifile)
+{
+ if (fd != NULL) {
+ if (fwrite(buffer, size, 1, fd) != 1) {
+ tc_warn("Audio file write error (errno=%d) [%s].", errno, strerror(errno));
+ return(TC_EXPORT_ERROR);
+ }
+ } else {
+ if (AVI_write_audio(avifile, buffer, size) < 0) {
+ AVI_print_error("AVI file audio write error");
+ return(TC_EXPORT_ERROR);
+ }
+ }
+
+ return(TC_EXPORT_OK);
+}
+
+
+/**
+ * encode audio frame in MP3 format
+ *
+ * @param aud_buffer is the input buffer ?
+ * @param aud_size is the input buffer length
+ * @param avifile is the output stream
+ *
+ * @return
+ *
+ * How this code works:
+ *
+ * We always encode raw audio chunks which are MP3_CHUNK_SZ (==2304)
+ * bytes large. `input' contains the raw audio buffer contains
+ * the encoded audio
+ *
+ * It is possible (very likely) that lame cannot produce a valid mp3
+ * chunk per "audio frame" so we do not write out any compressed audio.
+ * We need to buffer the not consumed input audio where another 2304
+ * bytes chunk won't fit in AND we need to buffer the already encoded
+ * but not enough audio.
+ *
+ * To find out how much we actually need to encode we decode the mp3
+ * header of the recently encoded audio chunk and read out the actual
+ * length.
+ *
+ * Then we write the audio. There can either be more than one valid mp3
+ * frame in buffer and/or still enough raw data left to encode one.
+ *
+ * Easy, eh? -- tibit.
+ */
+static int tc_audio_encode_mp3(char *aud_buffer, int aud_size, avi_t *avifile)
+{
+#ifdef HAVE_LAME
+ int outsize=0;
+ int count=0;
+
+ /*
+ * Apend the new incoming audio to the already available but not yet
+ * consumed.
+ */
+ ac_memcpy (input+input_len, aud_buffer, aud_size);
+ input_len += aud_size;
+ if (verbose_flag & TC_DEBUG)
+ tc_info("audio_encode_mp3: input buffer size=%d", input_len);
+
+ /*
+ * As long as lame doesn't return encoded data (lame needs to fill its
+ * internal buffers) AND as long as there is enough input data left.
+ */
+ while(input_len >= MP3_CHUNK_SZ)
+ {
+ if(IS_AUDIO_MONO)
+ {
+ outsize = lame_encode_buffer(
+ lgf,
+ (short int *)(input+count*MP3_CHUNK_SZ),
+ (short int *)(input+count*MP3_CHUNK_SZ),
+ MP3_CHUNK_SZ/2,
+ output+output_len,
+ OUTPUT_SIZE - output_len);
+ } else {
+ outsize = lame_encode_buffer_interleaved(
+ lgf,
+ (short int *) (input+count*MP3_CHUNK_SZ),
+ MP3_CHUNK_SZ/4,
+ output + output_len,
+ OUTPUT_SIZE - output_len);
+ }
+
+ if(outsize < 0)
+ {
+ tc_warn("Lame encoding error: (%s)",
+ lame_error2str(outsize));
+ return(TC_EXPORT_ERROR);
+ }
+
+ output_len += outsize;
+ input_len -= MP3_CHUNK_SZ;
+
+ ++count;
+
+ if (verbose_flag & TC_DEBUG)
+ tc_info("Encoding: count=%d outsize=%d output_len=%d "
+ "consumed=%d",
+ count, outsize, output_len, count*MP3_CHUNK_SZ);
+ }
+ /* Update input */
+ memmove(input, input+count*MP3_CHUNK_SZ, input_len);
+
+
+ if (verbose_flag & TC_DEBUG)
+ tc_info("output_len=%d input_len=%d count=%d",
+ output_len, input_len, count);
+
+ /* If we don't have any output data, there's nothing to do */
+ if (output_len == 0) {
+ return(TC_EXPORT_OK);
+ }
+
+ /*
+ * Now, it's time to write mp3 data to output stream...
+ */
+ if (IS_VBR)
+ {
+ int offset=0;
+ int size;
+
+ /*
+ * In VBR mode, we should write _complete_ chunk. And their
+ * size may change from one to other... So we should analyse
+ * each one and write it if enough data is avaible.
+ */
+
+ if (verbose_flag & TC_DEBUG)
+ tc_info("Writing... (output_len=%d)\n", output_len);
+ while((size=tc_get_mp3_header(output+offset, NULL, NULL)) > 0)
+ {
+ if (size > output_len)
+ break;
+
+ if (verbose_flag & TC_DEBUG)
+ tc_info("Writing chunk of size=%d", size);
+ tc_audio_write(output+offset, size, avifile);
+ offset += size;
+ output_len -= size;
+ }
+ memmove(output, output+offset, output_len);
+ if (verbose_flag & TC_DEBUG)
+ tc_info("Writing OK (output_len=%d)", output_len);
+ } else {
+ /*
+ * in CBR mode, write our data in simplest way.
+ * Thinking too much about chunk will break audio playback
+ * on archos Jukebox Multimedia...
+ */
+ tc_audio_write(output, output_len, avifile);
+ output_len=0;
+ }
+ return(TC_EXPORT_OK);
+#else // HAVE_LAME
+ tc_warn("No Lame support available!");
+ return(TC_EXPORT_ERROR);
+#endif
+}
+
+static int tc_audio_encode_ffmpeg(char *aud_buffer, int aud_size, avi_t *avifile)
+{
+#ifdef HAVE_FFMPEG
+ int in_size, out_size;
+ char *in_buf;
+
+ //-- input buffer and amount of bytes --
+ in_size = aud_size;
+ in_buf = aud_buffer;
+
+ //-- any byte in mpa-buffer left from past call ? --
+ //--------------------------------------------------
+ if (mpa_buf_ptr > 0) {
+
+ int bytes_needed, bytes_avail;
+
+ bytes_needed = mpa_bytes_pf - mpa_buf_ptr;
+ bytes_avail = in_size;
+
+ //-- complete frame -> encode --
+ //------------------------------
+ if ( bytes_avail >= bytes_needed ) {
+
+ ac_memcpy(&mpa_buf[mpa_buf_ptr], in_buf, bytes_needed);
+
+ TC_LOCK_LIBAVCODEC;
+ out_size = avcodec_encode_audio(&mpa_ctx, (unsigned char *)output,
+ OUTPUT_SIZE, (short *)mpa_buf);
+ TC_UNLOCK_LIBAVCODEC;
+ tc_audio_write(output, out_size, avifile);
+
+ in_size -= bytes_needed;
+ in_buf += bytes_needed;
+
+ mpa_buf_ptr = 0;
+ }
+
+ //-- incomplete frame -> append bytes to mpa-buffer and return --
+ //---------------------------------------------------------------
+ else {
+
+ ac_memcpy(&mpa_buf[mpa_buf_ptr], aud_buffer, bytes_avail);
+ mpa_buf_ptr += bytes_avail;
+ return (0);
+ }
+ } //bytes availabe from last call?
+
+
+ //-- encode only as much "full" frames as available --
+ //----------------------------------------------------
+
+ while (in_size >= mpa_bytes_pf) {
+ TC_LOCK_LIBAVCODEC;
+ out_size = avcodec_encode_audio(&mpa_ctx, (unsigned char *)output,
+ OUTPUT_SIZE, (short *)in_buf);
+ TC_UNLOCK_LIBAVCODEC;
+
+ tc_audio_write(output, out_size, avifile);
+
+ in_size -= mpa_bytes_pf;
+ in_buf += mpa_bytes_pf;
+ }
+
+ //-- hold rest of bytes in mpa-buffer --
+ //--------------------------------------
+ if (in_size > 0) {
+ mpa_buf_ptr = in_size;
+ ac_memcpy(mpa_buf, in_buf, mpa_buf_ptr);
+ }
+
+ return(TC_EXPORT_OK);
+#else // HAVE_FFMPEG
+ tc_warn("No FFMPEG support available!");
+ return(TC_EXPORT_ERROR);
+#endif
+}
+
+static int tc_audio_pass_through_ac3(char *aud_buffer, int aud_size, avi_t *avifile)
+{
+ if(bitrate == 0)
+ {
+ int i;
+ uint16_t sync_word = 0;
+
+ /* try to determine bitrate from audio frame: */
+ for(i=0;i<aud_size-3;++i)
+ {
+ sync_word = (sync_word << 8) + (uint8_t) aud_buffer[i];
+ if(sync_word == 0x0b77)
+ {
+ /* from import/ac3scan.c */
+ static const int bitrates[] = {
+ 32, 40, 48, 56,
+ 64, 80, 96, 112,
+ 128, 160, 192, 224,
+ 256, 320, 384, 448,
+ 512, 576, 640
+ };
+ int ratecode = (aud_buffer[i+3] & 0x3E) >> 1;
+ if (ratecode < sizeof(bitrates)/sizeof(*bitrates))
+ bitrate = bitrates[ratecode];
+ break;
+ }
+ }
+
+ /* assume bitrate > 0 is OK. */
+ if (bitrate > 0)
+ {
+ AVI_set_audio_bitrate(avifile, bitrate);
+ if (verbose_flag & TC_DEBUG)
+ tc_info("bitrate %d kBits/s", bitrate);
+ }
+ }
+
+ return(tc_audio_write(aud_buffer, aud_size, avifile));
+}
+
+
+/**
+ *
+ */
+static int tc_audio_pass_through_pcm(char *aud_buffer, int aud_size, avi_t *avifile)
+{
+#ifdef WORDS_BIGENDIAN
+ int i;
+ char tmp;
+
+ for(i=0; i<aud_size; i+=2)
+ {
+ tmp = aud_buffer[i+1];
+ aud_buffer[i+1] = aud_buffer[i];
+ aud_buffer[i] = tmp;
+ }
+#endif
+ return(tc_audio_write(aud_buffer, aud_size, avifile));
+
+}
+
+/**
+ *
+ */
+static int tc_audio_pass_through(char *aud_buffer, int aud_size, avi_t *avifile)
+{
+ return(tc_audio_write(aud_buffer, aud_size, avifile));
+
+}
+
+/**
+ *
+ */
+static int tc_audio_mute(char *aud_buffer, int aud_size, avi_t *avifile)
+{
+ /*
+ * Avoid Gcc to complain
+ */
+ (void)aud_buffer;
+ (void)aud_size;
+ (void)avifile;
+
+ return(TC_EXPORT_OK);
+}
+
+
+/**
+ * encode audio frame
+ *
+ * @param aud_buffer is the input buffer ?
+ * @param aud_size is the input buffer length ?
+ * @param avifile is the output stream ?
+ *
+ * @return
+ */
+int tc_audio_encode(char *aud_buffer, int aud_size, avi_t *avifile)
+{
+ assert(tc_audio_encode_function != NULL);
+ return(tc_audio_encode_function(aud_buffer, aud_size, avifile));
+ }
+
+
+/**
+ * Close audio stream
+ */
+int tc_audio_close()
+{
+ /* reset bitrate flag for AC3 pass-through */
+ bitrate = 0;
+
+ if (tc_audio_encode_function == tc_audio_encode_mp3)
+ {
+#ifdef HAVE_LAME
+ if(lame_flush) {
+
+ int outsize=0;
+
+ outsize = lame_encode_flush(lgf, output, 0);
+
+ if (verbose_flag & TC_DEBUG)
+ tc_info("flushing %d audio bytes", outsize);
+
+ if (output && outsize > 0) {
+ tc_audio_write(output, outsize, avifile2);
+ }
+ }
+#endif
+ }
+
+ if(fd)
+ {
+ if (is_pipe)
+ pclose(fd);
+ else
+ fclose(fd);
+ fd=NULL;
+ }
+
+ avifile2 = NULL;
+ return(TC_EXPORT_OK);
+}
+
+
+
+int tc_audio_stop()
+{
+ if (input) {
+ free(input);
+ input = NULL;
+ }
+ if (output) {
+ free(output);
+ output = NULL;
+ }
+#ifdef HAVE_LAME
+ if (tc_audio_encode_function == tc_audio_encode_mp3)
+ lame_close(lgf);
+#endif
+
+#ifdef HAVE_FFMPEG
+ if (tc_audio_encode_function == tc_audio_encode_ffmpeg)
+ {
+ //-- release encoder --
+ if (mpa_codec) avcodec_close(&mpa_ctx);
+
+ //-- cleanup buffer resources --
+ if (mpa_buf) free(mpa_buf);
+ mpa_buf = NULL;
+ mpa_buf_ptr = 0;
+
+ }
+#endif
+
+ return(0);
+}
+
+
+#ifdef HAVE_LAME
+
+/**
+ *
+ */
+static char * lame_error2str(int error)
+{
+ switch (error)
+ {
+ case -1: return "-1: mp3buf was too small";
+ case -2: return "-2: malloc() problem";
+ case -3: return "-3: lame_init_params() not called";
+ case -4: return "-4: psycho acoustic problems";
+ case -5: return "-5: ogg cleanup encoding error";
+ case -6: return "-6: ogg frame encoding error";
+ default: return "Unknown lame error";
+ }
+}
+
+// from mencoder
+//----------------------- mp3 audio frame header parser -----------------------
+
+static int tabsel_123[2][3][16] = {
+ { {0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,0},
+ {0,32,48,56, 64, 80, 96,112,128,160,192,224,256,320,384,0},
+ {0,32,40,48, 56, 64, 80, 96,112,128,160,192,224,256,320,0} },
+
+ { {0,32,48,56,64,80,96,112,128,144,160,176,192,224,256,0},
+ {0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,0},
+ {0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,0} }
+};
+static long freqs[9] = { 44100, 48000, 32000, 22050, 24000, 16000 , 11025 , 12000 , 8000 };
+
+/*
+ * return frame size or -1 (bad frame)
+ */
+static int tc_get_mp3_header(unsigned char* hbuf, int* chans, int* srate){
+ int stereo, ssize, crc, lsf, mpeg25, framesize;
+ int padding, bitrate_index, sampling_frequency;
+ unsigned long newhead =
+ hbuf[0] << 24 |
+ hbuf[1] << 16 |
+ hbuf[2] << 8 |
+ hbuf[3];
+
+
+ // head_check:
+ if( (newhead & 0xffe00000) != 0xffe00000 ||
+ (newhead & 0x0000fc00) == 0x0000fc00){
+ //tc_log_warn(__FILE__, "head_check failed");
+ return -1;
+ }
+
+ if((4-((newhead>>17)&3))!=3){
+ tc_warn("not layer-3");
+ return -1;
+ }
+
+ if( newhead & ((long)1<<20) ) {
+ lsf = (newhead & ((long)1<<19)) ? 0x0 : 0x1;
+ mpeg25 = 0;
+ } else {
+ lsf = 1;
+ mpeg25 = 1;
+ }
+
+ if(mpeg25)
+ sampling_frequency = 6 + ((newhead>>10)&0x3);
+ else
+ sampling_frequency = ((newhead>>10)&0x3) + (lsf*3);
+
+ if(sampling_frequency>8){
+ tc_warn("invalid sampling_frequency");
+ return -1; // valid: 0..8
+ }
+
+ crc = ((newhead>>16)&0x1)^0x1;
+ bitrate_index = ((newhead>>12)&0xf);
+ padding = ((newhead>>9)&0x1);
+// fr->extension = ((newhead>>8)&0x1);
+// fr->mode = ((newhead>>6)&0x3);
+// fr->mode_ext = ((newhead>>4)&0x3);
+// fr->copyright = ((newhead>>3)&0x1);
+// fr->original = ((newhead>>2)&0x1);
+// fr->emphasis = newhead & 0x3;
+
+ stereo = ( (((newhead>>6)&0x3)) == 3) ? 1 : 2;
+
+ if(!bitrate_index){
+ tc_warn("Free format not supported.");
+ return -1;
+ }
+
+ if(lsf)
+ ssize = (stereo == 1) ? 9 : 17;
+ else
+ ssize = (stereo == 1) ? 17 : 32;
+ if(crc) ssize += 2;
+
+ framesize = tabsel_123[lsf][2][bitrate_index] * 144000;
+
+ if(!framesize){
+ tc_warn("invalid framesize/bitrate_index");
+ return -1; // valid: 1..14
+ }
+
+ framesize /= freqs[sampling_frequency]<<lsf;
+ framesize += padding;
+
+// if(framesize<=0 || framesize>MAXFRAMESIZE) return FALSE;
+ if(srate) *srate = freqs[sampling_frequency];
+ if(chans) *chans = stereo;
+
+ return framesize;
+}
+
+#endif // HAVE_LAME
+
diff --git a/debian/transcode/transcode-1.1.7/export/aud_aux.h b/debian/transcode/transcode-1.1.7/export/aud_aux.h
new file mode 100644
index 00000000..8586d05a
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/aud_aux.h
@@ -0,0 +1,37 @@
+/*
+ * aud_aux.h
+ *
+ * Copyright (C) Thomas Oestreich - June 2001
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#ifndef _AUD_AUX_H
+#define _AUD_AUX_H
+
+#include "config.h"
+#include "transcode.h"
+#include "avilib/avilib.h"
+
+int tc_audio_init(vob_t *vob, int debug);
+int tc_audio_open(vob_t *vob, avi_t *avifile);
+int tc_audio_encode(char *aud_buffer, int aud_size, avi_t *avifile);
+int tc_audio_stop(void);
+int tc_audio_close(void);
+
+#endif
diff --git a/debian/transcode/transcode-1.1.7/export/divx4_vbr.c b/debian/transcode/transcode-1.1.7/export/divx4_vbr.c
new file mode 100644
index 00000000..94ca5c4d
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/divx4_vbr.c
@@ -0,0 +1,434 @@
+/*
+ * divx4_vbr.c
+ *
+ * Copyright (C) Thomas Oestreich - June 2001
+ *
+ * 2-pass code OpenDivX port:
+ * Copyright (C) 2001 Christoph Lampert <[email protected]>
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+
+/**********************************************************
+ * Two-pass-code from OpenDivX *
+ * *
+ * Large parts of this code were taken from VbrControl() *
+ * from the OpenDivX project, (C) divxnetworks, *
+ * this code is published under DivX Open license, which *
+ * can be found... somewhere... oh, whatever... *
+ **********************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <math.h>
+#include <stdint.h>
+
+#ifdef HAVE_DLFCN_H
+#include <dlfcn.h>
+#else
+# ifdef OS_DARWIN
+# include "libdldarwin/dlfcn.h"
+# endif
+#endif
+
+#include "transcode.h"
+#include "libtc/libtc.h"
+#include "vbr.h"
+
+/* Absolute maximum and minimum quantizers used in VBR modes */
+static const int min_quantizer=1;
+static const int max_quantizer=31;
+
+/* Limits on frame-level deviation of quantizer ( higher values
+ correspond to frames with more changes and vice versa ) */
+static const float min_quant_delta=-10.f;
+static const float max_quant_delta=5.f;
+/* Limits on stream-level deviation of quantizer ( used to make
+ overall bitrate of stream close to requested value ) */
+static const float min_rc_quant_delta=.6f;
+static const float max_rc_quant_delta=1.5f;
+
+typedef struct entry_s {
+/* max 28 bytes/frame or 5 Mb for 2-hour movie */
+ int quant;
+ int text_bits;
+ int motion_bits;
+ int total_bits;
+ float mult;
+ int is_key_frame;
+ int drop;
+} entry;
+
+int m_iCount;
+int m_iQuant;
+int m_iCrispness;
+short m_bDrop;
+float m_fQuant;
+
+int64_t m_lEncodedBits;
+int64_t m_lExpectedBits;
+
+FILE *m_pFile;
+
+entry vFrame;
+entry *m_vFrames;
+long lFrameStart;
+
+int iNumFrames;
+int dummy;
+
+void VbrControl_init_1pass_vbr(int quality, int crispness)
+{
+ m_fQuant = min_quantizer+((max_quantizer-min_quantizer)/6.)*(6-quality);
+ m_iCount = 0;
+ m_bDrop = TC_FALSE;
+ VbrControl_update_1pass_vbr();
+}
+
+int VbrControl_init_2pass_vbr_analysis(const char *filename, int quality)
+{
+ m_pFile = fopen(filename, "wb");
+ if (m_pFile == NULL) {
+ return -1;
+ }
+ m_iCount = 0;
+ m_bDrop = TC_FALSE;
+ fprintf(m_pFile, "##version 1\n");
+ fprintf(m_pFile, "quality %d\n", quality);
+ return 0;
+}
+
+int VbrControl_init_2pass_vbr_encoding(const char *filename, int bitrate,
+ double framerate, int crispness,
+ int quality)
+{
+ int i;
+
+ int64_t text_bits = 0;
+ int64_t total_bits = 0;
+ int64_t complexity = 0;
+ int64_t new_complexity = 0;
+ int64_t motion_bits = 0;
+ int64_t denominator = 0;
+ float qual_multiplier = 1.;
+ char head[20];
+
+ int64_t desired_bits;
+ int64_t non_text_bits;
+
+ float average_complexity;
+
+ m_pFile = fopen(filename, "rb");
+ if (m_pFile == NULL) {
+ return -1;
+ }
+ m_bDrop = TC_FALSE;
+ m_iCount = 0;
+
+ fread(head, 10, 1, m_pFile);
+ if (strncmp("##version ", head, 10) == 0) {
+ int version;
+ int iOldQual;
+ float old_qual = 0, new_qual = 0;
+
+ fscanf(m_pFile, "%d\n", &version);
+ fscanf(m_pFile, "quality %d\n", &iOldQual);
+ switch (iOldQual) {
+ case 5:
+ old_qual = 1.f;
+ break;
+ case 4:
+ old_qual = 1.1f;
+ break;
+ case 3:
+ old_qual = 1.25f;
+ break;
+ case 2:
+ old_qual = 1.4f;
+ break;
+ case 1:
+ old_qual = 2.f;
+ break;
+ }
+
+ switch (quality) {
+ case 5:
+ new_qual = 1.f;
+ break;
+ case 4:
+ new_qual = 1.1f;
+ break;
+ case 3:
+ new_qual = 1.25f;
+ break;
+ case 2:
+ new_qual = 1.4f;
+ break;
+ case 1:
+ new_qual = 2.f;
+ break;
+ }
+ qual_multiplier = new_qual/old_qual;
+ } else { /* strncmp("##version ", head, 10) != 0 */
+ fseek(m_pFile, 0, SEEK_SET);
+ }
+
+ lFrameStart = ftell(m_pFile); // save current position
+
+/* removed C++ dependencies, now read file twice :-( */
+
+ while (!feof(m_pFile)) {
+ fscanf(m_pFile, "Frame %d: intra %d, quant %d, texture %d, "
+ "motion %d, total %d\n",
+ &iNumFrames, (int *) &(vFrame.is_key_frame),
+ &(vFrame.quant), &(vFrame.text_bits),
+ &(vFrame.motion_bits), &(vFrame.total_bits));
+
+ vFrame.total_bits += vFrame.text_bits*(qual_multiplier-1);
+ vFrame.text_bits *= qual_multiplier;
+ text_bits += (int64_t)vFrame.text_bits;
+ motion_bits += (int64_t)vFrame.motion_bits;
+ total_bits += (int64_t)vFrame.total_bits;
+ complexity += (int64_t)vFrame.text_bits*vFrame.quant;
+
+ }
+ iNumFrames++;
+ average_complexity = complexity/iNumFrames;
+
+ if (verbose & TC_DEBUG) {
+ tc_log_info(__FILE__, "frames %d, texture %lld, motion %lld, "
+ "total %lld, complexity %lld",
+ iNumFrames, (long long)text_bits, (long long)motion_bits,
+ (long long)total_bits, (long long)complexity);
+ }
+
+ m_vFrames = tc_malloc(iNumFrames*sizeof(entry));
+ if (!m_vFrames) {
+ return TC_EXPORT_ERROR;
+ }
+
+ fseek(m_pFile, lFrameStart, SEEK_SET); /* start again */
+
+ for (i = 0; i < iNumFrames; i++) {
+ fscanf(m_pFile, "Frame %d: intra %d, quant %d, texture %d, "
+ "motion %d, total %d\n",
+ &dummy, (int *) &(m_vFrames[i].is_key_frame),
+ &(m_vFrames[i].quant), &(m_vFrames[i].text_bits),
+ &(m_vFrames[i].motion_bits), &(m_vFrames[i].total_bits));
+
+ m_vFrames[i].total_bits += m_vFrames[i].text_bits*(qual_multiplier-1);
+ m_vFrames[i].text_bits *= qual_multiplier;
+ }
+
+ if (m_pFile != NULL) {
+ fclose(m_pFile);
+ m_pFile=NULL;
+ }
+
+ desired_bits = (int64_t)bitrate*(int64_t)iNumFrames/framerate;
+ non_text_bits = total_bits-text_bits;
+
+ if (desired_bits <= non_text_bits) {
+ tc_log_warn(__FILE__, "Specified bitrate is too low for this clip.\n"
+ "Minimum possible bitrate for the clip is %.0f"
+ " kbps. Overriding user-specified value.\n",
+ (float)(non_text_bits*framerate/(int64_t)iNumFrames));
+
+ desired_bits=non_text_bits*3/2;
+ }
+
+ desired_bits -= non_text_bits;
+ /**
+ BRIEF EXPLANATION OF WHAT'S GOING ON HERE.
+ We assume that
+ text_bits=complexity / quantizer
+ total_bits-text_bits = const(complexity)
+ where 'complexity' is a characteristic of the frame
+ and does not depend much on quantizer dynamics.
+ Using this equation, we calculate 'average' quantizer
+ to be used for encoding ( 1st order effect ).
+ Having constant quantizer for the entire stream is not
+ very convenient - reconstruction errors are
+ more noticeable in low-motion scenes. To compensate
+ this effect, we multiply quantizer for each frame by
+ (complexity/average_complexity)^k,
+ ( k - parameter of adjustment ). k=0 means 'no compensation'
+ and k=1 is 'constant bitrate mode'. We choose something in
+ between, like 0.5 ( 2nd order effect ).
+ **/
+
+ average_complexity = complexity/iNumFrames;
+
+ for (i = 0; i < iNumFrames; i++) {
+ float mult;
+ if (m_vFrames[i].is_key_frame) {
+ if ((i+1<iNumFrames) && (m_vFrames[i+1].is_key_frame))
+ mult=1.25;
+ else
+ mult=.75;
+ } else {
+ mult = m_vFrames[i].text_bits*m_vFrames[i].quant;
+ mult = (float)sqrt(mult/average_complexity);
+
+ if (mult<0.5)
+ mult=0.5;
+ if (mult>1.5)
+ mult=1.5;
+ }
+
+ m_vFrames[i].mult = mult;
+ m_vFrames[i].drop = TC_FALSE;
+ new_complexity += m_vFrames[i].text_bits*m_vFrames[i].quant;
+
+ denominator += desired_bits*m_vFrames[i].mult/iNumFrames;
+ }
+
+ m_fQuant = ((double)new_complexity)/(double)denominator;
+
+ if (m_fQuant < min_quantizer)
+ m_fQuant=min_quantizer;
+ if (m_fQuant > max_quantizer)
+ m_fQuant=max_quantizer;
+ m_pFile = fopen("analyse.log", "wb");
+ if (m_pFile) {
+ fprintf(m_pFile, "Total frames: %d Avg quantizer: %f\n",
+ iNumFrames, m_fQuant);
+ fprintf(m_pFile, "Expecting %12lld bits\n",
+ (long long)desired_bits+(long long)non_text_bits);
+ fflush(m_pFile);
+ }
+ VbrControl_set_quant(m_fQuant*m_vFrames[0].mult);
+ m_lEncodedBits = m_lExpectedBits=0;
+ return 0;
+}
+
+int VbrControl_get_intra()
+{
+ return m_vFrames[m_iCount].is_key_frame;
+}
+
+short VbrControl_get_drop()
+{
+ return m_bDrop;
+}
+
+int VbrControl_get_quant()
+{
+ return m_iQuant;
+}
+
+void VbrControl_set_quant(float quant)
+{
+ m_iQuant=quant;
+ if((rand() % 10) < ((quant-m_iQuant) * 10))
+ m_iQuant++;
+ if(m_iQuant<min_quantizer)
+ m_iQuant=min_quantizer;
+ if(m_iQuant>max_quantizer)
+ m_iQuant=max_quantizer;
+}
+
+void VbrControl_update_1pass_vbr()
+{
+ VbrControl_set_quant(m_fQuant);
+ m_iCount++;
+}
+
+void VbrControl_update_2pass_vbr_analysis(int is_key_frame, int motion_bits,
+ int texture_bits, int total_bits,
+ int quant)
+{
+ if(m_pFile != NULL) {
+ fprintf(m_pFile, "Frame %d: intra %d, quant %d, texture %d, "
+ "motion %d, total %d\n",
+ m_iCount, is_key_frame, quant, texture_bits, motion_bits,
+ total_bits);
+ m_iCount++;
+ }
+}
+
+void VbrControl_update_2pass_vbr_encoding(int motion_bits, int texture_bits,
+ int total_bits)
+{
+ double q;
+ double dq;
+
+ if(m_iCount >= iNumFrames) {
+ return;
+ }
+
+ m_lExpectedBits += (m_vFrames[m_iCount].total_bits - m_vFrames[m_iCount].text_bits)
+ + m_vFrames[m_iCount].text_bits*m_vFrames[m_iCount].quant/m_fQuant;
+ m_lEncodedBits += (int64_t)total_bits;
+
+ if (m_pFile != NULL) {
+ fprintf(m_pFile, "Frame %d: PRESENT, complexity %d, "
+ "quant multiplier %f, texture %d, total %d ",
+ m_iCount, m_vFrames[m_iCount].text_bits * m_vFrames[m_iCount].quant,
+ m_vFrames[m_iCount].mult, texture_bits, total_bits);
+ }
+ m_iCount++;
+
+ q = m_fQuant * m_vFrames[m_iCount].mult;
+ if (q < m_fQuant + min_quant_delta) {
+ q = m_fQuant+min_quant_delta;
+ }
+ if (q > m_fQuant + max_quant_delta) {
+ q = m_fQuant+max_quant_delta;
+ }
+
+ dq = (double)m_lEncodedBits/(double)m_lExpectedBits;
+ dq *= dq;
+ if (dq < min_rc_quant_delta) {
+ dq = min_rc_quant_delta;
+ }
+ if (dq > max_rc_quant_delta) {
+ dq = max_rc_quant_delta;
+ }
+ if (m_iCount < 20) { // no framerate corrections in first frames
+ dq = 1;
+ }
+ if (m_pFile) {
+ fprintf(m_pFile, "Progress: expected %12lld, achieved %12lld, dq %f",
+ (long long)m_lExpectedBits,
+ (long long)m_lEncodedBits,
+ dq);
+ }
+ q *= dq;
+ VbrControl_set_quant(q);
+ if (m_pFile != NULL) {
+ fprintf(m_pFile, ", new quant %d\n", m_iQuant);
+ }
+}
+
+void VbrControl_close()
+{
+ if (m_pFile != NULL) {
+ fclose(m_pFile);
+ m_pFile = NULL;
+ }
+ free(m_vFrames);
+}
diff --git a/debian/transcode/transcode-1.1.7/export/divx5_encore2.h b/debian/transcode/transcode-1.1.7/export/divx5_encore2.h
new file mode 100644
index 00000000..0f71dae2
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/divx5_encore2.h
@@ -0,0 +1,175 @@
+#ifndef _ENCORE_ENCORE_H
+#define _ENCORE_ENCORE_H
+// This is the header file describing
+// the entrance function of the encoder core
+// or the encore ...
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/**
+ Structure passed as an argument when creating encoder.
+ You have to initialize at least x_dim and y_dim ( valid range:
+ 0<x_dim<=1920, 0<y_dim<=1280, both dimensions should be even ).
+ You can set all other values to 0, in which case they'll be initialized
+ to default values, or specify them directly.
+ On success 'handle' member will contain non-zero handle to initialized
+ encoder.
+**/
+
+typedef struct
+{
+ int non_mpeg_4;
+ int use_bidirect;
+ int obmc;
+ int data_partitioning;
+ int mpeg_2_quant;
+ int quarter_pel;
+ int bidir_quant_multiplier; // / 0x1000
+ int intra_frame_threshold; // 1 ... 100, 0 default value ( 50 )
+ int psychovisual;
+ double pv_strength_frame;
+ double pv_strength_MB;
+ int testing_param; /* only used in testing */
+ int use_gmc;
+ int gmc_sensitivity;
+
+ /* IVTC/deinterlace */
+ int interlace_mode;
+ int top_field_first;
+
+ /* crop/resize things */
+ int enable_crop;
+ int enable_resize;
+ int resize_width;
+ int resize_height;
+ int crop_left;
+ int crop_right;
+ int crop_top;
+ int crop_bottom;
+ int resize_mode; // 0==bilinear, 1==bicubic
+ double bicubic_B; // spline parameter
+ double bicubic_C; // spline parameter
+
+ /* tsfilter things */
+ int temporal_enable;
+ int spatial_passes ;
+ double temporal_level ;
+ double spatial_level ;
+
+ const char* mv_file;
+ int mv_direction;
+// also here:
+// any other special features
+} EXTENSIONS;
+
+
+typedef struct _ENC_PARAM_
+{
+ int x_dim; // the x dimension of the frames to be encoded
+ int y_dim; // the y dimension of the frames to be encoded
+ float framerate; // the frame rate of the sequence before postprocessing in frames/second
+ int bitrate; // the bitrate of the target encoded stream, in bits/second
+ int rc_period; // the intended rate control averaging period
+ int rc_reaction_period; // the reaction period for rate control
+ int rc_reaction_ratio; // the ratio for down/up rate control
+ int max_quantizer; // the upper limit of the quantizer
+ int min_quantizer; // the lower limit of the quantizer
+ int max_key_interval; // the maximum interval between key frames
+ int deinterlace; // fast deinterlace
+ int quality; // the quality of compression ( 1 - fastest, 5 - best )
+ void *handle; // will be filled by encore
+ EXTENSIONS extensions;
+}
+ENC_PARAM;
+
+/**
+ Structure passed as a first argument when encoding a frame.
+ Both pointers should be non-NULL. You are responsible for allocation
+ of bitstream buffer, its size should be large enough to hold a frame.
+ Theoretical upper limit of frame size is around 6 bytes/pixel
+ or 2.5 Mb for 720x576 frame.
+ On success 'length' will contain number of bytes written into the stream.
+**/
+typedef struct _ENC_FRAME_
+{
+ const void *image; // the image frame to be encoded
+ void *bitstream; // the buffer for encoded bitstream
+ int length; // the length of the encoded bitstream - if (length < 0) then bitstream is invalid
+ int colorspace; // the format of image frame
+ int quant; // quantizer for this frame; only used in VBR modes
+ int intra; // force this frame to be intra/inter; only used in VBR 2-pass
+ const void *mvs; // optional pointer to array of motion vectors
+}
+ENC_FRAME;
+
+/**
+ Structure passed as a second optional argument when encoding a frame.
+ On successful return its members are filled with parameters of encoded
+ stream.
+**/
+ typedef struct _ENC_RESULT_
+ {
+ int is_key_frame; // the current frame is encoded as a key frame
+ int quantizer; // the quantizer used for this frame
+ int texture_bits; // amount of bits spent on coding DCT coeffs
+ int motion_bits; // amount of bits spend on coding motion
+ int total_bits; // sum of two previous fields
+ }
+ ENC_RESULT;
+
+// the prototype of the encore() - main encode engine entrance
+int encore(void *handle, // handle - the handle of the calling entity, must be unique
+ int enc_opt, // enc_opt - the option for encoding, see below
+ void *param1, // param1 - the parameter 1 (its actually meaning depends on enc_opt
+ void *param2); // param2 - the parameter 2 (its actually meaning depends on enc_opt
+
+// encore options (the enc_opt parameter of encore())
+#define ENC_OPT_INIT 0 // initialize the encoder, return a handle
+#define ENC_OPT_RELEASE 1 // release all the resource associated with the handle
+#define ENC_OPT_ENCODE 2 // encode a single frame
+#define ENC_OPT_ENCODE_VBR 3 // encode a single frame, not using internal rate control algorithm
+#define ENC_OPT_VERSION 4
+#define ENC_OPT_INTERNAL_ERROR_INFO 5
+
+#define ENCORE_VERSION 20020304
+#define ENCORE_MAJOR_VERSION 5010
+
+
+// return code of encore()
+#define ENC_BUFFER -2
+#define ENC_FAIL -1
+#define ENC_OK 0
+#define ENC_MEMORY 1
+#define ENC_BAD_FORMAT 2
+#define ENC_INTERNAL 3
+
+/** Common 24-bit RGB, order of components b-g-r **/
+#define ENC_CSP_RGB24 0
+
+/** Planar YUV, U & V subsampled by 2 in both directions,
+ average 12 bit per pixel; order of components y-v-u **/
+#define ENC_CSP_YV12 1
+
+/** Packed YUV, U and V subsampled by 2 horizontally,
+ average 16 bit per pixel; order of components y-u-y-v **/
+#define ENC_CSP_YUY2 2
+
+/** Same as above, but order of components is u-y-v-y **/
+#define ENC_CSP_UYVY 3
+
+/** Same as ENC_CSP_YV12, but chroma components are swapped ( order y-u-v ) **/
+#define ENC_CSP_I420 4
+
+/** Same as above **/
+#define ENC_CSP_IYUV ENC_CSP_I420
+
+/** 32-bit RGB, order of components b-g-r, one byte unused **/
+#define ENC_CSP_RGB32 5
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/debian/transcode/transcode-1.1.7/export/dvd-ntsc.cfg b/debian/transcode/transcode-1.1.7/export/dvd-ntsc.cfg
new file mode 100644
index 00000000..4bd793f7
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/dvd-ntsc.cfg
@@ -0,0 +1,19 @@
+# transcode DVD-NTSC export profile
+video_width = 720
+video_height = 480
+video_keep_asr = yes
+video_bitrate = 5000
+video_bitrate_max = 6000
+video_gop_size = 18
+video_encode_fields = 2 # bottom first
+video_frc = 4
+video_codec = mpeg2video
+audio_codec = ac3
+video_module = ffmpeg
+video_module_options = "rc_min_rate=0:rc_max_rate=6000:rc_buffer_size=1792:rc_buffer_aggressivity=99"
+audio_module = ffmpeg
+audio_bitrate = 256
+audio_channels = 2
+audio_sample_rate = 48000
+audio_sample_bits = 16
+mplex_module = raw # since mpeg multiplexor isn't avalaible
diff --git a/debian/transcode/transcode-1.1.7/export/dvd-pal.cfg b/debian/transcode/transcode-1.1.7/export/dvd-pal.cfg
new file mode 100644
index 00000000..b35a9818
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/dvd-pal.cfg
@@ -0,0 +1,19 @@
+# transcode DVD-PAL export profile
+video_width = 720
+video_height = 576
+video_keep_asr = yes
+video_bitrate = 5000
+video_bitrate_max = 6000
+video_gop_size = 15
+video_encode_fields = 1 # top first
+video_frc = 3
+video_codec = mpeg2video
+audio_codec = ac3
+video_module = ffmpeg
+video_module_options = "rc_min_rate=0:rc_max_rate=6000:rc_buffer_size=1792:rc_buffer_aggressivity=99"
+audio_module = ffmpeg
+audio_bitrate = 256
+audio_channels = 2
+audio_sample_rate = 48000
+audio_sample_bits = 16
+mplex_module = raw # since mpeg multiplexor isn't avalaible
diff --git a/debian/transcode/transcode-1.1.7/export/export_ac3.c b/debian/transcode/transcode-1.1.7/export/export_ac3.c
new file mode 100644
index 00000000..657d1f66
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_ac3.c
@@ -0,0 +1,205 @@
+/*
+ * export_ac3.c
+ *
+ * Copyright (C) Daniel Pittman, 2003, based on export_ogg.c which was:
+ * Copyright (C) Tilmann Bitterberg, July 2002
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#define MOD_NAME "export_ac3.so"
+#define MOD_VERSION "v0.1 (2003-02-26)"
+#define MOD_CODEC "(video) null | (audio) ac3"
+
+#include "transcode.h"
+
+#include <stdio.h>
+#include <unistd.h>
+
+static int verbose_flag=TC_QUIET;
+static int capability_flag=TC_CAP_PCM;
+
+#define MOD_PRE ac3
+#include "export_def.h"
+static FILE *pFile = NULL;
+
+static inline int p_write (char *buf, size_t len)
+{
+ size_t n = 0;
+ size_t r = 0;
+ int fd = fileno (pFile);
+
+ while (r < len)
+ {
+ if ((n = write (fd, buf + r, len - r)) < 0)
+ return n;
+
+ r += n;
+ }
+
+ return r;
+}
+
+/* ------------------------------------------------------------
+ *
+ * open codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+ int result;
+
+ /* check for ffmpeg */
+ if (tc_test_program("ffmpeg") != 0) return (TC_EXPORT_ERROR);
+
+ if (param->flag == TC_AUDIO) {
+ char buf [PATH_MAX];
+
+ if (vob->mp3bitrate == 0) {
+ tc_log_warn (MOD_NAME, "Please set the export audio bitrate");
+ return(TC_EXPORT_ERROR);
+ }
+
+ if (vob->mp3frequency == 0) {
+ tc_log_warn (MOD_NAME, "Please set the export audio sample rate");
+ return(TC_EXPORT_ERROR);
+ }
+
+ tc_log_warn(MOD_NAME, "*** This module is non-optimal ***");
+ tc_log_warn(MOD_NAME, "*** Use -N 0x2000 instead of -y ...,ac3 (faster) ***");
+
+ result = tc_snprintf (buf, PATH_MAX,
+ "ffmpeg -y -f s%dle -ac %d -ar %d -i - -ab %dk -acodec ac3 %s%s",
+ vob->dm_bits,
+ vob->dm_chan,
+ vob->mp3frequency,
+ vob->mp3bitrate,
+ vob->audio_out_file,
+ vob->verbose > 1 ? "" : " >/dev/null 2>&1");
+
+ if (result < 0)
+ return(TC_EXPORT_ERROR);
+
+ if (verbose > 0)
+ tc_log_info(MOD_NAME, "%s", buf);
+
+ if ((pFile = popen (buf, "w")) == NULL)
+ return(TC_EXPORT_ERROR);
+
+ return(TC_EXPORT_OK);
+
+ }
+ if (param->flag == TC_VIDEO)
+ return(TC_EXPORT_OK);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+ if(param->flag == TC_AUDIO)
+ {
+ return(0);
+ }
+
+ if (param->flag == TC_VIDEO)
+ return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * encode and export
+ *
+ * ------------------------------------------------------------*/
+
+MOD_encode
+{
+ if(param->flag == TC_AUDIO)
+ {
+ if (p_write (param->buffer, param->size) != param->size)
+ {
+ tc_log_perror(MOD_NAME, "write audio frame");
+ return(TC_EXPORT_ERROR);
+ }
+ return (0);
+ }
+
+ if (param->flag == TC_VIDEO)
+ return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * stop codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+ if (param->flag == TC_VIDEO)
+ return (0);
+
+ if (param->flag == TC_AUDIO)
+ return (0);
+
+ return(TC_EXPORT_ERROR);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * close codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+ if (param->flag == TC_VIDEO)
+ return (0);
+
+ if (param->flag == TC_AUDIO)
+ {
+ if (pFile)
+ pclose (pFile);
+
+ pFile = NULL;
+
+ return(0);
+ }
+
+ return (TC_EXPORT_ERROR);
+}
+
+/* vim: sw=4
+ */
diff --git a/debian/transcode/transcode-1.1.7/export/export_def.h b/debian/transcode/transcode-1.1.7/export/export_def.h
new file mode 100644
index 00000000..f2ab8dfa
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_def.h
@@ -0,0 +1,116 @@
+/*
+ * export_def.h
+ *
+ * Copyright (C) Thomas Oestreich - June 2001
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#ifndef _EXPORT_DEF_H
+#define _EXPORT_DEF_H
+
+
+#ifndef MOD_PRE
+#error MOD_PRE not defined!
+#endif
+
+#define r2(i, a, b) i ## a ## b
+#define r1(a, b) r2(export_, a, b)
+#define RENAME(a, b) r1(a, b)
+
+#define MOD_name static int RENAME(MOD_PRE, _name) (transfer_t *param)
+#define MOD_open static int RENAME(MOD_PRE, _open) (transfer_t *param, vob_t *vob)
+#define MOD_init static int RENAME(MOD_PRE, _init) (transfer_t *param, vob_t *vob)
+#define MOD_encode static int RENAME(MOD_PRE, _encode) (transfer_t *param)
+#define MOD_stop static int RENAME(MOD_PRE, _stop) (transfer_t *param)
+#define MOD_close static int RENAME(MOD_PRE, _close) (transfer_t *param)
+
+
+//extern int verbose_flag;
+//extern int capability_flag;
+
+/* ------------------------------------------------------------
+ *
+ * codec id string
+ *
+ * ------------------------------------------------------------*/
+
+MOD_name
+{
+ static int display=0;
+
+ verbose_flag = param->flag;
+
+ // print module version only once
+ if(verbose_flag && (display++)==0) tc_log_info(MOD_NAME, "%s %s", MOD_VERSION, MOD_CODEC);
+
+ // return module capability flag
+ param->flag = capability_flag;
+
+ return(0);
+}
+
+
+MOD_open;
+MOD_init;
+MOD_encode;
+MOD_stop;
+MOD_close;
+
+/* ------------------------------------------------------------
+ *
+ * interface
+ *
+ * ------------------------------------------------------------*/
+
+int tc_export(int opt, void *para1, void *para2)
+{
+
+ switch(opt)
+ {
+
+ case TC_EXPORT_NAME:
+
+ return(RENAME(MOD_PRE, _name)((transfer_t *) para1));
+
+ case TC_EXPORT_OPEN:
+
+ return(RENAME(MOD_PRE, _open)((transfer_t *) para1, (vob_t *) para2));
+
+ case TC_EXPORT_INIT:
+
+ return(RENAME(MOD_PRE, _init)((transfer_t *) para1, (vob_t *) para2));
+
+ case TC_EXPORT_ENCODE:
+
+ return(RENAME(MOD_PRE, _encode)((transfer_t *) para1));
+
+ case TC_EXPORT_STOP:
+
+ return(RENAME(MOD_PRE, _stop)((transfer_t *) para1));
+
+ case TC_EXPORT_CLOSE:
+
+ return(RENAME(MOD_PRE, _close)((transfer_t *) para1));
+
+ default:
+ return(TC_EXPORT_UNKNOWN);
+ }
+}
+
+#endif
diff --git a/debian/transcode/transcode-1.1.7/export/export_divx5.c b/debian/transcode/transcode-1.1.7/export/export_divx5.c
new file mode 100644
index 00000000..c4f7aa02
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_divx5.c
@@ -0,0 +1,778 @@
+/*
+ * export_divx5.c
+ *
+ * Copyright (C) Thomas Oestreich - June 2001
+ *
+ * 2-pass code OpenDivX port: "-R 1", "-R 2"
+ * Copyright (C) 2001 Christoph Lampert <[email protected]>
+ *
+ * constant quantizer extensions "-R 3" by Gerhard Monzel
+ *
+ * This module is derived from export_divx4.c, minor modification by
+ * Christoph Lampert <[email protected]>
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <math.h>
+#include <stdint.h>
+
+#ifdef HAVE_DLFCN_H
+#include <dlfcn.h>
+#else
+# ifdef OS_DARWIN
+# include "libdldarwin/dlfcn.h"
+# endif
+#endif
+
+
+
+#ifdef HAVE_ENCORE2_H
+#include <encore2.h>
+#else
+#include "divx5_encore2.h"
+#endif
+#include "transcode.h"
+#include "avilib/avilib.h"
+#include "aud_aux.h"
+#include "vbr.h"
+
+#define MOD_NAME "export_divx5.so"
+#define MOD_VERSION "v0.1.8 (2003-07-24)"
+#define MOD_CODEC "(video) DivX 5.xx | (audio) MPEG/AC3/PCM"
+
+static int verbose_flag=TC_QUIET;
+static int capability_flag=TC_CAP_PCM|TC_CAP_RGB|TC_CAP_YUV|TC_CAP_AC3|TC_CAP_AUD;
+
+#define MOD_PRE divx5
+#include "export_def.h"
+
+int VbrMode=0;
+int force_key_frame=-1;
+
+static avi_t *avifile=NULL;
+
+//temporary audio/video buffer
+static char *buffer;
+
+#if ENCORE_VERSION >= 20021024
+DivXBitmapInfoHeader *format =NULL;
+void* encore_handle = NULL;
+SETTINGS *settings = NULL;
+char *logfile_mv=NULL;
+#else
+ENC_PARAM *divx;
+#endif
+ENC_FRAME encode;
+ENC_RESULT key;
+
+// dl stuff
+static int (*divx5_encore)(void *para0, int opt, void *para1, void *para2);
+static void *handle;
+static char module[TC_BUF_MAX];
+
+#if ENCORE_VERSION >= 20021024
+static char * prof2name(int n)
+{
+ switch (n) {
+ case 0: return "Free/No profile";
+ case 1: return "Handheld";
+ case 2: return "Portable";
+ case 3: return "Home Theatre";
+ case 4: return "High Definition";
+ default: return "Free/No profile";
+ }
+}
+#endif
+
+
+#define MODULE "libdivxencore.so.0"
+
+static int divx5_init(const char *path) {
+ const char *error;
+ int *quiet_encore;
+
+ tc_snprintf(module, sizeof(module), "%s/%s", path, MODULE);
+
+
+ // try transcode's module directory
+
+ handle = dlopen(module, RTLD_NOW);
+
+ if (!handle) {
+
+ //try the default:
+
+ handle = dlopen(MODULE, RTLD_GLOBAL| RTLD_LAZY);
+
+ if (!handle) {
+ tc_log_warn(MOD_NAME, "%s", dlerror());
+ return(-1);
+ } else {
+ if(verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME, "Loading external codec module %s", MODULE);
+ }
+
+ } else {
+ if(verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME, "Loading external codec module %s", module);
+ }
+
+ divx5_encore = dlsym(handle, "encore");
+
+ if ((error = dlerror()) != NULL) {
+ tc_log_warn(MOD_NAME, "%s", error);
+ return(-1);
+ }
+
+ quiet_encore=dlsym(handle, "quiet_encore");
+
+ if ((error = dlerror()) != NULL) {
+ tc_log_warn(MOD_NAME, "%s", error);
+ return(-1);
+ }
+
+ *quiet_encore=1;
+
+ // debug
+ if(verbose_flag & TC_STATS) *quiet_encore=0;
+
+ return(0);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+
+#if ENCORE_VERSION >= 20021024
+#else
+ struct stat fbuf;
+#endif
+ int ch;
+
+ tc_log_warn(MOD_NAME, "*** Warning: DivX is broken and support for it is ***");
+ tc_log_warn(MOD_NAME, "*** obsolete in transcode. Sooner or later it ***");
+ tc_log_warn(MOD_NAME, "*** will be removed from transcode. Don't use ***");
+ tc_log_warn(MOD_NAME, "*** DivX. Use xvid or ffmpeg -F mpeg4 instead ***");
+ tc_log_warn(MOD_NAME, "*** for all your mpeg4 encodings. ***");
+
+ if(param->flag == TC_VIDEO) {
+
+ //check for odd frame parameter:
+
+ if((ch = vob->ex_v_width - ((vob->ex_v_width>>3)<<3)) != 0) {
+ tc_log_warn(MOD_NAME, "frame width %d (no multiple of 8)", vob->ex_v_width);
+ tc_log_warn(MOD_NAME, "encoder may not work correctly or crash");
+
+ if(ch & 1) {
+ tc_log_warn(MOD_NAME, "invalid frame width");
+ return(TC_EXPORT_ERROR);
+ }
+ }
+
+ if((ch = vob->ex_v_height - ((vob->ex_v_height>>3)<<3)) != 0) {
+ tc_log_warn(MOD_NAME, "frame height %d (no multiple of 8)", vob->ex_v_height);
+ tc_log_warn(MOD_NAME, "encoder may not work correctly or crash");
+
+ if(ch & 1) {
+ tc_log_warn(MOD_NAME, "invalid frame height");
+ return(TC_EXPORT_ERROR);
+ }
+ }
+
+ if ((buffer = malloc(vob->ex_v_height*vob->ex_v_width*3))==NULL) {
+ tc_log_perror(MOD_NAME, "out of memory");
+ return(TC_EXPORT_ERROR);
+ } else
+
+ memset(buffer, 0, vob->ex_v_height*vob->ex_v_width*3);
+
+ //load the codec
+
+ if(divx5_init(vob->mod_path)<0) {
+ tc_log_warn(MOD_NAME, "failed to init DivX 5.0 Codec");
+ return(TC_EXPORT_ERROR);
+ }
+
+ if (divx5_encore(0, ENC_OPT_VERSION, 0, 0) != ENCORE_VERSION) {
+ tc_log_warn(MOD_NAME, "API in encore.h is not compatible with installed lbdivxencore library");
+ return (TC_EXPORT_ERROR);
+ }
+
+ VbrMode = vob->divxmultipass;
+ // 0 for nothing,
+ // 1 for DivX 5.0 - first-pass,
+ // 2 for DivX 5.0 - second pass
+ // 3 constant quantizer
+
+#if ENCORE_VERSION >= 20021024
+#define FOURCC(A, B, C, D) ( ((uint8_t) (A)) | (((uint8_t) (B))<<8) | (((uint8_t) (C))<<16) | (((uint8_t) (D))<<24) )
+
+ if ((settings = malloc(sizeof(SETTINGS)))==NULL) {
+ tc_log_perror(MOD_NAME, "out of memory");
+ return(TC_EXPORT_ERROR);
+ }
+ if ((format = malloc(sizeof(DivXBitmapInfoHeader)))==NULL) {
+ tc_log_perror(MOD_NAME, "out of memory");
+ return(TC_EXPORT_ERROR);
+ }
+ memset (settings, 0, sizeof(SETTINGS));
+ memset (format, 0, sizeof(DivXBitmapInfoHeader));
+
+ format->biSize = sizeof(DivXBitmapInfoHeader);
+ format->biWidth = vob->ex_v_width;
+ format->biHeight = vob->ex_v_height;
+ format->biCompression = (vob->im_v_codec==CODEC_RGB)?0:FOURCC('Y','V','1','2');
+ format->biBitCount = (vob->im_v_codec==CODEC_RGB)?24:0;
+
+ switch (vob->ex_frc) {
+ case 1: // 23.976
+ settings->input_clock = 24000;
+ settings->input_frame_period = 1001;
+ break;
+ case 2: // 24.000
+ settings->input_clock = 24000;
+ settings->input_frame_period = 1000;
+ break;
+ case 3: // 25.000
+ settings->input_clock = 25000;
+ settings->input_frame_period = 1000;
+ break;
+ case 4: // 29.970
+ settings->input_clock = 30000;
+ settings->input_frame_period = 1001;
+ break;
+ case 5: // 30.000
+ settings->input_clock = 30000;
+ settings->input_frame_period = 1000;
+ break;
+ case 0: // notset
+ default:
+ settings->input_clock = (int)vob->ex_fps*1000;
+ settings->input_frame_period = 1000;
+ break;
+ }
+
+ if (vob->divxlogfile && *vob->divxlogfile) {
+ if ((logfile_mv = malloc (strlen(vob->divxlogfile)+4)) == NULL) {
+ tc_log_error(MOD_NAME, "Cannot allocate memory for logfile_mv");
+ return(TC_EXPORT_ERROR);
+ }
+ tc_snprintf(logfile_mv, strlen(vob->divxlogfile)+4, "%s_mv", vob->divxlogfile);
+ }
+
+ // default -- expose this to user?
+ settings->complexity_modulation = 0.5;
+
+ settings->bitrate = vob->divxbitrate*1000;
+ settings->max_key_interval = vob->divxkeyframes;
+
+ settings->quality = vob->divxquality;
+
+ if (VbrMode == 1 || VbrMode == 2){
+ /*
+ * http://www.divx.com/support/divx/guide_mac.php
+ *
+ * Handheld 128000,262144,196608
+ * Portable 768000,1048576,786432
+ * Home Theatre Theatre 4000000,3145728,2359296
+ * High Definition 8000000,6291456,4718592
+ */
+
+ switch (vob->divx5_vbv_prof) {
+ case 1: // Handheld
+ settings->vbv_bitrate = 128000;
+ settings->vbv_size = 262144;
+ settings->vbv_occupancy = 196608;
+ break;
+ case 2: // Portable
+ settings->vbv_bitrate = 768000;
+ settings->vbv_size = 1048576;
+ settings->vbv_occupancy = 786432;
+ break;
+ case 3: // Home Theatre
+ settings->vbv_bitrate = 4000000;
+ settings->vbv_size = 3145728;
+ settings->vbv_occupancy = 2359296;
+ break;
+ case 4: // High Definition
+ settings->vbv_bitrate = 8000000;
+ settings->vbv_size = 6291456;
+ settings->vbv_occupancy = 4718592;
+ break;
+ case 0: // Free/user supplied
+ default:
+ settings->vbv_bitrate = vob->divx5_vbv_bitrate*400;
+ settings->vbv_size = vob->divx5_vbv_size*16384;
+ settings->vbv_occupancy = vob->divx5_vbv_occupancy*64;
+ break;
+ }
+ if (verbose & TC_DEBUG)
+ tc_log_info(MOD_NAME, "Using VBV Profile [%d] (%s)",
+ vob->divx5_vbv_prof,
+ prof2name(vob->divx5_vbv_prof));
+
+ }
+
+ switch(VbrMode) {
+ case 0:
+ break;
+ settings->vbr_mode = RCMODE_VBV_1PASS;
+ case 1:
+ settings->vbr_mode = RCMODE_VBV_MULTIPASS_1ST;
+ settings->mv_file = logfile_mv;
+ settings->log_file_read = NULL;
+ settings->log_file_write = vob->divxlogfile;
+
+ break;
+ case 2:
+ settings->vbr_mode = RCMODE_VBV_MULTIPASS_NTH;
+ settings->mv_file = logfile_mv;
+ settings->log_file_read = vob->divxlogfile;
+ // segfaults if !NULL;
+ settings->log_file_write = NULL;
+
+ break;
+
+ case 3:
+ settings->vbr_mode = RCMODE_1PASS_CONSTANT_Q;
+ settings->quantizer = vob->divxbitrate;
+ break;
+ }
+
+ // bframes .. lets see how to handle it
+ // the codec is crippled anyway
+ settings->use_bidirect = 0;
+
+ // don't need this.
+ settings->enable_crop = 0;
+ settings->enable_resize = 0;
+
+ if(divx5_encore(&encore_handle, ENC_OPT_INIT, format, settings) < 0) {
+ tc_log_warn(MOD_NAME, "Error doing ENC_OPT_INIT");
+ return(TC_EXPORT_ERROR);
+ }
+
+#else
+
+ if ((divx = malloc(sizeof(ENC_PARAM)))==NULL) {
+ tc_log_perror(MOD_NAME, "out of memory");
+ return(TC_EXPORT_ERROR);
+ }
+
+ memset(divx, 0, sizeof(ENC_PARAM));
+
+ //important parameter (Note: use_bidirect and obmc have been removed since DivX4)
+
+ divx->x_dim = vob->ex_v_width;
+ divx->y_dim = vob->ex_v_height;
+ divx->framerate = vob->ex_fps;
+ divx->bitrate = vob->divxbitrate*1000;
+
+ //recommended (advanced) parameter
+
+ divx->min_quantizer = vob->min_quantizer;
+ divx->max_quantizer = vob->max_quantizer;
+ divx->rc_period = vob->rc_period;
+ divx->rc_reaction_period = vob->rc_reaction_period;
+ divx->rc_reaction_ratio = vob->rc_reaction_ratio;
+
+ divx->max_key_interval = vob->divxkeyframes;
+ divx->quality = vob->divxquality;
+
+ divx->deinterlace=(vob->deinterlace==2) ? 1:0; // fast deinterlace = 1
+ divx->handle=NULL;
+
+ if(divx5_encore(NULL, ENC_OPT_INIT, divx, NULL) < 0) {
+ tc_log_warn(MOD_NAME, "DivX codec init error");
+ return(TC_EXPORT_ERROR);
+ }
+
+ // catch API mismatch
+ if(!divx || !divx->handle) {
+ tc_log_warn(MOD_NAME, "DivX codec open error");
+ return(TC_EXPORT_ERROR);
+ }
+
+ if(verbose_flag & TC_DEBUG)
+ {
+ //-- GMO start --
+ if (vob->divxmultipass == 3) {
+ tc_log_info(MOD_NAME, " single-pass session: %d (VBR)", vob->divxmultipass);
+ tc_log_info(MOD_NAME, " VBR-quantizer: %d", vob->divxbitrate);
+ } else {
+ tc_log_info(MOD_NAME, " multi-pass session: %d", vob->divxmultipass);
+ tc_log_info(MOD_NAME, " bitrate [kBits/s]: %d", divx->bitrate/1000);
+ }
+
+ tc_log_info(MOD_NAME, " quality: %d", divx->quality);
+ //-- GMO end --
+
+ tc_log_info(MOD_NAME, " crispness: %d", vob->divxcrispness);
+ tc_log_info(MOD_NAME, " max keyframe interval: %d", divx->max_key_interval);
+ tc_log_info(MOD_NAME, " frame rate: %.2f", vob->ex_fps);
+ tc_log_info(MOD_NAME, " color space: %s", (vob->im_v_codec==CODEC_RGB) ? "RGB24" : "YUV420P");
+ tc_log_info(MOD_NAME, " deinterlace: %d", divx->deinterlace);
+ }
+
+ encode.colorspace = (vob->im_v_codec==CODEC_RGB) ? ENC_CSP_RGB24:ENC_CSP_I420;
+ encode.mvs = NULL;
+
+ encode.bitstream = buffer;
+
+
+ switch(VbrMode) {
+
+ case 1:
+ VbrControl_init_2pass_vbr_analysis(vob->divxlogfile, divx->quality);
+ break;
+
+ case 2:
+
+ // check for logfile
+
+ if(vob->divxlogfile==NULL || stat(vob->divxlogfile, &fbuf)){
+ tc_log_warn(MOD_NAME, "pass-1 logfile \"%s\" not found exit",
+ vob->divxlogfile);
+ return(TC_EXPORT_ERROR);
+ }
+
+
+ // second pass: read back the logfile
+ VbrControl_init_2pass_vbr_encoding(vob->divxlogfile,
+ divx->bitrate,
+ divx->framerate,
+ vob->divxcrispness,
+ divx->quality);
+ break;
+
+ //-- GMO start --
+ case 3:
+ VbrControl_init_2pass_vbr_analysis(vob->divxlogfile, divx->quality);
+
+ encode.quant = vob->divxbitrate;
+ encode.intra = -1;
+ break;
+ //-- GMO end --
+
+ default:
+ // none
+ break;
+ }
+#endif
+
+ return(TC_EXPORT_OK);
+ }
+
+ if(param->flag == TC_AUDIO) {
+ tc_log_warn(MOD_NAME, "Usage of this module for audio encoding is deprecated.");
+ tc_log_warn(MOD_NAME, "Consider switch to export_tcaud module.");
+ return(tc_audio_init(vob, verbose));
+ }
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * open outputfile
+ *
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+
+ // open file
+ if(vob->avifile_out==NULL)
+ if(NULL == (vob->avifile_out = AVI_open_output_file(vob->video_out_file))) {
+ AVI_print_error("avi open error");
+ return(TC_EXPORT_ERROR);
+ }
+
+ /* save locally */
+ avifile = vob->avifile_out;
+
+ if(param->flag == TC_AUDIO) return(tc_audio_open(vob, vob->avifile_out));
+
+ if(param->flag == TC_VIDEO) {
+
+ // video
+#if ENCORE_MAJOR_VERSION >= 5010
+ AVI_set_video(vob->avifile_out, vob->ex_v_width, vob->ex_v_height,
+ vob->ex_fps, "DX50");
+#else
+ AVI_set_video(vob->avifile_out, vob->ex_v_width, vob->ex_v_height,
+ vob->ex_fps, "DIVX");
+#endif
+
+ if (vob->avi_comment_fd>0)
+ AVI_set_comment_fd(vob->avifile_out, vob->avi_comment_fd);
+
+ //do not force key frame at the very beginning of encoding, since
+ //first frame will be a key fame anayway. Therefore key.quantizer
+ //is well defined for any frame to follow
+ force_key_frame=(force_key_frame<0) ? 0:1;
+
+ return(0);
+ }
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * encode and export frame
+ *
+ * ------------------------------------------------------------*/
+
+
+MOD_encode
+{
+
+ if(param->flag == TC_VIDEO) {
+
+ // encode video
+
+ encode.image = param->buffer;
+ encode.bitstream = buffer;
+
+#if ENCORE_VERSION >= 20021024
+ encode.produce_empty_frame = 0;
+
+ do {
+ if(divx5_encore(encore_handle, ENC_OPT_ENCODE, &encode, &key) < 0) {
+ tc_log_warn(MOD_NAME, "DivX encoder error");
+ return(TC_EXPORT_ERROR);
+ }
+ // write bitstream
+ if(key.cType != '\0') {
+ /* split the AVI */
+ if((uint32_t)(AVI_bytes_written(avifile)+encode.length+16+8)>>20 >= tc_avi_limit)
+ tc_outstream_rotate_request();
+
+ //0.6.2: switch outfile on "C" and -J pv
+ if(key.cType == 'I') tc_outstream_rotate();
+
+ if(AVI_write_frame(avifile, buffer, encode.length, (key.cType == 'I')?1:0)<0) {
+ tc_log_warn(MOD_NAME, "DivX avi video write error");
+ return(TC_EXPORT_ERROR);
+ }
+ }
+ encode.image = NULL;
+ } while (encode.length >= 0 && key.cType != '\0');
+#else
+ switch(VbrMode) {
+
+ //-- GMO start --
+ case 3:
+
+ if (force_key_frame)
+ {
+ encode.intra = 1;
+ force_key_frame = 0;
+ }
+ else
+ encode.intra = -1;
+
+ if(divx5_encore(divx->handle, ENC_OPT_ENCODE_VBR, &encode, &key) < 0)
+ {
+ tc_log_warn(MOD_NAME, "encoder error");
+ return(TC_EXPORT_ERROR);
+ }
+
+
+ VbrControl_update_2pass_vbr_analysis(key.is_key_frame,
+ key.motion_bits,
+ key.texture_bits,
+ key.total_bits,
+ key.quantizer);
+ break;
+ //-- GMO end --
+
+ case 2:
+ // second pass of 2-pass, just a hack for the moment
+
+ encode.quant = VbrControl_get_quant();
+ encode.intra = VbrControl_get_intra();
+
+ if(force_key_frame) {
+ encode.intra=1; //key frame
+ force_key_frame=0; //reset
+ }
+
+ if(divx5_encore(divx->handle, ENC_OPT_ENCODE_VBR, &encode, &key) < 0) {
+ tc_log_warn(MOD_NAME, "encoder error");
+ return(TC_EXPORT_ERROR);
+ }
+
+ VbrControl_update_2pass_vbr_encoding(key.motion_bits,
+ key.texture_bits,
+ key.total_bits);
+ break;
+
+ default:
+
+ if(force_key_frame) {
+
+ encode.intra=1; //key frame
+ encode.quant=key.quantizer; //well defined for frames != first frame.
+
+ if(divx5_encore(divx->handle, ENC_OPT_ENCODE_VBR, &encode, &key) < 0) {
+ tc_log_warn(MOD_NAME, "encoder error");
+ return(TC_EXPORT_ERROR);
+ }
+
+ //reset
+ force_key_frame=0;
+
+ } else {
+
+ if(divx5_encore(divx->handle, ENC_OPT_ENCODE, &encode, &key) < 0) {
+ tc_log_warn(MOD_NAME, "encoder error");
+ return(TC_EXPORT_ERROR);
+ }
+ }
+
+ // first pass of two-pass, save results
+ if(VbrMode==1)
+ VbrControl_update_2pass_vbr_analysis(key.is_key_frame,
+ key.motion_bits,
+ key.texture_bits,
+ key.total_bits,
+ key.quantizer);
+ break;
+ }
+
+ // write bitstream
+
+ /* split the AVI */
+ if((uint32_t)(AVI_bytes_written(avifile)+encode.length+16+8)>>20 >= tc_avi_limit)
+ tc_outstream_rotate_request();
+
+ //0.6.2: switch outfile on "C" and -J pv
+ if(key.is_key_frame) tc_outstream_rotate();
+
+ if(AVI_write_frame(avifile, buffer, encode.length, key.is_key_frame)<0) {
+ tc_log_warn(MOD_NAME, "DivX avi video write error");
+ return(TC_EXPORT_ERROR);
+ }
+#endif
+
+ return(0);
+ }
+
+ if(param->flag == TC_AUDIO) return(tc_audio_encode(param->buffer, param->size, avifile));
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * close codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+
+ vob_t *vob = tc_get_vob();
+ if(param->flag == TC_AUDIO) return(tc_audio_close());
+
+ if(vob->avifile_out!=NULL) {
+ AVI_close(vob->avifile_out);
+ vob->avifile_out=NULL;
+ }
+
+ if(param->flag == TC_VIDEO) return(0);
+
+ return(TC_EXPORT_ERROR);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * stop encoder
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+
+ if(param->flag == TC_VIDEO) {
+#if ENCORE_VERSION >= 20021024
+ if(divx5_encore(encore_handle, ENC_OPT_RELEASE, NULL, NULL) < 0) {
+ tc_log_warn(MOD_NAME, "DivX encoder close error");
+ }
+#else
+ if(divx5_encore(divx->handle, ENC_OPT_RELEASE, NULL, NULL) < 0) {
+ tc_log_warn(MOD_NAME, "DivX encoder close error");
+ }
+#endif
+
+ if(buffer!=NULL) {
+ free(buffer);
+ buffer=NULL;
+ }
+
+ //remove codec
+ dlclose(handle);
+
+#if ENCORE_VERSION >= 20021024
+#else
+ switch(VbrMode) {
+
+ case 1:
+ case 2:
+ case 3:
+ VbrControl_close();
+ break;
+
+ default:
+ break;
+ }
+#endif
+
+ return(0);
+ }
+
+ if(param->flag == TC_AUDIO) return(tc_audio_stop());
+
+ return(TC_EXPORT_ERROR);
+}
+
diff --git a/debian/transcode/transcode-1.1.7/export/export_dv.c b/debian/transcode/transcode-1.1.7/export/export_dv.c
new file mode 100644
index 00000000..eb3b5f32
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_dv.c
@@ -0,0 +1,257 @@
+/*
+ * export_dv.c
+ *
+ * Copyright (C) Thomas Oestreich - June 2001
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#define MOD_NAME "export_dv.so"
+#define MOD_VERSION "v0.5 (2003-07-24)"
+#define MOD_CODEC "(video) Digital Video | (audio) MPEG/AC3/PCM"
+
+#include "transcode.h"
+#include "avilib/avilib.h"
+#include "aud_aux.h"
+#include "libtcvideo/tcvideo.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <libdv/dv.h>
+
+static int verbose_flag=TC_QUIET;
+static int capability_flag=TC_CAP_PCM|TC_CAP_RGB|TC_CAP_YUV|TC_CAP_AC3;
+
+#define MOD_PRE dv
+#include "export_def.h"
+
+static unsigned char *target; //[TC_FRAME_DV_PAL];
+
+static avi_t *avifile=NULL;
+
+static int frame_size=0, format=0;
+
+static int dv_yuy2_mode=0;
+
+static dv_encoder_t *encoder = NULL;
+static unsigned char *pixels[3], *tmp_buf;
+static TCVHandle tcvhandle;
+
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+
+ if(param->flag == TC_VIDEO) {
+ target = tc_bufalloc(TC_FRAME_DV_PAL);
+ tcvhandle = tcv_init();
+
+ if(vob->dv_yuy2_mode == 1) {
+ tmp_buf = tc_bufalloc(PAL_W*PAL_H*2); //max frame
+ dv_yuy2_mode=1;
+ }
+
+ encoder = dv_encoder_new(FALSE, FALSE, FALSE);
+
+ return(TC_EXPORT_OK);
+ }
+
+ if(param->flag == TC_AUDIO) {
+ tc_log_warn(MOD_NAME, "Usage of this module for audio encoding is deprecated.");
+ tc_log_warn(MOD_NAME, "Consider switch to export_tcaud module.");
+ return(tc_audio_init(vob, verbose_flag));
+ }
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * open outputfile
+ *
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+
+ // open out file
+ if(vob->avifile_out==NULL)
+ if(NULL == (vob->avifile_out = AVI_open_output_file(vob->video_out_file))) {
+ AVI_print_error("avi open error");
+ exit(TC_EXPORT_ERROR);
+ }
+
+ /* save locally */
+ avifile = vob->avifile_out;
+
+ if(param->flag == TC_VIDEO) {
+
+ AVI_set_video(vob->avifile_out, vob->ex_v_width, vob->ex_v_height, vob->ex_fps, "DVSD");
+
+ if (vob->avi_comment_fd>0)
+ AVI_set_comment_fd(vob->avifile_out, vob->avi_comment_fd);
+
+ switch(vob->im_v_codec) {
+
+ case CODEC_RGB:
+ format=0;
+ break;
+
+ case CODEC_YUV:
+ format=1;
+ break;
+
+ default:
+
+ tc_log_warn(MOD_NAME, "codec not supported");
+ return(TC_EXPORT_ERROR);
+
+ break;
+ }
+
+ // for reading
+ frame_size = (vob->ex_v_height==PAL_H) ? TC_FRAME_DV_PAL:TC_FRAME_DV_NTSC;
+
+ encoder->isPAL = (vob->ex_v_height==PAL_H);
+ encoder->is16x9 = FALSE;
+ encoder->vlc_encode_passes = 3;
+ encoder->static_qno = 0;
+ encoder->force_dct = DV_DCT_AUTO;
+
+ return(0);
+ }
+
+
+ if(param->flag == TC_AUDIO) return(tc_audio_open(vob, vob->avifile_out));
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * encode and export
+ *
+ * ------------------------------------------------------------*/
+
+MOD_encode
+{
+
+ int key;
+
+ if(param->flag == TC_VIDEO) {
+
+ time_t now = time(NULL);
+
+ if(dv_yuy2_mode) {
+ tcv_convert(tcvhandle, param->buffer, tmp_buf, PAL_W,
+ (encoder->isPAL) ? PAL_H : NTSC_H, IMG_YUV420P, IMG_YUY2);
+ pixels[0] = pixels[1] = pixels[2] = tmp_buf;
+ } else {
+ pixels[0] = param->buffer;
+ if(encoder->isPAL) {
+ pixels[1] = pixels[0] + PAL_W*PAL_H;
+ pixels[2] = pixels[1] + (PAL_W/2)*(PAL_H/2);
+ } else {
+ pixels[1] = pixels[0] + NTSC_W*NTSC_H;
+ pixels[2] = pixels[1] + (NTSC_W/2)*(NTSC_H/2);
+ }
+ }
+
+ dv_encode_full_frame(encoder, pixels, (format)?e_dv_color_yuv:e_dv_color_rgb, target);
+
+ dv_encode_metadata(target, encoder->isPAL, encoder->is16x9, &now, 0);
+ dv_encode_timecode(target, encoder->isPAL, 0);
+
+
+ // write video
+ // only keyframes
+ key = 1;
+
+ //0.6.2: switch outfile on "r/R" and -J pv
+ //0.6.2: enforce auto-split at 2G (or user value) for normal AVI files
+ if((uint32_t)(AVI_bytes_written(avifile)+frame_size+16+8)>>20 >= tc_avi_limit) tc_outstream_rotate_request();
+
+ if(key) tc_outstream_rotate();
+
+
+ if(AVI_write_frame(avifile, target, frame_size, key)<0) {
+ AVI_print_error("avi video write error");
+
+ return(TC_EXPORT_ERROR);
+ }
+ return(0);
+ }
+
+ if(param->flag == TC_AUDIO) return(tc_audio_encode(param->buffer, param->size, avifile));
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * stop encoder
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+
+ if(param->flag == TC_VIDEO) {
+
+ dv_encoder_free(encoder);
+ tcv_free(tcvhandle);
+
+ return(0);
+ }
+
+ if(param->flag == TC_AUDIO) return(tc_audio_stop());
+
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * close outputfiles
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+
+ vob_t *vob = tc_get_vob();
+ if(param->flag == TC_AUDIO) return(tc_audio_close());
+
+ //outputfile
+ if(vob->avifile_out!=NULL) {
+ AVI_close(vob->avifile_out);
+ vob->avifile_out=NULL;
+ }
+
+ if(param->flag == TC_VIDEO) return(0);
+
+ return(TC_EXPORT_ERROR);
+
+}
diff --git a/debian/transcode/transcode-1.1.7/export/export_dvraw.c b/debian/transcode/transcode-1.1.7/export/export_dvraw.c
new file mode 100644
index 00000000..b96100b2
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_dvraw.c
@@ -0,0 +1,334 @@
+/*
+ * export_dvraw.c
+ *
+ * Copyright (C) Thomas Oestreich - June 2001
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#define MOD_NAME "export_dvraw.so"
+#define MOD_VERSION "v0.4.1 (2007-08-17)"
+#define MOD_CODEC "(video) Digital Video | (audio) PCM"
+
+#include "transcode.h"
+#include "libtc/libtc.h"
+#include "libtc/optstr.h"
+#include "libtcvideo/tcvideo.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <libdv/dv.h>
+
+static int verbose_flag=TC_QUIET;
+static int capability_flag=TC_CAP_PCM|TC_CAP_RGB|TC_CAP_YUV|TC_CAP_VID|TC_CAP_YUV422;
+
+#define MOD_PRE dvraw
+#include "export_def.h"
+
+static int fd = -1;
+
+/* only 2 channesl supported */
+#define MAX_CHANNELS 2
+static int16_t *audio_bufs[MAX_CHANNELS] = { NULL, NULL };
+
+static uint8_t *target = NULL, *vbuf = NULL;
+
+static dv_encoder_t *encoder = NULL;
+static uint8_t *pixels[3] = { NULL, NULL, NULL }, *tmp_buf = NULL;
+static TCVHandle tcvhandle;
+
+static int frame_size = 0, format = 0;
+static int pass_through = 0;
+
+static int chans = 0, rate = 0;
+static int dv_yuy2_mode = 0;
+static int dv_uyvy_mode = 0;
+static int is_PAL = 0;
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+ int i;
+
+ if (param->flag == TC_VIDEO) {
+ is_PAL = (vob->ex_v_height == PAL_H);
+ target = tc_bufalloc(TC_FRAME_DV_PAL);
+ vbuf = tc_bufalloc(PAL_W * PAL_H * 3);
+
+ tcvhandle = tcv_init();
+
+ if (vob->dv_yuy2_mode == 1) {
+ tmp_buf = tc_bufalloc(PAL_W * PAL_H * 2); //max frame
+ dv_yuy2_mode = 1;
+ }
+
+ if (vob->im_v_codec == CODEC_YUV422) {
+ tmp_buf = tc_bufalloc(PAL_W * PAL_H * 2); //max frame
+ dv_uyvy_mode = 1;
+ }
+
+ encoder = dv_encoder_new(FALSE, FALSE, FALSE);
+ return TC_OK;
+ }
+
+ if (param->flag == TC_AUDIO) {
+ // tmp audio buffer
+ for ( i = 0; i < MAX_CHANNELS; i++) {
+ audio_bufs[i] = tc_malloc(DV_AUDIO_MAX_SAMPLES * sizeof(int16_t));
+ if (!(audio_bufs[i])) {
+ tc_log_error(MOD_NAME, "out of memory");
+ return TC_ERROR;
+ }
+ }
+ return TC_OK;
+ }
+
+ return(TC_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * open outputfile
+ *
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+ int bytealignment = 0, bytespersecond = 0, bytesperframe = 0;
+
+ if (param->flag == TC_VIDEO) {
+ fd = open(vob->video_out_file, O_RDWR|O_CREAT|O_TRUNC,
+ S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
+ if (fd < 0) {
+ tc_log_perror(MOD_NAME, "open file");
+ return TC_ERROR;
+ }
+
+ switch (vob->im_v_codec) {
+ case CODEC_RGB:
+ format = 0;
+ if (verbose >= TC_DEBUG)
+ tc_log_info(MOD_NAME, "raw format is RGB");
+ break;
+ case CODEC_YUV:
+ format = 1;
+ if (verbose >= TC_DEBUG)
+ tc_log_info(MOD_NAME, "raw format is YUV420P");
+ break;
+ case CODEC_YUV422:
+ format = 2;
+ if (verbose >= TC_DEBUG)
+ tc_log_info(MOD_NAME, "raw format is YUV422");
+ break;
+ case CODEC_RAW:
+ case CODEC_RAW_YUV:
+ format = 1;
+ pass_through = 1;
+ break;
+ default:
+ tc_log_warn(MOD_NAME, "codec not supported");
+ return TC_ERROR;
+ }
+
+ frame_size = (is_PAL) ?TC_FRAME_DV_PAL :TC_FRAME_DV_NTSC;
+
+ if (verbose >= TC_DEBUG)
+ tc_log_info(MOD_NAME, "encoding to %s DV",
+ (is_PAL) ?"PAL" :"NTSC");
+
+ // Store aspect ratio - ex_asr uses the value 3 for 16x9 (XXX: tricky)
+ encoder->is16x9 = (((vob->ex_asr < 0) ?vob->im_asr :vob->ex_asr) == 3);
+ encoder->isPAL = is_PAL;
+ encoder->vlc_encode_passes = 3;
+ encoder->static_qno = 0;
+ if (vob->ex_v_string != NULL)
+ if (optstr_get(vob->ex_v_string, "qno", "%d", &encoder->static_qno) == 1)
+ tc_log_info(MOD_NAME, "using quantisation: %d", encoder->static_qno);
+ encoder->force_dct = DV_DCT_AUTO;
+
+ return TC_OK;
+ }
+
+ if (param->flag == TC_AUDIO) {
+ if (!encoder) {
+ tc_log_warn(MOD_NAME, "-y XXX,dvraw is not possible without the video");
+ tc_log_warn(MOD_NAME, "export module also being dvraw");
+ return TC_ERROR;
+ }
+ chans = vob->dm_chan;
+ //re-sampling only with -J resample possible
+ rate = vob->a_rate;
+
+ bytealignment = (chans == 2) ?4 :2;
+ bytespersecond = rate * bytealignment;
+ bytesperframe = bytespersecond/(is_PAL ?25 :30);
+
+ if(verbose >= TC_DEBUG)
+ tc_log_info(MOD_NAME, "audio: CH=%d, f=%d, balign=%d, bps=%d, bpf=%d",
+ chans, rate, bytealignment, bytespersecond, bytesperframe);
+
+ return TC_OK;
+ }
+ return TC_ERROR;
+}
+
+/* ------------------------------------------------------------
+ *
+ * encode and export
+ *
+ * ------------------------------------------------------------*/
+
+MOD_encode
+{
+ int i;
+
+ if (param->flag == TC_VIDEO) {
+ if (pass_through) {
+ ac_memcpy(target, param->buffer, frame_size);
+ } else {
+ ac_memcpy(vbuf, param->buffer, param->size);
+ }
+
+ return TC_OK;
+ }
+
+ if (param->flag == TC_AUDIO) {
+ int16_t *abufs[2] = { audio_bufs[0], audio_bufs[1] }; /* working copies */
+ time_t now = time(NULL);
+ int achans = chans;
+
+ if (!pass_through) {
+ if (dv_uyvy_mode) {
+ tcv_convert(tcvhandle,
+ vbuf, tmp_buf, PAL_W, (encoder->isPAL) ? PAL_H : NTSC_H,
+ (format==2) ? IMG_YUV422P : IMG_YUV420P, IMG_UYVY);
+ pixels[0] = pixels[1] = pixels[2] = tmp_buf;
+ } else if (dv_yuy2_mode) {
+ tcv_convert(tcvhandle,
+ vbuf, tmp_buf, PAL_W, (encoder->isPAL) ? PAL_H : NTSC_H,
+ (format==2) ? IMG_YUV422P : IMG_YUV420P, IMG_YUY2);
+ pixels[0] = pixels[1] = pixels[2] = tmp_buf;
+ } else {
+ pixels[0] = vbuf;
+ if (encoder->isPAL) {
+ pixels[1] = pixels[0] + PAL_W*PAL_H;
+ pixels[2] = pixels[1] + (PAL_W/2)*(format==2?PAL_H:PAL_H/2);
+ } else {
+ pixels[1] = pixels[0] + NTSC_W*NTSC_H;
+ pixels[2] = pixels[1] + (NTSC_W/2)*(format==2?NTSC_H:NTSC_H/2);
+ }
+ }
+
+ dv_encode_full_frame(encoder, pixels, (format)?e_dv_color_yuv:e_dv_color_rgb, target);
+ } //no pass-through
+ /*
+ * samples * channels * bits = size;
+ * so
+ * samples = size / (channels * bits)
+ */
+ encoder->samples_this_frame = param->size / (chans * sizeof(int16_t));
+ dv_encode_metadata(target, encoder->isPAL, encoder->is16x9, &now, 0);
+ dv_encode_timecode(target, encoder->isPAL, 0);
+
+#ifdef WORDS_BIGENDIAN
+ for (i=0; i<param->size; i+=2) {
+ uint8_t tmp = param->buffer[i];
+ param->buffer[i] = param->buffer[i+1];
+ param->buffer[i+1] = tmp;
+ }
+#endif
+
+ // Although dv_encode_full_audio supports 4 channels, the internal
+ // PCM data (param->buffer) is only carrying 2 channels so only deal
+ // with 1 or 2 channel audio.
+ // Work around apparent bug in dv_encode_full_audio when chans == 1
+ // by putting silence in 2nd channel and calling with chans = 2
+ if (chans == 1) {
+ abufs[0] = (int16_t *)param->buffer; /* avoid ac_memcpy */
+ memset(abufs[1], 0, DV_AUDIO_MAX_SAMPLES * 2);
+ achans = 2;
+ } else {
+ // assume 2 channel, demultiplex for libdv API
+ for(i = 0; i < param->size/4; i++) { // XXX magic number
+ abufs[0][i] = ((int16_t *)param->buffer)[i * 2 ];
+ abufs[1][i] = ((int16_t *)param->buffer)[i * 2 + 1];
+ }
+ }
+ dv_encode_full_audio(encoder, abufs, achans, rate, target);
+
+ if (tc_pwrite(fd, target, frame_size) != frame_size) {
+ tc_log_perror(MOD_NAME, "write frame");
+ return TC_ERROR;
+ }
+
+ return TC_OK;
+ }
+
+ return TC_ERROR;
+}
+
+/* ------------------------------------------------------------
+ *
+ * stop encoder
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+ int i;
+
+ if (param->flag == TC_VIDEO) {
+ dv_encoder_free(encoder);
+ tcv_free(tcvhandle);
+ return TC_OK;
+ }
+
+ if (param->flag == TC_AUDIO) {
+ for(i = 0; i < MAX_CHANNELS; i++)
+ tc_free(audio_bufs[i]);
+ return TC_OK;
+ }
+
+ return TC_ERROR;
+}
+
+/* ------------------------------------------------------------
+ *
+ * close outputfiles
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+ if(param->flag == TC_VIDEO) {
+ close(fd);
+ return TC_OK;
+ }
+
+ if (param->flag == TC_AUDIO)
+ return TC_OK;
+
+ return TC_ERROR;
+}
+
+
diff --git a/debian/transcode/transcode-1.1.7/export/export_ffmpeg.c b/debian/transcode/transcode-1.1.7/export/export_ffmpeg.c
new file mode 100644
index 00000000..be252d4e
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_ffmpeg.c
@@ -0,0 +1,1831 @@
+/*
+ * export_ffmpeg.c
+ * based heavily on mplayers ve_lavc.c
+ *
+ * Copyright (C) Moritz Bunkus - October 2002
+ * UpToDate by Tilmann Bitterberg - July 2003
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include "transcode.h"
+#include "libtc/libtc.h"
+#include "libtc/tcavcodec.h"
+#include "filter.h"
+#include "avilib/avilib.h"
+#include "aud_aux.h"
+#include "aclib/imgconvert.h"
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <math.h>
+#include <time.h>
+
+#if !defined(INFINITY) && defined(HUGE_VAL)
+#define INFINITY HUGE_VAL
+#endif
+
+
+#define MOD_NAME "export_ffmpeg.so"
+#define MOD_VERSION "v0.3.18 (2008-11-29)"
+#define MOD_CODEC "(video) " LIBAVCODEC_IDENT \
+ " | (audio) MPEG/AC3/PCM"
+
+static int verbose_flag = TC_QUIET;
+static int capability_flag = TC_CAP_YUV|TC_CAP_RGB|TC_CAP_PCM|TC_CAP_AC3|
+ TC_CAP_AUD|TC_CAP_YUV422;
+#define MOD_PRE ffmpeg
+#include "export_def.h"
+
+#include "ffmpeg_cfg.h"
+
+
+/*************************************************************************
+ * libavcodec is not thread-safe. We must protect concurrent access to it.
+ * this is visible (without the mutex of course) with
+ * transcode .. -x ffmpeg -y ffmpeg -F mpeg4
+ */
+
+
+struct ffmpeg_codec {
+ char *name;
+ char *fourCC;
+ char *comments;
+ int multipass;
+};
+
+static struct ffmpeg_codec ffmpeg_codecs[] = {
+ {"mpeg4", "DIVX", "MPEG4 compliant video", 1},
+ {"msmpeg4", "div3", "old DivX3 compatible (aka MSMPEG4v3)", 1},
+ {"msmpeg4v2", "MP42", "old DivX3 compatible (older version)", 1},
+ {"mjpeg", "MJPG", "Motion JPEG", 0},
+ {"ljpeg", "LJPG", "Lossless JPEG", 0},
+ {"mpeg1video", "mpg1", "MPEG1 compliant video", 1},
+ {"mpeg2video", "mpg2", "MPEG2 compliant video", 1},
+ {"h263", "h263", "H263", 0},
+ {"h263p", "h263", "H263 plus", 1},
+ {"h264", "h264", "H264 (avc)", 1},
+ {"wmv1", "WMV1", "Windows Media Video v1", 1},
+ {"wmv2", "WMV2", "Windows Media Video v2", 1},
+ {"rv10", "RV10", "old RealVideo codec", 1},
+ {"huffyuv", "HFYU", "Lossless HUFFYUV codec", 1},
+ {"dvvideo", "DVSD", "Digital Video", 0},
+ {"ffv1", "FFV1", "FF Video Codec 1 (an experimental lossless codec)", 0},
+ {"asv1", "ASV1", "ASUS V1 codec", 0},
+ {"asv2", "ASV2", "ASUS V2 codec", 0},
+ {NULL, NULL, NULL, 0}
+};
+
+typedef enum /* do not edit without changing *_name and *_rate */
+{
+ pc_none,
+ pc_vcd,
+ pc_svcd,
+ pc_xvcd,
+ pc_dvd
+} pseudo_codec_t;
+
+typedef enum /* do not edit without changing *_name and *_rate */
+{
+ vt_none = 0,
+ vt_pal,
+ vt_ntsc
+} video_template_t;
+
+static pseudo_codec_t pseudo_codec = pc_none;
+static video_template_t video_template = vt_none;
+static char *real_codec = 0;
+static const char *pseudo_codec_name[] = { "none", "vcd", "svcd", "xvcd", "dvd" };
+static const int pseudo_codec_rate[] = { 0, 44100, 44100, -1, 48000 };
+static const char *vt_name[] = { "general", "pal/secam", "ntsc" };
+static const char *il_name[] = { "off", "top-first", "bottom-first", "unknown" };
+
+static uint8_t *enc_buffer = NULL;
+static uint8_t *img_buffer = NULL;
+static AVFrame *lavc_convert_frame = NULL;
+
+static AVCodec *lavc_venc_codec = NULL;
+static AVFrame *lavc_venc_frame = NULL;
+static AVCodecContext *lavc_venc_context;
+static avi_t *avifile = NULL;
+static int pix_fmt;
+static FILE *stats_file = NULL;
+static size_t size;
+static int encoded_frames = 0;
+static int frames = 0;
+static struct ffmpeg_codec *codec;
+static int is_mpegvideo = 0;
+static int is_huffyuv = 0;
+static int is_mjpeg = 0;
+static FILE *mpeg1fd = NULL;
+static int interlacing_active = 0;
+static int interlacing_top_first = 0;
+/* We can't declare lavc_param_psnr static so save it to this variable */
+static int do_psnr = 0;
+
+
+static struct ffmpeg_codec *find_ffmpeg_codec(char *name)
+{
+ int i = 0;
+ for (i = 0; ffmpeg_codecs[i].name != NULL; i++) {
+ if (!strcasecmp(name, ffmpeg_codecs[i].name))
+ return &ffmpeg_codecs[i];
+ }
+ return NULL;
+}
+
+/* second step name mangling */
+static const char *ffmpeg_codec_name(const char *tc_name)
+{
+#if LIBAVCODEC_VERSION_INT >= ((51<<16)+(44<<8)+0)
+ if (!strcmp(tc_name, "h264")) {
+ return "libx264";
+ }
+#endif
+ return tc_name;
+}
+
+static double psnr(double d) {
+ if (d == 0)
+ return INFINITY;
+ return -10.0 * log(d) / log(10);
+}
+
+
+// Could be using GNU extension 'strchrnul' instead:
+static char *tc_strchrnul(const char *s, int c) {
+ char *tmp = strchr(s, c);
+ if (tmp == NULL) {
+ tmp = s + strlen(s);
+ }
+ return tmp;
+}
+
+
+/* START: COPIED FROM ffmpeg-0.5_p22846(ffmpeg.c, cmdutils.c) */
+#include <libavcodec/opt.h>
+#include <libavutil/avstring.h>
+#include <libswscale/swscale.h>
+
+/* GLUE: */
+#define FFMPEG_DATADIR lavc_param_ffmpeg_datadir
+
+/* GLUE: */
+static AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB] = {NULL};
+
+static // GLUE
+const char **opt_names;
+static int opt_name_count;
+
+static char *audio_codec_name = NULL;
+static char *subtitle_codec_name = NULL;
+static char *video_codec_name = NULL;
+static int audio_stream_copy = 0;
+static int video_stream_copy = 0;
+static int subtitle_stream_copy = 0;
+
+static int av_exit(int ret)
+{
+ av_free(opt_names);
+
+ av_free(video_codec_name);
+ av_free(audio_codec_name);
+ av_free(subtitle_codec_name);
+
+ exit(ret); /* not all OS-es handle main() return value */
+ return ret;
+}
+
+static void opt_codec(int *pstream_copy, char **pcodec_name,
+ int codec_type, const char *arg)
+{
+ av_freep(pcodec_name);
+ if (!strcmp(arg, "copy")) {
+ *pstream_copy = 1;
+ } else {
+ *pcodec_name = av_strdup(arg);
+ }
+}
+
+static void opt_audio_codec(const char *arg)
+{
+ opt_codec(&audio_stream_copy, &audio_codec_name, AVMEDIA_TYPE_AUDIO, arg);
+}
+
+static void opt_video_codec(const char *arg)
+{
+ opt_codec(&video_stream_copy, &video_codec_name, AVMEDIA_TYPE_VIDEO, arg);
+}
+
+static void opt_subtitle_codec(const char *arg)
+{
+ opt_codec(&subtitle_stream_copy, &subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, arg);
+}
+
+static
+int opt_default(const char *opt, const char *arg){
+ int type;
+ int ret= 0;
+ const AVOption *o= NULL;
+ int opt_types[]={AV_OPT_FLAG_VIDEO_PARAM, AV_OPT_FLAG_AUDIO_PARAM, 0, AV_OPT_FLAG_SUBTITLE_PARAM, 0};
+
+ for(type=0; type<AVMEDIA_TYPE_NB && ret>= 0; type++){
+ /* GLUE: +if */
+ if (type == AVMEDIA_TYPE_VIDEO) {
+ const AVOption *o2 = av_find_opt(avcodec_opts[0], opt, NULL, opt_types[type], opt_types[type]);
+ if(o2)
+ ret = av_set_string3(avcodec_opts[type], opt, arg, 1, &o);
+ /* GLUE: +if */
+ }
+ }
+ /* GLUE: disabling
+ if(!o)
+ ret = av_set_string3(avformat_opts, opt, arg, 1, &o);
+ if(!o && sws_opts)
+ ret = av_set_string3(sws_opts, opt, arg, 1, &o);
+ */
+ if(!o){
+ /* GLUE: disabling
+ if(opt[0] == 'a')
+ ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_AUDIO], opt+1, arg, 1, &o);
+ else */ if(opt[0] == 'v')
+ ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_VIDEO], opt+1, arg, 1, &o);
+ /* GLUE: disabling
+ else if(opt[0] == 's')
+ ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], opt+1, arg, 1, &o);
+ */
+ }
+ if (o && ret < 0) {
+ fprintf(stderr, "Invalid value '%s' for option '%s'\n", arg, opt);
+ exit(1);
+ }
+ if (!o) {
+ fprintf(stderr, "Unrecognized option '%s'\n", opt);
+ exit(1);
+ }
+
+// av_log(NULL, AV_LOG_ERROR, "%s:%s: %f 0x%0X\n", opt, arg, av_get_double(avcodec_opts, opt, NULL), (int)av_get_int(avcodec_opts, opt, NULL));
+
+ //FIXME we should always use avcodec_opts, ... for storing options so there will not be any need to keep track of what i set over this
+ opt_names= av_realloc(opt_names, sizeof(void*)*(opt_name_count+1));
+ opt_names[opt_name_count++]= o->name;
+
+ /* GLUE: disabling
+ if(avcodec_opts[0]->debug || avformat_opts->debug)
+ av_log_set_level(AV_LOG_DEBUG);
+ */
+ return 0;
+}
+
+static int opt_preset(const char *opt, const char *arg)
+{
+ FILE *f=NULL;
+ char filename[1000], tmp[1000], tmp2[1000], line[1000];
+ int i;
+ const char *base[2]= { getenv("HOME"),
+ FFMPEG_DATADIR,
+ };
+
+ if (*opt != 'f') {
+ for(i=!base[0]; i<2 && !f; i++){
+ snprintf(filename, sizeof(filename), "%s%s/%s.ffpreset", base[i], i ? "" : "/.ffmpeg", arg);
+ f= fopen(filename, "r");
+ if(!f){
+ char *codec_name= *opt == 'v' ? video_codec_name :
+ *opt == 'a' ? audio_codec_name :
+ subtitle_codec_name;
+ snprintf(filename, sizeof(filename), "%s%s/%s-%s.ffpreset", base[i], i ? "" : "/.ffmpeg", codec_name, arg);
+ f= fopen(filename, "r");
+ }
+ }
+ } else {
+ av_strlcpy(filename, arg, sizeof(filename));
+ f= fopen(filename, "r");
+ }
+
+ if(!f){
+ fprintf(stderr, "File for preset '%s' not found\n", arg);
+ av_exit(1);
+ }
+
+ while(!feof(f)){
+ int e= fscanf(f, "%999[^\n]\n", line) - 1;
+ if(line[0] == '#' && !e)
+ continue;
+ e|= sscanf(line, "%999[^=]=%999[^\n]\n", tmp, tmp2) - 2;
+ if(e){
+ fprintf(stderr, "%s: Invalid syntax: '%s'\n", filename, line);
+ av_exit(1);
+ }
+ if(!strcmp(tmp, "acodec")){
+ opt_audio_codec(tmp2);
+ }else if(!strcmp(tmp, "vcodec")){
+ opt_video_codec(tmp2);
+ }else if(!strcmp(tmp, "scodec")){
+ opt_subtitle_codec(tmp2);
+ }else if(opt_default(tmp, tmp2) < 0){
+ fprintf(stderr, "%s: Invalid option or argument: '%s', parsed as '%s' = '%s'\n", filename, line, tmp, tmp2);
+ av_exit(1);
+ }
+ }
+
+ fclose(f);
+
+ return 0;
+}
+/* END: COPIED FROM ffmpeg-0.5_p22846(ffmpeg.c, cmdutils.c) */
+
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+ char *user_codec_string = NULL;
+
+ if (param->flag == TC_VIDEO) {
+ size_t fsize = 0;
+ char *p = NULL;
+ int i = 0, ret = 0;
+ /* Check if the user used '-F codecname' and abort if not. */
+
+ if (vob->ex_v_fcc) {
+ user_codec_string = tc_strdup(vob->ex_v_fcc);
+ tc_strstrip(user_codec_string);
+ }
+
+ if (!user_codec_string || !strlen(user_codec_string)) {
+ tc_log_info(MOD_NAME, "You must chose a codec by supplying '-F "
+ "<codecname>'. A list of supported codecs can be obtained with "
+ "'transcode -y ffmpeg -F list'.");
+
+ return TC_EXPORT_ERROR;
+ }
+
+ if (!strcasecmp(user_codec_string, "list")) {
+ tc_log_info(MOD_NAME, "List of known and supported codecs:");
+ tc_log_info(MOD_NAME, " Name fourCC multipass comments");
+ tc_log_info(MOD_NAME, " ---------- ------ --------- "
+ "-----------------------------------");
+ for (i = 0; ffmpeg_codecs[i].name != NULL; i++) {
+ tc_log_info(MOD_NAME, " %-10s %s %3s %s",
+ ffmpeg_codecs[i].name, ffmpeg_codecs[i].fourCC,
+ ffmpeg_codecs[i].multipass ? "yes" : "no",
+ ffmpeg_codecs[i].comments);
+ }
+ return TC_EXPORT_ERROR;
+ }
+
+ if (!strcmp(user_codec_string, "mpeg1"))
+ real_codec = tc_strdup("mpeg1video");
+ else if (!strcmp(user_codec_string, "mpeg2"))
+ real_codec = tc_strdup("mpeg2video");
+ else if (!strcmp(user_codec_string, "dv"))
+ real_codec = tc_strdup("dvvideo");
+ else
+ real_codec = tc_strdup(user_codec_string);
+
+ if (!strcmp(user_codec_string, "huffyuv"))
+ is_huffyuv = 1;
+
+ if (!strcmp(user_codec_string, "mjpeg")
+ || !strcmp(user_codec_string, "ljpeg")) {
+ int handle;
+
+ is_mjpeg = 1;
+
+ tc_log_info(MOD_NAME, "output is mjpeg or ljpeg, extending range from "
+ "YUV420P to YUVJ420P (full range)");
+
+ handle = tc_filter_add("levels", "input=16-240");
+ if (!handle)
+ tc_log_warn(MOD_NAME, "cannot load levels filter");
+ }
+
+ tc_free(user_codec_string);
+ user_codec_string = NULL;
+
+ p = strrchr(real_codec, '-');
+ if (p) { /* chop off -ntsc/-pal and set type */
+ *p++ = 0;
+
+ if (!strcmp(p, "ntsc")) {
+ video_template = vt_ntsc;
+ } else if (!strcmp(p, "pal")) {
+ video_template = vt_pal;
+ } else {
+ tc_log_warn(MOD_NAME, "Video template standard must be one of pal/ntsc");
+ return(TC_EXPORT_ERROR);
+ }
+ }
+
+ if (!strcmp(real_codec, "vcd")) {
+ tc_free(real_codec);
+ real_codec = tc_strdup("mpeg1video");
+ pseudo_codec = pc_vcd;
+ } else if (!strcmp(real_codec, "svcd")) {
+ tc_free(real_codec);
+ real_codec = tc_strdup("mpeg2video");
+ pseudo_codec = pc_svcd;
+ } else if(!strcmp(real_codec, "xvcd")) {
+ tc_free(real_codec);
+ real_codec = tc_strdup("mpeg2video");
+ pseudo_codec = pc_xvcd;
+ } else if(!strcmp(real_codec, "dvd")) {
+ tc_free(real_codec);
+ real_codec = tc_strdup("mpeg2video");
+ pseudo_codec = pc_dvd;
+ }
+
+ if (!strcmp(real_codec, "mpeg1video"))
+ is_mpegvideo = 1;
+
+ if (!strcmp(real_codec, "mpeg2video"))
+ is_mpegvideo = 2;
+
+ codec = find_ffmpeg_codec(real_codec);
+ if (codec == NULL) {
+ tc_log_warn(MOD_NAME, "Unknown codec '%s'.", real_codec);
+ return TC_EXPORT_ERROR;
+ }
+
+ TC_LOCK_LIBAVCODEC;
+ avcodec_init();
+ avcodec_register_all();
+ TC_UNLOCK_LIBAVCODEC;
+
+ /* -- get it -- */
+ lavc_venc_codec = avcodec_find_encoder_by_name(ffmpeg_codec_name(codec->name));
+ if (!lavc_venc_codec) {
+ tc_log_warn(MOD_NAME, "Could not find a FFMPEG codec for '%s'.",
+ codec->name);
+ return TC_EXPORT_ERROR;
+ }
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Using FFMPEG codec '%s' (FourCC '%s', %s).",
+ codec->name, codec->fourCC, codec->comments);
+ }
+
+ lavc_venc_context = avcodec_alloc_context();
+ lavc_venc_frame = avcodec_alloc_frame();
+
+ lavc_convert_frame= avcodec_alloc_frame();
+ size = avpicture_get_size(PIX_FMT_RGB24, vob->ex_v_width, vob->ex_v_height);
+ enc_buffer = tc_malloc(size);
+
+ if (lavc_venc_context == NULL || !enc_buffer || !lavc_convert_frame) {
+ tc_log_error(MOD_NAME, "Could not allocate enough memory.");
+ return TC_EXPORT_ERROR;
+ }
+
+ pix_fmt = vob->im_v_codec;
+
+ if (! (pix_fmt == CODEC_RGB || pix_fmt == CODEC_YUV || pix_fmt == CODEC_YUV422)) {
+ tc_log_warn(MOD_NAME, "Unknown color space %d.", pix_fmt);
+ return TC_EXPORT_ERROR;
+ }
+ if (pix_fmt == CODEC_RGB || pix_fmt == CODEC_YUV422 || is_huffyuv) {
+ img_buffer = tc_malloc(size);
+ if (!img_buffer) {
+ tc_log_error(MOD_NAME, "conversion buffer allocation failed.");
+ return TC_EXPORT_ERROR;
+ }
+ }
+
+ lavc_venc_context->width = vob->ex_v_width;
+ lavc_venc_context->height = vob->ex_v_height;
+ lavc_venc_context->qmin = vob->min_quantizer;
+ lavc_venc_context->qmax = vob->max_quantizer;
+
+ if (vob->export_attributes & TC_EXPORT_ATTRIBUTE_GOP)
+ lavc_venc_context->gop_size = vob->divxkeyframes;
+ else if (is_mpegvideo)
+ lavc_venc_context->gop_size = 15; /* conservative default for mpeg1/2 svcd/dvd */
+ else
+ lavc_venc_context->gop_size = 250; /* reasonable default for mpeg4 (and others) */
+
+ if (pseudo_codec != pc_none) { /* using profiles */
+ if (verbose) {
+ tc_log_info(MOD_NAME,
+ "Selected %s profile, %s video type for video",
+ pseudo_codec_name[pseudo_codec],
+ vt_name[video_template]);
+ }
+
+ if (!(vob->export_attributes & TC_EXPORT_ATTRIBUTE_FIELDS)) {
+ if (video_template == vt_pal) {
+ vob->encode_fields = TC_ENCODE_FIELDS_TOP_FIRST;
+ } else if (video_template == vt_ntsc) {
+ vob->encode_fields = TC_ENCODE_FIELDS_BOTTOM_FIRST;
+ } else {
+ tc_log_warn(MOD_NAME, "Interlacing parameters unknown, "
+ "select video type with profile");
+ vob->encode_fields = TC_ENCODE_FIELDS_UNKNOWN;
+ }
+
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Set interlacing to %s",
+ il_name[vob->encode_fields]);
+ }
+ }
+
+ if (!(vob->export_attributes & TC_EXPORT_ATTRIBUTE_FRC)) {
+ if (video_template == vt_pal)
+ vob->ex_frc = 3;
+ else if (video_template == vt_ntsc)
+ vob->ex_frc = 4;
+ else
+ vob->ex_frc = 0; /* unknown */
+ }
+
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Set frame rate to %s",
+ vob->ex_frc == 3 ? "25" :
+ vob->ex_frc == 4 ? "29.97" : "unknown");
+ }
+ }
+
+ switch(pseudo_codec) {
+ case(pc_vcd):
+ if (vob->ex_v_width != 352)
+ tc_log_warn(MOD_NAME, "X resolution is not 352 as required");
+
+ if (vob->ex_v_height != 240 && vob->ex_v_height != 288)
+ tc_log_warn(MOD_NAME, "Y resolution is not 240 or 288 as required");
+
+ if (vob->export_attributes & TC_EXPORT_ATTRIBUTE_VBITRATE) {
+ if (vob->divxbitrate != 1150)
+ tc_log_warn(MOD_NAME, "Video bitrate not 1150 kbps as required");
+ } else {
+ vob->divxbitrate = 1150;
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Set video bitrate to 1150");
+ }
+ }
+
+ if (vob->export_attributes & TC_EXPORT_ATTRIBUTE_GOP) {
+ if(vob->divxkeyframes > 9)
+ tc_log_warn(MOD_NAME, "GOP size not < 10 as required");
+ } else {
+ vob->divxkeyframes = 9;
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Set GOP size to 9");
+ }
+ }
+
+ lavc_venc_context->gop_size = vob->divxkeyframes;
+ lavc_param_rc_min_rate = 1150;
+ lavc_param_rc_max_rate = 1150;
+ lavc_param_rc_buffer_size = 40 * 8;
+ lavc_param_rc_buffer_aggressivity = 99;
+ lavc_param_scan_offset = 0;
+
+ break;
+
+ case(pc_svcd):
+ if (vob->ex_v_width != 480)
+ tc_log_warn(MOD_NAME, "X resolution is not 480 as required");
+
+ if (vob->ex_v_height != 480 && vob->ex_v_height != 576)
+ tc_log_warn(MOD_NAME, "Y resolution is not 480 or 576 as required");
+
+ if (vob->export_attributes & TC_EXPORT_ATTRIBUTE_VBITRATE) {
+ if(vob->divxbitrate != 2040)
+ tc_log_warn(MOD_NAME, "Video bitrate not 2040 kbps as required");
+ } else {
+ vob->divxbitrate = 2040;
+ tc_log_warn(MOD_NAME, "Set video bitrate to 2040");
+ }
+
+ if (vob->export_attributes & TC_EXPORT_ATTRIBUTE_GOP) {
+ if (vob->divxkeyframes > 18)
+ tc_log_warn(MOD_NAME, "GOP size not < 19 as required");
+ } else {
+ if (video_template == vt_ntsc)
+ vob->divxkeyframes = 18;
+ else
+ vob->divxkeyframes = 15;
+
+ tc_log_warn(MOD_NAME, "Set GOP size to %d", vob->divxkeyframes);
+ }
+
+ lavc_venc_context->gop_size = vob->divxkeyframes;
+ lavc_param_rc_min_rate= 0;
+ lavc_param_rc_max_rate = 2516;
+ lavc_param_rc_buffer_size = 224 * 8;
+ lavc_param_rc_buffer_aggressivity = 99;
+ lavc_param_scan_offset = CODEC_FLAG_SVCD_SCAN_OFFSET;
+
+ break;
+
+ case(pc_xvcd):
+ if (vob->ex_v_width != 480)
+ tc_log_warn(MOD_NAME, "X resolution is not 480 as required");
+
+ if (vob->ex_v_height != 480 && vob->ex_v_height != 576)
+ tc_log_warn(MOD_NAME, "Y resolution is not 480 or 576 as required");
+
+ if (vob->export_attributes & TC_EXPORT_ATTRIBUTE_VBITRATE) {
+ if (vob->divxbitrate < 1000 || vob->divxbitrate > 9000)
+ tc_log_warn(MOD_NAME, "Video bitrate not between 1000 and 9000 kbps as required");
+ } else {
+ vob->divxbitrate = 2040;
+ tc_log_warn(MOD_NAME, "Set video bitrate to 2040");
+ }
+
+ if (vob->export_attributes & TC_EXPORT_ATTRIBUTE_GOP) {
+ if (vob->divxkeyframes > 18)
+ tc_log_warn(MOD_NAME, "GOP size not < 19 as required");
+ } else {
+ if (video_template == vt_ntsc)
+ vob->divxkeyframes = 18;
+ else
+ vob->divxkeyframes = 15;
+
+ tc_log_warn(MOD_NAME, "Set GOP size to %d", vob->divxkeyframes);
+ }
+
+ lavc_venc_context->gop_size = vob->divxkeyframes;
+ lavc_param_rc_min_rate = 0;
+ if (vob->video_max_bitrate != 0)
+ lavc_param_rc_max_rate = vob->video_max_bitrate;
+ else
+ lavc_param_rc_max_rate = 5000;
+
+ lavc_param_rc_buffer_size = 224 * 8;
+ lavc_param_rc_buffer_aggressivity = 99;
+ lavc_param_scan_offset = CODEC_FLAG_SVCD_SCAN_OFFSET;
+
+ break;
+
+ case(pc_dvd):
+ if (vob->ex_v_width != 720 && vob->ex_v_width != 704 && vob->ex_v_width != 352)
+ tc_log_warn(MOD_NAME, "X resolution is not 720, 704 or 352 as required");
+
+ if (vob->ex_v_height != 576 && vob->ex_v_height != 480 && vob->ex_v_height != 288 && vob->ex_v_height != 240)
+ tc_log_warn(MOD_NAME, "Y resolution is not 576, 480, 288 or 240 as required");
+
+ if (vob->export_attributes & TC_EXPORT_ATTRIBUTE_VBITRATE) {
+ if(vob->divxbitrate < 1000 || vob->divxbitrate > 9800)
+ tc_log_warn(MOD_NAME, "Video bitrate not between 1000 and 9800 kbps as required");
+ } else {
+ vob->divxbitrate = 5000;
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Set video bitrate to 5000");
+ }
+ }
+
+ if (vob->export_attributes & TC_EXPORT_ATTRIBUTE_GOP) {
+ if (vob->divxkeyframes > 18)
+ tc_log_warn(MOD_NAME, "GOP size not < 19 as required");
+ } else {
+ if (video_template == vt_ntsc)
+ vob->divxkeyframes = 18;
+ else
+ vob->divxkeyframes = 15;
+
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Set GOP size to %d",
+ vob->divxkeyframes);
+ }
+ }
+
+ lavc_venc_context->gop_size = vob->divxkeyframes;
+ lavc_param_rc_min_rate = 0;
+ lavc_param_rc_max_rate = 6000; /*FIXME: ffmpeg exceeds maxrate in 2-pass*/
+ lavc_param_rc_buffer_size = 224 * 8;
+ lavc_param_rc_buffer_aggressivity = 99;
+
+ break;
+
+ case(pc_none): /* leave everything alone, prevent gcc warning */
+ if (verbose) {
+ tc_log_info(MOD_NAME, "No profile selected");
+ }
+
+ break;
+ }
+
+ switch (vob->ex_frc) {
+ case 1: /* 23.976 */
+ lavc_venc_context->time_base.den = 24000;
+ lavc_venc_context->time_base.num = 1001;
+ break;
+ case 2: /* 24.000 */
+ lavc_venc_context->time_base.den = 24000;
+ lavc_venc_context->time_base.num = 1000;
+ break;
+ case 3: /* 25.000 */
+ lavc_venc_context->time_base.den = 25000;
+ lavc_venc_context->time_base.num = 1000;
+ break;
+ case 4: /* 29.970 */
+ lavc_venc_context->time_base.den = 30000;
+ lavc_venc_context->time_base.num = 1001;
+ break;
+ case 5: /* 30.000 */
+ lavc_venc_context->time_base.den = 30000;
+ lavc_venc_context->time_base.num = 1000;
+ break;
+ case 6: /* 50.000 */
+ lavc_venc_context->time_base.den = 50000;
+ lavc_venc_context->time_base.num = 1000;
+ break;
+ case 7: /* 59.940 */
+ lavc_venc_context->time_base.den = 60000;
+ lavc_venc_context->time_base.num = 1001;
+ break;
+ case 8: /* 60.000 */
+ lavc_venc_context->time_base.den = 60000;
+ lavc_venc_context->time_base.num = 1000;
+ break;
+ case 0: /* not set */
+ default:
+ if ((vob->ex_fps > 29) && (vob->ex_fps < 30)) {
+ lavc_venc_context->time_base.den = 30000;
+ lavc_venc_context->time_base.num = 1001;
+ } else {
+ lavc_venc_context->time_base.den = (int)(vob->ex_fps * 1000.0);
+ lavc_venc_context->time_base.num = 1000;
+ }
+ break;
+ }
+
+ module_read_config("ffmpeg.cfg", codec->name, lavcopts_conf, MOD_NAME);
+ if (verbose_flag & TC_DEBUG) {
+ tc_log_info(MOD_NAME, "Using the following FFMPEG parameters:");
+ module_print_config(lavcopts_conf, MOD_NAME);
+ }
+
+ /* this overrides transcode settings */
+ if (lavc_param_fps_code > 0) {
+ switch (lavc_param_fps_code) {
+ case 1: /* 23.976 */
+ lavc_venc_context->time_base.den = 24000;
+ lavc_venc_context->time_base.num = 1001;
+ break;
+ case 2: /* 24.000 */
+ lavc_venc_context->time_base.den = 24000;
+ lavc_venc_context->time_base.num = 1000;
+ break;
+ case 3: /* 25.000 */
+ lavc_venc_context->time_base.den = 25000;
+ lavc_venc_context->time_base.num = 1000;
+ break;
+ case 4: /* 29.970 */
+ lavc_venc_context->time_base.den = 30000;
+ lavc_venc_context->time_base.num = 1001;
+ break;
+ case 5: /* 30.000 */
+ lavc_venc_context->time_base.den = 30000;
+ lavc_venc_context->time_base.num = 1000;
+ break;
+ case 6: /* 50.000 */
+ lavc_venc_context->time_base.den = 50000;
+ lavc_venc_context->time_base.num = 1000;
+ break;
+ case 7: /* 59.940 */
+ lavc_venc_context->time_base.den = 60000;
+ lavc_venc_context->time_base.num = 1001;
+ break;
+ case 8: /* 60.000 */
+ lavc_venc_context->time_base.den = 60000;
+ lavc_venc_context->time_base.num = 1000;
+ break;
+ case 0: /* not set */
+ default:
+ /*
+ * lavc_venc_context->time_base.den = (int)(vob->ex_fps * 1000.0);
+ * lavc_venc_context->time_base.num = 1000;
+ */
+ break;
+ }
+ }
+
+ /* closedgop requires scene detection to be disabled separately */
+ if (lavc_param_closedgop)
+ lavc_param_sc_threshold = 1000000000;
+
+ lavc_venc_context->bit_rate = vob->divxbitrate * 1000;
+ lavc_venc_context->bit_rate_tolerance = lavc_param_vrate_tolerance * 1000;
+ lavc_venc_context->lmin= (int)(FF_QP2LAMBDA * lavc_param_lmin + 0.5);
+ lavc_venc_context->lmax= (int)(FF_QP2LAMBDA * lavc_param_lmax + 0.5);
+ lavc_venc_context->max_qdiff = lavc_param_vqdiff;
+ lavc_venc_context->qcompress = lavc_param_vqcompress;
+ lavc_venc_context->qblur = lavc_param_vqblur;
+ lavc_venc_context->max_b_frames = lavc_param_vmax_b_frames;
+ lavc_venc_context->b_quant_factor = lavc_param_vb_qfactor;
+ lavc_venc_context->rc_strategy = lavc_param_vrc_strategy;
+ lavc_venc_context->b_frame_strategy = lavc_param_vb_strategy;
+ lavc_venc_context->b_quant_offset = lavc_param_vb_qoffset;
+ lavc_venc_context->luma_elim_threshold= lavc_param_luma_elim_threshold;
+ lavc_venc_context->chroma_elim_threshold= lavc_param_chroma_elim_threshold;
+ lavc_venc_context->rtp_payload_size = lavc_param_packet_size;
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
+ if (lavc_param_packet_size)
+ lavc_venc_context->rtp_mode = 1;
+#endif
+ lavc_venc_context->strict_std_compliance= lavc_param_strict;
+ lavc_venc_context->i_quant_factor = lavc_param_vi_qfactor;
+ lavc_venc_context->i_quant_offset = lavc_param_vi_qoffset;
+ lavc_venc_context->rc_qsquish = lavc_param_rc_qsquish;
+ lavc_venc_context->rc_qmod_amp = lavc_param_rc_qmod_amp;
+ lavc_venc_context->rc_qmod_freq = lavc_param_rc_qmod_freq;
+ lavc_venc_context->rc_eq = lavc_param_rc_eq;
+ lavc_venc_context->rc_max_rate = lavc_param_rc_max_rate * 1000;
+ lavc_venc_context->rc_min_rate = lavc_param_rc_min_rate * 1000;
+ lavc_venc_context->rc_buffer_size = lavc_param_rc_buffer_size * 1024;
+ lavc_venc_context->rc_buffer_aggressivity= lavc_param_rc_buffer_aggressivity;
+ lavc_venc_context->rc_initial_cplx = lavc_param_rc_initial_cplx;
+ lavc_venc_context->debug = lavc_param_debug;
+ lavc_venc_context->last_predictor_count= lavc_param_last_pred;
+ lavc_venc_context->pre_me = lavc_param_pre_me;
+ lavc_venc_context->me_pre_cmp = lavc_param_me_pre_cmp;
+ lavc_venc_context->pre_dia_size = lavc_param_pre_dia_size;
+ lavc_venc_context->me_subpel_quality = lavc_param_me_subpel_quality;
+ lavc_venc_context->me_range = lavc_param_me_range;
+ lavc_venc_context->intra_quant_bias = lavc_param_ibias;
+ lavc_venc_context->inter_quant_bias = lavc_param_pbias;
+ lavc_venc_context->coder_type = lavc_param_coder;
+ lavc_venc_context->context_model = lavc_param_context;
+ lavc_venc_context->scenechange_threshold= lavc_param_sc_threshold;
+ lavc_venc_context->noise_reduction = lavc_param_noise_reduction;
+ lavc_venc_context->inter_threshold = lavc_param_inter_threshold;
+ lavc_venc_context->intra_dc_precision = lavc_param_intra_dc_precision;
+ lavc_venc_context->skip_top = lavc_param_skip_top;
+ lavc_venc_context->skip_bottom = lavc_param_skip_bottom;
+
+ if ((lavc_param_threads < 1) || (lavc_param_threads > 7)) {
+ tc_log_warn(MOD_NAME, "Thread count out of range (should be [0-7])");
+ return(TC_EXPORT_ERROR);
+ }
+
+ lavc_venc_context->thread_count = lavc_param_threads;
+
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Starting %d thread(s)",
+ lavc_venc_context->thread_count);
+ }
+
+ avcodec_thread_init(lavc_venc_context, lavc_param_threads);
+
+ if (lavc_param_intra_matrix) {
+ char *tmp;
+
+ lavc_venc_context->intra_matrix =
+ malloc(sizeof(*lavc_venc_context->intra_matrix) * 64);
+
+ for (i = 0;
+ (tmp = strsep(&lavc_param_intra_matrix, ",")) && (i < 64);
+ i++) {
+ if (!tmp || (tmp && !strlen(tmp)))
+ break;
+ lavc_venc_context->intra_matrix[i] = atoi(tmp);
+ }
+
+ if (i != 64) {
+ free(lavc_venc_context->intra_matrix);
+ lavc_venc_context->intra_matrix = NULL;
+ } else {
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Using user specified intra matrix");
+ }
+ }
+ }
+
+ if (lavc_param_inter_matrix) {
+ char *tmp;
+
+ lavc_venc_context->inter_matrix =
+ malloc(sizeof(*lavc_venc_context->inter_matrix) * 64);
+
+ for (i = 0;
+ (tmp = strsep(&lavc_param_intra_matrix, ",")) && (i < 64);
+ i++) {
+ if (!tmp || (tmp && !strlen(tmp)))
+ break;
+ lavc_venc_context->inter_matrix[i] = atoi(tmp);
+ }
+
+ if (i != 64) {
+ free(lavc_venc_context->inter_matrix);
+ lavc_venc_context->inter_matrix = NULL;
+ } else {
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Using user specified inter matrix");
+ }
+ }
+ }
+
+ p = lavc_param_rc_override_string;
+ for (i = 0; p; i++) {
+ int start, end, q;
+ int e = sscanf(p, "%d,%d,%d", &start, &end, &q);
+
+ if (e != 3) {
+ tc_log_warn(MOD_NAME, "Error parsing vrc_override.");
+ return TC_EXPORT_ERROR;
+ }
+ lavc_venc_context->rc_override =
+ realloc(lavc_venc_context->rc_override, sizeof(RcOverride) * (i + 1));
+ lavc_venc_context->rc_override[i].start_frame = start;
+ lavc_venc_context->rc_override[i].end_frame = end;
+ if (q > 0) {
+ lavc_venc_context->rc_override[i].qscale = q;
+ lavc_venc_context->rc_override[i].quality_factor = 1.0;
+ } else {
+ lavc_venc_context->rc_override[i].qscale = 0;
+ lavc_venc_context->rc_override[i].quality_factor = -q / 100.0;
+ }
+ p = strchr(p, '/');
+ if (p)
+ p++;
+ }
+ lavc_venc_context->rc_override_count = i;
+ lavc_venc_context->mpeg_quant = lavc_param_mpeg_quant;
+ lavc_venc_context->dct_algo = lavc_param_fdct;
+ lavc_venc_context->idct_algo = lavc_param_idct;
+ lavc_venc_context->lumi_masking = lavc_param_lumi_masking;
+ lavc_venc_context->temporal_cplx_masking = lavc_param_temporal_cplx_masking;
+ lavc_venc_context->spatial_cplx_masking = lavc_param_spatial_cplx_masking;
+ lavc_venc_context->p_masking = lavc_param_p_masking;
+ lavc_venc_context->dark_masking = lavc_param_dark_masking;
+
+ if (vob->export_attributes & TC_EXPORT_ATTRIBUTE_PAR) { /* export_par explicitely set by user */
+ if (vob->ex_par > 0) {
+ switch(vob->ex_par) {
+ case 1:
+ lavc_venc_context->sample_aspect_ratio.num = 1;
+ lavc_venc_context->sample_aspect_ratio.den = 1;
+ break;
+ case 2:
+ lavc_venc_context->sample_aspect_ratio.num = 1200;
+ lavc_venc_context->sample_aspect_ratio.den = 1100;
+ break;
+ case 3:
+ lavc_venc_context->sample_aspect_ratio.num = 1000;
+ lavc_venc_context->sample_aspect_ratio.den = 1100;
+ break;
+ case 4:
+ lavc_venc_context->sample_aspect_ratio.num = 1600;
+ lavc_venc_context->sample_aspect_ratio.den = 1100;
+ break;
+ case 5:
+ lavc_venc_context->sample_aspect_ratio.num = 4000;
+ lavc_venc_context->sample_aspect_ratio.den = 3300;
+ break;
+ default:
+ tc_log_warn(MOD_NAME, "Parameter value for --export_par out of range (allowed: [1-5])");
+ return(TC_EXPORT_ERROR);
+ }
+ } else {
+ if (vob->ex_par_width > 0 && vob->ex_par_height > 0) {
+ lavc_venc_context->sample_aspect_ratio.num = vob->ex_par_width;
+ lavc_venc_context->sample_aspect_ratio.den = vob->ex_par_height;
+ } else {
+ tc_log_warn(MOD_NAME, "Parameter values for --export_par parameter out of range (allowed: [>0]/[>0])");
+ lavc_venc_context->sample_aspect_ratio.num = 1;
+ lavc_venc_context->sample_aspect_ratio.den = 1;
+ }
+ }
+ } else {
+ double dar, sar;
+
+ if (vob->export_attributes & TC_EXPORT_ATTRIBUTE_ASR) { /* export_asr explicitely set by user */
+ if (vob->ex_asr > 0) {
+ switch(vob->ex_asr) {
+ case 1: dar = 1.0; break;
+ case 2: dar = 4.0/3.0; break;
+ case 3: dar = 16.0/9.0; break;
+ case 4: dar = 221.0/100.0; break;
+ default:
+ tc_log_warn(MOD_NAME, "Parameter value to --export_asr out of range (allowed: [1-4])");
+ return(TC_EXPORT_ERROR);
+ }
+
+ sar = dar * ((double)vob->ex_v_height / (double)vob->ex_v_width);
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Display aspect ratio calculated"
+ " as %f", dar);
+ tc_log_info(MOD_NAME, "Sample aspect ratio calculated"
+ " as %f", sar);
+ }
+ lavc_venc_context->sample_aspect_ratio.num = (int)(sar * 1000);
+ lavc_venc_context->sample_aspect_ratio.den = 1000;
+ } else {
+ tc_log_warn(MOD_NAME, "Parameter value to --export_asr out of range (allowed: [1-4])");
+ return(TC_EXPORT_ERROR);
+ }
+ } else { /* user did not specify asr at all, assume no change */
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Set display aspect ratio to input");
+ }
+ /*
+ * sar = (4.0 * ((double)vob->ex_v_height) / (3.0 * (double)vob->ex_v_width));
+ * lavc_venc_context->sample_aspect_ratio.num = (int)(sar * 1000);
+ * lavc_venc_context->sample_aspect_ratio.den = 1000;
+ */
+ lavc_venc_context->sample_aspect_ratio.num = 1;
+ lavc_venc_context->sample_aspect_ratio.den = 1;
+ }
+ }
+
+ lavc_venc_context->flags = 0;
+
+ if (lavc_param_mb_decision)
+ lavc_venc_context->mb_decision= lavc_param_mb_decision;
+
+ lavc_venc_context->me_cmp = lavc_param_me_cmp;
+ lavc_venc_context->me_sub_cmp = lavc_param_me_sub_cmp;
+ lavc_venc_context->mb_cmp = lavc_param_mb_cmp;
+ lavc_venc_context->ildct_cmp = lavc_param_ildct_cmp;
+ lavc_venc_context->dia_size = lavc_param_dia_size;
+ lavc_venc_context->flags |= lavc_param_qpel;
+ lavc_venc_context->flags |= lavc_param_gmc;
+ lavc_venc_context->flags |= lavc_param_closedgop;
+ lavc_venc_context->flags |= lavc_param_trunc;
+ lavc_venc_context->flags |= lavc_param_aic;
+ lavc_venc_context->flags |= lavc_param_umv;
+ lavc_venc_context->flags |= lavc_param_v4mv;
+ lavc_venc_context->flags |= lavc_param_data_partitioning;
+ lavc_venc_context->flags |= lavc_param_cbp;
+ lavc_venc_context->flags |= lavc_param_mv0;
+ lavc_venc_context->flags |= lavc_param_qp_rd;
+ lavc_venc_context->flags |= lavc_param_scan_offset;
+ lavc_venc_context->flags |= lavc_param_ss;
+ lavc_venc_context->flags |= lavc_param_alt;
+ lavc_venc_context->flags |= lavc_param_ilme;
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
+ lavc_venc_context->flags |= lavc_param_trell;
+#else
+ lavc_venc_context->trellis = lavc_param_trell;
+#endif
+
+ if (lavc_param_gray)
+ lavc_venc_context->flags |= CODEC_FLAG_GRAY;
+ if (lavc_param_normalize_aqp)
+ lavc_venc_context->flags |= CODEC_FLAG_NORMALIZE_AQP;
+
+ switch(vob->encode_fields) {
+ case TC_ENCODE_FIELDS_TOP_FIRST:
+ interlacing_active = 1;
+ interlacing_top_first = 1;
+ break;
+ case TC_ENCODE_FIELDS_BOTTOM_FIRST:
+ interlacing_active = 1;
+ interlacing_top_first = 0;
+ break;
+ default: /* progressive / unknown */
+ interlacing_active = 0;
+ interlacing_top_first = 0;
+ break;
+ }
+
+ lavc_venc_context->flags |= interlacing_active ?
+ CODEC_FLAG_INTERLACED_DCT : 0;
+ lavc_venc_context->flags |= interlacing_active ?
+ CODEC_FLAG_INTERLACED_ME : 0;
+
+ lavc_venc_context->flags |= lavc_param_psnr;
+ do_psnr = lavc_param_psnr;
+
+ lavc_venc_context->prediction_method = lavc_param_prediction_method;
+
+ if(is_huffyuv)
+ lavc_venc_context->pix_fmt = PIX_FMT_YUV422P;
+ else
+ {
+ switch(pix_fmt)
+ {
+ case CODEC_YUV:
+ case CODEC_RGB:
+ {
+ if(is_mjpeg)
+ lavc_venc_context->pix_fmt = PIX_FMT_YUVJ420P;
+ else
+ lavc_venc_context->pix_fmt = PIX_FMT_YUV420P;
+ break;
+ }
+
+ case CODEC_YUV422:
+ {
+ if(is_mjpeg)
+ lavc_venc_context->pix_fmt = PIX_FMT_YUVJ422P;
+ else
+ lavc_venc_context->pix_fmt = PIX_FMT_YUV422P;
+ break;
+ }
+
+ default:
+ {
+ tc_log_warn(MOD_NAME, "Unknown pixel format %d.", pix_fmt);
+ return TC_EXPORT_ERROR;
+ }
+ }
+ }
+
+ switch (vob->divxmultipass) {
+ case 1:
+ if (!codec->multipass) {
+ tc_log_warn(MOD_NAME, "This codec does not support multipass "
+ "encoding.");
+ return TC_EXPORT_ERROR;
+ }
+ lavc_venc_context->flags |= CODEC_FLAG_PASS1;
+ stats_file = fopen(vob->divxlogfile, "w");
+ if (stats_file == NULL){
+ tc_log_warn(MOD_NAME, "Could not create 2pass log file \"%s\".",
+ vob->divxlogfile);
+ return TC_EXPORT_ERROR;
+ }
+ break;
+ case 2:
+ if (!codec->multipass) {
+ tc_log_warn(MOD_NAME, "This codec does not support multipass "
+ "encoding.");
+ return TC_EXPORT_ERROR;
+ }
+ lavc_venc_context->flags |= CODEC_FLAG_PASS2;
+ stats_file= fopen(vob->divxlogfile, "r");
+ if (stats_file==NULL){
+ tc_log_warn(MOD_NAME, "Could not open 2pass log file \"%s\" for "
+ "reading.", vob->divxlogfile);
+ return TC_EXPORT_ERROR;
+ }
+ fseek(stats_file, 0, SEEK_END);
+ fsize = ftell(stats_file);
+ fseek(stats_file, 0, SEEK_SET);
+
+ // count the lines of the file to not encode to much
+ {
+ char lbuf[255];
+ while (fgets (lbuf, 255, stats_file))
+ encoded_frames++;
+ }
+
+ fseek(stats_file, 0, SEEK_SET);
+
+ lavc_venc_context->stats_in= malloc(fsize + 1);
+ lavc_venc_context->stats_in[fsize] = 0;
+
+ if (fread(lavc_venc_context->stats_in, fsize, 1, stats_file) < 1){
+ tc_log_warn(MOD_NAME, "Could not read the complete 2pass log file "
+ "\"%s\".", vob->divxlogfile);
+ return TC_EXPORT_ERROR;
+ }
+ break;
+ case 3:
+ /* fixed qscale :p */
+ lavc_venc_context->flags |= CODEC_FLAG_QSCALE;
+ lavc_venc_frame->quality = vob->divxbitrate;
+ break;
+ }
+
+ lavc_venc_context->me_method = ME_ZERO + lavc_param_vme;
+
+
+ /* FIXME: transcode itself contains "broken ffmpeg default settings", thus we need to override them! */
+ if (lavc_param_video_preset) {
+ avcodec_opts[AVMEDIA_TYPE_VIDEO] = lavc_venc_context;
+ video_codec_name = ffmpeg_codec_name(codec->name);
+
+ const char *preset_start = lavc_param_video_preset;
+ while (preset_start) {
+ const char *preset_end = tc_strchrnul(preset_start, ',');
+ char preset_name[255] = {'\0'};
+
+ if (strncpy(preset_name, preset_start, preset_end-preset_start) != preset_name) {
+ tc_log_warn(MOD_NAME, "Extracting preset name failed");
+ return TC_EXPORT_ERROR;
+ }
+
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Parsing ffmpeg preset '%s'", preset_name);
+ }
+ if (opt_preset("vpre", preset_name) != 0) {
+ tc_log_warn(MOD_NAME, "Parsing ffmpeg preset '%s' failed", preset_name);
+ }
+ if (verbose) {
+ int i;
+ tc_log_info(MOD_NAME, "After parsing preset '%s', %i options are overridden:", preset_name, opt_name_count);
+ for (i=0; i < opt_name_count; i++)
+ tc_log_info(MOD_NAME, "-- %s", opt_names[i]);
+ }
+
+ if (*preset_end != '\0') {
+ preset_start = preset_end+1;
+ }
+ else {
+ preset_start = NULL;
+ }
+ }
+ }
+
+
+ //-- open codec --
+ //----------------
+ TC_LOCK_LIBAVCODEC;
+ ret = avcodec_open(lavc_venc_context, lavc_venc_codec);
+ TC_UNLOCK_LIBAVCODEC;
+ if (ret < 0) {
+ tc_log_warn(MOD_NAME, "could not open FFMPEG codec");
+ return TC_EXPORT_ERROR;
+ }
+
+ if (lavc_venc_context->codec->encode == NULL) {
+ tc_log_warn(MOD_NAME, "could not open FFMPEG codec "
+ "(lavc_venc_context->codec->encode == NULL)");
+ return TC_EXPORT_ERROR;
+ }
+
+ /* free second pass buffer, its not needed anymore */
+ if (lavc_venc_context->stats_in)
+ free(lavc_venc_context->stats_in);
+ lavc_venc_context->stats_in = NULL;
+
+ if (verbose_flag & TC_DEBUG) {
+ //-- GMO start --
+ if (vob->divxmultipass == 3) {
+ tc_log_info(MOD_NAME, " single-pass session: 3 (VBR)");
+ tc_log_info(MOD_NAME, " VBR-quantizer: %d",
+ vob->divxbitrate);
+ } else {
+ tc_log_info(MOD_NAME, " multi-pass session: %d",
+ vob->divxmultipass);
+ tc_log_info(MOD_NAME, " bitrate [kBits/s]: %d",
+ lavc_venc_context->bit_rate/1000);
+ }
+
+ //-- GMO end --
+
+ tc_log_info(MOD_NAME, " max keyframe interval: %d",
+ vob->divxkeyframes);
+ tc_log_info(MOD_NAME, " frame rate: %.2f",
+ vob->ex_fps);
+ tc_log_info(MOD_NAME, " color space: %s",
+ (pix_fmt == CODEC_RGB) ? "RGB24":
+ ((pix_fmt == CODEC_YUV) ? "YUV420P" : "YUV422"));
+ tc_log_info(MOD_NAME, " quantizers: %d/%d",
+ lavc_venc_context->qmin, lavc_venc_context->qmax);
+ }
+
+ return TC_EXPORT_OK;
+ }
+
+ if (param->flag == TC_AUDIO)
+ {
+ pseudo_codec_t target;
+ char * user_codec_string;
+
+ tc_log_warn(MOD_NAME, "Usage of this module for audio encoding is deprecated.");
+ tc_log_warn(MOD_NAME, "Consider switch to export_tcaud module.");
+
+ if(vob->ex_v_fcc)
+ {
+ user_codec_string = tc_strdup(vob->ex_v_fcc);
+ tc_strstrip(user_codec_string);
+ }
+ else
+ user_codec_string = 0;
+
+ if(user_codec_string)
+ {
+ if(!strncmp(user_codec_string, "vcd", 3))
+ target = pc_vcd;
+ else if(!strncmp(user_codec_string, "svcd", 4))
+ target = pc_svcd;
+ else if(!strncmp(user_codec_string, "xvcd", 4))
+ target = pc_xvcd;
+ else if(!strncmp(user_codec_string, "dvd", 3))
+ target = pc_dvd;
+ else
+ target = pc_none;
+ }
+ else
+ target = pc_none;
+
+ free(user_codec_string);
+ user_codec_string = 0;
+
+ if(target != pc_none)
+ {
+ int resample_active = tc_filter_find("resample") != 0;
+ int rate = pseudo_codec_rate[target];
+
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Selected %s profile for audio",
+ pseudo_codec_name[target]);
+ tc_log_info(MOD_NAME, "Resampling filter %sactive",
+ resample_active ? "already " : "in");
+ }
+
+ if(vob->export_attributes & TC_EXPORT_ATTRIBUTE_ACHANS)
+ {
+ if(vob->dm_chan != 2)
+ tc_log_warn(MOD_NAME, "Number of audio channels not 2 as required");
+ }
+ else
+ {
+ vob->dm_chan = 2;
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Set number of audio channels to 2");
+ }
+ }
+
+ if(vob->export_attributes & TC_EXPORT_ATTRIBUTE_ABITS)
+ {
+ if(vob->dm_bits != 16)
+ tc_log_warn(MOD_NAME, "Number of audio bits not 16 as required");
+ }
+ else
+ {
+ vob->dm_bits = 16;
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Set number of audio bits to 16");
+ }
+ }
+
+ if(resample_active)
+ {
+ if(vob->mp3frequency != 0)
+ tc_log_warn(MOD_NAME, "Resampling filter active but vob->mp3frequency not 0!");
+
+ if(vob->export_attributes & TC_EXPORT_ATTRIBUTE_ARATE)
+ {
+ if (verbose) {
+ if((rate == -1) || (vob->a_rate == rate)) {
+ tc_log_info(MOD_NAME,
+ "No audio resampling necessary");
+ } else {
+ tc_log_info(MOD_NAME, "Resampling audio from"
+ " %d Hz to %d Hz as required",
+ vob->a_rate, rate);
+ }
+ }
+ }
+ else if (rate != -1)
+ {
+ vob->a_rate = rate;
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Set audio sample rate to %d Hz",
+ rate);
+ }
+ }
+ }
+ else
+ {
+ if((vob->export_attributes & TC_EXPORT_ATTRIBUTE_ARATE) && (vob->mp3frequency != 0))
+ {
+ if(vob->mp3frequency != rate)
+ tc_log_warn(MOD_NAME, "Selected audio sample rate (%d Hz) not %d Hz as required",
+ vob->mp3frequency, rate);
+
+ if(vob->mp3frequency != vob->a_rate)
+ tc_log_warn(MOD_NAME, "Selected audio sample rate (%d Hz) not equal to input "
+ "sample rate (%d Hz), use -J", vob->mp3frequency, vob->a_rate);
+ }
+ else
+ {
+ if(vob->a_rate == rate && vob->mp3frequency == rate) {
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Set audio sample rate"
+ " to %d Hz", rate);
+ }
+ } else if (vob->a_rate == rate && vob->mp3frequency == 0) {
+ vob->mp3frequency = rate;
+ if (verbose) {
+ tc_log_info(MOD_NAME, "No audio resampling"
+ " necessary, using %d Hz", rate);
+ }
+ }
+ else
+ {
+ vob->mp3frequency = rate;
+ tc_log_warn(MOD_NAME, "Set audio sample rate to %d Hz, input rate is %d Hz",
+ rate, vob->a_rate);
+ tc_log_warn(MOD_NAME, " loading resample plugin");
+
+ if(tc_filter_add("resample", NULL) == -1)
+ tc_log_warn(MOD_NAME, "Load of resample filter failed, expect trouble");
+ }
+ }
+ }
+
+ if(vob->export_attributes & TC_EXPORT_ATTRIBUTE_ABITRATE)
+ {
+ if((target != pc_dvd) && (target != pc_xvcd))
+ {
+ if(vob->mp3bitrate != 224)
+ tc_log_warn(MOD_NAME, "Audio bit rate not 224 kbps as required");
+ }
+ else
+ {
+ if(vob->mp3bitrate < 160 || vob->mp3bitrate > 320)
+ tc_log_warn(MOD_NAME, "Audio bit rate not between 160 and 320 kbps as required");
+ }
+ }
+ else
+ {
+ vob->mp3bitrate = 224;
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Set audio bit rate to 224 kbps");
+ }
+ }
+
+ if(vob->export_attributes & TC_EXPORT_ATTRIBUTE_ACODEC)
+ {
+ if(target != pc_dvd)
+ {
+ if(vob->ex_a_codec != CODEC_MP2)
+ tc_log_warn(MOD_NAME, "Audio codec not mp2 as required");
+ }
+ else
+ {
+ if(vob->ex_a_codec != CODEC_MP2 && vob->ex_a_codec != CODEC_AC3)
+ tc_log_warn(MOD_NAME, "Audio codec not mp2 or ac3 as required");
+ }
+ }
+ else
+ {
+ if(target != pc_dvd)
+ {
+ vob->ex_a_codec = CODEC_MP2;
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Set audio codec to mp2");
+ }
+ }
+ else
+ {
+ vob->ex_a_codec = CODEC_AC3;
+ if (verbose) {
+ tc_log_info(MOD_NAME, "Set audio codec to ac3");
+ }
+ }
+ }
+ }
+
+ return tc_audio_init(vob, verbose_flag);
+ }
+
+ // invalid flag
+ return TC_EXPORT_ERROR;
+}
+
+/* ------------------------------------------------------------
+ *
+ * open outputfile
+ *
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+
+ // open output file
+
+ /* Open file */
+ if ( (param->flag == TC_VIDEO && !is_mpegvideo) || (param->flag == TC_AUDIO && !vob->audio_file_flag)) {
+ if (vob->avifile_out==NULL) {
+
+ vob->avifile_out = AVI_open_output_file(vob->video_out_file);
+
+ if ((vob->avifile_out) == NULL) {
+ AVI_print_error("avi open error");
+ return TC_EXPORT_ERROR;
+ }
+
+ }
+ }
+
+ /* Save locally */
+ avifile = vob->avifile_out;
+
+
+ if (param->flag == TC_VIDEO) {
+
+ // video
+ if (is_mpegvideo) {
+
+ mpeg1fd = fopen(vob->video_out_file, "wb");
+
+ if (!mpeg1fd)
+ {
+ tc_log_warn(MOD_NAME, "Cannot open file \"%s\", using /dev/null",
+ vob->video_out_file);
+ mpeg1fd = fopen("/dev/null", "wb");
+ }
+
+ } else {
+ // pass extradata to AVI writer
+ if (lavc_venc_context->extradata > 0) {
+ avifile->extradata = lavc_venc_context->extradata;
+ avifile->extradata_size = lavc_venc_context->extradata_size;
+ }
+ else {
+ avifile->extradata = NULL;
+ avifile->extradata_size = 0;
+ }
+
+ AVI_set_video(avifile, vob->ex_v_width, vob->ex_v_height, vob->ex_fps,
+ codec->fourCC);
+
+ if (vob->avi_comment_fd>0)
+ AVI_set_comment_fd(vob->avifile_out, vob->avi_comment_fd);
+ }
+
+ return TC_EXPORT_OK;
+ }
+
+
+ if (param->flag == TC_AUDIO)
+ return tc_audio_open(vob, vob->avifile_out);
+
+ // invalid flag
+ return TC_EXPORT_ERROR;
+}
+
+/* ------------------------------------------------------------
+ *
+ * encode and export
+ *
+ * ------------------------------------------------------------*/
+
+MOD_encode
+{
+
+ int out_size;
+ const char pict_type_char[5]= {'?', 'I', 'P', 'B', 'S'};
+
+ if (param->flag == TC_VIDEO) {
+
+ ++frames;
+
+ if (encoded_frames && frames > encoded_frames)
+ return TC_EXPORT_ERROR;
+
+ lavc_venc_frame->interlaced_frame = interlacing_active;
+ lavc_venc_frame->top_field_first = interlacing_top_first;
+
+ switch (pix_fmt)
+ {
+ case CODEC_YUV:
+ lavc_venc_frame->linesize[0] = lavc_venc_context->width;
+ lavc_venc_frame->linesize[1] = lavc_venc_context->width / 2;
+ lavc_venc_frame->linesize[2] = lavc_venc_context->width / 2;
+
+ if(is_huffyuv)
+ {
+ uint8_t *src[3];
+ YUV_INIT_PLANES(src, param->buffer, IMG_YUV_DEFAULT,
+ lavc_venc_context->width, lavc_venc_context->height);
+ avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer,
+ PIX_FMT_YUV422P, lavc_venc_context->width,
+ lavc_venc_context->height);
+ /* FIXME: can't use tcv_convert (see decode_lavc.c) */
+ ac_imgconvert(src, IMG_YUV_DEFAULT,
+ lavc_venc_frame->data, IMG_YUV422P,
+ lavc_venc_context->width,
+ lavc_venc_context->height);
+ }
+ else
+ {
+ YUV_INIT_PLANES(lavc_venc_frame->data, param->buffer,
+ IMG_YUV420P, lavc_venc_context->width,
+ lavc_venc_context->height);
+ }
+ break;
+
+ case CODEC_YUV422:
+ if(is_huffyuv)
+ {
+ YUV_INIT_PLANES(lavc_venc_frame->data, param->buffer,
+ IMG_YUV422P, lavc_venc_context->width,
+ lavc_venc_context->height);
+ }
+ else
+ {
+ uint8_t *src[3];
+ YUV_INIT_PLANES(src, param->buffer, IMG_YUV422P,
+ lavc_venc_context->width,
+ lavc_venc_context->height);
+ avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer,
+ PIX_FMT_YUV420P, lavc_venc_context->width,
+ lavc_venc_context->height);
+ ac_imgconvert(src, IMG_YUV422P,
+ lavc_venc_frame->data, IMG_YUV420P,
+ lavc_venc_context->width,
+ lavc_venc_context->height);
+ }
+ break;
+
+ case CODEC_RGB:
+ avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer,
+ PIX_FMT_YUV420P, lavc_venc_context->width,
+ lavc_venc_context->height);
+ ac_imgconvert(&param->buffer, IMG_RGB_DEFAULT,
+ lavc_venc_frame->data, IMG_YUV420P,
+ lavc_venc_context->width,
+ lavc_venc_context->height);
+ break;
+
+ default:
+ tc_log_warn(MOD_NAME, "Unknown pixel format %d.", pix_fmt);
+ return TC_EXPORT_ERROR;
+ }
+
+
+ TC_LOCK_LIBAVCODEC;
+ out_size = avcodec_encode_video(lavc_venc_context,
+ enc_buffer, size,
+ lavc_venc_frame);
+ TC_UNLOCK_LIBAVCODEC;
+
+ if (out_size < 0) {
+ tc_log_warn(MOD_NAME, "encoder error: size (%d)", out_size);
+ return TC_EXPORT_ERROR;
+ }
+ if (verbose & TC_STATS) {
+ tc_log_warn(MOD_NAME, "encoder: size of encoded (%d)", out_size);
+ }
+
+ //0.6.2: switch outfile on "r/R" and -J pv
+ //0.6.2: enforce auto-split at 2G (or user value) for normal AVI files
+ if (!is_mpegvideo) {
+ if((uint32_t)(AVI_bytes_written(avifile)+out_size+16+8)>>20 >= tc_avi_limit) tc_outstream_rotate_request();
+
+ if (lavc_venc_context->coded_frame->key_frame) tc_outstream_rotate();
+
+ if (AVI_write_frame(avifile, enc_buffer, out_size,
+ lavc_venc_context->coded_frame->key_frame? 1 : 0) < 0) {
+ AVI_print_error("avi video write error");
+
+ return TC_EXPORT_ERROR;
+ }
+ } else { // mpegvideo
+ if ( (out_size >0) && (fwrite (enc_buffer, out_size, 1, mpeg1fd) <= 0) ) {
+ tc_log_warn(MOD_NAME, "encoder error write failed size (%d)", out_size);
+ //return TC_EXPORT_ERROR;
+ }
+ }
+
+ /* store psnr / pict size / type / qscale */
+ if(do_psnr){
+ static FILE *fvstats=NULL;
+ char filename[20];
+ double f= lavc_venc_context->width*lavc_venc_context->height*255.0*255.0;
+
+ if(!fvstats) {
+ time_t today2;
+ struct tm *today;
+ today2 = time(NULL);
+ today = localtime(&today2);
+ tc_snprintf(filename, sizeof(filename), "psnr_%02d%02d%02d.log",
+ today->tm_hour, today->tm_min, today->tm_sec);
+ fvstats = fopen(filename,"w");
+ if(!fvstats) {
+ tc_log_perror(MOD_NAME, "fopen");
+ lavc_param_psnr=0; // disable block
+ do_psnr = 0;
+ /*exit(1);*/
+ }
+ }
+
+ fprintf(fvstats, "%6d, %2d, %6d, %2.2f, %2.2f, %2.2f, %2.2f %c\n",
+ lavc_venc_context->coded_frame->coded_picture_number,
+ lavc_venc_context->coded_frame->quality,
+ out_size,
+ psnr(lavc_venc_context->coded_frame->error[0]/f),
+ psnr(lavc_venc_context->coded_frame->error[1]*4/f),
+ psnr(lavc_venc_context->coded_frame->error[2]*4/f),
+ psnr((lavc_venc_context->coded_frame->error[0]+lavc_venc_context->coded_frame->error[1]+lavc_venc_context->coded_frame->error[2])/(f*1.5)),
+ pict_type_char[lavc_venc_context->coded_frame->pict_type]
+ );
+ }
+
+ /* store stats if there are any */
+ if (lavc_venc_context->stats_out && stats_file)
+ fprintf(stats_file, "%s", lavc_venc_context->stats_out);
+
+ return TC_EXPORT_OK;
+ }
+
+ if (param->flag == TC_AUDIO)
+ return tc_audio_encode(param->buffer, param->size, avifile);
+
+ // invalid flag
+ return TC_EXPORT_ERROR;
+}
+
+/* ------------------------------------------------------------
+ *
+ * stop encoder
+ *
+ * ------------------------------------------------------------*/
+
+#define FREEPTR(PTR) do { \
+ if ((PTR)) { \
+ free((PTR)); \
+ (PTR) = NULL; \
+ } \
+} while (0)
+
+
+MOD_stop
+{
+
+ if (param->flag == TC_VIDEO) {
+
+ if(do_psnr){
+ double f= lavc_venc_context->width*lavc_venc_context->height*255.0*255.0;
+
+ f*= lavc_venc_context->coded_frame->coded_picture_number;
+
+ tc_log_info(MOD_NAME, "PSNR: Y:%2.2f, Cb:%2.2f, Cr:%2.2f, All:%2.2f",
+ psnr(lavc_venc_context->error[0]/f),
+ psnr(lavc_venc_context->error[1]*4/f),
+ psnr(lavc_venc_context->error[2]*4/f),
+ psnr((lavc_venc_context->error[0]+lavc_venc_context->error[1]+lavc_venc_context->error[2])/(f*1.5))
+ );
+ }
+
+ FREEPTR(enc_buffer);
+ FREEPTR(img_buffer);
+ FREEPTR(lavc_venc_frame);
+
+ //-- release encoder --
+ if (lavc_venc_codec) {
+ avcodec_close(lavc_venc_context);
+ lavc_venc_codec = NULL;
+ }
+
+ if (stats_file) {
+ fclose(stats_file);
+ stats_file = NULL;
+ }
+
+ if (lavc_venc_context != NULL) {
+ if (lavc_venc_context->rc_override) {
+ FREEPTR(lavc_venc_context->rc_override);
+ }
+ FREEPTR(lavc_venc_context);
+ }
+ free(real_codec);
+ return TC_EXPORT_OK;
+ }
+
+ if (param->flag == TC_AUDIO)
+ return tc_audio_stop();
+
+ return TC_EXPORT_ERROR;
+}
+
+/* ------------------------------------------------------------
+ *
+ * close outputfiles
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+
+ vob_t *vob = tc_get_vob();
+
+ if (param->flag == TC_AUDIO)
+ return tc_audio_close();
+
+ if (vob->avifile_out!=NULL) {
+ AVI_close(vob->avifile_out);
+ vob->avifile_out=NULL;
+ return TC_EXPORT_OK;
+ }
+
+ if (is_mpegvideo) {
+ if (mpeg1fd) {
+ fclose (mpeg1fd);
+ mpeg1fd = NULL;
+ return TC_EXPORT_OK;
+ }
+ }
+
+ return TC_EXPORT_ERROR;
+
+}
diff --git a/debian/transcode/transcode-1.1.7/export/export_im.c b/debian/transcode/transcode-1.1.7/export/export_im.c
new file mode 100644
index 00000000..80f9320e
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_im.c
@@ -0,0 +1,254 @@
+/*
+ * export_im.c
+ *
+ * Copyright (C) Thomas Oestreich - March 2002
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+/* Note: because of ImageMagick bogosity, this must be included first, so
+ * we can undefine the PACKAGE_* symbols it splats into our namespace */
+#include <magick/api.h>
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
+
+#include "transcode.h"
+#include "libtcvideo/tcvideo.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#define MOD_NAME "export_im.so"
+#define MOD_VERSION "v0.0.4 (2003-11-13)"
+#define MOD_CODEC "(video) *"
+
+static int verbose_flag=TC_QUIET;
+static int capability_flag=TC_CAP_YUV|TC_CAP_RGB|TC_CAP_PCM|TC_CAP_AUD;
+
+#define MOD_PRE im
+#include "export_def.h"
+
+static char buf2[PATH_MAX];
+
+static uint8_t *tmp_buffer; //[SIZE_RGB_FRAME];
+static TCVHandle tcvhandle;
+
+static int codec, width, height;
+
+static int counter=0;
+static const char *prefix="frame.";
+static const char *type;
+
+static int interval=1;
+static unsigned int int_counter=0;
+
+ImageInfo *image_info;
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+
+ /* set the 'spit-out-frame' interval */
+ interval = vob->frame_interval;
+
+ if(param->flag == TC_VIDEO) {
+ int quality = 75;
+
+ width = vob->ex_v_width;
+ height = vob->ex_v_height;
+
+ codec = (vob->im_v_codec == CODEC_YUV) ? CODEC_YUV : CODEC_RGB;
+
+ InitializeMagick("");
+
+ image_info=CloneImageInfo((ImageInfo *) NULL);
+
+ if (vob->divxbitrate == VBITRATE)
+ quality = 75;
+ else quality = vob->divxbitrate;
+
+ if (quality >= 100) quality = 100;
+ if (quality <= 0) quality = 0;
+
+ image_info->quality = quality;
+
+ if (!tmp_buffer)
+ tmp_buffer = malloc (vob->ex_v_width*vob->ex_v_height*3);
+ if (!tmp_buffer)
+ return TC_EXPORT_ERROR;
+
+ tcvhandle = tcv_init();
+ if (!tcvhandle) {
+ tc_log_error(MOD_NAME, "tcv_init() failed");
+ return TC_EXPORT_ERROR;
+ }
+
+ return TC_EXPORT_OK;
+ }
+
+ if(param->flag == TC_AUDIO)
+ return TC_EXPORT_OK;
+
+ // invalid flag
+ return TC_EXPORT_ERROR;
+}
+
+/* ------------------------------------------------------------
+ *
+ * open outputfile
+ *
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+
+ if(param->flag == TC_VIDEO) {
+
+ // video
+
+ switch(vob->im_v_codec) {
+
+ case CODEC_YUV:
+ case CODEC_RGB:
+
+ if(vob->video_out_file!=NULL && strcmp(vob->video_out_file,"/dev/null")!=0) prefix=vob->video_out_file;
+
+ break;
+
+ default:
+
+ tc_log_warn(MOD_NAME, "codec not supported");
+ return(TC_EXPORT_ERROR);
+
+ break;
+ }
+
+ if(vob->ex_v_fcc != NULL && strlen(vob->ex_v_fcc) != 0) {
+ type = vob->ex_v_fcc;
+ } else type="jpg";
+
+ return(0);
+ }
+
+
+ if(param->flag == TC_AUDIO) return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * encode and export
+ *
+ * ------------------------------------------------------------*/
+
+MOD_encode
+{
+
+ ExceptionInfo exception_info;
+ char *out_buffer = param->buffer;
+ Image *image=NULL;
+ int res;
+
+ if ((++int_counter-1) % interval != 0)
+ return (0);
+
+ if(param->flag == TC_VIDEO) {
+
+ GetExceptionInfo(&exception_info);
+
+ res = tc_snprintf(buf2, PATH_MAX, "%s%06d.%s", prefix, counter++, type);
+ if (res < 0) {
+ tc_log_perror(MOD_NAME, "cmd buffer overflow");
+ return(TC_EXPORT_ERROR);
+ }
+
+ if(codec==CODEC_YUV) {
+ tcv_convert(tcvhandle, param->buffer, tmp_buffer, width, height,
+ IMG_YUV_DEFAULT, IMG_RGB24);
+ out_buffer = tmp_buffer;
+ }
+
+ image=ConstituteImage (width, height, "RGB", CharPixel, out_buffer, &exception_info);
+
+ strlcpy(image->filename, buf2, MaxTextExtent);
+
+ WriteImage(image_info, image);
+ DestroyImage(image);
+
+ return(0);
+ }
+
+ if(param->flag == TC_AUDIO) return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * stop encoder
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+
+ if(param->flag == TC_VIDEO) {
+ DestroyImageInfo(image_info);
+ ConstituteComponentTerminus();
+ DestroyMagick();
+
+ free(tmp_buffer);
+ tmp_buffer = NULL;
+ tcv_free(tcvhandle);
+ tcvhandle = 0;
+
+ return(0);
+ }
+
+ if(param->flag == TC_AUDIO) return(0);
+
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * close outputfiles
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+
+ if(param->flag == TC_AUDIO) return(0);
+ if(param->flag == TC_VIDEO) return(0);
+
+ return(TC_EXPORT_ERROR);
+
+}
+
diff --git a/debian/transcode/transcode-1.1.7/export/export_jpg.c b/debian/transcode/transcode-1.1.7/export/export_jpg.c
new file mode 100644
index 00000000..31975393
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_jpg.c
@@ -0,0 +1,349 @@
+/*
+ * export_jpg.c
+ *
+ * Copyright (C) Tilmann Bitterberg - September 2002
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#define MOD_NAME "export_jpg.so"
+#define MOD_VERSION "v0.2.1 (2003-08-06)"
+#define MOD_CODEC "(video) *"
+
+#include "transcode.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "jpeglib.h"
+
+static int verbose_flag=TC_QUIET;
+static int capability_flag=TC_CAP_YUV|TC_CAP_RGB|TC_CAP_PCM|TC_CAP_AUD;
+
+#define MOD_PRE jpg
+#include "export_def.h"
+
+static char buf2[PATH_MAX];
+
+static int codec, width, height;
+
+static int counter=0;
+static const char *prefix="frame.";
+static int jpeg_quality =0;
+#define JPEG_DEFAULT_QUALITY 85
+
+static int interval=1;
+static unsigned int int_counter=0;
+
+JSAMPLE * image_buffer; /* Points to large array of R,G,B-order data */
+static unsigned char **line[3];
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+// native YUV jpeg encoder code based on encode_JPEG of the quicktime4linux lib
+//
+static void write_yuv_JPEG_file(char *filename, int quality,
+ unsigned char **input,
+ int _width, int _height)
+{
+ int i, j, k;
+ int width = _width;
+ int height = _height;
+ unsigned char *base[3];
+ struct jpeg_compress_struct encinfo;
+ struct jpeg_error_mgr jerr;
+ FILE * outfile; /* target file */
+
+ jpeg_create_compress(&encinfo);
+
+ encinfo.err = jpeg_std_error(&jerr);
+
+ if ((outfile = fopen(filename, "wb")) == NULL) {
+ tc_log_error(MOD_NAME, "can't open %s", filename);
+ }
+ jpeg_stdio_dest(&encinfo, outfile);
+
+ encinfo.image_width = width;
+ encinfo.image_height = height;
+ encinfo.input_components = 3;
+
+ jpeg_set_defaults(&encinfo);
+ encinfo.dct_method = JDCT_FASTEST;
+
+ jpeg_set_quality(&encinfo, quality, TRUE);
+ encinfo.raw_data_in = TRUE;
+#if JPEG_LIB_VERSION >= 70
+ encinfo.do_fancy_downsampling = FALSE;
+#endif
+ encinfo.in_color_space = JCS_YCbCr;
+
+ encinfo.comp_info[0].h_samp_factor = 2;
+ encinfo.comp_info[0].v_samp_factor = 2;
+ encinfo.comp_info[1].h_samp_factor = 1;
+ encinfo.comp_info[1].v_samp_factor = 1;
+ encinfo.comp_info[2].h_samp_factor = 1;
+ encinfo.comp_info[2].v_samp_factor = 1;
+
+ jpeg_start_compress(&encinfo, TRUE);
+
+ base[0] = input[0];
+ base[1] = input[1];
+ base[2] = input[2];
+
+ for (i = 0; i < height; i += 2*DCTSIZE) {
+ for (j=0, k=0; j<2*DCTSIZE;j+=2, k++) {
+
+ line[0][j] = base[0]; base[0] += width;
+ line[0][j+1] = base[0]; base[0] += width;
+ line[1][k] = base[1]; base[1] += width/2;
+ line[2][k] = base[2]; base[2] += width/2;
+ }
+ jpeg_write_raw_data(&encinfo, line, 2*DCTSIZE);
+ }
+ jpeg_finish_compress(&encinfo);
+
+ fclose(outfile);
+
+ jpeg_destroy_compress(&encinfo);
+
+}
+
+static void write_rgb_JPEG_file (char * filename, int quality, int width, int height)
+{
+ struct jpeg_compress_struct cinfo;
+ struct jpeg_error_mgr jerr;
+ /* More stuff */
+ FILE * outfile; /* target file */
+ JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */
+ int row_stride; /* physical row width in image buffer */
+
+ /* Step 1: allocate and initialize JPEG compression object */
+
+ cinfo.err = jpeg_std_error(&jerr);
+ /* Now we can initialize the JPEG compression object. */
+ jpeg_create_compress(&cinfo);
+
+ /* Step 2: specify data destination (eg, a file) */
+ /* Note: steps 2 and 3 can be done in either order. */
+
+ if ((outfile = fopen(filename, "wb")) == NULL) {
+ tc_log_error(MOD_NAME, "can't open %s", filename);
+ }
+ jpeg_stdio_dest(&cinfo, outfile);
+
+ /* Step 3: set parameters for compression */
+
+ /* First we supply a description of the input image.
+ * Four fields of the cinfo struct must be filled in:
+ */
+ cinfo.image_width = width; /* image width and height, in pixels */
+ cinfo.image_height = height;
+ cinfo.input_components = 3; /* # of color components per pixel */
+ cinfo.in_color_space = JCS_RGB; /* colorspace of input image */
+
+ jpeg_set_defaults(&cinfo);
+ /* Now you can set any non-default parameters you wish to.
+ * Here we just illustrate the use of quality (quantization table) scaling:
+ */
+ jpeg_set_quality(&cinfo, quality, TRUE); /* limit to baseline-JPEG values */
+
+ /* Step 4: Start compressor */
+
+ /* TRUE ensures that we will write a complete interchange-JPEG file.
+ * Pass TRUE unless you are very sure of what you're doing.
+ */
+ jpeg_start_compress(&cinfo, TRUE);
+
+ /* Step 5: while (scan lines remain to be written) */
+ /* jpeg_write_scanlines(...); */
+
+ row_stride = cinfo.image_width * 3; /* JSAMPLEs per row in image_buffer */
+
+ while (cinfo.next_scanline < cinfo.image_height) {
+ row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride];
+ (void) jpeg_write_scanlines(&cinfo, row_pointer, 1);
+ }
+
+ /* Step 6: Finish compression */
+
+ jpeg_finish_compress(&cinfo);
+ /* After finish_compress, we can close the output file. */
+ fclose(outfile);
+
+ /* Step 7: release JPEG compression object */
+
+ /* This is an important step since it will release a good deal of memory. */
+ jpeg_destroy_compress(&cinfo);
+
+}
+
+MOD_init
+{
+
+ /* set the 'spit-out-frame' interval */
+ interval = vob->frame_interval;
+
+ if(param->flag == TC_VIDEO) {
+
+ width = vob->ex_v_width;
+ height = vob->ex_v_height;
+
+ codec = (vob->im_v_codec == CODEC_YUV) ? CODEC_YUV : CODEC_RGB;
+
+ if(vob->im_v_codec == CODEC_YUV) {
+ line[0] = malloc(height*sizeof(char*));
+ line[1] = malloc(height*sizeof(char*)/2);
+ line[2] = malloc(height*sizeof(char*)/2);
+ }
+
+ return(0);
+ }
+
+ if(param->flag == TC_AUDIO) return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * open outputfile
+ *
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+
+ if(param->flag == TC_VIDEO) {
+
+ // video
+
+ switch(vob->im_v_codec) {
+
+ case CODEC_YUV:
+ case CODEC_RGB:
+
+ if(vob->video_out_file!=NULL && strcmp(vob->video_out_file,"/dev/null")!=0) prefix=vob->video_out_file;
+
+ break;
+
+ default:
+
+ tc_log_warn(MOD_NAME, "codec not supported (0x%x)", vob->im_v_codec);
+ return(TC_EXPORT_ERROR);
+
+ break;
+ }
+
+ if(vob->ex_v_fcc != NULL && strlen(vob->ex_v_fcc) != 0) {
+ jpeg_quality=atoi(vob->ex_v_fcc);
+ if (jpeg_quality<=0) jpeg_quality = JPEG_DEFAULT_QUALITY;
+ if (jpeg_quality>100) jpeg_quality = 100;
+ } else {
+ jpeg_quality=75;
+ }
+
+ return(0);
+ }
+
+
+ if(param->flag == TC_AUDIO) return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * encode and export
+ *
+ * ------------------------------------------------------------*/
+
+MOD_encode
+{
+
+ char *out_buffer = param->buffer;
+
+ if ((++int_counter-1) % interval != 0)
+ return (0);
+
+ if(param->flag == TC_VIDEO) {
+
+
+ if(tc_snprintf(buf2, PATH_MAX, "%s%06d.%s", prefix, counter++, "jpg") < 0) {
+ tc_log_perror(MOD_NAME, "cmd buffer overflow");
+ return(TC_EXPORT_ERROR);
+ }
+
+ if(codec==CODEC_YUV) {
+ unsigned char *base[3];
+ YUV_INIT_PLANES(base, param->buffer, IMG_YUV420P, width, height);
+ write_yuv_JPEG_file(buf2, jpeg_quality, base, width, height);
+
+ //out_buffer = tmp_buffer;
+ } else {
+ image_buffer = out_buffer;
+ write_rgb_JPEG_file(buf2, jpeg_quality, width, height);
+ }
+
+ return(0);
+ }
+
+ if(param->flag == TC_AUDIO) return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * stop encoder
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+
+ if(param->flag == TC_VIDEO) {
+ return(0);
+ }
+
+ if(param->flag == TC_AUDIO) return(0);
+
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * close outputfiles
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+
+ if(param->flag == TC_AUDIO) return(0);
+ if(param->flag == TC_VIDEO) return(0);
+
+ return(TC_EXPORT_ERROR);
+
+}
diff --git a/debian/transcode/transcode-1.1.7/export/export_lame.c b/debian/transcode/transcode-1.1.7/export/export_lame.c
new file mode 100644
index 00000000..28ae841a
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_lame.c
@@ -0,0 +1,259 @@
+/*
+ * export_lame.c
+ *
+ * Copyright (C) Thomas Oestreich - November 2002
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#define MOD_NAME "export_lame.so"
+#define MOD_VERSION "v0.0.3 (2003-03-06)"
+#define MOD_CODEC "(audio) MPEG 1/2"
+
+#include "transcode.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+static int verbose_flag = TC_QUIET;
+static int capability_flag = TC_CAP_PCM;
+
+#define MOD_PRE lame
+#include "export_def.h"
+
+static FILE* pFile = NULL;
+
+/* ------------------------------------------------------------
+ *
+ * Pipe write helper function
+ *
+ * ------------------------------------------------------------*/
+
+static int p_write (char *buf, size_t len)
+{
+ size_t n = 0;
+ size_t r = 0;
+ int fd = fileno (pFile);
+
+ while (r < len)
+ {
+ if ((n = write (fd, buf + r, len - r)) < 0)
+ return n;
+
+ r += n;
+ }
+
+ return r;
+}
+
+/* ------------------------------------------------------------
+ *
+ * open outputfile
+ *
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+
+ /* check for lame */
+ if (tc_test_program("lame") != 0) return (TC_EXPORT_ERROR);
+
+ if (param->flag == TC_AUDIO) {
+ char buf [PATH_MAX];
+ int ifreq,ofreq,orate;
+ int verb;
+ int ofreq_int;
+ int ofreq_dec;
+ int ochan;
+ char chan;
+ char *ptr;
+ const char * swap_bytes = "";
+
+ char br[64];
+
+ /* verbose? */
+ verb = (verbose & TC_DEBUG) ? 2:0;
+
+ /* fetch audio parameter */
+ ofreq = vob->mp3frequency;
+ ifreq = vob->a_rate;
+ orate = vob->mp3bitrate;
+ ochan = vob->dm_chan;
+ chan = (ochan==2) ? 'j':'m';
+
+ /* default out freq */
+ if(ofreq==0)
+ ofreq = ifreq;
+
+ /* need conversion? */
+ if(ofreq!=ifreq) {
+ /* add sox for conversion */
+ if (tc_test_program("sox") != 0) {
+ return(TC_EXPORT_ERROR);
+ } else {
+ tc_snprintf(buf, sizeof(buf), "sox %s -r %d -c %d -t raw - -r %d -t raw - polyphase "
+ "2>/dev/null | ",
+ (vob->dm_bits==16)?"-w -s":"-b -u",
+ ifreq, ochan, ofreq);
+ ptr = buf + strlen(buf);
+ }
+ } else {
+ ptr = buf;
+ }
+
+ /* convert output frequency to fixed point */
+ ofreq_int = ofreq/1000.0;
+ ofreq_dec = ofreq-ofreq_int*1000;
+
+ /* lame command line */
+
+#if !defined(WORDS_BIGENDIAN)
+ swap_bytes = "-x";
+#endif
+
+ switch(vob->a_vbr) {
+
+ case 1:
+ tc_snprintf(br, sizeof(br), "--abr %d", orate);
+ break;
+
+ case 2:
+ tc_snprintf(br, sizeof(br), "--vbr-new -b %d -B %d -V %d", orate-64, orate+64, (int) vob->mp3quality);
+ break;
+
+ case 3:
+ tc_snprintf(br, sizeof(br), "--r3mix");
+ break;
+
+ default:
+ tc_snprintf(br, sizeof(br), "--cbr -b %d", orate);
+ break;
+ }
+
+ /* ptr is a pointer into buf */
+ tc_snprintf(ptr, sizeof(buf) - (ptr-buf),
+ "lame %s %s -s %d.%03d -m %c - \"%s.mp3\" 2>/dev/null %s",
+ swap_bytes, br, ofreq_int, ofreq_dec, chan,
+ vob->audio_out_file, (vob->ex_a_string?vob->ex_a_string:""));
+
+ tc_log_info (MOD_NAME, "%s", buf);
+
+ if ((pFile = popen (buf, "w")) == NULL)
+ return(TC_EXPORT_ERROR);
+
+ return(0);
+ }
+
+ if (param->flag == TC_VIDEO)
+ return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+ if(param->flag == TC_AUDIO)
+ {
+ return(0);
+ }
+
+ if (param->flag == TC_VIDEO)
+ return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * encode and export frame
+ *
+ * ------------------------------------------------------------*/
+
+
+MOD_encode
+{
+ if(param->flag == TC_AUDIO)
+ {
+ if (p_write (param->buffer, param->size) != param->size)
+ {
+ tc_log_perror(MOD_NAME, "write audio frame");
+ return(TC_EXPORT_ERROR);
+ }
+ return (0);
+ }
+
+ if (param->flag == TC_VIDEO)
+ return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * stop encoder
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+ if (param->flag == TC_VIDEO)
+ return (0);
+
+ if (param->flag == TC_AUDIO)
+ return (0);
+
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * close codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+ if (param->flag == TC_VIDEO)
+ return (0);
+
+ if (param->flag == TC_AUDIO)
+ {
+ if (pFile)
+ pclose (pFile);
+
+ pFile = NULL;
+
+ return(0);
+ }
+
+ return (TC_EXPORT_ERROR);
+}
+
diff --git a/debian/transcode/transcode-1.1.7/export/export_lzo.c b/debian/transcode/transcode-1.1.7/export/export_lzo.c
new file mode 100644
index 00000000..895ad256
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_lzo.c
@@ -0,0 +1,297 @@
+/*
+ * export_lzo.c
+ *
+ * Copyright (C) Thomas Oestreich - October 2002
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#define MOD_NAME "export_lzo.so"
+#define MOD_VERSION "v0.1.0 (2005-10-15)"
+#define MOD_CODEC "(video) LZO real-time compression | (audio) MPEG/AC3/PCM"
+
+#include "transcode.h"
+#include "libtc/libtc.h"
+#include "avilib/avilib.h"
+#include "aud_aux.h"
+#include "import/magic.h"
+#include "libtc/tc_lzo.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+static int verbose_flag=TC_QUIET;
+static int capability_flag=TC_CAP_DV|TC_CAP_PCM|TC_CAP_RGB|TC_CAP_YUV|TC_CAP_AC3|TC_CAP_AUD|TC_CAP_VID;
+
+#define MOD_PRE lzo
+#include "export_def.h"
+
+
+static avi_t *avifile1=NULL;
+static avi_t *avifile2=NULL;
+
+static int info_shown=0, force_kf=0;
+
+static int r;
+static lzo_byte *out;
+static lzo_byte *wrkmem;
+static lzo_uint out_len;
+static int codec;
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+
+ if(param->flag == TC_VIDEO) {
+ if(verbose & TC_DEBUG)
+ tc_log_info(MOD_NAME, "max AVI-file size limit = %lu bytes",
+ (unsigned long) AVI_max_size());
+
+ /*
+ * Step 1: initialize the LZO library
+ */
+
+ if (lzo_init() != LZO_E_OK) {
+ tc_log_warn(MOD_NAME, "lzo_init() failed");
+ return(TC_EXPORT_ERROR);
+ }
+
+ wrkmem = (lzo_bytep) lzo_malloc(LZO1X_1_MEM_COMPRESS);
+ out = (lzo_bytep) lzo_malloc(vob->ex_v_height*vob->ex_v_width*3*2);
+
+ if (wrkmem == NULL || out == NULL) {
+ tc_log_error(MOD_NAME, "out of memory");
+ return(TC_EXPORT_ERROR);
+ }
+
+ codec = vob->im_v_codec;
+
+ return(0);
+ }
+
+ if(param->flag == TC_AUDIO)
+ return(tc_audio_init(vob, verbose_flag));
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * open outputfile
+ *
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+
+ // open out file
+ if(vob->avifile_out==NULL)
+ if(NULL == (vob->avifile_out = AVI_open_output_file(vob->video_out_file))) {
+ AVI_print_error("avi open error");
+ exit(TC_EXPORT_ERROR);
+ }
+
+ /* save locally */
+ avifile2 = vob->avifile_out;
+
+ if(param->flag == TC_VIDEO) {
+
+ //video
+
+ //force keyframe
+ force_kf=1;
+
+ AVI_set_video(vob->avifile_out, vob->ex_v_width, vob->ex_v_height, vob->ex_fps, "LZO2");
+
+ if (vob->avi_comment_fd>0)
+ AVI_set_comment_fd(vob->avifile_out, vob->avi_comment_fd);
+
+ if(!info_shown && verbose_flag)
+ tc_log_info(MOD_NAME, "codec=%s, fps=%6.3f, width=%d, height=%d",
+ "LZO2", vob->ex_fps, vob->ex_v_width, vob->ex_v_height);
+
+ info_shown=1;
+
+ return(0);
+ }
+
+ if(param->flag == TC_AUDIO) {
+ tc_log_warn(MOD_NAME, "Usage of this module for audio encoding is deprecated.");
+ tc_log_warn(MOD_NAME, "Consider switch to export_tcaud module.");
+ return(tc_audio_open(vob, vob->avifile_out));
+ }
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+inline static void long2str(long a, unsigned char *b)
+{
+ b[0] = (a&0xff000000)>>24;
+ b[1] = (a&0x00ff0000)>>16;
+ b[2] = (a&0x0000ff00)>>8;
+ b[3] = (a&0x000000ff);
+}
+
+inline static void short2str(short a, unsigned char *b)
+{
+ b[0] = (a&0xff00)>>8;
+ b[1] = (a&0x00ff);
+}
+
+/* ------------------------------------------------------------
+ *
+ * encode and export
+ *
+ * ------------------------------------------------------------*/
+
+MOD_encode
+{
+
+ int key;
+
+ tc_lzo_header_t h;
+
+ if(param->flag == TC_VIDEO) {
+
+ //write video
+
+ //encode
+
+ /*
+ * compress from `in' to `out' with LZO1X-1
+ */
+
+ r = lzo1x_1_compress(param->buffer, param->size, out+sizeof(h), &out_len, wrkmem);
+ h.magic = TC_CODEC_LZO2;
+ h.size = out_len;
+ h.method = 1;
+ h.level = 1;
+ h.flags = 0;
+ h.flags |= ((codec==CODEC_RGB)?TC_LZO_FORMAT_RGB24:TC_LZO_FORMAT_YUV420P);
+ h.pad = 0;
+
+ ac_memcpy (out, &h, sizeof(h));
+
+ if (r == LZO_E_OK) {
+ if(verbose & TC_DEBUG)
+ tc_log_info(MOD_NAME, "compressed %lu bytes into %lu bytes",
+ (long) param->size, (long) out_len);
+ } else {
+ /* this should NEVER happen */
+ tc_log_warn(MOD_NAME, "internal error - compression failed: %d", r);
+ return(TC_EXPORT_ERROR);
+ }
+
+ /* check for an incompressible block */
+ if (out_len >= param->size) {
+ if(verbose & TC_DEBUG)
+ tc_log_info(MOD_NAME, "block contains incompressible data");
+ h.flags |= TC_LZO_NOT_COMPRESSIBLE;
+ ac_memcpy(out+sizeof(h), param->buffer, param->size);
+ out_len = param->size;
+ }
+
+ //0.5.0-pre8:
+ key = ((param->attributes & TC_FRAME_IS_KEYFRAME) || force_kf) ? 1:0;
+
+ out_len += sizeof(h);
+
+ //0.6.2: switch outfile on "C" and -J pv
+ //0.6.2: enforce auto-split at 2G (or user value) for normal AVI files
+ if((uint32_t)(AVI_bytes_written(avifile2)+out_len+16+8)>>20 >= tc_avi_limit) tc_outstream_rotate_request();
+
+ if(key) tc_outstream_rotate();
+
+ if(AVI_write_frame(avifile2, out, out_len, key)<0) {
+ AVI_print_error("avi video write error");
+
+ return(TC_EXPORT_ERROR);
+ }
+
+ return(0);
+
+ }
+
+ if(param->flag == TC_AUDIO)
+ return(tc_audio_encode(param->buffer, param->size, avifile2));
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * stop encoder
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+
+ if(param->flag == TC_VIDEO) {
+
+ lzo_free(wrkmem);
+ lzo_free(out);
+
+ return(0);
+ }
+
+ if(param->flag == TC_AUDIO)
+ return(tc_audio_stop());
+
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * close outputfiles
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+
+ vob_t *vob = tc_get_vob();
+
+ //inputfile
+ if(avifile1!=NULL) {
+ AVI_close(avifile1);
+ avifile1=NULL;
+ }
+
+ if(param->flag == TC_AUDIO)
+ return(tc_audio_close());
+
+ //outputfile
+ if(vob->avifile_out!=NULL) {
+ AVI_close(vob->avifile_out);
+ vob->avifile_out=NULL;
+ }
+
+ if(param->flag == TC_VIDEO) return(0);
+
+ return(TC_EXPORT_ERROR);
+
+}
+
diff --git a/debian/transcode/transcode-1.1.7/export/export_mov.c b/debian/transcode/transcode-1.1.7/export/export_mov.c
new file mode 100644
index 00000000..81069c1d
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_mov.c
@@ -0,0 +1,801 @@
+/*
+ * export_mov.c
+ *
+ * Copyright (C) Thomas Oestreich - June 2001
+ * Copyright (C) (2002) Christian Vogelgsang
+ * <[email protected]> (extension for all codecs supported
+ * by quicktime4linux
+ * <[email protected]> 2004 fixes & features
+ * Copyright (C) [email protected] 2001 (initial module author)
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#define MOD_NAME "export_mov.so"
+#define MOD_VERSION "v0.1.2 (2004-01-19)"
+#define MOD_CODEC "(video) * | (audio) *"
+
+#include "transcode.h"
+#include "import/magic.h"
+#include "encoder.h"
+#include "libtc/optstr.h"
+#include "libtcvideo/tcvideo.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+/* verbose flag */
+static int verbose_flag=TC_QUIET;
+
+/* set encoder capabilities */
+static int capability_flag=
+ /* audio formats */
+ TC_CAP_PCM| /* pcm audio */
+ /* video formats */
+ TC_CAP_RGB| /* rgb frames */
+ TC_CAP_YUV| /* YUV 4:2:0 */
+ TC_CAP_YUY2|
+ TC_CAP_VID|
+ TC_CAP_YUV422; /* YUV 4:2:2 */
+
+#define MOD_PRE mov
+#include "export_def.h"
+
+#include <quicktime.h>
+#include <colormodels.h>
+#include <lqt.h>
+
+#define QT_LIST_AUDIO "audio codec"
+#define QT_LIST_VIDEO "video codec"
+#define QT_LIST_PARM "parameters"
+
+/* exported quicktime file */
+static quicktime_t *qtfile = NULL;
+
+/* row pointer for source frames */
+static unsigned char** row_ptr = NULL;
+
+/* temporary buffer */
+static uint8_t *tmp_buf;
+
+/* toggle for raw frame export */
+static int rawVideo = 0;
+static int rawAudio = 0;
+
+/* colormodels */
+static ImageFormat tc_cm = 0;
+static int qt_cm = 0;
+
+/* store frame dimension */
+static int w = 0, h = 0;
+
+/* audio channels */
+static int channels = 0;
+
+/* sample size */
+static int bits = 0;
+
+/* encode audio buffers */
+static int16_t* audbuf0 = NULL;
+static int16_t* audbuf1 = NULL;
+
+struct qt_codec_list {
+ char *name;
+ char *internal_name;
+ char *comments;
+};
+
+static TCVHandle tcvhandle = 0;
+
+/* special paramters not retrievable from lqt */
+struct qt_codec_list qt_param_list[] = {
+ {"", "", ""},
+ {"Special Parameters:", "", ""},
+ {"copyright", "", "Copyright string (no '=' or ',' allowed)"},
+ {"name", "", "Name string (no '=' or ',' allowed) "},
+ {"info", "", "Info string (no '=' or ',' allowed) "},
+ {NULL, NULL, NULL}};
+
+#ifdef LIBQUICKTIME_000904
+/* from libquicktime */
+static int tc_quicktime_get_timescale(double frame_rate)
+{
+ int timescale = 600;
+ /* Encode the 29.97, 23.976, 59.94 framerates */
+ if(frame_rate - (int)frame_rate != 0)
+ timescale = (int)(frame_rate * 1001 + 0.5);
+ else
+ if((600 / frame_rate) - (int)(600 / frame_rate) != 0)
+ timescale = (int)(frame_rate * 100 + 0.5);
+ return timescale;
+}
+#endif
+
+/* print list of things. Shamelessly stolen from export_ffmpeg.c */
+static int list(char *list_type)
+{
+ int cod = 0;
+ int i = 0;
+
+ lqt_codec_info_t ** qi = NULL;
+
+
+ if (strcmp(list_type, QT_LIST_VIDEO) == 0) {
+ qi = lqt_query_registry(0, 1, 1, 0);
+ } else if (strcmp(list_type, QT_LIST_AUDIO) == 0) {
+ qi = lqt_query_registry(1, 0, 1, 0);
+ } else {
+ qi = lqt_query_registry(1, 1, 1, 0);
+ }
+
+ tc_log_info(MOD_NAME, "List of supported %s:", list_type);
+ tc_log_info(MOD_NAME, "Name comments");
+ tc_log_info(MOD_NAME, "--------------- "
+ "-----------------------------------");
+ while (qi[cod] != NULL) {
+ if (strcmp(list_type, QT_LIST_PARM) == 0) {
+ tc_log_info(MOD_NAME, "%s:", qi[cod]->name);
+ for(i = 0; i < qi[cod]->num_encoding_parameters; i++) {
+ if (qi[cod]->encoding_parameters[i].type != LQT_PARAMETER_SECTION) {
+ tc_log_info(MOD_NAME, " %-23s %s",
+ qi[cod]->encoding_parameters[i].name,
+ qi[cod]->encoding_parameters[i].real_name);
+ }
+ }
+ } else {
+ tc_log_info(MOD_NAME, "%-23s %s",
+ qi[cod]->name,
+ qi[cod]->description);
+ }
+ cod++;
+ }
+
+ return 1;
+}
+
+/* ------------------------------------------------------------
+ *
+ * open outputfile
+ *
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+ if(param->flag == TC_VIDEO)
+ return(0);
+
+ if(param->flag == TC_AUDIO)
+ return(0);
+
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+
+ int list_was_called = 0;
+
+ /* for codec parameters */
+ int jpeg_quality = 0;
+ int div3_bitrate_tolerance = 500000;
+ int vorbis_max_bitrate = 192;
+ int vorbis_min_bitrate = 128;
+
+ /* overwriting empty parameters now saves trouble later */
+ if (vob->ex_v_fcc == NULL) vob->ex_v_fcc = "";
+ if (vob->ex_a_fcc == NULL) vob->ex_a_fcc = "";
+ if (vob->ex_profile_name == NULL) vob->ex_profile_name = "";
+
+ if (!strcasecmp(vob->ex_v_fcc, "list")) list_was_called = list(QT_LIST_VIDEO);
+ if (!strcasecmp(vob->ex_a_fcc, "list")) list_was_called = list(QT_LIST_AUDIO);
+ if (!strcasecmp(vob->ex_profile_name, "list")) {
+ int i;
+
+ list_was_called = list(QT_LIST_PARM);
+
+ /* list special paramters at the end */
+ for(i = 0; qt_param_list[i].name != NULL; i++) {
+ tc_log_info(MOD_NAME, " %-23s %s",
+ qt_param_list[i].name,
+ qt_param_list[i].comments);
+ }
+ }
+
+ if (list_was_called) {
+ return(TC_EXPORT_ERROR);
+ }
+ /* video setup -------------------------------------------------- */
+ if(param->flag == TC_VIDEO) {
+
+ lqt_codec_info_t ** qt_codec_info = NULL;
+
+ char *qt_codec;
+ int divx_bitrate;
+
+ /* fetch frame size */
+ w = vob->ex_v_width;
+ h = vob->ex_v_height;
+
+ /* fetch qt codec from -F switch */
+ qt_codec = tc_strdup(vob->ex_v_fcc);
+
+ /* open target file for writing */
+ if(NULL == (qtfile = quicktime_open((char *)vob->video_out_file, 0, 1)) ){
+ tc_log_warn(MOD_NAME, "error opening qt file '%s'",
+ vob->video_out_file);
+ return(TC_EXPORT_ERROR);
+ }
+
+ /* set qt codecs */
+ /* not needed for passthrough*/
+ if (vob->im_v_codec != CODEC_RAW && vob->im_v_codec != CODEC_RAW_YUV && vob->im_v_codec != CODEC_RAW_RGB) {
+ if(qt_codec == NULL || strlen(qt_codec)==0) {
+ /* default */
+ qt_codec = "mjpa";
+ if (verbose_flag != TC_QUIET) {
+ tc_log_info(MOD_NAME, "Empty qt codec name. Switching to %s use '-F list'"
+ " to get a list of supported codec.", qt_codec);
+ }
+ }
+
+ /* check if we can encode with this codec */
+ qt_codec_info = lqt_find_video_codec_by_name(qt_codec);
+ if (!qt_codec_info) {
+ tc_log_warn(MOD_NAME, "qt video codec '%s' not supported!", qt_codec);
+ return(TC_EXPORT_ERROR);
+ }
+
+#if !defined(LIBQUICKTIME_000904)
+ /* set proposed video codec */
+ lqt_set_video(qtfile, 1, w, h, vob->ex_fps,qt_codec_info[0]);
+#else
+ /* set proposed video codec */
+ lqt_set_video(qtfile, 1, w, h,
+ tc_quicktime_get_timescale(vob->ex_fps) / vob->ex_fps+0.5,
+ tc_quicktime_get_timescale(vob->ex_fps), qt_codec_info[0]);
+#endif
+ }
+
+ /* set color model */
+ switch(vob->im_v_codec) {
+ case CODEC_RGB:
+ qt_cm = BC_RGB888;
+ tc_cm = IMG_RGB_DEFAULT;
+ break;
+
+ case CODEC_YUV:
+ qt_cm = BC_YUV420P;
+ tc_cm = IMG_YUV_DEFAULT;
+ break;
+
+ case CODEC_YUV422:
+ tc_cm = IMG_YUV422P;
+ qt_cm = BC_YUV422P;
+ break;
+
+ case CODEC_YUY2:
+ tc_cm = IMG_YUY2;
+ qt_cm = BC_YUV422;
+ break;
+
+ /* passthrough */
+ case CODEC_RAW_RGB:
+ case CODEC_RAW_YUV:
+ case CODEC_RAW:
+ /* set out output codec to input codec */
+ if(qt_codec == NULL || strlen(qt_codec)==0) {
+ switch (vob->v_codec_flag) {
+ case TC_CODEC_MJPEG:
+ quicktime_set_video(qtfile, 1, w, h, vob->ex_fps,"jpeg");
+ break;
+
+ case TC_CODEC_MPEG:
+ quicktime_set_video(qtfile, 1, w, h, vob->ex_fps,"mpeg");
+ break;
+
+ case TC_CODEC_DV:
+ quicktime_set_video(qtfile, 1, w, h, vob->ex_fps,"dvc ");
+ break;
+
+ case TC_CODEC_SVQ1:
+ quicktime_set_video(qtfile, 1, w, h, vob->ex_fps,"SVQ1");
+ break;
+
+ case TC_CODEC_SVQ3:
+ quicktime_set_video(qtfile, 1, w, h, vob->ex_fps,"SVQ3");
+ break;
+
+ case TC_CODEC_YUV420P:
+ quicktime_set_video(qtfile, 1, w, h, vob->ex_fps,"yv12");
+ break;
+
+ case TC_CODEC_RGB:
+ quicktime_set_video(qtfile, 1, w, h, vob->ex_fps,"raw ");
+ break;
+
+ case TC_CODEC_YUV2: /* test this */
+ quicktime_set_video(qtfile, 1, w, h, vob->ex_fps,"yuv2");
+ break;
+
+ case TC_CODEC_DIVX3:
+ case TC_CODEC_DIVX4:
+ case TC_CODEC_DIVX5:
+ quicktime_set_video(qtfile, 1, w, h, vob->ex_fps,"DIVX");
+ break;
+
+ default:
+ tc_log_warn(MOD_NAME, "codec '%lx' not supported for pass-through",
+ vob->v_codec_flag);
+ tc_log_warn(MOD_NAME, " If you really know what you are doing you can force");
+ tc_log_warn(MOD_NAME, " a codec via -F <vc>, '-F list' returns a list");
+ return(TC_EXPORT_ERROR);
+ break;
+ }
+ }
+ else {
+ tc_log_warn(MOD_NAME,"Overriding the output codec is almost never a good idea");
+ quicktime_set_video(qtfile, 1, w, h, vob->ex_fps,qt_codec);
+ }
+
+ rawVideo = 1;
+ break;
+
+ default:
+ /* unsupported internal format */
+ tc_log_warn(MOD_NAME, "unsupported internal video format %x",
+ vob->ex_v_codec);
+ return(TC_EXPORT_ERROR);
+ break;
+ }
+
+ /* if cs conversation not supported for codec do conversation */
+ /* not required for pass through */
+ if (vob->im_v_codec != CODEC_RAW && vob->im_v_codec != CODEC_RAW_YUV && vob->im_v_codec != CODEC_RAW_RGB) {
+ if (quicktime_writes_cmodel(qtfile, qt_cm, 0) != 1) {
+ if (verbose_flag != TC_QUIET) {
+ tc_log_info(MOD_NAME,"Colorspace not supported for this codec converting to RGB");
+ }
+
+ qt_cm = BC_RGB888;
+ lqt_set_cmodel(qtfile, 0, qt_cm);
+
+ tcvhandle = tcv_init();
+ if (!tcvhandle) {
+ tc_log_warn(MOD_NAME, "image conversion init failed");
+ return TC_EXPORT_ERROR;
+ }
+
+ } else {
+ lqt_set_cmodel(qtfile, 0, qt_cm);
+ }
+ }
+
+ /* set codec parameters */
+ /* tc uses kb */
+ divx_bitrate = vob->divxbitrate * 1000;
+ /* if max bitrate > bitrate use difference for bitrate tolerance */
+ if (vob->video_max_bitrate > vob->divxbitrate) div3_bitrate_tolerance = (vob->video_max_bitrate - vob->divxbitrate) * 1000;
+
+
+ /* Audio */
+ /* must be changed when it's changed in lqt; "bit_rate" conflicts with ffmpeg video codec */
+ if (strcmp(qt_codec,"ffmpeg_mp2") == 0||
+ strcmp(qt_codec,"ffmpeg_mp3") == 0||
+ strcmp(qt_codec,"ffmpeg_ac3") == 0)
+ quicktime_set_parameter(qtfile, "bit_rate", &vob->mp3bitrate);
+
+ if (strcmp(qt_codec,"lame") == 0)
+ quicktime_set_parameter(qtfile, "mp3_bitrate", &vob->mp3bitrate);
+
+ /* have to check this */
+ if (strcmp(qt_codec,"vorbis") == 0) {
+ quicktime_set_parameter(qtfile, "vorbis_bitrate", &vob->mp3bitrate);
+ quicktime_set_parameter(qtfile, "vorbis_max_bitrate", &vorbis_max_bitrate);
+ quicktime_set_parameter(qtfile, "vorbis_min_bitrate", &vorbis_min_bitrate);
+ quicktime_set_parameter(qtfile, "vorbis_vbr", &vob->a_vbr);
+ }
+
+ /* Video */
+ /* jpeg_quality == 0-100 ; tc quality setting (-Q) == 1-5 */
+ jpeg_quality = 20 * vob->divxquality;
+
+ if (strcmp(qt_codec,"mjpa") == 0||
+ strcmp(qt_codec,"jpeg") == 0)
+ quicktime_set_parameter(qtfile, "jpeg_quality", &jpeg_quality);
+
+ /* looks terrible :/ */
+ if (strcmp(qt_codec,"ffmpeg_mjpg") == 0||
+ strcmp(qt_codec,"ffmpeg_h263p") == 0||
+ strcmp(qt_codec,"ffmpeg_h263") == 0||
+ strcmp(qt_codec,"ffmpeg_msmpeg4v3") == 0||
+ strcmp(qt_codec,"ffmpeg_msmpeg4v2") == 0||
+ strcmp(qt_codec,"ffmpeg_msmpeg4v1") == 0||
+ strcmp(qt_codec,"ffmpeg_msmpg1") == 0||
+ strcmp(qt_codec,"ffmpeg_mpg4") == 0){
+
+ int min_bitrate = 0;
+
+ quicktime_set_parameter(qtfile, "flags_gray", &vob->decolor); /* set format different for this */
+
+ switch (vob->decolor) {
+ case 1:
+ quicktime_set_parameter(qtfile, "aspect_ratio_info", "Square");
+ break;
+
+ case 2:
+ quicktime_set_parameter(qtfile, "aspect_ratio_info", "4:3");
+ break;
+
+ case 3:
+ quicktime_set_parameter(qtfile, "aspect_ratio_info", "16:9");
+ break;
+
+ default:
+ tc_log_warn(MOD_NAME, "Given aspect ratio not supported, using default");
+ break;
+ }
+
+ quicktime_set_parameter(qtfile, "flags_gray", &vob->decolor);
+ quicktime_set_parameter(qtfile, "bit_rate", &vob->divxbitrate);
+ quicktime_set_parameter(qtfile, "bit_rate_tolerance", &div3_bitrate_tolerance);
+
+ min_bitrate = vob->divxbitrate - div3_bitrate_tolerance;
+ quicktime_set_parameter(qtfile, "rc_max_rate", &vob->video_max_bitrate);
+ quicktime_set_parameter(qtfile, "qmax", &vob->max_quantizer);
+ quicktime_set_parameter(qtfile, "qmin", &vob->min_quantizer);
+
+
+ if (!strcmp(qt_codec,"ffmpeg_mjpg"))
+ quicktime_set_parameter(qtfile, "gob_size", &vob->divxkeyframes);
+ }
+
+ if (strcmp(vob->ex_v_fcc,"opendivx") == 0) {
+ quicktime_set_parameter(qtfile, "divx_bitrate", &divx_bitrate);
+ quicktime_set_parameter(qtfile, "divx_rc_period", &vob->rc_period);
+ quicktime_set_parameter(qtfile, "divx_rc_reaction_period", &vob->rc_reaction_period);
+ quicktime_set_parameter(qtfile, "divx_rc_reaction_ratio", &vob->rc_reaction_ratio);
+ quicktime_set_parameter(qtfile, "divx_max_key_interval", &vob->divxkeyframes);
+ quicktime_set_parameter(qtfile, "divx_min_quantizer", &vob->min_quantizer);
+ quicktime_set_parameter(qtfile, "divx_max_quantizer", &vob->max_quantizer);
+ quicktime_set_parameter(qtfile, "divx_quantizer", &vob->min_quantizer);
+ quicktime_set_parameter(qtfile, "divx_quality", &vob->quality);
+ }
+
+ if (strcmp(qt_codec,"rtjpeg") == 0)
+ quicktime_set_parameter(qtfile, "rtjpeg_quality", &jpeg_quality);
+
+
+ /* set extended parameters */
+ if (vob->ex_profile_name != NULL) {
+ int i;
+ char meta[128];
+
+ if (optstr_get(vob->ex_profile_name, "copyright", "%128[^:]", meta) > 0) {
+ quicktime_set_copyright(qtfile, meta);
+ }
+ if(optstr_get(vob->ex_profile_name, "name", "%128[^:]", meta) > 0) {
+ quicktime_set_name(qtfile, meta);
+ }
+ if(optstr_get(vob->ex_profile_name, "info", "%128[^:]", meta) > 0) {
+ quicktime_set_name(qtfile, meta);
+ }
+
+ for (i = 0; i < (* qt_codec_info)->num_encoding_parameters; i++) {
+ lqt_parameter_info_t param = (* qt_codec_info)->encoding_parameters[i];
+
+ if (param.type == LQT_PARAMETER_INT) {
+ int val;
+ if (optstr_get(vob->ex_profile_name, param.name, "%i", &val) > 0) {
+ lqt_set_video_parameter(qtfile, 0, param.name, &val);
+ }
+ }
+ else if (param.type == LQT_PARAMETER_FLOAT) {
+ float val;
+ if (optstr_get(vob->ex_profile_name, param.name, "%f", &val) > 0) {
+ lqt_set_video_parameter(qtfile, 0, param.name, &val);
+ }
+ }
+ else if (param.type == LQT_PARAMETER_STRING || param.type == LQT_PARAMETER_STRINGLIST) {
+ char val[128];
+ if (optstr_get(vob->ex_profile_name, param.name, "%128[^:]", val) > 0) {
+ lqt_set_video_parameter(qtfile, 0, param.name, val);
+ }
+ }
+ }
+ }
+
+ /* alloc row pointers for frame encoding */
+ row_ptr = malloc (sizeof(char *) * h);
+
+ /* same for temp buffer ... used during yuy2/yv12 encoding */
+ tmp_buf = malloc (w*h*2);
+
+ /* verbose */
+ tc_log_info(MOD_NAME, "video codec='%s' w=%d h=%d fps=%g",
+ qt_codec,w,h,vob->ex_fps);
+
+ return(0);
+ }
+
+ /* audio setup -------------------------------------------------- */
+ if(param->flag == TC_AUDIO){
+ const char *qt_codec;
+ lqt_codec_info_t ** qt_codec_info = 0;
+
+ /* no audio setup if we don't have any channels (size == 0 might be better?)*/
+ if(vob->dm_chan==0) return 0;
+
+ /* check given audio format */
+ if((vob->dm_chan!=1)&&(vob->dm_chan!=2)) {
+ tc_log_warn(MOD_NAME, "Only mono or stereo audio supported");
+ return(TC_EXPORT_ERROR);
+ }
+ channels = vob->dm_chan;
+ bits = vob->dm_bits;
+
+ /* fetch qt codec from -F switch */
+ qt_codec = vob->ex_a_fcc;
+ if(qt_codec == NULL || strlen(qt_codec)==0) {
+ qt_codec = "ima4";
+ if (verbose_flag != TC_QUIET) {
+ tc_log_info(MOD_NAME, "empty qt codec name - switching to %s"
+ " use '-F ,list'", qt_codec);
+ tc_log_info(MOD_NAME, "to get a list of supported codec");
+ }
+ }
+
+
+ /* check encoder mode */
+ switch(vob->im_a_codec) {
+ case CODEC_PCM:
+ /* allocate sample buffers */
+ audbuf0 = (int16_t*)malloc(vob->ex_a_size);
+ audbuf1 = (int16_t*)malloc(vob->ex_a_size);
+
+ /* need to encode audio */
+ rawAudio = 0;
+ break;
+
+ default:
+ /* unsupported internal format */
+ tc_log_warn(MOD_NAME, "unsupported internal audio format %x",
+ vob->ex_v_codec);
+ return(TC_EXPORT_ERROR);
+ break;
+ }
+
+ qt_codec_info = lqt_find_audio_codec_by_name(qt_codec);
+ if (!qt_codec_info){
+ tc_log_warn(MOD_NAME, "qt audio codec '%s' unsupported",
+ qt_codec);
+ return(TC_EXPORT_ERROR);
+ }
+
+ /* setup audio parameters */
+ lqt_set_audio(qtfile,channels,vob->a_rate,bits,qt_codec_info[0]);
+
+ /* verbose */
+ tc_log_info(MOD_NAME, "audio codec='%s' bits=%d chan=%d rate=%d",
+ qt_codec,bits,channels,vob->a_rate);
+ return(0);
+ }
+
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * encode and export frame
+ *
+ * ------------------------------------------------------------*/
+
+
+MOD_encode
+{
+ /* video -------------------------------------------------------- */
+ if(param->flag == TC_VIDEO) {
+ vob_t *vob = tc_get_vob();
+
+ /* raw mode is easy */
+ if(rawVideo) {
+ /* add divx keyframes if needed */
+ if(quicktime_divx_is_key(param->buffer, param->size) == 1) quicktime_insert_keyframe(qtfile, (int)tc_get_frames_encoded(), 0);
+ if(quicktime_write_frame(qtfile,param->buffer,param->size,0)<0) {
+ tc_log_warn(MOD_NAME, "error writing raw video frame");
+ return(TC_EXPORT_ERROR);
+ }
+ }
+
+ /* encode frame */
+ else {
+ uint8_t *ptr = param->buffer;
+ int iy;
+
+ switch(qt_cm) {
+ case BC_RGB888:
+ /* convert to rgb if unsupported */
+ if (tc_cm != IMG_RGB24) {
+ if (!tcv_convert(tcvhandle, param->buffer, param->buffer,
+ vob->ex_v_width, vob->ex_v_height,
+ tc_cm, IMG_RGB24)) {
+ tc_log_warn(MOD_NAME, "image format conversion failed");
+ return TC_EXPORT_ERROR;
+ }
+ }
+
+ /* setup row pointers for RGB */
+ for (iy = 0; iy < h; iy++) {
+ row_ptr[iy] = ptr;
+ ptr += w*3;
+ }
+ break;
+ case BC_YUV420P:
+ /* setup row pointers for YUV420P */
+ row_ptr[0] = ptr;
+ ptr = ptr + (h * w);
+ /* note, quicktime wants YV12 so we reverse the planes */
+ row_ptr[2] = ptr;
+ ptr = ptr + (h * w) / 4;
+ row_ptr[1] = ptr;
+ break;
+ case BC_YUV422P:
+ /* setup row pointers for YUV422P */
+ row_ptr[0] = ptr;
+ ptr = ptr + (h * w);
+ row_ptr[1] = ptr;
+ ptr = ptr + (h * w) / 2;
+ row_ptr[2] = ptr;
+ break;
+ case BC_YUV422:
+ /* setup row pointers for YUY2 */
+ for (iy = 0; iy < h; iy++) {
+ row_ptr[iy] = ptr;
+ ptr += w*2;
+ }
+ break;
+ }
+
+ if(quicktime_encode_video(qtfile, row_ptr, 0)<0) {
+ tc_log_warn(MOD_NAME, "error encoding video frame");
+ return(TC_EXPORT_ERROR);
+ }
+ }
+
+ return(0);
+ }
+ /* audio -------------------------------------------------------- */
+ if(param->flag == TC_AUDIO){
+ /* raw mode is easy */
+ if(rawAudio) {
+ if(quicktime_write_frame(qtfile,
+ param->buffer,param->size,0)<0) {
+ tc_log_warn(MOD_NAME, "error writing raw audio frame");
+ return(TC_EXPORT_ERROR);
+ }
+ }
+ /* encode audio */
+ else {
+ int s,t;
+ int16_t *aptr[2] = { audbuf0, audbuf1 };
+
+ /* calc number of samples */
+ int samples = param->size;
+
+ /* no audio */
+ if (samples == 0) return 0;
+
+ if(bits==16)
+ samples >>= 1;
+ if(channels==2)
+ samples >>= 1;
+
+ /* fill audio buffer */
+ if(bits==8) {
+ /* UNTESTED: please verify :) */
+ if(channels==1) {
+ for(s=0;s<samples;s++)
+ audbuf0[s] = ((((int16_t)param->buffer[s]) << 8)-0x8000);
+ }
+ else /* stereo */ {
+ for(s=0,t=0;s<samples;s++,t+=2) {
+ audbuf0[s] = ((((int16_t)param->buffer[t]) << 8)-0x8000);
+ audbuf1[s] = ((((int16_t)param->buffer[t+1]) << 8)-0x8000);
+ }
+ }
+ }
+ else /* 16 bit */ {
+ if(channels==1) {
+ aptr[0] = (int16_t *)param->buffer;
+ }
+ else /* stereo */ {
+ /* decouple channels */
+ for(s=0,t=0;s<samples;s++,t+=2) {
+ audbuf0[s] = ((int16_t *)param->buffer)[t];
+ audbuf1[s] = ((int16_t *)param->buffer)[t+1];
+ }
+ }
+ }
+
+ /* encode audio samples */
+ if ((quicktime_encode_audio(qtfile, aptr, NULL, samples)<0)){
+ tc_log_warn(MOD_NAME, "error encoding audio frame");
+ return(TC_EXPORT_ERROR);
+ }
+ }
+
+ return(0);
+ }
+
+ return(TC_EXPORT_ERROR);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * stop encoder
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+
+ if(param->flag == TC_VIDEO) {
+ /* free row pointers */
+ if(row_ptr!=NULL)
+ free(row_ptr);
+ return(0);
+ }
+
+ if(param->flag == TC_AUDIO) {
+ /* free audio buffers */
+ if(audbuf0!=NULL)
+ free(audbuf0);
+ if(audbuf1!=NULL)
+ free(audbuf1);
+ return(0);
+ }
+
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * close outputfile
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+ if(param->flag == TC_VIDEO){
+ /* close quicktime file */
+ quicktime_close(qtfile);
+ qtfile=NULL;
+ return(0);
+ }
+
+ if(param->flag == TC_AUDIO) {
+ return(0);
+ }
+
+ return(TC_EXPORT_ERROR);
+
+}
diff --git a/debian/transcode/transcode-1.1.7/export/export_mp2.c b/debian/transcode/transcode-1.1.7/export/export_mp2.c
new file mode 100644
index 00000000..6b35c018
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_mp2.c
@@ -0,0 +1,258 @@
+/*
+ * export_mp2.c
+ *
+ * Copyright (C) Simone Karin Lehmann, June 2004, based on export_ac3 by Daniel Pittman
+ * Copyright (C) Daniel Pittman, 2003, based on export_ogg.c which was:
+ * Copyright (C) Tilmann Bitterberg, July 2002
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+/* Usage:
+
+ This module processes audio streams only. There are no compile time depencies.
+ At run time, sox and ffmpeg must be present.
+
+ This module lets you encode audio to MPEG 1 Layer 2 audio aka mp2. It uses the
+ ffmpeg encoder and therefor it's very fast. Just do
+
+ -y <video_module>,mp2
+
+ Additionaly this module can change the speed of the audio stream by a factor the
+ user can specify. You need sox do do this. Use the module the follwing way
+
+ -y <video_module>,mp2=speed=N
+
+ where N is an unsigned float. N < 1.0 will slow down audio (meaning playing time will
+ increase) whereas N > 1.0 will speed up audio (meaning playing time will decrease)
+ The pitch of the audio is not corrected. E.g. to speed up audio by 25/23.976 (this
+ is used to convert NTSC film material to PAL) use
+
+ -y <video_module>,mp2=speed=1.0427093
+
+*/
+
+#define MOD_NAME "export_mp2.so"
+#define MOD_VERSION "v0.2.1 (2004-08-06)"
+#define MOD_CODEC "(audio) MPEG 1/2"
+
+#include "transcode.h"
+#include "libtc/optstr.h"
+
+#include <stdio.h>
+#include <unistd.h>
+
+static int verbose_flag=TC_QUIET;
+static int capability_flag=TC_CAP_PCM;
+
+#define MOD_PRE mp2
+#include "export_def.h"
+
+static FILE *pFile = NULL;
+static double speed = 0.0;
+
+static inline int p_write (char *buf, size_t len)
+{
+ size_t n = 0;
+ size_t r = 0;
+ int fd = fileno (pFile);
+
+ while (r < len)
+ {
+ if ((n = write (fd, buf + r, len - r)) < 0)
+ return n;
+
+ r += n;
+ }
+
+ return r;
+}
+
+/* ------------------------------------------------------------
+ *
+ * open codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+ int result, srate;
+
+ /* check for ffmpeg */
+ if (tc_test_program("ffmpeg") != 0) return (TC_EXPORT_ERROR);
+
+ if (param->flag == TC_AUDIO) {
+ char buf [PATH_MAX];
+ char out_fname [PATH_MAX];
+ char *ptr = buf;
+
+ strlcpy(out_fname, vob->audio_out_file, sizeof(out_fname));
+ if (strcmp(vob->audio_out_file, vob->video_out_file) == 0)
+ strlcat(out_fname, ".mpa", sizeof(out_fname));
+
+ if (vob->mp3bitrate == 0) {
+ tc_log_warn (MOD_NAME, "Audio bitrate 0 is not valid, cannot cope.");
+ return(TC_EXPORT_ERROR);
+ }
+
+ srate = (vob->mp3frequency != 0) ? vob->mp3frequency : vob->a_rate;
+
+ // need sox for speed changing?
+ if (speed > 0.0) {
+
+ /* check for sox */
+ if (tc_test_program("sox") != 0) return (TC_EXPORT_ERROR);
+
+ result = tc_snprintf(buf, PATH_MAX,
+ "sox %s -s -c %d -r %d -t raw - -r %d -t wav - speed %.10f | ",
+ vob->dm_bits == 16 ? "-w" : "-b",
+ vob->dm_chan,
+ vob->a_rate,
+ vob->a_rate,
+ speed);
+ if (result < 0)
+ return(TC_EXPORT_ERROR);
+
+ ptr = buf + strlen(buf);
+ }
+
+ result = tc_snprintf (ptr, PATH_MAX - strlen(buf),
+ "ffmpeg -y -f s%d%s -ac %d -ar %d -i - -ab %dk -ar %d -f mp2 %s%s",
+ vob->dm_bits,
+ ((vob->dm_bits > 8) ? "le" : ""),
+ vob->dm_chan,
+ vob->a_rate,
+ vob->mp3bitrate,
+ srate,
+ out_fname,
+ vob->verbose > 1 ? "" : " >/dev/null 2>&1");
+
+ if (result < 0)
+ return(TC_EXPORT_ERROR);
+
+ if (verbose > 0)
+ tc_log_info (MOD_NAME, "%s", buf);
+
+ if ((pFile = popen (buf, "w")) == NULL)
+ return(TC_EXPORT_ERROR);
+
+ return(0);
+
+ }
+
+ if (param->flag == TC_VIDEO)
+ return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+ if(param->flag == TC_AUDIO)
+ {
+ if (vob->ex_a_string) {
+ optstr_get(vob->ex_a_string, "speed", "%lf", &speed);
+ }
+ return(0);
+ }
+
+ if (param->flag == TC_VIDEO)
+ return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * encode and export
+ *
+ * ------------------------------------------------------------*/
+
+MOD_encode
+{
+ if(param->flag == TC_AUDIO)
+ {
+ if (p_write (param->buffer, param->size) != param->size)
+ {
+ tc_log_perror(MOD_NAME, "write audio frame");
+ return(TC_EXPORT_ERROR);
+ }
+ return (0);
+ }
+
+ if (param->flag == TC_VIDEO)
+ return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * stop codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+ if (param->flag == TC_VIDEO)
+ return (0);
+
+ if (param->flag == TC_AUDIO)
+ return (0);
+
+ return(TC_EXPORT_ERROR);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * close codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+ if (param->flag == TC_VIDEO)
+ return (0);
+
+ if (param->flag == TC_AUDIO)
+ {
+ if (pFile)
+ pclose (pFile);
+
+ pFile = NULL;
+
+ return(0);
+ }
+
+ return (TC_EXPORT_ERROR);
+}
+
+/* vim: sw=4
+ */
diff --git a/debian/transcode/transcode-1.1.7/export/export_mp2enc.c b/debian/transcode/transcode-1.1.7/export/export_mp2enc.c
new file mode 100644
index 00000000..c6026b1c
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_mp2enc.c
@@ -0,0 +1,254 @@
+/*
+ * export_mp2enc.c
+ *
+ * Georg Ludwig - January 2002
+ *
+ * Parts of export_wav and export_mpeg2enc used for this file
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#define MOD_NAME "export_mp2enc.so"
+#define MOD_VERSION "v1.0.11 (2006-03-16)"
+#define MOD_CODEC "(audio) MPEG 1/2"
+
+#include "transcode.h"
+#include "avilib/wavlib.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#define CLAMP(x,l,h) x > h ? h : x < l ? l : x
+
+static int verbose_flag = TC_QUIET;
+static int capability_flag = TC_CAP_PCM;
+
+#define MOD_PRE mp2enc
+#include "export_def.h"
+
+static FILE* pFile = NULL;
+static WAV wav = NULL;
+
+/* ------------------------------------------------------------
+ *
+ * open outputfile
+ *
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+ int verb;
+
+ /* check for mp2enc */
+ if (tc_test_program("mp2enc") != 0) return (TC_EXPORT_ERROR);
+
+ if (param->flag == TC_AUDIO)
+ {
+ char buf [PATH_MAX];
+ char mono[] = "-m";
+ char stereo[] = "-s";
+ int srate, brate;
+ char *chan;
+ int def_srate, def_brate;
+ char *def_chan;
+
+ verb = (verbose & TC_DEBUG) ? 2:0;
+
+ srate = (vob->mp3frequency != 0) ? vob->mp3frequency : vob->a_rate;
+ brate = vob->mp3bitrate;
+ chan = (vob->dm_chan>=2) ? stereo : mono;
+
+ def_srate = srate;
+ def_brate = brate;
+ def_chan = chan;
+
+ // default profile values, authority: videohelp and dvdfaq
+ switch(vob->mpeg_profile) {
+ case VCD_PAL: case VCD_NTSC: case VCD:
+ def_srate = 44100;
+ def_brate = 224;
+ def_chan = stereo;
+ break;
+ case SVCD_PAL: case SVCD_NTSC: case SVCD:
+ def_srate = 44100;
+ def_brate = CLAMP (brate, 64, 384);
+ def_chan = stereo;
+ break;
+ case XVCD_PAL: case XVCD_NTSC: case XVCD:
+ // check for invalid sample rate
+ if ((srate != 32000) && (srate != 44100) && (srate != 48000))
+ def_srate = 44100;
+ // don't change if valid rate
+ def_brate = CLAMP (brate, 64, 384);
+ def_chan = stereo;
+ break;
+ case DVD_PAL: case DVD_NTSC: case DVD:
+ def_srate = 48000;
+ def_brate = CLAMP (brate, 64, 384);
+ def_chan = stereo;
+ case PROF_NONE:
+ break;
+ }
+
+ // encoding values, let commandline override profile
+ if(!(vob->export_attributes & TC_EXPORT_ATTRIBUTE_ARATE))
+ if (srate != def_srate) {
+ tc_log_info(MOD_NAME, "export profile changed samplerate:"
+ " %d -> %d Hz.", srate, def_srate);
+ srate = def_srate;
+ }
+ if(!(vob->export_attributes & TC_EXPORT_ATTRIBUTE_ABITRATE))
+ if (brate != def_brate) {
+ tc_log_info(MOD_NAME, "export profile changed bitrate: "
+ "%d -> %d kbps.", brate, def_brate);
+ brate = def_brate;
+ }
+ if(!(vob->export_attributes & TC_EXPORT_ATTRIBUTE_ACHANS))
+ if (chan != def_chan) {
+ tc_log_info(MOD_NAME, "export profile changed channels: "
+ "mono -> stereo.");
+ chan = def_chan;
+ }
+
+ if(tc_snprintf(buf, PATH_MAX, "mp2enc -v %d -r %d -b %d %s -o \"%s\" %s", verb, srate, brate, chan, vob->audio_out_file, (vob->ex_a_string?vob->ex_a_string:"")) < 0) {
+ tc_log_perror(MOD_NAME, "cmd buffer overflow");
+ return(TC_EXPORT_ERROR);
+ }
+
+ if(verbose & TC_INFO) tc_log_info(MOD_NAME, "(%d/%d) cmd=%s",
+ (int)strlen(buf), PATH_MAX, buf);
+
+ if((pFile = popen (buf, "w")) == NULL)
+ return(TC_EXPORT_ERROR);
+
+ wav = wav_fdopen(fileno(pFile), WAV_WRITE|WAV_PIPE, NULL);
+ if (wav == NULL) {
+ tc_log_perror(MOD_NAME, "open wave stream");
+ return TC_EXPORT_ERROR;
+ }
+
+ wav_set_rate(wav, vob->a_rate);
+ wav_set_bitrate(wav, vob->dm_chan*vob->a_rate*vob->dm_bits/8);
+ wav_set_channels(wav, vob->dm_chan);
+ wav_set_bits(wav, vob->dm_bits);
+
+ return(0);
+ }
+
+ if (param->flag == TC_VIDEO)
+ return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+ if(param->flag == TC_AUDIO)
+ {
+ return(0);
+ }
+
+ if (param->flag == TC_VIDEO)
+ return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * encode and export frame
+ *
+ * ------------------------------------------------------------*/
+
+
+MOD_encode
+{
+ if(param->flag == TC_AUDIO)
+ {
+ if (wav_write_data(wav, param->buffer, param->size) != param->size)
+ {
+ tc_log_perror(MOD_NAME, "write audio frame");
+ return(TC_EXPORT_ERROR);
+ }
+ return (0);
+ }
+
+ if (param->flag == TC_VIDEO)
+ return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * stop encoder
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+ if (param->flag == TC_VIDEO)
+ return (0);
+
+ if (param->flag == TC_AUDIO)
+ return (0);
+
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * close codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+ if (param->flag == TC_VIDEO)
+ return (0);
+
+ if (param->flag == TC_AUDIO)
+ {
+ if (wav != NULL) {
+ wav_close(wav);
+ wav = NULL;
+ }
+ if (pFile != NULL) {
+ pclose (pFile);
+ pFile = NULL;
+ }
+
+ return(0);
+ }
+
+ return (TC_EXPORT_ERROR);
+}
+
diff --git a/debian/transcode/transcode-1.1.7/export/export_mpeg2enc.c b/debian/transcode/transcode-1.1.7/export/export_mpeg2enc.c
new file mode 100644
index 00000000..3603387b
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_mpeg2enc.c
@@ -0,0 +1,468 @@
+/*
+ * export_mpeg2enc.c
+ *
+ * Copyright (C) Gerhard Monzel - January 2002
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#define MOD_NAME "export_mpeg2enc.so"
+#define MOD_VERSION "v1.1.10 (2003-10-30)"
+#define MOD_CODEC "(video) MPEG 1/2"
+
+#include "transcode.h"
+#include "libtcvideo/tcvideo.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#if defined(HAVE_MJPEGTOOLS_INC)
+#include "yuv4mpeg.h"
+#include "mpegconsts.h"
+#else
+#include "mjpegtools/yuv4mpeg.h"
+#include "mjpegtools/mpegconsts.h"
+#endif
+
+static int verbose_flag=TC_QUIET;
+static int capability_flag=TC_CAP_YUV|TC_CAP_RGB;
+
+#define MOD_PRE mpeg2enc
+#include "export_def.h"
+
+static y4m_stream_info_t y4mstream;
+
+static FILE *sa_ip = NULL;
+static int sa_width = 0;
+static int sa_height = 0;
+static int sa_size_l = 0;
+static int sa_size_c = 0;
+static TCVHandle tcvhandle = 0;
+static ImageFormat srcfmt;
+
+#define Y4M_LINE_MAX 256
+#define Y4M_MAGIC "YUV4MPEG2"
+#define Y4M_FRAME_MAGIC "FRAME"
+
+
+static int y4m_snprint_xtags(char *s, int maxn, y4m_xtag_list_t *xtags)
+{
+ int i, room;
+
+ for (i = 0, room = maxn - 1; i < y4m_xtag_count(xtags); i++) {
+ int n = tc_snprintf(s, room + 1, " %s", y4m_xtag_get(xtags, i));
+ if ((n < 0) || (n > room)) return Y4M_ERR_HEADER;
+ s += n;
+ room -= n;
+ }
+ s[0] = '\n'; /* finish off header with newline */
+ s[1] = '\0'; /* ...and end-of-string */
+ return Y4M_OK;
+}
+
+static int y4m_write_stream_header2(FILE *fd, y4m_stream_info_t *i)
+{
+ char s[Y4M_LINE_MAX+1];
+ int n;
+ int err;
+
+ y4m_ratio_t tmpframerate = y4m_si_get_framerate(i);
+ y4m_ratio_t tmpsamplerate = y4m_si_get_sampleaspect(i);
+ y4m_ratio_reduce(&tmpframerate);
+ y4m_ratio_reduce(&tmpsamplerate);
+ n = tc_snprintf(s, sizeof(s), "%s W%d H%d F%d:%d I%s A%d:%d",
+ Y4M_MAGIC,
+ y4m_si_get_width(i),
+ y4m_si_get_height(i),
+ y4m_si_get_framerate(i).n, y4m_si_get_framerate(i).d,
+ (y4m_si_get_interlace(i) == Y4M_ILACE_NONE) ? "p" :
+ (y4m_si_get_interlace(i) == Y4M_ILACE_TOP_FIRST) ? "t" :
+ (y4m_si_get_interlace(i) == Y4M_ILACE_BOTTOM_FIRST) ? "b" : "?",
+ y4m_si_get_sampleaspect(i).n, y4m_si_get_sampleaspect(i).d);
+ if (n < 0) return Y4M_ERR_HEADER;
+ if ((err = y4m_snprint_xtags(s + n, sizeof(s) - n - 1, y4m_si_xtags(i)))
+ != Y4M_OK)
+ return err;
+ /* zero on error */
+ return (fwrite(s, strlen(s), 1, fd) ? Y4M_OK : Y4M_ERR_SYSTEM);
+
+}
+
+static int y4m_write_frame_header2(FILE *fd, y4m_frame_info_t *i)
+{
+ char s[Y4M_LINE_MAX+1];
+ int n;
+ int err;
+
+ n = snprintf(s, sizeof(s), "%s", Y4M_FRAME_MAGIC);
+ if (n < 0) return Y4M_ERR_HEADER;
+ if ((err = y4m_snprint_xtags(s + n, sizeof(s) - n - 1, y4m_fi_xtags(i)))
+ != Y4M_OK)
+ return err;
+ /* zero on error */
+ return (fwrite(s, strlen(s), 1, fd) ? Y4M_OK : Y4M_ERR_SYSTEM);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * open outputfile
+ *
+ * ------------------------------------------------------------*/
+
+
+MOD_open
+{
+
+ int verb, prof=0;
+ const char *p1, *p2, *p3, *p4;
+ char bitrate[25];
+ //char dar_tag[20];
+ y4m_ratio_t framerate;
+ y4m_ratio_t dar;
+ int frc=0, asr=0;
+ char *tv_type="-n p";
+ char *pulldown="";
+ int fields = (vob->encode_fields == TC_ENCODE_FIELDS_TOP_FIRST
+ || vob->encode_fields == TC_ENCODE_FIELDS_BOTTOM_FIRST);
+
+ /* check for mpeg2enc */
+ if (tc_test_program("mpeg2enc") != 0) return (TC_EXPORT_ERROR);
+
+ if(param->flag == TC_VIDEO)
+ {
+ char buf[PATH_MAX];
+ char buf2[16];
+
+ //note: this is the real framerate of the raw stream
+ framerate = (vob->ex_frc==0) ? mpeg_conform_framerate(vob->ex_fps):mpeg_framerate(vob->ex_frc);
+ asr = (vob->ex_asr<0) ? vob->im_asr:vob->ex_asr;
+ switch (asr) {
+ case 1: dar.n = 1; dar.d = 1; break;
+ case 2: dar = y4m_dar_4_3; break;
+ case 3: dar = y4m_dar_16_9; break;
+ case 4: dar = y4m_dar_221_100; break;
+ case 0: default: dar.n=0; dar.d=0; break;
+ }
+
+ y4m_init_stream_info(&y4mstream);
+ y4m_si_set_framerate(&y4mstream,framerate);
+ if (vob->encode_fields == TC_ENCODE_FIELDS_TOP_FIRST) {
+ y4m_si_set_interlace(&y4mstream, Y4M_ILACE_TOP_FIRST);
+ } else if (vob->encode_fields == TC_ENCODE_FIELDS_BOTTOM_FIRST) {
+ y4m_si_set_interlace(&y4mstream, Y4M_ILACE_BOTTOM_FIRST);
+ } else if (vob->encode_fields == TC_ENCODE_FIELDS_PROGRESSIVE) {
+ y4m_si_set_interlace(&y4mstream, Y4M_ILACE_NONE);
+ }
+ y4m_si_set_sampleaspect(&y4mstream, y4m_guess_sar(vob->ex_v_width, vob->ex_v_height, dar));
+ /*
+ tc_snprintf( dar_tag, 19, "XM2AR%03d", asr );
+ y4m_xtag_add( y4m_si_xtags(&y4mstream), dar_tag );
+ */
+ y4m_si_set_height(&y4mstream, vob->ex_v_height);
+ y4m_si_set_width(&y4mstream, vob->ex_v_width);
+
+ verb = (verbose & TC_DEBUG) ? 2:0;
+
+ //base profile support and coustom setting
+ //-- -F "<base-profile>[,<options_string>]"
+ //-- parameter 1 (base profile) --
+
+ p1 = vob->ex_v_fcc;
+ p2 = vob->ex_a_fcc;
+ p3 = vob->ex_profile_name; //unsupported
+
+ if(verbose_flag & TC_DEBUG) tc_log_info(MOD_NAME, "P1=%s, P2=%s, P3=%s", p1, p2, p3);
+
+ prof = (p1==NULL || strlen(p1) == 0) ? 0:atoi(p1);
+
+
+ //-- adjust frame rate stuff --
+ //-----------------------------
+ if (vob->ex_frc) { // use specified output frame rate code
+ frc = vob->ex_frc;
+ } else { // otherwise we guess based on the frame rate
+ if ((int)(vob->ex_fps*100.0 + 0.01) == (int)(29.97*100.0)) {
+ frc=4;
+ } else if ((int)(vob->ex_fps*100.0 + 0.01) == (int)(23.97*100.0)) {
+ frc=1;
+ } else if ((int)(vob->ex_fps*100.0 + 0.01) == (int)(24.00*100.0)) {
+ frc=2;
+ } else {
+ frc=3; // default is PAL framerate code
+ }
+ }
+ // now set the stream type to either NTSC or PAL based on the
+ // frame rate code
+ if ((frc == 4) || (frc == 1) || (frc == 2)) {
+ tv_type = "-n n";
+ } else {
+ tv_type = "-n p"; // default is PAL
+ }
+
+ //ThOe pulldown?
+ if(vob->pulldown) pulldown="-p";
+
+ //ThOe collect additional parameter
+ if(asr>0)
+ tc_snprintf(buf2, sizeof(buf2), "%s %s -a %d", tv_type, pulldown, asr);
+ else
+ tc_snprintf(buf2, sizeof(buf2), "%s %s", tv_type, pulldown);
+
+ if (p2==NULL) p2="";
+
+ // additional commandline arguments
+ if (vob->ex_v_string==NULL) p4="";
+ else p4=vob->ex_v_string;
+
+ // constant quantizer encoding?
+ if (vob->divxmultipass == 3) {
+ if (vob->video_max_bitrate != 0) {
+ tc_snprintf(bitrate, sizeof(bitrate), "-q %d -b %d", vob->divxbitrate, vob->video_max_bitrate);
+ } else {
+ tc_snprintf(bitrate, sizeof(bitrate), "-q %d", vob->divxbitrate);
+ }
+ } else {
+ tc_snprintf(bitrate, sizeof(bitrate), "-b %d", vob->divxbitrate);
+ }
+
+
+ switch(prof) {
+
+ case 1:
+
+ //Standard VCD. An MPEG1 profile
+ //exactly to the VCD2.0 specification.
+
+ tc_snprintf(buf, sizeof(buf), "mpeg2enc -v %d -I %d -f 1 -F %d %s %s -o \"%s\" %s", verb, fields, frc, buf2, p4, vob->video_out_file, p2);
+ break;
+
+ case 2:
+
+ //User VCD
+
+ tc_snprintf(buf, sizeof(buf), "mpeg2enc -v %d -I %d -q 3 -f 2 -4 2 -2 3 %s -F %d %s -o \"%s\" %s %s", verb, fields, bitrate, frc, buf2, vob->video_out_file, p2, p4);
+ break;
+
+ case 3:
+
+ //Generic MPEG2
+
+ tc_snprintf(buf, sizeof(buf), "mpeg2enc -v %d -I %d -q 3 -f 3 -4 2 -2 3 %s -s -F %d %s -o \"%s\" %s %s", verb, fields, bitrate, frc, buf2, vob->video_out_file, p2, p4);
+ break;
+
+ case 4:
+
+ //Standard SVCD. An MPEG-2 profile
+ //exactly to the SVCD2.0 specification
+
+ if ( !(vob->export_attributes & TC_EXPORT_ATTRIBUTE_VBITRATE) )
+ tc_snprintf(buf, sizeof(buf), "mpeg2enc -v %d -I %d -f 4 -F %d %s -o \"%s\" %s %s", verb, fields, frc, buf2, vob->video_out_file, p2, p4);
+ else
+ tc_snprintf(buf, sizeof(buf), "mpeg2enc -v %d -I %d -f 4 %s -F %d %s -o \"%s\" %s %s", verb, fields, bitrate, frc, buf2, vob->video_out_file, p2, p4);
+ break;
+
+ case 5:
+
+ //User SVCD
+
+ tc_snprintf(buf, sizeof(buf), "mpeg2enc -v %d -I %d -q 3 -f 5 -4 2 -2 3 %s -F %d %s -V 230 -o \"%s\" %s %s", verb, fields, bitrate, frc, buf2, vob->video_out_file, p2, p4);
+ break;
+
+ case 6:
+
+ // Manual parameter mode.
+
+ tc_snprintf(buf, sizeof(buf), "mpeg2enc -v %d -I %d %s -o \"%s\" %s %s", verb, fields, bitrate, vob->video_out_file, p2?p2:"", p4);
+ break;
+
+ case 8:
+
+ //DVD
+
+ if ( !(vob->export_attributes & TC_EXPORT_ATTRIBUTE_VBITRATE) )
+ tc_snprintf(buf, sizeof(buf), "mpeg2enc -v %d -I %d -f 8 -F %d %s -o \"%s\" %s %s", verb, fields, frc, buf2, vob->video_out_file, p2, p4);
+ else
+ tc_snprintf(buf, sizeof(buf), "mpeg2enc -v %d -I %d -f 8 %s -F %d %s -o \"%s\" %s %s", verb, fields, bitrate, frc, buf2, vob->video_out_file, p2, p4);
+
+ break;
+
+
+ case 0:
+ default:
+
+ //Generic MPEG1
+
+ tc_snprintf(buf, sizeof(buf), "mpeg2enc -v %d -I %d -q 3 -f 0 -4 2 -2 3 %s -F %d %s -o \"%s\" %s %s", verb, fields, bitrate, frc, buf2, vob->video_out_file, p2, p4);
+ break;
+ }
+
+ tc_log_info(MOD_NAME, "%s", buf);
+
+ sa_ip = popen(buf, "w");
+ if (!sa_ip) return(TC_EXPORT_ERROR);
+
+ if( y4m_write_stream_header2( sa_ip, &y4mstream ) != Y4M_OK ){
+ tc_log_perror(MOD_NAME, "write stream header");
+ return(TC_EXPORT_ERROR);
+ }
+
+ // tc_snprintf(buf, sizeof(buf), MENC_HDR, sa_width, sa_height);
+ //fwrite(buf, strlen(buf), 1, sa_ip);
+
+ return(0);
+ }
+
+ if(param->flag == TC_AUDIO) return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+
+ if(param->flag == TC_VIDEO)
+ {
+ int prof = 0;
+
+ sa_width = vob->ex_v_width;
+ sa_height = vob->ex_v_height;
+ sa_size_l = sa_width * sa_height;
+ sa_size_c = sa_size_l/4;
+
+ if (vob->im_v_codec == CODEC_YUV) {
+ srcfmt = IMG_YUV_DEFAULT;
+ } else if (vob->im_v_codec == CODEC_YUV422) {
+ srcfmt = IMG_YUV422P;
+ } else if (vob->im_v_codec == CODEC_RGB) {
+ srcfmt = IMG_RGB_DEFAULT;
+ } else {
+ tc_log_warn(MOD_NAME, "unsupported video format %d",
+ vob->im_v_codec);
+ return(TC_EXPORT_ERROR);
+ }
+ if (!(tcvhandle = tcv_init())) {
+ tc_log_warn(MOD_NAME, "image conversion init failed");
+ return(TC_EXPORT_ERROR);
+ }
+
+ if (vob->ex_v_fcc) prof = atoi(vob->ex_v_fcc);
+
+ return(0);
+ }
+
+ if(param->flag == TC_AUDIO) return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * encode and export frame
+ *
+ * ------------------------------------------------------------*/
+
+
+MOD_encode
+{
+ y4m_frame_info_t info;
+
+ if(param->flag == TC_VIDEO)
+ {
+ vob_t *vob = tc_get_vob();
+
+ if (!tcv_convert(tcvhandle, param->buffer, param->buffer,
+ vob->ex_v_width, vob->ex_v_height,
+ srcfmt, IMG_YUV420P)) {
+ tc_log_warn(MOD_NAME, "image format conversion failed");
+ return(TC_EXPORT_ERROR);
+ }
+
+ y4m_init_frame_info(&info);
+
+ if( y4m_write_frame_header2( sa_ip, &info ) != Y4M_OK ){
+ tc_log_perror(MOD_NAME, "write stream header");
+ return(TC_EXPORT_ERROR);
+ }
+
+ fwrite(param->buffer, sa_size_l, 1, sa_ip);
+ fwrite(param->buffer + sa_size_l, sa_size_c, 1, sa_ip);
+ fwrite(param->buffer + sa_size_l + sa_size_c, sa_size_c, 1, sa_ip);
+
+ return (0);
+ }
+
+ if(param->flag == TC_AUDIO) return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * stop encoder
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+ if(param->flag == TC_VIDEO) {
+ return (0);
+ }
+
+ if(param->flag == TC_AUDIO) return (0);
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * close codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+
+ if(param->flag == TC_AUDIO) return (0);
+
+ if(param->flag == TC_VIDEO)
+ {
+ if (sa_ip) pclose(sa_ip);
+ sa_ip = NULL;
+
+ tcv_free(tcvhandle);
+ tcvhandle = 0;
+
+ return(0);
+ }
+
+ return(TC_EXPORT_ERROR);
+}
+
diff --git a/debian/transcode/transcode-1.1.7/export/export_null.c b/debian/transcode/transcode-1.1.7/export/export_null.c
new file mode 100644
index 00000000..cdf5d34d
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_null.c
@@ -0,0 +1,97 @@
+/*
+ * export_null.c
+ *
+ * Copyright (C) Thomas Oestreich - June 2001
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#define MOD_NAME "export_null.so"
+#define MOD_VERSION "v0.1.2 (2001-08-17)"
+#define MOD_CODEC "(video) null | (audio) null"
+
+#include "transcode.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+static int verbose_flag=TC_QUIET;
+static int capability_flag=-1; //all codecs welcome
+
+#define MOD_PRE null
+#include "export_def.h"
+
+/* ------------------------------------------------------------
+ *
+ * open codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+ return(0);
+}
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+ return(0);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * encode and export
+ *
+ * ------------------------------------------------------------*/
+
+MOD_encode
+{
+ return(0);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * stop codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+ return(0);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * close codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+ return(0);
+}
+
+
diff --git a/debian/transcode/transcode-1.1.7/export/export_ogg.c b/debian/transcode/transcode-1.1.7/export/export_ogg.c
new file mode 100644
index 00000000..52d0a9b0
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_ogg.c
@@ -0,0 +1,230 @@
+/*
+ * export_ogg.c
+ *
+ * Copyright (C) Tilmann Bitterberg, July 2002
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#define MOD_NAME "export_ogg.so"
+#define MOD_VERSION "v0.0.5 (2003-08-31)"
+#define MOD_CODEC "(video) null | (audio) ogg"
+
+#include "transcode.h"
+
+#include <stdio.h>
+#include <unistd.h>
+
+static int verbose_flag=TC_QUIET;
+static int capability_flag=TC_CAP_PCM;
+
+#define MOD_PRE ogg
+#include "export_def.h"
+static FILE *pFile = NULL;
+
+static inline int p_write (char *buf, size_t len)
+{
+ size_t n = 0;
+ size_t r = 0;
+ int fd = fileno (pFile);
+
+ while (r < len)
+ {
+ if ((n = write (fd, buf + r, len - r)) < 0)
+ return n;
+
+ r += n;
+ }
+
+ return r;
+}
+
+/* ------------------------------------------------------------
+ *
+ * open codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+ int result;
+ int ifreq,ofreq;
+
+ /* check for oggenc */
+ if (tc_test_program("oggenc") != 0) return (TC_EXPORT_ERROR);
+
+ ofreq = vob->mp3frequency;
+ ifreq = vob->a_rate;
+
+ /* default out freq */
+ if(ofreq==0)
+ ofreq = ifreq;
+
+ if (param->flag == TC_AUDIO) {
+ char buf [PATH_MAX];
+ char resample [PATH_MAX];
+
+ if (ofreq != ifreq) {
+ result = tc_snprintf(resample, PATH_MAX, "--resample %d -R %d", vob->mp3frequency, vob->a_rate);
+ } else {
+ result = tc_snprintf(resample, PATH_MAX, "-R %d", vob->a_rate);
+ }
+ if (result < 0) {
+ tc_log_perror(MOD_NAME, "command buffer overflow");
+ return(TC_EXPORT_ERROR);
+ }
+
+ if (!strcmp(vob->video_out_file, vob->audio_out_file)) {
+ tc_log_info(MOD_NAME, "Writing audio to \"/dev/null\" (no -m option)");
+ }
+ if (vob->mp3bitrate == 0)
+ result = tc_snprintf (buf, PATH_MAX, "oggenc -r -B %d -C %d -q %.2f %s -Q -o \"%s\" %s -",
+ vob->dm_bits,
+ vob->dm_chan,
+ vob->mp3quality,
+ resample,
+ vob->audio_out_file?vob->audio_out_file:"/dev/null",
+ (vob->ex_a_string?vob->ex_a_string:""));
+ else
+ result = tc_snprintf (buf, PATH_MAX, "oggenc -r -B %d -C %d -b %d %s -Q -o \"%s\" %s -",
+ vob->dm_bits,
+ vob->dm_chan,
+ vob->mp3bitrate,
+ resample,
+ vob->audio_out_file?vob->audio_out_file:"/dev/null",
+ (vob->ex_a_string?vob->ex_a_string:""));
+ if (result < 0) {
+ tc_log_perror(MOD_NAME, "command buffer overflow");
+ return(TC_EXPORT_ERROR);
+ }
+ if ((pFile = popen (buf, "w")) == NULL)
+ return(TC_EXPORT_ERROR);
+
+ if (verbose > 0)
+ tc_log_info (MOD_NAME, "%s", buf);
+
+ return(0);
+
+ }
+ if (param->flag == TC_VIDEO)
+ return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+ if(param->flag == TC_AUDIO)
+ {
+ return(0);
+ }
+
+ if (param->flag == TC_VIDEO)
+ return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * encode and export
+ *
+ * ------------------------------------------------------------*/
+
+MOD_encode
+{
+ if(param->flag == TC_AUDIO)
+ {
+ if (p_write (param->buffer, param->size) != param->size)
+ {
+ tc_log_perror(MOD_NAME, "write audio frame");
+ return(TC_EXPORT_ERROR);
+ }
+ return (0);
+ }
+
+ if (param->flag == TC_VIDEO)
+ return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * stop codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+ if (param->flag == TC_VIDEO)
+ return (0);
+
+ if (param->flag == TC_AUDIO)
+ return (0);
+
+ return(TC_EXPORT_ERROR);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * close codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+ vob_t *vob = tc_get_vob();
+
+ if (param->flag == TC_VIDEO)
+ return (0);
+
+ if (param->flag == TC_AUDIO)
+ {
+ if (pFile)
+ pclose (pFile);
+
+ pFile = NULL;
+
+ if (verbose > 0 && strcmp (vob->audio_out_file, "/dev/null") &&
+ strcmp (vob->video_out_file, "/dev/null")!=0) {
+ tc_log_info (MOD_NAME, "Hint: Now merge the files with");
+ tc_log_info (MOD_NAME, "Hint: ogmmerge -o complete.ogg %s %s",
+ vob->video_out_file, vob->audio_out_file );
+ }
+
+ return(0);
+ }
+
+ return (TC_EXPORT_ERROR);
+}
+
+/* vim: sw=4
+ */
diff --git a/debian/transcode/transcode-1.1.7/export/export_pcm.c b/debian/transcode/transcode-1.1.7/export/export_pcm.c
new file mode 100644
index 00000000..2ed96fd1
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_pcm.c
@@ -0,0 +1,293 @@
+/*
+ * export_pcm.c
+ *
+ * Copyright (C) Thomas Oestreich - May 2001
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#include "transcode.h"
+#include "avilib/avilib.h"
+#include "libtc/libtc.h"
+
+#define MOD_NAME "export_pcm.so"
+#define MOD_VERSION "v0.1.0 (2007-08-25)"
+#define MOD_CODEC "(audio) PCM (non-interleaved)"
+
+
+static int verbose_flag=TC_QUIET;
+static int capability_flag=TC_CAP_PCM|TC_CAP_RGB|TC_CAP_YUV|TC_CAP_VID;
+
+#define MOD_PRE tc_pcm
+#include "export_def.h"
+
+static struct wave_header rtf;
+static int fd_r = -1, fd_l = -1, fd_c = -1;
+static int fd_ls = -1, fd_rs = -1, fd_lfe = -1;
+
+typedef enum {
+ CHANNEL_CENTER = 1,
+ CHANNEL_STEREO = 2,
+ CHANNEL_FRONT = 4,
+ CHANNEL_LFE = 8
+} PCMChannels;
+
+static PCMChannels chan_settings[8] = {
+ 0, /* 0: nothing */
+ CHANNEL_CENTER, /* 1: mono */
+ CHANNEL_STEREO, /* 2: stereo */
+ CHANNEL_STEREO|CHANNEL_CENTER, /* 3: 2.1 */
+ CHANNEL_STEREO|CHANNEL_FRONT, /* 4: 2+2 */
+ CHANNEL_STEREO|CHANNEL_FRONT|CHANNEL_CENTER, /* 5: 2+2+1 */
+ CHANNEL_STEREO|CHANNEL_FRONT|CHANNEL_CENTER|CHANNEL_LFE, /* 6: 5.1 */
+ 0, /* nothing */
+};
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+ int rate;
+
+ if (param->flag == TC_VIDEO) {
+ return TC_EXPORT_OK;
+ }
+ if (param->flag == TC_AUDIO) {
+ memset(&rtf, 0, sizeof(rtf));
+
+ strlcpy(rtf.riff.id, "RIFF", 4);
+ strlcpy(rtf.riff.wave_id, "WAVE", 4);
+ strlcpy(rtf.format.id, "fmt ", 4);
+
+ rtf.format.len = sizeof(struct common_struct);
+ rtf.common.wFormatTag = CODEC_PCM;
+
+ rate = (vob->mp3frequency != 0) ?vob->mp3frequency :vob->a_rate;
+
+ rtf.common.dwSamplesPerSec = rate;
+ rtf.common.dwAvgBytesPerSec = vob->dm_chan * rate * vob->dm_bits/8;
+ rtf.common.wBitsPerSample = vob->dm_bits;
+ rtf.common.wBlockAlign = vob->dm_chan*vob->dm_bits/8;
+
+ if(vob->dm_chan >= 1 && vob->dm_chan <= 6) { /* sanity check */
+ rtf.common.wChannels=vob->dm_chan;
+ } else {
+ tc_log_error(MOD_NAME, "bad PCM channel number: %i",
+ vob->dm_chan);
+ return TC_EXPORT_ERROR;
+ }
+ if (!vob->a_codec_flag
+ || !rtf.common.dwSamplesPerSec
+ || !rtf.common.wBitsPerSample
+ || !rtf.common.wBlockAlign) {
+ tc_log_error(MOD_NAME, "cannot export PCM, invalid format "
+ "(no audio track at all?)");
+ return TC_EXPORT_ERROR;
+ }
+
+ rtf.riff.len = 0x7FFFFFFF;
+ rtf.data.len = 0x7FFFFFFF;
+
+ strlcpy(rtf.data.id, "data",4);
+
+ return TC_EXPORT_OK;
+ }
+ // invalid flag
+ return TC_EXPORT_ERROR;
+}
+
+/* ------------------------------------------------------------
+ *
+ * open outputfile
+ *
+ * ------------------------------------------------------------*/
+
+/* XXX */
+#define FD_OPEN(fd) do { \
+ fd = open(fname, O_RDWR|O_CREAT|O_TRUNC, \
+ S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); \
+ if (fd < 0) { \
+ tc_log_error(MOD_NAME, "opening file: %s", strerror(errno)); \
+ return TC_EXPORT_ERROR; \
+ } \
+} while (0)
+
+MOD_open
+{
+ char fname[TC_BUF_LINE];
+ int chan_flags = chan_settings[rtf.common.wChannels];
+
+ if (param->flag == TC_AUDIO) {
+ if (chan_flags & CHANNEL_LFE) {
+ tc_snprintf(fname, sizeof(fname), "%s_lfe.pcm",
+ vob->audio_out_file);
+ FD_OPEN(fd_lfe);
+ }
+
+ if (chan_flags & CHANNEL_FRONT) {
+ tc_snprintf(fname, sizeof(fname), "%s_ls.pcm",
+ vob->audio_out_file);
+ FD_OPEN(fd_ls);
+
+ tc_snprintf(fname, sizeof(fname), "%s_rs.pcm",
+ vob->audio_out_file);
+ FD_OPEN(fd_rs);
+ }
+
+ if (chan_flags & CHANNEL_STEREO) {
+ tc_snprintf(fname, sizeof(fname), "%s_l.pcm",
+ vob->audio_out_file);
+ FD_OPEN(fd_l);
+
+ tc_snprintf(fname, sizeof(fname), "%s_r.pcm",
+ vob->audio_out_file);
+ FD_OPEN(fd_r);
+ }
+
+ if (chan_flags & CHANNEL_CENTER) {
+ tc_snprintf(fname, sizeof(fname), "%s_c.pcm",
+ vob->audio_out_file);
+ FD_OPEN(fd_c);
+ }
+
+ return TC_EXPORT_OK;
+ }
+
+ if (param->flag == TC_VIDEO) {
+ return TC_EXPORT_OK;
+ }
+
+ // invalid flag
+ return TC_EXPORT_ERROR;
+}
+
+/* ------------------------------------------------------------
+ *
+ * encode and export
+ *
+ * ------------------------------------------------------------*/
+
+#define FD_WRITE(fd, buf, size) do { \
+ if(fd != -1 && tc_pwrite(fd, buf, size) != size) { \
+ tc_log_error(MOD_NAME, "writing audio frame: %s", \
+ strerror(errno)); \
+ return TC_EXPORT_ERROR; \
+ } \
+} while (0)
+
+MOD_encode
+{
+ if (param->flag == TC_VIDEO) {
+ return TC_EXPORT_OK;
+ }
+ if (param->flag == TC_AUDIO) {
+ int size = (int)(param->size/rtf.common.wChannels);
+
+ switch (rtf.common.wChannels) {
+ case 6:
+ FD_WRITE(fd_rs, param->buffer + 5 * size, size);
+ FD_WRITE(fd_ls, param->buffer + 4 * size, size);
+ FD_WRITE(fd_r, param->buffer + 3 * size, size);
+ FD_WRITE(fd_c, param->buffer + 2 * size, size);
+ FD_WRITE(fd_l, param->buffer + size, size);
+ FD_WRITE(fd_lfe, param->buffer, size);
+ break;
+
+ case 2:
+ FD_WRITE(fd_r, param->buffer + size, size);
+ FD_WRITE(fd_l, param->buffer, size);
+ break;
+
+ case 1:
+ FD_WRITE(fd_c, param->buffer, size);
+ break;
+ }
+
+ return TC_EXPORT_OK;
+ }
+
+ // invalid flag
+ return TC_EXPORT_ERROR;
+}
+
+/* ------------------------------------------------------------
+ *
+ * close outputfiles
+ *
+ * ------------------------------------------------------------*/
+
+#define FD_CLOSE(fd) do { \
+ if (fd != -1) { \
+ close(fd);\
+ } \
+} while (0)
+
+MOD_close
+{
+ if (param->flag == TC_VIDEO) {
+ return TC_EXPORT_OK;
+ }
+ if (param->flag == TC_AUDIO) {
+ FD_CLOSE(fd_l);
+ FD_CLOSE(fd_c);
+ FD_CLOSE(fd_r);
+ FD_CLOSE(fd_ls);
+ FD_CLOSE(fd_rs);
+ FD_CLOSE(fd_lfe);
+ return TC_EXPORT_OK;
+ }
+ return TC_EXPORT_ERROR;
+}
+
+/* ------------------------------------------------------------
+ *
+ * stop encoder
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+ if (param->flag == TC_VIDEO) {
+ return TC_EXPORT_OK;
+ }
+ if (param->flag == TC_AUDIO) {
+ return TC_EXPORT_OK;
+ }
+ return TC_EXPORT_ERROR;
+}
+
+/*************************************************************************/
+
+/*
+ * Local variables:
+ * c-file-style: "stroustrup"
+ * c-file-offsets: ((case-label . *) (statement-case-intro . *))
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * vim: expandtab shiftwidth=4:
+ */
diff --git a/debian/transcode/transcode-1.1.7/export/export_ppm.c b/debian/transcode/transcode-1.1.7/export/export_ppm.c
new file mode 100644
index 00000000..d81a1ca3
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_ppm.c
@@ -0,0 +1,278 @@
+/*
+ * export_ppm.c
+ *
+ * Copyright (C) Thomas Oestreich - June 2001
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#define MOD_NAME "export_ppm.so"
+#define MOD_VERSION "v0.1.1 (2002-02-14)"
+#define MOD_CODEC "(video) PPM/PGM | (audio) MPEG/AC3/PCM"
+
+#include "transcode.h"
+#include "avilib/avilib.h"
+#include "aud_aux.h"
+#include "libtcvideo/tcvideo.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+static int verbose_flag=TC_QUIET;
+static int capability_flag=TC_CAP_YUV|TC_CAP_RGB|TC_CAP_PCM|TC_CAP_AC3|TC_CAP_AUD|TC_CAP_YUV422;
+
+#define MOD_PRE ppm
+#include "export_def.h"
+
+static char buf[256];
+static char buf2[64];
+
+static uint8_t *tmp_buffer; //[SIZE_RGB_FRAME];
+
+static int codec, width, height, row_bytes;
+
+static int counter=0;
+static const char *prefix="frame";
+static const char *type;
+static int interval=1;
+static unsigned int int_counter=0;
+
+static TCVHandle tcvhandle;
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+ /* set the 'spit-out-frame' interval */
+ interval = vob->frame_interval;
+
+ if(param->flag == TC_VIDEO) {
+
+ /* this supports output of 4:2:0 YUV material, ie CODEC_YUV */
+ if(vob->im_v_codec == CODEC_YUV) {
+ width = vob->ex_v_width;
+ height = vob->ex_v_height;
+
+ row_bytes = BPP/8 * vob->ex_v_width;
+
+ codec = CODEC_YUV;
+
+ if (!tmp_buffer)
+ tmp_buffer = malloc (vob->ex_v_width*vob->ex_v_height*3);
+ if (!tmp_buffer)
+ return -1;
+
+ tcvhandle = tcv_init();
+ if (!tcvhandle) {
+ tc_log_error(MOD_NAME, "tcv_init() failed");
+ return -1;
+ }
+ }
+
+ /* this supports output of 4:2:2 YUV material, ie CODEC_YUV422 */
+ if(vob->im_v_codec == CODEC_YUV422) {
+ /* size of the exported image */
+ width = vob->ex_v_width;
+ height = vob->ex_v_height;
+
+ /* bytes per scan line (aka row) */
+ row_bytes = BPP/8 * vob->ex_v_width;
+
+ codec = CODEC_YUV422;
+
+ /* this is for the output, one byte each for R, G and B per pixel */
+ if (!tmp_buffer)
+ tmp_buffer = malloc (vob->ex_v_width*vob->ex_v_height*3);
+ if (!tmp_buffer)
+ return -1;
+
+ tcvhandle = tcv_init();
+ if (!tcvhandle) {
+ tc_log_error(MOD_NAME, "tcv_init() failed");
+ return -1;
+ }
+ }
+
+ /* source stream encoding format not supported */
+ return(0);
+
+ }
+
+ /* audio is not supported in PPM image format... */
+ if(param->flag == TC_AUDIO) return(tc_audio_init(vob, verbose_flag));
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * open outputfile
+ *
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+
+ if(param->flag == TC_VIDEO) {
+
+ // video
+
+ switch(vob->im_v_codec) {
+
+ case CODEC_YUV:
+ case CODEC_YUV422:
+ case CODEC_RGB:
+
+ if(vob->video_out_file!=NULL && strcmp(vob->video_out_file,"/dev/null")!=0) prefix=vob->video_out_file;
+
+ type = (vob->decolor) ? "P5":"P6";
+
+ tc_snprintf(buf, sizeof(buf), "%s\n#(%s-v%s) \n%d %d 255\n", type, PACKAGE, VERSION, vob->ex_v_width, vob->ex_v_height);
+
+ break;
+
+ default:
+
+ tc_log_warn(MOD_NAME, "codec not supported");
+ return(TC_EXPORT_ERROR);
+
+ break;
+ }
+
+ return(TC_EXPORT_OK);
+ }
+
+
+ if(param->flag == TC_AUDIO) {
+ tc_log_warn(MOD_NAME, "Usage of this module for audio encoding is deprecated.");
+ tc_log_warn(MOD_NAME, "Consider switch to export_tcaud module.");
+ return(tc_audio_open(vob, NULL));
+ }
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * encode and export
+ *
+ * ------------------------------------------------------------*/
+
+MOD_encode
+{
+
+ FILE *fd;
+ char *out_buffer = param->buffer;
+ int n, out_size = param->size;
+
+ if ((++int_counter-1) % interval != 0)
+ return (0);
+
+ if(param->flag == TC_VIDEO) {
+
+
+ if(codec==CODEC_YUV) {
+ tcv_convert(tcvhandle, param->buffer, tmp_buffer, width, height,
+ IMG_YUV_DEFAULT, IMG_RGB24);
+ out_buffer = tmp_buffer;
+ out_size = height * 3 *width;
+ }
+
+ if(codec==CODEC_YUV422) {
+ tcv_convert(tcvhandle, param->buffer, tmp_buffer, width, height,
+ IMG_YUV422P, IMG_RGB24);
+ out_buffer = tmp_buffer;
+ out_size = height * 3 *width;
+ }
+
+ if(strncmp(type, "P5", 2)==0) {
+ out_size /= 3;
+ //tcv_convert(tcvhandle, tmp_buffer, tmp_buffer, width, height,
+ // IMG_RGB24, IMG_GRAY8);
+ for (n=0; n<out_size; ++n) out_buffer[n] = out_buffer[3*n];
+ tc_snprintf(buf2, sizeof(buf2), "%s%06d.pgm", prefix, counter++);
+ } else
+ tc_snprintf(buf2, sizeof(buf2), "%s%06d.ppm", prefix, counter++);
+
+ if((fd = fopen(buf2, "w"))==NULL) {
+ tc_log_perror(MOD_NAME, "fopen file");
+ return(TC_EXPORT_ERROR);
+ }
+
+ if(fwrite(buf, strlen(buf), 1, fd) != 1) {
+ tc_log_perror(MOD_NAME, "write header");
+ return(TC_EXPORT_ERROR);
+ }
+
+ if(fwrite(out_buffer, out_size, 1, fd) != 1) {
+ tc_log_perror(MOD_NAME, "write frame");
+ return(TC_EXPORT_ERROR);
+ }
+ fclose(fd);
+ return(0);
+ }
+
+ if(param->flag == TC_AUDIO) return(tc_audio_encode(param->buffer, param->size, NULL));
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * stop encoder
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+
+ if(param->flag == TC_VIDEO) return(0);
+ if(param->flag == TC_AUDIO) return(tc_audio_stop());
+
+ free(tmp_buffer);
+ tmp_buffer = NULL;
+ tcv_free(tcvhandle);
+ tcvhandle = 0;
+
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * close outputfiles
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+
+ if(param->flag == TC_AUDIO) return(tc_audio_close());
+ if(param->flag == TC_VIDEO) return(0);
+
+ return(TC_EXPORT_ERROR);
+
+}
+
diff --git a/debian/transcode/transcode-1.1.7/export/export_pvm.c b/debian/transcode/transcode-1.1.7/export/export_pvm.c
new file mode 100644
index 00000000..da8fa713
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_pvm.c
@@ -0,0 +1,1076 @@
+/*
+ * export_pvm.c
+ *
+ * Copyright (C) Malanchini Marzio - June 2003
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include "transcode.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "pvm_version.h"
+#include "pvm_interface.h"
+#include "pvm_parser.h"
+#include "external_codec.h"
+#include "vob_pack_unpack.h"
+
+#define MOD_NAME "export_pvm.so"
+#define MOD_VERSION EXPORT_PVM_VERSION
+#define MOD_CODEC "(video) * | (audio) *"
+
+#define MAX_BUF 1024
+
+#define MIN_TOT_NPROC 1
+#define MIN_FRAME 10
+
+static int verbose_flag=TC_QUIET;
+static int capability_flag=-1; //all codecs are welcome
+
+#define MOD_PRE pvm
+#include "export_def.h"
+
+static int s_merger_tid_audio[]={-1,-1},s_merger_tid_video[]={-1,-1},s_init_check=0;
+static int s_merger_tid_system[]={-1,-1};
+static int s_null_video_module=0,s_null_audio_module=0,s_sys_merger_started=-1;
+static void *p_handle=NULL;
+static pvm_func_t s_pvm_single_proc_audio,s_pvm_single_proc_video,s_pvm_fun_audio,s_pvm_fun_video,s_pvm_single_proc_system;
+static pvm_config_env s_pvm_conf,*p_pvm_conf=NULL;
+
+static char *p_par1=NULL,*p_par2=NULL;
+
+
+extern pthread_mutex_t s_channel_lock;
+
+static void adjust_ch(char *line, char ch)
+{
+ char *src = &line[strlen(line)];
+ char *dst = line;
+
+ //-- remove blanks from right and left side --
+ do { src--; } while ( (src != line) && (*src == ch) );
+ *(src+1) = '\0';
+ src = line;
+ while (*src == ch) src++;
+
+ if (src == line) return;
+
+ //-- copy rest --
+ while (*src)
+ {
+ *dst = *src;
+ src++;
+ dst++;
+ }
+ *dst = '\0';
+}
+
+static void f_pvm_balancer(char *p_option,pvm_func_t *p_func,int s_seq,int s_type)
+{
+ int s_cont,s_dummy,s_dummy1,s_rc;
+
+ if (!strcasecmp(p_option, "open"))
+ {
+ for(s_cont=0;s_cont<p_func->s_nproc;s_cont++)
+ p_func->p_used_tid[s_cont]=INT_MAX; /*setup to INT_MAX*/
+ p_func->s_current_tid=0; /*First tid*/
+ }
+ else if (!strcasecmp(p_option, "close"))
+ {
+ for(s_cont=0;s_cont<p_func->s_nproc;s_cont++)
+ p_func->p_used_tid[s_cont]=INT_MAX; /*setup to INT_MAX*/
+ }
+ else if (!strcasecmp(p_option, "set-seq"))
+ {
+ p_func->p_used_tid[p_func->s_current_tid]=s_seq;
+ }
+ else if (!strcasecmp(p_option, "first-free"))
+ {
+ for(s_cont=(((1+p_func->s_current_tid)==p_func->s_nproc)?0:(1+p_func->s_current_tid));((p_func->p_used_tid[s_cont]!=INT_MAX)&&(s_cont<p_func->s_current_tid));s_cont=((((1+s_cont)==p_func->s_nproc)?0:(1+s_cont)))); /*det the first task free*/
+// for(s_cont=0;((p_func->p_used_tid[s_cont]!=INT_MAX)&&(s_cont<p_func->s_nproc));s_cont++); /*det the first task free*/
+ if ((s_cont<p_func->s_nproc)&&(p_func->p_used_tid[s_cont]==INT_MAX)) /*it's already assigned to a running task?*/
+ {
+ p_func->s_current_tid=s_cont; /*setting up the new task*/
+ if (verbose_flag & TC_DEBUG)
+ {
+ if (s_type== TC_VIDEO)
+ tc_log_info(MOD_NAME, "The new task for video is %d",s_cont);
+ else
+ tc_log_info(MOD_NAME, "The new task for audio is %d",s_cont);
+ }
+ }
+ else /*stop and wait for the first free task*/
+ {
+ if (verbose_flag & TC_DEBUG)
+ {
+ if (s_type== TC_VIDEO)
+ tc_log_info(MOD_NAME, "Waiting for a video free task...");
+ else
+ tc_log_info(MOD_NAME, "Waiting for an audio free task...");
+ }
+ s_cont=s_seq;
+ if (s_type== TC_VIDEO)
+ (int)f_pvm_set_recv(PVM_MSG_ENDTASK_VIDEO); /*set up to receive the PVM_MSG_ENDTASK_VIDEO*/
+ else
+ (int)f_pvm_set_recv(PVM_MSG_ENDTASK_AUDIO); /*set up to receive the PVM_MSG_ENDTASK_AUDIO*/
+ s_seq=f_pvm_recv(&s_dummy,(char *)&s_dummy1,&s_rc); /*Waiting for a free task */
+ (int)f_pvm_set_recv(s_cont); /*set up to receive the prev seq*/
+ for(s_cont=0;p_func->p_used_tid[s_cont]!=s_seq;s_cont++); /*det the task free*/
+ p_func->s_current_tid=s_cont; /*setting up the new task*/
+ if (verbose_flag & TC_DEBUG)
+ {
+ if (s_type== TC_VIDEO)
+ tc_log_info(MOD_NAME, "The new video task free is %d",s_cont);
+ else
+ tc_log_info(MOD_NAME, "The new audio task free is %d",s_cont);
+ }
+ }
+ }
+}
+
+static void f_help(void)
+{
+ tc_log_info(MOD_NAME, "%s",MOD_VERSION);
+ tc_log_info(MOD_NAME, " -F configfile,[[nproc]:[maxproc]:[nfrxtask]]");
+ tc_log_info(MOD_NAME, " nproc,maxproc,nfrxtask override the parameter present in the config file");
+ tc_log_info(MOD_NAME, " List of known and supported codecs:");
+ f_help_codec(MOD_NAME);
+}
+
+#define PVM_DEINIT do { \
+ if (s_init_check == 1) { \
+ void *ret = f_init_pvm_func("close", p_handle); \
+ s_init_check = (ret != NULL) ?1 :0; /* uhm... -- Fromani */ \
+ } else { \
+ s_init_check -= 1; \
+ } \
+} while (0)
+
+#define PVM_CLOSE do { \
+ f_pvm_balancer("close", p_pvm_fun, 0, param->flag); \
+ f_pvm_master_start_stop("close", "tcpvmexportd", NULL, \
+ p_pvm_conf->s_nproc, p_pvm_conf->s_max_proc, p_pvm_fun); \
+ PVM_DEINIT; \
+} while (0)
+
+/* ------------------------------------------------------------
+ *
+ * open codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+ pvm_func_t *p_pvm_fun=NULL;
+ int s_null_module;
+
+ pthread_mutex_lock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ if(param->flag == TC_VIDEO)
+ {
+ s_null_module=s_null_video_module;
+ p_pvm_fun=&s_pvm_fun_video;
+ if (verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME, "enter in MOD_OPEN Video");
+ }
+ else
+ {
+ s_null_module=s_null_audio_module;
+ p_pvm_fun=&s_pvm_fun_audio;
+ if (verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME, "enter in MOD_OPEN Video");
+ }
+ if (!s_null_module)
+ {
+ if((f_pvm_multi_send(0,(char *)0,PVM_EXP_OPT_OPEN,p_pvm_fun))==-1)
+ {
+ PVM_CLOSE;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ }
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ if (verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME, "exit MOD_OPEN Video");
+ return TC_OK;
+}
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+ char *p_file_to_open=NULL;
+ char *p_tmp=NULL;
+ char *p_vob_buffer=NULL;
+ char *p_argv[]={"-s",(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0};
+ char *p_argv_merger[]={"-s","-j",(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0};
+ char *p_argv_merger_sys[]={"-s","-j",(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0,(char*)0};
+ int s_cont = 1, s_contj = 2, s_contsys = 2, s_vob_buffer_size;
+ pvm_config_codec *p_conf_codec;
+ pvm_func_t *p_pvm_fun=NULL;
+ pvm_func_t *p_pvm_single_proc=NULL;
+ int *p_merger_tid,*p_merger_sys_tid=0;
+ int s_null_module=0;
+ pvm_config_merger *p_merger_conf=NULL;
+ char s_version[MAX_BUF];
+ static int s_msys=0;
+
+ pthread_mutex_lock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ if (verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME, "enter in MOD_INIT");
+ if (s_init_check==0)
+ {
+ s_init_check++; //do it only for the first time
+ memset((char *)&s_pvm_conf,'\0',sizeof(pvm_config_env));
+ p_pvm_conf=&s_pvm_conf;
+ if(vob->ex_v_fcc != NULL && strlen(vob->ex_v_fcc) != 0)
+ {
+ p_par1 = tc_strdup(vob->ex_v_fcc); /* ...and memleaks for all! */
+ adjust_ch(p_par1, ' '); /*-- module to recall --*/
+ if(!strcasecmp(p_par1,"list"))
+ {
+ f_help();
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ p_pvm_conf = pvm_parser_open(p_par1, verbose, 0);
+ if (p_pvm_conf == NULL)
+ {
+ tc_log_warn(MOD_NAME, "error checking %s",p_par1);
+ f_help();
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ ac_memcpy((char *)&s_pvm_conf,(char *)p_pvm_conf,sizeof(pvm_config_env));
+ p_pvm_conf=&s_pvm_conf;
+ }
+ else //need at least the config file
+ {
+ f_help();
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ if(vob->ex_a_fcc != NULL && strlen(vob->ex_a_fcc) != 0)
+ {
+ p_par2 = tc_strdup(vob->ex_a_fcc);
+ adjust_ch(p_par2, ' '); /*-- first parameter of the module --*/
+ if (p_par2[0]==':')
+ {
+ if (p_pvm_conf->s_nproc==0)
+ p_pvm_conf->s_nproc=1; /*default nproc per host*/
+ if (p_par2[1]==':')
+ {
+ if (p_pvm_conf->s_max_proc==0)
+ p_pvm_conf->s_max_proc=10;
+ }
+ else
+ {
+ p_tmp=strtok(p_par2,":");
+ if (p_tmp==NULL)
+ {
+ if (p_pvm_conf->s_max_proc==0)
+ p_pvm_conf->s_max_proc=10;
+ }
+ else
+ {
+ p_pvm_conf->s_max_proc=atoi(p_tmp);
+ p_pvm_conf->s_max_proc=(p_pvm_conf->s_max_proc<MIN_TOT_NPROC)?10:p_pvm_conf->s_max_proc; /*the max is set to 10*/
+ }
+ }
+ p_tmp=strtok(NULL,":");
+ if (p_tmp==NULL)
+ {
+ if (p_pvm_conf->s_num_frame_task==0)
+ p_pvm_conf->s_num_frame_task=100;
+ }
+ else
+ {
+ p_pvm_conf->s_num_frame_task=atoi(p_tmp);
+ p_pvm_conf->s_num_frame_task=(p_pvm_conf->s_num_frame_task<MIN_FRAME)?100:p_pvm_conf->s_num_frame_task; /*the to the default */
+ }
+ }
+ else
+ {
+ p_pvm_conf->s_nproc=atoi(strtok(p_par2,":"));
+ p_pvm_conf->s_nproc=((p_pvm_conf->s_nproc)<1)?1:p_pvm_conf->s_nproc; /*the min is set to 2*/
+ p_tmp=strtok(NULL,":");
+ if (p_tmp==NULL)
+ {
+ if (p_pvm_conf->s_max_proc==0)
+ p_pvm_conf->s_max_proc=10;
+ }
+ else
+ {
+ p_pvm_conf->s_max_proc=atoi(p_tmp);
+ p_pvm_conf->s_max_proc=(p_pvm_conf->s_max_proc<MIN_TOT_NPROC)?10:p_pvm_conf->s_max_proc; /*the max is set to 10*/
+ }
+ p_tmp=strtok(NULL,":");
+ if (p_tmp==NULL)
+ {
+ if (p_pvm_conf->s_num_frame_task==0)
+ p_pvm_conf->s_num_frame_task=100;
+ }
+ else
+ {
+ p_pvm_conf->s_num_frame_task=atoi(p_tmp);
+ p_pvm_conf->s_num_frame_task=(p_pvm_conf->s_num_frame_task<MIN_FRAME)?100:p_pvm_conf->s_num_frame_task;
+ }
+ }
+ }
+ }
+ else
+ {
+ s_init_check++;
+ }
+ if(param->flag == TC_VIDEO)
+ {
+ p_conf_codec=&(p_pvm_conf->s_video_codec);
+ p_file_to_open = tc_strdup(vob->video_out_file);
+ p_merger_conf=&(p_pvm_conf->s_video_merger);
+ }
+ else
+ {
+ p_conf_codec=&(p_pvm_conf->s_audio_codec);
+ if (vob->audio_out_file !=NULL)
+ p_file_to_open = tc_strdup(vob->audio_out_file);
+ else
+ p_file_to_open = tc_strdup(vob->video_out_file);
+ p_merger_conf=&(p_pvm_conf->s_audio_merger);
+ }
+ if (p_pvm_conf->p_multiplex_cmd!=NULL)
+ {
+ p_argv_merger_sys[s_contsys++]="-x";
+ p_argv_merger_sys[s_contsys++]=p_pvm_conf->p_multiplex_cmd;
+ }
+ if (f_supported_export_module(p_conf_codec->p_codec))
+ {
+ p_argv[s_cont++]="-c";
+ p_argv[s_cont++]=p_conf_codec->p_codec; /*store the parameter*/
+ p_argv_merger[s_contj++]="-c";
+ p_argv_merger[s_contj++]=p_conf_codec->p_codec; /*store the parameter*/
+ p_argv_merger_sys[s_contsys++]="-c";
+ if ((p_argv_merger_sys[s_contsys++]=f_supported_system((pvm_config_codec *)&(p_pvm_conf->s_video_codec),(pvm_config_codec *)&(p_pvm_conf->s_audio_codec)))!=NULL)
+ {
+ if (p_pvm_conf->s_system_merger.p_hostname!=NULL)
+ {
+ if (vob->divxmultipass!=1)
+ s_sys_merger_started=0;
+ else /*if multipass == 1 i don't need to start the system merger*/
+ {
+ s_contsys--;
+ p_argv_merger_sys[s_contsys]="unknown"; /*store the parameter*/
+ s_sys_merger_started=-1; /*so the system merger never started*/
+ }
+ }
+ else
+ {
+ s_contsys--;
+ p_argv_merger_sys[s_contsys]="unknown"; /*store the parameter*/
+ s_sys_merger_started=-1; /*so the system merger never started*/
+ }
+ }
+ else
+ {
+ p_argv_merger_sys[s_contsys-1]="unknown"; /*store the parameter*/
+ s_sys_merger_started=-1; /*so the system merger never started*/
+ }
+ if (p_conf_codec->p_par1!=NULL)
+ if (p_conf_codec->p_par1[0]!=' ')
+ {
+ p_argv[s_cont++]="-1";
+ p_argv[s_cont++]=p_conf_codec->p_par1; /*store the parameter*/
+ p_argv_merger[s_contj++]="-1";
+ p_argv_merger[s_contj++]=p_conf_codec->p_par1; /*store the parameter*/
+ p_argv_merger_sys[s_contsys++]="-1";
+ p_argv_merger_sys[s_contsys++]=p_conf_codec->p_par1; /*store the parameter*/
+ }
+ if (p_conf_codec->p_par2!=NULL)
+ if (p_conf_codec->p_par2[0]!=' ')
+ {
+ p_argv[s_cont++]="-2";
+ p_argv[s_cont++]=p_conf_codec->p_par2; /*store the parameter*/
+ }
+ if (p_conf_codec->p_par3!=NULL)
+ if (p_conf_codec->p_par3[0]!=' ')
+ {
+ p_argv[s_cont++]="-3";
+ p_argv[s_cont++]=p_conf_codec->p_par3; /*store the parameter*/
+ }
+ }
+ else if (!strcasecmp(p_conf_codec->p_codec, "null"))
+ {
+ s_null_module=1;
+ if(param->flag == TC_VIDEO)
+ {
+ s_null_video_module=s_null_module;
+ tc_log_info(MOD_NAME, "use internal video null codec");
+ }
+ else
+ {
+ s_null_audio_module=s_null_module;
+ tc_log_info(MOD_NAME, "use internal audio null codec");
+ }
+ }
+ else
+ {
+ tc_log_warn(MOD_NAME, "unsupported %s codec",p_conf_codec->p_codec);
+ f_help(); /*unsupported codec parameter*/
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ if ((!strcasecmp(p_pvm_conf->s_audio_codec.p_codec, "null"))||(!strcasecmp(p_pvm_conf->s_video_codec.p_codec, "null")))
+ {
+ s_sys_merger_started=-1; /*so the system merger never started*/
+ p_pvm_conf->s_system_merger.p_hostname=NULL;
+ }
+ if (!s_null_module) /*skip if null module is requested*/
+ {
+ /*check the default setup*/
+ p_pvm_conf->s_nproc=(p_pvm_conf->s_nproc<1)?1:p_pvm_conf->s_nproc;
+ p_pvm_conf->s_max_proc=(p_pvm_conf->s_max_proc<MIN_TOT_NPROC)?10:p_pvm_conf->s_max_proc;
+ p_pvm_conf->s_num_frame_task=(p_pvm_conf->s_num_frame_task<MIN_FRAME)?100:p_pvm_conf->s_num_frame_task;
+
+ if ((vob->divxmultipass==0)&&(p_pvm_conf->s_internal_multipass))
+ {
+ p_argv[s_cont++]="-M"; /*use internale multipass only if -R option isn't set*/
+ }
+ else
+ {
+ p_argv_merger[s_contj++]="-p";
+ switch(vob->divxmultipass)
+ {
+ case 3:
+ p_argv_merger[s_contj++]="3";
+ break;
+ case 2:
+ p_argv_merger[s_contj++]="2";
+ break;
+ case 1:
+ p_argv_merger[s_contj++]="1";
+ break;
+ case 0:
+ default:
+ p_argv_merger[s_contj++]="0";
+ break;
+ }
+ }
+ p_argv[s_cont++]="-d";
+ p_argv_merger[s_contj++]="-d";
+ p_argv_merger_sys[s_contsys++]="-d";
+ if (verbose == 0)
+ {
+ p_argv[s_cont++]="0";
+ p_argv_merger[s_contj++]="0";
+ p_argv_merger_sys[s_contsys++]="0";
+ }
+ else if (verbose==1)
+ {
+ p_argv[s_cont++]="1";
+ p_argv_merger[s_contj++]="1";
+ p_argv_merger_sys[s_contsys++]="1";
+ }
+ else
+ {
+ p_argv[s_cont++]="2";
+ p_argv_merger[s_contj++]="2";
+ p_argv_merger_sys[s_contsys++]="2";
+ }
+ if (p_file_to_open !=NULL)
+ {
+ p_argv[s_cont++]="-f";
+ p_argv[s_cont++]=p_file_to_open; /*video/audio out file name*/
+ p_argv_merger[s_contj++]="-f";
+ p_argv_merger[s_contj++]=p_file_to_open; /*video/audio out file name*/
+ p_argv_merger_sys[s_contsys++]="-f";
+ p_argv_merger_sys[s_contsys++]=p_file_to_open;
+ }
+ p_argv_merger_sys[s_contsys++]="-L"; /*need to create system list every time*/
+ if (p_merger_conf->s_build_only_list)
+ p_argv_merger[s_contj++]="-L";
+ if ((verbose_flag & TC_INFO)||(verbose_flag & TC_DEBUG))
+ tc_log_info(MOD_NAME, "P1=%s, P2=%s (%d %d %d)",
+ p_par1,p_par2,p_pvm_conf->s_nproc,
+ p_pvm_conf->s_max_proc,
+ p_pvm_conf->s_num_frame_task);
+ if (p_handle==NULL)
+ {
+ if((p_handle=f_init_pvm_func("open",NULL))==NULL)
+ {
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ }
+ p_argv[s_cont++]="-t";
+ p_argv_merger[s_contj++]="-t";
+ p_argv_merger_sys[s_contsys++]="-t";
+ if (p_pvm_conf->s_system_merger.s_build_only_list==2)
+ p_argv_merger_sys[s_contsys++]="multisystem";
+ else
+ p_argv_merger_sys[s_contsys++]="system";
+ if (s_sys_merger_started==0)
+ {
+ memset((char *)&s_pvm_single_proc_system,'\0',sizeof(pvm_func_t));
+ s_pvm_single_proc_system.p_slave_tids=&s_merger_tid_system[0]; /*data for the merger process*/
+ s_pvm_single_proc_system.s_nproc=1;
+ s_pvm_single_proc_system.s_current_tid=0; /*data for the merger process*/
+ p_merger_sys_tid=(int *)&s_merger_tid_system[0];
+ }
+ if(param->flag == TC_VIDEO)
+ {
+ p_argv[s_cont++]="video"; /*video parameter*/
+ p_argv_merger[s_contj++]="video"; /*video parameter*/
+ memset((char *)&s_pvm_fun_video,'\0',sizeof(pvm_func_t));
+ p_pvm_fun=&s_pvm_fun_video;
+ p_merger_tid=&s_merger_tid_video[0];
+ memset((char *)&s_pvm_single_proc_video,'\0',sizeof(pvm_func_t));
+ p_pvm_single_proc=&s_pvm_single_proc_video;
+ p_pvm_single_proc->p_slave_tids=&s_merger_tid_video[0]; /*data for the merger process*/
+ }
+ else
+ {
+ p_argv[s_cont++]="audio"; /*audio parameter*/
+ p_argv_merger[s_contj++]="audio";/*audio parameter*/
+ memset((char *)&s_pvm_fun_audio,'\0',sizeof(pvm_func_t));
+ p_pvm_fun=&s_pvm_fun_audio;
+ p_merger_tid=&s_merger_tid_audio[0];
+ memset((char *)&s_pvm_single_proc_audio,'\0',sizeof(pvm_func_t));
+ p_pvm_single_proc=&s_pvm_single_proc_audio;
+ p_pvm_single_proc->p_slave_tids=&s_merger_tid_audio[0]; /*data for the merger process*/
+ }
+ p_pvm_single_proc->s_nproc=1; /*data for the merger process*/
+ p_pvm_single_proc->s_current_tid=0; /*data for the merger process*/
+ if (f_pvm_master_start_stop("open","tcpvmexportd",p_argv,p_pvm_conf->s_nproc,p_pvm_conf->s_max_proc,p_pvm_fun)==NULL)
+ {
+ PVM_DEINIT;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ memset((char *)&s_version,'\0',MAX_BUF);
+ tc_snprintf((char *)&s_version,MAX_BUF,"%s",EXPORT_PVM_VERSION);
+ if((f_pvm_multi_send(strlen(&s_version[0]),(char *)&s_version[0],PVM_CHECK_VERSION,p_pvm_fun))==-1)
+ {
+ (pvm_func_t*)f_pvm_master_start_stop("close","tcpvmexportd",(char **)0,p_pvm_conf->s_nproc,p_pvm_conf->s_max_proc,p_pvm_fun);
+ PVM_DEINIT;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ if (p_pvm_conf->s_system_merger.p_hostname!=NULL)
+ {
+ if ((s_sys_merger_started==0)&&(s_msys==0))
+ {
+ s_sys_merger_started=1; /*execute only 1 time*/
+ s_msys=1;
+ if ((*p_merger_sys_tid=f_pvm_start_single_process("tcpvmexportd",p_argv_merger_sys,p_pvm_conf->s_system_merger.p_hostname)) ==-1)
+ {
+ (pvm_func_t*)f_pvm_master_start_stop("close","tcpvmexportd",(char **)0,p_pvm_conf->s_nproc,p_pvm_conf->s_max_proc,p_pvm_fun);
+ PVM_DEINIT;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ if (verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME, "System merger tid %d",*p_merger_sys_tid);
+ /*send the output file name*/
+ if(f_pvm_send(strlen(p_file_to_open),(char *)p_file_to_open,PVM_JOIN_OPT_INIT,s_pvm_single_proc_system.s_current_tid,&s_pvm_single_proc_system)==-1)
+ {
+ f_pvm_stop_single_process(*p_merger_sys_tid);
+ (pvm_func_t*)f_pvm_master_start_stop("close","tcpvmexportd",(char **)0,p_pvm_conf->s_nproc,p_pvm_conf->s_max_proc,p_pvm_fun);
+ PVM_DEINIT;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ }
+ }
+ if ((*p_merger_tid=f_pvm_start_single_process("tcpvmexportd",p_argv_merger,p_merger_conf->p_hostname)) ==-1)
+ {
+ if (s_sys_merger_started==1)
+ s_sys_merger_started--;
+ else if (s_sys_merger_started==0)
+ f_pvm_stop_single_process(*p_merger_sys_tid);
+ (pvm_func_t*)f_pvm_master_start_stop("close","tcpvmexportd",(char **)0,p_pvm_conf->s_nproc,p_pvm_conf->s_max_proc,p_pvm_fun);
+ PVM_DEINIT;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ if (verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME, "MOD_INIT stop f_pvm_start_single_process");
+ if (verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME, "MOD_INIT start PVM_INIT_SKED");
+ if((f_pvm_multi_send(sizeof(int),(char *)&p_pvm_conf->s_num_frame_task,PVM_INIT_SKED,p_pvm_fun))==-1)
+ {
+ f_pvm_stop_single_process(*p_merger_tid);
+ if (s_sys_merger_started==1)
+ s_sys_merger_started--;
+ else if (s_sys_merger_started==0)
+ f_pvm_stop_single_process(*p_merger_sys_tid);
+ (pvm_func_t*)f_pvm_master_start_stop("close","tcpvmexportd",(char **)0,p_pvm_conf->s_nproc,p_pvm_conf->s_max_proc,p_pvm_fun);
+ PVM_DEINIT;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ if (verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME, "MOD_INIT stop PVM_INIT_SKED");
+ if (verbose_flag & TC_DEBUG)
+ {
+ if(param->flag == TC_VIDEO)
+ tc_log_info(MOD_NAME, "Video merger tid %d",*p_merger_tid);
+ else
+ tc_log_info(MOD_NAME, "Audio merger tid %d",*p_merger_tid);
+ }
+ if((f_pvm_multi_send(sizeof(int),(char *)p_merger_tid,PVM_INIT_JOIN,p_pvm_fun))==-1) /*send the merger tid*/
+ {
+ f_pvm_stop_single_process(*p_merger_tid);
+ if (s_sys_merger_started==1)
+ s_sys_merger_started--;
+ else if (s_sys_merger_started==0)
+ f_pvm_stop_single_process(*p_merger_sys_tid);
+ (pvm_func_t*)f_pvm_master_start_stop("close","tcpvmexportd",(char **)0,p_pvm_conf->s_nproc,p_pvm_conf->s_max_proc,p_pvm_fun);
+ PVM_DEINIT;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ /*initial send of the vob structures to the slave processes*/
+ p_vob_buffer=f_vob_pack("open",vob,&s_vob_buffer_size);
+ if (vob->divxmultipass==2)
+ {
+ if (verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME, "enter in preinit msg");
+ for(s_cont=0;s_cont<p_pvm_fun->s_nproc;s_cont++)
+ {
+ if(f_pvm_send(sizeof(int),(char *)&s_cont,PVM_EXP_OPT_PREINIT,s_cont,p_pvm_fun)==-1)
+ {
+ f_pvm_stop_single_process(*p_merger_tid);
+ if (s_sys_merger_started==1)
+ s_sys_merger_started--;
+ else if (s_sys_merger_started==0)
+ f_pvm_stop_single_process(*p_merger_sys_tid);
+ (pvm_func_t*)f_pvm_master_start_stop("close","tcpvmexportd",(char **)0,p_pvm_conf->s_nproc,p_pvm_conf->s_max_proc,p_pvm_fun);
+ PVM_DEINIT;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ }
+ if (verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME, "exit from preinit msg");
+ }
+ if((f_pvm_multi_send(s_vob_buffer_size,p_vob_buffer,PVM_EXP_OPT_INIT,p_pvm_fun))==-1)
+ {
+ f_pvm_stop_single_process(*p_merger_tid);
+ if (s_sys_merger_started==1)
+ s_sys_merger_started--;
+ else if (s_sys_merger_started==0)
+ f_pvm_stop_single_process(*p_merger_sys_tid);
+ (pvm_func_t*)f_pvm_master_start_stop("close","tcpvmexportd",(char **)0,p_pvm_conf->s_nproc,p_pvm_conf->s_max_proc,p_pvm_fun);
+ PVM_DEINIT;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ (char *)f_vob_pack("close",NULL,&s_vob_buffer_size);
+ if(f_pvm_send(strlen(p_file_to_open),(char *)p_file_to_open,PVM_JOIN_OPT_INIT,p_pvm_single_proc->s_current_tid,p_pvm_single_proc)==-1)
+ {
+ f_pvm_stop_single_process(*p_merger_tid);
+ if (s_sys_merger_started==1)
+ s_sys_merger_started--;
+ else if (s_sys_merger_started==0)
+ f_pvm_stop_single_process(*p_merger_sys_tid);
+ (pvm_func_t*)f_pvm_master_start_stop("close","tcpvmexportd",(char **)0,p_pvm_conf->s_nproc,p_pvm_conf->s_max_proc,p_pvm_fun);
+ PVM_DEINIT;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ if (s_msys==1)
+ {
+ if(f_pvm_send(sizeof(int),(char *)p_merger_sys_tid,PVM_MERGER_INIT,p_pvm_single_proc->s_current_tid,p_pvm_single_proc)==-1)
+ {
+ f_pvm_stop_single_process(*p_merger_tid);
+ if (s_sys_merger_started==1)
+ s_sys_merger_started--;
+ else if (s_sys_merger_started==0)
+ f_pvm_stop_single_process(*p_merger_sys_tid);
+ (pvm_func_t*)f_pvm_master_start_stop("close","tcpvmexportd",(char **)0,p_pvm_conf->s_nproc,p_pvm_conf->s_max_proc,p_pvm_fun);
+ PVM_DEINIT;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ }
+ }
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ if (verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME, "exit from MOD_INIT");
+ return TC_OK;
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * encode and export
+ *
+ * ------------------------------------------------------------*/
+
+MOD_encode
+{
+ static int s_video_cont=0,s_audio_cont=0,s_video_seq=0,s_audio_seq=0;
+ static char *p_video_buffer=NULL,*p_audio_buffer=NULL;
+ pvm_func_t *p_pvm_fun=NULL;
+ char *p_buffer=NULL;
+ int s_seq,s_cont=0;
+ int *p_merger_tid=0,*p_merger_sys_tid=0;
+ int s_null_module;
+
+ pthread_mutex_lock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ p_merger_sys_tid=(int *)&s_merger_tid_system[0];
+ if(param->flag == TC_VIDEO)
+ {
+ s_null_module=s_null_video_module;
+ if (!s_null_module)
+ {
+ p_pvm_fun=&s_pvm_fun_video;
+ p_buffer=p_video_buffer;
+ s_seq=s_video_seq;
+ p_merger_tid=&s_merger_tid_video[0];
+ s_cont=s_video_cont;
+ }
+ }
+ else
+ {
+ s_null_module=s_null_audio_module;
+ if (!s_null_module)
+ {
+ p_pvm_fun=&s_pvm_fun_audio;
+ p_buffer=p_audio_buffer;
+ s_seq=s_audio_seq;
+ p_merger_tid=&s_merger_tid_audio[0];
+ s_cont=s_audio_cont;
+ }
+ }
+ if (!s_null_module)
+ {
+ if (p_buffer==NULL)
+ {
+ p_buffer=(char *)malloc(sizeof(transfer_t)+param->size);
+ f_pvm_balancer("open",p_pvm_fun,0,param->flag);
+ }
+ (int)f_pvm_set_send(s_seq); /*set the seq number*/
+ ac_memcpy(p_buffer,(char *)param,sizeof(transfer_t));
+ ac_memcpy(p_buffer+sizeof(transfer_t),(char *)param->buffer,param->size);
+ if((s_seq=f_pvm_send((sizeof(transfer_t)+param->size),(char *)p_buffer,PVM_EXP_OPT_ENCODE,p_pvm_fun->s_current_tid,p_pvm_fun))==-1)
+ {
+ f_pvm_stop_single_process(*p_merger_tid);
+ if (s_sys_merger_started==1)
+ s_sys_merger_started--;
+ else if (s_sys_merger_started==0)
+ f_pvm_stop_single_process(*p_merger_sys_tid);
+ PVM_CLOSE;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ if (verbose_flag & TC_DEBUG)
+ {
+ if(param->flag == TC_VIDEO)
+ tc_log_info(MOD_NAME,"Send %d video sequence number",s_seq);
+ else
+ tc_log_info(MOD_NAME,"Send %d audio sequence number",s_seq);
+ }
+ f_pvm_balancer("set-seq",p_pvm_fun,s_seq,param->flag); /*the tid in s_tid_pos now elab the seq*/
+ if (s_cont<p_pvm_conf->s_num_frame_task)
+ {
+ s_cont++;
+ }
+ else
+ {
+ (int)f_pvm_set_send(s_seq); /*set the prev. seq number*/
+ if((s_seq=f_pvm_send(0,(char *)0,PVM_EXP_OPT_RESTART_ENCODE1,p_pvm_fun->s_current_tid,p_pvm_fun))==-1)
+ {
+ f_pvm_stop_single_process(*p_merger_tid);
+ if (s_sys_merger_started==1)
+ s_sys_merger_started--;
+ else if (s_sys_merger_started==0)
+ f_pvm_stop_single_process(*p_merger_sys_tid);
+ PVM_CLOSE;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ f_pvm_balancer("first-free",p_pvm_fun,s_seq,param->flag);
+ if((s_seq=f_pvm_send(0,(char *)0,PVM_EXP_OPT_RESTART_ENCODE2,p_pvm_fun->s_current_tid,p_pvm_fun))==-1) /*automatic increment of seq*/
+ {
+ f_pvm_stop_single_process(*p_merger_tid);
+ if (s_sys_merger_started==1)
+ s_sys_merger_started--;
+ else if (s_sys_merger_started==0)
+ f_pvm_stop_single_process(*p_merger_sys_tid);
+ PVM_CLOSE;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ s_cont=0;
+ }
+ if(param->flag == TC_VIDEO)
+ {
+ p_video_buffer=p_buffer;
+ s_video_seq=s_seq;
+ s_video_cont=s_cont;
+ }
+ else
+ {
+ p_audio_buffer=p_buffer;
+ s_audio_seq=s_seq;
+ s_audio_cont=s_cont;
+ }
+ }
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_OK;
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * stop codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+ pvm_func_t *p_pvm_fun=NULL;
+ int *p_merger_tid=0,*p_merger_sys_tid=0;
+ int s_null_module;
+ static int s_msys=0;
+
+ p_merger_sys_tid=(int *)&s_merger_tid_system[0];
+ pthread_mutex_lock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ if(param->flag == TC_VIDEO)
+ {
+ s_null_module=s_null_video_module;
+ if (!s_null_module)
+ {
+ p_pvm_fun=&s_pvm_fun_video;
+ p_merger_tid=&s_merger_tid_video[0];
+ }
+ }
+ else
+ {
+ s_null_module=s_null_audio_module;
+ if (!s_null_module)
+ {
+ p_pvm_fun=&s_pvm_fun_audio;
+ p_merger_tid=&s_merger_tid_audio[0];
+ }
+ }
+ if (!s_null_module)
+ {
+ if (p_handle!=NULL)
+ {
+ if (p_pvm_fun!=NULL)
+ {
+ (int)f_pvm_multi_send(0,(char *)0,PVM_EXP_OPT_STOP,p_pvm_fun);
+ f_pvm_stop_single_process(*p_merger_tid);
+ if (s_sys_merger_started!=-1)
+ {
+ if (s_msys==0)
+ {
+ s_msys=1;
+ f_pvm_stop_single_process(*p_merger_sys_tid);
+ memset((char *)&s_pvm_single_proc_system,'\0',sizeof(pvm_func_t));
+ s_merger_tid_system[0]=-1;
+ }
+ }
+ f_pvm_balancer("close",p_pvm_fun,0,param->flag);
+ (pvm_func_t*)f_pvm_master_start_stop("close","tcpvmexportd",(char **)0,p_pvm_conf->s_nproc,p_pvm_conf->s_max_proc,p_pvm_fun);
+ }
+ PVM_DEINIT;
+ if (s_init_check==0)
+ p_handle=NULL;
+ }
+ if(param->flag == TC_VIDEO)
+ {
+ memset((char *)&s_pvm_fun_video,'\0',sizeof(pvm_func_t));
+ s_merger_tid_video[0]=-1;
+ }
+ else
+ {
+ memset((char *)&s_pvm_fun_video,'\0',sizeof(pvm_func_t));
+ s_merger_tid_audio[0]=-1;
+ }
+ }
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_OK;
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * close codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+ int s_seq=0,s_dummy,s_dummy1,s_rc;
+ pvm_func_t *p_pvm_fun=NULL;
+ int *p_merger_tid=0,*p_merger_sys_tid=0;
+ pvm_func_t *p_pvm_single_proc=NULL;
+ int s_null_module;
+ static int s_msys=0;
+
+ p_merger_sys_tid=(int *)&s_merger_tid_system[0];
+ pthread_mutex_lock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ if(param->flag == TC_VIDEO)
+ {
+ s_null_module=s_null_video_module;
+ if (!s_null_module)
+ {
+ p_pvm_fun=&s_pvm_fun_video;
+ p_merger_tid=&s_merger_tid_video[0];
+ p_pvm_single_proc=&s_pvm_single_proc_video;
+ }
+ }
+ else
+ {
+ s_null_module=s_null_audio_module;
+ if (!s_null_module)
+ {
+ p_pvm_fun=&s_pvm_fun_audio;
+ p_merger_tid=&s_merger_tid_audio[0];
+ p_pvm_single_proc=&s_pvm_single_proc_audio;
+ }
+ }
+ if (!s_null_module)
+ {
+ if((s_seq=f_pvm_send(0,(char *)0,PVM_EXP_OPT_RESTART_ENCODE1,p_pvm_fun->s_current_tid,p_pvm_fun))==-1) /*flush the buffer*/
+ {
+ f_pvm_stop_single_process(*p_merger_tid);
+ if (s_sys_merger_started==1)
+ s_sys_merger_started--;
+ else if (s_sys_merger_started==0)
+ f_pvm_stop_single_process(*p_merger_sys_tid);
+ PVM_CLOSE;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ if((f_pvm_multi_send(0,(char *)0,PVM_EXP_OPT_CLOSE,p_pvm_fun))==-1)
+ {
+ f_pvm_stop_single_process(*p_merger_tid);
+ if (s_sys_merger_started==1)
+ s_sys_merger_started--;
+ else if (s_sys_merger_started==0)
+ f_pvm_stop_single_process(*p_merger_sys_tid);
+ PVM_CLOSE;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ if((s_seq=f_pvm_send(0,(char *)0,PVM_JOIN_OPT_RUN,0,p_pvm_single_proc))==-1) /*s_seq not really used*/
+ {
+ f_pvm_stop_single_process(*p_merger_tid);
+ if (s_sys_merger_started==1)
+ s_sys_merger_started--;
+ else if (s_sys_merger_started==0)
+ f_pvm_stop_single_process(*p_merger_sys_tid);
+ PVM_CLOSE;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ if (verbose_flag & TC_DEBUG)
+ {
+ if(param->flag == TC_VIDEO)
+ tc_log_info(MOD_NAME,"Waiting for video merger task (seq %d) termination...",s_seq);
+ else
+ tc_log_info(MOD_NAME,"Waiting for audio merger task (seq %d) termination...",s_seq);
+ }
+ (int)f_pvm_set_recv(s_seq); /*set the last s_seq send*/
+ (int)f_pvm_recv(&s_dummy,(char *)&s_dummy1,&s_rc);
+ if (s_rc)
+ {
+ tc_log_warn(MOD_NAME,"Can't close destination file");
+ f_pvm_stop_single_process(*p_merger_tid);
+ if (s_sys_merger_started==1)
+ s_sys_merger_started--;
+ else if (s_sys_merger_started==0)
+ f_pvm_stop_single_process(*p_merger_sys_tid);
+ PVM_CLOSE;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ if (verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME, "done.");
+ if (s_sys_merger_started!=-1)
+ {
+ if((s_seq=f_pvm_send(0,(char *)0,PVM_JOIN_OPT_SENDFILE,0,p_pvm_single_proc))==-1) /*s_seq not really used*/
+ {
+ f_pvm_stop_single_process(*p_merger_tid);
+ if (s_sys_merger_started==1)
+ s_sys_merger_started--;
+ else if (s_sys_merger_started==0)
+ f_pvm_stop_single_process(*p_merger_sys_tid);
+ PVM_CLOSE;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ }
+ if (s_msys)
+ {
+ if (verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME, "Waiting for system merger build list...");
+ (int)f_pvm_set_recv(PVM_MSG_ENDTASK_SYSTEM); /*wait for system merger end task*/
+ (int)f_pvm_recv(&s_dummy,(char *)&s_dummy1,&s_rc);
+ if (verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME, "done.");
+ if (s_rc)
+ {
+ tc_log_warn(MOD_NAME,"Can't close destination file");
+ f_pvm_stop_single_process(*p_merger_tid);
+ PVM_CLOSE;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ if ((p_pvm_conf->s_system_merger.p_hostname!=NULL)&&(p_pvm_conf->s_system_merger.s_build_only_list!=1)) /*do it for 0 and 2*/
+ {
+ if((s_seq=f_pvm_send(0,(char *)0,PVM_JOIN_OPT_RUN,0,&s_pvm_single_proc_system))==-1) /*s_seq not really used*/
+ {
+ f_pvm_stop_single_process(*p_merger_tid);
+ f_pvm_stop_single_process(*p_merger_sys_tid);
+ PVM_CLOSE;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ if (verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME,"Waiting for system merger task (seq %d) termination...",s_seq);
+ (int)f_pvm_set_recv(s_seq); /*set the last s_seq send*/
+ (int)f_pvm_recv(&s_dummy,(char *)&s_dummy1,&s_rc);
+ if (s_rc)
+ {
+ tc_log_warn(MOD_NAME,"Can't close destination file");
+ f_pvm_stop_single_process(*p_merger_tid);
+ PVM_CLOSE;
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_ERROR;
+ }
+ if (verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME,"done.");
+ }
+ }
+ if (s_sys_merger_started!=-1)
+ s_msys=1;
+ }
+ pthread_mutex_unlock(&s_channel_lock); /*this is the only way to make my module work with nultithreads: need to change all the code*/
+ return TC_OK;
+}
+
+
diff --git a/debian/transcode/transcode-1.1.7/export/export_pvn.c b/debian/transcode/transcode-1.1.7/export/export_pvn.c
new file mode 100644
index 00000000..e7f6fed3
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_pvn.c
@@ -0,0 +1,373 @@
+/*
+ * export_pvn.c -- module for exporting PVN video streams
+ * (http://www.cse.yorku.ca/~jgryn/research/pvnspecs.html)
+ * Written by Andrew Church <[email protected]>
+ *
+ * This file is part of transcode, a video stream processing tool.
+ * transcode is free software, distributable under the terms of the GNU
+ * General Public License (version 2 or later). See the file COPYING
+ * for details.
+ */
+
+#include "transcode.h"
+#include "libtc/libtc.h"
+#include "libtc/optstr.h"
+#include "libtc/tcmodule-plugin.h"
+#include "libtcvideo/tcvideo.h"
+
+#define MOD_NAME "export_pvn.so"
+#define MOD_VERSION "v1.0 (2006-10-06)"
+#define MOD_CAP "Writes PVN video files"
+#define MOD_AUTHOR "Andrew Church"
+
+#define MOD_FEATURES \
+ TC_MODULE_FEATURE_MULTIPLEX|TC_MODULE_FEATURE_VIDEO
+
+#define MOD_FLAGS \
+ TC_MODULE_FLAG_RECONFIGURABLE
+
+
+
+/*************************************************************************/
+
+/* Local data structure: */
+
+typedef struct {
+ int width, height; // Frame width and height (to catch changes)
+ int fd; // Output file descriptor
+ int framecount; // Number of frames written
+ off_t framecount_pos; // File position of frame count (for rewriting)
+} PrivateData;
+
+/*************************************************************************/
+/*************************************************************************/
+
+/* Module interface routines and data. */
+
+/*************************************************************************/
+
+/**
+ * pvn_init: Initialize this instance of the module. See tcmodule-data.h
+ * for function details.
+ */
+
+static int pvn_init(TCModuleInstance *self, uint32_t features)
+{
+ PrivateData *pd;
+
+ TC_MODULE_SELF_CHECK(self, "init");
+ TC_MODULE_INIT_CHECK(self, MOD_FEATURES, features);
+
+ self->userdata = pd = tc_malloc(sizeof(PrivateData));
+ if (!pd) {
+ tc_log_error(MOD_NAME, "init: out of memory!");
+ return -1;
+ }
+ pd->fd = -1;
+ pd->framecount = 0;
+ pd->framecount_pos = 0;
+
+ if (verbose) {
+ tc_log_info(MOD_NAME, "%s %s", MOD_VERSION, MOD_CAP);
+ }
+ return 0;
+}
+
+/*************************************************************************/
+
+/**
+ * pvn_configure: Configure this instance of the module. See
+ * tcmodule-data.h for function details.
+ */
+
+static int pvn_configure(TCModuleInstance *self,
+ const char *options, vob_t *vob)
+{
+ if (!self) {
+ return -1;
+ }
+ return 0;
+}
+
+/*************************************************************************/
+
+/**
+ * pvn_inspect: Return the value of an option in this instance of the
+ * module. See tcmodule-data.h for function details.
+ */
+
+static int pvn_inspect(TCModuleInstance *self,
+ const char *param, const char **value)
+{
+ static char buf[TC_BUF_MAX];
+
+ if (!self || !param)
+ return -1;
+
+ if (optstr_lookup(param, "help")) {
+ tc_snprintf(buf, sizeof(buf),
+ "Overview:\n"
+ " Writes a PVN video stream (format PV6a, 8-bit data).\n"
+ " A grayscale file (PV5a) is written instead if the -K\n"
+ " switch is given to transcode.\n"
+ " The RGB colorspace must be used (-V rgb24).\n"
+ "No options available.\n");
+ *value = buf;
+ }
+ return 0;
+}
+
+/*************************************************************************/
+
+/**
+ * pvn_stop: Reset this instance of the module. See tcmodule-data.h for
+ * function details.
+ */
+
+static int pvn_stop(TCModuleInstance *self)
+{
+ PrivateData *pd;
+
+ if (!self) {
+ return -1;
+ }
+ pd = self->userdata;
+
+ if (pd->fd != -1) {
+ if (pd->framecount > 0 && pd->framecount_pos > 0) {
+ /* Write out final frame count, if we can */
+ if (lseek(pd->fd, pd->framecount_pos, SEEK_SET) != (off_t)-1) {
+ char buf[11];
+ int len = tc_snprintf(buf, sizeof(buf), "%10d",pd->framecount);
+ if (len > 0)
+ tc_pwrite(pd->fd, buf, len);
+ }
+ }
+ close(pd->fd);
+ pd->fd = -1;
+ }
+
+ return 0;
+}
+
+/*************************************************************************/
+
+/**
+ * pvn_fini: Clean up after this instance of the module. See
+ * tcmodule-data.h for function details.
+ */
+
+static int pvn_fini(TCModuleInstance *self)
+{
+ if (!self) {
+ return -1;
+ }
+ pvn_stop(self);
+ tc_free(self->userdata);
+ self->userdata = NULL;
+ return 0;
+}
+
+/*************************************************************************/
+
+/**
+ * pvn_multiplex: Multiplex a frame of data. See tcmodule-data.h for
+ * function details.
+ */
+
+static int pvn_multiplex(TCModuleInstance *self,
+ vframe_list_t *vframe, aframe_list_t *aframe)
+{
+ PrivateData *pd;
+
+ if (!self) {
+ tc_log_error(MOD_NAME, "multiplex: self == NULL!");
+ return -1;
+ }
+ pd = self->userdata;
+ if (pd->fd == -1) {
+ tc_log_error(MOD_NAME, "multiplex: no file opened!");
+ return -1;
+ }
+
+ if (vframe->v_width != pd->width || vframe->v_height != pd->height) {
+ tc_log_error(MOD_NAME, "Video frame size changed in midstream!");
+ return -1;
+ }
+ if (vframe->v_codec != CODEC_RGB) {
+ tc_log_error(MOD_NAME, "Invalid codec for video frame!");
+ return -1;
+ }
+ if (vframe->video_len != pd->width * pd->height * 3
+ && vframe->video_len != pd->width * pd->height // for grayscale
+ ) {
+ tc_log_error(MOD_NAME, "Invalid size for video frame!");
+ return -1;
+ }
+ if (tc_pwrite(pd->fd, vframe->video_buf, vframe->video_len)
+ != vframe->video_len
+ ) {
+ tc_log_error(MOD_NAME, "Error writing frame %d to output file: %s",
+ pd->framecount, strerror(errno));
+ return -1;
+ }
+ pd->framecount++;
+ return vframe->video_len;
+}
+
+/*************************************************************************/
+
+static const TCCodecID pvn_codecs_in[] = { TC_CODEC_RGB, TC_CODEC_ERROR };
+static const TCCodecID pvn_codecs_out[] = { TC_CODEC_ERROR };
+static const TCFormatID pvn_formats_in[] = { TC_FORMAT_ERROR };
+static const TCFormatID pvn_formats_out[] = { TC_FORMAT_PVN, TC_CODEC_ERROR };
+
+static const TCModuleInfo pvn_info = {
+ .features = MOD_FEATURES,
+ .flags = MOD_FLAGS,
+ .name = MOD_NAME,
+ .version = MOD_VERSION,
+ .description = MOD_CAP,
+ .codecs_in = pvn_codecs_in,
+ .codecs_out = pvn_codecs_out,
+ .formats_in = pvn_formats_in,
+ .formats_out = pvn_formats_out
+};
+
+static const TCModuleClass pvn_class = {
+ .info = &pvn_info,
+
+ .init = pvn_init,
+ .fini = pvn_fini,
+ .configure = pvn_configure,
+ .stop = pvn_stop,
+ .inspect = pvn_inspect,
+
+ .multiplex = pvn_multiplex,
+};
+
+extern const TCModuleClass *tc_plugin_setup(void)
+{
+ return &pvn_class;
+}
+
+/*************************************************************************/
+/*************************************************************************/
+
+/* Old-fashioned module interface. */
+
+static TCModuleInstance mod;
+
+static int verbose_flag;
+static int capability_flag = TC_CAP_RGB;
+#define MOD_PRE pvn
+#define MOD_CODEC "(video) PVN"
+#include "export_def.h"
+MOD_init {return 0;}
+MOD_stop {return 0;}
+
+/*************************************************************************/
+
+MOD_open
+{
+ PrivateData *pd = NULL;
+ char buf[1000];
+ int len;
+
+ if (param->flag != TC_VIDEO)
+ return -1;
+ if (pvn_init(&mod, TC_MODULE_FEATURE_MULTIPLEX|TC_MODULE_FEATURE_VIDEO) < 0)
+ return -1;
+ pd = mod.userdata;
+
+ pd->width = vob->ex_v_width;
+ pd->height = vob->ex_v_height;
+ /* FIXME: stdout should be handled in a more standard fashion */
+ if (strcmp(vob->video_out_file, "-") == 0) { // allow /dev/stdout too?
+ pd->fd = 1;
+ } else {
+ pd->fd = open(vob->video_out_file, O_WRONLY | O_CREAT | O_TRUNC, 0666);
+ if (pd->fd < 0) {
+ tc_log_error(MOD_NAME, "Unable to open %s: %s",
+ vob->video_out_file, strerror(errno));
+ goto fail;
+ }
+ }
+ len = tc_snprintf(buf, sizeof(buf), "PV%da\r\n%d %d\r\n",
+ tc_get_vob()->decolor ? 5 : 6,
+ pd->width, pd->height);
+ if (len < 0)
+ goto fail;
+ if (tc_pwrite(pd->fd, buf, len) != len) {
+ tc_log_error(MOD_NAME, "Unable to write header to %s: %s",
+ vob->video_out_file, strerror(errno));
+ goto fail;
+ }
+ pd->framecount_pos = lseek(pd->fd, 0, SEEK_CUR); // failure okay
+ len = tc_snprintf(buf, sizeof(buf), "%10d\r\n8\r\n%lf\r\n",
+ 0, (double)vob->ex_fps);
+ if (len < 0)
+ goto fail;
+ if (tc_pwrite(pd->fd, buf, len) != len) {
+ tc_log_error(MOD_NAME, "Unable to write header to %s: %s",
+ vob->video_out_file, strerror(errno));
+ goto fail;
+ }
+
+ return 0;
+
+ fail:
+ pvn_fini(&mod);
+ return -1;
+}
+
+/*************************************************************************/
+
+MOD_close
+{
+ if (param->flag != TC_VIDEO)
+ return -1;
+ pvn_fini(&mod);
+ return 0;
+}
+
+/*************************************************************************/
+
+MOD_encode
+{
+ vframe_list_t vframe;
+
+ if (param->flag != TC_VIDEO)
+ return -1;
+
+ vframe.v_width = tc_get_vob()->ex_v_width;
+ vframe.v_height = tc_get_vob()->ex_v_height;
+ vframe.v_codec = tc_get_vob()->ex_v_codec;
+ vframe.video_buf = param->buffer;
+ vframe.video_len = param->size;
+ if (!vframe.v_codec)
+ vframe.v_codec = CODEC_RGB; // assume it's correct
+ if (tc_get_vob()->decolor) {
+ // Assume the data is already decolored and just take every third byte
+ int i;
+ vframe.video_len /= 3;
+ for (i = 0; i < vframe.video_len; i++)
+ vframe.video_buf[i] = vframe.video_buf[i*3];
+ }
+ if (pvn_multiplex(&mod, &vframe, NULL) < 0)
+ return -1;
+
+ return 0;
+}
+
+/*************************************************************************/
+
+/*
+ * Local variables:
+ * c-file-style: "stroustrup"
+ * c-file-offsets: ((case-label . *) (statement-case-intro . *))
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * vim: expandtab shiftwidth=4:
+ */
diff --git a/debian/transcode/transcode-1.1.7/export/export_raw.c b/debian/transcode/transcode-1.1.7/export/export_raw.c
new file mode 100644
index 00000000..bc908415
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_raw.c
@@ -0,0 +1,466 @@
+/*
+ * export_raw.c
+ *
+ * Copyright (C) Thomas Oestreich - June 2001
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#define MOD_NAME "export_raw.so"
+#define MOD_VERSION "v0.3.12 (2003-08-04)"
+#define MOD_CODEC "(video) * | (audio) MPEG/AC3/PCM"
+
+#include "transcode.h"
+#include "aud_aux.h"
+#include "avilib/avilib.h"
+#include "import/magic.h"
+#include "libtc/libtc.h"
+#include "libtc/xio.h"
+#include "libtcvideo/tcvideo.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+static int verbose_flag=TC_QUIET;
+static int capability_flag=TC_CAP_DV|TC_CAP_PCM|TC_CAP_RGB|TC_CAP_YUV|TC_CAP_AC3|TC_CAP_AUD|TC_CAP_VID|TC_CAP_YUV422;
+
+#define MOD_PRE raw
+#include "export_def.h"
+
+static avi_t *avifile1=NULL;
+static avi_t *avifile2=NULL;
+
+static int info_shown=0, force_kf=0;
+static int width=0, height=0, im_v_codec=-1;
+static int mpeg_passthru;
+static FILE *mpeg_f = NULL;
+
+static TCVHandle tcvhandle = 0;
+static ImageFormat srcfmt = IMG_NONE, destfmt = IMG_NONE;
+static int destsize = 0;
+
+static const struct {
+ const char *name; // fourcc
+ ImageFormat format;
+ int bpp;
+} formats[] = {
+ { "I420", IMG_YUV420P, 12 },
+ { "YV12", IMG_YV12, 12 },
+ { "YUY2", IMG_YUY2, 16 },
+ { "UYVY", IMG_UYVY, 16 },
+ { "YVYU", IMG_YVYU, 16 },
+ { "Y800", IMG_Y8, 8 },
+ { "RGB", IMG_RGB24, 24 },
+ { NULL, IMG_NONE, 0 }
+};
+
+/*************************************************************************/
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+
+ if(param->flag == TC_VIDEO) {
+ if(verbose & TC_DEBUG) tc_log_info(MOD_NAME, "max AVI-file size limit = %lu bytes",(unsigned long) AVI_max_size());
+ return(TC_EXPORT_OK);
+ }
+
+ if(param->flag == TC_AUDIO) {
+ tc_log_warn(MOD_NAME, "Usage of this module for audio encoding is deprecated.");
+ tc_log_warn(MOD_NAME, "Consider switch to export_tcaud module.");
+ return(tc_audio_init(vob, verbose_flag));
+ }
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * open outputfile
+ *
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+
+
+ double fps;
+
+ const char *codec;
+ const char *fcc = NULL;
+ int force_avi = (vob->ex_v_string && strcmp(vob->ex_v_string,"avi") == 0);
+
+ im_v_codec = vob->im_v_codec;
+
+ // open out file
+ if(param->flag==TC_AUDIO && vob->audio_file_flag) goto further;
+ if(param->flag==TC_VIDEO
+ && vob->v_codec_flag == TC_CODEC_MPEG2
+ && (vob->pass_flag & TC_VIDEO)
+ && !force_avi)
+ goto further;
+ if(vob->avifile_out==NULL) {
+ if(NULL == (vob->avifile_out = AVI_open_output_file(
+ (param->flag==TC_VIDEO)? vob->video_out_file: vob->audio_out_file))) {
+ AVI_print_error("avi open error");
+ exit(TC_EXPORT_ERROR);
+ }
+ }
+
+further:
+
+ /* save locally */
+ avifile2 = vob->avifile_out;
+
+ if(param->flag == TC_VIDEO) {
+
+ // video
+
+ if (vob->ex_v_fcc) {
+ int want_help = (strcasecmp(vob->ex_v_fcc, "help") == 0);
+ int i;
+ if (want_help)
+ tc_log_info(MOD_NAME, "Available formats:");
+ for (i = 0; formats[i].name != NULL; i++) {
+ if (want_help)
+ tc_log_info(MOD_NAME, "%s", formats[i].name);
+ else if (strcasecmp(formats[i].name, vob->ex_v_fcc) == 0)
+ break;
+ }
+ if (formats[i].name == NULL) {
+ if (!want_help) {
+ tc_log_warn(MOD_NAME, "Unknown output format, \"-F help\" to list");
+ }
+ return TC_EXPORT_ERROR;
+ }
+ fcc = formats[i].name;
+ destfmt = formats[i].format;
+ destsize = vob->ex_v_width * vob->ex_v_height * formats[i].bpp / 8;
+ }
+
+ if (!(tcvhandle = tcv_init())) {
+ tc_log_warn(MOD_NAME, "tcv_convert_init failed");
+ return(TC_EXPORT_ERROR);
+ }
+
+ switch(vob->im_v_codec) {
+
+ case CODEC_RGB:
+
+ //force keyframe
+ force_kf=1;
+
+ width = vob->ex_v_width;
+ height = vob->ex_v_height;
+ if (!fcc)
+ fcc = "RGB";
+
+ AVI_set_video(vob->avifile_out, vob->ex_v_width, vob->ex_v_height,
+ vob->ex_fps, fcc);
+
+ if (vob->avi_comment_fd>0)
+ AVI_set_comment_fd(vob->avifile_out, vob->avi_comment_fd);
+
+ if(!info_shown && verbose_flag)
+ tc_log_info(MOD_NAME, "codec=%s, fps=%6.3f, width=%d, height=%d",
+ fcc, vob->ex_fps, vob->ex_v_width, vob->ex_v_height);
+ srcfmt = IMG_RGB_DEFAULT;
+ break;
+
+ case CODEC_YUV:
+
+ //force keyframe
+ force_kf=1;
+
+ width = vob->ex_v_width;
+ height = vob->ex_v_height;
+ if (!fcc)
+ fcc = "I420";
+
+ AVI_set_video(vob->avifile_out, vob->ex_v_width, vob->ex_v_height,
+ vob->ex_fps, fcc);
+
+ if(!info_shown && verbose_flag)
+ tc_log_info(MOD_NAME, "codec=%s, fps=%6.3f, width=%d, height=%d",
+ fcc, vob->ex_fps, vob->ex_v_width, vob->ex_v_height);
+ srcfmt = IMG_YUV_DEFAULT;
+ break;
+
+ case CODEC_YUV422:
+
+ //force keyframe
+ force_kf=1;
+
+ width = vob->ex_v_width;
+ height = vob->ex_v_height;
+ if (!fcc)
+ fcc = "UYVY";
+
+ AVI_set_video(vob->avifile_out, vob->ex_v_width, vob->ex_v_height,
+ vob->ex_fps, fcc);
+
+ if(!info_shown && verbose_flag)
+ tc_log_info(MOD_NAME, "codec=%s, fps=%6.3f, width=%d, height=%d",
+ fcc, vob->ex_fps, vob->ex_v_width, vob->ex_v_height);
+
+ srcfmt = IMG_YUV422P;
+ if (!vob->ex_v_fcc)
+ destfmt = IMG_UYVY;
+ break;
+
+
+ case CODEC_RAW:
+ case CODEC_RAW_YUV:
+
+ if (vob->v_codec_flag == TC_CODEC_MPEG2) {
+
+ if (vob->pass_flag & TC_VIDEO) {
+ mpeg_passthru = 1;
+ tc_log_info(MOD_NAME, "icodec (0x%08x) and codec_flag (0x%08lx) - passthru",
+ vob->im_v_codec, vob->v_codec_flag);
+
+ if (force_avi) {
+ fcc = "mpg2";
+ AVI_set_video(vob->avifile_out, vob->ex_v_width,
+ vob->ex_v_height, vob->ex_fps, fcc);
+ if(!info_shown && verbose_flag) {
+ tc_log_info(MOD_NAME, "codec=%s, fps=%6.3f, width=%d,"
+ " height=%d", fcc, vob->ex_fps,
+ vob->ex_v_width, vob->ex_v_height);
+ }
+ } else {
+ mpeg_f = fopen(vob->video_out_file, "w");
+ if (!mpeg_f) {
+ tc_log_warn(MOD_NAME, "Cannot open outfile \"%s\": %s",
+ vob->video_out_file, strerror(errno));
+ return (TC_EXPORT_ERROR);
+ }
+ }
+ }
+ }
+ else
+ switch(vob->v_format_flag) {
+
+ case TC_MAGIC_DV_PAL:
+ case TC_MAGIC_DV_NTSC:
+
+ //force keyframe
+ force_kf=1;
+
+ width = vob->ex_v_width;
+ height = vob->ex_v_height;
+
+ AVI_set_video(vob->avifile_out, vob->ex_v_width, vob->ex_v_height, vob->ex_fps, "DVSD");
+
+ if(!info_shown && verbose_flag)
+ tc_log_info(MOD_NAME, "codec=%s, fps=%6.3f, width=%d, height=%d",
+ "DVSD", vob->ex_fps, vob->ex_v_width, vob->ex_v_height);
+ break;
+
+ default:
+ // pass-through mode is the default, works only with import_avi.so
+ if(vob->pass_flag & TC_VIDEO) {
+ if (tc_file_check(vob->video_in_file) != 0) {
+ tc_log_warn(MOD_NAME, "bad source file: \"%s\"",
+ vob->video_in_file);
+ }
+
+ if(avifile1==NULL) {
+ avifile1 = AVI_open_input_file(vob->video_in_file, 1);
+ if(NULL == avifile1) {
+ AVI_print_error("avi open error in export_raw");
+ return(TC_EXPORT_ERROR);
+ }
+ }
+
+ //read all video parameter from input file
+ width = AVI_video_width(avifile1);
+ height = AVI_video_height(avifile1);
+
+ fps = AVI_frame_rate(avifile1);
+ codec = AVI_video_compressor(avifile1);
+
+ //same for outputfile
+ AVI_set_video(vob->avifile_out, width, height, fps, codec);
+
+ if(!info_shown && (verbose_flag))
+ tc_log_info(MOD_NAME, "codec=%s, fps=%6.3f, width=%d, height=%d",
+ codec, fps, width, height);
+
+ //free resources
+ if(avifile1!=NULL) {
+ AVI_close(avifile1);
+ avifile1=NULL;
+ }
+ }
+ }
+
+ break;
+
+ default:
+
+ tc_log_info(MOD_NAME, "codec (0x%08x) and format (0x%08lx)not supported",
+ vob->im_v_codec, vob->v_format_flag);
+ return(TC_EXPORT_ERROR);
+
+ break;
+ }
+
+ info_shown=1;
+ return(0);
+ }
+
+
+ if(param->flag == TC_AUDIO) return(tc_audio_open(vob, vob->avifile_out));
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * encode and export
+ *
+ * ------------------------------------------------------------*/
+
+MOD_encode
+{
+
+ int key;
+ int i, mod=width%4;
+ int size = param->size;
+
+ if(param->flag == TC_VIDEO) {
+
+ if (mpeg_f) {
+ if (fwrite (param->buffer, 1, param->size, mpeg_f) != param->size) {
+ tc_log_warn(MOD_NAME, "Cannot write data: %s", strerror(errno));
+ return(TC_EXPORT_ERROR);
+ }
+ return (TC_EXPORT_OK);
+ }
+
+
+ //0.5.0-pre8:
+ key = ((param->attributes & TC_FRAME_IS_KEYFRAME) || force_kf) ? 1:0;
+
+ //0.6.2: switch outfile on "r/R" and -J pv
+ //0.6.2: enforce auto-split at 2G (or user value) for normal AVI files
+ if((uint32_t)(AVI_bytes_written(avifile2)+param->size+16+8)>>20 >= tc_avi_limit) tc_outstream_rotate_request();
+
+ if(key) tc_outstream_rotate();
+
+ if (srcfmt && destfmt) {
+ vob_t *vob = tc_get_vob();
+ if (!tcv_convert(tcvhandle, param->buffer, param->buffer,
+ vob->ex_v_width, vob->ex_v_height, srcfmt, destfmt)) {
+ tc_log_warn(MOD_NAME, "image conversion failed");
+ return(TC_EXPORT_ERROR);
+ }
+ if (destsize)
+ size = destsize;
+ }
+
+ // Fixup: For uncompressed AVIs, it must be aligned at
+ // a 4-byte boundary
+ if (mod && (destfmt ? destfmt == IMG_RGB24 : im_v_codec == CODEC_RGB)) {
+ for (i = height; i>0; i--) {
+ memmove (param->buffer+(i*width*3) + mod*i,
+ param->buffer+(i*width*3) ,
+ width*3);
+ }
+ param->size = height*width*3 + (4-mod)*height;
+ //tc_log_msg(MOD_NAME, "going here mod = |%d| width (%d) size (%d)||", mod, width, param->size);
+ }
+ // write video
+ if(AVI_write_frame(avifile2, param->buffer, size, key)<0) {
+ AVI_print_error("avi video write error");
+
+ return(TC_EXPORT_ERROR);
+ }
+
+ return(0);
+
+ }
+
+ if(param->flag == TC_AUDIO) return(tc_audio_encode(param->buffer, param->size, avifile2));
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * stop encoder
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+
+ if(param->flag == TC_VIDEO) return(0);
+ if(param->flag == TC_AUDIO) return(tc_audio_stop());
+
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * close outputfiles
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+
+ vob_t *vob = tc_get_vob();
+
+ if (mpeg_f) {
+ fclose (mpeg_f);
+ mpeg_f = NULL;
+ }
+
+ //inputfile
+ if(avifile1!=NULL) {
+ AVI_close(avifile1);
+ avifile1=NULL;
+ }
+
+ if(param->flag == TC_AUDIO) return(tc_audio_close());
+
+ //outputfile
+ if(vob->avifile_out!=NULL) {
+ AVI_close(vob->avifile_out);
+ vob->avifile_out=NULL;
+ }
+
+ tcv_free(tcvhandle);
+ tcvhandle = 0;
+
+ if(param->flag == TC_VIDEO) return(0);
+
+ return(TC_EXPORT_ERROR);
+
+}
+
diff --git a/debian/transcode/transcode-1.1.7/export/export_tcaud.c b/debian/transcode/transcode-1.1.7/export/export_tcaud.c
new file mode 100644
index 00000000..c1431ccd
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_tcaud.c
@@ -0,0 +1,96 @@
+/*
+ * export_tcaud.c - generic audio export frontend module
+ * (C) 2007-2010 Francesco Romani <fromani at gmail dot com>
+ * incorporates code from former aud_aux.c, which was
+ * Copyright (C) Thomas Oestreich - June 2001
+ * Copyright (C) Nicolas LAURENT - August 2003
+ *
+ * This file is part of transcode, a video stream processing tool.
+ * transcode is free software, distributable under the terms of the GNU
+ * General Public License (version 2 or later). See the file COPYING
+ * for details.
+ */
+
+#define MOD_NAME "export_tcaud.so"
+#define MOD_VERSION "v0.9.0 (2007-07-03)"
+#define MOD_CODEC "(audio) MPEG/AC3/PCM"
+
+#include "transcode.h"
+#include "aud_aux.h"
+
+static int verbose_flag = TC_DEBUG;
+static int capability_flag = TC_CAP_PCM|TC_CAP_AC3|TC_CAP_AUD;
+
+#define MOD_PRE tcaud
+#include "export_def.h"
+
+/*************************************************************************/
+
+MOD_init
+{
+ if (param->flag == TC_AUDIO) {
+ return tc_audio_init(vob, verbose);
+ }
+ if (param->flag == TC_VIDEO) {
+ return TC_EXPORT_OK;
+ }
+ return TC_EXPORT_ERROR;
+}
+
+MOD_open
+{
+ if (param->flag == TC_AUDIO) {
+ return tc_audio_open(vob, vob->avifile_out);
+ }
+ if (param->flag == TC_VIDEO) {
+ return TC_EXPORT_OK;
+ }
+ return TC_EXPORT_ERROR;
+}
+
+MOD_encode
+{
+ if (param->flag == TC_AUDIO) {
+ vob_t *vob = tc_get_vob();
+ return tc_audio_encode(param->buffer, param->size, vob->avifile_out);
+ }
+ if (param->flag == TC_VIDEO) {
+ return TC_EXPORT_OK;
+ }
+ return TC_EXPORT_ERROR;
+}
+
+MOD_close
+{
+ if (param->flag == TC_AUDIO) {
+ return tc_audio_close();
+ }
+ if (param->flag == TC_VIDEO) {
+ return TC_EXPORT_OK;
+ }
+ return TC_EXPORT_ERROR;
+}
+
+MOD_stop
+{
+ if (param->flag == TC_AUDIO) {
+ return tc_audio_stop();
+ }
+ if (param->flag == TC_VIDEO) {
+ return TC_EXPORT_OK;
+ }
+ return TC_EXPORT_ERROR;
+}
+
+
+/*************************************************************************/
+
+/*
+ * Local variables:
+ * c-file-style: "stroustrup"
+ * c-file-offsets: ((case-label . *) (statement-case-intro . *))
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * vim: expandtab shiftwidth=4:
+ */
diff --git a/debian/transcode/transcode-1.1.7/export/export_toolame.c b/debian/transcode/transcode-1.1.7/export/export_toolame.c
new file mode 100644
index 00000000..3bbadf14
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_toolame.c
@@ -0,0 +1,235 @@
+/*
+ * export_toolame.c
+ *
+ * Andreas Neukoetter <[email protected]> - April 2002
+ * sox extension: Christian Vogelgsang <[email protected]>
+ *
+ * based on export mp2enc.c
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#define MOD_NAME "export_twolame.so"
+#define MOD_VERSION "v1.0.6 (2004-01-26)"
+#define MOD_CODEC "(audio) MPEG 1/2"
+
+#include "transcode.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+static int verbose_flag = TC_QUIET;
+static int capability_flag = TC_CAP_PCM;
+
+#define MOD_PRE twolame
+#include "export_def.h"
+
+static FILE* pFile = NULL;
+
+/* ------------------------------------------------------------
+ *
+ * Pipe write helper function
+ *
+ * ------------------------------------------------------------*/
+
+static int p_write (char *buf, size_t len)
+{
+ size_t n = 0;
+ size_t r = 0;
+ int fd = fileno (pFile);
+
+ while (r < len)
+ {
+ if ((n = write (fd, buf + r, len - r)) < 0)
+ return n;
+
+ r += n;
+ }
+
+ return r;
+}
+
+/* ------------------------------------------------------------
+ *
+ * open outputfile
+ *
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+ if (param->flag == TC_AUDIO) {
+ char buf [PATH_MAX];
+ int ifreq,ofreq,orate;
+ int verb;
+ //int ofreq_int;
+ //int ofreq_dec;
+ int ochan;
+ char chan;
+ char *ptr;
+
+ /* check for twolame */
+ if (tc_test_program("twolame") != 0) return (TC_EXPORT_ERROR);
+
+ /* verbose? */
+ verb = (verbose & TC_DEBUG) ? 2:0;
+
+ /* fetch audio parameter */
+ ofreq = vob->mp3frequency;
+ ifreq = vob->a_rate;
+ orate = vob->mp3bitrate;
+ ochan = vob->dm_chan;
+ chan = (ochan==2) ? (vob->mp3mode==1 ? 's' : 'j') : 'm';
+
+ /* default out freq */
+ if(ofreq==0)
+ ofreq = ifreq;
+
+ /* need conversion? */
+ if(ofreq!=ifreq) {
+ /* check for sox */
+ if (tc_test_program("sox") != 0) return (TC_EXPORT_ERROR);
+
+ /* add sox for conversion */
+ tc_snprintf(buf, sizeof(buf), "sox %s -r %d -c %d -t raw - -r %d"
+ " -t raw - polyphase 2>/dev/null | ",
+ (vob->dm_bits==16)?"-w -s":"-b -u",
+ ifreq, ochan, ofreq);
+ ptr = buf + strlen(buf);
+ } else {
+ ptr = buf;
+ }
+
+ /* convert output frequency to fixed point */
+ /* why that?
+ ofreq_int = ofreq/1000.0;
+ ofreq_dec = ofreq-ofreq_int*1000;
+ */
+
+ /* twolame command line */
+ /* ptr is a pointer into buf */
+ tc_snprintf(ptr, sizeof(buf) - (ptr-buf),
+ "twolame -s %0.3f -b %d -m %c - \"%s\" 2>/dev/null %s",
+ (double)ofreq/1000.0, orate, chan, vob->audio_out_file,
+ (vob->ex_a_string?vob->ex_a_string:""));
+
+ tc_log_info (MOD_NAME, "%s", buf);
+
+ if ((pFile = popen (buf, "w")) == NULL)
+ return(TC_EXPORT_ERROR);
+
+ return(0);
+ }
+
+ if (param->flag == TC_VIDEO)
+ return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+ if(param->flag == TC_AUDIO)
+ {
+ return(0);
+ }
+
+ if (param->flag == TC_VIDEO)
+ return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * encode and export frame
+ *
+ * ------------------------------------------------------------*/
+
+
+MOD_encode
+{
+ if(param->flag == TC_AUDIO)
+ {
+ if (p_write (param->buffer, param->size) != param->size)
+ {
+ tc_log_perror(MOD_NAME, "write audio frame");
+ return(TC_EXPORT_ERROR);
+ }
+ return (0);
+ }
+
+ if (param->flag == TC_VIDEO)
+ return(0);
+
+ // invalid flag
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * stop encoder
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+ if (param->flag == TC_VIDEO)
+ return (0);
+
+ if (param->flag == TC_AUDIO)
+ return (0);
+
+ return(TC_EXPORT_ERROR);
+}
+
+/* ------------------------------------------------------------
+ *
+ * close codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+ if (param->flag == TC_VIDEO)
+ return (0);
+
+ if (param->flag == TC_AUDIO)
+ {
+ if (pFile)
+ pclose (pFile);
+
+ pFile = NULL;
+
+ return(0);
+ }
+
+ return (TC_EXPORT_ERROR);
+}
+
diff --git a/debian/transcode/transcode-1.1.7/export/export_wav.c b/debian/transcode/transcode-1.1.7/export/export_wav.c
new file mode 100644
index 00000000..c5cc7bec
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_wav.c
@@ -0,0 +1,153 @@
+/*
+ * export_wav.c
+ *
+ * Copyright (C) Thomas Oestreich - June 2001
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#define MOD_NAME "export_wav.so"
+#define MOD_VERSION "v0.3.0 (2006-03-16)"
+#define MOD_CODEC "(audio) WAVE PCM"
+
+#include "transcode.h"
+#include "avilib/wavlib.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+static int verbose_flag = TC_QUIET;
+static int capability_flag = TC_CAP_PCM|TC_CAP_RGB|TC_CAP_YUV|TC_CAP_VID;
+
+#define MOD_PRE wav
+#include "export_def.h"
+
+static WAV wav = NULL;
+
+/* ------------------------------------------------------------
+ *
+ * init codec
+ *
+ * ------------------------------------------------------------*/
+
+MOD_init
+{
+ if (param->flag == TC_VIDEO) {
+ return TC_EXPORT_OK;
+ }
+ if (param->flag == TC_AUDIO) {
+ return TC_EXPORT_OK;
+ }
+ return TC_EXPORT_ERROR;
+}
+
+/* ------------------------------------------------------------
+ *
+ * open outputfile
+ *
+ * ------------------------------------------------------------*/
+
+MOD_open
+{
+ if (param->flag == TC_AUDIO) {
+ WAVError err;
+ int rate;
+
+ wav = wav_open(vob->audio_out_file, WAV_WRITE, &err);
+ if (wav == NULL) {
+ tc_log_error(MOD_NAME, "open file: %s", wav_strerror(err));
+ return TC_EXPORT_ERROR;
+ }
+
+ rate = (vob->mp3frequency != 0) ?vob->mp3frequency :vob->a_rate;
+ wav_set_bits(wav, vob->dm_bits);
+ wav_set_rate(wav, rate);
+ wav_set_bitrate(wav, vob->dm_chan * rate * vob->dm_bits/8);
+ wav_set_channels(wav, vob->dm_chan);
+
+ return TC_EXPORT_OK;
+ }
+
+ if (param->flag == TC_VIDEO) {
+ return TC_EXPORT_OK;
+ }
+ return TC_EXPORT_ERROR;
+}
+
+/* ------------------------------------------------------------
+ *
+ * encode and export
+ *
+ * ------------------------------------------------------------*/
+
+MOD_encode
+{
+ if (param->flag == TC_AUDIO) {
+ if (wav_write_data(wav, param->buffer, param->size) != param->size) {
+ tc_log_error(MOD_NAME, "write audio frame: %s",
+ wav_strerror(wav_last_error(wav)));
+ return TC_EXPORT_ERROR;
+ }
+ return TC_EXPORT_OK;
+ }
+
+ if (param->flag == TC_VIDEO) {
+ return TC_EXPORT_OK;
+ }
+ return TC_EXPORT_ERROR;
+}
+
+/* ------------------------------------------------------------
+ *
+ * close outputfiles
+ *
+ * ------------------------------------------------------------*/
+
+MOD_close
+{
+ if (param->flag == TC_VIDEO) {
+ return TC_EXPORT_OK;
+ }
+ if (param->flag == TC_AUDIO) {
+ if (wav_close(wav) != 0) {
+ tc_log_error(MOD_NAME, "closing file: %s",
+ wav_strerror(wav_last_error(wav)));
+ return TC_EXPORT_ERROR;
+ }
+ return TC_EXPORT_OK;
+ }
+ return TC_EXPORT_ERROR;
+}
+
+/* ------------------------------------------------------------
+ *
+ * stop encoder
+ *
+ * ------------------------------------------------------------*/
+
+MOD_stop
+{
+ if (param->flag == TC_VIDEO) {
+ return TC_EXPORT_OK;
+ }
+ if (param->flag == TC_AUDIO) {
+ return TC_EXPORT_OK;
+ }
+ return TC_EXPORT_ERROR;
+}
+
diff --git a/debian/transcode/transcode-1.1.7/export/export_xvid4.c b/debian/transcode/transcode-1.1.7/export/export_xvid4.c
new file mode 100644
index 00000000..865b8873
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_xvid4.c
@@ -0,0 +1,1335 @@
+/*****************************************************************************
+ * - XviD Transcode Export Module -
+ *
+ * Copyright (C) 2001-2003 - Thomas Oestreich
+ *
+ * Author : Edouard Gomez <[email protected]>
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software ; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation ; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY ; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program ; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Includes
+ ****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <math.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#ifdef HAVE_DLFCN_H
+#include <dlfcn.h>
+#else
+# ifdef OS_DARWIN
+# include "libdldarwin/dlfcn.h"
+# endif
+#endif
+
+#ifndef OS_BSD
+# ifdef HAVE_MALLOC_H
+# include <malloc.h>
+# endif
+#endif
+
+#include "xvid4.h"
+
+#include "transcode.h"
+#include "avilib/avilib.h"
+#include "aud_aux.h"
+#include "libtc/libtc.h"
+#include "libtcvideo/tcvideo.h"
+
+#include "libtc/cfgfile.h"
+
+/*****************************************************************************
+ * Transcode module binding functions and strings
+ ****************************************************************************/
+
+#define MOD_NAME "export_xvid4.so"
+#define MOD_VERSION "v0.0.6 (2007-08-11)"
+#define MOD_CODEC \
+"(video) XviD 1.0.x series (aka API 4.0) | (audio) MPEG/AC3/PCM"
+static int verbose_flag = TC_QUIET;
+static int capability_flag = TC_CAP_PCM |
+ TC_CAP_RGB |
+ TC_CAP_YUV |
+ TC_CAP_YUV422 |
+ TC_CAP_AC3 |
+ TC_CAP_AUD;
+#define MOD_PRE xvid4_
+#include "export_def.h"
+
+/* XviD shared library name */
+#define XVID_SHARED_LIB_BASE "libxvidcore"
+#ifdef OS_DARWIN
+#define XVID_SHARED_LIB_SUFX "dylib"
+#else
+#define XVID_SHARED_LIB_SUFX "so"
+#endif
+#define XVID_CONFIG_FILE "xvid4.cfg"
+
+/*****************************************************************************
+ * XviD symbols grouped in a nice struct.
+ ****************************************************************************/
+
+typedef int (*xvid_function_t)(void *handle, int opt,
+ void *param1, void *param2);
+
+typedef struct _xvid_module_t
+{
+ void *so;
+ xvid_function_t global;
+ xvid_function_t encore;
+ xvid_function_t plugin_onepass;
+ xvid_function_t plugin_twopass1;
+ xvid_function_t plugin_twopass2;
+ xvid_function_t plugin_lumimasking;
+} xvid_module_t;
+
+static int load_xvid(xvid_module_t *xvid, const char *path);
+static int unload_xvid(xvid_module_t *xvid);
+
+/*****************************************************************************
+ * Transcode module private data
+ ****************************************************************************/
+
+typedef struct _xvid_transcode_module_t
+{
+ /* XviD lib functions */
+ xvid_module_t xvid;
+
+ /* Instance related global vars */
+ void *instance;
+ xvid_gbl_init_t xvid_gbl_init;
+ xvid_enc_create_t xvid_enc_create;
+ xvid_enc_frame_t xvid_enc_frame;
+
+ /* This data must survive local block scope, so here it is */
+ xvid_enc_plugin_t plugins[7];
+ xvid_enc_zone_t zones[2];
+ xvid_plugin_single_t onepass;
+ xvid_plugin_2pass1_t pass1;
+ xvid_plugin_2pass2_t pass2;
+
+ /* Options from the config file */
+ xvid_enc_create_t cfg_create;
+ xvid_enc_frame_t cfg_frame;
+ xvid_plugin_single_t cfg_onepass;
+ xvid_plugin_2pass2_t cfg_pass2;
+ char *cfg_intra_matrix_file;
+ char *cfg_inter_matrix_file;
+ char *cfg_quant_method;
+ int cfg_packed;
+ int cfg_closed_gop;
+ int cfg_interlaced;
+ int cfg_quarterpel;
+ int cfg_gmc;
+ int cfg_trellis;
+ int cfg_cartoon;
+ int cfg_hqacpred;
+ int cfg_chromame;
+ int cfg_vhq;
+ int cfg_motion;
+ int cfg_stats;
+ int cfg_greyscale;
+ int cfg_turbo;
+ int cfg_full1pass;
+
+ /* MPEG4 stream buffer */
+ int stream_size;
+ uint8_t *stream;
+
+ /* File output
+ * Depending on the "-F raw" option presence, this module will
+ * use/initialize either the raw file descriptor or the avi file
+ * pointer in the vob structure passed by transcode */
+ int rawfd;
+
+ /* Stats accumulators */
+ int frames;
+ long long sse_y;
+ long long sse_u;
+ long long sse_v;
+
+ /* Image format conversion handle */
+ TCVHandle tcvhandle;
+} xvid_transcode_module_t;
+
+static xvid_transcode_module_t thismod;
+
+static void reset_module(xvid_transcode_module_t *mod);
+static void free_module(xvid_transcode_module_t *mod);
+static void read_config_file(xvid_transcode_module_t *mod);
+static void dispatch_settings(xvid_transcode_module_t *mod);
+static void set_create_struct(xvid_transcode_module_t *mod, vob_t *vob);
+static void set_frame_struct(xvid_transcode_module_t *mod, vob_t *vob, transfer_t *t);
+static const char *errorstring(int err);
+
+/*****************************************************************************
+ * Init codec
+ ****************************************************************************/
+
+MOD_init
+{
+ int ret;
+ xvid_module_t *xvid = &thismod.xvid;
+
+ /* Invalid flag */
+ if(param->flag != TC_AUDIO && param->flag != TC_VIDEO)
+ return(TC_EXPORT_ERROR);
+
+ /* Audio init */
+ if(param->flag == TC_AUDIO)
+ return(tc_audio_init(vob, verbose));
+
+ /* Video init */
+
+ /* This is the first function called according to transcode API
+ * We must initialize the module structure correctly but only
+ * _once_ */
+ reset_module(&thismod);
+
+ /* Check frame dimensions */
+ if(vob->ex_v_width%2 || vob->ex_v_height%2) {
+ tc_log_warn(MOD_NAME, "Only even dimensions allowed (%dx%d)",
+ vob->ex_v_width, vob->ex_v_height);
+ return(TC_EXPORT_ERROR);
+ }
+
+ /* Buffer allocation
+ * We allocate width*height*bpp/8 to "receive" the compressed stream
+ * I don't think the codec will ever return more than that. It's and
+ * encoder, so if it fails delivering smaller frames than original
+ * ones, something really odd occurs somewhere and i prefer the
+ * application crash */
+ thismod.stream_size = vob->ex_v_width * vob->ex_v_height;
+ if(vob->im_v_codec == CODEC_RGB) {
+ thismod.stream_size *= 3;
+ if (!(thismod.tcvhandle = tcv_init())) {
+ tc_log_warn(MOD_NAME, "tcv_init failed");
+ return TC_EXPORT_ERROR;
+ }
+ } else if(vob->im_v_codec == CODEC_YUV422) {
+ thismod.stream_size *= 2;
+ if (!(thismod.tcvhandle = tcv_init())) {
+ tc_log_warn(MOD_NAME, "tcv_init failed");
+ return TC_EXPORT_ERROR;
+ }
+ } else
+ thismod.stream_size = (thismod.stream_size*3)/2;
+ if((thismod.stream = malloc(thismod.stream_size)) == NULL) {
+ tc_log_error(MOD_NAME, "Error allocating stream buffer");
+ return(TC_EXPORT_ERROR);
+ } else {
+ memset(thismod.stream, 0, thismod.stream_size);
+ }
+
+ /* Load the codec */
+ if(load_xvid(xvid, vob->mod_path) < 0)
+ return(TC_EXPORT_ERROR);
+
+ /* Load the config file settings */
+ read_config_file(&thismod);
+
+ /* Dispatch settings to xvid structures that hold the config ready to
+ * be copied to encoder structures */
+ dispatch_settings(&thismod);
+
+ /* Init the xvidcore lib */
+ memset(&thismod.xvid_gbl_init, 0, sizeof(xvid_gbl_init_t));
+ thismod.xvid_gbl_init.version = XVID_VERSION;
+ ret = xvid->global(NULL, XVID_GBL_INIT, &thismod.xvid_gbl_init, NULL);
+
+ if(ret < 0) {
+ tc_log_warn(MOD_NAME, "Library initialization failed");
+ return(TC_EXPORT_ERROR);
+ }
+
+ /* Combine both the config settings with the transcode direct options
+ * into the final xvid_enc_create_t struct */
+ set_create_struct(&thismod, vob);
+ ret = xvid->encore(NULL, XVID_ENC_CREATE, &thismod.xvid_enc_create, NULL);
+
+ if(ret < 0) {
+ tc_log_warn(MOD_NAME, "Encoder initialization failed");
+ return(TC_EXPORT_ERROR);
+ }
+
+ /* Attach returned instance */
+ thismod.instance = thismod.xvid_enc_create.handle;
+
+ return(TC_EXPORT_OK);
+}
+
+
+/*****************************************************************************
+ * Open the output file
+ ****************************************************************************/
+
+MOD_open
+{
+ int avi_output = 1;
+
+ /* Invalid flag */
+ if(param->flag != TC_AUDIO && param->flag != TC_VIDEO)
+ return(TC_EXPORT_ERROR);
+
+ /* Check for raw output */
+ if((vob->ex_v_fcc != NULL) && (strlen(vob->ex_v_fcc) != 0) &&
+ (strcasecmp(vob->ex_v_fcc, "raw") == 0))
+ avi_output = 0;
+
+ /* Open file */
+ if(avi_output && vob->avifile_out == NULL) {
+
+ vob->avifile_out = AVI_open_output_file(vob->video_out_file);
+
+ if((vob->avifile_out) == NULL) {
+ AVI_print_error("avi open error");
+ return(TC_EXPORT_ERROR);
+ }
+ }
+
+ /* Open audio file */
+ if(param->flag == TC_AUDIO) {
+ tc_log_warn(MOD_NAME, "Usage of this module for audio encoding is deprecated.");
+ tc_log_warn(MOD_NAME, "Consider switch to export_tcaud module.");
+ return(tc_audio_open(vob, vob->avifile_out));
+ }
+
+ /* Open video file */
+ if(verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME, "Using %s output",
+ avi_output?"AVI":"Raw");
+
+ if(avi_output) {
+ /* AVI Video output */
+ AVI_set_video(vob->avifile_out, vob->ex_v_width,
+ vob->ex_v_height, vob->ex_fps, "XVID");
+
+ if(vob->avi_comment_fd > 0)
+ AVI_set_comment_fd(vob->avifile_out,
+ vob->avi_comment_fd);
+ } else {
+ /* Raw Video output */
+ thismod.rawfd = open(vob->video_out_file,
+ O_RDWR|O_CREAT|O_TRUNC,
+ S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
+ if(thismod.rawfd < 0) {
+ tc_log_perror(MOD_NAME, "open file");
+ return(TC_EXPORT_ERROR);
+ }
+ }
+
+ return(TC_EXPORT_OK);
+}
+
+
+/*****************************************************************************
+ * Encode and export a frame
+ ****************************************************************************/
+
+static int tc_xvid_write(int bytes, vob_t *vob)
+{
+ /* Make sure we take care of AVI splitting */
+ if(thismod.rawfd < 0) {
+ if((uint32_t)(AVI_bytes_written(vob->avifile_out)+bytes+16+8)>>20 >= tc_avi_limit)
+ tc_outstream_rotate_request();
+ if(thismod.xvid_enc_frame.out_flags & XVID_KEYFRAME)
+ tc_outstream_rotate();
+ }
+
+ /* Write bitstream */
+ if(thismod.rawfd < 0) {
+ int ret = AVI_write_frame(vob->avifile_out, thismod.stream, bytes,
+ thismod.xvid_enc_frame.out_flags & XVID_KEYFRAME);
+ if(ret < 0) {
+ tc_log_warn(MOD_NAME, "AVI video write error");
+ return(TC_EXPORT_ERROR);
+ }
+ } else {
+ int ret = tc_pwrite(thismod.rawfd, thismod.stream, bytes);
+ if(ret != bytes) {
+ tc_log_warn(MOD_NAME, "RAW video write error");
+ return(TC_EXPORT_ERROR);
+ }
+ }
+
+ return(TC_EXPORT_OK);
+}
+
+MOD_encode
+{
+ int bytes;
+
+ xvid_enc_stats_t xvid_enc_stats;
+ xvid_module_t *xvid = &thismod.xvid;
+ vob_t *vob = tc_get_vob();
+
+ /* Invalid flag */
+ if(param->flag != TC_AUDIO && param->flag != TC_VIDEO)
+ return(TC_EXPORT_ERROR);
+
+ /* Audio encoding */
+ if(param->flag == TC_AUDIO)
+ return(tc_audio_encode(param->buffer, param->size, vob->avifile_out));
+
+ /* Video encoding */
+
+ if(vob->im_v_codec == CODEC_YUV422) {
+ /* Convert to UYVY */
+ tcv_convert(thismod.tcvhandle, param->buffer, param->buffer,
+ vob->ex_v_width, vob->ex_v_height,
+ IMG_YUV422P, IMG_UYVY);
+ } else if (vob->im_v_codec == CODEC_RGB) {
+ /* Convert to BGR (why isn't RGB supported??) */
+ tcv_convert(thismod.tcvhandle, param->buffer, param->buffer,
+ vob->ex_v_width, vob->ex_v_height,
+ IMG_RGB24, IMG_BGR24);
+ }
+
+ /* Init the stat structure */
+ memset(&xvid_enc_stats,0, sizeof(xvid_enc_stats_t));
+ xvid_enc_stats.version = XVID_VERSION;
+
+ /* Combine both the config settings with the transcode direct options
+ * into the final xvid_enc_frame_t struct */
+ set_frame_struct(&thismod, vob, param);
+
+ bytes = xvid->encore(thismod.instance, XVID_ENC_ENCODE,
+ &thismod.xvid_enc_frame, &xvid_enc_stats);
+
+ /* Error handling */
+ if(bytes < 0) {
+ tc_log_warn(MOD_NAME, "xvidcore returned a \"%s\" error",
+ errorstring(bytes));
+ return(TC_EXPORT_ERROR);
+ }
+
+ /* Extract stats info */
+ if(xvid_enc_stats.type>0 && thismod.cfg_stats) {
+ thismod.frames++;
+ thismod.sse_y += xvid_enc_stats.sse_y;
+ thismod.sse_u += xvid_enc_stats.sse_u;
+ thismod.sse_v += xvid_enc_stats.sse_v;
+ }
+
+ /* XviD Core rame buffering handling
+ * We must make sure audio A/V is still good and does not run away */
+ if(bytes == 0) {
+ param->attributes |= TC_FRAME_IS_DELAYED;
+ return(TC_EXPORT_OK);
+ }
+
+ /* Make sure we take care of AVI splitting */
+ return tc_xvid_write(bytes, vob);
+}
+
+/*****************************************************************************
+ * Close codec
+ ****************************************************************************/
+
+static int tc_xvid_flush(vob_t *vob)
+{
+ int bytes = 0, ret = TC_EXPORT_OK;
+ xvid_enc_stats_t xvid_enc_stats;
+ xvid_module_t *xvid = &thismod.xvid;
+
+ do {
+ ret = TC_EXPORT_OK;
+
+ /* Init the stat structure */
+ memset(&xvid_enc_stats,0, sizeof(xvid_enc_stats_t));
+ xvid_enc_stats.version = XVID_VERSION;
+
+ set_frame_struct(&thismod, vob, NULL);
+
+ bytes = xvid->encore(thismod.instance, XVID_ENC_ENCODE,
+ &thismod.xvid_enc_frame, &xvid_enc_stats);
+
+ /* Extract stats info */
+ if(xvid_enc_stats.type>0 && thismod.cfg_stats) {
+ thismod.frames++;
+ thismod.sse_y += xvid_enc_stats.sse_y;
+ thismod.sse_u += xvid_enc_stats.sse_u;
+ thismod.sse_v += xvid_enc_stats.sse_v;
+ }
+
+ if (bytes > 0) {
+ ret = tc_xvid_write(bytes, vob);
+ }
+ } while (bytes > 0 && ret == TC_EXPORT_OK);
+ return ret;
+}
+
+
+MOD_close
+{
+ vob_t *vob = tc_get_vob();
+
+ /* Audio file closing */
+ if(param->flag == TC_AUDIO)
+ return(tc_audio_close());
+
+ if(param->flag == TC_VIDEO) {
+ int ret = tc_xvid_flush(vob);
+ if (ret == TC_EXPORT_OK) {
+ /* Video file closing */
+ if(thismod.rawfd >= 0) {
+ close(thismod.rawfd);
+ thismod.rawfd = -1;
+ }
+ if(vob->avifile_out != NULL) {
+ AVI_close(vob->avifile_out);
+ vob->avifile_out = NULL;
+ }
+ return(TC_EXPORT_OK);
+ }
+ /* fallback to EXPORT_ERROR */
+ }
+ return(TC_EXPORT_ERROR);
+}
+
+
+/*****************************************************************************
+ * Stop encoder
+ ****************************************************************************/
+
+#define SSE2PSNR(sse, width, height) \
+((!(sse)) ? (99.0f) : (48.131f - 10*(float)log10((float)(sse)/((float)((width)*(height))))))
+
+MOD_stop
+{
+ int ret;
+ xvid_module_t *xvid = &thismod.xvid;
+
+ /* Invalid flag */
+ if(param->flag != TC_AUDIO && param->flag != TC_VIDEO)
+ return(TC_EXPORT_ERROR);
+
+ /* Audio codec stoping */
+ if(param->flag == TC_AUDIO)
+ return(tc_audio_stop());
+
+ /* Video codec stoping */
+
+ /* ToDo: Can we flush the last frames here ? */
+
+ /* Destroy the encoder instance */
+ ret = xvid->encore(thismod.instance, XVID_ENC_DESTROY, NULL, NULL);
+ if(ret < 0) {
+ tc_log_warn(MOD_NAME, "Encoder instance releasing failed");
+ return(TC_EXPORT_ERROR);
+ }
+
+ /* Unload the shared symbols/lib */
+ unload_xvid(xvid);
+
+ /* Free all dynamic memory allocated in the module structure */
+ free_module(&thismod);
+
+ /* Print stats before resting the complete module structure */
+ if(thismod.cfg_stats) {
+ if(thismod.frames) {
+ thismod.sse_y /= thismod.frames;
+ thismod.sse_u /= thismod.frames;
+ thismod.sse_v /= thismod.frames;
+ } else {
+ thismod.sse_y = 0;
+ thismod.sse_u = 0;
+ thismod.sse_v = 0;
+ }
+
+ tc_log_info(MOD_NAME,
+ "psnr y = %.2f dB, "
+ "psnr u = %.2f dB, "
+ "psnr v = %.2f dB",
+ SSE2PSNR(thismod.sse_y,
+ thismod.xvid_enc_create.width,
+ thismod.xvid_enc_create.height),
+ SSE2PSNR(thismod.sse_u,
+ thismod.xvid_enc_create.width/2,
+ thismod.xvid_enc_create.height/2),
+ SSE2PSNR(thismod.sse_v,
+ thismod.xvid_enc_create.width/2,
+ thismod.xvid_enc_create.height/2));
+ }
+
+ /* This is the last function according to the transcode API
+ * this should be safe to reset the module structure */
+ reset_module(&thismod);
+
+ return(TC_EXPORT_OK);
+}
+#undef SSE2PSNR
+
+/*****************************************************************************
+ * Transcode module helper functions
+ ****************************************************************************/
+
+static void reset_module(xvid_transcode_module_t *mod)
+{
+ memset(mod, 0, sizeof(xvid_transcode_module_t));
+
+ /* This file descriptor is used as a flag
+ * < 0 means AVI output (invalid descriptor)
+ * >= 0 means Raw output (valid descriptor) */
+ mod->rawfd = -1;
+
+ /* Default options */
+ mod->cfg_packed = 0;
+ mod->cfg_closed_gop = 1;
+ mod->cfg_interlaced = 0;
+ mod->cfg_quarterpel = 0;
+ mod->cfg_gmc = 0;
+ mod->cfg_trellis = 0;
+ mod->cfg_cartoon = 0;
+ mod->cfg_hqacpred = 1;
+ mod->cfg_chromame = 1;
+ mod->cfg_vhq = 1;
+ mod->cfg_motion = 6;
+ mod->cfg_turbo = 0;
+ mod->cfg_full1pass = 0;
+ mod->cfg_stats = 0;
+ mod->cfg_greyscale = 0;
+ mod->cfg_quant_method = tc_strdup("h263");
+ mod->cfg_create.max_bframes = 1;
+ mod->cfg_create.bquant_ratio = 150;
+ mod->cfg_create.bquant_offset = 100;
+
+ return;
+}
+
+static void free_module(xvid_transcode_module_t *mod)
+{
+
+ /* Free tcvideo handle */
+ tcv_free(thismod.tcvhandle);
+ thismod.tcvhandle = 0;
+
+ /* Release stream buffer memory */
+ if(mod->stream) {
+ free(mod->stream);
+ mod->stream = NULL;
+ }
+
+ /* Release the quant method string */
+ if(mod->cfg_quant_method) {
+ free(thismod.cfg_quant_method);
+ thismod.cfg_quant_method = NULL;
+ }
+
+ /* Release the matrix file name string */
+ if(mod->cfg_inter_matrix_file) {
+ free(mod->cfg_inter_matrix_file);
+ mod->cfg_inter_matrix_file = NULL;
+ }
+
+ /* Release the matrix definition */
+ if(mod->cfg_frame.quant_inter_matrix) {
+ free(mod->cfg_frame.quant_inter_matrix);
+ mod->cfg_frame.quant_inter_matrix = NULL;
+ }
+
+ /* Release the matrix file name string */
+ if(mod->cfg_intra_matrix_file) {
+ free(mod->cfg_intra_matrix_file);
+ mod->cfg_intra_matrix_file = NULL;
+ }
+
+ /* Release the matrix definition */
+ if(mod->cfg_frame.quant_intra_matrix) {
+ free(mod->cfg_frame.quant_intra_matrix);
+ mod->cfg_frame.quant_intra_matrix = NULL;
+ }
+
+ return;
+}
+
+/*****************************************************************************
+ * Configuration functions
+ *
+ * They fill the .cfg_xxx members of the module structure.
+ * - read_config_file reads the values from the config file and sets .cfg_xxx
+ * members of the module structure.
+ * - dispatch_settings uses the values retrieved by read_config_file and
+ * turns them into XviD settings in the cfg_xxx xvid structure available
+ * in the module structure.
+ * - set_create_struct sets a xvid_enc_create structure according to the
+ * settings generated by the two previous functions calls.
+ * - set_frame_struct same as above for a xvid_enc_frame_t struct.
+ ****************************************************************************/
+
+static void read_config_file(xvid_transcode_module_t *mod)
+{
+ xvid_plugin_single_t *onepass = &mod->cfg_onepass;
+ xvid_plugin_2pass2_t *pass2 = &mod->cfg_pass2;
+ xvid_enc_create_t *create = &mod->cfg_create;
+ xvid_enc_frame_t *frame = &mod->cfg_frame;
+
+ TCConfigEntry complete_config[] =
+ {
+ /* Section [features] */
+// {"features", "Feature settings", TCCONF_TYPE_SECTION, 0, 0, 0},
+ {"quant_type", &mod->cfg_quant_method, TCCONF_TYPE_STRING, 0, 0, 0},
+ {"motion", &mod->cfg_motion, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 6},
+ {"chromame", &mod->cfg_chromame, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"vhq", &mod->cfg_vhq, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 4},
+ {"max_bframes", &create->max_bframes, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 20},
+ {"bquant_ratio", &create->bquant_ratio, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 200},
+ {"bquant_offset", &create->bquant_offset, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 200},
+ {"bframe_threshold", &frame->bframe_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -255, 255},
+ {"quarterpel", &mod->cfg_quarterpel, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"gmc", &mod->cfg_gmc, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"trellis", &mod->cfg_trellis, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"packed", &mod->cfg_packed, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"closed_gop", &mod->cfg_closed_gop, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"interlaced", &mod->cfg_interlaced, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"cartoon", &mod->cfg_cartoon, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"hqacpred", &mod->cfg_hqacpred, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"frame_drop_ratio", &create->frame_drop_ratio, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100},
+ {"stats", &mod->cfg_stats, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"greyscale", &mod->cfg_greyscale, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"turbo", &mod->cfg_turbo, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"full1pass", &mod->cfg_full1pass, TCCONF_TYPE_FLAG, 0, 0, 1},
+
+ /* section [quantizer] */
+// {"quantizer", "Quantizer settings", TCCONF_TYPE_SECTION, 0, 0, 0},
+ {"min_iquant", &create->min_quant[0], TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
+ {"max_iquant", &create->max_quant[0], TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
+ {"min_pquant", &create->min_quant[1], TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
+ {"max_pquant", &create->max_quant[1], TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
+ {"min_bquant", &create->min_quant[2], TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
+ {"max_bquant", &create->max_quant[2], TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
+ {"quant_intra_matrix", &mod->cfg_intra_matrix_file, TCCONF_TYPE_STRING, 0, 0, 100},
+ {"quant_inter_matrix", &mod->cfg_inter_matrix_file, TCCONF_TYPE_STRING, 0, 0, 100},
+
+ /* section [cbr] */
+// {"cbr", "CBR settings", TCCONF_TYPE_SECTION, 0, 0, 0},
+ {"reaction_delay_factor", &onepass->reaction_delay_factor, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100},
+ {"averaging_period", &onepass->averaging_period, TCCONF_TYPE_INT, TCCONF_FLAG_MIN, 0, 0},
+ {"buffer", &onepass->buffer, TCCONF_TYPE_INT, TCCONF_FLAG_MIN, 0, 0},
+
+ /* section [vbr] */
+// {"vbr", "VBR settings", TCCONF_TYPE_SECTION, 0, 0, 0},
+ {"keyframe_boost", &pass2->keyframe_boost, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100},
+ {"curve_compression_high", &pass2->curve_compression_high, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100},
+ {"curve_compression_low", &pass2->curve_compression_low, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100},
+ {"overflow_control_strength", &pass2->overflow_control_strength, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100},
+ {"max_overflow_improvement", &pass2->max_overflow_improvement, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100},
+ {"max_overflow_degradation", &pass2->max_overflow_degradation, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100},
+ {"kfreduction", &pass2->kfreduction, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100},
+ {"kfthreshold", &pass2->kfthreshold, TCCONF_TYPE_INT, TCCONF_FLAG_MIN, 0, 0},
+ {"container_frame_overhead", &pass2->container_frame_overhead, TCCONF_TYPE_INT, TCCONF_FLAG_MIN, 0, 0},
+
+ /* End of the config file */
+ {NULL, 0, 0, 0, 0, 0}
+ };
+
+ /* Read the values */
+ module_read_config("xvid4.cfg", NULL, complete_config, MOD_NAME);
+
+ /* Print the values */
+ if(verbose_flag & TC_DEBUG)
+ module_print_config(complete_config, MOD_NAME);
+
+ return;
+}
+
+static void *read_matrix(const char *filename);
+static void print_matrix(unsigned char *matrix);
+
+static void dispatch_settings(xvid_transcode_module_t *mod)
+{
+
+ xvid_enc_create_t *create = &mod->cfg_create;
+ xvid_enc_frame_t *frame = &mod->cfg_frame;
+
+ const int motion_presets[7] =
+ {
+ 0,
+ 0,
+ 0,
+ 0,
+ XVID_ME_HALFPELREFINE16,
+ XVID_ME_HALFPELREFINE16 | XVID_ME_ADVANCEDDIAMOND16,
+ XVID_ME_HALFPELREFINE16 | XVID_ME_EXTSEARCH16 |
+ XVID_ME_HALFPELREFINE8 | XVID_ME_USESQUARES16
+ };
+
+
+ /* Dispatch all settings having an impact on the "create" structure */
+ create->global = 0;
+
+ if(mod->cfg_packed)
+ create->global |= XVID_GLOBAL_PACKED;
+
+ if(mod->cfg_closed_gop)
+ create->global |= XVID_GLOBAL_CLOSED_GOP;
+
+ if(mod->cfg_stats)
+ create->global |= XVID_GLOBAL_EXTRASTATS_ENABLE;
+
+ /* Dispatch all settings having an impact on the "frame" structure */
+ frame->vol_flags = 0;
+ frame->vop_flags = 0;
+ frame->motion = 0;
+
+ frame->vop_flags |= XVID_VOP_HALFPEL;
+ frame->motion |= motion_presets[mod->cfg_motion];
+
+ if(mod->cfg_stats)
+ frame->vol_flags |= XVID_VOL_EXTRASTATS;
+
+ if(mod->cfg_greyscale)
+ frame->vop_flags |= XVID_VOP_GREYSCALE;
+
+ if(mod->cfg_cartoon) {
+ frame->vop_flags |= XVID_VOP_CARTOON;
+ frame->motion |= XVID_ME_DETECT_STATIC_MOTION;
+ }
+
+ if(mod->cfg_intra_matrix_file) {
+ frame->quant_intra_matrix = (unsigned char*)read_matrix(mod->cfg_intra_matrix_file);
+ if(frame->quant_intra_matrix != NULL) {
+ tc_log_info(MOD_NAME, "Loaded Intra matrix (switching to mpeg quantization type)");
+ print_matrix(frame->quant_intra_matrix);
+ free(mod->cfg_quant_method);
+ mod->cfg_quant_method = tc_strdup("mpeg");
+ }
+ }
+ if(mod->cfg_inter_matrix_file) {
+ frame->quant_inter_matrix = read_matrix(mod->cfg_inter_matrix_file);
+ if(frame->quant_inter_matrix) {
+ tc_log_info(MOD_NAME, "Loaded Inter matrix (switching to mpeg quantization type)");
+ print_matrix(frame->quant_inter_matrix);
+ free(mod->cfg_quant_method);
+ mod->cfg_quant_method = tc_strdup("mpeg");
+ }
+ }
+ if(!strcasecmp(mod->cfg_quant_method, "mpeg")) {
+ frame->vol_flags |= XVID_VOL_MPEGQUANT;
+ }
+ if(mod->cfg_quarterpel) {
+ frame->vol_flags |= XVID_VOL_QUARTERPEL;
+ frame->motion |= XVID_ME_QUARTERPELREFINE16;
+ frame->motion |= XVID_ME_QUARTERPELREFINE8;
+ }
+ if(mod->cfg_gmc) {
+ frame->vol_flags |= XVID_VOL_GMC;
+ frame->motion |= XVID_ME_GME_REFINE;
+ }
+ if(mod->cfg_interlaced) {
+ frame->vol_flags |= XVID_VOL_INTERLACING;
+ }
+ if(mod->cfg_trellis) {
+ frame->vop_flags |= XVID_VOP_TRELLISQUANT;
+ }
+ if(mod->cfg_hqacpred) {
+ frame->vop_flags |= XVID_VOP_HQACPRED;
+ }
+ if(mod->cfg_motion > 4) {
+ frame->vop_flags |= XVID_VOP_INTER4V;
+ }
+ if(mod->cfg_chromame) {
+ frame->motion |= XVID_ME_CHROMA_PVOP;
+ frame->motion |= XVID_ME_CHROMA_BVOP;
+ }
+ if(mod->cfg_vhq >= 1) {
+ frame->vop_flags |= XVID_VOP_MODEDECISION_RD;
+ }
+ if(mod->cfg_vhq >= 2) {
+ frame->motion |= XVID_ME_HALFPELREFINE16_RD;
+ frame->motion |= XVID_ME_QUARTERPELREFINE16_RD;
+ }
+ if(mod->cfg_vhq >= 3) {
+ frame->motion |= XVID_ME_HALFPELREFINE8_RD;
+ frame->motion |= XVID_ME_QUARTERPELREFINE8_RD;
+ frame->motion |= XVID_ME_CHECKPREDICTION_RD;
+ }
+ if(mod->cfg_vhq >= 4) {
+ frame->motion |= XVID_ME_EXTSEARCH_RD;
+ }
+ if (mod->cfg_turbo) {
+ frame->motion |= XVID_ME_FASTREFINE16;
+ frame->motion |= XVID_ME_FASTREFINE8;
+ frame->motion |= XVID_ME_SKIP_DELTASEARCH;
+ frame->motion |= XVID_ME_FAST_MODEINTERPOLATE;
+ frame->motion |= XVID_ME_BFRAME_EARLYSTOP;
+ }
+
+ /* motion level == 0 means no motion search which is equivalent to
+ * intra coding only */
+ if(mod->cfg_motion == 0) {
+ frame->type = XVID_TYPE_IVOP;
+ } else {
+ frame->type = XVID_TYPE_AUTO;
+ }
+
+ return;
+}
+
+static void set_create_struct(xvid_transcode_module_t *mod, vob_t *vob)
+{
+ xvid_enc_create_t *x = &mod->xvid_enc_create;
+ xvid_enc_create_t *xcfg = &mod->cfg_create;
+ xvid_module_t *xvid = &mod->xvid;
+
+ memset(x, 0, sizeof(xvid_enc_create_t));
+ x->version = XVID_VERSION;
+
+ /* Global encoder options */
+ x->global = xcfg->global;
+
+ /* Width and Height */
+ x->width = vob->ex_v_width;
+ x->height = vob->ex_v_height;
+
+ /* Max keyframe interval */
+ x->max_key_interval = vob->divxkeyframes;
+
+ /* FPS : we take care of non integer values */
+ if((vob->ex_fps - (int)vob->ex_fps) == 0) {
+ x->fincr = 1;
+ x->fbase = (int)vob->ex_fps;
+ } else {
+ x->fincr = 1001;
+ x->fbase = (int)(1001 * vob->ex_fps);
+ }
+
+ /* BFrames settings */
+ x->max_bframes = xcfg->max_bframes;
+ x->bquant_ratio = xcfg->bquant_ratio;
+ x->bquant_offset = xcfg->bquant_offset;
+
+ /* Frame dropping factor */
+ x->frame_drop_ratio = xcfg->frame_drop_ratio;
+
+ /* Quantizers */
+ x->min_quant[0] = xcfg->min_quant[0];
+ x->min_quant[1] = xcfg->min_quant[1];
+ x->min_quant[2] = xcfg->min_quant[2];
+ x->max_quant[0] = xcfg->max_quant[0];
+ x->max_quant[1] = xcfg->max_quant[1];
+ x->max_quant[2] = xcfg->max_quant[2];
+
+ /* Encodings zones
+ * ToDo?: Allow zones definitions */
+ memset(mod->zones, 0, sizeof(mod->zones));
+ x->zones = mod->zones;
+
+ if (1 == vob->divxmultipass && mod->cfg_full1pass)
+ {
+ x->zones[0].frame = 0;
+ x->zones[0].mode = XVID_ZONE_QUANT;
+ x->zones[0].increment = 200;
+ x->zones[0].base = 100;
+ x->num_zones = 1;
+ } else {
+ x->num_zones = 0;
+ }
+
+ /* Plugins */
+ memset(mod->plugins, 0, sizeof(mod->plugins));
+ x->plugins = mod->plugins;
+ x->num_plugins = 0;
+
+ /* Initialize rate controller plugin */
+
+ /* This is the first pass of a Two pass process */
+ if(vob->divxmultipass == 1) {
+ xvid_plugin_2pass1_t *pass1 = &mod->pass1;
+
+ if(xvid->plugin_twopass1 == NULL) {
+ tc_log_warn(MOD_NAME, "Two Pass #1 bitrate controller plugin not available");
+ return;
+ }
+
+ memset(pass1, 0, sizeof(xvid_plugin_2pass1_t));
+ pass1->version = XVID_VERSION;
+ pass1->filename = vob->divxlogfile;
+
+ x->plugins[x->num_plugins].func = xvid->plugin_twopass1;
+ x->plugins[x->num_plugins].param = pass1;
+ x->num_plugins++;
+ }
+
+ /* This is the second pass of a Two pass process */
+ if(vob->divxmultipass == 2) {
+ xvid_plugin_2pass2_t *pass2 = &mod->pass2;
+ xvid_plugin_2pass2_t *pass2cfg = &mod->cfg_pass2;
+
+ if(xvid->plugin_twopass2 == NULL) {
+ tc_log_warn(MOD_NAME, "Two Pass #2 bitrate controller plugin not available");
+ return;
+ }
+
+ memset(pass2, 0, sizeof(xvid_plugin_2pass2_t));
+ pass2->version = XVID_VERSION;
+ pass2->filename = vob->divxlogfile;
+
+ /* Apply config file settings if any, or all 0s which lets XviD
+ * apply its defaults */
+ pass2->keyframe_boost = pass2cfg->keyframe_boost;
+ pass2->curve_compression_high = pass2cfg->curve_compression_high;
+ pass2->curve_compression_low = pass2cfg->curve_compression_low;
+ pass2->overflow_control_strength = pass2cfg->overflow_control_strength;
+ pass2->max_overflow_improvement = pass2cfg->max_overflow_improvement;
+ pass2->max_overflow_degradation = pass2cfg->max_overflow_degradation;
+ pass2->kfreduction = pass2cfg->kfreduction;
+ pass2->kfthreshold = pass2cfg->kfthreshold;
+ pass2->container_frame_overhead = pass2cfg->container_frame_overhead;
+
+ /* Positive bitrate values are bitrates as usual but if the
+ * value is negative it is considered as being a total size
+ * to reach (in kilobytes) */
+ if(vob->divxbitrate > 0)
+ pass2->bitrate = vob->divxbitrate*1000;
+ else
+ pass2->bitrate = vob->divxbitrate;
+
+ x->plugins[x->num_plugins].func = xvid->plugin_twopass2;
+ x->plugins[x->num_plugins].param = pass2;
+ x->num_plugins++;
+ }
+
+ /* This is a single pass encoding: either a CBR pass or a constant
+ * quantizer pass */
+ if(vob->divxmultipass == 0 || vob->divxmultipass == 3) {
+ xvid_plugin_single_t *onepass = &mod->onepass;
+ xvid_plugin_single_t *cfgonepass = &mod->cfg_onepass;
+
+ if(xvid->plugin_onepass == NULL) {
+ tc_log_warn(MOD_NAME, "One Pass bitrate controller plugin not available");
+ return;
+ }
+
+ memset(onepass, 0, sizeof(xvid_plugin_single_t));
+ onepass->version = XVID_VERSION;
+ onepass->bitrate = vob->divxbitrate*1000;
+
+ /* Apply config file settings if any, or all 0s which lets XviD
+ * apply its defaults */
+ onepass->reaction_delay_factor = cfgonepass->reaction_delay_factor;
+ onepass->averaging_period = cfgonepass->averaging_period;
+ onepass->buffer = cfgonepass->buffer;
+
+ /* Quantizer mode uses the same plugin, we have only to define
+ * a constant quantizer zone beginning at frame 0 */
+ if(vob->divxmultipass == 3) {
+ x->zones[x->num_zones].mode = XVID_ZONE_QUANT;
+ x->zones[x->num_zones].frame = 1;
+ x->zones[x->num_zones].increment = vob->divxbitrate;
+ x->zones[x->num_zones].base = 1;
+ x->num_zones++;
+ }
+
+
+ x->plugins[x->num_plugins].func = xvid->plugin_onepass;
+ x->plugins[x->num_plugins].param = onepass;
+ x->num_plugins++;
+ }
+
+ return;
+}
+
+static void set_frame_struct(xvid_transcode_module_t *mod, vob_t *vob, transfer_t *t)
+{
+ xvid_enc_frame_t *x = &mod->xvid_enc_frame;
+ xvid_enc_frame_t *xcfg = &mod->cfg_frame;
+
+ memset(x, 0, sizeof(xvid_enc_frame_t));
+ x->version = XVID_VERSION;
+
+ /* Bind output buffer */
+ x->bitstream = mod->stream;
+
+ if (t == NULL) {
+ x->length = -1;
+ x->input.csp = XVID_CSP_NULL;
+ x->input.plane[0] = NULL;
+// x->input.plane[1] = NULL;
+// x->input.plane[2] = NULL;
+ x->input.stride[0] = 0;
+// x->input.stride[1] = 0;
+// x->input.stride[2] = 0;
+ } else {
+ x->length = mod->stream_size;
+
+ /* Bind source frame */
+ x->input.plane[0] = t->buffer;
+ if(vob->im_v_codec == CODEC_RGB) {
+ x->input.csp = XVID_CSP_BGR;
+ x->input.stride[0] = vob->ex_v_width*3;
+ } else if (vob->im_v_codec == CODEC_YUV422) {
+ x->input.csp = XVID_CSP_UYVY;
+ x->input.stride[0] = vob->ex_v_width*2;
+ } else {
+ x->input.csp = XVID_CSP_I420;
+ x->input.stride[0] = vob->ex_v_width;
+ }
+ }
+
+ /* Set up core's VOL level features */
+ x->vol_flags = xcfg->vol_flags;
+
+ /* Set up core's VOP level features */
+ x->vop_flags = xcfg->vop_flags;
+
+ /* Frame type -- let core decide for us */
+ x->type = xcfg->type;
+
+ /* Force the right quantizer -- It is internally managed by RC
+ * plugins */
+ x->quant = 0;
+
+ /* Set up motion estimation flags */
+ x->motion = xcfg->motion;
+
+ /* We don't use special matrices */
+ x->quant_intra_matrix = xcfg->quant_intra_matrix;
+ x->quant_inter_matrix = xcfg->quant_inter_matrix;
+
+ /* pixel aspect ratio
+ * transcode.c uses 0 for EXT instead of 15 */
+ if ((vob->ex_par==0) &&
+ (vob->ex_par_width==1) && (vob->ex_par_height==1))
+ vob->ex_par = 1;
+
+ x->par = (vob->ex_par==0)? XVID_PAR_EXT: vob->ex_par;
+ x->par_width = vob->ex_par_width;
+ x->par_height = vob->ex_par_height;
+
+ return;
+}
+
+/*****************************************************************************
+ * Returns an error string corresponding to the XviD err code
+ ****************************************************************************/
+
+static const char *errorstring(int err)
+{
+ char *error;
+ switch(err) {
+ case XVID_ERR_FAIL:
+ error = "General fault";
+ break;
+ case XVID_ERR_MEMORY:
+ error = "Memory allocation error";
+ break;
+ case XVID_ERR_FORMAT:
+ error = "File format error";
+ break;
+ case XVID_ERR_VERSION:
+ error = "Structure version not supported";
+ break;
+ case XVID_ERR_END:
+ error = "End of stream reached";
+ break;
+ default:
+ error = "Unknown";
+ }
+
+ return((const char *)error);
+}
+
+/*****************************************************************************
+ * Read and print a matrix file
+ ****************************************************************************/
+
+static void *read_matrix(const char *filename)
+{
+ int i;
+ unsigned char *matrix;
+ FILE *input;
+
+ /* Allocate matrix space */
+ if((matrix = malloc(64*sizeof(unsigned char))) == NULL)
+ return(NULL);
+
+ /* Open the matrix file */
+ if((input = fopen(filename, "rb")) == NULL) {
+ tc_log_warn(MOD_NAME,
+ "Error opening the matrix file %s",
+ filename);
+ free(matrix);
+ return(NULL);
+ }
+
+ /* Read the matrix */
+ for(i=0; i<64; i++) {
+
+ int value;
+
+ /* If fscanf fails then get out of the loop */
+ if(fscanf(input, "%d", &value) != 1) {
+ tc_log_warn(MOD_NAME,
+ "Error reading the matrix file %s",
+ filename);
+ free(matrix);
+ fclose(input);
+ return(NULL);
+ }
+
+ /* Clamp the value to safe range */
+ value = (value< 1)?1 :value;
+ value = (value>255)?255:value;
+ matrix[i] = value;
+ }
+
+ /* Fills the rest with 1 */
+ while(i<64) matrix[i++] = 1;
+
+ /* We're done */
+ fclose(input);
+
+ return(matrix);
+
+}
+
+static void print_matrix(unsigned char *matrix)
+{
+ int i;
+ for(i=0; i < 64; i+=8) {
+ tc_log_info(MOD_NAME,
+ "%3d %3d %3d %3d "
+ "%3d %3d %3d %3d",
+ (int)matrix[i], (int)matrix[i+1],
+ (int)matrix[i+2], (int)matrix[i+3],
+ (int)matrix[i+4], (int)matrix[i+5],
+ (int)matrix[i+6], (int)matrix[i+7]);
+ }
+
+ return;
+}
+
+/*****************************************************************************
+ * Un/Loading XviD shared lib and symbols
+ ****************************************************************************/
+
+static int load_xvid(xvid_module_t *xvid, const char *path)
+{
+ const char *error;
+ char soname[4][4096];
+ int i;
+
+ /* Reset pointers */
+ memset(xvid, 0, sizeof(xvid[0]));
+
+ /* First we build all sonames we will try to load */
+#ifdef OS_DARWIN
+ tc_snprintf(soname[0], 4095, "%s/%s.%d.%s", path, XVID_SHARED_LIB_BASE,
+ XVID_API_MAJOR(XVID_API), XVID_SHARED_LIB_SUFX);
+#else
+ tc_snprintf(soname[0], 4095, "%s/%s.%s.%d", path, XVID_SHARED_LIB_BASE,
+ XVID_SHARED_LIB_SUFX, XVID_API_MAJOR(XVID_API));
+#endif
+#ifdef OS_DARWIN
+ tc_snprintf(soname[1], 4095, "%s.%d.%s", XVID_SHARED_LIB_BASE,
+ XVID_API_MAJOR(XVID_API), XVID_SHARED_LIB_SUFX);
+#else
+ tc_snprintf(soname[1], 4095, "%s.%s.%d", XVID_SHARED_LIB_BASE,
+ XVID_SHARED_LIB_SUFX, XVID_API_MAJOR(XVID_API));
+#endif
+ tc_snprintf(soname[2], 4095, "%s/%s.%s", path, XVID_SHARED_LIB_BASE,
+ XVID_SHARED_LIB_SUFX);
+ tc_snprintf(soname[3], 4095, "%s.%s", XVID_SHARED_LIB_BASE,
+ XVID_SHARED_LIB_SUFX);
+
+ /* Let's try each shared lib until success */
+ for(i=0; i<4; i++) {
+ if(verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME, "Trying to load shared lib %s",
+ soname[i]);
+
+ /* Try loading the shared lib */
+ xvid->so = dlopen(soname[i], RTLD_GLOBAL| RTLD_LAZY);
+
+ /* Test wether loading succeeded */
+ if(xvid->so != NULL)
+ break;
+ }
+
+ /* None of the modules were available */
+ if(xvid->so == NULL) {
+ tc_log_warn(MOD_NAME, "No libxvidcore API4 found");
+ return(-1);
+ }
+
+ if(verbose_flag & TC_DEBUG)
+ tc_log_info(MOD_NAME, "Loaded %s", soname[i]);
+
+ /* Next step is to load xvidcore symbols
+ *
+ * Some of them are mandatory, others like plugins can be safely
+ * ignored if they are not available, this will just restrict user
+ * available functionnality -- Up to the upper layer to handle these
+ * functionnality restrictions */
+
+ /* Mandatory symbol */
+ xvid->global = dlsym(xvid->so, "xvid_global");
+
+ if(xvid->global == NULL && (error = dlerror()) != NULL) {
+ tc_log_warn(MOD_NAME, "Error loading symbol (%s)", error);
+ tc_log_warn(MOD_NAME, "Library \"%s\" looks like an old "
+ "version of libxvidcore", soname[i]);
+ tc_log_warn(MOD_NAME, "You cannot use this module with this"
+ " lib; maybe -y xvid2 works");
+ return(-1);
+ }
+
+ /* Mandatory symbol */
+ xvid->encore = dlsym(xvid->so, "xvid_encore");
+
+ if(xvid->encore == NULL && (error = dlerror()) != NULL) {
+ tc_log_warn(MOD_NAME, "Error loading symbol (%s)", error);
+ return(-1);
+ }
+
+ /* Optional plugin symbols */
+ xvid->plugin_onepass = dlsym(xvid->so, "xvid_plugin_single");
+ xvid->plugin_twopass1 = dlsym(xvid->so, "xvid_plugin_2pass1");
+ xvid->plugin_twopass2 = dlsym(xvid->so, "xvid_plugin_2pass2");
+ xvid->plugin_lumimasking = dlsym(xvid->so, "xvid_plugin_lumimasking");
+
+ return(0);
+}
+
+static int unload_xvid(xvid_module_t *xvid)
+{
+ if(xvid->so != NULL) {
+ dlclose(xvid->so);
+ memset(xvid, 0, sizeof(xvid[0]));
+ }
+
+ return(0);
+}
+
+/*
+ * Please do not modify the tag line.
+ *
+ * arch-tag: 16c618a5-6cda-4c95-a418-602fc4837824 export_xvid module
+ */
diff --git a/debian/transcode/transcode-1.1.7/export/export_yuv4mpeg.c b/debian/transcode/transcode-1.1.7/export/export_yuv4mpeg.c
new file mode 100644
index 00000000..ce0c56a9
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/export_yuv4mpeg.c
@@ -0,0 +1,266 @@
+/*
+ * export_yuv4mpeg.c
+ *
+ * Copyright (C) Thomas Oestreich - June 2001
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#define MOD_NAME "export_yuv4mpeg.so"
+#define MOD_VERSION "v0.1.10 (2006-10-06)"
+#define MOD_CODEC "(video) YUV4MPEG2 | (audio) MPEG/AC3/PCM"
+
+#include "transcode.h"
+#include "libtc/libtc.h"
+#include "libtcvideo/tcvideo.h"
+#include "aud_aux.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+static int verbose_flag=TC_QUIET;
+static int capability_flag=TC_CAP_YUV|TC_CAP_PCM|TC_CAP_AC3|TC_CAP_AUD|TC_CAP_RGB;
+
+#define MOD_PRE yuv4mpeg
+#include "export_def.h"
+
+#if defined(HAVE_MJPEGTOOLS_INC)
+#include "yuv4mpeg.h"
+#include "mpegconsts.h"
+#else
+#include "mjpegtools/yuv4mpeg.h"
+#include "mjpegtools/mpegconsts.h"
+#endif
+
+#ifndef DAR_4_3
+# define DAR_4_3 { 4, 3 }
+# define DAR_16_9 { 16, 9 }
+# define DAR_221_100 { 221, 100 }
+# define SAR_UNKNOWN { 0, 0 }
+#endif
+
+static const y4m_ratio_t dar_4_3 = DAR_4_3;
+static const y4m_ratio_t dar_16_9 = DAR_16_9;
+static const y4m_ratio_t dar_221_100 = DAR_221_100;
+static const y4m_ratio_t sar_UNKNOWN = SAR_UNKNOWN;
+
+
+static int fd, size;
+static TCVHandle tcvhandle = 0;
+static ImageFormat srcfmt;
+
+static y4m_stream_info_t y4mstream;
+
+
+MOD_init
+{
+ if (param->flag == TC_VIDEO) {
+ if (vob->im_v_codec == CODEC_YUV) {
+ srcfmt = IMG_YUV_DEFAULT;
+ } else if (vob->im_v_codec == CODEC_YUV422) {
+ srcfmt = IMG_YUV422P;
+ } else if (vob->im_v_codec == CODEC_RGB) {
+ srcfmt = IMG_RGB_DEFAULT;
+ } else {
+ tc_log_warn(MOD_NAME, "unsupported video format %d",
+ vob->im_v_codec);
+ return TC_EXPORT_ERROR;
+ }
+ tcvhandle = tcv_init();
+ if (!tcvhandle) {
+ tc_log_warn(MOD_NAME, "image conversion init failed");
+ return TC_EXPORT_ERROR;
+ }
+
+ return TC_EXPORT_OK;
+ }
+
+ if (param->flag == TC_AUDIO) {
+ tc_log_warn(MOD_NAME, "Usage of this module for audio encoding is deprecated.");
+ tc_log_warn(MOD_NAME, "Consider switch to export_tcaud module.");
+ return tc_audio_init(vob, verbose_flag);
+ }
+
+ return TC_EXPORT_ERROR;
+}
+
+static void asrcode2asrratio(int asr, y4m_ratio_t *r)
+{
+ switch (asr) {
+ case 2: *r = dar_4_3; break;
+ case 3: *r = dar_16_9; break;
+ case 4: *r = dar_221_100; break;
+ case 1: r->n = 1; r->d = 1; break;
+ case 0: default: *r = sar_UNKNOWN; break;
+ }
+}
+
+
+MOD_open
+{
+ if (param->flag == TC_VIDEO) {
+ int asr, ret;
+ // char dar_tag[20];
+ y4m_ratio_t framerate;
+ y4m_ratio_t asr_rate;
+
+ //note: this is the real framerate of the raw stream
+ framerate = (vob->ex_frc == 0)
+ ?mpeg_conform_framerate(vob->ex_fps)
+ :mpeg_framerate(vob->ex_frc);
+ if (framerate.n == 0 && framerate.d == 0) {
+ framerate.n = vob->ex_fps*1000;
+ framerate.d = 1000;
+ }
+
+ asr = (vob->ex_asr<0) ?vob->im_asr :vob->ex_asr;
+ asrcode2asrratio(asr, &asr_rate);
+
+ y4m_init_stream_info(&y4mstream);
+ y4m_si_set_framerate(&y4mstream, framerate);
+ if (vob->encode_fields == TC_ENCODE_FIELDS_TOP_FIRST) {
+ y4m_si_set_interlace(&y4mstream, Y4M_ILACE_TOP_FIRST);
+ } else if (vob->encode_fields == TC_ENCODE_FIELDS_BOTTOM_FIRST) {
+ y4m_si_set_interlace(&y4mstream, Y4M_ILACE_BOTTOM_FIRST);
+ } else if (vob->encode_fields == TC_ENCODE_FIELDS_PROGRESSIVE) {
+ y4m_si_set_interlace(&y4mstream, Y4M_ILACE_NONE);
+ }
+ y4m_si_set_sampleaspect(&y4mstream, y4m_guess_sar(vob->ex_v_width, vob->ex_v_height, asr_rate));
+ /*
+ tc_snprintf( dar_tag, 19, "XM2AR%03d", asr );
+ y4m_xtag_add( y4m_si_xtags(&y4mstream), dar_tag );
+ */
+ y4m_si_set_height(&y4mstream, vob->ex_v_height);
+ y4m_si_set_width(&y4mstream, vob->ex_v_width);
+ y4m_si_set_chroma(&y4mstream, Y4M_CHROMA_420JPEG); // XXX
+
+ size = vob->ex_v_width * vob->ex_v_height * 3/2;
+
+ fd = open(vob->video_out_file, O_RDWR|O_CREAT|O_TRUNC,
+ S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
+ if (fd < 0) {
+ tc_log_perror(MOD_NAME, "open file");
+ return(TC_EXPORT_ERROR);
+ }
+
+ ret = y4m_write_stream_header(fd, &y4mstream);
+ if (ret != Y4M_OK){
+ tc_log_error(MOD_NAME, "write stream header (err=%i)", ret);
+ tc_log_perror(MOD_NAME, "error");
+ return(TC_EXPORT_ERROR);
+ }
+
+ return TC_EXPORT_OK;
+ }
+
+ if (param->flag == TC_AUDIO) {
+ return tc_audio_open(vob, NULL);
+ }
+
+ return TC_EXPORT_ERROR;
+}
+
+
+MOD_encode
+{
+ if (param->flag == TC_VIDEO) {
+ vob_t *vob = tc_get_vob();
+ y4m_frame_info_t info;
+
+ if (!tcv_convert(tcvhandle, param->buffer, param->buffer,
+ vob->ex_v_width, vob->ex_v_height,
+ srcfmt, IMG_YUV420P)) {
+ tc_log_warn(MOD_NAME, "image format conversion failed");
+ return TC_EXPORT_ERROR;
+ }
+
+#ifdef USE_NEW_MJPEGTOOLS_CODE
+ y4m_init_frame_info(&info);
+
+ if (y4m_write_frame_header(fd, &y4mstream, &info) != Y4M_OK) {
+ tc_log_perror(MOD_NAME, "write frame header");
+ return TC_EXPORT_ERROR;
+ }
+#else
+ y4m_init_frame_info(&info);
+
+ if(y4m_write_frame_header(fd, &info) != Y4M_OK) {
+ tc_log_perror(MOD_NAME, "write frame header");
+ return TC_EXPORT_ERROR;
+ }
+#endif
+
+ /*
+ * do not trust param->size
+ * -- Looks like there is an outdated comment,
+ * a latent issue or both FR
+ */
+ if (tc_pwrite(fd, param->buffer, size) != size) {
+ tc_log_perror(MOD_NAME, "write frame");
+ return TC_EXPORT_ERROR;
+ }
+
+ return TC_EXPORT_OK;
+ }
+
+ if (param->flag == TC_AUDIO) {
+ return tc_audio_encode(param->buffer, param->size, NULL);
+ }
+
+ return TC_EXPORT_ERROR;
+}
+
+
+MOD_stop
+{
+ if (param->flag == TC_VIDEO) {
+ return TC_EXPORT_OK;
+ }
+ if (param->flag == TC_AUDIO) {
+ return tc_audio_stop();
+ }
+ return TC_EXPORT_ERROR;
+}
+
+
+MOD_close
+{
+ if (param->flag == TC_VIDEO) {
+ tcv_free(tcvhandle);
+ close(fd);
+ return TC_EXPORT_OK;
+ }
+
+ if (param->flag == TC_AUDIO) {
+ return tc_audio_close();
+ }
+
+ return TC_EXPORT_ERROR;
+}
+
+/*************************************************************************/
+
+/*
+ * Local variables:
+ * c-file-style: "stroustrup"
+ * c-file-offsets: ((case-label . *) (statement-case-intro . *))
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * vim: expandtab shiftwidth=4:
+ */
diff --git a/debian/transcode/transcode-1.1.7/export/ffmpeg_cfg.c b/debian/transcode/transcode-1.1.7/export/ffmpeg_cfg.c
new file mode 100644
index 00000000..0c3affcb
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/ffmpeg_cfg.c
@@ -0,0 +1,243 @@
+/* ------------------------------------------------------------
+ *
+ * read ffmpeg configuration parameters from a file
+ *
+ * ------------------------------------------------------------*/
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <string.h>
+#include <limits.h>
+
+#include "ffmpeg_cfg.h"
+
+/*
+ * Default values as taken from MPlayer's libmpcodecs/ve_lavc.c
+ */
+
+/* video options */
+//char *lavc_param_vcodec = "mpeg4";
+//int lavc_param_vbitrate = -1;
+int lavc_param_vrate_tolerance = 1000*8;
+int lavc_param_mb_decision = 0;
+int lavc_param_v4mv = 0;
+int lavc_param_vme = 4;
+//int lavc_param_vqscale = 0;
+//int lavc_param_vqmin = 2;
+//int lavc_param_vqmax = 31;
+int lavc_param_mb_qmin = 2;
+int lavc_param_mb_qmax = 31;
+int lavc_param_lmin = 2;
+int lavc_param_lmax = 31;
+int lavc_param_vqdiff = 3;
+float lavc_param_vqcompress = 0.5;
+float lavc_param_vqblur = 0.5;
+float lavc_param_vb_qfactor = 1.25;
+float lavc_param_vb_qoffset = 1.25;
+float lavc_param_vi_qfactor = 0.8;
+float lavc_param_vi_qoffset = 0.0;
+int lavc_param_vmax_b_frames = 0;
+//int lavc_param_keyint = -1;
+//int lavc_param_vpass = 0;
+int lavc_param_vrc_strategy = 2;
+int lavc_param_vb_strategy = 0;
+int lavc_param_luma_elim_threshold = 0;
+int lavc_param_chroma_elim_threshold = 0;
+int lavc_param_packet_size= 0;
+int lavc_param_strict= 0;
+int lavc_param_data_partitioning= 0;
+int lavc_param_gray=0;
+float lavc_param_rc_qsquish=1.0;
+float lavc_param_rc_qmod_amp=0;
+int lavc_param_rc_qmod_freq=0;
+char *lavc_param_rc_override_string=NULL;
+char *lavc_param_rc_eq="tex^qComp";
+int lavc_param_rc_buffer_size=0;
+float lavc_param_rc_buffer_aggressivity=1.0;
+int lavc_param_rc_max_rate=0;
+int lavc_param_rc_min_rate=0;
+float lavc_param_rc_initial_cplx=0.0;
+int lavc_param_mpeg_quant=0;
+int lavc_param_fdct=0;
+int lavc_param_idct=0;
+float lavc_param_lumi_masking= 0.0;
+float lavc_param_dark_masking= 0.0;
+float lavc_param_temporal_cplx_masking= 0.0;
+float lavc_param_spatial_cplx_masking= 0.0;
+float lavc_param_p_masking= 0.0;
+int lavc_param_normalize_aqp= 0;
+//int lavc_param_interlaced_dct= 0;
+int lavc_param_prediction_method= FF_PRED_LEFT;
+char *lavc_param_format="YV12";
+int lavc_param_debug= 0;
+int lavc_param_psnr= 0;
+int lavc_param_me_pre_cmp= 0;
+int lavc_param_me_cmp= 0;
+int lavc_param_me_sub_cmp= 0;
+int lavc_param_mb_cmp= 0;
+int lavc_param_ildct_cmp= FF_CMP_VSAD;
+int lavc_param_pre_dia_size= 0;
+int lavc_param_dia_size= 0;
+int lavc_param_qpel= 0;
+int lavc_param_trell= 0;
+int lavc_param_aic=0;
+int lavc_param_umv=0;
+int lavc_param_last_pred= 0;
+int lavc_param_pre_me= 1;
+int lavc_param_me_subpel_quality= 8;
+int lavc_param_me_range=0;
+int lavc_param_ibias=FF_DEFAULT_QUANT_BIAS;
+int lavc_param_pbias=FF_DEFAULT_QUANT_BIAS;
+int lavc_param_coder=0;
+int lavc_param_context=0;
+char *lavc_param_intra_matrix = NULL;
+char *lavc_param_inter_matrix = NULL;
+int lavc_param_cbp= 0;
+int lavc_param_mv0= 0;
+int lavc_param_noise_reduction= 0;
+int lavc_param_qp_rd= 0;
+int lavc_param_inter_threshold= 0;
+int lavc_param_sc_threshold= 0;
+int lavc_param_ss= 0;
+int lavc_param_top= -1;
+int lavc_param_alt= 0;
+int lavc_param_ilme= 0;
+
+int lavc_param_scan_offset = 0;
+int lavc_param_threads = 1;
+int lavc_param_intra_dc_precision = 0;
+int lavc_param_skip_top = 0;
+int lavc_param_fps_code = 0;
+int lavc_param_skip_bottom = 0;
+int lavc_param_closedgop = 0;
+int lavc_param_trunc = 0;
+int lavc_param_gmc = 0;
+
+//char *lavc_param_acodec = "mp2";
+//int lavc_param_atag = 0;
+//int lavc_param_abitrate = 224;
+
+char *lavc_param_video_preset = "medium";
+char *lavc_param_ffmpeg_datadir = "/usr/share/ffmpeg";
+
+TCConfigEntry lavcopts_conf[]={
+// {"acodec", &lavc_param_acodec, TCCONF_TYPE_STRING, 0, 0, 0},
+// {"abitrate", &lavc_param_abitrate, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 1000},
+// {"atag", &lavc_param_atag, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 0xffff},
+// {"vcodec", &lavc_param_vcodec, TCCONF_TYPE_STRING, 0, 0, 0},
+// {"vbitrate", &lavc_param_vbitrate, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 4, 24000000},
+ {"vratetol", &lavc_param_vrate_tolerance, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 4, 24000000},
+ {"vhq", &lavc_param_mb_decision, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"mbd", &lavc_param_mb_decision, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 9},
+ {"v4mv", &lavc_param_v4mv, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_4MV},
+ {"vme", &lavc_param_vme, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 5},
+// {"vqscale", &lavc_param_vqscale, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
+// {"vqmin", &lavc_param_vqmin, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
+// {"vqmax", &lavc_param_vqmax, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
+ {"mbqmin", &lavc_param_mb_qmin, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
+ {"mbqmax", &lavc_param_mb_qmax, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
+ {"lmin", &lavc_param_lmin, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0},
+ {"lmax", &lavc_param_lmax, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0},
+ {"vqdiff", &lavc_param_vqdiff, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
+ {"vqcomp", &lavc_param_vqcompress, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0},
+ {"vqblur", &lavc_param_vqblur, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0},
+ {"vb_qfactor", &lavc_param_vb_qfactor, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0},
+ {"vmax_b_frames", &lavc_param_vmax_b_frames, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, FF_MAX_B_FRAMES},
+// {"vpass", &lavc_param_vpass, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2},
+ {"vrc_strategy", &lavc_param_vrc_strategy, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2},
+ {"vb_strategy", &lavc_param_vb_strategy, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10},
+ {"vb_qoffset", &lavc_param_vb_qoffset, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 31.0},
+ {"vlelim", &lavc_param_luma_elim_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99},
+ {"vcelim", &lavc_param_chroma_elim_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99},
+ {"vpsize", &lavc_param_packet_size, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100000000},
+ {"vstrict", &lavc_param_strict, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99},
+ {"vdpart", &lavc_param_data_partitioning, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART},
+// {"keyint", &lavc_param_keyint, TCCONF_TYPE_INT, 0, 0, 0},
+ {"gray", &lavc_param_gray, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART},
+ {"mpeg_quant", &lavc_param_mpeg_quant, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"vi_qfactor", &lavc_param_vi_qfactor, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0},
+ {"vi_qoffset", &lavc_param_vi_qoffset, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 31.0},
+ {"vqsquish", &lavc_param_rc_qsquish, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 99.0},
+ {"vqmod_amp", &lavc_param_rc_qmod_amp, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 99.0},
+ {"vqmod_freq", &lavc_param_rc_qmod_freq, TCCONF_TYPE_INT, 0, 0, 0},
+ {"vrc_eq", &lavc_param_rc_eq, TCCONF_TYPE_STRING, 0, 0, 0},
+ {"vrc_override", &lavc_param_rc_override_string, TCCONF_TYPE_STRING, 0, 0, 0},
+ {"vrc_maxrate", &lavc_param_rc_max_rate, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 24000000},
+ {"vrc_minrate", &lavc_param_rc_min_rate, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 24000000},
+ {"vrc_buf_size", &lavc_param_rc_buffer_size, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 4, 24000000},
+ {"vrc_buf_aggressivity", &lavc_param_rc_buffer_aggressivity, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 99.0},
+ {"vrc_init_cplx", &lavc_param_rc_initial_cplx, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 9999999.0},
+ {"vfdct", &lavc_param_fdct, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10},
+ {"lumi_mask", &lavc_param_lumi_masking, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -1.0, 1.0},
+ {"tcplx_mask", &lavc_param_temporal_cplx_masking, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -1.0, 1.0},
+ {"scplx_mask", &lavc_param_spatial_cplx_masking, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -1.0, 1.0},
+ {"p_mask", &lavc_param_p_masking, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -1.0, 1.0},
+ {"naq", &lavc_param_normalize_aqp, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"dark_mask", &lavc_param_dark_masking, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -1.0, 1.0},
+ //{"ildct", &lavc_param_interlaced_dct, TCCONF_TYPE_FLAG, 0, 0, 1},
+ {"idct", &lavc_param_idct, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 20},
+ {"pred", &lavc_param_prediction_method, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 20},
+ {"format", &lavc_param_format, TCCONF_TYPE_STRING, 0, 0, 0},
+ {"debug", &lavc_param_debug, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100000000},
+ {"psnr", &lavc_param_psnr, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PSNR},
+ {"precmp", &lavc_param_me_pre_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000},
+ {"cmp", &lavc_param_me_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000},
+ {"subcmp", &lavc_param_me_sub_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000},
+ {"mbcmp", &lavc_param_mb_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000},
+ {"ildctcmp", &lavc_param_ildct_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000},
+ {"predia", &lavc_param_pre_dia_size, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -2000, 2000},
+ {"dia", &lavc_param_dia_size, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -2000, 2000},
+ {"qpel", &lavc_param_qpel, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL},
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
+ {"trell", &lavc_param_trell, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRELLIS_QUANT},
+#else
+ {"trell", &lavc_param_trell, TCCONF_TYPE_FLAG, 0, 0, 1},
+#endif
+ {"last_pred", &lavc_param_last_pred, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000},
+ {"preme", &lavc_param_pre_me, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000},
+ {"subq", &lavc_param_me_subpel_quality, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 8},
+ {"me_range", &lavc_param_me_range, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16000},
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
+ {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIC},
+#else
+ {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_AC_PRED},
+#endif
+ {"umv", &lavc_param_umv, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_UMV},
+ {"ibias", &lavc_param_ibias, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512},
+ {"pbias", &lavc_param_pbias, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512},
+ {"coder", &lavc_param_coder, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10},
+ {"context", &lavc_param_context, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10},
+ {"intra_matrix", &lavc_param_intra_matrix, TCCONF_TYPE_STRING, 0, 0, 0},
+ {"inter_matrix", &lavc_param_inter_matrix, TCCONF_TYPE_STRING, 0, 0, 0},
+ {"cbp", &lavc_param_cbp, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CBP_RD},
+ {"mv0", &lavc_param_mv0, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0},
+ {"nr", &lavc_param_noise_reduction, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000},
+ {"qprd", &lavc_param_qp_rd, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QP_RD},
+ {"threads", &lavc_param_threads, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16},
+ {"ss", &lavc_param_ss, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_SLICE_STRUCT},
+ {"svcd_sof", &lavc_param_scan_offset, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_SVCD_SCAN_OFFSET},
+ {"alt", &lavc_param_alt, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_ALT_SCAN},
+ {"ilme", &lavc_param_ilme, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME},
+ {"inter_threshold", &lavc_param_inter_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000},
+ {"sc_threshold", &lavc_param_sc_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000},
+ {"top", &lavc_param_top, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1, 1},
+ {"gmc", &lavc_param_gmc, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GMC},
+ {"trunc", &lavc_param_trunc, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRUNCATED},
+ {"closedgop", &lavc_param_closedgop, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CLOSED_GOP},
+ {"intra_dc_precision", &lavc_param_intra_dc_precision, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16},
+ {"skip_top", &lavc_param_skip_top, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000},
+ {"skip_bottom", &lavc_param_skip_bottom, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000},
+ {"fps_code", &lavc_param_fps_code, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 9},
+ {"vpre", &lavc_param_video_preset, TCCONF_TYPE_STRING, 0, 0, 0},
+ {"ffmpeg_datadir", &lavc_param_ffmpeg_datadir, TCCONF_TYPE_STRING, 0, 0, 0},
+ {NULL, NULL, 0, 0, 0, 0}
+};
diff --git a/debian/transcode/transcode-1.1.7/export/ffmpeg_cfg.h b/debian/transcode/transcode-1.1.7/export/ffmpeg_cfg.h
new file mode 100644
index 00000000..445300c3
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/ffmpeg_cfg.h
@@ -0,0 +1,108 @@
+#ifndef __FFMPEG_CFG_H
+#define __FFMPEG_CFG_H
+
+#include "libtc/cfgfile.h"
+#include "libtc/tcavcodec.h"
+
+//char *lavc_param_vcodec = "mpeg4";
+//extern int lavc_param_vbitrate;
+extern int lavc_param_vrate_tolerance;
+extern int lavc_param_mb_decision;
+extern int lavc_param_v4mv;
+extern int lavc_param_vme;
+//extern int lavc_param_vqscale;
+//extern int lavc_param_vqmin;
+//extern int lavc_param_vqmax;
+extern int lavc_param_mb_qmin;
+extern int lavc_param_mb_qmax;
+extern int lavc_param_lmin;
+extern int lavc_param_lmax;
+extern int lavc_param_vqdiff;
+extern float lavc_param_vqcompress;
+extern float lavc_param_vqblur;
+extern float lavc_param_vb_qfactor;
+extern float lavc_param_vb_qoffset;
+extern float lavc_param_vi_qfactor;
+extern float lavc_param_vi_qoffset;
+extern int lavc_param_vmax_b_frames;
+//extern int lavc_param_keyint;
+//extern int lavc_param_vpass;
+extern int lavc_param_vrc_strategy;
+extern int lavc_param_vb_strategy;
+extern int lavc_param_luma_elim_threshold;
+extern int lavc_param_chroma_elim_threshold;
+extern int lavc_param_packet_size;
+extern int lavc_param_strict;
+extern int lavc_param_data_partitioning;
+extern int lavc_param_gray;
+extern float lavc_param_rc_qsquish;
+extern float lavc_param_rc_qmod_amp;
+extern int lavc_param_rc_qmod_freq;
+extern char *lavc_param_rc_override_string;
+extern char *lavc_param_rc_eq;
+extern int lavc_param_rc_buffer_size;
+extern float lavc_param_rc_buffer_aggressivity;
+extern int lavc_param_rc_max_rate;
+extern int lavc_param_rc_min_rate;
+extern float lavc_param_rc_initial_cplx;
+extern int lavc_param_mpeg_quant;
+extern int lavc_param_fdct;
+extern int lavc_param_idct;
+extern float lavc_param_lumi_masking;
+extern float lavc_param_dark_masking;
+extern float lavc_param_temporal_cplx_masking;
+extern float lavc_param_spatial_cplx_masking;
+extern float lavc_param_p_masking;
+extern int lavc_param_normalize_aqp;
+// ildct
+extern int lavc_param_prediction_method;
+extern char *lavc_param_format;
+extern int lavc_param_debug;
+extern int lavc_param_psnr;
+extern int lavc_param_me_pre_cmp;
+extern int lavc_param_me_cmp;
+extern int lavc_param_me_sub_cmp;
+extern int lavc_param_mb_cmp;
+extern int lavc_param_ildct_cmp;
+extern int lavc_param_pre_dia_size;
+extern int lavc_param_dia_size;
+extern int lavc_param_qpel;
+extern int lavc_param_trell;
+extern int lavc_param_aic;//CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIC, NULL},
+extern int lavc_param_umv;// CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_UMV, NULL},
+extern int lavc_param_last_pred;
+extern int lavc_param_pre_me;
+extern int lavc_param_me_subpel_quality;
+extern int lavc_param_me_range;
+extern int lavc_param_ibias;
+extern int lavc_param_pbias;
+extern int lavc_param_coder;
+extern int lavc_param_context;
+extern char *lavc_param_intra_matrix;
+extern char *lavc_param_inter_matrix;
+extern int lavc_param_cbp;
+extern int lavc_param_mv0;
+extern int lavc_param_noise_reduction;
+extern int lavc_param_qp_rd;
+extern int lavc_param_inter_threshold;
+extern int lavc_param_sc_threshold;
+extern int lavc_param_ss;
+extern int lavc_param_top;
+extern int lavc_param_alt;
+extern int lavc_param_ilme;
+extern int lavc_param_scan_offset;
+extern int lavc_param_threads;
+extern int lavc_param_gmc;
+extern int lavc_param_trunc;
+extern int lavc_param_fps_code;
+extern int lavc_param_closedgop;
+extern int lavc_param_intra_dc_precision;
+extern int lavc_param_skip_top;
+extern int lavc_param_skip_bottom;
+
+extern char *lavc_param_video_preset;
+extern char *lavc_param_ffmpeg_datadir;
+
+extern TCConfigEntry lavcopts_conf[];
+
+#endif
diff --git a/debian/transcode/transcode-1.1.7/export/svcd-ntsc.cfg b/debian/transcode/transcode-1.1.7/export/svcd-ntsc.cfg
new file mode 100644
index 00000000..31f1f612
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/svcd-ntsc.cfg
@@ -0,0 +1,19 @@
+# transcode SVCD-NTSC export profile
+video_width = 480
+video_height = 480
+video_keep_asr = yes
+video_encode_fields = 2 # bottom first
+video_frc = 4
+video_bitrate = 2040
+video_bitrate_max = 2040
+video_gop_size = 18
+video_codec = mpeg2video
+video_module = ffmpeg
+video_module_options = "rc_min_rate=0:rc_max_rate=2516:rc_buffer_size=1792:rc_buffer_aggressivity=99:scan_offset=1"
+audio_codec = mp2
+audio_module = ffmpeg
+audio_bitrate = 224
+audio_channels = 2
+audio_sample_rate = 48000
+audio_sample_bits = 16
+mplex_module = raw # since mpeg multiplexor isn't avalaible
diff --git a/debian/transcode/transcode-1.1.7/export/svcd-pal.cfg b/debian/transcode/transcode-1.1.7/export/svcd-pal.cfg
new file mode 100644
index 00000000..6ebb6d48
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/svcd-pal.cfg
@@ -0,0 +1,19 @@
+# transcode SVCD-PAL export profile
+video_width = 480
+video_height = 576
+video_keep_asr = yes
+video_encode_fields = 1 # top first
+video_frc = 3
+video_bitrate = 2040
+video_bitrate_max = 2040
+video_gop_size = 15
+video_codec = mpeg2video
+video_module = ffmpeg
+video_module_options = "rc_min_rate=0:rc_max_rate=2516:rc_buffer_size=1792:rc_buffer_aggressivity=99:scan_offset=1"
+audio_codec = mp2
+audio_module = ffmpeg
+audio_bitrate = 224
+audio_channels = 2
+audio_sample_rate = 48000
+audio_sample_bits = 16
+mplex_module = raw # since mpeg multiplexor isn't avalaible
diff --git a/debian/transcode/transcode-1.1.7/export/vbr.h b/debian/transcode/transcode-1.1.7/export/vbr.h
new file mode 100644
index 00000000..86e5de2e
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/vbr.h
@@ -0,0 +1,43 @@
+/*
+ * divx4_vbr.h
+ *
+ * Copyright (C) Thomas Oestreich - June 2001
+ *
+ * This file is part of transcode, a video stream processing tool
+ *
+ * transcode is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * transcode is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#ifndef _DIVX4_VBR_H
+#define _DIVX4_VBR_H
+
+// methods from class VbrControl
+
+void VbrControl_init_1pass_vbr(int quality, int crispness);
+int VbrControl_init_2pass_vbr_encoding(const char* filename, int bitrate, double framerate, int crispness, int quality);
+int VbrControl_init_2pass_vbr_analysis(const char* filename, int quality);
+
+void VbrControl_update_1pass_vbr(void);
+void VbrControl_update_2pass_vbr_encoding(int motion_bits, int texture_bits, int total_bits);
+void VbrControl_update_2pass_vbr_analysis(int is_key_frame, int motion_bits, int texture_bits, int total_bits, int quant);
+
+int VbrControl_get_quant(void);
+void VbrControl_set_quant(float q);
+int VbrControl_get_intra(void);
+short VbrControl_get_drop(void);
+void VbrControl_close(void);
+
+#endif
diff --git a/debian/transcode/transcode-1.1.7/export/vcd-ntsc.cfg b/debian/transcode/transcode-1.1.7/export/vcd-ntsc.cfg
new file mode 100644
index 00000000..f9cdeccd
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/vcd-ntsc.cfg
@@ -0,0 +1,19 @@
+# transcode VCD-NTSC export profile
+video_width = 352
+video_height = 240
+video_keep_asr = yes
+video_encode_fields = 2 # bottom first
+video_frc = 4
+video_bitrate = 1152
+video_bitrate_max = 1152
+video_gop_size = 9
+video_codec = mpeg1video
+video_module = ffmpeg
+video_module_options = "rc_min_rate=1150:rc_max_rate=1150:rc_buffer_size=320:rc_buffer_aggressivity=99:scan_offset=0"
+audio_codec = mp2
+audio_module = ffmpeg
+audio_bitrate = 224
+audio_channels = 2
+audio_sample_rate = 48000
+audio_sample_bits = 16
+mplex_module = raw # since mpeg multiplexor isn't avalaible
diff --git a/debian/transcode/transcode-1.1.7/export/vcd-pal.cfg b/debian/transcode/transcode-1.1.7/export/vcd-pal.cfg
new file mode 100644
index 00000000..4f207a0c
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/vcd-pal.cfg
@@ -0,0 +1,19 @@
+# transcode VCD-PAL export profile
+video_width = 352
+video_height = 288
+video_keep_asr = yes
+video_encode_fields = 1 # top first
+video_frc = 3
+video_bitrate = 1152
+video_bitrate_max = 1152
+video_gop_size = 9
+video_codec = mpeg1video
+video_module = ffmpeg
+video_module_options = "rc_min_rate=1150:rc_max_rate=1150:rc_buffer_size=320:rc_buffer_aggressivity=99:scan_offset=0"
+audio_codec = mp2
+audio_module = ffmpeg
+audio_bitrate = 224
+audio_channels = 2
+audio_sample_rate = 48000
+audio_sample_bits = 16
+mplex_module = raw # since mpeg multiplexor isn't avalaible
diff --git a/debian/transcode/transcode-1.1.7/export/xvcd-ntsc.cfg b/debian/transcode/transcode-1.1.7/export/xvcd-ntsc.cfg
new file mode 100644
index 00000000..1a54ad57
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/xvcd-ntsc.cfg
@@ -0,0 +1,19 @@
+# transcode XVCD-NTSC export profile
+video_width = 480
+video_height = 480
+video_keep_asr = yes
+video_encode_fields = 2 # bottom first
+video_frc = 4
+video_bitrate = 2040
+video_bitrate_max = 2040
+video_gop_size = 18
+video_codec = mpeg2video
+video_module = ffmpeg
+video_module_options = "rc_min_rate=0:rc_max_rate=5000:rc_buffer_size=1792:rc_buffer_aggressivity=99:scan_offset=1"
+audio_codec = mp2
+audio_module = ffmpeg
+audio_bitrate = 224
+audio_channels = 2
+audio_sample_rate = 48000
+audio_sample_bits = 16
+mplex_module = raw # since mpeg multiplexor isn't avalaible
diff --git a/debian/transcode/transcode-1.1.7/export/xvcd-pal.cfg b/debian/transcode/transcode-1.1.7/export/xvcd-pal.cfg
new file mode 100644
index 00000000..73bebe33
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/xvcd-pal.cfg
@@ -0,0 +1,19 @@
+# transcode XVCD-PAL export profile
+video_width = 480
+video_height = 576
+video_keep_asr = yes
+video_encode_fields = 1 # top first
+video_frc = 3
+video_bitrate = 2040
+video_bitrate_max = 2040
+video_gop_size = 15
+video_codec = mpeg2video
+video_module = ffmpeg
+video_module_options = "rc_min_rate=0:rc_max_rate=5000:rc_buffer_size=1792:rc_buffer_aggressivity=99:scan_offset=1"
+audio_codec = mp2
+audio_module = ffmpeg
+audio_bitrate = 224
+audio_channels = 2
+audio_sample_rate = 48000
+audio_sample_bits = 16
+mplex_module = raw # since mpeg multiplexor isn't avalaible
diff --git a/debian/transcode/transcode-1.1.7/export/xvid4.cfg b/debian/transcode/transcode-1.1.7/export/xvid4.cfg
new file mode 100644
index 00000000..6d6202fd
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/xvid4.cfg
@@ -0,0 +1,510 @@
+# ############################################################################
+# XviD 1.0 configuration file for transcode
+# ############################################################################
+
+
+# ----------------------------------------------------------------------------
+#
+# Section: Features
+#
+# The fist section of this configuration file concerns what is labeled as
+# "features". This allows you to turn on/off some options to adapt XviD to
+# your needs.
+# ----------------------------------------------------------------------------
+
+[features]
+
+# MPEG4 allows two methods to compress the image, the first one is derived
+# from h263, the other one is inspired by the MPEG2 matrix quantization.
+#
+# NB: defaults to h263 if a typing mistake is done.
+# defaults to mpeg if custom matrices filenames are specified.
+#
+# Values = h263 | mpeg
+
+quant_type = h263
+
+
+# This option controls the motion estimation subsystem. The higher the value,
+# the more precise the estimation should be. The more precise the motion
+# estimation is, the more bits can be saved. Precision is gained at the
+# expense of CPU time so decrease this setting if you need realtime encoding.
+#
+# Values = [0..6]
+#
+# 0 None
+# 1 Very Low
+# 2 Low
+# 3 Medium
+# 4 High
+# 5 Very High
+# 6 Ultra High
+#
+# Default = 6
+
+motion = 6
+
+# Motion estimation involves lot of refinement steps. Usually these steps help
+# reaching better quality, but not by much, and they use a fair amount of CPU.
+# So if you want to speedup Motion Estimation by skipping some refinement steps
+# and using simplified ME functions, you can activate the turbo mode.
+#
+# This setting turns on the ME turbo mode.
+#
+# Values = 0 (no) | 1 (yes)
+# Default = 0
+
+turbo = 0
+
+# The usual motion estimation algorithm uses only the luminance information
+# to find the best motion vector. However for some video material, using
+# the chromatic planes can help find better vectors.
+#
+# This setting turns on/off the use of chroma planes for Motion Estimation
+#
+# Values = 0 (no) | 1 (yes)
+# Default = 1
+
+chromame = 1
+
+
+# The motion search algorithm is based on a search in the usual color domain
+# and tries to find a motion vector that minimizes the difference between
+# the reference frame and the encoded frame.
+#
+# Activating this setting, XviD will also use the frequency domain (DCT) to
+# search a motion vector that minimizes not only the spatial difference but
+# also the encoding length of the block. The higher, the more precise and more
+# CPU intensive
+#
+# Values = [0..4]
+#
+# 0 Disabled
+# 1 Mode decision
+# 2 Limited search
+# 3 Medium search
+# 4 Wide search
+#
+# Default = 1
+
+vhq = 1
+
+
+# BFrames are the third type of frames available in MPEG4, they are predicted
+# thanks to 2 reference frames. Thus, bframes help usually in two cases:
+# 1/ saving bitrate w/o loss of quality
+# 2/ increasing the quality for a same bitrate
+#
+# This setting controls how many bframes the xvid encoder can output in a row.
+#
+# You must be aware that the higher max_bframes is, the more distant reference
+# frames are from each other. Thus prediction of reference frames become hard
+# and results in poor quality. If the reference frames have poor quality, so
+# the bframes will have. So as a rule of thumb, this setting has to be tuned
+# according to your exact needs. CVommon values are [0..2] for "natural movies
+# and a bit higher values for anime/cartoons with great amounts of constant color
+# areas.
+#
+# Values = >=0 (0 disables bframes usage)
+# Default = 1
+
+max_bframes = 1
+
+
+# As explained before, BFrames are highly correlated to its reference frames
+# Thus XviD computes their quantizer to its reference's quantizers.
+#
+# This two settings allow you to tune the formula:
+#
+# Values = [0..200]
+# Default = ratio 150 & offset 100
+
+bquant_ratio = 150
+bquant_offset = 100
+
+
+# Sometimes BFrames do not look good, and introduce artefacts when most of the
+# frame is static and some small zones have high motion (a static scene with a
+# man talking, his mouth will probably look bad if what is surrounding the man
+# and his mouth is completly static)
+#
+# This setting allow you to favorize or not, the use of bframes. The higher the
+# value, the more a bframe has chance to be used.
+#
+# Values [-255..255]
+# Default = 0
+
+bframe_threshold = 0
+
+
+# MPEG4 uses a half pixel precision for its motion search by default. The
+# standard proposes a mode where encoders are allowed to use quarter pixel
+# precision.
+#
+# This option usually results in sharper image. But it has great impact on
+# bitrate and sometimes the higher use of bitrate will prevent it from giving
+# a better image quality at a fixed bitrate. The better is to test w and w/o it
+# and choose after this test, if it's worth activting it.
+#
+# Values = 0 (no) | 1 (yes)
+# Default = 0
+
+quarterpel = 0
+
+
+# Makes XviD generates Sprite Frame which describe best Pan/Zoom/Rotating
+# images. Deciding wether or not you must activate it depends highly on the
+# video material
+#
+# Values = 0 (no) | 1 (yes)
+# Default = 0
+
+gmc = 0
+
+
+# Trellis Quantization is a kind of adaptive quantization method that saves
+# bits modifying quantized coefficients to make them more compressable by the
+# entropy encoder.
+#
+# Its impact on quality is good, and if VHQ uses too much CPU for you, this
+# setting can be a good alternative to save a few bits (and gain quality at
+# fixed bitrate) at a minimum expense.
+# than VHQ
+#
+# Values = 0 (no) | 1 (yes)
+# Default = 0
+
+trellis = 0
+
+
+# Depending on the container and frontend API, sometimes it is good to ask XviD
+# to group the first bframe of a group with its forward reference frame, that
+# prevents A/V desync
+#
+# This setting would be useful if it was used with VFW 1.1 encoders (Windows)
+# because this API does not allow audio contention when no video frames are
+# output.
+#
+# But transcode does not suffer from that API problem and the xvid4 module
+# informs transcode to delay frames when needed, so this option is mostly not
+# needed with transcode.
+#
+# Values = 0 (no) | 1 (yes)
+# Default = 0
+
+packed = 0
+
+
+# A GOP is a Group Of Pictures. Its bounded by two Intra Frames.
+#
+# This option controls if XviD must close a GOP, which means that a GOP is
+# independent from the next GOP. This implies just that the last frame of
+# the GOP is eiter a PFrame or a SFrame but not a BFrame. This is usually
+# a good idea to turn on the option
+#
+# Values = 0 (no) | 1 (yes)
+# Default = 1
+
+closed_gop = 1
+
+
+# For interlaced video material, turn this option to on.
+#
+# Values = 0 (no) | 1 (yes)
+# Default = 0
+
+interlaced = 0
+
+
+# Activate this if your encoded sequence is an Anime/Cartoon. It modifies some
+# XviD internal thresholds so XviD takes better decisions on frame types and
+# motion vectors for flat looking cartoons.
+#
+# Values = 0 (no) | 1 (yes)
+# Default = 0
+
+cartoon = 0
+
+
+# Activates High Quality AC coefficient prediction from neighboor blocks.
+#
+# Values = 0 (no) | 1 (yes)
+# Default = 1
+
+hqacpred = 1
+
+
+# XviD keeps track of block coding type (skipped, predicted, intra). The skipped
+# block counter can be used to choose wether a frame is so close to its reference
+# that it can be _completly_ skipped.
+#
+# This setting allows you to choose the (100 - value) threshold for skipping a
+# frame.
+#
+# Values = [0..100] (0 -> never skip a frame, 100 -> skip all frames)
+# Default = 0
+
+frame_drop_ratio = 0
+
+# XviD discard chroma planes bitstream so the encoded video is greyscale only.
+# Note that this does not speed up encoding, that just prevent chroma data
+# from being written in the last stage of encoding.
+#
+# This setting enable Chroma color discarding.
+#
+# Values = 0 (no) | 1 (yes)
+# Default = 0
+
+greyscale = 0
+
+# For testing purposes, or quality measurement, XviD can return some stats
+# about the encoded frames.
+#
+# This option activates PSNR measurement, the average PSNR is displayed at the
+# end of the encoding session. This option is probably something a Joe user
+# does not really care. This option makes the encoding a bit slower.
+#
+# Values = 0 (no) | 1 (yes)
+# Default = 0
+
+stats = 0
+
+# When doing the first pass of a 2-pass encode, the encoder takes some
+# shortcuts and does not produce a full quality encode. Must users have
+# no reason to do this, since the first pass is usually discarded.
+#
+# Setting this option forces the encoder to produce a full quality first
+# pass at Q2. Enabling this makes the first pass a lot slower, and should
+# only be enabled if you're using the resuts of the first pass for something.
+#
+# Values = 0 (standard first pass) | 1 (full quality first pass)
+# Default = 0
+
+full1pass = 0
+
+# ----------------------------------------------------------------------------
+#
+# Section: Quantizer
+#
+# This section allows you to tune quantizing process.
+# ----------------------------------------------------------------------------
+
+[quantizer]
+
+# The next 6 settings control the valid range of quantizers for a specific frame
+# type
+#
+# a [2..31] range is probably good for all sequences, you can decrease the higher
+# bound limit if you notice some scenes with artefacts. However, restricting the
+# valid range can make the bitrate controller fails to achieve the desired bitrate
+#
+# Use this ranges with MUCH care
+#
+# Values = [0..31]
+# 1-> small quantizer -> better quality
+# 31-> high quantizer -> bad quality
+# 0 has a special meaning, it lets XviD uses its own default values
+
+min_iquant = 2
+max_iquant = 31
+min_pquant = 2
+max_pquant = 31
+min_bquant = 2
+max_bquant = 31
+
+# With the MPEG quantization method you can provide custom matrices optimized
+# your video material.
+#
+# A matrix file is just a file where 64 decimal values ranged in 1..255 are
+# specified separated by space chars (newline, space, tabs)
+#
+# The 8x8 matrix is then rebuilt like that
+#
+# [ first coeff, second coeff, ... eighth coeff]
+# [ ninth coeff, ... ]
+# [ ... ]
+# [ ]
+# [ ]
+# [ ]
+# [ ]
+# [ ]
+#
+# Value = filename of the matrix
+# Default : none (no custom matrix)
+
+#quant_intra_matrix =
+#quant_inter_matrix =
+
+
+# ----------------------------------------------------------------------------
+#
+# Section: CBR
+#
+# This section allows you to tune the Constant Bitrate settings.
+# ----------------------------------------------------------------------------
+
+[cbr]
+
+# This parameter controls the delay in frames before the CBR rate controller
+# will react to bitrate changes and will try to compensate the change to obtain
+# a constant bitrate over an averaging range of frames (see below).
+#
+# Value = >=0
+# Default = 16
+# 0 has a special meaning, it lets XviD uses its own default values
+
+reaction_delay_factor = 16
+
+
+# Real CBR is hard to achieve. Depending on the video material, bitrate can be
+# variable, and hard to predict. That's why XviD uses an averaging period for
+# which it guarantees a given amount of bits (minus a small variation).
+#
+# This settings express the "number of frames" for which XviD averages bitrate
+# and tries to achieve CBR.
+#
+# Value = >=0
+# Default = 100
+# 0 has a special meaning, it lets XviD uses its own default values
+
+averaging_period = 100
+
+
+# Todo: find its exact meaning
+#
+# Value = >=0
+# Default = 100
+# 0 has a special meaning, it lets XviD uses its own default values
+
+buffer = 100
+
+# ----------------------------------------------------------------------------
+#
+# Section: VBR
+#
+# This section allows you to tune the Variable Bitrate controller settings.
+# (2nd pass control in simpler words)
+# ----------------------------------------------------------------------------
+
+[vbr]
+
+# The two pass algorithm scales the initial bitrate curve to obtain one that
+# respect both the user target bitrate and the natural shape of the first pass
+# curve. However it is possible to give an additionnal amount of bits for Intra
+# frames.
+#
+# This setting tells how many additional amount of bits, Intra Frames are
+# supposed to be given (this "bossting" amount of bits is compensated by
+# subtracting the same amount of bits from other frame types pool)
+#
+# Value = [0..100]
+# Default = 0
+
+keyframe_boost = 0
+
+
+# This settigs control how much the upper part of the curve has to get closer
+# to the average bitrate value. The upper part of the curve is the set of values
+# that are higher than the curve average. It is expressed in %.
+#
+# Think of that setting like a shrinking factor for the upper part of the
+# curve.
+#
+# Value = [0..100]
+# Default = 0
+
+curve_compression_high = 0
+
+
+# This settigs control how much the lower part of the curve has to get closer
+# to the average bitrate value. The lower part of the curve is the set of values
+# that are lower than the curve average. It is expressed in %.
+#
+# Think of that setting like a growing factor for the lower part of the
+# curve.
+#
+# Value = [0..100]
+# Default = 0
+
+curve_compression_low = 0
+
+
+# During two pass, a scaled bitrate curve is computed. The difference between
+# that expected curve and the result obtained during encoding is called
+# overflow. Obviously, the two pass Rate Controller tries to compensate
+# that overflow distributing it over next frames to be encoded.
+#
+# This setting controls how much overflow is distributed at each new frame.
+# Low values allow lazy overflow control, big rate bursts are compensated more
+# slowly (could lead to lack of precision for small clips). High values
+# make RC compensate very hard the overflow, this can have a very bad impact on
+# quality during rate bursts.
+#
+# NB: This setting impacts quality a lot, play with it carefully !
+#
+# Value = [0..100]
+# Default = 0
+# 0 has a special meaning, it lets XviD uses its own default values
+
+overflow_control_strength = 5
+
+# During the frame bit allocation, overflow control may increase the frame
+# size. This parameter controls how much the overflow control is allowed
+# to increase the frame size in percent compared to the ideal curve allocation
+#
+# Value = >=0
+# Default = 60
+# 0 has a special meaning, it lets XviD uses its own default values
+
+max_overflow_improvement = 5
+
+
+# During the frame bit allocation, overflow control may decrease the frame
+# size. This parameter controls how much the overflow control is allowed
+# to decrease the frame size in percent compared to the ideal curve allocation
+#
+# Value = >=0
+# Default = 60
+# 0 has a special meaning, it lets XviD uses its own default values
+
+max_overflow_degradation = 5
+
+
+# This reduction factor is the maximum allowed keyframe penalty applied to
+# a frame in a ivop sequence. The more the frame is distant from the last
+# ivop in the consecutive ivop sequence, the more penalty it is applied.
+# This ensures a maximum bitrate allocation to the last ivop, thus favorizing
+# a good reference frame for following p/s/b vops.
+#
+# Value = >=0
+# Default = 20
+# 0 has a special meaning, it lets XviD uses its own default values
+
+kfreduction = 20
+
+
+# Distance between two ivops so that it is not decresed its bit allocation by
+# the ivop reduction mechanism.
+#
+# Value = >=0
+# Default = 1
+# 0 has a special meaning, it lets XviD uses its own default values
+
+kfthreshold = 1
+
+
+# Most of the time users express their target bitrate for video w/o taking care
+# of the video container overhead. This small but (mostly) constant overhead
+# can make the target file size is not respected (oversized result). We decided
+# to allow users to set the amount of overhead per frame the container generates
+# (give only an average per frame)
+#
+# Value = >=0
+# Default = 24 (AVI frame average overhead per frame in bytes)
+# 0 has a special meaning, it lets XviD uses its own default values
+
+container_frame_overhead = 24
+
+##############################################################################
+# Do not modify this tag comment
+# arch-tag: bb7970c1-33fb-4c8c-8d1b-742ff2e53336 xvid config file
diff --git a/debian/transcode/transcode-1.1.7/export/xvid4.h b/debian/transcode/transcode-1.1.7/export/xvid4.h
new file mode 100644
index 00000000..19dda0c5
--- /dev/null
+++ b/debian/transcode/transcode-1.1.7/export/xvid4.h
@@ -0,0 +1,776 @@
+/*****************************************************************************
+ *
+ * XVID MPEG-4 VIDEO CODEC
+ * - XviD Main header file -
+ *
+ * Copyright(C) 2001-2003 Peter Ross <[email protected]>
+ *
+ * This program is free software ; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation ; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY ; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program ; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id: xvid4.h,v 1.9 2005-12-25 16:54:13 achurch Exp $
+ *
+ ****************************************************************************/
+
+#ifndef _XVID_H_
+#define _XVID_H_
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*****************************************************************************
+ * versioning
+ ****************************************************************************/
+
+/* versioning
+ version takes the form "$major.$minor.$patch"
+ $patch is incremented when there is no api change
+ $minor is incremented when the api is changed, but remains backwards compatible
+ $major is incremented when the api is changed significantly
+
+ when initialising an xvid structure, you must always zero it, and set the version field.
+ memset(&struct,0,sizeof(struct));
+ struct.version = XVID_VERSION;
+
+ XVID_UNSTABLE is defined only during development.
+ */
+
+#define XVID_MAKE_VERSION(a,b,c) ((((a)&0xff)<<16) | (((b)&0xff)<<8) | ((c)&0xff))
+#define XVID_VERSION_MAJOR(a) ((char)(((a)>>16) & 0xff))
+#define XVID_VERSION_MINOR(a) ((char)(((a)>> 8) & 0xff))
+#define XVID_VERSION_PATCH(a) ((char)(((a)>> 0) & 0xff))
+
+#define XVID_MAKE_API(a,b) ((((a)&0xff)<<16) | (((b)&0xff)<<0))
+#define XVID_API_MAJOR(a) (((a)>>16) & 0xff)
+#define XVID_API_MINOR(a) (((a)>> 0) & 0xff)
+
+#define XVID_VERSION XVID_MAKE_VERSION(1,0,-126)
+#define XVID_API XVID_MAKE_API(4, 0)
+
+#define XVID_UNSTABLE
+
+/* Bitstream Version
+ * this will be writen into the bitstream to allow easy detection of xvid
+ * encoder bugs in the decoder, without this it might not possible to
+ * automatically distinquish between a file which has been encoded with an
+ * old & buggy XVID from a file which has been encoded with a bugfree version
+ * see the infamous interlacing bug ...
+ *
+ * this MUST be increased if an encoder bug is fixed, increasing it too often
+ * doesnt hurt but not increasing it could cause difficulty for decoders in the
+ * future
+ */
+#define XVID_BS_VERSION "0025"
+
+
+/*****************************************************************************
+ * error codes
+ ****************************************************************************/
+
+ /* all functions return values <0 indicate error */
+
+#define XVID_ERR_FAIL -1 /* general fault */
+#define XVID_ERR_MEMORY -2 /* memory allocation error */
+#define XVID_ERR_FORMAT -3 /* file format error */
+#define XVID_ERR_VERSION -4 /* structure version not supported */
+#define XVID_ERR_END -5 /* encoder only; end of stream reached */
+
+
+
+/*****************************************************************************
+ * xvid_image_t
+ ****************************************************************************/
+
+/* colorspace values */
+
+#define XVID_CSP_USER (1<< 0) /* 4:2:0 planar (==I420, except for pointers/strides) */
+#define XVID_CSP_I420 (1<< 1) /* 4:2:0 planar */
+#define XVID_CSP_YV12 (1<< 2) /* 4:2:0 planar */
+#define XVID_CSP_YUY2 (1<< 3) /* 4:2:2 packed */
+#define XVID_CSP_UYVY (1<< 4) /* 4:2:2 packed */
+#define XVID_CSP_YVYU (1<< 5) /* 4:2:2 packed */
+#define XVID_CSP_BGRA (1<< 6) /* 32-bit bgra packed */
+#define XVID_CSP_ABGR (1<< 7) /* 32-bit abgr packed */
+#define XVID_CSP_RGBA (1<< 8) /* 32-bit rgba packed */
+#define XVID_CSP_ARGB (1<<15) /* 32-bit argb packed */
+#define XVID_CSP_BGR (1<< 9) /* 24-bit bgr packed */
+#define XVID_CSP_RGB555 (1<<10) /* 16-bit rgb555 packed */
+#define XVID_CSP_RGB565 (1<<11) /* 16-bit rgb565 packed */
+#define XVID_CSP_SLICE (1<<12) /* decoder only: 4:2:0 planar, per slice rendering */
+#define XVID_CSP_INTERNAL (1<<13) /* decoder only: 4:2:0 planar, returns ptrs to internal buffers */
+#define XVID_CSP_NULL (1<<14) /* decoder only: dont output anything */
+#define XVID_CSP_VFLIP (1<<31) /* vertical flip mask */
+
+/* xvid_image_t
+ for non-planar colorspaces use only plane[0] and stride[0]
+ four plane reserved for alpha*/
+typedef struct {
+ int csp; /* [in] colorspace; or with XVID_CSP_VFLIP to perform vertical flip */
+ void * plane[4]; /* [in] image plane ptrs */
+ int stride[4]; /* [in] image stride; "bytes per row"*/
+} xvid_image_t;
+
+/* video-object-sequence profiles */
+#define XVID_PROFILE_S_L0 0x08 /* simple */
+#define XVID_PROFILE_S_L1 0x01
+#define XVID_PROFILE_S_L2 0x02
+#define XVID_PROFILE_S_L3 0x03
+#define XVID_PROFILE_ARTS_L1 0x91 /* advanced realtime simple */
+#define XVID_PROFILE_ARTS_L2 0x92
+#define XVID_PROFILE_ARTS_L3 0x93
+#define XVID_PROFILE_ARTS_L4 0x94
+#define XVID_PROFILE_AS_L0 0xf0 /* advanced simple */
+#define XVID_PROFILE_AS_L1 0xf1
+#define XVID_PROFILE_AS_L2 0xf2
+#define XVID_PROFILE_AS_L3 0xf3
+#define XVID_PROFILE_AS_L4 0xf4
+
+/* aspect ratios */
+#define XVID_PAR_11_VGA 1 /* 1:1 vga (square), default if supplied PAR is not a valid value */
+#define XVID_PAR_43_PAL 2 /* 4:3 pal (12:11 625-line) */
+#define XVID_PAR_43_NTSC 3 /* 4:3 ntsc (10:11 525-line) */
+#define XVID_PAR_169_PAL 4 /* 16:9 pal (16:11 625-line) */
+#define XVID_PAR_169_NTSC 5 /* 16:9 ntsc (40:33 525-line) */
+#define XVID_PAR_EXT 15 /* extended par; use par_width, par_height */
+
+/* frame type flags */
+#define XVID_TYPE_VOL -1 /* decoder only: vol was decoded */
+#define XVID_TYPE_NOTHING 0 /* decoder only (encoder stats): nothing was decoded/encoded */
+#define XVID_TYPE_AUTO 0 /* encoder: automatically determine coding type */
+#define XVID_TYPE_IVOP 1 /* intra frame */
+#define XVID_TYPE_PVOP 2 /* predicted frame */
+#define XVID_TYPE_BVOP 3 /* bidirectionally encoded */
+#define XVID_TYPE_SVOP 4 /* predicted+sprite frame */
+
+
+/*****************************************************************************
+ * xvid_global()
+ ****************************************************************************/
+
+/* cpu_flags definitions (make sure to sync this with cpuid.asm for ia32) */
+
+#define XVID_CPU_FORCE (1<<31) /* force passed cpu flags */
+#define XVID_CPU_ASM (1<< 7) /* native assembly */
+/* ARCH_IS_IA32 */
+#define XVID_CPU_MMX (1<< 0) /* mmx : pentiumMMX,k6 */
+#define XVID_CPU_MMXEXT (1<< 1) /* mmx-ext : pentium2, athlon */
+#define XVID_CPU_SSE (1<< 2) /* sse : pentium3, athlonXP */
+#define XVID_CPU_SSE2 (1<< 3) /* sse2 : pentium4, athlon64 */
+#define XVID_CPU_3DNOW (1<< 4) /* 3dnow : k6-2 */
+#define XVID_CPU_3DNOWEXT (1<< 5) /* 3dnow-ext : athlon */
+#define XVID_CPU_TSC (1<< 6) /* tsc : Pentium */
+/* ARCH_IS_PPC */
+#define XVID_CPU_ALTIVEC (1<< 0) /* altivec */
+
+
+#define XVID_DEBUG_ERROR (1<< 0)
+#define XVID_DEBUG_STARTCODE (1<< 1)
+#define XVID_DEBUG_HEADER (1<< 2)
+#define XVID_DEBUG_TIMECODE (1<< 3)
+#define XVID_DEBUG_MB (1<< 4)
+#define XVID_DEBUG_COEFF (1<< 5)
+#define XVID_DEBUG_MV (1<< 6)
+#define XVID_DEBUG_RC (1<< 7)
+#define XVID_DEBUG_DEBUG (1<<31)
+
+/* XVID_GBL_INIT param1 */
+typedef struct {
+ int version;
+ unsigned int cpu_flags; /* [in:opt] zero = autodetect cpu; XVID_CPU_FORCE|{cpu features} = force cpu features */
+ int debug; /* [in:opt] debug level */
+} xvid_gbl_init_t;
+
+
+/* XVID_GBL_INFO param1 */
+typedef struct {
+ int version;
+ int actual_version; /* [out] returns the actual xvidcore version */
+ const char * build; /* [out] if !null, points to description of this xvid core build */
+ unsigned int cpu_flags; /* [out] detected cpu features */
+ int num_threads; /* [out] detected number of cpus/threads */
+} xvid_gbl_info_t;
+
+
+/* XVID_GBL_CONVERT param1 */
+typedef struct {
+ int version;
+ xvid_image_t input; /* [in] input image & colorspace */
+ xvid_image_t output; /* [in] output image & colorspace */
+ int width; /* [in] width */
+ int height; /* [in] height */
+ int interlacing; /* [in] interlacing */
+} xvid_gbl_convert_t;
+
+
+#define XVID_GBL_INIT 0 /* initialize xvidcore; must be called before using xvid_decore, or xvid_encore) */
+#define XVID_GBL_INFO 1 /* return some info about xvidcore, and the host computer */
+#define XVID_GBL_CONVERT 2 /* colorspace conversion utility */
+
+extern int xvid_global(void *handle, int opt, void *param1, void *param2);
+
+
+/*****************************************************************************
+ * xvid_decore()
+ ****************************************************************************/
+
+#define XVID_DEC_CREATE 0 /* create decore instance; return 0 on success */
+#define XVID_DEC_DESTROY 1 /* destroy decore instance: return 0 on success */
+#define XVID_DEC_DECODE 2 /* decode a frame: returns number of bytes consumed >= 0 */
+
+extern int xvid_decore(void *handle, int opt, void *param1, void *param2);
+
+/* XVID_DEC_CREATE param 1
+ image width & height may be specified here when the dimensions are
+ known in advance. */
+typedef struct {
+ int version;
+ int width; /* [in:opt] image width */
+ int height; /* [in:opt] image width */
+ void * handle; /* [out] decore context handle */
+} xvid_dec_create_t;
+
+
+/* XVID_DEC_DECODE param1 */
+/* general flags */
+#define XVID_LOWDELAY (1<<0) /* lowdelay mode */
+#define XVID_DISCONTINUITY (1<<1) /* indicates break in stream */
+#define XVID_DEBLOCKY (1<<2) /* perform luma deblocking */
+#define XVID_DEBLOCKUV (1<<3) /* perform chroma deblocking */
+#define XVID_FILMEFFECT (1<<4) /* adds film grain */
+
+typedef struct {
+ int version;
+ int general; /* [in:opt] general flags */
+ void *bitstream; /* [in] bitstream (read from)*/
+ int length; /* [in] bitstream length */
+ xvid_image_t output; /* [in] output image (written to) */
+} xvid_dec_frame_t;
+
+
+/* XVID_DEC_DECODE param2 :: optional */
+typedef struct
+{
+ int version;
+
+ int type; /* [out] output data type */
+ union {
+ struct { /* type>0 {XVID_TYPE_IVOP,XVID_TYPE_PVOP,XVID_TYPE_BVOP,XVID_TYPE_SVOP} */
+ int general; /* [out] flags */
+ int time_base; /* [out] time base */
+ int time_increment; /* [out] time increment */
+
+ /* XXX: external deblocking stuff */
+ int * qscale; /* [out] pointer to quantizer table */
+ int qscale_stride; /* [out] quantizer scale stride */
+
+ } vop;
+ struct { /* XVID_TYPE_VOL */
+ int general; /* [out] flags */
+ int width; /* [out] width */
+ int height; /* [out] height */
+ int par; /* [out] pixel aspect ratio (refer to XVID_PAR_xxx above) */
+ int par_width; /* [out] aspect ratio width [1..255] */
+ int par_height; /* [out] aspect ratio height [1..255] */
+ } vol;
+ } data;
+} xvid_dec_stats_t;
+
+#define XVID_ZONE_QUANT (1<<0)
+#define XVID_ZONE_WEIGHT (1<<1)
+
+typedef struct
+{
+ int frame;
+ int mode;
+ int increment;
+ int base;
+} xvid_enc_zone_t;
+
+
+/*----------------------------------------------------------------------------
+ * xvid_enc_stats_t structure
+ *
+ * Used in:
+ * - xvid_plg_data_t structure
+ * - optional parameter in xvid_encore() function
+ *
+ * .coding_type = XVID_TYPE_NOTHING if the stats are not given
+ *--------------------------------------------------------------------------*/
+
+typedef struct {
+ int version;
+
+ /* encoding parameters */
+ int type; /* [out] coding type */
+ int quant; /* [out] frame quantizer */
+ int vol_flags; /* [out] vol flags (see above) */
+ int vop_flags; /* [out] vop flags (see above) */
+
+ /* bitrate */
+ int length; /* [out] frame length */
+
+ int hlength; /* [out] header length (bytes) */
+ int kblks; /* [out] number of blocks compressed as Intra */
+ int mblks; /* [out] number of blocks compressed as Inter */
+ int ublks; /* [out] number of blocks marked as not_coded */
+
+ int sse_y; /* [out] Y plane's sse */
+ int sse_u; /* [out] U plane's sse */
+ int sse_v; /* [out] V plane's sse */
+} xvid_enc_stats_t;
+
+/*****************************************************************************
+ xvid plugin system -- internals
+
+ xvidcore will call XVID_PLG_INFO and XVID_PLG_CREATE during XVID_ENC_CREATE
+ before encoding each frame xvidcore will call XVID_PLG_BEFORE
+ after encoding each frame xvidcore will call XVID_PLG_AFTER
+ xvidcore will call XVID_PLG_DESTROY during XVID_ENC_DESTROY
+ ****************************************************************************/
+
+
+#define XVID_PLG_CREATE (1<<0)
+#define XVID_PLG_DESTROY (1<<1)
+#define XVID_PLG_INFO (1<<2)
+#define XVID_PLG_BEFORE (1<<3)
+#define XVID_PLG_FRAME (1<<4)
+#define XVID_PLG_AFTER (1<<5)
+
+/* xvid_plg_info_t.flags */
+#define XVID_REQORIGINAL (1<<0) /* plugin requires a copy of the original (uncompressed) image */
+#define XVID_REQPSNR (1<<1) /* plugin requires psnr between the uncompressed and compressed image*/
+#define XVID_REQDQUANTS (1<<2) /* plugin requires access to the dquant table */
+
+
+typedef struct
+{
+ int version;
+ int flags; /* [in:opt] plugin flags */
+} xvid_plg_info_t;
+
+
+typedef struct
+{
+ int version;
+
+ int num_zones; /* [out] */
+ xvid_enc_zone_t * zones; /* [out] */
+
+ int width; /* [out] */
+ int height; /* [out] */
+ int mb_width; /* [out] */
+ int mb_height; /* [out] */
+ int fincr; /* [out] */
+ int fbase; /* [out] */
+
+ void * param; /* [out] */
+} xvid_plg_create_t;
+
+
+typedef struct
+{
+ int version;
+
+ int num_frames; /* [out] total frame encoded */
+} xvid_plg_destroy_t;
+
+typedef struct
+{
+ int version;
+
+ xvid_enc_zone_t * zone; /* [out] current zone */
+
+ int width; /* [out] */
+ int height; /* [out] */
+ int mb_width; /* [out] */
+ int mb_height; /* [out] */
+ int fincr; /* [out] */
+ int fbase; /* [out] */
+
+ int min_quant[3]; /* [out] */
+ int max_quant[3]; /* [out] */
+
+ xvid_image_t reference; /* [out] -> [out] */
+ xvid_image_t current; /* [out] -> [in,out] */
+ xvid_image_t original; /* [out] after: points the original (uncompressed) copy of the current frame */
+ int frame_num; /* [out] frame number */
+
+ int type; /* [in,out] */
+ int quant; /* [in,out] */
+
+ int * dquant; /* [in,out] pointer to diff quantizer table */
+ int dquant_stride; /* [in,out] diff quantizer stride */
+
+ int vop_flags; /* [in,out] */
+ int vol_flags; /* [in,out] */
+ int motion_flags; /* [in,out] */
+
+/* Deprecated, use the stats field instead.
+ * Will disapear before 1.0 */
+ int length; /* [out] after: length of encoded frame */
+ int kblks; /* [out] number of blocks compressed as Intra */
+ int mblks; /* [out] number of blocks compressed as Inter */
+ int ublks; /* [out] number of blocks marked not_coded */
+ int sse_y; /* [out] Y plane's sse */
+ int sse_u; /* [out] U plane's sse */
+ int sse_v; /* [out] V plane's sse */
+/* End of duplicated data, kept only for binary compatibility */
+
+ int bquant_ratio; /* [in] */
+ int bquant_offset; /* [in] */
+
+ xvid_enc_stats_t stats; /* [out] frame statistics */
+} xvid_plg_data_t;
+
+/*****************************************************************************
+ xvid plugin system -- external
+
+ the application passes xvid an array of "xvid_plugin_t" at XVID_ENC_CREATE. the array
+ indicates the plugin function pointer and plugin-specific data.
+ xvidcore handles the rest. example:
+
+ xvid_enc_create_t create;
+ xvid_enc_plugin_t plugins[2];
+
+ plugins[0].func = xvid_psnr_func;
+ plugins[0].param = NULL;
+ plugins[1].func = xvid_cbr_func;
+ plugins[1].param = &cbr_data;
+
+ create.num_plugins = 2;
+ create.plugins = plugins;
+
+ ****************************************************************************/
+
+typedef int (xvid_plugin_func)(void * handle, int opt, void * param1, void * param2);
+
+typedef struct
+{
+ xvid_plugin_func * func;
+ void * param;
+} xvid_enc_plugin_t;
+
+
+extern xvid_plugin_func xvid_plugin_single; /* single-pass rate control */
+extern xvid_plugin_func xvid_plugin_2pass1; /* two-pass rate control: first pass */
+extern xvid_plugin_func xvid_plugin_2pass2; /* two-pass rate control: second pass */
+
+extern xvid_plugin_func xvid_plugin_lumimasking; /* lumimasking */
+
+extern xvid_plugin_func xvid_plugin_psnr; /* write psnr values to stdout */
+extern xvid_plugin_func xvid_plugin_dump; /* dump before and after yuvpgms */
+
+
+/* single pass rate control
+ * CBR and Constant quantizer modes */
+typedef struct
+{
+ int version;
+
+ int bitrate; /* [in] bits per second */
+ int reaction_delay_factor; /* [in] */
+ int averaging_period; /* [in] */
+ int buffer; /* [in] */
+} xvid_plugin_single_t;
+
+
+typedef struct {
+ int version;
+
+ const char * filename;
+} xvid_plugin_2pass1_t;
+
+
+#define XVID_PAYBACK_BIAS 0 /* payback with bias */
+#define XVID_PAYBACK_PROP 1 /* payback proportionally */
+
+typedef struct {
+ int version;
+
+ int bitrate; /* [in] bits per second */
+ const char * filename; /* [in] first pass stats filename */
+
+ int keyframe_boost; /* [in] keyframe boost percentage: [0..100] */
+ int curve_compression_high; /* [in] percentage of compression performed on the high part of the curve (above average) */
+ int curve_compression_low; /* [in] percentage of compression performed on the low part of the curve (below average) */
+ int overflow_control_strength;/* [in] Payback delay expressed in number of frames */
+ int max_overflow_improvement; /* [in] percentage of allowed range for a frame that gets bigger because of overflow bonus */
+ int max_overflow_degradation; /* [in] percentage of allowed range for a frame that gets smaller because of overflow penalty */
+
+ int kfreduction; /* [in] maximum bitrate reduction applied to an iframe under the kfthreshold distance limit */
+ int kfthreshold; /* [in] if an iframe is closer to the next iframe than this distance, a quantity of bits
+ * is substracted from its bit allocation. The reduction is computed as multiples of
+ * kfreduction/kthreshold. It reaches kfreduction when the distance == kfthreshold,
+ * 0 for 1<distance<kfthreshold */
+
+ int container_frame_overhead; /* [in] How many bytes the controller has to compensate per frame due to container format overhead */
+}xvid_plugin_2pass2_t;
+
+/*****************************************************************************
+ * ENCODER API
+ ****************************************************************************/
+
+/*----------------------------------------------------------------------------
+ * Encoder operations
+ *--------------------------------------------------------------------------*/
+
+#define XVID_ENC_CREATE 0 /* create encoder instance; returns 0 on success */
+#define XVID_ENC_DESTROY 1 /* destroy encoder instance; returns 0 on success */
+#define XVID_ENC_ENCODE 2 /* encode a frame: returns number of ouput bytes
+ * 0 means this frame should not be written (ie. encoder lag) */
+
+
+/*----------------------------------------------------------------------------
+ * Encoder entry point
+ *--------------------------------------------------------------------------*/
+
+extern int xvid_encore(void *handle, int opt, void *param1, void *param2);
+
+/* Quick API reference
+ *
+ * XVID_ENC_CREATE operation
+ * - handle: ignored
+ * - opt: XVID_ENC_CREATE
+ * - param1: address of a xvid_enc_create_t structure
+ * - param2: ignored
+ *
+ * XVID_ENC_ENCODE operation
+ * - handle: an instance returned by a CREATE op
+ * - opt: XVID_ENC_ENCODE
+ * - param1: address of a xvid_enc_frame_t structure
+ * - param2: address of a xvid_enc_stats_t structure (optional)
+ * its return value is asynchronous to what is written to the buffer
+ * depending on the delay introduced by bvop use. It's display
+ * ordered.
+ *
+ * XVID_ENC_DESTROY operation
+ * - handle: an instance returned by a CREATE op
+ * - opt: XVID_ENC_DESTROY
+ * - param1: ignored
+ * - param2: ignored
+ */
+
+
+/*----------------------------------------------------------------------------
+ * "Global" flags
+ *
+ * These flags are used for xvid_enc_create_t->global field during instance
+ * creation (operation XVID_ENC_CREATE)
+ *--------------------------------------------------------------------------*/
+
+#define XVID_GLOBAL_PACKED (1<<0) /* packed bitstream */
+#define XVID_GLOBAL_CLOSED_GOP (1<<1) /* closed_gop: was DX50BVOP dx50 bvop compatibility */
+#define XVID_GLOBAL_EXTRASTATS_ENABLE (1<<2)
+#if 0
+#define XVID_GLOBAL_VOL_AT_IVOP (1<<3) /* write vol at every ivop: WIN32/divx compatibility */
+#define XVID_GLOBAL_FORCE_VOL (1<<4) /* when vol-based parameters are changed, insert an ivop NOT recommended */
+#endif
+
+
+/*----------------------------------------------------------------------------
+ * "VOL" flags
+ *
+ * These flags are used for xvid_enc_frame_t->vol_flags field during frame
+ * encoding (operation XVID_ENC_ENCODE)
+ *--------------------------------------------------------------------------*/
+
+#define XVID_VOL_MPEGQUANT (1<<0) /* enable MPEG type quantization */
+#define XVID_VOL_EXTRASTATS (1<<1) /* enable plane sse stats */
+#define XVID_VOL_QUARTERPEL (1<<2) /* enable quarterpel: frames will encoded as quarterpel */
+#define XVID_VOL_GMC (1<<3) /* enable GMC; frames will be checked for gmc suitability */
+#define XVID_VOL_REDUCED_ENABLE (1<<4) /* enable reduced resolution vops: frames will be checked for rrv suitability */
+#define XVID_VOL_INTERLACING (1<<5) /* enable interlaced encoding */
+
+
+/*----------------------------------------------------------------------------
+ * "VOP" flags
+ *
+ * These flags are used for xvid_enc_frame_t->vop_flags field during frame
+ * encoding (operation XVID_ENC_ENCODE)
+ *--------------------------------------------------------------------------*/
+
+/* Always valid */
+#define XVID_VOP_DEBUG (1<< 0) /* print debug messages in frames */
+#define XVID_VOP_HALFPEL (1<< 1) /* use halfpel interpolation */
+#define XVID_VOP_INTER4V (1<< 2) /* use 4 motion vectors per MB */
+#define XVID_VOP_TRELLISQUANT (1<< 3) /* use trellis based R-D "optimal" quantization */
+#define XVID_VOP_CHROMAOPT (1<< 4) /* enable chroma optimization pre-filter */
+#define XVID_VOP_CARTOON (1<< 5) /* use 'cartoon mode' */
+#define XVID_VOP_GREYSCALE (1<< 6) /* enable greyscale only mode (even for color input material chroma is ignored) */
+#define XVID_VOP_HQACPRED (1<< 7) /* high quality ac prediction */
+#define XVID_VOP_MODEDECISION_RD (1<< 8) /* enable DCT-ME and use it for mode decision */
+#define XVID_VOP_FAST_MODEDECISION_RD (1<<12) /* use simplified R-D mode decision */
+
+/* Only valid for vol_flags|=XVID_VOL_INTERLACING */
+#define XVID_VOP_TOPFIELDFIRST (1<< 9) /* set top-field-first flag */
+#define XVID_VOP_ALTERNATESCAN (1<<10) /* set alternate vertical scan flag */
+
+/* only valid for vol_flags|=XVID_VOL_REDUCED_ENABLED */
+#define XVID_VOP_REDUCED (1<<11) /* reduced resolution vop */
+
+
+/*----------------------------------------------------------------------------
+ * "Motion" flags
+ *
+ * These flags are used for xvid_enc_frame_t->motion field during frame
+ * encoding (operation XVID_ENC_ENCODE)
+ *--------------------------------------------------------------------------*/
+
+/* Motion Estimation Search Patterns */
+#define XVID_ME_ADVANCEDDIAMOND16 (1<< 0) /* use advdiamonds instead of diamonds as search pattern */
+#define XVID_ME_ADVANCEDDIAMOND8 (1<< 1) /* use advdiamond for XVID_ME_EXTSEARCH8 */
+#define XVID_ME_USESQUARES16 (1<< 2) /* use squares instead of diamonds as search pattern */
+#define XVID_ME_USESQUARES8 (1<< 3) /* use square for XVID_ME_EXTSEARCH8 */
+
+/* SAD operator based flags */
+#define XVID_ME_HALFPELREFINE16 (1<< 4)
+#define XVID_ME_HALFPELREFINE8 (1<< 6)
+#define XVID_ME_QUARTERPELREFINE16 (1<< 7)
+#define XVID_ME_QUARTERPELREFINE8 (1<< 8)
+#define XVID_ME_GME_REFINE (1<< 9)
+#define XVID_ME_EXTSEARCH16 (1<<10) /* extend PMV by more searches */
+#define XVID_ME_EXTSEARCH8 (1<<11) /* use diamond/square for extended 8x8 search */
+#define XVID_ME_CHROMA_PVOP (1<<12) /* also use chroma for P_VOP/S_VOP ME */
+#define XVID_ME_CHROMA_BVOP (1<<13) /* also use chroma for B_VOP ME */
+#define XVID_ME_FASTREFINE16 (1<<25) /* use low-complexity refinement functions */
+#define XVID_ME_FASTREFINE8 (1<<29) /* low-complexity 8x8 sub-block refinement */
+
+/* Rate Distortion based flags
+ * Valid when XVID_VOP_MODEDECISION_RD is enabled */
+#define XVID_ME_HALFPELREFINE16_RD (1<<14) /* perform RD-based halfpel refinement */
+#define XVID_ME_HALFPELREFINE8_RD (1<<15) /* perform RD-based halfpel refinement for 8x8 mode */
+#define XVID_ME_QUARTERPELREFINE16_RD (1<<16) /* perform RD-based qpel refinement */
+#define XVID_ME_QUARTERPELREFINE8_RD (1<<17) /* perform RD-based qpel refinement for 8x8 mode */
+#define XVID_ME_EXTSEARCH_RD (1<<18) /* perform RD-based search using square pattern enable XVID_ME_EXTSEARCH8 to do this in 8x8 search as well */
+#define XVID_ME_CHECKPREDICTION_RD (1<<19) /* always check vector equal to prediction */
+
+/* Other */
+#define XVID_ME_DETECT_STATIC_MOTION (1<<24) /* speed-up ME by detecting stationary scenes */
+#define XVID_ME_SKIP_DELTASEARCH (1<<26) /* speed-up by skipping b-frame delta search */
+#define XVID_ME_FAST_MODEINTERPOLATE (1<<27) /* speed-up by partly skipping interpolate mode */
+#define XVID_ME_BFRAME_EARLYSTOP (1<<28) /* speed-up by early exiting b-search */
+
+/* Unused */
+#define XVID_ME_UNRESTRICTED16 (1<<20) /* unrestricted ME, not implemented */
+#define XVID_ME_OVERLAPPING16 (1<<21) /* overlapping ME, not implemented */
+#define XVID_ME_UNRESTRICTED8 (1<<22) /* unrestricted ME, not implemented */
+#define XVID_ME_OVERLAPPING8 (1<<23) /* overlapping ME, not implemented */
+
+
+/*----------------------------------------------------------------------------
+ * xvid_enc_create_t structure definition
+ *
+ * This structure is passed as param1 during an instance creation (operation
+ * XVID_ENC_CREATE)
+ *--------------------------------------------------------------------------*/
+
+typedef struct {
+ int version;
+
+ int profile; /* [in] profile@level; refer to XVID_PROFILE_xxx */
+ int width; /* [in] frame dimensions; width, pixel units */
+ int height; /* [in] frame dimensions; height, pixel units */
+
+ int num_zones; /* [in:opt] number of bitrate zones */
+ xvid_enc_zone_t * zones; /* ^^ zone array */
+
+ int num_plugins; /* [in:opt] number of plugins */
+ xvid_enc_plugin_t * plugins; /* ^^ plugin array */
+
+ int num_threads; /* [in:opt] number of threads */
+ int max_bframes; /* [in:opt] max sequential bframes (0=disable bframes) */
+
+ int global; /* [in:opt] global flags; controls encoding behavior */
+
+ /* --- vol-based stuff; included here for convenience */
+ int fincr; /* [in:opt] framerate increment; set to zero for variable framerate */
+ int fbase; /* [in] framerate base frame_duration = fincr/fbase seconds*/
+ /* ---------------------------------------------- */
+
+ /* --- vop-based; included here for convenience */
+ int max_key_interval; /* [in:opt] the maximum interval between key frames */
+
+ int frame_drop_ratio; /* [in:opt] frame dropping: 0=drop none... 100=drop all */
+
+ int bquant_ratio; /* [in:opt] bframe quantizer multipier/offeset; used to decide bframes quant when bquant==-1 */
+ int bquant_offset; /* bquant = (avg(past_ref_quant,future_ref_quant)*bquant_ratio + bquant_offset) / 100 */
+
+ int min_quant[3]; /* [in:opt] */
+ int max_quant[3]; /* [in:opt] */
+ /* ---------------------------------------------- */
+
+ void *handle; /* [out] encoder instance handle */
+} xvid_enc_create_t;
+
+
+/*----------------------------------------------------------------------------
+ * xvid_enc_frame_t structure definition
+ *
+ * This structure is passed as param1 during a frame encoding (operation
+ * XVID_ENC_ENCODE)
+ *--------------------------------------------------------------------------*/
+
+/* out value for the frame structure->type field
+ * unlike stats output in param2, this field is not asynchronous and tells
+ * the client app, if the frame written into the stream buffer is an ivop
+ * usually used for indexing purpose in the container */
+#define XVID_KEYFRAME (1<<1)
+
+/* The structure */
+typedef struct {
+ int version;
+
+ /* VOL related stuff
+ * unless XVID_FORCEVOL is set, the encoder will not react to any changes
+ * here until the next VOL (keyframe). */
+
+ int vol_flags; /* [in] vol flags */
+ unsigned char *quant_intra_matrix; /* [in:opt] custom intra qmatrix */
+ unsigned char *quant_inter_matrix; /* [in:opt] custom inter qmatrix */
+
+ int par; /* [in:opt] pixel aspect ratio (refer to XVID_PAR_xxx above) */
+ int par_width; /* [in:opt] aspect ratio width */
+ int par_height; /* [in:opt] aspect ratio height */
+
+ /* Other fields that can change on a frame base */
+
+ int fincr; /* [in:opt] framerate increment, for variable framerate only */
+ int vop_flags; /* [in] (general)vop-based flags */
+ int motion; /* [in] ME options */
+
+ xvid_image_t input; /* [in] input image (read from) */
+
+ int type; /* [in:opt] coding type */
+ int quant; /* [in] frame quantizer; if <=0, automatic (ratecontrol) */
+ int bframe_threshold;
+
+ void *bitstream; /* [in:opt] bitstream ptr (written to)*/
+ int length; /* [in:opt] bitstream length (bytes) */
+
+ int out_flags; /* [out] bitstream output flags */
+} xvid_enc_frame_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/*
+ * Please do not modify the tag line.
+ *
+ * arch-tag: 86e02da0-ea04-4fff-993e-011fe7ce0682 xvid header
+ */