Ver código fonte

Added jxl writer.

Brucey 2 anos atrás
pai
commit
9d22cdb9dd

+ 95 - 0
jxlwriter.mod/common.bmx

@@ -0,0 +1,95 @@
+'
+' Copyright (c) 2022 Bruce A Henderson
+' 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 the author 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 AUTHOR "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 AUTHOR 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.
+'
+SuperStrict
+
+Import Image.JXL
+Import Image.CMS
+
+Import "source.bmx"
+
+Extern
+
+	Function JxlEncoderVersion:UInt()
+	Function JxlEncoderCreate:Byte Ptr(mem:Byte Ptr)
+	Function JxlEncoderReset(handle:Byte Ptr)
+	Function JxlEncoderDestroy(handle:Byte Ptr)
+	Function JxlEncoderInitBasicInfo(info:SJxlBasicInfo Var)
+	Function JxlEncoderSetBasicInfo:Int(handle:Byte Ptr, info:SJxlBasicInfo Var)
+	Function JxlColorEncodingSetToSRGB(encoding:SJxlColorEncoding Var, isGrey:Int)
+	Function JxlEncoderSetColorEncoding:Int(handler:Byte Ptr, color:SJxlColorEncoding Var)
+	Function JxlEncoderAddImageFrame:Int(settings:Byte Ptr, pixel_format:SJxlPixelFormat Var, pixels:Byte Ptr, size:Size_T)
+	Function JxlEncoderProcessOutput:Int(handle:Byte Ptr, next_out:Byte Ptr Ptr, avail_out:Size_T Var)
+	Function JxlEncoderCloseInput(handle:Byte Ptr)
+
+	Function JxlEncoderFrameSettingsCreate:Byte Ptr(handler:Byte Ptr, source:Byte Ptr)
+	Function JxlEncoderSetFrameDistance:Int(frame_settings:Byte Ptr, distance:Float)
+	Function JxlEncoderFrameSettingsSetOption:Int(frame_settings:Byte Ptr, option:EJxlEncoderFrameSettingId, value:Int)
+	Function JxlEncoderSetFrameLossless:Int(frame_settings:Byte Ptr, lossless:Int)
+
+	Function bmx_jxl_JxlEncoderSetParallelRunner:Int(handle:Byte Ptr, runner:Byte Ptr)
+
+End Extern
+
+Const JXL_ENC_SUCCESS:Int = 0
+Const JXL_ENC_ERROR:Int = 1
+Const JXL_ENC_NEED_MORE_OUTPUT:Int = 2
+
+Enum EJxlEncoderFrameSettingId
+	JXL_ENC_FRAME_SETTING_EFFORT = 0
+	JXL_ENC_FRAME_SETTING_DECODING_SPEED = 1
+	JXL_ENC_FRAME_SETTING_RESAMPLING = 2
+	JXL_ENC_FRAME_SETTING_EXTRA_CHANNEL_RESAMPLING = 3
+	JXL_ENC_FRAME_SETTING_ALREADY_DOWNSAMPLED = 4
+	JXL_ENC_FRAME_SETTING_PHOTON_NOISE = 5
+	JXL_ENC_FRAME_SETTING_NOISE = 6
+	JXL_ENC_FRAME_SETTING_DOTS = 7
+	JXL_ENC_FRAME_SETTING_PATCHES = 8
+	JXL_ENC_FRAME_SETTING_EPF = 9
+	JXL_ENC_FRAME_SETTING_GABORISH = 10
+	JXL_ENC_FRAME_SETTING_MODULAR = 11
+	JXL_ENC_FRAME_SETTING_KEEP_INVISIBLE = 12
+	JXL_ENC_FRAME_SETTING_GROUP_ORDER = 13
+	JXL_ENC_FRAME_SETTING_GROUP_ORDER_CENTER_X = 14
+	JXL_ENC_FRAME_SETTING_GROUP_ORDER_CENTER_Y = 15
+	JXL_ENC_FRAME_SETTING_RESPONSIVE = 16
+	JXL_ENC_FRAME_SETTING_PROGRESSIVE_AC = 17
+	JXL_ENC_FRAME_SETTING_QPROGRESSIVE_AC = 18
+	JXL_ENC_FRAME_SETTING_PROGRESSIVE_DC = 19
+	JXL_ENC_FRAME_SETTING_CHANNEL_COLORS_GLOBAL_PERCENT = 20
+	JXL_ENC_FRAME_SETTING_CHANNEL_COLORS_GROUP_PERCENT = 21
+	JXL_ENC_FRAME_SETTING_PALETTE_COLORS = 22
+	JXL_ENC_FRAME_SETTING_LOSSY_PALETTE = 23
+	JXL_ENC_FRAME_SETTING_COLOR_TRANSFORM = 24
+	JXL_ENC_FRAME_SETTING_MODULAR_COLOR_SPACE = 25
+	JXL_ENC_FRAME_SETTING_MODULAR_GROUP_SIZE = 26
+	JXL_ENC_FRAME_SETTING_MODULAR_PREDICTOR = 27
+	JXL_ENC_FRAME_SETTING_MODULAR_MA_TREE_LEARNING_PERCENT = 28
+	JXL_ENC_FRAME_SETTING_MODULAR_NB_PREV_CHANNELS = 29
+	JXL_ENC_FRAME_SETTING_JPEG_RECON_CFL = 30
+	JXL_ENC_FRAME_INDEX_BOX = 31
+	JXL_ENC_FRAME_SETTING_BROTLI_EFFORT = 32
+End Enum

