update openjpeg + x265, unproxy clip fix, config mods for lv2/opus/x265-10bit
authorGood Guy <good1.2guy@gmail.com>
Wed, 6 Jun 2018 22:56:21 +0000 (16:56 -0600)
committerGood Guy <good1.2guy@gmail.com>
Wed, 6 Jun 2018 22:56:21 +0000 (16:56 -0600)
15 files changed:
cinelerra-5.1/cinelerra/Makefile
cinelerra-5.1/cinelerra/ffmpeg.C
cinelerra-5.1/cinelerra/mwindow.h
cinelerra-5.1/cinelerra/mwindowedit.C
cinelerra-5.1/cinelerra/pluginlv2client.C
cinelerra-5.1/cinelerra/pluginlv2config.h
cinelerra-5.1/cinelerra/pluginlv2gui.C
cinelerra-5.1/cinelerra/pluginlv2ui.C
cinelerra-5.1/cinelerra/pluginlv2ui.h
cinelerra-5.1/configure.ac
cinelerra-5.1/ffmpeg/video/h265-10bit.mp4 [moved from cinelerra-5.1/ffmpeg/video/h265-12bit.mp4 with 69% similarity]
cinelerra-5.1/thirdparty/src/openjpeg-2.1.0-20160221.tar.xz [deleted file]
cinelerra-5.1/thirdparty/src/openjpeg-2.3.0.tar.xz [new file with mode: 0644]
cinelerra-5.1/thirdparty/src/x265_2.7.tar.xz [deleted file]
cinelerra-5.1/thirdparty/src/x265_2.8.tar.xz [new file with mode: 0644]

index 2320f3cd4abba4176b6ccd3c2be4116d1bce88dd..6abdc06385fe67266d7cc58c2800785579376ec4 100644 (file)
@@ -376,7 +376,7 @@ CUTLIBS = \
 BDWRITE = $(OBJDIR)/bdwrite
 BDWOBJS = $(OBJDIR)/bdwrite.o
 
-ifneq ($(WANT_LV2UI),no)
+ifneq ($(WANT_LV2),no)
 LV2UI = $(OBJDIR)/lv2ui
 LV2OBJS = \
        $(OBJDIR)/lv2ui.o \
@@ -480,7 +480,7 @@ $(OBJDIR)/sha1.o:   sha1.C sha1.h
        $(CXX) `cat $(OBJDIR)/c_flags` -O3 -c $< -o $@
 
 #lv2
-ifneq ($(WANT_LV2UI),no)
+ifneq ($(WANT_LV2),no)
 GTK2_INCS := `pkg-config --cflags gtk+-2.0`
 GTK2_LIBS := `pkg-config --libs gtk+-2.0`
 
