hdrvdp-fixes.patch (3850B)
1 From 44a21be2c4de409f80d90cbcc2c20cb3f42e859e Mon Sep 17 00:00:00 2001 2 From: Sami Boukortt <sboukortt@google.com> 3 Date: Fri, 16 Oct 2020 20:01:02 +0200 4 Subject: [PATCH] Fixes for Octave 5 MIME-Version: 1.0 6 Content-Type: text/plain; charset=UTF-8 7 Content-Transfer-Encoding: 8bit 8 9 Copyright (c) the JPEG XL Project Authors. All rights reserved. 10 11 Use of this source code is governed by a BSD-style 12 license that can be found in the LICENSE file. 13 14 ---- 15 16 ifft2: https://savannah.gnu.org/bugs/?43742 17 18 Removing #include <matrix.h>: https://octave.org/doc/v5.2.0/Getting-Started-with-Mex_002dFiles.html 19 “One important difference between Octave and MATLAB is that the header 20 "matrix.h" is implicitly included through the inclusion of "mex.h".” 21 22 Length checks: it appears that functions(…).file for MEX files in Octave 23 is empty. 24 --- 25 fast_conv_fft.m | 2 +- 26 matlabPyrTools_1.4_fixed/MEX/corrDn.c | 1 - 27 matlabPyrTools_1.4_fixed/MEX/pointOp.c | 1 - 28 matlabPyrTools_1.4_fixed/MEX/upConv.c | 1 - 29 matlabPyrTools_1.4_fixed/reconSpyr.m | 2 +- 30 matlabPyrTools_1.4_fixed/reconSpyrLevs.m | 2 +- 31 6 files changed, 3 insertions(+), 6 deletions(-) 32 33 diff --git a/fast_conv_fft.m b/fast_conv_fft.m 34 index 65ceef8..b89e54b 100644 35 --- a/fast_conv_fft.m 36 +++ b/fast_conv_fft.m 37 @@ -16,7 +16,7 @@ pad_size = (size(fH)-size(X)); 38 39 fX = fft2( padarray( X, pad_size, pad_value, 'post' ) ); 40 41 -Yl = real(ifft2( fX.*fH, size(fX,1), size(fX,2), 'symmetric' )); 42 +Yl = real(ifft2( fX.*fH, size(fX,1), size(fX,2))); 43 44 Y = Yl(1:size(X,1),1:size(X,2)); 45 46 diff --git a/matlabPyrTools_1.4_fixed/MEX/corrDn.c b/matlabPyrTools_1.4_fixed/MEX/corrDn.c 47 index d02e272..17e739e 100755 48 --- a/matlabPyrTools_1.4_fixed/MEX/corrDn.c 49 +++ b/matlabPyrTools_1.4_fixed/MEX/corrDn.c 50 @@ -6,7 +6,6 @@ RES = corrDn(IM, FILT, EDGES, STEP, START, STOP); 51 */ 52 53 #define V4_COMPAT 54 -#include <matrix.h> /* Matlab matrices */ 55 #include <mex.h> 56 57 #include "convolve.h" 58 diff --git a/matlabPyrTools_1.4_fixed/MEX/pointOp.c b/matlabPyrTools_1.4_fixed/MEX/pointOp.c 59 index 3623a02..e553adf 100755 60 --- a/matlabPyrTools_1.4_fixed/MEX/pointOp.c 61 +++ b/matlabPyrTools_1.4_fixed/MEX/pointOp.c 62 @@ -5,7 +5,6 @@ RES = pointOp(IM, LUT, ORIGIN, INCREMENT, WARNINGS) 63 */ 64 65 #define V4_COMPAT 66 -#include <matrix.h> /* Matlab matrices */ 67 #include <mex.h> 68 69 #include <stddef.h> /* NULL */ 70 diff --git a/matlabPyrTools_1.4_fixed/MEX/upConv.c b/matlabPyrTools_1.4_fixed/MEX/upConv.c 71 index 98a2bec..08fdf75 100755 72 --- a/matlabPyrTools_1.4_fixed/MEX/upConv.c 73 +++ b/matlabPyrTools_1.4_fixed/MEX/upConv.c 74 @@ -6,7 +6,6 @@ RES = upConv(IM, FILT, EDGES, STEP, START, STOP, RES); 75 */ 76 77 #define V4_COMPAT 78 -#include <matrix.h> /* Matlab matrices */ 79 #include <mex.h> 80 81 #include "convolve.h" 82 diff --git a/matlabPyrTools_1.4_fixed/reconSpyr.m b/matlabPyrTools_1.4_fixed/reconSpyr.m 83 index 05eeafb..1440d8a 100644 84 --- a/matlabPyrTools_1.4_fixed/reconSpyr.m 85 +++ b/matlabPyrTools_1.4_fixed/reconSpyr.m 86 @@ -31,7 +31,7 @@ function res = reconSpyr(pyr, pind, filtfile, edges, levs, bands) 87 % Deterimine whether a MEX version of upConv is available 88 is_mex = true; 89 finfo = functions( @upConv ); 90 -if( strcmp( finfo.file((end-2):end), '.m') ) 91 +if( length(finfo.file) > 2 && strcmp( finfo.file((end-2):end), '.m') ) 92 is_mex = false; 93 end 94 95 diff --git a/matlabPyrTools_1.4_fixed/reconSpyrLevs.m b/matlabPyrTools_1.4_fixed/reconSpyrLevs.m 96 index ac5e2b1..d3b91d5 100644 97 --- a/matlabPyrTools_1.4_fixed/reconSpyrLevs.m 98 +++ b/matlabPyrTools_1.4_fixed/reconSpyrLevs.m 99 @@ -11,7 +11,7 @@ function res = reconSpyrLevs(pyr,pind,lofilt,bfilts,edges,levs,bands) 100 % Deterimine whether MEX version of upConv is available 101 is_mex = true; 102 finfo = functions( @upConv ); 103 -if( strcmp( finfo.file((end-2):end), '.m') ) 104 +if( length(finfo.file) > 2 && strcmp( finfo.file((end-2):end), '.m') ) 105 is_mex = false; 106 end 107 108 -- 109 2.28.0 110