Credit Flac team + Andrew gui mods and Alac render formats
authorGood Guy <[email protected]>
Wed, 21 Sep 2022 01:25:09 +0000 (19:25 -0600)
committerGood Guy <[email protected]>
Wed, 21 Sep 2022 01:25:09 +0000 (19:25 -0600)
13 files changed:
cinelerra-5.1/cinelerra/asset.C
cinelerra-5.1/cinelerra/asset.h
cinelerra-5.1/cinelerra/fileflac.C
cinelerra-5.1/cinelerra/fileflac.h
cinelerra-5.1/cinelerra/fileflac.inc
cinelerra-5.1/configure.ac
cinelerra-5.1/ffmpeg/audio/alac.m4a [new file with mode: 0644]
cinelerra-5.1/ffmpeg/audio/alac.mkv [new file with mode: 0644]
cinelerra-5.1/ffmpeg/audio/alac.qt [new file with mode: 0644]
cinelerra-5.1/ffmpeg/audio/m4a.dfl [new file with mode: 0644]
cinelerra-5.1/guicast/Makefile
cinelerra-5.1/thirdparty/Makefile
cinelerra-5.1/thirdparty/src/flac-1.4.0.tar.xz [new file with mode: 0644]

index c4301af0a30a2c3be033530844d424f2ac05d93d..59454153a5b92ea40079a5b334b48c86e905a6da 100644 (file)
@@ -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);
index bb40ed4a32957a3577c2f021e6eff6bde48e346a..c1ee17c518e1884b509a2f21815168ee6788b47e 100644 (file)
@@ -224,9 +224,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;
 
index 94538037746188f78eb553fe697157791082b2ee..946c9d84a790e1240ff8fd36aa9e8fe35cb6fc88 100644 (file)
@@ -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);
index e85b64cf84fa57b3efe912619519c768e2387c3e..5bb87f18432cda7f18b2919354f921c7dacc07d3 100644 (file)
@@ -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
index 44feed4a8493d245402b97d96f398c624a2d006e..9e5fd31eb607f7efb212fc00cb9fa2cc9b2c435f 100644 (file)
@@ -23,7 +23,7 @@
 #define FILEFLAC_INC
 
 class FileFLAC;
-
+class FLACCompression;
 
 
 #endif
index ab06ace919e39c05b831b723690f44ecb2f27391..33e2fbfb15ee8b6d22aa314a18ae6789780cb337 100644 (file)
@@ -255,7 +255,7 @@ PKG_3RD([fftw],[auto],
   [ api ])
 
 PKG_3RD([flac],[auto],
-  [flac-1.3.2],
+  [flac-1.4.0],
   [ src/libFLAC/.libs/libFLAC.a \
     src/libFLAC++/.libs/libFLAC++.a \
     src/share/replaygain_analysis/.libs/libreplaygain_analysis.a \
diff --git a/cinelerra-5.1/ffmpeg/audio/alac.m4a b/cinelerra-5.1/ffmpeg/audio/alac.m4a
new file mode 100644 (file)
index 0000000..e222b98
--- /dev/null
@@ -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 (file)
index 0000000..b8291cc
--- /dev/null
@@ -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 (file)
index 0000000..8ec0dc2
--- /dev/null
@@ -0,0 +1,3 @@
+mov alac
+# Apple Lossless Audio Codec
+strict -2
diff --git a/cinelerra-5.1/ffmpeg/audio/m4a.dfl b/cinelerra-5.1/ffmpeg/audio/m4a.dfl
new file mode 100644 (file)
index 0000000..4dc3770
--- /dev/null
@@ -0,0 +1 @@
+alac.m4a
index 354b40b2fb9493b7470f96130ccc070edddccb3e..04d5a2e58dc452c0f9b02a09b99f447bae5d0a15 100644 (file)
@@ -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
index 504acb4a514b4c6ab250ce5a6fff9cb992eee6ab..159e9b01995aaaa0e02478e612081df1e11dc01d 100644 (file)
@@ -193,8 +193,9 @@ djbfft.cfg_vars?=echo "$(call bld_path,djbfft)" > conf-home; \
  (CFLAGS="$(CFLAGS)"; $(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_vars?= CFLAGS+=" -O3 -funroll-loops " CPPFLAGS+=" -DNDEBUG " CXXFLAGS+=" -O2 "
 flac.cfg_params?= --enable-shared=no
 flac.cflags?="$(call inc_path,libogg) $(call ld_path,libogg,src/.libs)"
 ffnvcodec.cfg_vars=echo "exec true" > ./configure; chmod +x ./configure;
diff --git a/cinelerra-5.1/thirdparty/src/flac-1.4.0.tar.xz b/cinelerra-5.1/thirdparty/src/flac-1.4.0.tar.xz
new file mode 100644 (file)
index 0000000..180000b
Binary files /dev/null and b/cinelerra-5.1/thirdparty/src/flac-1.4.0.tar.xz differ