index ac85cccde78fd3e12d881517040888835ea56734..2ac09f730a9612126925dcc7fd5df14bb4517946 100644 (file)
@@ -1615,7 +1615,7 @@ void FFMPEG::scan_video_options(Asset *asset, EDL *edl)
                AVCodec *av_codec = !get_codec(video_codec, "video", asset->vcodec) ?
                        avcodec_find_encoder_by_name(video_codec) : 0;
                if( av_codec && av_codec->pix_fmts ) {
-                       if( edl ) {
+                       if( 0 && edl ) { // frequently picks a bad answer
                                int color_model = edl->session->color_model;
                                int max_bits = BC_CModels::calculate_pixelsize(color_model) * 8;
                                max_bits /= BC_CModels::components(color_model);
index 66f8f39373898056052f1b8e40e21d475240e7ce..30ecbec58059fcd6b72db3d512610eab59d8420f 100644 (file)
@@ -507,6 +507,7 @@ public:
        int modify_edithandles();
        int modify_pluginhandles();
        void finish_modify_handles();
+       void rescale_proxy(EDL *clip, int orig_scale, int new_scale);
        void set_proxy(int use_scaler, int new_scale, int auto_scale,
                ArrayList<Indexable*> *orig_assets,
                ArrayList<Indexable*> *proxy_assets);
index 065c1f9f08d475fe994aec06fb3a1f39de87cd04..cfabc9bb1c73820aad08cb905bad3bcdfcd57fa8 100644 (file)
@@ -2319,6 +2319,38 @@ void MWindow::remap_audio(int pattern)
        }
 }
 
+
+void MWindow::rescale_proxy(EDL *clip, int orig_scale, int new_scale)
+{
+       if( orig_scale == new_scale ) return;
+// project size
+       float orig_w = (float)clip->session->output_w * orig_scale;
+       float orig_h = (float)clip->session->output_h * orig_scale;
+       if( !clip->parent_edl ) {
+               clip->session->output_w = Units::round(orig_w / new_scale);
+               clip->session->output_h = Units::round(orig_h / new_scale);
+       }
+
+// track sizes
+       for( Track *track=clip->tracks->first; track; track=track->next ) {
+               if( track->data_type != TRACK_VIDEO ) continue;
+               orig_w = (float)track->track_w * orig_scale;
+               orig_h = (float)track->track_h * orig_scale;
+               track->track_w = Units::round(orig_w / new_scale);
+               track->track_h = Units::round(orig_h / new_scale);
+               ((MaskAutos*)track->automation->autos[AUTOMATION_MASK])->
+                       set_proxy(orig_scale, new_scale);
+               ((FloatAutos*)track->automation->autos[AUTOMATION_CAMERA_X])->
+                       set_proxy(orig_scale, new_scale);
+               ((FloatAutos*)track->automation->autos[AUTOMATION_CAMERA_Y])->
+                       set_proxy(orig_scale, new_scale);
+               ((FloatAutos*)track->automation->autos[AUTOMATION_PROJECTOR_X])->
+                       set_proxy(orig_scale, new_scale);
+               ((FloatAutos*)track->automation->autos[AUTOMATION_PROJECTOR_Y])->
+                       set_proxy(orig_scale, new_scale);
+       }
+}
+
 void MWindow::set_proxy(int use_scaler, int new_scale, int auto_scale,
                ArrayList<Indexable*> *orig_assets,
                ArrayList<Indexable*> *proxy_assets)
@@ -2339,32 +2371,8 @@ void MWindow::set_proxy(int use_scaler, int new_scale, int auto_scale,
                new_scale = 1;
        }
 
-       if( !orig_use_scaler && new_scale != orig_scale ) {
-// project size
-               float orig_w = (float)edl->session->output_w * orig_scale;
-               float orig_h = (float)edl->session->output_h * orig_scale;
-               edl->session->output_w = Units::round(orig_w / new_scale);
-               edl->session->output_h = Units::round(orig_h / new_scale);
-
-// track sizes
-               for( Track *track=edl->tracks->first; track; track=track->next ) {
-                       if( track->data_type != TRACK_VIDEO ) continue;
-                       orig_w = (float)track->track_w * orig_scale;
-                       orig_h = (float)track->track_h * orig_scale;
-                       track->track_w = Units::round(orig_w / new_scale);
-                       track->track_h = Units::round(orig_h / new_scale);
-                       ((MaskAutos*)track->automation->autos[AUTOMATION_MASK])->
-                               set_proxy(orig_scale, new_scale);
-                       ((FloatAutos*)track->automation->autos[AUTOMATION_CAMERA_X])->
-                               set_proxy(orig_scale, new_scale);
-                       ((FloatAutos*)track->automation->autos[AUTOMATION_CAMERA_Y])->
-                               set_proxy(orig_scale, new_scale);
-                       ((FloatAutos*)track->automation->autos[AUTOMATION_PROJECTOR_X])->
-                               set_proxy(orig_scale, new_scale);
-                       ((FloatAutos*)track->automation->autos[AUTOMATION_PROJECTOR_Y])->
-                               set_proxy(orig_scale, new_scale);
-               }
-       }
+       if( !orig_use_scaler )
+               rescale_proxy(edl, orig_scale, new_scale);
 
 // change original assets to proxy assets
        int awindow_folder = use_scaler || new_scale != 1 ? AW_PROXY_FOLDER : AW_MEDIA_FOLDER;
@@ -2383,15 +2391,19 @@ void MWindow::set_proxy(int use_scaler, int new_scale, int auto_scale,
                }
                for( int j=0,m=edl->clips.size(); j<m; ++j ) {
                        EDL *clip = edl->clips[j];
+                       int has_proxy = 0;
                        for( Track *track=clip->tracks->first; track; track=track->next ) {
                                if( track->data_type != TRACK_VIDEO ) continue;
                                for( Edit *edit=track->edits->first; edit; edit=edit->next ) {
                                        if( !edit->asset ) continue;
                                        if( !strcmp(edit->asset->path, orig_assets->get(i)->path) ) {
+                                               has_proxy = 1;
                                                edit->asset = proxy_asset;
                                        }
                                }
                        }
+                       if( has_proxy && !orig_use_scaler )
+                               rescale_proxy(clip, orig_scale, new_scale);
                }
        }
 }