BIN
jxlwriter.mod/examples/colours.jpg


+ 64 - 0
jxlwriter.mod/examples/example_01.bmx

@@ -0,0 +1,64 @@
+SuperStrict
+
+Framework SDL.SDLRenderMax2D
+Import Image.JXLWriter
+Import Image.PNG
+Import Image.JPG
+Import BRL.StandardIO
+
+Local pixmap:TPixmap = LoadPixmap("transparent.png")
+SavePixmapJxl(pixmap, "transparent.jxl")
+
+' use more threads to improve encoding times
+JxlEncoderThreadCount = 4
+
+pixmap = LoadPixmap("colours.jpg")
+
+SavePixmapJxl(pixmap, "colours.jxl", False, 1)
+
+Local w:Int = DesktopWidth() * .75
+Local h:Int = DeskTopHeight() * .75
+
+Graphics w, h, 0
+
+AutoMidHandle(True)
+
+Local img1:TImage = Loader("transparent.jxl", w, h)
+Local img2:TImage = Loader("colours.jxl", w, h)
+
+If Not img1 Or Not img2 Then
+	Throw "Failed to load image"
+End If
+
+Local image:Int
+Local img:TImage = img1
+
+While Not KeyDown(Key_ESCAPE)
+
+	Cls
+
+	If KeyHit(KEY_SPACE) Then
+		image = Not image
+		If image Then
+			img = img2
+		Else
+			img = img1
+		End If
+	End If
+
+	DrawImage img, w / 2, h / 2
+
+	Flip
+
+Wend
+
+Function Loader:TImage(path:String, maxWidth:Int, maxHeight:Int)
+	Local pix:TPixmap = LoadPixmap( path )
+	If pix Then
+		If pix.width > maxWidth Or pix.height > maxHeight Then
+			Local ratio:Float = Min(maxWidth / Float(pix.width), maxHeight / Float(pix.height))
+			pix = ResizePixmap(pix, Int(pix.width * ratio), Int(pix.height * ratio))
+		End If
+		Return LoadImage(pix)
+	End If
+End Function

BIN
jxlwriter.mod/examples/transparent.png


+ 35 - 0
jxlwriter.mod/glue.c

