betaFeedback

WorksPhysics and Astronomy

Image and video compression of fluid flow data

Abstract

We study the compression of spatial and temporal features in fluid flow data using multimedia compression techniques. The efficacy of spatial compression techniques, including JPEG and JPEG2000 (JP2), and spatio-temporal video compression techniques, namely H.264, H.265, and AV1, in limiting the introduction of compression artifacts and preserving underlying flow physics are considered for laminar periodic wake around a cylinder, two-dimensional turbulence, and turbulent channel flow. These compression techniques significantly compress flow data while maintaining dominant flow features with negligible error. AV1 and H.265 compressions present the best performance across a variety of canonical flow regimes and outperform traditional techniques such as proper orthogonal decomposition in some cases. These image and video compression algorithms are flexible, scalable, and generalizable holding potential for a wide range of applications in fluid dynamics in the context of data storage and transfer.

Introduction

High-fidelity simulations and experiments within the field of fluid dynamics produce exceedingly large amounts of data. As the need for higher fidelity simulations and advanced experimental resources expands, storage and transfer requirements for spatio-temporal data from simulations become a major challenge. To address this issue, spatio-temporal redundancies or repeated dominant flow features can be exploited by a variety of compression techniques to alleviate memory constraints for fluid flow data storage. A variety of compression techniques, including modal analysis [1, 2, 3], sub-sampling and local re-simulation [4], and deep learning [5, 6, 7, 8] have been considered in an effort to reduce the size of fluid flow data. Although effective, these techniques can be application-specific and struggle to achieve substantial compression ratios without introducing undesirable compression artifacts such as discontinuities or deletions of flow features.

In comparison, multimedia compression techniques are general and simple to use, and have benefited from demand for the modern technologies of high-resolution video streaming [9, 10, 11] and video-conferencing [12, 13, 14]. These compression techniques are classified into two groups: lossless compression and lossy compression [15]. With lossless techniques, the data retrieved from or reconstructed from the compressed state is identical to that preceding the application of a compression algorithm. Hence, this is preferred for archival purposes and used for medical imaging [16] and technical drawings [17]. In contrast, processed data with lossy techniques do not necessarily match the original data, enabling a significant data-size reduction in the compressed state. Since this may introduce compression artifacts such as discontinuities in image data or the loss of high spatial frequency information, it is suitable for natural images such as photographs in applications where imperceptible loss may be acceptable [18]. We consider here the impacts of such losses on fluid mechanics simulation data to assess the costs of applying lossy techniques. In 2003, Schmalzl [19] considered multimedia data compression for fluid flows with an example of Rayleigh-Bénard convection. With multimedia compression technologies having undergone significant advances in the last two decades, we reassess image and video compressions with modern algorithms for applications to fluid flow data.

Lossy techniques of interest typically involve frequency-domain transformation, filtering, and entropy coding as components in the compression process. The development of the discrete cosine transform (DCT) [20, 21] has played a crucial role in image compression, and is the basis of Joint Photographic Experts Group (JPEG) [22]. The emergence of JPEG enabled efficient image compression in a wide range of communities and it became a generally accepted format for digital images. After the development of DCT, wavelet transforms began to be utilized for image compression in such algorithms as JPEG2000 (JP2) [23], which achieves better compression than the DCT of JPEG as a result of multi-scale properties of wavelets. It is worth pointing out that there have been studies on computational fluid dynamics that leverage wavelet methods to efficiently decompose multi-scale features for applications in turbulence modeling and simulations [24].

In tandem with the growth of image compression techniques, advancement in video compression technologies followed suit since video data can be characterized as a time series of image frames. Generally, these time frames include both spatial and temporal redundancies. In fact, we often see the similarities (redundancies) between temporally adjacent frames or spatially adjacent pixels. Video compression algorithms are designed to remove such redundancies and obtain a compact form of the original information. Current video compression technologies are generally based on the DCT [25]. Although other candidates including fractal compression [26, 27], matching pursuit [28], and discrete wavelet transform (DWT) have been investigated as the subject of some studies, these are still not used in practical products. Moving Picture Experts Group (MPEG) series have been traditionally used for video compression of high-definition television [29, 30, 31]. H.2xx series was then developed and they have achieved significant compression compared to the conventional MPEGs [32, 33]. Especially in the recent versions such as H.264 and H.265, motion compensation, quantization, and entropy coding are applied for efficient video compression. More recently, AOMedia Video 1 (AV1), an open, royalty-free video coding format, was released in 2018, achieving enhanced compression compared to the aforementioned techniques [34, 35].

To meet the demand for these image and video compression tools, significant investment and research have produced compression techniques of impressive efficiency and usability in addition to free video encoders [36] to promote widespread accessibility. As such, leveraging these multimedia-inspired compression techniques should also be of particular interest to the fluid dynamics community given the massive scale of data produced, stored, and transferred. A standardization on one or more multimedia compression formats for storing fluid flow data in a compressed representation can yield dividends in research output by allowing greater access to high-fidelity fluid flow data sets and by removing memory constraints as a barrier to entry.

This paper investigates the effectiveness of these image and video compression techniques on fluid flow data. Spatial image compression techniques, such as JPEG and JP2, alongside spatio-temporal video compression techniques, namely H.264, H.265, and AV1, are examined for various flow fields, including laminar cylinder flow, two-dimensional turbulence, and turbulent channel flow. Field variables from simulation data, such as streamwise velocity and vorticity, are represented as grayscale images, and multiple snapshots are packaged into a video. These videos are then encoded into a compressed form using the aforementioned multimedia compression methods. Modern techniques can compress flow data well below 10% of the original file size with negligible error and preserve the underlying physics of the flow. Although this paper focuses on applications to canonical fluid flows, the flexibility and scalability of these algorithms suggest an expansive potential within this field.

Compression is a process in which data is compressed (encoded) into a representation that uses less data, and decompressed (decoded) into identical data in the case of lossless compression or nearly-identical data in the case of lossy compression. Through this procedure, a compression method reduces bits of the original data q(x,t)q(x,t) by eliminating statistical redundancies that may be contained within temporally adjacent frames and spatially adjacent pixels. In general, a data compression algorithm is referred to as an encoder ϕ\phi while one that performs the decompression is called a decoder ψ\psi,

γ(x,t)=ϕ(q(x,t)),q(x,t)≈q~(x,t)=ψ(γ(x,t)),(1)\gamma(x,t) = \phi(q(x,t)), \quad q(x,t) \approx\widetilde{q}(x,t) = \psi(\gamma(x,t)), \tag*{(1)}

where γ(x,t)∈Rm\gamma(x,t) \in\mathbb{R}^{m} is the compressed data corresponding to the original data q(x,t)∈Rnq(x,t) \in\mathbb{R}^{n} with m≪nm \ll n. Depending on the extent of compression, the data, and a choice of encoder/decoder, the reconstruction q~(x,t)∈Rn\widetilde{q}(x,t) \in\mathbb{R}^{n} generally includes some amount of error.

The data compression process is illustrated in figure 1 for both image and video compressions. Figure 1(aa) depicts a lossy spatial image compression technique, involving quantization of the image data in a compressed space and producing a reconstruction in the image space showing the operations of JPEG and JP2. Figure 1(bb) provides a visualization of a spatio-temporal compression technique, exploiting a redundant block of a frame that remains consistent across subsequent frames, similar to H.264, H.265, and AV1. As these algorithms originated in the multimedia industry, they are optimized for human viewers and involve the removal of high-frequency components in the data and down-sampling of the color spectrum such that the eyes cannot easily distinguish compressed data from the original data. For the purposes of this study, we only consider grayscale images and videos, which are comprised only of a single-component field data matrix, denoted as q~(x)\widetilde{q}(x). This is in contrast to full-color data, which requires red, green, and blue components, and is unnecessary for the current analysis as we are interested in considering field variables individually. Herein, we consider the application of five compression techniques on grayscale images and videos. The encoding schemes, which package the data into a compressed binary form, are detailed in what follows.

Figure 1. (a) Spatial compression: an example velocity field of flow over a cylinder q(x)q(x) is represented as a grayscale image, encoded using an image-based technique to a compressed form, and reconstructed as q~(x)\tilde{q}(x) using a decoder. (b) Spatio-temporal compression: multiple snapshots of this flow field data q(x,t)q(x,t) are represented as a grayscale video and are compressed to q~(x,t)\tilde{q}(x,t) with both spatial and temporal techniques.

Compression techniques

Image Compression

JPEG

Let us first describe JPEG, which is a standard lossy spatial compression used for encoding image data based on the discrete cosine transform (DCT) [20]. An example of a JPEG compression process with a vorticity field of two-dimensional decaying isotropic turbulence is presented in Figure 2. The images are partitioned into 8×88 \times8 blocks in a left-to-right, top-to-bottom scan. Pixel values within blocks are quantized to values of [−128,127][-128,127] from [0,255][0,255]. The forward DCT is individually performed at each block and outputs compressed data. The DCT for 8×88 \times8 blocks is mathematically expressed as

JPEG compression process showing input, an 8×8 block, DCT coefficients, and reconstructed image

Figure 2. JPEG compression process with an example of two-dimensional isotropic turbulent vorticity.

