From: Good Guy Date: Wed, 6 Jun 2018 22:56:21 +0000 (-0600) Subject: update openjpeg + x265, unproxy clip fix, config mods for lv2/opus/x265-10bit X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=114b45040c8027671cbe50e7d6cecb28bf73b35f;p=goodguy%2Fhistory.git update openjpeg + x265, unproxy clip fix, config mods for lv2/opus/x265-10bit --- diff --git a/cinelerra-5.1/cinelerra/Makefile b/cinelerra-5.1/cinelerra/Makefile index 2320f3cd..6abdc063 100644 --- a/cinelerra-5.1/cinelerra/Makefile +++ b/cinelerra-5.1/cinelerra/Makefile @@ -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` diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C index ac85cccd..2ac09f73 100644 --- a/cinelerra-5.1/cinelerra/ffmpeg.C +++ b/cinelerra-5.1/cinelerra/ffmpeg.C @@ -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); diff --git a/cinelerra-5.1/cinelerra/mwindow.h b/cinelerra-5.1/cinelerra/mwindow.h index 66f8f393..30ecbec5 100644 --- a/cinelerra-5.1/cinelerra/mwindow.h +++ b/cinelerra-5.1/cinelerra/mwindow.h @@ -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 *orig_assets, ArrayList *proxy_assets); diff --git a/cinelerra-5.1/cinelerra/mwindowedit.C b/cinelerra-5.1/cinelerra/mwindowedit.C index 065c1f9f..cfabc9bb 100644 --- a/cinelerra-5.1/cinelerra/mwindowedit.C +++ b/cinelerra-5.1/cinelerra/mwindowedit.C @@ -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 *orig_assets, ArrayList *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(); jclips[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); } } } diff --git a/cinelerra-5.1/cinelerra/pluginlv2client.C b/cinelerra-5.1/cinelerra/pluginlv2client.C index d5c385b0..7ccb6ef8 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2client.C +++ b/cinelerra-5.1/cinelerra/pluginlv2client.C @@ -431,11 +431,7 @@ void PluginLV2UI::reset_gui() {} ForkChild *PluginLV2ParentUI::new_fork() { -#ifdef HAVE_LV2UI return new PluginLV2ChildUI(); -#else - return 0; -#endif } diff --git a/cinelerra-5.1/cinelerra/pluginlv2config.h b/cinelerra-5.1/cinelerra/pluginlv2config.h index 7f18461b..efe8d1c9 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2config.h +++ b/cinelerra-5.1/cinelerra/pluginlv2config.h @@ -33,14 +33,10 @@ #ifdef HAVE_LV2 #include - -#ifdef HAVE_LV2UI #include #define NS_UI "http://lv2plug.in/ns/extensions/ui#" #include -#endif - #include #include #include diff --git a/cinelerra-5.1/cinelerra/pluginlv2gui.C b/cinelerra-5.1/cinelerra/pluginlv2gui.C index e9e62d53..3c0c4566 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2gui.C +++ b/cinelerra-5.1/cinelerra/pluginlv2gui.C @@ -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; diff --git a/cinelerra-5.1/cinelerra/pluginlv2ui.C b/cinelerra-5.1/cinelerra/pluginlv2ui.C index 3e1c3ee9..929b5c67 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2ui.C +++ b/cinelerra-5.1/cinelerra/pluginlv2ui.C @@ -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 */ diff --git a/cinelerra-5.1/cinelerra/pluginlv2ui.h b/cinelerra-5.1/cinelerra/pluginlv2ui.h index 63a40102..c710060f 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2ui.h +++ b/cinelerra-5.1/cinelerra/pluginlv2ui.h @@ -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 diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac index 60497a06..d3a03d4b 100644 --- a/cinelerra-5.1/configure.ac +++ b/cinelerra-5.1/configure.ac @@ -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 diff --git a/cinelerra-5.1/ffmpeg/video/h265-12bit.mp4 b/cinelerra-5.1/ffmpeg/video/h265-10bit.mp4 similarity index 69% rename from cinelerra-5.1/ffmpeg/video/h265-12bit.mp4 rename to cinelerra-5.1/ffmpeg/video/h265-10bit.mp4 index f52813d9..b0d38ad7 100644 --- a/cinelerra-5.1/ffmpeg/video/h265-12bit.mp4 +++ b/cinelerra-5.1/ffmpeg/video/h265-10bit.mp4 @@ -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 index 09160172..00000000 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 index 00000000..79603ded 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 index 471711bc..00000000 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 index 00000000..45a807ba Binary files /dev/null and b/cinelerra-5.1/thirdparty/src/x265_2.8.tar.xz differ