@@ -0,0 +1,35 @@
+/*
+ Copyright (c) 2022 Bruce A Henderson
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice, this
+    list of conditions and the following disclaimer.
+
+ 2. 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.
+
+ 3. Neither the name of the copyright holder 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 HOLDER 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.
+*/
+#include "jxl/encode.h"
+#include "jxl/resizable_parallel_runner.h"
+
+JxlEncoderStatus bmx_jxl_JxlEncoderSetParallelRunner(JxlEncoder* enc, void* parallel_runner_opaque) {
+    return JxlEncoderSetParallelRunner(enc, JxlResizableParallelRunner, parallel_runner_opaque);
+}

+ 184 - 0
jxlwriter.mod/jxlwriter.bmx

@@ -0,0 +1,184 @@
+'
+' Copyright (c) 2022 Bruce A Henderson
+' 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 the author 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 AUTHOR "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 AUTHOR 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.
+'
+SuperStrict
+
+Rem
+bbdoc: Image/JXL writer
+about:
+The JXL writer module provides the ability to save JXL format #pixmaps.
+End Rem
+Module Image.JXLWriter
+
+ModuleInfo "Version: 1.00"
+ModuleInfo "License: BSD"
+ModuleInfo "Copyright: Wrapper - 2022 Bruce A Henderson"
+
+ModuleInfo "History: 1.00"
+ModuleInfo "History: Initial Release."
+
+ModuleInfo "CPP_OPTS: -std=c++11"
+ModuleInfo "CC_OPTS: -DJPEGXL_MAJOR_VERSION=0"
+ModuleInfo "CC_OPTS: -DJPEGXL_MINOR_VERSION=7"
+ModuleInfo "CC_OPTS: -DJPEGXL_PATCH_VERSION=0"
+
+ModuleInfo "CC_OPTS: -DHAVE_PROTOTYPES"
+
+Import "common.bmx"
+
+
+Rem
+bbdoc: 
+End Rem
+Function SavePixmapJxl:Int( pixmap:TPixmap, url:Object, useLossless:Int = True, distance:Float = 0 )
+
+	Local stream:TStream=WriteStream( url )
+	If Not stream Return False
+	
+	Local encoder:TJxlEncoder = New TJxlEncoder()
+	Local result:Int = encoder.Save(pixmap, stream, useLossless, distance)
+
+	stream.Close
+	Return result
+End Function
+
+Rem
+bbdoc: Number of threads to use during Jxl encoding.
+about: The default is to use only the current thread.
+End Rem
+Global JxlEncoderThreadCount:Int = 0
+
+Private
+
+Type TJxlEncoder
+
+	Field encoderPtr:Byte Ptr
+	Field runnerPtr:Byte Ptr
+
+	Method New()
+		encoderPtr = JxlEncoderCreate(Null)
+		runnerPtr = JxlResizableParallelRunnerCreate(Null)
+	End Method
+
+	Method Save:Int(pixmap:TPixmap, stream:TStream, useLossless:Int, distance:Float)
+
+		If bmx_jxl_JxlEncoderSetParallelRunner(encoderPtr, runnerPtr) <> JXL_ENC_SUCCESS Then
+			Return False
+		End If
+
+		JxlResizableParallelRunnerSetThreads(runnerPtr, Size_T(Max(0, JxlEncoderThreadCount)))
+
+		Local align:Int = pixmap.pitch - ((BytesPerPixel[pixmap.format] * pixmap.width) - 1)
+		If align <> 1 Then
+			align = 4
+		End If
+		Local info:SJxlBasicInfo
+		JxlEncoderInitBasicInfo(info)
+		info.xsize = pixmap.width
+		info.ysize = pixmap.height
+		info.bits_per_sample = 8
+		info.alpha_bits = AlphaBitsPerPixel[pixmap.format]
+		info.num_color_channels = BytesPerPixel[pixmap.format] - (AlphaBitsPerPixel[pixmap.format] > 0)
+		info.num_extra_channels = AlphaBitsPerPixel[pixmap.format] > 0
+
+		If useLossless Then
+			info.uses_original_profile = True
+		End If
+
+		Local format:SJxlPixelFormat = New SJxlPixelFormat(UInt(BytesPerPixel[pixmap.format]), EJxlDataType.JXL_TYPE_UINT8, EJxlEndianness.JXL_NATIVE_ENDIAN, Size_T(align))
+
+		If JxlEncoderSetBasicInfo(encoderPtr, info) <> JXL_ENC_SUCCESS Then
+			Return False
+		End If
+
+		Local colorEncoding:SJxlColorEncoding
+		JxlColorEncodingSetToSRGB(colorEncoding, pixmap.format = PF_I8)
+
+		If JxlEncoderSetColorEncoding(encoderPtr, colorEncoding) <> JXL_ENC_SUCCESS Then
+			Return False
+		End If
+
+		Local frameSettingsPtr:Byte Ptr = JxlEncoderFrameSettingsCreate(encoderPtr, Null)
+
+		If useLossless Then
+			JxlEncoderSetFrameLossless(frameSettingsPtr, True)
+		End If
+		JxlEncoderSetFrameDistance(frameSettingsPtr, distance)
+
+		If JxlEncoderAddImageFrame(frameSettingsPtr, format, pixmap.pixels, Size_T(pixmap.pitch * pixmap.height)) <> JXL_ENC_SUCCESS Then
+			Return False
+		End If
+
+		JxlEncoderCloseInput(encoderPtr)
+
+		Local compressed:Byte[1024]
+		Local nextOut:Byte Ptr = compressed
+		Local availOut:Size_T = compressed.Length
+
+		Local result:Int = JXL_ENC_NEED_MORE_OUTPUT
+
+		While result = JXL_ENC_NEED_MORE_OUTPUT
+			result = JxlEncoderProcessOutput(encoderPtr, VarPtr nextOut, availOut)
+
+			If result = JXL_ENC_NEED_MORE_OUTPUT Then
+				Local offset:Size_T = nextOut - compressed
+				compressed = compressed[..compressed.Length * 2]
+				nextOut = Byte Ptr(compressed) + offset
+				availOut = compressed.Length - offset
+			End If
+		Wend
+
+		Local size:Size_T = nextOut - Byte Ptr(compressed)
+		compressed = compressed[..size]
+
+		If result <> JXL_ENC_SUCCESS Then
+			Return False
+		End If
+
+		stream.Write(compressed, compressed.Length)
+
+		Return True
+
+	End Method
+
+	Method Free()
+		If runnerPtr Then
+			JxlResizableParallelRunnerDestroy(runnerPtr)
+			runnerPtr = Null
+		End If
+
+		If encoderPtr Then
+			JxlEncoderDestroy(encoderPtr)
+			encoderPtr = Null
+		End If
+	End Method
+
+	Method Delete()
+		Free()
+	End Method
+
+End Type
+