F(kx,ky)=14C(kx)C(ky)(∑ix=07∑iy=07f(ix,iy)cos⁡((2ix+1)kxπ16)cos⁡((2iy+1)kyπ16)),(2)F(k_x,k_y)=\frac{1}{4}C(k_x)C(k_y)\left(\sum_{i_x=0}^{7}\sum_{i_y=0}^{7}f(i_x,i_y)\cos\left(\frac{(2i_x+1)k_x\pi}{16}\right)\cos\left(\frac{(2i_y+1)k_y\pi}{16}\right)\right), \tag*{(2)}
f(ix,iy)=14(∑kx=07∑ky=07C(kx)C(ky)F(kx,ky)cos⁡((2ix+1)kxπ16)cos⁡((2iy+1)kyπ16)),(3)f(i_x,i_y)=\frac{1}{4}\left(\sum_{k_x=0}^{7}\sum_{k_y=0}^{7}C(k_x)C(k_y)F(k_x,k_y)\cos\left(\frac{(2i_x+1)k_x\pi}{16}\right)\cos\left(\frac{(2i_y+1)k_y\pi}{16}\right)\right), \tag*{(3)}

where

C(k)={1/2for k=01otherwise.(4)C(k)= \begin{cases} 1/\sqrt{2} & \text{for } k=0 \\ 1 & \text{otherwise.} \end{cases} \tag*{(4)}

Here, F(kx,ky)F(k_x,k_y) denotes the DCT coefficient corresponding to the horizontal wavelength kxk_x and vertical wavelength kyk_y and f(ix,iy)f(i_x,i_y) describes the pixel value at the location corresponding to ixi_x and iyi_y. In other words, the forward DCT takes as input a discrete signal of 64 points and produces coefficients for a linear combination of 64 unique basis signals, each denoting a specific spatial wavelength. Most of the spatial domain information is concentrated across lower wavelength because of slow spatial variation from one pixel to the next in image data. This quality permits lossy quantization, which refers to constant values in a quantization table Q(kx,ky)Q(k_x,k_y) with 64 elements. The DCT coefficient is normalized by a constant Q(kx,ky)Q(k_x,k_y) in an element-wise manner,

FQ(kx,ky)=⌊F(kx,ky)Q(kx,ky)⌋(5)F^{Q}(k_x,k_y)=\left\lfloor\frac{F(k_x,k_y)}{Q(k_x,k_y)}\right\rfloor \tag*{(5)}

where FQ(kx,ky)F^{Q}(k_x,k_y) is a normalized coefficient and the operation ⌊⋅⌋\lfloor\cdot\rfloor denotes rounding to the nearest integer. Quantization tables are provided by the Joint Photographics Experts Group. Note that dividing the DCT coefficients by values in the quantization table reduces high-wavenumber coefficients to 0, which permits efficient entropy coding (explained later) to perform the cutoff at high frequencies [37]. The resulting quantized DCT coefficients form a matrix of size 8×88 \times8 with low-wavenumber components generally located in the top-left of the matrix and high-wavenumber coefficients at the bottom-right, as a consequence of the similar distribution of spatial modes to which these coefficients correspond. Subsequently, quantized coefficients are ordered from low to high wavenumbers.

To reduce the data size, entropy coding [38, 39], a lossless method of compressing bitstreams with redundancies, is then performed for the output of DCT. The idea of entropy coding is used not only for JPEG but also other image/video compression techniques such as JP2, H.2xx series, and AV1. To express the encoding-based data compression, let us consider a message of DAEBCBACBBBC (12 characters). Since this message includes five different characters, it needs to prepare 3 bits to convert these characters to bits or binary digits representation. Here, we use the following conversion table,

ABCDE
000001010011100

Table 2.

With this table, the message is expressed as

DAEBCBACBBBC
011000100001010001000010001001001010

Table 3.

As shown, the number of bits is 36. The idea of the encoding-based compression is to prepare an adaptive conversion table assigning a shorter bit length for characters that appear in a high probability and a longer bit length for characters that barely appear. For example, the following adaptive table can be used:

ABCDE
11001011101111

With this new table, the message can be expressed as

DAEBCBACBBBC
1110110111101001101000010

The current table can save the total number of bits for the message from 36 to 25. Modern data compression techniques efficiently find such an adaptive conversion table for saving image and video sizes.

The presence of a better adaptive conversion can be proven with the source coding theorem [40]. For any data, the expected code length should satisfy the relationship,

Eβ∼P[l(d(β))]≥Eβ∼P[−log⁡b(P(β))],(6)\mathop{\mathrm{E}}_{\beta\sim P}[l(d(\beta))] \ge\mathop{\mathrm{E}}_{\beta\sim P}[-\log_b(P(\beta))], \tag*{(6)}

where ll is the number of symbols in a message, dd is the coding function, bb is the number of symbols in a table, and PP is the probability of the original symbol. An entropy coding method attempts to approach the lower bound. For JPEG compression, Huffman coding [41] is used to determine an adaptable table composed of the estimated probability of occurrence for each possible value. Huffman coding uses binary trees [42] for efficient encoding.

JPEG2000 (JP2)

JPEG2000 (JP2) is a successor to JPEG. JP2 operates using a similar four-step process to JPEG, involving image partitioning, frequency-domain transformation, quantization, and entropy coding. In contrast to JPEG, JP2 introduces more advanced dynamic tiling algorithms based on variable-sized macroblocks. This makes use of discrete wavelet transform (DWT) [43, 44], and performs additional preprocessing prior to entropy coding. Tiling in this context refers to the partitioning of the source image into several non-overlapping rectangular blocks, each of which is processed distinctly. Whereas JPEG restricts tile sizes to 8×88 \times8, tiles in JP2 can be of arbitrary size up to the image dimensions. The DWT is applied to each tile in a manner similar to DCT, decomposing a signal into a linear combination of wavelet functions. The coefficients in this linear combination correspond to a specific wavelet basis function in the signal. A wavelet can be defined as a scale and shift of a basis wavelet [45]. Child wavelets [46] are generally considered for DWT, given by

ψg,r(s)=12g/2ψ(s−2gr2g)(7)\psi_{g,r}(s) = \frac{1}{2^{g/2}}\psi\left(\frac{s-2^g r}{2^g}\right) \tag*{(7)}

where gg is a scaling factor, rr is a shift factor, and ss corresponds to the index of the one-dimensional representation of an image. In other words, the flow field snapshot is converted to a one-dimensional representation and the independent variable upon which this one-dimensional signal f(s)f(s). The DWT coefficient given a wavelet of the preceding definition is then

Fg,r=∫−∞∞f(s)ψg,r ds(8)F_{g,r} = \int_{-\infty}^{\infty} f(s)\psi_{g,r}\,ds \tag*{(8)}

where f(s)f(s) is a one-dimensional signal. The signal can be reconstructed through the summation of the product of each coefficient with the corresponding wavelet. In a discrete interpretation, this is written as

f(s)=∑g=−∞∞∑r=−∞∞Fg,rψg,r.(9)f(s) = \sum_{g=-\infty}^{\infty}\sum_{r=-\infty}^{\infty} F_{g,r}\psi_{g,r}. \tag*{(9)}

The summation bounds for both the calculation of the coefficients and the reconstruction of the signal can be set to finite values and can still produce lossless reconstructions assuming that the wavelets contain the maximum and minimum wavelengths within the source image.

An example of the DWT for the vorticity field of two-dimensional decaying turbulence is presented in figure 3. The DWT can be applied recursively to one-dimensional signals to produce higher fidelity representations of data. As such, successive high-pass filters are applied on down-sampled images, producing a higher fidelity representation of spatial frequencies in the source image. The DWT can be extended to higher dimensions by applying the one-dimensional DWT on rows and columns. The recursive application of the DWT produces 2n2^n distinct filtered images where nn is the number of times the DWT is applied.

Two-level discrete wavelet transform coefficients for two-dimensional homogeneous turbulent vorticity field

Figure 3. An example of the two-level discrete wavelet transform for two-dimensional homogeneous turbulent vorticity field, used in JP2 compression. High-pass filtering yields three large images. Low-pass filtering and downscaling are then performed, producing the three small images. (a) The final approximation image. (b, e) Vertical, (c, f) horizontal, and (d, g) diagonal coefficients of the second (b − d) and the first levels (e − g) are shown.

Similar to JPEG compression, the DWT coefficients are quantized following the transformation on the wavespace,

Fa,bQ=sign⁡(Fa,b)⌊∣Fa,b∣Δb⌋,(10)F^{Q}_{a,b} = \operatorname{sign}(F_{a,b}) \left\lfloor\frac{\lvert F_{a,b} \rvert}{\Delta_b} \right\rfloor, \tag*{(10)}

where Δb\Delta_b is defined as the quantization step. DWT coefficients within the range (−Δb,Δb)(-\Delta_b,\Delta_b) are quantized to 0. Following quantization, the coefficients are processed in preparation for entropy coding. Arithmetic coding [47] is used for entropy coding in JPEG2000. While Huffman coding separates the original data into component symbols and replaces each with a code in a table, Arithmetic coding encodes the entire message into a single number represented with an arbitrary-precision fraction pap_a, where 0≤pa<10 \le p_a < 1.

Video Compression

H.264 (AVC)

The H.264 video compression includes a multi-step process, consisting generally of prediction, transformation (a set of frequency-domain representation and quantization in image compression), and entropy encoding on the encoder side. A similar process for file reconstruction is performed on the decoder side. Prediction in video compression amounts to an operation to remove redundancies in the given signal. H.264 supports a range of prediction options such as intra-prediction used for data within the current frame, inter-prediction for motion compensation, and multiple block-size-based predictions. An accurate prediction implies that the residual contains very little information, amounting to good compression performance.

Video data is first partitioned into macroblocks of dimension 16×1616 \times16 pixels. A prediction of the current macroblock is formed using 4×44 \times4 and 16×1616 \times16-sized blocks in the case of intra-frame prediction, referring to predictions from surrounding blocks within the same frame. A range of block sizes from 4×44 \times4 to 16×1616 \times16 are also considered in the case of inter-frame prediction, referring to predictions from previously coded frames. Macroblock prediction is further discretized into intra-prediction with neighboring blocks in the current frame, blocks in a previously coded frame, and blocks from up to two previously coded frames.

In intra-prediction, the size of prediction macroblocks can be three cases: 16×1616 \times16, 8×88 \times8, or 4×44 \times4 pixels [32]. The choice of block size is made primarily based on prediction efficiency. One of several prediction modes where each prediction mode indicates a direction in which to extrapolate pixel values or to average across all pixels. In the case of inter-prediction, the reference frame, where the prediction block is situated, is chosen from several previously decoded frames. A motion vector is obtained for the current macroblock based on the offset from the prediction block or from previously coded motion vectors. The prediction frame is then calculated using the motion vector and the reference frame. The residual between the reference and prediction frames is finally stored, as illustrated in Figure 4. These motion vectors are optionally weighted to account for temporal proximity between frames, and are sent into the data stream. Generally, a deblocking filter is further applied to each frame to store in a decoded format for subsequent inter-frame predictions in smoothing the sharp edges caused by the use of block coding [48].

Motion compensation showing reference frame, prediction frame, motion vector, and residual

Figure 4. Motion compensation (MC), used in temporal compression of H.264, H.265, and AV1, is exemplified by the calculation of a motion vector field, describing the translation of pixels between successive frames. As an example, a streamwise velocity field uu of three-dimensional turbulent channel flow is considered. Subtracting the prediction frame from the reference frame yields a residual image, which is stored.

Transformation involves the conversion of blocks to frequency-domain representations and quantization of coefficients corresponding to high wavelength data. The DCT step is given by the transformation of block XX by matrix AA into DCT coefficients YY for each macroblock. For the case of 4×44 \times4 blocks, these matrices X,Y∈R4×4X,Y \in\mathbb{R}^{4 \times4} are expressed as

Y=AXAT=[aaaabc−c−ba−a−aac−bb−c]X[abacac−a−ba−c−aba−ba−c],(11)Y = AXA^{T} = \begin{bmatrix} a & a & a & a \\ b & c & -c & -b \\ a & -a & -a & a \\ c & -b & b & -c \end{bmatrix} X \begin{bmatrix} a & b & a & c \\ a & c & -a & -b \\ a & -c & -a & b \\ a & -b & a & -c \end{bmatrix}, \tag*{(11)}

where a=1/2a = 1/2, b=1/2cos⁡(π/8)b = \sqrt{1/2}\cos(\pi/8), c=1/2cos⁡(3π/8)c = \sqrt{1/2}\cos(3\pi/8). The rows of AA are orthonormal. To calculate equation 11 on a practical processor, the approximation for bb and cc is required. This is achieved with a fixed-point approximation, which is equivalent to scaling each row of AA by 2.5 and rounding to the nearest integer. A core transform Cf4C_{f4}, which scales each term of AA by 2.5 and rounds to the nearest integer, and a scaling matrix Sf4S_{f4}, which restores norms of row of Cf4C_{f4} to 1 by scaling, are respectively defined as,

Cf4=[c1c1c1c1c2c1−c1−c2c1−c1−c1c1c1−c2c2−c1],Sf4=[s1s2s1s2s2s3s2s3s1s2s1s2s2s3s2s3],(12)C_{f4} = \begin{bmatrix} c_1 & c_1 & c_1 & c_1 \\ c_2 & c_1 & -c_1 & -c_2 \\ c_1 & -c_1 & -c_1 & c_1 \\ c_1 & -c_2 & c_2 & -c_1 \end{bmatrix}, \quad S_{f4} = \begin{bmatrix} s_1 & s_2 & s_1 & s_2 \\ s_2 & s_3 & s_2 & s_3 \\ s_1 & s_2 & s_1 & s_2 \\ s_2 & s_3 & s_2 & s_3 \end{bmatrix}, \tag*{(12)}

where c1=1c_1 = 1, c2=2c_2 = 2, s1=1/4s_1 = 1/4, s2=1/(210)s_2 = 1/(2\sqrt{10}), and s3=1/10s_3 = 1/10. Matrix YY is then determined as

Y=[Cf4XCf4T]Sf4.(13)Y = [C_{f4}XC_{f4}^{T}]S_{f4}. \tag*{(13)}

Similar DCT approximations are specified for other block sizes, involving Cf8C_{f8}, Sf8S_{f8}, and others [32]. A quantization mechanism similar to JPEG is applied, with a quantization table specified for various block sizes. The quantized DCT coefficients are then traversed in an oscillating, “zig-zag” manner from low- to high-wavenumber components. Entropy coding is finally applied to the output of DCT.

H.265 (HEVC)

H.265 was released in 2013 as the successor to H.264. While the fundamental architecture is unchanged from H.264, H.265 makes use of coding tree units which are similar to macroblocks but expand the range of possible dimensions, with variable dimensions selected by the encoder, allowing coding tree units to be divided into sub-blocks. Predictions and reconstructions are performed on coding tree units and supported sub-block sizes range from 64×6464 \times64 to 4×44 \times4 pixels. Motion vectors are predicted based on those of adjacent units or blocks in the case of intra prediction, or previous encoded frames in the case of inter prediction. As in H.264, the DCT is performed at the coding tree block level, and the resultant coefficients are subjected to scalar quantization and entropy coding. Instead of deblocking filter in H.264, a sample adaptive offset filter is applied within the prediction loop to improve the quality of the compressed data [49].

AV1

AV1 was released in 2018 in an effort to replace the H.2XX series of video compression algorithms. In AV1, much of the fundamental architecture from H.2XX is maintained. Frames are partitioned using a 4-way partition tree with dimensions ranging from 128×128128 \times128 to 4×44 \times4. AV1 supports 56 directional spatial modes for intra-frame prediction with finer angle variations than that provided by H.2XX. AV1 extends the number of reference frames that any given frame can use to perform predictions to seven references for inter-frame prediction, thus enabling more accurate encoding of data with rich temporal characteristics. Motion vector field formation is improved by expanding the spatial search domain for vector candidates and through the utilization of a temporal motion field estimation system. AV1 also extends frequency-domain transform algorithms to include the asymmetric discrete sine transform with a richer set of transform kernels for varying block sizes. Entropy coding and scalar quantization are also used as well as H.2XX compression algorithms. To perform deblocking, a constrained directional enhancement filter and loop restoration filters are applied [34]. These filters are able to effectively remove artifacts without causing blurring, compared to conventional deblocking filters [50].

Flow Fields

Let us apply the compression techniques presented above to representative fluid flow data sets from numerical simulations. We describe herein the problem setup of the example flow fields we analyze and the simulation approach used to generate them.

Two-dimensional laminar cylinder wake

Bluff body flow forms a large class of problems, such as the vortex shedding around a cylinder. We first apply the compression techniques to the two-dimensional cylinder wake obtained by direct numerical simulation (DNS) [51, 52]. The governing equations are the incompressible Navier–Stokes equations,

∇⋅u=0,(14)\nabla\cdot u = 0, \tag*{(14)}
∂u∂t+u⋅∇u=−∇p+1ReD∇2u,(15)\frac{\partial u}{\partial t} + u \cdot\nabla u = -\nabla p + \frac{1}{Re_D}\nabla^2 u, \tag*{(15)}

where uu and pp are the non-dimensionalized velocity vector and pressure, respectively. All variables are non-dimensionalized with the fluid density ρ\rho, the uniform velocity U∞U_{\infty}, and the cylinder diameter DD. The Reynolds number is defined as ReD=U∞D/ν=100Re_D = U_\infty D/\nu= 100 with ν\nu being the kinematic viscosity. We consider five nested levels of multi-domains with the finest grid level covering (x,y)=[−1,16]×[−8,18](x,y) = [-1,16] \times[-8,18] and the largest domain being (x,y)=[−5,75]×[−40,40](x,y) = [-5,75] \times[-40,40]. The time step for DNS is Δt=2.50×10−3\Delta t = 2.50 \times10^{-3}. We extract the domain around a cylinder body over (x∗,y∗)/D=[−0.7,15]×[−5,5](x^*,y^*)/D = [-0.7,15] \times[-5,5] with (Nx,Ny)=(500,300)(N_x,N_y) = (500,300) and (Δx,Δy)=(0.0314,0.0333)(\Delta x,\Delta y) = (0.0314,0.0333). The flow exhibits vortex shedding with a single period with 21 snapshots. For the compression analysis, 160 temporal snapshots of grayscale images of the streamwise velocity field uu are considered.

Two-dimensional decaying homogeneous isotropic turbulence

To examine the data compression performance by the present techniques for more complex turbulent flows, we also consider a two-dimensional decaying homogeneous isotropic turbulence. This time-varying flow can be regarded as a canonical fluid flow example for a broad range of turbulent flows. The data set is prepared by DNS using the two-dimensional vorticity transport equation [53]. We set the initial Reynolds number Re0≡u0∗l0∗/ν=80.4Re_0 \equiv u_0^*l_0^*/\nu= 80.4, where u0∗u_0^* is the characteristic velocity obtained by the square root of the spatially averaged initial kinetic energy, l0∗=[2u2‾(t0)/ω2‾(t0)]1/2l_0^* = [2\overline{u^2}(t_0)/\overline{\omega^2}(t_0)]^{1/2} is the initial integral length, and ν\nu is the kinematic viscosity. The computational domain and the numbers of grid points are set to Lx=Ly=1L_x = L_y = 1 and Nx=Ny=128N_x = N_y = 128, respectively. We use 1000 snapshots in an eddy turn-overtime of t∈[2,6]t \in[2,6] with a time interval of Δt=0.004\Delta t = 0.004. For the data compression analysis, 128×128128 \times128 grid with grayscale contours of the vorticity field ω\omega are used.

Turbulent channel flow

To further demonstrate the present data compression techniques, we also examine turbulent channel flow at a friction Reynolds number of Reτ=uτδ/ν=180Re_\tau= u_\tau\delta/\nu= 180, where uτu_\tau is the friction velocity, δ\delta is the half-width of the channel, and ν\nu is the kinematic viscosity. This flow involves a broader range of spatio-temporal flow scales and fewer redundancies compared to the previous two examples. The data sets are prepared by a three-dimensional DNS [54, 55], numerically solving the incompressible Navier–Stokes equations. The present DNS has been validated by comparison with spectral DNS data of Moser et al [56]. The streamwise, wall-normal, and spanwise spatial coordinates are denoted by xx, yy, and zz, respectively. The size of the computational domain and the number of grid points here are (Lx,Ly,Lz)=(4πδ,2δ,2πδ)(L_x,L_y,L_z) = (4\pi\delta,2\delta,2\pi\delta) and (Nx,Ny,Nz)=(256,96,256)(N_x,N_y,N_z) = (256,96,256), respectively. The grids in the streamwise and spanwise directions are taken to be uniform, while that in the yy direction is a non-uniform grid. The no-slip boundary condition is imposed on the walls and a periodic boundary condition is applied to the xx and zz directions. The flow is driven by a constant pressure gradient. In what follows, we denote wall-unit quantities with the superscript +.

For the present study, an x−zx-z cross-sectional streamwise velocity uu at y+=13.2y^+ = 13.2 is analyzed, where representative streak structures are present [57]. Fifty temporal snapshots of a 256×256256 \times256 spatial grid over t+∈[0,63]t^+ \in[0,63] are formatted into grayscale data and are used for compression assessment.

Results

For image compression, matrices of flow field data corresponding to specific temporal snapshots are represented as uncompressed grayscale images with 8 bits. We have confirmed that the loss of precision in converting to the grayscale image does not significantly affect the statistics of fluid flows. These images are compressed using JPEG and JP2 encoders. For video compression, the matrices of flow field data are represented as grayscale images and concatenated into uncompressed, grayscale videos. This raw video file is used as the input to the H.264, H.265, and AV1 encoders. To obtain control over the outputted file size for the purposes of this analysis, a two-pass encoding scheme is considered. In the two-pass encoding, the encoder runs twice. The first run is used to collect some information and statistics such as how many bytes would be needed for data compression and the second run performs the actual encoding. These two processes enable the use of the information collected in the first run to achieve enhanced compression.

This study uses FFmpeg [36], a free and open-source software consisting of various libraries for handling video, audio, and other multimedia files. These libraries can be easily used from the command line ffmpeg. Default encoding settings for the relevant FFmpeg library are used to maintain consistency across all tests.

Image compression

To establish a baseline performance for comparison, individual flow snapshots are compressed using singular value decomposition (SVD) [58]. Individual snapshots are decomposed into left and right singular vector matrices UU and VTV^T, and a diagonal matrix Σ\Sigma containing the singular values. Snapshots are reconstructed by retaining the rr leading modes.

Here, the compression ratio η\eta in the SVD context is then defined as

η=r(m+n+1)mn,(16)\eta= \frac{r(m+n+1)}{mn}, \tag*{(16)}

where mm and nn are the snapshot dimensions in the horizontal and vertical directions and a value of η=1\eta= 1 corresponds to the original, uncompressed snapshot. In the present study, the snapshot dimensions for each flow example are set as (m,n)=(500,300)(m,n) = (500,300) for cylinder wake, (128,128)(128,128) for two-dimensional decaying turbulence, and (256,256)(256,256) for turbulent channel flow, respectively.

Let us compare the image compression techniques with the cylinder wake example. As for the data attribute, we use a streamwise velocity uu. The compressed wake fields and the spatial absolute error distributions with η≈0.05\eta\approx0.05 are presented in Figure 5. The L2L_2 error norm of reconstruction ε=∥fRef−fComp∥2/∥fRef∥2\varepsilon= \lVert f_{\mathrm{Ref}} - f_{\mathrm{Comp}}\rVert_2/\lVert f_{\mathrm{Ref}}\rVert_2, where fReff_{\mathrm{Ref}} and fCompf_{\mathrm{Comp}} are respectively the reference and compressed flow fields, is also shown underneath the decoded fields. The SVD produces negligible error for the entire flow field, although slight discontinuities are observed in the wake region. By comparison, JPEG compression introduces some compression artifacts including discontinuities of grayscale contours and granulated vortical structures. This is due to fixed-size areas upon which the DCT is performed and elementary anti-blocking features. This indicates that compression based on the fixed block of 8×88 \times8 pixels is not appropriate for flow fields that include fine-scale spatial variations. In contrast, the compressed flow field with the JP2 algorithm retains wake features even while achieving significant data compression, with the L2L_2 error of 0.003700.00370. These results support the effectiveness of the adaptive block size of DWT in JP2 compression for bluff body wake data sets.

Comparison of SVD, JPEG, and JPEG2000 compression results for a cylinder wake, showing compressed flow fields and spatial error distributions

Figure 5. Comparison of image compression techniques for cylinder wake at ReD=100Re_D = 100. A streamwise velocity field uu is considered. The L2L_2 error norm of the reconstruction ε\varepsilon and the compression ratio η\eta are shown underneath each flow field contour. Spatial absolute error distribution for each compression technique is also presented.

Next, we apply the image compression techniques to two-dimensional decaying homogeneous isotropic turbulence, as shown in Figure 6. We use a vorticity field ω\omega as a quantity of interest and compare the compression results with η≈0.280\eta\approx0.280. Similar to the cylinder example, the SVD can provide a smooth field and small error for the entire flow field. Although SVD can achieve a reasonable compression for the laminar cylinder wake and two-dimensional turbulence that are mainly composed of large vortical structures, we discuss later how the presence of fine-scale turbulent structures alters the compression performance. For this two-dimensional turbulence, the effect of 8×88 \times8 pixel blocks can be clearly observed in JPEG compression. Such pixelized artifacts on the flow field can be mitigated by using the JP2 compression technique, analogous to the observation with the cylinder example.

Comparison of image compression techniques for two-dimensional decaying turbulence

Figure 6. Comparison of image compression techniques for two-dimensional decaying turbulence. A vorticity field ω\omega is considered. The L2L_2 error norm of the reconstruction ε\varepsilon and the compression ratio η\eta are shown underneath each flow field contour.

The limitation of the SVD and the efficacy of the DWT-based process in the JP2 algorithm are further emphasized in the example of more complex turbulence. Here, the compression techniques are applied to a streamwise velocity uu of the three-dimensional channel flow. The compression results with η≈0.025\eta\approx0.025 are compared in Figure 7. As shown, the SVD-based compression cannot retain the important features of the streaks. Compared to SVD, JPEG provides a better reconstruction although it also introduces discontinuities that obscure small spatial length scales in the flow field. Surprisingly, JP2 produces non-negligible artifacts and maintains an L2L_2 error norm less than half that of SVD. The channel flow field at this low η\eta remains nearly indistinguishable from the uncompressed flow field, also preserving the streak spacing of the reference DNS field [57, 59]. These observations suggest the effectiveness of the JP2 algorithm for image compression of complex fluid flow data.

Comparison of image compression techniques for turbulent channel flow

Figure 7. Comparison of image compression techniques for turbulent channel flow at Reτ=180Re_\tau= 180. A streamwise velocity field uu is considered. The L2L_2 error norm of the reconstruction ε\varepsilon and the compression ratio η\eta are shown underneath each flow field contour.

Building on these assessments, the L2L_2 error between compressed and uncompressed flow fields is evaluated across compression ratios, as shown in Figure 8(a). The error is averaged over all temporal snapshots of each flow example. In general, all compression algorithms produce an asymptotically decaying L2L_2 error. JPEG introduces appreciable error at low η\eta, in the same order as SVD compression. It is worth pointing out that JP2 performs especially well at low η\eta while SVD compression produces the lowest L2L_2 error for high η\eta for all flow fields.

Relationship between the L2 error norm, SSIM, and image compression ratio, with zoom-in views for three flows

Figure 8. Relationship between (a) the L2L_2 error norm ε\varepsilon, (b) SSIM, and image compression ratio η\eta. Zoom-in view of η\eta-SSIM curve for (c) cylinder wake, (d) two-dimensional turbulence, and (e) turbulent channel flow.

As an additional metric for quantifying the error introduced by each compression method, the localized structural similarity index (SSIM) [60] is computed between compressed and uncompressed flow fields. SSIM can capture spatial correlation around pixels and is less sensitive against a pixel-wise error caused by translation and rotational difference compared to the L2L_2 error. Hence, SSIM is suited for the image and video-based compression analysis. The SSIM χ\chi is defined as

χ=l(ix,iy)c(ix,iy)s(ix,iy)(17)\chi= l(i_x,i_y)c(i_x,i_y)s(i_x,i_y) \tag*{(17)}

where

l(ix,iy)=2μxμy+C1μx2+μy2+C1,c(ix,iy)=2σxσy+C2σx2+σy2+C2,s(ix,iy)=σxy+C3σxσy+C3(18)l(i_x,i_y) = \frac{2\mu_x\mu_y + C_1}{\mu_x^2 + \mu_y^2 + C_1}, \quad c(i_x,i_y) = \frac{2\sigma_x\sigma_y + C_2}{\sigma_x^2 + \sigma_y^2 + C_2}, \quad s(i_x,i_y) = \frac{\sigma_{xy} + C_3}{\sigma_x\sigma_y + C_3} \tag*{(18)}

with μx\mu_x and σx\sigma_x defined as the mean and standard deviation of ixi_x respectively, σxy\sigma_{xy} being the covariance of ixi_x and iyi_y, and c1c_1, c2c_2, and c3c_3 being constants to stabilize division. We set {C1,C2,C3}={0.16,1.44,0.72}\{C_1,C_2,C_3\} = \{0.16, 1.44, 0.72\} following Wang et al. [60]. The resultant value lies between 0, representing no similarity, and 1, representing an identical image. The relationship between the image compression ratio and the L2L_2 error is depicted in Figure 8(b) Generally, JP2 and SVD produce a negligible decrease in the SSIM at low compression ratios and asymptotically approach an SSIM value of 1 at higher compression ratios. The SSIM value of the cylinder flow field with JPEG compression applied decays by approximately 10%, as a result of significant discontinuities produced by JPEG.

We also present the zoom-in view of the relationship between SSIM and the compression ratio η\eta for each flow, in Figure 8(c) − (Figure 8e). Similar to the observation in the η\eta − ε\varepsilon curves in Figure 8(a), SVD and JP2 provide high SSIM scores compared to JPEG. Especially at excessive compression (low η\eta) of three-dimensional turbulent channel flow, JP2 can provide better reconstructions than the other two cases. Although scalar metrics such as the L2L_2 error ε\varepsilon and SSIM are useful, we note that monitoring not only scalar values but also decoded flow fields with statistics is important in assessing how vortical structures can be retained through data compression because the influence of local structures are averaged.

We are additionally interested in whether finer structures in flow images can still be retained through the present compression process. To examine this aspect, we consider the kinetic energy spectrum of both two- and three-dimensional turbulent examples, as summarized in Figure 9. The kinetic energy spectrum E(k)E(k) for two-dimensional decaying turbulence is

Kinetic energy spectra for two-dimensional decaying homogeneous isotropic turbulence and three-dimensional turbulent channel flow

Figure 9. Kinetic energy spectra for two-dimensional decaying homogeneous isotropic turbulence using (a) JPEG and (d) JP2. (b, e) Streamwise and (c, f) spanwise kinetic energy spectrum of three-dimensional turbulent channel flow compressed with (b, c) JPEG and (e, f) JP2.

E(k)=12uiui‾,(19)E(k) = \frac{1}{2}\overline{u_i u_i}, \tag*{(19)}

where uiu_i are the components of the fluctuating velocity and the overbar denotes an averaging operation in space and time. For three-dimensional turbulent channel flow, the one-dimensional streamwise and spanwise spectra is evaluated

Euu(kx+;y+)=u∗u∗^z,t,Euu(kz+;y+)=u∗u∗^x,t,(20)E_{uu}(k_x^+;y^+) = \widehat{u^*u^*}^{z,t}, \qquad E_{uu}(k_z^+;y^+) = \widehat{u^*u^*}^{x,t}, \tag*{(20)}

where (⋅)∗(\cdot)^* represents the complex conjugate and (⋅)^\widehat{(\cdot)} denotes the one-dimensional Fourier transformed variable. Here, we compare three compression ratios, denoted as low, medium, and high, for each turbulent flow.

JP2 demonstrates a strong adherence to the kinetic energy spectrum of the uncompressed flow field in both the xx and zz directions while JPEG compression at low η\eta introduces non-negligible errors at higher wave numbers. This is a consequence of the quantization step of JPEG compression that removes high wavelength scales from the image. Considering the overestimation of Euu(kx+)E_{uu}(k_x^+) as seen in Figure 9 when using JPEG, this is likely caused by the absence of a deblocking filter, producing more high wavelength artifacts in the image than what exists in the uncompressed data. Similarly, the underestimation of E(k)E(k) by JP2 can be attributed to adaptive block sizes that produce a lower peak signal-to-noise ratio, indicative of lower quality. In general, JP2 is more adept at preserving high-wavenumber structures.

Video compression

From the perspective of information, fluid flows are inherently temporally-redundant — as such, video compression algorithms that perform temporal compression are a powerful tool, achieving compression performance that outperforms the previously analyzed image-based techniques. This section assesses the capabilities of video compression techniques such as H.264, H.265, and AV1 compression algorithms for time-varying fluid flow data. Additionally, proper orthogonal decomposition (POD) compression [61] is considered to compare this familiar method of compression within the fluid dynamics community with those analyzed herein [3, 62]. POD is used to decompose a matrix of vectorized, temporally evolving flow field data into a set of basis modes and eigenvalues that contain coherent flow structures and can be used for flow field reconstruction. Formally, a flow field q(x,t)−q(x)‾q(x,t)-\overline{q(x)} can be represented as ∑j=1najϕj\sum_{j=1}^{n} a_j\phi_j where aja_j is the temporal coefficient for mode ϕj\phi_j. The value of aja_j is the inner product between the mode ϕj\phi_j and the mean-subtracted flow field, q(x,t)−q(x)‾q(x,t)-\overline{q(x)}. This modal representation can be truncated to rr modes, such that the flow field is approximated by ∑j=1rajϕj\sum_{j=1}^{r}a_j\phi_j. This study uses the snapshot POD method [63] for comparison to the other video compression techniques. The compression ratio for a reconstructed flow field containing rr modes is evaluated as

η=r(m+n)+mn(m+n)+m,(21)\eta= \frac{r(m+n)+m}{n(m+n)+m}, \tag*{(21)}

where mm is the total number of pixels in the flow field and nn is the total number of flow snapshots. Note that POD is hereafter used for time-series of flow snapshots in comparing to the video compression techniques while we performed an instantaneous SVD for image compression.

The results of video compression for laminar cylinder wake at ReD=100Re_D=100 are shown in Figure 10. Here, we compare the decoded streamwise velocity field uu with η≈0.02−0.03\eta\approx0.02-0.03. POD compression introduces negligible error, likely as a result of the temporally redundant nature of periodic wake and the larger coherent modal structures that POD is able to extract. By comparison, H.264 compression produces significant artifacts at low η\eta. H.264 struggles likely because inter-frame prediction candidates are chosen from a shallow time range. We also observe that H.265 fails to improve in terms of error level over H.264 for the cylinder wake. This is due to the employment of a similar inter-frame prediction and selection algorithm to that of H.264. Compared to these H.2XX series, the AV1 algorithm provides much better compression, achieving a lower L2L_2 error than that achieved by H.264 and H.265. This highlights the enhanced capability of AV1 to compress laminar and temporally redundant flow fields.

Comparison of H.264, H.265, AV1, and POD compression of a streamwise velocity field

Figure 10. Comparison of video compression techniques applied on a streamwise velocity field uu of cylinder wake at ReD=100Re_D = 100, compressed using H.264, H.265, AV1, and POD compression algorithms. The L2L_2 error norm of the reconstruction ε\varepsilon and the compression ratio η\eta are shown underneath each flow field contour.

We next examine the video compression techniques for two-dimensional decaying homogeneous isotropic turbulence, as summarized in Figure 11. The flow fields are compared for the compression ratios of η≈0.02−0.03\eta\approx0.02 - 0.03. Similar to the cylinder case, POD compression provides a reasonable reconstruction, likely because large-scale vortical structures are dominant at this particular time. It is, however, easily anticipated that the error of this time-varying flow relies on the presence of a range of length scales, as the small length scales disappear with the progress of the decay over time [64, 65]. The dependence of the compression performance over time for decaying flow will be examined later. While H.2xx compression techniques provide a reasonable reconstruction, AV1 provides better compression without suffering from pixelized artifacts. These results suggest the powerful capabilities of novel deblocking filters for fluid flow applications.

Comparison of H.264, H.265, AV1, and POD compression of a two-dimensional isotropic turbulent vorticity field

Figure 11. Comparison of video compression techniques applied on two-dimensional isotropic turbulent vorticity field, compressed using H.264, H.265, AV1, and POD compression algorithms. The L2L_2 error norm of the reconstruction ε\varepsilon and the compression ratio η\eta are shown underneath each flow field contour.

The video compression techniques are also applied to the x−zx-z sectional streamwise velocity field uu of three-dimensional turbulent channel flow at Reτ=180Re_\tau= 180, as depicted in Figure 12. The compressed flow fields are compared for η≈0.150\eta\approx0.150. In contrast to the other flow examples, POD compression produces significant visible artifacts and a high error value for turbulent channel flow because of a complex temporal evolution of the flow field. POD requires a greater number of modes for adequate reconstruction [66, 67, 68]. Although H.265 improves over H.264 significantly for turbulent channel flow, this still produces few observable discontinuities. This is likely caused by adaptive tiling in macroblocks for prediction procedures, allowing lower η\eta with similar flow field representation. AV1 exceeds the performance of H.264 and H.265 consistently and POD compression on turbulent channel flow. Flow fields compressed using AV1 are indistinguishable from uncompressed flow fields at high η\eta.

Comparison of video compression techniques applied on a streamwise velocity field

Figure 12. Comparison of video compression techniques applied on a streamwise velocity field uu of three-dimensional turbulent channel flow at Reτ=180Re_\tau= 180, compressed using H.264, H.265, AV1, and POD compression algorithms. The L2L_2 error norm of the reconstruction ε\varepsilon and the compression ratio η\eta are shown underneath each flow field contour.

The L2L_2 error and SSIM are evaluated across a range of compression ratios for each type of flow field, as presented in Figure 13. In general, all video compression algorithms produce asymptotically decaying L2L_2 error values with increasing η\eta. AV1 performs well at low η\eta, especially for the cylinder wake. Additionally, all compression algorithms perform well for two-dimensional turbulence, likely as a result of the flow field snapshots holding slow changes from one frame to the next due to the decaying nature of the flow. Moreover, as observed with samples at various compression ratios, the L2L_2 error for all algorithms plateau at non-negligible values for the cylinder wake flow field. SSIM values generally diverge from the asymptotic limit at low η\eta. The exceptional cases include cylinder wake and two-dimensional turbulence compressed using AV1, which introduces negligible error at low η\eta. AV1 outperforms H.264 and H.265 on turbulent channel flow as well, due to the improved blocking techniques.

Relationship between L2 error norm, SSIM, and video compression ratio, with zoom-in views for cylinder wake and two-dimensional isotropic turbulence

Figure 13. Relationship between (a) the L2L_2 error norm ε\varepsilon, (b) SSIM, and video compression ratio η\eta. Zoom-in view of η\eta-SSIM curve for (c) cylinder wake and (d) two-dimensional isotropic turbulence.

In addition, the time evolution of the L2L_2 error is examined to gain insight into the performance of video compression algorithms for individual snapshots. The temporal evolution of the L2L_2 error norm ε\varepsilon for two-dimensional decaying turbulence is shown in figure 14. H.2xx compression techniques exhibit repeated temporal structures in its L2L_2 error evolution, likely as a consequence of inter-frame prediction selecting frames to make predictions from at relatively similar intervals. AV1 compression provides a distinctive reduction in the L2L_2 error over time for medium and low η\eta, indicating improved accuracy as snapshots begin to show redundancies due to the vortex field decaying and exhibiting similar large-scale coherent structures from one snapshot to the next. We also observe that H.264 produces a high error

L2 error norm of vorticity field for two-dimensional decaying homogeneous isotropic turbulence over time

Figure 14. L2L_2 error norm ε\varepsilon of vorticity field ω\omega for two-dimensional decaying homogeneous isotropic turbulence over time. (a) H.264, (b) H.265, and (c) AV1. (i) and (ii) in each case are chosen due to their employment in inter-frame prediction in each algorithm.

at low η\eta for early flow field snapshots. This relates to the time-varying flow nature of the present decaying turbulence, as mentioned above. The presence of finer structures at the high Taylor Reynolds number Re⁡λ(t)\operatorname{Re}_{\lambda}(t) portion of the flow likely causes the difficulty in compressing vortical flow data.

We also examine the L2L_2 error norm ε\varepsilon and the flow fields over time for turbulent channel flow, as depicted in Figure 15. H.264 generally produces a larger L2L_2 error compared to the other techniques, as we also observed with the visual assessments in Figure 12. With low η\eta of H.264 compression, the error decreases over time, likely as a result of a later snapshot being selected for inter-frame prediction. Compared to H.264, H.265 provides better compression over time. Similar to the observation with H.264, the L2L_2 error significantly varies over time at a low η\eta. This is likely due to the inter-frame selection of an early frame from which further predictions were made. AV1 produces a negligible error at a high η\eta while the errors increase as η\eta decreases.

L2 error norm of streamwise velocity field for turbulent channel flow over time

Figure 15. L2L_2 error norm ε\varepsilon of streamwise velocity field uu for turbulent channel flow over time. (a) H.264, (b) H.265, and (c) AV1. (i) and (ii) in each case are chosen due to their employment in inter-frame prediction in each algorithm.

We are also interested in the performance of video compression algorithms in preserving high wavenumber structures in the compressed state. The general performance of each compression algorithm with regard to kinetic energy spectra of each flow field is investigated, as shown in Figure 16. H.264 performs well for two-dimensional turbulence, but produces a noticeable error at all η\eta in both the stream- and spanwise directions of the kinetic energy spectrum of turbulent channel flow. A similar divergence from the expected data can be observed at low η\eta in the spanwise direction as well. H.265 performs comparatively well for two-dimensional decaying isotropic turbulence, and for turbulent channel flow in the spanwise direction. However, it produces a non-negligible error at high wavenumbers when compressed at low η\eta in the spanwise direction. This indicates an over-representation of high-wavenumber components due to blocking as a result of the adaptive subblock sizes of H.265. Generally, AV1 is the best-suited algorithm for preserving spatial frequency information, particularly at high wavenumbers, for both two and three-dimensional turbulent flow fields. At higher η\eta, the energy contents at each wavenumber are almost indistinguishable.

Kinetic energy spectra

Figure 16. Kinetic energy spectra E(k)E(k) for (a,d,g)(a, d, g) two-dimensional decaying homogeneous isotropic turbulence using H.264, H.265, and AV1. (b,e,h)(b, e, h) Streamwise Euu(kx+)E_{uu}(k_x^+) and (c,f,i)(c, f, i) spanwise kinetic energy spectra Euu(kz+)E_{uu}(k_z^+) of three-dimensional turbulent channel flow.

At last, we investigate whether the video compression techniques can preserve the temporal evolution of complex turbulent flows. Here, let us examine the temporal two-point correlation for three-dimensional channel flow compressed using all three video compression algorithms. The temporal two-point correlation coefficient at a given t+t^{+} is defined as Ruu+(t+)/Ruu+(0)R_{uu}^{+}(t^{+})/R_{uu}^{+}(0) [69, 70] and is depicted in Figure 17. The assessment of temporal two-point correlation provides insight into the relations of flow snapshots to preceding snapshots.

Normalized temporal two-point correlation coefficients for H.264, H.265, and AV1

Figure 17. Normalized temporal two-point correlation coefficients Ruu(t+)/Ruu(0)R_{uu}(t^+)/R_{uu}(0) for three-dimensional turbulent channel flow using H.264, H.265, and AV1.

Consistent with the insights gained from the kinetic energy spectrum, H.264 compression at a η\eta exhibits disagreement with the reference curve at t+t^+ values between 5 and 30, and above 50. This is indicative of a de-correlation of the velocity field and is likely a result of poor performance in capturing high-wavenumber information. Except for this particular case, all compression algorithms generally perform well, with temporal two-point correlation coefficients closely following that of the uncompressed flow field. These results suggest that these novel video compression techniques capture the spatio-temporal redundancies well even for complex turbulent flows and also significantly reduce data size while preserving their physics.

Conclusion

We compressed flow field data from canonical flow examples using a number of widely-available multimedia compression techniques. The performance of the JPEG and JP2 spatial image compression techniques and the H.264, H.265, and AV1 spatio-temporal video compression techniques were considered for simulated laminar cylinder flow, decaying isotropic turbulence, and turbulent channel flow. Streamwise velocity and vorticity field data were represented as grayscale images and videos, and were compressed using the aforementioned techniques.

All techniques, with the exception of JPEG, were shown to compress flow data below 10% of the original file size while introducing negligible error and preserving underlying flow physics. AV1 and H.265 compression were shown to have the best performance across a variety of flow regimes. The spatial error distributions were concentrated on the cylinder surface and directly behind the cylinder for the streamwise velocity data compression and in the vortex shedding wake for the vorticity data. Turbulence statistics in the form of kinetic energy spectra were preserved under compression for all methods except JPEG.

For single snapshots of data represented as an image, JP2 compression was shown to far outperform JPEG compression, with a tolerable increase in computational complexity. For multiple temporal snapshots of data represented as a video, the choice of compression method becomes more nuanced. JP2 compression was shown to achieve the lowest compression error as temporal compression adds slight error to the data. The AV1 algorithm maximizes η\eta at the expense of computational complexity and non-negligible encoding time. This algorithm is new and emerging from the research environment, so future optimizations could bring this encoding time to a manageable level. The H.265 algorithm provided excellent compression performance at a fast encoding time, and appears as a promising algorithm for current fluid dynamics applications. H.264 provided acceptable compression performance, but was largely triumphed by the AV1 and H.265 algorithms. AV1 exhibited a significant difference of compression performance compared to conventional techniques for complex turbulence data. Hence, it can be argued that AV1 can be especially recommended in compressing complex turbulent flows.

We have shown that modern multimedia compression algorithms provide robust performance in a variety of fluid flow applications. The implementation of these techniques becomes especially pertinent as simulations within computational fluid dynamics become exceedingly data-intensive, a trend that decreases the accessibility to high-fidelity models. These methods are free, easily accessible, regularly updated and supported, and provide flexible and scalable compression performance. Multimedia compression can also support fast data transfer from open fluid-flow databases [71, 72, 73], promoting data-based analysis in fluid mechanics. As such, the implementation of these compression techniques has exciting potential across the fluid dynamics community for data storage and transfer with minimal loss.

Acknowledgements

KT acknowledges the support from the US Army Research Office (W911NF-21-1-0060), the US Air Force Office of Scientific Research (FA9550-21-1-0178), and the US Department of Defense Vannevar Bush Faculty Fellowship (N00014-22-1-2798). We also thank Professor Koji Fukagata (Keio University) for sharing his DNS code.

Encoding time

The increased performance of new compression algorithms comes at a cost; non-negligible increases in computational complexity should be considered when implementing these algorithms. In fact, in a paper from 2000 on compressing three-dimensional flows with the JPEG and JP2 algorithms [74], the added complexity of the JP2 algorithm caused JPEG to be recommended over JP2, despite losing clear performance benefits. The recommendation of the present study reverses that statement. As such, it is important to quantify the encoding time of these algorithms at the time of writing this study.

The decoding time is observed to be negligibly small for all compression codecs; thus, this appendix focuses on encoding. The streamwise velocity and vorticity data are encoded for both the laminar cylinder flow and turbulent channel flow cases at the same bitrate (100 KB/s) for all compression algorithms and the encoding time is measured.

The encoding is performed with a 2.5GHz i7 Intel Core processor and 8 GB RAM. The results are summarized in Table 1. Encoding time per frame is observed to be larger for the turbulent channel flow than the laminar cylinder flow, indicating that the algorithms struggle to encode multiscale turbulent flow data. Across encoding algorithms, JPEG and H.264 compression are the fastest, a testament to the maturity and low complexity of these methods. JP2 and H.265 encoding are generally several times slower, but still relatively fast, justifying their added compression performance. AV1 is observed to be far slower in encoding than the other methods: over 100 times slower than JPEG and H.264, and over 25 times slower than JP2 and H.265. This severe encoding time increase limits the practicality of implementing this algorithm in large-scale applications, and perhaps justifies the use of H.265 over AV1. As the algorithm was released only a few years prior to the writing of this paper, advances in computing and algorithm development could increase its practicality in the near future.

JPEGJP2H.264H.265AV1
uu, Cylinder Flow0.582.270.942.8561.21
ω\omega, Cylinder Flow0.591.530.922.3943.83
uu, Channel Flow0.291.420.451.9649.59

Table 1. Encoding time (s) for different compression algorithms and flow regimes, compressed at 100 KB/s bitrate.

Declarations

Conflict of interest

The authors declare that they have no conflict of interest.

Authors’ contributions

KT designed research. VA, JF, and KF performed research and analyzed data. VA, JF, KF and KT wrote the paper. KT supervised.

Availability of data and materials

The data that support the findings of this study are available from the corresponding author upon reasonable request.

References

  1. [1]P. Holmes, J.L. Lumley, G. Berkooz, and C. W. Rowley. Turbulence, Coherent Structures, Dynamical Systems and Symmetry. Cambridge Univ. Press, 2nd edition, 2012.
  2. [2]P. J. Schmid. Dynamic mode decomposition of numerical and experimental data. J. Fluid Mech., 656:5–28, 2010.
  3. [3]K. Taira, S. L. Brunton, S. T. M. Dawson, C. W. Rowley, T. Colonius, B. J. McKeon, O. T. Schmidt, S. Gordeyev, V. Theofilis, and L. S. Ukeiley. Modal analysis of fluid flows: An overview. AIAA J., 55(12):4013–4041, 2017.
  4. [4]Z. Wu, T. A. Zaki, and C. Meneveau. Data compression for turbulence databases using spatiotemporal subsampling and local resimulation. Phys. Rev. Fluids, 5(6), 2020.DOI
  5. [5]Y. Liu, Y. Wang, D. Liang, F. Wang, F. Liu, Y. Lu, and S. Li. A novel in situ compression method for CFD data based on generative adversarial network. J. Vis., 22, 10 2018.DOI
  6. [6]A. Glaws, R. King, and M. Sprague. Deep learning for in situ data compression of large turbulent flow simulations. Phys. Rev. Fluids, 5(11):114602, 2020.DOI
  7. [7]A. T. Mohan, D. Tretiak, M. Chertkov, and D. Livescu. Spatio-temporal deep learning models of 3D turbulence with physics informed diagnostics. J. Turb., 21(9-10):484–524, 2020.DOI
  8. [8]M. Momenifar, E. Diao, V. Tarokh, and A. D. Bragg. Dimension reduced turbulent flow data from deep vector quantisers. J. Turb., 23(4-5):232–264, 2022.DOI
  9. [9]J. G. Apostolopoulos, W.-T. Tan, and S. J. Wee. Video streaming: Concepts, algorithms, and systems. HP Laboratories, Report HPL-2002-260, pages 2641–8770, 2002.
  10. [10]A. Rao, A. Legout, Y.-S. Lim, D. Towsley, C. Barakat, and W. Dabbous. Network characteristics of video streaming traffic. In Proceedings of the seventh conference on emerging networking experiments and technologies, pages 1–12, 2011.arxiv.org/abs/1111.0948
  11. [11]X. Jiang, F. R. Yu, T. Song, and V. C. M. Leung. A survey on multi-access edge computing applied to video streaming: some research issues and challenges. IEEE Commun. Surv. Tutor., 23(2):871–903, 2021.DOI
  12. [12]C. Egido. Video conferencing as a technology to support group work: a review of its failures. In Proceedings of the 1988 ACM conference on Computer-supported cooperative work, pages 13–24, 1988.DOI
  13. [13]K. M. Augestad and R. O. Lindsetmo. Overcoming distance: video-conferencing as a clinical and educational tool among surgeons. World J. Surg., 33(7):1356–1365, 2009.DOI
  14. [14]C. B. Mpungose. Lecturers’ reflections on use of Zoom video conferencing technology for e-learning at a south african university in the context of coronavirus. Afr. Identities, pages 1–17, 2021.DOI
  15. [15]A. Said and W. A Pearlman. An image multiresolution representation for lossless and lossy compression. IEEE Trans. Image Process., 5(9):1303–1310, 1996.
  16. [16]F. Liu, M. Hernandez-Cabronero, V. Sanchez, M. W. Marcellin, and A. Bilgin. The current role of image compression standards in medical imaging. Information, 8(4):131, 2017.DOI
  17. [17]K. Arora and M. Shukla. A comprehensive review of image compression techniques. Int. J. Comput. Sci. Inf. Technol., 5(2):1169–1172, 2014.
  18. [18]J. Guo and H. Chao. Building dual-domain representations for compression artifacts reduction. In European Conference on Computer Vision, pages 628–644. Springer, 2016.
  19. [19]J. Schmalzl. Using standard image compression algorithms to store data from computational fluid dynamics. Comput. Geosci., 29(8):1021–1031, 2003.DOI
  20. [20]N. Ahmed, T. Natarajan, and K. R. Rao. Discrete cosine transform. IEEE Trans. Comput., 100(1):90–93, 1974.
  21. [21]N. Ahmed. How I came up with the discrete cosine transform. Digit. Signal Process., 1(1):4–5, 1991.
  22. [22]J. Mitchell. Digital compression and coding of continuous-tone still images: Requirements and guidelines. ITU-T Recommendation T, 81, 1992.
  23. [23]D. Taubman and M. Marcellin. JPEG2000 image compression fundamentals, standards and practice: image compression fundamentals, standards and practice, volume 642. Springer Science & Business Media, 2012.
  24. [24]K. Schneider and O. V. Vasilyev. Wavelet methods in computational fluid dynamics. Annu. Rev Fluid Mech., 42:473–503, 2010.
  25. [25]R. Hoffman. Data compression in digital systems. Springer Science & Business Media, 2012.
  26. [26]Y. Fisher. Fractal image compression. Fractals, 2(03):347–361, 1994.
  27. [27]Y. Fisher. Fractal image compression: theory and application. Springer Science & Business Media, 2012.
  28. [28]S. G. Mallat and Z. Zhang. Matching pursuits with time-frequency dictionaries. IEEE Trans. Signal Process., 41(12):3397–3415, 1993.DOI
  29. [29]P. N. Tudor. MPEG-2 video compression. Electron. Commun. Eng. J., 7(6):257–264, 1995.
  30. [30]B. G. Haskell, A. Puri, and A. N. Netravali. Digital video: an introduction to MPEG-2. Springer Science & Business Media, 1996.
  31. [31]M. Bosi, K. Brandenburg, S. Quackenbush, L. Fielder, K. Akagiri, H. Fuchs, and M. Dietz. ISO/IEC MPEG-2 advanced audio coding. J. Audio Eng. Soc., 45(10):789–814, 1997.
  32. [32]T. Wiegand, G. J. Sullivan, G. Bjøntegaard, and A. Luthra. Overview of the H.264/AVC video coding standard. IEEE Trans. Circuits Syst. Video Technol., 13(7):560–576, 2003.
  33. [33]G. Pastuszak and A. Abramowski. Algorithm and architecture design of the H.265/HEVC intra encoder. IEEE Trans. Circuits Syst. Video Technol., 26(1):210–222, 2015.DOI
  34. [34]Y. Chen, D. Murherjee, J. Han, A. Grange, Y. Xu, Z. Liu, S. Parker, C. Chen, H. Su, U. Joshi, C.-H. Chiang, Y. Wang, P. Wilkins, J. Bankoski, L. Trudeau, N. Egge, J.-M. Valin, T. Davies, S. Midtskogen, A. Norkin, and P. de Rivaz. An overview of core coding tools in the AV1 video codec. In 2018 Picture Coding Symposium (PCS), pages 41–45, 2018.DOI
  35. [35]J. Han, B. Li, D. Mukherjee, C.-H. Chiang, A. Grange, C. Chen, H. Su, S. Parker, S. Deng, U. Joshi, Y. Chen, Y. Wang, P. Wilkins, and Y. Xu. A technical overview of AV1. Proceedings of the IEEE, 109(9):1435–1462, 2021.
  36. [36]FFmpeg. A complete, cross-platform solution to record, convert and stream audio and video. https://www.ffmpeg.org/, 2022. Accessed: 2022-11-25.
  37. [37]G.K. Wallace. The JPEG still picture compression standard. IEEE Trans. Consum. Electron., 38(1):xviii–xxxiv, 1992.
  38. [38]V. Sze and D. Marpe. Entropy coding in HEVC. In High Efficiency Video Coding (HEVC), pages 209–274. Springer, 2014.DOI
  39. [39]J. Duda, K. Tahboub, N. J. Gadgil, and E. J. Delp. The use of asymmetric numeral systems as an accurate replacement for huffman coding. In 2015 Picture Coding Symposium (PCS), pages 65–69. IEEE, 2015.DOI
  40. [40]C. E. Shannon. A mathematical theory of communication. Bell Syst. Tech. J., 27(3):379–423, 1948.
  41. [41]D. A. Huffman. A method for the construction of minimum-redundancy codes. Proc. IRE, 40(9):1098–1101, 1952.
  42. [42]D. E. Knuth. Fundamental algorithms. 1973.
  43. [43]I. Daubechies. Orthonormal bases of compactly supported wavelets. Commun. Pure Appl. Math., 41(7):909–996, 1988.
  44. [44]S. G. Mallat. Multiresolution approximations and wavelet orthonormal bases of l² (r). Trans. Am. Math. Soc., 315(1):69–87, 1989.
  45. [45]N. Ricker. Wavelet contraction, wavelet expansion, and the control of seismic resolution. Geophysics, 18(4):769–792, 1953.
  46. [46]C. E. Heil and D. F. Walnut. Continuous and discrete wavelet transforms. SIAM review, 31(4):628–666, 1989.
  47. [47]J. Rissanen and G. G. Langdon. Arithmetic coding. IBM J. Res. Dev., 23(2):149–162, 1979.
  48. [48]P. List, A. Joch, J. Lainema, G. Bjontegaard, and M. Karczewicz. Adaptive deblocking filter. IEEE Trans. Circuits Syst. Video Technol., 13(7):614–619, 2003.DOI
  49. [49]Gary J. Sullivan, Jens-Rainer Ohm, Woo-Jin Han, and Thomas Wiegand. Overview of the high efficiency video coding (HEVC) standard. IEEE Trans. Circuits Syst. Video Technol., 22(12):1649–1668, 2012.DOI
  50. [50]S. Midtskogen and J.-M. Valin. The AV1 constrained directional enhancement filter (CDEF). In 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 1193–1197. IEEE, 2018.
  51. [51]K. Taira and T. Colonius. The immersed boundary method: A projection approach. J. Comput. Phys., 225(2):2118–2137, 2007.
  52. [52]T. Colonius and K. Taira. A fast immersed boundary method using a nullspace approach and multi-domain far-field boundary conditions. Comput. Methods Appl. Mech. Eng., 197:2131–2146, 2008.DOI
  53. [53]K. Taira, A. G. Nair, and S. L. Brunton. Network structure of two-dimensional decaying isotropic turbulence. J. Fluid Mech., 795:R2, 2016.
  54. [54]K. Fukagata, N. Kasagi, and P. Koumoutsakos. A theoretical prediction of friction drag reduction in turbulent flow by superhydrophobic surfaces. Phys. Fluids, 18:051703, 2006.DOI
  55. [55]K. Fukami, K. Fukagata, and K. Taira. Machine-learning-based spatio-temporal super resolution reconstruction of turbulent flows. J. Fluid Mech., 909:A9, 2021.
  56. [56]R. D. Moser, J. Kim, and N. N. Mansour. Direct numerical simulation of turbulent channel flow up to Reτ = 590. Phys. Fluids, 11(4):943–945, 1999.
  57. [57]J. Kim, P. Moin, and R. Moser. Turbulence statistics in fully developed channel flow at low Reynolds number. J. Fluid Mech., 177:133–166, 1987.DOI
  58. [58]G. W. Stewart. On the early history of the singular value decomposition. SIAM Rev., 35(4):551–566, 1993.
  59. [59]C. R. Smith and S. P. Metzler. The characteristics of low-speed streaks in the near-wall region of a turbulent boundary layer. J. Fluid Mech., 129:27–54, 1983.DOI
  60. [60]Z. Wang, A. C. Bovik, H. R. Sheikh, and E. P. Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE Trans. Image Process., 13(4):600–612, 2004.
  61. [61]J. L. Lumley. The structure of inhomogeneous turbulent flows. In A. M. Yaglom and V. I. Tatarski, editors, Atmospheric turbulence and radio wave propagation. Nauka, 1967.
  62. [62]K. Taira, M. S. Hemati, S. L. Brunton, Y. Sun, K. Duraisamy, S. Bagheri, S. Dawson, and C.-A. Yeh. Modal analysis of fluid flows: Applications and outlook. AIAA J., 58(3):998–1022, 2020.arxiv.org/abs/1903.05750
  63. [63]L. Sirovich. Turbulence and the dynamics of coherent structures. I. Coherent structures. Q. Appl. Math., 45(3):561–571, 1987.
  64. [64]J. C. McWilliams. The emergence of isolated coherent vortices in turbulent flow. J. Fluid Mech., 146:21–43, 1984.
  65. [65]C.-A. Yeh, M. Gopalakrishnan Meena, and K. Taira. Network broadcast analysis and control of turbulent flows. J. Fluid Mech., 910:A15, 2021.DOI
  66. [66]G. Alfonsi and L. Primavera. The structure of turbulent boundary layers in the wall region of plane channel flow. Proc. R. Soc. A, 463(2078):593–612, 2007.DOI
  67. [67]S. D. Muralidhar, B. Podvin, L. Mathelin, and Y. Frigneau. Spatio-temporal proper orthogonal decomposition of turbulent channel flow. J. Fluid Mech., 864:614–639, 2019.DOI
  68. [68]K. Fukami, T. Nakamura, and K. Fukagata. Convolutional neural network based hierarchical autoencoder for nonlinear mode decomposition of fluid field data. Phys. Fluids, 32(9):095110, 2020.
  69. [69]K. Fukami, Y. Nabae, K. Kawai, and K. Fukagata. Synthetic turbulent inflow generator using machine learning. Phys. Rev. Fluids, 4:064603, 2019.DOI
  70. [70]M. Quadrio and P. Luchini. Integral space–time scales in turbulent wall flows. Phys. Fluids, 15(8):2219–2227, 2003.DOI
  71. [71]Y. Li, E. Perlman, M. Wan, Y. Yang, C. Meneveau, R. Burns, S. Chen, A. Szalay, and G. Eyink. A public turbulence database cluster and applications to study Lagrangian evolution of velocity increments in turbulence. J. Turb., (9):N31, 2008.DOI
  72. [72]X. Wu and P. Moin. A direct numerical simulation study on the mean velocity characteristics in turbulent pipe flow. J. Fluid Mech., 608:81–112, 2008.DOI
  73. [73]A. Towne, S. Dawson, G. A. Brès, A. Lozano-Durán, T. Saxton-Fox, A. Parthasarathy, A. R. Jones, H. Biler, C.-A. Yeh, H. D. Patel, and K. Taira. A database for reduced-complexity modeling of fluid flows. AIAA J., 2023.
  74. [74]J. Schmalzl. Using standard image compression algorithms to store data from computational fluid dynamics. Comput. Geosci., 29(8):1021–1031, 2003.

Paper details

vlnc:W_ussgaqwx
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

Not recorded for this paper

View statement
Looking for related papers…
Contents