index d5c385b0e052d70581de7ff972e0f06e5a293cc6..7ccb6ef8f2aad633d36c2a0c931fc7034c4872b0 100644 (file)
@@ -431,11 +431,7 @@ void PluginLV2UI::reset_gui() {}
 
 ForkChild *PluginLV2ParentUI::new_fork()
 {
-#ifdef HAVE_LV2UI
        return new PluginLV2ChildUI();
-#else
-       return 0;
-#endif
 }
 
 
index 7f18461bdf20ded9418594c6e75eb457a6efb2a8..efe8d1c9c31b553f7b1f603c91c4edbac3b09650 100644 (file)
 
 #ifdef HAVE_LV2
 #include <lilv/lilv.h>
-
-#ifdef HAVE_LV2UI
 #include <suil/suil.h>
 
 #define NS_UI "http://lv2plug.in/ns/extensions/ui#"
 #include <lv2/lv2plug.in/ns/extensions/ui/ui.h>
-#endif
-
 #include <lv2/lv2plug.in/ns/ext/atom/atom.h>
 #include <lv2/lv2plug.in/ns/ext/urid/urid.h>
 #include <lv2/lv2plug.in/ns/ext/state/state.h>
index e9e62d533cf1b4b7ef108d85fc29dd93ea767634..3c0c45663fb946d5e6db5f59025d4fb2a64ec7c7 100644 (file)
@@ -1,4 +1,3 @@
-#ifdef HAVE_LV2
 
 /*
  * CINELERRA
@@ -19,6 +18,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  */
+#ifdef HAVE_LV2
 
 #include "clip.h"
 #include "cstrdup.h"
@@ -212,12 +212,8 @@ void PluginLV2ClientWindow::create_objects()
        BC_Title *title;
        int x = 10, y = 10, x1;
        add_subwindow(title = new BC_Title(x, y, client->title));
-#ifdef HAVE_LV2UI
        x1 = get_w() - BC_GenericButton::calculate_w(this, _("UI")) - 8;
        add_subwindow(ui = new PluginLV2ClientUI(this, x1, y));
-#else
-       ui = 0;
-#endif
        y += title->get_h() + 10;
        add_subwindow(varbl = new BC_Title(x, y, ""));
        add_subwindow(range = new BC_Title(x+160, y, ""));
@@ -254,10 +250,8 @@ void PluginLV2ClientWindow::create_objects()
 int PluginLV2ClientWindow::resize_event(int w, int h)
 {
        int x1;
-#ifdef HAVE_LV2UI
        x1 = w - ui->get_w() - 8;
        ui->reposition_window(x1, ui->get_y());
-#endif
        x1 = w - reset->get_w() - 8;
        reset->reposition_window(x1, reset->get_y());
        x1 = w - apply->get_w() - 8;
index 3e1c3ee9553ad354cc571b29cf42773d9c5829aa..929b5c676f4123669ca7fe6aa808c096e1df855e 100644 (file)
@@ -1,4 +1,3 @@
-#ifdef HAVE_LV2UI
 
 // shared between parent/child fork
 #include "language.h"
@@ -330,4 +329,3 @@ int PluginLV2ChildUI::handle_child()
        return 1;
 }
 
-#endif /* HAVE_LV2UI */
index 63a401027fe0df64849dd6cac675b13e538bc579..c710060f6a1be7447ffcdf166a99df8524c431a1 100644 (file)
@@ -22,8 +22,6 @@
 #ifndef __PLUGINLV2UI_H__
 #define __PLUGINLV2UI_H__
 
-#ifdef HAVE_LV2UI
-
 #include "forkbase.h"
 #include "pluginlv2.h"
 #include "pluginlv2client.h"
