From: Good Guy Date: Tue, 16 Apr 2024 22:15:35 +0000 (-0600) Subject: no longer need ffmpeg patch0 which was for Termux X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=commitdiff_plain;h=HEAD;hp=2ff681c423ff0f83efbaed49aa37195a3b37f6db no longer need ffmpeg patch0 which was for Termux --- diff --git a/cinelerra-5.1/Cinelerra_factory b/cinelerra-5.1/Cinelerra_factory index ee236e34..f6259011 100644 --- a/cinelerra-5.1/Cinelerra_factory +++ b/cinelerra-5.1/Cinelerra_factory @@ -9,7 +9,7 @@ - + @@ -49,7 +49,7 @@ - + diff --git a/cinelerra-5.1/Makefile.am b/cinelerra-5.1/Makefile.am index ea53b474..4214a9ac 100644 --- a/cinelerra-5.1/Makefile.am +++ b/cinelerra-5.1/Makefile.am @@ -10,7 +10,7 @@ AM_MAKEFLAGS := -j$(WANT_JOBS) AUTOMAKE_OPTIONS=foreign ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = thirdparty libzmpeg3 mpeg2enc mplexlo \ +SUBDIRS = thirdparty libbthread-master libzmpeg3 mpeg2enc mplexlo \ db guicast cinelerra plugins doc po db/utils BUILT_SOURCES := bin diff --git a/cinelerra-5.1/alt_shortcuts.patch b/cinelerra-5.1/alt_shortcuts.patch new file mode 100644 index 00000000..3c03efe3 --- /dev/null +++ b/cinelerra-5.1/alt_shortcuts.patch @@ -0,0 +1,1508 @@ +diff -ur cinelerra-5.1/cinelerra/assetpopup.C cinelerra-5.1_after/cinelerra/assetpopup.C +--- cinelerra-5.1/cinelerra/assetpopup.C 2022-03-15 21:47:37.298381693 -0600 ++++ cinelerra-5.1_after/cinelerra/assetpopup.C 2023-09-28 11:55:17.347859646 -0600 +@@ -563,10 +563,11 @@ + } + + AssetPopupLoadFile::AssetPopupLoadFile(MWindow *mwindow, AWindowGUI *gui) +- : BC_MenuItem(_("Load files..."), "o", 'o') ++ : BC_MenuItem(_("Load files..."), "Ctrl+O", 'o') + { + this->mwindow = mwindow; + this->gui = gui; ++ set_ctrl(1); + } + + AssetPopupLoadFile::~AssetPopupLoadFile() +diff -ur cinelerra-5.1/cinelerra/awindowgui.C cinelerra-5.1_after/cinelerra/awindowgui.C +--- cinelerra-5.1/cinelerra/awindowgui.C 2023-02-09 09:50:37.229375332 -0700 ++++ cinelerra-5.1_after/cinelerra/awindowgui.C 2023-09-28 11:55:17.348859658 -0600 +@@ -1890,8 +1890,8 @@ + tip_info = !tip_info ? 1 : 0; + if( !tip_info ) hide_tip_info(); + return 1; +- case 'o': +- if( !ctrl_down() && !shift_down() ) { ++ case 'o': // Ctrl+O (Oscar letter) ++ if( ctrl_down() && !shift_down() ) { + assetlist_menu->load_file->handle_event(); + return 1; + } +@@ -3622,7 +3622,7 @@ + } + + AWindowListFormat::AWindowListFormat(MWindow *mwindow, AWindowGUI *gui) +- : BC_MenuItem("","v",'v') ++ : BC_MenuItem("","V",'v') + { + this->mwindow = mwindow; + this->gui = gui; +diff -ur cinelerra-5.1/cinelerra/batchrender.C cinelerra-5.1_after/cinelerra/batchrender.C +--- cinelerra-5.1/cinelerra/batchrender.C 2023-02-09 09:50:37.229375332 -0700 ++++ cinelerra-5.1_after/cinelerra/batchrender.C 2023-09-28 11:55:17.349859671 -0600 +@@ -69,7 +69,7 @@ + }; + + BatchRenderMenuItem::BatchRenderMenuItem(MWindow *mwindow) +- : BC_MenuItem(_("Batch Render..."), _("Shift-B"), 'B') ++ : BC_MenuItem(_("Batch Render..."), _("Shift+B"), 'B') + { + set_shift(1); + this->mwindow = mwindow; +@@ -1100,7 +1100,7 @@ + : BC_GenericButton(x, y, _("Save Jobs")) + { + this->thread = thread; +- set_tooltip(_("Save a Batch Render List")); ++ set_tooltip(_("Save a Batch Render List (Ctrl+S)")); + gui = 0; + startup_lock = new Mutex("BatchRenderSaveList::startup_lock"); + } +@@ -1166,8 +1166,13 @@ + } + + int BatchRenderSaveList::keypress_event() { +- if( get_keypress() == 's' || +- get_keypress() == 'S' ) return handle_event(); ++// Ctrl+S pressed? ++ switch( get_keypress() ) { ++ case 's': ++ case 'S': ++ if( ctrl_down() && !alt_down() && !shift_down() ) return handle_event(); ++ break; ++ } + return context_help_check_and_show(); + } + +@@ -1179,7 +1184,7 @@ + Thread() + { + this->thread = thread; +- set_tooltip(_("Load a previously saved Batch Render List")); ++ set_tooltip(_("Load a previously saved Batch Render List (Ctrl+O)")); + gui = 0; + startup_lock = new Mutex("BatchRenderLoadList::startup_lock"); + } +@@ -1247,8 +1252,13 @@ + } + + int BatchRenderLoadList::keypress_event() { +- if( get_keypress() == 'o' || +- get_keypress() == 'O' ) return handle_event(); ++// Ctrl+O pressed? ++ switch( get_keypress() ) { ++ case 'o': ++ case 'O': ++ if( ctrl_down() && !alt_down() && !shift_down() ) return handle_event(); ++ break; ++ } + return context_help_check_and_show(); + } + +diff -ur cinelerra-5.1/cinelerra/bdcreate.C cinelerra-5.1_after/cinelerra/bdcreate.C +--- cinelerra-5.1/cinelerra/bdcreate.C 2023-02-09 09:50:37.229375332 -0700 ++++ cinelerra-5.1_after/cinelerra/bdcreate.C 2023-09-28 11:55:17.349859671 -0600 +@@ -122,10 +122,8 @@ + const int CreateBD_Thread::BD_INTERLACE_MODE = ILACE_MODE_NOTINTERLACED; + + CreateBD_MenuItem::CreateBD_MenuItem(MWindow *mwindow) +- : BC_MenuItem(_("BD Render..."), _("Ctrl-Shift-D"), 'D') ++ : BC_MenuItem(_("BD Render...")) + { +- set_ctrl(1); +- set_shift(1); + this->mwindow = mwindow; + } + +diff -ur cinelerra-5.1/cinelerra/canvas.C cinelerra-5.1_after/cinelerra/canvas.C +--- cinelerra-5.1/cinelerra/canvas.C 2022-03-15 21:47:37.304381729 -0600 ++++ cinelerra-5.1_after/cinelerra/canvas.C 2023-09-28 11:55:17.350859683 -0600 +@@ -1025,7 +1025,7 @@ + + + CanvasPopupCameraKeyframe::CanvasPopupCameraKeyframe(Canvas *canvas) +- : BC_MenuItem(_("Camera keyframe"), _("Shift-F11"), KEY_F11) ++ : BC_MenuItem(_("Camera keyframe"), _("Shift+F11"), KEY_F11) + { + this->canvas = canvas; + set_shift(1); +@@ -1037,7 +1037,7 @@ + } + + CanvasPopupProjectorKeyframe::CanvasPopupProjectorKeyframe(Canvas *canvas) +- : BC_MenuItem(_("Projector keyframe"), _("Shift-F12"), KEY_F12) ++ : BC_MenuItem(_("Projector keyframe"), _("Shift+F12"), KEY_F12) + { + this->canvas = canvas; + set_shift(1); +@@ -1062,7 +1062,7 @@ + + + CanvasFullScreenItem::CanvasFullScreenItem(Canvas *canvas) +- : BC_MenuItem(_("Fullscreen"), "f", 'f') ++ : BC_MenuItem(_("Fullscreen"), "F", 'f') + { + this->canvas = canvas; + } +diff -ur cinelerra-5.1/cinelerra/channelinfo.C cinelerra-5.1_after/cinelerra/channelinfo.C +--- cinelerra-5.1/cinelerra/channelinfo.C 2023-02-09 09:50:37.229375332 -0700 ++++ cinelerra-5.1_after/cinelerra/channelinfo.C 2023-09-28 11:55:17.350859683 -0600 +@@ -1815,7 +1815,7 @@ + } + + ChannelScan::ChannelScan(MWindow *mwindow) +- : BC_MenuItem(_("Scan..."), _("Ctrl-Alt-s"), 's') ++ : BC_MenuItem(_("Scan..."), _("Ctrl+Alt+S"), 's') + { + set_ctrl(); + set_alt(); +diff -ur cinelerra-5.1/cinelerra/convert.C cinelerra-5.1_after/cinelerra/convert.C +--- cinelerra-5.1/cinelerra/convert.C 2022-03-15 21:47:37.307381747 -0600 ++++ cinelerra-5.1_after/cinelerra/convert.C 2023-09-28 11:55:17.351859696 -0600 +@@ -637,7 +637,7 @@ + + + ConvertMenuItem::ConvertMenuItem(MWindow *mwindow) +- : BC_MenuItem(_("Transcode..."), _("Alt-e"), 'e') ++ : BC_MenuItem(_("Transcode..."), _("Alt+E"), 'e') + { + this->mwindow = mwindow; + set_alt(); +diff -ur cinelerra-5.1/cinelerra/cwindowgui.C cinelerra-5.1_after/cinelerra/cwindowgui.C +--- cinelerra-5.1/cinelerra/cwindowgui.C 2022-03-15 21:47:37.308381753 -0600 ++++ cinelerra-5.1_after/cinelerra/cwindowgui.C 2023-09-28 11:55:17.351859696 -0600 +@@ -487,6 +487,8 @@ + } + break; + ++// *** 2023. REM Original code. (editpanel.C take its place, for me) ++/* + case ',': + if( !ctrl_down() && !alt_down() ) { + unlock_window(); +@@ -498,6 +500,8 @@ + result = 1; + } + break; ++*/ ++// *** END rem*** + + case RIGHT: + if( !ctrl_down() ) { +@@ -516,6 +520,8 @@ + } + break; + ++// *** 2023. REM Original code. (editpanel.C take its place, for me) ++/* + case '.': + if( !ctrl_down() && !alt_down() ) { + unlock_window(); +@@ -527,6 +533,8 @@ + result = 1; + } + break; ++*/ ++// *** END rem*** + } + + if( !result && cwindow_operation < 0 && ctrl_down() && shift_down() ) { +diff -ur cinelerra-5.1/cinelerra/cwindowtool.C cinelerra-5.1_after/cinelerra/cwindowtool.C +--- cinelerra-5.1/cinelerra/cwindowtool.C 2023-02-09 09:50:37.231375772 -0700 ++++ cinelerra-5.1_after/cinelerra/cwindowtool.C 2023-09-28 11:55:17.352859708 -0600 +@@ -1645,7 +1645,7 @@ + add_subwindow(t_bump = new CWindowCurveToggle(Projector_Crv_Bump, mwindow, this, x1, y)); + t_bump->context_help_set_keyword("Bump autos"); + x1 += button->get_w() + xs25; +- y += yS(5); ++// 2023 REM y += yS(5); + add_subwindow(add_keyframe = new CWindowProjectorAddKeyframe(mwindow, this, x1, y)); + add_keyframe->context_help_set_keyword("Using Autos"); + x1 += add_keyframe->get_w() + xs15; +@@ -1910,7 +1910,7 @@ + { + this->mwindow = mwindow; + this->gui = gui; +- set_tooltip(_("Add Keyframe: Shift-F12")); ++ set_tooltip(_("Add Keyframe: Shift+F12")); + } + + int CWindowProjectorAddKeyframe::handle_event() +diff -ur cinelerra-5.1/cinelerra/dvdcreate.C cinelerra-5.1_after/cinelerra/dvdcreate.C +--- cinelerra-5.1/cinelerra/dvdcreate.C 2023-06-28 10:24:09.241079904 -0600 ++++ cinelerra-5.1_after/cinelerra/dvdcreate.C 2023-09-28 11:55:17.353859720 -0600 +@@ -117,9 +117,8 @@ + + + CreateDVD_MenuItem::CreateDVD_MenuItem(MWindow *mwindow) +- : BC_MenuItem(_("DVD Render..."), _("Alt-d"), 'd') ++ : BC_MenuItem(_("DVD Render...")) + { +- set_alt(1); + this->mwindow = mwindow; + } + +diff -ur cinelerra-5.1/cinelerra/editpanel.C cinelerra-5.1_after/cinelerra/editpanel.C +--- cinelerra-5.1/cinelerra/editpanel.C 2023-02-09 09:50:37.245378853 -0700 ++++ cinelerra-5.1_after/cinelerra/editpanel.C 2023-09-28 11:55:17.354859733 -0600 +@@ -484,7 +484,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("Toggle label at current position ( l )")); ++ set_tooltip(_("Toggle label at current position ( ' )")); // single quote + // *** CONTEXT_HELP *** + context_help_set_keyword("Labels"); + } +@@ -494,7 +494,7 @@ + } + int EditLabelbutton::keypress_event() + { +- if( get_keypress() == 'l' && !alt_down() ) ++ if( get_keypress() == '\'' && !alt_down() ) // single quote + return handle_event(); + return context_help_check_and_show(); + } +@@ -511,7 +511,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("Next label ( ctrl -> )")); ++ set_tooltip(_("Next label ( Ctrl+Right Arrow )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Labels"); + } +@@ -547,7 +547,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("Previous label ( ctrl <- )")); ++ set_tooltip(_("Previous label ( Ctrl+Left Arrow )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Labels"); + } +@@ -583,7 +583,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("Previous edit (alt <- )")); ++ set_tooltip(_("Previous edit ( Alt+Left Arrow, 'A' )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Snapping while Cutting and Dragging"); + } +@@ -594,7 +594,7 @@ + { + if( alt_down() ) { + int key = get_keypress(); +- if( (key == LEFT || key == ',') && !ctrl_down() ) { ++ if( key == LEFT && !ctrl_down() ) { + panel->panel_prev_edit(0); + return 1; + } +@@ -603,6 +603,13 @@ + return 1; + } + } ++ else { ++ int key = get_keypress(); ++ if( key == 'a' && !ctrl_down() && !shift_down() ) { ++ panel->panel_prev_edit(0); ++ return 1; ++ } ++ } + return context_help_check_and_show(); + } + int EditPrevEdit::handle_event() +@@ -619,7 +626,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("Next edit ( alt -> )")); ++ set_tooltip(_("Next edit ( Alt+Right Arrow, 'S' )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Snapping while Cutting and Dragging"); + } +@@ -630,7 +637,7 @@ + { + if( alt_down() ) { + int key = get_keypress(); +- if( (key == RIGHT || key == '.') && !ctrl_down() ) { ++ if( key == RIGHT && !ctrl_down() ) { + panel->panel_next_edit(0); + return 1; + } +@@ -639,6 +646,13 @@ + return 1; + } + } ++ else { ++ int key = get_keypress(); ++ if( key == 's' && !ctrl_down() && !shift_down() ) { ++ panel->panel_next_edit(0); ++ return 1; ++ } ++ } + return context_help_check_and_show(); + } + int EditNextEdit::handle_event() +@@ -654,7 +668,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("Copy ( c )")); ++ set_tooltip(_("Copy ( C )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Cut and Paste Editing"); + } +@@ -683,7 +697,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("Overwrite ( b )")); ++ set_tooltip(_("Overwrite ( B )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Two Screen Editing"); + } +@@ -713,7 +727,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("In point ( [ or < )")); ++ set_tooltip(_("In point ( '[', '<', 'I' )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("In\\/Out Points"); + } +@@ -735,7 +749,7 @@ + } + } + else if( !alt_down() ) { +- if( key == '[' || key == '<' ) { ++ if( key == '[' || key == '<' || key == 'i' ) { + panel->panel_set_inpoint(); + return 1; + } +@@ -750,7 +764,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("Out point ( ] or > )")); ++ set_tooltip(_("Out point ( ']', '>', 'O' )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("In\\/Out Points"); + } +@@ -772,7 +786,7 @@ + } + } + else if( !alt_down() ) { +- if( key == ']' || key == '>' ) { ++ if( key == ']' || key == '>' || key == 'o' ) { + panel->panel_set_outpoint(); + return 1; + } +@@ -786,7 +800,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("Splice ( v )")); ++ set_tooltip(_("Splice ( V )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Two Screen Editing"); + } +@@ -815,7 +829,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("To clip ( i )")); ++ set_tooltip(_("To clip ( Ctrl+I )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Two Screen Editing"); + } +@@ -831,8 +845,8 @@ + int EditToClip::keypress_event() + { + if( alt_down() ) return context_help_check_and_show(); +- if( get_keypress() == 'i' || +- (panel->is_vwindow() && get_keypress() == 'I') ) { ++ if( (get_keypress() == 'i' && ctrl_down()) || ++ (panel->is_vwindow() && (get_keypress() == 'I' && ctrl_down()) ) ) { + handle_event(); + return 1; + } +@@ -845,7 +859,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("Split | Cut ( x )")); ++ set_tooltip(_("Split | Cut ( X )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Cut and Paste Editing"); + } +@@ -873,7 +887,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("Paste ( v )")); ++ set_tooltip(_("Paste ( V )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Cut and Paste Editing"); + } +@@ -899,7 +913,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("Fit selection to display ( f )")); ++ set_tooltip(_("Fit selection to display ( F )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Transport and Buttons Bar"); + } +@@ -926,7 +940,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("Fit all autos to display ( Alt + f )")); ++ set_tooltip(_("Fit all autos to display ( Alt+F )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Using Autos"); + } +@@ -1001,7 +1015,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("Generate keyframes while tweeking (j)")); ++ set_tooltip(_("Generate keyframes while tweeking ( G )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Generate Keyframes while Tweaking"); + } +@@ -1015,7 +1029,7 @@ + int KeyFrameButton::keypress_event() + { + int key = get_keypress(); +- if( key == 'j' && !ctrl_down() && !shift_down() && !alt_down() ) { ++ if( key == 'g' && !ctrl_down() && !shift_down() && !alt_down() ) { + int value = get_value() ? 0 : 1; + update(value); + panel->panel_set_auto_keyframes(value); +@@ -1072,7 +1086,7 @@ + this->mwindow = mwindow; + this->panel = panel; + mangoto = new ManualGoto(mwindow, panel); +- set_tooltip(_("Manual goto ( g )")); ++ set_tooltip(_("Manual goto ( Ctrl+G )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Transport and Buttons Bar"); + } +@@ -1088,7 +1102,7 @@ + + int EditManualGoto::keypress_event() + { +- if( get_keypress() == 'g' ) { ++ if( get_keypress() == 'g' && ctrl_down() ) { + handle_event(); + return 1; + } +@@ -1104,7 +1118,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("Click to play (p)")); ++ set_tooltip(_("Click to play ( P )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Click to Play in Viewer and Compositor"); + } +@@ -1132,7 +1146,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("Commercial ( shift A )")); ++ set_tooltip(_("Commercial ( Shift+A )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("The commercial DB"); + } +@@ -1174,7 +1188,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("Undo ( z or Ctrl-z)")); ++ set_tooltip(_("Undo ( 'Z', Ctrl+Z )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Transport and Buttons Bar"); + } +@@ -1200,7 +1214,7 @@ + { + this->mwindow = mwindow; + this->panel = panel; +- set_tooltip(_("Redo ( shift Z )")); ++ set_tooltip(_("Redo ( Shift+Z )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Transport and Buttons Bar"); + } +diff -ur cinelerra-5.1/cinelerra/editpopup.C cinelerra-5.1_after/cinelerra/editpopup.C +--- cinelerra-5.1/cinelerra/editpopup.C 2022-04-11 14:29:13.599769890 -0600 ++++ cinelerra-5.1_after/cinelerra/editpopup.C 2023-09-28 11:55:17.354859733 -0600 +@@ -147,7 +147,7 @@ + } + + EditPopupClearSelect::EditPopupClearSelect(MWindow *mwindow, EditPopup *popup) +- : BC_MenuItem(_("Clear Select"),_("Ctrl-Shift-A"),'A') ++ : BC_MenuItem(_("Clear Select"),_("Ctrl+Shift+A"),'A') + { + this->mwindow = mwindow; + this->popup = popup; +@@ -162,7 +162,7 @@ + } + + EditPopupSelectEdits::EditPopupSelectEdits(MWindow *mwindow, EditPopup *popup) +- : BC_MenuItem(_("Select Edits"),_("Ctrl-Alt-'"),'\'') ++ : BC_MenuItem(_("Select Edits"),_("Ctrl+Alt+A"),'a') + { + this->mwindow = mwindow; + this->popup = popup; +@@ -190,7 +190,7 @@ + } + + EditPopupCopy::EditPopupCopy(MWindow *mwindow, EditPopup *popup) +- : BC_MenuItem(_("Copy"),_("Ctrl-c"),'c') ++ : BC_MenuItem(_("Copy"),_("Ctrl+C"),'c') + { + this->mwindow = mwindow; + this->popup = popup; +@@ -204,7 +204,7 @@ + } + + EditPopupCopyPack::EditPopupCopyPack(MWindow *mwindow, EditPopup *popup) +- : BC_MenuItem(_("Copy pack"),_("Ctrl-Shift-C"),'C') ++ : BC_MenuItem(_("Copy pack"),_("Ctrl+Shift+C"),'C') + { + this->mwindow = mwindow; + this->popup = popup; +@@ -219,7 +219,7 @@ + } + + EditPopupCut::EditPopupCut(MWindow *mwindow, EditPopup *popup) +- : BC_MenuItem(_("Cut"),_("Ctrl-x"),'x') ++ : BC_MenuItem(_("Cut"),_("Ctrl+X"),'x') + { + this->mwindow = mwindow; + this->popup = popup; +@@ -233,7 +233,7 @@ + } + + EditPopupCutPack::EditPopupCutPack(MWindow *mwindow, EditPopup *popup) +- : BC_MenuItem(_("Cut pack"),_("Ctrl-Alt-z"),'z') ++ : BC_MenuItem(_("Cut pack"),_("Ctrl+Alt+Z"),'z') + { + this->mwindow = mwindow; + this->popup = popup; +@@ -248,7 +248,7 @@ + } + + EditPopupMute::EditPopupMute(MWindow *mwindow, EditPopup *popup) +- : BC_MenuItem(C_("Mute"),_("Ctrl-m"),'m') ++ : BC_MenuItem(_("Mute"),_("Ctrl+M"),'m') + { + this->mwindow = mwindow; + this->popup = popup; +@@ -262,7 +262,7 @@ + } + + EditPopupMutePack::EditPopupMutePack(MWindow *mwindow, EditPopup *popup) +- : BC_MenuItem(_("Mute pack"),_("Ctrl-Shift-M"),'M') ++ : BC_MenuItem(_("Mute pack"),_("Ctrl+Shift+M"),'M') + { + this->mwindow = mwindow; + this->popup = popup; +@@ -277,7 +277,7 @@ + } + + EditPopupPaste::EditPopupPaste(MWindow *mwindow, EditPopup *popup) +- : BC_MenuItem(_("Paste"),_("Ctrl-v"),'v') ++ : BC_MenuItem(_("Paste"),_("Ctrl+V"),'v') + { + this->mwindow = mwindow; + this->popup = popup; +@@ -297,7 +297,7 @@ + } + + EditPopupOverwrite::EditPopupOverwrite(MWindow *mwindow, EditPopup *popup) +- : BC_MenuItem(_("Overwrite"),_("Ctrl-b"),'b') ++ : BC_MenuItem(_("Overwrite"),_("Ctrl+B"),'b') + { + this->mwindow = mwindow; + this->popup = popup; +@@ -317,7 +317,7 @@ + } + + EditPopupOverwritePlugins::EditPopupOverwritePlugins(MWindow *mwindow, EditPopup *popup) +- : BC_MenuItem(_("Overwrite Plugins"),_("Ctrl-Shift-P"),'P') ++ : BC_MenuItem(_("Overwrite Plugins"),_("Ctrl+Shift+P"),'P') + { + this->mwindow = mwindow; + this->popup = popup; +@@ -372,12 +372,11 @@ + } + + EditPopupTimecode::EditPopupTimecode(MWindow *mwindow, EditPopup *popup) +- : BC_MenuItem(_("Timecode"),_("Ctrl-!"),'!') ++ : BC_MenuItem(_("Timecode"),_("Ctrl+!"),'!') + { + this->mwindow = mwindow; + this->popup = popup; + set_ctrl(1); +- set_shift(1); + } + + int EditPopupTimecode::handle_event() +diff -ur cinelerra-5.1/cinelerra/exportedl.C cinelerra-5.1_after/cinelerra/exportedl.C +--- cinelerra-5.1/cinelerra/exportedl.C 2023-01-28 12:41:13.742539792 -0700 ++++ cinelerra-5.1_after/cinelerra/exportedl.C 2023-09-28 11:55:17.354859733 -0600 +@@ -292,7 +292,7 @@ + + + ExportEDLItem::ExportEDLItem(MWindow *mwindow) +- : BC_MenuItem(_("Export EDL..."), "Shift-E", 'E') ++ : BC_MenuItem(_("Export EDL..."), "Shift+E", 'E') + { + this->mwindow = mwindow; + set_shift(1); +diff -ur cinelerra-5.1/cinelerra/gwindowgui.C cinelerra-5.1_after/cinelerra/gwindowgui.C +--- cinelerra-5.1/cinelerra/gwindowgui.C 2022-03-15 21:47:37.364382093 -0600 ++++ cinelerra-5.1_after/cinelerra/gwindowgui.C 2023-09-28 11:55:17.354859733 -0600 +@@ -324,11 +324,11 @@ + switch( ref ) { + case NONAUTOTOGGLES_CAMERA_XYZ: + camera_xyz = toggle; +- accel = _("Shift-F1"); ++ accel = _("Shift+F1"); + break; + case NONAUTOTOGGLES_PROJECTOR_XYZ: + projector_xyz = toggle; +- accel = _("Shift-F2"); ++ accel = _("Shift+F2"); + break; + case NON_AUTOMATION_HARD_EDGES: + VFrame *vframe = mwindow->theme->hardedge_data; +diff -ur cinelerra-5.1/cinelerra/loadfile.C cinelerra-5.1_after/cinelerra/loadfile.C +--- cinelerra-5.1/cinelerra/loadfile.C 2023-02-09 09:50:37.250379954 -0700 ++++ cinelerra-5.1_after/cinelerra/loadfile.C 2023-09-28 11:55:17.354859733 -0600 +@@ -45,8 +45,9 @@ + #include + + Load::Load(MWindow *mwindow, MainMenu *mainmenu) +- : BC_MenuItem(_("Load files..."), "o", 'o') ++ : BC_MenuItem(_("Load files..."), "Ctrl+O", 'o') + { ++ set_ctrl(1); + this->mwindow = mwindow; + this->mainmenu = mainmenu; + this->thread = 0; +diff -ur cinelerra-5.1/cinelerra/mainmenu.C cinelerra-5.1_after/cinelerra/mainmenu.C +--- cinelerra-5.1/cinelerra/mainmenu.C 2022-03-15 21:47:37.368382117 -0600 ++++ cinelerra-5.1_after/cinelerra/mainmenu.C 2023-09-28 11:55:17.355859745 -0600 +@@ -263,17 +263,17 @@ + viewmenu->add_item(mask_automation = new ShowAutomation(mwindow, _("Mask"), "8", AUTOMATION_MASK)); + viewmenu->add_item(speed_automation = new ShowAutomation(mwindow, _("Speed"), "9", AUTOMATION_SPEED)); + +- camera_x = new ShowAutomation(mwindow, _("Camera X"), "Ctrl-Shift-X", AUTOMATION_CAMERA_X); ++ camera_x = new ShowAutomation(mwindow, _("Camera X"), "Ctrl+Shift+X", AUTOMATION_CAMERA_X); + camera_x->set_ctrl(); camera_x->set_shift(); viewmenu->add_item(camera_x); +- camera_y = new ShowAutomation(mwindow, _("Camera Y"), "Ctrl-Shift-Y", AUTOMATION_CAMERA_Y); ++ camera_y = new ShowAutomation(mwindow, _("Camera Y"), "Ctrl+Shift+Y", AUTOMATION_CAMERA_Y); + camera_y->set_ctrl(); camera_y->set_shift(); viewmenu->add_item(camera_y); +- camera_z = new ShowAutomation(mwindow, _("Camera Z"), "Ctrl-Shift-Z", AUTOMATION_CAMERA_Z); ++ camera_z = new ShowAutomation(mwindow, _("Camera Z"), "Ctrl+Shift+Z", AUTOMATION_CAMERA_Z); + camera_z->set_ctrl(); camera_z->set_shift(); viewmenu->add_item(camera_z); +- project_x = new ShowAutomation(mwindow, _("Projector X"), "Alt-Shift-X", AUTOMATION_PROJECTOR_X); ++ project_x = new ShowAutomation(mwindow, _("Projector X"), "Alt+Shift+X", AUTOMATION_PROJECTOR_X); + project_x->set_alt(); project_x->set_shift(); viewmenu->add_item(project_x); +- project_y = new ShowAutomation(mwindow, _("Projector Y"), "Alt-Shift-Y", AUTOMATION_PROJECTOR_Y); ++ project_y = new ShowAutomation(mwindow, _("Projector Y"), "Alt+Shift+Y", AUTOMATION_PROJECTOR_Y); + project_y->set_alt(); project_y->set_shift(); viewmenu->add_item(project_y); +- project_z = new ShowAutomation(mwindow, _("Projector Z"), "Alt-Shift-Z", AUTOMATION_PROJECTOR_Z); ++ project_z = new ShowAutomation(mwindow, _("Projector Z"), "Alt+Shift+Z", AUTOMATION_PROJECTOR_Z); + project_z->set_alt(); project_z->set_shift(); viewmenu->add_item(project_z); + + add_menu(windowmenu = new BC_Menu(_("Window"))); +@@ -291,7 +291,7 @@ + windowmenu->add_item(new TileWindows(mwindow,_("Tile right"),1)); + windowmenu->add_item(new BC_MenuItem("-")); + +- windowmenu->add_item(new TileWindows(mwindow,_("Default positions"),-1,_("Ctrl-P"),'p')); ++ windowmenu->add_item(new TileWindows(mwindow,_("Default positions"),-1,_("Ctrl+P"),'p')); + windowmenu->add_item(load_layout = new LoadLayout(mwindow, _("Load layout..."),LAYOUT_LOAD)); + load_layout->create_objects(); + windowmenu->add_item(save_layout = new LoadLayout(mwindow, _("Save layout..."),LAYOUT_SAVE)); +@@ -639,7 +639,7 @@ + + // ================================================= edit + +-Undo::Undo(MWindow *mwindow) : BC_MenuItem(_("Undo"), "z or Ctrl-z", 'z') ++Undo::Undo(MWindow *mwindow) : BC_MenuItem(_("Undo"), "Z, Ctrl+Z", 'z') + { + this->mwindow = mwindow; + } +@@ -658,7 +658,7 @@ + } + + +-Redo::Redo(MWindow *mwindow) : BC_MenuItem(_("Redo"), _("Shift-Z"), 'Z') ++Redo::Redo(MWindow *mwindow) : BC_MenuItem(_("Redo"), _("Shift+Z"), 'Z') + { + set_shift(1); + this->mwindow = mwindow; +@@ -679,7 +679,7 @@ + } + + CutKeyframes::CutKeyframes(MWindow *mwindow) +- : BC_MenuItem(_("Cut keyframes"), _("Shift-X"), 'X') ++ : BC_MenuItem(_("Cut keyframes"), _("Shift+X"), 'X') + { + set_shift(); + this->mwindow = mwindow; +@@ -693,7 +693,7 @@ + } + + CopyKeyframes::CopyKeyframes(MWindow *mwindow) +- : BC_MenuItem(_("Copy keyframes"), _("Shift-C"), 'C') ++ : BC_MenuItem(_("Copy keyframes"), _("Shift+C"), 'C') + { + set_shift(); + this->mwindow = mwindow; +@@ -707,7 +707,7 @@ + } + + PasteKeyframes::PasteKeyframes(MWindow *mwindow) +- : BC_MenuItem(_("Paste keyframes"), _("Shift-V"), 'V') ++ : BC_MenuItem(_("Paste keyframes"), _("Shift+V"), 'V') + { + set_shift(); + this->mwindow = mwindow; +@@ -721,7 +721,7 @@ + } + + ClearKeyframes::ClearKeyframes(MWindow *mwindow) +- : BC_MenuItem(_("Clear keyframes"), _("Shift-Del"), DELETE) ++ : BC_MenuItem(_("Clear keyframes"), _("Shift+Del"), DELETE) + { + set_shift(); + this->mwindow = mwindow; +@@ -886,7 +886,7 @@ + + + CutDefaultKeyframe::CutDefaultKeyframe(MWindow *mwindow) +- : BC_MenuItem(_("Cut default keyframe"), _("Alt-x"), 'x') ++ : BC_MenuItem(_("Cut default keyframe"), _("Alt+X"), 'x') + { + set_alt(); + this->mwindow = mwindow; +@@ -900,7 +900,7 @@ + } + + CopyDefaultKeyframe::CopyDefaultKeyframe(MWindow *mwindow) +- : BC_MenuItem(_("Copy default keyframe"), _("Alt-c"), 'c') ++ : BC_MenuItem(_("Copy default keyframe"), _("Alt+C"), 'c') + { + set_alt(); + this->mwindow = mwindow; +@@ -914,7 +914,7 @@ + } + + PasteDefaultKeyframe::PasteDefaultKeyframe(MWindow *mwindow) +- : BC_MenuItem(_("Paste default keyframe"), _("Alt-v"), 'v') ++ : BC_MenuItem(_("Paste default keyframe"), _("Alt+V"), 'v') + { + set_alt(); + this->mwindow = mwindow; +@@ -928,7 +928,7 @@ + } + + ClearDefaultKeyframe::ClearDefaultKeyframe(MWindow *mwindow) +- : BC_MenuItem(_("Clear default keyframe"), _("Alt-Del"), DELETE) ++ : BC_MenuItem(_("Clear default keyframe"), _("Alt+Del"), DELETE) + { + set_alt(); + this->mwindow = mwindow; +@@ -942,7 +942,7 @@ + } + + Cut::Cut(MWindow *mwindow) +- : BC_MenuItem(_("Split | Cut"), "x", 'x') ++ : BC_MenuItem(_("Split | Cut"), "X", 'x') + { + this->mwindow = mwindow; + } +@@ -955,7 +955,7 @@ + } + + Copy::Copy(MWindow *mwindow) +- : BC_MenuItem(_("Copy"), "c", 'c') ++ : BC_MenuItem(_("Copy"), "C", 'c') + { + this->mwindow = mwindow; + } +@@ -968,7 +968,7 @@ + } + + Paste::Paste(MWindow *mwindow) +- : BC_MenuItem(_("Paste"), "v", 'v') ++ : BC_MenuItem(_("Paste"), "V", 'v') + { + this->mwindow = mwindow; + } +@@ -1024,7 +1024,7 @@ + } + + PasteSilence::PasteSilence(MWindow *mwindow) +- : BC_MenuItem(_("Paste silence"), _("Shift-Space"), ' ') ++ : BC_MenuItem(_("Paste silence"), _("Shift+Space"), ' ') + { + this->mwindow = mwindow; + set_shift(); +@@ -1038,9 +1038,10 @@ + } + + SelectAll::SelectAll(MWindow *mwindow) +- : BC_MenuItem(_("Select All"), "a", 'a') ++ : BC_MenuItem(_("Select All"), "Ctrl+A", 'a') + { + this->mwindow = mwindow; ++ set_ctrl(1); + } + + int SelectAll::handle_event() +@@ -1072,7 +1073,7 @@ + return 1; + } + +-ClearSelect::ClearSelect(MWindow *mwindow) : BC_MenuItem(_("Clear Select"),"Ctrl-Shift-A",'A') ++ClearSelect::ClearSelect(MWindow *mwindow) : BC_MenuItem(_("Clear Select"),"Ctrl+Shift+A",'A') + { + set_ctrl(1); + set_shift(1); +@@ -1109,7 +1110,7 @@ + } + + MuteSelection::MuteSelection(MWindow *mwindow) +- : BC_MenuItem(_("Mute Region"), "m", 'm') ++ : BC_MenuItem(_("Mute Region"), "M", 'm') + { + this->mwindow = mwindow; + } +@@ -1148,7 +1149,7 @@ + // ============================================= audio + + AddAudioTrack::AddAudioTrack(MWindow *mwindow) +- : BC_MenuItem(_("Add track"), "t", 't') ++ : BC_MenuItem(_("Add track"), "T", 't') + { + this->mwindow = mwindow; + } +@@ -1172,7 +1173,7 @@ + } + + DefaultATransition::DefaultATransition(MWindow *mwindow) +- : BC_MenuItem(_("Default Transition"), "u", 'u') ++ : BC_MenuItem(_("Default Transition"), "U", 'u') + { + this->mwindow = mwindow; + } +@@ -1216,7 +1217,7 @@ + + + AddVideoTrack::AddVideoTrack(MWindow *mwindow) +- : BC_MenuItem(_("Add track"), _("Shift-T"), 'T') ++ : BC_MenuItem(_("Add track"), _("Shift+T"), 'T') + { + set_shift(); + this->mwindow = mwindow; +@@ -1257,7 +1258,7 @@ + + + DefaultVTransition::DefaultVTransition(MWindow *mwindow) +- : BC_MenuItem(_("Default Transition"), _("Shift-U"), 'U') ++ : BC_MenuItem(_("Default Transition"), _("Shift+U"), 'U') + { + set_shift(); + this->mwindow = mwindow; +@@ -1298,7 +1299,7 @@ + } + + DeleteFirstTrack::DeleteFirstTrack(MWindow *mwindow) +- : BC_MenuItem(_("Delete first track"), "Shift-D", 'D') ++ : BC_MenuItem(_("Delete first track"), "Shift+D", 'D') + { + set_shift(1); + this->mwindow = mwindow; +@@ -1314,7 +1315,7 @@ + } + + DeleteLastTrack::DeleteLastTrack(MWindow *mwindow) +- : BC_MenuItem(_("Delete last track"), "Ctrl-d", 'd') ++ : BC_MenuItem(_("Delete last track"), "Ctrl+D", 'd') + { + set_ctrl(1); + this->mwindow = mwindow; +@@ -1330,7 +1331,7 @@ + } + + MoveTracksUp::MoveTracksUp(MWindow *mwindow) +- : BC_MenuItem(_("Move tracks up"), _("Shift-Up"), UP) ++ : BC_MenuItem(_("Move tracks up"), _("Shift+Up"), UP) + { + this->mwindow = mwindow; + set_shift(); +@@ -1344,7 +1345,7 @@ + } + + MoveTracksDown::MoveTracksDown(MWindow *mwindow) +- : BC_MenuItem(_("Move tracks down"), _("Shift-Down"), DOWN) ++ : BC_MenuItem(_("Move tracks down"), _("Shift+Down"), DOWN) + { + this->mwindow = mwindow; + set_shift(); +@@ -1359,7 +1360,7 @@ + + + RollTracksUp::RollTracksUp(MWindow *mwindow) +- : BC_MenuItem(_("Roll tracks up"), _("Ctrl-Shift-Up"), UP) ++ : BC_MenuItem(_("Roll tracks up"), _("Ctrl+Shift+Up"), UP) + { + this->mwindow = mwindow; + set_ctrl(); +@@ -1374,7 +1375,7 @@ + } + + RollTracksDown::RollTracksDown(MWindow *mwindow) +- : BC_MenuItem(_("Roll tracks down"), _("Ctrl-Shift-Down"), DOWN) ++ : BC_MenuItem(_("Roll tracks down"), _("Ctrl+Shift+Down"), DOWN) + { + this->mwindow = mwindow; + set_ctrl(); +@@ -1409,7 +1410,7 @@ + + + LoopPlayback::LoopPlayback(MWindow *mwindow) +- : BC_MenuItem(_("Loop Playback"), _("Shift-L"), 'L') ++ : BC_MenuItem(_("Loop Playback"), _("Shift+L"), 'L') + { + this->mwindow = mwindow; + set_checked(mwindow->edl->local_session->loop_playback); +@@ -1431,7 +1432,7 @@ + + + AddSubttlTrack::AddSubttlTrack(MWindow *mwindow) +- : BC_MenuItem(_("Add subttl"), _("Shift-Y"), 'Y') ++ : BC_MenuItem(_("Add subttl"), _("Shift+Y"), 'Y') + { + set_shift(); + this->mwindow = mwindow; +@@ -1445,7 +1446,7 @@ + } + + PasteSubttl::PasteSubttl(MWindow *mwindow) +- : BC_MenuItem(_("paste subttl"), "y", 'y') ++ : BC_MenuItem(_("paste subttl"), "Y", 'y') + { + this->mwindow = mwindow; + } +@@ -1459,7 +1460,7 @@ + + + SetBRenderActive::SetBRenderActive(MWindow *mwindow) +- : BC_MenuItem(_("Toggle background rendering"),_("Shift-G"),'G') ++ : BC_MenuItem(_("Toggle background rendering"),_("Shift+G"),'G') + { + this->mwindow = mwindow; + set_shift(1); +@@ -1526,7 +1527,7 @@ + + + CursorOnFrames::CursorOnFrames(MWindow *mwindow) +- : BC_MenuItem(_("Align cursor on frames"),_("Ctrl-a"),'a') ++ : BC_MenuItem(_("Align cursor on frames"),_("Ctrl+F"),'f') + { + this->mwindow = mwindow; + set_checked(mwindow->edl->session->cursor_on_frames); +@@ -1578,11 +1579,10 @@ + } + + SaveSettingsNow::SaveSettingsNow(MWindow *mwindow) +- : BC_MenuItem(_("Save settings now"),_("Ctrl-Shift-S"),'S') ++ : BC_MenuItem(_("Save settings now"),_("Shift+S"),'s') + { + this->mwindow = mwindow; +- set_ctrl(1); +- set_shift(1); ++ set_shift(1); // set_ctrl(1); + } + + int SaveSettingsNow::handle_event() +@@ -1664,7 +1664,7 @@ + + + ShowGWindow::ShowGWindow(MWindow *mwindow) +- : BC_MenuItem(_("Show Overlays"), _("Ctrl-0"), '0') ++ : BC_MenuItem(_("Show Overlays"), _("Ctrl+0"), '0') + { + this->mwindow = mwindow; + set_ctrl(1); +@@ -1728,7 +1728,7 @@ + } + + SplitX::SplitX(MWindow *mwindow) +- : BC_MenuItem(_("Split X pane"), _("Ctrl-1"), '1') ++ : BC_MenuItem(_("Split X pane"), _("Ctrl+1"), '1') + { + this->mwindow = mwindow; + set_ctrl(1); +@@ -1742,7 +1742,7 @@ + } + + SplitY::SplitY(MWindow *mwindow) +- : BC_MenuItem(_("Split Y pane"), _("Ctrl-2"), '2') ++ : BC_MenuItem(_("Split Y pane"), _("Ctrl+2"), '2') + { + this->mwindow = mwindow; + set_ctrl(1); +@@ -1826,7 +1826,7 @@ + } + + MixerViewer::MixerViewer(MixerItems *mixer_items) +- : MixerItem(mixer_items, _("Mixer Viewer"), _("Shift-M"), 'M') ++ : MixerItem(mixer_items, _("Mixer Viewer"), _("Shift+M"), 'M') + { + set_shift(1); + } +@@ -1839,7 +1839,7 @@ + } + + DragTileMixers::DragTileMixers(MixerItems *mixer_items) +- : MixerItem(mixer_items, _("Drag Tile mixers"), "Alt-t", 't') ++ : MixerItem(mixer_items, _("Tile mixers"), "Alt+T", 't') + { + set_alt(); + drag_box = 0; +@@ -1933,7 +1933,7 @@ + this->load_layout = load_layout; + if( hotkey ) { + char hot_txt[BCSTRLEN]; +- sprintf(hot_txt, _("Ctrl-Shift+F%d"), hotkey-KEY_F1+1); ++ sprintf(hot_txt, _("Ctrl+Shift+F%d"), hotkey-KEY_F1+1); + set_ctrl(); set_shift(); + set_hotkey_text(hot_txt); + } +diff -ur cinelerra-5.1/cinelerra/mwindowgui.C cinelerra-5.1_after/cinelerra/mwindowgui.C +--- cinelerra-5.1/cinelerra/mwindowgui.C 2022-05-30 15:03:35.152305163 -0600 ++++ cinelerra-5.1_after/cinelerra/mwindowgui.C 2023-09-28 11:55:17.355859745 -0600 +@@ -1092,27 +1092,38 @@ + + switch( get_keypress() ) { + case 'A': +- if( !alt_down() ) { +- if( !ctrl_down() || !shift_down() ) break; ++ if( !alt_down() && ctrl_down() ) { + mwindow->edl->tracks->clear_selected_edits(); + draw_overlays(1); + result = 1; +- break; +- } // fall thru ++ } ++ break; + case 'a': ++// REM 2023 ++/* + if( !alt_down() ) break; + stop_transport("MWindowGUI::keypress_event 1"); + mwindow->nearest_auto_keyframe(shift_down(), + !ctrl_down() ? PLAY_FORWARD : PLAY_REVERSE); + result = 1; ++*/ ++// REM END ++ if( ctrl_down() && alt_down() ) { ++ mwindow->select_edits(1); ++ result = 1; ++ } + break; + ++// REM 2023 ++/* + case '\'': + if( ctrl_down() && alt_down() ) { + mwindow->select_edits(1); + result = 1; + } + break; ++*/ ++// REM END + + case 'e': + if( ctrl_down() || alt_down() ) break; +@@ -1123,8 +1134,8 @@ + case 'k': case 'K': + if( alt_down() ) break; + stop_transport("MWindowGUI::keypress_event 2"); +- mwindow->nearest_plugin_keyframe(shift_down(), +- !ctrl_down() ? PLAY_FORWARD : PLAY_REVERSE); ++// mwindow->nearest_plugin_keyframe(shift_down(), ++// !ctrl_down() ? PLAY_FORWARD : PLAY_REVERSE); + result = 1; + break; + +@@ -1204,10 +1215,23 @@ + stop_transport("MWindowGUI::keypress_event 1"); + mwindow->prev_edit_handle(shift_down()); + } ++ // *** Shift+Left Arrow to jump to Previous Keyframe. START new code 2023 *** ++ else if( shift_down() ) { ++ stop_transport("MWindowGUI::keypress_event 1"); ++ mwindow->nearest_plugin_keyframe( (!shift_down() && !ctrl_down()), PLAY_REVERSE ); ++ } ++ // *** END new code 2023 *** + else + mwindow->move_left(); + result = 1; + } ++ // *** Ctrl+Shift+Alt+Left Arrow to jump to Previous AutosKeyframe. START new code 2023 *** ++ if( ctrl_down() && shift_down() && alt_down() ) { ++ stop_transport("MWindowGUI::keypress_event 1"); ++ mwindow->nearest_auto_keyframe( (!shift_down() && !ctrl_down() && !alt_down() ), PLAY_REVERSE ); ++ result = 1; ++ } ++ // *** END new code 2023 *** + break; + + case ',': +@@ -1223,10 +1247,23 @@ + stop_transport("MWindowGUI::keypress_event 2"); + mwindow->next_edit_handle(shift_down()); + } ++ // *** Shift+Right Arrow to jump to Next Keyframe. START new code 2023 *** ++ else if( shift_down() ) { ++ stop_transport("MWindowGUI::keypress_event 1"); ++ mwindow->nearest_plugin_keyframe( (!shift_down() && !ctrl_down()), PLAY_FORWARD ); ++ } ++ // *** END new code 2023 *** + else + mwindow->move_right(); + result = 1; + } ++ // *** Ctrl+Shift+Alt+Right Arrow to jump to Next AutosKeyframe. START new code 2023 *** ++ if( ctrl_down() && shift_down() && alt_down() ) { ++ stop_transport("MWindowGUI::keypress_event 1"); ++ mwindow->nearest_auto_keyframe( (!shift_down() && !ctrl_down() && !alt_down() ), PLAY_FORWARD ); ++ result = 1; ++ } ++ // *** END new code 2023 *** + break; + + case '.': +diff -ur cinelerra-5.1/cinelerra/new.C cinelerra-5.1_after/cinelerra/new.C +--- cinelerra-5.1/cinelerra/new.C 2023-01-24 11:13:37.499568388 -0700 ++++ cinelerra-5.1_after/cinelerra/new.C 2023-09-28 11:55:17.355859745 -0600 +@@ -140,8 +140,9 @@ + } + + NewProject::NewProject(MWindow *mwindow) +- : BC_MenuItem(_("New Project..."), "n", 'n'), New(mwindow) ++ : BC_MenuItem(_("New Project..."), "Ctrl+N", 'n'), New(mwindow) + { ++ set_ctrl(1); + } + NewProject::~NewProject() + { +@@ -154,7 +155,7 @@ + } + + AppendTracks::AppendTracks(MWindow *mwindow) +- : BC_MenuItem(_("Append to Project..."), "Shift-N", 'N'), New(mwindow) ++ : BC_MenuItem(_("Append to Project..."), "Shift+N", 'N'), New(mwindow) + { + set_shift(1); + } +diff -ur cinelerra-5.1/cinelerra/playtransport.C cinelerra-5.1_after/cinelerra/playtransport.C +--- cinelerra-5.1/cinelerra/playtransport.C 2022-03-15 21:47:37.376382165 -0600 ++++ cinelerra-5.1_after/cinelerra/playtransport.C 2023-09-28 11:55:17.355859745 -0600 +@@ -273,12 +273,35 @@ + break; + case 'j': case 'J': + if( alt_key ) command = SINGLE_FRAME_FWD; ++// IF pressed TWICE its toggle between FAST and NORMAL Rewind PLAY ++ if( !alt_key && !ctrl_key ) { ++ switch( curr_command ) { ++ case NORMAL_REWIND: ++ command = FAST_REWIND; ++ break; ++ default: ++ command = NORMAL_REWIND; ++ break; ++ } ++ } + break; + case 'k': case 'K': + if( alt_key ) command = SLOW_FWD; ++ if( !alt_key && !ctrl_key ) command = STOP; + break; + case 'l': case 'L': + if( alt_key ) command = NORMAL_FWD; ++// IF pressed TWICE its toggle between FAST and NORMAL Forward PLAY ++ if( !alt_key && !ctrl_key ) { ++ switch( curr_command ) { ++ case NORMAL_FWD: ++ command = FAST_FWD; ++ break; ++ default: ++ command = NORMAL_FWD; ++ break; ++ } ++ } + break; + case ':': case ';': + if( alt_key ) command = FAST_FWD; +@@ -286,6 +309,12 @@ + case 'm': case 'M': + if( alt_key ) command = STOP; + break; ++ case ',': ++ if( !alt_key && !ctrl_key && !shft_key ) command = SINGLE_FRAME_REWIND; ++ break; ++ case '.': ++ if( !alt_key && !ctrl_key && !shft_key ) command = SINGLE_FRAME_FWD; ++ break; + } + if( command >= 0 ) { + handle_transport(command, 0, use_inout, toggle_audio, loop_play, speed); +@@ -409,7 +438,7 @@ + FastReverseButton::FastReverseButton(MWindow *mwindow, PlayTransport *transport, int x, int y) + : PTransportButton(mwindow, transport, x, y, mwindow->theme->get_image_set("fastrev")) + { +- set_tooltip(_("Fast reverse ( + or Alt-p )")); ++ set_tooltip(_("Fast reverse ( Numpad +, Alt+P )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Transport Controls"); + } +@@ -424,7 +453,7 @@ + ReverseButton::ReverseButton(MWindow *mwindow, PlayTransport *transport, int x, int y) + : PTransportButton(mwindow, transport, x, y, mwindow->theme->get_image_set("reverse")) + { +- set_tooltip(_("Normal reverse ( 6 or Alt-o )")); ++ set_tooltip(_("Normal reverse ( Numpad 6, Alt+O, 'J' )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Transport Controls"); + } +@@ -439,7 +468,7 @@ + FrameReverseButton::FrameReverseButton(MWindow *mwindow, PlayTransport *transport, int x, int y) + : PTransportButton(mwindow, transport, x, y, mwindow->theme->get_image_set("framerev")) + { +- set_tooltip(_("Frame reverse ( 4 or Alt-u )")); ++ set_tooltip(_("Frame reverse ( Numpad 4, Alt+U, ',' )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Transport Controls"); + } +@@ -456,7 +485,7 @@ + PlayButton::PlayButton(MWindow *mwindow, PlayTransport *transport, int x, int y) + : PTransportButton(mwindow, transport, x, y, mwindow->theme->get_image_set("play")) + { +- set_tooltip(_("Normal forward ( 3 or Alt-l )")); ++ set_tooltip(_("Normal forward ( Numpad 3, Alt+L, 'L' )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Transport Controls"); + } +@@ -473,7 +502,7 @@ + FramePlayButton::FramePlayButton(MWindow *mwindow, PlayTransport *transport, int x, int y) + : PTransportButton(mwindow, transport, x, y, mwindow->theme->get_image_set("framefwd")) + { +- set_tooltip(_("Frame forward ( 1 or Alt-j )")); ++ set_tooltip(_("Frame forward ( Numpad 1, Alt+J, '.' )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Transport Controls"); + } +@@ -490,7 +519,7 @@ + FastPlayButton::FastPlayButton(MWindow *mwindow, PlayTransport *transport, int x, int y) + : PTransportButton(mwindow, transport, x, y, mwindow->theme->get_image_set("fastfwd")) + { +- set_tooltip(_("Fast forward ( Enter or Alt-; )")); ++ set_tooltip(_("Fast forward ( Numpad Enter, Alt+; )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Transport Controls"); + } +@@ -518,7 +547,7 @@ + StopButton::StopButton(MWindow *mwindow, PlayTransport *transport, int x, int y) + : PTransportButton(mwindow, transport, x, y, mwindow->theme->get_image_set("stop")) + { +- set_tooltip(_("Stop ( 0 or Alt-m )")); ++ set_tooltip(_("Stop ( Numpad 0, Alt+M, 'K' )")); + // *** CONTEXT_HELP *** + context_help_set_keyword("Transport Controls"); + } +diff -ur cinelerra-5.1/cinelerra/preferencesthread.C cinelerra-5.1_after/cinelerra/preferencesthread.C +--- cinelerra-5.1/cinelerra/preferencesthread.C 2022-03-15 21:47:37.379382184 -0600 ++++ cinelerra-5.1_after/cinelerra/preferencesthread.C 2023-09-28 11:55:17.356859758 -0600 +@@ -71,7 +71,7 @@ + + + PreferencesMenuitem::PreferencesMenuitem(MWindow *mwindow) +- : BC_MenuItem(_("Preferences..."), _("Shift-P"), 'P') ++ : BC_MenuItem(_("Preferences..."), _("Shift+P"), 'P') + { + this->mwindow = mwindow; + +diff -ur cinelerra-5.1/cinelerra/proxy.C cinelerra-5.1_after/cinelerra/proxy.C +--- cinelerra-5.1/cinelerra/proxy.C 2022-03-15 21:47:37.380382190 -0600 ++++ cinelerra-5.1_after/cinelerra/proxy.C 2023-09-28 11:55:17.356859758 -0600 +@@ -52,7 +52,7 @@ + #define MAX_SCALE 16 + + ProxyMenuItem::ProxyMenuItem(MWindow *mwindow) +- : BC_MenuItem(_("Proxy settings..."), _("Alt-r"), 'r') ++ : BC_MenuItem(_("Proxy settings..."), _("Alt+R"), 'r') + { + this->mwindow = mwindow; + set_alt(); +diff -ur cinelerra-5.1/cinelerra/quit.C cinelerra-5.1_after/cinelerra/quit.C +--- cinelerra-5.1/cinelerra/quit.C 2022-03-15 21:47:37.380382190 -0600 ++++ cinelerra-5.1_after/cinelerra/quit.C 2023-09-28 11:55:17.356859758 -0600 +@@ -41,8 +41,9 @@ + + + Quit::Quit(MWindow *mwindow) +- : BC_MenuItem(_("Quit"), "q", 'q'), Thread() ++ : BC_MenuItem(_("Quit"), "Ctrl+Q", 'q'), Thread() + { ++ set_ctrl(1); + this->mwindow = mwindow; + } + +diff -ur cinelerra-5.1/cinelerra/record.C cinelerra-5.1_after/cinelerra/record.C +--- cinelerra-5.1/cinelerra/record.C 2022-03-15 21:47:37.381382196 -0600 ++++ cinelerra-5.1_after/cinelerra/record.C 2023-09-28 11:55:17.356859758 -0600 +@@ -86,7 +86,7 @@ + + + RecordMenuItem::RecordMenuItem(MWindow *mwindow) +- : BC_MenuItem(_("Record..."), "r", 'r') ++ : BC_MenuItem(_("Record..."), "R", 'r') + { + this->mwindow = mwindow; + record = new Record(mwindow, this); +diff -ur cinelerra-5.1/cinelerra/render.C cinelerra-5.1_after/cinelerra/render.C +--- cinelerra-5.1/cinelerra/render.C 2023-06-28 10:24:09.242079933 -0600 ++++ cinelerra-5.1_after/cinelerra/render.C 2023-09-28 11:55:17.356859758 -0600 +@@ -83,7 +83,7 @@ + + + RenderItem::RenderItem(MWindow *mwindow) +- : BC_MenuItem(_("Render..."), _("Shift-R"), 'R') ++ : BC_MenuItem(_("Render..."), _("Shift+R"), 'R') + { + this->mwindow = mwindow; + set_shift(1); +diff -ur cinelerra-5.1/cinelerra/savefile.C cinelerra-5.1_after/cinelerra/savefile.C +--- cinelerra-5.1/cinelerra/savefile.C 2022-03-15 21:47:37.385382220 -0600 ++++ cinelerra-5.1_after/cinelerra/savefile.C 2023-09-28 11:55:17.356859758 -0600 +@@ -40,7 +40,7 @@ + + + SaveBackup::SaveBackup(MWindow *mwindow) +- : BC_MenuItem(_("Save backup"), "b", 'b') ++ : BC_MenuItem(_("Save backup"), "B", 'b') + { + this->mwindow = mwindow; + } +@@ -52,8 +52,9 @@ + } + + +-Save::Save(MWindow *mwindow) : BC_MenuItem(_("Save"), "s", 's') ++Save::Save(MWindow *mwindow) : BC_MenuItem(_("Save"), "Ctrl+S", 's') + { ++ set_ctrl(1); + this->mwindow = mwindow; + quit_now = 0; + } +@@ -87,8 +88,9 @@ + } + + SaveAs::SaveAs(MWindow *mwindow) +- : BC_MenuItem(_("Save as..."), "Shift-S", 'S'), Thread() ++ : BC_MenuItem(_("Save as..."), "Ctrl+Shift+S", 'S'), Thread() + { ++ set_ctrl(1); + set_shift(1); + this->mwindow = mwindow; + quit_now = 0; +@@ -216,7 +218,7 @@ + } + + SaveProject::SaveProject(MWindow *mwindow) +- : BC_MenuItem(_("Export Project..."), "Alt-s", 's'), Thread() ++ : BC_MenuItem(_("Export Project..."), "Alt+S", 's'), Thread() + { + set_alt(1); + this->mwindow = mwindow; +@@ -257,10 +259,10 @@ + + + SaveSession::SaveSession(MWindow *mwindow) +- : BC_MenuItem(_("Save Session"),_("Ctrl-s"),'s') ++ : BC_MenuItem(_("Save Session")) + { + this->mwindow = mwindow; +- set_ctrl(1); ++// set_ctrl(1); + } + + int SaveSession::handle_event() +diff -ur cinelerra-5.1/cinelerra/setformat.C cinelerra-5.1_after/cinelerra/setformat.C +--- cinelerra-5.1/cinelerra/setformat.C 2023-01-24 11:13:37.500568399 -0700 ++++ cinelerra-5.1_after/cinelerra/setformat.C 2023-09-28 11:55:17.357859770 -0600 +@@ -48,7 +48,7 @@ + + + SetFormat::SetFormat(MWindow *mwindow) +- : BC_MenuItem(_("Format..."), _("Shift-F"), 'F') ++ : BC_MenuItem(_("Format..."), _("Shift+F"), 'F') + { + set_shift(1); + this->mwindow = mwindow; +diff -ur cinelerra-5.1/cinelerra/swindow.C cinelerra-5.1_after/cinelerra/swindow.C +--- cinelerra-5.1/cinelerra/swindow.C 2023-02-09 09:50:37.265383255 -0700 ++++ cinelerra-5.1_after/cinelerra/swindow.C 2023-09-28 11:55:17.357859770 -0600 +@@ -1106,7 +1106,7 @@ + + + SubttlSWin::SubttlSWin(MWindow *mwindow) +- : BC_MenuItem(_("SubTitle..."), _("Alt-y"), 'y') ++ : BC_MenuItem(_("SubTitle..."), _("Alt+Y"), 'y') + { + set_alt(); + this->mwindow = mwindow; +diff -ur cinelerra-5.1/guicast/bcfilebox.C cinelerra-5.1_after/guicast/bcfilebox.C +--- cinelerra-5.1/guicast/bcfilebox.C 2022-03-15 21:47:37.422382444 -0600 ++++ cinelerra-5.1_after/guicast/bcfilebox.C 2023-09-28 15:19:16.470367060 -0600 +@@ -767,6 +767,7 @@ + int BC_FileBox::keypress_event() + { + switch(get_keypress()) { ++/* + case 'a': + if( !ctrl_down() ) break; + refresh(0, 1); +@@ -775,6 +776,19 @@ + if( !ctrl_down() ) break; + refresh(0, 0); + return 1; ++*/ ++ // *** START new code 2023 *** ++ case 'a': ++ case 'A': ++ if( ctrl_down() && !shift_down() && !alt_down() ) { ++ refresh(0, 1); // Select All ++ return 1; ++ } ++ if( ctrl_down() && shift_down() && !alt_down() ) { ++ refresh(0, 0); // Deselect All ++ return 1; ++ } ++ // *** END new code 2023 *** + case 'w': + if( !ctrl_down() ) break; + set_done(1); diff --git a/cinelerra-5.1/bld.sh b/cinelerra-5.1/bld.sh index 7c8837bf..4684fbb0 100755 --- a/cinelerra-5.1/bld.sh +++ b/cinelerra-5.1/bld.sh @@ -1,4 +1,8 @@ #!/bin/bash +# IMPORTANT comments below to change the configure line +# For python version 12, add --without-lv2 +# For newer operating system versions, add --enable-libsvtav1 +# For really old versions, such as ubuntu 16, add --enable-libaom=no ( ./autogen.sh ./configure --with-single-user --with-booby make && make install ) 2>&1 | tee log diff --git a/cinelerra-5.1/bld_appimage.sh b/cinelerra-5.1/bld_appimage.sh index 1fcdd70e..fb7a5cb9 100755 --- a/cinelerra-5.1/bld_appimage.sh +++ b/cinelerra-5.1/bld_appimage.sh @@ -20,7 +20,7 @@ CONFIG_OPTIONS="--with-single-user --with-booby --enable-static-build" if [ $target = "aarch64" ] ; then CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-dav1d" elif [ $target = "armv7l" ] ; then -CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-dav1d --disable-libaom --disable libwebp --without-nv" +CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-dav1d --disable-libaom --disable-libwebp --without-nv" fi echo configure script options are $CONFIG_OPTIONS diff --git a/cinelerra-5.1/blds/bld_prepare.sh b/cinelerra-5.1/blds/bld_prepare.sh index 67eb9f23..0e7958d0 100755 --- a/cinelerra-5.1/blds/bld_prepare.sh +++ b/cinelerra-5.1/blds/bld_prepare.sh @@ -7,7 +7,7 @@ fi if [ $# -ne 1 ]; then echo "usage: $0 " - echo " = [centos | suse | ubuntu | fedora | mint | debian | arch]" + echo " = [centos | suse | ubuntu | fedora | mint | debian | arch | debian-older | ubuntu-older]" fi dir="$1" @@ -79,7 +79,7 @@ case "$dir" in fi ;; #debian 32bit: export ac_cv_header_xmmintrin_h=no -"debian") +"debian-older") apt-get -f -y install apt-file sox nasm yasm g++ build-essential zlib1g-dev \ texinfo libpng-dev freeglut3-dev libxv-dev libasound2-dev libbz2-dev \ libncurses5-dev libxinerama-dev libfreetype6-dev libxft-dev libgif-dev \ @@ -92,7 +92,7 @@ case "$dir" in ;; #"ub16-10") # apt-get -y install libx264-dev libx265-dev libvpx-dev libmjpegtools-dev -"ubuntu" | "mint" | "ub14" | "ub15" | "ub16" | "ub17" | "ub18" ) +"ubuntu-older" | "mint" | "ub14" | "ub15" | "ub16" | "ub17" | "ub18" ) apt-get -y install apt-file sox nasm yasm g++ build-essential libz-dev \ texinfo libpng-dev freeglut3-dev libxv-dev libasound2-dev libbz2-dev \ libncurses5-dev libxinerama-dev libfreetype6-dev libxft-dev libgif-dev \ @@ -104,7 +104,33 @@ case "$dir" in libpulse-dev libtool python \ patchelf libboost-filesystem-dev libboost-regex-dev ;; - *) +#ubuntu for newest versions since about 06/2022 +"ubuntu") + apt-get -y install apt-file sox nasm yasm g++ build-essential libz-dev \ + texinfo libpng-dev freeglut3-dev libxv-dev libasound2-dev libbz2-dev \ + libncurses5-dev libxinerama-dev libfreetype6-dev libxft-dev libgif-dev \ + libtiff5-dev exuberant-ctags ttf-bitstream-vera xfonts-75dpi xfonts-100dpi \ + fonts-dejavu libopenexr-dev libavc1394-dev festival-dev fftw3-dev gdb \ + libdc1394-25 libdc1394-dev libiec61883-dev libflac-dev libjbig-dev libusb-1.0-0-dev \ + libvdpau-dev libva-dev libsndfile1-dev libtheora-dev cmake udftools \ + libxml2-utils git inkscape autoconf automake debhelper libgtk2.0-dev \ + libpulse-dev libtool 2to3 python-is-python3 python2-minimal python2 dh-python \ + patchelf libboost-filesystem-dev libboost-regex-dev libxml-parser-perl libimath-dev liblilv-dev + ;; +#debian for newest versions since about 06/2022 +"debian") + apt-get -f -y install apt-file sox nasm yasm g++ build-essential zlib1g-dev \ + texinfo libpng-dev freeglut3-dev libxv-dev libasound2-dev libbz2-dev \ + libncurses5-dev libxinerama-dev libfreetype6-dev libxft-dev libgif-dev \ + libtiff5-dev exuberant-ctags ttf-bitstream-vera xfonts-75dpi xfonts-100dpi \ + fonts-dejavu libopenexr-dev festival libfftw3-dev gdb libusb-1.0-0-dev \ + libdc1394-25 libdc1394-dev libflac-dev libjbig-dev libvdpau-dev libva-dev \ + inkscape libsndfile1-dev libtheora-dev cmake udftools libxml2-utils git \ + autoconf automake debhelper libgtk2.0-dev libpulse-dev 2to3 python-is-python3 python3 dh-python \ + patchelf libboost-filesystem-dev libboost-regex-dev libxml-parser-perl fuse + ;; + +*) echo "unknown os: $dir" exit 1; ;; diff --git a/cinelerra-5.1/blds/bsd.bld b/cinelerra-5.1/blds/bsd.bld index 3a6c024c..6f78fd4b 100755 --- a/cinelerra-5.1/blds/bsd.bld +++ b/cinelerra-5.1/blds/bsd.bld @@ -14,6 +14,6 @@ alias make=gmake --without-video4linux2 --without-xxf86vm --without-ladspa-build \ --without-commercial --without-thirdparty \ --without-shuttle --without-libdpx --without-shuttle-usb \ - --without-x10tv --with-jobs=4 --without-wintv + --without-x10tv --with-jobs=4 --without-wintv --with-clang gmake gmake install ) 2>&1 | tee log diff --git a/cinelerra-5.1/blds/netbsd.bld b/cinelerra-5.1/blds/netbsd.bld old mode 100644 new mode 100755 index b6c5f96b..0e2c97a6 --- a/cinelerra-5.1/blds/netbsd.bld +++ b/cinelerra-5.1/blds/netbsd.bld @@ -1,22 +1,22 @@ #!/bin/bash -#use: patch -p2 < bsd.patch +#patch not needed anymore export CONFIG_SHELL=/bin/bash export MAKE=gmake -export C_INCLUDE_PATH=/usr/local/include:/usr/X11R7/include:/usr/pkg/include:/usr/pkg/include/ffmpeg4 +export C_INCLUDE_PATH=/usr/local/include:/usr/X11R7/include:/usr/pkg/include:/usr/pkg/include/ffmpeg6 export CPLUS_INCLUDE_PATH=/usr/local/include export LIBRARY_PATH=/usr/local/lib -export LDFLAGS="-L/usr/X11R7/lib -L/usr/pkg/lib" -export CFLAGS="-I/usr/pkg/include -I/usr/pkg/include/ffmpeg4 -pthread -I/usr/pkg/include -I/usr/pkg/include/OpenEXR -I/usr/pkg/include -I/usr/pkg/include/Imath" +export LDFLAGS="-L/usr/X11R7/lib -L/usr/pkg/lib -L/usr/pkg/lib/ffmpeg6 " +export CFLAGS1="-I/usr/pkg/include -I/usr/pkg/include/ffmpeg6 -pthread -I/usr/pkg/include -I/usr/pkg/include/OpenEXR -I/usr/pkg/include -I/usr/pkg/include/Imath" alias make=gmake ( ./autogen.sh - BSD=1 CC=gcc CXX=g++ CFLAGS="-g -fpermissive -O2 -DFFMPEG3" \ + BSD=1 CC=gcc CXX=g++ CFLAGS=" ${CFLAGS1} -g -fpermissive -O2" \ ./configure --with-single-user \ --disable-static-build --without-lv2 --disable-lame --disable-twolame \ --with-oss --without-alsa --without-firewire --without-dv --without-dvb \ --without-video4linux2 --without-xxf86vm --without-ladspa-build \ --without-libzmpeg --without-commercial --without-thirdparty \ --without-vaapi --without-openexr --with-jobs=4 --without-vdpau --without-shuttle --without-shuttle-usb \ - --without-x10tv --without-wintv + --without-x10tv --without-wintv --without-libdpx gmake gmake install ) 2>&1 | tee log diff --git a/cinelerra-5.1/blds/termux.bld b/cinelerra-5.1/blds/termux.bld index afa14a74..e30f5750 100755 --- a/cinelerra-5.1/blds/termux.bld +++ b/cinelerra-5.1/blds/termux.bld @@ -1,6 +1,6 @@ #!/bin/bash # Produced, tested, and used by Andrew-R on an Android tablet -export FFMPEG_EXTRA_CFG="--disable-debug --disable-doc --disable-ffprobe --enable-libdav1d" -export EXTRA_LIBS="-ldav1d" -./configure --without-lv2 --without-vdpau --without-vaapi --without-ladspa-build \ - --without-nv --with-single-user --with-clang --without-gl --disable-dav1d +export FFMPEG_EXTRA_CFG="--disable-debug --target-os=android --enable-mediacodec --enable-jni --enable-opencl --disable-doc --disable-ffprobe --enable-libdav1d" +export EXTRA_LIBS="-ldav1d -lOpenCL -landroid -landroid-posix-semaphore" +./configure --with-lv2 --disable-lv2 --disable-sord --disable-serd --disable-suil --disable-sratom --disable-lilv --without-vdpau --without-vaapi --without-ladspa-build \ + --without-nv --with-single-user --with-clang --without-gl --disable-dav1d diff --git a/cinelerra-5.1/blds/termux_dyn.bld b/cinelerra-5.1/blds/termux_dyn.bld index 252d3192..ae099e62 100755 --- a/cinelerra-5.1/blds/termux_dyn.bld +++ b/cinelerra-5.1/blds/termux_dyn.bld @@ -6,4 +6,4 @@ export CFLAGS --without-dv \ --without-firewire --without-vaapi \ --without-vdpau --without-libdpx \ - --without-gl + --without-gl --with-clang diff --git a/cinelerra-5.1/cinelerra/Makefile b/cinelerra-5.1/cinelerra/Makefile index fe3e67a7..1cb58d50 100644 --- a/cinelerra-5.1/cinelerra/Makefile +++ b/cinelerra-5.1/cinelerra/Makefile @@ -437,23 +437,32 @@ ifeq ($(WANT_CIN_3RDPARTY),no) LIBS += -lavfilter -lavformat -lavcodec -lavutil LIBS += -lswresample -lswscale PLATFORM = $(shell uname -s) -ifneq (, $(filter $(PLATFORM), FreeBSD NetBSD)) +ifneq (, $(filter $(PLATFORM), NetBSD)) +LIBS += -lintl +endif +ifneq (, $(filter $(PLATFORM), FreeBSD)) LIBS += -lintl -liconv LIBS += -lexecinfo endif -LIBS += `pkg-config --libs OpenEXR` -LIBS += `pkg-config --libs flac` -LIBS += `pkg-config --libs libjpeg` -LIBS += `pkg-config --libs uuid` -LIBS += `pkg-config --libs theora` -LIBS += `pkg-config --libs vorbis` -LIBS += `pkg-config --libs sndfile` +LIBS += `pkg-config --libs OpenEXR 2>/dev/null` +LIBS += `pkg-config --libs flac 2>/dev/null` +LIBS += `pkg-config --libs libjpeg 2>/dev/null` +LIBS += `pkg-config --libs uuid 2>/dev/null` +LIBS += `pkg-config --libs theora 2>/dev/null` +LIBS += `pkg-config --libs vorbis 2>/dev/null` +LIBS += `pkg-config --libs sndfile 2>/dev/null` +LIBS += `pkg-config --libs x11 2>/dev/null` +ifeq ($(WANT_DV),yes) +LIBS += `pkg-config --libs libiec61883 2>/dev/null` +LIBS += `pkg-config --libs libdv 2>/dev/null` +LIBS += `pkg-config --libs libavc1394 2>/dev/null` +endif ifeq ($(WANT_LIBZMPEG),yes) LIBS += -la52 -ltwolame -lmp3lame endif LIBS += -lgif -ltheoraenc -ltheoradec -lvorbisfile -lvorbisenc -ltiff ifeq ($(shell uname -o), Android) -LIBS += -landroid-shmem -liconv jpt.a +LIBS += -landroid-shmem -liconv ../libbthread-master/jpt.a endif LIBS += $(shared_libs) LIBS += $(system_libs) @@ -517,7 +526,7 @@ CFLAGS += -DUSE_ALPHA else -LDFLAGS1 = -Wl,-export-dynamic -g +LDFLAGS1 = -Wl,-export-dynamic -g -Wl,-z,noexecstack LDFLAGS2 = $(LDFLAGS) LINKER = $(CXX) -o $(OUTPUT) @@ -535,6 +544,7 @@ all: $(OUTPUT) $(CUTADS) $(BDWRITE) $(LV2UI) $(OUTPUT): $(OBJS) $(THEME_DATA) $(DCRAW) $(LIBRARIES) $(LINKER) `cat $(OBJDIR)/objs` $(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(OUTPUT) $(OUTPUT_G)) + $(if $(findstring -g,$(CFLAGS)),objcopy --add-gnu-debuglink=$(OUTPUT_G) $(OUTPUT)) $(if $(findstring -ggdb,$(CFLAGS)),,strip $(OUTPUT)) ln -f -s ../bin/$(WANT_CIN) ci @@ -543,6 +553,7 @@ $(CUTADS): $(CUTOBJS) $(CUTLIBS) $(LIBRARIES) @echo $(CXX) -o $@ $(CUTOBJS) @$(CXX) $(CFLAGS) -pthread -o $@ $(CUTOBJS) $(CUTLIBS) $(LIBS) $(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(CUTADS) $(CUTADS).debuginfo) + $(if $(findstring -g,$(CFLAGS)),objcopy --add-gnu-debuglink=$(CUTADS).debuginfo $(CUTADS)) $(if $(findstring -ggdb,$(CFLAGS)),,strip $(CUTADS)) install-cutads: diff --git a/cinelerra-5.1/cinelerra/RELEASE_NOTES b/cinelerra-5.1/cinelerra/RELEASE_NOTES deleted file mode 100644 index a14d828b..00000000 --- a/cinelerra-5.1/cinelerra/RELEASE_NOTES +++ /dev/null @@ -1,35 +0,0 @@ -1.1.0 - -Titler fonts installed by rpm. -XMovie decodes ac3 according to redesigned liba52 channel mappings. -Quicktime MPEG4 parameters debugged. -Gradient effect. -Background rendering over a renderfarm. -Renderfarm clients automatically reduced to idle priority. -Better MJPA decoding on single processors. -Better title functionality in 16 bit colormodels. -Undo for effect keyframes. -Effect GUI's cleared during undo for effect attachment. -Fewer lockups on startup. -Proper keyframe interpolation in scale effect. -Stamp timecode in titler. -Memory leak in rendering stages removed. -Removed legacy plugin server code. -Downsample video resolution. -Option to generate sequence header in every GOP for MPEG2. -LADSPA support. -Listbox doesn't enter drag_icon state when dragging column division. -Radial, linear, and zoom blur. -Effect rendering bug fixed. -64 bit mpeg transport stream seeking beyond 2 gigs. -More accurate mask drawing when projector is zoomed. -Clear labels updates CWindow -More accurate YUV/RGB conversions. -Histogram. -Perspective. -Import partial tgas -Copy keyframes doesn't copy default keyframe. -Track highlighting offset by vertical scroll. -Multiple video scope, spectrogram, and histogram displays may be opened. -HutSaturation in YUV colorspaces. -Undo for masks. diff --git a/cinelerra-5.1/cinelerra/TODO b/cinelerra-5.1/cinelerra/TODO deleted file mode 100644 index 726163ff..00000000 --- a/cinelerra-5.1/cinelerra/TODO +++ /dev/null @@ -1,146 +0,0 @@ -BIG BUGS ----------------- -Nested EDLs with different colormodels crash. -Effects not getting rendered if multiple effects have random starting times. -Drag effect before timeline is finished drawing after a load -> lockup -Load a sound file. Change the file on the disk. Crash on exit. -Change asset path, CPlayback never returns to redraw the frame. - - - - - - -WISH LIST ----------------- - -Private plugin data storage in the track. - - save_private(position) & load_private(position) calls - - the problem is the playback thread doesn't have access to the timeline EDL - - would need a call to send data back to the timeline EDL -Double click -> select edit -> drag to expand selection by edit -Remove unused files from project and disk. -clear button in error dialog -Option to display full path for assets -custom button bar - - preferences window with possible buttons and current buttons for the 3 main windows - - buttons need different implementations for each window because of locking - - order is fixed - - drag from possible buttons to current buttons to add - - drag from current buttons to possible buttons to remove - - remove icons after dragging out of possible buttons - - prev/next edit - - save - - open - - record - - new - - keyframe straight or curved - - modify labels - - modify effects - - align on frames -undo menu showing previous 20 steps to undo - - or page in resources window -Page in resources window for overlays -Common service for audio and video drivers. - - -time stretch rubber band - - before or after effects - -Music synthesis - - all roads lead to having just audio & video tracks - - asset or effect - -Image synthesis - - asset or effect - - particle system - - track motion of every pixel, determine Z for every pixel - - track motion for successively smaller macroblocks - - synthesize picture using cubes and compare - - - - -rendering, playback, record settings bound to EDL. -histogram parade - either toggle, different plugin, or plugin replacement -editing in place -Apply motion tracking to another effect or mask. - - currently involves matchmoving an alpha multiply track -Denoise from mjpeg tools. - - yuvdeinterlace -Check for output asset being used in project before rendering. -Extended MPEG video support - - need accurate beginning and ending frames - - 1: direct copy of MPEG video frames - - 2: multiplexer settings under audio - - 3: support program stream using mplex and fifos - - support transport stream using makets and fifos for mplex when it supports it - - encode AC3 audio only with video. 6 channel support - -Time average with median. -Remove unused resources function. -Session management -Signal handling for non interactive rendering. -Sound level using readahead buffer. -Asset searches. -Asset organization in subfolders. -Field based reverse video. -Zoomblur transition -Zoom transition - - - - - - - - - - -NOT GOING TO HAPPEN ---------------------- -Hide controls in Record Monitor -Quicktime mp3 needs standards check - - no need for mp3 anymore -Dissolve doesn't work in YUVA OpenGL - - not reproducible -Batch filename not saved from recording dialog if cancelled. - - not reproducible - - - - - - - -Not reproducible ----------------------- -Quit freezes when background rendering is on. - - No quit during slow effect with background rendering. - - Not reproducible. - - - - - - - - - - - -B ------------ -Doesn't support window managers with user placement of windows. -Remember Asset list position. - - - - - - - - -On hold --------------- -Paste non realtime plugins leading to a dialog box. diff --git a/cinelerra-5.1/cinelerra/TODO.mine b/cinelerra-5.1/cinelerra/TODO.mine deleted file mode 100644 index fe68087b..00000000 --- a/cinelerra-5.1/cinelerra/TODO.mine +++ /dev/null @@ -1,168 +0,0 @@ -Big bugs ----------------- -Node framerates not displaying. -Drag effect before timeline is finished drawing after a load -> lockup -Quicktime mp3 needs standards check - - no need for mp3 anymore -Importing assets of the same name but different resolutions crashes because the -formats aren't updated. -Default pan keyframe gets pasted when dragging edit from one track to another. -Undo doesn't restore project title from previous load. - - New file can be saved under old filename if undo is used. - - Current title changes in save function and could not be restored in redo. -Load a sound file. Change the file on the disk. Crash on exit. -Batch filename not saved from recording dialog if cancelled. -TOC progress sometimes doesn't automatically close if not updated at least once. -Labels always edited when concatenating new files to existing tracks. -Need to paste silence when pasting segment from a silent part of a track. -Slow undo updating if many still frames. -Change asset path, CPlayback never returns to redraw the frame. -First toggle between playback window and fullscreen sometimes crashes. -Cursor position is wrong during looped playback -fix AC3 gain problem. -Dissolve doesn't work in YUVA OpenGL - - - - - - -Big Features ----------------- -Documentation - - 2 point motion tracking - - lens - - swap frames -clear button in error dialog -FLAC -WMV 9 & 3 -QDM2 -AVI with AC3 audio has audio ID 0x2000 -Option to display full path for assets -custom button bar - - preferences window with possible buttons and current buttons for the 3 main windows - - buttons need different implementations for each window because of locking - - order is fixed - - drag from possible buttons to current buttons to add - - drag from current buttons to possible buttons to remove - - remove icons after dragging out of possible buttons - - prev/next edit - - save - - open - - record - - new - - keyframe straight or curved -undo menu showing previous 20 steps to undo - - or page in resources window -Page in resources window for overlays -Common service for audio and video drivers. -Embedded sequences - - pulldown menu of sequences - - tabs for sequences - - sequence naming - -time stretch rubber band - - before or after effects - -Music synthesis - - track type, asset or effect - -Image synthesis - - track type, asset or effect - - particle system - - track motion of every pixel, determine Z for every pixel - - track motion for successively smaller macroblocks - - synthesize picture using cubes and compare - -Digital TV - - dump network tuner - - combined tuner driver for audio and video - - channel scan only detects physical number and pids default to 0 - - user adds channels based on physical number - - dialog adds new subchannels as they're detected - - user selects PID's for audio and video in the channel edit dialog - - filters PID's because of image format differences - - software preview of video and audio. - - Maybe audio decoded in the record driver with playback on the playback device. - - - - -rendering, playback, record settings bound to EDL. -histogram parade - either toggle, different plugin, or plugin replacement -editing in place -Apply motion tracking to another effect or mask. - - currently involves matchmoving an alpha multiply track -Denoise from mjpeg tools. - - yuvdeinterlace -Check for output asset being used in project before rendering. -Extended MPEG video support - - need accurate beginning and ending frames - - 1: direct copy of MPEG video frames - - 2: multiplexer settings under audio - - 3: support program stream using mplex and fifos - - support transport stream using makets and fifos for mplex when it supports it - - encode AC3 audio only with video. 6 channel support - -Time average with median. -Remove unused resources function. -Session management -Signal handling for non interactive rendering. -Sound level using readahead buffer. -Asset searches. -Asset organization in subfolders. -Field based reverse video. -Zoomblur transition -Zoom transition - - - - - - - - - - -Not going to happen ---------------------- -Hide controls in Record Monitor - - - - - - - - -Not reproducible ----------------------- -Quit freezes when background rendering is on. - - No quit during slow effect with background rendering. - - Not reproducible. - - - - - - - - - - - -B ------------ -Doesn't support window managers with user placement of windows. -Remember Asset list position. - - - - - - - - -On hold --------------- -Paste non realtime plugins leading to a dialog box. diff --git a/cinelerra-5.1/cinelerra/TODO.r1027 b/cinelerra-5.1/cinelerra/TODO.r1027 deleted file mode 100644 index 0e562d36..00000000 --- a/cinelerra-5.1/cinelerra/TODO.r1027 +++ /dev/null @@ -1,157 +0,0 @@ -Big bugs ----------------- -Node framerates not displaying. -Drag effect before timeline is finished drawing after a load -> lockup -Quicktime mp3 needs standards check - - no need for mp3 anymore -Importing assets of the same name but different resolutions crashes because the -formats aren't updated. -Default pan keyframe gets pasted when dragging edit from one track to another. -Undo doesn't restore project title from previous load. - - New file can be saved under old filename if undo is used. - - Current title changes in save function and could not be restored in redo. -Load a sound file. Change the file on the disk. Crash on exit. -Batch filename not saved from recording dialog if cancelled. -TOC progress sometimes doesn't automatically close if not updated at least once. -Labels always edited when concatenating new files to existing tracks. -Need to paste silence when pasting segment from a silent part of a track. -Slow undo updating if many still frames. -Change asset path, CPlayback never returns to redraw the frame. -First toggle between playback window and fullscreen sometimes crashes. -Cursor position is wrong during looped playback -fix AC3 gain problem. - - - - - - - -Big Features ----------------- -Documentation - - 2 point motion tracking - - lens -FLAC -AVI with AC3 audio has audio ID 0x2000 -Option to display full path for assets -custom button bar - - preferences window with possible buttons and current buttons for the 3 main windows - - order is fixed - - drag from possible buttons to current buttons to add - - drag from current buttons to possible buttons to remove - - remove icons after dragging out of possible buttons - - prev/next edit - - save - - open - - record - - new - - keyframe straight or curved -filebox history should be alphabetical but still deleted based on age - - but File history isn't -undo menu showing previous 20 steps to undo - - page in resources window -Page in resources window for overlays -Common service for audio and video drivers. -time stretch rubber band - - before or after effects - -Music synthesis - - track type, asset or effect - -Image synthesis - - track type, asset or effect - - particle system - - track motion of every pixel, determine Z for every pixel - - track motion for successively smaller macroblocks - -Digital TV - - dump network tuner - - combined tuner driver for audio and video - - channel scan only detects physical number and pids default to 0 - - user adds channels based on physical number - - dialog adds new subchannels as they're detected - - user selects PID's for audio and video in the channel edit dialog - - software preview of video and audio. Maybe decoded in the record driver. - - - - -rendering, playback, record settings bound to EDL. -histogram parade - either toggle, different plugin, or plugin replacement -editing in place -Apply motion tracking to another effect or mask. - - currently involves matchmoving an alpha multiply track -Denoise from mjpeg tools. - - yuvdeinterlace -Check for output asset being used in project before rendering. -Extended MPEG video support - - need accurate beginning and ending frames - - 1: direct copy of MPEG video frames - - 2: multiplexer settings under audio - - 3: support program stream using mplex and fifos - - support transport stream using makets and fifos for mplex when it supports it - - encode AC3 audio only with video. 6 channel support - -Time average with median. -Remove unused resources function. -Session management -Signal handling for non interactive rendering. -Sound level using readahead buffer. -Asset searches. -Asset organization in subfolders. -Field based reverse video. -Zoomblur transition -Zoom transition - - - - - - - - - - -Not going to happen ---------------------- -Hide controls in Record Monitor - - - - - - - - -Not reproducible ----------------------- -Quit freezes when background rendering is on. - - No quit during slow effect with background rendering. - - Not reproducible. - - - - - - - - - - - -B ------------ -Doesn't support window managers with user placement of windows. -Remember Asset list position. - - - - - - - - -On hold --------------- -Paste non realtime plugins leading to a dialog box. diff --git a/cinelerra-5.1/cinelerra/TODO.r1040 b/cinelerra-5.1/cinelerra/TODO.r1040 deleted file mode 100644 index bbfc80fa..00000000 --- a/cinelerra-5.1/cinelerra/TODO.r1040 +++ /dev/null @@ -1,159 +0,0 @@ -Big bugs ----------------- -Node framerates not displaying. -Drag effect before timeline is finished drawing after a load -> lockup -Quicktime mp3 needs standards check - - no need for mp3 anymore -Importing assets of the same name but different resolutions crashes because the -formats aren't updated. -Default pan keyframe gets pasted when dragging edit from one track to another. -Undo doesn't restore project title from previous load. - - New file can be saved under old filename if undo is used. - - Current title changes in save function and could not be restored in redo. -Load a sound file. Change the file on the disk. Crash on exit. -Batch filename not saved from recording dialog if cancelled. -TOC progress sometimes doesn't automatically close if not updated at least once. -Labels always edited when concatenating new files to existing tracks. -Need to paste silence when pasting segment from a silent part of a track. -Slow undo updating if many still frames. -Change asset path, CPlayback never returns to redraw the frame. -First toggle between playback window and fullscreen sometimes crashes. -Cursor position is wrong during looped playback -fix AC3 gain problem. - - - - - - - -Big Features ----------------- -Embedded sequences -Documentation - - 2 point motion tracking - - lens -FLAC -Tilter should be baking on a transparent layer and applying alpha to that layer in a second pass. -AVI with AC3 audio has audio ID 0x2000 -Option to display full path for assets -custom button bar - - preferences window with possible buttons and current buttons for the 3 main windows - - order is fixed - - drag from possible buttons to current buttons to add - - drag from current buttons to possible buttons to remove - - remove icons after dragging out of possible buttons - - prev/next edit - - save - - open - - record - - new - - keyframe straight or curved -filebox history should be alphabetical but still deleted based on age - - but File history isn't -undo menu showing previous 20 steps to undo - - page in resources window -Page in resources window for overlays -Common service for audio and video drivers. -time stretch rubber band - - before or after effects - -Music synthesis - - track type, asset or effect - -Image synthesis - - track type, asset or effect - - particle system - - track motion of every pixel, determine Z for every pixel - - track motion for successively smaller macroblocks - -Digital TV - - dump network tuner - - combined tuner driver for audio and video - - channel scan only detects physical number and pids default to 0 - - user adds channels based on physical number - - dialog adds new subchannels as they're detected - - user selects PID's for audio and video in the channel edit dialog - - software preview of video and audio. Maybe decoded in the record driver. - - - - -rendering, playback, record settings bound to EDL. -histogram parade - either toggle, different plugin, or plugin replacement -editing in place -Apply motion tracking to another effect or mask. - - currently involves matchmoving an alpha multiply track -Denoise from mjpeg tools. - - yuvdeinterlace -Check for output asset being used in project before rendering. -Extended MPEG video support - - need accurate beginning and ending frames - - 1: direct copy of MPEG video frames - - 2: multiplexer settings under audio - - 3: support program stream using mplex and fifos - - support transport stream using makets and fifos for mplex when it supports it - - encode AC3 audio only with video. 6 channel support - -Time average with median. -Remove unused resources function. -Session management -Signal handling for non interactive rendering. -Sound level using readahead buffer. -Asset searches. -Asset organization in subfolders. -Field based reverse video. -Zoomblur transition -Zoom transition - - - - - - - - - - -Not going to happen ---------------------- -Hide controls in Record Monitor - - - - - - - - -Not reproducible ----------------------- -Quit freezes when background rendering is on. - - No quit during slow effect with background rendering. - - Not reproducible. - - - - - - - - - - - -B ------------ -Doesn't support window managers with user placement of windows. -Remember Asset list position. - - - - - - - - -On hold --------------- -Paste non realtime plugins leading to a dialog box. diff --git a/cinelerra-5.1/cinelerra/aautomation.C b/cinelerra-5.1/cinelerra/aautomation.C index 69c29a47..5766b999 100644 --- a/cinelerra-5.1/cinelerra/aautomation.C +++ b/cinelerra-5.1/cinelerra/aautomation.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/aboutprefs.C b/cinelerra-5.1/cinelerra/aboutprefs.C index 03a6f9d0..0ffb8072 100644 --- a/cinelerra-5.1/cinelerra/aboutprefs.C +++ b/cinelerra-5.1/cinelerra/aboutprefs.C @@ -28,10 +28,12 @@ #include "vframe.h" #include "versioninfo.h" + #ifndef COMPILEDATE #define COMPILEDATE "built: " __DATE__ " " __TIME__ #endif const char *AboutPrefs::build_timestamp = COMPILEDATE; +const char *AboutPrefs::ffmpeg_version = CINELERRA_LIBAV_VERSION; AboutPrefs::AboutPrefs(MWindow *mwindow, PreferencesWindow *pwindow) : PreferencesDialog(mwindow, pwindow) @@ -51,11 +53,6 @@ void AboutPrefs::create_objects() int x, y; BC_Resources *resources = BC_WindowBase::get_resources(); -// add_subwindow(new BC_Title(mwindow->theme->preferencestitle_x, -// mwindow->theme->preferencestitle_y, -// _("About"), -// LARGEFONT, -// resources->text_default)); x = mwindow->theme->preferencesoptions_x; y = mwindow->theme->preferencesoptions_y + @@ -72,7 +69,12 @@ void AboutPrefs::create_objects() COPYRIGHTTEXT2 #endif ); - y += get_text_height(MEDIUMFONT) * 3; + y += 2*get_text_height(MEDIUMFONT); + draw_text(x,y, COPYRIGHTTEXT3); + y += get_text_height(MEDIUMFONT); + draw_text(x,y, COPYRIGHTTEXT4); + + y += get_text_height(MEDIUMFONT) * 2; const char *cfg_path = File::get_cindat_path(); @@ -99,7 +101,7 @@ void AboutPrefs::create_objects() about.append(new BC_ListBoxItem(msg)); } BC_ListBox *listbox; - add_subwindow(listbox = new BC_ListBox(x, y, xS(450), yS(280), + add_subwindow(listbox = new BC_ListBox(x, y, xS(450), yS(250), LISTBOX_TEXT, &about, 0, 0, 1)); y += listbox->get_h() + get_text_height(LARGEFONT) + yS(10); } @@ -125,6 +127,12 @@ void AboutPrefs::create_objects() y += get_text_height(MEDIUMFONT, license3); draw_text(x, y, build_timestamp); + x += get_text_width(MEDIUMFONT, build_timestamp); + draw_text(x,y, " "); + x += get_text_width(MEDIUMFONT, " "); + draw_text(x,y, ffmpeg_version); + x -= get_text_width(MEDIUMFONT, build_timestamp); + x -= get_text_width(MEDIUMFONT, " "); #if defined(REPOMAINTXT) y += get_text_height(MEDIUMFONT, build_timestamp); draw_text(x, y, REPOMAINTXT); diff --git a/cinelerra-5.1/cinelerra/aboutprefs.h b/cinelerra-5.1/cinelerra/aboutprefs.h index ee87dcf1..1b50374c 100644 --- a/cinelerra-5.1/cinelerra/aboutprefs.h +++ b/cinelerra-5.1/cinelerra/aboutprefs.h @@ -32,6 +32,7 @@ public: ~AboutPrefs(); static const char *build_timestamp; + static const char *ffmpeg_version; void create_objects(); ArrayList about; }; diff --git a/cinelerra-5.1/cinelerra/adcuts.C b/cinelerra-5.1/cinelerra/adcuts.C index 1fa1700d..3b3bd96b 100644 --- a/cinelerra-5.1/cinelerra/adcuts.C +++ b/cinelerra-5.1/cinelerra/adcuts.C @@ -1,3 +1,22 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * This program is free software; you can redistribute it and/or modify it + * 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 + */ + #include "adcuts.h" #include "filexml.h" diff --git a/cinelerra-5.1/cinelerra/adcuts.h b/cinelerra-5.1/cinelerra/adcuts.h index 3e8b4340..549433cc 100644 --- a/cinelerra-5.1/cinelerra/adcuts.h +++ b/cinelerra-5.1/cinelerra/adcuts.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef _ADCUTS_H_ #define _ADCUTS_H_ diff --git a/cinelerra-5.1/cinelerra/adcuts.inc b/cinelerra-5.1/cinelerra/adcuts.inc index 22133d87..beef3f65 100644 --- a/cinelerra-5.1/cinelerra/adcuts.inc +++ b/cinelerra-5.1/cinelerra/adcuts.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef _ADCUTS_INC_ #define _ADCUTS_INC_ diff --git a/cinelerra-5.1/cinelerra/adeviceprefs.C b/cinelerra-5.1/cinelerra/adeviceprefs.C index 74d62d8d..92f6c364 100644 --- a/cinelerra-5.1/cinelerra/adeviceprefs.C +++ b/cinelerra-5.1/cinelerra/adeviceprefs.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/androidcontrol.C b/cinelerra-5.1/cinelerra/androidcontrol.C index f26aed40..89a9aca5 100644 --- a/cinelerra-5.1/cinelerra/androidcontrol.C +++ b/cinelerra-5.1/cinelerra/androidcontrol.C @@ -1,3 +1,22 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ #include "keys.h" #include "mwindow.h" diff --git a/cinelerra-5.1/cinelerra/androidcontrol.h b/cinelerra-5.1/cinelerra/androidcontrol.h index df1b2faf..5e92ba41 100644 --- a/cinelerra-5.1/cinelerra/androidcontrol.h +++ b/cinelerra-5.1/cinelerra/androidcontrol.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __ANDROID_CONTROL_H__ #define __ANDROID_CONTROL_H__ diff --git a/cinelerra-5.1/cinelerra/androidcontrol.inc b/cinelerra-5.1/cinelerra/androidcontrol.inc index 3a0b82c8..71faf828 100644 --- a/cinelerra-5.1/cinelerra/androidcontrol.inc +++ b/cinelerra-5.1/cinelerra/androidcontrol.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __ANDROID_CONTROL_INC__ #define __ANDROID_CONTROL_INC__ diff --git a/cinelerra-5.1/cinelerra/asset.C b/cinelerra-5.1/cinelerra/asset.C index c4301af0..59454153 100644 --- a/cinelerra-5.1/cinelerra/asset.C +++ b/cinelerra-5.1/cinelerra/asset.C @@ -132,6 +132,8 @@ int Asset::init_values() ac3_bitrate = 128; + flac_compression = 0; + png_use_alpha = 0; png_depth = 8; png_compression = 0; @@ -293,6 +295,8 @@ void Asset::copy_format(Asset *asset, int do_index) tiff_cmodel = asset->tiff_cmodel; tiff_compression = asset->tiff_compression; + flac_compression = asset->flac_compression; + mov_sphere = asset->mov_sphere; jpeg_sphere = asset->jpeg_sphere; } @@ -803,6 +807,7 @@ void Asset::load_defaults(BC_Hash *defaults, exr_compression = GET_DEFAULT("EXR_COMPRESSION", exr_compression); tiff_cmodel = GET_DEFAULT("TIFF_CMODEL", tiff_cmodel); tiff_compression = GET_DEFAULT("TIFF_COMPRESSION", tiff_compression); + flac_compression = GET_DEFAULT("FLAC_COMPRESSION", flac_compression); mov_sphere = GET_DEFAULT("MOV_SPHERE", mov_sphere); jpeg_sphere = GET_DEFAULT("JPEG_SPHERE", jpeg_sphere); @@ -902,7 +907,7 @@ void Asset::save_defaults(BC_Hash *defaults, UPDATE_DEFAULT("TIFF_CMODEL", tiff_cmodel); UPDATE_DEFAULT("TIFF_COMPRESSION", tiff_compression); - + UPDATE_DEFAULT("FLAC_COMPRESSION", flac_compression); UPDATE_DEFAULT("MOV_SPHERE", mov_sphere); UPDATE_DEFAULT("JPEG_SPHERE", jpeg_sphere); diff --git a/cinelerra-5.1/cinelerra/asset.h b/cinelerra-5.1/cinelerra/asset.h index bb40ed4a..90b43524 100644 --- a/cinelerra-5.1/cinelerra/asset.h +++ b/cinelerra-5.1/cinelerra/asset.h @@ -1,6 +1,7 @@ /* * CINELERRA * Copyright (C) 2010 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 @@ -224,9 +225,10 @@ public: // TIFF video compression. An enumeration from filetiff.h int tiff_cmodel; int tiff_compression; - +// AC3 bitrate int ac3_bitrate; - +// FLAC compression + int flac_compression; // Insert tag for spherical playback int mov_sphere, jpeg_sphere; diff --git a/cinelerra-5.1/cinelerra/assetedit.C b/cinelerra-5.1/cinelerra/assetedit.C index 9bdf847f..18dde8ff 100644 --- a/cinelerra-5.1/cinelerra/assetedit.C +++ b/cinelerra-5.1/cinelerra/assetedit.C @@ -412,11 +412,11 @@ void AssetEditWindow::create_objects() { x = x2; - add_subwindow(lohi = new AssetEditByteOrderLOHI(this, - asset->byte_order, x, y)); - x += xS(70); add_subwindow(hilo = new AssetEditByteOrderHILO(this, !asset->byte_order, x, y)); + x += xS(70); + add_subwindow(lohi = new AssetEditByteOrderLOHI(this, + asset->byte_order, x, y)); y += vmargin; } else { diff --git a/cinelerra-5.1/cinelerra/atrack.C b/cinelerra-5.1/cinelerra/atrack.C index 2e18bdf7..3215ae97 100644 --- a/cinelerra-5.1/cinelerra/atrack.C +++ b/cinelerra-5.1/cinelerra/atrack.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/audioalsa.C b/cinelerra-5.1/cinelerra/audioalsa.C index 4a128a74..21fe8b1e 100644 --- a/cinelerra-5.1/cinelerra/audioalsa.C +++ b/cinelerra-5.1/cinelerra/audioalsa.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/audiodevice.C b/cinelerra-5.1/cinelerra/audiodevice.C index 0904ed5a..9ae6f235 100644 --- a/cinelerra-5.1/cinelerra/audiodevice.C +++ b/cinelerra-5.1/cinelerra/audiodevice.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/audiodevice.h b/cinelerra-5.1/cinelerra/audiodevice.h index 2c12d9c4..f3336ae0 100644 --- a/cinelerra-5.1/cinelerra/audiodevice.h +++ b/cinelerra-5.1/cinelerra/audiodevice.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/audiodevice.inc b/cinelerra-5.1/cinelerra/audiodevice.inc index fdfd9483..13554940 100644 --- a/cinelerra-5.1/cinelerra/audiodevice.inc +++ b/cinelerra-5.1/cinelerra/audiodevice.inc @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/audiooss.C b/cinelerra-5.1/cinelerra/audiooss.C index cb1fc087..7bcc9442 100644 --- a/cinelerra-5.1/cinelerra/audiooss.C +++ b/cinelerra-5.1/cinelerra/audiooss.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/audiooss.h b/cinelerra-5.1/cinelerra/audiooss.h index 82340b3a..df62b682 100644 --- a/cinelerra-5.1/cinelerra/audiooss.h +++ b/cinelerra-5.1/cinelerra/audiooss.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/auto.C b/cinelerra-5.1/cinelerra/auto.C index 87a2ddaf..f4e751aa 100644 --- a/cinelerra-5.1/cinelerra/auto.C +++ b/cinelerra-5.1/cinelerra/auto.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/automation.C b/cinelerra-5.1/cinelerra/automation.C index c8556bf7..aa1c2006 100644 --- a/cinelerra-5.1/cinelerra/automation.C +++ b/cinelerra-5.1/cinelerra/automation.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008-2013 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/automation.h b/cinelerra-5.1/cinelerra/automation.h index b626d66a..cae68d54 100644 --- a/cinelerra-5.1/cinelerra/automation.h +++ b/cinelerra-5.1/cinelerra/automation.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008-2013 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/automation.inc b/cinelerra-5.1/cinelerra/automation.inc index 636eede3..434ebdab 100644 --- a/cinelerra-5.1/cinelerra/automation.inc +++ b/cinelerra-5.1/cinelerra/automation.inc @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008-2013 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/autos.h b/cinelerra-5.1/cinelerra/autos.h index dcb997d8..b4162e54 100644 --- a/cinelerra-5.1/cinelerra/autos.h +++ b/cinelerra-5.1/cinelerra/autos.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/awindow.C b/cinelerra-5.1/cinelerra/awindow.C index 160902ed..cc9986a4 100644 --- a/cinelerra-5.1/cinelerra/awindow.C +++ b/cinelerra-5.1/cinelerra/awindow.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 1997-2012 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/awindow.h b/cinelerra-5.1/cinelerra/awindow.h index bff38258..d98fe475 100644 --- a/cinelerra-5.1/cinelerra/awindow.h +++ b/cinelerra-5.1/cinelerra/awindow.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index be782977..dfe0163a 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 1997-2012 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/batchrender.C b/cinelerra-5.1/cinelerra/batchrender.C index 20d817b5..c010f185 100644 --- a/cinelerra-5.1/cinelerra/batchrender.C +++ b/cinelerra-5.1/cinelerra/batchrender.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2011 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/batchrender.h b/cinelerra-5.1/cinelerra/batchrender.h index 2646b577..fca24d22 100644 --- a/cinelerra-5.1/cinelerra/batchrender.h +++ b/cinelerra-5.1/cinelerra/batchrender.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/bdcreate.C b/cinelerra-5.1/cinelerra/bdcreate.C index 16c655a5..7305d4e9 100644 --- a/cinelerra-5.1/cinelerra/bdcreate.C +++ b/cinelerra-5.1/cinelerra/bdcreate.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #include "asset.h" #include "bchash.h" #include "bdcreate.h" @@ -26,12 +46,21 @@ #include #if !defined(__FreeBSD__) #include +#if !defined(__NetBSD__) #include +#endif #else #include #include #endif +#if defined(__NetBSD__) +#include +#ifndef statfs +#define statfs statvfs +#endif +#endif + // BD Creation // selected by timezone @@ -51,10 +80,10 @@ static struct bd_format { { "1920x1080 25i", 1920,1080, 25., 1, ILACE_MODE_TOP_FIRST }, { "1920x1080 25p*", 1920,1080, 25., 1, ILACE_MODE_FAKE_INTERLACE }, { "1920x1080 23.976p", 1920,1080, 23.976, 1, ILACE_MODE_NOTINTERLACED }, - { "1440x1080 29.97i", 1440,1080, 29.97, -1, ILACE_MODE_TOP_FIRST }, - { "1440x1080 25i", 1440,1080, 25., -1, ILACE_MODE_TOP_FIRST }, - { "1440x1080 24p", 1440,1080, 24., -1, ILACE_MODE_NOTINTERLACED }, - { "1440x1080 23.976p", 1440,1080, 23.976,-1, ILACE_MODE_NOTINTERLACED }, + { "1440x1080 29.97i", 1440,1080, 29.97, 1, ILACE_MODE_TOP_FIRST }, + { "1440x1080 25i", 1440,1080, 25., 1, ILACE_MODE_TOP_FIRST }, + { "1440x1080 24p", 1440,1080, 24., 1, ILACE_MODE_NOTINTERLACED }, + { "1440x1080 23.976p", 1440,1080, 23.976, 1, ILACE_MODE_NOTINTERLACED }, { "1280x720 59.94p", 1280,720, 59.94, 1, ILACE_MODE_NOTINTERLACED }, { "1280x720 50p", 1280,720, 50., 1, ILACE_MODE_NOTINTERLACED }, { "1280x720 29.97p*", 1280,720, 29.97, 1, ILACE_MODE_NOTINTERLACED }, @@ -63,8 +92,13 @@ static struct bd_format { { "1280x720 23.976p", 1280,720, 23.976, 1, ILACE_MODE_NOTINTERLACED }, { "720x576 25i", 720,576, 25., 0, ILACE_MODE_BOTTOM_FIRST }, { "720x576 25p*", 720,576, 25., 0, ILACE_MODE_NOTINTERLACED }, + { "720x576(w) 25i", 720,576, 25., 1, ILACE_MODE_BOTTOM_FIRST }, + { "720x576(w) 25p*", 720,576, 25., 1, ILACE_MODE_NOTINTERLACED }, { "720x480 29.97i", 720,480, 29.97, 0, ILACE_MODE_BOTTOM_FIRST }, { "720x480 29.97p*", 720,480, 29.97, 0, ILACE_MODE_NOTINTERLACED }, + { "720x480(w) 29.97i", 720,480, 29.97, 1, ILACE_MODE_BOTTOM_FIRST }, + { "720x480(w) 29.97p*", 720,480, 29.97, 1, ILACE_MODE_NOTINTERLACED }, + }; static struct bd_profile { @@ -398,6 +432,13 @@ int CreateBD_Thread::create_bd_jobs(ArrayList *jobs, const char FFMPEG::set_option_path(option_path, "video/%s", asset->vcodec); FFMPEG::load_options(option_path, asset->ff_video_options, sizeof(asset->ff_video_options)); + if(session->aspect_w == 16) { + char aspect_line[100]; + float par = (float)((float)asset->width / (float)asset->height); + sprintf(aspect_line, "aspect=%f\n", asset->aspect_ratio/par); + strcat(asset->ff_video_options, aspect_line); + //printf("Aspect line: %s par: %f width: %i height: %i\n ", aspect_line, par, asset->width, asset->height); + } asset->ff_video_bitrate = vid_bitrate; asset->ff_video_quality = -1; return 0; @@ -1117,7 +1158,7 @@ int CreateBD_FormatItem::handle_event() popup->set_text(text); int n = strlen(text)-1; int not_standard = n >= 0 && text[n] == '*' ? 1 : 0; - popup->gui->non_standard->update(not_standard ? _("* non-standard format") : "", 0); + popup->gui->non_standard->update(not_standard ? _(" * non-standard format") : "", 0); return popup->handle_event(); } diff --git a/cinelerra-5.1/cinelerra/bdcreate.h b/cinelerra-5.1/cinelerra/bdcreate.h index 793ba513..6d58682b 100644 --- a/cinelerra-5.1/cinelerra/bdcreate.h +++ b/cinelerra-5.1/cinelerra/bdcreate.h @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + + #ifndef __BDCREATE_H__ #define __BDCREATE_H__ diff --git a/cinelerra-5.1/cinelerra/bdwrite.C b/cinelerra-5.1/cinelerra/bdwrite.C index 1017c169..1b864bb9 100644 --- a/cinelerra-5.1/cinelerra/bdwrite.C +++ b/cinelerra-5.1/cinelerra/bdwrite.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + //#include "bd.h" //This program was created by inverting libbluray, without any docs, // so it is probably got problems. Still, works on my Samsung player. @@ -2575,6 +2595,22 @@ static int field_probe(AVFormatContext *fmt_ctx, AVStream *st) av_packet_unref(&ipkt); av_frame_free(&ipic); avcodec_free_context(&ctx); + + if (ilaced < 0) { + fprintf(stderr, "warning bdwrite uses field into from stream \n", st->codecpar->field_order); + switch(st->codecpar->field_order) { + case AV_FIELD_TT: + case AV_FIELD_TB: + case AV_FIELD_BB: + case AV_FIELD_BT: + return 1; + case AV_FIELD_PROGRESSIVE: + return 0; + default: + return -1; + } + } + return ilaced; } diff --git a/cinelerra-5.1/cinelerra/boxblur.h b/cinelerra-5.1/cinelerra/boxblur.h index 9213c852..49eb3a57 100644 --- a/cinelerra-5.1/cinelerra/boxblur.h +++ b/cinelerra-5.1/cinelerra/boxblur.h @@ -1,3 +1,4 @@ +// from ffmpeg vf_boxblur #include "boxblur.inc" #include "loadbalance.h" #include "vframe.h" diff --git a/cinelerra-5.1/cinelerra/boxblur.inc b/cinelerra-5.1/cinelerra/boxblur.inc index 8eee8b1f..e992b321 100644 --- a/cinelerra-5.1/cinelerra/boxblur.inc +++ b/cinelerra-5.1/cinelerra/boxblur.inc @@ -1,3 +1,4 @@ +// from ffmpeg vf_boxblur #ifndef __BOXBLUR_INC__ #define __BOXBLUR_INC__ diff --git a/cinelerra-5.1/cinelerra/browsebutton.C b/cinelerra-5.1/cinelerra/browsebutton.C index 99b356a8..f8d489c3 100644 --- a/cinelerra-5.1/cinelerra/browsebutton.C +++ b/cinelerra-5.1/cinelerra/browsebutton.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/browsebutton.h b/cinelerra-5.1/cinelerra/browsebutton.h index 0818cdc8..8ffd0fc9 100644 --- a/cinelerra-5.1/cinelerra/browsebutton.h +++ b/cinelerra-5.1/cinelerra/browsebutton.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/cache.C b/cinelerra-5.1/cinelerra/cache.C index a93f1e1b..a024fc43 100644 --- a/cinelerra-5.1/cinelerra/cache.C +++ b/cinelerra-5.1/cinelerra/cache.C @@ -120,7 +120,7 @@ File* CICache::check_out(Asset *asset, EDL *edl, int block) remove_user(); return 0; } - + //printf("users: %i \n", users ); remove_user(); total_lock->unlock(); //printf("check out %p %lx %s\n", current, tid, asset->path); diff --git a/cinelerra-5.1/cinelerra/channelinfo.C b/cinelerra-5.1/cinelerra/channelinfo.C index 5c8d9187..8e71c32d 100644 --- a/cinelerra-5.1/cinelerra/channelinfo.C +++ b/cinelerra-5.1/cinelerra/channelinfo.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifdef HAVE_DVB #include "asset.h" diff --git a/cinelerra-5.1/cinelerra/channelinfo.h b/cinelerra-5.1/cinelerra/channelinfo.h index d436ebb8..d96349da 100644 --- a/cinelerra-5.1/cinelerra/channelinfo.h +++ b/cinelerra-5.1/cinelerra/channelinfo.h @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + + #ifndef CHANNELINFO_H #define CHANNELINFO_H diff --git a/cinelerra-5.1/cinelerra/channelinfo.inc b/cinelerra-5.1/cinelerra/channelinfo.inc index b1864d6b..9147821a 100644 --- a/cinelerra-5.1/cinelerra/channelinfo.inc +++ b/cinelerra-5.1/cinelerra/channelinfo.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef CHANNELINFO_INC #define CHANNELINFO_INC diff --git a/cinelerra-5.1/cinelerra/clipedit.C b/cinelerra-5.1/cinelerra/clipedit.C index f3f81f25..7351be71 100644 --- a/cinelerra-5.1/cinelerra/clipedit.C +++ b/cinelerra-5.1/cinelerra/clipedit.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/clipedls.C b/cinelerra-5.1/cinelerra/clipedls.C index 83c23ee0..1cb05cc8 100644 --- a/cinelerra-5.1/cinelerra/clipedls.C +++ b/cinelerra-5.1/cinelerra/clipedls.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #include "bcsignals.h" #include "clipedls.h" #include "edl.h" diff --git a/cinelerra-5.1/cinelerra/clipedls.h b/cinelerra-5.1/cinelerra/clipedls.h index ee2467aa..42f646f0 100644 --- a/cinelerra-5.1/cinelerra/clipedls.h +++ b/cinelerra-5.1/cinelerra/clipedls.h @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + + #ifndef __CLIP_EDLS_H__ #define __CLIP_EDLS_H__ diff --git a/cinelerra-5.1/cinelerra/clipedls.inc b/cinelerra-5.1/cinelerra/clipedls.inc index 8febdcd4..952af161 100644 --- a/cinelerra-5.1/cinelerra/clipedls.inc +++ b/cinelerra-5.1/cinelerra/clipedls.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __CLIPEDLS_INC__ #define __CLIPEDLS_INC__ diff --git a/cinelerra-5.1/cinelerra/commercials.C b/cinelerra-5.1/cinelerra/commercials.C index b93bb4e3..3011e329 100644 --- a/cinelerra-5.1/cinelerra/commercials.C +++ b/cinelerra-5.1/cinelerra/commercials.C @@ -1,3 +1,22 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ #include "arraylist.h" #include "asset.h" diff --git a/cinelerra-5.1/cinelerra/commercials.h b/cinelerra-5.1/cinelerra/commercials.h index 9fc8df5d..6e504d44 100644 --- a/cinelerra-5.1/cinelerra/commercials.h +++ b/cinelerra-5.1/cinelerra/commercials.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #if defined(__i386__) || defined(__x86_64__) #if defined (__linux__) #ifndef _COMMERCIALS_H_ @@ -205,4 +225,4 @@ public: #endif #endif // linux -#endif /* x86 */ \ No newline at end of file +#endif /* x86 */ diff --git a/cinelerra-5.1/cinelerra/commercials.inc b/cinelerra-5.1/cinelerra/commercials.inc index f0386208..1d3a3939 100644 --- a/cinelerra-5.1/cinelerra/commercials.inc +++ b/cinelerra-5.1/cinelerra/commercials.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef _COMMERCIALS_INC_ #define _COMMERCIALS_INC_ diff --git a/cinelerra-5.1/cinelerra/compressortools.inc b/cinelerra-5.1/cinelerra/compressortools.inc index 58810d9c..2a8e33d2 100644 --- a/cinelerra-5.1/cinelerra/compressortools.inc +++ b/cinelerra-5.1/cinelerra/compressortools.inc @@ -1,3 +1,24 @@ + +/* + * CINELERRA + * Copyright (C) 2008-2019 Adam Williams + * + * 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 + * + */ + #ifndef __COMPRESSORTOOLS_INC__ #define __COMPRESSORTOOLS_INC__ diff --git a/cinelerra-5.1/cinelerra/convert.h b/cinelerra-5.1/cinelerra/convert.h index 41c125c9..53463205 100644 --- a/cinelerra-5.1/cinelerra/convert.h +++ b/cinelerra-5.1/cinelerra/convert.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + #ifndef __CONVERT_H__ #define __CONVERT_H__ diff --git a/cinelerra-5.1/cinelerra/convert.inc b/cinelerra-5.1/cinelerra/convert.inc index 119a94fb..366368c9 100644 --- a/cinelerra-5.1/cinelerra/convert.inc +++ b/cinelerra-5.1/cinelerra/convert.inc @@ -1,3 +1,24 @@ + +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + #ifndef __CONVERT_INC__ #define __CONVERT_INC__ diff --git a/cinelerra-5.1/cinelerra/cpanel.h b/cinelerra-5.1/cinelerra/cpanel.h index a3e19430..95b9d471 100644 --- a/cinelerra-5.1/cinelerra/cpanel.h +++ b/cinelerra-5.1/cinelerra/cpanel.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/cropvideo.C b/cinelerra-5.1/cinelerra/cropvideo.C index 72aa0b9d..08adc485 100644 --- a/cinelerra-5.1/cinelerra/cropvideo.C +++ b/cinelerra-5.1/cinelerra/cropvideo.C @@ -87,10 +87,12 @@ void CropVideo::run() int CropVideo::load_defaults() { +return 0; } int CropVideo::save_defaults() { +return 0; } CropVideoWindow::CropVideoWindow(MWindow *mwindow, CropVideo *thread) diff --git a/cinelerra-5.1/cinelerra/ctimebar.C b/cinelerra-5.1/cinelerra/ctimebar.C index 95166678..41d4c791 100644 --- a/cinelerra-5.1/cinelerra/ctimebar.C +++ b/cinelerra-5.1/cinelerra/ctimebar.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/ctracking.C b/cinelerra-5.1/cinelerra/ctracking.C index 23c7d1b4..4780b385 100644 --- a/cinelerra-5.1/cinelerra/ctracking.C +++ b/cinelerra-5.1/cinelerra/ctracking.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/cutads.C b/cinelerra-5.1/cinelerra/cutads.C index ac58d56a..736074c8 100644 --- a/cinelerra-5.1/cinelerra/cutads.C +++ b/cinelerra-5.1/cinelerra/cutads.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #include "../libzmpeg3/libzmpeg3.h" #include "arraylist.h" #include "mediadb.h" diff --git a/cinelerra-5.1/cinelerra/cwindowtool.C b/cinelerra-5.1/cinelerra/cwindowtool.C index cd331069..1762f644 100644 --- a/cinelerra-5.1/cinelerra/cwindowtool.C +++ b/cinelerra-5.1/cinelerra/cwindowtool.C @@ -1,6 +1,7 @@ /* * CINELERRA * Copyright (C) 2008-2017 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/cwindowtool.h b/cinelerra-5.1/cinelerra/cwindowtool.h index 48066398..b25e16a2 100644 --- a/cinelerra-5.1/cinelerra/cwindowtool.h +++ b/cinelerra-5.1/cinelerra/cwindowtool.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/dbwindow.C b/cinelerra-5.1/cinelerra/dbwindow.C index 98070234..cc60e650 100644 --- a/cinelerra-5.1/cinelerra/dbwindow.C +++ b/cinelerra-5.1/cinelerra/dbwindow.C @@ -1,4 +1,22 @@ - +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ #include "bcmenuitem.h" #include "bctimer.h" @@ -840,8 +858,8 @@ DbWindowItem(int id, const char *source, const char *title, DbWindowItem:: ~DbWindowItem() { - delete source; - delete title; + delete [] source; + delete [] title; } #define CmprFn(nm,key) int DbWindowGUI:: \ diff --git a/cinelerra-5.1/cinelerra/dbwindow.h b/cinelerra-5.1/cinelerra/dbwindow.h index aadbfb07..11e02e09 100644 --- a/cinelerra-5.1/cinelerra/dbwindow.h +++ b/cinelerra-5.1/cinelerra/dbwindow.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #if defined(__i386__) || defined(__x86_64__) #if defined (__linux__) #ifndef _DBWINDOW_H_ @@ -299,4 +319,4 @@ public: #endif #endif // linux -#endif /* x86 */ \ No newline at end of file +#endif /* x86 */ diff --git a/cinelerra-5.1/cinelerra/dbwindow.inc b/cinelerra-5.1/cinelerra/dbwindow.inc index 5134d3c1..e4306fef 100644 --- a/cinelerra-5.1/cinelerra/dbwindow.inc +++ b/cinelerra-5.1/cinelerra/dbwindow.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef _DBWINDOW_INC_ #define _DBWINDOW_INC_ diff --git a/cinelerra-5.1/cinelerra/dcraw.h b/cinelerra-5.1/cinelerra/dcraw.h index 3a124932..5fdc33b4 100644 --- a/cinelerra-5.1/cinelerra/dcraw.h +++ b/cinelerra-5.1/cinelerra/dcraw.h @@ -1,4 +1,27 @@ -/* CINELERRA dcraw.c */ +/* + dcraw.c -- Dave Coffin's raw photo decoder + Copyright 1997-2018 by Dave Coffin, dcoffin a cybercom o net + + This is a command-line ANSI C program to convert raw photos from + any digital camera on any computer running any operating system. + + No license is required to download and use dcraw.c. However, + to lawfully redistribute dcraw, you must either (a) offer, at + no extra charge, full source code* for all executable files + containing RESTRICTED functions, (b) distribute this code under + the GPL Version 2 or later, (c) remove all RESTRICTED functions, + re-implement them, or copy them from an earlier, unrestricted + Revision of dcraw.c, or (d) purchase a license from the author. + + The functions that process Foveon images have been RESTRICTED + since Revision 1.237. All other code remains free for all uses. + + *If you have not modified dcraw.c in any way, a link to my + homepage qualifies as "full source code". + + $Revision: 1.478 $ + $Date: 2018/06/01 20:36:25 $ + */ #include #include diff --git a/cinelerra-5.1/cinelerra/device1394output.h b/cinelerra-5.1/cinelerra/device1394output.h index 0690e896..5572c2f5 100644 --- a/cinelerra-5.1/cinelerra/device1394output.h +++ b/cinelerra-5.1/cinelerra/device1394output.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/dragcheckbox.C b/cinelerra-5.1/cinelerra/dragcheckbox.C index 8f699bdb..be1c3127 100644 --- a/cinelerra-5.1/cinelerra/dragcheckbox.C +++ b/cinelerra-5.1/cinelerra/dragcheckbox.C @@ -1,3 +1,20 @@ +/* + * 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 + */ + #include "automation.h" #include "bctoggle.h" #include "canvas.h" diff --git a/cinelerra-5.1/cinelerra/dragcheckbox.h b/cinelerra-5.1/cinelerra/dragcheckbox.h index d14da97c..2c294e1f 100644 --- a/cinelerra-5.1/cinelerra/dragcheckbox.h +++ b/cinelerra-5.1/cinelerra/dragcheckbox.h @@ -1,3 +1,20 @@ +/* + * 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 + */ + #ifndef __DRAGCHECKBOX_H__ #define __DRAGCHECKBOX_H__ diff --git a/cinelerra-5.1/cinelerra/dragcheckbox.inc b/cinelerra-5.1/cinelerra/dragcheckbox.inc index 327e0043..cb0a5429 100644 --- a/cinelerra-5.1/cinelerra/dragcheckbox.inc +++ b/cinelerra-5.1/cinelerra/dragcheckbox.inc @@ -1,3 +1,20 @@ +/* + * 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 + */ + #ifndef __DRAGCHECKBOX_INC__ #define __DRAGCHECKBOX_INC__ diff --git a/cinelerra-5.1/cinelerra/dv1394.h b/cinelerra-5.1/cinelerra/dv1394.h index 49217b8c..d8fc61f9 100644 --- a/cinelerra-5.1/cinelerra/dv1394.h +++ b/cinelerra-5.1/cinelerra/dv1394.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/dvdcreate.C b/cinelerra-5.1/cinelerra/dvdcreate.C index 175ef547..390d2cbc 100644 --- a/cinelerra-5.1/cinelerra/dvdcreate.C +++ b/cinelerra-5.1/cinelerra/dvdcreate.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #include "asset.h" #include "bchash.h" #include "clip.h" @@ -8,6 +28,7 @@ #include "edlsession.h" #include "file.h" #include "filexml.h" +#include "interlacemodes.h" #include "keyframe.h" #include "labels.h" #include "mainerror.h" @@ -26,12 +47,21 @@ #include #if !defined(__FreeBSD__) #include +#if !defined(__NetBSD__) #include +#endif #else #include #include #endif +#if defined(__NetBSD__) +#include +#ifndef statfs +#define statfs statvfs +#endif +#endif + #define DVD_PAL_4x3 0 #define DVD_PAL_16x9 1 #define DVD_NTSC_4x3 2 @@ -320,6 +350,10 @@ int CreateDVD_Thread::create_dvd_jobs(ArrayList *jobs, const ch double old_samplerate = session->sample_rate; double old_framerate = session->frame_rate; + if(use_deinterlace) { + session->interlace_mode = ILACE_MODE_NOTINTERLACED; + } + session->video_channels = DVD_STREAMS; session->video_tracks = DVD_STREAMS; session->frame_rate = dvd_framerate; @@ -437,12 +471,17 @@ int CreateDVD_Thread::create_dvd_jobs(ArrayList *jobs, const ch asset->vmpeg_bitrate = vid_bitrate; asset->vmpeg_quantization = 15; asset->vmpeg_iframe_distance = 15; - asset->vmpeg_progressive = 0; + if(session->interlace_mode == ILACE_MODE_NOTINTERLACED || use_deinterlace) + { asset->vmpeg_progressive = 1; } else { + asset->vmpeg_progressive = 0; } asset->vmpeg_denoise = 0; asset->vmpeg_seq_codes = 0; asset->vmpeg_derivative = 2; asset->vmpeg_preset = 8; asset->vmpeg_field_order = 0; + if(session->interlace_mode == ILACE_MODE_BOTTOM_FIRST && !use_deinterlace) + { asset->vmpeg_field_order = 1; } else { + asset->vmpeg_field_order = 0; } asset->vmpeg_pframe_distance = 0; use_farmed = job->farmed; job = new BatchRenderJob(mwindow->preferences, 0, 0); diff --git a/cinelerra-5.1/cinelerra/dvdcreate.h b/cinelerra-5.1/cinelerra/dvdcreate.h index 3c39ea15..b856bc75 100644 --- a/cinelerra-5.1/cinelerra/dvdcreate.h +++ b/cinelerra-5.1/cinelerra/dvdcreate.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __DVDCREATE_H__ #define __DVDCREATE_H__ diff --git a/cinelerra-5.1/cinelerra/editpanel.C b/cinelerra-5.1/cinelerra/editpanel.C index 0fa5064a..6da2d0da 100644 --- a/cinelerra-5.1/cinelerra/editpanel.C +++ b/cinelerra-5.1/cinelerra/editpanel.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/editpanel.h b/cinelerra-5.1/cinelerra/editpanel.h index 2f3b40ed..cf430e56 100644 --- a/cinelerra-5.1/cinelerra/editpanel.h +++ b/cinelerra-5.1/cinelerra/editpanel.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/edits.h b/cinelerra-5.1/cinelerra/edits.h index 5550cb55..f851e605 100644 --- a/cinelerra-5.1/cinelerra/edits.h +++ b/cinelerra-5.1/cinelerra/edits.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008-2013 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/edl.C b/cinelerra-5.1/cinelerra/edl.C index 8597dab3..30e9e894 100644 --- a/cinelerra-5.1/cinelerra/edl.C +++ b/cinelerra-5.1/cinelerra/edl.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 1997-2012 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 @@ -902,8 +903,8 @@ static void get_edit_regions(ArrayList *edits, ArrayList ®ions) // move edit inclusive labels by regions for( int i=0; isize(); ++i ) { Edit *edit = edits->get(i); - double pos = edit->track->from_units(edit->startproject); - double end = edit->track->from_units(edit->startproject + edit->length); + volatile double pos = edit->track->from_units(edit->startproject); + volatile double end = edit->track->from_units(edit->startproject + edit->length); int n = regions.size(), k = n; while( --k >= 0 ) { Range &range = regions[k]; diff --git a/cinelerra-5.1/cinelerra/edl.inc b/cinelerra-5.1/cinelerra/edl.inc index c23ecdb2..8b9e7303 100644 --- a/cinelerra-5.1/cinelerra/edl.inc +++ b/cinelerra-5.1/cinelerra/edl.inc @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/edlsession.C b/cinelerra-5.1/cinelerra/edlsession.C index 1471834d..1a761fc0 100644 --- a/cinelerra-5.1/cinelerra/edlsession.C +++ b/cinelerra-5.1/cinelerra/edlsession.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/edlsession.h b/cinelerra-5.1/cinelerra/edlsession.h index f88a1268..4fe36219 100644 --- a/cinelerra-5.1/cinelerra/edlsession.h +++ b/cinelerra-5.1/cinelerra/edlsession.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008-2015 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/eqcanvas.C b/cinelerra-5.1/cinelerra/eqcanvas.C index 24028889..8180c36d 100644 --- a/cinelerra-5.1/cinelerra/eqcanvas.C +++ b/cinelerra-5.1/cinelerra/eqcanvas.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + #include "clip.h" #include "eqcanvas.h" #include "mwindow.h" diff --git a/cinelerra-5.1/cinelerra/exportedl.C b/cinelerra-5.1/cinelerra/exportedl.C index 108c2ad6..69174635 100644 --- a/cinelerra-5.1/cinelerra/exportedl.C +++ b/cinelerra-5.1/cinelerra/exportedl.C @@ -39,7 +39,7 @@ #include "exportedl.h" #include "tracks.h" #include "transition.h" -#if defined (__FreeBSD__) +#if defined (__FreeBSD__) || defined (__NetBSD__) #include #endif #include diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C index 2d441a79..8c753a35 100644 --- a/cinelerra-5.1/cinelerra/ffmpeg.C +++ b/cinelerra-5.1/cinelerra/ffmpeg.C @@ -1,3 +1,22 @@ +/* + * CINELERRA + * Copyright (C) 2012-2014 Paolo Rampino + * + * 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 + * + */ #include #include @@ -585,6 +604,10 @@ int FFStream::write_packet(FFPacket &pkt) ret = av_interleaved_write_frame(ffmpeg->fmt_ctx, pkt); } else { + bsfc->time_base_in = st->time_base; + avcodec_parameters_copy(bsfc->par_in, st->codecpar); + av_bsf_init(bsfc); + ret = av_bsf_send_packet(bsfc, pkt); while( ret >= 0 ) { FFPacket bs; @@ -593,6 +616,9 @@ int FFStream::write_packet(FFPacket &pkt) if( ret == AVERROR_EOF ) return -1; break; } + //printf(" filter name %s \n", bsfc->filter[0].name); + //avcodec_parameters_copy(ffmpeg->fmt_ctx->streams[0]->codecpar, bsfc->par_out); + //avcodec_parameters_copy(st->codecpar, bsfc->par_out); av_packet_rescale_ts(bs, avctx->time_base, st->time_base); bs->stream_index = st->index; ret = av_interleaved_write_frame(ffmpeg->fmt_ctx, bs); @@ -1134,7 +1160,14 @@ int FFVideoStream::decode_hw_format(AVCodec *decoder, AVHWDeviceType type) if( hw_pix_fmt >= 0 ) { hw_pixfmt = hw_pix_fmt; avctx->get_format = get_hw_format; + const char *drm_node = getenv("CIN_DRM_DEC"); + if(drm_node && type==AV_HWDEVICE_TYPE_VAAPI) { + ret = av_hwdevice_ctx_create(&hw_device_ctx, type, drm_node, 0, 0); + } + else { ret = av_hwdevice_ctx_create(&hw_device_ctx, type, 0, 0, 0); + } + if( ret >= 0 ) { avctx->hw_device_ctx = av_buffer_ref(hw_device_ctx); ret = 1; @@ -1150,6 +1183,7 @@ int FFVideoStream::decode_hw_format(AVCodec *decoder, AVHWDeviceType type) AVHWDeviceType FFVideoStream::encode_hw_activate(const char *hw_dev) { + const char *drm_node_enc = getenv("CIN_DRM_ENC"); AVBufferRef *hw_device_ctx = 0; AVBufferRef *hw_frames_ref = 0; AVHWDeviceType type = AV_HWDEVICE_TYPE_NONE; @@ -1161,7 +1195,12 @@ AVHWDeviceType FFVideoStream::encode_hw_activate(const char *hw_dev) } } if( type != AV_HWDEVICE_TYPE_NONE ) { - int ret = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI, 0, 0, 0); + int ret = 0; + if (drm_node_enc) { + ret = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI, drm_node_enc, 0, 0); + } else { + ret = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_VAAPI, 0, 0, 0); + } if( ret < 0 ) { ff_err(ret, "Failed to create a HW device.\n"); type = AV_HWDEVICE_TYPE_NONE; @@ -2505,6 +2544,34 @@ int FFMPEG::info(char *text, int len) enum AVColorRange range = st->codecpar->color_range; const char *rg = av_color_range_name(range); report("/ range:%s\n", rg ? rg : unkn); + + AVRational sar = av_guess_sample_aspect_ratio(fmt_ctx, st, NULL); + AVRational display_aspect_ratio; + if(sar.num) { + + av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den, + st->codecpar->width * (int64_t)sar.num, + st->codecpar->height * (int64_t)sar.den, + 1024 * 1024); +/* report(" Guessed SAR: %d:%d, ", sar.num, sar.den ); + report("DAR: %d:%d \n", display_aspect_ratio.num, display_aspect_ratio.den); */ + } + if (st->sample_aspect_ratio.num) + { + av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den, + st->codecpar->width * (int64_t)st->sample_aspect_ratio.num, + st->codecpar->height * (int64_t)st->sample_aspect_ratio.den, + 1024 * 1024); + report(" container Detected SAR: %d:%d , DAR %d:%d \n", st->sample_aspect_ratio.num, st->sample_aspect_ratio.den, display_aspect_ratio.num, display_aspect_ratio.den); + } + if (st->codecpar->sample_aspect_ratio.num) + { + av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den, + st->codecpar->width * (int64_t)st->codecpar->sample_aspect_ratio.num, + st->codecpar->height * (int64_t)st->codecpar->sample_aspect_ratio.den, + 1024 * 1024); + report(" codec Detected SAR: %d:%d , DAR %d:%d \n", st->codecpar->sample_aspect_ratio.num, st->codecpar->sample_aspect_ratio.den, display_aspect_ratio.num, display_aspect_ratio.den); + } double secs = to_secs(st->duration, st->time_base); int64_t length = secs * vid->frame_rate + 0.5; double ofs = to_secs((vid->nudge - st->start_time), st->time_base); @@ -2939,6 +3006,14 @@ int FFMPEG::open_encoder(const char *type, const char *spec) vid->width = asset->width; vid->height = asset->height; vid->frame_rate = asset->frame_rate; +#if 0 + char tc_str[20] = "00:00:00:00"; + double tc_offset; + if(asset->timecode > 0) + Units::totext(tc_str, asset->timecode, TIME_HMSF, 0, asset->frame_rate, 0); + //printf("tc: %s \n", tc_str); + av_dict_set(&st->metadata, "timecode", tc_str, 0); +#endif if( (vid->color_range = asset->ff_color_range) < 0 ) vid->color_range = file_base->file->preferences->yuv_color_range; switch( vid->color_range ) { @@ -2990,6 +3065,13 @@ int FFMPEG::open_encoder(const char *type, const char *spec) frame_rate.num, frame_rate.den, INT_MAX); ctx->framerate = (AVRational) { frame_rate.num, frame_rate.den }; ctx->time_base = (AVRational) { frame_rate.den, frame_rate.num }; + if(!strcmp(format_name, "webm") || !strcmp(format_name, "matroska") || !strcmp(format_name, "mov") || + !strcmp(format_name, "qt") || !strcmp(format_name, "mp4") || !strcmp(format_name, "avi") || + !strcmp(format_name, "dv") || !strcmp(format_name, "yuv4mpegpipe")) + { + if (to_sample_aspect_ratio(asset).den > 0) + st->sample_aspect_ratio = to_sample_aspect_ratio(asset); + } st->avg_frame_rate = frame_rate; st->time_base = ctx->time_base; vid->writing = -1; @@ -3631,7 +3713,7 @@ float FFMPEG::ff_aspect_ratio(int stream) AVCodecParameters *par = ffvideo[stream]->st->codecpar; AVRational dar; AVRational sar = av_guess_sample_aspect_ratio(fmt_ctx, strm, NULL); - if (sar.num) { + if (sar.num && ffvideo[stream]->get_rotation_angle() == 0) { av_reduce(&dar.num, &dar.den, par->width * sar.num, par->height * sar.den, diff --git a/cinelerra-5.1/cinelerra/ffmpeg.h b/cinelerra-5.1/cinelerra/ffmpeg.h index af5e4300..ed864b59 100644 --- a/cinelerra-5.1/cinelerra/ffmpeg.h +++ b/cinelerra-5.1/cinelerra/ffmpeg.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2012-2014 Paolo Rampino + * + * 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 + */ + #ifndef FFMPEG_H #define FFMPEG_H diff --git a/cinelerra-5.1/cinelerra/ffmpeg.inc b/cinelerra-5.1/cinelerra/ffmpeg.inc index a9d697b9..19001e80 100644 --- a/cinelerra-5.1/cinelerra/ffmpeg.inc +++ b/cinelerra-5.1/cinelerra/ffmpeg.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2012-2014 Paolo Rampino + * + * 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 + * + */ + #ifndef __FFMPEG_INC__ #define __FFMPEG_INC__ diff --git a/cinelerra-5.1/cinelerra/file.C b/cinelerra-5.1/cinelerra/file.C index 2a133005..90ad489f 100644 --- a/cinelerra-5.1/cinelerra/file.C +++ b/cinelerra-5.1/cinelerra/file.C @@ -1,6 +1,7 @@ /* * CINELERRA * Copyright (C) 2010 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 @@ -254,6 +255,10 @@ int File::get_options(FormatTools *format, FileOGG::get_parameters(parent_window, asset, format_window, audio_options, video_options, edl); break; + case FILE_VORBIS: + FileVorbis::get_parameters(parent_window, asset, format_window, + audio_options, video_options, edl); + break; #endif default: break; diff --git a/cinelerra-5.1/cinelerra/fileac3.C b/cinelerra-5.1/cinelerra/fileac3.C index 04994227..dd3b4536 100644 --- a/cinelerra-5.1/cinelerra/fileac3.C +++ b/cinelerra-5.1/cinelerra/fileac3.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/filedb.inc b/cinelerra-5.1/cinelerra/filedb.inc index 4bb02cf2..4d347471 100644 --- a/cinelerra-5.1/cinelerra/filedb.inc +++ b/cinelerra-5.1/cinelerra/filedb.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + #ifndef _FILEDB_INC_ #define _FILEDB_INC_ diff --git a/cinelerra-5.1/cinelerra/filedv.C b/cinelerra-5.1/cinelerra/filedv.C index cf8bc1bf..14ddbf74 100644 --- a/cinelerra-5.1/cinelerra/filedv.C +++ b/cinelerra-5.1/cinelerra/filedv.C @@ -229,9 +229,9 @@ TRACE("FileDV::open_file 20") encoder->isPAL = isPAL; output_size = (isPAL ? DV1394_PAL_FRAME_SIZE : DV1394_NTSC_FRAME_SIZE); - // Compare to 16 / 8 rather than == 16 / 9 in case of floating point - // rounding errors - encoder->is16x9 = asset->aspect_ratio > 16 / 8; + //printf("filedv aspect- %f \n", asset->aspect_ratio); + if(1.777778 - asset->aspect_ratio < 0.001f) + encoder->is16x9 = 1; } else { @@ -602,6 +602,7 @@ UNTRACE int FileDV::write_frames(VFrame ***frames, int len) { int result = 0; + time_t now = time(NULL); if(stream == 0) return 1; @@ -619,11 +620,15 @@ int FileDV::write_frames(VFrame ***frames, int len) //printf("FileDV::write_frames: 4\n"); dv_encode_full_frame(encoder, temp_frame->get_rows(), e_dv_color_yuv, video_buffer); + dv_encode_metadata(video_buffer, encoder->isPAL, encoder->is16x9, &now, 0); + dv_encode_timecode(video_buffer, encoder->isPAL, 0); break; case BC_RGB888: //printf("FileDV::write_frames: 5\n"); dv_encode_full_frame(encoder, temp_frame->get_rows(), e_dv_color_rgb, video_buffer); + dv_encode_metadata(video_buffer, encoder->isPAL, encoder->is16x9, &now, 0); + dv_encode_timecode(video_buffer, encoder->isPAL, 0); break; default: unsigned char *data = new unsigned char[asset->height * asset->width * 2]; diff --git a/cinelerra-5.1/cinelerra/filedv.h b/cinelerra-5.1/cinelerra/filedv.h index 64e867e9..2ae140e6 100644 --- a/cinelerra-5.1/cinelerra/filedv.h +++ b/cinelerra-5.1/cinelerra/filedv.h @@ -28,10 +28,6 @@ #include "filebase.h" #include "file.inc" -#ifdef DV_USE_FFMPEG -#include -#endif - #include diff --git a/cinelerra-5.1/cinelerra/fileexr.C b/cinelerra-5.1/cinelerra/fileexr.C index fbc39862..a705f6c8 100644 --- a/cinelerra-5.1/cinelerra/fileexr.C +++ b/cinelerra-5.1/cinelerra/fileexr.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 @@ -311,6 +312,9 @@ int FileEXR::read_frame_header(char *path) int FileEXR::read_frame(VFrame *frame, VFrame *data) { + + try { + Imf::setGlobalThreadCount(file->cpus); EXRIStream exr_stream((char*)data->get_data(), data->get_compressed_size()); Imf::InputFile file(exr_stream); @@ -425,6 +429,10 @@ int FileEXR::read_frame(VFrame *frame, VFrame *data) } } return 0; + } catch (const std::exception &e) { + std::cerr << "error reading EXR image file:" << e.what() << std::endl; + return 1; + } } @@ -506,6 +514,15 @@ int FileEXR::write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit) return 0; } +int FileEXR::can_copy_from(Asset *asset, int64_t position) +{ + if(asset->format == FILE_EXR || + asset->format == FILE_EXR_LIST) + return 1; + + return 0; +} + FrameWriterUnit* FileEXR::new_writer_unit(FrameWriter *writer) { return new EXRUnit(this, writer); diff --git a/cinelerra-5.1/cinelerra/fileexr.h b/cinelerra-5.1/cinelerra/fileexr.h index 5f5b251e..40fb01c9 100644 --- a/cinelerra-5.1/cinelerra/fileexr.h +++ b/cinelerra-5.1/cinelerra/fileexr.h @@ -44,6 +44,7 @@ public: int read_frame_header(char *path); int read_frame(VFrame *frame, VFrame *data); int64_t get_memory_usage(); + int can_copy_from(Asset *asset, int64_t position); int write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit); FrameWriterUnit* new_writer_unit(FrameWriter *writer); diff --git a/cinelerra-5.1/cinelerra/fileffmpeg.C b/cinelerra-5.1/cinelerra/fileffmpeg.C index a6437242..2fbf6c86 100644 --- a/cinelerra-5.1/cinelerra/fileffmpeg.C +++ b/cinelerra-5.1/cinelerra/fileffmpeg.C @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * Copyright (C) 2010 Monty Montgomery + * Copyright (C) 2012-2014 Paolo Rampino + * + * 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 + * + */ #include #include diff --git a/cinelerra-5.1/cinelerra/fileffmpeg.h b/cinelerra-5.1/cinelerra/fileffmpeg.h index f4a0fec4..c4e7910f 100644 --- a/cinelerra-5.1/cinelerra/fileffmpeg.h +++ b/cinelerra-5.1/cinelerra/fileffmpeg.h @@ -1,3 +1,25 @@ +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * Copyright (C) 2010 Monty Montgomery + * Copyright (C) 2012-2014 Paolo Rampino + * + * 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 + */ + #ifndef __FILEFFMPEG_H__ #define __FILEFFMPEG_H__ diff --git a/cinelerra-5.1/cinelerra/fileflac.C b/cinelerra-5.1/cinelerra/fileflac.C index 94538037..946c9d84 100644 --- a/cinelerra-5.1/cinelerra/fileflac.C +++ b/cinelerra-5.1/cinelerra/fileflac.C @@ -213,6 +213,7 @@ int FileFLAC::open_file(int rd, int wr) FLAC__stream_encoder_set_channels(flac_encode, asset->channels); FLAC__stream_encoder_set_bits_per_sample(flac_encode, asset->bits); FLAC__stream_encoder_set_sample_rate(flac_encode, asset->sample_rate); + FLAC__stream_encoder_set_compression_level(flac_encode, asset->flac_compression); FLAC__stream_encoder_init_file(flac_encode, asset->path, 0, 0); } @@ -343,26 +344,50 @@ FLACConfigAudio::FLACConfigAudio(BC_WindowBase *parent_window, { this->parent_window = parent_window; this->asset = asset; + compression = 0; // *** CONTEXT_HELP *** context_help_set_keyword("Single File Rendering"); } FLACConfigAudio::~FLACConfigAudio() { + delete compression; } void FLACConfigAudio::create_objects() { + BC_Title *title; + int ys5 = yS(5), xs100 = xS(100); int x = xS(10), y = yS(10); lock_window("FLACConfigAudio::create_objects"); bits_popup = new BitsPopup(this, x, y, &asset->bits, 0, 0, 0, 0, 0); bits_popup->create_objects(); - + y += bits_popup->get_h() + ys5; + add_subwindow(title = new BC_Title(x,y,_("Compression:"))); + int x1 = x + title->get_w() + xs100; + compression = new FLACCompression(this, x1, y); + compression->create_objects(); + y += compression->get_h() + ys5; add_subwindow(new BC_OKButton(this)); show_window(1); unlock_window(); } +FLACCompression::FLACCompression(FLACConfigAudio *gui, int x, int y) +: BC_TumbleTextBox(gui, (int64_t)gui->asset->flac_compression, + (int64_t)0, (int64_t)8, x, y, xS(40)) + +{ + this->gui = gui; +} + +int FLACCompression::handle_event() +{ + gui->asset->flac_compression = atol(get_text()); + return 1; +} + + int FLACConfigAudio::close_event() { set_done(0); diff --git a/cinelerra-5.1/cinelerra/fileflac.h b/cinelerra-5.1/cinelerra/fileflac.h index e85b64cf..5bb87f18 100644 --- a/cinelerra-5.1/cinelerra/fileflac.h +++ b/cinelerra-5.1/cinelerra/fileflac.h @@ -25,6 +25,7 @@ #include "bitspopup.inc" #include "edl.inc" #include "file.inc" +#include "fileflac.inc" #include "filebase.h" class FileFLAC : public FileBase @@ -84,8 +85,15 @@ public: BitsPopup *bits_popup; BC_WindowBase *parent_window; Asset *asset; + FLACCompression *compression; }; - +class FLACCompression : public BC_TumbleTextBox +{ +public: + FLACCompression(FLACConfigAudio *gui, int x, int y); + int handle_event(); + FLACConfigAudio *gui; +}; #endif diff --git a/cinelerra-5.1/cinelerra/fileflac.inc b/cinelerra-5.1/cinelerra/fileflac.inc index 44feed4a..9e5fd31e 100644 --- a/cinelerra-5.1/cinelerra/fileflac.inc +++ b/cinelerra-5.1/cinelerra/fileflac.inc @@ -23,7 +23,7 @@ #define FILEFLAC_INC class FileFLAC; - +class FLACCompression; #endif diff --git a/cinelerra-5.1/cinelerra/fileformat.C b/cinelerra-5.1/cinelerra/fileformat.C index c87edf2c..a5cbbe01 100644 --- a/cinelerra-5.1/cinelerra/fileformat.C +++ b/cinelerra-5.1/cinelerra/fileformat.C @@ -101,8 +101,8 @@ void FileFormat::create_objects_(char *string2) //printf("FileFormat::create_objects_ 1 %d\n", asset->byte_order); add_subwindow(new BC_Title(x, y, _("Byte order:"))); - add_subwindow(lohi = new FileFormatByteOrderLOHI(x2, y, this, asset->byte_order)); - add_subwindow(hilo = new FileFormatByteOrderHILO(x2 + 70, y, this, !asset->byte_order)); + add_subwindow(hilo = new FileFormatByteOrderHILO(x2, y, this, !asset->byte_order)); + add_subwindow(lohi = new FileFormatByteOrderLOHI(x2 + 70, y, this, asset->byte_order)); y += ys30; add_subwindow(signed_button = new FileFormatSigned(x, y, this, asset->signed_)); diff --git a/cinelerra-5.1/cinelerra/filegif.C b/cinelerra-5.1/cinelerra/filegif.C index 92e592bc..f7e45645 100644 --- a/cinelerra-5.1/cinelerra/filegif.C +++ b/cinelerra-5.1/cinelerra/filegif.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2014 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/filejpeg.C b/cinelerra-5.1/cinelerra/filejpeg.C index 15ae547c..75881b8b 100644 --- a/cinelerra-5.1/cinelerra/filejpeg.C +++ b/cinelerra-5.1/cinelerra/filejpeg.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/filelist.C b/cinelerra-5.1/cinelerra/filelist.C index 8c923409..3443a8b4 100644 --- a/cinelerra-5.1/cinelerra/filelist.C +++ b/cinelerra-5.1/cinelerra/filelist.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 1997-2012 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/filemediadb.C b/cinelerra-5.1/cinelerra/filemediadb.C index c9c4f42c..fb08da45 100644 --- a/cinelerra-5.1/cinelerra/filemediadb.C +++ b/cinelerra-5.1/cinelerra/filemediadb.C @@ -1,7 +1,7 @@ /* * CINELERRA - * Copyright (C) 2008 Adam Williams + * Copyright (C) 2016-2020 William Morrow * * 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 diff --git a/cinelerra-5.1/cinelerra/filemediadb.h b/cinelerra-5.1/cinelerra/filemediadb.h index f01e7ea4..27b612a9 100644 --- a/cinelerra-5.1/cinelerra/filemediadb.h +++ b/cinelerra-5.1/cinelerra/filemediadb.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + * + */ + #ifndef _FILEMEDIADB_H_ #define _FILEMEDIADB_H_ /* diff --git a/cinelerra-5.1/cinelerra/filemediadb.inc b/cinelerra-5.1/cinelerra/filemediadb.inc index 1b3911a0..774c47c4 100644 --- a/cinelerra-5.1/cinelerra/filemediadb.inc +++ b/cinelerra-5.1/cinelerra/filemediadb.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef _FILEMEDIADB_INC_ #define _FILEMEDIADB_INC_ diff --git a/cinelerra-5.1/cinelerra/filempeg.C b/cinelerra-5.1/cinelerra/filempeg.C index c728036a..49dfedea 100644 --- a/cinelerra-5.1/cinelerra/filempeg.C +++ b/cinelerra-5.1/cinelerra/filempeg.C @@ -632,6 +632,28 @@ int FileMPEG::open_file(int rd, int wr) sprintf(string, " -V 500"); strncat(mjpeg_command, string, sizeof(mjpeg_command)); } + + if(asset->vmpeg_preset == 13) /* set high profile for 1080 */ + { + sprintf(string, " -l high"); + strncat(mjpeg_command, string, sizeof(mjpeg_command)); + } + + if(asset->vmpeg_preset == 6) /* set -T for vcd */ + { + sprintf(string, " -T 35"); + strncat(mjpeg_command, string, sizeof(mjpeg_command)); + } + + if(asset->vmpeg_preset == 7) /* set -T for svcd */ + { + sprintf(string, " -T 120"); + strncat(mjpeg_command, string, sizeof(mjpeg_command)); + } + + sprintf(string, " -c"); /* set closed gop */ + strncat(mjpeg_command, string, sizeof(mjpeg_command)); + strncat(mjpeg_command, asset->vmpeg_progressive ? " -I 0" : " -I 1", diff --git a/cinelerra-5.1/cinelerra/fileogg.C b/cinelerra-5.1/cinelerra/fileogg.C index 824e7a11..bac03b1e 100644 --- a/cinelerra-5.1/cinelerra/fileogg.C +++ b/cinelerra-5.1/cinelerra/fileogg.C @@ -1,6 +1,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/filepng.C b/cinelerra-5.1/cinelerra/filepng.C index 4b7f74f8..f4b09d7d 100644 --- a/cinelerra-5.1/cinelerra/filepng.C +++ b/cinelerra-5.1/cinelerra/filepng.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 @@ -258,7 +259,13 @@ int FilePNG::read_frame(VFrame *output, VFrame *input) //printf("FilePNG::read_frame 1 %d %d\n", native_cmodel, output->get_color_model()); png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0); + if(!png_ptr) return 0; info_ptr = png_create_info_struct(png_ptr); + if(!info_ptr) return 0; + if (setjmp(png_jmpbuf(png_ptr))) { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return 0; + } png_set_read_fn(png_ptr, input, (png_rw_ptr)read_function); png_read_info(png_ptr, info_ptr); diff --git a/cinelerra-5.1/cinelerra/fileppm.C b/cinelerra-5.1/cinelerra/fileppm.C index e91690a1..fe10742d 100644 --- a/cinelerra-5.1/cinelerra/fileppm.C +++ b/cinelerra-5.1/cinelerra/fileppm.C @@ -183,6 +183,15 @@ int FilePPM::write_frame(VFrame *frame, VFrame *output, return 0; } +int FilePPM::can_copy_from(Asset *asset, int64_t position) +{ + if(asset->format == FILE_PPM || + asset->format == FILE_PPM_LIST) + return 1; + + return 0; +} + int FilePPM::colormodel_supported(int colormodel) { return BC_RGB888; diff --git a/cinelerra-5.1/cinelerra/fileppm.h b/cinelerra-5.1/cinelerra/fileppm.h index ec6a094a..4711b107 100644 --- a/cinelerra-5.1/cinelerra/fileppm.h +++ b/cinelerra-5.1/cinelerra/fileppm.h @@ -43,6 +43,7 @@ public: int check_frame_header(FILE *fp); int read_frame_header(char *path); int write_frame(VFrame *frame, VFrame *output, FrameWriterUnit *unit); + int can_copy_from(Asset *asset, int64_t position); FrameWriterUnit* new_writer_unit(FrameWriter *writer); static void get_parameters(BC_WindowBase *parent_window, Asset *asset, BC_WindowBase* &format_window, diff --git a/cinelerra-5.1/cinelerra/fileppm.inc b/cinelerra-5.1/cinelerra/fileppm.inc index e2e38201..d8e7bd90 100644 --- a/cinelerra-5.1/cinelerra/fileppm.inc +++ b/cinelerra-5.1/cinelerra/fileppm.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + #ifndef __FILEPPM_INC__ #define __FILEPPM_INC__ diff --git a/cinelerra-5.1/cinelerra/filesndfile.C b/cinelerra-5.1/cinelerra/filesndfile.C index a215080d..a24002f3 100644 --- a/cinelerra-5.1/cinelerra/filesndfile.C +++ b/cinelerra-5.1/cinelerra/filesndfile.C @@ -442,6 +442,7 @@ SndFileHILO::SndFileHILO(SndFileConfig *gui, int x, int y) : BC_Radial(x, y, gui->asset->byte_order == 0, _("Hi Lo")) { this->gui = gui; + set_tooltip(_("Little Endian")); } int SndFileHILO::handle_event() { @@ -457,6 +458,7 @@ SndFileLOHI::SndFileLOHI(SndFileConfig *gui, int x, int y) : BC_Radial(x, y, gui->asset->byte_order == 1, _("Lo Hi")) { this->gui = gui; + set_tooltip(_("Big Endian")); } int SndFileLOHI::handle_event() { diff --git a/cinelerra-5.1/cinelerra/filetga.C b/cinelerra-5.1/cinelerra/filetga.C index df9a56ee..0bff2e18 100644 --- a/cinelerra-5.1/cinelerra/filetga.C +++ b/cinelerra-5.1/cinelerra/filetga.C @@ -337,6 +337,8 @@ void FileTGA::read_tga(Asset *asset, VFrame *frame, VFrame *data, VFrame* &temp) case 24: source_cmodel = BC_RGB888; break; + default: + return; } // Read image diff --git a/cinelerra-5.1/cinelerra/filetiff.C b/cinelerra-5.1/cinelerra/filetiff.C index e14791e4..fc24b384 100644 --- a/cinelerra-5.1/cinelerra/filetiff.C +++ b/cinelerra-5.1/cinelerra/filetiff.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 @@ -322,6 +323,9 @@ int FileTIFF::read_frame(VFrame *output, VFrame *input) tiff_mmap, tiff_unmap); + if(!stream) + return 0; + // This loads the original TIFF data into each scanline of the output frame, // assuming the output scanlines are bigger than the input scanlines. // Then it expands the input data in reverse to fill the row. diff --git a/cinelerra-5.1/cinelerra/filevorbis.C b/cinelerra-5.1/cinelerra/filevorbis.C index b051f9a9..34f33108 100644 --- a/cinelerra-5.1/cinelerra/filevorbis.C +++ b/cinelerra-5.1/cinelerra/filevorbis.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 @@ -30,7 +31,6 @@ #include "language.h" #include "mainerror.h" #include "mwindow.inc" -#include "mainerror.h" #include #include diff --git a/cinelerra-5.1/cinelerra/floatauto.C b/cinelerra-5.1/cinelerra/floatauto.C index a72d5252..851f64fe 100644 --- a/cinelerra-5.1/cinelerra/floatauto.C +++ b/cinelerra-5.1/cinelerra/floatauto.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/floatauto.h b/cinelerra-5.1/cinelerra/floatauto.h index a6b9c192..0dd2357c 100644 --- a/cinelerra-5.1/cinelerra/floatauto.h +++ b/cinelerra-5.1/cinelerra/floatauto.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/floatautos.C b/cinelerra-5.1/cinelerra/floatautos.C index bebbbcc1..b650d08e 100644 --- a/cinelerra-5.1/cinelerra/floatautos.C +++ b/cinelerra-5.1/cinelerra/floatautos.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/floatautos.h b/cinelerra-5.1/cinelerra/floatautos.h index 6842d54e..94c62bad 100644 --- a/cinelerra-5.1/cinelerra/floatautos.h +++ b/cinelerra-5.1/cinelerra/floatautos.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/forkbase.inc b/cinelerra-5.1/cinelerra/forkbase.inc index 8f0266c2..909cba12 100644 --- a/cinelerra-5.1/cinelerra/forkbase.inc +++ b/cinelerra-5.1/cinelerra/forkbase.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + #ifndef __FORKBASE_INC__ #define __FORKBASE_INC__ diff --git a/cinelerra-5.1/cinelerra/formatpresets.C b/cinelerra-5.1/cinelerra/formatpresets.C index bb27ba0c..5a452a21 100644 --- a/cinelerra-5.1/cinelerra/formatpresets.C +++ b/cinelerra-5.1/cinelerra/formatpresets.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/formattools.C b/cinelerra-5.1/cinelerra/formattools.C index 9f9b0c19..ee040f3c 100644 --- a/cinelerra-5.1/cinelerra/formattools.C +++ b/cinelerra-5.1/cinelerra/formattools.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2010-2013 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/formattools.h b/cinelerra-5.1/cinelerra/formattools.h index 35415ae0..79311c5e 100644 --- a/cinelerra-5.1/cinelerra/formattools.h +++ b/cinelerra-5.1/cinelerra/formattools.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/formatwindow.C b/cinelerra-5.1/cinelerra/formatwindow.C index 67f7416d..c3726c3c 100644 --- a/cinelerra-5.1/cinelerra/formatwindow.C +++ b/cinelerra-5.1/cinelerra/formatwindow.C @@ -142,6 +142,7 @@ FormatQuality::~FormatQuality() int FormatQuality::handle_event() { asset->quality = get_value(); +return 0; } @@ -152,6 +153,7 @@ FormatBits::~FormatBits() {} int FormatBits::handle_event() { asset->bits = get_bits(); +return 0; } @@ -162,6 +164,7 @@ FormatDither::~FormatDither() {} int FormatDither::handle_event() { *dither = get_value(); +return 0; } @@ -174,6 +177,7 @@ FormatSigned::~FormatSigned() {} int FormatSigned::handle_event() { asset->signed_ = get_value(); +return 0; } @@ -188,6 +192,7 @@ int FormatHILO::handle_event() { asset->byte_order = get_value() ^ 1; lohi->update(get_value() ^ 1); +return 0; } FormatLOHI::FormatLOHI(int x, int y, FormatHILO *hilo, Asset *asset) @@ -202,5 +207,6 @@ int FormatLOHI::handle_event() { asset->byte_order = get_value(); hilo->update(get_value() ^ 1); +return 0; } diff --git a/cinelerra-5.1/cinelerra/grabpick_dn_png.h b/cinelerra-5.1/cinelerra/grabpick_dn_png.h index e38e905f..c0558af7 100644 --- a/cinelerra-5.1/cinelerra/grabpick_dn_png.h +++ b/cinelerra-5.1/cinelerra/grabpick_dn_png.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef GRABPICK_DN_PNG_H #define GRABPICK_DN_PNG_H diff --git a/cinelerra-5.1/cinelerra/grabpick_hi_png.h b/cinelerra-5.1/cinelerra/grabpick_hi_png.h index a3535a04..412ae8a0 100644 --- a/cinelerra-5.1/cinelerra/grabpick_hi_png.h +++ b/cinelerra-5.1/cinelerra/grabpick_hi_png.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef GRABPICK_HI_PNG_H #define GRABPICK_HI_PNG_H diff --git a/cinelerra-5.1/cinelerra/grabpick_up_png.h b/cinelerra-5.1/cinelerra/grabpick_up_png.h index 4040a7ac..93c1831e 100644 --- a/cinelerra-5.1/cinelerra/grabpick_up_png.h +++ b/cinelerra-5.1/cinelerra/grabpick_up_png.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef GRABPICK_UP_PNG_H #define GRABPICK_UP_PNG_H diff --git a/cinelerra-5.1/cinelerra/indexfile.C b/cinelerra-5.1/cinelerra/indexfile.C index 885495ed..16175535 100644 --- a/cinelerra-5.1/cinelerra/indexfile.C +++ b/cinelerra-5.1/cinelerra/indexfile.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 1997-2014 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/intauto.C b/cinelerra-5.1/cinelerra/intauto.C index 675f358c..dc2745ce 100644 --- a/cinelerra-5.1/cinelerra/intauto.C +++ b/cinelerra-5.1/cinelerra/intauto.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/interfaceprefs.C b/cinelerra-5.1/cinelerra/interfaceprefs.C index 4e80eb86..bea12a4a 100644 --- a/cinelerra-5.1/cinelerra/interfaceprefs.C +++ b/cinelerra-5.1/cinelerra/interfaceprefs.C @@ -100,7 +100,7 @@ void InterfacePrefs::create_objects() add_subwindow(title = new BC_Title(x, y, _("Clicking on edit boundaries does what:"))); title->context_help_set_keyword("Using the Drag Handle with Trim"); y += title->get_h() + ys10; - add_subwindow(title = new BC_Title(x, y, _("Button 1:"))); + add_subwindow(title = new BC_Title(x, y, _("LMB Bt.1:"))); title->context_help_set_keyword("Using the Drag Handle with Trim"); int x1 = x + xS(100); @@ -112,7 +112,7 @@ void InterfacePrefs::create_objects() text->create_objects(); text->context_help_set_keyword("Using the Drag Handle with Trim"); y += ys30; - add_subwindow(title = new BC_Title(x, y, _("Button 2:"))); + add_subwindow(title = new BC_Title(x, y, _("MMB Bt.2:"))); title->context_help_set_keyword("Using the Drag Handle with Trim"); add_subwindow(text = new ViewBehaviourText(x1, y - ys5, @@ -122,7 +122,7 @@ void InterfacePrefs::create_objects() text->create_objects(); text->context_help_set_keyword("Using the Drag Handle with Trim"); y += ys30; - add_subwindow(title = new BC_Title(x, y, _("Button 3:"))); + add_subwindow(title = new BC_Title(x, y, _("RMB Bt.3:"))); title->context_help_set_keyword("Using the Drag Handle with Trim"); add_subwindow(text = new ViewBehaviourText(x1, y - ys5, behavior_to_text(pwindow->thread->edl->session->edit_handle_mode[2]), diff --git a/cinelerra-5.1/cinelerra/interlacemodes.C b/cinelerra-5.1/cinelerra/interlacemodes.C index a77d0c52..79239f9b 100644 --- a/cinelerra-5.1/cinelerra/interlacemodes.C +++ b/cinelerra-5.1/cinelerra/interlacemodes.C @@ -1,16 +1,16 @@ /* - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published + * 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 library is distributed in the hope that it will be useful, but + * 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 - * Lesser General Public License for more details. + * General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software + * 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 */ diff --git a/cinelerra-5.1/cinelerra/interlacemodes.h b/cinelerra-5.1/cinelerra/interlacemodes.h index 2201ca1a..9e11b3f7 100644 --- a/cinelerra-5.1/cinelerra/interlacemodes.h +++ b/cinelerra-5.1/cinelerra/interlacemodes.h @@ -1,16 +1,16 @@ /* - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published + * 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 library is distributed in the hope that it will be useful, but + * 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 - * Lesser General Public License for more details. + * General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software + * 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 */ diff --git a/cinelerra-5.1/cinelerra/interp.h b/cinelerra-5.1/cinelerra/interp.h index 6cbcffbe..9310cb3d 100644 --- a/cinelerra-5.1/cinelerra/interp.h +++ b/cinelerra-5.1/cinelerra/interp.h @@ -1,3 +1,21 @@ +/* + * 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 + */ + + #ifndef __INTERP__ #define __INTERP__ diff --git a/cinelerra-5.1/cinelerra/keyframepopup.C b/cinelerra-5.1/cinelerra/keyframepopup.C index c3dcaea1..b2992006 100644 --- a/cinelerra-5.1/cinelerra/keyframepopup.C +++ b/cinelerra-5.1/cinelerra/keyframepopup.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/keyframepopup.h b/cinelerra-5.1/cinelerra/keyframepopup.h index 16342eb0..6c4156e2 100644 --- a/cinelerra-5.1/cinelerra/keyframepopup.h +++ b/cinelerra-5.1/cinelerra/keyframepopup.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/labels.C b/cinelerra-5.1/cinelerra/labels.C index ad3626bf..56105ed1 100644 --- a/cinelerra-5.1/cinelerra/labels.C +++ b/cinelerra-5.1/cinelerra/labels.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/labels.h b/cinelerra-5.1/cinelerra/labels.h index e648de5a..72103089 100644 --- a/cinelerra-5.1/cinelerra/labels.h +++ b/cinelerra-5.1/cinelerra/labels.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/libdv.h b/cinelerra-5.1/cinelerra/libdv.h index 9cdec3cd..1cb09162 100644 --- a/cinelerra-5.1/cinelerra/libdv.h +++ b/cinelerra-5.1/cinelerra/libdv.h @@ -1,3 +1,7 @@ +/* + * Grabbing algorithm is from dvgrab + */ + #ifndef LIBDV_H #define LIBDV_H diff --git a/cinelerra-5.1/cinelerra/loadfile.C b/cinelerra-5.1/cinelerra/loadfile.C index d9d9fe78..27c26991 100644 --- a/cinelerra-5.1/cinelerra/loadfile.C +++ b/cinelerra-5.1/cinelerra/loadfile.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2009 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/localsession.C b/cinelerra-5.1/cinelerra/localsession.C index 8293824c..c8428abd 100644 --- a/cinelerra-5.1/cinelerra/localsession.C +++ b/cinelerra-5.1/cinelerra/localsession.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 @@ -73,8 +74,8 @@ LocalSession::LocalSession(EDL *edl) preview_start = 0; preview_end = -1; zoom_sample = DEFAULT_ZOOM_TIME; zoom_y = 0; - zoom_atrack = 0; - zoom_vtrack = 0; + zoom_atrack = 64; + zoom_vtrack = 64; x_pane = y_pane = -1; gang_tracks = GANG_NONE; diff --git a/cinelerra-5.1/cinelerra/lv2ui.C b/cinelerra-5.1/cinelerra/lv2ui.C index 7d0e3237..dce5c15e 100644 --- a/cinelerra-5.1/cinelerra/lv2ui.C +++ b/cinelerra-5.1/cinelerra/lv2ui.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #include #include diff --git a/cinelerra-5.1/cinelerra/main.C b/cinelerra-5.1/cinelerra/main.C index b660d1b4..b1f1fb69 100644 --- a/cinelerra-5.1/cinelerra/main.C +++ b/cinelerra-5.1/cinelerra/main.C @@ -1,6 +1,7 @@ /* * CINELERRA * Copyright (C) 2010 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 @@ -308,9 +309,18 @@ int main(int argc, char *argv[]) #ifndef COPYRIGHTTEXT2 #define COPYRIGHTTEXT2 "" #endif +#ifndef COPYRIGHTTEXT3 +#define COPYRIGHTTEXT3 "" +#endif + fprintf(stderr, "%s %s - %s\n%s", PROGRAM_NAME,CINELERRA_VERSION, AboutPrefs::build_timestamp, REPOMAINTXT COPYRIGHTTEXT1 COPYRIGHTTEXT2); + fprintf(stderr, "%s", COPYRIGHTTEXT3); + fprintf(stderr, "%s", COPYRIGHTTEXT4); + fprintf(stderr,"\n"); + fprintf(stderr, "%s \n", AboutPrefs::ffmpeg_version); + fprintf(stderr,"\n"); fprintf(stderr, "%s is free software, covered by the GNU General Public License,\n" "and you are welcome to change it and/or distribute copies of it under\n" "certain conditions. There is absolutely no warranty for %s.\n\n", diff --git a/cinelerra-5.1/cinelerra/mainclock.C b/cinelerra-5.1/cinelerra/mainclock.C index 41e2df82..f623eae9 100644 --- a/cinelerra-5.1/cinelerra/mainclock.C +++ b/cinelerra-5.1/cinelerra/mainclock.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 1997-2017 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/mainclock.h b/cinelerra-5.1/cinelerra/mainclock.h index b876bfd1..1b9b3a30 100644 --- a/cinelerra-5.1/cinelerra/mainclock.h +++ b/cinelerra-5.1/cinelerra/mainclock.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/maskauto.C b/cinelerra-5.1/cinelerra/maskauto.C index 47fb3f42..1a6cf5f8 100644 --- a/cinelerra-5.1/cinelerra/maskauto.C +++ b/cinelerra-5.1/cinelerra/maskauto.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/maskauto.h b/cinelerra-5.1/cinelerra/maskauto.h index a1338f43..6af17c3a 100644 --- a/cinelerra-5.1/cinelerra/maskauto.h +++ b/cinelerra-5.1/cinelerra/maskauto.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/maskautos.h b/cinelerra-5.1/cinelerra/maskautos.h index c0907875..2cc16840 100644 --- a/cinelerra-5.1/cinelerra/maskautos.h +++ b/cinelerra-5.1/cinelerra/maskautos.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/mbuttons.C b/cinelerra-5.1/cinelerra/mbuttons.C index 7c22885a..cdafd1a7 100644 --- a/cinelerra-5.1/cinelerra/mbuttons.C +++ b/cinelerra-5.1/cinelerra/mbuttons.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/mediadb.C b/cinelerra-5.1/cinelerra/mediadb.C index 2f903711..8ce4db4d 100644 --- a/cinelerra-5.1/cinelerra/mediadb.C +++ b/cinelerra-5.1/cinelerra/mediadb.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #include #include #include diff --git a/cinelerra-5.1/cinelerra/mediadb.h b/cinelerra-5.1/cinelerra/mediadb.h index 3b816c4e..5140d3e9 100644 --- a/cinelerra-5.1/cinelerra/mediadb.h +++ b/cinelerra-5.1/cinelerra/mediadb.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #if defined(__i386__) || defined(__x86_64__) #if defined (__linux__) #ifndef _MEDIA_DB_H_ @@ -242,4 +262,4 @@ public: #endif #endif // linux -#endif /* x86 */ \ No newline at end of file +#endif /* x86 */ diff --git a/cinelerra-5.1/cinelerra/mediadb.inc b/cinelerra-5.1/cinelerra/mediadb.inc index b8e58fde..39fd9478 100644 --- a/cinelerra-5.1/cinelerra/mediadb.inc +++ b/cinelerra-5.1/cinelerra/mediadb.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef _MEDIA_DB_INC_ #define _MEDIA_DB_INC_ diff --git a/cinelerra-5.1/cinelerra/meterhistory.C b/cinelerra-5.1/cinelerra/meterhistory.C index e601c351..8ea50fa2 100644 --- a/cinelerra-5.1/cinelerra/meterhistory.C +++ b/cinelerra-5.1/cinelerra/meterhistory.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #include "meterhistory.h" #include diff --git a/cinelerra-5.1/cinelerra/meterhistory.h b/cinelerra-5.1/cinelerra/meterhistory.h index 1f61109c..ec39b21c 100644 --- a/cinelerra-5.1/cinelerra/meterhistory.h +++ b/cinelerra-5.1/cinelerra/meterhistory.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __METERHISTORY_H__ #define __METERHISTORY_H__ diff --git a/cinelerra-5.1/cinelerra/mixersalign.inc b/cinelerra-5.1/cinelerra/mixersalign.inc index a8e0edfc..57863da5 100644 --- a/cinelerra-5.1/cinelerra/mixersalign.inc +++ b/cinelerra-5.1/cinelerra/mixersalign.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + #ifndef __MIXERSALIGN_INC__ #define __MIXERSALIGN_INC__ diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index a502c156..1291b992 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -1,6 +1,7 @@ /* * CINELERRA * Copyright (C) 1997-2014 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 @@ -5303,7 +5304,7 @@ int MWindow::select_asset(Asset *asset, int vstream, int astream, int delete_tra int channels = 0; for( uint64_t mask=channel_mask; mask!=0; mask>>=1 ) channels += mask & 1; if( channels < 1 ) channels = 1; - if( channels > 6 ) channels = 6; + if( channels > MAXCHANNELS ) channels = MAXCHANNELS; session->audio_tracks = session->audio_channels = channels; int *achannel_positions = preferences->channel_positions[session->audio_channels-1]; diff --git a/cinelerra-5.1/cinelerra/mwindow.h b/cinelerra-5.1/cinelerra/mwindow.h index f0814499..b1b95a3e 100644 --- a/cinelerra-5.1/cinelerra/mwindow.h +++ b/cinelerra-5.1/cinelerra/mwindow.h @@ -1,6 +1,7 @@ /* * CINELERRA * Copyright (C) 1997-2014 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/mwindowedit.C b/cinelerra-5.1/cinelerra/mwindowedit.C index 458ced96..5f7aa62f 100644 --- a/cinelerra-5.1/cinelerra/mwindowedit.C +++ b/cinelerra-5.1/cinelerra/mwindowedit.C @@ -1,6 +1,7 @@ /* * CINELERRA * Copyright (C) 1997-2012 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/mwindowmove.C b/cinelerra-5.1/cinelerra/mwindowmove.C index 305e4eac..3bad75ef 100644 --- a/cinelerra-5.1/cinelerra/mwindowmove.C +++ b/cinelerra-5.1/cinelerra/mwindowmove.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 1997-2014 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/new.C b/cinelerra-5.1/cinelerra/new.C index f9294cff..b722d0ea 100644 --- a/cinelerra-5.1/cinelerra/new.C +++ b/cinelerra-5.1/cinelerra/new.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/new.h b/cinelerra-5.1/cinelerra/new.h index d2603781..6b53f0c4 100644 --- a/cinelerra-5.1/cinelerra/new.h +++ b/cinelerra-5.1/cinelerra/new.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/overlaydirect.C b/cinelerra-5.1/cinelerra/overlaydirect.C index 5324401f..b36a20fe 100644 --- a/cinelerra-5.1/cinelerra/overlaydirect.C +++ b/cinelerra-5.1/cinelerra/overlaydirect.C @@ -1,3 +1,20 @@ +/* + * 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 + */ + #include "overlayframe.h" #include "overlaydirect.h" diff --git a/cinelerra-5.1/cinelerra/overlaydirect.h b/cinelerra-5.1/cinelerra/overlaydirect.h index ebdc30f8..32986ad9 100644 --- a/cinelerra-5.1/cinelerra/overlaydirect.h +++ b/cinelerra-5.1/cinelerra/overlaydirect.h @@ -1,3 +1,21 @@ +/* + * 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 + */ + + #ifndef __OVERLAYDIRECT_H__ #define __OVERLAYDIRECT_H__ #include "overlayframe.h" diff --git a/cinelerra-5.1/cinelerra/overlayframe.h b/cinelerra-5.1/cinelerra/overlayframe.h index 13c2e4bd..4775e8df 100644 --- a/cinelerra-5.1/cinelerra/overlayframe.h +++ b/cinelerra-5.1/cinelerra/overlayframe.h @@ -32,6 +32,7 @@ #include #include #include +#include #define DIRECT_COPY 0 #define BILINEAR 1 @@ -237,7 +238,7 @@ static inline int64_t aclip(int64_t v, int mx) { return v < 0 ? 0 : v > mx ? mx : v; } static inline float aclip(float v, float mx) { - return v < 0 ? 0 : v > mx ? mx : v; + return v < -FLT_MAX+1 ? -FLT_MAX : v > FLT_MAX-1 ? FLT_MAX : v; } static inline float aclip(float v, int mx) { return v < 0 ? 0 : v > mx ? mx : v; diff --git a/cinelerra-5.1/cinelerra/overlaynearest.h b/cinelerra-5.1/cinelerra/overlaynearest.h index 0f7c62db..45318319 100644 --- a/cinelerra-5.1/cinelerra/overlaynearest.h +++ b/cinelerra-5.1/cinelerra/overlaynearest.h @@ -1,3 +1,21 @@ +/* + * 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 + */ + + #ifndef __OVERLAYNEAREST_H__ #define __OVERLAYNEAREST_H__ #include "overlayframe.h" diff --git a/cinelerra-5.1/cinelerra/overlaysample.C b/cinelerra-5.1/cinelerra/overlaysample.C index 09d3d3ae..33789c6d 100644 --- a/cinelerra-5.1/cinelerra/overlaysample.C +++ b/cinelerra-5.1/cinelerra/overlaysample.C @@ -1,3 +1,20 @@ +/* + * 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 + */ + #include "overlayframe.h" #include "overlaysample.h" diff --git a/cinelerra-5.1/cinelerra/overlaysample.h b/cinelerra-5.1/cinelerra/overlaysample.h index 1d7d44a1..981cc892 100644 --- a/cinelerra-5.1/cinelerra/overlaysample.h +++ b/cinelerra-5.1/cinelerra/overlaysample.h @@ -1,3 +1,21 @@ +/* + * 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 + */ + + #ifndef __OVERLAYSAMPLE_H__ #define __OVERLAYSAMPLE_H__ #include "overlayframe.h" diff --git a/cinelerra-5.1/cinelerra/packagedispatcher.C b/cinelerra-5.1/cinelerra/packagedispatcher.C index 17d02c0d..b6aa9675 100644 --- a/cinelerra-5.1/cinelerra/packagedispatcher.C +++ b/cinelerra-5.1/cinelerra/packagedispatcher.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 1997-2011 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/packagedispatcher.h b/cinelerra-5.1/cinelerra/packagedispatcher.h index e548ce5b..f3d2d500 100644 --- a/cinelerra-5.1/cinelerra/packagedispatcher.h +++ b/cinelerra-5.1/cinelerra/packagedispatcher.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/packagingengine.h b/cinelerra-5.1/cinelerra/packagingengine.h index 217b5667..a8e0c716 100644 --- a/cinelerra-5.1/cinelerra/packagingengine.h +++ b/cinelerra-5.1/cinelerra/packagingengine.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/panauto.C b/cinelerra-5.1/cinelerra/panauto.C index 16ca05f1..cac4c23a 100644 --- a/cinelerra-5.1/cinelerra/panauto.C +++ b/cinelerra-5.1/cinelerra/panauto.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/panedividers.C b/cinelerra-5.1/cinelerra/panedividers.C index 724b7be7..ba3ba5ef 100644 --- a/cinelerra-5.1/cinelerra/panedividers.C +++ b/cinelerra-5.1/cinelerra/panedividers.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + #include "bcsignals.h" #include "cursors.h" #include "mwindow.h" diff --git a/cinelerra-5.1/cinelerra/panedividers.h b/cinelerra-5.1/cinelerra/panedividers.h index ee88e438..22c69942 100644 --- a/cinelerra-5.1/cinelerra/panedividers.h +++ b/cinelerra-5.1/cinelerra/panedividers.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + #ifndef PANEDIVIDERS_H #define PANEDIVIDERS_H diff --git a/cinelerra-5.1/cinelerra/panedividers.inc b/cinelerra-5.1/cinelerra/panedividers.inc index 85dbd8a2..1ff6a85b 100644 --- a/cinelerra-5.1/cinelerra/panedividers.inc +++ b/cinelerra-5.1/cinelerra/panedividers.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + #ifndef PANEDIVIDERS_INC #define PANEDIVIDERS_INC diff --git a/cinelerra-5.1/cinelerra/patch.C b/cinelerra-5.1/cinelerra/patch.C index b2c0c446..3607ccf3 100644 --- a/cinelerra-5.1/cinelerra/patch.C +++ b/cinelerra-5.1/cinelerra/patch.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/performanceprefs.C b/cinelerra-5.1/cinelerra/performanceprefs.C index 44545e31..77ca2d5f 100644 --- a/cinelerra-5.1/cinelerra/performanceprefs.C +++ b/cinelerra-5.1/cinelerra/performanceprefs.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/playback3d.C b/cinelerra-5.1/cinelerra/playback3d.C index 9eee736f..592e9095 100644 --- a/cinelerra-5.1/cinelerra/playback3d.C +++ b/cinelerra-5.1/cinelerra/playback3d.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2009 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/playbackconfig.C b/cinelerra-5.1/cinelerra/playbackconfig.C index 24976c56..6d502ee6 100644 --- a/cinelerra-5.1/cinelerra/playbackconfig.C +++ b/cinelerra-5.1/cinelerra/playbackconfig.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/plugin.C b/cinelerra-5.1/cinelerra/plugin.C index dce1f5b7..64b43072 100644 --- a/cinelerra-5.1/cinelerra/plugin.C +++ b/cinelerra-5.1/cinelerra/plugin.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/pluginfclient.C b/cinelerra-5.1/cinelerra/pluginfclient.C index 32c3f4aa..2d57743c 100644 --- a/cinelerra-5.1/cinelerra/pluginfclient.C +++ b/cinelerra-5.1/cinelerra/pluginfclient.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #include #include #include @@ -17,6 +37,8 @@ #include "vframe.h" #include "filexml.h" +#include "libavfilter/version.h" + #ifdef FFMPEG3 #define av_filter_iterate(p) ((*(const AVFilter**)(p))=avfilter_next(*(const AVFilter **)(p))) #endif @@ -642,11 +664,19 @@ PluginFClient::~PluginFClient() bool PluginFClient::is_audio(const AVFilter *fp) { if( !fp->outputs ) return 0; +#if LIBAVFILTER_VERSION_MINOR > 2 && LIBAVFILTER_VERSION_MAJOR > 7 + if( avfilter_filter_pad_count(fp, 1) > 1 ) return 0; +#else if( avfilter_pad_count(fp->outputs) > 1 ) return 0; +#endif if( !avfilter_pad_get_name(fp->outputs, 0) ) return 0; if( avfilter_pad_get_type(fp->outputs, 0) != AVMEDIA_TYPE_AUDIO ) return 0; if( !fp->inputs ) return 1; +#if LIBAVFILTER_VERSION_MINOR > 2 && LIBAVFILTER_VERSION_MAJOR > 7 + if( avfilter_filter_pad_count(fp, 0) > 1 ) return 0; +#else if( avfilter_pad_count(fp->inputs) > 1 ) return 0; +#endif if( !avfilter_pad_get_name(fp->inputs, 0) ) return 0; if( avfilter_pad_get_type(fp->inputs, 0) != AVMEDIA_TYPE_AUDIO ) return 0; return 1; @@ -654,11 +684,19 @@ bool PluginFClient::is_audio(const AVFilter *fp) bool PluginFClient::is_video(const AVFilter *fp) { if( !fp->outputs ) return 0; +#if LIBAVFILTER_VERSION_MINOR > 2 && LIBAVFILTER_VERSION_MAJOR > 7 + if( avfilter_filter_pad_count(fp, 1) > 1 ) return 0; +#else if( avfilter_pad_count(fp->outputs) > 1 ) return 0; +#endif if( !avfilter_pad_get_name(fp->outputs, 0) ) return 0; if( avfilter_pad_get_type(fp->outputs, 0) != AVMEDIA_TYPE_VIDEO ) return 0; if( !fp->inputs ) return 1; +#if LIBAVFILTER_VERSION_MINOR > 2 && LIBAVFILTER_VERSION_MAJOR > 7 + if( avfilter_filter_pad_count(fp, 0) > 1 ) return 0; +#else if( avfilter_pad_count(fp->inputs) > 1 ) return 0; +#endif if( !avfilter_pad_get_name(fp->inputs, 0) ) return 0; if( avfilter_pad_get_type(fp->inputs, 0) != AVMEDIA_TYPE_VIDEO ) return 0; return 1; diff --git a/cinelerra-5.1/cinelerra/pluginfclient.h b/cinelerra-5.1/cinelerra/pluginfclient.h index 8e2ffaa5..f23516d0 100644 --- a/cinelerra-5.1/cinelerra/pluginfclient.h +++ b/cinelerra-5.1/cinelerra/pluginfclient.h @@ -1,3 +1,21 @@ +/* + * 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 + */ + + #ifndef __PLUGINFCLIENT_H__ #define __PLUGINFCLIENT_H__ diff --git a/cinelerra-5.1/cinelerra/pluginfclient.inc b/cinelerra-5.1/cinelerra/pluginfclient.inc index 344ae4ab..bd140c65 100644 --- a/cinelerra-5.1/cinelerra/pluginfclient.inc +++ b/cinelerra-5.1/cinelerra/pluginfclient.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __PLUGINFCLIENT_INC__ #define __PLUGINFCLIENT_INC__ diff --git a/cinelerra-5.1/cinelerra/pluginlv2.C b/cinelerra-5.1/cinelerra/pluginlv2.C index 538e533c..8b52aa61 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2.C +++ b/cinelerra-5.1/cinelerra/pluginlv2.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifdef HAVE_LV2 #include "bctrace.h" diff --git a/cinelerra-5.1/cinelerra/pluginlv2.h b/cinelerra-5.1/cinelerra/pluginlv2.h index 6f1e6009..69a2297b 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2.h +++ b/cinelerra-5.1/cinelerra/pluginlv2.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + #ifndef __PLUGINLV2_H__ #define __PLUGINLV2_H__ diff --git a/cinelerra-5.1/cinelerra/pluginlv2client.h b/cinelerra-5.1/cinelerra/pluginlv2client.h index f1162919..11845c21 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2client.h +++ b/cinelerra-5.1/cinelerra/pluginlv2client.h @@ -1,3 +1,21 @@ +/* + * 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 + */ + + #ifndef __PLUGINLV2CLIENT_H__ #define __PLUGINLV2CLIENT_H__ diff --git a/cinelerra-5.1/cinelerra/pluginlv2config.C b/cinelerra-5.1/cinelerra/pluginlv2config.C index 32721c52..3466e460 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2config.C +++ b/cinelerra-5.1/cinelerra/pluginlv2config.C @@ -2,7 +2,7 @@ /* * CINELERRA - * Copyright (C) 2018 GG + * Copyright (C) 2018-2020 William Morrow * * 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 diff --git a/cinelerra-5.1/cinelerra/pluginlv2config.inc b/cinelerra-5.1/cinelerra/pluginlv2config.inc index 6c1f41de..1817fbb9 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2config.inc +++ b/cinelerra-5.1/cinelerra/pluginlv2config.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __PLUGINLV2CONFIG_INC__ #define __PLUGINLV2CONFIG_INC__ diff --git a/cinelerra-5.1/cinelerra/pluginlv2gui.C b/cinelerra-5.1/cinelerra/pluginlv2gui.C index 05696836..1998fdbb 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2gui.C +++ b/cinelerra-5.1/cinelerra/pluginlv2gui.C @@ -1,7 +1,7 @@ /* * CINELERRA - * Copyright (C) 2018 GG + * Copyright (C) 2018-2020 William Morrow * * 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 diff --git a/cinelerra-5.1/cinelerra/pluginlv2gui.h b/cinelerra-5.1/cinelerra/pluginlv2gui.h index 0f93c7bb..9509c00e 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2gui.h +++ b/cinelerra-5.1/cinelerra/pluginlv2gui.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + #ifndef __PLUGINLV2GUI_H__ #define __PLUGINLV2GUI_H__ diff --git a/cinelerra-5.1/cinelerra/pluginlv2gui.inc b/cinelerra-5.1/cinelerra/pluginlv2gui.inc index f282cc59..aaf702a9 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2gui.inc +++ b/cinelerra-5.1/cinelerra/pluginlv2gui.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __PLUGINLV2GUI_INC__ #define __PLUGINLV2GUI_INC__ diff --git a/cinelerra-5.1/cinelerra/pluginlv2ui.C b/cinelerra-5.1/cinelerra/pluginlv2ui.C index 2b0c9926..64db9b29 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2ui.C +++ b/cinelerra-5.1/cinelerra/pluginlv2ui.C @@ -1,3 +1,22 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ // shared between parent/child fork #include "language.h" diff --git a/cinelerra-5.1/cinelerra/pluginlv2ui.inc b/cinelerra-5.1/cinelerra/pluginlv2ui.inc index 5b8309bd..55553e3e 100644 --- a/cinelerra-5.1/cinelerra/pluginlv2ui.inc +++ b/cinelerra-5.1/cinelerra/pluginlv2ui.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __PLUGINLV2UI_INC__ #define __PLUGINLV2UI_INC__ diff --git a/cinelerra-5.1/cinelerra/pluginmessages.h b/cinelerra-5.1/cinelerra/pluginmessages.h index f45c9bd1..0a63dd90 100644 --- a/cinelerra-5.1/cinelerra/pluginmessages.h +++ b/cinelerra-5.1/cinelerra/pluginmessages.h @@ -32,19 +32,19 @@ public: PluginMessages(int input_flag, int output_flag, int message_id = -1); ~PluginMessages(); - send_message(char *text); - receive_message(char *text); - - send_message(int command, char *text); - send_message(long command, long value); - send_message(long command, long value1, long value2); - send_message(int command); - - receive_message(); // returns the command - receive_message(int *command, char *text); - receive_message(int *command, long *value); - receive_message(long *value1, long *value2); - receive_message(int *command, long *value1, long *value2); + void send_message(char *text); + void receive_message(char *text); + + void send_message(int command, char *text); + void send_message(long command, long value); + void send_message(long command, long value1, long value2); + void send_message(int command); + + void receive_message(); // returns the command + void receive_message(int *command, char *text); + void receive_message(int *command, long *value); + void receive_message(long *value1, long *value2); + void receive_message(int *command, long *value1, long *value2); Messages *messages; int input_flag, output_flag; diff --git a/cinelerra-5.1/cinelerra/pluginprefs.C b/cinelerra-5.1/cinelerra/pluginprefs.C index 2a3f7878..b8167bb2 100644 --- a/cinelerra-5.1/cinelerra/pluginprefs.C +++ b/cinelerra-5.1/cinelerra/pluginprefs.C @@ -93,6 +93,7 @@ PluginGlobalPathText::~PluginGlobalPathText() {} int PluginGlobalPathText::handle_event() { strcpy(pwindow->thread->preferences->global_plugin_dir, get_text()); +return 0; } @@ -110,4 +111,5 @@ PluginLocalPathText::~PluginLocalPathText() {} int PluginLocalPathText::handle_event() { strcpy(pwindow->thread->preferences->local_plugin_dir, get_text()); +return 0; } diff --git a/cinelerra-5.1/cinelerra/pluginset.C b/cinelerra-5.1/cinelerra/pluginset.C index b0c096e4..833ab473 100644 --- a/cinelerra-5.1/cinelerra/pluginset.C +++ b/cinelerra-5.1/cinelerra/pluginset.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/pluginvclient.C b/cinelerra-5.1/cinelerra/pluginvclient.C index 09a9c928..c2162feb 100644 --- a/cinelerra-5.1/cinelerra/pluginvclient.C +++ b/cinelerra-5.1/cinelerra/pluginvclient.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/pluginvclient.h b/cinelerra-5.1/cinelerra/pluginvclient.h index 69f3da85..a0f3627d 100644 --- a/cinelerra-5.1/cinelerra/pluginvclient.h +++ b/cinelerra-5.1/cinelerra/pluginvclient.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/preferences.C b/cinelerra-5.1/cinelerra/preferences.C index 2b8d84bd..dbffa179 100644 --- a/cinelerra-5.1/cinelerra/preferences.C +++ b/cinelerra-5.1/cinelerra/preferences.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 @@ -451,6 +452,7 @@ int Preferences::load_defaults(BC_Hash *defaults) shbtn_prefs.append(new ShBtnPref(_("Setting Shell Commands"), "$CIN_BROWSER file://$CIN_DAT/doc/ShellCmds.html")); shbtn_prefs.append(new ShBtnPref(_("Shortcuts"), "$CIN_BROWSER file://$CIN_DAT/doc/shortcuts.html")); shbtn_prefs.append(new ShBtnPref(_("RenderMux"), "$CIN_DAT/doc/RenderMux.sh")); + shbtn_prefs.append(new ShBtnPref(_("Delete brender files in tmp"), "$CIN_DAT/doc/brender_tmp_delete.sh")); shbtns_total = 0; } for( int i=0; i - * - * 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 - * - */ - -#include "bcsignals.h" -#include "bcwindowbase.inc" -#include "cstrdup.h" -#include "file.h" -#include "filesystem.h" -#include "filexml.h" -#include "keyframe.h" -#include "messages.inc" -#include "mwindow.h" -#include "pluginserver.h" -#include "preferences.inc" -#include "presets.h" - -#include -#include - -PresetsDB::PresetsDB() -{ -} - - -void PresetsDB::clear() -{ - plugins.remove_all_objects(); -} - -void PresetsDB::load() -{ - clear(); - - FileXML file; - char path[BCTEXTLEN]; - char string[BCTEXTLEN]; - sprintf(path, "%s/%s", File::get_config_path(), PRESETS_FILE); - FileSystem fs; - fs.complete_path(path); - file.read_from_file(path); - int result = 0; - - do - { - result = file.read_tag(); - if(!result) - { - if(file.tag.title_is("PLUGIN")) - { - PresetsDBPlugin *plugin = 0; - sprintf(string, "Unknown"); - const char *title = file.tag.get_property("TITLE", string); - -// Search for existing plugin - for(int i = 0; i < plugins.size(); i++) - { - if(!strcasecmp(plugins.get(i)->title, title)) - { - plugin = plugins.get(i); - break; - } - } - -// Create new plugin - if(!plugin) - { - plugin = new PresetsDBPlugin(title); - plugins.append(plugin); - } - - plugin->load(&file); - } - } - }while(!result); -} - -void PresetsDB::save() -{ - FileXML file; - for(int i = 0; i < plugins.size(); i++) - { - PresetsDBPlugin *plugin = plugins.get(i); - plugin->save(&file); - } - file.terminate_string(); - - char path[BCTEXTLEN]; - sprintf(path, "%s/%s", File::get_config_path(), PRESETS_FILE); - FileSystem fs; - fs.complete_path(path); - file.write_to_file(path); -} - - -int PresetsDB::get_total_presets(char *plugin_title) -{ - for(int i = 0; i < plugins.size(); i++) - { - PresetsDBPlugin *plugin = plugins.get(i); - if(!strcasecmp(plugin->title, plugin_title)) - { - return plugin->keyframes.size(); - } - } - - return 0; -} - -char* PresetsDB::get_preset_title(char *plugin_title, int number) -{ - for(int i = 0; i < plugins.size(); i++) - { - PresetsDBPlugin *plugin = plugins.get(i); - if(!strcasecmp(plugin->title, plugin_title)) - { - if(number < plugin->keyframes.size()) - { - return plugin->keyframes.get(number)->title; - } - else - { - printf("PresetsDB::get_preset_title %d buffer overrun\n", __LINE__); - } - break; - } - } - return 0; -} - -char* PresetsDB::get_preset_data(char *plugin_title, int number) -{ - for(int i = 0; i < plugins.size(); i++) - { - PresetsDBPlugin *plugin = plugins.get(i); - if(!strcasecmp(plugin->title, plugin_title)) - { - if(number < plugin->keyframes.size()) - { - return plugin->keyframes.get(number)->data; - } - else - { - printf("PresetsDB::get_preset_data %d buffer overrun\n", __LINE__); - } - break; - } - } - return 0; -} - -PresetsDBPlugin* PresetsDB::get_plugin(const char *plugin_title) -{ - for(int i = 0; i < plugins.size(); i++) - { - PresetsDBPlugin *plugin = plugins.get(i); - if(!strcasecmp(plugin->title, plugin_title)) - { - return plugin; - } - } - return 0; -} - -PresetsDBPlugin* PresetsDB::new_plugin(const char *plugin_title) -{ - PresetsDBPlugin *result = new PresetsDBPlugin(plugin_title); - plugins.append(result); - return result; -} - - -void PresetsDB::save_preset(const char *plugin_title, const char *preset_title, char *data) -{ - PresetsDBPlugin *plugin = get_plugin(plugin_title); - if(!plugin) plugin = new_plugin(plugin_title); - PresetsDBKeyframe *keyframe = plugin->get_keyframe(preset_title); - if(!keyframe) keyframe = plugin->new_keyframe(preset_title); - keyframe->set_data(data); - save(); - -} - - -void PresetsDB::delete_preset(const char *plugin_title, const char *preset_title) -{ - PresetsDBPlugin *plugin = get_plugin(plugin_title); - if(plugin) - { - plugin->delete_keyframe(preset_title); - } - save(); -} - -void PresetsDB::load_preset(const char *plugin_title, const char *preset_title, KeyFrame *keyframe) -{ - PresetsDBPlugin *plugin = get_plugin(plugin_title); - if(plugin) - { - plugin->load_preset(preset_title, keyframe); - } -} - -int PresetsDB::preset_exists(const char *plugin_title, const char *preset_title) -{ - PresetsDBPlugin *plugin = get_plugin(plugin_title); - if(plugin) - { - return plugin->preset_exists(preset_title); - } - return 0; -} - - - - -PresetsDBKeyframe::PresetsDBKeyframe(const char *title) -{ - this->title = cstrdup(title); - data = 0; -} - -PresetsDBKeyframe::~PresetsDBKeyframe() -{ - delete [] title; - delete [] data; -} - -void PresetsDBKeyframe::set_data(char *data) -{ - delete [] this->data; - this->data = cstrdup(data); -} - - - -PresetsDBPlugin::PresetsDBPlugin(const char *title) -{ - this->title = cstrdup(title); -} - -PresetsDBPlugin::~PresetsDBPlugin() -{ - keyframes.remove_all_objects(); - delete [] title; -} - -void PresetsDBPlugin::load(FileXML *file) -{ - int result = 0; - char string[BCTEXTLEN]; - - do - { - result = file->read_tag(); - if(!result) - { - if(file->tag.title_is("/PLUGIN")) break; - else - if(file->tag.title_is("KEYFRAME")) - { - sprintf(string, "Unknown"); - const char *keyframe_title = file->tag.get_property("TITLE", string); - PresetsDBKeyframe *keyframe = new PresetsDBKeyframe(keyframe_title); - - char data[MESSAGESIZE]; - int len = file->read_data_until("/KEYFRAME", data, MESSAGESIZE-1); - data[len] = 0; - keyframe->set_data(data); - keyframes.append(keyframe); - - } - } - }while(!result); - - -} - -void PresetsDBPlugin::save(FileXML *file) -{ - file->tag.set_title("PLUGIN"); - file->tag.set_property("TITLE", title); - file->append_tag(); - file->append_newline(); - - for(int j = 0; j < keyframes.size(); j++) - { - PresetsDBKeyframe *keyframe = keyframes.get(j); - file->tag.set_title("KEYFRAME"); - file->tag.set_property("TITLE", keyframe->title); - file->append_tag(); - file->append_text(keyframe->data); - file->tag.set_title("/KEYFRAME"); - file->append_tag(); - file->append_newline(); - } - - file->tag.set_title("/PLUGIN"); - file->append_tag(); - file->append_newline(); -} - -PresetsDBKeyframe* PresetsDBPlugin::get_keyframe(const char *title) -{ - for(int i = 0; i < keyframes.size(); i++) - { - PresetsDBKeyframe *keyframe = keyframes.get(i); - if(!strcasecmp(keyframe->title, title)) return keyframe; - } - return 0; -} - -void PresetsDBPlugin::delete_keyframe(const char *title) -{ - for(int i = 0; i < keyframes.size(); i++) - { - PresetsDBKeyframe *keyframe = keyframes.get(i); - if(!strcasecmp(keyframe->title, title)) - { - keyframes.remove_object_number(i); - return; - } - } -} - - -PresetsDBKeyframe* PresetsDBPlugin::new_keyframe(const char *title) -{ - PresetsDBKeyframe *keyframe = new PresetsDBKeyframe(title); - keyframes.append(keyframe); - return keyframe; -} - -void PresetsDBPlugin::load_preset(const char *preset_title, KeyFrame *keyframe) -{ - PresetsDBKeyframe *src = get_keyframe(preset_title); - if(src) - { - keyframe->set_data(src->data); -// Save as the plugin's default -// Need the path -//printf("PresetsDBPlugin::load_preset %d %s\n", __LINE__, title); - PluginServer *server = MWindow::scan_plugindb(title, -1); - if(!server) - { - } - else - { - char path[BCTEXTLEN]; - server->get_defaults_path(path); - FileSystem fs; - fs.complete_path(path); - - FILE *fd = fopen(path, "w"); - if(fd) - { - if(!fwrite(src->data, strlen(src->data), 1, fd)) - { - fprintf(stderr, "PresetsDBPlugin::load_preset %d \"%s\": %s\n", - __LINE__, - path, - strerror(errno)); - } - - fclose(fd); - } - else - { - fprintf(stderr, "PresetsDBPlugin::load_preset %d \"%s\": %s\n", - __LINE__, - path, - strerror(errno)); - } - } - } -} - -int PresetsDBPlugin::preset_exists(const char *preset_title) -{ - PresetsDBKeyframe *src = get_keyframe(preset_title); - if(src) - { - return 1; - } - return 0; -} - - - - - - - diff --git a/cinelerra-5.1/cinelerra/presets.h.sav b/cinelerra-5.1/cinelerra/presets.h.sav deleted file mode 100644 index 99d3c10b..00000000 --- a/cinelerra-5.1/cinelerra/presets.h.sav +++ /dev/null @@ -1,108 +0,0 @@ - -/* - * CINELERRA - * Copyright (C) 2008 Adam Williams - * - * 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 - * - */ - -#ifndef PRESETS_H -#define PRESETS_H - - -#include "arraylist.h" -#include "filexml.inc" -#include "keyframe.inc" - - -// Front end for a DB of presets for all plugins - -// A single preset -class PresetsDBKeyframe -{ -public: - PresetsDBKeyframe(const char *title); - ~PresetsDBKeyframe(); - - void set_data(char *data); - - char *title; - char *data; -}; - -// Presets for a single plugin -class PresetsDBPlugin -{ -public: - PresetsDBPlugin(const char *title); - ~PresetsDBPlugin(); - - - void load(FileXML *file); - void save(FileXML *file); - -// Get a preset by name - PresetsDBKeyframe* get_keyframe(const char *title); -// Create a new keyframe - PresetsDBKeyframe* new_keyframe(const char *title); - void delete_keyframe(const char *title); -// Load a preset into the keyframe - void load_preset(const char *preset_title, KeyFrame *keyframe); - int preset_exists(const char *preset_title); - - ArrayList keyframes; - char *title; -}; - -class PresetsDB -{ -public: - PresetsDB(); - -// Load the database from the file. - void load(); -// Save the database to the file. - void save(); - -// Get the total number of presets for a plugin - int get_total_presets(char *plugin_title); -// Get the title of a preset - char* get_preset_title(char *plugin_title, int number); -// Get the data for a preset - char* get_preset_data(char *plugin_title, int number); -// Get a pluginDB by name - PresetsDBPlugin* get_plugin(const char *plugin_title); -// Create a pluginDB - PresetsDBPlugin* new_plugin(const char *plugin_title); - void save_preset(const char *plugin_title, const char *preset_title, char *data); - void delete_preset(const char *plugin_title, const char *preset_title); -// Load a preset into the keyframe - void load_preset(const char *plugin_title, const char *preset_title, KeyFrame *keyframe); - int preset_exists(const char *plugin_title, const char *preset_title); - -private: -// Remove all plugin data - void clear(); - - ArrayList plugins; -}; - - - -#endif - - - diff --git a/cinelerra-5.1/cinelerra/presets.inc.sav b/cinelerra-5.1/cinelerra/presets.inc.sav deleted file mode 100644 index 3718d19a..00000000 --- a/cinelerra-5.1/cinelerra/presets.inc.sav +++ /dev/null @@ -1,32 +0,0 @@ - -/* - * CINELERRA - * Copyright (C) 2008 Adam Williams - * - * 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 - * - */ - -#ifndef PRESETS_INC -#define PRESETS_INC - - -class PresetsDB; - -#endif - - - - diff --git a/cinelerra-5.1/cinelerra/presetsgui.C.sav b/cinelerra-5.1/cinelerra/presetsgui.C.sav deleted file mode 100644 index 48abf86f..00000000 --- a/cinelerra-5.1/cinelerra/presetsgui.C.sav +++ /dev/null @@ -1,504 +0,0 @@ - -/* - * CINELERRA - * Copyright (C) 2008 Adam Williams - * - * 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 - * - */ - -#if 0 - - - - -#include "edl.h" -#include "keyframe.h" -#include "keys.h" -#include "language.h" -#include "localsession.h" -#include "mainsession.h" -#include "mainundo.h" -#include "mwindow.h" -#include "mwindowgui.h" -#include "plugin.h" -#include "presets.h" -#include "presetsgui.h" -#include "theme.h" -#include "trackcanvas.h" -#include "tracks.h" - - - - - - - - - - - -PresetsThread::PresetsThread(MWindow *mwindow) - : BC_DialogThread() -{ - this->mwindow = mwindow; - plugin = 0; - data = new ArrayList; - presets_db = new PresetsDB; - plugin_title[0] = 0; - window_title[0] = 0; -} - -PresetsThread::~PresetsThread() -{ - close_window(); - delete data; -} - -void PresetsThread::calculate_list() -{ - data->remove_all_objects(); - int total_presets = presets_db->get_total_presets(plugin_title); - for(int i = 0; i < total_presets; i++) - { - data->append(new BC_ListBoxItem(presets_db->get_preset_title( - plugin_title, - i))); - } -} - - -void PresetsThread::start_window(Plugin *plugin) -{ - if(!BC_DialogThread::is_running()) - { - this->plugin = plugin; - plugin->calculate_title(plugin_title, 0); - sprintf(window_title, _(PROGRAM_NAME ": %s Presets"), plugin_title); - - -// Calculate database - presets_db->load(); - calculate_list(); - - - mwindow->gui->unlock_window(); - BC_DialogThread::start(); - mwindow->gui->lock_window("PresetsThread::start_window"); - } -} - -BC_Window* PresetsThread::new_gui() -{ - mwindow->gui->lock_window("PresetsThread::new_gui"); - int x = mwindow->gui->get_abs_cursor_x(0) - - mwindow->session->plugindialog_w / 2; - int y = mwindow->gui->get_abs_cursor_y(0) - - mwindow->session->plugindialog_h / 2; - - PresetsWindow *window = new PresetsWindow(mwindow, - this, - x, - y, - window_title); - - window->create_objects(); - mwindow->gui->unlock_window(); - return window; -} - -void PresetsThread::handle_done_event(int result) -{ -// Apply the preset - if(!result) - { - char *title = ((PresetsWindow*)get_gui())->title_text->get_text(); - apply_preset(title); - } -} - -void PresetsThread::handle_close_event(int result) -{ -} - -void PresetsThread::save_preset(char *title) -{ - get_gui()->unlock_window(); - mwindow->gui->lock_window("PresetsThread::save_preset"); - -// Test EDL for plugin existence - if(!mwindow->edl->tracks->plugin_exists(plugin)) - { - mwindow->gui->unlock_window(); - get_gui()->lock_window("PresetsThread::save_preset 2"); - return; - } - - -// Get current plugin keyframe - EDL *edl = mwindow->edl; - Track *track = plugin->track; - KeyFrame *keyframe = plugin->get_prev_keyframe( - track->to_units(edl->local_session->get_selectionstart(1), 0), - PLAY_FORWARD); - -// Send to database - presets_db->save_preset(plugin_title, title, keyframe->get_data()); - - mwindow->gui->unlock_window(); - get_gui()->lock_window("PresetsThread::save_preset 2"); - - -// Update list - calculate_list(); - ((PresetsWindow*)get_gui())->list->update(data, - 0, - 0, - 1); -} - -void PresetsThread::delete_preset(char *title) -{ - get_gui()->unlock_window(); - mwindow->gui->lock_window("PresetsThread::save_preset"); - -// Test EDL for plugin existence - if(!mwindow->edl->tracks->plugin_exists(plugin)) - { - mwindow->gui->unlock_window(); - get_gui()->lock_window("PresetsThread::delete_preset 1"); - return; - } - - presets_db->delete_preset(plugin_title, title); - - mwindow->gui->unlock_window(); - get_gui()->lock_window("PresetsThread::delete_preset 2"); - - -// Update list - calculate_list(); - ((PresetsWindow*)get_gui())->list->update(data, - 0, - 0, - 1); -} - - -void PresetsThread::apply_preset(char *title) -{ - if(presets_db->preset_exists(plugin_title, title)) - { - get_gui()->unlock_window(); - mwindow->gui->lock_window("PresetsThread::apply_preset"); - -// Test EDL for plugin existence - if(!mwindow->edl->tracks->plugin_exists(plugin)) - { - mwindow->gui->unlock_window(); - get_gui()->lock_window("PresetsThread::delete_preset 1"); - return; - } - - mwindow->undo->update_undo_before(); - KeyFrame *keyframe = plugin->get_keyframe(); - presets_db->load_preset(plugin_title, title, keyframe); - mwindow->save_backup(); - mwindow->undo->update_undo_after(_("apply preset"), LOAD_AUTOMATION); - - mwindow->update_plugin_guis(); - mwindow->gui->canvas->draw_overlays(); - mwindow->gui->canvas->flash(); - mwindow->sync_parameters(CHANGE_PARAMS); - - mwindow->gui->unlock_window(); - get_gui()->lock_window("PresetsThread::apply_preset"); - } -} - - - - - -PresetsList::PresetsList(PresetsThread *thread, - PresetsWindow *window, - int x, - int y, - int w, - int h) - : BC_ListBox(x, - y, - w, - h, - LISTBOX_TEXT, - thread->data) -{ - this->thread = thread; - this->window = window; -} - -int PresetsList::selection_changed() -{ - window->title_text->update( - thread->data->get(get_selection_number(0, 0))->get_text()); - return 0; -} - -int PresetsList::handle_event() -{ - window->set_done(0); - return 0; -} - - - - - - - - - - -PresetsText::PresetsText(PresetsThread *thread, - PresetsWindow *window, - int x, - int y, - int w) - : BC_TextBox(x, - y, - w, - 1, - "") -{ - this->thread = thread; - this->window = window; -} - -int PresetsText::handle_event() -{ - return 0; -} - - - - - - - - - - - - - - - - - -PresetsDelete::PresetsDelete(PresetsThread *thread, - PresetsWindow *window, - int x, - int y) - : BC_GenericButton(x, y, _("Delete")) -{ - this->thread = thread; - this->window = window; -} - -int PresetsDelete::handle_event() -{ - thread->delete_preset(window->title_text->get_text()); - return 1; -} - - - - - - - -PresetsSave::PresetsSave(PresetsThread *thread, - PresetsWindow *window, - int x, - int y) -: BC_GenericButton(x, y, _("Save")) -{ - this->thread = thread; - this->window = window; -} - -int PresetsSave::handle_event() -{ - thread->save_preset(window->title_text->get_text()); - return 1; -} - - - - - - - - -PresetsApply::PresetsApply(PresetsThread *thread, - PresetsWindow *window, - int x, - int y) - : BC_GenericButton(x, y, _("Apply")) -{ - this->thread = thread; - this->window = window; -} - -int PresetsApply::handle_event() -{ - thread->apply_preset(window->title_text->get_text()); - return 1; -} - - - -PresetsOK::PresetsOK(PresetsThread *thread, - PresetsWindow *window) - : BC_OKButton(window) -{ - this->thread = thread; - this->window = window; -} - -int PresetsOK::keypress_event() -{ - if(get_keypress() == RETURN) - { -printf("PresetsOK::keypress_event %d\n", __LINE__); - if(thread->presets_db->preset_exists(thread->plugin_title, - window->title_text->get_text())) - { -printf("PresetsOK::keypress_event %d\n", __LINE__); - window->set_done(0); - return 1; - } - else - { -printf("PresetsOK::keypress_event %d\n", __LINE__); - thread->save_preset(window->title_text->get_text()); - return 1; - } - } - return 0; -} - - - - - - - - - - -PresetsWindow::PresetsWindow(MWindow *mwindow, - PresetsThread *thread, - int x, - int y, - char *title_string) - : BC_Window(title_string, - x, y, - mwindow->session->presetdialog_w, - mwindow->session->presetdialog_h, - xS(320), yS(240), 1, 0, 1) -{ - this->mwindow = mwindow; - this->thread = thread; -} - -void PresetsWindow::create_objects() -{ - Theme *theme = mwindow->theme; - - lock_window("PresetsWindow::create_objects"); - theme->get_presetdialog_sizes(this); - - add_subwindow(title1 = new BC_Title(theme->presets_list_x, - theme->presets_list_y - BC_Title::calculate_h(this, "P") - theme->widget_border, - _("Saved presets:"))); - add_subwindow(list = new PresetsList(thread, - this, - theme->presets_list_x, - theme->presets_list_y, - theme->presets_list_w, - theme->presets_list_h)); - add_subwindow(title2 = new BC_Title(theme->presets_text_x, - theme->presets_text_y - BC_Title::calculate_h(this, "P") - theme->widget_border, - _("Preset title:"))); - add_subwindow(title_text = new PresetsText(thread, - this, - theme->presets_text_x, - theme->presets_text_y, - theme->presets_text_w)); - add_subwindow(delete_button = new PresetsDelete(thread, - this, - theme->presets_delete_x, - theme->presets_delete_y)); - add_subwindow(save_button = new PresetsSave(thread, - this, - theme->presets_save_x, - theme->presets_save_y)); - add_subwindow(apply_button = new PresetsApply(thread, - this, - theme->presets_apply_x, - theme->presets_apply_y)); - - add_subwindow(new PresetsOK(thread, this)); - add_subwindow(new BC_CancelButton(this)); - - show_window(); - unlock_window(); -} - -int PresetsWindow::resize_event(int w, int h) -{ - Theme *theme = mwindow->theme; - mwindow->session->presetdialog_w = w; - mwindow->session->presetdialog_h = h; - theme->get_presetdialog_sizes(this); - - title1->reposition_window(theme->presets_list_x, - theme->presets_list_y - BC_Title::calculate_h(this, "P") - theme->widget_border); - title2->reposition_window(theme->presets_text_x, - theme->presets_text_y - BC_Title::calculate_h(this, "P") - theme->widget_border); - list->reposition_window(theme->presets_list_x, - theme->presets_list_y, - theme->presets_list_w, - theme->presets_list_h); - title_text->reposition_window(theme->presets_text_x, - theme->presets_text_y, - theme->presets_text_w); - delete_button->reposition_window(theme->presets_delete_x, - theme->presets_delete_y); - save_button->reposition_window(theme->presets_save_x, - theme->presets_save_y); - apply_button->reposition_window(theme->presets_apply_x, - theme->presets_apply_y); - return 0; -} - - - - - - -#endif - diff --git a/cinelerra-5.1/cinelerra/presetsgui.C.sav1 b/cinelerra-5.1/cinelerra/presetsgui.C.sav1 deleted file mode 100644 index 43c4c39e..00000000 --- a/cinelerra-5.1/cinelerra/presetsgui.C.sav1 +++ /dev/null @@ -1,503 +0,0 @@ - -/* - * CINELERRA - * Copyright (C) 2008 Adam Williams - * - * 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 - * - */ - -#if 0 - - - - -#include "edl.h" -#include "keyframe.h" -#include "keys.h" -#include "language.h" -#include "localsession.h" -#include "mainsession.h" -#include "mainundo.h" -#include "mwindow.h" -#include "mwindowgui.h" -#include "plugin.h" -#include "presets.h" -#include "presetsgui.h" -#include "theme.h" -#include "trackcanvas.h" -#include "tracks.h" - - - - - - - - - - - -PresetsThread::PresetsThread(MWindow *mwindow) - : BC_DialogThread() -{ - this->mwindow = mwindow; - plugin = 0; - data = new ArrayList; - presets_db = new PresetsDB; - plugin_title[0] = 0; - window_title[0] = 0; -} - -PresetsThread::~PresetsThread() -{ - delete data; -} - -void PresetsThread::calculate_list() -{ - data->remove_all_objects(); - int total_presets = presets_db->get_total_presets(plugin_title); - for(int i = 0; i < total_presets; i++) - { - data->append(new BC_ListBoxItem(presets_db->get_preset_title( - plugin_title, - i))); - } -} - - -void PresetsThread::start_window(Plugin *plugin) -{ - if(!BC_DialogThread::is_running()) - { - this->plugin = plugin; - plugin->calculate_title(plugin_title, 0); - sprintf(window_title, PROGRAM_NAME ": %s Presets", plugin_title); - - -// Calculate database - presets_db->load(); - calculate_list(); - - - mwindow->gui->unlock_window(); - BC_DialogThread::start(); - mwindow->gui->lock_window("PresetsThread::start_window"); - } -} - -BC_Window* PresetsThread::new_gui() -{ - mwindow->gui->lock_window("PresetsThread::new_gui"); - int x = mwindow->gui->get_abs_cursor_x(0) - - mwindow->session->plugindialog_w / 2; - int y = mwindow->gui->get_abs_cursor_y(0) - - mwindow->session->plugindialog_h / 2; - - PresetsWindow *window = new PresetsWindow(mwindow, - this, - x, - y, - window_title); - - window->create_objects(); - mwindow->gui->unlock_window(); - return window; -} - -void PresetsThread::handle_done_event(int result) -{ -// Apply the preset - if(!result) - { - char *title = ((PresetsWindow*)get_gui())->title_text->get_text(); - apply_preset(title); - } -} - -void PresetsThread::handle_close_event(int result) -{ -} - -void PresetsThread::save_preset(char *title) -{ - get_gui()->unlock_window(); - mwindow->gui->lock_window("PresetsThread::save_preset"); - -// Test EDL for plugin existence - if(!mwindow->edl->tracks->plugin_exists(plugin)) - { - mwindow->gui->unlock_window(); - get_gui()->lock_window("PresetsThread::save_preset 2"); - return; - } - - -// Get current plugin keyframe - EDL *edl = mwindow->edl; - Track *track = plugin->track; - KeyFrame *keyframe = plugin->get_prev_keyframe( - track->to_units(edl->local_session->get_selectionstart(1), 0), - PLAY_FORWARD); - -// Send to database - presets_db->save_preset(plugin_title, title, keyframe->get_data()); - - mwindow->gui->unlock_window(); - get_gui()->lock_window("PresetsThread::save_preset 2"); - - -// Update list - calculate_list(); - ((PresetsWindow*)get_gui())->list->update(data, - 0, - 0, - 1); -} - -void PresetsThread::delete_preset(char *title) -{ - get_gui()->unlock_window(); - mwindow->gui->lock_window("PresetsThread::save_preset"); - -// Test EDL for plugin existence - if(!mwindow->edl->tracks->plugin_exists(plugin)) - { - mwindow->gui->unlock_window(); - get_gui()->lock_window("PresetsThread::delete_preset 1"); - return; - } - - presets_db->delete_preset(plugin_title, title); - - mwindow->gui->unlock_window(); - get_gui()->lock_window("PresetsThread::delete_preset 2"); - - -// Update list - calculate_list(); - ((PresetsWindow*)get_gui())->list->update(data, - 0, - 0, - 1); -} - - -void PresetsThread::apply_preset(char *title) -{ - if(presets_db->preset_exists(plugin_title, title)) - { - get_gui()->unlock_window(); - mwindow->gui->lock_window("PresetsThread::apply_preset"); - -// Test EDL for plugin existence - if(!mwindow->edl->tracks->plugin_exists(plugin)) - { - mwindow->gui->unlock_window(); - get_gui()->lock_window("PresetsThread::delete_preset 1"); - return; - } - - mwindow->undo->update_undo_before(); - KeyFrame *keyframe = plugin->get_keyframe(); - presets_db->load_preset(plugin_title, title, keyframe); - mwindow->save_backup(); - mwindow->undo->update_undo_after(_("apply preset"), LOAD_AUTOMATION); - - mwindow->update_plugin_guis(); - mwindow->gui->canvas->draw_overlays(); - mwindow->gui->canvas->flash(); - mwindow->sync_parameters(CHANGE_PARAMS); - - mwindow->gui->unlock_window(); - get_gui()->lock_window("PresetsThread::apply_preset"); - } -} - - - - - -PresetsList::PresetsList(PresetsThread *thread, - PresetsWindow *window, - int x, - int y, - int w, - int h) - : BC_ListBox(x, - y, - w, - h, - LISTBOX_TEXT, - thread->data) -{ - this->thread = thread; - this->window = window; -} - -int PresetsList::selection_changed() -{ - window->title_text->update( - thread->data->get(get_selection_number(0, 0))->get_text()); - return 0; -} - -int PresetsList::handle_event() -{ - window->set_done(0); - return 0; -} - - - - - - - - - - -PresetsText::PresetsText(PresetsThread *thread, - PresetsWindow *window, - int x, - int y, - int w) - : BC_TextBox(x, - y, - w, - 1, - "") -{ - this->thread = thread; - this->window = window; -} - -int PresetsText::handle_event() -{ - return 0; -} - - - - - - - - - - - - - - - - - -PresetsDelete::PresetsDelete(PresetsThread *thread, - PresetsWindow *window, - int x, - int y) - : BC_GenericButton(x, y, _("Delete")) -{ - this->thread = thread; - this->window = window; -} - -int PresetsDelete::handle_event() -{ - thread->delete_preset(window->title_text->get_text()); - return 1; -} - - - - - - - -PresetsSave::PresetsSave(PresetsThread *thread, - PresetsWindow *window, - int x, - int y) -: BC_GenericButton(x, y, C_("Save")) -{ - this->thread = thread; - this->window = window; -} - -int PresetsSave::handle_event() -{ - thread->save_preset(window->title_text->get_text()); - return 1; -} - - - - - - - - -PresetsApply::PresetsApply(PresetsThread *thread, - PresetsWindow *window, - int x, - int y) - : BC_GenericButton(x, y, _("Apply")) -{ - this->thread = thread; - this->window = window; -} - -int PresetsApply::handle_event() -{ - thread->apply_preset(window->title_text->get_text()); - return 1; -} - - - -PresetsOK::PresetsOK(PresetsThread *thread, - PresetsWindow *window) - : BC_OKButton(window) -{ - this->thread = thread; - this->window = window; -} - -int PresetsOK::keypress_event() -{ - if(get_keypress() == RETURN) - { -printf("PresetsOK::keypress_event %d\n", __LINE__); - if(thread->presets_db->preset_exists(thread->plugin_title, - window->title_text->get_text())) - { -printf("PresetsOK::keypress_event %d\n", __LINE__); - window->set_done(0); - return 1; - } - else - { -printf("PresetsOK::keypress_event %d\n", __LINE__); - thread->save_preset(window->title_text->get_text()); - return 1; - } - } - return 0; -} - - - - - - - - - - -PresetsWindow::PresetsWindow(MWindow *mwindow, - PresetsThread *thread, - int x, - int y, - char *title_string) - : BC_Window(title_string, - x, y, - mwindow->session->presetdialog_w, - mwindow->session->presetdialog_h, - xS(320), yS(240), 1, 0, 1) -{ - this->mwindow = mwindow; - this->thread = thread; -} - -void PresetsWindow::create_objects() -{ - Theme *theme = mwindow->theme; - - lock_window("PresetsWindow::create_objects"); - theme->get_presetdialog_sizes(this); - - add_subwindow(title1 = new BC_Title(theme->presets_list_x, - theme->presets_list_y - BC_Title::calculate_h(this, "P") - theme->widget_border, - _("Saved presets:"))); - add_subwindow(list = new PresetsList(thread, - this, - theme->presets_list_x, - theme->presets_list_y, - theme->presets_list_w, - theme->presets_list_h)); - add_subwindow(title2 = new BC_Title(theme->presets_text_x, - theme->presets_text_y - BC_Title::calculate_h(this, "P") - theme->widget_border, - _("Preset title:"))); - add_subwindow(title_text = new PresetsText(thread, - this, - theme->presets_text_x, - theme->presets_text_y, - theme->presets_text_w)); - add_subwindow(delete_button = new PresetsDelete(thread, - this, - theme->presets_delete_x, - theme->presets_delete_y)); - add_subwindow(save_button = new PresetsSave(thread, - this, - theme->presets_save_x, - theme->presets_save_y)); - add_subwindow(apply_button = new PresetsApply(thread, - this, - theme->presets_apply_x, - theme->presets_apply_y)); - - add_subwindow(new PresetsOK(thread, this)); - add_subwindow(new BC_CancelButton(this)); - - show_window(); - unlock_window(); -} - -int PresetsWindow::resize_event(int w, int h) -{ - Theme *theme = mwindow->theme; - mwindow->session->presetdialog_w = w; - mwindow->session->presetdialog_h = h; - theme->get_presetdialog_sizes(this); - - title1->reposition_window(theme->presets_list_x, - theme->presets_list_y - BC_Title::calculate_h(this, "P") - theme->widget_border); - title2->reposition_window(theme->presets_text_x, - theme->presets_text_y - BC_Title::calculate_h(this, "P") - theme->widget_border); - list->reposition_window(theme->presets_list_x, - theme->presets_list_y, - theme->presets_list_w, - theme->presets_list_h); - title_text->reposition_window(theme->presets_text_x, - theme->presets_text_y, - theme->presets_text_w); - delete_button->reposition_window(theme->presets_delete_x, - theme->presets_delete_y); - save_button->reposition_window(theme->presets_save_x, - theme->presets_save_y); - apply_button->reposition_window(theme->presets_apply_x, - theme->presets_apply_y); - return 0; -} - - - - - - -#endif - diff --git a/cinelerra-5.1/cinelerra/presetsgui.h.sav b/cinelerra-5.1/cinelerra/presetsgui.h.sav deleted file mode 100644 index 52d2cf5c..00000000 --- a/cinelerra-5.1/cinelerra/presetsgui.h.sav +++ /dev/null @@ -1,170 +0,0 @@ - -/* - * CINELERRA - * Copyright (C) 2008 Adam Williams - * - * 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 - * - */ - -#ifndef PRESETSGUI_H -#define PRESETSGUI_H - - -// Presets for effects & transitions -#if 0 - -#include "bcdialog.h" -#include "guicast.h" -#include "mwindow.inc" -#include "plugin.inc" -#include "presets.inc" - -class PresetsWindow; - - - - - -class PresetsThread : public BC_DialogThread -{ -public: - PresetsThread(MWindow *mwindow); - ~PresetsThread(); - - void calculate_list(); - void start_window(Plugin *plugin); - BC_Window* new_gui(); - void handle_done_event(int result); - void handle_close_event(int result); - void save_preset(char *title); - void delete_preset(char *title); - void apply_preset(char *title); - - char window_title[BCTEXTLEN]; - char plugin_title[BCTEXTLEN]; - MWindow *mwindow; - Plugin *plugin; - ArrayList *data; - PresetsDB *presets_db; -}; - -class PresetsList : public BC_ListBox -{ -public: - PresetsList(PresetsThread *thread, - PresetsWindow *window, - int x, - int y, - int w, - int h); - int selection_changed(); - int handle_event(); - PresetsThread *thread; - PresetsWindow *window; -}; - -class PresetsText : public BC_TextBox -{ -public: - PresetsText(PresetsThread *thread, - PresetsWindow *window, - int x, - int y, - int w); - int handle_event(); - PresetsThread *thread; - PresetsWindow *window; -}; - - -class PresetsDelete : public BC_GenericButton -{ -public: - PresetsDelete(PresetsThread *thread, - PresetsWindow *window, - int x, - int y); - int handle_event(); - PresetsThread *thread; - PresetsWindow *window; -}; - -class PresetsSave : public BC_GenericButton -{ -public: - PresetsSave(PresetsThread *thread, - PresetsWindow *window, - int x, - int y); - int handle_event(); - PresetsThread *thread; - PresetsWindow *window; -}; - -class PresetsApply : public BC_GenericButton -{ -public: - PresetsApply(PresetsThread *thread, - PresetsWindow *window, - int x, - int y); - int handle_event(); - PresetsThread *thread; - PresetsWindow *window; -}; - -class PresetsOK : public BC_OKButton -{ -public: - PresetsOK(PresetsThread *thread, - PresetsWindow *window); - int keypress_event(); - PresetsThread *thread; - PresetsWindow *window; -}; - - -class PresetsWindow : public BC_Window -{ -public: - PresetsWindow(MWindow *mwindow, - PresetsThread *thread, - int x, - int y, - char *title_string); - - void create_objects(); - int resize_event(int w, int h); - - PresetsList *list; - PresetsText *title_text; - PresetsDelete *delete_button; - PresetsSave *save_button; - PresetsApply *apply_button; - BC_Title *title1; - BC_Title *title2; - MWindow *mwindow; - PresetsThread *thread; -}; - - - -#endif - -#endif - - - diff --git a/cinelerra-5.1/cinelerra/presetsgui.inc.sav b/cinelerra-5.1/cinelerra/presetsgui.inc.sav deleted file mode 100644 index 641cd17c..00000000 --- a/cinelerra-5.1/cinelerra/presetsgui.inc.sav +++ /dev/null @@ -1,33 +0,0 @@ - -/* - * CINELERRA - * Copyright (C) 2008 Adam Williams - * - * 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 - * - */ - -#ifndef PRESETSGUI_INC -#define PRESETSGUI_INC - - -class PresetsThread; -class PresetsWindow; - -#endif - - - - diff --git a/cinelerra-5.1/cinelerra/probeprefs.C b/cinelerra-5.1/cinelerra/probeprefs.C index e81d742b..bf903ffd 100644 --- a/cinelerra-5.1/cinelerra/probeprefs.C +++ b/cinelerra-5.1/cinelerra/probeprefs.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #include "bcwindowbase.h" #include "bcdisplayinfo.h" #include "bcdialog.h" diff --git a/cinelerra-5.1/cinelerra/probeprefs.h b/cinelerra-5.1/cinelerra/probeprefs.h index e7fb5bf7..34906d7f 100644 --- a/cinelerra-5.1/cinelerra/probeprefs.h +++ b/cinelerra-5.1/cinelerra/probeprefs.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __PROBEPREFS_H__ #define __PROBEPREFS_H__ diff --git a/cinelerra-5.1/cinelerra/probeprefs.inc b/cinelerra-5.1/cinelerra/probeprefs.inc index e20e0b48..b49f6efa 100644 --- a/cinelerra-5.1/cinelerra/probeprefs.inc +++ b/cinelerra-5.1/cinelerra/probeprefs.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __PROBEPREFS_INC__ #define __PROBEPREFS_INC__ diff --git a/cinelerra-5.1/cinelerra/proxy.inc b/cinelerra-5.1/cinelerra/proxy.inc index dcf1b756..2eae7732 100644 --- a/cinelerra-5.1/cinelerra/proxy.inc +++ b/cinelerra-5.1/cinelerra/proxy.inc @@ -1,3 +1,24 @@ + +/* + * CINELERRA + * Copyright (C) 2015 Adam Williams + * + * 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 + * + */ + #ifndef __PROXY_INC__ #define __PROXY_INC__ diff --git a/cinelerra-5.1/cinelerra/recordbatches.C b/cinelerra-5.1/cinelerra/recordbatches.C index 6ed37423..e3dc12ac 100644 --- a/cinelerra-5.1/cinelerra/recordbatches.C +++ b/cinelerra-5.1/cinelerra/recordbatches.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #include #include #include diff --git a/cinelerra-5.1/cinelerra/recordbatches.h b/cinelerra-5.1/cinelerra/recordbatches.h index c587281c..85978cf6 100644 --- a/cinelerra-5.1/cinelerra/recordbatches.h +++ b/cinelerra-5.1/cinelerra/recordbatches.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef RECORDBATCHES_H #define RECORDBATCHES_H diff --git a/cinelerra-5.1/cinelerra/recordbatches.inc b/cinelerra-5.1/cinelerra/recordbatches.inc index 2525bafe..fad82044 100644 --- a/cinelerra-5.1/cinelerra/recordbatches.inc +++ b/cinelerra-5.1/cinelerra/recordbatches.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef RECORDBATCHES_INC #define RECORDBATCHES_INC diff --git a/cinelerra-5.1/cinelerra/recordconfig.C b/cinelerra-5.1/cinelerra/recordconfig.C index 749a5e6f..61587b9c 100644 --- a/cinelerra-5.1/cinelerra/recordconfig.C +++ b/cinelerra-5.1/cinelerra/recordconfig.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/recordengine.C b/cinelerra-5.1/cinelerra/recordengine.C index 2fb14891..9e604596 100644 --- a/cinelerra-5.1/cinelerra/recordengine.C +++ b/cinelerra-5.1/cinelerra/recordengine.C @@ -127,6 +127,7 @@ int RecordEngine::initialize() current_jump_jumps[2] = 60; current_jump_jumps[3] = 80; current_jump_jumps[4] = 100; +return 0; } int RecordEngine::run_script(FileXML *script) @@ -199,6 +200,7 @@ long RecordEngine::get_dc_offset(int offset) int RecordEngine::set_dc_offset(long new_offset, int number) { adevice->set_dc_offset(new_offset, number); +return 0; } long int RecordEngine::get_dc_offset(long *dc_offset, RecordGUIDCOffsetText **dc_offset_text) @@ -210,6 +212,7 @@ int RecordEngine::set_gui(RecordGUI *gui) { this->gui = gui; update_position(current_position); +return 0; } int RecordEngine::get_duplex_enable() @@ -491,11 +494,13 @@ int RecordEngine::close_output_devices() int RecordEngine::lock_window() { gui->lock_window(); +return 0; } int RecordEngine::unlock_window() { gui->unlock_window(); +return 0; } int RecordEngine::update_position(long new_position) @@ -523,6 +528,7 @@ int RecordEngine::update_position(long new_position) gui->update_next_label(next_label); } +return 0; } int RecordEngine::goto_prev_label() @@ -540,6 +546,7 @@ int RecordEngine::goto_prev_label() update_position(new_position); } } +return 0; } int RecordEngine::goto_next_label() @@ -588,6 +595,7 @@ int RecordEngine::calibrate_dc_offset(long new_value, int channel) int RecordEngine::reset_over() { +return 0; } int RecordEngine::set_done(int value) @@ -595,6 +603,7 @@ int RecordEngine::set_done(int value) stop_operation(1); stop_monitor(); gui->set_done(value); +return 0; } int RecordEngine::start_over() @@ -623,6 +632,7 @@ int RecordEngine::start_over() record->startsource_frame = 0; } } +return 0; } int RecordEngine::change_channel(Channel *channel) @@ -648,6 +658,7 @@ int RecordEngine::get_format(char *string) { File file; strcpy(string, file.formattostr(mwindow->plugindb, asset->format)); + return 0; } int RecordEngine::get_samplerate() { return asset->rate; } int RecordEngine::get_bits() { return asset->bits; } @@ -665,25 +676,30 @@ float RecordEngine::get_frames_per_foot() { /* return mwindow->preferences->fram int RecordEngine::set_monitor_video(int value) { +return 0; } int RecordEngine::set_monitor_audio(int value) { +return 0; } int RecordEngine::set_record_mode(char *text) { record->record_mode = text_to_mode(text); +return 0; } int RecordEngine::get_record_mode(char *text) { mode_to_text(text, record->record_mode); +return 0; } int RecordEngine::get_record_mode() { return record->record_mode; +return 0; } int RecordEngine::mode_to_text(char *string, int mode) @@ -694,6 +710,7 @@ int RecordEngine::mode_to_text(char *string, int mode) case 1: sprintf(string, _("Timed")); break; case 2: sprintf(string, _("Loop")); break; } +return 0; } int RecordEngine::text_to_mode(char *string) @@ -701,6 +718,7 @@ int RecordEngine::text_to_mode(char *string) if(!strcasecmp(string, _("Untimed"))) return 0; if(!strcasecmp(string, _("Timed"))) return 1; if(!strcasecmp(string, _("Loop"))) return 2; +return 0; } long RecordEngine::get_current_delay() @@ -718,11 +736,13 @@ int RecordEngine::reset_current_delay() { current_jump_delay = 0; current_jump_jump = current_jump_jumps[current_jump_delay]; +return 0; } int RecordEngine::set_loop_duration() { record->set_loop_duration((long)record->get_samplerate() * (atol(gui->loop_sec->get_text()) + atol(gui->loop_min->get_text()) * 60 + atol(gui->loop_hr->get_text()) * 3600)); +return 0; } diff --git a/cinelerra-5.1/cinelerra/recordmonitor.C b/cinelerra-5.1/cinelerra/recordmonitor.C index 3342c8d9..d978466f 100644 --- a/cinelerra-5.1/cinelerra/recordmonitor.C +++ b/cinelerra-5.1/cinelerra/recordmonitor.C @@ -1,6 +1,7 @@ /* * CINELERRA * Copyright (C) 2011 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/recordmonitor.h b/cinelerra-5.1/cinelerra/recordmonitor.h index a186c16e..6d19ad94 100644 --- a/cinelerra-5.1/cinelerra/recordmonitor.h +++ b/cinelerra-5.1/cinelerra/recordmonitor.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2011 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/recordvideo.C b/cinelerra-5.1/cinelerra/recordvideo.C index 91b5971b..740c5a19 100644 --- a/cinelerra-5.1/cinelerra/recordvideo.C +++ b/cinelerra-5.1/cinelerra/recordvideo.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/remotecontrol.C b/cinelerra-5.1/cinelerra/remotecontrol.C index 0907707d..5e1df35d 100644 --- a/cinelerra-5.1/cinelerra/remotecontrol.C +++ b/cinelerra-5.1/cinelerra/remotecontrol.C @@ -1,3 +1,22 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ #include "bccolors.h" #include "mainsession.h" diff --git a/cinelerra-5.1/cinelerra/remotecontrol.h b/cinelerra-5.1/cinelerra/remotecontrol.h index 81ded583..ac338aef 100644 --- a/cinelerra-5.1/cinelerra/remotecontrol.h +++ b/cinelerra-5.1/cinelerra/remotecontrol.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef _REMOTECONTROL_H_ #define _REMOTECONTROL_H_ diff --git a/cinelerra-5.1/cinelerra/render.C b/cinelerra-5.1/cinelerra/render.C index 1136be9b..a43449e4 100644 --- a/cinelerra-5.1/cinelerra/render.C +++ b/cinelerra-5.1/cinelerra/render.C @@ -1,6 +1,7 @@ /* * CINELERRA * Copyright (C) 1997-2011 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 @@ -726,6 +727,11 @@ void RenderThread::render_single(int test_overwrite, Asset *asset, EDL *edl, if( !render->result ) { // Get total range to render render->total_start = command->start_position; +#if 0 + render->default_asset->timecode = command->start_position; + printf("tc: %f \n", render->default_asset->timecode); + render->default_asset->timecode += edl->session->timecode_offset; +#endif render->total_end = command->end_position; total_length = render->total_end - render->total_start; diff --git a/cinelerra-5.1/cinelerra/render.h b/cinelerra-5.1/cinelerra/render.h index ad954335..07a3403a 100644 --- a/cinelerra-5.1/cinelerra/render.h +++ b/cinelerra-5.1/cinelerra/render.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/render.inc b/cinelerra-5.1/cinelerra/render.inc index e5866df1..b5ec492d 100644 --- a/cinelerra-5.1/cinelerra/render.inc +++ b/cinelerra-5.1/cinelerra/render.inc @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/renderfarm.C b/cinelerra-5.1/cinelerra/renderfarm.C index 9194bf9d..4231d269 100644 --- a/cinelerra-5.1/cinelerra/renderfarm.C +++ b/cinelerra-5.1/cinelerra/renderfarm.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/renderfarmclient.C b/cinelerra-5.1/cinelerra/renderfarmclient.C index 24e52db7..7c50bd54 100644 --- a/cinelerra-5.1/cinelerra/renderfarmclient.C +++ b/cinelerra-5.1/cinelerra/renderfarmclient.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/rescale.C b/cinelerra-5.1/cinelerra/rescale.C index ce9bcd61..ef385ff4 100644 --- a/cinelerra-5.1/cinelerra/rescale.C +++ b/cinelerra-5.1/cinelerra/rescale.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #include "rescale.h" #include "indexable.h" #include "language.h" diff --git a/cinelerra-5.1/cinelerra/rescale.h b/cinelerra-5.1/cinelerra/rescale.h index 046a9c7d..147bef6b 100644 --- a/cinelerra-5.1/cinelerra/rescale.h +++ b/cinelerra-5.1/cinelerra/rescale.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __RESCALE_H__ #define __RESCALE_H__ #include "indexable.inc" diff --git a/cinelerra-5.1/cinelerra/scale.C b/cinelerra-5.1/cinelerra/scale.C index 860c46fb..7d682bcb 100644 --- a/cinelerra-5.1/cinelerra/scale.C +++ b/cinelerra-5.1/cinelerra/scale.C @@ -47,6 +47,7 @@ Scale::~Scale() int Scale::handle_event() { thread->start(); +return 0; } ScaleThread::ScaleThread(MWindow *mwindow) @@ -189,6 +190,7 @@ int ScaleThread::update_aspect(ScaleWindow *window) sprintf(string, "%.0f", aspect_h); window->aspect_h->update(string); } +return 0; } @@ -307,6 +309,7 @@ int ScaleSizeText::handle_event() if(*output > 10000) *output = 10000; *output *= -1; thread->update_window(); +return 0; } ScaleOffsetText::ScaleOffsetText(int x, int y, ScaleThread *thread, int *output) @@ -320,6 +323,7 @@ int ScaleOffsetText::handle_event() if(*output > 10000) *output = 10000; if(*output < -10000) *output = -10000; thread->update_window(1); +return 0; } ScaleRatioText::ScaleRatioText(int x, int y, ScaleThread *thread, float *output) @@ -334,6 +338,7 @@ int ScaleRatioText::handle_event() if(*output < -10000) *output = -10000; *output *= -1; thread->update_window(); +return 0; } @@ -346,6 +351,7 @@ ScaleConstrain::~ScaleConstrain() {} int ScaleConstrain::handle_event() { thread->constrain_ratio = get_value(); +return 0; } ScaleData::ScaleData(int x, int y, ScaleThread *thread) @@ -356,6 +362,7 @@ int ScaleData::handle_event() { thread->scale_data = get_value(); thread->update_window(); +return 0; } @@ -371,6 +378,7 @@ int ScaleAspectAuto::handle_event() { thread->auto_aspect = get_value(); thread->update_aspect(thread->window); +return 0; } @@ -389,6 +397,7 @@ ScaleAspectW::~ScaleAspectW() int ScaleAspectW::handle_event() { *output = atof(get_text()); +return 0; } @@ -405,6 +414,7 @@ ScaleAspectH::~ScaleAspectH() int ScaleAspectH::handle_event() { *output = atof(get_text()); +return 0; } diff --git a/cinelerra-5.1/cinelerra/setformat.C b/cinelerra-5.1/cinelerra/setformat.C index 6afdebfc..ca514aaf 100644 --- a/cinelerra-5.1/cinelerra/setformat.C +++ b/cinelerra-5.1/cinelerra/setformat.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 1997-2012 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 @@ -288,6 +289,13 @@ SetFormatWindow::~SetFormatWindow() delete presets; } +/* W Ratio, H Ratio +Sets the ratio of the new canvas size (W, H) to the old (previous) canvas size (W, H). +The new canvas size is recalculated based upon a certain factor in the W Ratio, +H Ratio fields. A practical use-case: The current resolution is 640x480, and for some reason +you want it to be 1.33 times wider. You don't have to calculate what 640x1.33 is; +you type 1.33 into the "W" input instead, and Cinelerra calculates it for you. */ + void SetFormatWindow::create_objects() { lock_window("SetFormatWindow::create_objects"); @@ -420,7 +428,7 @@ void SetFormatWindow::create_objects() y += mwindow->theme->setformat_margin; add_subwindow(new BC_Title(mwindow->theme->setformat_x3, y, - _("Aspect ratio:"))); + _("Display Aspect ratio:"))); y += mwindow->theme->setformat_margin; x = mwindow->theme->setformat_x3; add_subwindow(aspect_w = new ScaleAspectText(x, y, thread, @@ -453,6 +461,10 @@ void SetFormatWindow::create_objects() (ArrayList*)&mwindow->interlace_project_modes, mwindow->theme->setformat_x4 + textbox->get_w(), y)); y += mwindow->theme->setformat_margin; + + add_subwindow(new BC_Title(mwindow->theme->setformat_x3, + y+10, + _("Note: W/H ratio fields means multipliers \nrelative to previous canvas size \n"))); BC_OKTextButton *ok; BC_CancelTextButton *cancel; diff --git a/cinelerra-5.1/cinelerra/setformat.h b/cinelerra-5.1/cinelerra/setformat.h index f7b275cc..b4744e22 100644 --- a/cinelerra-5.1/cinelerra/setformat.h +++ b/cinelerra-5.1/cinelerra/setformat.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/sha1.C b/cinelerra-5.1/cinelerra/sha1.C index 17471f94..abcdc9a9 100644 --- a/cinelerra-5.1/cinelerra/sha1.C +++ b/cinelerra-5.1/cinelerra/sha1.C @@ -1,4 +1,38 @@ -// see copyright notice in sha1.h +/* +*Copyright (C) 2011 Google Inc. All rights reserved. + * +*Redistribution and use in source and binary forms, with or without +*modification, are permitted provided that the following conditions are +*met: + * +** Redistributions of source code must retain the above copyright +*notice, this list of conditions and the following disclaimer. +** Redistributions in binary form must reproduce the above +*copyright notice, this list of conditions and the following disclaimer +*in the documentation and/or other materials provided with the +*distribution. +** Neither the name of Google Inc. nor the names of its +*contributors may be used to endorse or promote products derived from +*this software without specific prior written permission. + * +*THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +*"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +*LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +*A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +*OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +*SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +*LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +*DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +*THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +*(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +*OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// A straightforward SHA-1 implementation based on RFC 3174. +// http://www.ietf.org/rfc/rfc3174.txt +// The names of functions and variables (such as "a", "b", and "f") +// follow notations in RFC 3174. + #include "sha1.h" void SHA1::addBytes(const uint8_t* input, size_t length) diff --git a/cinelerra-5.1/cinelerra/shbtnprefs.C b/cinelerra-5.1/cinelerra/shbtnprefs.C index c28f91d8..36a9da5b 100644 --- a/cinelerra-5.1/cinelerra/shbtnprefs.C +++ b/cinelerra-5.1/cinelerra/shbtnprefs.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #include "bcwindowbase.h" #include "bcdisplayinfo.h" #include "bcdialog.h" diff --git a/cinelerra-5.1/cinelerra/shbtnprefs.h b/cinelerra-5.1/cinelerra/shbtnprefs.h index de7050d3..6ad78343 100644 --- a/cinelerra-5.1/cinelerra/shbtnprefs.h +++ b/cinelerra-5.1/cinelerra/shbtnprefs.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __SHBTNPREFS_H__ #define __SHBTNPREFS_H__ diff --git a/cinelerra-5.1/cinelerra/shbtnprefs.inc b/cinelerra-5.1/cinelerra/shbtnprefs.inc index ed626105..a23d0230 100644 --- a/cinelerra-5.1/cinelerra/shbtnprefs.inc +++ b/cinelerra-5.1/cinelerra/shbtnprefs.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __CMDLNPREFS_INC__ #define __CMDLNPREFS_INC__ diff --git a/cinelerra-5.1/cinelerra/shdmp.C b/cinelerra-5.1/cinelerra/shdmp.C index 4afe1850..c3213845 100644 --- a/cinelerra-5.1/cinelerra/shdmp.C +++ b/cinelerra-5.1/cinelerra/shdmp.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #include #include #include diff --git a/cinelerra-5.1/cinelerra/shudmp.C b/cinelerra-5.1/cinelerra/shudmp.C index ae31aceb..1d3560ce 100644 --- a/cinelerra-5.1/cinelerra/shudmp.C +++ b/cinelerra-5.1/cinelerra/shudmp.C @@ -1,3 +1,20 @@ +/* + * 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 + */ + #include #include #include diff --git a/cinelerra-5.1/cinelerra/shuttle.C b/cinelerra-5.1/cinelerra/shuttle.C index 53b6527a..80d2fdff 100644 --- a/cinelerra-5.1/cinelerra/shuttle.C +++ b/cinelerra-5.1/cinelerra/shuttle.C @@ -624,10 +624,16 @@ static const struct shuttle_dev { } shuttle_devs[] = { { "/dev/input/by-id/usb-Contour_Design_ShuttleXpress-event-if00", 0x0b33, 0x0020 }, + { "/dev/input/by-id/usb-Contour_Design_ShuttleXpress-event-mouse", + 0x0b33, 0x0020 }, { "/dev/input/by-id/usb-Contour_Design_ShuttlePRO_v2-event-if00", 0x0b33, 0x0030 }, + { "/dev/input/by-id/usb-Contour_Design_ShuttlePRO_v2-event-mouse", + 0x0b33, 0x0030 }, { "/dev/input/by-id/usb-Contour_Design_ShuttlePro-event-if00", 0x0b33, 0x0030 }, + { "/dev/input/by-id/usb-Contour_Design_ShuttlePro-event-mouse", + 0x0b33, 0x0030 }, { "/dev/input/by-id/usb-Contour_Design_ShuttlePRO_v2-event-joystick", 0x0b33, 0x0030 }, }; diff --git a/cinelerra-5.1/cinelerra/shuttle.h b/cinelerra-5.1/cinelerra/shuttle.h index 06406d53..c9d84705 100644 --- a/cinelerra-5.1/cinelerra/shuttle.h +++ b/cinelerra-5.1/cinelerra/shuttle.h @@ -1,3 +1,6 @@ +// Copyright 2013 Eric Messick (FixedImagePhoto.com/Contact) +// reworked 2019 for cinelerra-gg by William Morrow + #ifndef __SHUTTLE_H__ #define __SHUTTLE_H__ #ifdef HAVE_SHUTTLE diff --git a/cinelerra-5.1/cinelerra/shuttle.inc b/cinelerra-5.1/cinelerra/shuttle.inc index db6b37fd..56c315b4 100644 --- a/cinelerra-5.1/cinelerra/shuttle.inc +++ b/cinelerra-5.1/cinelerra/shuttle.inc @@ -1,3 +1,6 @@ +// Copyright 2013 Eric Messick (FixedImagePhoto.com/Contact) +// reworked 2019 for cinelerra-gg by William Morrow + #ifndef __SHUTTLE_INC__ #define __SHUTTLE_INC__ diff --git a/cinelerra-5.1/cinelerra/signalstatus.C b/cinelerra-5.1/cinelerra/signalstatus.C index c002ecc6..2159daec 100644 --- a/cinelerra-5.1/cinelerra/signalstatus.C +++ b/cinelerra-5.1/cinelerra/signalstatus.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifdef HAVE_DVB #include "bctitle.h" diff --git a/cinelerra-5.1/cinelerra/signalstatus.h b/cinelerra-5.1/cinelerra/signalstatus.h index 8d8ad13c..fea0cf02 100644 --- a/cinelerra-5.1/cinelerra/signalstatus.h +++ b/cinelerra-5.1/cinelerra/signalstatus.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef _SIGNALSTATUS_H_ #define _SIGNALSTATUS_H_ #ifdef HAVE_DVB diff --git a/cinelerra-5.1/cinelerra/signalstatus.inc b/cinelerra-5.1/cinelerra/signalstatus.inc index 829d8ef1..a300a328 100644 --- a/cinelerra-5.1/cinelerra/signalstatus.inc +++ b/cinelerra-5.1/cinelerra/signalstatus.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef _SIGNALSTATUS_INC_ #define _SIGNALSTATUS_INC_ diff --git a/cinelerra-5.1/cinelerra/strack.C b/cinelerra-5.1/cinelerra/strack.C index bdd4f59a..53050399 100644 --- a/cinelerra-5.1/cinelerra/strack.C +++ b/cinelerra-5.1/cinelerra/strack.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #include "clip.h" #include "edit.h" #include "edits.h" diff --git a/cinelerra-5.1/cinelerra/swindow.C b/cinelerra-5.1/cinelerra/swindow.C index d57becf7..18f6abaa 100644 --- a/cinelerra-5.1/cinelerra/swindow.C +++ b/cinelerra-5.1/cinelerra/swindow.C @@ -1,3 +1,22 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ #include "bchash.h" #include "bctimer.h" diff --git a/cinelerra-5.1/cinelerra/swindow.h b/cinelerra-5.1/cinelerra/swindow.h index ec3baafe..38612e71 100644 --- a/cinelerra-5.1/cinelerra/swindow.h +++ b/cinelerra-5.1/cinelerra/swindow.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __SWINDOW_H__ #define __SWINDOW_H__ diff --git a/cinelerra-5.1/cinelerra/swindow.inc b/cinelerra-5.1/cinelerra/swindow.inc index d948be37..10f0e80a 100644 --- a/cinelerra-5.1/cinelerra/swindow.inc +++ b/cinelerra-5.1/cinelerra/swindow.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __SWINDOW_INC__ #define __SWINDOW_INC__ diff --git a/cinelerra-5.1/cinelerra/testwindow.C b/cinelerra-5.1/cinelerra/testwindow.C index 122103f7..da3122aa 100644 --- a/cinelerra-5.1/cinelerra/testwindow.C +++ b/cinelerra-5.1/cinelerra/testwindow.C @@ -1,3 +1,20 @@ +/* + * 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 + */ + #include "testwindow.h" // c++ -g -I../guicast testwindow.C ../guicast/x86_64/libguicast.a \ // -DHAVE_GL -DHAVE_XFT -I/usr/include/freetype2 -lGL -lX11 -lXext \ diff --git a/cinelerra-5.1/cinelerra/testwindow.h b/cinelerra-5.1/cinelerra/testwindow.h index 929eb7ec..2abe7680 100644 --- a/cinelerra-5.1/cinelerra/testwindow.h +++ b/cinelerra-5.1/cinelerra/testwindow.h @@ -1,3 +1,20 @@ +/* + * 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 + */ + #ifndef __TESTWINDOW_H__ #define __TESTWINDOW_H__ diff --git a/cinelerra-5.1/cinelerra/timebar.C b/cinelerra-5.1/cinelerra/timebar.C index 68f42b5a..4b32cb6a 100644 --- a/cinelerra-5.1/cinelerra/timebar.C +++ b/cinelerra-5.1/cinelerra/timebar.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 1997-2014 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/timebar.h b/cinelerra-5.1/cinelerra/timebar.h index 3032aa0b..e4534781 100644 --- a/cinelerra-5.1/cinelerra/timebar.h +++ b/cinelerra-5.1/cinelerra/timebar.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 1997-2014 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/timelinepane.C b/cinelerra-5.1/cinelerra/timelinepane.C index 466b5332..0a067938 100644 --- a/cinelerra-5.1/cinelerra/timelinepane.C +++ b/cinelerra-5.1/cinelerra/timelinepane.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + #include "bcsignals.h" #include "edl.h" #include "timelinepane.h" diff --git a/cinelerra-5.1/cinelerra/timelinepane.h b/cinelerra-5.1/cinelerra/timelinepane.h index 4f463106..991a9fcf 100644 --- a/cinelerra-5.1/cinelerra/timelinepane.h +++ b/cinelerra-5.1/cinelerra/timelinepane.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + #ifndef TIMELINEPANE_H #define TIMELINEPANE_H diff --git a/cinelerra-5.1/cinelerra/track.C b/cinelerra-5.1/cinelerra/track.C index aff2b093..7960a96e 100644 --- a/cinelerra-5.1/cinelerra/track.C +++ b/cinelerra-5.1/cinelerra/track.C @@ -1,6 +1,7 @@ /* * CINELERRA * Copyright (C) 2010 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/trackcanvas.C b/cinelerra-5.1/cinelerra/trackcanvas.C index b2ed8a82..4d3b0637 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.C +++ b/cinelerra-5.1/cinelerra/trackcanvas.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 1997-2014 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/trackcanvas.h b/cinelerra-5.1/cinelerra/trackcanvas.h index 2f7358ac..7fa89832 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.h +++ b/cinelerra-5.1/cinelerra/trackcanvas.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008-2014 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/tracks.C b/cinelerra-5.1/cinelerra/tracks.C index 862bde2d..dc6bfc81 100644 --- a/cinelerra-5.1/cinelerra/tracks.C +++ b/cinelerra-5.1/cinelerra/tracks.C @@ -1,6 +1,7 @@ /* * CINELERRA * Copyright (C) 2010 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/transition.C b/cinelerra-5.1/cinelerra/transition.C index 28c9079b..3389457f 100644 --- a/cinelerra-5.1/cinelerra/transition.C +++ b/cinelerra-5.1/cinelerra/transition.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/transitionpopup.C b/cinelerra-5.1/cinelerra/transitionpopup.C index 2a73b772..a748244b 100644 --- a/cinelerra-5.1/cinelerra/transitionpopup.C +++ b/cinelerra-5.1/cinelerra/transitionpopup.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/transportque.C b/cinelerra-5.1/cinelerra/transportque.C index 5048beaf..96645929 100644 --- a/cinelerra-5.1/cinelerra/transportque.C +++ b/cinelerra-5.1/cinelerra/transportque.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/transportque.h b/cinelerra-5.1/cinelerra/transportque.h index fcfc1703..00f9e24a 100644 --- a/cinelerra-5.1/cinelerra/transportque.h +++ b/cinelerra-5.1/cinelerra/transportque.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/undostackitem.C b/cinelerra-5.1/cinelerra/undostackitem.C index dd7729dc..a0908640 100644 --- a/cinelerra-5.1/cinelerra/undostackitem.C +++ b/cinelerra-5.1/cinelerra/undostackitem.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/undostackitem.h b/cinelerra-5.1/cinelerra/undostackitem.h index 589c8959..ebf5e8a8 100644 --- a/cinelerra-5.1/cinelerra/undostackitem.h +++ b/cinelerra-5.1/cinelerra/undostackitem.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/vautomation.C b/cinelerra-5.1/cinelerra/vautomation.C index 97322f37..94e9f55f 100644 --- a/cinelerra-5.1/cinelerra/vautomation.C +++ b/cinelerra-5.1/cinelerra/vautomation.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/vdeviceprefs.C b/cinelerra-5.1/cinelerra/vdeviceprefs.C index 9d718b42..ad9078d2 100644 --- a/cinelerra-5.1/cinelerra/vdeviceprefs.C +++ b/cinelerra-5.1/cinelerra/vdeviceprefs.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2011 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/versioninfo.h b/cinelerra-5.1/cinelerra/versioninfo.h index d6e20b7c..852542f5 100644 --- a/cinelerra-5.1/cinelerra/versioninfo.h +++ b/cinelerra-5.1/cinelerra/versioninfo.h @@ -1,11 +1,16 @@ #ifndef __VERSIONINFO_H__ #define __VERSIONINFO_H__ +#include +#define CINELERRA_LIBAV_VERSION "Libav version: " LIBAVCODEC_IDENT; #define CINELERRA_VERSION "Infinity" #define REPOMAINTXT "git://git.cinelerra-gg.org/goodguy/cinelerra.git\n" #define COPYRIGHT_DATE "2019" #define COPYRIGHTTEXT1 "(c) 2006-2019 Heroine Virtual Ltd. by Adam Williams\n" #define COPYRIGHTTEXT2 "2007-2020 mods for Cinelerra-GG by W.P.Morrow aka goodguy\n" +#define COPYRIGHTTEXT3 "2003-2017 mods for Cinelerra-CV by CinelerraCV team\n" +#define COPYRIGHTTEXT4 "2015-2024 mods for Cinelerra-GG by Cinelerra-GG team\n" + #undef COMPILEDATE #endif diff --git a/cinelerra-5.1/cinelerra/videoconfig.C b/cinelerra-5.1/cinelerra/videoconfig.C index d6b4a192..842f8292 100644 --- a/cinelerra-5.1/cinelerra/videoconfig.C +++ b/cinelerra-5.1/cinelerra/videoconfig.C @@ -72,4 +72,5 @@ int VideoConfig::save_defaults(BC_Hash *defaults) defaults->update("VIDEO_CAPTURE_LENGTH", capture_length); defaults->update("VIDEO_OUT_DRIVER", video_out_driver); + return 0; } diff --git a/cinelerra-5.1/cinelerra/videodevice.C b/cinelerra-5.1/cinelerra/videodevice.C index 3ca744b4..339d3ac7 100644 --- a/cinelerra-5.1/cinelerra/videodevice.C +++ b/cinelerra-5.1/cinelerra/videodevice.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008-2013 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/videodevice.h b/cinelerra-5.1/cinelerra/videodevice.h index 61f56657..2c6e9d55 100644 --- a/cinelerra-5.1/cinelerra/videodevice.h +++ b/cinelerra-5.1/cinelerra/videodevice.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/videowindow.C b/cinelerra-5.1/cinelerra/videowindow.C index 8461ee26..5b843633 100644 --- a/cinelerra-5.1/cinelerra/videowindow.C +++ b/cinelerra-5.1/cinelerra/videowindow.C @@ -54,12 +54,14 @@ int VideoWindow::load_defaults(BC_Hash *defaults) { video_visible = defaults->get("VIDEOVISIBLE", 1); video_window_w = defaults->get("PLAYVIDEOW", video_window_w); + return 0; } int VideoWindow::update_defaults(BC_Hash *defaults) { defaults->update("VIDEOVISIBLE", video_visible); defaults->update("PLAYVIDEOW", video_window_w); + return 0; } void VideoWindow::create_objects() @@ -89,6 +91,7 @@ int VideoWindow::show_window() gui->show_window(); mwindow->gui->mainmenu->set_show_video(1); } + return 0; } int VideoWindow::hide_window() @@ -99,6 +102,7 @@ int VideoWindow::hide_window() gui->hide_window(); mwindow->gui->mainmenu->set_show_video(0); } + return 0; } int VideoWindow::resize_window() @@ -118,12 +122,14 @@ int VideoWindow::resize_window() if(video_cropping) gui->canvas->draw_crop_box(); gui->flash(); } + return 0; } int VideoWindow::fix_size(int &w, int &h, int width_given, float aspect_ratio) { w = width_given; h = (int)((float)width_given / aspect_ratio); + return 0; } int VideoWindow::original_size() @@ -132,6 +138,7 @@ int VideoWindow::original_size() get_full_sizes(w, h); video_window_w = w; resize_window(); + return 0; } int VideoWindow::get_full_sizes(int &w, int &h) @@ -160,6 +167,7 @@ int VideoWindow::init_video() { gui->canvas->start_video(); } + return 0; } int VideoWindow::stop_video() @@ -168,6 +176,7 @@ int VideoWindow::stop_video() { gui->canvas->stop_video(); } + return 0; } int VideoWindow::update(BC_Bitmap *frame) @@ -178,6 +187,7 @@ int VideoWindow::update(BC_Bitmap *frame) // gui->canvas->draw_bitmap(frame, 1); gui->unlock_window(); } + return 0; } int VideoWindow::get_w() @@ -199,6 +209,7 @@ BC_Bitmap* VideoWindow::get_bitmap() int VideoWindow::reset() { + return 0; } int VideoWindow::start_cropping() @@ -210,6 +221,7 @@ int VideoWindow::start_cropping() gui->y2 = gui->get_h(); gui->canvas->draw_crop_box(); gui->canvas->flash(); + return 0; } int VideoWindow::get_aspect_ratio(float &aspect_w, float &aspect_h) @@ -222,6 +234,7 @@ int VideoWindow::get_aspect_ratio(float &aspect_w, float &aspect_h) new_h = (int)((float)(gui->y2 - gui->y1) / zoom_factor); mwindow->create_aspect_ratio(aspect_w, aspect_h, new_w, new_h); + return 0; } int VideoWindow::stop_cropping() diff --git a/cinelerra-5.1/cinelerra/videowindowgui.C b/cinelerra-5.1/cinelerra/videowindowgui.C index 351f544d..e0022103 100644 --- a/cinelerra-5.1/cinelerra/videowindowgui.C +++ b/cinelerra-5.1/cinelerra/videowindowgui.C @@ -105,6 +105,7 @@ int VideoWindowGUI::update_title() int VideoWindowGUI::close_event() { thread->hide_window(); + return 0; } @@ -153,6 +154,7 @@ int VideoWindowCanvas::button_press() gui->y_offset = y - gui->y1; } } + return 0; } int VideoWindowCanvas::button_release() @@ -162,6 +164,7 @@ int VideoWindowCanvas::button_release() button_down = 0; corner_selected = 0; } + return 0; } int VideoWindowCanvas::cursor_motion() @@ -199,6 +202,7 @@ int VideoWindowCanvas::cursor_motion() draw_crop_box(); flash(); } + return 0; } int VideoWindowCanvas::draw_crop_box() @@ -214,5 +218,6 @@ int VideoWindowCanvas::draw_crop_box() draw_box(gui->x2 - CROPHANDLE_W, gui->y1 + 1, CROPHANDLE_W, CROPHANDLE_H - 1); draw_rectangle(gui->x1, gui->y1, w, h); set_opaque(); + return 0; } diff --git a/cinelerra-5.1/cinelerra/virtualanode.C b/cinelerra-5.1/cinelerra/virtualanode.C index 55a79d35..50f35a46 100644 --- a/cinelerra-5.1/cinelerra/virtualanode.C +++ b/cinelerra-5.1/cinelerra/virtualanode.C @@ -368,7 +368,7 @@ int VirtualANode::render_fade(double *buffer, int64_t len, int64_t input_position, int64_t sample_rate, Autos *autos, int direction, int use_nudge) { - double fade_value; + double fade_value = 0.0; FloatAuto *previous = 0; FloatAuto *next = 0; EDL *edl = vconsole->renderengine->get_edl(); diff --git a/cinelerra-5.1/cinelerra/virtualnode.C b/cinelerra-5.1/cinelerra/virtualnode.C index 92701bdd..374c22d7 100644 --- a/cinelerra-5.1/cinelerra/virtualnode.C +++ b/cinelerra-5.1/cinelerra/virtualnode.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/virtualvconsole.C b/cinelerra-5.1/cinelerra/virtualvconsole.C index 3c3fb86f..81c424c7 100644 --- a/cinelerra-5.1/cinelerra/virtualvconsole.C +++ b/cinelerra-5.1/cinelerra/virtualvconsole.C @@ -101,7 +101,7 @@ int VirtualVConsole::process_buffer(int64_t input_position, EDLSession *session = renderengine->get_edl()->session; int clr_color = session->cwindow_clear_color; - vrender->video_out->set_clear_color(clr_color, 0xff); + vrender->video_out->set_clear_color(clr_color, 0x00); if(use_opengl) { diff --git a/cinelerra-5.1/cinelerra/virtualvnode.h b/cinelerra-5.1/cinelerra/virtualvnode.h index 42f31f49..e18dd3d9 100644 --- a/cinelerra-5.1/cinelerra/virtualvnode.h +++ b/cinelerra-5.1/cinelerra/virtualvnode.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/vmodule.C b/cinelerra-5.1/cinelerra/vmodule.C index 64521524..1829c404 100644 --- a/cinelerra-5.1/cinelerra/vmodule.C +++ b/cinelerra-5.1/cinelerra/vmodule.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2009-2013 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 @@ -104,10 +105,10 @@ CICache* VModule::get_cache() int VModule::import_frame(VFrame *output, VEdit *current_edit, int64_t input_position, double frame_rate, int direction, int use_opengl) { - int64_t direction_position; + int64_t direction_position=0; // Translation of edit - float in_x, in_y, in_w, in_h; - float out_x, out_y, out_w, out_h; + float in_x=0.0, in_y=0.0, in_w=0.0, in_h=0.0; + float out_x=0.0, out_y=0.0, out_w=0.0, out_h=0.0; int result = 0; const int debug = 0; double edl_rate = get_edl()->session->frame_rate; diff --git a/cinelerra-5.1/cinelerra/vmodule.h b/cinelerra-5.1/cinelerra/vmodule.h index f15ab8ea..4b93f417 100644 --- a/cinelerra-5.1/cinelerra/vmodule.h +++ b/cinelerra-5.1/cinelerra/vmodule.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/vtrack.C b/cinelerra-5.1/cinelerra/vtrack.C index d99f913e..c3fbf810 100644 --- a/cinelerra-5.1/cinelerra/vtrack.C +++ b/cinelerra-5.1/cinelerra/vtrack.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/wintv.C b/cinelerra-5.1/cinelerra/wintv.C index 532a4704..28a10e57 100644 --- a/cinelerra-5.1/cinelerra/wintv.C +++ b/cinelerra-5.1/cinelerra/wintv.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifdef HAVE_WINTV #include "channelinfo.h" diff --git a/cinelerra-5.1/cinelerra/wintv.h b/cinelerra-5.1/cinelerra/wintv.h index 669cc7f9..eea97c45 100644 --- a/cinelerra-5.1/cinelerra/wintv.h +++ b/cinelerra-5.1/cinelerra/wintv.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __WINTV_H__ #define __WINTV_H__ // as of 2020/01/06 using kernel version 5.3.16 diff --git a/cinelerra-5.1/cinelerra/wintv.inc b/cinelerra-5.1/cinelerra/wintv.inc index 744a6ac3..9b257131 100644 --- a/cinelerra-5.1/cinelerra/wintv.inc +++ b/cinelerra-5.1/cinelerra/wintv.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __WINTV_INC__ #define __WINTV_INC__ diff --git a/cinelerra-5.1/cinelerra/wwindow.inc b/cinelerra-5.1/cinelerra/wwindow.inc index 74b40173..a68aa419 100644 --- a/cinelerra-5.1/cinelerra/wwindow.inc +++ b/cinelerra-5.1/cinelerra/wwindow.inc @@ -1,3 +1,24 @@ + +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + #ifndef WARNWINDOW_INC #define WARNWINDOW_INC diff --git a/cinelerra-5.1/cinelerra/x10tv.C b/cinelerra-5.1/cinelerra/x10tv.C index ee7438bb..616ac596 100644 --- a/cinelerra-5.1/cinelerra/x10tv.C +++ b/cinelerra-5.1/cinelerra/x10tv.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifdef HAVE_X10TV #include "channelinfo.h" diff --git a/cinelerra-5.1/cinelerra/x10tv.h b/cinelerra-5.1/cinelerra/x10tv.h index efb7fb0a..246e87a8 100644 --- a/cinelerra-5.1/cinelerra/x10tv.h +++ b/cinelerra-5.1/cinelerra/x10tv.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __X10TV_H__ #define __X10TV_H__ #ifdef HAVE_X10TV diff --git a/cinelerra-5.1/cinelerra/x10tv.inc b/cinelerra-5.1/cinelerra/x10tv.inc index 523c6535..a32675ab 100644 --- a/cinelerra-5.1/cinelerra/x10tv.inc +++ b/cinelerra-5.1/cinelerra/x10tv.inc @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #ifndef __X10TV_INC__ #define __X10TV_INC__ diff --git a/cinelerra-5.1/cinelerra/ydiff.C b/cinelerra-5.1/cinelerra/ydiff.C index 900a8f6f..685d9766 100644 --- a/cinelerra-5.1/cinelerra/ydiff.C +++ b/cinelerra-5.1/cinelerra/ydiff.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + #include #include #include diff --git a/cinelerra-5.1/cinelerra/zoombar.C b/cinelerra-5.1/cinelerra/zoombar.C index b09223ad..be95a980 100644 --- a/cinelerra-5.1/cinelerra/zoombar.C +++ b/cinelerra-5.1/cinelerra/zoombar.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 1997-2014 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/cinelerra/zoombar.h b/cinelerra-5.1/cinelerra/zoombar.h index 7d717a99..7d7edbc8 100644 --- a/cinelerra-5.1/cinelerra/zoombar.h +++ b/cinelerra-5.1/cinelerra/zoombar.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac index 1c9f289d..4b72a861 100644 --- a/cinelerra-5.1/configure.ac +++ b/cinelerra-5.1/configure.ac @@ -5,13 +5,31 @@ AC_INIT([cinelerra],[5.1],[mail@lists.cinelerra-gg.org]) # Put autogenerated stuff in subdir m4, which must be created # externally. This macro must be set before calling AC_INIT_AUTOMAKE AC_CONFIG_AUX_DIR(m4) +AC_CONFIG_MACRO_DIRS([m4]) AM_INIT_AUTOMAKE([foreign]) +LT_INIT() AM_PROG_AS AC_LANG([C++]) AC_LANG([C]) AC_PROG_CXX + +AC_CHECK_PROG(MAKEINFO,[makeinfo],[makeinfo],[no]) +if test x"$MAKEINFO" == x"no" ; then +AC_MSG_ERROR([Please install texinfo]) +fi + +AC_CHECK_PROG(GETTEXT,[gettext],[gettext],[no]) +if test x"$GETTEXT" == x"no" ; then +AC_MSG_ERROR([Please install gettext]) +fi + +AC_CHECK_PROG(LIBTOOL,[libtool],[libtool],[no]) +if test x"$LIBTOOL" == x"no" ; then +AC_MSG_ERROR([Please install libtool]) +fi + CFG_CFLAGS+=" -fno-omit-frame-pointer -fno-math-errno -fno-signed-zeros" CFG_CFLAGS+=" -pthread -Wall" # misguided pedantic warnings @@ -205,7 +223,7 @@ PKG_3RD([esound],[no], [ . ]) PKG_3RD([ffmpeg],[yes], - [ffmpeg-4.4], + [ffmpeg-6.1], [ libavutil/libavutil.a \ libavcodec/libavcodec.a \ libpostproc/libpostproc.a \ @@ -238,7 +256,7 @@ PKG_3RD([fftw],[auto], [ api ]) PKG_3RD([flac],[auto], - [flac-1.3.2], + [flac-1.4.2], [ src/libFLAC/.libs/libFLAC.a \ src/libFLAC++/.libs/libFLAC++.a \ src/share/replaygain_analysis/.libs/libreplaygain_analysis.a \ @@ -285,7 +303,7 @@ PKG_3RD([libdv],[auto], [ . ]) PKG_3RD([libjpeg],[auto], - [libjpeg-turbo-2.1.2], + [libjpeg-turbo-2.1.5.1], [ build/libjpeg.a \ build/libturbojpeg.a ], [ opt/libjpeg-turbo/include ]) @@ -306,7 +324,7 @@ PKG_3RD([libogg],[auto], [ include ]) PKG_3RD([libsndfile],[auto], - [libsndfile-1.0.28], + [libsndfile-1.2.2], [ src/.libs/libsndfile.a \ src/.libs/libcommon.a \ src/G72x/.libs/libg72x.a \ @@ -388,7 +406,7 @@ PKG_3RD([ilmBase],[auto], [ilmBase], [] []) # []) # PKG_3RD([tiff],[auto], - [tiff-4.3.0], + [tiff-4.6.0], [ libtiff/.libs/libtiff.a \ libtiff/.libs/libtiffxx.a \ port/.libs/libport.a ],[ @@ -400,17 +418,17 @@ PKG_3RD([twolame],[auto], [ libtwolame ]) PKG_3RD([x264],[auto], - [x264-snapshot-20210615-master], + [x264-stable], [ libx264.a ], [ . ]) PKG_3RD([x265],[auto], - [x265_3.5], + [x265_3.517122023], [ libx265.a ], [ . source ]) PKG_3RD([libvpx],[auto], - [libvpx-1.11.0], + [libvpx-1.13.1], [ libvpx.a ], [ . ]) @@ -445,19 +463,26 @@ PKG_3RD([suil],[auto], [ usr/local/include ]) PKG_3RD([libaom],[auto], - [libaom-v3.2.0], + [libaom-v3.8.0], [ usr/local/lib*/libaom*.a ], [ usr/local/include ]) +PKG_3RD([libsvtav1],[no], + [libsvtav1-v1.8.0], + [ usr/local/lib*/libSvtAv1Enc.a ], + [ usr/local/include/svt-av1 ]) + PKG_3RD([dav1d],[auto], [dav1d-0.5.1], [ usr/local/lib*/libdav1d*.a ], [ usr/local/include ]) PKG_3RD([libwebp],[auto], - [libwebp-1.1.0], - [ usr/local/lib*/libwebp*.a ], - [ usr/local/include ]) + [libwebp-1.3.2], + [ usr/local/lib*/libwebp*.a \ + usr/local/lib*/libsharpyuv*.a ], + [ usr/local/include/webp \ + usr/local/include/ ]) PKG_3RD([ffnvcodec],[auto], [ffnvcodec], @@ -582,7 +607,7 @@ if test "x$HAVE_$1" != "xno"; then fi ]) -IMMATH_HEADERS=$(pkg-config --cflags Imath) +IMMATH_HEADERS=$(pkg-config --cflags Imath 2>/dev/null) CHECK_LIB([X11], [X11], [XOpenDisplay]) CHECK_HEADERS([X11], [X11 headers], [X11/X.h X11/Xlib.h X11/Xutil.h X11/cursorfont.h]) @@ -799,23 +824,23 @@ CHECK_WANT([LV2], [auto], [use lv2], [ AC_MSG_CHECKING([for lv2 availability]) saved_LIBS="$LIBS" saved_CFLAGS="$CFLAGS" - LIBS=" $(pkg-config --libs lilv-0)" + LIBS=" $(pkg-config --libs lilv-0 2>/dev/null)" CHECK_LIB([lilv], [lilv-0], [lilv_world_new]) CHECK_LIB([sord], [sord-0], [sord_world_new]) CHECK_LIB([serd], [serd-0], [serd_reader_new]) CHECK_LIB([sratom], [sratom-0], [sratom_new]) - CFLAGS="-I/usr/include/lilv-0 -I/usr/local/include/lilv-0 `pkg-config --cflags lilv-0`" + CFLAGS="-I/usr/include/lilv-0 -I/usr/local/include/lilv-0 `pkg-config --cflags lilv-0 2>/dev/null`" CHECK_HEADERS([lilv], [lilv headers], [lilv/lilv.h]) - CFLAGS="-I/usr/include/serd-0 -I/usr/local/include/serd-0 `pkg-config --cflags serd-0`" + CFLAGS="-I/usr/include/serd-0 -I/usr/local/include/serd-0 `pkg-config --cflags serd-0 2>/dev/null`" CHECK_HEADERS([serd], [serd headers], [serd/serd.h]) - CFLAGS="-I/usr/include/sord-0 -I/usr/local/include/sord-0 `pkg-config --cflags sord-0`" + CFLAGS="-I/usr/include/sord-0 -I/usr/local/include/sord-0 `pkg-config --cflags sord-0 2>/dev/null`" CHECK_HEADERS([sord], [sord headers], [sord/sord.h]) - CFLAGS="-I/usr/include/sratom-0 -I/usr/local/include/sratom-0 `pkg-config --cflags sratom-0`" + CFLAGS="-I/usr/include/sratom-0 -I/usr/local/include/sratom-0 `pkg-config --cflags sratom-0 2>/dev/null`" CHECK_HEADERS([sratom], [sratom headers], [sratom/sratom.h]) CHECK_LIB([suil], [suil-0], [suil_instance_new]) - CFLAGS="-I/usr/include/suil-0 -I/usr/local/include/suil-0 `pkg-config --cflags suil-0`" + CFLAGS="-I/usr/include/suil-0 -I/usr/local/include/suil-0 `pkg-config --cflags suil-0 2>/dev/null`" CHECK_HEADERS([suil], [suil headers], [suil/suil.h]) - CFG_CFLAGS+=" $(pkg-config --cflags lilv-0) $(pkg-config --cflags suil-0)" + CFG_CFLAGS+=" $(pkg-config --cflags lilv-0 2>/dev/null) $(pkg-config --cflags suil-0 2>/dev/null)" LIBS="$saved_LIBS" CFLAGS="$saved_CFLAGS"]) # have all or none @@ -881,8 +906,9 @@ EXROStream() : Imf::OStream("mypath") {} }; if test "x$WANT_STATIC_BUILD" = "xno"; then SHARED_openexr="$LIBS" SHARED_LIBS+=" $LIBS" - CFG_CFLAGS+=" -I/usr/include/OpenEXR -I/usr/local/include/OpenEXR" + CFG_CFLAGS+=" -I/usr/local/include/Imath -I/usr/include/OpenEXR -I/usr/local/include/OpenEXR" CFG_CFLAGS+=" $(pkg-config --cflags OpenEXR)" + CFG_CFLAGS+=" $(pkg-config --cflags Imath)" fi CFG_CFLAGS+=" $(pkg-config --cflags OpenEXR)" fi @@ -1006,6 +1032,7 @@ PKG_PROVIDE([libuuid]) PKG_PROVIDE([libvorbis]) PKG_PROVIDE([mjpegtools]) PKG_PROVIDE([libaom]) +PKG_PROVIDE([libsvtav1]) PKG_PROVIDE([dav1d]) PKG_PROVIDE([libwebp]) PKG_PROVIDE([openExr], [$WANT_OPENEXR]) @@ -1065,6 +1092,7 @@ done # build extras if test "x$WANT_CLANG" = "xyes" ; then FFMPEG_EXTRA_CFG+=' --cc=clang --cxx=clang++' + CFG_CFLAGS+=" -Wno-unknown-warning-option" fi if test "x$HAVE_tiff" = "xyes"; then if test "x$HAVE_jbig" = "xyes"; then @@ -1256,6 +1284,22 @@ if test "x$BSD" != "x" ; then echo "CFLAGS += -DNO_GDB" fi +if test [ "$(uname)"] = "NetBSD" ; then +echo "CFLAGS += -DNO_BTRACE" +echo "CFLAGS += -DNO_CTX" +echo "system_libs += -L/usr/pkg/lib/ffmpeg6" +echo "system_libs += -L/usr/pkg/lib/" +echo "system_libs += -lpng16" +echo "system_libs += -lintl" +echo "system_libs += -lossaudio" +echo "CFLAGS += -I/usr/X11R7/include" +echo "CFLAGS += -I/usr/pkg/include/ffmpeg6" +echo "CFLAGS += $(pkg-config --cflags xft)" +echo "CFLAGS += -I/usr/pkg/include" +echo "CFLAGS += -I/usr/pkg/include/uuid" + +fi + if test "x$WANT_X264_HIDEPTH" = "xyes" ; then X264_CFG_PARAMS="$X264_CFG_PARAMS --bit-depth=10" fi diff --git a/cinelerra-5.1/doc/brender_tmp_delete.sh b/cinelerra-5.1/doc/brender_tmp_delete.sh new file mode 100755 index 00000000..e38a4c34 --- /dev/null +++ b/cinelerra-5.1/doc/brender_tmp_delete.sh @@ -0,0 +1,3 @@ +#!/bin/bash +# delete brender ##### background rendering files in /tmp +rm -i -f /tmp/brender* diff --git a/cinelerra-5.1/doc/shortcuts.html b/cinelerra-5.1/doc/shortcuts.html index d2cab0ff..adff7925 100644 --- a/cinelerra-5.1/doc/shortcuts.html +++ b/cinelerra-5.1/doc/shortcuts.html @@ -1674,6 +1674,12 @@ 'Ctrl' Proxy quick switch + +
+ '!'
+ 'Ctrl' + Assigns the timecode of the asset to the timebar +
F1 diff --git a/cinelerra-5.1/doc/vaapi_proxy.sh b/cinelerra-5.1/doc/vaapi_proxy.sh new file mode 100755 index 00000000..6109f8a3 --- /dev/null +++ b/cinelerra-5.1/doc/vaapi_proxy.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +filename="$1" +fileout="${filename%.*}" +proxy="6" +# Hardware encode AMD +ffmpeg -threads 2 -hwaccel vaapi -vaapi_device /dev/dri/renderD128 \ + -i "$1" -c:v h264_vaapi -vf "format=nv12,hwupload,scale_vaapi=iw/'$proxy':ih/'$proxy'" \ + -vcodec h264_vaapi -preset fast -c:a copy \ + -bf 0 -profile:v 66 "$fileout".proxy"$proxy"-mp4.mp4 diff --git a/cinelerra-5.1/doc/whatsnew_2_1.html b/cinelerra-5.1/doc/whatsnew_2_1.html deleted file mode 100644 index 6c202f61..00000000 --- a/cinelerra-5.1/doc/whatsnew_2_1.html +++ /dev/null @@ -1,4 +0,0 @@ -

What's new in Cinelerra 2.1

- -So many big things happened in 2.1 that a simple CHANGELOG won't do. - diff --git a/cinelerra-5.1/expanders.es b/cinelerra-5.1/expanders.es index 4569ac8d..99c58389 100644 --- a/cinelerra-5.1/expanders.es +++ b/cinelerra-5.1/expanders.es @@ -1,4 +1,12 @@ Video Effects + - Favoritos + Brightness/Contrast + Color 3 Way + Color Balance + Gradient + Histogram + Title + VideoScope - Corrección_de_Color Blue Banana Brightness/Contrast @@ -14,6 +22,7 @@ Video Effects Hue saturation Interpolate Bayer Invert Video + Posterize RGBShift RGB - 601 Reroute @@ -28,25 +37,34 @@ Video Effects F_chromahold F_colorbalance F_colorchannelmixer + F_colorcontrast + F_colorcorrect + F_colorize F_colorkey F_colorlevels F_colormatrix F_colorspace + F_colortemperature F_curves F_elbg F_eq + F_exposure F_fftfilt F_floodfill + F_grayworld F_greyedge F_haldclutsrc F_histeq F_histogram + F_hsvhold + F_hsvkey F_limiter F_lut F_lut1d F_lut3d F_lutrgb F_lutyuv + F_monochrome F_negate F_normalize F_pseudocolor @@ -115,6 +133,7 @@ Video Effects Crop & Position Flip Lens + Mirror Perspective Polar Rotate @@ -139,6 +158,7 @@ Video Effects F_perspective F_rotate F_scale + F_shear F_super2xsai F_swaprect F_tile @@ -160,8 +180,10 @@ Video Effects Interpolate Video ReframeRT Reverse video + Speed PerCent Time Average TimeFront + Timelapse Helper F_amplify F_deflicker F_framerate @@ -171,13 +193,24 @@ Video Effects F_realtime F_tblend F_tinterlace + F_tmidequalizer F_tmix F_vfrdet + - Artistic + F_epx + F_kirsch + F_pixelize + F_shufflepixels - Test F_bench F_bbox + F_blockdetect + F_blurdetect F_ciescope F_color + F_colorchart + F_colorize + F_colorspectrum F_datascope F_entropy F_graphmonitor diff --git a/cinelerra-5.1/expanders.fr b/cinelerra-5.1/expanders.fr index 57119ca8..25ed8883 100644 --- a/cinelerra-5.1/expanders.fr +++ b/cinelerra-5.1/expanders.fr @@ -1,4 +1,12 @@ Video Effects + - Favoris + Brightness/Contrast + Color 3 Way + Color Balance + Gradient + Histogram + Title + VideoScope - Correction de couleurs Blue Banana Brightness/Contrast @@ -14,6 +22,7 @@ Video Effects Hue saturation Interpolate Bayer Invert Video + Posterize RGBShift RGB - 601 Reroute @@ -28,25 +37,34 @@ Video Effects F_chromahold F_colorbalance F_colorchannelmixer + F_colorcontrast + F_colorcorrect + F_colorize F_colorkey F_colorlevels F_colormatrix F_colorspace + F_colortemperature F_curves F_elbg F_eq + F_exposure F_fftfilt F_floodfill + F_grayworld F_greyedge F_haldclutsrc F_histeq F_histogram + F_hsvhold + F_hsvkey F_limiter F_lut F_lut1d F_lut3d F_lutrgb F_lutyuv + F_monochrome F_negate F_normalize F_pseudocolor @@ -115,6 +133,7 @@ Video Effects Crop & Position Flip Lens + Mirror Perspective Polar Rotate @@ -139,6 +158,7 @@ Video Effects F_perspective F_rotate F_scale + F_shear F_super2xsai F_swaprect F_tile @@ -160,8 +180,10 @@ Video Effects Interpolate Video ReframeRT Reverse video + Speed PerCent Time Average TimeFront + Timelapse Helper F_amplify F_deflicker F_framerate @@ -171,13 +193,24 @@ Video Effects F_realtime F_tblend F_tinterlace + F_tmidequalizer F_tmix F_vfrdet + -Artistic + F_epx + F_kirsch + F_pixelize + F_shufflepixels - Test F_bench F_bbox + F_blockdetect + F_blurdetect F_ciescope F_color + F_colorchart + F_colorize + F_colorspectrum F_datascope F_entropy F_graphmonitor diff --git a/cinelerra-5.1/expanders.txt b/cinelerra-5.1/expanders.txt index 0bfb8db7..0e3ae841 100644 --- a/cinelerra-5.1/expanders.txt +++ b/cinelerra-5.1/expanders.txt @@ -1,4 +1,12 @@ Video Effects + - Favorites + Brightness/Contrast + Color 3 Way + Color Balance + Gradient + Histogram + Title + VideoScope - Color_Correction Blue Banana Brightness/Contrast @@ -43,10 +51,13 @@ Video Effects F_exposure F_fftfilt F_floodfill + F_grayworld F_greyedge F_haldclutsrc F_histeq F_histogram + F_hsvhold + F_hsvkey F_limiter F_lut F_lut1d @@ -123,6 +134,7 @@ Video Effects Crop & Position Flip Lens + Mirror Perspective Polar Rotate @@ -186,15 +198,20 @@ Video Effects F_tmix F_vfrdet - Artistic - F_shufflepixels F_epx F_kirsch + F_pixelize + F_shufflepixels - Test F_bench F_bbox + F_blockdetect + F_blurdetect F_ciescope F_color + F_colorchart F_colorize + F_colorspectrum F_datascope F_entropy F_graphmonitor diff --git a/cinelerra-5.1/ffmpeg/audio/alac.m4a b/cinelerra-5.1/ffmpeg/audio/alac.m4a new file mode 100644 index 00000000..e222b98d --- /dev/null +++ b/cinelerra-5.1/ffmpeg/audio/alac.m4a @@ -0,0 +1,3 @@ +ipod alac +# Apple Lossless Audio Codec +strict -2 diff --git a/cinelerra-5.1/ffmpeg/audio/alac.mkv b/cinelerra-5.1/ffmpeg/audio/alac.mkv new file mode 100644 index 00000000..b8291cc9 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/audio/alac.mkv @@ -0,0 +1,3 @@ +matroska alac +# Apple Lossless Audio Codec +strict -2 diff --git a/cinelerra-5.1/ffmpeg/audio/alac.qt b/cinelerra-5.1/ffmpeg/audio/alac.qt new file mode 100644 index 00000000..8ec0dc2d --- /dev/null +++ b/cinelerra-5.1/ffmpeg/audio/alac.qt @@ -0,0 +1,3 @@ +mov alac +# Apple Lossless Audio Codec +strict -2 diff --git a/cinelerra-5.1/ffmpeg/audio/dv.dv b/cinelerra-5.1/ffmpeg/audio/dv.dv new file mode 100644 index 00000000..43dbab9d --- /dev/null +++ b/cinelerra-5.1/ffmpeg/audio/dv.dv @@ -0,0 +1,2 @@ +dv pcm_s16le +# Only for testing raw dv stream diff --git a/cinelerra-5.1/ffmpeg/audio/dvd_pcm.dvd b/cinelerra-5.1/ffmpeg/audio/dvd_pcm.dvd new file mode 100644 index 00000000..4b202124 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/audio/dvd_pcm.dvd @@ -0,0 +1,2 @@ +dvd pcm_dvd +# works with 32, 44.1, 48 or 96Khz diff --git a/cinelerra-5.1/ffmpeg/audio/flac.webm b/cinelerra-5.1/ffmpeg/audio/flac.webm deleted file mode 100644 index 84f34f94..00000000 --- a/cinelerra-5.1/ffmpeg/audio/flac.webm +++ /dev/null @@ -1 +0,0 @@ -webm flac diff --git a/cinelerra-5.1/ffmpeg/audio/m4a.dfl b/cinelerra-5.1/ffmpeg/audio/m4a.dfl new file mode 100644 index 00000000..4dc37708 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/audio/m4a.dfl @@ -0,0 +1 @@ +alac.m4a diff --git a/cinelerra-5.1/ffmpeg/audio/mp2.dfl b/cinelerra-5.1/ffmpeg/audio/mp2.dfl new file mode 100644 index 00000000..4315a971 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/audio/mp2.dfl @@ -0,0 +1 @@ +mp2.mp2 diff --git a/cinelerra-5.1/ffmpeg/audio/mp2.mp2 b/cinelerra-5.1/ffmpeg/audio/mp2.mp2 new file mode 100644 index 00000000..8c3ee283 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/audio/mp2.mp2 @@ -0,0 +1,2 @@ +mp2 mp2 +b=384000 diff --git a/cinelerra-5.1/ffmpeg/plugin.opts b/cinelerra-5.1/ffmpeg/plugin.opts index 9b60b2c4..9fa5e12c 100644 --- a/cinelerra-5.1/ffmpeg/plugin.opts +++ b/cinelerra-5.1/ffmpeg/plugin.opts @@ -64,9 +64,10 @@ bass channels=0x1 bbox bench biquad -blackdetect blackframe #blend ###Input/output error +blackdetect +blockdetect boxblur #buffer size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1 ###Invalid argument #buffersink ###Input/output error @@ -110,7 +111,7 @@ dilation #displace drawbox drawgraph -drawgrid +drawgrid x=-1:y=-1:width=iw/3:height=ih/3:color=invert:thickness=2 #dynaudnorm ###Invalid argument earwax #ebur128 ###Operation not permitted @@ -428,3 +429,74 @@ monochrome #frei0r #frei0r_src #libvmaf +; new in 5.0 +adecorrelate +adynamicequalizer +adynamicsmooth +afwtdn +alatency +apsyclip +aspectralstats +atilt +colorspectrum +grayworld +hsvhold +hsvkey +huesaturation +latency +scharr +#azmq +#zmq +; broken in 5.0 +#anlmf ###Input/output error +#asdr ###Input/output error +#asegment ###Operation not permitted +#dnn_classify ###Invalid argument +#dnn_detect ###Invalid argument +#guided ###Operation not permitted +#limitdiff ###Operation not permitted +#morpho ###Input/output error +#overlay_vaapi ###Input/output error +#segment ###Operation not permitted +#varblur ###Input/output error +#xcorrelate ###Input/output error +; new in 5.1 +blurdetect +colorchart +pixelize +siti +tiltshelf +virtualbass +; broken in 5.1 +#avsynctest ###Input/output error +#chromakey_cuda ###Operation not permitted +#colormap ###Input/output error +#dialoguenhance ###Invalid argument +#feedback ###Input/output error +#multiply ###Input/output error +#overlay_opencl ###Input/output error +#program_opencl ###Operation not permitted +#remap_opencl ###Input/output error +#xfade_opencl ###Input_output error +#openclsrc ###invalid argument +; new in 6.1 +backgroundkey +ccrepack +zoneplate +adrc +afdelaysrc +; do not work in 6.1 +#afireqsrc ###not working with at least defaults +#apsnr ###Input/output error +#arls ###Input/output error +#asisdr ###Input/output error +#corr ###Input/output error +#ssim360 ###Input/output error +#hstack_vaapi ###Operation not permitted +#vstack_vaapi ###Operation not permitted +#xstack_vaapi ###Operation not permitted +#a3dscope ###Input/output error +#showcwt ###Input/output error +#bilateral_cuda ###Function not implemented +#bwdif_cuda ###Function not implemented +#colorspace_cuda ###Function not implemented diff --git a/cinelerra-5.1/ffmpeg/video/alias_pix.pix b/cinelerra-5.1/ffmpeg/video/alias_pix.pix new file mode 100644 index 00000000..f8588082 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/alias_pix.pix @@ -0,0 +1,3 @@ +image2 alias_pix +# this codec creates a set of image files in a directory +# use an image2 file name like /dir/b%05d.bmp diff --git a/cinelerra-5.1/ffmpeg/video/apng.apng b/cinelerra-5.1/ffmpeg/video/apng.apng new file mode 100644 index 00000000..ae539e6a --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/apng.apng @@ -0,0 +1,2 @@ +apng apng +# animated png diff --git a/cinelerra-5.1/ffmpeg/video/apng.dfl b/cinelerra-5.1/ffmpeg/video/apng.dfl new file mode 100644 index 00000000..72204a00 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/apng.dfl @@ -0,0 +1 @@ +apng.apng diff --git a/cinelerra-5.1/ffmpeg/video/av1_svt.mkv b/cinelerra-5.1/ffmpeg/video/av1_svt.mkv new file mode 100644 index 00000000..e19ae864 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/av1_svt.mkv @@ -0,0 +1,6 @@ +matroska libsvtav1 +# this codec codes less than one frame per sec +# and so even a few seconds of video can take +# a very long time to encode +# crf = 26 +# preset = 6 diff --git a/cinelerra-5.1/ffmpeg/video/av1_svt.webm b/cinelerra-5.1/ffmpeg/video/av1_svt.webm new file mode 100644 index 00000000..6784f822 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/av1_svt.webm @@ -0,0 +1,6 @@ +webm libsvtav1 +# this codec codes less than one frame per sec +# and so even a few seconds of video can take +# a very long time to encode +# crf = 26 +# preset = 6 diff --git a/cinelerra-5.1/ffmpeg/video/av1_vaapi.dfl b/cinelerra-5.1/ffmpeg/video/av1_vaapi.dfl new file mode 100644 index 00000000..c158dbd5 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/av1_vaapi.dfl @@ -0,0 +1 @@ +av1_vaapi.webm diff --git a/cinelerra-5.1/ffmpeg/video/av1_vaapi.webm b/cinelerra-5.1/ffmpeg/video/av1_vaapi.webm new file mode 100644 index 00000000..cc80552f --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/av1_vaapi.webm @@ -0,0 +1,8 @@ +webm av1_vaapi +# Nvidia 4000+ series (better nvenc/vdpau) +# AMD Radeon 7000+ series +# Intel Xe2, Arc+ series +cin_hw_dev=vaapi +g=30 +# profile=high #(main, professional) +rc_mode=QVBR diff --git a/cinelerra-5.1/ffmpeg/video/avif.avif b/cinelerra-5.1/ffmpeg/video/avif.avif new file mode 100644 index 00000000..a00fb7d2 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/avif.avif @@ -0,0 +1,2 @@ +image2 libaom-av1 +# AVIF - image format based on av1 \ No newline at end of file diff --git a/cinelerra-5.1/ffmpeg/video/avif.dfl b/cinelerra-5.1/ffmpeg/video/avif.dfl new file mode 100644 index 00000000..4390a0df --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/avif.dfl @@ -0,0 +1 @@ +avif.avif diff --git a/cinelerra-5.1/ffmpeg/video/avrp.qt b/cinelerra-5.1/ffmpeg/video/avrp.qt new file mode 100644 index 00000000..eab15916 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/avrp.qt @@ -0,0 +1,2 @@ +mov avrp +# AVID 1:1 10 bit RGB packer \ No newline at end of file diff --git a/cinelerra-5.1/ffmpeg/video/avui.qt b/cinelerra-5.1/ffmpeg/video/avui.qt new file mode 100644 index 00000000..ac295110 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/avui.qt @@ -0,0 +1,4 @@ +mov avui +strict=-2 +# AVID Meridien uncompressed +# Only 720x486 and 720x576 are supported \ No newline at end of file diff --git a/cinelerra-5.1/ffmpeg/video/ayuv.qt b/cinelerra-5.1/ffmpeg/video/ayuv.qt new file mode 100644 index 00000000..cc329b45 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/ayuv.qt @@ -0,0 +1,2 @@ +mov ayuv +# uncompressed packed MS 4:4:4:4 \ No newline at end of file diff --git a/cinelerra-5.1/ffmpeg/video/cineform.qt b/cinelerra-5.1/ffmpeg/video/cineform.qt new file mode 100644 index 00000000..c3183194 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/cineform.qt @@ -0,0 +1,3 @@ +mov cfhd +quality=medium +cin_pix_fmt=yuv422p10 diff --git a/cinelerra-5.1/ffmpeg/video/cljr.qt b/cinelerra-5.1/ffmpeg/video/cljr.qt new file mode 100644 index 00000000..ea5defbe --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/cljr.qt @@ -0,0 +1,3 @@ +mov cljr +# Cirrus Logic AccuPak + diff --git a/cinelerra-5.1/ffmpeg/video/dv.dv b/cinelerra-5.1/ffmpeg/video/dv.dv new file mode 100644 index 00000000..372edbf8 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/dv.dv @@ -0,0 +1,2 @@ +dv dvvideo +# Only for testing raw dv stream diff --git a/cinelerra-5.1/ffmpeg/video/ffvhuff.mov b/cinelerra-5.1/ffmpeg/video/ffvhuff.mov new file mode 100644 index 00000000..eb2a790b --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/ffvhuff.mov @@ -0,0 +1,2 @@ +mov ffvhuff + diff --git a/cinelerra-5.1/ffmpeg/video/flashsv1.flv b/cinelerra-5.1/ffmpeg/video/flashsv1.flv new file mode 100644 index 00000000..4e1225af --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/flashsv1.flv @@ -0,0 +1,2 @@ +flv flashsv +# flash screen video diff --git a/cinelerra-5.1/ffmpeg/video/flashsv2.flv b/cinelerra-5.1/ffmpeg/video/flashsv2.flv new file mode 100644 index 00000000..6b295168 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/flashsv2.flv @@ -0,0 +1,4 @@ +flv flashsv2 +# Flash screen video ver 2 + + diff --git a/cinelerra-5.1/ffmpeg/video/h264-rgb.mp4 b/cinelerra-5.1/ffmpeg/video/h264-rgb.mp4 new file mode 100644 index 00000000..118b277a --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/h264-rgb.mp4 @@ -0,0 +1,4 @@ +mp4 libx264rgb +qp=0 +colorspace=0 + diff --git a/cinelerra-5.1/ffmpeg/video/h264_metadata.mp4 b/cinelerra-5.1/ffmpeg/video/h264_metadata.mp4 new file mode 100644 index 00000000..ca999979 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/h264_metadata.mp4 @@ -0,0 +1,6 @@ +mp4 libx264 | h264_metadata=crop_left=20:crop_right=20 +# use framerate for 1 keyframe/sec, needed for seeks +keyint_min=25 +x264-params keyint=25 + + diff --git a/cinelerra-5.1/ffmpeg/video/h264_nvenc.qt b/cinelerra-5.1/ffmpeg/video/h264_nvenc.qt new file mode 100644 index 00000000..8044368a --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/h264_nvenc.qt @@ -0,0 +1,4 @@ +mov h264_nvenc +# encode for nvidia graphics hw only +preset medium +profile main diff --git a/cinelerra-5.1/ffmpeg/video/h264_vaapi.mkv b/cinelerra-5.1/ffmpeg/video/h264_vaapi.mkv new file mode 100644 index 00000000..8a22ef3f --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/h264_vaapi.mkv @@ -0,0 +1,4 @@ +matroska h264_vaapi +# Only works when there is vaapi capable hardware and software +cin_hw_dev=vaapi +profile=high diff --git a/cinelerra-5.1/ffmpeg/video/h264_vaapi.qt b/cinelerra-5.1/ffmpeg/video/h264_vaapi.qt new file mode 100644 index 00000000..48ff1e87 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/h264_vaapi.qt @@ -0,0 +1,3 @@ +mov h264_vaapi +cin_hw_dev=vaapi +profile=high diff --git a/cinelerra-5.1/ffmpeg/video/hdr.dfl b/cinelerra-5.1/ffmpeg/video/hdr.dfl new file mode 100644 index 00000000..f4fb418d --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/hdr.dfl @@ -0,0 +1 @@ +hdr.hdr diff --git a/cinelerra-5.1/ffmpeg/video/hdr.hdr b/cinelerra-5.1/ffmpeg/video/hdr.hdr new file mode 100644 index 00000000..747ff429 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/hdr.hdr @@ -0,0 +1,8 @@ +image2 hdr +# this codec creates a set of image files in a directory +# use an image2 file name like /dir/t%05d.tiff +# Next 3 parameters are what YouTube HDR uses +colorspace bt2020nc +color_trc smpte2084 +color_primaries bt2020 + diff --git a/cinelerra-5.1/ffmpeg/video/pfm.dfl b/cinelerra-5.1/ffmpeg/video/pfm.dfl new file mode 100644 index 00000000..1ae07ed0 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/pfm.dfl @@ -0,0 +1 @@ +pfm.pfm diff --git a/cinelerra-5.1/ffmpeg/video/pfm.pfm b/cinelerra-5.1/ffmpeg/video/pfm.pfm new file mode 100644 index 00000000..17c57e5f --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/pfm.pfm @@ -0,0 +1,3 @@ +image2 pfm +# portable floating-point image format +# for single frame only diff --git a/cinelerra-5.1/ffmpeg/video/phm.dfl b/cinelerra-5.1/ffmpeg/video/phm.dfl new file mode 100644 index 00000000..160c410f --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/phm.dfl @@ -0,0 +1 @@ +phm.phm diff --git a/cinelerra-5.1/ffmpeg/video/phm.phm b/cinelerra-5.1/ffmpeg/video/phm.phm new file mode 100644 index 00000000..cd73b1cf --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/phm.phm @@ -0,0 +1,3 @@ +image2 phm +# portable half floating-point image format +# for single frame only diff --git a/cinelerra-5.1/ffmpeg/video/prores_ks.pro b/cinelerra-5.1/ffmpeg/video/prores_ks.pro index e1f6968e..116e3cfe 100644 --- a/cinelerra-5.1/ffmpeg/video/prores_ks.pro +++ b/cinelerra-5.1/ffmpeg/video/prores_ks.pro @@ -3,6 +3,9 @@ mov prores_ks # Do not render audio as it will fail with current opts profile=3 quant_mat=auto +# Option to make players believe that +# the original Apple engine was used +vendor=apl0 # cin_pix_fmt=yuv422p10le; yuva444p10le; gbrp10le # The possible video profile values for the ProRes codec are: # 5 = 4444xq diff --git a/cinelerra-5.1/ffmpeg/video/qoi.dfl b/cinelerra-5.1/ffmpeg/video/qoi.dfl new file mode 100644 index 00000000..bd119652 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/qoi.dfl @@ -0,0 +1,2 @@ +qoi.qoi + diff --git a/cinelerra-5.1/ffmpeg/video/qoi.qoi b/cinelerra-5.1/ffmpeg/video/qoi.qoi new file mode 100644 index 00000000..3248e34d --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/qoi.qoi @@ -0,0 +1,3 @@ +image2 qoi +# quite ok image format QOI +# for single frame only diff --git a/cinelerra-5.1/ffmpeg/video/r10k.qt b/cinelerra-5.1/ffmpeg/video/r10k.qt new file mode 100644 index 00000000..5a4bec79 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/r10k.qt @@ -0,0 +1,2 @@ +mov r10k +# Blackmagic Design Kona 10 bit diff --git a/cinelerra-5.1/ffmpeg/video/rpza.qt b/cinelerra-5.1/ffmpeg/video/rpza.qt new file mode 100644 index 00000000..576d17af --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/rpza.qt @@ -0,0 +1,7 @@ +mov rpza +# mostly useful for old 160x120 videos +# this encoder requires manual tuning +skip_frame_thresh=13 +start_one_color_thresh=8 +continue_one_color_thresh=0 +sixteen_color_thresh=24 diff --git a/cinelerra-5.1/ffmpeg/video/v408.qt b/cinelerra-5.1/ffmpeg/video/v408.qt new file mode 100644 index 00000000..4c7c82a4 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/v408.qt @@ -0,0 +1,2 @@ +mov v408 +# uncompressed packed QT 4:4:4:4 diff --git a/cinelerra-5.1/ffmpeg/video/vp9.webm b/cinelerra-5.1/ffmpeg/video/vp9.webm new file mode 100644 index 00000000..3cb78eab --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/vp9.webm @@ -0,0 +1,5 @@ +webm libvpx-vp9 +# Miroslav improved VP9 webm setting and simplification +b=0 +crf=31 +row-mt=1 diff --git a/cinelerra-5.1/ffmpeg/video/wbmp.dfl b/cinelerra-5.1/ffmpeg/video/wbmp.dfl new file mode 100644 index 00000000..347e43e5 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/wbmp.dfl @@ -0,0 +1 @@ +wbmp.wbmp diff --git a/cinelerra-5.1/ffmpeg/video/wbmp.wbmp b/cinelerra-5.1/ffmpeg/video/wbmp.wbmp new file mode 100644 index 00000000..49e13493 --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/wbmp.wbmp @@ -0,0 +1,3 @@ +image2 wbmp +# this codec creates a set of image files in a directory +# use an image2 file name like /dir/t%05d.tiff diff --git a/cinelerra-5.1/ffmpeg/video/webm.dfl b/cinelerra-5.1/ffmpeg/video/webm.dfl index d546cbf9..fe34eb60 100644 --- a/cinelerra-5.1/ffmpeg/video/webm.dfl +++ b/cinelerra-5.1/ffmpeg/video/webm.dfl @@ -1 +1 @@ -webm.webm +vp9.webm diff --git a/cinelerra-5.1/ffmpeg/video/y41p.qt b/cinelerra-5.1/ffmpeg/video/y41p.qt new file mode 100644 index 00000000..c7c6f45b --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/y41p.qt @@ -0,0 +1,2 @@ +mov y41p +# Uncompressed YUV 4:1:1 12-bit diff --git a/cinelerra-5.1/ffmpeg/video/yuv4.qt b/cinelerra-5.1/ffmpeg/video/yuv4.qt new file mode 100644 index 00000000..1a0dcd2e --- /dev/null +++ b/cinelerra-5.1/ffmpeg/video/yuv4.qt @@ -0,0 +1,2 @@ +mov yuv4 +# uncompressed 4:2:0 codec diff --git a/cinelerra-5.1/guicast/Makefile b/cinelerra-5.1/guicast/Makefile index 354b40b2..49bd154c 100644 --- a/cinelerra-5.1/guicast/Makefile +++ b/cinelerra-5.1/guicast/Makefile @@ -20,6 +20,10 @@ ifeq ($(OBJDIR), armv8l) BOOTSTRAPFLAGS := -DBOOTSTRAP="\"objcopy -B arm -I binary -O elf32-littlearm\"" endif +ifeq ($(OBJDIR), armv7l) +BOOTSTRAPFLAGS := -DBOOTSTRAP="\"objcopy -B arm -I binary -O elf32-littlearm\"" +endif + ifeq ($(OBJDIR), aarch64) BOOTSTRAPFLAGS := -DBOOTSTRAP="\"objcopy -B aarch64 -I binary -O elf64-littleaarch64\"" endif @@ -111,18 +115,25 @@ OUTPUT = $(OBJDIR)/libguicast.a UTILS = $(OBJDIR)/bootstrap $(OBJDIR)/pngtoh $(OBJDIR)/pngtoraw BCXFER = xfer/$(OBJDIR)/xfer.stamp -CFLAGS += $(static_incs) +CFLAGS += $(static_incs) `pkg-config --cflags libpng` `pkg-config --cflags libjpeg` $(shell echo $(CFLAGS) > $(OBJDIR)/c_flags) $(shell echo $(OBJS) > $(OBJDIR)/objs) all: $(OUTPUT) $(UTILS) -ifeq ($(uname -s), FreeBSD) -python = $(shell find /usrlocal/bin -name python3\* | head -n 1) -else -python = `which python` +PLATFORM = $(uname -s) +ifneq ($(PLATFORM), FreeBSD) +python = $(shell find /usr/local/bin -name python3\* | head -n 1) +endif +ifneq ($(PLATFORM), Linux) +python = $(shell which python) endif +ifeq ($(python),) +python += $(shell which python3.9) +endif + + $(BCXFER): bccmdl.py bcxfer.C bcxfer.h $(python) < ./bccmdl.py +$(MAKE) -C xfer diff --git a/cinelerra-5.1/guicast/arraylist.h b/cinelerra-5.1/guicast/arraylist.h index 2fade202..02a8aef8 100644 --- a/cinelerra-5.1/guicast/arraylist.h +++ b/cinelerra-5.1/guicast/arraylist.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + #ifndef ARRAYLIST_H #define ARRAYLIST_H #include diff --git a/cinelerra-5.1/guicast/bccmodels.C b/cinelerra-5.1/guicast/bccmodels.C index 38c2c4b0..60e80b50 100644 --- a/cinelerra-5.1/guicast/bccmodels.C +++ b/cinelerra-5.1/guicast/bccmodels.C @@ -1,16 +1,16 @@ /* - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published + * 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 library is distributed in the hope that it will be useful, but + * 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 - * Lesser General Public License for more details. + * General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software + * 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 */ diff --git a/cinelerra-5.1/guicast/bccmodels.h b/cinelerra-5.1/guicast/bccmodels.h index 30dd1902..87af95ee 100644 --- a/cinelerra-5.1/guicast/bccmodels.h +++ b/cinelerra-5.1/guicast/bccmodels.h @@ -1,16 +1,16 @@ /* - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published + * 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 library is distributed in the hope that it will be useful, but + * 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 - * Lesser General Public License for more details. + * General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software + * 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 */ diff --git a/cinelerra-5.1/guicast/bccmodels.inc b/cinelerra-5.1/guicast/bccmodels.inc index f7d0106f..7462b526 100644 --- a/cinelerra-5.1/guicast/bccmodels.inc +++ b/cinelerra-5.1/guicast/bccmodels.inc @@ -1,3 +1,21 @@ +/* + * 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 + */ + + #ifndef BCCMODELS_INC #define BCCMODELS_INC diff --git a/cinelerra-5.1/guicast/bcdragbox.C b/cinelerra-5.1/guicast/bcdragbox.C index 10a39d96..298828d4 100644 --- a/cinelerra-5.1/guicast/bcdragbox.C +++ b/cinelerra-5.1/guicast/bcdragbox.C @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2020 William Morrow + * + * 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 + */ + + #include "bcdragbox.h" #include "bcmenuitem.h" #include "bctimer.h" diff --git a/cinelerra-5.1/guicast/bcdragbox.h b/cinelerra-5.1/guicast/bcdragbox.h index 4ecb9264..bce776ec 100644 --- a/cinelerra-5.1/guicast/bcdragbox.h +++ b/cinelerra-5.1/guicast/bcdragbox.h @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2020 William Morrow + * + * 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 + */ + + #ifndef __BC_DRAGRECT_H__ #define __BC_DRAGRECT_H__ diff --git a/cinelerra-5.1/guicast/bcdragbox.inc b/cinelerra-5.1/guicast/bcdragbox.inc index ae232b7d..2579b526 100644 --- a/cinelerra-5.1/guicast/bcdragbox.inc +++ b/cinelerra-5.1/guicast/bcdragbox.inc @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2020 William Morrow + * + * 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 + */ + + #ifndef __BC_DRAGRECT_INC__ #define __BC_DRAGRECT_INC__ diff --git a/cinelerra-5.1/guicast/bckeyboard.h b/cinelerra-5.1/guicast/bckeyboard.h index 5399ed4c..cb947dd3 100644 --- a/cinelerra-5.1/guicast/bckeyboard.h +++ b/cinelerra-5.1/guicast/bckeyboard.h @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2007-2020 William Morrow + * + * 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 + */ + + #ifndef _BC_KEYBOARD_H_ #define _BC_KEYBOARD_H_ diff --git a/cinelerra-5.1/guicast/bctheme.C b/cinelerra-5.1/guicast/bctheme.C index 1ec64c7f..9addf9f7 100644 --- a/cinelerra-5.1/guicast/bctheme.C +++ b/cinelerra-5.1/guicast/bctheme.C @@ -455,7 +455,10 @@ void BC_Theme::overlay(VFrame *dst, VFrame *src, int in_x1, int in_x2, int shift void BC_Theme::set_data(unsigned char *ptr) { - int hdr_sz = *(int*)ptr - sizeof(int); + //int hdr_sz = *(int*)ptr - sizeof(int); + int hdr_sz = 0; + memcpy(&hdr_sz, ptr, sizeof(int)); + hdr_sz -= sizeof(int); unsigned char *cp = ptr + sizeof(int); unsigned char *dp = cp + hdr_sz; int start_item = images.size(); diff --git a/cinelerra-5.1/guicast/bctrace.C b/cinelerra-5.1/guicast/bctrace.C index 2d08b46b..84cd48f5 100644 --- a/cinelerra-5.1/guicast/bctrace.C +++ b/cinelerra-5.1/guicast/bctrace.C @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + + #include #include #include diff --git a/cinelerra-5.1/guicast/bctrace.h b/cinelerra-5.1/guicast/bctrace.h index 2c2046b5..b2c4c359 100644 --- a/cinelerra-5.1/guicast/bctrace.h +++ b/cinelerra-5.1/guicast/bctrace.h @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + + #ifndef __BC_TRACE_H__ #define __BC_TRACE_H__ diff --git a/cinelerra-5.1/guicast/bctrace.inc b/cinelerra-5.1/guicast/bctrace.inc index b43bfbe7..e6f74631 100644 --- a/cinelerra-5.1/guicast/bctrace.inc +++ b/cinelerra-5.1/guicast/bctrace.inc @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + + #ifndef __BCTRACE_INC__ #define __BCTRACE_INC__ diff --git a/cinelerra-5.1/guicast/bcxfer.C b/cinelerra-5.1/guicast/bcxfer.C index 8eb6533b..19aa7694 100644 --- a/cinelerra-5.1/guicast/bcxfer.C +++ b/cinelerra-5.1/guicast/bcxfer.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + void BC_Xfer::init( uint8_t **output_rows, int out_colormodel, int out_x, int out_y, int out_w, int out_h, diff --git a/cinelerra-5.1/guicast/bcxfer.h b/cinelerra-5.1/guicast/bcxfer.h index d743956f..0ac9efcd 100644 --- a/cinelerra-5.1/guicast/bcxfer.h +++ b/cinelerra-5.1/guicast/bcxfer.h @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + + #include "bccmodels.h" #include "bcresources.h" #include "condition.h" diff --git a/cinelerra-5.1/guicast/cstrdup.h b/cinelerra-5.1/guicast/cstrdup.h index db95285e..2ab7b2ab 100644 --- a/cinelerra-5.1/guicast/cstrdup.h +++ b/cinelerra-5.1/guicast/cstrdup.h @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2007-2020 William Morrow + * + * 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 + */ + + #ifndef __CSTRDUP_H__ #define __CSTRDUP_H__ diff --git a/cinelerra-5.1/guicast/debug.h b/cinelerra-5.1/guicast/debug.h index f0a1215a..f7879afd 100644 --- a/cinelerra-5.1/guicast/debug.h +++ b/cinelerra-5.1/guicast/debug.h @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2007-2020 William Morrow + * + * 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 + */ + + #ifndef DEBUG_H #define DEBUG_H diff --git a/cinelerra-5.1/guicast/filesystem.h b/cinelerra-5.1/guicast/filesystem.h index b6cece2d..90885554 100644 --- a/cinelerra-5.1/guicast/filesystem.h +++ b/cinelerra-5.1/guicast/filesystem.h @@ -26,7 +26,7 @@ #include "bcwindowbase.inc" #include "sizes.h" -#if defined (__FreeBSD__) +#if defined (__FreeBSD__) || (__NetBSD__) #define dirent64 dirent #define readdir64 readdir #endif diff --git a/cinelerra-5.1/guicast/linklist.h b/cinelerra-5.1/guicast/linklist.h index b424a2ac..cacceae6 100644 --- a/cinelerra-5.1/guicast/linklist.h +++ b/cinelerra-5.1/guicast/linklist.h @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + + #ifndef LINKLIST_H #define LINKLIST_H diff --git a/cinelerra-5.1/guicast/pngtoh.c b/cinelerra-5.1/guicast/pngtoh.c index f683e558..693da8f6 100644 --- a/cinelerra-5.1/guicast/pngtoh.c +++ b/cinelerra-5.1/guicast/pngtoh.c @@ -1,15 +1,15 @@ /* * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published + * 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 - * Lesser General Public License for more details. + * General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public + * 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 diff --git a/cinelerra-5.1/guicast/test4.C b/cinelerra-5.1/guicast/test4.C index de94fad8..f2b17dcf 100644 --- a/cinelerra-5.1/guicast/test4.C +++ b/cinelerra-5.1/guicast/test4.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2015-2020 William Morrow + * + * 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 + */ + //c++ -g -I../guicast test4.C ../guicast/x86_64/libguicast.a \ // -DHAVE_GL -DHAVE_XFT -I/usr/include/freetype2 -lGL -lX11 -lXext \ diff --git a/cinelerra-5.1/guicast/test5.C b/cinelerra-5.1/guicast/test5.C index 81fa6dd5..95724e42 100644 --- a/cinelerra-5.1/guicast/test5.C +++ b/cinelerra-5.1/guicast/test5.C @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2017-2020 William Morrow + * + * 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 + */ + + #include #include #include "bccolors.C" diff --git a/cinelerra-5.1/guicast/test6.C b/cinelerra-5.1/guicast/test6.C index 4ac6baea..df3c9059 100644 --- a/cinelerra-5.1/guicast/test6.C +++ b/cinelerra-5.1/guicast/test6.C @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2020 William Morrow + * + * 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 + */ + + #include #include #include diff --git a/cinelerra-5.1/guicast/test9.C b/cinelerra-5.1/guicast/test9.C index a777d7f2..c344b9d0 100644 --- a/cinelerra-5.1/guicast/test9.C +++ b/cinelerra-5.1/guicast/test9.C @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2018-2020 William Morrow + * + * 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 + */ + + #include "bcsignals.h" #include "guicast.h" #include "pys_icon_png.h" diff --git a/cinelerra-5.1/guicast/vicon.C b/cinelerra-5.1/guicast/vicon.C index c0d9dfa3..e0b4d1b8 100644 --- a/cinelerra-5.1/guicast/vicon.C +++ b/cinelerra-5.1/guicast/vicon.C @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + + #include "vicon.h" #include "bctimer.h" diff --git a/cinelerra-5.1/guicast/vicon.h b/cinelerra-5.1/guicast/vicon.h index acd11e38..86474095 100644 --- a/cinelerra-5.1/guicast/vicon.h +++ b/cinelerra-5.1/guicast/vicon.h @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + + #ifndef __VICON_H__ #define __VICON_H__ diff --git a/cinelerra-5.1/guicast/vicon.inc b/cinelerra-5.1/guicast/vicon.inc index 21a59a10..0c3e4e15 100644 --- a/cinelerra-5.1/guicast/vicon.inc +++ b/cinelerra-5.1/guicast/vicon.inc @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2016-2020 William Morrow + * + * 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 + */ + + #ifndef __VICON_INC__ #define __VICON_INC__ diff --git a/cinelerra-5.1/info/plugins.txt b/cinelerra-5.1/info/plugins.txt index b6c5f087..daf71caf 100644 --- a/cinelerra-5.1/info/plugins.txt +++ b/cinelerra-5.1/info/plugins.txt @@ -124,6 +124,9 @@ Live Video: Reads video directly from the capture card input and replaces any video on the track. Loop video: Loop video by specifying the length of the region to loop. +Mirror: Mirror horizontal or vertical with the ability to + swap left to right or top to bottom. And if enable + reflection center checked, can vary X/Y centering. Mandelbrot: Render a Mandelbrot fractal using Cuda. Motion: Tracks translation and rotation motion to stabilize shaky video. @@ -258,6 +261,7 @@ F_addroi: Mark a region of interest in a video frame. F_amplify: Amplify changes between successive video frames. F_atadenoise: Apply an Adaptive Temporal Averaging Denoiser. F_avgblur: Apply average blur filter. +F_backgroundkey: Turns a static background into transparency. F_bbox: Compute bounding box for each frame. F_bench: Benchmarks part of a filtergraph. F_bilateral: Apply bilateral filter, spatial smoothing while @@ -265,22 +269,29 @@ F_bilateral: Apply bilateral filter, spatial smoothing while F_bitplanenoise: Measure bit plane noise. F_blackdetect: Detect video intervals that are (almost) black. F_blackframe: Detect frames that are (almost) black. +F_blockdetect: Determines blockiness of frames without altering the + input frames. +F_blurdetect: Determines blurriness of frames without altering the + input frames. F_boxblur: Blurs the input video. Through the settings you are able to change the power and the radius of the boxblur applied to luma, chroma and alpha. F_bwdif: Deinterlaces the input image. F_cas: Apply Contrast Adaptive Sharpen filter to video. +F_ccrepack: Repack CEA-708 closed caption metadata. F_cellauto: Create pattern generated by an elementart cellular automaton. F_chromahold: Turns a certain color range into gray. F_chromakey: Turns a certain color into transparency. Operates on YUV colors. +F_chromakey_cuda: CUDA accelerated YUV colorspace color/chroma keying. F_chromanr: Reduce chrominance noise. F_chromashift: Shift chroma. F_ciescope: Video CIE scope. F_color: Provide a uniformly colored input. F_colorbalance: Adjusts the color balance. F_colorchannelmixer: Adjusts colors by mixing color channels. +F_colorchart: The colorchart source provides a colors checker chart. F_colorcontrast: Adjust color contrast between RGB components. F_colorcorrect: Adjust color white balance selectivity for blacks and whites. @@ -290,6 +301,7 @@ F_colorlevels: Adjusts the color levels. F_colormatrix: Converts color matrix. F_colorize: Overlay a solid color on the video stream. F_colorspace: Converts color space/range. +F_colorspectrum: Provides a color spectrum input. F_colortemperature: Adjust color temperature of video. F_cover_rect: Find and cover a user specified object. F_crop: Crops the input video. @@ -352,6 +364,8 @@ F_gblur: Apply Gaussian Blur filter. F_gradfun: Debands video quickly using gradients. F_gradients: Draws a transparent gradient. F_graphmonitor: Show various filtergraph stats. +F_grayworld: A color constancy filter that applies color + correction based on the grayworld assumption. F_greyedge: Estimates scene illumination by grey edge assumption. F_haldclutsrc: Provide an identity Hald CLUT. @@ -361,7 +375,11 @@ F_histogram: Computes and draws a histogram. F_hqdn3d: Applies a High Quality 3D Denoiser. F_hqx: Scales the input by 2, 3 or 4 using the hq*x magnification algorithm. +F_hsvhold: Turns a certain HSV range into gray values. +F_hsvkey: Turns a certain HSV range into transparency. F_hue: Adjust the hue and saturation of the input video. +F_huesaturation: Apply hue-saturation-intensity adjustments + to input video stream. F_idet: Interlace detect Filter. F_il: Deinterleaves or interleaves fields. F_inflate: Applies inflate effect. @@ -369,6 +387,7 @@ F_interlace: Convert progressive video into interlaced. F_kerndeint: Applies kernel deinterlacing to the input. F_kirsch: Apply kirsch operator. F_lagfun: Slowly update darker pixels. +F_latency: Measure filtering latency. F_lenscorrection: Rectifies the image by correcting for lens distortion. F_life: Generate a life pattern. F_limiter: Limit pixels components to the specified range. @@ -411,6 +430,7 @@ F_perspective: Corrects the perspective of video. F_phase: Phase shift fields. F_photosensitivity: Filter out photosensitive epilepsy seizure-inducing flashes. +F_pixelize: Apply pixelization to video stream. F_pixscope: Pixel data analysis for checking color and levels. It will display sample values of color channels. F_pp: Filters video using libpostproc. @@ -438,6 +458,7 @@ F_scale: Scale the input video size and/or convert the image format. F_scale_cuda: GPU accelerated video resizer. F_scdet: Detect video scene change. +F_scharr: Apply scharr operator to input video stream. F_scroll: Scroll input video horizontally and/or vertically by constant speed. F_selectivecolor: Apply cmyk adjustments to specific color ranges. @@ -454,6 +475,10 @@ F_shuffleplanes: Shuffles video planes. F_sierpinski: Generate a Sierpinski carpet/triangle fractal, and randomly pan around. F_signalstats: Separates statistics from video analysis. +F_siti: Calculate Spatial Info (SI) and Temporal Info (TI) scores + for a video, as defined in ITU-T P.910: + Subjective video quality assessment methods for + multimedia applications. F_smartblur: Blurs the input video without impacting the outlines. Through the settings you can select the radius, the strength and the threshold of luma and chroma. @@ -504,6 +529,7 @@ F_yadif_cuda: Deinterlace CUDA frames. F_yaepblur: Yet another edge preserving blur filter. F_yuvtestsrc: Generate YUV test pattern. F_zoompan: Applies Zoom & Pan effect. +F_zoneplate: Generate zone-plate. # # Description of FFmpeg Audio Plugins # @@ -513,21 +539,30 @@ F_acontrast: Simple audio dynamic range compression/expansion filter. F_acrusher: Reduces audio bit resolution. F_acue: Delay filtering to match a cue. +F_adecorrelate: Apply decorrelation to input audio stream. F_adelay: Delays one or more audio channels. F_adenorm: Remedy denormals by adding extremely low-level noise. F_aderivative: Compute derivative of input audio. +F_adynamicequalizer: Apply dynamic equalization to input + audio stream. +F_adrc: Audio spectral dynamic range controller. +F_adynamicsmooth: Apply dynamic smoothing to input audio stream. F_aecho: Adds echoing to the audio. F_aemphasis: Audio emphasis. F_aeval: Filters audio signal according to specific expression. F_aexciter: Enhance high frequency part of audio. F_afade: Fades in/out input audio. +F_afdelaysrc: Generate a fractional delay FIR coefficients. F_aformat: Convert the input audio to the specified format. F_afreqshift: Apply frequency shifting to input audio. +F_afwtdn: Reduce broadband noise from input samples using + Wavelets. F_agate: Audio gate. F_aiir: Apply infinite Impulse Response filter with supplied coefficients. F_aintegral: Compute integral of input audio. +F_alatency: Measure filtering latency. F_allpass: Applies a two-pole all-pass filter. F_aloop: Loops audio samples. F_ametadata: Manipulate audio frame metadata. @@ -537,12 +572,18 @@ F_anoisesrc: Generates a noise audio signal. F_aperms: Set permissions for the output audio frame. F_aphaser: Adds a phasing effect to the audio. F_aphaseshift: Apply phase shifting to input audio. +F_apsyclip: Apply Psychoacoustic clipper to input audio + stream. F_arealtime: Slows down filtering to match realtime. F_aresample: Resamples audio data. F_asetrate: Change the sample rate without altering the data. F_asoftclip: Apply audio soft clipping - a type of distortion effect where signal amplitude is saturated along a smooth curve. +F_aspectralstats:Display frequency domain statistical + information about the audio channels. + Statistics are calculated and stored as metadata + for each audio channel and for each audio frame. F_astats: Shows time domain statistics about audio frames. F_asubboost: Boost subwoofer frequencies. F_asubcut: Cut subwoofer frequencies. @@ -550,6 +591,7 @@ F_asupercut: Cut super frequencies. F_asuperpass: Apply high order Butterworth band-pass filter. F_asuperstop: Apply high order Butterworth band-stop filter. F_atempo: Adjusts audio tempo. +F_atilt: Apply spectral tilt filter to audio stream. F_atrim: Pick one continuous section from the input and drop the rest. F_bandpass: Applies a two-pole Butterworth band-pass filter. @@ -616,9 +658,15 @@ F_stereowiden: Applies stereo widening effect. When using this and then right mouse clicking all subsequent audio tracks bringing up a menu. Highlight the effect shown in the middle section and click OK. +F_tiltshelf: Boost or cut the lower frequencies and cut or boost + higher frequencies of the audio using a two-pole + shelving filter with a response similar to that of + a standard hi-fi’s tone-controls. + This is also known as shelving equalisation (EQ). F_treble: Boosts or cuts upper frequencies. F_tremolo: Applies tremolo effect. F_vibrato: Applies vibrato effect. +F_virtualbass: Apply audio Virtual Bass filter. F_volume: Change input volume. F_volumedetect: Detect audio volume. # @@ -678,6 +726,8 @@ L_Crossover distortion: Simulation of the distortion that happens in class Compressor: Lessen the dynamic range between the loudest and quietest parts of an audio signal by boosting the quieter signals and attenuating the louder signals. +Compressor Multi: Compressor that acts on 3 distinct frequency bands + instead of the entire singe sprectrum. DC Offset: Remove DC Offset, which is usually an undesirable characteristic of a recording normally caused by defective equipment. (Has no controls) diff --git a/cinelerra-5.1/libbthread-master/.gitignore b/cinelerra-5.1/libbthread-master/.gitignore new file mode 100644 index 00000000..9afa025d --- /dev/null +++ b/cinelerra-5.1/libbthread-master/.gitignore @@ -0,0 +1,19 @@ +/Makefile.in +/aclocal.m4 +/autom4te.cache/ +/config.* +/configure +/depcomp +/install-sh +/libtool +/ltmain.sh +/m4/ +/missing +/stamp-h? +.deps/ +.dirstamp +.libs/ +*.l[ao] +*~ +/compile +*.o diff --git a/cinelerra-5.1/libbthread-master/LICENSE b/cinelerra-5.1/libbthread-master/LICENSE new file mode 100644 index 00000000..8000a6fa --- /dev/null +++ b/cinelerra-5.1/libbthread-master/LICENSE @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random + Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/cinelerra-5.1/libbthread-master/Makefile b/cinelerra-5.1/libbthread-master/Makefile new file mode 100644 index 00000000..af3276b5 --- /dev/null +++ b/cinelerra-5.1/libbthread-master/Makefile @@ -0,0 +1,18 @@ +PLATFORM = $(uname -o) +ifneq ($(PLATFORM),Android) +all: +# +# mv pt-test.c pt-test +# cat `ls *.c` > just-pt.c + $(CXX) -c -o jpt.o just-pt.cc -I. + ar crs jpt.a jpt.o +clean: + rm -f *.a *.o +install: + +else +all: +install: +clean: + +endif diff --git a/cinelerra-5.1/libbthread-master/Makefile.am b/cinelerra-5.1/libbthread-master/Makefile.am new file mode 100644 index 00000000..41724def --- /dev/null +++ b/cinelerra-5.1/libbthread-master/Makefile.am @@ -0,0 +1,23 @@ +# Copyright (C) 2002 Free Software Foundation, Inc. +# This file is part of the GNU C Library. +# +# The GNU C Library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# The GNU C Library 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 +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with the GNU C Library; see the file COPYING.LIB. If not, +# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +lib_LTLIBRARIES = libbthread.la +libbthread_la_SOURCES = pt-cancel.c pt-docancel.c pt-init.c pt-setcancelstate.c pt-setcanceltype.c pt-testcancel.c pt-internal.h +include_HEADERS = bthread.h +check_PROGRAMS = bthread-test +bthread_test_SOURCES = pt-test.c diff --git a/cinelerra-5.1/libbthread-master/README.md b/cinelerra-5.1/libbthread-master/README.md new file mode 100644 index 00000000..2b001045 --- /dev/null +++ b/cinelerra-5.1/libbthread-master/README.md @@ -0,0 +1,41 @@ +libbthread +========== + +library that provide some missing posix threading function to the bionic libc. + +while i was porting tens of linux projects under the dSploit android app i found that +the bionic libc does not provide some POSIX thread functions like `pthread_cancel`, `pthread_testcancel` and so on. + +so, i developed this library, which exploit some unused bits in the bionic thread structure. + +there is many thing to develop, like support for deferred cancels, but basic thread cancellation works :smiley: + +i hope that you find this library useful :wink: + +-- tux_mind + +License +========== + +Project is licensed under GNU LGPL v2.0 (Library General Public License) + +pt-internal.h - is from The Android Open Source Project and licensed under Apache License, Version 2.0 + +building +======== + +```bash +$ autoreconf -i +$ export PATH="$PATH:/path/to/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin" +$ target_host=aarch64-linux-android +$ export AR=${target_host}-ar +$ export AS=${target_host}-as +$ export CC=${target_host}21-clang +$ export CXX=${target_host}21-clang++ +$ export LD=${target_host}-ld +$ export STRIP=${target_host}-strip +$ export CFLAGS="-fPIE -fPIC" +$ export LDFLAGS="-pie" +$ ./configure --host=${target_host} +$ make +``` diff --git a/cinelerra-5.1/libbthread-master/bthread.h b/cinelerra-5.1/libbthread-master/bthread.h new file mode 100644 index 00000000..57a0c492 --- /dev/null +++ b/cinelerra-5.1/libbthread-master/bthread.h @@ -0,0 +1,31 @@ +/* BThread main header + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +# define PTHREAD_CANCEL_ENABLE 0x00000010 +# define PTHREAD_CANCEL_DISABLE 0x00000000 + +# define PTHREAD_CANCEL_ASYNCHRONOUS 0x00000020 +# define PTHREAD_CANCEL_DEFERRED 0x00000000 + +#define PTHREAD_CANCELED ((void *) -1) + +int pthread_setcancelstate (int , int *); +int pthread_setcanceltype (int , int *); +void pthread_testcancel (void); +int pthread_cancel (pthread_t t); diff --git a/cinelerra-5.1/libbthread-master/configure.ac b/cinelerra-5.1/libbthread-master/configure.ac new file mode 100644 index 00000000..a8b16c41 --- /dev/null +++ b/cinelerra-5.1/libbthread-master/configure.ac @@ -0,0 +1,38 @@ +# Copyright (C) 2002 Free Software Foundation, Inc. +# This file is part of the GNU C Library. +# +# The GNU C Library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# The GNU C Library 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 +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with the GNU C Library; see the file COPYING.LIB. If not, +# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +AC_PREREQ([2.69]) +AC_INIT([libbthread], [0.2], []) +AC_CONFIG_SRCDIR([pt-cancel.c]) +AC_CONFIG_HEADERS([config.h]) +AM_INIT_AUTOMAKE([foreign]) + +LT_INIT + +# Checks for programs. +AC_PROG_CC + +# Checks for header files. +AC_CHECK_HEADERS([stdlib.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_TYPE_PID_T + +AC_CONFIG_FILES([Makefile]) + +AC_OUTPUT diff --git a/cinelerra-5.1/libbthread-master/just-pt.cc b/cinelerra-5.1/libbthread-master/just-pt.cc new file mode 100644 index 00000000..3b388558 --- /dev/null +++ b/cinelerra-5.1/libbthread-master/just-pt.cc @@ -0,0 +1,216 @@ +/* Cancel a thread. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ +#include +#if defined(__TERMUX__) + +#include + +#include + +#include + +int +pthread_cancel (pthread_t t) +{ + int err = 0; + struct pthread_internal_t *p = (struct pthread_internal_t*) t; + + pthread_init(); + + pthread_mutex_lock (&p->cancel_lock); + if (p->attr.flags & PTHREAD_ATTR_FLAG_CANCEL_PENDING) + { + pthread_mutex_unlock (&p->cancel_lock); + return 0; + } + + p->attr.flags |= PTHREAD_ATTR_FLAG_CANCEL_PENDING; + + if (!(p->attr.flags & PTHREAD_ATTR_FLAG_CANCEL_ENABLE)) + { + pthread_mutex_unlock (&p->cancel_lock); + return 0; + } + + if (p->attr.flags & PTHREAD_ATTR_FLAG_CANCEL_ASYNCRONOUS) { + pthread_mutex_unlock (&p->cancel_lock); + err = __pthread_do_cancel (p); + } else { + // DEFERRED CANCEL NOT IMPLEMENTED YET + pthread_mutex_unlock (&p->cancel_lock); + } + + return err; +} +/* Cancel a thread. */ + +#include + +#include + +static void +call_exit (void) +{ + pthread_exit (0); +} + +int +__pthread_do_cancel (struct pthread_internal_t *p) +{ + + if(p == (struct pthread_internal_t *)pthread_self()) + call_exit (); + else if(p->attr.flags & PTHREAD_ATTR_FLAG_CANCEL_HANDLER) + pthread_kill((pthread_t)p, SIGRTMIN); + else + pthread_kill((pthread_t)p, SIGTERM); + + return 0; +} +/* Init a thread. */ + +#include +#include +#include +#include + +void pthread_cancel_handler(int signum) { + pthread_exit(0); +} + +void pthread_init(void) { + struct sigaction sa; + struct pthread_internal_t * p = (struct pthread_internal_t *)pthread_self(); + + if(p->attr.flags & PTHREAD_ATTR_FLAG_CANCEL_HANDLER) + return; + + // set thread status as pthread_create should do. + // ASYNCROUNOUS is not set, see pthread_setcancelstate(3) + p->attr.flags |= PTHREAD_ATTR_FLAG_CANCEL_HANDLER|PTHREAD_ATTR_FLAG_CANCEL_ENABLE; + + sa.sa_handler = pthread_cancel_handler; + sigemptyset(&(sa.sa_mask)); + sa.sa_flags = 0; + + sigaction(SIGRTMIN, &sa, NULL); +} +/* Set the cancel state for the calling thread. */ + +#include +#include +#include +#include + +int +pthread_setcancelstate (int state, int *oldstate) +{ + struct pthread_internal_t *p = (struct pthread_internal_t*)pthread_self(); + int newflags; + + pthread_init(); + + switch (state) + { + default: + return EINVAL; + case PTHREAD_CANCEL_ENABLE: + case PTHREAD_CANCEL_DISABLE: + break; + } + + pthread_mutex_lock (&p->cancel_lock); + if (oldstate) + *oldstate = p->attr.flags & PTHREAD_ATTR_FLAG_CANCEL_ENABLE; + + if(state == PTHREAD_ATTR_FLAG_CANCEL_ENABLE) + p->attr.flags |= PTHREAD_ATTR_FLAG_CANCEL_ENABLE; + else + p->attr.flags &= ~PTHREAD_ATTR_FLAG_CANCEL_ENABLE; + newflags=p->attr.flags; + pthread_mutex_unlock (&p->cancel_lock); + + if((newflags & PTHREAD_ATTR_FLAG_CANCEL_PENDING) && (newflags & PTHREAD_ATTR_FLAG_CANCEL_ENABLE) && (newflags & PTHREAD_ATTR_FLAG_CANCEL_ASYNCRONOUS)) + __pthread_do_cancel(p); + + return 0; +} +/* */ + +#include +#include +#include +#include + +int +pthread_setcanceltype (int type, int *oldtype) +{ + struct pthread_internal_t *p = (struct pthread_internal_t*)pthread_self(); + int newflags; + + pthread_init(); + + switch (type) + { + default: + return EINVAL; + case PTHREAD_CANCEL_DEFERRED: + case PTHREAD_CANCEL_ASYNCHRONOUS: + break; + } + + pthread_mutex_lock (&p->cancel_lock); + if (oldtype) + *oldtype = p->attr.flags & PTHREAD_ATTR_FLAG_CANCEL_ASYNCRONOUS; + + if(type == PTHREAD_CANCEL_ASYNCHRONOUS) + p->attr.flags |= PTHREAD_ATTR_FLAG_CANCEL_ASYNCRONOUS; + else + p->attr.flags &= ~PTHREAD_ATTR_FLAG_CANCEL_ASYNCRONOUS; + newflags=p->attr.flags; + pthread_mutex_unlock (&p->cancel_lock); + + if((newflags & PTHREAD_ATTR_FLAG_CANCEL_PENDING) && (newflags & PTHREAD_ATTR_FLAG_CANCEL_ENABLE) && (newflags & PTHREAD_ATTR_FLAG_CANCEL_ASYNCRONOUS)) + __pthread_do_cancel(p); + + return 0; +} +/* Add an explicit cancelation point. */ + +#include +#include +#include + +void +pthread_testcancel (void) +{ + struct pthread_internal_t *p = (struct pthread_internal_t*)pthread_self(); + int cancelled; + + pthread_init(); + + pthread_mutex_lock (&p->cancel_lock); + cancelled = (p->attr.flags & PTHREAD_ATTR_FLAG_CANCEL_ENABLE) && (p->attr.flags & PTHREAD_ATTR_FLAG_CANCEL_PENDING); + pthread_mutex_unlock (&p->cancel_lock); + + if (cancelled) + pthread_exit (PTHREAD_CANCELED); + +} +#endif diff --git a/cinelerra-5.1/libbthread-master/pt-cancel.c b/cinelerra-5.1/libbthread-master/pt-cancel.c new file mode 100644 index 00000000..7683662d --- /dev/null +++ b/cinelerra-5.1/libbthread-master/pt-cancel.c @@ -0,0 +1,58 @@ +/* Cancel a thread. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#include + +#include + +int +pthread_cancel (pthread_t t) +{ + int err = 0; + struct pthread_internal_t *p = (struct pthread_internal_t*) t; + + pthread_init(); + + pthread_mutex_lock (&p->cancel_lock); + if (p->attr.flags & PTHREAD_ATTR_FLAG_CANCEL_PENDING) + { + pthread_mutex_unlock (&p->cancel_lock); + return 0; + } + + p->attr.flags |= PTHREAD_ATTR_FLAG_CANCEL_PENDING; + + if (!(p->attr.flags & PTHREAD_ATTR_FLAG_CANCEL_ENABLE)) + { + pthread_mutex_unlock (&p->cancel_lock); + return 0; + } + + if (p->attr.flags & PTHREAD_ATTR_FLAG_CANCEL_ASYNCRONOUS) { + pthread_mutex_unlock (&p->cancel_lock); + err = __pthread_do_cancel (p); + } else { + // DEFERRED CANCEL NOT IMPLEMENTED YET + pthread_mutex_unlock (&p->cancel_lock); + } + + return err; +} diff --git a/cinelerra-5.1/libbthread-master/pt-docancel.c b/cinelerra-5.1/libbthread-master/pt-docancel.c new file mode 100644 index 00000000..d6a74df7 --- /dev/null +++ b/cinelerra-5.1/libbthread-master/pt-docancel.c @@ -0,0 +1,42 @@ +/* Cancel a thread. + Copyright (C) 2002, 2007, 2008 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include + +#include + +static void +call_exit (void) +{ + pthread_exit (0); +} + +int +__pthread_do_cancel (struct pthread_internal_t *p) +{ + + if(p == (struct pthread_internal_t *)pthread_self()) + call_exit (); + else if(p->attr.flags & PTHREAD_ATTR_FLAG_CANCEL_HANDLER) + pthread_kill((pthread_t)p, SIGRTMIN); + else + pthread_kill((pthread_t)p, SIGTERM); + + return 0; +} diff --git a/cinelerra-5.1/libbthread-master/pt-init.c b/cinelerra-5.1/libbthread-master/pt-init.c new file mode 100644 index 00000000..7579da62 --- /dev/null +++ b/cinelerra-5.1/libbthread-master/pt-init.c @@ -0,0 +1,45 @@ +/* Init a thread. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include + +void pthread_cancel_handler(int signum) { + pthread_exit(0); +} + +void pthread_init(void) { + struct sigaction sa; + struct pthread_internal_t * p = (struct pthread_internal_t *)pthread_self(); + + if(p->attr.flags & PTHREAD_ATTR_FLAG_CANCEL_HANDLER) + return; + + // set thread status as pthread_create should do. + // ASYNCROUNOUS is not set, see pthread_setcancelstate(3) + p->attr.flags |= PTHREAD_ATTR_FLAG_CANCEL_HANDLER|PTHREAD_ATTR_FLAG_CANCEL_ENABLE; + + sa.sa_handler = pthread_cancel_handler; + sigemptyset(&(sa.sa_mask)); + sa.sa_flags = 0; + + sigaction(SIGRTMIN, &sa, NULL); +} diff --git a/cinelerra-5.1/libbthread-master/pt-internal.h b/cinelerra-5.1/libbthread-master/pt-internal.h new file mode 100644 index 00000000..19f3f1cb --- /dev/null +++ b/cinelerra-5.1/libbthread-master/pt-internal.h @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _PTHREAD_INTERNAL_H_ +#define _PTHREAD_INTERNAL_H_ + +#include + +struct pthread_internal_t { + struct pthread_internal_t* next; + struct pthread_internal_t* prev; + + pid_t tid; + + void** tls; + + volatile pthread_attr_t attr; + + __pthread_cleanup_t* cleanup_stack; + + void* (*start_routine)(void*); + void* start_routine_arg; + void* return_value; + + void* alternate_signal_stack; + + /* + * The dynamic linker implements dlerror(3), which makes it hard for us to implement this + * per-thread buffer by simply using malloc(3) and free(3). + */ +#define __BIONIC_DLERROR_BUFFER_SIZE 508 + char dlerror_buffer[__BIONIC_DLERROR_BUFFER_SIZE]; + + // ugly hack: use last 4 bytes of dlerror_buffer as cancel_lock + pthread_mutex_t cancel_lock; +}; + +/* Has the thread a cancellation request? */ +#define PTHREAD_ATTR_FLAG_CANCEL_PENDING 0x00000008 + +/* Has the thread enabled cancellation? */ +#define PTHREAD_ATTR_FLAG_CANCEL_ENABLE 0x00000010 + +/* Has the thread asyncronous cancellation? */ +#define PTHREAD_ATTR_FLAG_CANCEL_ASYNCRONOUS 0x00000020 + +/* Has the thread a cancellation handler? */ +#define PTHREAD_ATTR_FLAG_CANCEL_HANDLER 0x00000040 + +struct pthread_internal_t *__pthread_getid ( pthread_t ); + +int __pthread_do_cancel (struct pthread_internal_t *); + +void pthread_init(void); + +#endif /* _PTHREAD_INTERNAL_H_ */ diff --git a/cinelerra-5.1/libbthread-master/pt-setcancelstate.c b/cinelerra-5.1/libbthread-master/pt-setcancelstate.c new file mode 100644 index 00000000..ecc0d65b --- /dev/null +++ b/cinelerra-5.1/libbthread-master/pt-setcancelstate.c @@ -0,0 +1,57 @@ +/* Set the cancel state for the calling thread. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include + +int +pthread_setcancelstate (int state, int *oldstate) +{ + struct pthread_internal_t *p = (struct pthread_internal_t*)pthread_self(); + int newflags; + + pthread_init(); + + switch (state) + { + default: + return EINVAL; + case PTHREAD_CANCEL_ENABLE: + case PTHREAD_CANCEL_DISABLE: + break; + } + + pthread_mutex_lock (&p->cancel_lock); + if (oldstate) + *oldstate = p->attr.flags & PTHREAD_ATTR_FLAG_CANCEL_ENABLE; + + if(state == PTHREAD_ATTR_FLAG_CANCEL_ENABLE) + p->attr.flags |= PTHREAD_ATTR_FLAG_CANCEL_ENABLE; + else + p->attr.flags &= ~PTHREAD_ATTR_FLAG_CANCEL_ENABLE; + newflags=p->attr.flags; + pthread_mutex_unlock (&p->cancel_lock); + + if((newflags & PTHREAD_ATTR_FLAG_CANCEL_PENDING) && (newflags & PTHREAD_ATTR_FLAG_CANCEL_ENABLE) && (newflags & PTHREAD_ATTR_FLAG_CANCEL_ASYNCRONOUS)) + __pthread_do_cancel(p); + + return 0; +} diff --git a/cinelerra-5.1/libbthread-master/pt-setcanceltype.c b/cinelerra-5.1/libbthread-master/pt-setcanceltype.c new file mode 100644 index 00000000..1b8cda1a --- /dev/null +++ b/cinelerra-5.1/libbthread-master/pt-setcanceltype.c @@ -0,0 +1,57 @@ +/* Set the cancel type for the calling thread. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include + +int +pthread_setcanceltype (int type, int *oldtype) +{ + struct pthread_internal_t *p = (struct pthread_internal_t*)pthread_self(); + int newflags; + + pthread_init(); + + switch (type) + { + default: + return EINVAL; + case PTHREAD_CANCEL_DEFERRED: + case PTHREAD_CANCEL_ASYNCHRONOUS: + break; + } + + pthread_mutex_lock (&p->cancel_lock); + if (oldtype) + *oldtype = p->attr.flags & PTHREAD_ATTR_FLAG_CANCEL_ASYNCRONOUS; + + if(type == PTHREAD_CANCEL_ASYNCHRONOUS) + p->attr.flags |= PTHREAD_ATTR_FLAG_CANCEL_ASYNCRONOUS; + else + p->attr.flags &= ~PTHREAD_ATTR_FLAG_CANCEL_ASYNCRONOUS; + newflags=p->attr.flags; + pthread_mutex_unlock (&p->cancel_lock); + + if((newflags & PTHREAD_ATTR_FLAG_CANCEL_PENDING) && (newflags & PTHREAD_ATTR_FLAG_CANCEL_ENABLE) && (newflags & PTHREAD_ATTR_FLAG_CANCEL_ASYNCRONOUS)) + __pthread_do_cancel(p); + + return 0; +} diff --git a/cinelerra-5.1/libbthread-master/pt-testcancel.c b/cinelerra-5.1/libbthread-master/pt-testcancel.c new file mode 100644 index 00000000..9d5dbdf3 --- /dev/null +++ b/cinelerra-5.1/libbthread-master/pt-testcancel.c @@ -0,0 +1,39 @@ +/* Add an explicit cancelation point. + Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include +#include + +void +pthread_testcancel (void) +{ + struct pthread_internal_t *p = (struct pthread_internal_t*)pthread_self(); + int cancelled; + + pthread_init(); + + pthread_mutex_lock (&p->cancel_lock); + cancelled = (p->attr.flags & PTHREAD_ATTR_FLAG_CANCEL_ENABLE) && (p->attr.flags & PTHREAD_ATTR_FLAG_CANCEL_PENDING); + pthread_mutex_unlock (&p->cancel_lock); + + if (cancelled) + pthread_exit (PTHREAD_CANCELED); + +} diff --git a/cinelerra-5.1/libzmpeg3/Makefile b/cinelerra-5.1/libzmpeg3/Makefile index 7e96761f..d854fa97 100644 --- a/cinelerra-5.1/libzmpeg3/Makefile +++ b/cinelerra-5.1/libzmpeg3/Makefile @@ -83,7 +83,7 @@ ifeq ($(WANT_CIN_3RDPARTY),no) LIBS += -la52 endif ifeq ($(shell uname -o), Android) -LIBS += jpt.a +LIBS += ../libbthread-master/jpt.a endif LIBS += $(lib_a52dec) $(lib_djbfft) $(lib_libbthread) diff --git a/cinelerra-5.1/mpeg2enc/Makefile b/cinelerra-5.1/mpeg2enc/Makefile index ceac3cec..f517e52f 100644 --- a/cinelerra-5.1/mpeg2enc/Makefile +++ b/cinelerra-5.1/mpeg2enc/Makefile @@ -60,7 +60,7 @@ ifeq ($(WANT_CIN_3RDPARTY),no) LIBS += -la52 endif ifeq ($(shell uname -o), Android) -LIBS += jpt.a +LIBS += ../libbthread-master/jpt.a endif HVEG2LIB = $(OBJDIR)/hveg2enc.a diff --git a/cinelerra-5.1/mpeg2enc/TODO b/cinelerra-5.1/mpeg2enc/TODO deleted file mode 100644 index acd4fad1..00000000 --- a/cinelerra-5.1/mpeg2enc/TODO +++ /dev/null @@ -1,10 +0,0 @@ -TODO -==== - - - update vbv_delay calculation to agree with November 1994 - (WG11 approved IS draft of ISO/IEC 13818-2). - - - allow intra only encoding of sequences (disable ipflag in - putseq.c) - - diff --git a/cinelerra-5.1/mpeg2enc/mpeg2enc.c b/cinelerra-5.1/mpeg2enc/mpeg2enc.c index af76232d..04f237be 100644 --- a/cinelerra-5.1/mpeg2enc/mpeg2enc.c +++ b/cinelerra-5.1/mpeg2enc/mpeg2enc.c @@ -33,6 +33,7 @@ #include #include #include +#include #define GLOBAL_ /* used by global.h */ #include "config.h" diff --git a/cinelerra-5.1/mplexlo/Makefile b/cinelerra-5.1/mplexlo/Makefile index 66126523..068c4981 100644 --- a/cinelerra-5.1/mplexlo/Makefile +++ b/cinelerra-5.1/mplexlo/Makefile @@ -17,7 +17,7 @@ ifeq ($(WANT_CIN_3RDPARTY),no) LIBS += -la52 endif ifeq ($(shell uname -o), Android) -LIBS += jpt.a +LIBS += ../libbthread-master/jpt.a endif OUTPUT := $(OBJDIR)/mplexlo diff --git a/cinelerra-5.1/msg/txt b/cinelerra-5.1/msg/txt index b4fdd4d3..48577fb9 100644 --- a/cinelerra-5.1/msg/txt +++ b/cinelerra-5.1/msg/txt @@ -3,19 +3,59 @@ For usage help, refer to the following: https://cinelerra-gg.org/download/CinelerraGG_Manual.pdf http://g-raffa.eu/Cinelerra/HOWTO/basics.html . -2022 April changes of note: +2024 January changes of note: + X265 library has been updated to snapshot of 17-12-2023. + Libsndfile is now at version 1.2.2. + Libaom is updated to 3.8.0 but does not work on older O/S. + The Resources window info/details now shows sar/dar values. + Libsvtav1 is a buildable option for newer distros. + Histogram/Videoscpe now allow for greater than 1 values. +2023 November changes of note: + New build farm for Ubuntu, Debian, Suse, and Fedora at: + https://github.com/einhander/cin-gg-packages/releases + FFmpeg has been upgraded to 6.1. + Libvpx has been upgraded to 1.13.1. + Tiff has been upgraded to 4.6.0. +2023 September changes of note: + Libwebp has been upgraded to 1.3.2. + Alternative shortcuts (more Standard) AppImage available. +2023 August changes of note: + Mirror new video plugin has been added. + Copyright messages now include GG team & earlier CV team. +2023 June changes of note: + Capability to create DVDs with BFF interlace added. +2023 April changes of note: + X264 has been upgraded to r3106 stable release. +2023 March changes of note: + Flac has been upgraded to 1.4.2 + Tiff has been upgraded to 4.5.0 + Libjpeg-turbo upgraded to 2.1.5.1 + Libvpx is now upgraded to 1.13.0 +2023 February changes of note: + GPL headers have been added to essentially all program + files with contributor attribution for CV or known author. +2023 January changes of note: + New shell script added to delete background render files + that exist on /tmp named brenderX. + Speed up for rendering VP9 4K/8K videos on computers with + more than 16 cpu-s has been applied. +. +2022 New Features of note: + FFmpeg has been upgraded to 5.1 from 4.4. DPX image reader added to easily load a list file of DPX images. - Bluray lpcm and tsmuxer audio options added + chapter intervals. -2022 March changes of note: A new script, bld_appimage.sh, includes rework of linuxdeploy in order to create appimages for aarch64 and armhf + x86_64/i686. - Context Help for the Shuttle has been improved for reliability. - New lossless render format for vp9 was added. + Speed up using direct copy for EXR and PPM sequences. + Updated libraries include: + Flac to 1.3.2, Tiff to 4.4.0, Libaom upgraded to 3.4.0, + Libvpx to 1.12.0, OpenJPEG to 2.5.0, libogg, and fftw. BSD compiled CinGG for version 13.0 and 12.3 is available. -2022 February changes of note: - Updated libraries: libvpx, libogg, tiff, and fftw to current. -2022 January changes of note: - This month has only had minor changes and fixes added. + New script, vaapi_proxy.sh, speeds up vaapi proxy creation. + Bluray lpcm and tsmuxer audio options added + chapter intervals. + Context Help for the Shuttle has been improved for reliability. + New render formats - h264-rgb.mp4 fixes problem in OBS 28, + vp9.webm, ALAC-Apple Lossless audio, and VP9 lossless. +. 2021 New Features of note: Context Help has been added using hotkey alt/h by Georgy. The help page will come up in your web browser tab for the item diff --git a/cinelerra-5.1/opencv_build b/cinelerra-5.1/opencv_build index 7be18228..bc3feb19 100644 --- a/cinelerra-5.1/opencv_build +++ b/cinelerra-5.1/opencv_build @@ -80,6 +80,10 @@ $(opencv)/build: $(opencv).src -DWITH_IPP=OFF \ -DWITH_LAPACK=OFF \ -DWITH_GPHOTO2=OFF \ + -DWITH_JASPER=OFF \ + -DWITH_FFMPEG=OFF \ + -DWITH_GSTREAMER=OFF \ + -DWITH_ANDROID_MEDIANDK=OFF \ -DBUILD_SHARED_LIBS=OFF \ -DINSTALL_C_EXAMPLES=OFF \ -DINSTALL_PYTHON_EXAMPLES=OFF \ @@ -88,6 +92,7 @@ $(opencv)/build: $(opencv).src -DBUILD_TESTS=OFF \ -DBUILD_opencv_apps=OFF \ -DBUILD_opencv_python3=no \ + -DBUILD_LIST="calib3d,core,features2d,imgproc,objdetect,photo,video,xfeatures2d,ximgproc,videostab" \ -DCMAKE_INSTALL_PREFIX=/usr/local \ -DOPENCV_EXTRA_MODULES_PATH="$(opencv)_contrib/modules/" @@ -105,6 +110,10 @@ $(opencv)/build: $(opencv).src -DWITH_IPP=OFF \ -DWITH_LAPACK=OFF \ -DWITH_GPHOTO2=OFF \ + -DWITH_JASPER=OFF \ + -DWITH_FFMPEG=OFF \ + -DWITH_GSTREAMER=OFF \ + -DWITH_ANDROID_MEDIANDK=OFF \ -DBUILD_SHARED_LIBS=ON \ -DINSTALL_C_EXAMPLES=ON \ -DINSTALL_PYTHON_EXAMPLES=ON \ diff --git a/cinelerra-5.1/picon/cinfinity/mirror.png b/cinelerra-5.1/picon/cinfinity/mirror.png new file mode 100644 index 00000000..33812e4c Binary files /dev/null and b/cinelerra-5.1/picon/cinfinity/mirror.png differ diff --git a/cinelerra-5.1/picon/cinfinity2/mirror.png b/cinelerra-5.1/picon/cinfinity2/mirror.png new file mode 100644 index 00000000..a22884ac Binary files /dev/null and b/cinelerra-5.1/picon/cinfinity2/mirror.png differ diff --git a/cinelerra-5.1/plugin_defs b/cinelerra-5.1/plugin_defs index 9f7d5396..cb3c700a 100644 --- a/cinelerra-5.1/plugin_defs +++ b/cinelerra-5.1/plugin_defs @@ -76,6 +76,7 @@ video := \ liveaudio \ livevideo \ loopvideo \ + mirror \ motion \ motion2 \ motion51 \ diff --git a/cinelerra-5.1/plugins/C41/c41.h b/cinelerra-5.1/plugins/C41/c41.h index 391f2f17..393648f7 100644 --- a/cinelerra-5.1/plugins/C41/c41.h +++ b/cinelerra-5.1/plugins/C41/c41.h @@ -1,3 +1,22 @@ +/* + * C41 plugin for Cinelerra + * Copyright (C) 2011 Florent Delannoy + * + * 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 + * + */ #ifndef __C41_H__ #define __C41_H__ diff --git a/cinelerra-5.1/plugins/Makefile b/cinelerra-5.1/plugins/Makefile index 227faf80..22aaf433 100644 --- a/cinelerra-5.1/plugins/Makefile +++ b/cinelerra-5.1/plugins/Makefile @@ -98,6 +98,7 @@ DIRS = $(OPENCV_OBJS) \ $(LIVEDVB) \ loopaudio \ loopvideo \ + mirror \ motion \ motion51 \ motion2point \ @@ -170,9 +171,13 @@ DIRS = $(OPENCV_OBJS) \ theme_unflat \ theme_cakewalk \ -PLATFORM = $(shell uname -o) -ifneq ($(PLATFORM), FreeBSD) -DIRS += cdripper theme_blond theme_blue +PLATFORM = $(shell uname) +ifeq ($(PLATFORM), NetBSD) +DIRS += theme_blond theme_blue +else ifeq ($(PLATFORM), FreeBSD) +DIRS += theme_blond theme_blue +else ifeq ($(PLATFORM), Linux) +DIRS += cdripper theme_blond theme_blue endif # not maintained diff --git a/cinelerra-5.1/plugins/cdripper/cdripper.C b/cinelerra-5.1/plugins/cdripper/cdripper.C index f1244466..fcdfbfc4 100644 --- a/cinelerra-5.1/plugins/cdripper/cdripper.C +++ b/cinelerra-5.1/plugins/cdripper/cdripper.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/deinterlace-cv/deinterlace-cv.C b/cinelerra-5.1/plugins/deinterlace-cv/deinterlace-cv.C index 4429d86b..74d5699d 100644 --- a/cinelerra-5.1/plugins/deinterlace-cv/deinterlace-cv.C +++ b/cinelerra-5.1/plugins/deinterlace-cv/deinterlace-cv.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/deinterlace-cv/deinterlace-cv.h b/cinelerra-5.1/plugins/deinterlace-cv/deinterlace-cv.h index 8265a3b0..bd059265 100644 --- a/cinelerra-5.1/plugins/deinterlace-cv/deinterlace-cv.h +++ b/cinelerra-5.1/plugins/deinterlace-cv/deinterlace-cv.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/deinterlace-cv/deinterwindow-cv.C b/cinelerra-5.1/plugins/deinterlace-cv/deinterwindow-cv.C index bd090e47..c73fc47f 100644 --- a/cinelerra-5.1/plugins/deinterlace-cv/deinterwindow-cv.C +++ b/cinelerra-5.1/plugins/deinterlace-cv/deinterwindow-cv.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/deinterlace-cv/deinterwindow-cv.h b/cinelerra-5.1/plugins/deinterlace-cv/deinterwindow-cv.h index a5e2262e..c98b835a 100644 --- a/cinelerra-5.1/plugins/deinterlace-cv/deinterwindow-cv.h +++ b/cinelerra-5.1/plugins/deinterlace-cv/deinterwindow-cv.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/delayaudio/delayaudio.C b/cinelerra-5.1/plugins/delayaudio/delayaudio.C index 22c32f62..9396db81 100644 --- a/cinelerra-5.1/plugins/delayaudio/delayaudio.C +++ b/cinelerra-5.1/plugins/delayaudio/delayaudio.C @@ -136,8 +136,7 @@ void DelayAudio::reconfigure() if(buffer) { - int size = MIN(new_allocation, allocation); - + int size = new_allocation; memcpy(new_buffer->get_data(), buffer->get_data(), (size - PluginClient::in_buffer_size) * sizeof(double)); @@ -154,7 +153,8 @@ int DelayAudio::process_realtime(int64_t size, Samples *input_ptr, Samples *outp { load_configuration(); - if(need_reconfigure) reconfigure(); +// if(need_reconfigure) reconfigure(); + reconfigure(); // printf("DelayAudio::process_realtime %d %d\n", // input_start, size); diff --git a/cinelerra-5.1/plugins/denoiseseltempavg/seltempavg.C b/cinelerra-5.1/plugins/denoiseseltempavg/seltempavg.C index 7cd86503..0e9248ff 100644 --- a/cinelerra-5.1/plugins/denoiseseltempavg/seltempavg.C +++ b/cinelerra-5.1/plugins/denoiseseltempavg/seltempavg.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/denoisevideo/denoisevideo.C b/cinelerra-5.1/plugins/denoisevideo/denoisevideo.C index bdcc5558..c6757171 100644 --- a/cinelerra-5.1/plugins/denoisevideo/denoisevideo.C +++ b/cinelerra-5.1/plugins/denoisevideo/denoisevideo.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/descratch/descratch.C b/cinelerra-5.1/plugins/descratch/descratch.C index 027c560d..11a8c6b8 100644 --- a/cinelerra-5.1/plugins/descratch/descratch.C +++ b/cinelerra-5.1/plugins/descratch/descratch.C @@ -7,7 +7,7 @@ bag@hotmail.ru http://avisynth.org.ru This program is FREE software under GPL licence v2. This plugin removes vertical scratches from digitized films. -Reworked for cin5 by GG. 03/2018, from the laws of Fizick's +Reworked for cin5 by William Morrow. 03/2018, from the laws of Fizick's Adapted strategy to mark, test, draw during port. */ diff --git a/cinelerra-5.1/plugins/descratch/descratch.h b/cinelerra-5.1/plugins/descratch/descratch.h index 841899f5..f032d34b 100644 --- a/cinelerra-5.1/plugins/descratch/descratch.h +++ b/cinelerra-5.1/plugins/descratch/descratch.h @@ -1,3 +1,17 @@ +/* +DeScratch - Scratches Removing Filter +Plugin for Avisynth 2.5 +Copyright (c)2003-2016 Alexander G. Balakhnin aka Fizick +bag@hotmail.ru http://avisynth.org.ru + +This program is FREE software under GPL licence v2. + +This plugin removes vertical scratches from digitized films. +Reworked for cin5 by William Morrow. 03/2018, from the laws of Fizick's +Adapted strategy to mark, test, draw during port. +*/ + + #ifndef __DESCRATCH_H__ #define __DESCRATCH_H__ diff --git a/cinelerra-5.1/plugins/flip/flip.C b/cinelerra-5.1/plugins/flip/flip.C index 30317b26..8c98a4c3 100644 --- a/cinelerra-5.1/plugins/flip/flip.C +++ b/cinelerra-5.1/plugins/flip/flip.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/freezeframe/freezeframe.C b/cinelerra-5.1/plugins/freezeframe/freezeframe.C index 5d8bfe83..7ac15373 100644 --- a/cinelerra-5.1/plugins/freezeframe/freezeframe.C +++ b/cinelerra-5.1/plugins/freezeframe/freezeframe.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 1997-2012 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/gain/gain.C b/cinelerra-5.1/plugins/gain/gain.C index b9b9947f..74016559 100644 --- a/cinelerra-5.1/plugins/gain/gain.C +++ b/cinelerra-5.1/plugins/gain/gain.C @@ -34,10 +34,15 @@ #include -REGISTER_PLUGIN(Gain) +REGISTER_PLUGIN(GainMain) GainConfig::GainConfig() +{ + reset(); +} + +void GainConfig::reset() { level = 0.0; } @@ -71,25 +76,25 @@ void GainConfig::interpolate(GainConfig &prev, -Gain::Gain(PluginServer *server) +GainMain::GainMain(PluginServer *server) : PluginAClient(server) { } -Gain::~Gain() +GainMain::~GainMain() { } -const char* Gain::plugin_title() { return N_("Gain"); } -int Gain::is_realtime() { return 1; } +const char* GainMain::plugin_title() { return N_("Gain"); } +int GainMain::is_realtime() { return 1; } -NEW_WINDOW_MACRO(Gain, GainWindow) -LOAD_CONFIGURATION_MACRO(Gain, GainConfig) +NEW_WINDOW_MACRO(GainMain, GainWindow) +LOAD_CONFIGURATION_MACRO(GainMain, GainConfig) -int Gain::process_realtime(int64_t size, Samples *input_ptr, Samples *output_ptr) +int GainMain::process_realtime(int64_t size, Samples *input_ptr, Samples *output_ptr) { load_configuration(); @@ -108,7 +113,7 @@ int Gain::process_realtime(int64_t size, Samples *input_ptr, Samples *output_ptr -void Gain::save_data(KeyFrame *keyframe) +void GainMain::save_data(KeyFrame *keyframe) { FileXML output; @@ -124,7 +129,7 @@ void Gain::save_data(KeyFrame *keyframe) output.terminate_string(); } -void Gain::read_data(KeyFrame *keyframe) +void GainMain::read_data(KeyFrame *keyframe) { FileXML input; // cause xml file to read directly from text @@ -142,13 +147,14 @@ void Gain::read_data(KeyFrame *keyframe) } } -void Gain::update_gui() +void GainMain::update_gui() { if(thread) { load_configuration(); thread->window->lock_window(); - ((GainWindow*)thread->window)->level->update(config.level); + ((GainWindow*)thread->window)->level_text->update((float)config.level); + ((GainWindow*)thread->window)->level_slider->update(config.level); thread->window->unlock_window(); } } diff --git a/cinelerra-5.1/plugins/gain/gain.h b/cinelerra-5.1/plugins/gain/gain.h index b2a86e03..614d125a 100644 --- a/cinelerra-5.1/plugins/gain/gain.h +++ b/cinelerra-5.1/plugins/gain/gain.h @@ -22,7 +22,7 @@ #ifndef GAIN_H #define GAIN_H -class Gain; +class GainMain; class GainEngine; #include "gainwindow.h" @@ -32,6 +32,7 @@ class GainConfig { public: GainConfig(); + void reset(); int equivalent(GainConfig &that); void copy_from(GainConfig &that); void interpolate(GainConfig &prev, @@ -43,11 +44,11 @@ public: double level; }; -class Gain : public PluginAClient +class GainMain : public PluginAClient { public: - Gain(PluginServer *server); - ~Gain(); + GainMain(PluginServer *server); + ~GainMain(); int process_realtime(int64_t size, Samples *input_ptr, Samples *output_ptr); diff --git a/cinelerra-5.1/plugins/gain/gainwindow.C b/cinelerra-5.1/plugins/gain/gainwindow.C index c61f985a..6b62ccbb 100644 --- a/cinelerra-5.1/plugins/gain/gainwindow.C +++ b/cinelerra-5.1/plugins/gain/gainwindow.C @@ -23,6 +23,7 @@ #include "bchash.h" #include "filesystem.h" #include "gainwindow.h" +#include "theme.h" #include "language.h" #include @@ -33,15 +34,15 @@ -GainWindow::GainWindow(Gain *gain) - : PluginClientWindow(gain, - xS(230), +GainWindow::GainWindow(GainMain *plugin) + : PluginClientWindow(plugin, + xS(420), yS(60), - xS(230), + xS(420), yS(60), 0) { - this->gain = gain; + this->plugin = plugin; } GainWindow::~GainWindow() @@ -51,37 +52,92 @@ GainWindow::~GainWindow() void GainWindow::create_objects() { int xs10 = xS(10); - int ys10 = yS(10), ys20 = yS(20); + int ys10 = yS(10); int x = xs10, y = ys10; - add_tool(new BC_Title(5, y, _("Level:"))); - y += ys20; - add_tool(level = new GainLevel(gain, x, y)); + int x2 = xS(80), x3 = xS(180); + int clr_x = get_w()-x - xS(22); // note: clrBtn_w = 22 + + y += ys10; + add_tool(new BC_Title(x, y, _("Level:"))); + level_text = new GainLevelText(this, plugin, (x + x2), y); + level_text->create_objects(); + add_tool(level_slider = new GainLevelSlider(this, plugin, x3, y)); + clr_x = x3 + level_slider->get_w() + x; + add_subwindow(level_clr = new GainLevelClr(this, plugin, clr_x, y)); show_window(); flush(); } +void GainWindow::update() +{ + float level = plugin->config.level; + level_text->update(level); + level_slider->update(level); +} + + + +GainLevelText::GainLevelText(GainWindow *window, GainMain *plugin, int x, int y) + : BC_TumbleTextBox(window, plugin->config.level, + (float)INFINITYGAIN, (float)GAINLEVEL_MAX, x, y, xS(60), 2) +{ + this->window = window; + this->plugin = plugin; + set_increment(0.1); +} +GainLevelText::~GainLevelText() +{ +} +int GainLevelText::handle_event() +{ + float min = INFINITYGAIN, max = GAINLEVEL_MAX; + float output = atof(get_text()); + + if(output > max) output = max; + else if(output < min) output = min; + plugin->config.level = output; + window->update(); + plugin->send_configure_change(); + return 1; +} +GainLevelSlider::GainLevelSlider(GainWindow *window, GainMain *plugin, int x, int y) + : BC_FSlider(x, y, 0, xS(200), yS(200), INFINITYGAIN, GAINLEVEL_MAX, plugin->config.level) +{ + this->window = window; + this->plugin = plugin; + enable_show_value(0); // Hide caption +} +GainLevelSlider::~GainLevelSlider() +{ +} +int GainLevelSlider::handle_event() +{ + plugin->config.level = get_value(); + window->level_text->update((float)plugin->config.level); + plugin->send_configure_change(); + return 1; +} + -GainLevel::GainLevel(Gain *gain, int x, int y) - : BC_FSlider(x, - y, - 0, - xS(200), - yS(200), - INFINITYGAIN, - 40, - gain->config.level) +GainLevelClr::GainLevelClr(GainWindow *window, GainMain *plugin, int x, int y) + : BC_Button(x, y, plugin->get_theme()->get_image_set("reset_button")) +{ + this->window = window; + this->plugin = plugin; +} +GainLevelClr::~GainLevelClr() { - this->gain = gain; } -int GainLevel::handle_event() +int GainLevelClr::handle_event() { - gain->config.level = get_value(); - gain->send_configure_change(); + plugin->config.reset(); + window->update(); + plugin->send_configure_change(); return 1; } diff --git a/cinelerra-5.1/plugins/gain/gainwindow.h b/cinelerra-5.1/plugins/gain/gainwindow.h index 603c9d36..b773ecc7 100644 --- a/cinelerra-5.1/plugins/gain/gainwindow.h +++ b/cinelerra-5.1/plugins/gain/gainwindow.h @@ -23,9 +23,13 @@ #define GAINWINDOW_H #define TOTAL_LOADS 5 +#define GAINLEVEL_MAX 40 class GainThread; class GainWindow; +class GainLevelText; +class GainLevelSlider; +class GainLevelClr; #include "filexml.h" #include "gain.h" @@ -35,26 +39,52 @@ class GainWindow; -class GainLevel; - class GainWindow : public PluginClientWindow { public: - GainWindow(Gain *gain); + GainWindow(GainMain *plugin); ~GainWindow(); void create_objects(); + void update(); + + GainMain *plugin; + GainLevelText *level_text; + GainLevelSlider *level_slider; + GainLevelClr *level_clr; +}; + +class GainLevelText : public BC_TumbleTextBox +{ +public: + GainLevelText(GainWindow *window, GainMain *plugin, int x, int y); + ~GainLevelText(); + int handle_event(); - Gain *gain; - GainLevel *level; + GainWindow *window; + GainMain *plugin; }; -class GainLevel : public BC_FSlider +class GainLevelSlider : public BC_FSlider { public: - GainLevel(Gain *gain, int x, int y); + GainLevelSlider(GainWindow *window, GainMain *plugin, int x, int y); + ~GainLevelSlider(); int handle_event(); - Gain *gain; + + GainWindow *window; + GainMain *plugin; +}; + +class GainLevelClr : public BC_Button +{ +public: + GainLevelClr(GainWindow *window, GainMain *plugin, int x, int y); + ~GainLevelClr(); + int handle_event(); + + GainWindow *window; + GainMain *plugin; }; diff --git a/cinelerra-5.1/plugins/histeq/histeq.C b/cinelerra-5.1/plugins/histeq/histeq.C index 8148f116..770b98e7 100644 --- a/cinelerra-5.1/plugins/histeq/histeq.C +++ b/cinelerra-5.1/plugins/histeq/histeq.C @@ -1,7 +1,7 @@ /* * CINELERRA - * Copyright (C) 2008-2012 Adam Williams + * Copyright (C) 2020 William Morrow * * 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 diff --git a/cinelerra-5.1/plugins/histeq/histeq.h b/cinelerra-5.1/plugins/histeq/histeq.h index f8da0169..ef478220 100644 --- a/cinelerra-5.1/plugins/histeq/histeq.h +++ b/cinelerra-5.1/plugins/histeq/histeq.h @@ -1,7 +1,6 @@ - /* * CINELERRA - * Copyright (C) 1997-2011 Adam Williams + * Copyright (C) 2020 William Morrow * * 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 diff --git a/cinelerra-5.1/plugins/histeq/histeq.inc b/cinelerra-5.1/plugins/histeq/histeq.inc index ae7ae3c3..92aaa673 100644 --- a/cinelerra-5.1/plugins/histeq/histeq.inc +++ b/cinelerra-5.1/plugins/histeq/histeq.inc @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2020 William Morrow + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser 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 + */ + + #ifndef __HISTEQ_H__ #define __HISTEQ_H__ diff --git a/cinelerra-5.1/plugins/histogram/histogram.C b/cinelerra-5.1/plugins/histogram/histogram.C index c78c3c7c..4b55f429 100644 --- a/cinelerra-5.1/plugins/histogram/histogram.C +++ b/cinelerra-5.1/plugins/histogram/histogram.C @@ -234,7 +234,7 @@ float HistogramMain::calculate_level(float input, int mode, int use_value) if( !EQUIV(config.gamma[mode], 0) ) { output = pow(output, 1.0 / config.gamma[mode]); - CLAMP(output, 0, 1.0); + CLAMP(output, 0, 100.0); } // Apply value curve diff --git a/cinelerra-5.1/plugins/loopvideo/loopvideo.C b/cinelerra-5.1/plugins/loopvideo/loopvideo.C index d6cfdad8..57116932 100644 --- a/cinelerra-5.1/plugins/loopvideo/loopvideo.C +++ b/cinelerra-5.1/plugins/loopvideo/loopvideo.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/mirror/Makefile b/cinelerra-5.1/plugins/mirror/Makefile new file mode 100644 index 00000000..1df0b5be --- /dev/null +++ b/cinelerra-5.1/plugins/mirror/Makefile @@ -0,0 +1,11 @@ +include ../../plugin_defs + +OBJS = $(OBJDIR)/mirror.o \ + $(OBJDIR)/mirrorwindow.o + +PLUGIN = mirror + +include ../../plugin_config + +$(OBJDIR)/mirror.o: mirror.C +$(OBJDIR)/mirror.o: mirrorwindow.C diff --git a/cinelerra-5.1/plugins/mirror/mirror.C b/cinelerra-5.1/plugins/mirror/mirror.C new file mode 100644 index 00000000..847e587a --- /dev/null +++ b/cinelerra-5.1/plugins/mirror/mirror.C @@ -0,0 +1,644 @@ + +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + +/* + * 2023. Derivative by Flip plugin. +*/ + +#include "clip.h" +#include "bccmodels.h" +#include "bchash.h" +#include "filexml.h" +#include "mirror.h" +#include "mirrorwindow.h" +#include "language.h" +#include "mwindow.h" + +#include +#include +#include + +REGISTER_PLUGIN(MirrorMain) + + + + + + +MirrorConfig::MirrorConfig() +{ + reset(RESET_DEFAULT_SETTINGS); +} + +void MirrorConfig::reset(int clear) +{ + switch(clear) { + case RESET_REFLECTION_CENTER_X : + reflection_center_x = 50.00; + mirror_horizontal = 1; + mirror_swaphorizontal = 0; + break; + case RESET_REFLECTION_CENTER_Y : + reflection_center_y = 50.00; + mirror_vertical = 1; + mirror_swapvertical = 0; + break; + case RESET_ALL : + case RESET_DEFAULT_SETTINGS : + default: + mirror_horizontal = 1; + mirror_swaphorizontal = 0; + mirror_vertical = 0; + mirror_swapvertical = 0; + reflection_center_enable = 0; + reflection_center_x = 50.00; + reflection_center_y = 50.00; + break; + } +} + +void MirrorConfig::copy_from(MirrorConfig &that) +{ + mirror_horizontal = that.mirror_horizontal; + mirror_swaphorizontal = that.mirror_swaphorizontal; + mirror_vertical = that.mirror_vertical; + mirror_swapvertical = that.mirror_swapvertical; + reflection_center_enable = that.reflection_center_enable; + reflection_center_x = that.reflection_center_x; + reflection_center_y = that.reflection_center_y; +} + +int MirrorConfig::equivalent(MirrorConfig &that) +{ + return EQUIV(mirror_horizontal, that.mirror_horizontal) && + EQUIV(mirror_swaphorizontal, that.mirror_swaphorizontal) && + EQUIV(mirror_vertical, that.mirror_vertical) && + EQUIV(mirror_swapvertical, that.mirror_swapvertical) && + EQUIV(reflection_center_enable, that.reflection_center_enable) && + EQUIV(reflection_center_x, that.reflection_center_x) && + EQUIV(reflection_center_y, that.reflection_center_y); +} + +void MirrorConfig::interpolate(MirrorConfig &prev, + MirrorConfig &next, + int64_t prev_frame, + int64_t next_frame, + int64_t current_frame) +{ + double next_scale = (double)(current_frame - prev_frame) / (next_frame - prev_frame); + double prev_scale = (double)(next_frame - current_frame) / (next_frame - prev_frame); + + this->mirror_horizontal = prev.mirror_horizontal; + this->mirror_swaphorizontal = prev.mirror_swaphorizontal; + this->mirror_vertical = prev.mirror_vertical; + this->mirror_swapvertical = prev.mirror_swapvertical; + this->reflection_center_enable = prev.reflection_center_enable; + this->reflection_center_x = prev.reflection_center_x * prev_scale + next.reflection_center_x * next_scale; + this->reflection_center_y = prev.reflection_center_y * prev_scale + next.reflection_center_y * next_scale; +} + + + + + + + + + + +MirrorMain::MirrorMain(PluginServer *server) + : PluginVClient(server) +{ + +} + +MirrorMain::~MirrorMain() +{ + +} + +const char* MirrorMain::plugin_title() { return N_("Mirror"); } +int MirrorMain::is_realtime() { return 1; } + + +#define SWAPCOPY_PIXELS(components, in, out) \ +{ \ + in[0] = out[0]; \ + in[1] = out[1]; \ + in[2] = out[2]; \ + if(components == 4) \ + { \ + in[3] = out[3]; \ + } \ +} + + +#define MIRROR_MACRO(type, components) \ +{ \ + type **input_rows, **output_rows; \ + type *input_row, *output_row; \ + input_rows = ((type**)frame->get_rows()); \ + output_rows = ((type**)frame->get_rows()); \ + \ + if (!config.reflection_center_enable) \ + { \ + /* HORIZONTAL ONLY */ \ + if(config.mirror_horizontal && !config.mirror_vertical && !config.mirror_swaphorizontal) \ + { \ + for(i = 0; i < h; i++) \ + { \ + input_row = input_rows[i]; \ + output_row = output_rows[i] + (w - 1) * components; \ + for(k = 0; k < w / 2; k++) \ + { \ + SWAPCOPY_PIXELS(components, output_row, input_row); \ + input_row += components; \ + output_row -= components; \ + } \ + } \ + } \ + /* HORIZONTAL SWAP ONLY */ \ + else if(config.mirror_horizontal && !config.mirror_vertical && config.mirror_swaphorizontal) \ + { \ + for(i = 0; i < h; i++) \ + { \ + input_row = input_rows[i]; \ + output_row = output_rows[i] + (w - 1) * components; \ + for(k = 0; k < w / 2; k++) \ + { \ + SWAPCOPY_PIXELS(components, input_row, output_row); \ + input_row += components; \ + output_row -= components; \ + } \ + } \ + } \ + /* VERTICAL ONLY */ \ + else if(config.mirror_vertical && !config.mirror_horizontal && !config.mirror_swapvertical) \ + { \ + for(i = 0, j = h - 1; i < h / 2; i++, j--) \ + { \ + input_row = input_rows[i]; \ + output_row = output_rows[j]; \ + for(k = 0; k < w; k++) \ + { \ + SWAPCOPY_PIXELS(components, output_row, input_row); \ + output_row += components; \ + input_row += components; \ + } \ + } \ + } \ + /* VERTICAL SWAP ONLY */ \ + else if(config.mirror_vertical && !config.mirror_horizontal && config.mirror_swapvertical) \ + { \ + for(i = 0, j = h - 1; i < h / 2; i++, j--) \ + { \ + input_row = input_rows[i]; \ + output_row = output_rows[j]; \ + for(k = 0; k < w; k++) \ + { \ + SWAPCOPY_PIXELS(components, input_row, output_row); \ + output_row += components; \ + input_row += components; \ + } \ + } \ + } \ + /* HORIZONTAL and VERTICAL */ \ + else if(config.mirror_horizontal && config.mirror_vertical && !config.mirror_swaphorizontal && !config.mirror_swapvertical) \ + { \ + /* HORIZONTAL ONLY */ \ + for(i = 0; i < h; i++) \ + { \ + input_row = input_rows[i]; \ + output_row = output_rows[i] + (w - 1) * components; \ + for(k = 0; k < w / 2; k++) \ + { \ + SWAPCOPY_PIXELS(components, output_row, input_row); \ + input_row += components; \ + output_row -= components; \ + } \ + } \ + /* VERTICAL ONLY */ \ + for(i = 0, j = h - 1; i < h / 2; i++, j--) \ + { \ + input_row = input_rows[i]; \ + output_row = output_rows[j]; \ + for(k = 0; k < w; k++) \ + { \ + SWAPCOPY_PIXELS(components, output_row, input_row); \ + output_row += components; \ + input_row += components; \ + } \ + } \ + } \ + /* HORIZONTAL with SWAP and VERTICAL with SWAP */ \ + else if(config.mirror_horizontal && config.mirror_vertical && config.mirror_swaphorizontal && config.mirror_swapvertical) \ + { \ + /* HORIZONTAL SWAP ONLY */ \ + for(i = 0; i < h; i++) \ + { \ + input_row = input_rows[i]; \ + output_row = output_rows[i] + (w - 1) * components; \ + for(k = 0; k < w / 2; k++) \ + { \ + SWAPCOPY_PIXELS(components, input_row, output_row); \ + input_row += components; \ + output_row -= components; \ + } \ + } \ + /* VERTICAL SWAP ONLY */ \ + for(i = 0, j = h - 1; i < h / 2; i++, j--) \ + { \ + input_row = input_rows[i]; \ + output_row = output_rows[j]; \ + for(k = 0; k < w; k++) \ + { \ + SWAPCOPY_PIXELS(components, input_row, output_row); \ + output_row += components; \ + input_row += components; \ + } \ + } \ + } \ + /* HORIZONTAL with SWAP and VERTICAL ONLY */ \ + else if(config.mirror_horizontal && config.mirror_vertical && config.mirror_swaphorizontal && !config.mirror_swapvertical) \ + { \ + /* HORIZONTAL SWAP ONLY */ \ + for(i = 0; i < h; i++) \ + { \ + input_row = input_rows[i]; \ + output_row = output_rows[i] + (w - 1) * components; \ + for(k = 0; k < w / 2; k++) \ + { \ + SWAPCOPY_PIXELS(components, input_row, output_row); \ + input_row += components; \ + output_row -= components; \ + } \ + } \ + /* VERTICAL ONLY */ \ + for(i = 0, j = h - 1; i < h / 2; i++, j--) \ + { \ + input_row = input_rows[i]; \ + output_row = output_rows[j]; \ + for(k = 0; k < w; k++) \ + { \ + SWAPCOPY_PIXELS(components, output_row, input_row); \ + output_row += components; \ + input_row += components; \ + } \ + } \ + } \ + /* HORIZONTAL ONLY and VERTICAL with SWAP */ \ + else if(config.mirror_horizontal && config.mirror_vertical && !config.mirror_swaphorizontal && config.mirror_swapvertical) \ + { \ + /* HORIZONTAL ONLY */ \ + for(i = 0; i < h; i++) \ + { \ + input_row = input_rows[i]; \ + output_row = output_rows[i] + (w - 1) * components; \ + for(k = 0; k < w / 2; k++) \ + { \ + SWAPCOPY_PIXELS(components, output_row, input_row); \ + input_row += components; \ + output_row -= components; \ + } \ + } \ + /* VERTICAL SWAP ONLY */ \ + for(i = 0, j = h - 1; i < h / 2; i++, j--) \ + { \ + input_row = input_rows[i]; \ + output_row = output_rows[j]; \ + for(k = 0; k < w; k++) \ + { \ + SWAPCOPY_PIXELS(components, input_row, output_row); \ + output_row += components; \ + input_row += components; \ + } \ + } \ + } \ + } \ + \ + else if(config.reflection_center_enable) \ + { \ + if(config.mirror_vertical) \ + { \ + int y_pixel = (int)round(config.reflection_center_y / 100.00 * h); \ + if(config.reflection_center_y < 50.00) \ + { \ + int valueY_source = y_pixel + 1; \ + int valueY_destination = y_pixel - 1; \ + for(int i = 0; i < y_pixel; i++) \ + { \ + input_row = input_rows[valueY_source]; \ + output_row = output_rows[valueY_destination]; \ + for(k = 0; k < w; k++) \ + { \ + SWAPCOPY_PIXELS(components, output_row, input_row); \ + output_row += components; \ + input_row += components; \ + } \ + valueY_source += 1; \ + valueY_destination -= 1; \ + } \ + } \ + else if(config.reflection_center_y > 50.00) \ + { \ + int valueY_source = y_pixel - 1; \ + int valueY_destination = y_pixel + 1; \ + for(int i = 0; i < (h - y_pixel - 1); i++) \ + { \ + input_row = input_rows[valueY_source]; \ + output_row = output_rows[valueY_destination]; \ + for(k = 0; k < w; k++) \ + { \ + SWAPCOPY_PIXELS(components, output_row, input_row); \ + output_row += components; \ + input_row += components; \ + } \ + valueY_source -= 1; \ + valueY_destination += 1; \ + } \ + } \ + else /* Y_PERCENT == 50.00 */ \ + { \ + for(i = 0, j = h - 1; i < h / 2; i++, j--) \ + { \ + input_row = input_rows[i]; \ + output_row = output_rows[j]; \ + for(k = 0; k < w; k++) \ + { \ + SWAPCOPY_PIXELS(components, output_row, input_row); \ + output_row += components; \ + input_row += components; \ + } \ + } \ + } \ + } \ + \ + if(config.mirror_horizontal) \ + { \ + int x_pixel = (int)round(config.reflection_center_x / 100.00 * w); \ + if(config.reflection_center_x < 50.00) \ + { \ + int valueX_source = x_pixel + 1; \ + int valueX_destination = x_pixel - 1; \ + for(i = 0; i < h; i++) \ + { \ + input_row = input_rows[i] + valueX_source * components; \ + output_row = output_rows[i] + valueX_destination * components; \ + for(k = 0; k < x_pixel; k++) \ + { \ + SWAPCOPY_PIXELS(components, output_row, input_row); \ + output_row -= components; \ + input_row += components; \ + } \ + } \ + } \ + else if(config.reflection_center_x > 50.00) \ + { \ + int valueX_source = x_pixel - 1; \ + int valueX_destination = x_pixel + 1; \ + for(i = 0; i < h; i++) \ + { \ + input_row = input_rows[i] + valueX_source * components; \ + output_row = output_rows[i] + valueX_destination * components; \ + for(k = 0; k < (w - x_pixel - 1); k++) \ + { \ + SWAPCOPY_PIXELS(components, output_row, input_row); \ + output_row += components; \ + input_row -= components; \ + } \ + } \ + } \ + else /* X_PERCENT == 50.00 */ \ + { \ + for(i = 0; i < h; i++) \ + { \ + input_row = input_rows[i]; \ + output_row = output_rows[i] + (w - 1) * components; \ + for(k = 0; k < w / 2; k++) \ + { \ + SWAPCOPY_PIXELS(components, output_row, input_row); \ + input_row += components; \ + output_row -= components; \ + } \ + } \ + } \ + } \ + } \ +} + +int MirrorMain::process_buffer(VFrame *frame, + int64_t start_position, + double frame_rate) +{ + int i, j, k; + int w = frame->get_w(); + int h = frame->get_h(); + int colormodel = frame->get_color_model(); + + load_configuration(); + +// THIS CODE WAS FOR the FLIP Plugin!!! +/* + read_frame(frame, + 0, + get_source_position(), + get_framerate(), + get_use_opengl()); + + if(get_use_opengl()) + { + if(config.mirror_vertical || config.mirror_horizontal) + return run_opengl(); + else + return 0; + } +*/ + read_frame(frame, + 0, + start_position, + frame_rate, + get_use_opengl()); + + if(config.mirror_vertical || config.mirror_horizontal) + { + switch(colormodel) + { + case BC_RGB888: + case BC_YUV888: + MIRROR_MACRO(unsigned char, 3); + break; + case BC_RGB_FLOAT: + MIRROR_MACRO(float, 3); + break; + case BC_RGB161616: + case BC_YUV161616: + MIRROR_MACRO(uint16_t, 3); + break; + case BC_RGBA8888: + case BC_YUVA8888: + MIRROR_MACRO(unsigned char, 4); + break; + case BC_RGBA_FLOAT: + MIRROR_MACRO(float, 4); + break; + case BC_RGBA16161616: + case BC_YUVA16161616: + MIRROR_MACRO(uint16_t, 4); + break; + } + } + return 0; +} + + +NEW_WINDOW_MACRO(MirrorMain, MirrorWindow) +LOAD_CONFIGURATION_MACRO(MirrorMain, MirrorConfig) + +void MirrorMain::update_gui() +{ + if(thread) + { + load_configuration(); + thread->window->lock_window(); + ((MirrorWindow*)thread->window)->mirror_horizontal->update((int)config.mirror_horizontal); + ((MirrorWindow*)thread->window)->mirror_swaphorizontal->update((int)config.mirror_swaphorizontal); + ((MirrorWindow*)thread->window)->mirror_vertical->update((int)config.mirror_vertical); + ((MirrorWindow*)thread->window)->mirror_swapvertical->update((int)config.mirror_swapvertical); + ((MirrorWindow*)thread->window)->reflection_center_enable->update(config.reflection_center_enable); + ((MirrorWindow*)thread->window)->reflection_center_x_text->update(config.reflection_center_x); + ((MirrorWindow*)thread->window)->reflection_center_x_slider->update(config.reflection_center_x); + ((MirrorWindow*)thread->window)->reflection_center_y_text->update(config.reflection_center_y); + ((MirrorWindow*)thread->window)->reflection_center_y_slider->update(config.reflection_center_y); + // Needed to update Enable-Disable GUI when "Show controls" is pressed. + ((MirrorWindow*)thread->window)->update_reflection_center_enable(); + thread->window->unlock_window(); + } +} + +void MirrorMain::save_data(KeyFrame *keyframe) +{ + FileXML output; + +// cause data to be stored directly in text + output.set_shared_output(keyframe->xbuf); + +// Store data + output.tag.set_title("MIRROR"); + output.tag.set_property("HORIZONTAL", config.mirror_horizontal); + output.tag.set_property("SWAP_HORIZONTAL", config.mirror_swaphorizontal); + output.tag.set_property("VERTICAL", config.mirror_vertical); + output.tag.set_property("SWAP_VERTICAL", config.mirror_swapvertical); + output.tag.set_property("REFLECTION_CENTER_ENABLE", config.reflection_center_enable); + output.tag.set_property("REFLECTION_CENTER_X", config.reflection_center_x); + output.tag.set_property("REFLECTION_CENTER_Y", config.reflection_center_y); + output.append_tag(); + output.tag.set_title("/MIRROR"); + output.append_tag(); + output.append_newline(); + output.terminate_string(); +// data is now in *text +} + +void MirrorMain::read_data(KeyFrame *keyframe) +{ + FileXML input; + + input.set_shared_input(keyframe->xbuf); + + int result = 0; + config.mirror_vertical = config.mirror_horizontal = 0; + config.mirror_swapvertical = config.mirror_swaphorizontal = 0; + + while(!result) + { + result = input.read_tag(); + + if(!result) + { + if(input.tag.title_is("MIRROR")) + { + config.mirror_horizontal = input.tag.get_property("HORIZONTAL", config.mirror_horizontal); + config.mirror_swaphorizontal = input.tag.get_property("SWAP_HORIZONTAL", config.mirror_swaphorizontal); + config.mirror_vertical = input.tag.get_property("VERTICAL", config.mirror_vertical); + config.mirror_swapvertical = input.tag.get_property("SWAP_VERTICAL", config.mirror_swapvertical); + config.reflection_center_enable = input.tag.get_property("REFLECTION_CENTER_ENABLE", config.reflection_center_enable); + config.reflection_center_x = input.tag.get_property("REFLECTION_CENTER_X", config.reflection_center_x); + config.reflection_center_y = input.tag.get_property("REFLECTION_CENTER_Y", config.reflection_center_y); + } + } + } +} + + +int MirrorMain::handle_opengl() +{ +#ifdef HAVE_GL +// FIXIT. When?! ... THIS CODE WAS FOR the FLIP Plugin!!! +/* + get_output()->to_texture(); + get_output()->enable_opengl(); + get_output()->init_screen(); + get_output()->bind_texture(0); + + if(config.mirror_vertical && !config.mirror_horizontal) + { + get_output()->draw_texture(0, + 0, + get_output()->get_w(), + get_output()->get_h(), + 0, + get_output()->get_h(), + get_output()->get_w(), + 0); + } + + if(config.mirror_horizontal && !config.mirror_vertical) + { + get_output()->draw_texture(0, + 0, + get_output()->get_w(), + get_output()->get_h(), + get_output()->get_w(), + 0, + 0, + get_output()->get_h()); + } + + if(config.mirror_vertical && config.mirror_horizontal) + { + get_output()->draw_texture(0, + 0, + get_output()->get_w(), + get_output()->get_h(), + get_output()->get_w(), + get_output()->get_h(), + 0, + 0); + } + + get_output()->set_opengl_state(VFrame::SCREEN); +*/ +#endif + return 0; +} + + + diff --git a/cinelerra-5.1/plugins/mirror/mirror.h b/cinelerra-5.1/plugins/mirror/mirror.h new file mode 100644 index 00000000..5836a418 --- /dev/null +++ b/cinelerra-5.1/plugins/mirror/mirror.h @@ -0,0 +1,77 @@ + +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + +/* + * 2023. Derivative by Flip plugin. +*/ + +#ifndef MIRROR_H +#define MIRROR_H + + +class MirrorMain; + +#include "filexml.h" +#include "mirrorwindow.h" +#include "guicast.h" +#include "pluginvclient.h" + +class MirrorConfig +{ +public: + MirrorConfig(); + void reset(int clear); + void copy_from(MirrorConfig &that); + int equivalent(MirrorConfig &that); + void interpolate(MirrorConfig &prev, + MirrorConfig &next, + int64_t prev_frame, + int64_t next_frame, + int64_t current_frame); + int mirror_horizontal; + int mirror_swaphorizontal; + int mirror_vertical; + int mirror_swapvertical; + int reflection_center_enable; + float reflection_center_x, reflection_center_y; +}; + +class MirrorMain : public PluginVClient +{ +public: + MirrorMain(PluginServer *server); + ~MirrorMain(); + + PLUGIN_CLASS_MEMBERS(MirrorConfig); + +// required for all realtime plugins + int process_buffer(VFrame *frame, + int64_t start_position, + double frame_rate); + int is_realtime(); + void update_gui(); + void save_data(KeyFrame *keyframe); + void read_data(KeyFrame *keyframe); + int handle_opengl(); +}; + + +#endif diff --git a/cinelerra-5.1/plugins/mirror/mirrorwindow.C b/cinelerra-5.1/plugins/mirror/mirrorwindow.C new file mode 100644 index 00000000..9cfb7440 --- /dev/null +++ b/cinelerra-5.1/plugins/mirror/mirrorwindow.C @@ -0,0 +1,424 @@ + +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + +/* + * 2023. Derivative by Flip plugin. +*/ + +#include "bcdisplayinfo.h" +#include "mirrorwindow.h" +#include "language.h" +#include "theme.h" + + + + + + + +MirrorWindow::MirrorWindow(MirrorMain *client) + : PluginClientWindow(client, xS(420), yS(270), xS(420), yS(270), 0) +{ + this->client = client; +} + +MirrorWindow::~MirrorWindow() +{ + delete mirror_horizontal; + delete mirror_swaphorizontal; + delete mirror_vertical; + delete mirror_swapvertical; + delete reflection_center_enable; + delete reflection_center_x_text; + delete reflection_center_x_slider; + delete reflection_center_y_text; + delete reflection_center_y_slider; + delete reflection_center_x_clr; + delete reflection_center_y_clr; + delete reset; +} + +void MirrorWindow::create_objects() +{ + int xs10 = xS(10), xs20 = xS(20), xs200 = xS(200); + int ys10 = yS(10), ys20 = yS(20), ys30 = yS(30), ys40 = yS(40); + int x2 = xS(60), x3 = xS(180); + int x = xs10, y = ys10; + int clr_x = get_w()-x - xS(22); // note: clrBtn_w = 22 + + BC_TitleBar *title_bar; + BC_Bar *bar; + + +// Direction section + add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, xs20, xs10, _("Direction"))); + y += ys20; + add_tool(mirror_horizontal = new MirrorToggle(client, + &(client->config.mirror_horizontal), + _("Horizontal"), + x, + y)); + add_tool(mirror_swaphorizontal = new MirrorSwapSide(client, + &(client->config.mirror_swaphorizontal), + _("Swap LEFT-RIGHT side"), + (get_w() / 2), + y)); + y += ys30; + add_tool(mirror_vertical = new MirrorToggle(client, + &(client->config.mirror_vertical), + _("Vertical"), + x, + y)); + add_tool(mirror_swapvertical = new MirrorSwapSide(client, + &(client->config.mirror_swapvertical), + _("Swap TOP-BOTTOM side"), + (get_w() / 2), + y)); + y += ys40; + add_tool(reflection_center_enable = new MirrorReflectionCenter(this, client, x, y)); + y += ys40; + +// Reflection Center section + add_subwindow(title_bar = new BC_TitleBar(x, y, get_w()-2*x, xs20, xs10, _("Reflection Center"))); + y += ys20; + add_tool(new BC_Title(x, y, _("X"))); + add_tool(new BC_Title((x2-x), y, _("%"))); + reflection_center_x_text = new MirrorReflectionCenterXText(this, client, (x + x2), y); + reflection_center_x_text->create_objects(); + reflection_center_x_slider = new MirrorReflectionCenterXSlider(this, client, x3, y, xs200); + add_subwindow(reflection_center_x_slider); + add_subwindow(reflection_center_x_clr = new MirrorReflectionCenterClr(this, client, + clr_x, y, RESET_REFLECTION_CENTER_X)); + y += ys30; + add_tool(new BC_Title(x, y, _("Y"))); + add_tool(new BC_Title((x2-x), y, _("%"))); + reflection_center_y_text = new MirrorReflectionCenterYText(this, client, (x + x2), y); + reflection_center_y_text->create_objects(); + reflection_center_y_slider = new MirrorReflectionCenterYSlider(this, client, x3, y, xs200); + add_subwindow(reflection_center_y_slider); + add_subwindow(reflection_center_y_clr = new MirrorReflectionCenterClr(this, client, + clr_x, y, RESET_REFLECTION_CENTER_Y)); + y += ys40; + +// Reset section + add_subwindow(bar = new BC_Bar(x, y, get_w()-2*x)); + y += ys10; + add_tool(reset = new MirrorReset(client, this, x, y)); + show_window(); + flush(); + +// Needed to update Enable-Disable GUI when "Show controls" is pressed. + update_reflection_center_enable(); +} + + +void MirrorWindow::update_reflection_center_enable() +{ + if(client->config.reflection_center_enable) + { + reflection_center_x_text->enable(); + reflection_center_x_slider->enable(); + reflection_center_x_clr->enable(); + reflection_center_y_text->enable(); + reflection_center_y_slider->enable(); + reflection_center_y_clr->enable(); + mirror_swaphorizontal->disable(); + mirror_swaphorizontal->hide_window(); + mirror_swapvertical->disable(); + mirror_swapvertical->hide_window(); + } + else + { + reflection_center_x_text->disable(); + reflection_center_x_slider->disable(); + reflection_center_x_clr->disable(); + reflection_center_y_text->disable(); + reflection_center_y_slider->disable(); + reflection_center_y_clr->disable(); + mirror_swaphorizontal->enable(); + mirror_swaphorizontal->show_window(); + mirror_swapvertical->enable(); + mirror_swapvertical->show_window(); + } +} + +void MirrorWindow::update(int clear) +{ + switch(clear) { + case RESET_REFLECTION_CENTER_X : + reflection_center_x_text->update((float)client->config.reflection_center_x); + reflection_center_x_slider->update((float)client->config.reflection_center_x); + mirror_horizontal->update(client->config.mirror_horizontal); + mirror_swaphorizontal->update(client->config.mirror_swaphorizontal); + break; + case RESET_REFLECTION_CENTER_Y : + reflection_center_y_text->update((float)client->config.reflection_center_y); + reflection_center_y_slider->update((float)client->config.reflection_center_y); + mirror_vertical->update(client->config.mirror_vertical); + mirror_swapvertical->update(client->config.mirror_swapvertical); + break; + case RESET_ALL : + case RESET_DEFAULT_SETTINGS : + default: + mirror_horizontal->update(client->config.mirror_horizontal); + mirror_swaphorizontal->update(client->config.mirror_swaphorizontal); + mirror_vertical->update(client->config.mirror_vertical); + mirror_swapvertical->update(client->config.mirror_swapvertical); + reflection_center_enable->update(client->config.reflection_center_enable); + reflection_center_x_text->update((float)client->config.reflection_center_x); + reflection_center_x_slider->update((float)client->config.reflection_center_x); + reflection_center_y_text->update((float)client->config.reflection_center_y); + reflection_center_y_slider->update((float)client->config.reflection_center_y); + break; + } +} + +MirrorToggle::MirrorToggle(MirrorMain *client, int *output, char *string, int x, int y) + : BC_CheckBox(x, y, *output, string) +{ + this->client = client; + this->output = output; +} +MirrorToggle::~MirrorToggle() +{ +} +int MirrorToggle::handle_event() +{ + *output = get_value(); + client->send_configure_change(); + return 1; +} + +MirrorSwapSide::MirrorSwapSide(MirrorMain *client, int *output, char *string, int x, int y) + : BC_CheckBox(x, y, *output, string) +{ + this->client = client; + this->output = output; +} +MirrorSwapSide::~MirrorSwapSide() +{ +} +int MirrorSwapSide::handle_event() +{ + *output = get_value(); + client->send_configure_change(); + return 1; +} + +MirrorReflectionCenter::MirrorReflectionCenter(MirrorWindow *window, MirrorMain *client, int x, int y) + : BC_CheckBox(x, y, client->config.reflection_center_enable, _("Enable Reflection Center")) +{ + this->window = window; + this->client = client; +} +MirrorReflectionCenter::~MirrorReflectionCenter() +{ +} +int MirrorReflectionCenter::handle_event() +{ + client->config.reflection_center_enable = get_value(); + + if(client->config.reflection_center_enable) + { + window->reflection_center_x_text->enable(); + window->reflection_center_x_slider->enable(); + window->reflection_center_x_clr->enable(); + window->reflection_center_y_text->enable(); + window->reflection_center_y_slider->enable(); + window->reflection_center_y_clr->enable(); + + window->mirror_swaphorizontal->disable(); + window->mirror_swaphorizontal->hide_window(); + window->mirror_swapvertical->disable(); + window->mirror_swapvertical->hide_window(); + + window->reflection_center_x_text->update(client->config.reflection_center_x); + window->reflection_center_x_slider->update(client->config.reflection_center_x); + window->reflection_center_y_text->update(client->config.reflection_center_y); + window->reflection_center_y_slider->update(client->config.reflection_center_y); + window->mirror_swaphorizontal->update(client->config.mirror_swaphorizontal); + window->mirror_swapvertical->update(client->config.mirror_swapvertical); + } + else + { + window->reflection_center_x_text->disable(); + window->reflection_center_x_slider->disable(); + window->reflection_center_x_clr->disable(); + window->reflection_center_y_text->disable(); + window->reflection_center_y_slider->disable(); + window->reflection_center_y_clr->disable(); + + window->mirror_swaphorizontal->enable(); + window->mirror_swaphorizontal->show_window(); + window->mirror_swapvertical->enable(); + window->mirror_swapvertical->show_window(); + + window->reflection_center_x_text->update(client->config.reflection_center_x); + window->reflection_center_x_slider->update(client->config.reflection_center_x); + window->reflection_center_y_text->update(client->config.reflection_center_y); + window->reflection_center_y_slider->update(client->config.reflection_center_y); + window->mirror_swaphorizontal->update(client->config.mirror_swaphorizontal); + window->mirror_swapvertical->update(client->config.mirror_swapvertical); + } + client->send_configure_change(); + return 1; +} + +/* ********************************************** */ +/* **** MIRROR REFLECTION CENTER X ************** */ +MirrorReflectionCenterXText::MirrorReflectionCenterXText(MirrorWindow *window, MirrorMain *client, + int x, + int y) + : BC_TumbleTextBox(window, client->config.reflection_center_x, + (float)0.00, (float)100.00, x, y, xS(60), 2) +{ + this->window = window; + this->client = client; +} + +MirrorReflectionCenterXText::~MirrorReflectionCenterXText() +{ +} + +int MirrorReflectionCenterXText::handle_event() +{ + client->config.reflection_center_x = atof(get_text()); + if(client->config.reflection_center_x > 100.00) client->config.reflection_center_x = 100.00; + else if(client->config.reflection_center_x < 0.00) client->config.reflection_center_x = 0.00; + window->reflection_center_x_text->update(client->config.reflection_center_x); + window->reflection_center_x_slider->update(client->config.reflection_center_x); + client->send_configure_change(); + return 1; +} + +MirrorReflectionCenterXSlider::MirrorReflectionCenterXSlider(MirrorWindow *window, MirrorMain *client, + int x, int y, int w) + : BC_FSlider(x, y, 0, w, w, 0.00, 100.00, client->config.reflection_center_x) +{ + this->window = window; + this->client = client; + enable_show_value(0); // Hide caption + set_precision(0.01); +} + +MirrorReflectionCenterXSlider::~MirrorReflectionCenterXSlider() +{ +} + +int MirrorReflectionCenterXSlider::handle_event() +{ + client->config.reflection_center_x = get_value(); + window->reflection_center_x_text->update(client->config.reflection_center_x); + window->update(RESET_ALL); + client->send_configure_change(); + return 1; +} +/* ********************************************** */ + +/* ********************************************** */ +/* **** MIRROR REFLECTION CENTER Y ************** */ +MirrorReflectionCenterYText::MirrorReflectionCenterYText(MirrorWindow *window, MirrorMain *client, + int x, + int y) + : BC_TumbleTextBox(window, client->config.reflection_center_y, + (float)0.00, (float)100.00, x, y, xS(60), 2) +{ + this->window = window; + this->client = client; +} + +MirrorReflectionCenterYText::~MirrorReflectionCenterYText() +{ +} + +int MirrorReflectionCenterYText::handle_event() +{ + client->config.reflection_center_y = atof(get_text()); + if(client->config.reflection_center_y > 100.00) client->config.reflection_center_y = 100.00; + else if(client->config.reflection_center_y < 0.00) client->config.reflection_center_y = 0.00; + window->reflection_center_y_text->update(client->config.reflection_center_y); + window->reflection_center_y_slider->update(client->config.reflection_center_y); + client->send_configure_change(); + return 1; +} + +MirrorReflectionCenterYSlider::MirrorReflectionCenterYSlider(MirrorWindow *window, MirrorMain *client, + int x, int y, int w) + : BC_FSlider(x, y, 0, w, w, 0.00, 100.00, client->config.reflection_center_y) +{ + this->window = window; + this->client = client; + enable_show_value(0); // Hide caption + set_precision(0.01); +} + +MirrorReflectionCenterYSlider::~MirrorReflectionCenterYSlider() +{ +} + +int MirrorReflectionCenterYSlider::handle_event() +{ + client->config.reflection_center_y = get_value(); + window->reflection_center_y_text->update(client->config.reflection_center_y); + window->update(RESET_ALL); + client->send_configure_change(); + return 1; +} +/* ********************************************** */ + + +MirrorReflectionCenterClr::MirrorReflectionCenterClr(MirrorWindow *window, MirrorMain *client, int x, int y, int clear) + : BC_Button(x, y, client->get_theme()->get_image_set("reset_button")) +{ + this->window = window; + this->client = client; + this->clear = clear; +} +MirrorReflectionCenterClr::~MirrorReflectionCenterClr() +{ +} +int MirrorReflectionCenterClr::handle_event() +{ + client->config.reset(clear); + window->update(clear); + client->send_configure_change(); + return 1; +} + +MirrorReset::MirrorReset(MirrorMain *client, MirrorWindow *window, int x, int y) + : BC_GenericButton(x, y, _("Reset")) +{ + this->client = client; + this->window = window; +} + +MirrorReset::~MirrorReset() +{ +} + +int MirrorReset::handle_event() +{ + client->config.reset(RESET_ALL); + window->update_reflection_center_enable(); + window->update(RESET_ALL); + client->send_configure_change(); + return 1; +} diff --git a/cinelerra-5.1/plugins/mirror/mirrorwindow.h b/cinelerra-5.1/plugins/mirror/mirrorwindow.h new file mode 100644 index 00000000..efd4ec13 --- /dev/null +++ b/cinelerra-5.1/plugins/mirror/mirrorwindow.h @@ -0,0 +1,188 @@ + +/* + * CINELERRA + * Copyright (C) 2008 Adam Williams + * + * 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 + * + */ + +/* + * 2023. Derivative by Flip plugin. +*/ + +#ifndef MIRRORWINDOW_H +#define MIRRORWINDOW_H + + +class MirrorThread; +class MirrorWindow; +class MirrorToggle; +class MirrorSwapSide; +class MirrorReflectionCenter; +class MirrorReflectionCenterXText; +class MirrorReflectionCenterXSlider; +class MirrorReflectionCenterYText; +class MirrorReflectionCenterYSlider; +class MirrorReflectionCenterClr; +class MirrorReset; + + + +#include "filexml.inc" +#include "mirror.h" +#include "mutex.h" +#include "pluginvclient.h" + +#define RESET_DEFAULT_SETTINGS 10 +#define RESET_ALL 0 +#define RESET_REFLECTION_CENTER_X 1 +#define RESET_REFLECTION_CENTER_Y 2 + + +class MirrorWindow : public PluginClientWindow +{ +public: + MirrorWindow(MirrorMain *client); + ~MirrorWindow(); + + void create_objects(); + void update(int clear); + + void update_reflection_center_enable(); + + MirrorMain *client; + MirrorToggle *mirror_vertical; + MirrorToggle *mirror_horizontal; + MirrorSwapSide *mirror_swapvertical; + MirrorSwapSide *mirror_swaphorizontal; + MirrorReflectionCenter *reflection_center_enable; + + // Mirror Reflection Center X, Y + MirrorReflectionCenterXText *reflection_center_x_text; + MirrorReflectionCenterXSlider *reflection_center_x_slider; + MirrorReflectionCenterClr *reflection_center_x_clr; + + MirrorReflectionCenterYText *reflection_center_y_text; + MirrorReflectionCenterYSlider *reflection_center_y_slider; + MirrorReflectionCenterClr *reflection_center_y_clr; + + MirrorReset *reset; +}; + +class MirrorToggle : public BC_CheckBox +{ +public: + MirrorToggle(MirrorMain *client, int *output, char *string, int x, int y); + ~MirrorToggle(); + int handle_event(); + + MirrorMain *client; + int *output; +}; + +class MirrorSwapSide : public BC_CheckBox +{ +public: + MirrorSwapSide(MirrorMain *client, int *output, char *string, int x, int y); + ~MirrorSwapSide(); + int handle_event(); + + MirrorMain *client; + int *output; +}; + +class MirrorReflectionCenter : public BC_CheckBox +{ +public: + MirrorReflectionCenter(MirrorWindow *window, MirrorMain *client, int x, int y); + ~MirrorReflectionCenter(); + int handle_event(); + + MirrorMain *client; + MirrorWindow *window; +}; + +class MirrorReflectionCenterXText : public BC_TumbleTextBox +{ +public: + MirrorReflectionCenterXText(MirrorWindow *window, + MirrorMain *client, + int x, + int y); + ~MirrorReflectionCenterXText(); + int handle_event(); + MirrorMain *client; + MirrorWindow *window; +}; + +class MirrorReflectionCenterXSlider : public BC_FSlider +{ +public: + MirrorReflectionCenterXSlider(MirrorWindow *window, MirrorMain *client, + int x, int y, int w); + ~MirrorReflectionCenterXSlider(); + int handle_event(); + MirrorWindow *window; + MirrorMain *client; +}; + +class MirrorReflectionCenterYText : public BC_TumbleTextBox +{ +public: + MirrorReflectionCenterYText(MirrorWindow *window, + MirrorMain *client, + int x, + int y); + ~MirrorReflectionCenterYText(); + int handle_event(); + MirrorMain *client; + MirrorWindow *window; +}; + +class MirrorReflectionCenterYSlider : public BC_FSlider +{ +public: + MirrorReflectionCenterYSlider(MirrorWindow *window, MirrorMain *client, + int x, int y, int w); + ~MirrorReflectionCenterYSlider(); + int handle_event(); + MirrorWindow *window; + MirrorMain *client; +}; + +class MirrorReflectionCenterClr : public BC_Button +{ +public: + MirrorReflectionCenterClr(MirrorWindow *window, MirrorMain *client, + int x, int y, int clear); + ~MirrorReflectionCenterClr(); + int handle_event(); + MirrorWindow *window; + MirrorMain *client; + int clear; +}; + +class MirrorReset : public BC_GenericButton +{ +public: + MirrorReset(MirrorMain *client, MirrorWindow *window, int x, int y); + ~MirrorReset(); + int handle_event(); + MirrorMain *client; + MirrorWindow *window; +}; + +#endif diff --git a/cinelerra-5.1/plugins/motion-cv/motion-cv.C b/cinelerra-5.1/plugins/motion-cv/motion-cv.C index 780a0fef..e2989eb6 100644 --- a/cinelerra-5.1/plugins/motion-cv/motion-cv.C +++ b/cinelerra-5.1/plugins/motion-cv/motion-cv.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/motion-cv/motion-cv.h b/cinelerra-5.1/plugins/motion-cv/motion-cv.h index 99de4b25..8f4ca53d 100644 --- a/cinelerra-5.1/plugins/motion-cv/motion-cv.h +++ b/cinelerra-5.1/plugins/motion-cv/motion-cv.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/motion-cv/motionwindow-cv.C b/cinelerra-5.1/plugins/motion-cv/motionwindow-cv.C index d797fe93..286d11f3 100644 --- a/cinelerra-5.1/plugins/motion-cv/motionwindow-cv.C +++ b/cinelerra-5.1/plugins/motion-cv/motionwindow-cv.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/motion-cv/motionwindow-cv.h b/cinelerra-5.1/plugins/motion-cv/motionwindow-cv.h index 53fdd070..69fdc19c 100644 --- a/cinelerra-5.1/plugins/motion-cv/motionwindow-cv.h +++ b/cinelerra-5.1/plugins/motion-cv/motionwindow-cv.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/motion/motion.C b/cinelerra-5.1/plugins/motion/motion.C index d35d4cc5..bd2550b0 100644 --- a/cinelerra-5.1/plugins/motion/motion.C +++ b/cinelerra-5.1/plugins/motion/motion.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2012 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/motion51/motion51.C b/cinelerra-5.1/plugins/motion51/motion51.C index d694b234..702d43e7 100644 --- a/cinelerra-5.1/plugins/motion51/motion51.C +++ b/cinelerra-5.1/plugins/motion51/motion51.C @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2020 William Morrow + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser 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 + */ + + #include "affine.h" #include "bchash.h" #include "clip.h" diff --git a/cinelerra-5.1/plugins/motion51/motion51.h b/cinelerra-5.1/plugins/motion51/motion51.h index afd8bbad..4de1c68d 100644 --- a/cinelerra-5.1/plugins/motion51/motion51.h +++ b/cinelerra-5.1/plugins/motion51/motion51.h @@ -1,7 +1,6 @@ - /* * CINELERRA - * Copyright (C) 2008 Adam Williams + * Copyright (C) 2020 William Morrow * * 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 diff --git a/cinelerra-5.1/plugins/motion51/motion51.inc b/cinelerra-5.1/plugins/motion51/motion51.inc index da4794ed..4d7e8a8d 100644 --- a/cinelerra-5.1/plugins/motion51/motion51.inc +++ b/cinelerra-5.1/plugins/motion51/motion51.inc @@ -1,3 +1,24 @@ +/* + * CINELERRA + * Copyright (C) 2020 William Morrow + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser 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 + */ + + #ifndef __MOTION_51_INC__ #define __MOTION_51_INC__ diff --git a/cinelerra-5.1/plugins/motion51/motionwindow51.C b/cinelerra-5.1/plugins/motion51/motionwindow51.C index c84305bf..36463e5b 100644 --- a/cinelerra-5.1/plugins/motion51/motionwindow51.C +++ b/cinelerra-5.1/plugins/motion51/motionwindow51.C @@ -1,7 +1,6 @@ - /* * CINELERRA - * Copyright (C) 2012 Adam Williams + * Copyright (C) 2020 William Morrow * * 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 diff --git a/cinelerra-5.1/plugins/motion51/motionwindow51.h b/cinelerra-5.1/plugins/motion51/motionwindow51.h index faf94053..aaaeb0aa 100644 --- a/cinelerra-5.1/plugins/motion51/motionwindow51.h +++ b/cinelerra-5.1/plugins/motion51/motionwindow51.h @@ -1,7 +1,6 @@ - /* * CINELERRA - * Copyright (C) 2008 Adam Williams + * Copyright (C) 2020 William Morrow * * 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 diff --git a/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C b/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C index 0321c395..72286527 100644 --- a/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C +++ b/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.h b/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.h index e41c2384..d273a73d 100644 --- a/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.h +++ b/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.inc b/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.inc index 3cff8614..958d78c1 100644 --- a/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.inc +++ b/cinelerra-5.1/plugins/theme_blond_cv/blondcvtheme.inc @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C b/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C index 6203e863..5d5ea052 100644 --- a/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C +++ b/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.h b/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.h index d7bf9122..d1ad3f08 100644 --- a/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.h +++ b/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.h @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.inc b/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.inc index 7e54b537..dcd00417 100644 --- a/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.inc +++ b/cinelerra-5.1/plugins/theme_blue_dot/bluedottheme.inc @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/theme_neophyte/neophyte.C b/cinelerra-5.1/plugins/theme_neophyte/neophyte.C index 0ec9ad12..affab7bc 100644 --- a/cinelerra-5.1/plugins/theme_neophyte/neophyte.C +++ b/cinelerra-5.1/plugins/theme_neophyte/neophyte.C @@ -56,7 +56,7 @@ // traffic lights, light green: 0x27ae60/0x37c871 - just on the buttons. #define ComicYellow 0xffcc00 // heads up! #define DarkRed 0xaa0000 // locked or not switched on. -#define LockedRed 0x400000 +#define LockedRed 0xda4453 PluginClient* new_plugin(PluginServer *server) { diff --git a/cinelerra-5.1/plugins/timefront/timefront.C b/cinelerra-5.1/plugins/timefront/timefront.C index eb2d83d5..f57183fb 100644 --- a/cinelerra-5.1/plugins/timefront/timefront.C +++ b/cinelerra-5.1/plugins/timefront/timefront.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * 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 diff --git a/cinelerra-5.1/plugins/yuv411/yuv411.C b/cinelerra-5.1/plugins/yuv411/yuv411.C index 57a14ba1..7bfd2f44 100644 --- a/cinelerra-5.1/plugins/yuv411/yuv411.C +++ b/cinelerra-5.1/plugins/yuv411/yuv411.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016 Eric Olson + * + * 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 + */ + #include "clip.h" #include "bccmodels.h" #include "bchash.h" diff --git a/cinelerra-5.1/plugins/yuv411/yuv411.h b/cinelerra-5.1/plugins/yuv411/yuv411.h index 6499d78b..75c9b5fc 100644 --- a/cinelerra-5.1/plugins/yuv411/yuv411.h +++ b/cinelerra-5.1/plugins/yuv411/yuv411.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016 Eric Olson + * + * 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 + */ + #ifndef YUV411_H #define YUV411_H diff --git a/cinelerra-5.1/plugins/yuv411/yuv411win.C b/cinelerra-5.1/plugins/yuv411/yuv411win.C index e80f1439..bb6a2c33 100644 --- a/cinelerra-5.1/plugins/yuv411/yuv411win.C +++ b/cinelerra-5.1/plugins/yuv411/yuv411win.C @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016 Eric Olson + * + * 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 + */ + #include "bcdisplayinfo.h" #include "edl.h" #include "edlsession.h" diff --git a/cinelerra-5.1/plugins/yuv411/yuv411win.h b/cinelerra-5.1/plugins/yuv411/yuv411win.h index 5f33344a..98a2787d 100644 --- a/cinelerra-5.1/plugins/yuv411/yuv411win.h +++ b/cinelerra-5.1/plugins/yuv411/yuv411win.h @@ -1,3 +1,23 @@ +/* + * CINELERRA + * Copyright (C) 2016 Eric Olson + * + * 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 + */ + #ifndef YUV411WIN_H #define YUV411WIN_H diff --git a/cinelerra-5.1/thirdparty/Makefile b/cinelerra-5.1/thirdparty/Makefile index 504acb4a..ba1ce051 100644 --- a/cinelerra-5.1/thirdparty/Makefile +++ b/cinelerra-5.1/thirdparty/Makefile @@ -112,6 +112,7 @@ $(BLD): # pkg-config names pc_libaom=aom +pc_libsvtav1=SvtAv1Enc pc_dav1d=dav1d pc_libwebp=libwebp libwebpmux pc_opus=opus @@ -129,8 +130,10 @@ esound.cfg_params= --enable-shared=no --with-pic esound.mak_vars+= CFLAGS="" esound.ldflags=" -lm -lstdc++" fftw.cfg_params= --disable-fortran --enable-shared=no +ffmpeg.cfg_vars?= PKG_CONFIG_PATH="$(call bld_path,libwebp)/usr/local/lib/pkgconfig" ffmpeg.cfg_params= \ --enable-pthreads --disable-avdevice --enable-gpl --disable-ffplay \ + --disable-doc \ $(call if_want,VAAPI,--enable-vaapi,--disable-vaapi) \ $(call if_want,VDPAU,--enable-vdpau,--disable-vdpau) \ $(call if_want,NV, --enable-nvenc --enable-nvdec --enable-ffnvcodec) \ @@ -138,6 +141,7 @@ ffmpeg.cfg_params= \ $(call if_ena,openjpeg,--enable-libopenjpeg) \ $(call if_ena,lame,--enable-libmp3lame) \ $(call if_ena,libaom,--enable-libaom) \ + $(call if_ena,libsvtav1,--enable-libsvtav1) \ $(call if_ena,dav1d,--enable-libdav1d) \ $(call if_ena,libwebp,--enable-libwebp) \ $(call if_ena,opus,--enable-libopus) \ @@ -151,6 +155,7 @@ ffmpeg.cfg_params= \ $(call inc_path,twolame) \ $(call inc_path,lame) \ $(call inc_path,libaom) \ + $(call inc_path,libsvtav1) \ $(call inc_path,dav1d) \ $(call inc_path,libwebp) \ $(call inc_path,openjpeg) \ @@ -167,6 +172,7 @@ ffmpeg.cfg_params= \ $(call ld_path,twolame,libtwolame/.libs) \ $(call ld_path,lame,libmp3lame/.libs) \ $(call ld_path,libaom,usr/local/lib) \ + $(call ld_path,libsvtav1,usr/local/lib) \ $(call ld_path,dav1d,usr/local/lib) \ $(call ld_path,libwebp,usr/local/lib) \ $(call ld_path,openjpeg,bin) \ @@ -190,12 +196,13 @@ a52dec.ldflags?= "$(call ld_path,djbfft)" a52dec.cfg_vars?= CFLAGS+=" -U__FreeBSD__ $(call inc_path,djbfft)" LIBS+=" $(call ld_path,djbfft)"; autoreconf -ifv && automake -caf; a52dec.cfg_params?=--enable-djbfft --disable-oss djbfft.cfg_vars?=echo "$(call bld_path,djbfft)" > conf-home; \ - (CFLAGS="$(CFLAGS)"; $(CFG_VARS)$(if $(CFG_VARS),; )echo "$(CC) $$$$CFLAGS") > conf-cc; \ + (CFLAGS="$(CFLAGS) -std=gnu89"; $(CFG_VARS)$(if $(CFG_VARS),; )echo "$(CC) $$$$CFLAGS") > conf-cc; \ echo "exec true" > ./configure; chmod +x ./configure; djbfft.mak_params?=; cd $(call bld_path,djbfft); ln -sf djbfft.a libdjbfft.a -audiofile.cfg_params?=--enable-shared=no +audiofile.cfg_params?=--enable-shared=no --disable-doxygen-docs --enable-debug=no --enable-examples=no audiofile.mak_params?=LIBS="-lm -lstdc++" -flac.cfg_params?= --enable-shared=no +flac.cfg_vars?= CFLAGS+=" -O3 -funroll-loops " CPPFLAGS+=" -DNDEBUG " CXXFLAGS+=" -O2 " +flac.cfg_params?= --enable-shared=no --disable-doxygen-docs flac.cflags?="$(call inc_path,libogg) $(call ld_path,libogg,src/.libs)" ffnvcodec.cfg_vars=echo "exec true" > ./configure; chmod +x ./configure; giflib.cfg_vars=echo "exec true" > ./configure; chmod +x ./configure; @@ -206,12 +213,17 @@ libaom.cfg_vars?= mkdir aom.build && cd aom.build && $(call cmake_config,..) libaom.cfg_params?= -DENABLE_TESTS=no -DCMAKE_BUILD_TYPE=Release -DENABLE_DOCS=no -DENABLE_SHARED=no -DCMAKE_INSTALL_LIBDIR=lib \ -DENABLE_EXAMPLES=no -DCMAKE_INSTALL_PREFIX=$(call bld_path,libaom)/usr/local libaom.mak_params?= ; $(MAKE) -C libaom*/aom.build install +libsvtav1.cfg_vars?= mkdir libsvtav1.build && cd libsvtav1.build && $(call cmake_config,..) +libsvtav1.cfg_params?= -DENABLE_TESTS=no -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=no -DENABLE_DOCS=no -DENABLE_SHARED=no -DCMAKE_INSTALL_LIBDIR=lib \ + -DENABLE_EXAMPLES=no -DCMAKE_INSTALL_PREFIX=$(call bld_path,libsvtav1)/usr/local +libsvtav1.mak_params?= ; $(MAKE) -C libsvtav1*/libsvtav1.build install dav1d.cfg_vars?=echo "echo dav1d custom make" >> configure; chmod +x ./configure; dav1d.mak_params?=; $(MAKE) -C dav1d* install DESTDIR="$(call bld_path,dav1d)" -libwebp.cfg_vars?= mkdir build && cd build && $(call cmake_config,..) -libwebp.mak_params?= -C build all install DESTDIR=$(call bld_path,libwebp) +libwebp.cfg_vars?= ./autogen.sh; +libwebp.cfg_params?= --prefix=$(call bld_path,libwebp)usr/local --enable-static --disable-shared --disable-libwebpdemux --disable-libwebpmux; \ + make install; mjpegtools.cflags?="$(call inc_path,libjpeg) $(call ld_path,libjpeg,build)" -mjpegtools.cfg_vars?= ./autogen.sh; +mjpegtools.cfg_vars?= ./autogen.sh; export CXXFLAGS+="-std=c++11"; mjpegtools.cfg_params?= --enable-shared=no --without-libquicktime --without-libdv \ --without-libpng --without-dga --without-gtk --without-libsdl --without-sdlgfx mjpegtools.mak_params?= all @@ -243,7 +255,7 @@ libtheora.cfg_params?= --disable-examples --disable-spec --enable-shared=no libuuid.cfg_vars?= autoreconf -ifv -I m4 && automake -caf; libuuid.cfg_params?=--enable-shared=no libvorbis.cfg_params?= --disable-oggtest --enable-shared=no -openjpeg.cfg_params?= -DBUILD_SHARED_LIBS:BOOL=OFF +openjpeg.cfg_params?= -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_CODEC:BOOL=OFF openjpeg.cfg_vars?=$(call cmake_config,.) openjpeg.mak_params?= ; cd $(call bld_path,openjpeg,src/lib/openjp2); ln -sf . openjpeg-2.1 opencv.cfg_vars?=$(call cmake_config,.) @@ -252,17 +264,20 @@ openexr.cfg_vars?=true; \# openexr.mak_vars?=true; \# opus.cfg_params?= --disable-extra-programs speech_tools.mak_params?=-j1 +tiff.ldflags?="$(call ld_path,libjpeg,build)" +tiff.cflags?="$(call lnc_path,libjpeg)" tiff.cfg_vars+=LIBS+=" -lpthread"; autoreconf -ifv -I m4 && automake -caf; -tiff.cfg_params+= --disable-libdeflate --enable-shared=no --disable-zstd $(call if_pkg,libwebp,\ +tiff.cfg_params+= --disable-libdeflate --disable-lerc --enable-shared=no --disable-zstd $(call if_pkg,libwebp,\ --with-webp-include-dir=$(call pkg_incl,libwebp)\ --with-webp-lib-dir=$(call pkg_libs,libwebp))\ $(call if_npkg,libwebp,--disable-webp) twolame.cfg_params?=--enable-shared=no x264.cfg_params?= --enable-static --enable-pic x265.cfg_vars?=$(call cmake_config,source) -x265.cfg_params?= -DENABLE_SHARED=no +x265.cfg_params?= -DENABLE_SHARED=no -DENABLE_CLI=no libvpx.cfg_params?= --enable-pic --disable-avx512 --enable-vp9-highbitdepth --disable-examples --disable-unit_tests libdpx.cfg_vars?= libtoolize; aclocal; autoconf; automake -a; +libsndfile.cfg_params+= --disable-shared --enable-static --disable-sqlite --disable-mpeg DS:=$$$$$$$$ pkg_cfg=$(call bld_path,$(1),usr/local/lib/pkgconfig): @@ -336,7 +351,7 @@ $(call rules,$(call std-build,audiofile)) $(call rules,$(call std-build,encore)) $(call rules,$(call std-build,esound,audiofile)) $(call rules,$(call std-build,ffmpeg, twolame lame openjpeg opus \ - libtheora x264 x265 libvpx libaom dav1d libwebp \ + libtheora x264 x265 libvpx libaom libsvtav1 dav1d libwebp \ $(call if_want,NV, ffnvcodec))) $(call rules,$(call std-build,fftw)) $(call rules,$(call std-build,flac,libogg)) @@ -345,6 +360,7 @@ $(call rules,$(call std-build,ilmBase, openexr)) $(call rules,$(call std-build,ladspa)) $(call rules,$(call std-build,lame)) $(call rules,$(call std-build,libaom)) +$(call rules,$(call std-build,libsvtav1)) $(call rules,$(call std-build,dav1d)) $(call rules,$(call std-build,libwebp)) $(call rules,$(call std-build,libavc1394,libraw1394)) @@ -364,7 +380,7 @@ $(call rules,$(call std-build,openExr, ilmBase)) $(call rules,$(call std-build,openjpeg)) $(call rules,$(call std-build,opus)) $(call rules,$(call std-build,speech_tools)) -$(call rules,$(call std-build,tiff, libwebp)) +$(call rules,$(call std-build,tiff, libwebp libjpeg)) $(call rules,$(call std-build,twolame)) $(call rules,$(call std-build,x264)) $(call rules,$(call std-build,x265)) diff --git a/cinelerra-5.1/thirdparty/compile_multibit_X265.txt b/cinelerra-5.1/thirdparty/compile_multibit_X265.txt index b41d2f02..915d6121 100644 --- a/cinelerra-5.1/thirdparty/compile_multibit_X265.txt +++ b/cinelerra-5.1/thirdparty/compile_multibit_X265.txt @@ -1,46 +1,47 @@ +From 9bda08470b306aa5d2e4915f76ddd6fd8b009577 Mon Sep 17 00:00:00 2001 From: Andrew Randrianasulu -Date: Sun, 20 Jun 2021 10:35:26 +0300 -Subject: [PATCH 32/67] Add multilib x265 (slower compilation, but you can - render 10 bit h265 out of the box) +Date: Wed, 20 Dec 2023 15:16:40 +0300 +Subject: [PATCH 13/14] Multibit x265 patches updated for x265-17122023 --- - cinelerra-5.1/thirdparty/Makefile | 5 +- - cinelerra-5.1/thirdparty/src/x265_3.5.patch1 | 4 ++ - cinelerra-5.1/thirdparty/src/x265_3.5.patch2 | 7 +++ - cinelerra-5.1/thirdparty/src/x265_3.5.patch3 | 57 ++++++++++++++++++++ + cinelerra-5.1/thirdparty/Makefile | 5 +- + .../thirdparty/src/x265_3.517122023.patch1 | 4 ++ + .../thirdparty/src/x265_3.517122023.patch2 | 7 +++ + .../thirdparty/src/x265_3.517122023.patch3 | 57 +++++++++++++++++++ 4 files changed, 71 insertions(+), 2 deletions(-) - create mode 100644 cinelerra-5.1/thirdparty/src/x265_3.5.patch1 - create mode 100644 cinelerra-5.1/thirdparty/src/x265_3.5.patch2 - create mode 100644 cinelerra-5.1/thirdparty/src/x265_3.5.patch3 + create mode 100644 cinelerra-5.1/thirdparty/src/x265_3.517122023.patch1 + create mode 100644 cinelerra-5.1/thirdparty/src/x265_3.517122023.patch2 + create mode 100644 cinelerra-5.1/thirdparty/src/x265_3.517122023.patch3 -diff --git a/cinelerra-5.1/thirdparty/Makefile b/cinelerra-5.1/thirdparty/Makefile --- a/cinelerra-5.1/thirdparty/Makefile +++ b/cinelerra-5.1/thirdparty/Makefile -@@ -259,8 +259,9 @@ tiff.cfg_params+= --disable-libdeflate --enable-shared=no --disable-zstd $(call +@@ -265,8 +265,9 @@ $(call if_npkg,libwebp,--disable-webp) twolame.cfg_params?=--enable-shared=no x264.cfg_params?= --enable-static --enable-pic -x265.cfg_vars?=$(call cmake_config,source) --x265.cfg_params?= -DENABLE_SHARED=no +-x265.cfg_params?= -DENABLE_SHARED=no -DENABLE_CLI=no +x265.cfg_vars?=chmod +x ./configure; chmod +x ./multilib.sh; +#x265.cfg_vars?=$(call cmake_config,source) -+#x265.cfg_params?= -DENABLE_SHARED=no ++#x265.cfg_params?= -DENABLE_SHARED=no -DENABLE_CLI=no libvpx.cfg_params?= --enable-pic --disable-avx512 --enable-vp9-highbitdepth --disable-examples --disable-unit_tests + libdpx.cfg_vars?= libtoolize; aclocal; autoconf; automake -a; - DS:=$$$$$$$$ -diff --git a/cinelerra-5.1/thirdparty/src/x265_3.5.patch1 b/cinelerra-5.1/thirdparty/src/x265_3.5.patch1 +diff --git a/cinelerra-5.1/thirdparty/src/x265_3.517122023.patch1 b/cinelerra-5.1/thirdparty/src/x265_3.517122023.patch1 new file mode 100644 +index 00000000..23d7e84f --- /dev/null -+++ b/cinelerra-5.1/thirdparty/src/x265_3.5.patch1 ++++ b/cinelerra-5.1/thirdparty/src/x265_3.517122023.patch1 @@ -0,0 +1,4 @@ +--- /dev/null 2020-03-14 06:02:18.586124011 +0300 ++++ ./configure 2020-03-18 00:04:59.360807192 +0300 +@@ -0,0 +1 @@ ++/bin/true -diff --git a/cinelerra-5.1/thirdparty/src/x265_3.5.patch2 b/cinelerra-5.1/thirdparty/src/x265_3.5.patch2 +diff --git a/cinelerra-5.1/thirdparty/src/x265_3.517122023.patch2 b/cinelerra-5.1/thirdparty/src/x265_3.517122023.patch2 new file mode 100644 +index 00000000..72459e66 --- /dev/null -+++ b/cinelerra-5.1/thirdparty/src/x265_3.5.patch2 ++++ b/cinelerra-5.1/thirdparty/src/x265_3.517122023.patch2 @@ -0,0 +1,7 @@ +--- /dev/null 2020-03-14 06:02:18.586124011 +0300 ++++ ./Makefile 2020-03-18 00:04:59.388807329 +0300 @@ -49,10 +50,11 @@ new file mode 100644 ++.NOTPARALLEL: ++all: ++ $(shell ./multilib.sh ; cp 8bit/libx265.a . ; cp 8bit/x265.pc . ; cp 8bit/x265_config.h .) -diff --git a/cinelerra-5.1/thirdparty/src/x265_3.5.patch3 b/cinelerra-5.1/thirdparty/src/x265_3.5.patch3 +diff --git a/cinelerra-5.1/thirdparty/src/x265_3.517122023.patch3 b/cinelerra-5.1/thirdparty/src/x265_3.517122023.patch3 new file mode 100644 +index 00000000..26fa121b --- /dev/null -+++ b/cinelerra-5.1/thirdparty/src/x265_3.5.patch3 ++++ b/cinelerra-5.1/thirdparty/src/x265_3.517122023.patch3 @@ -0,0 +1,57 @@ +--- /dev/null 2020-07-19 09:07:01.788494015 +0300 ++++ ./multilib.sh 2020-08-02 02:34:58.444933214 +0300 @@ -85,7 +87,7 @@ new file mode 100644 ++cd ../8bit ++ln -sf ../10bit/libx265.a libx265_main10.a ++ln -sf ../12bit/libx265.a libx265_main12.a -++cmake ../source -DEXTRA_LIB="x265_main10.a;x265_main12.a" -DENABLE_SHARED=OFF -DEXTRA_LINK_FLAGS=-L. -DLINKED_10BIT=ON -DLINKED_12BIT=ON +++cmake ../source -DEXTRA_LIB="x265_main10.a;x265_main12.a" -DENABLE_SHARED=OFF -DEXTRA_LINK_FLAGS=-L. -DLINKED_10BIT=ON -DLINKED_12BIT=ON -DENABLE_CLI=OFF ++make ++ ++# rename the 8bit library, then combine all three into libx265.a @@ -111,3 +113,6 @@ new file mode 100644 ++libtool -static -o libx265.a libx265_main.a libx265_main10.a libx265_main12.a 2>/dev/null ++ ++fi +-- +2.43.0 + diff --git a/cinelerra-5.1/thirdparty/downloads.txt b/cinelerra-5.1/thirdparty/downloads.txt index dc72ccb2..b519e297 100644 --- a/cinelerra-5.1/thirdparty/downloads.txt +++ b/cinelerra-5.1/thirdparty/downloads.txt @@ -6,16 +6,16 @@ http://gnu.mirrors.pair.com/savannah/savannah//openexr/openexr-2.2.1.tar.gz https://sourceforge.net/projects/opencvlibrary/files/ 4.3.0 https://github.com/opencv/opencv_contrib/releases 4.3.0 #https://sourceforge.net/projects/opencore-amr/files/fdk-aac/fdk-aac-2.2.0.tar.gz/download -http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.28.tar.gz -https://ieee1394.wiki.kernel.org/index.php/Libraries -https://www.kernel.org/pub/linux/libs/ieee1394/libraw1394-2.1.2.tar.xz -https://www.kernel.org/pub/linux/libs/ieee1394/libiec61883-1.2.0.tar.xz +#http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.28.tar.gz +https://github.com/libsndfile/libsndfile/releases 1.2.2 +https://mirrors.edge.kernel.org/pub/linux/libs/ieee1394/libraw1394-2.1.2.tar.xz +https://mirrors.edge.kernel.org/pub/linux/libs/ieee1394/libiec61883-1.2.0.tar.xz https://sourceforge.net/projects/libavc1394/files/latest/download?source=directory = 0.5.4 https://sourceforge.net/projects/libdv/files/latest/download?source=directory = 0.104 https://sourceforge.net/projects/giflib/files/latest/download = 5.2.1 -https://sourceforge.net/projects/flac/files/latest/download?source=directory = 1.3.2 -https://github.com/uclouvain/openjpeg/ = Releases=sourcefiles openjpeg-2.4.0.tar.gz -https://sourceforge.net/projects/libjpeg-turbo/ = Code (GitHub)=sourcefiles/2.1.2/libjpeg-turbo-2.1.2.tar.gz +https://github.com/xiph/flac/releases/tag/1.4.2 +https://github.com/uclouvain/openjpeg/ = Releases=sourcefiles openjpeg-2.5.0.tar.gz +https://sourceforge.net/projects/libjpeg-turbo/ = Code (GitHub)=sourcefiles/2.1.2/libjpeg-turbo-2.1.5.1.tar.gz http://www.fftw.org/fftw-3.3.10.tar.gz # Not sure why festival is in here but it is now at 2.5 since 25-Dec-2017 http://festvox.org/packed/festival/2.4/festival-2.4-release.tar.gz @@ -30,20 +30,21 @@ http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.7.tar.xz http://downloads.xiph.org/releases/ogg/libogg-1.3.5.tar.gz http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2 https://sourceforge.net/projects/lame/files/latest/download?source=directory = 3.100 -https://download.osgeo.org/libtiff/tiff-4.3.0.tar.gz +https://download.osgeo.org/libtiff/tiff-4.6.0.tar.xz https://sourceforge.net/projects/libuuid/files/latest/download?source=directory - 1.0.3 -https://code.videolan.org/videolan/x264/-/tree/stable/x264-stable.tar.gz -https://code.videolan.org/videolan/x264/-/tree/master/x264-snapshot-20210615-master.tar.xz (Andrew does somehow) -https://bitbucket.org/multicoreware/x265_git/downloads/x265_3.5.tar.gz -https://ffmpeg.org/releases/ffmpeg-4.4.tar.bz2 -https://github.com/webmproject/libvpx/archive/v1.11.0.tar.gz -https://code.videolan.org/videolan/dav1d/-/archive/0.7.1/dav1d-0.7.1.tar.gz +https://code.videolan.org/videolan/x264/-/tree/stable/x264-stable.tar.gz (Jan. 2023 version r3106) +https://bitbucket.org/multicoreware/x265_git/downloads/x265_3.5.tar.gz (snapshot 17122023) +https://ffmpeg.org/releases/ffmpeg-6.1.tar.bz2 +https://github.com/webmproject/libvpx/archive/v1.13.1.tar.gz +https://code.videolan.org/videolan/dav1d/-/archive/0.5.1/dav1d-0.5.1.tar.gz https://github.com/swh/ladspa/releases/tag/v0.4.17, plugin.org.uk https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz -https://github.com/webmproject/libwebp = libwebp-1.1.0 -https://github.com/mozilla/aom = libaom-v3.1.1 +#https://github.com/webmproject/libwebp = libwebp-1.3.2 +https://github.com/webmproject/libwebp/archive/refs/tags/v1.3.2.tar.gz +https://github.com/mozilla/aom = libaom-v3.8.0 (need v3.4.0 for ubuntu 16) git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git ?? https://github.com/FFmpeg/nv-codec-headers/releases/download/n10.0.26.0/nv-codec-headers-10.0.26.0.tar.gz +https://gitlab.com/AOMediaCodec/SVT-AV1/-/releases (v.1.8.0) https://gitlab.com/drobilla/lv2/-/archive/v1.18.0/lv2-v1.18.0.tar.gz http://download.drobilla.net/suil-0.10.6.tar.bz2 diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch0 b/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch0 deleted file mode 100644 index f9760935..00000000 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch0 +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c -index 88fdbeaf1e..f39d2e7cc4 100644 ---- a/fftools/cmdutils.c -+++ b/fftools/cmdutils.c -@@ -1184,6 +1184,7 @@ static void print_buildconf(int flags, int level) - - void show_banner(int argc, char **argv, const OptionDef *options) - { -+ return; - int idx = locate_option(argc, argv, options, "version"); - if (hide_banner || idx) - return; diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch1 b/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch1 deleted file mode 100644 index 88631302..00000000 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch1 +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/libavformat/bluray.c b/libavformat/bluray.c -index 635c4f1b87..80a2e2c3d2 100644 ---- a/libavformat/bluray.c -+++ b/libavformat/bluray.c -@@ -28,7 +28,7 @@ - #include "libavutil/opt.h" - - #define BLURAY_PROTO_PREFIX "bluray:" --#define MIN_PLAYLIST_LENGTH 180 /* 3 min */ -+#define MIN_PLAYLIST_LENGTH 0 - - typedef struct { - const AVClass *class; diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_1 b/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_1 deleted file mode 100644 index b453e71d..00000000 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_1 +++ /dev/null @@ -1,35 +0,0 @@ ---- ffmpeg-4.4/libavcodec/aaccoder.c.orig 2021-05-08 11:52:41.824074401 +0300 -+++ ffmpeg-4.4/libavcodec/aaccoder.c 2021-05-08 11:55:06.868074410 +0300 -@@ -800,7 +800,7 @@ - - for (sid_sf_boost = 0; sid_sf_boost < 4; sid_sf_boost++) { - float dist1 = 0.0f, dist2 = 0.0f; -- int B0 = 0, B1 = 0; -+ int B0_ = 0, B1 = 0; - int minidx; - int mididx, sididx; - int midcb, sidcb; -@@ -862,12 +862,12 @@ - sididx, - sidcb, - mslambda / (minthr * bmax), INFINITY, &b4, NULL, 0); -- B0 += b1+b2; -+ B0_ += b1+b2; - B1 += b3+b4; - dist1 -= b1+b2; - dist2 -= b3+b4; - } -- cpe->ms_mask[w*16+g] = dist2 <= dist1 && B1 < B0; -+ cpe->ms_mask[w*16+g] = dist2 <= dist1 && B1 < B0_; - if (cpe->ms_mask[w*16+g]) { - if (sce0->band_type[w*16+g] != NOISE_BT && sce1->band_type[w*16+g] != NOISE_BT) { - sce0->sf_idx[w*16+g] = mididx; -@@ -879,7 +879,7 @@ - cpe->ms_mask[w*16+g] = 0; - } - break; -- } else if (B1 > B0) { -+ } else if (B1 > B0_) { - /* More boost won't fix this */ - break; - } diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_10 b/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_10 deleted file mode 100644 index 835c3b21..00000000 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_10 +++ /dev/null @@ -1,67 +0,0 @@ ---- ffmpeg-4.4/libavcodec/libdav1d.c 2021-04-09 00:28:39.000000000 +0300 -+++ ffmpeg-4.4/libavcodec/libdav1d.c 2022-03-27 15:54:53.212041349 +0300 -@@ -33,6 +33,9 @@ - #include "decode.h" - #include "internal.h" - -+#define FF_DAV1D_VERSION_AT_LEAST(x,y) \ -+ (DAV1D_API_VERSION_MAJOR > (x) || DAV1D_API_VERSION_MAJOR == (x) && DAV1D_API_VERSION_MINOR >= (y)) -+ - typedef struct Libdav1dContext { - AVClass *class; - Dav1dContext *c; -@@ -145,6 +148,15 @@ - if (dav1d->operating_point >= 0) - s.operating_point = dav1d->operating_point; - -+#if FF_DAV1D_VERSION_AT_LEAST(6,0) -+ if (dav1d->frame_threads || dav1d->tile_threads) -+ s.n_threads = FFMAX(dav1d->frame_threads, dav1d->tile_threads); -+ else -+ s.n_threads = FFMIN(threads, DAV1D_MAX_THREADS); -+ s.max_frame_delay = (c->flags & AV_CODEC_FLAG_LOW_DELAY) ? 1 : s.n_threads; -+ av_log(c, AV_LOG_DEBUG, "Using %d threads, %d max_frame_delay\n", -+ s.n_threads, s.max_frame_delay); -+#else - s.n_tile_threads = dav1d->tile_threads - ? dav1d->tile_threads - : FFMIN(floor(sqrt(threads)), DAV1D_MAX_TILE_THREADS); -@@ -153,6 +165,7 @@ - : FFMIN(ceil(threads / s.n_tile_threads), DAV1D_MAX_FRAME_THREADS); - av_log(c, AV_LOG_DEBUG, "Using %d frame threads, %d tile threads\n", - s.n_frame_threads, s.n_tile_threads); -+#endif - - res = dav1d_open(&dav1d->c, &s); - if (res < 0) -@@ -185,6 +198,9 @@ - Libdav1dContext *dav1d = c->priv_data; - Dav1dData *data = &dav1d->data; - Dav1dPicture pic = { 0 }, *p = &pic; -+#if FF_DAV1D_VERSION_AT_LEAST(5,1) -+ enum Dav1dEventFlags event_flags = 0; -+#endif - int res; - - if (!data->sz) { -@@ -456,11 +472,18 @@ - return 0; - } - -+#ifndef DAV1D_MAX_FRAME_THREADS -+#define DAV1D_MAX_FRAME_THREADS DAV1D_MAX_THREADS -+#endif -+#ifndef DAV1D_MAX_TILE_THREADS -+#define DAV1D_MAX_TILE_THREADS DAV1D_MAX_THREADS -+#endif -+ - #define OFFSET(x) offsetof(Libdav1dContext, x) - #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM - static const AVOption libdav1d_options[] = { -- { "tilethreads", "Tile threads", OFFSET(tile_threads), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_TILE_THREADS, VD }, -- { "framethreads", "Frame threads", OFFSET(frame_threads), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_FRAME_THREADS, VD }, -+ { "tilethreads", "Tile threads", OFFSET(tile_threads), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_TILE_THREADS, VD | AV_OPT_FLAG_DEPRECATED }, -+ { "framethreads", "Frame threads", OFFSET(frame_threads), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_FRAME_THREADS, VD | AV_OPT_FLAG_DEPRECATED }, - { "filmgrain", "Apply Film Grain", OFFSET(apply_grain), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VD | AV_OPT_FLAG_DEPRECATED }, - { "oppoint", "Select an operating point of the scalable bitstream", OFFSET(operating_point), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 31, VD }, - { "alllayers", "Output all spatial layers", OFFSET(all_layers), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD }, diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_2 b/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_2 deleted file mode 100644 index 3d20039a..00000000 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_2 +++ /dev/null @@ -1,139 +0,0 @@ ---- ffmpeg-4.4/libavcodec/hevc_mvs.c.orig 2021-05-08 12:22:19.580985429 +0300 -+++ ffmpeg-4.4/libavcodec/hevc_mvs.c 2021-05-08 12:29:05.340985454 +0300 -@@ -307,8 +307,8 @@ - const int xB1 = x0 + nPbW - 1; - const int yB1 = y0 - 1; - -- const int xB0 = x0 + nPbW; -- const int yB0 = y0 - 1; -+ const int xB0_ = x0 + nPbW; -+ const int yB0_ = y0 - 1; - - const int xA0 = x0 - 1; - const int yA0 = y0 + nPbH; -@@ -365,14 +365,14 @@ - } - - // above right spatial merge candidate -- is_available_b0 = AVAILABLE(cand_up_right, B0) && -- xB0 < s->ps.sps->width && -- PRED_BLOCK_AVAILABLE(B0) && -- !is_diff_mer(s, xB0, yB0, x0, y0); -+ is_available_b0 = AVAILABLE(cand_up_right, B0_) && -+ xB0_ < s->ps.sps->width && -+ PRED_BLOCK_AVAILABLE(B0_) && -+ !is_diff_mer(s, xB0_, yB0_, x0, y0); - - if (is_available_b0 && -- !(is_available_b1 && COMPARE_MV_REFIDX(B0, B1))) { -- mergecandlist[nb_merge_cand] = TAB_MVF_PU(B0); -+ !(is_available_b1 && COMPARE_MV_REFIDX(B0_, B1))) { -+ mergecandlist[nb_merge_cand] = TAB_MVF_PU(B0_); - if (merge_idx == nb_merge_cand) - return; - nb_merge_cand++; -@@ -588,7 +588,7 @@ - MvField *tab_mvf = s->ref->tab_mvf; - int isScaledFlag_L0 = 0; - int availableFlagLXA0 = 1; -- int availableFlagLXB0 = 1; -+ int availableFlagLXB0_ = 1; - int numMVPCandLX = 0; - int min_pu_width = s->ps.sps->min_pu_width; - -@@ -596,7 +596,7 @@ - int is_available_a0; - int xA1, yA1; - int is_available_a1; -- int xB0, yB0; -+ int xB0_, yB0_; - int is_available_b0; - int xB1, yB1; - int is_available_b1; -@@ -677,12 +677,12 @@ - b_candidates: - // B candidates - // above right spatial merge candidate -- xB0 = x0 + nPbW; -- yB0 = y0 - 1; -+ xB0_ = x0 + nPbW; -+ yB0_ = y0 - 1; - -- is_available_b0 = AVAILABLE(cand_up_right, B0) && -- xB0 < s->ps.sps->width && -- PRED_BLOCK_AVAILABLE(B0); -+ is_available_b0 = AVAILABLE(cand_up_right, B0_) && -+ xB0_ < s->ps.sps->width && -+ PRED_BLOCK_AVAILABLE(B0_); - - // above spatial merge candidate - xB1 = x0 + nPbW - 1; -@@ -696,10 +696,10 @@ - - // above right spatial merge candidate - if (is_available_b0) { -- if (MP_MX(B0, pred_flag_index_l0, mxB)) { -+ if (MP_MX(B0_, pred_flag_index_l0, mxB)) { - goto scalef; - } -- if (MP_MX(B0, pred_flag_index_l1, mxB)) { -+ if (MP_MX(B0_, pred_flag_index_l1, mxB)) { - goto scalef; - } - } -@@ -723,40 +723,40 @@ - goto scalef; - } - } -- availableFlagLXB0 = 0; -+ availableFlagLXB0_ = 0; - - scalef: - if (!isScaledFlag_L0) { -- if (availableFlagLXB0) { -+ if (availableFlagLXB0_) { - availableFlagLXA0 = 1; - mxA = mxB; - } -- availableFlagLXB0 = 0; -+ availableFlagLXB0_ = 0; - - // XB0 and L1 - if (is_available_b0) { -- availableFlagLXB0 = MP_MX_LT(B0, pred_flag_index_l0, mxB); -- if (!availableFlagLXB0) -- availableFlagLXB0 = MP_MX_LT(B0, pred_flag_index_l1, mxB); -+ availableFlagLXB0_ = MP_MX_LT(B0_, pred_flag_index_l0, mxB); -+ if (!availableFlagLXB0_) -+ availableFlagLXB0_ = MP_MX_LT(B0_, pred_flag_index_l1, mxB); - } - -- if (is_available_b1 && !availableFlagLXB0) { -- availableFlagLXB0 = MP_MX_LT(B1, pred_flag_index_l0, mxB); -- if (!availableFlagLXB0) -- availableFlagLXB0 = MP_MX_LT(B1, pred_flag_index_l1, mxB); -+ if (is_available_b1 && !availableFlagLXB0_) { -+ availableFlagLXB0_ = MP_MX_LT(B1, pred_flag_index_l0, mxB); -+ if (!availableFlagLXB0_) -+ availableFlagLXB0_ = MP_MX_LT(B1, pred_flag_index_l1, mxB); - } - -- if (is_available_b2 && !availableFlagLXB0) { -- availableFlagLXB0 = MP_MX_LT(B2, pred_flag_index_l0, mxB); -- if (!availableFlagLXB0) -- availableFlagLXB0 = MP_MX_LT(B2, pred_flag_index_l1, mxB); -+ if (is_available_b2 && !availableFlagLXB0_) { -+ availableFlagLXB0_ = MP_MX_LT(B2, pred_flag_index_l0, mxB); -+ if (!availableFlagLXB0_) -+ availableFlagLXB0_ = MP_MX_LT(B2, pred_flag_index_l1, mxB); - } - } - - if (availableFlagLXA0) - mvpcand_list[numMVPCandLX++] = mxA; - -- if (availableFlagLXB0 && (!availableFlagLXA0 || mxA.x != mxB.x || mxA.y != mxB.y)) -+ if (availableFlagLXB0_ && (!availableFlagLXA0 || mxA.x != mxB.x || mxA.y != mxB.y)) - mvpcand_list[numMVPCandLX++] = mxB; - - //temporal motion vector prediction candidate diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_3 b/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_3 deleted file mode 100644 index 5e42b668..00000000 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_3 +++ /dev/null @@ -1,104 +0,0 @@ ---- ffmpeg-4.4/libavcodec/opus_pvq.c.orig 2021-05-08 12:19:49.996985421 +0300 -+++ ffmpeg-4.4/libavcodec/opus_pvq.c 2021-05-08 12:21:12.440985425 +0300 -@@ -495,12 +495,12 @@ - uint32_t N0 = N; - int N_B = N / blocks; - int N_B0 = N_B; -- int B0 = blocks; -+ int B0_ = blocks; - int time_divide = 0; - int recombine = 0; - int inv = 0; - float mid = 0, side = 0; -- int longblocks = (B0 == 1); -+ int longblocks = (B0_ == 1); - uint32_t cm = 0; - - if (N == 1) { -@@ -532,7 +532,7 @@ - /* Band recombining to increase frequency resolution */ - - if (lowband && -- (recombine || ((N_B & 1) == 0 && tf_change < 0) || B0 > 1)) { -+ (recombine || ((N_B & 1) == 0 && tf_change < 0) || B0_ > 1)) { - for (i = 0; i < N; i++) - lowband_scratch[i] = lowband[i]; - lowband = lowband_scratch; -@@ -556,13 +556,13 @@ - time_divide++; - tf_change++; - } -- B0 = blocks; -+ B0_ = blocks; - N_B0 = N_B; - - /* Reorganize the samples in time order instead of frequency order */ -- if (B0 > 1 && (quant || lowband)) -+ if (B0_ > 1 && (quant || lowband)) - celt_deinterleave_hadamard(pvq->hadamard_tmp, quant ? X : lowband, -- N_B >> recombine, B0 << recombine, -+ N_B >> recombine, B0_ << recombine, - longblocks); - } - -@@ -604,7 +604,7 @@ - if (quant) { - if (stereo && N > 2) - ff_opus_rc_enc_uint_step(rc, itheta, qn / 2); -- else if (stereo || B0 > 1) -+ else if (stereo || B0_ > 1) - ff_opus_rc_enc_uint(rc, itheta, qn + 1); - else - ff_opus_rc_enc_uint_tri(rc, itheta, qn); -@@ -619,7 +619,7 @@ - } else { - if (stereo && N > 2) - itheta = ff_opus_rc_dec_uint_step(rc, qn / 2); -- else if (stereo || B0 > 1) -+ else if (stereo || B0_ > 1) - itheta = ff_opus_rc_dec_uint(rc, qn+1); - else - itheta = ff_opus_rc_dec_uint_tri(rc, qn); -@@ -725,7 +725,7 @@ - - /* Give more bits to low-energy MDCTs than they would - * otherwise deserve */ -- if (B0 > 1 && !stereo && (itheta & 0x3fff)) { -+ if (B0_ > 1 && !stereo && (itheta & 0x3fff)) { - if (itheta > 8192) - /* Rough approximation for pre-echo masking */ - delta -= delta >> (4 - duration); -@@ -764,14 +764,14 @@ - cmt = pvq->quant_band(pvq, f, rc, band, Y, NULL, N, sbits, blocks, - next_lowband2, duration, NULL, next_level, - gain * side, NULL, fill >> blocks); -- cm |= cmt << ((B0 >> 1) & (stereo - 1)); -+ cm |= cmt << ((B0_ >> 1) & (stereo - 1)); - } else { - /* For a stereo split, the high bits of fill are always zero, - * so no folding will be done to the side. */ - cm = pvq->quant_band(pvq, f, rc, band, Y, NULL, N, sbits, blocks, - next_lowband2, duration, NULL, next_level, - gain * side, NULL, fill >> blocks); -- cm <<= ((B0 >> 1) & (stereo - 1)); -+ cm <<= ((B0_ >> 1) & (stereo - 1)); - rebalance = sbits - (rebalance - f->remaining2); - if (rebalance > 3 << 3 && itheta != 16384) - mbits += rebalance - (3 << 3); -@@ -842,13 +842,13 @@ - int k; - - /* Undo the sample reorganization going from time order to frequency order */ -- if (B0 > 1) -+ if (B0_ > 1) - celt_interleave_hadamard(pvq->hadamard_tmp, X, N_B >> recombine, -- B0 << recombine, longblocks); -+ B0_ << recombine, longblocks); - - /* Undo time-freq changes that we did earlier */ - N_B = N_B0; -- blocks = B0; -+ blocks = B0_; - for (k = 0; k < time_divide; k++) { - blocks >>= 1; - N_B <<= 1; diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_4 b/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_4 deleted file mode 100644 index ff7e6d93..00000000 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_4 +++ /dev/null @@ -1,42 +0,0 @@ ---- ffmpeg-4.4/libavcodec/libx264.c.orig -+++ ffmpeg-4.4/libavcodec/libx264.c -@@ -790,6 +790,18 @@ FF_ENABLE_DEPRECATION_WARNINGS - av_log(avctx, AV_LOG_ERROR, - "x264 too old for AVC Intra, at least version 142 needed\n"); - #endif -+ -+ if (x4->avcintra_class > 200) { -+#if X264_BUILD < 164 -+ av_log(avctx, AV_LOG_ERROR, -+ "x264 too old for AVC Intra 300/480, at least version 164 needed\n"); -+ return AVERROR(EINVAL); -+#else -+ /* AVC-Intra 300/480 only supported by Sony XAVC flavor */ -+ x4->params.i_avcintra_flavor = X264_AVCINTRA_FLAVOR_SONY; -+#endif -+ } -+ - if (x4->b_bias != INT_MIN) - x4->params.i_bframe_bias = x4->b_bias; - if (x4->b_pyramid >= 0) -@@ -921,6 +933,11 @@ FF_ENABLE_DEPRECATION_WARNINGS - } - } - -+#if X264_BUILD >= 142 -+ /* Separate headers not supported in AVC-Intra mode */ -+ if (x4->params.i_avcintra_class >= 0) -+ x4->params.b_repeat_headers = 1; -+#endif - - { - AVDictionaryEntry *en = NULL; -@@ -1123,7 +1140,7 @@ static const AVOption options[] = { - { "none", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_NONE}, INT_MIN, INT_MAX, VE, "nal-hrd" }, - { "vbr", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_VBR}, INT_MIN, INT_MAX, VE, "nal-hrd" }, - { "cbr", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_CBR}, INT_MIN, INT_MAX, VE, "nal-hrd" }, -- { "avcintra-class","AVC-Intra class 50/100/200", OFFSET(avcintra_class),AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 200 , VE}, -+ { "avcintra-class","AVC-Intra class 50/100/200/300/480", OFFSET(avcintra_class),AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 480 , VE}, - { "me_method", "Set motion estimation method", OFFSET(motion_est), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, X264_ME_TESA, VE, "motion-est"}, - { "motion-est", "Set motion estimation method", OFFSET(motion_est), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, X264_ME_TESA, VE, "motion-est"}, - { "dia", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = X264_ME_DIA }, INT_MIN, INT_MAX, VE, "motion-est" }, diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_9 b/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_9 deleted file mode 100644 index f973f2fc..00000000 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_9 +++ /dev/null @@ -1,355 +0,0 @@ ---- /dev/null 2021-12-05 17:02:04.576000000 +0300 -+++ ./libavcodec/pcm-bluenc.c 2021-12-08 16:22:32.519865993 +0300 -@@ -0,0 +1,332 @@ -+/* -+ * LPCM codecs for PCM formats found in Blu-ray m2ts streams -+ * Copyright (c) 2018 Paul B Mahol -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg 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 -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#include "avcodec.h" -+#include "bytestream.h" -+#include "internal.h" -+ -+typedef struct PCMBDContext { -+ uint8_t header[4]; // Header added to every frame -+ int block_size; // Size of a block of samples in bytes -+ int samples_per_block; // Number of samples per channel per block -+ int groups_per_block; // Number of 20/24-bit sample groups per block -+ uint8_t *extra_samples; // Pointer to leftover samples from a frame -+ int extra_sample_count; // Number of leftover samples in the buffer -+} PCMBDContext; -+ -+static av_cold int pcm_bd_encode_init(AVCodecContext *avctx) -+{ -+ PCMBDContext *s = avctx->priv_data; -+ int quant, freq; -+ uint16_t frame_size; -+ uint8_t ch_layout = 0; -+ -+ switch (avctx->sample_rate) { -+ case 48000: -+ freq = 1; -+ break; -+ case 96000: -+ freq = 4; -+ break; -+ case 192000: -+ freq = 5; -+ break; -+ } -+ -+ switch (avctx->sample_fmt) { -+ case AV_SAMPLE_FMT_S16: -+ avctx->bits_per_coded_sample = 16; -+ quant = 1; -+ break; -+/* case AV_SAMPLE_FMT_S20: -+ avctx->bits_per_coded_sample = 20; -+ quant = 2; -+ break; -+*/ -+ case AV_SAMPLE_FMT_S32: -+ avctx->bits_per_coded_sample = 24; -+ quant = 3; -+ break; -+ } -+ -+ avctx->block_align = avctx->channels * avctx->bits_per_coded_sample / 8; -+ avctx->bit_rate = avctx->block_align * 8LL * avctx->sample_rate; -+ if (avctx->bit_rate > 19800000) { -+ av_log(avctx, AV_LOG_ERROR, "Too big bitrate: reduce sample rate, bitdepth or channels.\n"); -+ return AVERROR(EINVAL); -+ } -+ -+ if (avctx->sample_fmt == AV_SAMPLE_FMT_S16) { -+ switch (avctx->channels) { -+ case 1: -+ s->block_size = avctx->channels * 4; -+ break; -+ default: -+ s->block_size = avctx->channels * 2; -+ break; -+ } -+ s->samples_per_block = 1; -+ frame_size = 2008 / s->block_size; -+ } else { -+ switch (avctx->channels) { -+ case 1: -+ s->block_size = 2 * avctx->channels * avctx->bits_per_coded_sample / 8; -+ s->samples_per_block = 1; -+ break; -+ case 2: -+ case 4: -+ /* one group has all the samples needed */ -+ s->block_size = avctx->channels * avctx->bits_per_coded_sample / 8; -+ s->samples_per_block = 1; -+ s->groups_per_block = 2; -+ break; -+ case 8: -+ case 6: -+ /* two groups have all the samples needed */ -+ s->block_size = avctx->channels * avctx->bits_per_coded_sample / 8; -+ s->samples_per_block = 1; -+ // s->groups_per_block = 2; -+ break; -+ default: -+ /* need avctx->channels groups */ -+ s->block_size = 4 * avctx->channels * -+ avctx->bits_per_coded_sample / 8; -+ s->samples_per_block = 4; -+ s->groups_per_block = avctx->channels; -+ break; -+ } -+ -+ frame_size = FFALIGN(2008 / s->block_size, s->samples_per_block); -+ } -+ -+ switch(avctx->channel_layout) { -+ case AV_CH_LAYOUT_MONO: -+ ch_layout = 1; -+ break; -+ case AV_CH_LAYOUT_STEREO: -+ ch_layout = 3; -+ break; -+ case AV_CH_LAYOUT_5POINT1: -+ case AV_CH_LAYOUT_5POINT1_BACK: -+ ch_layout = 9; -+ break; -+ case AV_CH_LAYOUT_7POINT1: -+ ch_layout = 11; -+ break; -+ default: -+ av_log(avctx, AV_LOG_ERROR, "Not yet implemented ch layout!\n"); -+ } -+// description on the web: -+/* http://forum.doom9.org/showthread.php?t=152897 -+ -+It's a header. -+ -+size in bytes = 16 bits (big endian) -+channel assignment = 4 bits -+sampling frequency = 4 bits -+bits per sample = 2 bits -+start flag = 1 bit -+reserved = 5 bits -+ -+channel assignment -+1 = mono -+3 = stereo -+4 = 3/0 -+5 = 2/1 -+6 = 3/1 -+7 = 2/2 -+8 = 3/2 -+9 = 3/2+lfe -+10 = 3/4 -+11 = 3/4+lfe -+ -+sampling frequency -+1 = 48 kHz -+4 = 96 kHz -+5 = 192 kHz -+ -+bits per sample -+1 = 16 -+2 = 20 -+3 = 24 -+*/ -+ -+ s->header[2] = (ch_layout << 4) | (freq); -+ s->header[3] = (quant << 6) | 0x1 ; -+ -+ -+ avctx->frame_size = frame_size; // in num. of samples -+ -+ return 0; -+} -+ -+static int pcm_bd_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, -+ const AVFrame *frame, int *got_packet_ptr) -+{ -+ PCMBDContext *s = avctx->priv_data; -+ int samples, channels; -+ int64_t pkt_size = (frame->nb_samples / s->samples_per_block) * s->block_size + 4; -+ const int16_t *src16; -+ const int32_t *src32; -+ PutByteContext pb; -+ int ret; -+ -+ if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size, 0)) < 0) -+ return ret; -+ -+ AV_WB16(s->header, pkt_size - 4); -+ memcpy(avpkt->data, s->header, 4); -+ -+ src16 = (const int16_t *)frame->data[0]; -+ src32 = (const int32_t *)frame->data[0]; -+ -+ bytestream2_init_writer(&pb, avpkt->data + 4, avpkt->size - 4); -+ -+ int num_source_channels = FFALIGN(avctx->channels, 2); -+ // int num_source_channels = avctx->channels; -+ // int sample_size = (num_source_channels * -+ // (avctx->sample_fmt == AV_SAMPLE_FMT_S16 ? 16 : 24)) >> 3; -+ samples = frame->nb_samples * num_source_channels; -+ -+ switch (avctx->sample_fmt) { -+ case AV_SAMPLE_FMT_S16: -+ switch (avctx->channels) { -+ case 1: -+ do { -+ do { -+ channels = avctx->channels; -+ bytestream2_put_be16(&pb, *src16++); -+ } while (--channels); -+ bytestream2_put_be16(&pb, 0); -+ } while (--samples); -+ break; -+ case 2: -+ do { -+ bytestream2_put_be16(&pb, *src16++); -+ } while (--samples); -+ break; -+ case 6: -+ do { -+ bytestream2_put_be16(&pb, src16[0]); -+ bytestream2_put_be16(&pb, src16[1]); -+ bytestream2_put_be16(&pb, src16[2]); -+ bytestream2_put_be16(&pb, src16[4]); -+ bytestream2_put_be16(&pb, src16[5]); -+ bytestream2_put_be16(&pb, src16[3]); -+ src16+=6; -+ } while (--samples); -+ break; -+ case 8: -+ do { -+ bytestream2_put_be16(&pb, src16[0]); -+ bytestream2_put_be16(&pb, src16[1]); -+ bytestream2_put_be16(&pb, src16[2]); -+ bytestream2_put_be16(&pb, src16[6]); -+ bytestream2_put_be16(&pb, src16[4]); -+ bytestream2_put_be16(&pb, src16[5]); -+ bytestream2_put_be16(&pb, src16[7]); -+ bytestream2_put_be16(&pb, src16[3]); -+ src16+=8; -+ } while (--samples); -+ break; -+ -+ default: -+ av_log(avctx, AV_LOG_ERROR, "this ch config not implemented for s16!\n"); -+ break; -+ } -+ break; -+ case AV_SAMPLE_FMT_S32: -+ switch (avctx->channels) { -+ case 2: -+ case 4: -+ do { -+ bytestream2_put_be24(&pb, (*src32++) >> 8); -+ } while (--samples); -+ break; -+ case 8: -+ do { -+ bytestream2_put_be24(&pb, src32[0] >> 8); -+ bytestream2_put_be24(&pb, src32[1] >> 8); -+ bytestream2_put_be24(&pb, src32[2] >> 8); -+ bytestream2_put_be24(&pb, src32[6] >> 8); -+ bytestream2_put_be24(&pb, src32[4] >> 8); -+ bytestream2_put_be24(&pb, src32[5] >> 8); -+ bytestream2_put_be24(&pb, src32[7] >> 8); -+ bytestream2_put_be24(&pb, src32[3] >> 8); -+ src32+=8; -+ } while (--samples); -+ break; -+ case 6: -+ do { -+ bytestream2_put_be24(&pb, src32[0] >> 8); -+ bytestream2_put_be24(&pb, src32[1] >> 8); -+ bytestream2_put_be24(&pb, src32[2] >> 8); -+ bytestream2_put_be24(&pb, src32[4] >> 8); -+ bytestream2_put_be24(&pb, src32[5] >> 8); -+ bytestream2_put_be24(&pb, src32[3] >> 8); -+ src32+=6; -+ } while (--samples); -+ break; -+ case 1: -+ do { -+ do { -+ channels = avctx->channels; -+ bytestream2_put_be24(&pb, (*src32++) >> 8); -+ } while (--channels); -+ bytestream2_put_be24(&pb, 0); -+ } while (--samples); -+ break; -+ default: -+ av_log(avctx, AV_LOG_ERROR, "this bitdepth not implemented!\n"); -+ break; -+ } -+ break; -+ } -+ -+ avpkt->pts = frame->pts; -+ avpkt->size = pkt_size; -+ avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples); -+ *got_packet_ptr = 1; -+ -+ return 0; -+} -+ -+AVCodec ff_pcm_bluray_encoder = { -+ .name = "pcm_bluray", -+ .long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|24-bit big-endian for bluray media"), -+ .type = AVMEDIA_TYPE_AUDIO, -+ .id = AV_CODEC_ID_PCM_BLURAY, -+ .priv_data_size = sizeof(PCMBDContext), -+ .init = pcm_bd_encode_init, -+ .encode2 = pcm_bd_encode_frame, -+ .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME, -+ .supported_samplerates = (const int[]) { 48000, 96000, 192000, 0}, -+ .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, -+ AV_CH_LAYOUT_STEREO, -+ AV_CH_LAYOUT_5POINT1, -+ AV_CH_LAYOUT_5POINT1_BACK, -+ AV_CH_LAYOUT_7POINT1, -+ 0 }, -+ .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, -+ AV_SAMPLE_FMT_S32, -+ AV_SAMPLE_FMT_NONE }, -+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, -+}; ---- ./libavcodec/allcodecs.orig 2021-04-09 00:28:39.000000000 +0300 -+++ ./libavcodec/allcodecs.c 2021-12-06 15:45:03.333762281 +0300 -@@ -523,6 +523,7 @@ - /* PCM codecs */ - extern AVCodec ff_pcm_alaw_encoder; - extern AVCodec ff_pcm_alaw_decoder; -+extern AVCodec ff_pcm_bluray_encoder; - extern AVCodec ff_pcm_bluray_decoder; - extern AVCodec ff_pcm_dvd_encoder; - extern AVCodec ff_pcm_dvd_decoder; ---- ./libavcodec/Makefile.orig 2021-04-09 00:28:39.000000000 +0300 -+++ ./libavcodec/Makefile 2021-12-06 21:11:19.365842066 +0300 -@@ -789,6 +789,7 @@ - OBJS-$(CONFIG_PCM_ALAW_DECODER) += pcm.o - OBJS-$(CONFIG_PCM_ALAW_ENCODER) += pcm.o - OBJS-$(CONFIG_PCM_BLURAY_DECODER) += pcm-bluray.o -+OBJS-$(CONFIG_PCM_BLURAY_ENCODER) += pcm-bluenc.o - OBJS-$(CONFIG_PCM_DVD_DECODER) += pcm-dvd.o - OBJS-$(CONFIG_PCM_DVD_ENCODER) += pcm-dvdenc.o - OBJS-$(CONFIG_PCM_F16LE_DECODER) += pcm.o diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_99 b/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_99 deleted file mode 100644 index e53d07d9..00000000 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch_99 +++ /dev/null @@ -1,574 +0,0 @@ ---- ffmpeg-4.4/libavcodec/pcm-bluenc.c 2022-04-24 09:45:43.921091116 +0300 -+++ ffmpeg-4.4/libavcodec/pcm-bluenc.c 2022-04-24 16:07:28.537982120 +0300 -@@ -1,6 +1,5 @@ - /* - * LPCM codecs for PCM formats found in Blu-ray m2ts streams -- * Copyright (c) 2018 Paul B Mahol - * - * This file is part of FFmpeg. - * -@@ -19,314 +18,305 @@ - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -+#include "libavutil/channel_layout.h" - #include "avcodec.h" - #include "bytestream.h" -+//#include "codec_internal.h" -+#include "encode.h" - #include "internal.h" - --typedef struct PCMBDContext { -- uint8_t header[4]; // Header added to every frame -- int block_size; // Size of a block of samples in bytes -- int samples_per_block; // Number of samples per channel per block -- int groups_per_block; // Number of 20/24-bit sample groups per block -- uint8_t *extra_samples; // Pointer to leftover samples from a frame -- int extra_sample_count; // Number of leftover samples in the buffer --} PCMBDContext; -+typedef struct BlurayPCMEncContext { -+ uint16_t header; // Header added to every frame -+} BlurayPCMEncContext; - --static av_cold int pcm_bd_encode_init(AVCodecContext *avctx) -+static av_cold int pcm_bluray_encode_init(AVCodecContext *avctx) - { -- PCMBDContext *s = avctx->priv_data; -- int quant, freq; -- uint16_t frame_size; -- uint8_t ch_layout = 0; -- -+ BlurayPCMEncContext *s = avctx->priv_data; -+ uint8_t ch_layout; -+ int quant, freq, frame_size; -+ -+ switch(avctx->sample_fmt) { -+ case AV_SAMPLE_FMT_S16: -+ avctx->bits_per_coded_sample = 16; -+ frame_size = 240; -+ quant =1; -+ break; -+ case AV_SAMPLE_FMT_S32: -+ avctx->bits_per_coded_sample = 24; -+ frame_size = 360; -+ quant =3; -+ break; -+ default: -+ return AVERROR_BUG; -+ } -+ - switch (avctx->sample_rate) { - case 48000: - freq = 1; - break; - case 96000: -+ //frame_size *= 2; - freq = 4; - break; - case 192000: -- freq = 5; -- break; -+ //frame_size *= 4; -+ freq = 5; -+ break; -+ default: -+ return AVERROR_BUG; - } - -- switch (avctx->sample_fmt) { -- case AV_SAMPLE_FMT_S16: -- avctx->bits_per_coded_sample = 16; -- quant = 1; -+ //frame_size *= avctx->channels; -+ -+ switch (avctx->channel_layout) { -+ case AV_CH_LAYOUT_MONO: -+ ch_layout = 1; - break; --/* case AV_SAMPLE_FMT_S20: -- avctx->bits_per_coded_sample = 20; -- quant = 2; -+ case AV_CH_LAYOUT_STEREO: -+ ch_layout = 3; - break; --*/ -- case AV_SAMPLE_FMT_S32: -- avctx->bits_per_coded_sample = 24; -- quant = 3; -+ case AV_CH_LAYOUT_SURROUND: -+ ch_layout = 4; - break; -- } -- -- avctx->block_align = avctx->channels * avctx->bits_per_coded_sample / 8; -- avctx->bit_rate = avctx->block_align * 8LL * avctx->sample_rate; -- if (avctx->bit_rate > 19800000) { -- av_log(avctx, AV_LOG_ERROR, "Too big bitrate: reduce sample rate, bitdepth or channels.\n"); -- return AVERROR(EINVAL); -- } -- -- if (avctx->sample_fmt == AV_SAMPLE_FMT_S16) { -- switch (avctx->channels) { -- case 1: -- s->block_size = avctx->channels * 4; -- break; -- default: -- s->block_size = avctx->channels * 2; -+ case AV_CH_LAYOUT_2_1: -+ ch_layout = 5; - break; -- } -- s->samples_per_block = 1; -- frame_size = 2008 / s->block_size; -- } else { -- switch (avctx->channels) { -- case 1: -- s->block_size = 2 * avctx->channels * avctx->bits_per_coded_sample / 8; -- s->samples_per_block = 1; -- break; -- case 2: -- case 4: -- /* one group has all the samples needed */ -- s->block_size = avctx->channels * avctx->bits_per_coded_sample / 8; -- s->samples_per_block = 1; -- s->groups_per_block = 2; -- break; -- case 8: -- case 6: -- /* two groups have all the samples needed */ -- s->block_size = avctx->channels * avctx->bits_per_coded_sample / 8; -- s->samples_per_block = 1; -- // s->groups_per_block = 2; -- break; -- default: -- /* need avctx->channels groups */ -- s->block_size = 4 * avctx->channels * -- avctx->bits_per_coded_sample / 8; -- s->samples_per_block = 4; -- s->groups_per_block = avctx->channels; -- break; -- } -- -- frame_size = FFALIGN(2008 / s->block_size, s->samples_per_block); -+ case AV_CH_LAYOUT_4POINT0: -+ ch_layout = 6; -+ break; -+ case AV_CH_LAYOUT_2_2: -+ ch_layout = 7; -+ break; -+ case AV_CH_LAYOUT_5POINT0: -+ ch_layout = 8; -+ break; -+ case AV_CH_LAYOUT_5POINT1_BACK: -+ ch_layout = 9; -+ break; -+ case AV_CH_LAYOUT_7POINT0: -+ ch_layout = 10; -+ break; -+ case AV_CH_LAYOUT_7POINT1: -+ ch_layout = 11; -+ break; -+ default: -+ return AVERROR_BUG; - } - -- switch(avctx->channel_layout) { -- case AV_CH_LAYOUT_MONO: -- ch_layout = 1; -- break; -- case AV_CH_LAYOUT_STEREO: -- ch_layout = 3; -- break; -- case AV_CH_LAYOUT_5POINT1: -- case AV_CH_LAYOUT_5POINT1_BACK: -- ch_layout = 9; -- break; -- case AV_CH_LAYOUT_7POINT1: -- ch_layout = 11; -- break; -- default: -- av_log(avctx, AV_LOG_ERROR, "Not yet implemented ch layout!\n"); -- } --// description on the web: --/* http://forum.doom9.org/showthread.php?t=152897 -- --It's a header. -- --size in bytes = 16 bits (big endian) --channel assignment = 4 bits --sampling frequency = 4 bits --bits per sample = 2 bits --start flag = 1 bit --reserved = 5 bits -- --channel assignment --1 = mono --3 = stereo --4 = 3/0 --5 = 2/1 --6 = 3/1 --7 = 2/2 --8 = 3/2 --9 = 3/2+lfe --10 = 3/4 --11 = 3/4+lfe -- --sampling frequency --1 = 48 kHz --4 = 96 kHz --5 = 192 kHz -- --bits per sample --1 = 16 --2 = 20 --3 = 24 --*/ -- -- s->header[2] = (ch_layout << 4) | (freq); -- s->header[3] = (quant << 6) | 0x1 ; -- -- -- avctx->frame_size = frame_size; // in num. of samples -+ s->header = (((ch_layout << 4) | freq) << 8) | (quant << 6); -+ avctx->frame_size = frame_size; - - return 0; - } - --static int pcm_bd_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, -- const AVFrame *frame, int *got_packet_ptr) -+static int pcm_bluray_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, -+ const AVFrame *frame, int *got_packet_ptr) - { -- PCMBDContext *s = avctx->priv_data; -- int samples, channels; -- int64_t pkt_size = (frame->nb_samples / s->samples_per_block) * s->block_size + 4; -+ BlurayPCMEncContext *s = avctx->priv_data; -+ int sample_size, samples, channel, num_dest_channels; - const int16_t *src16; - const int32_t *src32; -+ unsigned pkt_size; - PutByteContext pb; - int ret; - -- if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size, 0)) < 0) -+ num_dest_channels = FFALIGN(avctx->channels, 2); -+ sample_size = (num_dest_channels * -+ (avctx->sample_fmt == AV_SAMPLE_FMT_S16 ? 16 : 24)) >> 3; -+ samples = frame->nb_samples; -+ -+ pkt_size = sample_size * samples + 4; -+ -+ if ((ret = ff_get_encode_buffer(avctx, avpkt, pkt_size, 0)) < 0) - return ret; - -- AV_WB16(s->header, pkt_size - 4); -- memcpy(avpkt->data, s->header, 4); -+ AV_WB16(avpkt->data, pkt_size - 4); -+ AV_WB16(avpkt->data + 2, s->header); - - src16 = (const int16_t *)frame->data[0]; - src32 = (const int32_t *)frame->data[0]; - - bytestream2_init_writer(&pb, avpkt->data + 4, avpkt->size - 4); - -- int num_source_channels = FFALIGN(avctx->channels, 2); -- // int num_source_channels = avctx->channels; -- // int sample_size = (num_source_channels * -- // (avctx->sample_fmt == AV_SAMPLE_FMT_S16 ? 16 : 24)) >> 3; -- samples = frame->nb_samples * num_source_channels; -- -- switch (avctx->sample_fmt) { -- case AV_SAMPLE_FMT_S16: -- switch (avctx->channels) { -- case 1: -- do { -- do { -- channels = avctx->channels; -- bytestream2_put_be16(&pb, *src16++); -- } while (--channels); -- bytestream2_put_be16(&pb, 0); -- } while (--samples); -- break; -- case 2: -- do { -- bytestream2_put_be16(&pb, *src16++); -- } while (--samples); -- break; -- case 6: -- do { -- bytestream2_put_be16(&pb, src16[0]); -- bytestream2_put_be16(&pb, src16[1]); -- bytestream2_put_be16(&pb, src16[2]); -- bytestream2_put_be16(&pb, src16[4]); -- bytestream2_put_be16(&pb, src16[5]); -- bytestream2_put_be16(&pb, src16[3]); -- src16+=6; -- } while (--samples); -- break; -- case 8: -- do { -- bytestream2_put_be16(&pb, src16[0]); -- bytestream2_put_be16(&pb, src16[1]); -- bytestream2_put_be16(&pb, src16[2]); -- bytestream2_put_be16(&pb, src16[6]); -- bytestream2_put_be16(&pb, src16[4]); -- bytestream2_put_be16(&pb, src16[5]); -- bytestream2_put_be16(&pb, src16[7]); -- bytestream2_put_be16(&pb, src16[3]); -- src16+=8; -- } while (--samples); -- break; -- -- default: -- av_log(avctx, AV_LOG_ERROR, "this ch config not implemented for s16!\n"); -+ switch (avctx->channel_layout) { -+ /* cases with same number of source and coded channels */ -+ case AV_CH_LAYOUT_STEREO: -+ case AV_CH_LAYOUT_4POINT0: -+ case AV_CH_LAYOUT_2_2: -+ samples *= num_dest_channels; -+ if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) { -+#if HAVE_BIGENDIAN -+ bytestream2_put_bufferu(&pb, frame->data[0], samples * 2); -+#else -+ do { -+ bytestream2_put_be16u(&pb, *src16++); -+ } while (--samples); -+#endif -+ } else { -+ do { -+ bytestream2_put_be24u(&pb, (*src32++) >> 8); -+ } while (--samples); -+ } - break; -+ /* cases where number of source channels = coded channels + 1 */ -+ case AV_CH_LAYOUT_MONO: -+ case AV_CH_LAYOUT_SURROUND: -+ case AV_CH_LAYOUT_2_1: -+ case AV_CH_LAYOUT_5POINT0: -+ if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) { -+ do { -+#if HAVE_BIGENDIAN -+ bytestream2_put_bufferu(&pb, (const uint8_t *)src16, avctx->ch_layout.nb_channels * 2); -+ src16 += avctx->channels; -+#else -+ channel = avctx->channels; -+ do { -+ bytestream2_put_be16u(&pb, *src16++); -+ } while (--channel); -+#endif -+ bytestream2_put_ne16(&pb, 0); -+ } while (--samples); -+ } else { -+ do { -+ channel = avctx->channels; -+ do { -+ bytestream2_put_be24u(&pb, (*src32++) >> 8); -+ } while (--channel); -+ bytestream2_put_ne24(&pb, 0); -+ } while (--samples); - } - break; -- case AV_SAMPLE_FMT_S32: -- switch (avctx->channels) { -- case 2: -- case 4: -- do { -- bytestream2_put_be24(&pb, (*src32++) >> 8); -- } while (--samples); -- break; -- case 8: -- do { -- bytestream2_put_be24(&pb, src32[0] >> 8); -- bytestream2_put_be24(&pb, src32[1] >> 8); -- bytestream2_put_be24(&pb, src32[2] >> 8); -- bytestream2_put_be24(&pb, src32[6] >> 8); -- bytestream2_put_be24(&pb, src32[4] >> 8); -- bytestream2_put_be24(&pb, src32[5] >> 8); -- bytestream2_put_be24(&pb, src32[7] >> 8); -- bytestream2_put_be24(&pb, src32[3] >> 8); -- src32+=8; -- } while (--samples); -- break; -- case 6: -- do { -- bytestream2_put_be24(&pb, src32[0] >> 8); -- bytestream2_put_be24(&pb, src32[1] >> 8); -- bytestream2_put_be24(&pb, src32[2] >> 8); -- bytestream2_put_be24(&pb, src32[4] >> 8); -- bytestream2_put_be24(&pb, src32[5] >> 8); -- bytestream2_put_be24(&pb, src32[3] >> 8); -- src32+=6; -- } while (--samples); -- break; -- case 1: -- do { -- do { -- channels = avctx->channels; -- bytestream2_put_be24(&pb, (*src32++) >> 8); -- } while (--channels); -- bytestream2_put_be24(&pb, 0); -- } while (--samples); -- break; -- default: -- av_log(avctx, AV_LOG_ERROR, "this bitdepth not implemented!\n"); -- break; -- } -- break; -+ /* remapping: L, R, C, LBack, RBack, LF */ -+ case AV_CH_LAYOUT_5POINT1_BACK: -+ if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) { -+ do { -+ bytestream2_put_be16u(&pb, src16[0]); -+ bytestream2_put_be16u(&pb, src16[1]); -+ bytestream2_put_be16u(&pb, src16[2]); -+ bytestream2_put_be16u(&pb, src16[4]); -+ bytestream2_put_be16u(&pb, src16[5]); -+ bytestream2_put_be16u(&pb, src16[3]); -+ src16 += 6; -+ } while (--samples); -+ } else { -+ do { -+ bytestream2_put_be24u(&pb, src32[0] >> 8); -+ bytestream2_put_be24u(&pb, src32[1] >> 8); -+ bytestream2_put_be24u(&pb, src32[2] >> 8); -+ bytestream2_put_be24u(&pb, src32[4] >> 8); -+ bytestream2_put_be24u(&pb, src32[5] >> 8); -+ bytestream2_put_be24u(&pb, src32[3] >> 8); -+ src32 += 6; -+ } while (--samples); -+ } -+ break; -+ /* remapping: L, R, C, LSide, LBack, RBack, RSide, */ -+ case AV_CH_LAYOUT_7POINT0: -+ if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) { -+ do { -+ bytestream2_put_be16u(&pb, src16[0]); -+ bytestream2_put_be16u(&pb, src16[1]); -+ bytestream2_put_be16u(&pb, src16[2]); -+ bytestream2_put_be16u(&pb, src16[5]); -+ bytestream2_put_be16u(&pb, src16[3]); -+ bytestream2_put_be16u(&pb, src16[4]); -+ bytestream2_put_be16u(&pb, src16[6]); -+ src16 += 7; -+ bytestream2_put_ne16(&pb, 0); -+ } while (--samples); -+ } else { -+ do { -+ bytestream2_put_be24u(&pb, src32[0] >> 8); -+ bytestream2_put_be24u(&pb, src32[1] >> 8); -+ bytestream2_put_be24u(&pb, src32[2] >> 8); -+ bytestream2_put_be24u(&pb, src32[5] >> 8); -+ bytestream2_put_be24u(&pb, src32[3] >> 8); -+ bytestream2_put_be24u(&pb, src32[4] >> 8); -+ bytestream2_put_be24u(&pb, src32[6] >> 8); -+ src32 += 7; -+ bytestream2_put_ne24(&pb, 0); -+ } while (--samples); -+ } -+ break; -+ /* remapping: L, R, C, LSide, LBack, RBack, RSide, LF */ -+ case AV_CH_LAYOUT_7POINT1: -+ if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) { -+ do { -+ bytestream2_put_be16u(&pb, src16[0]); -+ bytestream2_put_be16u(&pb, src16[1]); -+ bytestream2_put_be16u(&pb, src16[2]); -+ bytestream2_put_be16u(&pb, src16[6]); -+ bytestream2_put_be16u(&pb, src16[4]); -+ bytestream2_put_be16u(&pb, src16[5]); -+ bytestream2_put_be16u(&pb, src16[7]); -+ bytestream2_put_be16u(&pb, src16[3]); -+ src16 += 8; -+ } while (--samples); -+ } else { -+ do { -+ bytestream2_put_be24u(&pb, src32[0]); -+ bytestream2_put_be24u(&pb, src32[1]); -+ bytestream2_put_be24u(&pb, src32[2]); -+ bytestream2_put_be24u(&pb, src32[6]); -+ bytestream2_put_be24u(&pb, src32[4]); -+ bytestream2_put_be24u(&pb, src32[5]); -+ bytestream2_put_be24u(&pb, src32[7]); -+ bytestream2_put_be24u(&pb, src32[3]); -+ src32 += 8; -+ } while (--samples); -+ } -+ break; -+ default: -+ return AVERROR_BUG; - } - -- avpkt->pts = frame->pts; -- avpkt->size = pkt_size; -+ avpkt->pts = frame->pts; - avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples); - *got_packet_ptr = 1; - - return 0; - } - --AVCodec ff_pcm_bluray_encoder = { -- .name = "pcm_bluray", -- .long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|24-bit big-endian for bluray media"), -- .type = AVMEDIA_TYPE_AUDIO, -- .id = AV_CODEC_ID_PCM_BLURAY, -- .priv_data_size = sizeof(PCMBDContext), -- .init = pcm_bd_encode_init, -- .encode2 = pcm_bd_encode_frame, -- .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME, -- .supported_samplerates = (const int[]) { 48000, 96000, 192000, 0}, -- .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, -- AV_CH_LAYOUT_STEREO, -- AV_CH_LAYOUT_5POINT1, -- AV_CH_LAYOUT_5POINT1_BACK, -- AV_CH_LAYOUT_7POINT1, -- 0 }, -- .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, -- AV_SAMPLE_FMT_S32, -- AV_SAMPLE_FMT_NONE }, -- .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, -+const AVCodec ff_pcm_bluray_encoder = { -+ .name = "pcm_bluray", -+ .long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for Blu-ray media"), -+ .type = AVMEDIA_TYPE_AUDIO, -+ .id = AV_CODEC_ID_PCM_BLURAY, -+ .priv_data_size = sizeof(BlurayPCMEncContext), -+ .init = pcm_bluray_encode_init, -+ .encode2 = pcm_bluray_encode_frame, -+ .supported_samplerates = (const int[]) { 48000, 96000, 192000, 0 }, -+//#define FF_API_OLD_CHANNEL_LAYOUT 1 -+#if 1 -+ .channel_layouts = (const uint64_t[]) { -+ AV_CH_LAYOUT_MONO, -+ AV_CH_LAYOUT_STEREO, -+ AV_CH_LAYOUT_SURROUND, -+ AV_CH_LAYOUT_2_1, -+ AV_CH_LAYOUT_4POINT0, -+ AV_CH_LAYOUT_2_2, -+ AV_CH_LAYOUT_5POINT0, -+ AV_CH_LAYOUT_5POINT1_BACK, -+ AV_CH_LAYOUT_7POINT0, -+ AV_CH_LAYOUT_7POINT1, -+ 0 }, -+#endif -+#if 0 -+ .p.ch_layouts = (const AVChannelLayout[]) { -+ AV_CHANNEL_LAYOUT_MONO, -+ AV_CHANNEL_LAYOUT_STEREO, -+ AV_CHANNEL_LAYOUT_SURROUND, -+ AV_CHANNEL_LAYOUT_2_1, -+ AV_CHANNEL_LAYOUT_4POINT0, -+ AV_CHANNEL_LAYOUT_2_2, -+ AV_CHANNEL_LAYOUT_5POINT0, -+ AV_CHANNEL_LAYOUT_5POINT1, -+ AV_CHANNEL_LAYOUT_7POINT0, -+ AV_CHANNEL_LAYOUT_7POINT1, -+ { 0 } }, -+#endif -+ .sample_fmts = (const enum AVSampleFormat[]) { -+ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, -+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, -+ .capabilities = AV_CODEC_CAP_DR1, - }; diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch0 b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch0 new file mode 100644 index 00000000..7deb9356 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch0 @@ -0,0 +1,33 @@ +--- a/libavcodec/aaccoder.c ++++ b/libavcodec/aaccoder.c +@@ -60,6 +60,8 @@ + * replace low energy non zero bands */ + #define NOISE_LAMBDA_REPLACE 1.948f + ++#undef B0 ++ + #include "libavcodec/aaccoder_trellis.h" + + /** +--- a/libavcodec/hevc_mvs.c ++++ b/libavcodec/hevc_mvs.c +@@ -25,6 +25,8 @@ + #include "hevcdec.h" + #include "threadframe.h" + ++#undef B0 ++ + static const uint8_t l0_l1_cand_idx[12][2] = { + { 0, 1, }, + { 1, 0, }, +--- a/libavcodec/opus_pvq.c ++++ b/libavcodec/opus_pvq.c +@@ -31,6 +31,8 @@ + #define CELT_PVQ_U(n, k) (ff_celt_pvq_u_row[FFMIN(n, k)][FFMAX(n, k)]) + #define CELT_PVQ_V(n, k) (CELT_PVQ_U(n, k) + CELT_PVQ_U(n, (k) + 1)) + ++#undef B0 ++ + static inline int16_t celt_cos(int16_t x) + { + x = (MUL16(x, x) + 4096) >> 13; diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch1 b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch1 new file mode 100644 index 00000000..e157d3f3 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch1 @@ -0,0 +1,11 @@ +--- a/fftools/cmdutils.c ++++ b/fftools/cmdutils.c +@@ -59,7 +59,7 @@ + AVDictionary *swr_opts; + AVDictionary *format_opts, *codec_opts; + +-int hide_banner = 0; ++int hide_banner = 1; + + void uninit_opts(void) + { diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch9 b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch10 similarity index 75% rename from cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch9 rename to cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch10 index 0cf24e74..c94880d0 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch9 +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch10 @@ -1,8 +1,6 @@ -diff --git a/libavutil/hwcontext_cuda.c b/libavutil/hwcontext_cuda.c -index 718a449b6e..84685fe1d9 100644 --- a/libavutil/hwcontext_cuda.c +++ b/libavutil/hwcontext_cuda.c -@@ -269,9 +269,11 @@ static void cuda_device_uninit(AVHWDeviceContext *device_ctx) +@@ -286,9 +286,11 @@ CudaFunctions *cu = hwctx->internal->cuda_dl; if (hwctx->internal->is_allocated && hwctx->cuda_ctx) { @@ -14,7 +12,7 @@ index 718a449b6e..84685fe1d9 100644 CHECK_CU(cu->cuCtxDestroy(hwctx->cuda_ctx)); hwctx->cuda_ctx = NULL; -@@ -321,7 +323,7 @@ static int cuda_context_init(AVHWDeviceContext *device_ctx, int flags) { +@@ -338,7 +340,7 @@ cu = hwctx->internal->cuda_dl; hwctx->internal->flags = flags; @@ -23,7 +21,7 @@ index 718a449b6e..84685fe1d9 100644 if (flags & AV_CUDA_USE_PRIMARY_CONTEXT) { ret = CHECK_CU(cu->cuDevicePrimaryCtxGetState(hwctx->internal->cuda_device, &dev_flags, &dev_active)); -@@ -342,7 +344,9 @@ static int cuda_context_init(AVHWDeviceContext *device_ctx, int flags) { +@@ -359,7 +361,9 @@ hwctx->internal->cuda_device)); if (ret < 0) return ret; diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch2 b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch2 similarity index 79% rename from cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch2 rename to cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch2 index e3a51af5..6e1a7fc6 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch2 +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch2 @@ -1,9 +1,8 @@ -diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c ---- a/libavformat/mpegtsenc.c 2021-04-08 15:28:40.000000000 -0600 -+++ b/libavformat/mpegtsenc.c 2021-05-29 11:47:43.834039463 -0600 -@@ -81,9 +81,11 @@ - int64_t sdt_period; /* SDT period in PCR time base */ +--- a/libavformat/mpegtsenc.c ++++ b/libavformat/mpegtsenc.c +@@ -84,9 +84,11 @@ int64_t pat_period; /* PAT/PMT period in PCR time base */ + int64_t nit_period; /* NIT period in PCR time base */ int nb_services; - int64_t first_pcr; int first_dts_checked; @@ -15,7 +14,7 @@ diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c int mux_rate; ///< set to 1 when VBR int pes_payload_size; int64_t total_size; -@@ -243,7 +245,7 @@ +@@ -252,7 +254,7 @@ int data_st_warning; int64_t pcr_period; /* PCR period in PCR time base */ @@ -24,7 +23,7 @@ diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c /* For Opus */ int opus_queued_samples; -@@ -833,18 +835,18 @@ +@@ -945,18 +947,18 @@ return 0; } @@ -48,7 +47,7 @@ diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c tp_extra_header = AV_RB32(&tp_extra_header); avio_write(s->pb, (unsigned char *) &tp_extra_header, sizeof(tp_extra_header)); -@@ -930,9 +932,6 @@ +@@ -1042,9 +1044,6 @@ else ts_st->pcr_period = 1; } @@ -58,7 +57,7 @@ diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c } static void select_pcr_streams(AVFormatContext *s) -@@ -993,6 +992,7 @@ +@@ -1107,6 +1106,7 @@ if (s->max_delay < 0) /* Not set by the caller */ s->max_delay = 0; @@ -66,7 +65,7 @@ diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c // round up to a whole number of TS packets ts->pes_payload_size = (ts->pes_payload_size + 14 + 183) / 184 * 184 - 14; -@@ -1048,7 +1048,9 @@ +@@ -1166,7 +1166,9 @@ /* MPEG pid values < 16 are reserved. Applications which set st->id in * this range are assigned a calculated pid. */ if (st->id < 16) { @@ -77,7 +76,7 @@ diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c switch (st->codecpar->codec_type) { case AVMEDIA_TYPE_VIDEO: ts_st->pid = ts->m2ts_video_pid++; -@@ -1075,9 +1077,9 @@ +@@ -1193,9 +1195,9 @@ av_log(s, AV_LOG_ERROR, "Cannot automatically assign PID for stream %d\n", st->index); return AVERROR(EINVAL); } @@ -89,36 +88,41 @@ diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c } else { ts_st->pid = st->id; } -@@ -1144,8 +1146,12 @@ - +@@ -1263,9 +1265,14 @@ ts->last_pat_ts = AV_NOPTS_VALUE; ts->last_sdt_ts = AV_NOPTS_VALUE; + ts->last_nit_ts = AV_NOPTS_VALUE; - ts->pat_period = av_rescale(ts->pat_period_us, PCR_TIME_BASE, AV_TIME_BASE); - ts->sdt_period = av_rescale(ts->sdt_period_us, PCR_TIME_BASE, AV_TIME_BASE); +- ts->nit_period = av_rescale(ts->nit_period_us, PCR_TIME_BASE, AV_TIME_BASE); + ts->pat_period = ts->pat_period_us < 0 ? -1 : + av_rescale(ts->pat_period_us, PCR_TIME_BASE, AV_TIME_BASE); + ts->sdt_period = ts->sdt_period_us < 0 ? -1 : + av_rescale(ts->sdt_period_us, PCR_TIME_BASE, AV_TIME_BASE); ++ ts->nit_period = ts->nit_period_us < 0 ? -1 : ++ av_rescale(ts->nit_period_us, PCR_TIME_BASE, AV_TIME_BASE); + ts->pcr = 0; + ts->pcr_pos = 0; - if (ts->mux_rate == 1) - av_log(s, AV_LOG_VERBOSE, "muxrate VBR, "); -@@ -1153,34 +1159,37 @@ + /* assign provider name */ + provider = av_dict_get(s->metadata, "service_provider", NULL, 0); +@@ -1281,8 +1288,8 @@ av_log(s, AV_LOG_VERBOSE, "muxrate %d, ", ts->mux_rate); av_log(s, AV_LOG_VERBOSE, - "sdt every %"PRId64" ms, pat/pmt every %"PRId64" ms\n", + "sdt every %"PRId64" ms, pat/pmt every %"PRId64" ms", - av_rescale(ts->sdt_period, 1000, PCR_TIME_BASE), - av_rescale(ts->pat_period, 1000, PCR_TIME_BASE)); + ts->sdt_period < 0 ? -1 : av_rescale(ts->sdt_period, 1000, PCR_TIME_BASE), + ts->pat_period < 0 ? -1 : av_rescale(ts->pat_period, 1000, PCR_TIME_BASE)); - - return 0; + if (ts->flags & MPEGTS_FLAG_NIT) + av_log(s, AV_LOG_VERBOSE, ", nit every %"PRId64" ms", av_rescale(ts->nit_period, 1000, PCR_TIME_BASE)); + av_log(s, AV_LOG_VERBOSE, "\n"); +@@ -1291,36 +1298,40 @@ } - /* send SDT, PAT and PMT tables regularly */ --static void retransmit_si_info(AVFormatContext *s, int force_pat, int force_sdt, int64_t pcr) -+static void retransmit_si_info(AVFormatContext *s, int force_pat, int force_sdt) + /* send SDT, NIT, PAT and PMT tables regularly */ +-static void retransmit_si_info(AVFormatContext *s, int force_pat, int force_sdt, int force_nit, int64_t pcr) ++static void retransmit_si_info(AVFormatContext *s, int force_pat, int force_sdt, int force_nit) { MpegTSWrite *ts = s->priv_data; int i; @@ -139,6 +143,13 @@ diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c - mpegts_write_pat(s); - for (i = 0; i < ts->nb_services; i++) - mpegts_write_pmt(s, ts->services[i]); +- } +- if ((pcr != AV_NOPTS_VALUE && ts->last_nit_ts == AV_NOPTS_VALUE) || +- (pcr != AV_NOPTS_VALUE && pcr - ts->last_nit_ts >= ts->nit_period) || +- force_nit +- ) { +- if (pcr != AV_NOPTS_VALUE) +- ts->last_nit_ts = FFMAX(pcr, ts->last_nit_ts); + if (ts->sdt_period >= 0) { + int64_t pcr = get_pcr(ts, s->pb); + if (ts->last_sdt_ts == AV_NOPTS_VALUE || pcr >= ts->last_sdt_ts + ts->sdt_period) @@ -157,11 +168,21 @@ diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c + mpegts_write_pat(s); + for (i = 0; i < ts->nb_services; i++) + mpegts_write_pmt(s, ts->services[i]); ++ } ++ } ++ if (ts->nit_period >= 0) { ++ int64_t pcr = get_pcr(ts, s->pb); ++ if (ts->last_nit_ts == AV_NOPTS_VALUE || pcr >= ts->last_nit_ts + ts->nit_period) ++ force_nit = 1; ++ if (force_nit) { ++ ts->last_nit_ts = pcr; + if (ts->flags & MPEGTS_FLAG_NIT) + mpegts_write_nit(s); + } } } -@@ -1217,25 +1226,29 @@ +@@ -1357,25 +1368,29 @@ static void mpegts_insert_pcr_only(AVFormatContext *s, AVStream *st) { MpegTSWrite *ts = s->priv_data; @@ -197,18 +218,18 @@ diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c /* stuffing bytes */ memset(q, 0xFF, TS_PACKET_SIZE - (q - buf)); -@@ -1303,9 +1316,9 @@ - uint8_t *q; - int val, is_start, len, header_len, write_pcr, is_dvb_subtitle, is_dvb_teletext, flags; +@@ -1475,9 +1490,9 @@ int afc_len, stuffing_len; + int is_dvb_subtitle = (st->codecpar->codec_id == AV_CODEC_ID_DVB_SUBTITLE); + int is_dvb_teletext = (st->codecpar->codec_id == AV_CODEC_ID_DVB_TELETEXT); - int64_t delay = av_rescale(s->max_delay, 90000, AV_TIME_BASE); int force_pat = st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && key && !ts_st->prev_payload_key; int force_sdt = 0; + int64_t pcr; + int force_nit = 0; av_assert0(ts_st->payload != buf || st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO); - if (ts->flags & MPEGTS_FLAG_PAT_PMT_AT_FRAMES && st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { -@@ -1320,20 +1333,19 @@ +@@ -1494,21 +1509,19 @@ is_start = 1; while (payload_size > 0) { @@ -218,17 +239,18 @@ diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c - else if (dts != AV_NOPTS_VALUE) - pcr = (dts - delay) * 300; - -- retransmit_si_info(s, force_pat, force_sdt, pcr); +- retransmit_si_info(s, force_pat, force_sdt, force_nit, pcr); - force_pat = 0; - force_sdt = 0; +- force_nit = 0; + // add 11, pcr references the last byte of program clock reference base + ts->pcr_pos = avio_tell(s->pb) + 11; + pcr = ts->pcr = ts->mux_rate != 1 ? + av_rescale(ts->pcr_pos, 8 * PCR_TIME_BASE, ts->mux_rate) : + (dts == AV_NOPTS_VALUE ? 0 : (dts - ts->delay) * 300); -+ if (force_pat || force_sdt) { -+ retransmit_si_info(s, force_pat, force_sdt); -+ force_pat = force_sdt = 0; ++ if (force_pat || force_sdt || force_nit) { ++ retransmit_si_info(s, force_pat, force_sdt, force_nit); ++ force_pat = force_sdt = force_nit = 0; + } write_pcr = 0; @@ -238,7 +260,7 @@ diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c if (pcr >= ts->next_pcr) { int64_t next_pcr = INT64_MAX; for (int i = 0; i < s->nb_streams; i++) { -@@ -1343,36 +1355,43 @@ +@@ -1518,36 +1531,43 @@ AVStream *st2 = s->streams[st2_index]; MpegTSWriteStream *ts_st2 = st2->priv_data; if (ts_st2->pcr_period) { @@ -247,7 +269,7 @@ diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c - if (st2 != st) { + if (pcr >= ts_st2->pcr_timer) { + ts_st2->pcr_timer = pcr + ts_st2->pcr_period; -+ if (st2 != st) { ++ if (st2 != st) { mpegts_insert_pcr_only(s, st2); - pcr = get_pcr(ts); } else { @@ -299,7 +321,7 @@ diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c /* prepare packet header */ q = buf; *q++ = 0x47; -@@ -1400,7 +1419,6 @@ +@@ -1576,7 +1596,6 @@ if (write_pcr) { set_af_flag(buf, 0x10); q = get_ts_payload_start(buf); @@ -307,7 +329,7 @@ diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c if (dts != AV_NOPTS_VALUE && dts < pcr / 300) av_log(s, AV_LOG_WARNING, "dts < pcr, TS is invalid\n"); extend_af(buf, write_pcr_bits(q, pcr)); -@@ -1678,8 +1696,8 @@ +@@ -1840,8 +1859,8 @@ uint8_t *data = NULL; MpegTSWrite *ts = s->priv_data; MpegTSWriteStream *ts_st = st->priv_data; @@ -317,10 +339,10 @@ diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c + const int64_t max_audio_delay = ts->delay / 2; int64_t dts = pkt->dts, pts = pkt->pts; int opus_samples = 0; - buffer_size_t side_data_size; -@@ -1699,9 +1717,9 @@ - } + size_t side_data_size; +@@ -1861,9 +1880,9 @@ + if (ts->copyts < 1) { if (pts != AV_NOPTS_VALUE) - pts += delay; + pts += delay_ticks2; @@ -330,7 +352,7 @@ diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c } if (!ts_st->first_timestamp_checked && (pts == AV_NOPTS_VALUE || dts == AV_NOPTS_VALUE)) { -@@ -2098,8 +2116,10 @@ +@@ -2262,8 +2281,10 @@ 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_SERVICE_TYPE_HEVC_DIGITAL_HDTV }, 0x01, 0xff, ENC, "mpegts_service_type" }, { "mpegts_pmt_start_pid", "Set the first pid of the PMT.", OFFSET(pmt_start_pid), AV_OPT_TYPE_INT, { .i64 = 0x1000 }, FIRST_OTHER_PID, LAST_OTHER_PID, ENC }, @@ -342,7 +364,7 @@ diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c { "mpegts_m2ts_mode", "Enable m2ts mode.", OFFSET(m2ts_mode), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, ENC }, { "muxrate", NULL, OFFSET(mux_rate), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, INT_MAX, ENC }, { "pes_payload_size", "Minimum PES packet payload in bytes", -@@ -2121,10 +2141,10 @@ +@@ -2287,10 +2308,10 @@ OFFSET(omit_video_pes_length), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, ENC }, { "pcr_period", "PCR retransmission time in milliseconds", OFFSET(pcr_period_ms), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, ENC }, @@ -353,12 +375,11 @@ diff -git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c - OFFSET(sdt_period_us), AV_OPT_TYPE_DURATION, { .i64 = SDT_RETRANS_TIME * 1000LL }, 0, INT64_MAX, ENC }, + { "sdt_period", "SDT retransmission time limit in ms, -1 no sdt", + OFFSET(sdt_period_us), AV_OPT_TYPE_INT64, { .i64 = SDT_RETRANS_TIME * 1000LL }, -1, INT64_MAX, ENC }, + { "nit_period", "NIT retransmission time limit in seconds", + OFFSET(nit_period_us), AV_OPT_TYPE_DURATION, { .i64 = NIT_RETRANS_TIME * 1000LL }, 0, INT64_MAX, ENC }, { NULL }, - }; - -diff -git a/libavformat/mpegts.h b/libavformat/mpegts.h ---- a/libavformat/mpegts.h 2020-10-15 12:32:22.417967898 -0600 -+++ b/libavformat/mpegts.h 2020-10-15 12:32:46.463055553 -0600 +--- a/libavformat/mpegts.h ++++ b/libavformat/mpegts.h @@ -64,6 +64,7 @@ /* PID from 0x1FFC to 0x1FFE may be assigned as needed to PMT, elementary * streams and other data tables */ @@ -367,3 +388,26 @@ diff -git a/libavformat/mpegts.h b/libavformat/mpegts.h /* m2ts pids */ #define M2TS_PMT_PID 0x0100 +--- a/libavformat/bluray.c ++++ b/libavformat/bluray.c +@@ -28,7 +28,7 @@ + #include "libavutil/opt.h" + + #define BLURAY_PROTO_PREFIX "bluray:" +-#define MIN_PLAYLIST_LENGTH 180 /* 3 min */ ++#define MIN_PLAYLIST_LENGTH 0 + + typedef struct { + const AVClass *class; +--- a/doc/muxers.texi ++++ b/doc/muxers.texi +@@ -1934,7 +1934,8 @@ + Maximum time in seconds between PAT/PMT tables. Default is @code{0.1}. + + @item sdt_period @var{duration} +-Maximum time in seconds between SDT tables. Default is @code{0.5}. ++Maximum time in seconds between SDT tables. Default is @code{0.5}. Regardless ++of this setting no SDT is written in m2ts mode. + + @item nit_period @var{duration} + Maximum time in seconds between NIT tables. Default is @code{0.5}. diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch3 b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch3 similarity index 66% rename from cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch3 rename to cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch3 index 28d3876f..d553a807 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch3 +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch3 @@ -1,8 +1,6 @@ -diff --git a/libavformat/avformat.h b/libavformat/avformat.h -index e91e7f1d33..0f9b26a6d3 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h -@@ -480,6 +480,9 @@ typedef struct AVProbeData { +@@ -499,6 +499,9 @@ The user or muxer can override this through AVFormatContext.avoid_negative_ts */ @@ -12,7 +10,7 @@ index e91e7f1d33..0f9b26a6d3 100644 #define AVFMT_SEEK_TO_PTS 0x4000000 /**< Seeking is based on PTS */ -@@ -650,7 +653,8 @@ typedef struct AVInputFormat { +@@ -670,7 +673,8 @@ /** * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, * AVFMT_NOTIMESTAMPS, AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, @@ -21,44 +19,38 @@ index e91e7f1d33..0f9b26a6d3 100644 + * AVFMT_SEEK_NOSTREAMS */ int flags; - -diff --git a/libavformat/dv.c b/libavformat/dv.c -index e99422d4b5..58ce1bbb5f 100644 + --- a/libavformat/dv.c +++ b/libavformat/dv.c -@@ -642,6 +642,7 @@ static int dv_probe(const AVProbeData *p) - AVInputFormat ff_dv_demuxer = { +@@ -640,6 +640,7 @@ + const AVInputFormat ff_dv_demuxer = { .name = "dv", .long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"), + .flags = AVFMT_SEEK_NOSTREAMS, .priv_data_size = sizeof(RawDVContext), .read_probe = dv_probe, .read_header = dv_read_header, -diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c -index cff7f0cb54..8b6d22aff2 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c -@@ -4251,6 +4251,7 @@ static const AVClass webm_dash_class = { - AVInputFormat ff_matroska_demuxer = { +@@ -4427,6 +4427,7 @@ + const AVInputFormat ff_webm_dash_manifest_demuxer = { + .name = "webm_dash_manifest", + .long_name = NULL_IF_CONFIG_SMALL("WebM DASH Manifest"), ++ .flags = AVFMT_SEEK_NOSTREAMS, + .priv_class = &webm_dash_class, + .priv_data_size = sizeof(MatroskaDemuxContext), + .flags_internal = FF_FMT_INIT_CLEANUP, +@@ -4439,6 +4440,7 @@ + const AVInputFormat ff_matroska_demuxer = { .name = "matroska,webm", .long_name = NULL_IF_CONFIG_SMALL("Matroska / WebM"), + .flags = AVFMT_SEEK_NOSTREAMS, .extensions = "mkv,mk3d,mka,mks,webm", .priv_data_size = sizeof(MatroskaDemuxContext), - .read_probe = matroska_probe, -@@ -4264,6 +4265,7 @@ AVInputFormat ff_matroska_demuxer = { - AVInputFormat ff_webm_dash_manifest_demuxer = { - .name = "webm_dash_manifest", - .long_name = NULL_IF_CONFIG_SMALL("WebM DASH Manifest"), -+ .flags = AVFMT_SEEK_NOSTREAMS, - .priv_data_size = sizeof(MatroskaDemuxContext), - .read_header = webm_dash_manifest_read_header, - .read_packet = webm_dash_manifest_read_packet, -diff --git a/libavformat/utils.c b/libavformat/utils.c -index 807d9f10cb..55a444e7b6 100644 ---- a/libavformat/utils.c -+++ b/libavformat/utils.c -@@ -2486,6 +2486,13 @@ static int seek_frame_internal(AVFormatContext *s, int stream_index, + .flags_internal = FF_FMT_INIT_CLEANUP, +--- a/libavformat/seek.c ++++ b/libavformat/seek.c +@@ -600,6 +600,13 @@ return seek_frame_byte(s, stream_index, timestamp, flags); } diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patchZZ1 b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch4 similarity index 55% rename from cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patchZZ1 rename to cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch4 index c47e9e52..722fe2d0 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patchZZ1 +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch4 @@ -1,10 +1,8 @@ -diff --git a/libavformat/avidec.c b/libavformat/avidec.c -index 5cf67a4771..5bd2372c27 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c -@@ -1942,6 +1942,7 @@ AVInputFormat ff_avi_demuxer = { - .long_name = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"), +@@ -1995,6 +1995,7 @@ .priv_data_size = sizeof(AVIContext), + .flags_internal = FF_FMT_INIT_CLEANUP, .extensions = "avi", + .flags = AVFMT_SEEK_NOSTREAMS, .read_probe = avi_probe, diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch5 b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch5 similarity index 59% rename from cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch5 rename to cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch5 index 32e7fe11..64ee262c 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch5 +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch5 @@ -1,29 +1,24 @@ -diff --git a/libavfilter/formats.c b/libavfilter/formats.c -index de4315369d..f430908343 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c -@@ -107,11 +107,13 @@ AVFilterFormats *ff_merge_formats(AVFilterFormats *a, AVFilterFormats *b, +@@ -110,11 +110,13 @@ possibly causing a lossy conversion elsewhere in the graph. To avoid that, pretend that there are no common formats to force the insertion of a conversion filter. */ - if (type == AVMEDIA_TYPE_VIDEO) -- for (i = 0; i < a->nb_formats; i++) + if (type == AVMEDIA_TYPE_VIDEO) { -+ for (i = 0; i < a->nb_formats; i++) { -+ const AVPixFmtDescriptor *adesc = av_pix_fmt_desc_get(a->formats[i]); + for (i = 0; i < a->nb_formats; i++) { + const AVPixFmtDescriptor *const adesc = av_pix_fmt_desc_get(a->formats[i]); + if( !adesc ) continue; for (j = 0; j < b->nb_formats; j++) { -- const AVPixFmtDescriptor *adesc = av_pix_fmt_desc_get(a->formats[i]); const AVPixFmtDescriptor *bdesc = av_pix_fmt_desc_get(b->formats[j]); + if( !bdesc ) continue; alpha2 |= adesc->flags & bdesc->flags & AV_PIX_FMT_FLAG_ALPHA; chroma2|= adesc->nb_components > 1 && bdesc->nb_components > 1; if (a->formats[i] == b->formats[j]) { -@@ -119,6 +121,8 @@ AVFilterFormats *ff_merge_formats(AVFilterFormats *a, AVFilterFormats *b, - chroma1|= adesc->nb_components > 1; +@@ -123,6 +125,7 @@ } } -+ } + } + } // If chroma or alpha can be lost through merging then do not merge diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch6 b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch6 new file mode 100644 index 00000000..4e08b128 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch6 @@ -0,0 +1,41 @@ +X-Git-Url: http://git.ffmpeg.org/gitweb/ffmpeg.git/blobdiff_plain/30bd4831e6213cee64ed950d69d1732194cc6464..6f53f0d09ea4c9c7f7354f018a87ef840315207d:/libavformat/mov.c + +diff --git a/libavformat/mov.c b/libavformat/mov.c +index a644f9ac62..2b1131b911 100644 +--- a/libavformat/mov.c ++++ b/libavformat/mov.c +@@ -3949,8 +3949,11 @@ static int build_open_gop_key_points(AVStream *st) + + /* Build an unrolled index of the samples */ + sc->sample_offsets_count = 0; +- for (uint32_t i = 0; i < sc->ctts_count; i++) ++ for (uint32_t i = 0; i < sc->ctts_count; i++) { ++ if (sc->ctts_data[i].count > INT_MAX - sc->sample_offsets_count) ++ return AVERROR(ENOMEM); + sc->sample_offsets_count += sc->ctts_data[i].count; ++ } + av_freep(&sc->sample_offsets); + sc->sample_offsets = av_calloc(sc->sample_offsets_count, sizeof(*sc->sample_offsets)); + if (!sc->sample_offsets) +@@ -3969,8 +3972,11 @@ static int build_open_gop_key_points(AVStream *st) + /* Build a list of open-GOP key samples */ + sc->open_key_samples_count = 0; + for (uint32_t i = 0; i < sc->sync_group_count; i++) +- if (sc->sync_group[i].index == cra_index) ++ if (sc->sync_group[i].index == cra_index) { ++ if (sc->sync_group[i].count > INT_MAX - sc->open_key_samples_count) ++ return AVERROR(ENOMEM); + sc->open_key_samples_count += sc->sync_group[i].count; ++ } + av_freep(&sc->open_key_samples); + sc->open_key_samples = av_calloc(sc->open_key_samples_count, sizeof(*sc->open_key_samples)); + if (!sc->open_key_samples) +@@ -3981,6 +3987,8 @@ static int build_open_gop_key_points(AVStream *st) + if (sg->index == cra_index) + for (uint32_t j = 0; j < sg->count; j++) + sc->open_key_samples[k++] = sample_id; ++ if (sg->count > INT_MAX - sample_id) ++ return AVERROR_PATCHWELCOME; + sample_id += sg->count; + } + diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch6 b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch7 similarity index 62% rename from cinelerra-5.1/thirdparty/src/ffmpeg.git.patch6 rename to cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch7 index e59a17cc..17f2f050 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch6 +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch7 @@ -1,8 +1,6 @@ -diff --git a/libavcodec/vdpau_mpeg12.c b/libavcodec/vdpau_mpeg12.c -index 72220ffb4e..5687c416c9 100644 --- a/libavcodec/vdpau_mpeg12.c -+++ b/libavcodec/vdpau_mpeg12.c -@@ -114,6 +114,7 @@ const AVHWAccel ff_mpeg1_vdpau_hwaccel = { ++++ a/libavcodec/vdpau_mpeg12.c +@@ -116,6 +116,7 @@ .frame_priv_data_size = sizeof(struct vdpau_picture_context), .init = vdpau_mpeg1_init, .uninit = ff_vdpau_common_uninit, diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch7 b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch8 similarity index 76% rename from cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch7 rename to cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch8 index 05d3b1d0..1a9476c7 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch7 +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch8 @@ -1,8 +1,6 @@ -diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c -index 3b29a189e9..681a4187c5 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c -@@ -684,7 +684,7 @@ frame_end: +@@ -685,7 +685,7 @@ if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) ff_mpeg4_frame_end(avctx, buf, buf_size); diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch8 b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch9 similarity index 77% rename from cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch8 rename to cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch9 index 51bc09e3..40eb4f1a 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch8 +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch9 @@ -1,8 +1,6 @@ -diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c -index 9bd0a555d4..111a9f3a46 100644 --- a/libavformat/mpegenc.c +++ b/libavformat/mpegenc.c -@@ -976,9 +976,9 @@ static int remove_decoded_packets(AVFormatContext *ctx, int64_t scr) +@@ -976,9 +976,9 @@ PacketDesc *pkt_desc; while ((pkt_desc = stream->predecode_packet) && diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch999 b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch999 new file mode 100644 index 00000000..19021779 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patch999 @@ -0,0 +1,62 @@ +X-Git-Url: http://git.ffmpeg.org/gitweb/ffmpeg.git/blobdiff_plain/ccc684993276248d64c328a810fb7714af2f4c70..effadce6c756247ea8bae32dc13bb3e6f464f0eb:/libavcodec/x86/mathops.h + +diff --git a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h +index 6298f5ed19..ca7e2dffc1 100644 +--- a/libavcodec/x86/mathops.h ++++ b/libavcodec/x86/mathops.h +@@ -35,12 +35,20 @@ + static av_always_inline av_const int MULL(int a, int b, unsigned shift) + { + int rt, dummy; ++ if (__builtin_constant_p(shift)) + __asm__ ( + "imull %3 \n\t" + "shrdl %4, %%edx, %%eax \n\t" + :"=a"(rt), "=d"(dummy) +- :"a"(a), "rm"(b), "ci"((uint8_t)shift) ++ :"a"(a), "rm"(b), "i"(shift & 0x1F) + ); ++ else ++ __asm__ ( ++ "imull %3 \n\t" ++ "shrdl %4, %%edx, %%eax \n\t" ++ :"=a"(rt), "=d"(dummy) ++ :"a"(a), "rm"(b), "c"((uint8_t)shift) ++ ); + return rt; + } + +@@ -113,19 +121,31 @@ __asm__ volatile(\ + // avoid +32 for shift optimization (gcc should do that ...) + #define NEG_SSR32 NEG_SSR32 + static inline int32_t NEG_SSR32( int32_t a, int8_t s){ ++ if (__builtin_constant_p(s)) + __asm__ ("sarl %1, %0\n\t" + : "+r" (a) +- : "ic" ((uint8_t)(-s)) ++ : "i" (-s & 0x1F) + ); ++ else ++ __asm__ ("sarl %1, %0\n\t" ++ : "+r" (a) ++ : "c" ((uint8_t)(-s)) ++ ); + return a; + } + + #define NEG_USR32 NEG_USR32 + static inline uint32_t NEG_USR32(uint32_t a, int8_t s){ ++ if (__builtin_constant_p(s)) + __asm__ ("shrl %1, %0\n\t" + : "+r" (a) +- : "ic" ((uint8_t)(-s)) ++ : "i" (-s & 0x1F) + ); ++ else ++ __asm__ ("shrl %1, %0\n\t" ++ : "+r" (a) ++ : "c" ((uint8_t)(-s)) ++ ); + return a; + } + diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patchA b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patchB similarity index 78% rename from cinelerra-5.1/thirdparty/src/ffmpeg.git.patchA rename to cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patchB index 6d181e3c..89e99896 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patchA +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patchB @@ -1,8 +1,6 @@ -diff --git a/libavutil/hwcontext_vdpau.c b/libavutil/hwcontext_vdpau.c -index dbef5495af..fba06d8ccf 100644 --- a/libavutil/hwcontext_vdpau.c +++ b/libavutil/hwcontext_vdpau.c -@@ -68,6 +68,11 @@ static const VDPAUPixFmtMap pix_fmts_420[] = { +@@ -47,6 +47,11 @@ { 0, AV_PIX_FMT_NONE, }, }; @@ -14,7 +12,7 @@ index dbef5495af..fba06d8ccf 100644 static const VDPAUPixFmtMap pix_fmts_422[] = { { VDP_YCBCR_FORMAT_NV12, AV_PIX_FMT_NV16 }, { VDP_YCBCR_FORMAT_YV12, AV_PIX_FMT_YUV422P }, -@@ -92,6 +97,7 @@ static const struct { +@@ -71,6 +76,7 @@ const VDPAUPixFmtMap *map; } vdpau_pix_fmts[] = { { VDP_CHROMA_TYPE_420, AV_PIX_FMT_YUV420P, pix_fmts_420 }, diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patchB b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patchC similarity index 58% rename from cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patchB rename to cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patchC index 848ce478..bce5202e 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patchB +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patchC @@ -1,8 +1,6 @@ -diff --git a/libavcodec/encode.c b/libavcodec/encode_fprint.c -index 89df523..cca0cc1 100644 --- a/libavcodec/encode.c -+++ b/libavcodec/encode_fprint.c -@@ -191,7 +191,7 @@ static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt) ++++ b/libavcodec/encode.c +@@ -191,7 +191,7 @@ } if (!frame->buf[0]) { @@ -11,33 +9,33 @@ index 89df523..cca0cc1 100644 (avci->frame_thread_encoder && avctx->active_thread_type & FF_THREAD_FRAME))) return AVERROR_EOF; -@@ -246,8 +246,10 @@ static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt) - } +@@ -243,8 +243,10 @@ + avpkt->flags |= avci->intra_only_flag; } - if (avci->draining && !got_packet) + if (avci->draining && !got_packet) { -+ fflush(stderr); ++ fflush(stderr); avci->draining_done = 1; + } end: if (ret < 0 || !got_packet) -@@ -372,10 +374,16 @@ int attribute_align_arg avcodec_send_frame(AVCodecContext *avctx, const AVFrame +@@ -365,10 +367,16 @@ if (avci->draining) return AVERROR_EOF; -- if (avci->buffer_frame->data[0]) -+ if (avci->buffer_frame->data[0]) { +- if (avci->buffer_frame->buf[0]) ++ if (avci->buffer_frame->buf[0]) { + if (!frame) { -+ fflush(stderr); ++ fflush(stderr); + av_frame_unref(avci->buffer_frame); -+ } ++ } return AVERROR(EAGAIN); + } if (!frame) { -+ fflush(stderr); ++ fflush(stderr); avci->draining = 1; } else { ret = encode_send_frame_internal(avctx, frame); diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patchD b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patchD new file mode 100644 index 00000000..18544724 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patchD @@ -0,0 +1,72 @@ +From c13d95934327ddad4db30f6aee93cd2aa6a26a57 Mon Sep 17 00:00:00 2001 +From: OvchinnikovDmitrii +Date: Thu, 6 Oct 2022 15:49:59 +0200 +Subject: [PATCH 1/1] lavc/libvpx: increase thread limit to 64 + +This change improves the performance and multicore scalability of the vp9 +codec for streaming single-pass encoded videos by taking advantage of up +to 64 cores in the system. The current thread limit for ffmpeg codecs is 16 +(MAX_AUTO_THREADS in pthread_internal.h) due to a limitation in H.264 codec +that prevents more than 16 threads being used. + +Experiments show that increasing the thread limit to 64 for vp9 improves +the performance for encoding 4K raw videos for streaming by up to 47% +compared to 16 threads, and from 20-30% for 32 threads, with the same quality +as measured by the VMAF score. + +Rationale for this change: +Vp9 uses tiling to split the video frame into multiple columns; tiles must +be at least 256 pixels wide, so there is a limit to how many tiles can be +used. The tiles can be processed in parallel, and more tiles mean more CPU +threads can be used. 4K videos can make use of 16 threads, and 8K videos +can use 32. Row-mt can double the number of threads so 64 threads can be used. + +Signed-off-by: James Zern +--- + libavcodec/libvpx.h | 2 ++ + libavcodec/libvpxdec.c | 2 +- + libavcodec/libvpxenc.c | 2 +- + 3 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/libavcodec/libvpx.h b/libavcodec/libvpx.h +index 0caed8cdcb..331feb8745 100644 +--- a/libavcodec/libvpx.h ++++ b/libavcodec/libvpx.h +@@ -25,6 +25,8 @@ + + #include "codec_internal.h" + ++#define MAX_VPX_THREADS 64 ++ + void ff_vp9_init_static(FFCodec *codec); + #if 0 + enum AVPixelFormat ff_vpx_imgfmt_to_pixfmt(vpx_img_fmt_t img); +diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c +index 9cd2c56caf..0ae19c3f72 100644 +--- a/libavcodec/libvpxdec.c ++++ b/libavcodec/libvpxdec.c +@@ -88,7 +88,7 @@ static av_cold int vpx_init(AVCodecContext *avctx, + const struct vpx_codec_iface *iface) + { + struct vpx_codec_dec_cfg deccfg = { +- .threads = FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), 16) ++ .threads = FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), MAX_VPX_THREADS) + }; + + av_log(avctx, AV_LOG_INFO, "%s\n", vpx_codec_version_str()); +diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c +index 9aa5510c28..339d4d8146 100644 +--- a/libavcodec/libvpxenc.c ++++ b/libavcodec/libvpxenc.c +@@ -942,7 +942,7 @@ static av_cold int vpx_init(AVCodecContext *avctx, + enccfg.g_timebase.num = avctx->time_base.num; + enccfg.g_timebase.den = avctx->time_base.den; + enccfg.g_threads = +- FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), 16); ++ FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), MAX_VPX_THREADS); + enccfg.g_lag_in_frames= ctx->lag_in_frames; + + if (avctx->flags & AV_CODEC_FLAG_PASS1) +-- +2.25.1 + diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patchE b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patchE new file mode 100644 index 00000000..444ab3af --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patchE @@ -0,0 +1,34 @@ +From: Lynne +Date: Sun, 25 Dec 2022 00:03:30 +0000 (+0100) +Subject: hwcontext_vulkan: remove optional encode/decode extensions from the list +X-Git-Url: http://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff_plain/7268323193d55365f914de39fadd5dbdb1f68976?hp=30d432f205538f6ef6c86ed0a90e27cdd735cd2b + +hwcontext_vulkan: remove optional encode/decode extensions from the list + +They're not currently used, so they don't need to be there. +Vulkan stabilized the decode extensions less than a week ago, and their +name prefixes were changed from EXT to KHR. It's a bit too soon to be +depending on it, so rather than bumping, just remove these for now. + +(cherry picked from commit eb0455d64690eed0068e5cb202f72ecdf899837c) +--- + +diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c +index 237caa4bc0..3bc0dc8a40 100644 +--- a/libavutil/hwcontext_vulkan.c ++++ b/libavutil/hwcontext_vulkan.c +@@ -354,14 +354,6 @@ static const VulkanOptExtension optional_device_exts[] = { + { VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_MEMORY }, + { VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_SEM }, + #endif +- +- /* Video encoding/decoding */ +- { VK_KHR_VIDEO_QUEUE_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, +- { VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, +- { VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, +- { VK_EXT_VIDEO_ENCODE_H264_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, +- { VK_EXT_VIDEO_DECODE_H264_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, +- { VK_EXT_VIDEO_DECODE_H265_EXTENSION_NAME, FF_VK_EXT_NO_FLAG }, + }; + + /* Converts return values to strings */ diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patchZ1 b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patchZ1 new file mode 100644 index 00000000..e6f708da --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patchZ1 @@ -0,0 +1,55 @@ +--- a/libavcodec/wrapped_avframe.c ++++ b/libavcodec/wrapped_avframe.c +@@ -33,6 +33,38 @@ + #include "libavutil/buffer.h" + #include "libavutil/pixdesc.h" + ++ ++ ++static const enum AVPixelFormat pix_fmts_all[] = { ++ AV_PIX_FMT_YUV411P, ++ AV_PIX_FMT_YUV420P, ++ AV_PIX_FMT_YUVJ420P, ++ AV_PIX_FMT_YUV422P, ++ AV_PIX_FMT_YUVJ422P, ++ AV_PIX_FMT_YUV444P, ++ AV_PIX_FMT_YUVJ444P, ++ AV_PIX_FMT_YUV420P10, ++ AV_PIX_FMT_YUV422P10, ++ AV_PIX_FMT_YUV444P10, ++ AV_PIX_FMT_YUV420P12, ++ AV_PIX_FMT_YUV422P12, ++ AV_PIX_FMT_YUV444P12, ++ AV_PIX_FMT_YUV420P14, ++ AV_PIX_FMT_YUV422P14, ++ AV_PIX_FMT_YUV444P14, ++ AV_PIX_FMT_YUV420P16, ++ AV_PIX_FMT_YUV422P16, ++ AV_PIX_FMT_YUV444P16, ++ AV_PIX_FMT_GRAY8, ++ AV_PIX_FMT_GRAY9, ++ AV_PIX_FMT_GRAY10, ++ AV_PIX_FMT_GRAY12, ++ AV_PIX_FMT_GRAY16, ++ AV_PIX_FMT_NONE ++}; ++ ++ ++ + static void wrapped_avframe_release_buffer(void *unused, uint8_t *data) + { + AVFrame *frame = (AVFrame *)data; +@@ -109,6 +141,7 @@ + .p.id = AV_CODEC_ID_WRAPPED_AVFRAME, + FF_CODEC_ENCODE_CB(wrapped_avframe_encode), + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, ++ .p.pix_fmts = pix_fmts_all, + }; + + const FFCodec ff_wrapped_avframe_decoder = { +@@ -118,4 +151,5 @@ + .p.id = AV_CODEC_ID_WRAPPED_AVFRAME, + FF_CODEC_DECODE_CB(wrapped_avframe_decode), + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, ++ + }; diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patchZ2 b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patchZ2 similarity index 73% rename from cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patchZ2 rename to cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patchZ2 index d70788d1..2d8ede6d 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patchZ2 +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.patchZ2 @@ -1,6 +1,6 @@ ---- a/libavformat/yuv4mpegenc.c.orig 2021-06-15 23:40:32.239553104 +0300 -+++ b/libavformat/yuv4mpegenc.c 2021-06-15 23:40:40.851553105 +0300 -@@ -313,7 +313,7 @@ +--- a/libavformat/yuv4mpegenc.c ++++ b/libavformat/yuv4mpegenc.c +@@ -259,7 +259,7 @@ av_log(s, AV_LOG_ERROR, "'%s' is not an official yuv4mpegpipe pixel format. " "Use '-strict -1' to encode to this pixel format.\n", av_get_pix_fmt_name(s->streams[0]->codecpar->format)); diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.tar.xz b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.tar.xz similarity index 53% rename from cinelerra-5.1/thirdparty/src/ffmpeg-4.4.tar.xz rename to cinelerra-5.1/thirdparty/src/ffmpeg-5.1.tar.xz index 30881566..b832184c 100644 Binary files a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.tar.xz and b/cinelerra-5.1/thirdparty/src/ffmpeg-5.1.tar.xz differ diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch0 b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch0 new file mode 100644 index 00000000..06435263 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch0 @@ -0,0 +1,34 @@ +--- a/libavcodec/aaccoder.c ++++ b/libavcodec/aaccoder.c +@@ -60,6 +60,8 @@ + * replace low energy non zero bands */ + #define NOISE_LAMBDA_REPLACE 1.948f + ++#undef B0 ++ + #include "libavcodec/aaccoder_trellis.h" + + typedef float (*quantize_and_encode_band_func)(struct AACEncContext *s, PutBitContext *pb, + +--- a/libavcodec/hevc_mvs.c ++++ b/libavcodec/hevc_mvs.c +@@ -25,6 +25,8 @@ + #include "hevcdec.h" + #include "threadframe.h" + ++#undef B0 ++ + static const uint8_t l0_l1_cand_idx[12][2] = { + { 0, 1, }, + { 1, 0, }, +--- a/libavcodec/opus_pvq.c ++++ b/libavcodec/opus_pvq.c +@@ -36,6 +36,8 @@ + #define CELT_PVQ_U(n, k) (ff_celt_pvq_u_row[FFMIN(n, k)][FFMAX(n, k)]) + #define CELT_PVQ_V(n, k) (CELT_PVQ_U(n, k) + CELT_PVQ_U(n, (k) + 1)) + ++#undef B0 ++ + static inline int16_t celt_cos(int16_t x) + { + x = (MUL16(x, x) + 4096) >> 13; diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch1 b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch1 new file mode 100644 index 00000000..e157d3f3 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch1 @@ -0,0 +1,11 @@ +--- a/fftools/cmdutils.c ++++ b/fftools/cmdutils.c +@@ -59,7 +59,7 @@ + AVDictionary *swr_opts; + AVDictionary *format_opts, *codec_opts; + +-int hide_banner = 0; ++int hide_banner = 1; + + void uninit_opts(void) + { diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch10 b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch10 new file mode 100644 index 00000000..1fc3f890 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch10 @@ -0,0 +1,16 @@ +--- a/libavutil/hwcontext_cuda.c.orig 2023-11-11 03:25:17.000000000 +0300 ++++ b/libavutil/hwcontext_cuda.c 2023-11-12 17:52:01.243063419 +0300 +@@ -361,11 +361,13 @@ + hwctx->internal->cuda_device)); + if (ret < 0) + return ret; ++#if 0 + } else if (flags & AV_CUDA_USE_CURRENT_CONTEXT) { + ret = CHECK_CU(cu->cuCtxGetCurrent(&hwctx->cuda_ctx)); + if (ret < 0) + return ret; + av_log(device_ctx, AV_LOG_INFO, "Using current CUDA context.\n"); ++#endif + } else { + ret = CHECK_CU(cu->cuCtxCreate(&hwctx->cuda_ctx, desired_flags, + hwctx->internal->cuda_device)); diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch2 b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch2 new file mode 100644 index 00000000..77050275 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch2 @@ -0,0 +1,414 @@ +--- a/libavformat/mpegtsenc.c ++++ b/libavformat/mpegtsenc.c +@@ -87,9 +87,11 @@ + int64_t pat_period; /* PAT/PMT period in PCR time base */ + int64_t nit_period; /* NIT period in PCR time base */ + int nb_services; +- int64_t first_pcr; + int first_dts_checked; +- int64_t next_pcr; ++ int64_t pcr_pos, pcr; ++ int64_t first_pcr, next_pcr; ++ int64_t delay; ++ int pcr_stream_pid; + int mux_rate; ///< set to 1 when VBR + int pes_payload_size; + int64_t total_size; +@@ -256,7 +258,7 @@ + int data_st_warning; + + int64_t pcr_period; /* PCR period in PCR time base */ +- int64_t last_pcr; ++ int64_t pcr_timer; + + /* For Opus */ + int opus_queued_samples; +@@ -954,18 +956,18 @@ + return 0; + } + +-static int64_t get_pcr(const MpegTSWrite *ts) ++static int64_t get_pcr(const MpegTSWrite *ts, AVIOContext *pb) + { +- return av_rescale(ts->total_size + 11, 8 * PCR_TIME_BASE, ts->mux_rate) + +- ts->first_pcr; ++ int64_t pos = avio_tell(pb) + 11; ++ return ts->pcr + (ts->mux_rate == 1 ? (pos - ts->pcr_pos) * 8 : ++ av_rescale(pos - ts->pcr_pos, 8 * PCR_TIME_BASE, ts->mux_rate)); + } + + static void write_packet(AVFormatContext *s, const uint8_t *packet) + { + MpegTSWrite *ts = s->priv_data; + if (ts->m2ts_mode) { +- int64_t pcr = get_pcr(s->priv_data); +- uint32_t tp_extra_header = pcr % 0x3fffffff; ++ uint32_t tp_extra_header = get_pcr(ts, s->pb) % 0x3fffffff; + tp_extra_header = AV_RB32(&tp_extra_header); + avio_write(s->pb, (unsigned char *) &tp_extra_header, + sizeof(tp_extra_header)); +@@ -1051,9 +1053,6 @@ + else + ts_st->pcr_period = 1; + } +- +- // output a PCR as soon as possible +- ts_st->last_pcr = ts->first_pcr - ts_st->pcr_period; + } + + static void select_pcr_streams(AVFormatContext *s) +@@ -1116,6 +1115,7 @@ + + if (s->max_delay < 0) /* Not set by the caller */ + s->max_delay = 0; ++ ts->delay = av_rescale(s->max_delay, 90000, AV_TIME_BASE); + + // round up to a whole number of TS packets + ts->pes_payload_size = (ts->pes_payload_size + 14 + 183) / 184 * 184 - 14; +@@ -1175,7 +1175,9 @@ + /* MPEG pid values < 16 are reserved. Applications which set st->id in + * this range are assigned a calculated pid. */ + if (st->id < 16) { +- if (ts->m2ts_mode) { ++ if (ts->start_pid >= 0) ++ ts_st->pid = ts->start_pid + i; ++ else if (ts->m2ts_mode) { + switch (st->codecpar->codec_type) { + case AVMEDIA_TYPE_VIDEO: + ts_st->pid = ts->m2ts_video_pid++; +@@ -1202,9 +1204,9 @@ + av_log(s, AV_LOG_ERROR, "Cannot automatically assign PID for stream %d\n", st->index); + return AVERROR(EINVAL); + } +- } else { +- ts_st->pid = ts->start_pid + i; + } ++ else ++ ts_st->pid = START_PID + i; + } else { + ts_st->pid = st->id; + } +@@ -1272,9 +1274,14 @@ + ts->last_pat_ts = AV_NOPTS_VALUE; + ts->last_sdt_ts = AV_NOPTS_VALUE; + ts->last_nit_ts = AV_NOPTS_VALUE; +- ts->pat_period = av_rescale(ts->pat_period_us, PCR_TIME_BASE, AV_TIME_BASE); +- ts->sdt_period = av_rescale(ts->sdt_period_us, PCR_TIME_BASE, AV_TIME_BASE); +- ts->nit_period = av_rescale(ts->nit_period_us, PCR_TIME_BASE, AV_TIME_BASE); ++ ts->pat_period = ts->pat_period_us < 0 ? -1 : ++ av_rescale(ts->pat_period_us, PCR_TIME_BASE, AV_TIME_BASE); ++ ts->sdt_period = ts->sdt_period_us < 0 ? -1 : ++ av_rescale(ts->sdt_period_us, PCR_TIME_BASE, AV_TIME_BASE); ++ ts->nit_period = ts->nit_period_us < 0 ? -1 : ++ av_rescale(ts->nit_period_us, PCR_TIME_BASE, AV_TIME_BASE); ++ ts->pcr = 0; ++ ts->pcr_pos = 0; + + /* assign provider name */ + provider = av_dict_get(s->metadata, "service_provider", NULL, 0); +@@ -1290,8 +1297,8 @@ + av_log(s, AV_LOG_VERBOSE, "muxrate %d, ", ts->mux_rate); + av_log(s, AV_LOG_VERBOSE, + "sdt every %"PRId64" ms, pat/pmt every %"PRId64" ms", +- av_rescale(ts->sdt_period, 1000, PCR_TIME_BASE), +- av_rescale(ts->pat_period, 1000, PCR_TIME_BASE)); ++ ts->sdt_period < 0 ? -1 : av_rescale(ts->sdt_period, 1000, PCR_TIME_BASE), ++ ts->pat_period < 0 ? -1 : av_rescale(ts->pat_period, 1000, PCR_TIME_BASE)); + if (ts->flags & MPEGTS_FLAG_NIT) + av_log(s, AV_LOG_VERBOSE, ", nit every %"PRId64" ms", av_rescale(ts->nit_period, 1000, PCR_TIME_BASE)); + av_log(s, AV_LOG_VERBOSE, "\n"); +@@ -1300,36 +1307,40 @@ + } + + /* send SDT, NIT, PAT and PMT tables regularly */ +-static void retransmit_si_info(AVFormatContext *s, int force_pat, int force_sdt, int force_nit, int64_t pcr) ++static void retransmit_si_info(AVFormatContext *s, int force_pat, int force_sdt, int force_nit) + { + MpegTSWrite *ts = s->priv_data; + int i; + +- if ((pcr != AV_NOPTS_VALUE && ts->last_sdt_ts == AV_NOPTS_VALUE) || +- (pcr != AV_NOPTS_VALUE && pcr - ts->last_sdt_ts >= ts->sdt_period) || +- force_sdt +- ) { +- if (pcr != AV_NOPTS_VALUE) +- ts->last_sdt_ts = FFMAX(pcr, ts->last_sdt_ts); +- mpegts_write_sdt(s); +- } +- if ((pcr != AV_NOPTS_VALUE && ts->last_pat_ts == AV_NOPTS_VALUE) || +- (pcr != AV_NOPTS_VALUE && pcr - ts->last_pat_ts >= ts->pat_period) || +- force_pat) { +- if (pcr != AV_NOPTS_VALUE) +- ts->last_pat_ts = FFMAX(pcr, ts->last_pat_ts); +- mpegts_write_pat(s); +- for (i = 0; i < ts->nb_services; i++) +- mpegts_write_pmt(s, ts->services[i]); +- } +- if ((pcr != AV_NOPTS_VALUE && ts->last_nit_ts == AV_NOPTS_VALUE) || +- (pcr != AV_NOPTS_VALUE && pcr - ts->last_nit_ts >= ts->nit_period) || +- force_nit +- ) { +- if (pcr != AV_NOPTS_VALUE) +- ts->last_nit_ts = FFMAX(pcr, ts->last_nit_ts); ++ if (ts->sdt_period >= 0) { ++ int64_t pcr = get_pcr(ts, s->pb); ++ if (ts->last_sdt_ts == AV_NOPTS_VALUE || pcr >= ts->last_sdt_ts + ts->sdt_period) ++ force_sdt = 1; ++ if (force_sdt) { ++ ts->last_sdt_ts = pcr; ++ mpegts_write_sdt(s); ++ } ++ } ++ if (ts->pat_period >= 0) { ++ int64_t pcr = get_pcr(ts, s->pb); ++ if (ts->last_pat_ts == AV_NOPTS_VALUE || pcr >= ts->last_pat_ts + ts->pat_period) ++ force_pat = 1; ++ if (force_pat) { ++ ts->last_pat_ts = pcr; ++ mpegts_write_pat(s); ++ for (i = 0; i < ts->nb_services; i++) ++ mpegts_write_pmt(s, ts->services[i]); ++ } ++ } ++ if (ts->nit_period >= 0) { ++ int64_t pcr = get_pcr(ts, s->pb); ++ if (ts->last_nit_ts == AV_NOPTS_VALUE || pcr >= ts->last_nit_ts + ts->nit_period) ++ force_nit = 1; ++ if (force_nit) { ++ ts->last_nit_ts = pcr; + if (ts->flags & MPEGTS_FLAG_NIT) + mpegts_write_nit(s); ++ } + } + } + +@@ -1366,25 +1377,29 @@ + static void mpegts_insert_pcr_only(AVFormatContext *s, AVStream *st) + { + MpegTSWrite *ts = s->priv_data; +- MpegTSWriteStream *ts_st = st->priv_data; ++ int64_t pcr = get_pcr(ts, s->pb); ++ MpegTSWriteStream *ts_st = st ? st->priv_data : 0; ++ uint32_t pcr_pid = ts_st ? ts_st->pid : ts->pcr_stream_pid; + uint8_t *q; + uint8_t buf[TS_PACKET_SIZE]; + + q = buf; + *q++ = 0x47; +- *q++ = ts_st->pid >> 8; +- *q++ = ts_st->pid; +- *q++ = 0x20 | ts_st->cc; /* Adaptation only */ ++ *q++ = pcr_pid >> 8; ++ *q++ = pcr_pid; ++ uint32_t flags = 0x20; /* Adaptation only */ + /* Continuity Count field does not increment (see 13818-1 section 2.4.3.3) */ ++ if(ts_st) flags |= ts_st->cc; ++ *q++ = flags; + *q++ = TS_PACKET_SIZE - 5; /* Adaptation Field Length */ + *q++ = 0x10; /* Adaptation flags: PCR present */ +- if (ts_st->discontinuity) { ++ if (ts_st && ts_st->discontinuity) { + q[-1] |= 0x80; + ts_st->discontinuity = 0; + } + + /* PCR coded into 6 bytes */ +- q += write_pcr_bits(q, get_pcr(ts)); ++ q += write_pcr_bits(q, pcr); + + /* stuffing bytes */ + memset(q, 0xFF, TS_PACKET_SIZE - (q - buf)); +@@ -1485,9 +1500,9 @@ + int afc_len, stuffing_len; + int is_dvb_subtitle = (st->codecpar->codec_id == AV_CODEC_ID_DVB_SUBTITLE); + int is_dvb_teletext = (st->codecpar->codec_id == AV_CODEC_ID_DVB_TELETEXT); +- int64_t delay = av_rescale(s->max_delay, 90000, AV_TIME_BASE); + int force_pat = st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && key && !ts_st->prev_payload_key; + int force_sdt = 0; ++ int64_t pcr; + int force_nit = 0; + + av_assert0(ts_st->payload != buf || st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO); +@@ -1504,21 +1519,19 @@ + + is_start = 1; + while (payload_size > 0) { +- int64_t pcr = AV_NOPTS_VALUE; +- if (ts->mux_rate > 1) +- pcr = get_pcr(ts); +- else if (dts != AV_NOPTS_VALUE) +- pcr = (dts - delay) * 300; +- +- retransmit_si_info(s, force_pat, force_sdt, force_nit, pcr); +- force_pat = 0; +- force_sdt = 0; +- force_nit = 0; ++ // add 11, pcr references the last byte of program clock reference base ++ ts->pcr_pos = avio_tell(s->pb) + 11; ++ pcr = ts->pcr = ts->mux_rate != 1 ? ++ av_rescale(ts->pcr_pos, 8 * PCR_TIME_BASE, ts->mux_rate) : ++ (dts == AV_NOPTS_VALUE ? 0 : (dts - ts->delay) * 300); ++ if (force_pat || force_sdt || force_nit) { ++ retransmit_si_info(s, force_pat, force_sdt, force_nit); ++ force_pat = force_sdt = force_nit = 0; ++ } + + write_pcr = 0; + if (ts->mux_rate > 1) { + /* Send PCR packets for all PCR streams if needed */ +- pcr = get_pcr(ts); + if (pcr >= ts->next_pcr) { + int64_t next_pcr = INT64_MAX; + for (int i = 0; i < s->nb_streams; i++) { +@@ -1528,36 +1541,43 @@ + AVStream *st2 = s->streams[st2_index]; + MpegTSWriteStream *ts_st2 = st2->priv_data; + if (ts_st2->pcr_period) { +- if (pcr - ts_st2->last_pcr >= ts_st2->pcr_period) { +- ts_st2->last_pcr = FFMAX(pcr - ts_st2->pcr_period, ts_st2->last_pcr + ts_st2->pcr_period); +- if (st2 != st) { ++ if (pcr >= ts_st2->pcr_timer) { ++ ts_st2->pcr_timer = pcr + ts_st2->pcr_period; ++ if (st2 != st) { + mpegts_insert_pcr_only(s, st2); +- pcr = get_pcr(ts); + } else { + write_pcr = 1; + } + } +- next_pcr = FFMIN(next_pcr, ts_st2->last_pcr + ts_st2->pcr_period); ++ next_pcr = FFMIN(next_pcr, ts_st2->pcr_timer); + } + } + ts->next_pcr = next_pcr; + } +- if (dts != AV_NOPTS_VALUE && (dts - pcr / 300) > delay) { +- /* pcr insert gets priority over null packet insert */ +- if (write_pcr) +- mpegts_insert_pcr_only(s, st); +- else +- mpegts_insert_null_packet(s); +- /* recalculate write_pcr and possibly retransmit si_info */ +- continue; +- } +- } else if (ts_st->pcr_period && pcr != AV_NOPTS_VALUE) { +- if (pcr - ts_st->last_pcr >= ts_st->pcr_period && is_start) { +- ts_st->last_pcr = FFMAX(pcr - ts_st->pcr_period, ts_st->last_pcr + ts_st->pcr_period); ++ } ++ else if (ts_st->pcr_period) { ++ if (pcr >= ts_st->pcr_timer) { ++ ts_st->pcr_timer = pcr + ts_st->pcr_period; + write_pcr = 1; + } + } + ++ if (write_pcr && ts->pcr_stream_pid >= 0) { ++ mpegts_insert_pcr_only(s, 0); ++ continue; ++ } ++ ++ if (ts->mux_rate > 1 && dts != AV_NOPTS_VALUE && ++ (dts - pcr / 300) > ts->delay) { ++ /* pcr insert gets priority over null packet insert */ ++ if (write_pcr) ++ mpegts_insert_pcr_only(s, st); ++ else ++ mpegts_insert_null_packet(s); ++ /* recalculate write_pcr and possibly retransimit si_info */ ++ continue; ++ } ++ + /* prepare packet header */ + q = buf; + *q++ = 0x47; +@@ -1587,7 +1607,6 @@ + if (write_pcr) { + set_af_flag(buf, 0x10); + q = get_ts_payload_start(buf); +- // add 11, pcr references the last byte of program clock reference base + if (dts != AV_NOPTS_VALUE && dts < pcr / 300) + av_log(s, AV_LOG_WARNING, "dts < pcr, TS is invalid\n"); + extend_af(buf, write_pcr_bits(q, pcr)); +@@ -1851,8 +1870,8 @@ + uint8_t *data = NULL; + MpegTSWrite *ts = s->priv_data; + MpegTSWriteStream *ts_st = st->priv_data; +- const int64_t delay = av_rescale(s->max_delay, 90000, AV_TIME_BASE) * 2; +- const int64_t max_audio_delay = av_rescale(s->max_delay, 90000, AV_TIME_BASE) / 2; ++ const int64_t delay_ticks2 = ts->delay * 2; ++ const int64_t max_audio_delay = ts->delay / 2; + int64_t dts = pkt->dts, pts = pkt->pts; + int opus_samples = 0; + size_t side_data_size; +@@ -1872,9 +1891,9 @@ + + if (ts->copyts < 1) { + if (pts != AV_NOPTS_VALUE) +- pts += delay; ++ pts += delay_ticks2; + if (dts != AV_NOPTS_VALUE) +- dts += delay; ++ dts += delay_ticks2; + } + + if (!ts_st->first_timestamp_checked && (pts == AV_NOPTS_VALUE || dts == AV_NOPTS_VALUE)) { +@@ -2305,8 +2324,10 @@ + 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_SERVICE_TYPE_HEVC_DIGITAL_HDTV }, 0x01, 0xff, ENC, "mpegts_service_type" }, + { "mpegts_pmt_start_pid", "Set the first pid of the PMT.", + OFFSET(pmt_start_pid), AV_OPT_TYPE_INT, { .i64 = 0x1000 }, FIRST_OTHER_PID, LAST_OTHER_PID, ENC }, ++ { "mpegts_pcr_stream_pid", "create seperate PCR stream on this pid.", ++ OFFSET(pcr_stream_pid), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 0x1f00, ENC }, + { "mpegts_start_pid", "Set the first pid.", +- OFFSET(start_pid), AV_OPT_TYPE_INT, { .i64 = 0x0100 }, FIRST_OTHER_PID, LAST_OTHER_PID, ENC }, ++ OFFSET(start_pid), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, LAST_OTHER_PID, ENC }, + { "mpegts_m2ts_mode", "Enable m2ts mode.", OFFSET(m2ts_mode), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, ENC }, + { "muxrate", NULL, OFFSET(mux_rate), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, INT_MAX, ENC }, + { "pes_payload_size", "Minimum PES packet payload in bytes", +@@ -2332,10 +2353,10 @@ + OFFSET(omit_video_pes_length), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, ENC }, + { "pcr_period", "PCR retransmission time in milliseconds", + OFFSET(pcr_period_ms), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, ENC }, +- { "pat_period", "PAT/PMT retransmission time limit in seconds", ++ { "pat_period", "PAT/PMT retransmission time limit in ms, -1 no pat", + OFFSET(pat_period_us), AV_OPT_TYPE_DURATION, { .i64 = PAT_RETRANS_TIME * 1000LL }, 0, INT64_MAX, ENC }, +- { "sdt_period", "SDT retransmission time limit in seconds", +- OFFSET(sdt_period_us), AV_OPT_TYPE_DURATION, { .i64 = SDT_RETRANS_TIME * 1000LL }, 0, INT64_MAX, ENC }, ++ { "sdt_period", "SDT retransmission time limit in ms, -1 no sdt", ++ OFFSET(sdt_period_us), AV_OPT_TYPE_INT64, { .i64 = SDT_RETRANS_TIME * 1000LL }, -1, INT64_MAX, ENC }, + { "nit_period", "NIT retransmission time limit in seconds", + OFFSET(nit_period_us), AV_OPT_TYPE_DURATION, { .i64 = NIT_RETRANS_TIME * 1000LL }, 0, INT64_MAX, ENC }, + { NULL }, +--- a/libavformat/mpegts.h ++++ b/libavformat/mpegts.h +@@ -64,6 +64,7 @@ + /* PID from 0x1FFC to 0x1FFE may be assigned as needed to PMT, elementary + * streams and other data tables */ + #define NULL_PID 0x1FFF /* Null packet (used for fixed bandwidth padding) */ ++#define START_PID 0x0400 + + /* m2ts pids */ + #define M2TS_PMT_PID 0x0100 +--- a/libavformat/bluray.c ++++ b/libavformat/bluray.c +@@ -27,7 +27,7 @@ + #include "libavutil/opt.h" + + #define BLURAY_PROTO_PREFIX "bluray:" +-#define MIN_PLAYLIST_LENGTH 180 /* 3 min */ ++#define MIN_PLAYLIST_LENGTH 0 + + typedef struct { + const AVClass *class; + +--- a/doc/muxers.texi ++++ b/doc/muxers.texi +@@ -1932,7 +1932,8 @@ + Maximum time in seconds between PAT/PMT tables. Default is @code{0.1}. + + @item sdt_period @var{duration} +-Maximum time in seconds between SDT tables. Default is @code{0.5}. ++Maximum time in seconds between SDT tables. Default is @code{0.5}. Regardless ++of this setting no SDT is written in m2ts mode. + + @item nit_period @var{duration} + Maximum time in seconds between NIT tables. Default is @code{0.5}. diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch3 b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch3 new file mode 100644 index 00000000..956322f7 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch3 @@ -0,0 +1,66 @@ +--- a/libavformat/avformat.h ++++ b/libavformat/avformat.h +@@ -500,6 +500,9 @@ + The user or muxer can override this through + AVFormatContext.avoid_negative_ts + */ ++#define AVFMT_SEEK_NOSTREAMS 0x80000 /**< Stream index ignored by seek, ++ or some streams fail to seek ++ */ + + #define AVFMT_SEEK_TO_PTS 0x4000000 /**< Seeking is based on PTS */ + +@@ -563,7 +566,8 @@ + /** + * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, + * AVFMT_NOTIMESTAMPS, AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, +- * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS. ++ * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK, AVFMT_SEEK_TO_PTS, ++ * AVFMT_SEEK_NOSTREAMS + */ + int flags; + +--- a/libavformat/dv.c ++++ b/libavformat/dv.c +@@ -713,6 +713,7 @@ + const AVInputFormat ff_dv_demuxer = { + .name = "dv", + .long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"), ++ .flags = AVFMT_SEEK_NOSTREAMS, + .priv_data_size = sizeof(RawDVContext), + .read_probe = dv_probe, + .read_header = dv_read_header, +--- a/libavformat/matroskadec.c ++++ b/libavformat/matroskadec.c +@@ -4780,6 +4780,7 @@ + const AVInputFormat ff_webm_dash_manifest_demuxer = { + .name = "webm_dash_manifest", + .long_name = NULL_IF_CONFIG_SMALL("WebM DASH Manifest"), ++ .flags = AVFMT_SEEK_NOSTREAMS, + .priv_class = &webm_dash_class, + .priv_data_size = sizeof(MatroskaDemuxContext), + .flags_internal = FF_FMT_INIT_CLEANUP, +@@ -4792,6 +4793,7 @@ + const AVInputFormat ff_matroska_demuxer = { + .name = "matroska,webm", + .long_name = NULL_IF_CONFIG_SMALL("Matroska / WebM"), ++ .flags = AVFMT_SEEK_NOSTREAMS, + .extensions = "mkv,mk3d,mka,mks,webm", + .priv_data_size = sizeof(MatroskaDemuxContext), + .flags_internal = FF_FMT_INIT_CLEANUP, +--- a/libavformat/seek.c ++++ b/libavformat/seek.c +@@ -605,6 +605,13 @@ + return seek_frame_byte(s, stream_index, timestamp, flags); + } + ++ if (stream_index != -1 && (s->iformat->flags & AVFMT_SEEK_NOSTREAMS)) { ++ timestamp = av_rescale_q(timestamp, ++ s->streams[stream_index]->time_base, ++ AV_TIME_BASE_Q); ++ stream_index = -1; ++ } ++ + if (stream_index < 0) { + stream_index = av_find_default_stream_index(s); + if (stream_index < 0) diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch4 b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch4 new file mode 100644 index 00000000..8eb65ed1 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch4 @@ -0,0 +1,10 @@ +--- a/libavformat/avidec.c ++++ b/libavformat/avidec.c +@@ -2016,6 +2016,7 @@ + .priv_data_size = sizeof(AVIContext), + .flags_internal = FF_FMT_INIT_CLEANUP, + .extensions = "avi", ++ .flags = AVFMT_SEEK_NOSTREAMS, + .read_probe = avi_probe, + .read_header = avi_read_header, + .read_packet = avi_read_packet, diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch5 b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch5 new file mode 100644 index 00000000..64ee262c --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch5 @@ -0,0 +1,25 @@ +--- a/libavfilter/formats.c ++++ b/libavfilter/formats.c +@@ -110,11 +110,13 @@ + possibly causing a lossy conversion elsewhere in the graph. + To avoid that, pretend that there are no common formats to force the + insertion of a conversion filter. */ +- if (type == AVMEDIA_TYPE_VIDEO) ++ if (type == AVMEDIA_TYPE_VIDEO) { + for (i = 0; i < a->nb_formats; i++) { + const AVPixFmtDescriptor *const adesc = av_pix_fmt_desc_get(a->formats[i]); ++ if( !adesc ) continue; + for (j = 0; j < b->nb_formats; j++) { + const AVPixFmtDescriptor *bdesc = av_pix_fmt_desc_get(b->formats[j]); ++ if( !bdesc ) continue; + alpha2 |= adesc->flags & bdesc->flags & AV_PIX_FMT_FLAG_ALPHA; + chroma2|= adesc->nb_components > 1 && bdesc->nb_components > 1; + if (a->formats[i] == b->formats[j]) { +@@ -123,6 +125,7 @@ + } + } + } ++ } + + // If chroma or alpha can be lost through merging then do not merge + if (alpha2 > alpha1 || chroma2 > chroma1) diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch6 b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch7 similarity index 68% rename from cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch6 rename to cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch7 index e59a17cc..379ddb62 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patch6 +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch7 @@ -1,8 +1,6 @@ -diff --git a/libavcodec/vdpau_mpeg12.c b/libavcodec/vdpau_mpeg12.c -index 72220ffb4e..5687c416c9 100644 --- a/libavcodec/vdpau_mpeg12.c +++ b/libavcodec/vdpau_mpeg12.c -@@ -114,6 +114,7 @@ const AVHWAccel ff_mpeg1_vdpau_hwaccel = { +@@ -117,6 +117,7 @@ .frame_priv_data_size = sizeof(struct vdpau_picture_context), .init = vdpau_mpeg1_init, .uninit = ff_vdpau_common_uninit, diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch8 b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch8 new file mode 100644 index 00000000..fcafebb8 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch8 @@ -0,0 +1,11 @@ +--- a/libavcodec/h263dec.c ++++ b/libavcodec/h263dec.c +@@ -623,7 +623,7 @@ + if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) + ff_mpeg4_frame_end(avctx, buf, buf_size); + +- if (!s->divx_packed && avctx->hwaccel) ++ if (s->divx_packed && avctx->hwaccel) + ff_thread_finish_setup(avctx); + + av_assert1(s->current_picture.f->pict_type == s->current_picture_ptr->f->pict_type); diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch9 b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch9 new file mode 100644 index 00000000..721fd09d --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patch9 @@ -0,0 +1,14 @@ +--- a/libavformat/mpegenc.c ++++ b/libavformat/mpegenc.c +@@ -987,9 +987,9 @@ + PacketDesc *pkt_desc; + + while ((pkt_desc = stream->predecode_packet) && ++ pkt_desc != stream->premux_packet && + scr > pkt_desc->dts) { // FIXME: > vs >= +- if (stream->buffer_index < pkt_desc->size || +- stream->predecode_packet == stream->premux_packet) { ++ if (stream->buffer_index < pkt_desc->size) { + av_log(ctx, AV_LOG_ERROR, + "buffer underflow st=%d bufi=%d size=%d\n", + i, stream->buffer_index, pkt_desc->size); diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patchA b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patchB similarity index 78% rename from cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patchA rename to cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patchB index 6d181e3c..89e99896 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patchA +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patchB @@ -1,8 +1,6 @@ -diff --git a/libavutil/hwcontext_vdpau.c b/libavutil/hwcontext_vdpau.c -index dbef5495af..fba06d8ccf 100644 --- a/libavutil/hwcontext_vdpau.c +++ b/libavutil/hwcontext_vdpau.c -@@ -68,6 +68,11 @@ static const VDPAUPixFmtMap pix_fmts_420[] = { +@@ -47,6 +47,11 @@ { 0, AV_PIX_FMT_NONE, }, }; @@ -14,7 +12,7 @@ index dbef5495af..fba06d8ccf 100644 static const VDPAUPixFmtMap pix_fmts_422[] = { { VDP_YCBCR_FORMAT_NV12, AV_PIX_FMT_NV16 }, { VDP_YCBCR_FORMAT_YV12, AV_PIX_FMT_YUV422P }, -@@ -92,6 +97,7 @@ static const struct { +@@ -71,6 +76,7 @@ const VDPAUPixFmtMap *map; } vdpau_pix_fmts[] = { { VDP_CHROMA_TYPE_420, AV_PIX_FMT_YUV420P, pix_fmts_420 }, diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patchC b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patchC new file mode 100644 index 00000000..56df39cc --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patchC @@ -0,0 +1,41 @@ +--- a/libavcodec/encode.c ++++ b/libavcodec/encode.c +@@ -331,7 +331,7 @@ + } + + if (!frame->buf[0]) { +- if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY || ++ if (avci->draining && !(avctx->codec->capabilities & AV_CODEC_CAP_DELAY || + avci->frame_thread_encoder)) + return AVERROR_EOF; + +@@ -350,8 +350,10 @@ + ret = ff_encode_encode_cb(avctx, avpkt, frame, &got_packet); + } + +- if (avci->draining && !got_packet) ++ if (avci->draining && !got_packet) { ++ fflush(stderr); + avci->draining_done = 1; ++ } + + return ret; + } +@@ -526,10 +528,16 @@ + if (avci->draining) + return AVERROR_EOF; + +- if (avci->buffer_frame->buf[0]) ++ if (avci->buffer_frame->buf[0]) { ++ if (!frame) { ++ fflush(stderr); ++ av_frame_unref(avci->buffer_frame); ++ } + return AVERROR(EAGAIN); ++ } + + if (!frame) { ++ fflush(stderr); + avci->draining = 1; + } else { + ret = encode_send_frame_internal(avctx, frame); diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patchD b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patchD new file mode 100644 index 00000000..874fc2a8 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patchD @@ -0,0 +1,26 @@ +--- a/libavcodec/pcm-dvdenc.c ++++ b/libavcodec/pcm-dvdenc.c +@@ -38,6 +38,12 @@ static av_cold int pcm_dvd_encode_init(AVCodecContext *avctx) + int quant, freq, frame_size; + + switch (avctx->sample_rate) { ++ case 32000: ++ freq = 3; ++ break; ++ case 44100: ++ freq = 2; ++ break; + case 48000: + freq = 0; + break; +@@ -181,7 +187,7 @@ const FFCodec ff_pcm_dvd_encoder = { + .priv_data_size = sizeof(PCMDVDContext), + .init = pcm_dvd_encode_init, + FF_CODEC_ENCODE_CB(pcm_dvd_encode_frame), +- .p.supported_samplerates = (const int[]) { 48000, 96000, 0}, ++ .p.supported_samplerates = (const int[]) { 32000, 44100, 48000, 96000, 0}, + CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, + AV_CH_LAYOUT_5POINT1, AV_CH_LAYOUT_7POINT1) + .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, +-- +2.43.0 diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patchZ1 b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patchZ1 similarity index 54% rename from cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patchZ1 rename to cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patchZ1 index 2e0e4013..29cfb628 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg-4.4.patchZ1 +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patchZ1 @@ -1,9 +1,9 @@ ---- a/libavcodec/wrapped_avframe.c.orig 2021-06-15 22:37:02.955552877 +0300 -+++ b/libavcodec/wrapped_avframe.c 2021-06-15 23:50:34.439553140 +0300 -@@ -109,6 +109,36 @@ - return 0; - } - +--- a/libavcodec/wrapped_avframe.c ++++ b/libavcodec/wrapped_avframe.c +@@ -33,6 +33,38 @@ + #include "libavutil/buffer.h" + #include "libavutil/pixdesc.h" + + + +static const enum AVPixelFormat pix_fmts_all[] = { @@ -34,14 +34,16 @@ + AV_PIX_FMT_NONE +}; + - AVCodec ff_wrapped_avframe_encoder = { - .name = "wrapped_avframe", - .long_name = NULL_IF_CONFIG_SMALL("AVFrame to AVPacket passthrough"), -@@ -116,6 +146,7 @@ - .id = AV_CODEC_ID_WRAPPED_AVFRAME, - .encode2 = wrapped_avframe_encode, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, -+ .pix_fmts = pix_fmts_all, ++ ++ + static void wrapped_avframe_release_buffer(void *unused, uint8_t *data) + { + AVFrame *frame = (AVFrame *)data; +@@ -111,6 +143,7 @@ + .p.id = AV_CODEC_ID_WRAPPED_AVFRAME, + .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + FF_CODEC_ENCODE_CB(wrapped_avframe_encode), ++ .p.pix_fmts = pix_fmts_all, }; - - AVCodec ff_wrapped_avframe_decoder = { + + const FFCodec ff_wrapped_avframe_decoder = { diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patchZ2 b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patchZ2 new file mode 100644 index 00000000..a883b14d --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.patchZ2 @@ -0,0 +1,11 @@ +--- a/libavformat/yuv4mpegenc.c ++++ b/libavformat/yuv4mpegenc.c +@@ -268,7 +268,7 @@ + av_log(s, AV_LOG_ERROR, "'%s' is not an official yuv4mpegpipe pixel format. " + "Use '-strict -1' to encode to this pixel format.\n", + av_get_pix_fmt_name(s->streams[0]->codecpar->format)); +- return AVERROR(EINVAL); ++ //return AVERROR(EINVAL); + } + av_log(s, AV_LOG_WARNING, "Warning: generating non standard YUV stream. " + "Mjpegtools will not work.\n"); diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.tar.xz b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.tar.xz new file mode 100644 index 00000000..573e3b42 Binary files /dev/null and b/cinelerra-5.1/thirdparty/src/ffmpeg-6.1.tar.xz differ diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch0 b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch0 deleted file mode 100644 index f9760935..00000000 --- a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch0 +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c -index 88fdbeaf1e..f39d2e7cc4 100644 ---- a/fftools/cmdutils.c -+++ b/fftools/cmdutils.c -@@ -1184,6 +1184,7 @@ static void print_buildconf(int flags, int level) - - void show_banner(int argc, char **argv, const OptionDef *options) - { -+ return; - int idx = locate_option(argc, argv, options, "version"); - if (hide_banner || idx) - return; diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch1 b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch1 index 88631302..e157d3f3 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch1 +++ b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch1 @@ -1,13 +1,11 @@ -diff --git a/libavformat/bluray.c b/libavformat/bluray.c -index 635c4f1b87..80a2e2c3d2 100644 ---- a/libavformat/bluray.c -+++ b/libavformat/bluray.c -@@ -28,7 +28,7 @@ - #include "libavutil/opt.h" +--- a/fftools/cmdutils.c ++++ b/fftools/cmdutils.c +@@ -59,7 +59,7 @@ + AVDictionary *swr_opts; + AVDictionary *format_opts, *codec_opts; - #define BLURAY_PROTO_PREFIX "bluray:" --#define MIN_PLAYLIST_LENGTH 180 /* 3 min */ -+#define MIN_PLAYLIST_LENGTH 0 +-int hide_banner = 0; ++int hide_banner = 1; - typedef struct { - const AVClass *class; + void uninit_opts(void) + { diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch10 b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch10 new file mode 100644 index 00000000..1fc3f890 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch10 @@ -0,0 +1,16 @@ +--- a/libavutil/hwcontext_cuda.c.orig 2023-11-11 03:25:17.000000000 +0300 ++++ b/libavutil/hwcontext_cuda.c 2023-11-12 17:52:01.243063419 +0300 +@@ -361,11 +361,13 @@ + hwctx->internal->cuda_device)); + if (ret < 0) + return ret; ++#if 0 + } else if (flags & AV_CUDA_USE_CURRENT_CONTEXT) { + ret = CHECK_CU(cu->cuCtxGetCurrent(&hwctx->cuda_ctx)); + if (ret < 0) + return ret; + av_log(device_ctx, AV_LOG_INFO, "Using current CUDA context.\n"); ++#endif + } else { + ret = CHECK_CU(cu->cuCtxCreate(&hwctx->cuda_ctx, desired_flags, + hwctx->internal->cuda_device)); diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch2 b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch2 index 11573c26..fc9c74b7 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch2 +++ b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch2 @@ -1,835 +1,128 @@ -diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c -index d827ba3e28..c8c6db979b 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c -@@ -56,7 +56,8 @@ typedef struct MpegTSService { - int sid; /* service ID */ - uint8_t name[256]; - uint8_t provider_name[256]; -- int pcr_pid; -+ int64_t pcr, pcr_packet_timer, pcr_packet_period; -+ int pcr_sid, pcr_pid; - AVProgram *program; - } MpegTSService; - -@@ -76,11 +77,12 @@ typedef struct MpegTSWrite { - MpegTSSection pat; /* MPEG-2 PAT table */ - MpegTSSection sdt; /* MPEG-2 SDT table context */ - MpegTSService **services; -- int64_t sdt_period; /* SDT period in PCR time base */ -- int64_t pat_period; /* PAT/PMT period in PCR time base */ -+ int64_t sdt_packet_timer, sdt_packet_period; -+ int64_t pat_packet_timer, pat_packet_period; +@@ -89,9 +89,11 @@ + int64_t pat_period; /* PAT/PMT period in PCR time base */ + int64_t nit_period; /* NIT period in PCR time base */ int nb_services; - int64_t first_pcr; + int first_dts_checked; - int64_t next_pcr; -+ int onid; -+ int tsid; -+ int64_t pcr, first_pcr, delay; ++ int64_t pcr_pos, pcr; ++ int64_t first_pcr, next_pcr; ++ int64_t delay; ++ int pcr_stream_pid; int mux_rate; ///< set to 1 when VBR int pes_payload_size; + int64_t total_size; +@@ -258,7 +260,7 @@ + int data_st_warning; -@@ -90,14 +92,14 @@ typedef struct MpegTSWrite { - int service_type; - - int pmt_start_pid; -+ int pcr_start_pid; - int start_pid; - int m2ts_mode; -- int m2ts_video_pid; -- int m2ts_audio_pid; -- int m2ts_pgssub_pid; -- int m2ts_textsub_pid; -+ int64_t ts_offset; - -- int pcr_period_ms; -+ int reemit_pat_pmt; // backward compatibility -+ -+ double pcr_period; - #define MPEGTS_FLAG_REEMIT_PAT_PMT 0x01 - #define MPEGTS_FLAG_AAC_LATM 0x02 - #define MPEGTS_FLAG_PAT_PMT_AT_FRAMES 0x04 -@@ -106,10 +108,8 @@ typedef struct MpegTSWrite { - int flags; - int copyts; - int tables_version; -- int64_t pat_period_us; -- int64_t sdt_period_us; -- int64_t last_pat_ts; -- int64_t last_sdt_ts; -+ double pat_period; -+ double sdt_period; - - int omit_video_pes_length; - } MpegTSWrite; -@@ -217,14 +217,15 @@ static int mpegts_write_section1(MpegTSSection *s, int tid, int id, - /* mpegts writer */ - - #define DEFAULT_PROVIDER_NAME "FFmpeg" --#define DEFAULT_SERVICE_NAME "Service" -+#define DEFAULT_SERVICE_NAME "Service01" - --/* we retransmit the SI info at this rate */ -+/* we retransmit the SI info at this rate (ms) */ - #define SDT_RETRANS_TIME 500 - #define PAT_RETRANS_TIME 100 --#define PCR_RETRANS_TIME 20 -+#define PCR_RETRANS_TIME 50 - - typedef struct MpegTSWriteStream { -+ struct MpegTSService *service; - int pid; /* stream associated pid */ - int cc; - int discontinuity; -@@ -236,10 +237,7 @@ typedef struct MpegTSWriteStream { - int payload_flags; - uint8_t *payload; - AVFormatContext *amux; -- int data_st_warning; -- -- int64_t pcr_period; /* PCR period in PCR time base */ + int64_t pcr_period; /* PCR period in PCR time base */ - int64_t last_pcr; -+ AVRational user_tb; ++ int64_t pcr_timer; /* For Opus */ int opus_queued_samples; -@@ -259,7 +257,7 @@ static void mpegts_write_pat(AVFormatContext *s) - put16(&q, service->sid); - put16(&q, 0xe000 | service->pmt.pid); - } -- mpegts_write_section1(&ts->pat, PAT_TID, ts->transport_stream_id, ts->tables_version, 0, 0, -+ mpegts_write_section1(&ts->pat, PAT_TID, ts->tsid, ts->tables_version, 0, 0, - data, q - data); - } - -@@ -281,148 +279,6 @@ static void put_registration_descriptor(uint8_t **q_ptr, uint32_t tag) - *q_ptr = q; - } - --static int get_dvb_stream_type(AVFormatContext *s, AVStream *st) --{ -- MpegTSWrite *ts = s->priv_data; -- MpegTSWriteStream *ts_st = st->priv_data; -- int stream_type; -- -- switch (st->codecpar->codec_id) { -- case AV_CODEC_ID_MPEG1VIDEO: -- case AV_CODEC_ID_MPEG2VIDEO: -- stream_type = STREAM_TYPE_VIDEO_MPEG2; -- break; -- case AV_CODEC_ID_MPEG4: -- stream_type = STREAM_TYPE_VIDEO_MPEG4; -- break; -- case AV_CODEC_ID_H264: -- stream_type = STREAM_TYPE_VIDEO_H264; -- break; -- case AV_CODEC_ID_HEVC: -- stream_type = STREAM_TYPE_VIDEO_HEVC; -- break; -- case AV_CODEC_ID_CAVS: -- stream_type = STREAM_TYPE_VIDEO_CAVS; -- break; -- case AV_CODEC_ID_DIRAC: -- stream_type = STREAM_TYPE_VIDEO_DIRAC; -- break; -- case AV_CODEC_ID_VC1: -- stream_type = STREAM_TYPE_VIDEO_VC1; -- break; -- case AV_CODEC_ID_MP2: -- case AV_CODEC_ID_MP3: -- if ( st->codecpar->sample_rate > 0 -- && st->codecpar->sample_rate < 32000) { -- stream_type = STREAM_TYPE_AUDIO_MPEG2; -- } else { -- stream_type = STREAM_TYPE_AUDIO_MPEG1; -- } -- break; -- case AV_CODEC_ID_AAC: -- stream_type = (ts->flags & MPEGTS_FLAG_AAC_LATM) -- ? STREAM_TYPE_AUDIO_AAC_LATM -- : STREAM_TYPE_AUDIO_AAC; -- break; -- case AV_CODEC_ID_AAC_LATM: -- stream_type = STREAM_TYPE_AUDIO_AAC_LATM; -- break; -- case AV_CODEC_ID_AC3: -- stream_type = (ts->flags & MPEGTS_FLAG_SYSTEM_B) -- ? STREAM_TYPE_PRIVATE_DATA -- : STREAM_TYPE_AUDIO_AC3; -- break; -- case AV_CODEC_ID_EAC3: -- stream_type = (ts->flags & MPEGTS_FLAG_SYSTEM_B) -- ? STREAM_TYPE_PRIVATE_DATA -- : STREAM_TYPE_AUDIO_EAC3; -- break; -- case AV_CODEC_ID_DTS: -- stream_type = STREAM_TYPE_AUDIO_DTS; -- break; -- case AV_CODEC_ID_TRUEHD: -- stream_type = STREAM_TYPE_AUDIO_TRUEHD; -- break; -- case AV_CODEC_ID_OPUS: -- stream_type = STREAM_TYPE_PRIVATE_DATA; -- break; -- case AV_CODEC_ID_TIMED_ID3: -- stream_type = STREAM_TYPE_METADATA; -- break; -- case AV_CODEC_ID_DVB_SUBTITLE: -- case AV_CODEC_ID_DVB_TELETEXT: -- stream_type = STREAM_TYPE_PRIVATE_DATA; -- break; -- case AV_CODEC_ID_SMPTE_KLV: -- if (st->codecpar->profile == FF_PROFILE_KLVA_SYNC) { -- stream_type = STREAM_TYPE_METADATA; -- } else { -- stream_type = STREAM_TYPE_PRIVATE_DATA; -- } -- break; -- default: -- av_log_once(s, AV_LOG_WARNING, AV_LOG_DEBUG, &ts_st->data_st_warning, -- "Stream %d, codec %s, is muxed as a private data stream " -- "and may not be recognized upon reading.\n", st->index, -- avcodec_get_name(st->codecpar->codec_id)); -- stream_type = STREAM_TYPE_PRIVATE_DATA; -- break; -- } -- -- return stream_type; --} -- --static int get_m2ts_stream_type(AVFormatContext *s, AVStream *st) --{ -- int stream_type; -- MpegTSWriteStream *ts_st = st->priv_data; -- -- switch (st->codecpar->codec_id) { -- case AV_CODEC_ID_MPEG2VIDEO: -- stream_type = STREAM_TYPE_VIDEO_MPEG2; -- break; -- case AV_CODEC_ID_H264: -- stream_type = STREAM_TYPE_VIDEO_H264; -- break; -- case AV_CODEC_ID_VC1: -- stream_type = STREAM_TYPE_VIDEO_VC1; -- break; -- case AV_CODEC_ID_HEVC: -- stream_type = STREAM_TYPE_VIDEO_HEVC; -- break; -- case AV_CODEC_ID_PCM_BLURAY: -- stream_type = 0x80; -- break; -- case AV_CODEC_ID_AC3: -- stream_type = 0x81; -- break; -- case AV_CODEC_ID_DTS: -- stream_type = (st->codecpar->channels > 6) ? 0x85 : 0x82; -- break; -- case AV_CODEC_ID_TRUEHD: -- stream_type = 0x83; -- break; -- case AV_CODEC_ID_EAC3: -- stream_type = 0x84; -- break; -- case AV_CODEC_ID_HDMV_PGS_SUBTITLE: -- stream_type = 0x90; -- break; -- case AV_CODEC_ID_HDMV_TEXT_SUBTITLE: -- stream_type = 0x92; -- break; -- default: -- av_log_once(s, AV_LOG_WARNING, AV_LOG_DEBUG, &ts_st->data_st_warning, -- "Stream %d, codec %s, is muxed as a private data stream " -- "and may not be recognized upon reading.\n", st->index, -- avcodec_get_name(st->codecpar->codec_id)); -- stream_type = STREAM_TYPE_PRIVATE_DATA; -- break; -- } -- -- return stream_type; --} -- - static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service) - { - MpegTSWrite *ts = s->priv_data; -@@ -436,14 +292,6 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service) - q += 2; /* patched after */ - - /* put program info here */ -- if (ts->m2ts_mode) { -- put_registration_descriptor(&q, MKTAG('H', 'D', 'M', 'V')); -- *q++ = 0x88; // descriptor_tag - hdmv_copy_control_descriptor -- *q++ = 0x04; // descriptor_length -- put16(&q, 0x0fff); // CA_System_ID -- *q++ = 0xfc; // private_data_byte -- *q++ = 0xfc; // private_data_byte -- } - - val = 0xf000 | (q - program_info_length_ptr - 2); - program_info_length_ptr[0] = val >> 8; -@@ -472,8 +320,72 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service) - err = 1; - break; - } -- -- stream_type = ts->m2ts_mode ? get_m2ts_stream_type(s, st) : get_dvb_stream_type(s, st); -+ switch (st->codecpar->codec_id) { -+ case AV_CODEC_ID_MPEG1VIDEO: -+ case AV_CODEC_ID_MPEG2VIDEO: -+ stream_type = STREAM_TYPE_VIDEO_MPEG2; -+ break; -+ case AV_CODEC_ID_MPEG4: -+ stream_type = STREAM_TYPE_VIDEO_MPEG4; -+ break; -+ case AV_CODEC_ID_H264: -+ stream_type = STREAM_TYPE_VIDEO_H264; -+ break; -+ case AV_CODEC_ID_HEVC: -+ stream_type = STREAM_TYPE_VIDEO_HEVC; -+ break; -+ case AV_CODEC_ID_CAVS: -+ stream_type = STREAM_TYPE_VIDEO_CAVS; -+ break; -+ case AV_CODEC_ID_DIRAC: -+ stream_type = STREAM_TYPE_VIDEO_DIRAC; -+ break; -+ case AV_CODEC_ID_VC1: -+ stream_type = STREAM_TYPE_VIDEO_VC1; -+ break; -+ case AV_CODEC_ID_MP2: -+ case AV_CODEC_ID_MP3: -+ if ( st->codecpar->sample_rate > 0 -+ && st->codecpar->sample_rate < 32000) { -+ stream_type = STREAM_TYPE_AUDIO_MPEG2; -+ } else { -+ stream_type = STREAM_TYPE_AUDIO_MPEG1; -+ } -+ break; -+ case AV_CODEC_ID_AAC: -+ stream_type = (ts->flags & MPEGTS_FLAG_AAC_LATM) -+ ? STREAM_TYPE_AUDIO_AAC_LATM -+ : STREAM_TYPE_AUDIO_AAC; -+ break; -+ case AV_CODEC_ID_AAC_LATM: -+ stream_type = STREAM_TYPE_AUDIO_AAC_LATM; -+ break; -+ case AV_CODEC_ID_AC3: -+ stream_type = (ts->flags & MPEGTS_FLAG_SYSTEM_B) -+ ? STREAM_TYPE_PRIVATE_DATA -+ : STREAM_TYPE_AUDIO_AC3; -+ break; -+ case AV_CODEC_ID_EAC3: -+ stream_type = (ts->flags & MPEGTS_FLAG_SYSTEM_B) -+ ? STREAM_TYPE_PRIVATE_DATA -+ : STREAM_TYPE_AUDIO_EAC3; -+ break; -+ case AV_CODEC_ID_DTS: -+ stream_type = STREAM_TYPE_AUDIO_DTS; -+ break; -+ case AV_CODEC_ID_TRUEHD: -+ stream_type = STREAM_TYPE_AUDIO_TRUEHD; -+ break; -+ case AV_CODEC_ID_OPUS: -+ stream_type = STREAM_TYPE_PRIVATE_DATA; -+ break; -+ case AV_CODEC_ID_TIMED_ID3: -+ stream_type = STREAM_TYPE_METADATA; -+ break; -+ default: -+ stream_type = STREAM_TYPE_PRIVATE_DATA; -+ break; -+ } - - *q++ = stream_type; - put16(&q, 0xe000 | ts_st->pid); -@@ -736,7 +648,7 @@ static void mpegts_write_sdt(AVFormatContext *s) - int i, running_status, free_ca_mode, val; - - q = data; -- put16(&q, ts->original_network_id); -+ put16(&q, ts->onid); - *q++ = 0xff; - for (i = 0; i < ts->nb_services; i++) { - service = ts->services[i]; -@@ -762,7 +674,7 @@ static void mpegts_write_sdt(AVFormatContext *s) - desc_list_len_ptr[0] = val >> 8; - desc_list_len_ptr[1] = val; - } -- mpegts_write_section1(&ts->sdt, SDT_TID, ts->transport_stream_id, ts->tables_version, 0, 0, -+ mpegts_write_section1(&ts->sdt, SDT_TID, ts->tsid, ts->tables_version, 0, 0, - data, q - data); - } - -@@ -802,49 +714,12 @@ invalid: +@@ -959,18 +961,18 @@ return 0; } --static int64_t get_pcr(const MpegTSWrite *ts, AVIOContext *pb) --{ -- return av_rescale(avio_tell(pb) + 11, 8 * PCR_TIME_BASE, ts->mux_rate) + -- ts->first_pcr; --} -- --static void write_packet(AVFormatContext *s, const uint8_t *packet) --{ -- MpegTSWrite *ts = s->priv_data; -- if (ts->m2ts_mode) { -- int64_t pcr = get_pcr(s->priv_data, s->pb); -- uint32_t tp_extra_header = pcr % 0x3fffffff; -- tp_extra_header = AV_RB32(&tp_extra_header); -- avio_write(s->pb, (unsigned char *) &tp_extra_header, -- sizeof(tp_extra_header)); -- } -- avio_write(s->pb, packet, TS_PACKET_SIZE); --} -- --static void section_write_packet(MpegTSSection *s, const uint8_t *packet) --{ -- AVFormatContext *ctx = s->opaque; -- write_packet(ctx, packet); --} -- - static MpegTSService *mpegts_add_service(AVFormatContext *s, int sid, -- const AVDictionary *metadata, -- AVProgram *program) -+ const char *provider_name, -+ const char *name) +-static int64_t get_pcr(const MpegTSWrite *ts) ++static int64_t get_pcr(const MpegTSWrite *ts, AVIOContext *pb) { - MpegTSWrite *ts = s->priv_data; - MpegTSService *service; -- AVDictionaryEntry *title, *provider; -- char default_service_name[32]; -- const char *service_name; -- const char *provider_name; -- -- title = av_dict_get(metadata, "service_name", NULL, 0); -- if (!title) -- title = av_dict_get(metadata, "title", NULL, 0); -- snprintf(default_service_name, sizeof(default_service_name), "%s%02d", DEFAULT_SERVICE_NAME, ts->nb_services + 1); -- service_name = title ? title->value : default_service_name; -- provider = av_dict_get(metadata, "service_provider", NULL, 0); -- provider_name = provider ? provider->value : DEFAULT_PROVIDER_NAME; - - service = av_mallocz(sizeof(MpegTSService)); - if (!service) -@@ -852,92 +727,57 @@ static MpegTSService *mpegts_add_service(AVFormatContext *s, int sid, - service->pmt.pid = ts->pmt_start_pid + ts->nb_services; - service->sid = sid; - service->pcr_pid = 0x1fff; -+ service->pcr_sid = 0x1fff; - if (encode_str8(service->provider_name, provider_name) < 0 || -- encode_str8(service->name, service_name) < 0) { -+ encode_str8(service->name, name) < 0) { - av_log(s, AV_LOG_ERROR, "Too long service or provider name\n"); - goto fail; - } - if (av_dynarray_add_nofree(&ts->services, &ts->nb_services, service) < 0) - goto fail; - -- service->pmt.write_packet = section_write_packet; -- service->pmt.opaque = s; -- service->pmt.cc = 15; -- service->pmt.discontinuity= ts->flags & MPEGTS_FLAG_DISCONT; -- service->program = program; -- - return service; - fail: - av_free(service); - return NULL; +- return av_rescale(ts->total_size + 11, 8 * PCR_TIME_BASE, ts->mux_rate) + +- ts->first_pcr; ++ int64_t pos = avio_tell(pb) + 11; ++ return ts->pcr + (ts->mux_rate == 1 ? (pos - ts->pcr_pos) * 8 : ++ av_rescale(pos - ts->pcr_pos, 8 * PCR_TIME_BASE, ts->mux_rate)); } --static void enable_pcr_generation_for_stream(AVFormatContext *s, AVStream *pcr_st) -+static void mpegts_prefix_m2ts_header(AVFormatContext *s) + static void write_packet(AVFormatContext *s, const uint8_t *packet) { MpegTSWrite *ts = s->priv_data; -- MpegTSWriteStream *ts_st = pcr_st->priv_data; -- -- if (ts->mux_rate > 1 || ts->pcr_period_ms >= 0) { -- int pcr_period_ms = ts->pcr_period_ms == -1 ? PCR_RETRANS_TIME : ts->pcr_period_ms; -- ts_st->pcr_period = av_rescale(pcr_period_ms, PCR_TIME_BASE, 1000); -- } else { -- /* By default, for VBR we select the highest multiple of frame duration which is less than 100 ms. */ -- int64_t frame_period = 0; -- if (pcr_st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) { -- int frame_size = av_get_audio_frame_duration2(pcr_st->codecpar, 0); -- if (!frame_size) { -- av_log(s, AV_LOG_WARNING, "frame size not set\n"); -- frame_size = 512; -- } -- frame_period = av_rescale_rnd(frame_size, PCR_TIME_BASE, pcr_st->codecpar->sample_rate, AV_ROUND_UP); -- } else if (pcr_st->avg_frame_rate.num) { -- frame_period = av_rescale_rnd(pcr_st->avg_frame_rate.den, PCR_TIME_BASE, pcr_st->avg_frame_rate.num, AV_ROUND_UP); -- } -- if (frame_period > 0 && frame_period <= PCR_TIME_BASE / 10) -- ts_st->pcr_period = frame_period * (PCR_TIME_BASE / 10 / frame_period); -- else -- ts_st->pcr_period = 1; -+ if (ts->m2ts_mode) { -+ uint32_t tp_extra_header = ts->pcr % 0x3fffffff; -+ tp_extra_header = AV_RB32(&tp_extra_header); -+ avio_write(s->pb, (unsigned char *) &tp_extra_header, -+ sizeof(tp_extra_header)); + if (ts->m2ts_mode) { +- int64_t pcr = get_pcr(s->priv_data); +- uint32_t tp_extra_header = pcr % 0x3fffffff; ++ uint32_t tp_extra_header = get_pcr(ts, s->pb) % 0x3fffffff; + tp_extra_header = AV_RB32(&tp_extra_header); + avio_write(s->pb, (unsigned char *) &tp_extra_header, + sizeof(tp_extra_header)); +@@ -1056,9 +1058,6 @@ + else + ts_st->pcr_period = 1; } - - // output a PCR as soon as possible - ts_st->last_pcr = ts->first_pcr - ts_st->pcr_period; } --static void select_pcr_streams(AVFormatContext *s) -+static void section_write_packet(MpegTSSection *s, const uint8_t *packet) - { -- MpegTSWrite *ts = s->priv_data; -- -- for (int i = 0; i < ts->nb_services; i++) { -- MpegTSService *service = ts->services[i]; -- AVStream *pcr_st = NULL; -- AVProgram *program = service->program; -- int nb_streams = program ? program->nb_stream_indexes : s->nb_streams; -- -- for (int j = 0; j < nb_streams; j++) { -- AVStream *st = s->streams[program ? program->stream_index[j] : j]; -- if (!pcr_st || -- pcr_st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO && st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) -- { -- pcr_st = st; -- } -- } -- -- if (pcr_st) { -- MpegTSWriteStream *ts_st = pcr_st->priv_data; -- service->pcr_pid = ts_st->pid; -- enable_pcr_generation_for_stream(s, pcr_st); -- av_log(s, AV_LOG_VERBOSE, "service %i using PCR in pid=%i, pcr_period=%"PRId64"ms\n", -- service->sid, service->pcr_pid, av_rescale(ts_st->pcr_period, 1000, PCR_TIME_BASE)); -- } -- } -+ AVFormatContext *ctx = s->opaque; -+ mpegts_prefix_m2ts_header(ctx); -+ avio_write(ctx->pb, packet, TS_PACKET_SIZE); - } - - static int mpegts_init(AVFormatContext *s) - { - MpegTSWrite *ts = s->priv_data; -+ MpegTSWriteStream *ts_st; -+ MpegTSService *service; -+ AVStream *st, *pcr_st = NULL; -+ AVDictionaryEntry *title, *provider; -+ double clk_rate; - int i, j; -+ const char *service_name; -+ const char *provider_name; -+ int *pids; - int ret; + static void select_pcr_streams(AVFormatContext *s) +@@ -1121,6 +1120,7 @@ -+ if (s->max_delay < 0) /* Not set by the caller */ -+ s->max_delay = 0; + if (s->max_delay < 0) /* Not set by the caller */ + s->max_delay = 0; + ts->delay = av_rescale(s->max_delay, 90000, AV_TIME_BASE); -+ - if (ts->m2ts_mode == -1) { - if (av_match_ext(s->url, "m2ts")) { - ts->m2ts_mode = 1; -@@ -946,36 +786,53 @@ static int mpegts_init(AVFormatContext *s) - } - } -- ts->m2ts_video_pid = M2TS_VIDEO_PID; -- ts->m2ts_audio_pid = M2TS_AUDIO_START_PID; -- ts->m2ts_pgssub_pid = M2TS_PGSSUB_START_PID; -- ts->m2ts_textsub_pid = M2TS_TEXTSUB_PID; -- -- if (ts->m2ts_mode) { -- ts->pmt_start_pid = M2TS_PMT_PID; -- if (s->nb_programs > 1) { -- av_log(s, AV_LOG_ERROR, "Only one program is allowed in m2ts mode!\n"); -- return AVERROR(EINVAL); -- } -- } -- -- if (s->max_delay < 0) /* Not set by the caller */ -- s->max_delay = 0; -- // round up to a whole number of TS packets ts->pes_payload_size = (ts->pes_payload_size + 14 + 183) / 184 * 184 - 14; - -+ ts->tsid = ts->transport_stream_id; -+ ts->onid = ts->original_network_id; - if (!s->nb_programs) { - /* allocate a single DVB service */ -- if (!mpegts_add_service(s, ts->service_id, s->metadata, NULL)) -+ title = av_dict_get(s->metadata, "service_name", NULL, 0); -+ if (!title) -+ title = av_dict_get(s->metadata, "title", NULL, 0); -+ service_name = title ? title->value : DEFAULT_SERVICE_NAME; -+ provider = av_dict_get(s->metadata, "service_provider", NULL, 0); -+ provider_name = provider ? provider->value : DEFAULT_PROVIDER_NAME; -+ service = mpegts_add_service(s, ts->service_id, -+ provider_name, service_name); -+ -+ if (!service) - return AVERROR(ENOMEM); -+ -+ service->pmt.write_packet = section_write_packet; -+ service->pmt.opaque = s; -+ service->pmt.cc = 15; -+ service->pmt.discontinuity= ts->flags & MPEGTS_FLAG_DISCONT; - } else { - for (i = 0; i < s->nb_programs; i++) { - AVProgram *program = s->programs[i]; -- if (!mpegts_add_service(s, program->id, program->metadata, program)) -+ title = av_dict_get(program->metadata, "service_name", NULL, 0); -+ if (!title) -+ title = av_dict_get(program->metadata, "title", NULL, 0); -+ service_name = title ? title->value : DEFAULT_SERVICE_NAME; -+ provider = av_dict_get(program->metadata, "service_provider", NULL, 0); -+ provider_name = provider ? provider->value : DEFAULT_PROVIDER_NAME; -+ service = mpegts_add_service(s, program->id, -+ provider_name, service_name); -+ -+ if (!service) - return AVERROR(ENOMEM); -+ -+ service->pmt.write_packet = section_write_packet; -+ service->pmt.opaque = s; -+ service->pmt.cc = 15; -+ service->pmt.discontinuity= ts->flags & MPEGTS_FLAG_DISCONT; -+ service->program = program; - } - } -+ if (ts->m2ts_mode > 1) -+ service->pmt.pid = 0x00ff + ts->service_id; - - ts->pat.pid = PAT_PID; - /* Initialize at 15 so that it wraps and is equal to 0 for the -@@ -991,158 +848,175 @@ static int mpegts_init(AVFormatContext *s) - ts->sdt.write_packet = section_write_packet; - ts->sdt.opaque = s; - -+ pids = av_malloc_array(s->nb_streams, sizeof(*pids)); -+ if (!pids) { -+ ret = AVERROR(ENOMEM); -+ goto fail; -+ } -+ - /* assign pids to each stream */ - for (i = 0; i < s->nb_streams; i++) { -- AVStream *st = s->streams[i]; -- MpegTSWriteStream *ts_st; -+ AVProgram *program; -+ st = s->streams[i]; - - ts_st = av_mallocz(sizeof(MpegTSWriteStream)); - if (!ts_st) { -- return AVERROR(ENOMEM); -+ ret = AVERROR(ENOMEM); -+ goto fail; - } - st->priv_data = ts_st; - -+ ts_st->user_tb = st->time_base; - avpriv_set_pts_info(st, 33, 1, 90000); - - ts_st->payload = av_mallocz(ts->pes_payload_size); - if (!ts_st->payload) { -- return AVERROR(ENOMEM); -+ ret = AVERROR(ENOMEM); -+ goto fail; - } - -- /* MPEG pid values < 16 are reserved. Applications which set st->id in -- * this range are assigned a calculated pid. */ -- if (st->id < 16) { +@@ -1180,7 +1180,9 @@ + /* MPEG pid values < 16 are reserved. Applications which set st->id in + * this range are assigned a calculated pid. */ + if (st->id < 16) { - if (ts->m2ts_mode) { -- switch (st->codecpar->codec_type) { -- case AVMEDIA_TYPE_VIDEO: -- ts_st->pid = ts->m2ts_video_pid++; -- break; -- case AVMEDIA_TYPE_AUDIO: -- ts_st->pid = ts->m2ts_audio_pid++; -- break; -- case AVMEDIA_TYPE_SUBTITLE: -- switch (st->codecpar->codec_id) { -- case AV_CODEC_ID_HDMV_PGS_SUBTITLE: -- ts_st->pid = ts->m2ts_pgssub_pid++; -- break; -- case AV_CODEC_ID_HDMV_TEXT_SUBTITLE: -- ts_st->pid = ts->m2ts_textsub_pid++; -- break; -- } -+ program = av_find_program_from_stream(s, NULL, i); -+ if (program) { -+ for (j = 0; j < ts->nb_services; j++) { -+ if (ts->services[j]->program == program) { -+ service = ts->services[j]; - break; ++ if (ts->start_pid >= 0) ++ ts_st->pid = ts->start_pid + i; ++ else if (ts->m2ts_mode) { + switch (st->codecpar->codec_type) { + case AVMEDIA_TYPE_VIDEO: + ts_st->pid = ts->m2ts_video_pid++; +@@ -1207,9 +1209,9 @@ + av_log(s, AV_LOG_ERROR, "Cannot automatically assign PID for stream %d\n", st->index); + return AVERROR(EINVAL); } -- if (ts->m2ts_video_pid > M2TS_VIDEO_PID + 1 || -- ts->m2ts_audio_pid > M2TS_AUDIO_START_PID + 32 || -- ts->m2ts_pgssub_pid > M2TS_PGSSUB_START_PID + 32 || -- ts->m2ts_textsub_pid > M2TS_TEXTSUB_PID + 1 || -- ts_st->pid < 16) { -- av_log(s, AV_LOG_ERROR, "Cannot automatically assign PID for stream %d\n", st->index); -- return AVERROR(EINVAL); -- } - } else { - ts_st->pid = ts->start_pid + i; } -- } else { -- ts_st->pid = st->id; - } -- if (ts_st->pid >= 0x1FFF) { -+ -+ ts_st->service = service; -+ /* MPEG pid values < 16 are reserved. Applications which set st->id in -+ * this range are assigned a calculated pid. */ -+ if (st->id < 16) { -+ ts_st->pid = ts->start_pid + i; -+ } else if (st->id < 0x1FFF) { -+ ts_st->pid = st->id; -+ } else { - av_log(s, AV_LOG_ERROR, - "Invalid stream id %d, must be less than 8191\n", st->id); -- return AVERROR(EINVAL); -+ ret = AVERROR(EINVAL); -+ goto fail; - } -- for (j = 0; j < ts->nb_services; j++) { -- if (ts->services[j]->pmt.pid > LAST_OTHER_PID) { -- av_log(s, AV_LOG_ERROR, -- "Invalid PMT PID %d, must be less than %d\n", ts->services[j]->pmt.pid, LAST_OTHER_PID + 1); -- return AVERROR(EINVAL); -- } -- if (ts_st->pid == ts->services[j]->pmt.pid) { -- av_log(s, AV_LOG_ERROR, "PID %d cannot be both elementary and PMT PID\n", ts_st->pid); -- return AVERROR(EINVAL); -- } -+ if (ts_st->pid == service->pmt.pid) { -+ av_log(s, AV_LOG_ERROR, "Duplicate stream id %d\n", ts_st->pid); -+ ret = AVERROR(EINVAL); -+ goto fail; - } - for (j = 0; j < i; j++) { -- MpegTSWriteStream *ts_st_prev = s->streams[j]->priv_data; -- if (ts_st_prev->pid == ts_st->pid) { -+ if (pids[j] == ts_st->pid) { - av_log(s, AV_LOG_ERROR, "Duplicate stream id %d\n", ts_st->pid); -- return AVERROR(EINVAL); -+ ret = AVERROR(EINVAL); -+ goto fail; - } - } -+ pids[i] = ts_st->pid; - ts_st->payload_pts = AV_NOPTS_VALUE; - ts_st->payload_dts = AV_NOPTS_VALUE; - ts_st->first_pts_check = 1; - ts_st->cc = 15; - ts_st->discontinuity = ts->flags & MPEGTS_FLAG_DISCONT; -+ /* update PCR pid by using the first video stream */ -+ if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && -+ service->pcr_sid == 0x1fff) -+ pcr_st = st; -+ - if (st->codecpar->codec_id == AV_CODEC_ID_AAC && - st->codecpar->extradata_size > 0) { - AVStream *ast; - ts_st->amux = avformat_alloc_context(); - if (!ts_st->amux) { -- return AVERROR(ENOMEM); -+ ret = AVERROR(ENOMEM); -+ goto fail; - } - ts_st->amux->oformat = - av_guess_format((ts->flags & MPEGTS_FLAG_AAC_LATM) ? "latm" : "adts", - NULL, NULL); - if (!ts_st->amux->oformat) { -- return AVERROR(EINVAL); -+ ret = AVERROR(EINVAL); -+ goto fail; - } - if (!(ast = avformat_new_stream(ts_st->amux, NULL))) { -- return AVERROR(ENOMEM); -+ ret = AVERROR(ENOMEM); -+ goto fail; - } - ret = avcodec_parameters_copy(ast->codecpar, st->codecpar); - if (ret != 0) -- return ret; -+ goto fail; - ast->time_base = st->time_base; - ret = avformat_write_header(ts_st->amux, NULL); - if (ret < 0) -- return ret; -+ goto fail; - } - if (st->codecpar->codec_id == AV_CODEC_ID_OPUS) { - ts_st->opus_pending_trim_start = st->codecpar->initial_padding * 48000 / st->codecpar->sample_rate; ++ else ++ ts_st->pid = START_PID + i; + } else { + ts_st->pid = st->id; } - } - -+ av_freep(&pids); -+ -+ /* if no video stream, use the first stream as PCR */ -+ if (!pcr_st && s->nb_streams > 0) -+ pcr_st = s->streams[0]; -+ if (!pcr_st) { -+ av_log(s, AV_LOG_ERROR, "no streams\n"); -+ ret = AVERROR(EINVAL); -+ goto fail; -+ } -+ ts_st = pcr_st->priv_data; -+ if (service->pcr_sid == 0x1fff) -+ service->pcr_sid = ts_st->pid; -+ if (service->pcr_pid == 0x1fff) -+ service->pcr_pid = ts->m2ts_mode > 1 ? -+ 0x1000 + ts->service_id : service->pcr_sid ; -+ if (service->pmt.pid == service->pcr_pid) { -+ av_log(s, AV_LOG_ERROR, "Duplicate stream id %d\n", service->pcr_pid); -+ ret = AVERROR(EINVAL); -+ goto fail; -+ } -+ -+ clk_rate = ts->mux_rate > 1 ? ts->mux_rate : PCR_TIME_BASE; -+ ts->sdt_packet_period = ts->sdt_period < 0 ? -1 : ts->sdt_period/1000 * clk_rate; -+ ts->pat_packet_period = ts->pat_period/1000 * clk_rate; -+ service->pcr_packet_period = ts->pcr_period/1000 * clk_rate; -+ if (service->pcr_packet_period < (TS_PACKET_SIZE*8*10)) -+ service->pcr_packet_period = (TS_PACKET_SIZE*8*10); -+ av_log(s, AV_LOG_VERBOSE, "clk_rate %f: ticks/pkt %d pcr, %d sdt, %d pmt\n", clk_rate, -+ (int)service->pcr_packet_period, (int)ts->sdt_packet_period, (int)ts->pat_packet_period); -+ - if (ts->copyts < 1) - ts->first_pcr = av_rescale(s->max_delay, PCR_TIME_BASE, AV_TIME_BASE); - -- select_pcr_streams(s); -- -- ts->last_pat_ts = AV_NOPTS_VALUE; -- ts->last_sdt_ts = AV_NOPTS_VALUE; +@@ -1277,9 +1279,14 @@ + ts->last_pat_ts = AV_NOPTS_VALUE; + ts->last_sdt_ts = AV_NOPTS_VALUE; + ts->last_nit_ts = AV_NOPTS_VALUE; - ts->pat_period = av_rescale(ts->pat_period_us, PCR_TIME_BASE, AV_TIME_BASE); - ts->sdt_period = av_rescale(ts->sdt_period_us, PCR_TIME_BASE, AV_TIME_BASE); -+ // output a PCR as soon as possible +- ts->nit_period = av_rescale(ts->nit_period_us, PCR_TIME_BASE, AV_TIME_BASE); ++ ts->pat_period = ts->pat_period_us < 0 ? -1 : ++ av_rescale(ts->pat_period_us, PCR_TIME_BASE, AV_TIME_BASE); ++ ts->sdt_period = ts->sdt_period_us < 0 ? -1 : ++ av_rescale(ts->sdt_period_us, PCR_TIME_BASE, AV_TIME_BASE); ++ ts->nit_period = ts->nit_period_us < 0 ? -1 : ++ av_rescale(ts->nit_period_us, PCR_TIME_BASE, AV_TIME_BASE); + ts->pcr = 0; -+ service->pcr_packet_timer = 0; -+ ts->pat_packet_timer = 0; -+ ts->sdt_packet_timer = 0; ++ ts->pcr_pos = 0; - if (ts->mux_rate == 1) - av_log(s, AV_LOG_VERBOSE, "muxrate VBR, "); - else + /* assign provider name */ + provider = av_dict_get(s->metadata, "service_provider", NULL, 0); +@@ -1295,8 +1302,8 @@ av_log(s, AV_LOG_VERBOSE, "muxrate %d, ", ts->mux_rate); -- av_log(s, AV_LOG_VERBOSE, -- "sdt every %"PRId64" ms, pat/pmt every %"PRId64" ms\n", + av_log(s, AV_LOG_VERBOSE, + "sdt every %"PRId64" ms, pat/pmt every %"PRId64" ms", - av_rescale(ts->sdt_period, 1000, PCR_TIME_BASE), - av_rescale(ts->pat_period, 1000, PCR_TIME_BASE)); - - return 0; -+ -+fail: -+ av_freep(&pids); -+ return ret; ++ ts->sdt_period < 0 ? -1 : av_rescale(ts->sdt_period, 1000, PCR_TIME_BASE), ++ ts->pat_period < 0 ? -1 : av_rescale(ts->pat_period, 1000, PCR_TIME_BASE)); + if (ts->flags & MPEGTS_FLAG_NIT) + av_log(s, AV_LOG_VERBOSE, ", nit every %"PRId64" ms", av_rescale(ts->nit_period, 1000, PCR_TIME_BASE)); + av_log(s, AV_LOG_VERBOSE, "\n"); +@@ -1305,36 +1312,40 @@ } - /* send SDT, PAT and PMT tables regularly */ --static void retransmit_si_info(AVFormatContext *s, int force_pat, int force_sdt, int64_t pcr) -+static void retransmit_si_info(AVFormatContext *s, int force_pat, int64_t dts) + /* send SDT, NIT, PAT and PMT tables regularly */ +-static void retransmit_si_info(AVFormatContext *s, int force_pat, int force_sdt, int force_nit, int64_t pcr) ++static void retransmit_si_info(AVFormatContext *s, int force_pat, int force_sdt, int force_nit) { MpegTSWrite *ts = s->priv_data; int i; @@ -840,35 +133,63 @@ index d827ba3e28..c8c6db979b 100644 - ) { - if (pcr != AV_NOPTS_VALUE) - ts->last_sdt_ts = FFMAX(pcr, ts->last_sdt_ts); -+ if ( ts->sdt_packet_period >= 0 && ts->pcr >= ts->sdt_packet_timer ) { -+ ts->sdt_packet_timer = ts->pcr + ts->sdt_packet_period; - mpegts_write_sdt(s); - } +- mpegts_write_sdt(s); +- } - if ((pcr != AV_NOPTS_VALUE && ts->last_pat_ts == AV_NOPTS_VALUE) || - (pcr != AV_NOPTS_VALUE && pcr - ts->last_pat_ts >= ts->pat_period) || - force_pat) { - if (pcr != AV_NOPTS_VALUE) - ts->last_pat_ts = FFMAX(pcr, ts->last_pat_ts); -+ if (ts->pcr >= ts->pat_packet_timer || force_pat) { -+ ts->pat_packet_timer = ts->pcr + ts->pat_packet_period; - mpegts_write_pat(s); - for (i = 0; i < ts->nb_services; i++) - mpegts_write_pmt(s, ts->services[i]); -@@ -1175,7 +1049,8 @@ static void mpegts_insert_null_packet(AVFormatContext *s) - *q++ = 0xff; - *q++ = 0x10; - memset(q, 0x0FF, TS_PACKET_SIZE - (q - buf)); -- write_packet(s, buf); -+ mpegts_prefix_m2ts_header(s); -+ avio_write(s->pb, buf, TS_PACKET_SIZE); +- mpegts_write_pat(s); +- for (i = 0; i < ts->nb_services; i++) +- mpegts_write_pmt(s, ts->services[i]); +- } +- if ((pcr != AV_NOPTS_VALUE && ts->last_nit_ts == AV_NOPTS_VALUE) || +- (pcr != AV_NOPTS_VALUE && pcr - ts->last_nit_ts >= ts->nit_period) || +- force_nit +- ) { +- if (pcr != AV_NOPTS_VALUE) +- ts->last_nit_ts = FFMAX(pcr, ts->last_nit_ts); ++ if (ts->sdt_period >= 0) { ++ int64_t pcr = get_pcr(ts, s->pb); ++ if (ts->last_sdt_ts == AV_NOPTS_VALUE || pcr >= ts->last_sdt_ts + ts->sdt_period) ++ force_sdt = 1; ++ if (force_sdt) { ++ ts->last_sdt_ts = pcr; ++ mpegts_write_sdt(s); ++ } ++ } ++ if (ts->pat_period >= 0) { ++ int64_t pcr = get_pcr(ts, s->pb); ++ if (ts->last_pat_ts == AV_NOPTS_VALUE || pcr >= ts->last_pat_ts + ts->pat_period) ++ force_pat = 1; ++ if (force_pat) { ++ ts->last_pat_ts = pcr; ++ mpegts_write_pat(s); ++ for (i = 0; i < ts->nb_services; i++) ++ mpegts_write_pmt(s, ts->services[i]); ++ } ++ } ++ if (ts->nit_period >= 0) { ++ int64_t pcr = get_pcr(ts, s->pb); ++ if (ts->last_nit_ts == AV_NOPTS_VALUE || pcr >= ts->last_nit_ts + ts->nit_period) ++ force_nit = 1; ++ if (force_nit) { ++ ts->last_nit_ts = pcr; + if (ts->flags & MPEGTS_FLAG_NIT) + mpegts_write_nit(s); ++ } + } } - /* Write a single transport stream packet with a PCR and no payload */ -@@ -1183,13 +1058,14 @@ static void mpegts_insert_pcr_only(AVFormatContext *s, AVStream *st) +@@ -1371,25 +1382,29 @@ + static void mpegts_insert_pcr_only(AVFormatContext *s, AVStream *st) { MpegTSWrite *ts = s->priv_data; - MpegTSWriteStream *ts_st = st->priv_data; -+ uint32_t pcr_pid = ts_st->service->pcr_pid; +- MpegTSWriteStream *ts_st = st->priv_data; ++ int64_t pcr = get_pcr(ts, s->pb); ++ MpegTSWriteStream *ts_st = st ? st->priv_data : 0; ++ uint32_t pcr_pid = ts_st ? ts_st->pid : ts->pcr_stream_pid; uint8_t *q; uint8_t buf[TS_PACKET_SIZE]; @@ -876,89 +197,91 @@ index d827ba3e28..c8c6db979b 100644 *q++ = 0x47; - *q++ = ts_st->pid >> 8; - *q++ = ts_st->pid; +- *q++ = 0x20 | ts_st->cc; /* Adaptation only */ + *q++ = pcr_pid >> 8; + *q++ = pcr_pid; - *q++ = 0x20 | ts_st->cc; /* Adaptation only */ ++ uint32_t flags = 0x20; /* Adaptation only */ /* Continuity Count field does not increment (see 13818-1 section 2.4.3.3) */ ++ if(ts_st) flags |= ts_st->cc; ++ *q++ = flags; *q++ = TS_PACKET_SIZE - 5; /* Adaptation Field Length */ -@@ -1200,11 +1076,12 @@ static void mpegts_insert_pcr_only(AVFormatContext *s, AVStream *st) + *q++ = 0x10; /* Adaptation flags: PCR present */ +- if (ts_st->discontinuity) { ++ if (ts_st && ts_st->discontinuity) { + q[-1] |= 0x80; + ts_st->discontinuity = 0; } /* PCR coded into 6 bytes */ -- q += write_pcr_bits(q, get_pcr(ts, s->pb)); -+ q += write_pcr_bits(q, ts->pcr); +- q += write_pcr_bits(q, get_pcr(ts)); ++ q += write_pcr_bits(q, pcr); /* stuffing bytes */ memset(q, 0xFF, TS_PACKET_SIZE - (q - buf)); -- write_packet(s, buf); -+ mpegts_prefix_m2ts_header(s); -+ avio_write(s->pb, buf, TS_PACKET_SIZE); - } - - static void write_pts(uint8_t *q, int fourbits, int64_t pts) -@@ -1268,84 +1145,55 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st, - uint8_t *q; - int val, is_start, len, header_len, write_pcr, is_dvb_subtitle, is_dvb_teletext, flags; +@@ -1490,9 +1505,9 @@ int afc_len, stuffing_len; + int is_dvb_subtitle = (st->codecpar->codec_id == AV_CODEC_ID_DVB_SUBTITLE); + int is_dvb_teletext = (st->codecpar->codec_id == AV_CODEC_ID_DVB_TELETEXT); - int64_t delay = av_rescale(s->max_delay, 90000, AV_TIME_BASE); int force_pat = st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && key && !ts_st->prev_payload_key; -- int force_sdt = 0; + int force_sdt = 0; ++ int64_t pcr; + int force_nit = 0; av_assert0(ts_st->payload != buf || st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO); - if (ts->flags & MPEGTS_FLAG_PAT_PMT_AT_FRAMES && st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { - force_pat = 1; - } +@@ -1509,21 +1524,19 @@ -- if (ts->flags & MPEGTS_FLAG_REEMIT_PAT_PMT) { -- force_pat = 1; -- force_sdt = 1; -- ts->flags &= ~MPEGTS_FLAG_REEMIT_PAT_PMT; -- } -- is_start = 1; while (payload_size > 0) { - int64_t pcr = AV_NOPTS_VALUE; - if (ts->mux_rate > 1) -- pcr = get_pcr(ts, s->pb); +- pcr = get_pcr(ts); - else if (dts != AV_NOPTS_VALUE) - pcr = (dts - delay) * 300; -+ ts->pcr = ts->first_pcr + (ts->mux_rate == 1 ? -+ (dts == AV_NOPTS_VALUE ? 0 : (dts - ts->delay) * 300) : -+ // add 11, pcr references the last byte of program clock reference base -+ av_rescale(avio_tell(s->pb) + 11, 8 * PCR_TIME_BASE, ts->mux_rate)); - -- retransmit_si_info(s, force_pat, force_sdt, pcr); -+ retransmit_si_info(s, force_pat, dts); - force_pat = 0; +- +- retransmit_si_info(s, force_pat, force_sdt, force_nit, pcr); +- force_pat = 0; - force_sdt = 0; +- force_nit = 0; ++ // add 11, pcr references the last byte of program clock reference base ++ ts->pcr_pos = avio_tell(s->pb) + 11; ++ pcr = ts->pcr = ts->mux_rate != 1 ? ++ av_rescale(ts->pcr_pos, 8 * PCR_TIME_BASE, ts->mux_rate) : ++ (dts == AV_NOPTS_VALUE ? 0 : (dts - ts->delay) * 300); ++ if (force_pat || force_sdt || force_nit) { ++ retransmit_si_info(s, force_pat, force_sdt, force_nit); ++ force_pat = force_sdt = force_nit = 0; ++ } write_pcr = 0; -- if (ts->mux_rate > 1) { -- /* Send PCR packets for all PCR streams if needed */ -- pcr = get_pcr(ts, s->pb); -- if (pcr >= ts->next_pcr) { -- int64_t next_pcr = INT64_MAX; -- for (int i = 0; i < s->nb_streams; i++) { -- /* Make the current stream the last, because for that we -- * can insert the pcr into the payload later */ -- int st2_index = i < st->index ? i : (i + 1 == s->nb_streams ? st->index : i + 1); -- AVStream *st2 = s->streams[st2_index]; -- MpegTSWriteStream *ts_st2 = st2->priv_data; -- if (ts_st2->pcr_period) { + if (ts->mux_rate > 1) { + /* Send PCR packets for all PCR streams if needed */ +- pcr = get_pcr(ts); + if (pcr >= ts->next_pcr) { + int64_t next_pcr = INT64_MAX; + for (int i = 0; i < s->nb_streams; i++) { +@@ -1533,36 +1546,43 @@ + AVStream *st2 = s->streams[st2_index]; + MpegTSWriteStream *ts_st2 = st2->priv_data; + if (ts_st2->pcr_period) { - if (pcr - ts_st2->last_pcr >= ts_st2->pcr_period) { - ts_st2->last_pcr = FFMAX(pcr - ts_st2->pcr_period, ts_st2->last_pcr + ts_st2->pcr_period); - if (st2 != st) { -- mpegts_insert_pcr_only(s, st2); -- pcr = get_pcr(ts, s->pb); -- } else { -- write_pcr = 1; -- } -- } ++ if (pcr >= ts_st2->pcr_timer) { ++ ts_st2->pcr_timer = pcr + ts_st2->pcr_period; ++ if (st2 != st) { + mpegts_insert_pcr_only(s, st2); +- pcr = get_pcr(ts); + } else { + write_pcr = 1; + } + } - next_pcr = FFMIN(next_pcr, ts_st2->last_pcr + ts_st2->pcr_period); -- } -- } -- ts->next_pcr = next_pcr; -- } ++ next_pcr = FFMIN(next_pcr, ts_st2->pcr_timer); + } + } + ts->next_pcr = next_pcr; + } - if (dts != AV_NOPTS_VALUE && (dts - pcr / 300) > delay) { - /* pcr insert gets priority over null packet insert */ - if (write_pcr) @@ -971,18 +294,21 @@ index d827ba3e28..c8c6db979b 100644 - } else if (ts_st->pcr_period && pcr != AV_NOPTS_VALUE) { - if (pcr - ts_st->last_pcr >= ts_st->pcr_period && is_start) { - ts_st->last_pcr = FFMAX(pcr - ts_st->pcr_period, ts_st->last_pcr + ts_st->pcr_period); -+ if (ts_st->pid == ts_st->service->pcr_sid) { -+ if( ts->pcr >= ts_st->service->pcr_packet_timer ) { -+ ts_st->service->pcr_packet_timer = ts->pcr + ts_st->service->pcr_packet_period; ++ } ++ else if (ts_st->pcr_period) { ++ if (pcr >= ts_st->pcr_timer) { ++ ts_st->pcr_timer = pcr + ts_st->pcr_period; write_pcr = 1; } } -+ if (write_pcr && ts_st->service->pcr_sid != ts_st->service->pcr_pid) { -+ mpegts_insert_pcr_only(s, st); + ++ if (write_pcr && ts->pcr_stream_pid >= 0) { ++ mpegts_insert_pcr_only(s, 0); + continue; + } ++ + if (ts->mux_rate > 1 && dts != AV_NOPTS_VALUE && -+ (dts - ts->pcr / 300) > ts->delay) { ++ (dts - pcr / 300) > ts->delay) { + /* pcr insert gets priority over null packet insert */ + if (write_pcr) + mpegts_insert_pcr_only(s, st); @@ -991,346 +317,98 @@ index d827ba3e28..c8c6db979b 100644 + /* recalculate write_pcr and possibly retransimit si_info */ + continue; + } - ++ /* prepare packet header */ q = buf; *q++ = 0x47; - val = ts_st->pid >> 8; -- if (ts->m2ts_mode && st->codecpar->codec_id == AV_CODEC_ID_AC3) -- val |= 0x20; - if (is_start) - val |= 0x40; -+ if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && -+ st->codecpar->codec_id == AV_CODEC_ID_AC3 && -+ ts->m2ts_mode > 1) -+ val |= 0x20; - *q++ = val; - *q++ = ts_st->pid; - ts_st->cc = ts_st->cc + 1 & 0xf; -@@ -1357,7 +1205,7 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st, - } - if (key && is_start && pts != AV_NOPTS_VALUE) { - // set Random Access for key frames -- if (ts_st->pcr_period) -+ if (ts_st->pid == ts_st->service->pcr_sid) - write_pcr = 1; - set_af_flag(buf, 0x40); - q = get_ts_payload_start(buf); -@@ -1365,10 +1213,10 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st, +@@ -1592,7 +1612,6 @@ if (write_pcr) { set_af_flag(buf, 0x10); q = get_ts_payload_start(buf); - // add 11, pcr references the last byte of program clock reference base -- if (dts != AV_NOPTS_VALUE && dts < pcr / 300) -+ if (ts->mux_rate > 1) -+ if (dts != AV_NOPTS_VALUE && dts < ts->pcr / 300) + if (dts != AV_NOPTS_VALUE && dts < pcr / 300) av_log(s, AV_LOG_WARNING, "dts < pcr, TS is invalid\n"); -- extend_af(buf, write_pcr_bits(q, pcr)); -+ extend_af(buf, write_pcr_bits(q, ts->pcr)); - q = get_ts_payload_start(buf); - } - if (is_start) { -@@ -1439,10 +1287,10 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st, - if (ts->m2ts_mode && - st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && - st->codecpar->codec_id == AV_CODEC_ID_AC3) { -- /* set PES_extension_flag */ -- pes_extension = 1; -- flags |= 0x01; -- header_len += 3; -+ /* set PES_extension_flag */ -+ pes_extension = 1; -+ flags |= 0x01; -+ header_len += 3; - } - if (is_dvb_teletext) { - pes_header_stuffing_bytes = 0x24 - header_len; -@@ -1469,11 +1317,13 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st, - *q++ = flags; - *q++ = header_len; - if (pts != AV_NOPTS_VALUE) { -- write_pts(q, flags >> 6, pts); -+ int64_t ts_pts = pts + ts->ts_offset; -+ write_pts(q, flags >> 6, ts_pts); - q += 5; - } - if (dts != AV_NOPTS_VALUE && pts != AV_NOPTS_VALUE && dts != pts) { -- write_pts(q, 1, dts); -+ int64_t ts_dts = dts + ts->ts_offset; -+ write_pts(q, 1, ts_dts); - q += 5; - } - if (pes_extension && st->codecpar->codec_id == AV_CODEC_ID_DIRAC) { -@@ -1485,14 +1335,14 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st, - *q++ = 0x00 | 0x60; - } - /* For Blu-ray AC3 Audio Setting extended flags */ -- if (ts->m2ts_mode && -- pes_extension && -- st->codecpar->codec_id == AV_CODEC_ID_AC3) { -- flags = 0x01; /* set PES_extension_flag_2 */ -- *q++ = flags; -- *q++ = 0x80 | 0x01; /* marker bit + extension length */ -- *q++ = 0x00 | 0x71; /* for AC3 Audio (specifically on blue-rays) */ -- } -+ if (ts->m2ts_mode && -+ pes_extension && -+ st->codecpar->codec_id == AV_CODEC_ID_AC3) { -+ flags = 0x01; /* set PES_extension_flag_2 */ -+ *q++ = flags; -+ *q++ = 0x80 | 0x01; /* marker bit + extension length */ -+ *q++ = 0x00 | 0x71; /* for AC3 Audio (specifically on blue-rays) */ -+ } - - - if (is_dvb_subtitle) { -@@ -1546,7 +1396,8 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st, - - payload += len; - payload_size -= len; -- write_packet(s, buf); -+ mpegts_prefix_m2ts_header(s); -+ avio_write(s->pb, buf, TS_PACKET_SIZE); - } - ts_st->prev_payload_key = key; - } -@@ -1643,8 +1494,6 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt) + extend_af(buf, write_pcr_bits(q, pcr)); +@@ -1864,8 +1883,8 @@ uint8_t *data = NULL; MpegTSWrite *ts = s->priv_data; MpegTSWriteStream *ts_st = st->priv_data; - const int64_t delay = av_rescale(s->max_delay, 90000, AV_TIME_BASE) * 2; - const int64_t max_audio_delay = av_rescale(s->max_delay, 90000, AV_TIME_BASE) / 2; ++ const int64_t delay_ticks2 = ts->delay * 2; ++ const int64_t max_audio_delay = ts->delay / 2; int64_t dts = pkt->dts, pts = pkt->pts; int opus_samples = 0; - int side_data_size; -@@ -1657,11 +1506,23 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt) - if (side_data) - stream_id = side_data[0]; + size_t side_data_size; +@@ -1885,9 +1904,9 @@ -+ if (ts->reemit_pat_pmt) { -+ av_log(s, AV_LOG_WARNING, -+ "resend_headers option is deprecated, use -mpegts_flags resend_headers\n"); -+ ts->reemit_pat_pmt = 0; -+ ts->flags |= MPEGTS_FLAG_REEMIT_PAT_PMT; -+ } -+ -+ if (ts->flags & MPEGTS_FLAG_REEMIT_PAT_PMT) { -+ ts->pat_packet_timer = ts->sdt_packet_timer = 0; -+ ts->flags &= ~MPEGTS_FLAG_REEMIT_PAT_PMT; -+ } -+ if (ts->copyts < 1) { if (pts != AV_NOPTS_VALUE) - pts += delay; -+ pts += 2*ts->delay; ++ pts += delay_ticks2; if (dts != AV_NOPTS_VALUE) - dts += delay; -+ dts += 2*ts->delay; - } - - if (ts_st->first_pts_check && pts == AV_NOPTS_VALUE) { -@@ -1724,7 +1585,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt) - - ret = avio_open_dyn_buf(&ts_st->amux->pb); - if (ret < 0) -- return ret; -+ return AVERROR(ENOMEM); - - ret = av_write_frame(ts_st->amux, &pkt2); - if (ret < 0) { -@@ -1755,7 +1616,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt) - } while (p < buf_end && (state & 0x7e) != 2*35 && - (state & 0x7e) >= 2*32); - -- if ((state & 0x7e) < 2*16 || (state & 0x7e) >= 2*24) -+ if ((state & 0x7e) < 2*16 && (state & 0x7e) >= 2*24) - extradd = 0; - if ((state & 0x7e) != 2*35) { // AUD NAL - data = av_malloc(pkt->size + 7 + extradd); -@@ -1843,9 +1704,25 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt) - } ++ dts += delay_ticks2; } -+ if (pkt->dts != AV_NOPTS_VALUE) { -+ int i; -+ for(i=0; inb_streams; i++) { -+ AVStream *st2 = s->streams[i]; -+ MpegTSWriteStream *ts_st2 = st2->priv_data; -+ if ( ts_st2->payload_size -+ && (ts_st2->payload_dts == AV_NOPTS_VALUE || dts - ts_st2->payload_dts > ts->delay)) { -+ mpegts_write_pes(s, st2, ts_st2->payload, ts_st2->payload_size, -+ ts_st2->payload_pts, ts_st2->payload_dts, -+ ts_st2->payload_flags & AV_PKT_FLAG_KEY, stream_id); -+ ts_st2->payload_size = 0; -+ } -+ } -+ } -+ - if (ts_st->payload_size && (ts_st->payload_size + size > ts->pes_payload_size || - (dts != AV_NOPTS_VALUE && ts_st->payload_dts != AV_NOPTS_VALUE && -- dts - ts_st->payload_dts >= max_audio_delay) || -+ av_compare_ts(dts - ts_st->payload_dts, st->time_base, -+ s->max_delay, AV_TIME_BASE_Q) >= 0) || - ts_st->opus_queued_samples + opus_samples >= 5760 /* 120ms */)) { - mpegts_write_pes(s, st, ts_st->payload, ts_st->payload_size, - ts_st->payload_pts, ts_st->payload_dts, -@@ -1881,7 +1758,6 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt) - - static void mpegts_write_flush(AVFormatContext *s) - { -- MpegTSWrite *ts = s->priv_data; - int i; - - /* flush current packets */ -@@ -1896,12 +1772,6 @@ static void mpegts_write_flush(AVFormatContext *s) - ts_st->opus_queued_samples = 0; - } - } -- -- if (ts->m2ts_mode) { -- int packets = (avio_tell(s->pb) / (TS_PACKET_SIZE + 4)) % 32; -- while (packets++ < 32) -- mpegts_insert_null_packet(s); -- } - } - - static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt) -@@ -1969,62 +1839,104 @@ static int mpegts_check_bitstream(struct AVFormatContext *s, const AVPacket *pkt - return ret; - } - --#define OFFSET(x) offsetof(MpegTSWrite, x) --#define ENC AV_OPT_FLAG_ENCODING_PARAM - static const AVOption options[] = { - { "mpegts_transport_stream_id", "Set transport_stream_id field.", -- OFFSET(transport_stream_id), AV_OPT_TYPE_INT, { .i64 = 0x0001 }, 0x0001, 0xffff, ENC }, -+ offsetof(MpegTSWrite, transport_stream_id), AV_OPT_TYPE_INT, -+ { .i64 = 0x0001 }, 0x0001, 0xffff, AV_OPT_FLAG_ENCODING_PARAM }, - { "mpegts_original_network_id", "Set original_network_id field.", -- OFFSET(original_network_id), AV_OPT_TYPE_INT, { .i64 = DVB_PRIVATE_NETWORK_START }, 0x0001, 0xffff, ENC }, -+ offsetof(MpegTSWrite, original_network_id), AV_OPT_TYPE_INT, -+ { .i64 = DVB_PRIVATE_NETWORK_START }, 0x0001, 0xffff, AV_OPT_FLAG_ENCODING_PARAM }, - { "mpegts_service_id", "Set service_id field.", -- OFFSET(service_id), AV_OPT_TYPE_INT, { .i64 = 0x0001 }, 0x0001, 0xffff, ENC }, -+ offsetof(MpegTSWrite, service_id), AV_OPT_TYPE_INT, -+ { .i64 = 0x0001 }, 0x0001, 0xffff, AV_OPT_FLAG_ENCODING_PARAM }, - { "mpegts_service_type", "Set service_type field.", -- OFFSET(service_type), AV_OPT_TYPE_INT, { .i64 = 0x01 }, 0x01, 0xff, ENC, "mpegts_service_type" }, -+ offsetof(MpegTSWrite, service_type), AV_OPT_TYPE_INT, -+ { .i64 = 0x01 }, 0x01, 0xff, AV_OPT_FLAG_ENCODING_PARAM, "mpegts_service_type" }, - { "digital_tv", "Digital Television.", -- 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_SERVICE_TYPE_DIGITAL_TV }, 0x01, 0xff, ENC, "mpegts_service_type" }, -+ 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_SERVICE_TYPE_DIGITAL_TV }, 0x01, 0xff, -+ AV_OPT_FLAG_ENCODING_PARAM, "mpegts_service_type" }, - { "digital_radio", "Digital Radio.", -- 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_SERVICE_TYPE_DIGITAL_RADIO }, 0x01, 0xff, ENC, "mpegts_service_type" }, -+ 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_SERVICE_TYPE_DIGITAL_RADIO }, 0x01, 0xff, -+ AV_OPT_FLAG_ENCODING_PARAM, "mpegts_service_type" }, - { "teletext", "Teletext.", -- 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_SERVICE_TYPE_TELETEXT }, 0x01, 0xff, ENC, "mpegts_service_type" }, -+ 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_SERVICE_TYPE_TELETEXT }, 0x01, 0xff, -+ AV_OPT_FLAG_ENCODING_PARAM, "mpegts_service_type" }, - { "advanced_codec_digital_radio", "Advanced Codec Digital Radio.", -- 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_SERVICE_TYPE_ADVANCED_CODEC_DIGITAL_RADIO }, 0x01, 0xff, ENC, "mpegts_service_type" }, -+ 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_SERVICE_TYPE_ADVANCED_CODEC_DIGITAL_RADIO }, 0x01, 0xff, -+ AV_OPT_FLAG_ENCODING_PARAM, "mpegts_service_type" }, - { "mpeg2_digital_hdtv", "MPEG2 Digital HDTV.", -- 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_SERVICE_TYPE_MPEG2_DIGITAL_HDTV }, 0x01, 0xff, ENC, "mpegts_service_type" }, -+ 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_SERVICE_TYPE_MPEG2_DIGITAL_HDTV }, 0x01, 0xff, -+ AV_OPT_FLAG_ENCODING_PARAM, "mpegts_service_type" }, - { "advanced_codec_digital_sdtv", "Advanced Codec Digital SDTV.", -- 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_SERVICE_TYPE_ADVANCED_CODEC_DIGITAL_SDTV }, 0x01, 0xff, ENC, "mpegts_service_type" }, -+ 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_SERVICE_TYPE_ADVANCED_CODEC_DIGITAL_SDTV }, 0x01, 0xff, -+ AV_OPT_FLAG_ENCODING_PARAM, "mpegts_service_type" }, - { "advanced_codec_digital_hdtv", "Advanced Codec Digital HDTV.", -- 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_SERVICE_TYPE_ADVANCED_CODEC_DIGITAL_HDTV }, 0x01, 0xff, ENC, "mpegts_service_type" }, -+ 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_SERVICE_TYPE_ADVANCED_CODEC_DIGITAL_HDTV }, 0x01, 0xff, -+ AV_OPT_FLAG_ENCODING_PARAM, "mpegts_service_type" }, - { "hevc_digital_hdtv", "HEVC Digital Television Service.", -- 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_SERVICE_TYPE_HEVC_DIGITAL_HDTV }, 0x01, 0xff, ENC, "mpegts_service_type" }, -+ 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_SERVICE_TYPE_HEVC_DIGITAL_HDTV }, 0x01, 0xff, -+ AV_OPT_FLAG_ENCODING_PARAM, "mpegts_service_type" }, + if (!ts_st->first_timestamp_checked && (pts == AV_NOPTS_VALUE || dts == AV_NOPTS_VALUE)) { +@@ -2354,8 +2373,10 @@ + 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_SERVICE_TYPE_HEVC_DIGITAL_HDTV }, 0x01, 0xff, ENC, .unit = "mpegts_service_type" }, { "mpegts_pmt_start_pid", "Set the first pid of the PMT.", -- OFFSET(pmt_start_pid), AV_OPT_TYPE_INT, { .i64 = 0x1000 }, FIRST_OTHER_PID, LAST_OTHER_PID, ENC }, -+ offsetof(MpegTSWrite, pmt_start_pid), AV_OPT_TYPE_INT, -+ { .i64 = 0x1000 }, 0x0010, 0x1f00, AV_OPT_FLAG_ENCODING_PARAM }, -+ { "mpegts_pcr_start_pid", "Set the first pid of the PCR.", -+ offsetof(MpegTSWrite, pcr_start_pid), AV_OPT_TYPE_INT, -+ { .i64 = 0x1000 }, 0x0010, 0x1f00, AV_OPT_FLAG_ENCODING_PARAM }, + OFFSET(pmt_start_pid), AV_OPT_TYPE_INT, { .i64 = 0x1000 }, FIRST_OTHER_PID, LAST_OTHER_PID, ENC }, ++ { "mpegts_pcr_stream_pid", "create seperate PCR stream on this pid.", ++ OFFSET(pcr_stream_pid), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 0x1f00, ENC }, { "mpegts_start_pid", "Set the first pid.", - OFFSET(start_pid), AV_OPT_TYPE_INT, { .i64 = 0x0100 }, FIRST_OTHER_PID, LAST_OTHER_PID, ENC }, -- { "mpegts_m2ts_mode", "Enable m2ts mode.", OFFSET(m2ts_mode), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, ENC }, -- { "muxrate", NULL, OFFSET(mux_rate), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, INT_MAX, ENC }, -+ offsetof(MpegTSWrite, start_pid), AV_OPT_TYPE_INT, -+ { .i64 = 0x0100 }, 0x0010, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM }, -+ { "mpegts_m2ts_mode", "Enable m2ts mode.", -+ offsetof(MpegTSWrite, m2ts_mode), AV_OPT_TYPE_BOOL, -+ { .i64 = -1 }, -1, 2, AV_OPT_FLAG_ENCODING_PARAM }, -+ { "mpegts_pcr_offset", "clock offset.", -+ offsetof(MpegTSWrite, ts_offset), AV_OPT_TYPE_BOOL, -+ { .i64 = 0 }, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM }, -+ { "muxrate", NULL, -+ offsetof(MpegTSWrite, mux_rate), AV_OPT_TYPE_INT, -+ { .i64 = 1 }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM }, ++ OFFSET(start_pid), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, LAST_OTHER_PID, ENC }, + { "mpegts_m2ts_mode", "Enable m2ts mode.", OFFSET(m2ts_mode), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, ENC }, + { "muxrate", NULL, OFFSET(mux_rate), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, INT_MAX, ENC }, { "pes_payload_size", "Minimum PES packet payload in bytes", -- OFFSET(pes_payload_size), AV_OPT_TYPE_INT, { .i64 = DEFAULT_PES_PAYLOAD_SIZE }, 0, INT_MAX, ENC }, -- { "mpegts_flags", "MPEG-TS muxing flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, 0, INT_MAX, ENC, "mpegts_flags" }, -+ offsetof(MpegTSWrite, pes_payload_size), AV_OPT_TYPE_INT, -+ { .i64 = DEFAULT_PES_PAYLOAD_SIZE }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM }, -+ { "mpegts_flags", "MPEG-TS muxing flags", -+ offsetof(MpegTSWrite, flags), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, 0, INT_MAX, -+ AV_OPT_FLAG_ENCODING_PARAM, "mpegts_flags" }, - { "resend_headers", "Reemit PAT/PMT before writing the next packet", -- 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_REEMIT_PAT_PMT }, 0, INT_MAX, ENC, "mpegts_flags" }, -+ 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_REEMIT_PAT_PMT }, 0, INT_MAX, -+ AV_OPT_FLAG_ENCODING_PARAM, "mpegts_flags" }, - { "latm", "Use LATM packetization for AAC", -- 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_AAC_LATM }, 0, INT_MAX, ENC, "mpegts_flags" }, -+ 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_AAC_LATM }, 0, INT_MAX, -+ AV_OPT_FLAG_ENCODING_PARAM, "mpegts_flags" }, - { "pat_pmt_at_frames", "Reemit PAT and PMT at each video frame", -- 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_PAT_PMT_AT_FRAMES}, 0, INT_MAX, ENC, "mpegts_flags" }, -+ 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_PAT_PMT_AT_FRAMES}, 0, INT_MAX, -+ AV_OPT_FLAG_ENCODING_PARAM, "mpegts_flags" }, - { "system_b", "Conform to System B (DVB) instead of System A (ATSC)", -- 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_SYSTEM_B }, 0, INT_MAX, ENC, "mpegts_flags" }, -+ 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_SYSTEM_B }, 0, INT_MAX, -+ AV_OPT_FLAG_ENCODING_PARAM, "mpegts_flags" }, - { "initial_discontinuity", "Mark initial packets as discontinuous", -- 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_DISCONT }, 0, INT_MAX, ENC, "mpegts_flags" }, -- { "mpegts_copyts", "don't offset dts/pts", OFFSET(copyts), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, ENC }, -- { "tables_version", "set PAT, PMT and SDT version", OFFSET(tables_version), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 31, ENC }, -+ 0, AV_OPT_TYPE_CONST, { .i64 = MPEGTS_FLAG_DISCONT }, 0, INT_MAX, -+ AV_OPT_FLAG_ENCODING_PARAM, "mpegts_flags" }, -+ // backward compatibility -+ { "resend_headers", "Reemit PAT/PMT before writing the next packet", -+ offsetof(MpegTSWrite, reemit_pat_pmt), AV_OPT_TYPE_INT, -+ { .i64 = 0 }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM }, -+ { "mpegts_copyts", "don't offset dts/pts", -+ offsetof(MpegTSWrite, copyts), AV_OPT_TYPE_BOOL, -+ { .i64 = -1 }, -1, 1, AV_OPT_FLAG_ENCODING_PARAM }, -+ { "tables_version", "set PAT, PMT and SDT version", -+ offsetof(MpegTSWrite, tables_version), AV_OPT_TYPE_INT, -+ { .i64 = 0 }, 0, 31, AV_OPT_FLAG_ENCODING_PARAM }, - { "omit_video_pes_length", "Omit the PES packet length for video packets", -- OFFSET(omit_video_pes_length), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, ENC }, -- { "pcr_period", "PCR retransmission time in milliseconds", -- OFFSET(pcr_period_ms), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, ENC }, +@@ -2381,10 +2402,10 @@ + OFFSET(omit_video_pes_length), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, ENC }, + { "pcr_period", "PCR retransmission time in milliseconds", + OFFSET(pcr_period_ms), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, ENC }, - { "pat_period", "PAT/PMT retransmission time limit in seconds", -- OFFSET(pat_period_us), AV_OPT_TYPE_DURATION, { .i64 = PAT_RETRANS_TIME * 1000LL }, 0, INT64_MAX, ENC }, ++ { "pat_period", "PAT/PMT retransmission time limit in ms, -1 no pat", + OFFSET(pat_period_us), AV_OPT_TYPE_DURATION, { .i64 = PAT_RETRANS_TIME * 1000LL }, 0, INT64_MAX, ENC }, - { "sdt_period", "SDT retransmission time limit in seconds", - OFFSET(sdt_period_us), AV_OPT_TYPE_DURATION, { .i64 = SDT_RETRANS_TIME * 1000LL }, 0, INT64_MAX, ENC }, -+ offsetof(MpegTSWrite, omit_video_pes_length), AV_OPT_TYPE_BOOL, -+ { .i64 = 1 }, 0, 1, AV_OPT_FLAG_ENCODING_PARAM }, -+ { "pcr_period", "PCR retransmission time limit in msecs", -+ offsetof(MpegTSWrite, pcr_period), AV_OPT_TYPE_DOUBLE, -+ { .dbl = PCR_RETRANS_TIME }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM }, -+ { "pat_period", "PAT/PMT retransmission time limit in msecs", -+ offsetof(MpegTSWrite, pat_period), AV_OPT_TYPE_DOUBLE, -+ { .dbl = PAT_RETRANS_TIME }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM }, -+ { "sdt_period", "SDT retransmission time limit in msecs", -+ offsetof(MpegTSWrite, sdt_period), AV_OPT_TYPE_DOUBLE, -+ { .dbl = SDT_RETRANS_TIME }, -1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM }, ++ { "sdt_period", "SDT retransmission time limit in ms, -1 no sdt", ++ OFFSET(sdt_period_us), AV_OPT_TYPE_INT64, { .i64 = SDT_RETRANS_TIME * 1000LL }, -1, INT64_MAX, ENC }, + { "nit_period", "NIT retransmission time limit in seconds", + OFFSET(nit_period_us), AV_OPT_TYPE_DURATION, { .i64 = NIT_RETRANS_TIME * 1000LL }, 0, INT64_MAX, ENC }, { NULL }, - }; - +--- a/libavformat/mpegts.h ++++ b/libavformat/mpegts.h +@@ -64,6 +64,7 @@ + /* PID from 0x1FFC to 0x1FFE may be assigned as needed to PMT, elementary + * streams and other data tables */ + #define NULL_PID 0x1FFF /* Null packet (used for fixed bandwidth padding) */ ++#define START_PID 0x0400 + + /* m2ts pids */ + #define M2TS_PMT_PID 0x0100 +--- a/libavformat/bluray.c ++++ b/libavformat/bluray.c +@@ -27,7 +27,7 @@ + #include "libavutil/opt.h" + + #define BLURAY_PROTO_PREFIX "bluray:" +-#define MIN_PLAYLIST_LENGTH 180 /* 3 min */ ++#define MIN_PLAYLIST_LENGTH 0 + + typedef struct { + const AVClass *class; + +--- a/doc/muxers.texi ++++ b/doc/muxers.texi +@@ -2920,7 +2920,8 @@ + Maximum time in seconds between PAT/PMT tables. Default is @code{0.1}. + + @item sdt_period @var{duration} +-Maximum time in seconds between SDT tables. Default is @code{0.5}. ++Maximum time in seconds between SDT tables. Default is @code{0.5}. Regardless ++of this setting no SDT is written in m2ts mode. + + @item nit_period @var{duration} + Maximum time in seconds between NIT tables. Default is @code{0.5}. diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch3 b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch3 index fb8730e4..25b062bc 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch3 +++ b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch3 @@ -1,8 +1,6 @@ -diff --git a/libavformat/avformat.h b/libavformat/avformat.h -index e91e7f1d33..0f9b26a6d3 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h -@@ -480,6 +480,9 @@ typedef struct AVProbeData { +@@ -499,6 +499,9 @@ The user or muxer can override this through AVFormatContext.avoid_negative_ts */ @@ -12,7 +10,7 @@ index e91e7f1d33..0f9b26a6d3 100644 #define AVFMT_SEEK_TO_PTS 0x4000000 /**< Seeking is based on PTS */ -@@ -650,7 +653,8 @@ typedef struct AVInputFormat { +@@ -562,7 +565,8 @@ /** * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, * AVFMT_NOTIMESTAMPS, AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, @@ -22,43 +20,39 @@ index e91e7f1d33..0f9b26a6d3 100644 */ int flags; -diff --git a/libavformat/dv.c b/libavformat/dv.c -index e99422d4b5..58ce1bbb5f 100644 --- a/libavformat/dv.c +++ b/libavformat/dv.c -@@ -642,6 +642,7 @@ static int dv_probe(const AVProbeData *p) - AVInputFormat ff_dv_demuxer = { - .name = "dv", - .long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"), -+ .flags = AVFMT_SEEK_NOSTREAMS, +@@ -713,6 +713,7 @@ + const FFInputFormat ff_dv_demuxer = { + .p.name = "dv", + .p.long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"), ++ .p.flags = AVFMT_SEEK_NOSTREAMS, + .p.extensions = "dv,dif", .priv_data_size = sizeof(RawDVContext), .read_probe = dv_probe, - .read_header = dv_read_header, -diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c -index cff7f0cb54..8b6d22aff2 100644 + --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c -@@ -4251,6 +4251,7 @@ static const AVClass webm_dash_class = { - AVInputFormat ff_matroska_demuxer = { - .name = "matroska,webm", - .long_name = NULL_IF_CONFIG_SMALL("Matroska / WebM"), -+ .flags = AVFMT_SEEK_NOSTREAMS, - .extensions = "mkv,mk3d,mka,mks", +@@ -4794,6 +4794,7 @@ + const FFInputFormat ff_webm_dash_manifest_demuxer = { + .p.name = "webm_dash_manifest", + .p.long_name = NULL_IF_CONFIG_SMALL("WebM DASH Manifest"), ++ .p.flags = AVFMT_SEEK_NOSTREAMS, + .p.priv_class = &webm_dash_class, .priv_data_size = sizeof(MatroskaDemuxContext), - .read_probe = matroska_probe, -@@ -4264,6 +4265,7 @@ AVInputFormat ff_matroska_demuxer = { - AVInputFormat ff_webm_dash_manifest_demuxer = { - .name = "webm_dash_manifest", - .long_name = NULL_IF_CONFIG_SMALL("WebM DASH Manifest"), -+ .flags = AVFMT_SEEK_NOSTREAMS, + .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP, +@@ -4806,6 +4807,7 @@ + const FFInputFormat ff_matroska_demuxer = { + .p.name = "matroska,webm", + .p.long_name = NULL_IF_CONFIG_SMALL("Matroska / WebM"), ++ .p.flags = AVFMT_SEEK_NOSTREAMS, + .p.extensions = "mkv,mk3d,mka,mks,webm", + .p.mime_type = "audio/webm,audio/x-matroska,video/webm,video/x-matroska", .priv_data_size = sizeof(MatroskaDemuxContext), - .read_header = webm_dash_manifest_read_header, - .read_packet = webm_dash_manifest_read_packet, -diff --git a/libavformat/utils.c b/libavformat/utils.c -index 807d9f10cb..55a444e7b6 100644 ---- a/libavformat/utils.c -+++ b/libavformat/utils.c -@@ -2486,6 +2486,13 @@ static int seek_frame_internal(AVFormatContext *s, int stream_index, + +--- a/libavformat/seek.c ++++ b/libavformat/seek.c +@@ -605,6 +605,13 @@ return seek_frame_byte(s, stream_index, timestamp, flags); } diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch4 b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch4 index 02c27428..9e472ce1 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch4 +++ b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch4 @@ -1,29 +1,10 @@ -diff --git a/libavfilter/af_aformat.c b/libavfilter/af_aformat.c -index 1a702778c3..232d629ba0 100644 ---- a/libavfilter/af_aformat.c -+++ b/libavfilter/af_aformat.c -@@ -112,6 +112,16 @@ static av_cold int init(AVFilterContext *ctx) - return 0; - } - -+#define DEL_FIELD(p,mem,fld) if( p->mem ) { av_freep(&p->mem->fld); av_freep(&p->mem); } -+ -+static av_cold void uninit(AVFilterContext *ctx) -+{ -+ AFormatContext *s = ctx->priv; -+ DEL_FIELD(s, formats, formats); -+ DEL_FIELD(s, sample_rates, formats); -+ DEL_FIELD(s, channel_layouts, channel_layouts); -+} -+ - static int query_formats(AVFilterContext *ctx) - { - AFormatContext *s = ctx->priv; -@@ -149,6 +159,7 @@ AVFilter ff_af_aformat = { - .name = "aformat", - .description = NULL_IF_CONFIG_SMALL("Convert the input audio to one of the specified formats."), - .init = init, -+ .uninit = uninit, - .query_formats = query_formats, - .priv_size = sizeof(AFormatContext), - .priv_class = &aformat_class, +--- a/libavformat/avidec.c ++++ b/libavformat/avidec.c +@@ -2020,6 +2020,7 @@ + .p.name = "avi", + .p.long_name = NULL_IF_CONFIG_SMALL("AVI (Audio Video Interleaved)"), + .p.extensions = "avi", ++ .p.flags = AVFMT_SEEK_NOSTREAMS, + .p.priv_class = &demuxer_class, + .priv_data_size = sizeof(AVIContext), + .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP, diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch5 b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch5 index 32e7fe11..64ee262c 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch5 +++ b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch5 @@ -1,29 +1,24 @@ -diff --git a/libavfilter/formats.c b/libavfilter/formats.c -index de4315369d..f430908343 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c -@@ -107,11 +107,13 @@ AVFilterFormats *ff_merge_formats(AVFilterFormats *a, AVFilterFormats *b, +@@ -110,11 +110,13 @@ possibly causing a lossy conversion elsewhere in the graph. To avoid that, pretend that there are no common formats to force the insertion of a conversion filter. */ - if (type == AVMEDIA_TYPE_VIDEO) -- for (i = 0; i < a->nb_formats; i++) + if (type == AVMEDIA_TYPE_VIDEO) { -+ for (i = 0; i < a->nb_formats; i++) { -+ const AVPixFmtDescriptor *adesc = av_pix_fmt_desc_get(a->formats[i]); + for (i = 0; i < a->nb_formats; i++) { + const AVPixFmtDescriptor *const adesc = av_pix_fmt_desc_get(a->formats[i]); + if( !adesc ) continue; for (j = 0; j < b->nb_formats; j++) { -- const AVPixFmtDescriptor *adesc = av_pix_fmt_desc_get(a->formats[i]); const AVPixFmtDescriptor *bdesc = av_pix_fmt_desc_get(b->formats[j]); + if( !bdesc ) continue; alpha2 |= adesc->flags & bdesc->flags & AV_PIX_FMT_FLAG_ALPHA; chroma2|= adesc->nb_components > 1 && bdesc->nb_components > 1; if (a->formats[i] == b->formats[j]) { -@@ -119,6 +121,8 @@ AVFilterFormats *ff_merge_formats(AVFilterFormats *a, AVFilterFormats *b, - chroma1|= adesc->nb_components > 1; +@@ -123,6 +125,7 @@ } } -+ } + } + } // If chroma or alpha can be lost through merging then do not merge diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch7 b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch7 index 05d3b1d0..379ddb62 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch7 +++ b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch7 @@ -1,13 +1,10 @@ -diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c -index 3b29a189e9..681a4187c5 100644 ---- a/libavcodec/h263dec.c -+++ b/libavcodec/h263dec.c -@@ -684,7 +684,7 @@ frame_end: - if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) - ff_mpeg4_frame_end(avctx, buf, buf_size); - -- if (!s->divx_packed && avctx->hwaccel) -+ if (s->divx_packed && avctx->hwaccel) - ff_thread_finish_setup(avctx); - - av_assert1(s->current_picture.f->pict_type == s->current_picture_ptr->f->pict_type); +--- a/libavcodec/vdpau_mpeg12.c ++++ b/libavcodec/vdpau_mpeg12.c +@@ -117,6 +117,7 @@ + .frame_priv_data_size = sizeof(struct vdpau_picture_context), + .init = vdpau_mpeg1_init, + .uninit = ff_vdpau_common_uninit, ++ .frame_params = ff_vdpau_common_frame_params, + .priv_data_size = sizeof(VDPAUContext), + .caps_internal = HWACCEL_CAP_ASYNC_SAFE, + }; diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch8 b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch8 index 51bc09e3..fcafebb8 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch8 +++ b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch8 @@ -1,16 +1,11 @@ -diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c -index 9bd0a555d4..111a9f3a46 100644 ---- a/libavformat/mpegenc.c -+++ b/libavformat/mpegenc.c -@@ -976,9 +976,9 @@ static int remove_decoded_packets(AVFormatContext *ctx, int64_t scr) - PacketDesc *pkt_desc; +--- a/libavcodec/h263dec.c ++++ b/libavcodec/h263dec.c +@@ -623,7 +623,7 @@ + if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) + ff_mpeg4_frame_end(avctx, buf, buf_size); - while ((pkt_desc = stream->predecode_packet) && -+ pkt_desc != stream->premux_packet && - scr > pkt_desc->dts) { // FIXME: > vs >= -- if (stream->buffer_index < pkt_desc->size || -- stream->predecode_packet == stream->premux_packet) { -+ if (stream->buffer_index < pkt_desc->size) { - av_log(ctx, AV_LOG_ERROR, - "buffer underflow st=%d bufi=%d size=%d\n", - i, stream->buffer_index, pkt_desc->size); +- if (!s->divx_packed && avctx->hwaccel) ++ if (s->divx_packed && avctx->hwaccel) + ff_thread_finish_setup(avctx); + + av_assert1(s->current_picture.f->pict_type == s->current_picture_ptr->f->pict_type); diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch9 b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch9 index 0cf24e74..721fd09d 100644 --- a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch9 +++ b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patch9 @@ -1,36 +1,14 @@ -diff --git a/libavutil/hwcontext_cuda.c b/libavutil/hwcontext_cuda.c -index 718a449b6e..84685fe1d9 100644 ---- a/libavutil/hwcontext_cuda.c -+++ b/libavutil/hwcontext_cuda.c -@@ -269,9 +269,11 @@ static void cuda_device_uninit(AVHWDeviceContext *device_ctx) - CudaFunctions *cu = hwctx->internal->cuda_dl; +--- a/libavformat/mpegenc.c ++++ b/libavformat/mpegenc.c +@@ -987,9 +987,9 @@ + PacketDesc *pkt_desc; - if (hwctx->internal->is_allocated && hwctx->cuda_ctx) { -+#ifdef CUDA_PRIMARY_CTX - if (hwctx->internal->flags & AV_CUDA_USE_PRIMARY_CONTEXT) - CHECK_CU(cu->cuDevicePrimaryCtxRelease(hwctx->internal->cuda_device)); - else -+#endif - CHECK_CU(cu->cuCtxDestroy(hwctx->cuda_ctx)); - - hwctx->cuda_ctx = NULL; -@@ -321,7 +323,7 @@ static int cuda_context_init(AVHWDeviceContext *device_ctx, int flags) { - cu = hwctx->internal->cuda_dl; - - hwctx->internal->flags = flags; -- -+#ifdef CUDA_PRIMARY_CTX - if (flags & AV_CUDA_USE_PRIMARY_CONTEXT) { - ret = CHECK_CU(cu->cuDevicePrimaryCtxGetState(hwctx->internal->cuda_device, - &dev_flags, &dev_active)); -@@ -342,7 +344,9 @@ static int cuda_context_init(AVHWDeviceContext *device_ctx, int flags) { - hwctx->internal->cuda_device)); - if (ret < 0) - return ret; -- } else { -+ } else -+#endif -+ { - ret = CHECK_CU(cu->cuCtxCreate(&hwctx->cuda_ctx, desired_flags, - hwctx->internal->cuda_device)); - if (ret < 0) + while ((pkt_desc = stream->predecode_packet) && ++ pkt_desc != stream->premux_packet && + scr > pkt_desc->dts) { // FIXME: > vs >= +- if (stream->buffer_index < pkt_desc->size || +- stream->predecode_packet == stream->premux_packet) { ++ if (stream->buffer_index < pkt_desc->size) { + av_log(ctx, AV_LOG_ERROR, + "buffer underflow st=%d bufi=%d size=%d\n", + i, stream->buffer_index, pkt_desc->size); diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patchB b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patchB new file mode 100644 index 00000000..89e99896 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patchB @@ -0,0 +1,22 @@ +--- a/libavutil/hwcontext_vdpau.c ++++ b/libavutil/hwcontext_vdpau.c +@@ -47,6 +47,11 @@ + { 0, AV_PIX_FMT_NONE, }, + }; + ++static const VDPAUPixFmtMap pix_fmts_420j[] = { ++ { VDP_YCBCR_FORMAT_YV12, AV_PIX_FMT_YUVJ420P }, ++ { 0, AV_PIX_FMT_NONE, }, ++}; ++ + static const VDPAUPixFmtMap pix_fmts_422[] = { + { VDP_YCBCR_FORMAT_NV12, AV_PIX_FMT_NV16 }, + { VDP_YCBCR_FORMAT_YV12, AV_PIX_FMT_YUV422P }, +@@ -71,6 +76,7 @@ + const VDPAUPixFmtMap *map; + } vdpau_pix_fmts[] = { + { VDP_CHROMA_TYPE_420, AV_PIX_FMT_YUV420P, pix_fmts_420 }, ++ { VDP_CHROMA_TYPE_420, AV_PIX_FMT_YUVJ420P, pix_fmts_420j }, + { VDP_CHROMA_TYPE_422, AV_PIX_FMT_YUV422P, pix_fmts_422 }, + { VDP_CHROMA_TYPE_444, AV_PIX_FMT_YUV444P, pix_fmts_444 }, + #ifdef VDP_YCBCR_FORMAT_P016 diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patchC b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patchC new file mode 100644 index 00000000..b89b3afb --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patchC @@ -0,0 +1,41 @@ +--- a/libavcodec/encode.c ++++ b/libavcodec/encode.c +@@ -320,7 +320,7 @@ + } + + if (!frame->buf[0]) { +- if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY || ++ if (avci->draining && !(avctx->codec->capabilities & AV_CODEC_CAP_DELAY || + avci->frame_thread_encoder)) + return AVERROR_EOF; + +@@ -339,8 +339,10 @@ + ret = ff_encode_encode_cb(avctx, avpkt, frame, &got_packet); + } + +- if (avci->draining && !got_packet) ++ if (avci->draining && !got_packet) { ++ fflush(stderr); + avci->draining_done = 1; ++ } + + return ret; + } +@@ -515,10 +517,16 @@ + if (avci->draining) + return AVERROR_EOF; + +- if (avci->buffer_frame->buf[0]) ++ if (avci->buffer_frame->buf[0]) { ++ if (!frame) { ++ fflush(stderr); ++ av_frame_unref(avci->buffer_frame); ++ } + return AVERROR(EAGAIN); ++ } + + if (!frame) { ++ fflush(stderr); + avci->draining = 1; + } else { + ret = encode_send_frame_internal(avctx, frame); diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patchZ1 b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patchZ1 new file mode 100644 index 00000000..29cfb628 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patchZ1 @@ -0,0 +1,49 @@ +--- a/libavcodec/wrapped_avframe.c ++++ b/libavcodec/wrapped_avframe.c +@@ -33,6 +33,38 @@ + #include "libavutil/buffer.h" + #include "libavutil/pixdesc.h" + ++ ++ ++static const enum AVPixelFormat pix_fmts_all[] = { ++ AV_PIX_FMT_YUV411P, ++ AV_PIX_FMT_YUV420P, ++ AV_PIX_FMT_YUVJ420P, ++ AV_PIX_FMT_YUV422P, ++ AV_PIX_FMT_YUVJ422P, ++ AV_PIX_FMT_YUV444P, ++ AV_PIX_FMT_YUVJ444P, ++ AV_PIX_FMT_YUV420P10, ++ AV_PIX_FMT_YUV422P10, ++ AV_PIX_FMT_YUV444P10, ++ AV_PIX_FMT_YUV420P12, ++ AV_PIX_FMT_YUV422P12, ++ AV_PIX_FMT_YUV444P12, ++ AV_PIX_FMT_YUV420P14, ++ AV_PIX_FMT_YUV422P14, ++ AV_PIX_FMT_YUV444P14, ++ AV_PIX_FMT_YUV420P16, ++ AV_PIX_FMT_YUV422P16, ++ AV_PIX_FMT_YUV444P16, ++ AV_PIX_FMT_GRAY8, ++ AV_PIX_FMT_GRAY9, ++ AV_PIX_FMT_GRAY10, ++ AV_PIX_FMT_GRAY12, ++ AV_PIX_FMT_GRAY16, ++ AV_PIX_FMT_NONE ++}; ++ ++ ++ + static void wrapped_avframe_release_buffer(void *unused, uint8_t *data) + { + AVFrame *frame = (AVFrame *)data; +@@ -111,6 +143,7 @@ + .p.id = AV_CODEC_ID_WRAPPED_AVFRAME, + .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + FF_CODEC_ENCODE_CB(wrapped_avframe_encode), ++ .p.pix_fmts = pix_fmts_all, + }; + + const FFCodec ff_wrapped_avframe_decoder = { diff --git a/cinelerra-5.1/thirdparty/src/ffmpeg.git.patchZ2 b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patchZ2 new file mode 100644 index 00000000..a883b14d --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/ffmpeg.git.patchZ2 @@ -0,0 +1,11 @@ +--- a/libavformat/yuv4mpegenc.c ++++ b/libavformat/yuv4mpegenc.c +@@ -268,7 +268,7 @@ + av_log(s, AV_LOG_ERROR, "'%s' is not an official yuv4mpegpipe pixel format. " + "Use '-strict -1' to encode to this pixel format.\n", + av_get_pix_fmt_name(s->streams[0]->codecpar->format)); +- return AVERROR(EINVAL); ++ //return AVERROR(EINVAL); + } + av_log(s, AV_LOG_WARNING, "Warning: generating non standard YUV stream. " + "Mjpegtools will not work.\n"); diff --git a/cinelerra-5.1/thirdparty/src/flac-1.3.2.tar.xz b/cinelerra-5.1/thirdparty/src/flac-1.3.2.tar.xz deleted file mode 100644 index 5b9c69af..00000000 Binary files a/cinelerra-5.1/thirdparty/src/flac-1.3.2.tar.xz and /dev/null differ diff --git a/cinelerra-5.1/thirdparty/src/flac-1.4.2.tar.xz b/cinelerra-5.1/thirdparty/src/flac-1.4.2.tar.xz new file mode 100644 index 00000000..f6d9f148 Binary files /dev/null and b/cinelerra-5.1/thirdparty/src/flac-1.4.2.tar.xz differ diff --git a/cinelerra-5.1/thirdparty/src/libaom-v3.1.1.patch0 b/cinelerra-5.1/thirdparty/src/libaom-v3.1.1.patch0 deleted file mode 100644 index 0c3ad19c..00000000 --- a/cinelerra-5.1/thirdparty/src/libaom-v3.1.1.patch0 +++ /dev/null @@ -1,11 +0,0 @@ ---- libaom-3.1.1/CMakeLists.txt.orig 2021-09-07 21:36:23.156964673 +0300 -+++ libaom-3.1.1/CMakeLists.txt 2021-09-07 21:36:53.780586982 +0300 -@@ -8,7 +8,7 @@ - # License 1.0 was not distributed with this source code in the PATENTS file, you - # can obtain it at www.aomedia.org/license/patent. - # --cmake_minimum_required(VERSION 3.6) -+cmake_minimum_required(VERSION 3.5) - - set(AOM_ROOT "${CMAKE_CURRENT_SOURCE_DIR}") - set(AOM_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/cinelerra-5.1/thirdparty/src/libaom-v3.1.1.patch1 b/cinelerra-5.1/thirdparty/src/libaom-v3.1.1.patch1 deleted file mode 100644 index 1c007dde..00000000 --- a/cinelerra-5.1/thirdparty/src/libaom-v3.1.1.patch1 +++ /dev/null @@ -1,21 +0,0 @@ ---- libaom-v3.0.0/aom_ports/arm_cpudetect.c 2020-07-10 02:32:42.000000000 +0300 -+++ libaom-v3.0.0_1/aom_ports/arm_cpudetect.c 2021-05-08 05:18:23.404156362 +0300 -@@ -87,7 +87,7 @@ - return flags & mask; - } - --#elif defined(__ANDROID__) /* end _MSC_VER */ -+#elif (defined(__ANDROID__) && !defined(__TERMUX__))/* end _MSC_VER */ - #include - - int aom_arm_cpu_caps(void) { -@@ -106,8 +106,7 @@ - return flags & mask; - } - --#elif defined(__linux__) /* end __ANDROID__ */ -- -+#elif defined(__LINUX__) || defined(__TERMUX__)/* end __ANDROID__ */ - #include - - int aom_arm_cpu_caps(void) { diff --git a/cinelerra-5.1/thirdparty/src/libaom-v3.1.1.tar.xz b/cinelerra-5.1/thirdparty/src/libaom-v3.1.1.tar.xz deleted file mode 100644 index d6460e06..00000000 Binary files a/cinelerra-5.1/thirdparty/src/libaom-v3.1.1.tar.xz and /dev/null differ diff --git a/cinelerra-5.1/thirdparty/src/libaom-v3.2.0.patch0 b/cinelerra-5.1/thirdparty/src/libaom-v3.2.0.patch0 deleted file mode 100644 index 0c3ad19c..00000000 --- a/cinelerra-5.1/thirdparty/src/libaom-v3.2.0.patch0 +++ /dev/null @@ -1,11 +0,0 @@ ---- libaom-3.1.1/CMakeLists.txt.orig 2021-09-07 21:36:23.156964673 +0300 -+++ libaom-3.1.1/CMakeLists.txt 2021-09-07 21:36:53.780586982 +0300 -@@ -8,7 +8,7 @@ - # License 1.0 was not distributed with this source code in the PATENTS file, you - # can obtain it at www.aomedia.org/license/patent. - # --cmake_minimum_required(VERSION 3.6) -+cmake_minimum_required(VERSION 3.5) - - set(AOM_ROOT "${CMAKE_CURRENT_SOURCE_DIR}") - set(AOM_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/cinelerra-5.1/thirdparty/src/libaom-v3.2.0.tar.xz b/cinelerra-5.1/thirdparty/src/libaom-v3.2.0.tar.xz deleted file mode 100644 index 3d085f31..00000000 Binary files a/cinelerra-5.1/thirdparty/src/libaom-v3.2.0.tar.xz and /dev/null differ diff --git a/cinelerra-5.1/thirdparty/src/libaom-v3.4.0.patch0 b/cinelerra-5.1/thirdparty/src/libaom-v3.4.0.patch0 new file mode 100644 index 00000000..8fc94ee5 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/libaom-v3.4.0.patch0 @@ -0,0 +1,11 @@ +--- libaom-v3.4.0/CMakeLists.txt.orig 2022-07-23 22:33:18.090606192 +0300 ++++ libaom-v3.4.0/CMakeLists.txt 2022-07-23 22:41:42.114605831 +0300 +@@ -11,7 +11,7 @@ + if(CONFIG_TFLITE) + cmake_minimum_required(VERSION 3.11) + else() +- cmake_minimum_required(VERSION 3.7) ++ cmake_minimum_required(VERSION 3.5) + endif() + + set(AOM_ROOT "${CMAKE_CURRENT_SOURCE_DIR}") diff --git a/cinelerra-5.1/thirdparty/src/libaom-v3.2.0.patch1 b/cinelerra-5.1/thirdparty/src/libaom-v3.4.0.patch1 similarity index 100% rename from cinelerra-5.1/thirdparty/src/libaom-v3.2.0.patch1 rename to cinelerra-5.1/thirdparty/src/libaom-v3.4.0.patch1 diff --git a/cinelerra-5.1/thirdparty/src/libaom-v3.4.0.tar.xz b/cinelerra-5.1/thirdparty/src/libaom-v3.4.0.tar.xz new file mode 100644 index 00000000..f55e51d3 Binary files /dev/null and b/cinelerra-5.1/thirdparty/src/libaom-v3.4.0.tar.xz differ diff --git a/cinelerra-5.1/thirdparty/src/libaom-v3.8.0.patch0 b/cinelerra-5.1/thirdparty/src/libaom-v3.8.0.patch0 new file mode 100644 index 00000000..fcd437ef --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/libaom-v3.8.0.patch0 @@ -0,0 +1,11 @@ +--- libaom-v3.4.0/CMakeLists.txt.orig 2022-07-23 22:33:18.090606192 +0300 ++++ libaom-v3.4.0/CMakeLists.txt 2022-07-23 22:41:42.114605831 +0300 +@@ -11,7 +11,7 @@ + if(CONFIG_TFLITE) + cmake_minimum_required(VERSION 3.11) + else() +- cmake_minimum_required(VERSION 3.9) ++ cmake_minimum_required(VERSION 3.5) + endif() + + set(AOM_ROOT "${CMAKE_CURRENT_SOURCE_DIR}") diff --git a/cinelerra-5.1/thirdparty/src/libaom-v3.8.0.tar.xz b/cinelerra-5.1/thirdparty/src/libaom-v3.8.0.tar.xz new file mode 100644 index 00000000..3d79cfcd Binary files /dev/null and b/cinelerra-5.1/thirdparty/src/libaom-v3.8.0.tar.xz differ diff --git a/cinelerra-5.1/thirdparty/src/libjpeg-turbo-2.1.0.tar.gz b/cinelerra-5.1/thirdparty/src/libjpeg-turbo-2.1.0.tar.gz deleted file mode 100644 index 9e239c9e..00000000 Binary files a/cinelerra-5.1/thirdparty/src/libjpeg-turbo-2.1.0.tar.gz and /dev/null differ diff --git a/cinelerra-5.1/thirdparty/src/libjpeg-turbo-2.1.2.tar.gz b/cinelerra-5.1/thirdparty/src/libjpeg-turbo-2.1.2.tar.gz deleted file mode 100644 index 2a73d420..00000000 Binary files a/cinelerra-5.1/thirdparty/src/libjpeg-turbo-2.1.2.tar.gz and /dev/null differ diff --git a/cinelerra-5.1/thirdparty/src/libjpeg-turbo-2.1.5.1.tar.gz b/cinelerra-5.1/thirdparty/src/libjpeg-turbo-2.1.5.1.tar.gz new file mode 100644 index 00000000..0a4a0fa2 Binary files /dev/null and b/cinelerra-5.1/thirdparty/src/libjpeg-turbo-2.1.5.1.tar.gz differ diff --git a/cinelerra-5.1/thirdparty/src/libogg-1.3.4.tar.xz b/cinelerra-5.1/thirdparty/src/libogg-1.3.4.tar.xz deleted file mode 100644 index 654ff9c2..00000000 Binary files a/cinelerra-5.1/thirdparty/src/libogg-1.3.4.tar.xz and /dev/null differ diff --git a/cinelerra-5.1/thirdparty/src/libsndfile-1.2.2.tar.xz b/cinelerra-5.1/thirdparty/src/libsndfile-1.2.2.tar.xz new file mode 100644 index 00000000..8ce5a73c Binary files /dev/null and b/cinelerra-5.1/thirdparty/src/libsndfile-1.2.2.tar.xz differ diff --git a/cinelerra-5.1/thirdparty/src/libsvtav1-v1.8.0.patch0 b/cinelerra-5.1/thirdparty/src/libsvtav1-v1.8.0.patch0 new file mode 100644 index 00000000..3a7b2b83 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/libsvtav1-v1.8.0.patch0 @@ -0,0 +1,11 @@ +--- libsvtav1-v1.8.0/CMakeLists.txt ++++ libsvtav1-v1.8.0/CMakeLists.txt +@@ -9,7 +9,7 @@ + # PATENTS file, you can obtain it at https://www.aomedia.org/license/patent-license. + # + +-cmake_minimum_required(VERSION 3.16) ++cmake_minimum_required(VERSION 3.12) + + if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") + message(WARNING "Building in-source is highly not recommended\n" diff --git a/cinelerra-5.1/thirdparty/src/libsvtav1-v1.8.0.tar.xz b/cinelerra-5.1/thirdparty/src/libsvtav1-v1.8.0.tar.xz new file mode 100644 index 00000000..1b3b1004 Binary files /dev/null and b/cinelerra-5.1/thirdparty/src/libsvtav1-v1.8.0.tar.xz differ diff --git a/cinelerra-5.1/thirdparty/src/libuuid-1.0.3.patch b/cinelerra-5.1/thirdparty/src/libuuid-1.0.3.patch new file mode 100644 index 00000000..80292b4a --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/libuuid-1.0.3.patch @@ -0,0 +1,48 @@ +--- ./gen_uuid_c 2023-04-06 18:59:49.376261216 -0600 ++++ ./gen_uuid.c 2023-04-06 17:57:00.987526837 -0600 +@@ -216,7 +216,7 @@ + for (i = 0; i < n; i+= ifreq_size(*ifrp) ) { + ifrp = (struct ifreq *)((char *) ifc.ifc_buf+i); + strncpy(ifr.ifr_name, ifrp->ifr_name, IFNAMSIZ); +-#ifdef SIOCGIFHWADDR ++#if defined(SIOCGIFHWADDR) && !defined(__sun) + if (ioctl(sd, SIOCGIFHWADDR, &ifr) < 0) + continue; + a = (unsigned char *) &ifr.ifr_hwaddr.sa_data; +@@ -271,11 +271,16 @@ + THREAD_LOCAL int state_fd = -2; + THREAD_LOCAL FILE *state_f; + THREAD_LOCAL uint16_t clock_seq; ++ struct flock lock; + struct timeval tv; + uint64_t clock_reg; + mode_t save_umask; + int len; + int ret = 0; ++ ++lock.l_whence = SEEK_SET; ++lock.l_start = 0; ++lock.l_len = 0; + + if (state_fd == -2) { + save_umask = umask(0); +@@ -294,7 +299,8 @@ + } + if (state_fd >= 0) { + rewind(state_f); +- while (flock(state_fd, LOCK_EX) < 0) { ++ lock.l_type = F_WRLCK; ++ while (fcntl(state_fd, F_SETLKW, &lock) < 0) { + if ((errno == EAGAIN) || (errno == EINTR)) + continue; + fclose(state_f); +@@ -366,7 +372,8 @@ + fflush(state_f); + } + rewind(state_f); +- flock(state_fd, LOCK_UN); ++ lock.l_type = F_UNLCK; ++ fcntl(state_fd, F_SETLK, &lock); + } + + *clock_high = clock_reg >> 32; diff --git a/cinelerra-5.1/thirdparty/src/libvpx-1.11.0.tar.xz b/cinelerra-5.1/thirdparty/src/libvpx-1.11.0.tar.xz deleted file mode 100644 index 0c9afd37..00000000 Binary files a/cinelerra-5.1/thirdparty/src/libvpx-1.11.0.tar.xz and /dev/null differ diff --git a/cinelerra-5.1/thirdparty/src/libvpx-1.11.0.patch1 b/cinelerra-5.1/thirdparty/src/libvpx-1.13.1.patch1 similarity index 100% rename from cinelerra-5.1/thirdparty/src/libvpx-1.11.0.patch1 rename to cinelerra-5.1/thirdparty/src/libvpx-1.13.1.patch1 diff --git a/cinelerra-5.1/thirdparty/src/libvpx-1.13.1.tar.gz b/cinelerra-5.1/thirdparty/src/libvpx-1.13.1.tar.gz new file mode 100644 index 00000000..a2455c38 Binary files /dev/null and b/cinelerra-5.1/thirdparty/src/libvpx-1.13.1.tar.gz differ diff --git a/cinelerra-5.1/thirdparty/src/libwebp-1.1.0.patch1 b/cinelerra-5.1/thirdparty/src/libwebp-1.1.0.patch1 deleted file mode 100644 index 9e3d2b04..00000000 --- a/cinelerra-5.1/thirdparty/src/libwebp-1.1.0.patch1 +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9503daa..61c15e6 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -75,20 +75,6 @@ set(INSTALLED_LIBRARIES) - - # ############################################################################## - # Android only. --if(ANDROID) -- include_directories(${ANDROID_NDK}/sources/android/cpufeatures) -- add_library(cpufeatures STATIC -- ${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c) -- list(APPEND INSTALLED_LIBRARIES cpufeatures) -- target_link_libraries(cpufeatures dl) -- set(WEBP_DEP_LIBRARIES ${WEBP_DEP_LIBRARIES} cpufeatures) -- set(WEBP_DEP_INCLUDE_DIRS ${WEBP_DEP_INCLUDE_DIRS} -- ${ANDROID_NDK}/sources/android/cpufeatures) -- add_definitions(-DHAVE_CPU_FEATURES_H=1) -- set(HAVE_CPU_FEATURES_H 1) --else() -- set(HAVE_CPU_FEATURES_H 0) --endif() - - function(configure_pkg_config FILE) - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.in" diff --git a/cinelerra-5.1/thirdparty/src/libwebp-1.1.0.patch2 b/cinelerra-5.1/thirdparty/src/libwebp-1.1.0.patch2 deleted file mode 100644 index 737e1efa..00000000 --- a/cinelerra-5.1/thirdparty/src/libwebp-1.1.0.patch2 +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/cmake/cpu.cmake b/cmake/cpu.cmake -index da9a42a..46a8f4a 100644 ---- a/cmake/cpu.cmake -+++ b/cmake/cpu.cmake -@@ -46,14 +46,7 @@ set(WEBP_SIMD_FILES_TO_NOT_INCLUDE) - set(WEBP_SIMD_FILES_TO_INCLUDE) - set(WEBP_SIMD_FLAGS_TO_INCLUDE) - --if(${ANDROID}) -- if(${ANDROID_ABI} STREQUAL "armeabi-v7a") -- # This is because Android studio uses the configuration "-march=armv7-a -- # -mfloat-abi=softfp -mfpu=vfpv3-d16" that does not trigger neon -- # optimizations but should (as this configuration does not exist anymore). -- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon ") -- endif() --endif() -+ - - list(LENGTH WEBP_SIMD_FLAGS WEBP_SIMD_FLAGS_LENGTH) - math(EXPR WEBP_SIMD_FLAGS_RANGE "${WEBP_SIMD_FLAGS_LENGTH} - 1") diff --git a/cinelerra-5.1/thirdparty/src/libwebp-1.1.0.patch3 b/cinelerra-5.1/thirdparty/src/libwebp-1.1.0.patch3 deleted file mode 100644 index 7696f589..00000000 --- a/cinelerra-5.1/thirdparty/src/libwebp-1.1.0.patch3 +++ /dev/null @@ -1,27 +0,0 @@ ---- ./CMakeLists.txt.orig 2021-11-23 13:07:40.473195486 +0300 -+++ ./CMakeLists.txt 2021-11-23 13:08:43.225195490 +0300 -@@ -4,15 +4,15 @@ - - # Options for coder / decoder executables. - option(WEBP_ENABLE_SIMD "Enable any SIMD optimization." ON) --option(WEBP_BUILD_ANIM_UTILS "Build animation utilities." ON) --option(WEBP_BUILD_CWEBP "Build the cwebp command line tool." ON) --option(WEBP_BUILD_DWEBP "Build the dwebp command line tool." ON) --option(WEBP_BUILD_GIF2WEBP "Build the gif2webp conversion tool." ON) --option(WEBP_BUILD_IMG2WEBP "Build the img2webp animation tool." ON) --option(WEBP_BUILD_VWEBP "Build the vwebp viewer tool." ON) --option(WEBP_BUILD_WEBPINFO "Build the webpinfo command line tool." ON) --option(WEBP_BUILD_WEBPMUX "Build the webpmux command line tool." ON) --option(WEBP_BUILD_EXTRAS "Build extras." ON) -+option(WEBP_BUILD_ANIM_UTILS "Build animation utilities." OFF) -+option(WEBP_BUILD_CWEBP "Build the cwebp command line tool." OFF) -+option(WEBP_BUILD_DWEBP "Build the dwebp command line tool." OFF) -+option(WEBP_BUILD_GIF2WEBP "Build the gif2webp conversion tool." OFF) -+option(WEBP_BUILD_IMG2WEBP "Build the img2webp animation tool." OFF) -+option(WEBP_BUILD_VWEBP "Build the vwebp viewer tool." OFF) -+option(WEBP_BUILD_WEBPINFO "Build the webpinfo command line tool." OFF) -+option(WEBP_BUILD_WEBPMUX "Build the webpmux command line tool." OFF) -+option(WEBP_BUILD_EXTRAS "Build extras." OFF) - option(WEBP_BUILD_WEBP_JS "Emscripten build of webp.js." OFF) - option(WEBP_NEAR_LOSSLESS "Enable near-lossless encoding" ON) - option(WEBP_ENABLE_SWAP_16BIT_CSP "Enable byte swap for 16 bit colorspaces." diff --git a/cinelerra-5.1/thirdparty/src/libwebp-1.3.2.patch0 b/cinelerra-5.1/thirdparty/src/libwebp-1.3.2.patch0 new file mode 100644 index 00000000..bc1628e7 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/libwebp-1.3.2.patch0 @@ -0,0 +1,12 @@ +--- libwebp-1.3.2/src/libwebp.pc.in.orig 2023-09-15 19:52:28.960943568 +0300 ++++ libwebp-1.3.2/src/libwebp.pc.in 2023-09-15 19:55:00.828943460 +0300 +@@ -6,7 +6,7 @@ + Name: libwebp + Description: Library for the WebP graphics format + Version: @PACKAGE_VERSION@ +-Requires.private: libsharpyuv ++Requires: libsharpyuv + Cflags: -I${includedir} +-Libs: -L${libdir} -l@webp_libname_prefix@webp ++Libs: -L${libdir} -l@webp_libname_prefix@webp -lsharpyuv + Libs.private: -lm @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ diff --git a/cinelerra-5.1/thirdparty/src/libwebp-1.1.0.tar.xz b/cinelerra-5.1/thirdparty/src/libwebp-1.3.2.tar.xz similarity index 63% rename from cinelerra-5.1/thirdparty/src/libwebp-1.1.0.tar.xz rename to cinelerra-5.1/thirdparty/src/libwebp-1.3.2.tar.xz index 45b5e3d9..344a4c09 100644 Binary files a/cinelerra-5.1/thirdparty/src/libwebp-1.1.0.tar.xz and b/cinelerra-5.1/thirdparty/src/libwebp-1.3.2.tar.xz differ diff --git a/cinelerra-5.1/thirdparty/src/mjpegtools-2.1.0.patch8 b/cinelerra-5.1/thirdparty/src/mjpegtools-2.1.0.patch8 new file mode 100644 index 00000000..610f94e6 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/mjpegtools-2.1.0.patch8 @@ -0,0 +1,34 @@ +Index: mplex/lpcmstrm_in.cpp +=================================================================== +--- ./mplex/lpcmstrm_in.cpp (revision 3507) ++++ ./mplex/lpcmstrm_in.cpp (working copy) +@@ -306,7 +306,15 @@ + default : bps_code = 3; break; + } + dst[4] = starting_frame_index; +- unsigned int bsf_code = (samples_per_second == 48000) ? 0 : 1; ++ unsigned int bsf_code; ++ switch(samples_per_second) ++ { ++ case 48000: bsf_code = 0; break; ++ case 96000: bsf_code = 1; break; ++ case 44100: bsf_code = 2; break; ++ case 32000: bsf_code = 3; break; ++ } ++ //unsigned int bsf_code = (samples_per_second == 48000) ? 0 : 1; + unsigned int channels_code = channels - 1; + dst[5] = (bps_code << 6) | (bsf_code << 4) | channels_code; + dst[6] = dynamic_range_code; +Index: mplex/stream_params.cpp +=================================================================== +--- ./mplex/stream_params.cpp (revision 3507) ++++ ./mplex/stream_params.cpp (working copy) +@@ -46,7 +46,7 @@ + unsigned int chans, + unsigned int bits ) + { +- if( samples != 48000 && samples != 96000 ) ++ if( samples != 48000 && samples != 96000 && samples != 44100 && samples != 32000 ) + return 0; + if( chans < 1 || chans > 7 ) + return 0; diff --git a/cinelerra-5.1/thirdparty/src/openexr-2.4.1.patch3 b/cinelerra-5.1/thirdparty/src/openexr-2.4.1.patch3 new file mode 100644 index 00000000..24d9ae1e --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/openexr-2.4.1.patch3 @@ -0,0 +1,10 @@ +--- openexr-2.4.1/OpenEXR/IlmImf/ImfMisc.cpp.orig 2023-02-06 20:35:13.691479571 +0300 ++++ openexr-2.4.1/OpenEXR/IlmImf/ImfMisc.cpp 2023-02-06 20:35:59.535479538 +0300 +@@ -53,6 +53,7 @@ + #include + #include + #include "ImfNamespace.h" ++#include + + OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER + diff --git a/cinelerra-5.1/thirdparty/src/openjpeg-2.4.0.tar.xz b/cinelerra-5.1/thirdparty/src/openjpeg-2.4.0.tar.xz deleted file mode 100644 index 2e9627dd..00000000 Binary files a/cinelerra-5.1/thirdparty/src/openjpeg-2.4.0.tar.xz and /dev/null differ diff --git a/cinelerra-5.1/thirdparty/src/sord-0.16.4.patch1 b/cinelerra-5.1/thirdparty/src/sord-0.16.4.patch1 new file mode 100644 index 00000000..d21399a4 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/sord-0.16.4.patch1 @@ -0,0 +1,21 @@ +--- ./waflib/Context.py ++++ ./waflib/Context.py +@@ -6,10 +6,17 @@ + Classes and functions enabling the command system + """ + +-import os, re, imp, sys ++import os, re, sys + from waflib import Utils, Errors, Logs + import waflib.Node + ++if sys.hexversion > 0x3040000: ++ import types ++ class imp(object): ++ new_module = lambda x: types.ModuleType(x) ++else: ++ import imp ++ + # the following 3 constants are updated on each new release (do not touch) + HEXVERSION=0x2001200 + """Constant updated on new releases""" diff --git a/cinelerra-5.1/thirdparty/src/sratom-0.6.4.patch1 b/cinelerra-5.1/thirdparty/src/sratom-0.6.4.patch1 new file mode 100644 index 00000000..274285a2 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/sratom-0.6.4.patch1 @@ -0,0 +1,21 @@ +--- ./waflib/Context.py ++++ ./waflib/Context.py +@@ -6,10 +6,17 @@ + Classes and functions enabling the command system + """ + +-import os, re, imp, sys ++import os, re, sys + from waflib import Utils, Errors, Logs + import waflib.Node + ++if sys.hexversion > 0x3040000: ++ import types ++ class imp(object): ++ new_module = lambda x: types.ModuleType(x) ++else: ++ import imp ++ + # the following 3 constants are updated on each new release (do not touch) + HEXVERSION=0x2001200 + """Constant updated on new releases""" diff --git a/cinelerra-5.1/thirdparty/src/suil-0.10.6.patch1 b/cinelerra-5.1/thirdparty/src/suil-0.10.6.patch1 new file mode 100644 index 00000000..274285a2 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/suil-0.10.6.patch1 @@ -0,0 +1,21 @@ +--- ./waflib/Context.py ++++ ./waflib/Context.py +@@ -6,10 +6,17 @@ + Classes and functions enabling the command system + """ + +-import os, re, imp, sys ++import os, re, sys + from waflib import Utils, Errors, Logs + import waflib.Node + ++if sys.hexversion > 0x3040000: ++ import types ++ class imp(object): ++ new_module = lambda x: types.ModuleType(x) ++else: ++ import imp ++ + # the following 3 constants are updated on each new release (do not touch) + HEXVERSION=0x2001200 + """Constant updated on new releases""" diff --git a/cinelerra-5.1/thirdparty/src/tiff-4.1.0.patch1 b/cinelerra-5.1/thirdparty/src/tiff-4.1.0.patch1 deleted file mode 100644 index e0f3f605..00000000 --- a/cinelerra-5.1/thirdparty/src/tiff-4.1.0.patch1 +++ /dev/null @@ -1,11 +0,0 @@ ---- ./Makefile.am.orig 2021-11-29 09:48:57.020738370 +0300 -+++ ./Makefile.am 2021-11-29 09:49:35.968738373 +0300 -@@ -60,7 +60,7 @@ - rm -rf $(distdir)/_build/cmake - rm -rf $(distdir)/_inst/cmake - --SUBDIRS = port libtiff tools build contrib test man html -+SUBDIRS = port libtiff build - - release: - (rm -f $(top_srcdir)/RELEASE-DATE && echo $(LIBTIFF_RELEASE_DATE) > $(top_srcdir)/RELEASE-DATE) diff --git a/cinelerra-5.1/thirdparty/src/tiff-4.1.0.tar.xz b/cinelerra-5.1/thirdparty/src/tiff-4.1.0.tar.xz deleted file mode 100644 index 6a3d4175..00000000 Binary files a/cinelerra-5.1/thirdparty/src/tiff-4.1.0.tar.xz and /dev/null differ diff --git a/cinelerra-5.1/thirdparty/src/tiff-4.3.0.patch1 b/cinelerra-5.1/thirdparty/src/tiff-4.3.0.patch1 deleted file mode 100644 index e0f3f605..00000000 --- a/cinelerra-5.1/thirdparty/src/tiff-4.3.0.patch1 +++ /dev/null @@ -1,11 +0,0 @@ ---- ./Makefile.am.orig 2021-11-29 09:48:57.020738370 +0300 -+++ ./Makefile.am 2021-11-29 09:49:35.968738373 +0300 -@@ -60,7 +60,7 @@ - rm -rf $(distdir)/_build/cmake - rm -rf $(distdir)/_inst/cmake - --SUBDIRS = port libtiff tools build contrib test man html -+SUBDIRS = port libtiff build - - release: - (rm -f $(top_srcdir)/RELEASE-DATE && echo $(LIBTIFF_RELEASE_DATE) > $(top_srcdir)/RELEASE-DATE) diff --git a/cinelerra-5.1/thirdparty/src/tiff-4.3.0.tar.xz b/cinelerra-5.1/thirdparty/src/tiff-4.3.0.tar.xz deleted file mode 100644 index 76be8c3b..00000000 Binary files a/cinelerra-5.1/thirdparty/src/tiff-4.3.0.tar.xz and /dev/null differ diff --git a/cinelerra-5.1/thirdparty/src/tiff-4.6.0.patch1 b/cinelerra-5.1/thirdparty/src/tiff-4.6.0.patch1 new file mode 100644 index 00000000..5ab06745 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/tiff-4.6.0.patch1 @@ -0,0 +1,11 @@ +--- ./Makefile.am 2023-11-03 18:42:35.844353508 -0600 ++++ ./Makefile.am 2023-11-04 10:56:54.473163327 -0600 +@@ -60,7 +60,7 @@ + rm -rf $(distdir)/_build/cmake + rm -rf $(distdir)/_inst/cmake + +-SUBDIRS = port libtiff tools build contrib test doc tools/unsupported ++SUBDIRS = port libtiff build + + + NEW_LIBTIFF_RELEASE_DATE=$(shell date +"%Y%m%d") diff --git a/cinelerra-5.1/thirdparty/src/tiff-4.6.0.patch2 b/cinelerra-5.1/thirdparty/src/tiff-4.6.0.patch2 new file mode 100644 index 00000000..39887156 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/tiff-4.6.0.patch2 @@ -0,0 +1,10 @@ +--- ./configure.ac ++++ ./configure.ac +@@ -888,6 +888,7 @@ + if test "x$enable_webp" != "xno" ; then + + if test "x$with_webp_lib_dir" != "x" ; then ++ LIBS="-lpthread $LIBS" + LDFLAGS="-L$with_webp_lib_dir $LDFLAGS" + fi + diff --git a/cinelerra-5.1/thirdparty/src/tiff-4.6.0.tar.xz b/cinelerra-5.1/thirdparty/src/tiff-4.6.0.tar.xz new file mode 100644 index 00000000..25eb11ab Binary files /dev/null and b/cinelerra-5.1/thirdparty/src/tiff-4.6.0.tar.xz differ diff --git a/cinelerra-5.1/thirdparty/src/x264-stable.patch1 b/cinelerra-5.1/thirdparty/src/x264-stable.patch1 new file mode 100644 index 00000000..08026a95 --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/x264-stable.patch1 @@ -0,0 +1,18 @@ +--- a/encoder/encoder.c 2023-04-01 19:08:58.420132123 -0600 ++++ b/encoder/encoder.c 2023-04-01 18:52:48.148808059 -0600 +@@ -667,6 +667,7 @@ + return -1; + } + ++#if 0 + /* Detect default ffmpeg settings and terminate with an error. */ + if( b_open ) + { +@@ -690,6 +691,7 @@ + return -1; + } + } ++#endif + + if( h->param.rc.i_rc_method < 0 || h->param.rc.i_rc_method > 2 ) + { diff --git a/cinelerra-5.1/thirdparty/src/x264-stable.tar.gz b/cinelerra-5.1/thirdparty/src/x264-stable.tar.gz new file mode 100644 index 00000000..45b8f4cf Binary files /dev/null and b/cinelerra-5.1/thirdparty/src/x264-stable.tar.gz differ diff --git a/cinelerra-5.1/thirdparty/src/x265_3.5.patch0 b/cinelerra-5.1/thirdparty/src/x265_3.5.patch0 new file mode 100644 index 00000000..09c60b7a --- /dev/null +++ b/cinelerra-5.1/thirdparty/src/x265_3.5.patch0 @@ -0,0 +1,5319 @@ +diff -Naur ./source/CMakeLists.txt ../x265_apple_patch/source/CMakeLists.txt +--- ./source/CMakeLists.txt 2021-05-08 13:06:22.000000000 +0100 ++++ ../x265_apple_patch/source/CMakeLists.txt 2021-05-08 13:08:01.000000000 +0100 +@@ -40,9 +40,11 @@ + # System architecture detection + string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC) + set(X86_ALIASES x86 i386 i686 x86_64 amd64) +-set(ARM_ALIASES armv6l armv7l aarch64) ++set(ARM_ALIASES armv6l armv7l) ++set(ARM64_ALIASES arm64 arm64e aarch64) + list(FIND X86_ALIASES "${SYSPROC}" X86MATCH) + list(FIND ARM_ALIASES "${SYSPROC}" ARMMATCH) ++list(FIND ARM64_ALIASES "${SYSPROC}" ARM64MATCH) + set(POWER_ALIASES ppc64 ppc64le) + list(FIND POWER_ALIASES "${SYSPROC}" POWERMATCH) + if("${SYSPROC}" STREQUAL "" OR X86MATCH GREATER "-1") +@@ -79,6 +81,15 @@ + message(STATUS "Detected ARM target processor") + add_definitions(-DX265_ARCH_ARM=1 -DX265_ARCH_ARM64=0 -DHAVE_ARMV6=1) + endif() ++elseif(ARM64MATCH GREATER "-1") ++ if(CROSS_COMPILE_ARM64) ++ message(STATUS "Cross compiling for ARM64 arch") ++ else() ++ set(CROSS_COMPILE_ARM64 0) ++ endif() ++ message(STATUS "Detected ARM64 target processor") ++ set(ARM64 1) ++ add_definitions(-DX265_ARCH_ARM64=1 -DHAVE_NEON) + else() + message(STATUS "CMAKE_SYSTEM_PROCESSOR value `${CMAKE_SYSTEM_PROCESSOR}` is unknown") + message(STATUS "Please add this value near ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}") +@@ -259,6 +270,9 @@ + endif() + endif() + endif() ++ if(ARM64 OR CROSS_COMPILE_ARM64) ++ add_definitions(-DHAVE_NEON) ++ endif() + add_definitions(${ARM_ARGS}) + if(FPROFILE_GENERATE) + if(INTEL_CXX) +@@ -350,7 +364,7 @@ + endif(GCC) + + find_package(Nasm) +-if(ARM OR CROSS_COMPILE_ARM) ++if(ARM OR CROSS_COMPILE_ARM OR ARM64 OR CROSS_COMPILE_ARM64) + option(ENABLE_ASSEMBLY "Enable use of assembly coded primitives" ON) + elseif(NASM_FOUND AND X86) + if (NASM_VERSION_STRING VERSION_LESS "2.13.0") +@@ -549,6 +563,32 @@ + ARGS ${ARM_ARGS} -c ${ASM_SRC} -o ${ASM}.${SUFFIX} + DEPENDS ${ASM_SRC}) + endforeach() ++ elseif(ARM64 OR CROSS_COMPILE_ARM64) ++ # compile ARM arch asm files here ++ enable_language(ASM) ++ foreach(ASM ${ARM_ASMS}) ++ set(ASM_SRC ${CMAKE_CURRENT_SOURCE_DIR}/common/arm64/${ASM}) ++ list(APPEND ASM_SRCS ${ASM_SRC}) ++ list(APPEND ASM_OBJS ${ASM}.${SUFFIX}) ++ add_custom_command( ++ OUTPUT ${ASM}.${SUFFIX} ++ COMMAND ${CMAKE_CXX_COMPILER} ++ ARGS ${ARM_ARGS} -c ${ASM_SRC} -o ${ASM}.${SUFFIX} ++ DEPENDS ${ASM_SRC}) ++ endforeach() ++ elseif(ARM64 OR CROSS_COMPILE_ARM64) ++ # compile ARM arch asm files here ++ enable_language(ASM) ++ foreach(ASM ${ARM_ASMS}) ++ set(ASM_SRC ${CMAKE_CURRENT_SOURCE_DIR}/common/arm64/${ASM}) ++ list(APPEND ASM_SRCS ${ASM_SRC}) ++ list(APPEND ASM_OBJS ${ASM}.${SUFFIX}) ++ add_custom_command( ++ OUTPUT ${ASM}.${SUFFIX} ++ COMMAND ${CMAKE_CXX_COMPILER} ++ ARGS ${ARM_ARGS} -c ${ASM_SRC} -o ${ASM}.${SUFFIX} ++ DEPENDS ${ASM_SRC}) ++ endforeach() + elseif(X86) + # compile X86 arch asm files here + foreach(ASM ${MSVC_ASMS}) +diff -Naur ./source/common/CMakeLists.txt ../x265_apple_patch/source/common/CMakeLists.txt +--- ./source/common/CMakeLists.txt 2021-05-08 13:06:22.000000000 +0100 ++++ ../x265_apple_patch/source/common/CMakeLists.txt 2021-05-08 13:08:01.000000000 +0100 +@@ -114,6 +114,22 @@ + source_group(Assembly FILES ${ASM_PRIMITIVES}) + endif(ENABLE_ASSEMBLY AND (ARM OR CROSS_COMPILE_ARM)) + ++ ++if(ENABLE_ASSEMBLY AND (ARM64 OR CROSS_COMPILE_ARM64)) ++ set(C_SRCS asm-primitives.cpp pixel-prim.h pixel-prim.cpp filter-prim.h filter-prim.cpp dct-prim.h dct-prim.cpp loopfilter-prim.cpp loopfilter-prim.h intrapred-prim.cpp arm64-utils.cpp arm64-utils.h) ++ enable_language(ASM) ++ # add ARM assembly/intrinsic files here ++ #set(A_SRCS ) ++ #set(VEC_PRIMITIVES) ++ ++ #set(ARM64_ASMS "${A_SRCS}" CACHE INTERNAL "ARM64 Assembly Sources") ++ foreach(SRC ${C_SRCS}) ++ set(ASM_PRIMITIVES ${ASM_PRIMITIVES} arm64/${SRC}) ++ endforeach() ++ source_group(Assembly FILES ${ASM_PRIMITIVES}) ++endif(ENABLE_ASSEMBLY AND (ARM64 OR CROSS_COMPILE_ARM64)) ++ ++ + if(POWER) + set_source_files_properties(version.cpp PROPERTIES COMPILE_FLAGS -DX265_VERSION=${X265_VERSION}) + if(ENABLE_ALTIVEC) +diff -Naur ./source/common/arm64/arm64-utils.cpp ../x265_apple_patch/source/common/arm64/arm64-utils.cpp +--- ./source/common/arm64/arm64-utils.cpp 1970-01-01 01:00:00.000000000 +0100 ++++ ../x265_apple_patch/source/common/arm64/arm64-utils.cpp 2021-05-08 13:08:01.000000000 +0100 +@@ -0,0 +1,290 @@ ++#include "common.h" ++#include "x265.h" ++#include "arm64-utils.h" ++#include ++ ++#define COPY_16(d,s) *(uint8x16_t *)(d) = *(uint8x16_t *)(s) ++namespace X265_NS { ++ ++ ++ ++void transpose8x8(uint8_t* dst, const uint8_t* src, intptr_t dstride, intptr_t sstride) ++{ ++ uint8x8_t a0,a1,a2,a3,a4,a5,a6,a7; ++ uint8x8_t b0,b1,b2,b3,b4,b5,b6,b7; ++ ++ a0 = *(uint8x8_t *)(src + 0*sstride); ++ a1 = *(uint8x8_t *)(src + 1*sstride); ++ a2 = *(uint8x8_t *)(src + 2*sstride); ++ a3 = *(uint8x8_t *)(src + 3*sstride); ++ a4 = *(uint8x8_t *)(src + 4*sstride); ++ a5 = *(uint8x8_t *)(src + 5*sstride); ++ a6 = *(uint8x8_t *)(src + 6*sstride); ++ a7 = *(uint8x8_t *)(src + 7*sstride); ++ ++ b0 = vtrn1_u32(a0,a4); ++ b1 = vtrn1_u32(a1,a5); ++ b2 = vtrn1_u32(a2,a6); ++ b3 = vtrn1_u32(a3,a7); ++ b4 = vtrn2_u32(a0,a4); ++ b5 = vtrn2_u32(a1,a5); ++ b6 = vtrn2_u32(a2,a6); ++ b7 = vtrn2_u32(a3,a7); ++ ++ a0 = vtrn1_u16(b0,b2); ++ a1 = vtrn1_u16(b1,b3); ++ a2 = vtrn2_u16(b0,b2); ++ a3 = vtrn2_u16(b1,b3); ++ a4 = vtrn1_u16(b4,b6); ++ a5 = vtrn1_u16(b5,b7); ++ a6 = vtrn2_u16(b4,b6); ++ a7 = vtrn2_u16(b5,b7); ++ ++ b0 = vtrn1_u8(a0,a1); ++ b1 = vtrn2_u8(a0,a1); ++ b2 = vtrn1_u8(a2,a3); ++ b3 = vtrn2_u8(a2,a3); ++ b4 = vtrn1_u8(a4,a5); ++ b5 = vtrn2_u8(a4,a5); ++ b6 = vtrn1_u8(a6,a7); ++ b7 = vtrn2_u8(a6,a7); ++ ++ *(uint8x8_t *)(dst + 0*dstride) = b0; ++ *(uint8x8_t *)(dst + 1*dstride) = b1; ++ *(uint8x8_t *)(dst + 2*dstride) = b2; ++ *(uint8x8_t *)(dst + 3*dstride) = b3; ++ *(uint8x8_t *)(dst + 4*dstride) = b4; ++ *(uint8x8_t *)(dst + 5*dstride) = b5; ++ *(uint8x8_t *)(dst + 6*dstride) = b6; ++ *(uint8x8_t *)(dst + 7*dstride) = b7; ++} ++ ++ ++ ++ ++ ++ ++void transpose16x16(uint8_t* dst, const uint8_t* src, intptr_t dstride, intptr_t sstride) ++{ ++ uint16x8_t a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,aA,aB,aC,aD,aE,aF; ++ uint16x8_t b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,bA,bB,bC,bD,bE,bF; ++ uint16x8_t c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,cA,cB,cC,cD,cE,cF; ++ uint16x8_t d0,d1,d2,d3,d4,d5,d6,d7,d8,d9,dA,dB,dC,dD,dE,dF; ++ ++ a0 = *(uint16x8_t *)(src + 0*sstride); ++ a1 = *(uint16x8_t *)(src + 1*sstride); ++ a2 = *(uint16x8_t *)(src + 2*sstride); ++ a3 = *(uint16x8_t *)(src + 3*sstride); ++ a4 = *(uint16x8_t *)(src + 4*sstride); ++ a5 = *(uint16x8_t *)(src + 5*sstride); ++ a6 = *(uint16x8_t *)(src + 6*sstride); ++ a7 = *(uint16x8_t *)(src + 7*sstride); ++ a8 = *(uint16x8_t *)(src + 8*sstride); ++ a9 = *(uint16x8_t *)(src + 9*sstride); ++ aA = *(uint16x8_t *)(src + 10*sstride); ++ aB = *(uint16x8_t *)(src + 11*sstride); ++ aC = *(uint16x8_t *)(src + 12*sstride); ++ aD = *(uint16x8_t *)(src + 13*sstride); ++ aE = *(uint16x8_t *)(src + 14*sstride); ++ aF = *(uint16x8_t *)(src + 15*sstride); ++ ++ b0 = vtrn1q_u64(a0, a8); ++ b1 = vtrn1q_u64(a1, a9); ++ b2 = vtrn1q_u64(a2, aA); ++ b3 = vtrn1q_u64(a3, aB); ++ b4 = vtrn1q_u64(a4, aC); ++ b5 = vtrn1q_u64(a5, aD); ++ b6 = vtrn1q_u64(a6, aE); ++ b7 = vtrn1q_u64(a7, aF); ++ b8 = vtrn2q_u64(a0, a8); ++ b9 = vtrn2q_u64(a1, a9); ++ bA = vtrn2q_u64(a2, aA); ++ bB = vtrn2q_u64(a3, aB); ++ bC = vtrn2q_u64(a4, aC); ++ bD = vtrn2q_u64(a5, aD); ++ bE = vtrn2q_u64(a6, aE); ++ bF = vtrn2q_u64(a7, aF); ++ ++ c0 = vtrn1q_u32(b0, b4); ++ c1 = vtrn1q_u32(b1, b5); ++ c2 = vtrn1q_u32(b2, b6); ++ c3 = vtrn1q_u32(b3, b7); ++ c4 = vtrn2q_u32(b0, b4); ++ c5 = vtrn2q_u32(b1, b5); ++ c6 = vtrn2q_u32(b2, b6); ++ c7 = vtrn2q_u32(b3, b7); ++ c8 = vtrn1q_u32(b8, bC); ++ c9 = vtrn1q_u32(b9, bD); ++ cA = vtrn1q_u32(bA, bE); ++ cB = vtrn1q_u32(bB, bF); ++ cC = vtrn2q_u32(b8, bC); ++ cD = vtrn2q_u32(b9, bD); ++ cE = vtrn2q_u32(bA, bE); ++ cF = vtrn2q_u32(bB, bF); ++ ++ d0 = vtrn1q_u16(c0, c2); ++ d1 = vtrn1q_u16(c1, c3); ++ d2 = vtrn2q_u16(c0, c2); ++ d3 = vtrn2q_u16(c1, c3); ++ d4 = vtrn1q_u16(c4, c6); ++ d5 = vtrn1q_u16(c5, c7); ++ d6 = vtrn2q_u16(c4, c6); ++ d7 = vtrn2q_u16(c5, c7); ++ d8 = vtrn1q_u16(c8, cA); ++ d9 = vtrn1q_u16(c9, cB); ++ dA = vtrn2q_u16(c8, cA); ++ dB = vtrn2q_u16(c9, cB); ++ dC = vtrn1q_u16(cC, cE); ++ dD = vtrn1q_u16(cD, cF); ++ dE = vtrn2q_u16(cC, cE); ++ dF = vtrn2q_u16(cD, cF); ++ ++ *(uint16x8_t *)(dst + 0*dstride) = vtrn1q_u8(d0, d1); ++ *(uint16x8_t *)(dst + 1*dstride) = vtrn2q_u8(d0, d1); ++ *(uint16x8_t *)(dst + 2*dstride) = vtrn1q_u8(d2, d3); ++ *(uint16x8_t *)(dst + 3*dstride) = vtrn2q_u8(d2, d3); ++ *(uint16x8_t *)(dst + 4*dstride) = vtrn1q_u8(d4, d5); ++ *(uint16x8_t *)(dst + 5*dstride) = vtrn2q_u8(d4, d5); ++ *(uint16x8_t *)(dst + 6*dstride) = vtrn1q_u8(d6, d7); ++ *(uint16x8_t *)(dst + 7*dstride) = vtrn2q_u8(d6, d7); ++ *(uint16x8_t *)(dst + 8*dstride) = vtrn1q_u8(d8, d9); ++ *(uint16x8_t *)(dst + 9*dstride) = vtrn2q_u8(d8, d9); ++ *(uint16x8_t *)(dst + 10*dstride) = vtrn1q_u8(dA, dB); ++ *(uint16x8_t *)(dst + 11*dstride) = vtrn2q_u8(dA, dB); ++ *(uint16x8_t *)(dst + 12*dstride) = vtrn1q_u8(dC, dD); ++ *(uint16x8_t *)(dst + 13*dstride) = vtrn2q_u8(dC, dD); ++ *(uint16x8_t *)(dst + 14*dstride) = vtrn1q_u8(dE, dF); ++ *(uint16x8_t *)(dst + 15*dstride) = vtrn2q_u8(dE, dF); ++ ++ ++} ++ ++ ++void transpose32x32(uint8_t* dst, const uint8_t* src, intptr_t dstride, intptr_t sstride) ++{ ++ //assumption: there is no partial overlap ++ transpose16x16(dst,src,dstride,sstride); ++ transpose16x16(dst+16*dstride+16,src+16*sstride+16,dstride,sstride); ++ if (dst == src) ++ { ++ uint8_t tmp[16*16] __attribute__((aligned(64))); ++ transpose16x16(tmp,src + 16,16,sstride); ++ transpose16x16(dst + 16, src + 16*sstride,dstride,sstride); ++ for (int i=0;i<16;i++) COPY_16(dst+(16 + i)*dstride,tmp + 16*i); ++ } ++ else ++ { ++ transpose16x16(dst+16*dstride,src + 16,dstride,sstride); ++ transpose16x16(dst + 16, src + 16*sstride,dstride,sstride); ++ } ++ ++} ++ ++ ++ ++void transpose8x8(uint16_t* dst, const uint16_t* src, intptr_t dstride, intptr_t sstride) ++{ ++ uint16x8_t a0,a1,a2,a3,a4,a5,a6,a7; ++ uint16x8_t b0,b1,b2,b3,b4,b5,b6,b7; ++ ++ a0 = *(uint16x8_t *)(src + 0*sstride); ++ a1 = *(uint16x8_t *)(src + 1*sstride); ++ a2 = *(uint16x8_t *)(src + 2*sstride); ++ a3 = *(uint16x8_t *)(src + 3*sstride); ++ a4 = *(uint16x8_t *)(src + 4*sstride); ++ a5 = *(uint16x8_t *)(src + 5*sstride); ++ a6 = *(uint16x8_t *)(src + 6*sstride); ++ a7 = *(uint16x8_t *)(src + 7*sstride); ++ ++ b0 = vtrn1q_u64(a0,a4); ++ b1 = vtrn1q_u64(a1,a5); ++ b2 = vtrn1q_u64(a2,a6); ++ b3 = vtrn1q_u64(a3,a7); ++ b4 = vtrn2q_u64(a0,a4); ++ b5 = vtrn2q_u64(a1,a5); ++ b6 = vtrn2q_u64(a2,a6); ++ b7 = vtrn2q_u64(a3,a7); ++ ++ a0 = vtrn1q_u32(b0,b2); ++ a1 = vtrn1q_u32(b1,b3); ++ a2 = vtrn2q_u32(b0,b2); ++ a3 = vtrn2q_u32(b1,b3); ++ a4 = vtrn1q_u32(b4,b6); ++ a5 = vtrn1q_u32(b5,b7); ++ a6 = vtrn2q_u32(b4,b6); ++ a7 = vtrn2q_u32(b5,b7); ++ ++ b0 = vtrn1q_u16(a0,a1); ++ b1 = vtrn2q_u16(a0,a1); ++ b2 = vtrn1q_u16(a2,a3); ++ b3 = vtrn2q_u16(a2,a3); ++ b4 = vtrn1q_u16(a4,a5); ++ b5 = vtrn2q_u16(a4,a5); ++ b6 = vtrn1q_u16(a6,a7); ++ b7 = vtrn2q_u16(a6,a7); ++ ++ *(uint16x8_t *)(dst + 0*dstride) = b0; ++ *(uint16x8_t *)(dst + 1*dstride) = b1; ++ *(uint16x8_t *)(dst + 2*dstride) = b2; ++ *(uint16x8_t *)(dst + 3*dstride) = b3; ++ *(uint16x8_t *)(dst + 4*dstride) = b4; ++ *(uint16x8_t *)(dst + 5*dstride) = b5; ++ *(uint16x8_t *)(dst + 6*dstride) = b6; ++ *(uint16x8_t *)(dst + 7*dstride) = b7; ++} ++ ++void transpose16x16(uint16_t* dst, const uint16_t* src, intptr_t dstride, intptr_t sstride) ++{ ++ //assumption: there is no partial overlap ++ transpose8x8(dst,src,dstride,sstride); ++ transpose8x8(dst+8*dstride+8,src+8*sstride+8,dstride,sstride); ++ ++ if (dst == src) ++ { ++ uint16_t tmp[8*8]; ++ transpose8x8(tmp,src + 8,8,sstride); ++ transpose8x8(dst + 8, src + 8*sstride,dstride,sstride); ++ for (int i=0;i<8;i++) COPY_16(dst+(8 + i)*dstride,tmp + 8*i); ++ } ++ else ++ { ++ transpose8x8(dst+8*dstride,src + 8,dstride,sstride); ++ transpose8x8(dst + 8, src + 8*sstride,dstride,sstride); ++ } ++ ++} ++ ++ ++ ++void transpose32x32(uint16_t* dst, const uint16_t* src, intptr_t dstride, intptr_t sstride) ++{ ++ //assumption: there is no partial overlap ++ for (int i=0;i<4;i++) ++ { ++ transpose8x8(dst+i*8*(1+dstride),src+i*8*(1+sstride),dstride,sstride); ++ for (int j=i+1;j<4;j++) ++ { ++ if (dst == src) ++ { ++ uint16_t tmp[8*8] __attribute__((aligned(64))); ++ transpose8x8(tmp,src + 8*i + 8*j*sstride,8,sstride); ++ transpose8x8(dst + 8*i + 8*j*dstride, src + 8*j + 8*i*sstride,dstride,sstride); ++ for (int k=0;k<8;k++) COPY_16(dst+ 8*j + (8*i+k)*dstride,tmp + 8*k); ++ } ++ else ++ { ++ transpose8x8(dst + 8*(j + i*dstride),src + 8*(i + j*sstride),dstride,sstride); ++ transpose8x8(dst + 8*(i + j*dstride),src + 8*(j + i*sstride),dstride,sstride); ++ } ++ ++ } ++ } ++} ++ ++ ++ ++ ++} ++ ++ ++ +diff -Naur ./source/common/arm64/arm64-utils.h ../x265_apple_patch/source/common/arm64/arm64-utils.h +--- ./source/common/arm64/arm64-utils.h 1970-01-01 01:00:00.000000000 +0100 ++++ ../x265_apple_patch/source/common/arm64/arm64-utils.h 2021-05-08 13:08:01.000000000 +0100 +@@ -0,0 +1,14 @@ ++#ifndef __ARM64_UTILS_H__ ++#define __ARM64_UTILS_H__ ++ ++ ++namespace X265_NS { ++void transpose8x8(uint8_t* dst, const uint8_t* src, intptr_t dstride, intptr_t sstride); ++void transpose16x16(uint8_t* dst, const uint8_t* src, intptr_t dstride, intptr_t sstride); ++void transpose32x32(uint8_t* dst, const uint8_t* src, intptr_t dstride, intptr_t sstride); ++void transpose8x8(uint16_t* dst, const uint16_t* src, intptr_t dstride, intptr_t sstride); ++void transpose16x16(uint16_t* dst, const uint16_t* src, intptr_t dstride, intptr_t sstride); ++void transpose32x32(uint16_t* dst, const uint16_t* src, intptr_t dstride, intptr_t sstride); ++} ++ ++#endif +diff -Naur ./source/common/arm64/asm-primitives.cpp ../x265_apple_patch/source/common/arm64/asm-primitives.cpp +--- ./source/common/arm64/asm-primitives.cpp 1970-01-01 01:00:00.000000000 +0100 ++++ ../x265_apple_patch/source/common/arm64/asm-primitives.cpp 2021-05-08 13:08:01.000000000 +0100 +@@ -0,0 +1,53 @@ ++/***************************************************************************** ++ * Copyright (C) 2013-2017 MulticoreWare, Inc ++ * ++ * Authors: Steve Borho ++ * Praveen Kumar Tiwari ++ * Min Chen ++ * Dnyaneshwar Gorade ++ * ++ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA. ++ * ++ * This program is also available under a commercial proprietary license. ++ * For more information, contact us at license @ x265.com. ++ *****************************************************************************/ ++ ++#include "common.h" ++#include "primitives.h" ++#include "x265.h" ++#include "cpu.h" ++ ++#include "pixel-prim.h" ++#include "filter-prim.h" ++#include "dct-prim.h" ++#include "loopfilter-prim.h" ++#include "intrapred-prim.h" ++ ++namespace X265_NS { ++// private x265 namespace ++ ++void setupAssemblyPrimitives(EncoderPrimitives &p, int cpuMask) ++{ ++ if (cpuMask & X265_CPU_NEON) ++ { ++ setupPixelPrimitives_neon(p); ++ setupFilterPrimitives_neon(p); ++ setupDCTPrimitives_neon(p); ++ setupLoopFilterPrimitives_neon(p); ++ setupIntraPrimitives_neon(p); ++ } ++} ++ ++} // namespace X265_NS +diff -Naur ./source/common/arm64/dct-prim.cpp ../x265_apple_patch/source/common/arm64/dct-prim.cpp +--- ./source/common/arm64/dct-prim.cpp 1970-01-01 01:00:00.000000000 +0100 ++++ ../x265_apple_patch/source/common/arm64/dct-prim.cpp 2021-05-08 13:08:01.000000000 +0100 +@@ -0,0 +1,933 @@ ++#include "dct-prim.h" ++ ++ ++#if HAVE_NEON ++ ++#include ++ ++ ++namespace { ++using namespace X265_NS; ++ ++ ++static int16x8_t rev16(const int16x8_t a) ++{ ++ static const int8x16_t tbl = {14,15,12,13,10,11,8,9,6,7,4,5,2,3,0,1}; ++ return vqtbx1q_u8(a,a,tbl); ++} ++ ++static int32x4_t rev32(const int32x4_t a) ++{ ++ static const int8x16_t tbl = {12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3}; ++ return vqtbx1q_u8(a,a,tbl); ++} ++ ++static void transpose_4x4x16(int16x4_t& x0,int16x4_t& x1,int16x4_t& x2,int16x4_t& x3) ++{ ++ int16x4_t s0,s1,s2,s3; ++ s0 = vtrn1_s32(x0,x2); ++ s1 = vtrn1_s32(x1,x3); ++ s2 = vtrn2_s32(x0,x2); ++ s3 = vtrn2_s32(x1,x3); ++ ++ x0 = vtrn1_s16(s0,s1); ++ x1 = vtrn2_s16(s0,s1); ++ x2 = vtrn1_s16(s2,s3); ++ x3 = vtrn2_s16(s2,s3); ++} ++ ++ ++ ++static int scanPosLast_opt(const uint16_t *scan, const coeff_t *coeff, uint16_t *coeffSign, uint16_t *coeffFlag, uint8_t *coeffNum, int numSig, const uint16_t* /*scanCG4x4*/, const int /*trSize*/) ++{ ++ ++ // This is an optimized function for scanPosLast, which removes the rmw dependency, once integrated into mainline x265, should replace reference implementation ++ // For clarity, left the original reference code in comments ++ int scanPosLast = 0; ++ ++ uint16_t cSign = 0; ++ uint16_t cFlag = 0; ++ uint8_t cNum = 0; ++ ++ uint32_t prevcgIdx = 0; ++ do ++ { ++ const uint32_t cgIdx = (uint32_t)scanPosLast >> MLS_CG_SIZE; ++ ++ const uint32_t posLast = scan[scanPosLast]; ++ ++ const int curCoeff = coeff[posLast]; ++ const uint32_t isNZCoeff = (curCoeff != 0); ++ /* ++ NOTE: the new algorithm is complicated, so I keep reference code here ++ uint32_t posy = posLast >> log2TrSize; ++ uint32_t posx = posLast - (posy << log2TrSize); ++ uint32_t blkIdx0 = ((posy >> MLS_CG_LOG2_SIZE) << codingParameters.log2TrSizeCG) + (posx >> MLS_CG_LOG2_SIZE); ++ const uint32_t blkIdx = ((posLast >> (2 * MLS_CG_LOG2_SIZE)) & ~maskPosXY) + ((posLast >> MLS_CG_LOG2_SIZE) & maskPosXY); ++ sigCoeffGroupFlag64 |= ((uint64_t)isNZCoeff << blkIdx); ++ */ ++ ++ // get L1 sig map ++ numSig -= isNZCoeff; ++ ++ if (scanPosLast % (1< 0); ++ ++ coeffSign[prevcgIdx] = cSign; ++ coeffFlag[prevcgIdx] = cFlag; ++ coeffNum[prevcgIdx] = cNum; ++ return scanPosLast - 1; ++} ++ ++ ++#if (MLS_CG_SIZE == 4) ++template ++static void nonPsyRdoQuant_neon(int16_t *m_resiDctCoeff, int64_t *costUncoded, int64_t *totalUncodedCost, int64_t *totalRdCost, uint32_t blkPos) ++{ ++ const int transformShift = MAX_TR_DYNAMIC_RANGE - X265_DEPTH - log2TrSize; /* Represents scaling through forward transform */ ++ const int scaleBits = SCALE_BITS - 2 * transformShift; ++ const uint32_t trSize = 1 << log2TrSize; ++ ++ int64x2_t vcost_sum_0 = vdupq_n_s64(0); ++ int64x2_t vcost_sum_1 = vdupq_n_s64(0); ++ for (int y = 0; y < MLS_CG_SIZE; y++) ++ { ++ int16x4_t in = *(int16x4_t *)&m_resiDctCoeff[blkPos]; ++ int32x4_t mul = vmull_s16(in,in); ++ int64x2_t cost0, cost1; ++ cost0 = vshll_n_s32(vget_low_s32(mul),scaleBits); ++ cost1 = vshll_high_n_s32(mul,scaleBits); ++ *(int64x2_t *)&costUncoded[blkPos+0] = cost0; ++ *(int64x2_t *)&costUncoded[blkPos+2] = cost1; ++ vcost_sum_0 = vaddq_s64(vcost_sum_0,cost0); ++ vcost_sum_1 = vaddq_s64(vcost_sum_1,cost1); ++ blkPos += trSize; ++ } ++ int64_t sum = vaddvq_s64(vaddq_s64(vcost_sum_0,vcost_sum_1)); ++ *totalUncodedCost += sum; ++ *totalRdCost += sum; ++} ++ ++template ++static void psyRdoQuant_neon(int16_t *m_resiDctCoeff, int16_t *m_fencDctCoeff, int64_t *costUncoded, int64_t *totalUncodedCost, int64_t *totalRdCost, int64_t *psyScale, uint32_t blkPos) ++{ ++ const int transformShift = MAX_TR_DYNAMIC_RANGE - X265_DEPTH - log2TrSize; /* Represents scaling through forward transform */ ++ const int scaleBits = SCALE_BITS - 2 * transformShift; ++ const uint32_t trSize = 1 << log2TrSize; ++ //using preprocessor to bypass clang bug ++ const int max = X265_MAX(0, (2 * transformShift + 1)); ++ ++ int64x2_t vcost_sum_0 = vdupq_n_s64(0); ++ int64x2_t vcost_sum_1 = vdupq_n_s64(0); ++ int32x4_t vpsy = vdupq_n_s32(*psyScale); ++ for (int y = 0; y < MLS_CG_SIZE; y++) ++ { ++ int32x4_t signCoef = vmovl_s16(*(int16x4_t *)&m_resiDctCoeff[blkPos]); ++ int32x4_t predictedCoef = vsubq_s32(vmovl_s16(*(int16x4_t *)&m_fencDctCoeff[blkPos]),signCoef); ++ int64x2_t cost0, cost1; ++ cost0 = vmull_s32(vget_low_s32(signCoef),vget_low_s32(signCoef)); ++ cost1 = vmull_high_s32(signCoef,signCoef); ++ cost0 = vshlq_n_s64(cost0,scaleBits); ++ cost1 = vshlq_n_s64(cost1,scaleBits); ++ int64x2_t neg0 = vmull_s32(vget_low_s32(predictedCoef),vget_low_s32(vpsy)); ++ int64x2_t neg1 = vmull_high_s32(predictedCoef,vpsy); ++ if (max > 0) { ++ int64x2_t shift = vdupq_n_s64(-max); ++ neg0 = vshlq_s64(neg0,shift); ++ neg1 = vshlq_s64(neg1,shift); ++ } ++ cost0 = vsubq_s64(cost0,neg0); ++ cost1 = vsubq_s64(cost1,neg1); ++ *(int64x2_t *)&costUncoded[blkPos+0] = cost0; ++ *(int64x2_t *)&costUncoded[blkPos+2] = cost1; ++ vcost_sum_0 = vaddq_s64(vcost_sum_0,cost0); ++ vcost_sum_1 = vaddq_s64(vcost_sum_1,cost1); ++ ++ blkPos += trSize; ++ } ++ int64_t sum = vaddvq_s64(vaddq_s64(vcost_sum_0,vcost_sum_1)); ++ *totalUncodedCost += sum; ++ *totalRdCost += sum; ++} ++ ++#else ++ #error "MLS_CG_SIZE must be 4 for neon version" ++#endif ++ ++ ++ ++template ++int count_nonzero_neon(const int16_t* quantCoeff) ++{ ++ X265_CHECK(((intptr_t)quantCoeff & 15) == 0, "quant buffer not aligned\n"); ++ int count = 0; ++ int16x8_t vcount = vdupq_n_s16(0); ++ const int numCoeff = trSize * trSize; ++ int i = 0; ++ for (; (i + 8) <= numCoeff; i+=8) ++ { ++ int16x8_t in = *(int16x8_t*)&quantCoeff[i]; ++ vcount = vaddq_s16(vcount,vtstq_s16(in,in)); ++ } ++ for (; i < numCoeff; i++) ++ { ++ count += quantCoeff[i] != 0; ++ } ++ ++ return count - vaddvq_s16(vcount); ++} ++ ++template ++uint32_t copy_count_neon(int16_t* coeff, const int16_t* residual, intptr_t resiStride) ++{ ++ uint32_t numSig = 0; ++ int16x8_t vcount = vdupq_n_s16(0); ++ for (int k = 0; k < trSize; k++) ++ { ++ int j = 0; ++ for (; (j + 8) <= trSize; j+=8) ++ { ++ int16x8_t in = *(int16x8_t*)&residual[j]; ++ *(int16x8_t*)&coeff[j] = in; ++ vcount = vaddq_s16(vcount,vtstq_s16(in,in)); ++ } ++ for (; j < trSize; j++) ++ { ++ coeff[j] = residual[j]; ++ numSig += (residual[j] != 0); ++ } ++ residual += resiStride; ++ coeff += trSize; ++ } ++ ++ return numSig - vaddvq_s16(vcount); ++} ++ ++ ++static void partialButterfly16(const int16_t* src, int16_t* dst, int shift, int line) ++{ ++ int j, k; ++ int32x4_t E[2], O[2]; ++ int32x4_t EE, EO; ++ int32x2_t EEE, EEO; ++ const int add = 1 << (shift - 1); ++ const int32x4_t _vadd = {add,0}; ++ ++ for (j = 0; j < line; j++) ++ { ++ int16x8_t in0 = *(int16x8_t *)src; ++ int16x8_t in1 = rev16(*(int16x8_t *)&src[8]); ++ ++ E[0] = vaddl_s16(vget_low_s16(in0),vget_low_s16(in1)); ++ O[0] = vsubl_s16(vget_low_s16(in0),vget_low_s16(in1)); ++ E[1] = vaddl_high_s16(in0,in1); ++ O[1] = vsubl_high_s16(in0,in1); ++ ++ for (k = 1; k < 16; k += 2) ++ { ++ int32x4_t c0 = vmovl_s16(*(int16x4_t *)&g_t16[k][0]); ++ int32x4_t c1 = vmovl_s16(*(int16x4_t *)&g_t16[k][4]); ++ ++ int32x4_t res = _vadd; ++ res = vmlaq_s32(res,c0,O[0]); ++ res = vmlaq_s32(res,c1,O[1]); ++ dst[k * line] = (int16_t)(vaddvq_s32(res) >> shift); ++ } ++ ++ /* EE and EO */ ++ EE = vaddq_s32(E[0],rev32(E[1])); ++ EO = vsubq_s32(E[0],rev32(E[1])); ++ ++ for (k = 2; k < 16; k += 4) ++ { ++ int32x4_t c0 = vmovl_s16(*(int16x4_t *)&g_t16[k][0]); ++ int32x4_t res = _vadd; ++ res = vmlaq_s32(res,c0,EO); ++ dst[k * line] = (int16_t)(vaddvq_s32(res) >> shift); ++ } ++ ++ /* EEE and EEO */ ++ EEE[0] = EE[0] + EE[3]; ++ EEO[0] = EE[0] - EE[3]; ++ EEE[1] = EE[1] + EE[2]; ++ EEO[1] = EE[1] - EE[2]; ++ ++ dst[0] = (int16_t)((g_t16[0][0] * EEE[0] + g_t16[0][1] * EEE[1] + add) >> shift); ++ dst[8 * line] = (int16_t)((g_t16[8][0] * EEE[0] + g_t16[8][1] * EEE[1] + add) >> shift); ++ dst[4 * line] = (int16_t)((g_t16[4][0] * EEO[0] + g_t16[4][1] * EEO[1] + add) >> shift); ++ dst[12 * line] = (int16_t)((g_t16[12][0] * EEO[0] + g_t16[12][1] * EEO[1] + add) >> shift); ++ ++ ++ src += 16; ++ dst++; ++ } ++} ++ ++ ++static void partialButterfly32(const int16_t* src, int16_t* dst, int shift, int line) ++{ ++ int j, k; ++ const int add = 1 << (shift - 1); ++ ++ ++ for (j = 0; j < line; j++) ++ { ++ int32x4_t VE[4], VO0,VO1,VO2,VO3; ++ int32x4_t VEE[2], VEO[2]; ++ int32x4_t VEEE, VEEO; ++ int EEEE[2], EEEO[2]; ++ ++ int16x8x4_t inputs; ++ inputs = *(int16x8x4_t *)&src[0]; ++ int16x8x4_t in_rev; ++ ++ in_rev.val[1] = rev16(inputs.val[2]); ++ in_rev.val[0] = rev16(inputs.val[3]); ++ ++ VE[0] = vaddl_s16(vget_low_s16(inputs.val[0]),vget_low_s16(in_rev.val[0])); ++ VE[1] = vaddl_high_s16(inputs.val[0],in_rev.val[0]); ++ VO0 = vsubl_s16(vget_low_s16(inputs.val[0]),vget_low_s16(in_rev.val[0])); ++ VO1 = vsubl_high_s16(inputs.val[0],in_rev.val[0]); ++ VE[2] = vaddl_s16(vget_low_s16(inputs.val[1]),vget_low_s16(in_rev.val[1])); ++ VE[3] = vaddl_high_s16(inputs.val[1],in_rev.val[1]); ++ VO2 = vsubl_s16(vget_low_s16(inputs.val[1]),vget_low_s16(in_rev.val[1])); ++ VO3 = vsubl_high_s16(inputs.val[1],in_rev.val[1]); ++ ++ for (k = 1; k < 32; k += 2) ++ { ++ int32x4_t c0 = vmovl_s16(*(int16x4_t *)&g_t32[k][0]); ++ int32x4_t c1 = vmovl_s16(*(int16x4_t *)&g_t32[k][4]); ++ int32x4_t c2 = vmovl_s16(*(int16x4_t *)&g_t32[k][8]); ++ int32x4_t c3 = vmovl_s16(*(int16x4_t *)&g_t32[k][12]); ++ int32x4_t s = vmulq_s32(c0,VO0); ++ s = vmlaq_s32(s,c1,VO1); ++ s = vmlaq_s32(s,c2,VO2); ++ s = vmlaq_s32(s,c3,VO3); ++ ++ dst[k * line] = (int16_t)((vaddvq_s32(s) + add) >> shift); ++ ++ } ++ ++ int32x4_t rev_VE[2]; ++ ++ ++ rev_VE[0] = rev32(VE[3]); ++ rev_VE[1] = rev32(VE[2]); ++ ++ /* EE and EO */ ++ for (k = 0; k < 2; k++) ++ { ++ VEE[k] = vaddq_s32(VE[k],rev_VE[k]); ++ VEO[k] = vsubq_s32(VE[k],rev_VE[k]); ++ } ++ for (k = 2; k < 32; k += 4) ++ { ++ int32x4_t c0 = vmovl_s16(*(int16x4_t *)&g_t32[k][0]); ++ int32x4_t c1 = vmovl_s16(*(int16x4_t *)&g_t32[k][4]); ++ int32x4_t s = vmulq_s32(c0,VEO[0]); ++ s = vmlaq_s32(s,c1,VEO[1]); ++ ++ dst[k * line] = (int16_t)((vaddvq_s32(s) + add) >> shift); ++ ++ } ++ ++ int32x4_t tmp = rev32(VEE[1]); ++ VEEE = vaddq_s32(VEE[0],tmp); ++ VEEO = vsubq_s32(VEE[0],tmp); ++ for (k = 4; k < 32; k += 8) ++ { ++ int32x4_t c = vmovl_s16(*(int16x4_t *)&g_t32[k][0]); ++ int32x4_t s = vmulq_s32(c,VEEO); ++ ++ dst[k * line] = (int16_t)((vaddvq_s32(s) + add) >> shift); ++ } ++ ++ /* EEEE and EEEO */ ++ EEEE[0] = VEEE[0] + VEEE[3]; ++ EEEO[0] = VEEE[0] - VEEE[3]; ++ EEEE[1] = VEEE[1] + VEEE[2]; ++ EEEO[1] = VEEE[1] - VEEE[2]; ++ ++ dst[0] = (int16_t)((g_t32[0][0] * EEEE[0] + g_t32[0][1] * EEEE[1] + add) >> shift); ++ dst[16 * line] = (int16_t)((g_t32[16][0] * EEEE[0] + g_t32[16][1] * EEEE[1] + add) >> shift); ++ dst[8 * line] = (int16_t)((g_t32[8][0] * EEEO[0] + g_t32[8][1] * EEEO[1] + add) >> shift); ++ dst[24 * line] = (int16_t)((g_t32[24][0] * EEEO[0] + g_t32[24][1] * EEEO[1] + add) >> shift); ++ ++ ++ ++ src += 32; ++ dst++; ++ } ++} ++ ++static void partialButterfly8(const int16_t* src, int16_t* dst, int shift, int line) ++{ ++ int j, k; ++ int E[4], O[4]; ++ int EE[2], EO[2]; ++ int add = 1 << (shift - 1); ++ ++ for (j = 0; j < line; j++) ++ { ++ /* E and O*/ ++ for (k = 0; k < 4; k++) ++ { ++ E[k] = src[k] + src[7 - k]; ++ O[k] = src[k] - src[7 - k]; ++ } ++ ++ /* EE and EO */ ++ EE[0] = E[0] + E[3]; ++ EO[0] = E[0] - E[3]; ++ EE[1] = E[1] + E[2]; ++ EO[1] = E[1] - E[2]; ++ ++ dst[0] = (int16_t)((g_t8[0][0] * EE[0] + g_t8[0][1] * EE[1] + add) >> shift); ++ dst[4 * line] = (int16_t)((g_t8[4][0] * EE[0] + g_t8[4][1] * EE[1] + add) >> shift); ++ dst[2 * line] = (int16_t)((g_t8[2][0] * EO[0] + g_t8[2][1] * EO[1] + add) >> shift); ++ dst[6 * line] = (int16_t)((g_t8[6][0] * EO[0] + g_t8[6][1] * EO[1] + add) >> shift); ++ ++ dst[line] = (int16_t)((g_t8[1][0] * O[0] + g_t8[1][1] * O[1] + g_t8[1][2] * O[2] + g_t8[1][3] * O[3] + add) >> shift); ++ dst[3 * line] = (int16_t)((g_t8[3][0] * O[0] + g_t8[3][1] * O[1] + g_t8[3][2] * O[2] + g_t8[3][3] * O[3] + add) >> shift); ++ dst[5 * line] = (int16_t)((g_t8[5][0] * O[0] + g_t8[5][1] * O[1] + g_t8[5][2] * O[2] + g_t8[5][3] * O[3] + add) >> shift); ++ dst[7 * line] = (int16_t)((g_t8[7][0] * O[0] + g_t8[7][1] * O[1] + g_t8[7][2] * O[2] + g_t8[7][3] * O[3] + add) >> shift); ++ ++ src += 8; ++ dst++; ++ } ++} ++ ++static void partialButterflyInverse4(const int16_t* src, int16_t* dst, int shift, int line) ++{ ++ int j; ++ int E[2], O[2]; ++ int add = 1 << (shift - 1); ++ ++ for (j = 0; j < line; j++) ++ { ++ /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ ++ O[0] = g_t4[1][0] * src[line] + g_t4[3][0] * src[3 * line]; ++ O[1] = g_t4[1][1] * src[line] + g_t4[3][1] * src[3 * line]; ++ E[0] = g_t4[0][0] * src[0] + g_t4[2][0] * src[2 * line]; ++ E[1] = g_t4[0][1] * src[0] + g_t4[2][1] * src[2 * line]; ++ ++ /* Combining even and odd terms at each hierarchy levels to calculate the final spatial domain vector */ ++ dst[0] = (int16_t)(x265_clip3(-32768, 32767, (E[0] + O[0] + add) >> shift)); ++ dst[1] = (int16_t)(x265_clip3(-32768, 32767, (E[1] + O[1] + add) >> shift)); ++ dst[2] = (int16_t)(x265_clip3(-32768, 32767, (E[1] - O[1] + add) >> shift)); ++ dst[3] = (int16_t)(x265_clip3(-32768, 32767, (E[0] - O[0] + add) >> shift)); ++ ++ src++; ++ dst += 4; ++ } ++} ++ ++ ++ ++static void partialButterflyInverse16_neon(const int16_t* src, int16_t* orig_dst, int shift, int line) ++{ ++#define FMAK(x,l) s[l] = vmlal_lane_s16(s[l],*(int16x4_t*)&src[(x)*line],*(int16x4_t *)&g_t16[x][k],l) ++#define MULK(x,l) vmull_lane_s16(*(int16x4_t*)&src[x*line],*(int16x4_t *)&g_t16[x][k],l); ++#define ODD3_15(k) FMAK(3,k);FMAK(5,k);FMAK(7,k);FMAK(9,k);FMAK(11,k);FMAK(13,k);FMAK(15,k); ++#define EVEN6_14_STEP4(k) FMAK(6,k);FMAK(10,k);FMAK(14,k); ++ ++ ++ int j, k; ++ int32x4_t E[8], O[8]; ++ int32x4_t EE[4], EO[4]; ++ int32x4_t EEE[2], EEO[2]; ++ const int add = 1 << (shift - 1); ++ ++ ++#pragma unroll(4) ++ for (j = 0; j < line; j+=4) ++ { ++ /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ ++ ++#pragma unroll(2) ++ for (k=0;k<2;k++) { ++ int32x4_t s; ++ s = vmull_s16(vdup_n_s16(g_t16[4][k]),*(int16x4_t*)&src[4*line]);; ++ EEO[k] = vmlal_s16(s,vdup_n_s16(g_t16[12][k]),*(int16x4_t*)&src[(12)*line]); ++ s = vmull_s16(vdup_n_s16(g_t16[0][k]),*(int16x4_t*)&src[0*line]);; ++ EEE[k] = vmlal_s16(s,vdup_n_s16(g_t16[8][k]),*(int16x4_t*)&src[(8)*line]); ++ } ++ ++ /* Combining even and odd terms at each hierarchy levels to calculate the final spatial domain vector */ ++ EE[0] = vaddq_s32(EEE[0] , EEO[0]); ++ EE[2] = vsubq_s32(EEE[1] , EEO[1]); ++ EE[1] = vaddq_s32(EEE[1] , EEO[1]); ++ EE[3] = vsubq_s32(EEE[0] , EEO[0]); ++ ++ ++#pragma unroll(1) ++ for (k = 0; k < 4; k+=4) ++ { ++ int32x4_t s[4]; ++ s[0] = MULK(2,0); ++ s[1] = MULK(2,1); ++ s[2] = MULK(2,2); ++ s[3] = MULK(2,3); ++ ++ EVEN6_14_STEP4(0); ++ EVEN6_14_STEP4(1); ++ EVEN6_14_STEP4(2); ++ EVEN6_14_STEP4(3); ++ ++ EO[k] = s[0]; ++ EO[k+1] = s[1]; ++ EO[k+2] = s[2]; ++ EO[k+3] = s[3]; ++ } ++ ++ ++ ++ static const int32x4_t min = vdupq_n_s32(-32768); ++ static const int32x4_t max = vdupq_n_s32(32767); ++ const int32x4_t minus_shift = vdupq_n_s32(-shift); ++ ++#pragma unroll(4) ++ for (k = 0; k < 4; k++) ++ { ++ E[k] = vaddq_s32(EE[k] , EO[k]); ++ E[k + 4] = vsubq_s32(EE[3 - k] , EO[3 - k]); ++ } ++ ++#pragma unroll(2) ++ for (k = 0; k < 8; k+=4) ++ { ++ int32x4_t s[4]; ++ s[0] = MULK(1,0); ++ s[1] = MULK(1,1); ++ s[2] = MULK(1,2); ++ s[3] = MULK(1,3); ++ ODD3_15(0); ++ ODD3_15(1); ++ ODD3_15(2); ++ ODD3_15(3); ++ O[k] = s[0]; ++ O[k+1] = s[1]; ++ O[k+2] = s[2]; ++ O[k+3] = s[3]; ++ int32x4_t t; ++ int16x4_t x0,x1,x2,x3; ++ ++ E[k] = vaddq_s32(vdupq_n_s32(add),E[k]); ++ t = vaddq_s32(E[k],O[k]); ++ t = vshlq_s32(t,minus_shift); ++ t = vmaxq_s32(t,min); ++ t = vminq_s32(t,max); ++ x0 = vmovn_s32(t); ++ ++ E[k+1] = vaddq_s32(vdupq_n_s32(add),E[k+1]); ++ t = vaddq_s32(E[k+1],O[k+1]); ++ t = vshlq_s32(t,minus_shift); ++ t = vmaxq_s32(t,min); ++ t = vminq_s32(t,max); ++ x1 = vmovn_s32(t); ++ ++ E[k+2] = vaddq_s32(vdupq_n_s32(add),E[k+2]); ++ t = vaddq_s32(E[k+2],O[k+2]); ++ t = vshlq_s32(t,minus_shift); ++ t = vmaxq_s32(t,min); ++ t = vminq_s32(t,max); ++ x2 = vmovn_s32(t); ++ ++ E[k+3] = vaddq_s32(vdupq_n_s32(add),E[k+3]); ++ t = vaddq_s32(E[k+3],O[k+3]); ++ t = vshlq_s32(t,minus_shift); ++ t = vmaxq_s32(t,min); ++ t = vminq_s32(t,max); ++ x3 = vmovn_s32(t); ++ ++ transpose_4x4x16(x0,x1,x2,x3); ++ *(int16x4_t*)&orig_dst[0*16+k] = x0; ++ *(int16x4_t*)&orig_dst[1*16+k] = x1; ++ *(int16x4_t*)&orig_dst[2*16+k] = x2; ++ *(int16x4_t*)&orig_dst[3*16+k] = x3; ++ } ++ ++ ++#pragma unroll(2) ++ for (k = 0; k < 8; k+=4) ++ { ++ int32x4_t t; ++ int16x4_t x0,x1,x2,x3; ++ ++ t = vsubq_s32(E[7-k],O[7-k]); ++ t = vshlq_s32(t,minus_shift); ++ t = vmaxq_s32(t,min); ++ t = vminq_s32(t,max); ++ x0 = vmovn_s32(t); ++ ++ t = vsubq_s32(E[6-k],O[6-k]); ++ t = vshlq_s32(t,minus_shift); ++ t = vmaxq_s32(t,min); ++ t = vminq_s32(t,max); ++ x1 = vmovn_s32(t); ++ ++ t = vsubq_s32(E[5-k],O[5-k]); ++ ++ t = vshlq_s32(t,minus_shift); ++ t = vmaxq_s32(t,min); ++ t = vminq_s32(t,max); ++ x2 = vmovn_s32(t); ++ ++ t = vsubq_s32(E[4-k],O[4-k]); ++ t = vshlq_s32(t,minus_shift); ++ t = vmaxq_s32(t,min); ++ t = vminq_s32(t,max); ++ x3 = vmovn_s32(t); ++ ++ transpose_4x4x16(x0,x1,x2,x3); ++ *(int16x4_t*)&orig_dst[0*16+k+8] = x0; ++ *(int16x4_t*)&orig_dst[1*16+k+8] = x1; ++ *(int16x4_t*)&orig_dst[2*16+k+8] = x2; ++ *(int16x4_t*)&orig_dst[3*16+k+8] = x3; ++ } ++ orig_dst += 4*16; ++ src+=4; ++ } ++ ++#undef MUL ++#undef FMA ++#undef FMAK ++#undef MULK ++#undef ODD3_15 ++#undef EVEN6_14_STEP4 ++ ++ ++} ++ ++ ++ ++static void partialButterflyInverse32_neon(const int16_t* src, int16_t* orig_dst, int shift, int line) ++{ ++#define MUL(x) vmull_s16(vdup_n_s16(g_t32[x][k]),*(int16x4_t*)&src[x*line]); ++#define FMA(x) s = vmlal_s16(s,vdup_n_s16(g_t32[x][k]),*(int16x4_t*)&src[(x)*line]) ++#define FMAK(x,l) s[l] = vmlal_lane_s16(s[l],*(int16x4_t*)&src[(x)*line],*(int16x4_t *)&g_t32[x][k],l) ++#define MULK(x,l) vmull_lane_s16(*(int16x4_t*)&src[x*line],*(int16x4_t *)&g_t32[x][k],l); ++#define ODD31(k) FMAK(3,k);FMAK(5,k);FMAK(7,k);FMAK(9,k);FMAK(11,k);FMAK(13,k);FMAK(15,k);FMAK(17,k);FMAK(19,k);FMAK(21,k);FMAK(23,k);FMAK(25,k);FMAK(27,k);FMAK(29,k);FMAK(31,k); ++ ++#define ODD15(k) FMAK(6,k);FMAK(10,k);FMAK(14,k);FMAK(18,k);FMAK(22,k);FMAK(26,k);FMAK(30,k); ++#define ODD7(k) FMAK(12,k);FMAK(20,k);FMAK(28,k); ++ ++ ++ int j, k; ++ int32x4_t E[16], O[16]; ++ int32x4_t EE[8], EO[8]; ++ int32x4_t EEE[4], EEO[4]; ++ int32x4_t EEEE[2], EEEO[2]; ++ int16x4_t dst[32]; ++ int add = 1 << (shift - 1); ++ ++#pragma unroll (8) ++ for (j = 0; j < line; j+=4) ++ { ++#pragma unroll (4) ++ for (k = 0; k < 16; k+=4) ++ { ++ int32x4_t s[4]; ++ s[0] = MULK(1,0); ++ s[1] = MULK(1,1); ++ s[2] = MULK(1,2); ++ s[3] = MULK(1,3); ++ ODD31(0); ++ ODD31(1); ++ ODD31(2); ++ ODD31(3); ++ O[k] = s[0]; ++ O[k+1] = s[1]; ++ O[k+2] = s[2]; ++ O[k+3] = s[3]; ++ ++ ++ } ++ ++ ++#pragma unroll (2) ++ for (k = 0; k < 8; k+=4) ++ { ++ int32x4_t s[4]; ++ s[0] = MULK(2,0); ++ s[1] = MULK(2,1); ++ s[2] = MULK(2,2); ++ s[3] = MULK(2,3); ++ ++ ODD15(0); ++ ODD15(1); ++ ODD15(2); ++ ODD15(3); ++ ++ EO[k] = s[0]; ++ EO[k+1] = s[1]; ++ EO[k+2] = s[2]; ++ EO[k+3] = s[3]; ++ } ++ ++ ++ for (k = 0; k < 4; k+=4) ++ { ++ int32x4_t s[4]; ++ s[0] = MULK(4,0); ++ s[1] = MULK(4,1); ++ s[2] = MULK(4,2); ++ s[3] = MULK(4,3); ++ ++ ODD7(0); ++ ODD7(1); ++ ODD7(2); ++ ODD7(3); ++ ++ EEO[k] = s[0]; ++ EEO[k+1] = s[1]; ++ EEO[k+2] = s[2]; ++ EEO[k+3] = s[3]; ++ } ++ ++#pragma unroll (2) ++ for (k=0;k<2;k++) { ++ int32x4_t s; ++ s = MUL(8); ++ EEEO[k] = FMA(24); ++ s = MUL(0); ++ EEEE[k] = FMA(16); ++ } ++ /* Combining even and odd terms at each hierarchy levels to calculate the final spatial domain vector */ ++ EEE[0] = vaddq_s32(EEEE[0],EEEO[0]); ++ EEE[3] = vsubq_s32(EEEE[0],EEEO[0]); ++ EEE[1] = vaddq_s32(EEEE[1],EEEO[1]); ++ EEE[2] = vsubq_s32(EEEE[1],EEEO[1]); ++ ++#pragma unroll (4) ++ for (k = 0; k < 4; k++) ++ { ++ EE[k] = vaddq_s32(EEE[k],EEO[k]); ++ EE[k + 4] = vsubq_s32((EEE[3 - k]), (EEO[3 - k])); ++ } ++ ++#pragma unroll (8) ++ for (k = 0; k < 8; k++) ++ { ++ E[k] = vaddq_s32(EE[k],EO[k]); ++ E[k + 8] = vsubq_s32((EE[7 - k]),(EO[7 - k])); ++ } ++ ++ static const int32x4_t min = vdupq_n_s32(-32768); ++ static const int32x4_t max = vdupq_n_s32(32767); ++ ++ ++ ++#pragma unroll (16) ++ for (k = 0; k < 16; k++) ++ { ++ int32x4_t adde = vaddq_s32(vdupq_n_s32(add),E[k]); ++ int32x4_t s = vaddq_s32(adde,O[k]); ++ s = vshlq_s32(s,vdupq_n_s32(-shift)); ++ s = vmaxq_s32(s,min); ++ s = vminq_s32(s,max); ++ ++ ++ ++ dst[k] = vmovn_s32(s); ++ adde = vaddq_s32(vdupq_n_s32(add),(E[15-k])); ++ s =vsubq_s32(adde,(O[15-k])); ++ s = vshlq_s32(s,vdupq_n_s32(-shift)); ++ s = vmaxq_s32(s,min); ++ s = vminq_s32(s,max); ++ ++ dst[k+16] = vmovn_s32(s); ++ } ++ ++ ++#pragma unroll (8) ++ for (k = 0; k < 32; k+=4) ++ { ++ int16x4_t x0 = dst[k+0]; ++ int16x4_t x1 = dst[k+1]; ++ int16x4_t x2 = dst[k+2]; ++ int16x4_t x3 = dst[k+3]; ++ transpose_4x4x16(x0,x1,x2,x3); ++ *(int16x4_t*)&orig_dst[0*32+k] = x0; ++ *(int16x4_t*)&orig_dst[1*32+k] = x1; ++ *(int16x4_t*)&orig_dst[2*32+k] = x2; ++ *(int16x4_t*)&orig_dst[3*32+k] = x3; ++ } ++ orig_dst += 4*32; ++ src += 4; ++ } ++#undef MUL ++#undef FMA ++#undef FMAK ++#undef MULK ++#undef ODD31 ++#undef ODD15 ++#undef ODD7 ++ ++} ++ ++ ++static void dct8_neon(const int16_t* src, int16_t* dst, intptr_t srcStride) ++{ ++ const int shift_1st = 2 + X265_DEPTH - 8; ++ const int shift_2nd = 9; ++ ++ ALIGN_VAR_32(int16_t, coef[8 * 8]); ++ ALIGN_VAR_32(int16_t, block[8 * 8]); ++ ++ for (int i = 0; i < 8; i++) ++ { ++ memcpy(&block[i * 8], &src[i * srcStride], 8 * sizeof(int16_t)); ++ } ++ ++ partialButterfly8(block, coef, shift_1st, 8); ++ partialButterfly8(coef, dst, shift_2nd, 8); ++} ++ ++static void dct16_neon(const int16_t* src, int16_t* dst, intptr_t srcStride) ++{ ++ const int shift_1st = 3 + X265_DEPTH - 8; ++ const int shift_2nd = 10; ++ ++ ALIGN_VAR_32(int16_t, coef[16 * 16]); ++ ALIGN_VAR_32(int16_t, block[16 * 16]); ++ ++ for (int i = 0; i < 16; i++) ++ { ++ memcpy(&block[i * 16], &src[i * srcStride], 16 * sizeof(int16_t)); ++ } ++ ++ partialButterfly16(block, coef, shift_1st, 16); ++ partialButterfly16(coef, dst, shift_2nd, 16); ++} ++ ++static void dct32_neon(const int16_t* src, int16_t* dst, intptr_t srcStride) ++{ ++ const int shift_1st = 4 + X265_DEPTH - 8; ++ const int shift_2nd = 11; ++ ++ ALIGN_VAR_32(int16_t, coef[32 * 32]); ++ ALIGN_VAR_32(int16_t, block[32 * 32]); ++ ++ for (int i = 0; i < 32; i++) ++ { ++ memcpy(&block[i * 32], &src[i * srcStride], 32 * sizeof(int16_t)); ++ } ++ ++ partialButterfly32(block, coef, shift_1st, 32); ++ partialButterfly32(coef, dst, shift_2nd, 32); ++} ++ ++static void idct4_neon(const int16_t* src, int16_t* dst, intptr_t dstStride) ++{ ++ const int shift_1st = 7; ++ const int shift_2nd = 12 - (X265_DEPTH - 8); ++ ++ ALIGN_VAR_32(int16_t, coef[4 * 4]); ++ ALIGN_VAR_32(int16_t, block[4 * 4]); ++ ++ partialButterflyInverse4(src, coef, shift_1st, 4); // Forward DST BY FAST ALGORITHM, block input, coef output ++ partialButterflyInverse4(coef, block, shift_2nd, 4); // Forward DST BY FAST ALGORITHM, coef input, coeff output ++ ++ for (int i = 0; i < 4; i++) ++ { ++ memcpy(&dst[i * dstStride], &block[i * 4], 4 * sizeof(int16_t)); ++ } ++} ++ ++static void idct16_neon(const int16_t* src, int16_t* dst, intptr_t dstStride) ++{ ++ const int shift_1st = 7; ++ const int shift_2nd = 12 - (X265_DEPTH - 8); ++ ++ ALIGN_VAR_32(int16_t, coef[16 * 16]); ++ ALIGN_VAR_32(int16_t, block[16 * 16]); ++ ++ partialButterflyInverse16_neon(src, coef, shift_1st, 16); ++ partialButterflyInverse16_neon(coef, block, shift_2nd, 16); ++ ++ for (int i = 0; i < 16; i++) ++ { ++ memcpy(&dst[i * dstStride], &block[i * 16], 16 * sizeof(int16_t)); ++ } ++} ++ ++static void idct32_neon(const int16_t* src, int16_t* dst, intptr_t dstStride) ++{ ++ const int shift_1st = 7; ++ const int shift_2nd = 12 - (X265_DEPTH - 8); ++ ++ ALIGN_VAR_32(int16_t, coef[32 * 32]); ++ ALIGN_VAR_32(int16_t, block[32 * 32]); ++ ++ partialButterflyInverse32_neon(src, coef, shift_1st, 32); ++ partialButterflyInverse32_neon(coef, block, shift_2nd, 32); ++ ++ for (int i = 0; i < 32; i++) ++ { ++ memcpy(&dst[i * dstStride], &block[i * 32], 32 * sizeof(int16_t)); ++ } ++} ++ ++ ++ ++} ++ ++namespace X265_NS { ++// x265 private namespace ++void setupDCTPrimitives_neon(EncoderPrimitives& p) { ++ p.cu[BLOCK_4x4].nonPsyRdoQuant = nonPsyRdoQuant_neon<2>; ++ p.cu[BLOCK_8x8].nonPsyRdoQuant = nonPsyRdoQuant_neon<3>; ++ p.cu[BLOCK_16x16].nonPsyRdoQuant = nonPsyRdoQuant_neon<4>; ++ p.cu[BLOCK_32x32].nonPsyRdoQuant = nonPsyRdoQuant_neon<5>; ++ p.cu[BLOCK_4x4].psyRdoQuant = psyRdoQuant_neon<2>; ++ p.cu[BLOCK_8x8].psyRdoQuant = psyRdoQuant_neon<3>; ++ p.cu[BLOCK_16x16].psyRdoQuant = psyRdoQuant_neon<4>; ++ p.cu[BLOCK_32x32].psyRdoQuant = psyRdoQuant_neon<5>; ++ p.cu[BLOCK_8x8].dct = dct8_neon; ++ p.cu[BLOCK_16x16].dct = dct16_neon; ++ p.cu[BLOCK_32x32].dct = dct32_neon; ++ p.cu[BLOCK_4x4].idct = idct4_neon; ++ p.cu[BLOCK_16x16].idct = idct16_neon; ++ p.cu[BLOCK_32x32].idct = idct32_neon; ++ p.cu[BLOCK_4x4].count_nonzero = count_nonzero_neon<4>; ++ p.cu[BLOCK_8x8].count_nonzero = count_nonzero_neon<8>; ++ p.cu[BLOCK_16x16].count_nonzero = count_nonzero_neon<16>; ++ p.cu[BLOCK_32x32].count_nonzero = count_nonzero_neon<32>; ++ ++ p.cu[BLOCK_4x4].copy_cnt = copy_count_neon<4>; ++ p.cu[BLOCK_8x8].copy_cnt = copy_count_neon<8>; ++ p.cu[BLOCK_16x16].copy_cnt = copy_count_neon<16>; ++ p.cu[BLOCK_32x32].copy_cnt = copy_count_neon<32>; ++ p.cu[BLOCK_4x4].psyRdoQuant_1p = nonPsyRdoQuant_neon<2>; ++ p.cu[BLOCK_4x4].psyRdoQuant_2p = psyRdoQuant_neon<2>; ++ p.cu[BLOCK_8x8].psyRdoQuant_1p = nonPsyRdoQuant_neon<3>; ++ p.cu[BLOCK_8x8].psyRdoQuant_2p = psyRdoQuant_neon<3>; ++ p.cu[BLOCK_16x16].psyRdoQuant_1p = nonPsyRdoQuant_neon<4>; ++ p.cu[BLOCK_16x16].psyRdoQuant_2p = psyRdoQuant_neon<4>; ++ p.cu[BLOCK_32x32].psyRdoQuant_1p = nonPsyRdoQuant_neon<5>; ++ p.cu[BLOCK_32x32].psyRdoQuant_2p = psyRdoQuant_neon<5>; ++ ++ p.scanPosLast =scanPosLast_opt; ++ ++} ++}; ++ ++ ++ ++#endif +diff -Naur ./source/common/arm64/dct-prim.h ../x265_apple_patch/source/common/arm64/dct-prim.h +--- ./source/common/arm64/dct-prim.h 1970-01-01 01:00:00.000000000 +0100 ++++ ../x265_apple_patch/source/common/arm64/dct-prim.h 2021-05-08 13:08:01.000000000 +0100 +@@ -0,0 +1,18 @@ ++#ifndef __DCT_PRIM_NEON_H__ ++#define __DCT_PRIM_NEON_H__ ++ ++ ++#include "common.h" ++#include "primitives.h" ++#include "contexts.h" // costCoeffNxN_c ++#include "threading.h" // CLZ ++ ++namespace X265_NS { ++// x265 private namespace ++void setupDCTPrimitives_neon(EncoderPrimitives& p); ++}; ++ ++ ++ ++#endif ++ +diff -Naur ./source/common/arm64/filter-prim.cpp ../x265_apple_patch/source/common/arm64/filter-prim.cpp +--- ./source/common/arm64/filter-prim.cpp 1970-01-01 01:00:00.000000000 +0100 ++++ ../x265_apple_patch/source/common/arm64/filter-prim.cpp 2021-05-08 13:08:01.000000000 +0100 +@@ -0,0 +1,797 @@ ++ ++#if HAVE_NEON ++ ++#include "filter-prim.h" ++#include ++ ++namespace { ++ ++using namespace X265_NS; ++ ++ ++template ++void filterPixelToShort_neon(const pixel* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride) ++{ ++ const int shift = IF_INTERNAL_PREC - X265_DEPTH; ++ int row, col; ++ const int16x8_t off = vdupq_n_s16(IF_INTERNAL_OFFS); ++ for (row = 0; row < height; row++) ++ { ++ ++ for (col = 0; col < width; col+=8) ++ { ++ int16x8_t in; ++ ++#if HIGH_BIT_DEPTH ++ in = *(int16x8_t *)&src[col]; ++#else ++ in = vmovl_u8(*(uint8x8_t *)&src[col]); ++#endif ++ ++ int16x8_t tmp = vshlq_n_s16(in,shift); ++ tmp = vsubq_s16(tmp,off); ++ *(int16x8_t *)&dst[col] = tmp; ++ ++ } ++ ++ src += srcStride; ++ dst += dstStride; ++ } ++} ++ ++ ++template ++void interp_horiz_pp_neon(const pixel* src, intptr_t srcStride, pixel* dst, intptr_t dstStride, int coeffIdx) ++{ ++ const int16_t* coeff = (N == 4) ? g_chromaFilter[coeffIdx] : g_lumaFilter[coeffIdx]; ++ int headRoom = IF_FILTER_PREC; ++ int offset = (1 << (headRoom - 1)); ++ uint16_t maxVal = (1 << X265_DEPTH) - 1; ++ int cStride = 1; ++ ++ src -= (N / 2 - 1) * cStride; ++ int16x8_t vc; ++ vc = *(int16x8_t *)coeff; ++ int16x4_t low_vc = vget_low_s16(vc); ++ int16x4_t high_vc = vget_high_s16(vc); ++ ++ const int32x4_t voffset = vdupq_n_s32(offset); ++ const int32x4_t vhr = vdupq_n_s32(-headRoom); ++ ++ int row, col; ++ for (row = 0; row < height; row++) ++ { ++ for (col = 0; col < width; col+=8) ++ { ++ int32x4_t vsum1,vsum2; ++ ++ int16x8_t input[N]; ++ ++ for (int i=0;i ++void interp_horiz_ps_neon(const uint16_t * src, intptr_t srcStride, int16_t* dst, intptr_t dstStride, int coeffIdx, int isRowExt) ++{ ++ const int16_t* coeff = (N == 4) ? g_chromaFilter[coeffIdx] : g_lumaFilter[coeffIdx]; ++ const int headRoom = IF_INTERNAL_PREC - X265_DEPTH; ++ const int shift = IF_FILTER_PREC - headRoom; ++ const int offset = (unsigned)-IF_INTERNAL_OFFS << shift; ++ ++ int blkheight = height; ++ src -= N / 2 - 1; ++ ++ if (isRowExt) ++ { ++ src -= (N / 2 - 1) * srcStride; ++ blkheight += N - 1; ++ } ++ int32x4_t vc0 = vmovl_s16(*(int16x4_t *)coeff); ++ int32x4_t vc1; ++ ++ if (N ==8) { ++ vc1 = vmovl_s16(*(int16x4_t *)(coeff + 4)); ++ } ++ ++ const int32x4_t voffset = vdupq_n_s32(offset); ++ const int32x4_t vhr = vdupq_n_s32(-shift); ++ ++ int row, col; ++ for (row = 0; row < blkheight; row++) ++ { ++ for (col = 0; col < width; col+=4) ++ { ++ int32x4_t vsum; ++ ++ int32x4_t input[N]; ++ ++ for (int i=0;i ++void interp_horiz_ps_neon(const uint8_t* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride, int coeffIdx, int isRowExt) ++{ ++ const int16_t* coeff = (N == 4) ? g_chromaFilter[coeffIdx] : g_lumaFilter[coeffIdx]; ++ const int headRoom = IF_INTERNAL_PREC - X265_DEPTH; ++ const int shift = IF_FILTER_PREC - headRoom; ++ const int offset = (unsigned)-IF_INTERNAL_OFFS << shift; ++ ++ int blkheight = height; ++ src -= N / 2 - 1; ++ ++ if (isRowExt) ++ { ++ src -= (N / 2 - 1) * srcStride; ++ blkheight += N - 1; ++ } ++ int16x8_t vc; ++ vc = *(int16x8_t *)coeff; ++ ++ const int16x8_t voffset = vdupq_n_s16(offset); ++ const int16x8_t vhr = vdupq_n_s16(-shift); ++ ++ int row, col; ++ for (row = 0; row < blkheight; row++) ++ { ++ for (col = 0; col < width; col+=8) ++ { ++ int16x8_t vsum; ++ ++ int16x8_t input[N]; ++ ++ for (int i=0;i ++void interp_vert_ss_neon(const int16_t* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride, int coeffIdx) ++{ ++ const int16_t* c = (N == 8 ? g_lumaFilter[coeffIdx] : g_chromaFilter[coeffIdx]); ++ int shift = IF_FILTER_PREC; ++ src -= (N / 2 - 1) * srcStride; ++ int16x8_t vc; ++ vc = *(int16x8_t *)c; ++ int16x4_t low_vc = vget_low_s16(vc); ++ int16x4_t high_vc = vget_high_s16(vc); ++ ++ const int32x4_t vhr = vdupq_n_s32(-shift); ++ ++ int row, col; ++ for (row = 0; row < height; row++) ++ { ++ for (col = 0; col < width; col+=8) ++ { ++ int32x4_t vsum1,vsum2; ++ ++ int16x8_t input[N]; ++ ++ for (int i=0;i ++void interp_vert_pp_neon(const uint16_t* src, intptr_t srcStride, uint16_t* dst, intptr_t dstStride, int coeffIdx) ++{ ++ ++ const int16_t* c = (N == 4) ? g_chromaFilter[coeffIdx] : g_lumaFilter[coeffIdx]; ++ int shift = IF_FILTER_PREC; ++ int offset = 1 << (shift - 1); ++ const uint16_t maxVal = (1 << X265_DEPTH) - 1; ++ ++ src -= (N / 2 - 1) * srcStride; ++ int16x8_t vc; ++ vc = *(int16x8_t *)c; ++ int32x4_t low_vc = vmovl_s16(vget_low_s16(vc)); ++ int32x4_t high_vc = vmovl_s16(vget_high_s16(vc)); ++ ++ const int32x4_t voffset = vdupq_n_s32(offset); ++ const int32x4_t vhr = vdupq_n_s32(-shift); ++ ++ int row, col; ++ for (row = 0; row < height; row++) ++ { ++ for (col = 0; col < width; col+=4) ++ { ++ int32x4_t vsum; ++ ++ int32x4_t input[N]; ++ ++ for (int i=0;i ++void interp_vert_pp_neon(const uint8_t* src, intptr_t srcStride, uint8_t* dst, intptr_t dstStride, int coeffIdx) ++{ ++ ++ const int16_t* c = (N == 4) ? g_chromaFilter[coeffIdx] : g_lumaFilter[coeffIdx]; ++ int shift = IF_FILTER_PREC; ++ int offset = 1 << (shift - 1); ++ const uint16_t maxVal = (1 << X265_DEPTH) - 1; ++ ++ src -= (N / 2 - 1) * srcStride; ++ int16x8_t vc; ++ vc = *(int16x8_t *)c; ++ ++ const int16x8_t voffset = vdupq_n_s16(offset); ++ const int16x8_t vhr = vdupq_n_s16(-shift); ++ ++ int row, col; ++ for (row = 0; row < height; row++) ++ { ++ for (col = 0; col < width; col+=8) ++ { ++ int16x8_t vsum; ++ ++ int16x8_t input[N]; ++ ++ for (int i=0;i ++void interp_vert_ps_neon(const uint16_t* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride, int coeffIdx) ++{ ++ const int16_t* c = (N == 4) ? g_chromaFilter[coeffIdx] : g_lumaFilter[coeffIdx]; ++ int headRoom = IF_INTERNAL_PREC - X265_DEPTH; ++ int shift = IF_FILTER_PREC - headRoom; ++ int offset = (unsigned)-IF_INTERNAL_OFFS << shift; ++ src -= (N / 2 - 1) * srcStride; ++ ++ int16x8_t vc; ++ vc = *(int16x8_t *)c; ++ int32x4_t low_vc = vmovl_s16(vget_low_s16(vc)); ++ int32x4_t high_vc = vmovl_s16(vget_high_s16(vc)); ++ ++ const int32x4_t voffset = vdupq_n_s32(offset); ++ const int32x4_t vhr = vdupq_n_s32(-shift); ++ ++ int row, col; ++ for (row = 0; row < height; row++) ++ { ++ for (col = 0; col < width; col+=4) ++ { ++ int16x8_t vsum; ++ ++ int16x8_t input[N]; ++ ++ for (int i=0;i ++void interp_vert_ps_neon(const uint8_t* src, intptr_t srcStride, int16_t* dst, intptr_t dstStride, int coeffIdx) ++{ ++ const int16_t* c = (N == 4) ? g_chromaFilter[coeffIdx] : g_lumaFilter[coeffIdx]; ++ int headRoom = IF_INTERNAL_PREC - X265_DEPTH; ++ int shift = IF_FILTER_PREC - headRoom; ++ int offset = (unsigned)-IF_INTERNAL_OFFS << shift; ++ src -= (N / 2 - 1) * srcStride; ++ ++ int16x8_t vc; ++ vc = *(int16x8_t *)c; ++ ++ const int16x8_t voffset = vdupq_n_s16(offset); ++ const int16x8_t vhr = vdupq_n_s16(-shift); ++ ++ int row, col; ++ for (row = 0; row < height; row++) ++ { ++ for (col = 0; col < width; col+=8) ++ { ++ int16x8_t vsum; ++ ++ int16x8_t input[N]; ++ ++ for (int i=0;i ++void interp_vert_sp_neon(const int16_t* src, intptr_t srcStride, pixel* dst, intptr_t dstStride, int coeffIdx) ++{ ++ int headRoom = IF_INTERNAL_PREC - X265_DEPTH; ++ int shift = IF_FILTER_PREC + headRoom; ++ int offset = (1 << (shift - 1)) + (IF_INTERNAL_OFFS << IF_FILTER_PREC); ++ uint16_t maxVal = (1 << X265_DEPTH) - 1; ++ const int16_t* coeff = (N == 8 ? g_lumaFilter[coeffIdx] : g_chromaFilter[coeffIdx]); ++ ++ src -= (N / 2 - 1) * srcStride; ++ ++ int16x8_t vc; ++ vc = *(int16x8_t *)coeff; ++ int16x4_t low_vc = vget_low_s16(vc); ++ int16x4_t high_vc = vget_high_s16(vc); ++ ++ const int32x4_t voffset = vdupq_n_s32(offset); ++ const int32x4_t vhr = vdupq_n_s32(-shift); ++ ++ int row, col; ++ for (row = 0; row < height; row++) ++ { ++ for (col = 0; col < width; col+=8) ++ { ++ int32x4_t vsum1,vsum2; ++ ++ int16x8_t input[N]; ++ ++ for (int i=0;i ++void interp_hv_pp_neon(const pixel* src, intptr_t srcStride, pixel* dst, intptr_t dstStride, int idxX, int idxY) ++{ ++ ALIGN_VAR_32(int16_t, immed[width * (height + N - 1)]); ++ ++ interp_horiz_ps_neon(src, srcStride, immed, width, idxX, 1); ++ interp_vert_sp_neon(immed + (N / 2 - 1) * width, width, dst, dstStride, idxY); ++} ++ ++ ++ ++} ++ ++ ++ ++ ++namespace X265_NS { ++ #define CHROMA_420(W, H) \ ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_ ## W ## x ## H].filter_hpp = interp_horiz_pp_neon<4, W, H>; \ ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_ ## W ## x ## H].filter_hps = interp_horiz_ps_neon<4, W, H>; \ ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_ ## W ## x ## H].filter_vpp = interp_vert_pp_neon<4, W, H>; \ ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_ ## W ## x ## H].filter_vps = interp_vert_ps_neon<4, W, H>; \ ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_ ## W ## x ## H].filter_vsp = interp_vert_sp_neon<4, W, H>; \ ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_ ## W ## x ## H].filter_vss = interp_vert_ss_neon<4, W, H>; \ ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_ ## W ## x ## H].p2s[NONALIGNED] = filterPixelToShort_neon;\ ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_ ## W ## x ## H].p2s[ALIGNED] = filterPixelToShort_neon; ++ ++ #define CHROMA_422(W, H) \ ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_ ## W ## x ## H].filter_hpp = interp_horiz_pp_neon<4, W, H>; \ ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_ ## W ## x ## H].filter_hps = interp_horiz_ps_neon<4, W, H>; \ ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_ ## W ## x ## H].filter_vpp = interp_vert_pp_neon<4, W, H>; \ ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_ ## W ## x ## H].filter_vps = interp_vert_ps_neon<4, W, H>; \ ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_ ## W ## x ## H].filter_vsp = interp_vert_sp_neon<4, W, H>; \ ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_ ## W ## x ## H].filter_vss = interp_vert_ss_neon<4, W, H>; \ ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_ ## W ## x ## H].p2s[NONALIGNED] = filterPixelToShort_neon;\ ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_ ## W ## x ## H].p2s[ALIGNED] = filterPixelToShort_neon; ++ ++ #define CHROMA_444(W, H) \ ++ p.chroma[X265_CSP_I444].pu[LUMA_ ## W ## x ## H].filter_hpp = interp_horiz_pp_neon<4, W, H>; \ ++ p.chroma[X265_CSP_I444].pu[LUMA_ ## W ## x ## H].filter_hps = interp_horiz_ps_neon<4, W, H>; \ ++ p.chroma[X265_CSP_I444].pu[LUMA_ ## W ## x ## H].filter_vpp = interp_vert_pp_neon<4, W, H>; \ ++ p.chroma[X265_CSP_I444].pu[LUMA_ ## W ## x ## H].filter_vps = interp_vert_ps_neon<4, W, H>; \ ++ p.chroma[X265_CSP_I444].pu[LUMA_ ## W ## x ## H].filter_vsp = interp_vert_sp_neon<4, W, H>; \ ++ p.chroma[X265_CSP_I444].pu[LUMA_ ## W ## x ## H].filter_vss = interp_vert_ss_neon<4, W, H>; \ ++ p.chroma[X265_CSP_I444].pu[LUMA_ ## W ## x ## H].p2s[NONALIGNED] = filterPixelToShort_neon;\ ++ p.chroma[X265_CSP_I444].pu[LUMA_ ## W ## x ## H].p2s[ALIGNED] = filterPixelToShort_neon; ++ ++ #define LUMA(W, H) \ ++ p.pu[LUMA_ ## W ## x ## H].luma_hpp = interp_horiz_pp_neon<8, W, H>; \ ++ p.pu[LUMA_ ## W ## x ## H].luma_hps = interp_horiz_ps_neon<8, W, H>; \ ++ p.pu[LUMA_ ## W ## x ## H].luma_vpp = interp_vert_pp_neon<8, W, H>; \ ++ p.pu[LUMA_ ## W ## x ## H].luma_vps = interp_vert_ps_neon<8, W, H>; \ ++ p.pu[LUMA_ ## W ## x ## H].luma_vsp = interp_vert_sp_neon<8, W, H>; \ ++ p.pu[LUMA_ ## W ## x ## H].luma_vss = interp_vert_ss_neon<8, W, H>; \ ++ p.pu[LUMA_ ## W ## x ## H].luma_hvpp = interp_hv_pp_neon<8, W, H>; \ ++ p.pu[LUMA_ ## W ## x ## H].convert_p2s[NONALIGNED] = filterPixelToShort_neon;\ ++ p.pu[LUMA_ ## W ## x ## H].convert_p2s[ALIGNED] = filterPixelToShort_neon; ++ ++ ++void setupFilterPrimitives_neon(EncoderPrimitives &p) ++{ ++ ++ // All neon functions assume width of multiple of 8, (2,4,12 variants are not optimized) ++ ++ LUMA(8, 8); ++ LUMA(8, 4); ++ LUMA(16, 16); ++ CHROMA_420(8, 8); ++ LUMA(16, 8); ++ CHROMA_420(8, 4); ++ LUMA(8, 16); ++ LUMA(16, 12); ++ CHROMA_420(8, 6); ++ LUMA(16, 4); ++ CHROMA_420(8, 2); ++ LUMA(32, 32); ++ CHROMA_420(16, 16); ++ LUMA(32, 16); ++ CHROMA_420(16, 8); ++ LUMA(16, 32); ++ CHROMA_420(8, 16); ++ LUMA(32, 24); ++ CHROMA_420(16, 12); ++ LUMA(24, 32); ++ LUMA(32, 8); ++ CHROMA_420(16, 4); ++ LUMA(8, 32); ++ LUMA(64, 64); ++ CHROMA_420(32, 32); ++ LUMA(64, 32); ++ CHROMA_420(32, 16); ++ LUMA(32, 64); ++ CHROMA_420(16, 32); ++ LUMA(64, 48); ++ CHROMA_420(32, 24); ++ LUMA(48, 64); ++ CHROMA_420(24, 32); ++ LUMA(64, 16); ++ CHROMA_420(32, 8); ++ LUMA(16, 64); ++ CHROMA_420(8, 32); ++ CHROMA_422(8, 16); ++ CHROMA_422(8, 8); ++ CHROMA_422(8, 12); ++ CHROMA_422(8, 4); ++ CHROMA_422(16, 32); ++ CHROMA_422(16, 16); ++ CHROMA_422(8, 32); ++ CHROMA_422(16, 24); ++ CHROMA_422(16, 8); ++ CHROMA_422(32, 64); ++ CHROMA_422(32, 32); ++ CHROMA_422(16, 64); ++ CHROMA_422(32, 48); ++ CHROMA_422(24, 64); ++ CHROMA_422(32, 16); ++ CHROMA_422(8, 64); ++ CHROMA_444(8, 8); ++ CHROMA_444(8, 4); ++ CHROMA_444(16, 16); ++ CHROMA_444(16, 8); ++ CHROMA_444(8, 16); ++ CHROMA_444(16, 12); ++ CHROMA_444(16, 4); ++ CHROMA_444(32, 32); ++ CHROMA_444(32, 16); ++ CHROMA_444(16, 32); ++ CHROMA_444(32, 24); ++ CHROMA_444(24, 32); ++ CHROMA_444(32, 8); ++ CHROMA_444(8, 32); ++ CHROMA_444(64, 64); ++ CHROMA_444(64, 32); ++ CHROMA_444(32, 64); ++ CHROMA_444(64, 48); ++ CHROMA_444(48, 64); ++ CHROMA_444(64, 16); ++ CHROMA_444(16, 64); ++ ++} ++ ++}; ++ ++ ++#endif ++ ++ +diff -Naur ./source/common/arm64/filter-prim.h ../x265_apple_patch/source/common/arm64/filter-prim.h +--- ./source/common/arm64/filter-prim.h 1970-01-01 01:00:00.000000000 +0100 ++++ ../x265_apple_patch/source/common/arm64/filter-prim.h 2021-05-08 13:08:01.000000000 +0100 +@@ -0,0 +1,20 @@ ++#ifndef _FILTER_PRIM_ARM64_H__ ++#define _FILTER_PRIM_ARM64_H__ ++ ++ ++#include "common.h" ++#include "slicetype.h" // LOWRES_COST_MASK ++#include "primitives.h" ++#include "x265.h" ++ ++ ++namespace X265_NS { ++ ++ ++void setupFilterPrimitives_neon(EncoderPrimitives &p); ++ ++}; ++ ++ ++#endif ++ +diff -Naur ./source/common/arm64/intrapred-prim.cpp ../x265_apple_patch/source/common/arm64/intrapred-prim.cpp +--- ./source/common/arm64/intrapred-prim.cpp 1970-01-01 01:00:00.000000000 +0100 ++++ ../x265_apple_patch/source/common/arm64/intrapred-prim.cpp 2021-05-08 13:08:01.000000000 +0100 +@@ -0,0 +1,266 @@ ++/***************************************************************************** ++ * Copyright (C) 2013-2017 MulticoreWare, Inc ++ * ++ * Authors: Min Chen ++ * ++ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA. ++ * ++ * This program is also available under a commercial proprietary license. ++ * For more information, contact us at license @ x265.com. ++ *****************************************************************************/ ++ ++ ++#include "common.h" ++#include "primitives.h" ++ ++ ++#if 1 ++#include "arm64-utils.h" ++#include ++ ++using namespace X265_NS; ++ ++namespace { ++ ++ ++ ++template ++void intra_pred_ang_neon(pixel* dst, intptr_t dstStride, const pixel *srcPix0, int dirMode, int bFilter) ++{ ++ int width2 = width << 1; ++ // Flip the neighbours in the horizontal case. ++ int horMode = dirMode < 18; ++ pixel neighbourBuf[129]; ++ const pixel *srcPix = srcPix0; ++ ++ if (horMode) ++ { ++ neighbourBuf[0] = srcPix[0]; ++ //for (int i = 0; i < width << 1; i++) ++ //{ ++ // neighbourBuf[1 + i] = srcPix[width2 + 1 + i]; ++ // neighbourBuf[width2 + 1 + i] = srcPix[1 + i]; ++ //} ++ memcpy(&neighbourBuf[1],&srcPix[width2+1],sizeof(pixel)*(width << 1)); ++ memcpy(&neighbourBuf[width2 + 1],&srcPix[1],sizeof(pixel)*(width << 1)); ++ srcPix = neighbourBuf; ++ } ++ ++ // Intra prediction angle and inverse angle tables. ++ const int8_t angleTable[17] = { -32, -26, -21, -17, -13, -9, -5, -2, 0, 2, 5, 9, 13, 17, 21, 26, 32 }; ++ const int16_t invAngleTable[8] = { 4096, 1638, 910, 630, 482, 390, 315, 256 }; ++ ++ // Get the prediction angle. ++ int angleOffset = horMode ? 10 - dirMode : dirMode - 26; ++ int angle = angleTable[8 + angleOffset]; ++ ++ // Vertical Prediction. ++ if (!angle) ++ { ++ for (int y = 0; y < width; y++) { ++ memcpy(&dst[y * dstStride],srcPix + 1,sizeof(pixel)*width); ++ } ++ if (bFilter) ++ { ++ int topLeft = srcPix[0], top = srcPix[1]; ++ for (int y = 0; y < width; y++) ++ dst[y * dstStride] = x265_clip((int16_t)(top + ((srcPix[width2 + 1 + y] - topLeft) >> 1))); ++ } ++ } ++ else // Angular prediction. ++ { ++ // Get the reference pixels. The reference base is the first pixel to the top (neighbourBuf[1]). ++ pixel refBuf[64]; ++ const pixel *ref; ++ ++ // Use the projected left neighbours and the top neighbours. ++ if (angle < 0) ++ { ++ // Number of neighbours projected. ++ int nbProjected = -((width * angle) >> 5) - 1; ++ pixel *ref_pix = refBuf + nbProjected + 1; ++ ++ // Project the neighbours. ++ int invAngle = invAngleTable[- angleOffset - 1]; ++ int invAngleSum = 128; ++ for (int i = 0; i < nbProjected; i++) ++ { ++ invAngleSum += invAngle; ++ ref_pix[- 2 - i] = srcPix[width2 + (invAngleSum >> 8)]; ++ } ++ ++ // Copy the top-left and top pixels. ++ //for (int i = 0; i < width + 1; i++) ++ //ref_pix[-1 + i] = srcPix[i]; ++ ++ memcpy(&ref_pix[-1],srcPix,(width+1)*sizeof(pixel)); ++ ref = ref_pix; ++ } ++ else // Use the top and top-right neighbours. ++ ref = srcPix + 1; ++ ++ // Pass every row. ++ int angleSum = 0; ++ for (int y = 0; y < width; y++) ++ { ++ angleSum += angle; ++ int offset = angleSum >> 5; ++ int fraction = angleSum & 31; ++ ++ if (fraction) // Interpolate ++ { ++ if (width >= 8 && sizeof(pixel) == 1) ++ { ++ const int16x8_t f0 = vdupq_n_s16(32-fraction); ++ const int16x8_t f1 = vdupq_n_s16(fraction); ++ for (int x = 0;x= 4 && sizeof(pixel) == 2) ++ { ++ const int32x4_t f0 = vdupq_n_s32(32-fraction); ++ const int32x4_t f1 = vdupq_n_s32(fraction); ++ for (int x = 0;x> 5); ++ } ++ } ++ else // Copy. ++ { ++ memcpy(&dst[y * dstStride],&ref[offset],sizeof(pixel)*width); ++ } ++ } ++ } ++ ++ // Flip for horizontal. ++ if (horMode) ++ { ++ if (width == 8) transpose8x8(dst,dst,dstStride,dstStride); ++ else if (width == 16) transpose16x16(dst,dst,dstStride,dstStride); ++ else if (width == 32) transpose32x32(dst,dst,dstStride,dstStride); ++ else { ++ for (int y = 0; y < width - 1; y++) ++ { ++ for (int x = y + 1; x < width; x++) ++ { ++ pixel tmp = dst[y * dstStride + x]; ++ dst[y * dstStride + x] = dst[x * dstStride + y]; ++ dst[x * dstStride + y] = tmp; ++ } ++ } ++ } ++ } ++} ++ ++template ++void all_angs_pred_neon(pixel *dest, pixel *refPix, pixel *filtPix, int bLuma) ++{ ++ const int size = 1 << log2Size; ++ for (int mode = 2; mode <= 34; mode++) ++ { ++ pixel *srcPix = (g_intraFilterFlags[mode] & size ? filtPix : refPix); ++ pixel *out = dest + ((mode - 2) << (log2Size * 2)); ++ ++ intra_pred_ang_neon(out, size, srcPix, mode, bLuma); ++ ++ // Optimize code don't flip buffer ++ bool modeHor = (mode < 18); ++ ++ // transpose the block if this is a horizontal mode ++ if (modeHor) ++ { ++ if (size == 8) transpose8x8(out,out,size,size); ++ else if (size == 16) transpose16x16(out,out,size,size); ++ else if (size == 32) transpose32x32(out,out,size,size); ++ else { ++ for (int k = 0; k < size - 1; k++) ++ { ++ for (int l = k + 1; l < size; l++) ++ { ++ pixel tmp = out[k * size + l]; ++ out[k * size + l] = out[l * size + k]; ++ out[l * size + k] = tmp; ++ } ++ } ++ } ++ } ++ } ++} ++} ++ ++namespace X265_NS { ++// x265 private namespace ++ ++void setupIntraPrimitives_neon(EncoderPrimitives& p) ++{ ++// p.cu[BLOCK_4x4].intra_filter = intraFilter<4>; ++// p.cu[BLOCK_8x8].intra_filter = intraFilter<8>; ++// p.cu[BLOCK_16x16].intra_filter = intraFilter<16>; ++// p.cu[BLOCK_32x32].intra_filter = intraFilter<32>; ++ ++// p.cu[BLOCK_4x4].intra_pred[PLANAR_IDX] = planar_pred_neon<2>; ++// p.cu[BLOCK_8x8].intra_pred[PLANAR_IDX] = planar_pred_neon<3>; ++// p.cu[BLOCK_16x16].intra_pred[PLANAR_IDX] = planar_pred_neon<4>; ++// p.cu[BLOCK_32x32].intra_pred[PLANAR_IDX] = planar_pred_neon<5>; ++// ++// p.cu[BLOCK_4x4].intra_pred[DC_IDX] = intra_pred_dc_neon<4>; ++// p.cu[BLOCK_8x8].intra_pred[DC_IDX] = intra_pred_dc_neon<8>; ++// p.cu[BLOCK_16x16].intra_pred[DC_IDX] = intra_pred_dc_neon<16>; ++// p.cu[BLOCK_32x32].intra_pred[DC_IDX] = intra_pred_dc_neon<32>; ++ ++ for (int i = 2; i < NUM_INTRA_MODE; i++) ++ { ++ p.cu[BLOCK_4x4].intra_pred[i] = intra_pred_ang_neon<4>; ++ p.cu[BLOCK_8x8].intra_pred[i] = intra_pred_ang_neon<8>; ++ p.cu[BLOCK_16x16].intra_pred[i] = intra_pred_ang_neon<16>; ++ p.cu[BLOCK_32x32].intra_pred[i] = intra_pred_ang_neon<32>; ++ } ++ ++ p.cu[BLOCK_4x4].intra_pred_allangs = all_angs_pred_neon<2>; ++ p.cu[BLOCK_8x8].intra_pred_allangs = all_angs_pred_neon<3>; ++ p.cu[BLOCK_16x16].intra_pred_allangs = all_angs_pred_neon<4>; ++ p.cu[BLOCK_32x32].intra_pred_allangs = all_angs_pred_neon<5>; ++} ++} ++ ++ ++ ++#else ++ ++namespace X265_NS { ++// x265 private namespace ++void setupIntraPrimitives_neon(EncoderPrimitives& p) ++{} ++} ++ ++#endif ++ ++ ++ +diff -Naur ./source/common/arm64/intrapred-prim.h ../x265_apple_patch/source/common/arm64/intrapred-prim.h +--- ./source/common/arm64/intrapred-prim.h 1970-01-01 01:00:00.000000000 +0100 ++++ ../x265_apple_patch/source/common/arm64/intrapred-prim.h 2021-05-08 13:08:01.000000000 +0100 +@@ -0,0 +1,14 @@ ++#ifndef INTRAPRED_PRIM_H__ ++ ++#if defined(__aarch64__) ++ ++namespace X265_NS { ++// x265 private namespace ++ ++void setupIntraPrimitives_neon(EncoderPrimitives& p); ++} ++ ++#endif ++ ++#endif ++ +diff -Naur ./source/common/arm64/loopfilter-prim.cpp ../x265_apple_patch/source/common/arm64/loopfilter-prim.cpp +--- ./source/common/arm64/loopfilter-prim.cpp 1970-01-01 01:00:00.000000000 +0100 ++++ ../x265_apple_patch/source/common/arm64/loopfilter-prim.cpp 2021-05-08 13:08:01.000000000 +0100 +@@ -0,0 +1,305 @@ ++/***************************************************************************** ++* Copyright (C) 2013-2017 MulticoreWare, Inc ++* ++* Authors: Praveen Kumar Tiwari ++* Dnyaneshwar Gorade ++* Min Chen ++* ++* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA. ++* ++* This program is also available under a commercial proprietary license. ++* For more information, contact us at license @ x265.com. ++*****************************************************************************/ ++#include "loopfilter-prim.h" ++ ++#define PIXEL_MIN 0 ++ ++ ++ ++#if !(HIGH_BIT_DEPTH) && defined(HAVE_NEON) ++#include ++ ++namespace { ++ ++ ++/* get the sign of input variable (TODO: this is a dup, make common) */ ++static inline int8_t signOf(int x) ++{ ++ return (x >> 31) | ((int)((((uint32_t)-x)) >> 31)); ++} ++ ++static inline int8x8_t sign_diff_neon(const uint8x8_t in0, const uint8x8_t in1) ++{ ++ int16x8_t in = vsubl_u8(in0,in1); ++ return vmovn_s16(vmaxq_s16(vminq_s16(in,vdupq_n_s16(1)),vdupq_n_s16(-1))); ++} ++ ++static void calSign_neon(int8_t *dst, const pixel *src1, const pixel *src2, const int endX) ++{ ++ int x = 0; ++ for (; (x + 8) <= endX; x += 8) { ++ *(int8x8_t *)&dst[x] = sign_diff_neon(*(uint8x8_t *)&src1[x],*(uint8x8_t *)&src2[x]); ++ } ++ ++ for (; x < endX; x++) ++ dst[x] = signOf(src1[x] - src2[x]); ++} ++ ++static void processSaoCUE0_neon(pixel * rec, int8_t * offsetEo, int width, int8_t* signLeft, intptr_t stride) ++{ ++ ++ ++ int y; ++ int8_t signRight, signLeft0; ++ int8_t edgeType; ++ ++ for (y = 0; y < 2; y++) ++ { ++ signLeft0 = signLeft[y]; ++ int x = 0; ++ ++ if (width >= 8) { ++ int8x8_t vsignRight; ++ int8x8x2_t shifter; ++ shifter.val[1][0] = signLeft0; ++ static const int8x8_t index = {8,0,1,2,3,4,5,6}; ++ int8x8_t tbl = *(int8x8_t *)offsetEo; ++ for (; (x+8) <= width; x+=8) ++ { ++ uint8x8_t in = *(uint8x8_t *)&rec[x]; ++ vsignRight = sign_diff_neon(in,*(uint8x8_t *)&rec[x+1]); ++ shifter.val[0] = vneg_s8(vsignRight); ++ int8x8_t tmp = shifter.val[0]; ++ int8x8_t edge = vtbl2_s8(shifter,index); ++ int8x8_t vedgeType = vadd_s8(vadd_s8(vsignRight,edge),vdup_n_s8(2)); ++ shifter.val[1][0] = tmp[7]; ++ int16x8_t t1 = vmovl_s8(vtbl1_s8(tbl,vedgeType)); ++ t1 = vaddw_u8(t1,in); ++ t1 = vmaxq_s16(t1,vdupq_n_s16(0)); ++ t1 = vminq_s16(t1,vdupq_n_s16(255)); ++ *(uint8x8_t *)&rec[x] = vmovn_u16(t1); ++ } ++ signLeft0 = shifter.val[1][0]; ++ } ++ for (; x < width; x++) ++ { ++ signRight = ((rec[x] - rec[x + 1]) < 0) ? -1 : ((rec[x] - rec[x + 1]) > 0) ? 1 : 0; ++ edgeType = signRight + signLeft0 + 2; ++ signLeft0 = -signRight; ++ rec[x] = x265_clip(rec[x] + offsetEo[edgeType]); ++ } ++ rec += stride; ++ } ++} ++ ++static void processSaoCUE1_neon(pixel* rec, int8_t* upBuff1, int8_t* offsetEo, intptr_t stride, int width) ++{ ++ int x = 0; ++ int8_t signDown; ++ int edgeType; ++ ++ if (width >= 8) { ++ int8x8_t tbl = *(int8x8_t *)offsetEo; ++ for (; (x+8) <= width; x+=8) ++ { ++ uint8x8_t in0 = *(uint8x8_t *)&rec[x]; ++ uint8x8_t in1 = *(uint8x8_t *)&rec[x+stride]; ++ int8x8_t vsignDown = sign_diff_neon(in0,in1); ++ int8x8_t vedgeType = vadd_s8(vadd_s8(vsignDown,*(int8x8_t *)&upBuff1[x]),vdup_n_s8(2)); ++ *(int8x8_t *)&upBuff1[x] = vneg_s8(vsignDown); ++ int16x8_t t1 = vmovl_s8(vtbl1_s8(tbl,vedgeType)); ++ t1 = vaddw_u8(t1,in0); ++ *(uint8x8_t *)&rec[x] = vqmovun_s16(t1); ++ } ++ } ++ for (; x < width; x++) ++ { ++ signDown = signOf(rec[x] - rec[x + stride]); ++ edgeType = signDown + upBuff1[x] + 2; ++ upBuff1[x] = -signDown; ++ rec[x] = x265_clip(rec[x] + offsetEo[edgeType]); ++ } ++} ++ ++static void processSaoCUE1_2Rows_neon(pixel* rec, int8_t* upBuff1, int8_t* offsetEo, intptr_t stride, int width) ++{ ++ int y; ++ int8_t signDown; ++ int edgeType; ++ ++ for (y = 0; y < 2; y++) ++ { ++ int x=0; ++ if (width >= 8) { ++ int8x8_t tbl = *(int8x8_t *)offsetEo; ++ for (; (x+8) <= width; x+=8) ++ { ++ uint8x8_t in0 = *(uint8x8_t *)&rec[x]; ++ uint8x8_t in1 = *(uint8x8_t *)&rec[x+stride]; ++ int8x8_t vsignDown = sign_diff_neon(in0,in1); ++ int8x8_t vedgeType = vadd_s8(vadd_s8(vsignDown,*(int8x8_t *)&upBuff1[x]),vdup_n_s8(2)); ++ *(int8x8_t *)&upBuff1[x] = vneg_s8(vsignDown); ++ int16x8_t t1 = vmovl_s8(vtbl1_s8(tbl,vedgeType)); ++ t1 = vaddw_u8(t1,in0); ++ t1 = vmaxq_s16(t1,vdupq_n_s16(0)); ++ t1 = vminq_s16(t1,vdupq_n_s16(255)); ++ *(uint8x8_t *)&rec[x] = vmovn_u16(t1); ++ ++ } ++ } ++ for (; x < width; x++) ++ { ++ signDown = signOf(rec[x] - rec[x + stride]); ++ edgeType = signDown + upBuff1[x] + 2; ++ upBuff1[x] = -signDown; ++ rec[x] = x265_clip(rec[x] + offsetEo[edgeType]); ++ } ++ rec += stride; ++ } ++} ++ ++static void processSaoCUE2_neon(pixel * rec, int8_t * bufft, int8_t * buff1, int8_t * offsetEo, int width, intptr_t stride) ++{ ++ int x; ++ ++ if (abs(buff1-bufft) < 16) ++ { ++ for (x = 0; x < width; x++) ++ { ++ int8_t signDown = signOf(rec[x] - rec[x + stride + 1]); ++ int edgeType = signDown + buff1[x] + 2; ++ bufft[x + 1] = -signDown; ++ rec[x] = x265_clip(rec[x] + offsetEo[edgeType]);; ++ } ++ } ++ else ++ { ++ int8x8_t tbl = *(int8x8_t *)offsetEo; ++ x=0; ++ for (; (x + 8) <= width; x+=8) ++ { ++ uint8x8_t in0 = *(uint8x8_t *)&rec[x]; ++ uint8x8_t in1 = *(uint8x8_t *)&rec[x+stride+1]; ++ int8x8_t vsignDown = sign_diff_neon(in0,in1); ++ int8x8_t vedgeType = vadd_s8(vadd_s8(vsignDown,*(int8x8_t *)&buff1[x]),vdup_n_s8(2)); ++ *(int8x8_t *)&bufft[x+1] = vneg_s8(vsignDown); ++ int16x8_t t1 = vmovl_s8(vtbl1_s8(tbl,vedgeType)); ++ t1 = vaddw_u8(t1,in0); ++ t1 = vmaxq_s16(t1,vdupq_n_s16(0)); ++ t1 = vminq_s16(t1,vdupq_n_s16(255)); ++ *(uint8x8_t *)&rec[x] = vmovn_u16(t1); ++ } ++ for (; x < width; x++) ++ { ++ int8_t signDown = signOf(rec[x] - rec[x + stride + 1]); ++ int edgeType = signDown + buff1[x] + 2; ++ bufft[x + 1] = -signDown; ++ rec[x] = x265_clip(rec[x] + offsetEo[edgeType]);; ++ } ++ ++ } ++} ++ ++ ++static void processSaoCUE3_neon(pixel *rec, int8_t *upBuff1, int8_t *offsetEo, intptr_t stride, int startX, int endX) ++{ ++ int8_t signDown; ++ int8_t edgeType; ++ int8x8_t tbl = *(int8x8_t *)offsetEo; ++ ++ int x = startX + 1; ++ for (; (x+8) <= endX; x+=8 ) ++ { ++ uint8x8_t in0 = *(uint8x8_t *)&rec[x]; ++ uint8x8_t in1 = *(uint8x8_t *)&rec[x+stride]; ++ int8x8_t vsignDown = sign_diff_neon(in0,in1); ++ int8x8_t vedgeType = vadd_s8(vadd_s8(vsignDown,*(int8x8_t *)&upBuff1[x]),vdup_n_s8(2)); ++ *(int8x8_t *)&upBuff1[x-1] = vneg_s8(vsignDown); ++ int16x8_t t1 = vmovl_s8(vtbl1_s8(tbl,vedgeType)); ++ t1 = vaddw_u8(t1,in0); ++ t1 = vmaxq_s16(t1,vdupq_n_s16(0)); ++ t1 = vminq_s16(t1,vdupq_n_s16(255)); ++ *(uint8x8_t *)&rec[x] = vmovn_u16(t1); ++ ++ } ++ for (; x < endX; x++) ++ { ++ signDown = signOf(rec[x] - rec[x + stride]); ++ edgeType = signDown + upBuff1[x] + 2; ++ upBuff1[x - 1] = -signDown; ++ rec[x] = x265_clip(rec[x] + offsetEo[edgeType]); ++ } ++} ++ ++static void processSaoCUB0_neon(pixel* rec, const int8_t* offset, int ctuWidth, int ctuHeight, intptr_t stride) ++{ ++ #define SAO_BO_BITS 5 ++ const int boShift = X265_DEPTH - SAO_BO_BITS; ++ int x, y; ++ int8x8x4_t table; ++ table = *(int8x8x4_t *)offset; ++ ++ for (y = 0; y < ctuHeight; y++) ++ { ++ ++ for (x = 0; (x+8) <= ctuWidth; x+=8) ++ { ++ int8x8_t in = *(int8x8_t*)&rec[x]; ++ int8x8_t offsets = vtbl4_s8(table,vshr_n_u8(in,boShift)); ++ int16x8_t tmp = vmovl_s8(offsets); ++ tmp = vaddw_u8(tmp,in); ++ tmp = vmaxq_s16(tmp,vdupq_n_s16(0)); ++ tmp = vminq_s16(tmp,vdupq_n_s16(255)); ++ *(uint8x8_t *)&rec[x] = vmovn_u16(tmp); ++ } ++ for (; x < ctuWidth; x++) ++ { ++ rec[x] = x265_clip(rec[x] + offset[rec[x] >> boShift]); ++ } ++ rec += stride; ++ } ++} ++ ++} ++ ++ ++ ++namespace X265_NS { ++void setupLoopFilterPrimitives_neon(EncoderPrimitives &p) ++{ ++ p.saoCuOrgE0 = processSaoCUE0_neon; ++ p.saoCuOrgE1 = processSaoCUE1_neon; ++ p.saoCuOrgE1_2Rows = processSaoCUE1_2Rows_neon; ++ p.saoCuOrgE2[0] = processSaoCUE2_neon; ++ p.saoCuOrgE2[1] = processSaoCUE2_neon; ++ p.saoCuOrgE3[0] = processSaoCUE3_neon; ++ p.saoCuOrgE3[1] = processSaoCUE3_neon; ++ p.saoCuOrgB0 = processSaoCUB0_neon; ++ p.sign = calSign_neon; ++ ++} ++ ++#else //HIGH_BIT_DEPTH ++ ++ ++namespace X265_NS { ++void setupLoopFilterPrimitives_neon(EncoderPrimitives &) ++{ ++} ++ ++#endif ++ ++ ++} +diff -Naur ./source/common/arm64/loopfilter-prim.h ../x265_apple_patch/source/common/arm64/loopfilter-prim.h +--- ./source/common/arm64/loopfilter-prim.h 1970-01-01 01:00:00.000000000 +0100 ++++ ../x265_apple_patch/source/common/arm64/loopfilter-prim.h 2021-05-08 13:08:01.000000000 +0100 +@@ -0,0 +1,43 @@ ++#ifndef _LOOPFILTER_NEON_H__ ++#define _LOOPFILTER_NEON_H__ ++ ++ ++/***************************************************************************** ++* Copyright (C) 2013-2017 MulticoreWare, Inc ++* ++* Authors: Praveen Kumar Tiwari ++* Dnyaneshwar Gorade ++* Min Chen ++* ++* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA. ++* ++* This program is also available under a commercial proprietary license. ++* For more information, contact us at license @ x265.com. ++*****************************************************************************/ ++ ++ ++ ++#include "common.h" ++#include "primitives.h" ++ ++#define PIXEL_MIN 0 ++ ++namespace X265_NS { ++void setupLoopFilterPrimitives_neon(EncoderPrimitives &p); ++ ++}; ++ ++ ++#endif +diff -Naur ./source/common/arm64/pixel-prim.cpp ../x265_apple_patch/source/common/arm64/pixel-prim.cpp +--- ./source/common/arm64/pixel-prim.cpp 1970-01-01 01:00:00.000000000 +0100 ++++ ../x265_apple_patch/source/common/arm64/pixel-prim.cpp 2021-05-08 13:08:01.000000000 +0100 +@@ -0,0 +1,1940 @@ ++#include "common.h" ++#include "slicetype.h" // LOWRES_COST_MASK ++#include "primitives.h" ++#include "x265.h" ++ ++#include "pixel-prim.h" ++#include "arm64-utils.h" ++#if HAVE_NEON ++ ++#include ++ ++using namespace X265_NS; ++ ++ ++ ++namespace { ++ ++ ++/* SATD SA8D variants - based on x264 */ ++static inline void SUMSUB_AB(int16x8_t& sum, int16x8_t& sub, const int16x8_t a, const int16x8_t b) ++{ ++ sum = vaddq_s16(a,b); ++ sub = vsubq_s16(a,b); ++} ++ ++static inline void transpose_8h(int16x8_t& t1, int16x8_t& t2, const int16x8_t s1, const int16x8_t s2) ++{ ++ t1 = vtrn1q_s16(s1, s2); ++ t2 = vtrn2q_s16(s1, s2); ++} ++ ++static inline void transpose_4s(int16x8_t& t1, int16x8_t& t2, const int16x8_t s1, const int16x8_t s2) ++{ ++ t1 = vtrn1q_s32(s1, s2); ++ t2 = vtrn2q_s32(s1, s2); ++} ++ ++#if (X265_DEPTH <= 10) ++static inline void transpose_2d(int16x8_t& t1, int16x8_t& t2, const int16x8_t s1, const int16x8_t s2) ++{ ++ t1 = vtrn1q_s64(s1, s2); ++ t2 = vtrn2q_s64(s1, s2); ++} ++#endif ++ ++ ++static inline void SUMSUB_ABCD(int16x8_t& s1, int16x8_t& d1, int16x8_t& s2, int16x8_t& d2, ++ int16x8_t a,int16x8_t b,int16x8_t c,int16x8_t d) ++{ ++ SUMSUB_AB(s1,d1,a,b); ++ SUMSUB_AB(s2,d2,c,d); ++} ++ ++static inline void HADAMARD4_V(int16x8_t& r1,int16x8_t& r2,int16x8_t& r3,int16x8_t& r4, ++ int16x8_t& t1,int16x8_t& t2,int16x8_t& t3,int16x8_t& t4) ++{ ++ SUMSUB_ABCD(t1, t2, t3, t4, r1, r2, r3, r4); ++ SUMSUB_ABCD(r1, r3, r2, r4, t1, t3, t2, t4); ++} ++ ++ ++static int _satd_4x8_8x4_end_neon(int16x8_t v0,int16x8_t v1,int16x8_t v2, int16x8_t v3) ++ ++{ ++ ++ int16x8_t v4,v5,v6,v7,v16,v17,v18,v19; ++ ++ ++ SUMSUB_AB (v16, v17, v0, v1); ++ SUMSUB_AB (v18, v19, v2, v3); ++ ++ SUMSUB_AB (v4 , v6 , v16, v18); ++ SUMSUB_AB (v5 , v7 , v17, v19); ++ ++ v0 = vtrn1q_s16(v4, v5); ++ v1 = vtrn2q_s16(v4, v5); ++ v2 = vtrn1q_s16(v6, v7); ++ v3 = vtrn2q_s16(v6, v7); ++ ++ SUMSUB_AB (v16, v17, v0, v1); ++ SUMSUB_AB (v18, v19, v2, v3); ++ ++ v0 = vtrn1q_s32(v16, v18); ++ v1 = vtrn2q_s32(v16, v18); ++ v2 = vtrn1q_s32(v17, v19); ++ v3 = vtrn2q_s32(v17, v19); ++ ++ v0 = vabsq_s16(v0); ++ v1 = vabsq_s16(v1); ++ v2 = vabsq_s16(v2); ++ v3 = vabsq_s16(v3); ++ ++ v0 = vmaxq_u16(v0, v1); ++ v1 = vmaxq_u16(v2, v3); ++ ++ v0 = vaddq_u16(v0, v1); ++ return vaddlvq_u16(v0); ++} ++ ++static inline int _satd_4x4_neon(int16x8_t v0, int16x8_t v1) ++{ ++ int16x8_t v2,v3; ++ SUMSUB_AB (v2, v3, v0, v1); ++ ++ v0 = vzip1q_s64(v2,v3); ++ v1 = vzip2q_s64(v2,v3); ++ SUMSUB_AB (v2, v3, v0, v1); ++ ++ v0 = vtrn1q_s16(v2,v3); ++ v1 = vtrn2q_s16(v2,v3); ++ SUMSUB_AB (v2, v3, v0, v1); ++ ++ v0 = vtrn1q_s32(v2,v3); ++ v1 = vtrn2q_s32(v2,v3); ++ ++ v0 = vabsq_s16(v0); ++ v1 = vabsq_s16(v1); ++ v0 = vmaxq_u16(v0, v1); ++ ++ return vaddlvq_s16(v0); ++} ++ ++static void _satd_8x4v_8x8h_neon(int16x8_t& v0,int16x8_t& v1, int16x8_t&v2,int16x8_t& v3,int16x8_t& v20,int16x8_t& v21, int16x8_t&v22,int16x8_t& v23) ++{ ++ int16x8_t v16,v17,v18,v19,v4,v5,v6,v7; ++ ++ SUMSUB_AB(v16, v18, v0, v2); ++ SUMSUB_AB(v17, v19, v1, v3); ++ ++ HADAMARD4_V (v20, v21, v22, v23, v0, v1, v2, v3); ++ ++ transpose_8h( v0, v1, v16, v17); ++ transpose_8h( v2, v3, v18, v19); ++ transpose_8h( v4, v5, v20, v21); ++ transpose_8h( v6, v7, v22, v23); ++ ++ SUMSUB_AB (v16, v17, v0, v1); ++ SUMSUB_AB (v18, v19, v2, v3); ++ SUMSUB_AB (v20, v21, v4, v5); ++ SUMSUB_AB (v22, v23, v6, v7); ++ ++ transpose_4s( v0, v2, v16, v18); ++ transpose_4s( v1, v3, v17, v19); ++ transpose_4s( v4, v6, v20, v22); ++ transpose_4s( v5, v7, v21, v23); ++ ++ v0 = vabsq_s16(v0); ++ v1 = vabsq_s16(v1); ++ v2 = vabsq_s16(v2); ++ v3 = vabsq_s16(v3); ++ v4 = vabsq_s16(v4); ++ v5 = vabsq_s16(v5); ++ v6 = vabsq_s16(v6); ++ v7 = vabsq_s16(v7); ++ ++ v0 = vmaxq_u16(v0,v2); ++ v1 = vmaxq_u16(v1,v3); ++ v2 = vmaxq_u16(v4,v6); ++ v3 = vmaxq_u16(v5,v7); ++ ++} ++ ++#if HIGH_BIT_DEPTH ++ ++#if (X265_DEPTH > 10) ++static inline void transpose_2d(int32x4_t& t1, int32x4_t& t2, const int32x4_t s1, const int32x4_t s2) ++{ ++ t1 = vtrn1q_s64(s1, s2); ++ t2 = vtrn2q_s64(s1, s2); ++} ++ ++static inline void ISUMSUB_AB(int32x4_t& sum, int32x4_t& sub, const int32x4_t a, const int32x4_t b) ++{ ++ sum = vaddq_s32(a,b); ++ sub = vsubq_s32(a,b); ++} ++ ++static inline void ISUMSUB_AB_FROM_INT16(int32x4_t& suml, int32x4_t& sumh, int32x4_t& subl, int32x4_t& subh, const int16x8_t a, const int16x8_t b) ++{ ++ suml = vaddl_s16(vget_low_s16(a),vget_low_s16(b)); ++ sumh = vaddl_high_s16(a,b); ++ subl = vsubl_s16(vget_low_s16(a),vget_low_s16(b)); ++ subh = vsubl_high_s16(a, b); ++} ++ ++#endif ++ ++static inline void _sub_8x8_fly(const uint16_t* pix1, intptr_t stride_pix1, const uint16_t* pix2, intptr_t stride_pix2, ++ int16x8_t& v0,int16x8_t& v1, int16x8_t& v2,int16x8_t& v3, ++ int16x8_t& v20,int16x8_t& v21, int16x8_t& v22,int16x8_t& v23) ++{ ++ uint16x8_t r0,r1,r2,r3; ++ uint16x8_t t0,t1,t2,t3; ++ int16x8_t v16,v17; ++ int16x8_t v18,v19; ++ ++ r0 = *(uint16x8_t*)(pix1 + 0*stride_pix1); ++ r1 = *(uint16x8_t*)(pix1 + 1*stride_pix1); ++ r2 = *(uint16x8_t*)(pix1 + 2*stride_pix1); ++ r3 = *(uint16x8_t*)(pix1 + 3*stride_pix1); ++ ++ t0 = *(uint16x8_t*)(pix2 + 0*stride_pix2); ++ t1 = *(uint16x8_t*)(pix2 + 1*stride_pix2); ++ t2 = *(uint16x8_t*)(pix2 + 2*stride_pix2); ++ t3 = *(uint16x8_t*)(pix2 + 3*stride_pix2); ++ ++ v16 = vsubq_u16(r0,t0); ++ v17 = vsubq_u16(r1,t1); ++ v18 = vsubq_u16(r2,t2); ++ v19 = vsubq_u16(r3,t3); ++ ++ r0 = *(uint16x8_t*)(pix1 + 4*stride_pix1); ++ r1 = *(uint16x8_t*)(pix1 + 5*stride_pix1); ++ r2 = *(uint16x8_t*)(pix1 + 6*stride_pix1); ++ r3 = *(uint16x8_t*)(pix1 + 7*stride_pix1); ++ ++ t0 = *(uint16x8_t*)(pix2 + 4*stride_pix2); ++ t1 = *(uint16x8_t*)(pix2 + 5*stride_pix2); ++ t2 = *(uint16x8_t*)(pix2 + 6*stride_pix2); ++ t3 = *(uint16x8_t*)(pix2 + 7*stride_pix2); ++ ++ v20 = vsubq_u16(r0,t0); ++ v21 = vsubq_u16(r1,t1); ++ v22 = vsubq_u16(r2,t2); ++ v23 = vsubq_u16(r3,t3); ++ ++ SUMSUB_AB (v0, v1, v16, v17); ++ SUMSUB_AB (v2, v3, v18, v19); ++ ++} ++ ++ ++ ++ ++static void _satd_16x4_neon(const uint16_t* pix1, intptr_t stride_pix1, const uint16_t* pix2, intptr_t stride_pix2, ++ int16x8_t& v0,int16x8_t&v1, int16x8_t&v2,int16x8_t&v3) ++{ ++ uint8x16_t r0,r1,r2,r3; ++ uint8x16_t t0,t1,t2,t3; ++ int16x8_t v16,v17,v20,v21; ++ int16x8_t v18,v19,v22,v23; ++ ++ r0 = *(int16x8_t*)(pix1 + 0*stride_pix1); ++ r1 = *(int16x8_t*)(pix1 + 1*stride_pix1); ++ r2 = *(int16x8_t*)(pix1 + 2*stride_pix1); ++ r3 = *(int16x8_t*)(pix1 + 3*stride_pix1); ++ ++ t0 = *(int16x8_t*)(pix2 + 0*stride_pix2); ++ t1 = *(int16x8_t*)(pix2 + 1*stride_pix2); ++ t2 = *(int16x8_t*)(pix2 + 2*stride_pix2); ++ t3 = *(int16x8_t*)(pix2 + 3*stride_pix2); ++ ++ ++ v16 = vsubq_u16((r0),(t0) ); ++ v17 = vsubq_u16((r1),(t1) ); ++ v18 = vsubq_u16((r2),(t2) ); ++ v19 = vsubq_u16((r3),(t3) ); ++ ++ r0 = *(int16x8_t*)(pix1 + 0*stride_pix1 + 8); ++ r1 = *(int16x8_t*)(pix1 + 1*stride_pix1 + 8); ++ r2 = *(int16x8_t*)(pix1 + 2*stride_pix1 + 8); ++ r3 = *(int16x8_t*)(pix1 + 3*stride_pix1 + 8); ++ ++ t0 = *(int16x8_t*)(pix2 + 0*stride_pix2 + 8); ++ t1 = *(int16x8_t*)(pix2 + 1*stride_pix2 + 8); ++ t2 = *(int16x8_t*)(pix2 + 2*stride_pix2 + 8); ++ t3 = *(int16x8_t*)(pix2 + 3*stride_pix2 + 8); ++ ++ ++ v20 = vsubq_u16(r0,t0); ++ v21 = vsubq_u16(r1,t1); ++ v22 = vsubq_u16(r2,t2); ++ v23 = vsubq_u16(r3,t3); ++ ++ SUMSUB_AB (v0, v1, v16, v17); ++ SUMSUB_AB (v2, v3, v18, v19); ++ ++ _satd_8x4v_8x8h_neon(v0,v1,v2,v3,v20,v21,v22,v23); ++ ++} ++ ++ ++int pixel_satd_4x4_neon(const uint16_t* pix1, intptr_t stride_pix1, const uint16_t* pix2, intptr_t stride_pix2) ++{ ++ uint64x2_t t0,t1,r0,r1; ++ t0[0] = *(uint64_t *)(pix1 + 0*stride_pix1); ++ t1[0] = *(uint64_t *)(pix1 + 1*stride_pix1); ++ t0[1] = *(uint64_t *)(pix1 + 2*stride_pix1); ++ t1[1] = *(uint64_t *)(pix1 + 3*stride_pix1); ++ ++ r0[0] = *(uint64_t *)(pix2 + 0*stride_pix1); ++ r1[0] = *(uint64_t *)(pix2 + 1*stride_pix2); ++ r0[1] = *(uint64_t *)(pix2 + 2*stride_pix2); ++ r1[1] = *(uint64_t *)(pix2 + 3*stride_pix2); ++ ++ return _satd_4x4_neon(vsubq_u16(t0,r0), vsubq_u16(r1,t1)); ++} ++ ++ ++ ++ ++ ++ ++int pixel_satd_8x4_neon(const uint16_t* pix1, intptr_t stride_pix1, const uint16_t* pix2, intptr_t stride_pix2) ++{ ++ uint16x8_t i0,i1,i2,i3,i4,i5,i6,i7; ++ ++ i0 = *(uint16x8_t *)(pix1 + 0*stride_pix1); ++ i1 = *(uint16x8_t *)(pix2 + 0*stride_pix2); ++ i2 = *(uint16x8_t *)(pix1 + 1*stride_pix1); ++ i3 = *(uint16x8_t *)(pix2 + 1*stride_pix2); ++ i4 = *(uint16x8_t *)(pix1 + 2*stride_pix1); ++ i5 = *(uint16x8_t *)(pix2 + 2*stride_pix2); ++ i6 = *(uint16x8_t *)(pix1 + 3*stride_pix1); ++ i7 = *(uint16x8_t *)(pix2 + 3*stride_pix2); ++ ++ int16x8_t v0 = vsubq_u16(i0,i1); ++ int16x8_t v1 = vsubq_u16(i2,i3); ++ int16x8_t v2 = vsubq_u16(i4,i5); ++ int16x8_t v3 = vsubq_u16(i6,i7); ++ ++ return _satd_4x8_8x4_end_neon(v0,v1,v2,v3); ++} ++ ++ ++int pixel_satd_16x16_neon(const uint16_t* pix1, intptr_t stride_pix1, const uint16_t* pix2, intptr_t stride_pix2) ++{ ++ int32x4_t v30 = vdupq_n_u32(0),v31= vdupq_n_u32(0); ++ int16x8_t v0,v1,v2,v3; ++ ++ _satd_16x4_neon(pix1,stride_pix1,pix2,stride_pix2,v0,v1,v2,v3); ++ v30 = vpadalq_u16(v30,v0); ++ v30 = vpadalq_u16(v30,v1); ++ v31 = vpadalq_u16(v31,v2); ++ v31 = vpadalq_u16(v31,v3); ++ ++ _satd_16x4_neon(pix1 + 4*stride_pix1,stride_pix1,pix2+4*stride_pix2,stride_pix2,v0,v1,v2,v3); ++ v30 = vpadalq_u16(v30,v0); ++ v30 = vpadalq_u16(v30,v1); ++ v31 = vpadalq_u16(v31,v2); ++ v31 = vpadalq_u16(v31,v3); ++ ++ _satd_16x4_neon(pix1 + 8*stride_pix1,stride_pix1,pix2+8*stride_pix2,stride_pix2,v0,v1,v2,v3); ++ v30 = vpadalq_u16(v30,v0); ++ v30 = vpadalq_u16(v30,v1); ++ v31 = vpadalq_u16(v31,v2); ++ v31 = vpadalq_u16(v31,v3); ++ ++ _satd_16x4_neon(pix1 + 12*stride_pix1,stride_pix1,pix2+12*stride_pix2,stride_pix2,v0,v1,v2,v3); ++ v30 = vpadalq_u16(v30,v0); ++ v30 = vpadalq_u16(v30,v1); ++ v31 = vpadalq_u16(v31,v2); ++ v31 = vpadalq_u16(v31,v3); ++ ++ return vaddvq_s32(vaddq_s32(v30,v31)); ++ ++} ++ ++#else //HIGH_BIT_DEPTH ++ ++static void _satd_16x4_neon(const uint8_t* pix1, intptr_t stride_pix1, const uint8_t* pix2, intptr_t stride_pix2, ++ int16x8_t& v0,int16x8_t&v1, int16x8_t&v2,int16x8_t&v3) ++{ ++ uint8x16_t r0,r1,r2,r3; ++ uint8x16_t t0,t1,t2,t3; ++ int16x8_t v16,v17,v20,v21; ++ int16x8_t v18,v19,v22,v23; ++ ++ r0 = *(uint8x16_t*)(pix1 + 0*stride_pix1); ++ r1 = *(uint8x16_t*)(pix1 + 1*stride_pix1); ++ r2 = *(uint8x16_t*)(pix1 + 2*stride_pix1); ++ r3 = *(uint8x16_t*)(pix1 + 3*stride_pix1); ++ ++ t0 = *(uint8x16_t*)(pix2 + 0*stride_pix2); ++ t1 = *(uint8x16_t*)(pix2 + 1*stride_pix2); ++ t2 = *(uint8x16_t*)(pix2 + 2*stride_pix2); ++ t3 = *(uint8x16_t*)(pix2 + 3*stride_pix2); ++ ++ ++ ++ v16 = vsubl_u8(vget_low_u8(r0),vget_low_u8(t0) ); ++ v20 = vsubl_high_u8(r0,t0); ++ v17 = vsubl_u8(vget_low_u8(r1),vget_low_u8(t1) ); ++ v21 = vsubl_high_u8(r1,t1); ++ v18 = vsubl_u8(vget_low_u8(r2),vget_low_u8(t2) ); ++ v22 = vsubl_high_u8(r2,t2); ++ v19 = vsubl_u8(vget_low_u8(r3),vget_low_u8(t3) ); ++ v23 = vsubl_high_u8(r3,t3); ++ ++ SUMSUB_AB (v0, v1, v16, v17); ++ SUMSUB_AB (v2, v3, v18, v19); ++ ++ _satd_8x4v_8x8h_neon(v0,v1,v2,v3,v20,v21,v22,v23); ++ ++} ++ ++ ++static inline void _sub_8x8_fly(const uint8_t* pix1, intptr_t stride_pix1, const uint8_t* pix2, intptr_t stride_pix2, ++ int16x8_t& v0,int16x8_t& v1, int16x8_t& v2,int16x8_t& v3, ++ int16x8_t& v20,int16x8_t& v21, int16x8_t& v22,int16x8_t& v23) ++{ ++ uint8x8_t r0,r1,r2,r3; ++ uint8x8_t t0,t1,t2,t3; ++ int16x8_t v16,v17; ++ int16x8_t v18,v19; ++ ++ r0 = *(uint8x8_t*)(pix1 + 0*stride_pix1); ++ r1 = *(uint8x8_t*)(pix1 + 1*stride_pix1); ++ r2 = *(uint8x8_t*)(pix1 + 2*stride_pix1); ++ r3 = *(uint8x8_t*)(pix1 + 3*stride_pix1); ++ ++ t0 = *(uint8x8_t*)(pix2 + 0*stride_pix2); ++ t1 = *(uint8x8_t*)(pix2 + 1*stride_pix2); ++ t2 = *(uint8x8_t*)(pix2 + 2*stride_pix2); ++ t3 = *(uint8x8_t*)(pix2 + 3*stride_pix2); ++ ++ v16 = vsubl_u8(r0,t0); ++ v17 = vsubl_u8(r1,t1); ++ v18 = vsubl_u8(r2,t2); ++ v19 = vsubl_u8(r3,t3); ++ ++ r0 = *(uint8x8_t*)(pix1 + 4*stride_pix1); ++ r1 = *(uint8x8_t*)(pix1 + 5*stride_pix1); ++ r2 = *(uint8x8_t*)(pix1 + 6*stride_pix1); ++ r3 = *(uint8x8_t*)(pix1 + 7*stride_pix1); ++ ++ t0 = *(uint8x8_t*)(pix2 + 4*stride_pix2); ++ t1 = *(uint8x8_t*)(pix2 + 5*stride_pix2); ++ t2 = *(uint8x8_t*)(pix2 + 6*stride_pix2); ++ t3 = *(uint8x8_t*)(pix2 + 7*stride_pix2); ++ ++ v20 = vsubl_u8(r0,t0); ++ v21 = vsubl_u8(r1,t1); ++ v22 = vsubl_u8(r2,t2); ++ v23 = vsubl_u8(r3,t3); ++ ++ ++ SUMSUB_AB (v0, v1, v16, v17); ++ SUMSUB_AB (v2, v3, v18, v19); ++ ++} ++ ++int pixel_satd_4x4_neon(const uint8_t* pix1, intptr_t stride_pix1, const uint8_t* pix2, intptr_t stride_pix2) ++{ ++ uint32x2_t t0,t1,r0,r1; ++ t0[0] = *(uint32_t *)(pix1 + 0*stride_pix1); ++ t1[0] = *(uint32_t *)(pix1 + 1*stride_pix1); ++ t0[1] = *(uint32_t *)(pix1 + 2*stride_pix1); ++ t1[1] = *(uint32_t *)(pix1 + 3*stride_pix1); ++ ++ r0[0] = *(uint32_t *)(pix2 + 0*stride_pix1); ++ r1[0] = *(uint32_t *)(pix2 + 1*stride_pix2); ++ r0[1] = *(uint32_t *)(pix2 + 2*stride_pix2); ++ r1[1] = *(uint32_t *)(pix2 + 3*stride_pix2); ++ ++ return _satd_4x4_neon(vsubl_u8(t0,r0), vsubl_u8(r1,t1)); ++} ++ ++ ++int pixel_satd_8x4_neon(const uint8_t* pix1, intptr_t stride_pix1, const uint8_t* pix2, intptr_t stride_pix2) ++{ ++ uint8x8_t i0,i1,i2,i3,i4,i5,i6,i7; ++ ++ i0 = *(uint8x8_t *)(pix1 + 0*stride_pix1); ++ i1 = *(uint8x8_t *)(pix2 + 0*stride_pix2); ++ i2 = *(uint8x8_t *)(pix1 + 1*stride_pix1); ++ i3 = *(uint8x8_t *)(pix2 + 1*stride_pix2); ++ i4 = *(uint8x8_t *)(pix1 + 2*stride_pix1); ++ i5 = *(uint8x8_t *)(pix2 + 2*stride_pix2); ++ i6 = *(uint8x8_t *)(pix1 + 3*stride_pix1); ++ i7 = *(uint8x8_t *)(pix2 + 3*stride_pix2); ++ ++ int16x8_t v0 = vsubl_u8(i0,i1); ++ int16x8_t v1 = vsubl_u8(i2,i3); ++ int16x8_t v2 = vsubl_u8(i4,i5); ++ int16x8_t v3 = vsubl_u8(i6,i7); ++ ++ return _satd_4x8_8x4_end_neon(v0,v1,v2,v3); ++} ++ ++int pixel_satd_16x16_neon(const uint8_t* pix1, intptr_t stride_pix1, const uint8_t* pix2, intptr_t stride_pix2) ++{ ++ int16x8_t v30,v31; ++ int16x8_t v0,v1,v2,v3; ++ ++ _satd_16x4_neon(pix1,stride_pix1,pix2,stride_pix2,v0,v1,v2,v3); ++ v30 = vaddq_s16(v0,v1); ++ v31 = vaddq_s16(v2,v3); ++ ++ _satd_16x4_neon(pix1 + 4*stride_pix1,stride_pix1,pix2+4*stride_pix2,stride_pix2,v0,v1,v2,v3); ++ v0 = vaddq_s16(v0,v1); ++ v1 = vaddq_s16(v2,v3); ++ v30 = vaddq_s16(v30, v0); ++ v31 = vaddq_s16(v31, v1); ++ ++ _satd_16x4_neon(pix1 + 8*stride_pix1,stride_pix1,pix2+8*stride_pix2,stride_pix2,v0,v1,v2,v3); ++ v0 = vaddq_s16(v0,v1); ++ v1 = vaddq_s16(v2,v3); ++ v30 = vaddq_s16(v30, v0); ++ v31 = vaddq_s16(v31, v1); ++ ++ _satd_16x4_neon(pix1 + 12*stride_pix1,stride_pix1,pix2+12*stride_pix2,stride_pix2,v0,v1,v2,v3); ++ v0 = vaddq_s16(v0,v1); ++ v1 = vaddq_s16(v2,v3); ++ v30 = vaddq_s16(v30, v0); ++ v31 = vaddq_s16(v31, v1); ++ ++ int32x4_t sum0 = vpaddlq_u16(v30); ++ int32x4_t sum1 = vpaddlq_u16(v31); ++ sum0 = vaddq_s32(sum0,sum1); ++ return vaddvq_s32(sum0); ++ ++} ++#endif //HIGH_BIT_DEPTH ++ ++ ++static inline void _sa8d_8x8_neon_end(int16x8_t& v0,int16x8_t& v1,int16x8_t v2,int16x8_t v3, ++ int16x8_t v20,int16x8_t v21,int16x8_t v22,int16x8_t v23) ++{ ++ int16x8_t v16,v17,v18,v19; ++ int16x8_t v4,v5,v6,v7; ++ ++ SUMSUB_AB (v16, v18, v0, v2); ++ SUMSUB_AB (v17, v19, v1, v3); ++ ++ HADAMARD4_V (v20, v21, v22, v23, v0, v1, v2, v3); ++ ++ SUMSUB_AB (v0, v16, v16, v20); ++ SUMSUB_AB (v1, v17, v17, v21); ++ SUMSUB_AB (v2, v18, v18, v22); ++ SUMSUB_AB (v3, v19, v19, v23); ++ ++ transpose_8h (v20, v21, v16, v17); ++ transpose_8h (v4, v5, v0, v1); ++ transpose_8h (v22, v23, v18, v19); ++ transpose_8h (v6, v7, v2, v3); ++ ++#if (X265_DEPTH <= 10) ++ ++ int16x8_t v24,v25; ++ ++ SUMSUB_AB (v2, v3, v20, v21); ++ SUMSUB_AB (v24, v25, v4, v5); ++ SUMSUB_AB (v0, v1, v22, v23); ++ SUMSUB_AB (v4, v5, v6, v7); ++ ++ transpose_4s (v20, v22, v2, v0); ++ transpose_4s (v21, v23, v3, v1); ++ transpose_4s (v16, v18, v24, v4); ++ transpose_4s (v17, v19, v25, v5); ++ ++ SUMSUB_AB (v0, v2, v20, v22); ++ SUMSUB_AB (v1, v3, v21, v23); ++ SUMSUB_AB (v4, v6, v16, v18); ++ SUMSUB_AB (v5, v7, v17, v19); ++ ++ transpose_2d (v16, v20, v0, v4); ++ transpose_2d (v17, v21, v1, v5); ++ transpose_2d (v18, v22, v2, v6); ++ transpose_2d (v19, v23, v3, v7); ++ ++ ++ v16 = vabsq_s16(v16); ++ v17 = vabsq_s16(v17); ++ v18 = vabsq_s16(v18); ++ v19 = vabsq_s16(v19); ++ v20 = vabsq_s16(v20); ++ v21 = vabsq_s16(v21); ++ v22 = vabsq_s16(v22); ++ v23 = vabsq_s16(v23); ++ ++ v16 = vmaxq_u16(v16,v20); ++ v17 = vmaxq_u16(v17,v21); ++ v18 = vmaxq_u16(v18,v22); ++ v19 = vmaxq_u16(v19,v23); ++ ++#if HIGH_BIT_DEPTH ++ v0 = vpaddlq_u16(v16); ++ v1 = vpaddlq_u16(v17); ++ v0 = vpadalq_u16(v0,v18); ++ v1 = vpadalq_u16(v1,v19); ++ ++#else //HIGH_BIT_DEPTH ++ ++ v0 = vaddq_u16(v16,v17); ++ v1 = vaddq_u16(v18,v19); ++ ++#endif //HIGH_BIT_DEPTH ++ ++#else // HIGH_BIT_DEPTH 12 bit only, switching math to int32, each int16x8 is up-convreted to 2 int32x4 (low and high) ++ ++ int32x4_t v2l,v2h,v3l,v3h,v24l,v24h,v25l,v25h,v0l,v0h,v1l,v1h; ++ int32x4_t v22l,v22h,v23l,v23h; ++ int32x4_t v4l,v4h,v5l,v5h; ++ int32x4_t v6l,v6h,v7l,v7h; ++ int32x4_t v16l,v16h,v17l,v17h; ++ int32x4_t v18l,v18h,v19l,v19h; ++ int32x4_t v20l,v20h,v21l,v21h; ++ ++ ISUMSUB_AB_FROM_INT16(v2l, v2h, v3l, v3h, v20, v21); ++ ISUMSUB_AB_FROM_INT16(v24l, v24h, v25l, v25h, v4, v5); ++ ++ v22l = vmovl_s16(vget_low_s16(v22)); ++ v22h = vmovl_high_s16(v22); ++ v23l = vmovl_s16(vget_low_s16(v23)); ++ v23h = vmovl_high_s16(v23); ++ ++ ISUMSUB_AB(v0l, v1l, v22l, v23l); ++ ISUMSUB_AB(v0h, v1h, v22h, v23h); ++ ++ v6l = vmovl_s16(vget_low_s16(v6)); ++ v6h = vmovl_high_s16(v6); ++ v7l = vmovl_s16(vget_low_s16(v7)); ++ v7h = vmovl_high_s16(v7); ++ ++ ISUMSUB_AB (v4l, v5l, v6l, v7l); ++ ISUMSUB_AB (v4h, v5h, v6h, v7h); ++ ++ transpose_2d (v20l, v22l, v2l, v0l); ++ transpose_2d (v21l, v23l, v3l, v1l); ++ transpose_2d (v16l, v18l, v24l, v4l); ++ transpose_2d (v17l, v19l, v25l, v5l); ++ ++ transpose_2d (v20h, v22h, v2h, v0h); ++ transpose_2d (v21h, v23h, v3h, v1h); ++ transpose_2d (v16h, v18h, v24h, v4h); ++ transpose_2d (v17h, v19h, v25h, v5h); ++ ++ ISUMSUB_AB (v0l, v2l, v20l, v22l); ++ ISUMSUB_AB (v1l, v3l, v21l, v23l); ++ ISUMSUB_AB (v4l, v6l, v16l, v18l); ++ ISUMSUB_AB (v5l, v7l, v17l, v19l); ++ ++ ISUMSUB_AB (v0h, v2h, v20h, v22h); ++ ISUMSUB_AB (v1h, v3h, v21h, v23h); ++ ISUMSUB_AB (v4h, v6h, v16h, v18h); ++ ISUMSUB_AB (v5h, v7h, v17h, v19h); ++ ++ v16l = v0l; ++ v16h = v4l; ++ v20l = v0h; ++ v20h = v4h; ++ ++ v17l = v1l; ++ v17h = v5l; ++ v21l = v1h; ++ v21h = v5h; ++ ++ v18l = v2l; ++ v18h = v6l; ++ v22l = v2h; ++ v22h = v6h; ++ ++ v19l = v3l; ++ v19h = v7l; ++ v23l = v3h; ++ v23h = v7h; ++ ++ v16l = vabsq_s32(v16l); ++ v17l = vabsq_s32(v17l); ++ v18l = vabsq_s32(v18l); ++ v19l = vabsq_s32(v19l); ++ v20l = vabsq_s32(v20l); ++ v21l = vabsq_s32(v21l); ++ v22l = vabsq_s32(v22l); ++ v23l = vabsq_s32(v23l); ++ ++ v16h = vabsq_s32(v16h); ++ v17h = vabsq_s32(v17h); ++ v18h = vabsq_s32(v18h); ++ v19h = vabsq_s32(v19h); ++ v20h = vabsq_s32(v20h); ++ v21h = vabsq_s32(v21h); ++ v22h = vabsq_s32(v22h); ++ v23h = vabsq_s32(v23h); ++ ++ v16l = vmaxq_u32(v16l,v20l); ++ v17l = vmaxq_u32(v17l,v21l); ++ v18l = vmaxq_u32(v18l,v22l); ++ v19l = vmaxq_u32(v19l,v23l); ++ ++ v16h = vmaxq_u32(v16h,v20h); ++ v17h = vmaxq_u32(v17h,v21h); ++ v18h = vmaxq_u32(v18h,v22h); ++ v19h = vmaxq_u32(v19h,v23h); ++ ++ v16l = vaddq_u32(v16l,v16h); ++ v17l = vaddq_u32(v17l,v17h); ++ v18l = vaddq_u32(v18l,v18h); ++ v19l = vaddq_u32(v19l,v19h); ++ ++ v0 = vaddq_u32(v16l, v17l); ++ v1 = vaddq_u32(v18l,v19l); ++ ++ ++#endif ++ ++} ++ ++ ++ ++static inline void _satd_8x8_neon(const pixel* pix1, intptr_t stride_pix1, const pixel* pix2, intptr_t stride_pix2, ++ int16x8_t& v0,int16x8_t&v1, int16x8_t&v2,int16x8_t&v3) ++{ ++ ++ int16x8_t v20,v21,v22,v23; ++ _sub_8x8_fly(pix1,stride_pix1,pix2,stride_pix2,v0,v1,v2,v3,v20,v21,v22,v23); ++ _satd_8x4v_8x8h_neon(v0,v1,v2,v3,v20,v21,v22,v23); ++ ++} ++ ++ ++ ++int pixel_satd_8x8_neon(const pixel* pix1, intptr_t stride_pix1, const pixel* pix2, intptr_t stride_pix2) ++{ ++ int16x8_t v30,v31; ++ int16x8_t v0,v1,v2,v3; ++ ++ _satd_8x8_neon(pix1,stride_pix1,pix2,stride_pix2,v0,v1,v2,v3); ++#if !(HIGH_BIT_DEPTH) ++ v30 = vaddq_u16(v0,v1); ++ v31 = vaddq_u16(v2,v3); ++ ++ uint16x8_t sum = vaddq_u16(v30,v31); ++ return vaddvq_s32(vpaddlq_u16(sum)); ++#else ++ ++ v30 = vaddq_u16(v0,v1); ++ v31 = vaddq_u16(v2,v3); ++ ++ int32x4_t sum = vpaddlq_u16(v30); ++ sum = vpadalq_u16(sum, v31); ++ return vaddvq_s32(sum); ++#endif ++} ++ ++ ++int pixel_sa8d_8x8_neon(const pixel* pix1, intptr_t stride_pix1, const pixel* pix2, intptr_t stride_pix2) ++{ ++ int16x8_t v0,v1,v2,v3; ++ int16x8_t v20,v21,v22,v23; ++ ++ _sub_8x8_fly(pix1, stride_pix1, pix2, stride_pix2, v0, v1, v2, v3, v20, v21, v22, v23); ++ _sa8d_8x8_neon_end(v0, v1, v2, v3, v20, v21, v22, v23); ++ ++#if HIGH_BIT_DEPTH ++//#if 1//HIGH_BIT_DEPTH ++ int32x4_t s = vaddq_u32(v0,v1); ++ return (vaddvq_u32(s) + 1) >> 1; ++#else ++ return (vaddlvq_s16(vaddq_u16(v0, v1)) + 1) >> 1; ++#endif ++} ++ ++ ++ ++ ++ ++int pixel_sa8d_16x16_neon(const pixel* pix1, intptr_t stride_pix1, const pixel* pix2, intptr_t stride_pix2) ++{ ++ int16x8_t v0,v1,v2,v3; ++ int16x8_t v20,v21,v22,v23; ++ int32x4_t v30,v31; ++ ++ _sub_8x8_fly(pix1, stride_pix1, pix2, stride_pix2, v0, v1, v2, v3, v20, v21, v22, v23); ++ _sa8d_8x8_neon_end(v0, v1, v2, v3, v20, v21, v22, v23); ++ ++#if !(HIGH_BIT_DEPTH) ++ v30 = vpaddlq_u16(v0); ++ v31 = vpaddlq_u16(v1); ++#else ++ v30 = vaddq_s32(v0,v1); ++#endif ++ ++ _sub_8x8_fly(pix1 + 8, stride_pix1, pix2 + 8, stride_pix2, v0, v1, v2, v3, v20, v21, v22, v23); ++ _sa8d_8x8_neon_end(v0, v1, v2, v3, v20, v21, v22, v23); ++ ++#if !(HIGH_BIT_DEPTH) ++ v30 = vpadalq_u16(v30,v0); ++ v31 = vpadalq_u16(v31,v1); ++#else ++ v31 = vaddq_s32(v0,v1); ++#endif ++ ++ ++ _sub_8x8_fly(pix1 + 8*stride_pix1, stride_pix1, pix2 + 8*stride_pix2, stride_pix2, v0, v1, v2, v3, v20, v21, v22, v23); ++ _sa8d_8x8_neon_end(v0, v1, v2, v3, v20, v21, v22, v23); ++ ++#if !(HIGH_BIT_DEPTH) ++ v30 = vpadalq_u16(v30,v0); ++ v31 = vpadalq_u16(v31,v1); ++#else ++ v30 = vaddq_s32(v30,v0); ++ v31 = vaddq_s32(v31,v1); ++#endif ++ ++ _sub_8x8_fly(pix1 + 8*stride_pix1 + 8, stride_pix1, pix2 + 8*stride_pix2 + 8, stride_pix2, v0, v1, v2, v3, v20, v21, v22, v23); ++ _sa8d_8x8_neon_end(v0, v1, v2, v3, v20, v21, v22, v23); ++ ++#if !(HIGH_BIT_DEPTH) ++ v30 = vpadalq_u16(v30,v0); ++ v31 = vpadalq_u16(v31,v1); ++#else ++ v30 = vaddq_s32(v30,v0); ++ v31 = vaddq_s32(v31,v1); ++#endif ++ ++ v30 = vaddq_u32(v30,v31); ++ ++ return (vaddvq_u32(v30) + 1) >> 1; ++} ++ ++ ++ ++ ++ ++ ++ ++ ++template ++void blockfill_s_neon(int16_t* dst, intptr_t dstride, int16_t val) ++{ ++ for (int y = 0; y < size; y++) { ++ int x = 0; ++ int16x8_t v = vdupq_n_s16(val); ++ for (; (x + 8) <= size; x+=8) { ++ *(int16x8_t*)&dst[y * dstride + x] = v; ++ } ++ for (; x < size; x++) { ++ dst[y * dstride + x] = val; ++ } ++ } ++} ++ ++template ++int sad_pp_neon(const pixel* pix1, intptr_t stride_pix1, const pixel* pix2, intptr_t stride_pix2) ++{ ++ int sum = 0; ++ ++ ++ for (int y = 0; y < ly; y++) ++ { ++#if HIGH_BIT_DEPTH ++ int x=0; ++ uint16x8_t vsum16_1 = vdupq_n_u16(0); ++ for (; (x + 8) <= lx; x+=8) { ++ uint16x8_t p1 = *(uint16x8_t*)&pix1[x]; ++ uint16x8_t p2 = *(uint16x8_t*)&pix2[x]; ++ vsum16_1 = vabaq_s16(vsum16_1,p1,p2); ++ ++ } ++ if (lx & 4) { ++ uint16x4_t p1 = *(uint16x4_t*)&pix1[x]; ++ uint16x4_t p2 = *(uint16x4_t*)&pix2[x]; ++ sum += vaddlv_s16(vaba_s16(vdup_n_s16(0),p1,p2)); ++ x += 4; ++ } ++ if (lx >= 4) { ++ sum += vaddlvq_s16(vsum16_1); ++ } ++ ++#else ++ ++ int x=0; ++ uint16x8_t vsum16_1 = vdupq_n_u16(0); ++ uint16x8_t vsum16_2 = vdupq_n_u16(0); ++ ++ for (; (x + 16) <= lx; x+=16) { ++ uint8x16_t p1 = *(uint8x16_t*)&pix1[x]; ++ uint8x16_t p2 = *(uint8x16_t*)&pix2[x]; ++ vsum16_1 = vabal_u8(vsum16_1,vget_low_u8(p1),vget_low_u8(p2)); ++ vsum16_2 = vabal_high_u8(vsum16_2,p1,p2); ++ } ++ if (lx & 8) { ++ uint8x8_t p1 = *(uint8x8_t*)&pix1[x]; ++ uint8x8_t p2 = *(uint8x8_t*)&pix2[x]; ++ vsum16_1 = vabal_u8(vsum16_1,p1,p2); ++ x += 8; ++ } ++ if (lx & 4) { ++ uint32x2_t p1 = vdup_n_u32(0); ++ p1[0] = *(uint32_t*)&pix1[x]; ++ uint32x2_t p2 = vdup_n_u32(0); ++ p2[0] = *(uint32_t*)&pix2[x]; ++ vsum16_1 = vabal_u8(vsum16_1,p1,p2); ++ x += 4; ++ } ++ if (lx >= 16) { ++ vsum16_1 = vaddq_u16(vsum16_1,vsum16_2); ++ } ++ if (lx >= 4) { ++ sum += vaddvq_u16(vsum16_1); ++ } ++ ++#endif ++ if (lx & 3) for (; x < lx; x++) { ++ sum += abs(pix1[x] - pix2[x]); ++ } ++ ++ pix1 += stride_pix1; ++ pix2 += stride_pix2; ++ } ++ ++ return sum; ++} ++ ++template ++void sad_x3_neon(const pixel* pix1, const pixel* pix2, const pixel* pix3, const pixel* pix4, intptr_t frefstride, int32_t* res) ++{ ++ res[0] = 0; ++ res[1] = 0; ++ res[2] = 0; ++ for (int y = 0; y < ly; y++) ++ { ++ int x = 0; ++ uint16x8_t vsum16_0 = vdupq_n_u16(0); ++ uint16x8_t vsum16_1 = vdupq_n_u16(0); ++ uint16x8_t vsum16_2 = vdupq_n_u16(0); ++#if HIGH_BIT_DEPTH ++ for (; (x + 8) <= lx; x+=8) { ++ uint16x8_t p1 = *(uint16x8_t*)&pix1[x]; ++ uint16x8_t p2 = *(uint16x8_t*)&pix2[x]; ++ uint16x8_t p3 = *(uint16x8_t*)&pix3[x]; ++ uint16x8_t p4 = *(uint16x8_t*)&pix4[x]; ++ vsum16_0 = vabaq_s16(vsum16_0,p1,p2); ++ vsum16_1 = vabaq_s16(vsum16_1,p1,p3); ++ vsum16_2 = vabaq_s16(vsum16_2,p1,p4); ++ ++ } ++ if (lx & 4) { ++ uint16x4_t p1 = *(uint16x4_t*)&pix1[x]; ++ uint16x4_t p2 = *(uint16x4_t*)&pix2[x]; ++ uint16x4_t p3 = *(uint16x4_t*)&pix3[x]; ++ uint16x4_t p4 = *(uint16x4_t*)&pix4[x]; ++ res[0] += vaddlv_s16(vaba_s16(vdup_n_s16(0),p1,p2)); ++ res[1] += vaddlv_s16(vaba_s16(vdup_n_s16(0),p1,p3)); ++ res[2] += vaddlv_s16(vaba_s16(vdup_n_s16(0),p1,p4)); ++ x += 4; ++ } ++ if (lx >= 4) { ++ res[0] += vaddlvq_s16(vsum16_0); ++ res[1] += vaddlvq_s16(vsum16_1); ++ res[2] += vaddlvq_s16(vsum16_2); ++ } ++#else ++ ++ for (; (x + 16) <= lx; x+=16) { ++ uint8x16_t p1 = *(uint8x16_t*)&pix1[x]; ++ uint8x16_t p2 = *(uint8x16_t*)&pix2[x]; ++ uint8x16_t p3 = *(uint8x16_t*)&pix3[x]; ++ uint8x16_t p4 = *(uint8x16_t*)&pix4[x]; ++ vsum16_0 = vabal_u8(vsum16_0,vget_low_u8(p1),vget_low_u8(p2)); ++ vsum16_0 = vabal_high_u8(vsum16_0,p1,p2); ++ vsum16_1 = vabal_u8(vsum16_1,vget_low_u8(p1),vget_low_u8(p3)); ++ vsum16_1 = vabal_high_u8(vsum16_1,p1,p3); ++ vsum16_2 = vabal_u8(vsum16_2,vget_low_u8(p1),vget_low_u8(p4)); ++ vsum16_2 = vabal_high_u8(vsum16_2,p1,p4); ++ } ++ if (lx & 8) { ++ uint8x8_t p1 = *(uint8x8_t*)&pix1[x]; ++ uint8x8_t p2 = *(uint8x8_t*)&pix2[x]; ++ uint8x8_t p3 = *(uint8x8_t*)&pix3[x]; ++ uint8x8_t p4 = *(uint8x8_t*)&pix4[x]; ++ vsum16_0 = vabal_u8(vsum16_0,p1,p2); ++ vsum16_1 = vabal_u8(vsum16_1,p1,p3); ++ vsum16_2 = vabal_u8(vsum16_2,p1,p4); ++ x += 8; ++ } ++ if (lx & 4) { ++ uint32x2_t p1 = vdup_n_u32(0); ++ p1[0] = *(uint32_t*)&pix1[x]; ++ uint32x2_t p2 = vdup_n_u32(0); ++ p2[0] = *(uint32_t*)&pix2[x]; ++ uint32x2_t p3 = vdup_n_u32(0); ++ p3[0] = *(uint32_t*)&pix3[x]; ++ uint32x2_t p4 = vdup_n_u32(0); ++ p4[0] = *(uint32_t*)&pix4[x]; ++ vsum16_0 = vabal_u8(vsum16_0,p1,p2); ++ vsum16_1 = vabal_u8(vsum16_1,p1,p3); ++ vsum16_2 = vabal_u8(vsum16_2,p1,p4); ++ x += 4; ++ } ++ if (lx >= 4) { ++ res[0] += vaddvq_u16(vsum16_0); ++ res[1] += vaddvq_u16(vsum16_1); ++ res[2] += vaddvq_u16(vsum16_2); ++ } ++ ++#endif ++ if (lx & 3) for (; x < lx; x++) ++ { ++ res[0] += abs(pix1[x] - pix2[x]); ++ res[1] += abs(pix1[x] - pix3[x]); ++ res[2] += abs(pix1[x] - pix4[x]); ++ } ++ ++ pix1 += FENC_STRIDE; ++ pix2 += frefstride; ++ pix3 += frefstride; ++ pix4 += frefstride; ++ } ++} ++ ++template ++void sad_x4_neon(const pixel* pix1, const pixel* pix2, const pixel* pix3, const pixel* pix4, const pixel* pix5, intptr_t frefstride, int32_t* res) ++{ ++ res[0] = 0; ++ res[1] = 0; ++ res[2] = 0; ++ res[3] = 0; ++ for (int y = 0; y < ly; y++) ++ { ++ int x=0; ++ uint16x8_t vsum16_0 = vdupq_n_u16(0); ++ uint16x8_t vsum16_1 = vdupq_n_u16(0); ++ uint16x8_t vsum16_2 = vdupq_n_u16(0); ++ uint16x8_t vsum16_3 = vdupq_n_u16(0); ++#if HIGH_BIT_DEPTH ++ for (; (x + 8) <= lx; x+=8) { ++ uint16x8_t p1 = *(uint16x8_t*)&pix1[x]; ++ uint16x8_t p2 = *(uint16x8_t*)&pix2[x]; ++ uint16x8_t p3 = *(uint16x8_t*)&pix3[x]; ++ uint16x8_t p4 = *(uint16x8_t*)&pix4[x]; ++ uint16x8_t p5 = *(uint16x8_t*)&pix5[x]; ++ vsum16_0 = vabaq_s16(vsum16_0,p1,p2); ++ vsum16_1 = vabaq_s16(vsum16_1,p1,p3); ++ vsum16_2 = vabaq_s16(vsum16_2,p1,p4); ++ vsum16_3 = vabaq_s16(vsum16_3,p1,p5); ++ ++ } ++ if (lx & 4) { ++ uint16x4_t p1 = *(uint16x4_t*)&pix1[x]; ++ uint16x4_t p2 = *(uint16x4_t*)&pix2[x]; ++ uint16x4_t p3 = *(uint16x4_t*)&pix3[x]; ++ uint16x4_t p4 = *(uint16x4_t*)&pix4[x]; ++ uint16x4_t p5 = *(uint16x4_t*)&pix5[x]; ++ res[0] += vaddlv_s16(vaba_s16(vdup_n_s16(0),p1,p2)); ++ res[1] += vaddlv_s16(vaba_s16(vdup_n_s16(0),p1,p3)); ++ res[2] += vaddlv_s16(vaba_s16(vdup_n_s16(0),p1,p4)); ++ res[3] += vaddlv_s16(vaba_s16(vdup_n_s16(0),p1,p5)); ++ x += 4; ++ } ++ if (lx >= 4) { ++ res[0] += vaddlvq_s16(vsum16_0); ++ res[1] += vaddlvq_s16(vsum16_1); ++ res[2] += vaddlvq_s16(vsum16_2); ++ res[3] += vaddlvq_s16(vsum16_3); ++ } ++ ++#else ++ ++ for (; (x + 16) <= lx; x+=16) { ++ uint8x16_t p1 = *(uint8x16_t*)&pix1[x]; ++ uint8x16_t p2 = *(uint8x16_t*)&pix2[x]; ++ uint8x16_t p3 = *(uint8x16_t*)&pix3[x]; ++ uint8x16_t p4 = *(uint8x16_t*)&pix4[x]; ++ uint8x16_t p5 = *(uint8x16_t*)&pix5[x]; ++ vsum16_0 = vabal_u8(vsum16_0,vget_low_u8(p1),vget_low_u8(p2)); ++ vsum16_0 = vabal_high_u8(vsum16_0,p1,p2); ++ vsum16_1 = vabal_u8(vsum16_1,vget_low_u8(p1),vget_low_u8(p3)); ++ vsum16_1 = vabal_high_u8(vsum16_1,p1,p3); ++ vsum16_2 = vabal_u8(vsum16_2,vget_low_u8(p1),vget_low_u8(p4)); ++ vsum16_2 = vabal_high_u8(vsum16_2,p1,p4); ++ vsum16_3 = vabal_u8(vsum16_3,vget_low_u8(p1),vget_low_u8(p5)); ++ vsum16_3 = vabal_high_u8(vsum16_3,p1,p5); ++ } ++ if (lx & 8) { ++ uint8x8_t p1 = *(uint8x8_t*)&pix1[x]; ++ uint8x8_t p2 = *(uint8x8_t*)&pix2[x]; ++ uint8x8_t p3 = *(uint8x8_t*)&pix3[x]; ++ uint8x8_t p4 = *(uint8x8_t*)&pix4[x]; ++ uint8x8_t p5 = *(uint8x8_t*)&pix5[x]; ++ vsum16_0 = vabal_u8(vsum16_0,p1,p2); ++ vsum16_1 = vabal_u8(vsum16_1,p1,p3); ++ vsum16_2 = vabal_u8(vsum16_2,p1,p4); ++ vsum16_3 = vabal_u8(vsum16_3,p1,p5); ++ x += 8; ++ } ++ if (lx & 4) { ++ uint32x2_t p1 = vdup_n_u32(0); ++ p1[0] = *(uint32_t*)&pix1[x]; ++ uint32x2_t p2 = vdup_n_u32(0); ++ p2[0] = *(uint32_t*)&pix2[x]; ++ uint32x2_t p3 = vdup_n_u32(0); ++ p3[0] = *(uint32_t*)&pix3[x]; ++ uint32x2_t p4 = vdup_n_u32(0); ++ p4[0] = *(uint32_t*)&pix4[x]; ++ uint32x2_t p5 = vdup_n_u32(0); ++ p5[0] = *(uint32_t*)&pix5[x]; ++ vsum16_0 = vabal_u8(vsum16_0,p1,p2); ++ vsum16_1 = vabal_u8(vsum16_1,p1,p3); ++ vsum16_2 = vabal_u8(vsum16_2,p1,p4); ++ vsum16_3 = vabal_u8(vsum16_3,p1,p5); ++ x += 4; ++ } ++ if (lx >= 4) { ++ res[0] += vaddvq_u16(vsum16_0); ++ res[1] += vaddvq_u16(vsum16_1); ++ res[2] += vaddvq_u16(vsum16_2); ++ res[3] += vaddvq_u16(vsum16_3); ++ } ++ ++#endif ++ if (lx & 3) for (; x < lx; x++) ++ { ++ res[0] += abs(pix1[x] - pix2[x]); ++ res[1] += abs(pix1[x] - pix3[x]); ++ res[2] += abs(pix1[x] - pix4[x]); ++ res[3] += abs(pix1[x] - pix5[x]); ++ } ++ ++ pix1 += FENC_STRIDE; ++ pix2 += frefstride; ++ pix3 += frefstride; ++ pix4 += frefstride; ++ pix5 += frefstride; ++ } ++} ++ ++ ++template ++sse_t sse_neon(const T1* pix1, intptr_t stride_pix1, const T2* pix2, intptr_t stride_pix2) ++{ ++ sse_t sum = 0; ++ ++ int32x4_t vsum1 = vdupq_n_s32(0); ++ int32x4_t vsum2 = vdupq_n_s32(0); ++ for (int y = 0; y < ly; y++) ++ { ++ int x = 0; ++ for (; (x+8) <= lx; x+=8) ++ { ++ int16x8_t tmp; ++ if (sizeof(T1) == 2 && sizeof(T2) == 2) { ++ tmp = vsubq_s16(*(int16x8_t *)&pix1[x],*(int16x8_t *)&pix2[x]); ++ } else if (sizeof(T1) == 1 && sizeof(T2) == 1){ ++ tmp = vsubl_u8(*(uint8x8_t *)&pix1[x],*(uint8x8_t *)&pix2[x]); ++ } ++ else { ++ X265_CHECK(false,"unsupported sse"); ++ } ++ vsum1 = vmlal_s16(vsum1,vget_low_s16(tmp),vget_low_s16(tmp)); ++ vsum2 = vmlal_high_s16(vsum2,tmp,tmp); ++ } ++ for (; x < lx; x++) ++ { ++ int tmp = pix1[x] - pix2[x]; ++ sum += (tmp * tmp); ++ } ++ ++ if (sizeof(T1) == 2 && sizeof(T2) == 2) ++ { ++ int32x4_t vsum = vaddq_u32(vsum1,vsum2);; ++ sum += vaddvq_u32(vsum); ++ vsum1 = vsum2 = vdupq_n_u16(0); ++ } ++ ++ pix1 += stride_pix1; ++ pix2 += stride_pix2; ++ } ++ int32x4_t vsum = vaddq_u32(vsum1,vsum2); ++ ++ return sum + vaddvq_u32(vsum); ++} ++ ++ ++template ++void blockcopy_ps_neon(int16_t* a, intptr_t stridea, const pixel* b, intptr_t strideb) ++{ ++ for (int y = 0; y < by; y++) ++ { ++ int x= 0; ++ for (; (x + 8) <= bx; x+=8) ++ { ++#if HIGH_BIT_DEPTH ++ *(int16x8_t *)&a[x] = *(int16x8_t *)&b[x]; ++#else ++ *(int16x8_t *)&a[x] = vmovl_u8(*(int8x8_t *)&b[x]); ++#endif ++ } ++ for (; x < bx; x++) { ++ a[x] = (int16_t)b[x]; ++ } ++ ++ a += stridea; ++ b += strideb; ++ } ++} ++ ++ ++template ++void blockcopy_pp_neon(pixel* a, intptr_t stridea, const pixel* b, intptr_t strideb) ++{ ++ for (int y = 0; y < by; y++) ++ { ++ int x = 0; ++#if HIGH_BIT_DEPTH ++ for (; (x + 8) <= bx; x+=8) ++ { ++ *(int16x8_t *)&a[x] = *(int16x8_t *)&b[x]; ++ } ++ if (bx & 4) ++ { ++ *(uint64_t *)&a[x] = *(uint64_t *)&b[x]; ++ x += 4; ++ } ++#else ++ for (; (x + 16) <= bx; x+=16) ++ { ++ *(uint8x16_t *)&a[x] = *(uint8x16_t *)&b[x]; ++ } ++ if (bx & 8) ++ { ++ *(uint8x8_t *)&a[x] = *(uint8x8_t *)&b[x]; ++ x += 8; ++ } ++ if (bx & 4) ++ { ++ *(uint32_t *)&a[x] = *(uint32_t *)&b[x]; ++ x += 4; ++ } ++#endif ++ for (; x < bx; x++) { ++ a[x] = b[x]; ++ } ++ ++ a += stridea; ++ b += strideb; ++ } ++} ++ ++ ++template ++void pixel_sub_ps_neon(int16_t* a, intptr_t dstride, const pixel* b0, const pixel* b1, intptr_t sstride0, intptr_t sstride1) ++{ ++ for (int y = 0; y < by; y++) ++ { ++ int x = 0; ++ for (; (x + 8) <= bx; x+=8) { ++#if HIGH_BIT_DEPTH ++ *(int16x8_t *)&a[x] = vsubq_s16(*(int16x8_t *)&b0[x], *(int16x8_t *)&b1[x]); ++#else ++ *(int16x8_t *)&a[x] = vsubl_u8(*(uint8x8_t *)&b0[x], *(uint8x8_t *)&b1[x]); ++#endif ++ } ++ for (; x < bx; x++) ++ a[x] = (int16_t)(b0[x] - b1[x]); ++ ++ b0 += sstride0; ++ b1 += sstride1; ++ a += dstride; ++ } ++} ++ ++template ++void pixel_add_ps_neon(pixel* a, intptr_t dstride, const pixel* b0, const int16_t* b1, intptr_t sstride0, intptr_t sstride1) ++{ ++ for (int y = 0; y < by; y++) ++ { ++ int x = 0; ++ for (; (x + 8) <= bx; x+=8) { ++ int16x8_t t; ++ int16x8_t b1e = *(int16x8_t *)&b1[x]; ++ int16x8_t b0e; ++#if HIGH_BIT_DEPTH ++ b0e = *(int16x8_t *)&b0[x]; ++ t = vaddq_s16(b0e,b1e); ++ t = vminq_s16(t,vdupq_n_s16((1 << X265_DEPTH) - 1)); ++ t = vmaxq_s16(t,vdupq_n_s16(0)); ++ *(int16x8_t *)&a[x] = t; ++#else ++ b0e = vmovl_u8(*(uint8x8_t *)&b0[x]); ++ t = vaddq_s16(b0e,b1e); ++ *(uint8x8_t *)&a[x] = vqmovun_s16(t); ++#endif ++ } ++ for (; x < bx; x++) ++ a[x] = (int16_t)x265_clip(b0[x] + b1[x]); ++ ++ b0 += sstride0; ++ b1 += sstride1; ++ a += dstride; ++ } ++} ++ ++template ++void addAvg_neon(const int16_t* src0, const int16_t* src1, pixel* dst, intptr_t src0Stride, intptr_t src1Stride, intptr_t dstStride) ++{ ++ ++ const int shiftNum = IF_INTERNAL_PREC + 1 - X265_DEPTH; ++ const int offset = (1 << (shiftNum - 1)) + 2 * IF_INTERNAL_OFFS; ++ ++ const int32x4_t addon = vdupq_n_s32(offset); ++ for (int y = 0; y < by; y++) ++ { ++ int x = 0; ++ ++ for (; (x + 8) <= bx; x += 8) ++ { ++ int16x8_t in0 = *(int16x8_t*)&src0[x]; ++ int16x8_t in1 = *(int16x8_t*)&src1[x]; ++ int32x4_t t1 = vaddl_s16(vget_low_s16(in0),vget_low_s16(in1)); ++ int32x4_t t2 = vaddl_high_s16(in0,in1); ++ t1 = vaddq_s32(t1,addon); ++ t2 = vaddq_s32(t2,addon); ++ t1 = vshrq_n_s32(t1,shiftNum); ++ t2 = vshrq_n_s32(t2,shiftNum); ++ int16x8_t t = vuzp1q_s16(t1,t2); ++#if HIGH_BIT_DEPTH ++ t = vminq_s16(t,vdupq_n_s16((1 << X265_DEPTH) - 1)); ++ t = vmaxq_s16(t,vdupq_n_s16(0)); ++ *(int16x8_t *)&dst[x] = t; ++#else ++ *(uint8x8_t *)&dst[x] = vqmovun_s16(t); ++#endif ++ } ++ for (; x < bx; x += 2) ++ { ++ dst[x + 0] = x265_clip((src0[x + 0] + src1[x + 0] + offset) >> shiftNum); ++ dst[x + 1] = x265_clip((src0[x + 1] + src1[x + 1] + offset) >> shiftNum); ++ } ++ ++ src0 += src0Stride; ++ src1 += src1Stride; ++ dst += dstStride; ++ } ++} ++ ++template ++void pixelavg_pp_neon(pixel* dst, intptr_t dstride, const pixel* src0, intptr_t sstride0, const pixel* src1, intptr_t sstride1, int) ++{ ++ for (int y = 0; y < ly; y++) ++ { ++ int x = 0; ++ for (; (x+8) <= lx; x+=8) { ++#if HIGH_BIT_DEPTH ++ int16x8_t in0 = *(int16x8_t *)&src0[x]; ++ int16x8_t in1 = *(int16x8_t *)&src1[x]; ++ int16x8_t t = vaddq_s16(in0,in1); ++ t = vaddq_s16(t,vdupq_n_s16(1)); ++ t = vshrq_n_s16(t,1); ++ *(int16x8_t *)&dst[x] = t; ++#else ++ int16x8_t in0 = vmovl_u8(*(uint8x8_t *)&src0[x]); ++ int16x8_t in1 = vmovl_u8(*(uint8x8_t *)&src1[x]); ++ int16x8_t t = vaddq_s16(in0,in1); ++ t = vaddq_s16(t,vdupq_n_s16(1)); ++ t = vshrq_n_s16(t,1); ++ *(uint8x8_t *)&dst[x] = vmovn_u16(t); ++#endif ++ } ++ for (; x < lx; x++) ++ dst[x] = (src0[x] + src1[x] + 1) >> 1; ++ ++ src0 += sstride0; ++ src1 += sstride1; ++ dst += dstride; ++ } ++} ++ ++ ++template ++void cpy1Dto2D_shl_neon(int16_t* dst, const int16_t* src, intptr_t dstStride, int shift) ++{ ++ X265_CHECK((((intptr_t)dst | (dstStride * sizeof(*dst))) & 15) == 0 || size == 4, "dst alignment error\n"); ++ X265_CHECK(((intptr_t)src & 15) == 0, "src alignment error\n"); ++ X265_CHECK(shift >= 0, "invalid shift\n"); ++ ++ for (int i = 0; i < size; i++) ++ { ++ int j = 0; ++ for (; (j+8) <= size; j+=8) ++ { ++ *(int16x8_t *)&dst[j] = vshlq_s16(*(int16x8_t*)&src[j],vdupq_n_s16(shift)); ++ } ++ for (; j < size; j++) ++ { ++ dst[j] = src[j] << shift; ++ } ++ src += size; ++ dst += dstStride; ++ } ++} ++ ++ ++template ++uint64_t pixel_var_neon(const uint8_t* pix, intptr_t i_stride) ++{ ++ uint32_t sum = 0, sqr = 0; ++ ++ int32x4_t vsqr = vdupq_n_s32(0); ++ for (int y = 0; y < size; y++) ++ { ++ int x = 0; ++ int16x8_t vsum = vdupq_n_s16(0); ++ for (; (x + 8) <= size; x+=8) ++ { ++ int16x8_t in; ++ in = vmovl_u8(*(uint8x8_t*)&pix[x]); ++ vsum = vaddq_u16(vsum,in); ++ vsqr = vmlal_s16(vsqr,vget_low_s16(in),vget_low_s16(in)); ++ vsqr = vmlal_high_s16(vsqr,in,in); ++ } ++ for (; x < size; x++) ++ { ++ sum += pix[x]; ++ sqr += pix[x] * pix[x]; ++ } ++ sum += vaddvq_s16(vsum); ++ ++ pix += i_stride; ++ } ++ sqr += vaddvq_u32(vsqr); ++ return sum + ((uint64_t)sqr << 32); ++} ++ ++template ++void getResidual_neon(const pixel* fenc, const pixel* pred, int16_t* residual, intptr_t stride) ++{ ++ for (int y = 0; y < blockSize; y++) ++ { ++ int x = 0; ++ for (; (x + 8) < blockSize; x+=8) { ++ int16x8_t vfenc,vpred; ++#if HIGH_BIT_DEPTH ++ vfenc = *(int16x8_t *)&fenc[x]; ++ vpred = *(int16x8_t *)&pred[x]; ++#else ++ vfenc = vmovl_u8(*(uint8x8_t *)&fenc[x]); ++ vpred = vmovl_u8(*(uint8x8_t *)&pred[x]); ++#endif ++ *(int16x8_t*)&residual[x] = vsubq_s16(vfenc,vpred); ++ } ++ for (; x < blockSize; x++) { ++ residual[x] = static_cast(fenc[x]) - static_cast(pred[x]); ++ } ++ fenc += stride; ++ residual += stride; ++ pred += stride; ++ } ++} ++ ++#if 1//!(HIGH_BIT_DEPTH) ++template ++int psyCost_pp_neon(const pixel* source, intptr_t sstride, const pixel* recon, intptr_t rstride) ++{ ++ static pixel zeroBuf[8] /* = { 0 } */; ++ ++ if (size) ++ { ++ int dim = 1 << (size + 2); ++ uint32_t totEnergy = 0; ++ for (int i = 0; i < dim; i += 8) ++ { ++ for (int j = 0; j < dim; j+= 8) ++ { ++ /* AC energy, measured by sa8d (AC + DC) minus SAD (DC) */ ++ int sourceEnergy = pixel_sa8d_8x8_neon(source + i * sstride + j, sstride, zeroBuf, 0) - ++ (sad_pp_neon<8, 8>(source + i * sstride + j, sstride, zeroBuf, 0) >> 2); ++ int reconEnergy = pixel_sa8d_8x8_neon(recon + i * rstride + j, rstride, zeroBuf, 0) - ++ (sad_pp_neon<8, 8>(recon + i * rstride + j, rstride, zeroBuf, 0) >> 2); ++ ++ totEnergy += abs(sourceEnergy - reconEnergy); ++ } ++ } ++ return totEnergy; ++ } ++ else ++ { ++ /* 4x4 is too small for sa8d */ ++ int sourceEnergy = pixel_satd_4x4_neon(source, sstride, zeroBuf, 0) - (sad_pp_neon<4, 4>(source, sstride, zeroBuf, 0) >> 2); ++ int reconEnergy = pixel_satd_4x4_neon(recon, rstride, zeroBuf, 0) - (sad_pp_neon<4, 4>(recon, rstride, zeroBuf, 0) >> 2); ++ return abs(sourceEnergy - reconEnergy); ++ } ++} ++ ++ ++template ++// Calculate sa8d in blocks of 8x8 ++int sa8d8(const pixel* pix1, intptr_t i_pix1, const pixel* pix2, intptr_t i_pix2) ++{ ++ int cost = 0; ++ ++ for (int y = 0; y < h; y += 8) ++ for (int x = 0; x < w; x += 8) ++ cost += pixel_sa8d_8x8_neon(pix1 + i_pix1 * y + x, i_pix1, pix2 + i_pix2 * y + x, i_pix2); ++ ++ return cost; ++} ++ ++template ++// Calculate sa8d in blocks of 16x16 ++int sa8d16(const pixel* pix1, intptr_t i_pix1, const pixel* pix2, intptr_t i_pix2) ++{ ++ int cost = 0; ++ ++ for (int y = 0; y < h; y += 16) ++ for (int x = 0; x < w; x += 16) ++ cost += pixel_sa8d_16x16_neon(pix1 + i_pix1 * y + x, i_pix1, pix2 + i_pix2 * y + x, i_pix2); ++ ++ return cost; ++} ++#endif ++ ++template ++void cpy2Dto1D_shl_neon(int16_t* dst, const int16_t* src, intptr_t srcStride, int shift) ++{ ++ X265_CHECK(((intptr_t)dst & 15) == 0, "dst alignment error\n"); ++ X265_CHECK((((intptr_t)src | (srcStride * sizeof(*src))) & 15) == 0 || size == 4, "src alignment error\n"); ++ X265_CHECK(shift >= 0, "invalid shift\n"); ++ ++ for (int i = 0; i < size; i++) ++ { ++ for (int j = 0; j < size; j++) ++ dst[j] = src[j] << shift; ++ ++ src += srcStride; ++ dst += size; ++ } ++} ++ ++ ++#if 1//!(HIGH_BIT_DEPTH) ++template ++// calculate satd in blocks of 4x4 ++int satd4(const pixel* pix1, intptr_t stride_pix1, const pixel* pix2, intptr_t stride_pix2) ++{ ++ int satd = 0; ++ ++ for (int row = 0; row < h; row += 4) ++ for (int col = 0; col < w; col += 4) ++ satd += pixel_satd_4x4_neon(pix1 + row * stride_pix1 + col, stride_pix1, ++ pix2 + row * stride_pix2 + col, stride_pix2); ++ ++ return satd; ++} ++ ++template ++// calculate satd in blocks of 8x4 ++int satd8(const pixel* pix1, intptr_t stride_pix1, const pixel* pix2, intptr_t stride_pix2) ++{ ++ int satd = 0; ++ ++ if (((w | h) & 15) == 0) ++ { ++ for (int row = 0; row < h; row += 16) ++ for (int col = 0; col < w; col += 16) ++ satd += pixel_satd_16x16_neon(pix1 + row * stride_pix1 + col, stride_pix1, ++ pix2 + row * stride_pix2 + col, stride_pix2); ++ ++ } ++ else ++ if (((w | h) & 7) == 0) ++ { ++ for (int row = 0; row < h; row += 8) ++ for (int col = 0; col < w; col += 8) ++ satd += pixel_satd_8x8_neon(pix1 + row * stride_pix1 + col, stride_pix1, ++ pix2 + row * stride_pix2 + col, stride_pix2); ++ ++ } ++ else ++ { ++ for (int row = 0; row < h; row += 4) ++ for (int col = 0; col < w; col += 8) ++ satd += pixel_satd_8x4_neon(pix1 + row * stride_pix1 + col, stride_pix1, ++ pix2 + row * stride_pix2 + col, stride_pix2); ++ } ++ ++ return satd; ++} ++#endif ++ ++ ++template ++void transpose_neon(pixel* dst, const pixel* src, intptr_t stride) ++{ ++ for (int k = 0; k < blockSize; k++) ++ for (int l = 0; l < blockSize; l++) ++ dst[k * blockSize + l] = src[l * stride + k]; ++} ++ ++ ++template<> ++void transpose_neon<8>(pixel* dst, const pixel* src, intptr_t stride) ++{ ++ transpose8x8(dst,src,8,stride); ++} ++ ++template<> ++void transpose_neon<16>(pixel* dst, const pixel* src, intptr_t stride) ++{ ++ transpose16x16(dst,src,16,stride); ++} ++ ++template<> ++void transpose_neon<32>(pixel* dst, const pixel* src, intptr_t stride) ++{ ++ transpose32x32(dst,src,32,stride); ++} ++ ++ ++template<> ++void transpose_neon<64>(pixel* dst, const pixel* src, intptr_t stride) ++{ ++ transpose32x32(dst,src,64,stride); ++ transpose32x32(dst+32*64+32,src+32*stride+32,64,stride); ++ transpose32x32(dst+32*64,src+32,64,stride); ++ transpose32x32(dst+32,src+32*stride,64,stride); ++} ++ ++ ++template ++sse_t pixel_ssd_s_neon(const int16_t* a, intptr_t dstride) ++{ ++ sse_t sum = 0; ++ ++ ++ int32x4_t vsum = vdupq_n_s32(0); ++ ++ for (int y = 0; y < size; y++) ++ { ++ int x = 0; ++ ++ for (; (x + 8) <= size; x+=8) { ++ int16x8_t in = *(int16x8_t*)&a[x]; ++ vsum = vmlal_s16(vsum,vget_low_s16(in),vget_low_s16(in)); ++ vsum = vmlal_high_s16(vsum,(in),(in)); ++ } ++ for (; x < size; x++) { ++ sum += a[x] * a[x]; ++ } ++ ++ a += dstride; ++ } ++ return sum + vaddvq_s32(vsum); ++} ++ ++ ++}; ++ ++ ++ ++ ++namespace X265_NS { ++ ++ ++void setupPixelPrimitives_neon(EncoderPrimitives &p) ++{ ++ #define LUMA_PU(W, H) \ ++ p.pu[LUMA_ ## W ## x ## H].copy_pp = blockcopy_pp_neon; \ ++ p.pu[LUMA_ ## W ## x ## H].addAvg[NONALIGNED] = addAvg_neon; \ ++ p.pu[LUMA_ ## W ## x ## H].addAvg[ALIGNED] = addAvg_neon; \ ++ p.pu[LUMA_ ## W ## x ## H].sad = sad_pp_neon; \ ++ p.pu[LUMA_ ## W ## x ## H].sad_x3 = sad_x3_neon; \ ++ p.pu[LUMA_ ## W ## x ## H].sad_x4 = sad_x4_neon; \ ++ p.pu[LUMA_ ## W ## x ## H].pixelavg_pp[NONALIGNED] = pixelavg_pp_neon; \ ++ p.pu[LUMA_ ## W ## x ## H].pixelavg_pp[ALIGNED] = pixelavg_pp_neon; ++ ++#if !(HIGH_BIT_DEPTH) ++ ++#define LUMA_CU(W, H) \ ++ p.cu[BLOCK_ ## W ## x ## H].sub_ps = pixel_sub_ps_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].add_ps[NONALIGNED] = pixel_add_ps_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].add_ps[ALIGNED] = pixel_add_ps_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].copy_ps = blockcopy_ps_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].copy_pp = blockcopy_pp_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].blockfill_s[NONALIGNED] = blockfill_s_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].blockfill_s[ALIGNED] = blockfill_s_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].cpy2Dto1D_shl = cpy2Dto1D_shl_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].cpy1Dto2D_shl[NONALIGNED] = cpy1Dto2D_shl_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].cpy1Dto2D_shl[ALIGNED] = cpy1Dto2D_shl_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].psy_cost_pp = psyCost_pp_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].transpose = transpose_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].var = pixel_var_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].calcresidual[NONALIGNED] = getResidual_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].calcresidual[ALIGNED] = getResidual_neon; \ ++ ++#else ++ ++ #define LUMA_CU(W, H) \ ++ p.cu[BLOCK_ ## W ## x ## H].sub_ps = pixel_sub_ps_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].add_ps[NONALIGNED] = pixel_add_ps_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].add_ps[ALIGNED] = pixel_add_ps_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].copy_pp = blockcopy_pp_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].copy_ps = blockcopy_ps_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].copy_pp = blockcopy_pp_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].blockfill_s[NONALIGNED] = blockfill_s_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].blockfill_s[ALIGNED] = blockfill_s_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].cpy2Dto1D_shl = cpy2Dto1D_shl_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].cpy1Dto2D_shl[NONALIGNED] = cpy1Dto2D_shl_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].cpy1Dto2D_shl[ALIGNED] = cpy1Dto2D_shl_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].psy_cost_pp = psyCost_pp_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].transpose = transpose_neon; \ ++ /*p.cu[BLOCK_ ## W ## x ## H].var = pixel_var_neon;*/ \ ++ p.cu[BLOCK_ ## W ## x ## H].calcresidual[NONALIGNED] = getResidual_neon; \ ++ p.cu[BLOCK_ ## W ## x ## H].calcresidual[ALIGNED] = getResidual_neon; \ ++ ++ ++ ++#endif ++ ++ ++ LUMA_PU(4, 4); ++ LUMA_PU(8, 8); ++ LUMA_PU(16, 16); ++ LUMA_PU(32, 32); ++ LUMA_PU(64, 64); ++ LUMA_PU(4, 8); ++ LUMA_PU(8, 4); ++ LUMA_PU(16, 8); ++ LUMA_PU(8, 16); ++ LUMA_PU(16, 12); ++ LUMA_PU(12, 16); ++ LUMA_PU(16, 4); ++ LUMA_PU(4, 16); ++ LUMA_PU(32, 16); ++ LUMA_PU(16, 32); ++ LUMA_PU(32, 24); ++ LUMA_PU(24, 32); ++ LUMA_PU(32, 8); ++ LUMA_PU(8, 32); ++ LUMA_PU(64, 32); ++ LUMA_PU(32, 64); ++ LUMA_PU(64, 48); ++ LUMA_PU(48, 64); ++ LUMA_PU(64, 16); ++ LUMA_PU(16, 64); ++ ++ p.pu[LUMA_4x4].satd = pixel_satd_4x4_neon; ++ p.pu[LUMA_8x8].satd = satd8<8, 8>; ++ p.pu[LUMA_8x4].satd = pixel_satd_8x4_neon; ++ p.pu[LUMA_4x8].satd = satd4<4, 8>; ++ p.pu[LUMA_16x16].satd = satd8<16, 16>; ++ p.pu[LUMA_16x8].satd = satd8<16, 8>; ++ p.pu[LUMA_8x16].satd = satd8<8, 16>; ++ p.pu[LUMA_16x12].satd = satd8<16, 12>; ++ p.pu[LUMA_12x16].satd = satd4<12, 16>; ++ p.pu[LUMA_16x4].satd = satd8<16, 4>; ++ p.pu[LUMA_4x16].satd = satd4<4, 16>; ++ p.pu[LUMA_32x32].satd = satd8<32, 32>; ++ p.pu[LUMA_32x16].satd = satd8<32, 16>; ++ p.pu[LUMA_16x32].satd = satd8<16, 32>; ++ p.pu[LUMA_32x24].satd = satd8<32, 24>; ++ p.pu[LUMA_24x32].satd = satd8<24, 32>; ++ p.pu[LUMA_32x8].satd = satd8<32, 8>; ++ p.pu[LUMA_8x32].satd = satd8<8, 32>; ++ p.pu[LUMA_64x64].satd = satd8<64, 64>; ++ p.pu[LUMA_64x32].satd = satd8<64, 32>; ++ p.pu[LUMA_32x64].satd = satd8<32, 64>; ++ p.pu[LUMA_64x48].satd = satd8<64, 48>; ++ p.pu[LUMA_48x64].satd = satd8<48, 64>; ++ p.pu[LUMA_64x16].satd = satd8<64, 16>; ++ p.pu[LUMA_16x64].satd = satd8<16, 64>; ++ ++ ++ LUMA_CU(4, 4); ++ LUMA_CU(8, 8); ++ LUMA_CU(16, 16); ++ LUMA_CU(32, 32); ++ LUMA_CU(64, 64); ++ ++ ++ p.cu[BLOCK_4x4].sa8d = pixel_satd_4x4_neon; ++ p.cu[BLOCK_8x8].sa8d = pixel_sa8d_8x8_neon; ++ p.cu[BLOCK_16x16].sa8d = pixel_sa8d_16x16_neon; ++ p.cu[BLOCK_32x32].sa8d = sa8d16<32, 32>; ++ p.cu[BLOCK_64x64].sa8d = sa8d16<64, 64>; ++ ++ ++ #define CHROMA_PU_420(W, H) \ ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_ ## W ## x ## H].addAvg[NONALIGNED] = addAvg_neon; \ ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_ ## W ## x ## H].addAvg[ALIGNED] = addAvg_neon; \ ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_ ## W ## x ## H].copy_pp = blockcopy_pp_neon; \ ++ ++ ++ CHROMA_PU_420(4, 4); ++ CHROMA_PU_420(8, 8); ++ CHROMA_PU_420(16, 16); ++ CHROMA_PU_420(32, 32); ++ CHROMA_PU_420(4, 2); ++ CHROMA_PU_420(8, 4); ++ CHROMA_PU_420(4, 8); ++ CHROMA_PU_420(8, 6); ++ CHROMA_PU_420(6, 8); ++ CHROMA_PU_420(8, 2); ++ CHROMA_PU_420(2, 8); ++ CHROMA_PU_420(16, 8); ++ CHROMA_PU_420(8, 16); ++ CHROMA_PU_420(16, 12); ++ CHROMA_PU_420(12, 16); ++ CHROMA_PU_420(16, 4); ++ CHROMA_PU_420(4, 16); ++ CHROMA_PU_420(32, 16); ++ CHROMA_PU_420(16, 32); ++ CHROMA_PU_420(32, 24); ++ CHROMA_PU_420(24, 32); ++ CHROMA_PU_420(32, 8); ++ CHROMA_PU_420(8, 32); ++ ++ ++ ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_2x2].satd = NULL; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_4x4].satd = pixel_satd_4x4_neon; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_8x8].satd = satd8<8, 8>; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_16x16].satd = satd8<16, 16>; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_32x32].satd = satd8<32, 32>; ++ ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_4x2].satd = NULL; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_2x4].satd = NULL; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_8x4].satd = pixel_satd_8x4_neon; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_4x8].satd = satd4<4, 8>; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_16x8].satd = satd8<16, 8>; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_8x16].satd = satd8<8, 16>; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_32x16].satd = satd8<32, 16>; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_16x32].satd = satd8<16, 32>; ++ ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_8x6].satd = NULL; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_6x8].satd = NULL; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_8x2].satd = NULL; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_2x8].satd = NULL; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_16x12].satd = satd4<16, 12>; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_12x16].satd = satd4<12, 16>; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_16x4].satd = satd4<16, 4>; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_4x16].satd = satd4<4, 16>; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_32x24].satd = satd8<32, 24>; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_24x32].satd = satd8<24, 32>; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_32x8].satd = satd8<32, 8>; ++ p.chroma[X265_CSP_I420].pu[CHROMA_420_8x32].satd = satd8<8, 32>; ++ ++ ++ #define CHROMA_CU_420(W, H) \ ++ p.chroma[X265_CSP_I420].cu[BLOCK_420_ ## W ## x ## H].sse_pp = sse_neon; \ ++ p.chroma[X265_CSP_I420].cu[BLOCK_420_ ## W ## x ## H].copy_pp = blockcopy_pp_neon; \ ++ p.chroma[X265_CSP_I420].cu[BLOCK_420_ ## W ## x ## H].copy_ps = blockcopy_ps_neon; \ ++ p.chroma[X265_CSP_I420].cu[BLOCK_420_ ## W ## x ## H].sub_ps = pixel_sub_ps_neon; \ ++ p.chroma[X265_CSP_I420].cu[BLOCK_420_ ## W ## x ## H].add_ps[NONALIGNED] = pixel_add_ps_neon; \ ++ p.chroma[X265_CSP_I420].cu[BLOCK_420_ ## W ## x ## H].add_ps[ALIGNED] = pixel_add_ps_neon; ++ ++ ++ CHROMA_CU_420(4, 4) ++ CHROMA_CU_420(8, 8) ++ CHROMA_CU_420(16, 16) ++ CHROMA_CU_420(32, 32) ++ ++ ++ p.chroma[X265_CSP_I420].cu[BLOCK_8x8].sa8d = p.chroma[X265_CSP_I420].pu[CHROMA_420_4x4].satd; ++ p.chroma[X265_CSP_I420].cu[BLOCK_16x16].sa8d = sa8d8<8, 8>; ++ p.chroma[X265_CSP_I420].cu[BLOCK_32x32].sa8d = sa8d16<16, 16>; ++ p.chroma[X265_CSP_I420].cu[BLOCK_64x64].sa8d = sa8d16<32, 32>; ++ ++ ++ #define CHROMA_PU_422(W, H) \ ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_ ## W ## x ## H].addAvg[NONALIGNED] = addAvg_neon; \ ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_ ## W ## x ## H].addAvg[ALIGNED] = addAvg_neon; \ ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_ ## W ## x ## H].copy_pp = blockcopy_pp_neon; \ ++ ++ ++ CHROMA_PU_422(4, 8); ++ CHROMA_PU_422(8, 16); ++ CHROMA_PU_422(16, 32); ++ CHROMA_PU_422(32, 64); ++ CHROMA_PU_422(4, 4); ++ CHROMA_PU_422(2, 8); ++ CHROMA_PU_422(8, 8); ++ CHROMA_PU_422(4, 16); ++ CHROMA_PU_422(8, 12); ++ CHROMA_PU_422(6, 16); ++ CHROMA_PU_422(8, 4); ++ CHROMA_PU_422(2, 16); ++ CHROMA_PU_422(16, 16); ++ CHROMA_PU_422(8, 32); ++ CHROMA_PU_422(16, 24); ++ CHROMA_PU_422(12, 32); ++ CHROMA_PU_422(16, 8); ++ CHROMA_PU_422(4, 32); ++ CHROMA_PU_422(32, 32); ++ CHROMA_PU_422(16, 64); ++ CHROMA_PU_422(32, 48); ++ CHROMA_PU_422(24, 64); ++ CHROMA_PU_422(32, 16); ++ CHROMA_PU_422(8, 64); ++ ++ ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_2x4].satd = NULL; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_4x8].satd = satd4<4, 8>; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_8x16].satd = satd8<8, 16>; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_16x32].satd = satd8<16, 32>; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_32x64].satd = satd8<32, 64>; ++ ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_4x4].satd = pixel_satd_4x4_neon; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_2x8].satd = NULL; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_8x8].satd = satd8<8, 8>; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_4x16].satd = satd4<4, 16>; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_16x16].satd = satd8<16, 16>; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_8x32].satd = satd8<8, 32>; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_32x32].satd = satd8<32, 32>; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_16x64].satd = satd8<16, 64>; ++ ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_8x12].satd = satd4<8, 12>; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_6x16].satd = NULL; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_8x4].satd = satd4<8, 4>; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_2x16].satd = NULL; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_16x24].satd = satd8<16, 24>; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_12x32].satd = satd4<12, 32>; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_16x8].satd = satd8<16, 8>; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_4x32].satd = satd4<4, 32>; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_32x48].satd = satd8<32, 48>; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_24x64].satd = satd8<24, 64>; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_32x16].satd = satd8<32, 16>; ++ p.chroma[X265_CSP_I422].pu[CHROMA_422_8x64].satd = satd8<8, 64>; ++ ++ ++ #define CHROMA_CU_422(W, H) \ ++ p.chroma[X265_CSP_I422].cu[BLOCK_422_ ## W ## x ## H].sse_pp = sse_neon; \ ++ p.chroma[X265_CSP_I422].cu[BLOCK_422_ ## W ## x ## H].copy_pp = blockcopy_pp_neon; \ ++ p.chroma[X265_CSP_I422].cu[BLOCK_422_ ## W ## x ## H].copy_ps = blockcopy_ps_neon; \ ++ p.chroma[X265_CSP_I422].cu[BLOCK_422_ ## W ## x ## H].sub_ps = pixel_sub_ps_neon; \ ++ p.chroma[X265_CSP_I422].cu[BLOCK_422_ ## W ## x ## H].add_ps[NONALIGNED] = pixel_add_ps_neon; \ ++ p.chroma[X265_CSP_I422].cu[BLOCK_422_ ## W ## x ## H].add_ps[ALIGNED] = pixel_add_ps_neon; ++ ++ ++ CHROMA_CU_422(4, 8) ++ CHROMA_CU_422(8, 16) ++ CHROMA_CU_422(16, 32) ++ CHROMA_CU_422(32, 64) ++ ++ p.chroma[X265_CSP_I422].cu[BLOCK_8x8].sa8d = p.chroma[X265_CSP_I422].pu[CHROMA_422_4x8].satd; ++ p.chroma[X265_CSP_I422].cu[BLOCK_16x16].sa8d = sa8d8<8, 16>; ++ p.chroma[X265_CSP_I422].cu[BLOCK_32x32].sa8d = sa8d16<16, 32>; ++ p.chroma[X265_CSP_I422].cu[BLOCK_64x64].sa8d = sa8d16<32, 64>; ++ ++ ++} ++ ++ ++} ++ ++ ++#endif ++ +diff -Naur ./source/common/arm64/pixel-prim.h ../x265_apple_patch/source/common/arm64/pixel-prim.h +--- ./source/common/arm64/pixel-prim.h 1970-01-01 01:00:00.000000000 +0100 ++++ ../x265_apple_patch/source/common/arm64/pixel-prim.h 2021-05-08 13:08:01.000000000 +0100 +@@ -0,0 +1,22 @@ ++#ifndef PIXEL_PRIM_NEON_H__ ++#define PIXEL_PRIM_NEON_H__ ++ ++#include "common.h" ++#include "slicetype.h" // LOWRES_COST_MASK ++#include "primitives.h" ++#include "x265.h" ++ ++ ++ ++namespace X265_NS { ++ ++ ++ ++void setupPixelPrimitives_neon(EncoderPrimitives &p); ++ ++ ++} ++ ++ ++#endif ++ +diff -Naur ./source/common/arm64/pixel.h ../x265_apple_patch/source/common/arm64/pixel.h +--- ./source/common/arm64/pixel.h 1970-01-01 01:00:00.000000000 +0100 ++++ ../x265_apple_patch/source/common/arm64/pixel.h 2021-05-08 13:08:01.000000000 +0100 +@@ -0,0 +1,134 @@ ++/***************************************************************************** ++ * pixel.h: aarch64 pixel metrics ++ ***************************************************************************** ++ * Copyright (C) 2009-2019 x265 project ++ * ++ * Authors: David Conrad ++ * Janne Grunau ++ * ++ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA. ++ * ++ * This program is also available under a commercial proprietary license. ++ * For more information, contact us at licensing@x265.com. ++ *****************************************************************************/ ++ ++#ifndef x265_AARCH64_PIXEL_H ++#define x265_AARCH64_PIXEL_H ++ ++#define x265_pixel_sad_16x16_neon x265_template(pixel_sad_16x16_neon) ++#define x265_pixel_sad_16x8_neon x265_template(pixel_sad_16x8_neon) ++#define x265_pixel_sad_4x16_neon x265_template(pixel_sad_4x16_neon) ++#define x265_pixel_sad_4x4_neon x265_template(pixel_sad_4x4_neon) ++#define x265_pixel_sad_4x8_neon x265_template(pixel_sad_4x8_neon) ++#define x265_pixel_sad_8x16_neon x265_template(pixel_sad_8x16_neon) ++#define x265_pixel_sad_8x4_neon x265_template(pixel_sad_8x4_neon) ++#define x265_pixel_sad_8x8_neon x265_template(pixel_sad_8x8_neon) ++#define x265_pixel_sad_x3_16x16_neon x265_template(pixel_sad_x3_16x16_neon) ++#define x265_pixel_sad_x3_16x8_neon x265_template(pixel_sad_x3_16x8_neon) ++#define x265_pixel_sad_x3_4x4_neon x265_template(pixel_sad_x3_4x4_neon) ++#define x265_pixel_sad_x3_4x8_neon x265_template(pixel_sad_x3_4x8_neon) ++#define x265_pixel_sad_x3_8x16_neon x265_template(pixel_sad_x3_8x16_neon) ++#define x265_pixel_sad_x3_8x4_neon x265_template(pixel_sad_x3_8x4_neon) ++#define x265_pixel_sad_x3_8x8_neon x265_template(pixel_sad_x3_8x8_neon) ++#define x265_pixel_sad_x4_16x16_neon x265_template(pixel_sad_x4_16x16_neon) ++#define x265_pixel_sad_x4_16x8_neon x265_template(pixel_sad_x4_16x8_neon) ++#define x265_pixel_sad_x4_4x4_neon x265_template(pixel_sad_x4_4x4_neon) ++#define x265_pixel_sad_x4_4x8_neon x265_template(pixel_sad_x4_4x8_neon) ++#define x265_pixel_sad_x4_8x16_neon x265_template(pixel_sad_x4_8x16_neon) ++#define x265_pixel_sad_x4_8x4_neon x265_template(pixel_sad_x4_8x4_neon) ++#define x265_pixel_sad_x4_8x8_neon x265_template(pixel_sad_x4_8x8_neon) ++#define x265_pixel_satd_16x16_neon x265_template(pixel_satd_16x16_neon) ++#define x265_pixel_satd_16x8_neon x265_template(pixel_satd_16x8_neon) ++#define x265_pixel_satd_4x16_neon x265_template(pixel_satd_4x16_neon) ++#define x265_pixel_satd_4x4_neon x265_template(pixel_satd_4x4_neon) ++#define x265_pixel_satd_4x8_neon x265_template(pixel_satd_4x8_neon) ++#define x265_pixel_satd_8x16_neon x265_template(pixel_satd_8x16_neon) ++#define x265_pixel_satd_8x4_neon x265_template(pixel_satd_8x4_neon) ++#define x265_pixel_satd_8x8_neon x265_template(pixel_satd_8x8_neon) ++#define x265_pixel_ssd_16x16_neon x265_template(pixel_ssd_16x16_neon) ++#define x265_pixel_ssd_16x8_neon x265_template(pixel_ssd_16x8_neon) ++#define x265_pixel_ssd_4x16_neon x265_template(pixel_ssd_4x16_neon) ++#define x265_pixel_ssd_4x4_neon x265_template(pixel_ssd_4x4_neon) ++#define x265_pixel_ssd_4x8_neon x265_template(pixel_ssd_4x8_neon) ++#define x265_pixel_ssd_8x16_neon x265_template(pixel_ssd_8x16_neon) ++#define x265_pixel_ssd_8x4_neon x265_template(pixel_ssd_8x4_neon) ++#define x265_pixel_ssd_8x8_neon x265_template(pixel_ssd_8x8_neon) ++#define DECL_PIXELS( ret, name, suffix, args ) \ ++ ret x265_pixel_##name##_16x16_##suffix args;\ ++ ret x265_pixel_##name##_16x8_##suffix args;\ ++ ret x265_pixel_##name##_8x16_##suffix args;\ ++ ret x265_pixel_##name##_8x8_##suffix args;\ ++ ret x265_pixel_##name##_8x4_##suffix args;\ ++ ret x265_pixel_##name##_4x16_##suffix args;\ ++ ret x265_pixel_##name##_4x8_##suffix args;\ ++ ret x265_pixel_##name##_4x4_##suffix args;\ ++ ++#define DECL_X1( name, suffix ) \ ++ DECL_PIXELS( int, name, suffix, ( uint8_t *, intptr_t, uint8_t *, intptr_t ) ) ++ ++#define DECL_X4( name, suffix ) \ ++ DECL_PIXELS( void, name##_x3, suffix, ( uint8_t *, uint8_t *, uint8_t *, uint8_t *, intptr_t, int * ) )\ ++ DECL_PIXELS( void, name##_x4, suffix, ( uint8_t *, uint8_t *, uint8_t *, uint8_t *, uint8_t *, intptr_t, int * ) ) ++ ++DECL_X1( sad, neon ) ++DECL_X4( sad, neon ) ++DECL_X1( satd, neon ) ++DECL_X1( ssd, neon ) ++ ++ ++#define x265_pixel_ssd_nv12_core_neon x265_template(pixel_ssd_nv12_core_neon) ++void x265_pixel_ssd_nv12_core_neon( uint8_t *, intptr_t, uint8_t *, intptr_t, int, int, uint64_t *, uint64_t * ); ++ ++#define x265_pixel_vsad_neon x265_template(pixel_vsad_neon) ++int x265_pixel_vsad_neon( uint8_t *, intptr_t, int ); ++ ++#define x265_pixel_sa8d_8x8_neon x265_template(pixel_sa8d_8x8_neon) ++int x265_pixel_sa8d_8x8_neon ( uint8_t *, intptr_t, uint8_t *, intptr_t ); ++#define x265_pixel_sa8d_16x16_neon x265_template(pixel_sa8d_16x16_neon) ++int x265_pixel_sa8d_16x16_neon( uint8_t *, intptr_t, uint8_t *, intptr_t ); ++#define x265_pixel_sa8d_satd_16x16_neon x265_template(pixel_sa8d_satd_16x16_neon) ++uint64_t x265_pixel_sa8d_satd_16x16_neon( uint8_t *, intptr_t, uint8_t *, intptr_t ); ++ ++#define x265_pixel_var_8x8_neon x265_template(pixel_var_8x8_neon) ++uint64_t x265_pixel_var_8x8_neon ( uint8_t *, intptr_t ); ++#define x265_pixel_var_8x16_neon x265_template(pixel_var_8x16_neon) ++uint64_t x265_pixel_var_8x16_neon ( uint8_t *, intptr_t ); ++#define x265_pixel_var_16x16_neon x265_template(pixel_var_16x16_neon) ++uint64_t x265_pixel_var_16x16_neon( uint8_t *, intptr_t ); ++#define x265_pixel_var2_8x8_neon x265_template(pixel_var2_8x8_neon) ++int x265_pixel_var2_8x8_neon ( uint8_t *, uint8_t *, int * ); ++#define x265_pixel_var2_8x16_neon x265_template(pixel_var2_8x16_neon) ++int x265_pixel_var2_8x16_neon( uint8_t *, uint8_t *, int * ); ++ ++#define x265_pixel_hadamard_ac_8x8_neon x265_template(pixel_hadamard_ac_8x8_neon) ++uint64_t x265_pixel_hadamard_ac_8x8_neon ( uint8_t *, intptr_t ); ++#define x265_pixel_hadamard_ac_8x16_neon x265_template(pixel_hadamard_ac_8x16_neon) ++uint64_t x265_pixel_hadamard_ac_8x16_neon ( uint8_t *, intptr_t ); ++#define x265_pixel_hadamard_ac_16x8_neon x265_template(pixel_hadamard_ac_16x8_neon) ++uint64_t x265_pixel_hadamard_ac_16x8_neon ( uint8_t *, intptr_t ); ++#define x265_pixel_hadamard_ac_16x16_neon x265_template(pixel_hadamard_ac_16x16_neon) ++uint64_t x265_pixel_hadamard_ac_16x16_neon( uint8_t *, intptr_t ); ++ ++#define x265_pixel_ssim_4x4x2_core_neon x265_template(pixel_ssim_4x4x2_core_neon) ++void x265_pixel_ssim_4x4x2_core_neon( const uint8_t *, intptr_t, ++ const uint8_t *, intptr_t, ++ int sums[2][4] ); ++#define x265_pixel_ssim_end4_neon x265_template(pixel_ssim_end4_neon) ++float x265_pixel_ssim_end4_neon( int sum0[5][4], int sum1[5][4], int width ); ++ ++#define x265_pixel_asd8_neon x265_template(pixel_asd8_neon) ++int x265_pixel_asd8_neon( uint8_t *, intptr_t, uint8_t *, intptr_t, int ); ++ ++#endif +diff -Naur ./source/common/cpu.cpp ../x265_apple_patch/source/common/cpu.cpp +--- ./source/common/cpu.cpp 2021-05-08 13:06:22.000000000 +0100 ++++ ../x265_apple_patch/source/common/cpu.cpp 2021-05-08 13:08:01.000000000 +0100 +@@ -104,7 +104,8 @@ + { "ARMv6", X265_CPU_ARMV6 }, + { "NEON", X265_CPU_NEON }, + { "FastNeonMRC", X265_CPU_FAST_NEON_MRC }, +- ++#elif X265_ARCH_ARM64 ++ { "NEON", X265_CPU_NEON }, + #elif X265_ARCH_POWER8 + { "Altivec", X265_CPU_ALTIVEC }, + +@@ -374,6 +375,18 @@ + #endif // if HAVE_ARMV6 + return flags; + } ++#elif X265_ARCH_ARM64 ++ ++uint32_t cpu_detect(bool benableavx512) ++{ ++ int flags = 0; ++ ++#if HAVE_NEON ++ flags |= X265_CPU_NEON; ++#endif ++ ++ return flags; ++} + + #elif X265_ARCH_POWER8 + +diff -Naur ./source/common/pixel.cpp ../x265_apple_patch/source/common/pixel.cpp +--- ./source/common/pixel.cpp 2021-05-08 13:06:22.000000000 +0100 ++++ ../x265_apple_patch/source/common/pixel.cpp 2021-05-08 13:08:01.000000000 +0100 +@@ -266,7 +266,7 @@ + { + int satd = 0; + +-#if ENABLE_ASSEMBLY && X265_ARCH_ARM64 ++#if ENABLE_ASSEMBLY && X265_ARCH_ARM64 && 0 + pixelcmp_t satd_4x4 = x265_pixel_satd_4x4_neon; + #endif + +@@ -284,7 +284,7 @@ + { + int satd = 0; + +-#if ENABLE_ASSEMBLY && X265_ARCH_ARM64 ++#if ENABLE_ASSEMBLY && X265_ARCH_ARM64 && 0 + pixelcmp_t satd_8x4 = x265_pixel_satd_8x4_neon; + #endif + +diff -Naur ./source/common/version.cpp ../x265_apple_patch/source/common/version.cpp +--- ./source/common/version.cpp 2021-05-08 13:06:22.000000000 +0100 ++++ ../x265_apple_patch/source/common/version.cpp 2021-05-08 13:47:38.000000000 +0100 +@@ -31,7 +31,7 @@ + + #if defined(__clang__) + #define COMPILEDBY "[clang " XSTR(__clang_major__) "." XSTR(__clang_minor__) "." XSTR(__clang_patchlevel__) "]" +-#ifdef __IA64__ ++#ifdef __IA64__ || __arm64__ || __aarch64__ + #define ONARCH "[on 64-bit] " + #else + #define ONARCH "[on 32-bit] " +@@ -71,7 +71,7 @@ + #define ONOS "[Unk-OS]" + #endif + +-#if X86_64 ++#if X86_64 || __arm64__ || __aarch64__ + #define BITS "[64 bit]" + #else + #define BITS "[32 bit]" +diff -Naur ./source/test/testharness.h ../x265_apple_patch/source/test/testharness.h +--- ./source/test/testharness.h 2021-05-08 13:06:22.000000000 +0100 ++++ ../x265_apple_patch/source/test/testharness.h 2021-05-08 13:08:01.000000000 +0100 +@@ -64,7 +64,6 @@ + + uint64_t m_rand; + }; +- + #ifdef _MSC_VER + #include + #elif HAVE_RDTSC +@@ -73,7 +72,7 @@ + #include + #elif ( !defined(__APPLE__) && defined (__GNUC__) && defined(__ARM_NEON__)) + #include +-#elif defined(__GNUC__) && (!defined(__clang__) || __clang_major__ < 4) ++#else + /* fallback for older GCC/MinGW */ + static inline uint32_t __rdtsc(void) + { +@@ -90,6 +89,12 @@ + + // TO-DO: replace clock() function with appropriate ARM cpu instructions + a = clock(); ++#elif X265_ARCH_ARM64 ++ // TOD-DO: verify following inline asm to get cpu Timestamp Counter for ARM arch ++ // asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(a)); ++ ++ // TO-DO: replace clock() function with appropriate ARM cpu instructions ++ a = clock(); + #endif + #endif + return a; +@@ -140,7 +145,7 @@ + * needs an explicit asm check because it only sometimes crashes in normal use. */ + intptr_t PFX(checkasm_call)(intptr_t (*func)(), int *ok, ...); + float PFX(checkasm_call_float)(float (*func)(), int *ok, ...); +-#elif X265_ARCH_ARM == 0 ++#elif (X265_ARCH_ARM == 0 && X265_ARCH_ARM64 == 0) + #define PFX(stack_pagealign)(func, align) func() + #endif + +diff -Naur ./source/test/testharness.h.orig ../x265_apple_patch/source/test/testharness.h.orig +--- ./source/test/testharness.h.orig 1970-01-01 01:00:00.000000000 +0100 ++++ ../x265_apple_patch/source/test/testharness.h.orig 2021-05-08 13:08:01.000000000 +0100 +@@ -0,0 +1,184 @@ ++/***************************************************************************** ++ * Copyright (C) 2013-2020 MulticoreWare, Inc ++ * ++ * Authors: Steve Borho ++ * Min Chen ++ * Yimeng Su ++ * ++ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA. ++ * ++ * This program is also available under a commercial proprietary license. ++ * For more information, contact us at license @ x265.com. ++ *****************************************************************************/ ++ ++#ifndef _TESTHARNESS_H_ ++#define _TESTHARNESS_H_ 1 ++ ++#include "common.h" ++#include "primitives.h" ++ ++#if _MSC_VER ++#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) ++#endif ++ ++#define PIXEL_MIN 0 ++#define SHORT_MAX 32767 ++#define SHORT_MIN -32767 ++#define UNSIGNED_SHORT_MAX 65535 ++ ++using namespace X265_NS; ++ ++extern const char* lumaPartStr[NUM_PU_SIZES]; ++extern const char* const* chromaPartStr[X265_CSP_COUNT]; ++ ++class TestHarness ++{ ++public: ++ ++ TestHarness() {} ++ ++ virtual ~TestHarness() {} ++ ++ virtual bool testCorrectness(const EncoderPrimitives& ref, const EncoderPrimitives& opt) = 0; ++ ++ virtual void measureSpeed(const EncoderPrimitives& ref, const EncoderPrimitives& opt) = 0; ++ ++ virtual const char *getName() const = 0; ++ ++protected: ++ ++ /* Temporary variables for stack checks */ ++ int m_ok; ++ ++ uint64_t m_rand; ++}; ++ ++#ifdef _MSC_VER ++#include ++#elif HAVE_RDTSC ++#include ++#elif (!defined(__APPLE__) && (defined (__GNUC__) && (defined(__x86_64__) || defined(__i386__)))) ++#include ++#elif ( !defined(__APPLE__) && defined (__GNUC__) && defined(__ARM_NEON__)) ++#include ++#elif defined(__GNUC__) && (!defined(__clang__) || __clang_major__ < 4) ++/* fallback for older GCC/MinGW */ ++static inline uint32_t __rdtsc(void) ++{ ++ uint32_t a = 0; ++ ++#if X265_ARCH_X86 ++ asm volatile("rdtsc" : "=a" (a) ::"edx"); ++#elif X265_ARCH_ARM ++#if X265_ARCH_ARM64 ++ asm volatile("mrs %0, cntvct_el0" : "=r"(a)); ++#else ++ // TOD-DO: verify following inline asm to get cpu Timestamp Counter for ARM arch ++ // asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(a)); ++ ++ // TO-DO: replace clock() function with appropriate ARM cpu instructions ++ a = clock(); ++#endif ++#endif ++ return a; ++} ++#endif // ifdef _MSC_VER ++ ++#define BENCH_RUNS 2000 ++ ++/* Adapted from checkasm.c, runs each optimized primitive four times, measures rdtsc ++ * and discards invalid times. Repeats BENCH_RUNS times to get a good average. ++ * Then measures the C reference with BENCH_RUNS / 4 runs and reports X factor and average cycles.*/ ++#define REPORT_SPEEDUP(RUNOPT, RUNREF, ...) \ ++ { \ ++ uint32_t cycles = 0; int runs = 0; \ ++ RUNOPT(__VA_ARGS__); \ ++ for (int ti = 0; ti < BENCH_RUNS; ti++) { \ ++ uint32_t t0 = (uint32_t)__rdtsc(); \ ++ RUNOPT(__VA_ARGS__); \ ++ RUNOPT(__VA_ARGS__); \ ++ RUNOPT(__VA_ARGS__); \ ++ RUNOPT(__VA_ARGS__); \ ++ uint32_t t1 = (uint32_t)__rdtsc() - t0; \ ++ if (t1 * runs <= cycles * 4 && ti > 0) { cycles += t1; runs++; } \ ++ } \ ++ uint32_t refcycles = 0; int refruns = 0; \ ++ RUNREF(__VA_ARGS__); \ ++ for (int ti = 0; ti < BENCH_RUNS / 4; ti++) { \ ++ uint32_t t0 = (uint32_t)__rdtsc(); \ ++ RUNREF(__VA_ARGS__); \ ++ RUNREF(__VA_ARGS__); \ ++ RUNREF(__VA_ARGS__); \ ++ RUNREF(__VA_ARGS__); \ ++ uint32_t t1 = (uint32_t)__rdtsc() - t0; \ ++ if (t1 * refruns <= refcycles * 4 && ti > 0) { refcycles += t1; refruns++; } \ ++ } \ ++ x265_emms(); \ ++ float optperf = (10.0f * cycles / runs) / 4; \ ++ float refperf = (10.0f * refcycles / refruns) / 4; \ ++ printf("\t%3.2fx ", refperf / optperf); \ ++ printf("\t %-8.2lf \t %-8.2lf\n", optperf, refperf); \ ++ } ++ ++extern "C" { ++#if X265_ARCH_X86 ++int PFX(stack_pagealign)(int (*func)(), int align); ++ ++/* detect when callee-saved regs aren't saved ++ * needs an explicit asm check because it only sometimes crashes in normal use. */ ++intptr_t PFX(checkasm_call)(intptr_t (*func)(), int *ok, ...); ++float PFX(checkasm_call_float)(float (*func)(), int *ok, ...); ++#elif X265_ARCH_ARM == 0 ++#define PFX(stack_pagealign)(func, align) func() ++#endif ++ ++#if X86_64 ++ ++/* Evil hack: detect incorrect assumptions that 32-bit ints are zero-extended to 64-bit. ++ * This is done by clobbering the stack with junk around the stack pointer and calling the ++ * assembly function through x265_checkasm_call with added dummy arguments which forces all ++ * real arguments to be passed on the stack and not in registers. For 32-bit argument the ++ * upper half of the 64-bit register location on the stack will now contain junk. Note that ++ * this is dependent on compiler behavior and that interrupts etc. at the wrong time may ++ * overwrite the junk written to the stack so there's no guarantee that it will always ++ * detect all functions that assumes zero-extension. ++ */ ++void PFX(checkasm_stack_clobber)(uint64_t clobber, ...); ++#define checked(func, ...) ( \ ++ m_ok = 1, m_rand = (rand() & 0xffff) * 0x0001000100010001ULL, \ ++ PFX(checkasm_stack_clobber)(m_rand, m_rand, m_rand, m_rand, m_rand, m_rand, m_rand, m_rand, \ ++ m_rand, m_rand, m_rand, m_rand, m_rand, m_rand, m_rand, m_rand, \ ++ m_rand, m_rand, m_rand, m_rand, m_rand), /* max_args+6 */ \ ++ PFX(checkasm_call)((intptr_t(*)())func, &m_ok, 0, 0, 0, 0, __VA_ARGS__)) ++ ++#define checked_float(func, ...) ( \ ++ m_ok = 1, m_rand = (rand() & 0xffff) * 0x0001000100010001ULL, \ ++ PFX(checkasm_stack_clobber)(m_rand, m_rand, m_rand, m_rand, m_rand, m_rand, m_rand, m_rand, \ ++ m_rand, m_rand, m_rand, m_rand, m_rand, m_rand, m_rand, m_rand, \ ++ m_rand, m_rand, m_rand, m_rand, m_rand), /* max_args+6 */ \ ++ PFX(checkasm_call_float)((float(*)())func, &m_ok, 0, 0, 0, 0, __VA_ARGS__)) ++#define reportfail() if (!m_ok) { fflush(stdout); fprintf(stderr, "stack clobber check failed at %s:%d", __FILE__, __LINE__); abort(); } ++#elif ARCH_X86 ++#define checked(func, ...) PFX(checkasm_call)((intptr_t(*)())func, &m_ok, __VA_ARGS__); ++#define checked_float(func, ...) PFX(checkasm_call_float)((float(*)())func, &m_ok, __VA_ARGS__); ++ ++#else // if X86_64 ++#define checked(func, ...) func(__VA_ARGS__) ++#define checked_float(func, ...) func(__VA_ARGS__) ++#define reportfail() ++#endif // if X86_64 ++} ++ ++#endif // ifndef _TESTHARNESS_H_ diff --git a/cinelerra-5.1/thirdparty/src/x265_3.517122023.tar.gz b/cinelerra-5.1/thirdparty/src/x265_3.517122023.tar.gz new file mode 100644 index 00000000..19b5bab1 Binary files /dev/null and b/cinelerra-5.1/thirdparty/src/x265_3.517122023.tar.gz differ diff --git a/cinelerra-5.1/tools/makeappimagetool/appdir_root_setup.cpp b/cinelerra-5.1/tools/makeappimagetool/appdir_root_setup.cpp index a8576093..9ddf551e 100644 --- a/cinelerra-5.1/tools/makeappimagetool/appdir_root_setup.cpp +++ b/cinelerra-5.1/tools/makeappimagetool/appdir_root_setup.cpp @@ -1,4 +1,5 @@ // local headers +#include #include "includes/util.h" #include "includes/log.h" #include "includes/appdir_root_setup.h" diff --git a/cinelerra-5.1/tools/makeappimagetool/subprocess.cpp b/cinelerra-5.1/tools/makeappimagetool/subprocess.cpp index 0dcfd6b4..bd3ee62b 100644 --- a/cinelerra-5.1/tools/makeappimagetool/subprocess.cpp +++ b/cinelerra-5.1/tools/makeappimagetool/subprocess.cpp @@ -6,6 +6,7 @@ #include #include #include +#include // local headers #include "includes/subprocess.h"