+ 111 - 0
jxlwriter.mod/source.bmx

@@ -0,0 +1,111 @@
+'
+' Copyright (c) 2022 Bruce A Henderson
+' 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 the author 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 AUTHOR "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 AUTHOR 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.
+'
+SuperStrict
+
+Import "../jxl.mod/libjxl/*.h"
+Import "../jxl.mod/libjxl/lib/include/*.h"
+Import "../jxl.mod/highway/*.h"
+Import "../jxl.mod/brotli/c/include/*.h"
+Import "../cms.mod/libcms2/include/*.h"
+
+Import "../jxl.mod/libjxl/lib/jxl/butteraugli/butteraugli.cc"
+Import "../jxl.mod/libjxl/lib/jxl/butteraugli_wrapper.cc"
+
+Import "../jxl.mod/libjxl/lib/jxl/enc_ac_strategy.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_adaptive_quantization.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_ans.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_ar_control_field.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_butteraugli_comparator.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_butteraugli_pnorm.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_cache.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_chroma_from_luma.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_cluster.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_coeff_order.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_color_management.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_comparator.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_context_map.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_detect_dots.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_dot_dictionary.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_entropy_coder.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_external_image.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_fast_heuristics.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_file.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_frame.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_group.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_heuristics.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_huffman.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_icc_codec.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_image_bundle.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_modular.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_noise.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_patch_dictionary.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_photon_noise.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_quant_weights.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_splines.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_toc.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_transforms.cc"
+Import "../jxl.mod/libjxl/lib/jxl/enc_xyb.cc"
+Import "../jxl.mod/libjxl/lib/jxl/encode.cc"
+Import "../jxl.mod/libjxl/lib/jxl/gaborish.cc"
+Import "../jxl.mod/libjxl/lib/jxl/huffman_tree.cc"
+Import "../jxl.mod/libjxl/lib/jxl/jpeg/enc_jpeg_data.cc"
+Import "../jxl.mod/libjxl/lib/jxl/jpeg/enc_jpeg_data_reader.cc"
+Import "../jxl.mod/libjxl/lib/jxl/jpeg/enc_jpeg_huffman_decode.cc"
+Import "../jxl.mod/libjxl/lib/jxl/linalg.cc"
+Import "../jxl.mod/libjxl/lib/jxl/modular/encoding/enc_debug_tree.cc"
+Import "../jxl.mod/libjxl/lib/jxl/modular/encoding/enc_encoding.cc"
+Import "../jxl.mod/libjxl/lib/jxl/modular/encoding/enc_ma.cc"
+Import "../jxl.mod/libjxl/lib/jxl/modular/transform/enc_palette.cc"
+Import "../jxl.mod/libjxl/lib/jxl/modular/transform/enc_rct.cc"
+Import "../jxl.mod/libjxl/lib/jxl/modular/transform/enc_squeeze.cc"
+Import "../jxl.mod/libjxl/lib/jxl/modular/transform/enc_transform.cc"
+Import "../jxl.mod/libjxl/lib/jxl/optimize.cc"
+Import "../jxl.mod/libjxl/lib/jxl/progressive_split.cc"
+
+Import "../jxl.mod/brotli/c/enc/backward_references.c"
+Import "../jxl.mod/brotli/c/enc/backward_references_hq.c"
+Import "../jxl.mod/brotli/c/enc/bit_cost.c"
+Import "../jxl.mod/brotli/c/enc/block_splitter.c"
+Import "../jxl.mod/brotli/c/enc/brotli_bit_stream.c"
+Import "../jxl.mod/brotli/c/enc/cluster.c"
+Import "../jxl.mod/brotli/c/enc/command.c"
+Import "../jxl.mod/brotli/c/enc/compound_dictionary.c"
+Import "../jxl.mod/brotli/c/enc/compress_fragment.c"
+Import "../jxl.mod/brotli/c/enc/compress_fragment_two_pass.c"
+Import "../jxl.mod/brotli/c/enc/dictionary_hash.c"
+Import "../jxl.mod/brotli/c/enc/encode.c"
+Import "../jxl.mod/brotli/c/enc/encoder_dict.c"
+Import "../jxl.mod/brotli/c/enc/entropy_encode.c"
+Import "../jxl.mod/brotli/c/enc/fast_log.c"
+Import "../jxl.mod/brotli/c/enc/histogram.c"
+Import "../jxl.mod/brotli/c/enc/literal_cost.c"
+Import "../jxl.mod/brotli/c/enc/memory.c"
+Import "../jxl.mod/brotli/c/enc/metablock.c"
+Import "../jxl.mod/brotli/c/enc/static_dict.c"
+Import "../jxl.mod/brotli/c/enc/utf8_util.c"
+
+Import "glue.c"