@@ -96,5 +94,5 @@ public:
        int handle_child();
        int run(int ac, char **av);
 };
-#endif
+
 #endif
index 60497a06150dce72d15a1f6cac4f81bed6dad61f..d3a03d4b0f0c4cd3925a7b494e2d8c3f8b9e3029 100644 (file)
@@ -36,7 +36,6 @@ CHECK_WITH([exec-name],[binary executable name],[CIN],[cin])
 CHECK_WITH([single-user],[to install cin in bin],[CINBIN_BUILD],[no])
 CHECK_WITH([ladspa-build],[build ladspa library],[LADSPA_BUILD],[yes])
 CHECK_WITH([lv2],[lv2 library support],[LV2],[yes])
-CHECK_WITH([lv2ui],[lv2 ui support],[LV2UI],[yes])
 CHECK_WITH([cinlib],[cinelerra library path],[CINLIB_DIR],[auto])
 CHECK_WITH([cindat],[cinelerra share path],[CINDAT_DIR],[auto])
 CHECK_WITH([plugin-dir],[plugin install dir],[PLUGIN_DIR],[auto])
@@ -47,14 +46,12 @@ CHECK_WITH([git-ffmpeg],[git ffmpeg using url],[GIT_FFMPEG],[no])
 CHECK_WITH([noelision],[use noelision/libpthread],[NOELISION],[auto])
 
 if test "x$WANT_LV2" != "xno"; then
-  if test "x$WANT_LV2UI" != "xno"; then
-    GTK2_LIBS=`pkg-config --libs gtk+-2.0`
-    AC_CHECK_LIB([m], [gtk_init], [HAVE_gtk=yes], [HAVE_gtk=no], [$GTK2_LIBS])
-    test "x$HAVE_gtk" != "xno" && test -z "`pkg-config --cflags gtk+-2.0`" && HAVE_gtk=no
-    test "x$HAVE_gtk" != "xno" && test -z "`pkg-config --libs gtk+-2.0`" && HAVE_gtk=no
-    if test "x$HAVE_gtk" = "xno"; then
-      AC_MSG_ERROR([LV2UI requires gtk+-2.0 support.])
-    fi
+  GTK2_LIBS=`pkg-config --libs gtk+-2.0`
+  AC_CHECK_LIB([m], [gtk_init], [HAVE_gtk=yes], [HAVE_gtk=no], [$GTK2_LIBS])
+  test "x$HAVE_gtk" != "xno" && test -z "`pkg-config --cflags gtk+-2.0`" && HAVE_gtk=no
+  test "x$HAVE_gtk" != "xno" && test -z "`pkg-config --libs gtk+-2.0`" && HAVE_gtk=no
+  if test "x$HAVE_gtk" = "xno"; then
+    AC_MSG_ERROR([LV2 requires gtk+-2.0 support.])
   fi
 fi
 
@@ -251,7 +248,7 @@ PKG_3RD([opus],[auto],
   [ include ])
 
 PKG_3RD([openjpeg],[auto],
-  [openjpeg-2.1.0-20160221],
+  [openjpeg-2.3.0],
   [ bin/libopenjp2.a ],
   [ src/lib/openjp2 ])
 
@@ -331,7 +328,7 @@ PKG_3RD([x264],[auto],
   [ . ])
 
 PKG_3RD([x265],[auto],
-  [x265_2.7],
+  [x265_2.8],
   [ libx265.a ],
   [ . source ])
 
