Skip to content

Commit

Permalink
Merge branch 'master' of github.com:OSGeo/gdal
Browse files Browse the repository at this point in the history
* 'master' of github.com:OSGeo/gdal:
  makefile.vc: remove Unix commands in lib_dist target (OSGeo#3986)
  QuadraticMeanFloatSSE2(): tiny perf improvement in SSE3 case
  Docker: update Alpine based images to Alpine 3.14 [ci skip]
  rasterio.py: add test for Byte averaging by a factor of 2
  VSIS3FSHandler::GetOptions(): fix non-XML conformity (fixes postgis/postgis#618 (comment))
  • Loading branch information
a0x8o committed Jun 10, 2022
1 parent 0f64c72 commit 03b2261
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 4 deletions.
11 changes: 11 additions & 0 deletions autotest/gcore/rasterio.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,7 @@ def test_rasterio_average_halfsize_downsampling_byte():
v15 = 1
v16 = 1
m4 = (v13 + v14 + v15 + v16 + 2) >> 2
<<<<<<< HEAD
ds = gdal.GetDriverByName('MEM').Create('', 18, 4, 1, gdal.GDT_Byte)
ds.WriteRaster(0, 0, 18, 4,
struct.pack('B' * 18 * 4,
Expand All @@ -1077,6 +1078,16 @@ def test_rasterio_average_halfsize_downsampling_byte():
data = ds.GetRasterBand(1).ReadRaster(0, 0, 18, 4, 9, 2, resample_alg = gdal.GRIORA_Average)
assert struct.unpack('B' * 9 * 2, data) == (m1, m2, m3, m4, m2, m3, m4, m1, m2,
m1, m2, m3, m4, m2, m3, m4, m1, m2)
=======
ds = gdal.GetDriverByName('MEM').Create('', 18, 2, 1, gdal.GDT_Byte)
ds.WriteRaster(0, 0, 18, 2,
struct.pack('B' * 18 * 2,
v1, v2, v5, v6, v9, v10, v13, v14, v5, v6, v9, v10, v13, v14, v1, v2, v5, v6,
v3, v4, v7, v8, v11, v12, v15, v16, v7, v8, v11, v12, v15, v16, v3, v4, v7, v8))
# Ask for at least 8 output pixels in width to trigger SSE2 optim
data = ds.GetRasterBand(1).ReadRaster(0, 0, 18, 2, 9, 1, resample_alg = gdal.GRIORA_Average)
assert struct.unpack('B' * 9, data) == (m1, m2, m3, m4, m2, m3, m4, m1, m2)
>>>>>>> 2e13b33fc5 (Merge branch 'master' of github.com:OSGeo/gdal)

ds.BuildOverviews('AVERAGE', [2])
ovr_data = ds.GetRasterBand(1).GetOverview(0).ReadRaster()
Expand Down
10 changes: 10 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ Each directory contains a `./build.sh` for convenient building of the image.
Note: the mention of the overall licensing terms of the GDAL build is to the
best of our knowledge and not guaranteed. Users should check by themselves.

<<<<<<< HEAD:docker/README.md
# Alpine based
=======
# Alpine based (3.14)
>>>>>>> 2e13b33fc5 (Merge branch 'master' of github.com:OSGeo/gdal):gdal/docker/README.md
Alpine version:
* 3.15 for 3.5
Expand All @@ -33,9 +37,15 @@ See [alpine-small/Dockerfile](alpine-small/Dockerfile)
* Vector drivers: small + Spatialite, XLS
* Using internal libtiff and libgeotiff
* External libraries enabled: small + libgeos, libhdf5, libhdf5, libkea, libnetcdf, libfreexl,
<<<<<<< HEAD:docker/README.md
libspatialite, libxml2, libpoppler, openexr, libheif, libdeflate, libparquet
* GDAL Python
* Base PROJ grid package (http://download.osgeo.org/proj/proj-datumgrid-1.8.zip)
=======
libspatialite, libxml2, libpoppler, openexr, libheif, libdeflate
* GDAL Python (Python 3.9)
* Base PROJ grid package
>>>>>>> 2e13b33fc5 (Merge branch 'master' of github.com:OSGeo/gdal):gdal/docker/README.md
* Overall licensing terms of the GDAL build: copy-left (GPL) + LGPL + permissive

See [alpine-normal/Dockerfile](alpine-normal/Dockerfile)
Expand Down
4 changes: 4 additions & 0 deletions docker/alpine-normal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
# Public domain
# or licensed under MIT (LICENSE.TXT) Copyright 2019 Even Rouault <[email protected]>

<<<<<<< HEAD:docker/alpine-normal/Dockerfile
ARG ALPINE_VERSION=3.16
=======
ARG ALPINE_VERSION=3.14
>>>>>>> 2e13b33fc5 (Merge branch 'master' of github.com:OSGeo/gdal):gdal/docker/alpine-normal/Dockerfile
FROM alpine:${ALPINE_VERSION} as builder

# Derived from osgeo/proj by Howard Butler <[email protected]>
Expand Down
4 changes: 4 additions & 0 deletions docker/alpine-small/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
# Public domain
# or licensed under MIT (LICENSE.TXT) Copyright 2019 Even Rouault <[email protected]>

<<<<<<< HEAD:docker/alpine-small/Dockerfile
ARG ALPINE_VERSION=3.16
=======
ARG ALPINE_VERSION=3.14
>>>>>>> 2e13b33fc5 (Merge branch 'master' of github.com:OSGeo/gdal):gdal/docker/alpine-small/Dockerfile
FROM alpine:${ALPINE_VERSION} as builder

# Derived from osgeo/proj by Howard Butler <[email protected]>
Expand Down
19 changes: 16 additions & 3 deletions gcore/overview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,7 @@ inline __m128 SQUARE(__m128 x)
return _mm_mul_ps(x, x);
}

<<<<<<< HEAD:gcore/overview.cpp
inline __m128 FIXUP_LANES(__m128 x)
{
return x;
Expand All @@ -1007,6 +1008,20 @@ inline __m128 FIXUP_LANES(__m128 x)
#endif

template<class T> static int NOINLINE QuadraticMeanFloatSSE2(int nDstXWidth,
=======
#ifdef __SSE3__
#define sse2_hadd_ps _mm_hadd_ps
#else
inline __m128 sse2_hadd_ps(__m128 a, __m128 b)
{
auto aEven_bEven = _mm_shuffle_ps(a, b, _MM_SHUFFLE(2,0,2,0));
auto aOdd_bOdd = _mm_shuffle_ps(a, b, _MM_SHUFFLE(3,1,3,1));
return _mm_add_ps(aEven_bEven, aOdd_bOdd); // (aEven + aOdd, bEven + bOdd)
}
#endif

template<class T> static int QuadraticMeanFloatSSE2(int nDstXWidth,
>>>>>>> 2e13b33fc5 (Merge branch 'master' of github.com:OSGeo/gdal):gdal/gcore/overview.cpp
int nChunkXSize,
const T*& CPL_RESTRICT pSrcScanlineShiftedInOut,
T* CPL_RESTRICT pDstScanline)
Expand Down Expand Up @@ -1127,9 +1142,7 @@ template<class T> static int NOINLINE QuadraticMeanFloatSSE2(int nDstXWidth,
rms = FIXUP_LANES(rms);
=======
// Horizontal addition
const auto A = _mm_shuffle_ps(sumLo, sumHi, _MM_SHUFFLE(2,0,2,0));
const auto B = _mm_shuffle_ps(sumLo, sumHi, _MM_SHUFFLE(3,1,3,1));
const auto sumSquares = _mm_add_ps(A, B);
const auto sumSquares = sse2_hadd_ps(sumLo, sumHi);

auto rms = _mm_mul_ps(maxV, _mm_sqrt_ps(_mm_mul_ps(sumSquares, zeroDot25)));

Expand Down
2 changes: 1 addition & 1 deletion gdal/docker/alpine-ultrasmall/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Public domain
# or licensed under X/MIT (LICENSE.TXT) Copyright 2019 Even Rouault <[email protected]>

ARG ALPINE_VERSION=3.13
ARG ALPINE_VERSION=3.14
FROM alpine:${ALPINE_VERSION} as builder

# Derived from osgeo/proj by Howard Butler <[email protected]>
Expand Down

0 comments on commit 03b2261

Please sign in to comment.