@@ -380,6 +377,7 @@ AC_ARG_ENABLE([$1],
 
 CHECK_ENABLE([static-build], [STATIC_BUILD], [build static], [auto])
 CHECK_ENABLE([x264_hidepth], [X264_HIDEPTH], [build x264 10bit], [no])
+CHECK_ENABLE([x265_hidepth], [X265_HIDEPTH], [build x265 10bit], [no])
 
 test "x$WANT_STATIC_BUILD" = "xauto" && WANT_STATIC_BUILD=$WANT_CINBIN_BUILD
 
@@ -591,7 +589,7 @@ CHECK_WANT([ESOUND], [no], [use esd], [
  CHECK_LIB([audiofile], [audiofile], [afOpenFile])
  CHECK_HEADERS([audiofile], [audiofile headers], [audiofile.h])])
 
-CHECK_WANT([LIBOPUS], [auto], [use libopus], [
+CHECK_WANT([OPUS], [auto], [use libopus], [
  CHECK_LIB([opus], [opus], [opus_multistream_decoder_create])
  CHECK_HEADERS([opus], [libopus headers], [opus/opus_multistream.h])])
 
@@ -603,16 +601,9 @@ CHECK_WANT([LV2], [auto], [use lv2], [
  CHECK_LIB([sratom], [sratom-0], [sratom_new])
  CFLAGS="-I/usr/include/lilv-0"
  CHECK_HEADERS([lv2], [lilv headers], [lilv/lilv.h])
- CFLAGS="$saved_CFLAGS"])
-
-if test "x$WANT_LV2" = "xno"; then
- WANT_LV2UI=no
-fi
-
-CHECK_WANT([LV2UI], [auto], [use lv2ui], [
  CHECK_LIB([suil], [suil-0], [suil_instance_new])
  CFLAGS="-I/usr/include/suil-0"
- CHECK_HEADERS([lv2ui], [suil headers], [suil/suil.h])
+ CHECK_HEADERS([lv2], [suil headers], [suil/suil.h])
  CFLAGS="$saved_CFLAGS"])
 
 CHECK_WANT([DL], [auto], [system has libdl], [
@@ -757,10 +748,13 @@ PKG_PROVIDE([lilv], [$WANT_LV2])
 PKG_PROVIDE([sratom], [$WANT_LV2])
 PKG_PROVIDE([serd], [$WANT_LV2])
 PKG_PROVIDE([sord], [$WANT_LV2])
-PKG_PROVIDE([suil], [$WANT_LV2UI])
+PKG_PROVIDE([suil], [$WANT_LV2])
 
-test "x$WANT_LV2"   = "xyes" && test "x$BUILD_lilv" = "x0" && CFG_CFLAGS+=' -I/usr/include/lilv-0'
-test "x$WANT_LV2UI" = "xyes" && test "x$BUILD_suil" = "x0" && CFG_CFLAGS+=' -I/usr/include/suil-0'
+if test "x$WANT_LV2" = "xyes"; then
+  if test "x$HAVE_lv2" = "xyes" -a "x$BUILD_lilv" = "x0"; then
+    CFG_CFLAGS+=' -I/usr/include/lilv-0 -I/usr/include/suil-0'
+  fi
+fi
 
 AC_SUBST(STATIC_BLDS)
 AC_SUBST(SHARED_LIBS)
@@ -772,7 +766,7 @@ AC_SUBST(SYSTEM_LIBS)
 
 echo ""
 for v in GL XFT XXF86VM OSS ALSA FIREWIRE DV DVB \
-        VIDEO4LINUX2 ESOUND PACTL OPENEXR LV2 LV2UI; do
+        VIDEO4LINUX2 ESOUND PACTL OPENEXR LV2; do
   eval vv="\$WANT_$v"
   if test "x$vv" != "xno"; then
     CFG_CFLAGS+=" -DHAVE_$v"
@@ -814,10 +808,12 @@ if test "x$HAVE_DL" = "xyes"; then
   EXTRA_LIBS+=' -ldl'
   FFMPEG_EXTRA_CFG+=' --extra-ldflags="-ldl"'
 fi
-if test "x$HAVE_opus" = "xyes"; then
-  EXTRA_LIBS+=' -lopus'
-  CFG_CFLAGS+=' -I/usr/include/opus'
+if test "x$WANT_OPUS" = "xyes"; then
   FFMPEG_EXTRA_CFG+=' --enable-libopus'
+  if "x$HAVE_OPUS" = "xyes" -a "x$BUILD_opus" = "x0"; then
+    EXTRA_LIBS+=' -lopus'
+    CFG_CFLAGS+=' -I/usr/include/opus'
+  fi
 fi
 
 # intel lock elision bugs
@@ -833,6 +829,7 @@ fi
 AC_SUBST(EXTRA_LIBS)
 AC_SUBST(FFMPEG_EXTRA_CFG)
 AC_SUBST(WANT_X264_HIDEPTH)
+AC_SUBST(WANT_X265_HIDEPTH)
 
 AC_SUBST(CFG_CFLAGS)
 AC_SUBST(CFG_CXXFLAGS)
@@ -889,9 +886,12 @@ echo ""
 for flg in $CFG_CXXFLAGS; do echo "CXXFLAGS += $flg"; done
 echo ""
 
-if test  $WANT_X264_HIDEPTH = "yes" ; then
+if test "x$WANT_X264_HIDEPTH" = "xyes" ; then
   X264_CFG_PARAMS="$X264_CFG_PARAMS --bit-depth=10"
 fi
+if test "x$WANT_X265_HIDEPTH" = "xyes" ; then
+  X265_CFG_PARAMS="$X265_CFG_PARAMS -DHIGH_BIT_DEPTH:BOOL=ON" # -DMAIN12:BOOL=ON"
+fi
 
 for pkg in $STATIC_PKGS; do
   eval pkg_lib="\$PKG_$pkg"
@@ -955,11 +955,14 @@ if test "x$HAVE_tiff" = "xyes"; then
 fi
 
 if test "x$WANT_GIT_FFMPEG" != "xno"; then
-echo "ffmpeg.git := $WANT_GIT_FFMPEG"
+  echo "ffmpeg.git := $WANT_GIT_FFMPEG"
 fi
-if test "x$HAVE_opus" = "xyes"; then
-echo 'ffmpeg.cflags+=" -I/usr/include/opus"'
+if test "x$WANT_OPUS" = "xyes" -a "x$BUILD_opus" = "x0"; then
+  echo 'ffmpeg.cflags+=" -I/usr/include/opus"'
 fi
 if test "x$X264_CFG_PARAMS" != "x" ; then
   echo "x264.cfg_params :=$X264_CFG_PARAMS --enable-static --enable-pic"
 fi
+if test "x$X265_CFG_PARAMS" != "x" ; then
+  echo "x265.cfg_params :=$X265_CFG_PARAMS -DENABLE_SHARED=no"
+fi
similarity index 69%
rename from cinelerra-5.1/ffmpeg/video/h265-12bit.mp4
rename to cinelerra-5.1/ffmpeg/video/h265-10bit.mp4
index f52813d9291ba92adf5a216169507eb8c486eb35..b0d38ad72520c50c1d2096b77039c53e22e9a6b6 100644 (file)
@@ -3,9 +3,9 @@ mp4 libx265
 strict=-2
 colorspace=bt2020_cl
 color_primaries=bt2020
-color_trc=bt2020_12bit
-pixel_format=yuv422p12
+color_trc=bt2020_10bit
+pixel_format=yuv422p10
 # use framerate for 1 keyframe/sec, needed for seeks
 keyint_min=30
-x265-params=output-depth=12:keyint=30
+x265-params=output-depth=10:keyint=30
 cin_quality=-1
diff --git a/cinelerra-5.1/thirdparty/src/openjpeg-2.1.0-20160221.tar.xz b/cinelerra-5.1/thirdparty/src/openjpeg-2.1.0-20160221.tar.xz
deleted file mode 100644 (file)
index 0916017..0000000
Binary files a/cinelerra-5.1/thirdparty/src/openjpeg-2.1.0-20160221.tar.xz and /dev/null differ
diff --git a/cinelerra-5.1/thirdparty/src/openjpeg-2.3.0.tar.xz b/cinelerra-5.1/thirdparty/src/openjpeg-2.3.0.tar.xz
new file mode 100644 (file)
index 0000000..79603de
Binary files /dev/null and b/cinelerra-5.1/thirdparty/src/openjpeg-2.3.0.tar.xz differ
diff --git a/cinelerra-5.1/thirdparty/src/x265_2.7.tar.xz b/cinelerra-5.1/thirdparty/src/x265_2.7.tar.xz
deleted file mode 100644 (file)
index 471711b..0000000
Binary files a/cinelerra-5.1/thirdparty/src/x265_2.7.tar.xz and /dev/null differ
diff --git a/cinelerra-5.1/thirdparty/src/x265_2.8.tar.xz b/cinelerra-5.1/thirdparty/src/x265_2.8.tar.xz
new file mode 100644 (file)
index 0000000..45a807b
Binary files /dev/null and b/cinelerra-5.1/thirdparty/src/x265_2.8.tar.xz differ