Method and apparatus for parallel decoding of digital data

WO2026017876A3PCT designated stage Publication Date: 2026-02-19INTOPIX
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/EP2025/070701
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-05-27
Filing Date
2025-07-18
Publication Date
2026-02-19

AI Technical Summary

Technical Problem

The computational complexity of image and video compression algorithms, particularly in resource-constrained environments, limits their applicability in scenarios such as mobile devices and real-time processing, necessitating more efficient encoding and decoding methods.

Method used

A method for encoding and decoding digital images that involves grouping coefficients into buffers, accumulating bits in parallel, and interleaving these buffers to form a packed data set, utilizing SIMD and specialized bit manipulation instructions for improved computational efficiency.

Benefits of technology

This method reduces the computational time for encoding and decoding by 4 to 10 times compared to the reference implementation, enabling faster processing in resource-constrained environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure EP2025070701_19022026_PF_FP_ABST
    Figure EP2025070701_19022026_PF_FP_ABST
Patent Text Reader

Abstract

The present invention relates to a method for decoding an encoded image obtainable by applying at least one wavelet-type filter operation in a vertical direction, wherein the efficiency of the decoding is improved by reducing dependencies between respective processing channels decoding in parallel respective strips of spatial image samples, wherein each processing channel reconstructs a strip of spatial image samples independently from the other processing channels from an extended group of wavelet coefficients, whereby extended groups of wavelet coefficients mutually overlap to an extent that each extended group of wavelet coefficients comprises all the wavelet coefficients required for the processing channel receiving the extended group of wavelet coefficients to independently reconstruct a strip of spatial image samples. The present invention also relates to an apparatus and a computer program for performing the method for decoding.
Need to check novelty before this filing date? Find Prior Art

Description

Method and apparatus for parallel decoding of digital data Technical field

[0001] The present invention relates to the field of digital image and video compression. More precisely, the present invention relates to computer-implemented methods, apparatuses, and computer programs for encoding and / or decoding digital images. Background

[0002] Digital images and videos are increasingly prevalent in modern communication, entertainment, surveillance, and scientific applications. As the demand for high-resolution and / or high-framerate content continues to grow, so does the need for efficient image and video compression techniques to reduce storage requirements and transmission bandwidth. Numerous algorithms and standards have been developed to address these challenges, including both lossy and lossless compression methods.

[0003] The software implementation of image and video compression algorithms often involves substantial computational complexity, which can limit their applicability in resource- constrained environments such as mobile devices, embedded systems, or real-time processing scenarios. Therefore, there is a need for improving the computational efficiency of encoding and / or decoding of digital images and videos. Disclosure of the invention

[0004] To this end, four innovative improvements over the prior art are disclosed herein. These innovative improvements may work independently or be combined. The present invention as defined in the claims relates primarily to the second innovative improvement. However, the invention may advantageously be combined with one or more other innovative improvements described herein. First innovative improvement

[0005] In this section, the “method for encoding” relates to the method for encoding according to the first innovative improvement, unless otherwise specified. Similarly, in this section, the “method for decoding” relates to the method for decoding according to the first innovative improvement, unless otherwise specified. Technical field

[0006] The first innovative improvement relates to a method, apparatus, and computer program for encoding an input data set comprising a sequence of coefficients into a packed data set. The first innovative improvement also relates to a method, apparatus, and computer program for decoding a packed data set into an output data set. Background

[0007] The JPEG XS standard, formally known as ISO / IEC 21122, is an interoperable, visually lossless, low-latency, and lightweight image and video coding system. JPEG XS Part 1, formally known in its second edition as ISO / IEC 21122-1:2022, normatively defines how a compressed JPEG XS codestream can be transformed into a decoded image in a bit exact manner, a “codestream” being defined in the JPEG XS standard as a compressed image data representation that includes all necessary data to allow a (full or approximate) reconstruction of the sample values of a digital image. Moreover, JPEG XS Part 1 provides some key algorithms enabling an encoder to generate a JPEG XS codestream.

[0008] The following definitions and notations are used herein. A “coefficient” is an integer number, coded in binary representation, and having a magnitude and an optional sign value. Parameter NS designates the number of bits coding the value of a coefficient, which is also herein referred to as the “size” of a coefficient. A coefficient may correspond to an image data, such as for example the value of a pixel of an image, or the value of a color component of a pixel of an image. Coefficients may be grouped into a “group of coefficients”, which is also referred to as a “code group” in the JPEG XS standard. Parameter Ng designates the number of coefficients in a group, which is also herein referred to as the “size” of a group. In a group of Ng coefficients, a “bitplane” is an array of Ng bits of the coefficients of the group all having the same significance. The significance, or weight, of a bit relates to the position of the bit within a binary number, the “most significant bit”, or “MSB”, having the highest weight, i.e. the highest position within a binary number, and the “least significant bit”, or “LSB” having the lowest weight, i.e. the lowest position within a binary number. Coefficients may be comprised in a sequence of coefficients, i.e. an ordered set of coefficients.

[0009] Table C.8 (“Syntax of the data subpacket”) in subclause C.5.4 (“Data subpacket”) of ISO / IEC 21122-1:2022 specifies the syntax of the data subpacket in a codestream compliant with the JPEG XS standard. In summary, the JPEG XS standard specifies that coefficients in a sequence of groups of coefficients must be packed into a data subpacket such as to meet the following requirements:1) the order of the coefficients within a group is preserved in bitplanes packed into the data subpacket, i.e. a bitplane of a group of four coefficients ABCD will begin with a bit from coefficient A, followed by a bit from coefficient B, followed by a bit from coefficient C, and finish with a bit from coefficient D; 2) the order of bitplanes is preserved in the data subpacket, i.e. bitplanes of a group of coefficients are packed in the data subpacket by decreasing significance, starting with the most significant bitplane to be packed until the least significant bitplane to be packed; 3) the order of the groups of coefficients in the sequence of groups is preserved in the data subpacket, i.e. if a group X of coefficients precedes a group Y of coefficients in the sequence of groups, then the bits of coefficients of group X will be packed before the bits of coefficients of group Y in the data subpacket.

[0010] Here is an example illustrating how a sequence of coefficients is packed into a data subpacket according to the JPEG XS standard. Let us first introduce a few more definitions and notations. First, a “packed data set” as used herein is a data set comprising a sequence of packed coefficients. A data subpacket according to the JPEG XS standard is a packed data set. In addition, a “bitplane count” as used herein is the number of bits, preferably the number of consecutive bits, of each coefficient in a group of coefficients to be packed into a packed data set or extracted from a packed data set. Herein, consecutive bits are bits of consecutive significance. An equivalent definition of a bitplane count is the following: a bitplane count for a group of coefficients is the number of bitplanes of said group, preferably bitplanes of consecutive significance, to be packed into a packed data set or extracted from a packed data set. Finally, parameter NCG as used herein designates the number of groups of coefficients in a sequence of coefficients. Let us then consider a sequence V of 8 coefficients such that V = {a, b, c, d, e, f, g, h}, each coefficient being coded in NS = 16 bits, the coefficients being grouped into groups of Ng = 4 consecutive coefficients, so as to form NCG = 2 groups of coefficients, i.e. {a, b, c, d} and {e, f, g, h}. Let us further consider a sequence L of bitplane counts such that L = {3, 1}, the sequence L comprising a bitplane count for each one of the NCG= 2 groups of coefficients. Let us finally denote each bit of a coefficient with an index representing its significance, a higher index denoting a higher significance, such that the bits of a coefficient “a” are denoted as “a15a14a13a12a11a10a9a8a7a6a5a4a3a2a1a0”. In such a case, the coefficients are packed into a packed data set P in the following way according to the JPEG XS standard: P = a2b2c2d2a1b1c1d1a0b0c0d0e0f0g0h0,which meets the requirements 1) to 3) set forth hereinabove.

[0011] JPEG XS Part 5, formally known in its second edition as ISO / IEC 21122-5:2022, provides the JPEG XS reference software, which is a reference software implementation of an encoder and a decoder compliant with the JPEG XS standard. In said reference implementation, the algorithm for the encoding and / or decoding of a data subpacket essentially iterates over each bit of each coefficient sequentially. Efficiency of this algorithm could be improved in order to enable a faster encoding and / or decoding of digital images and videos.

[0012] Therefore, there is a need for a method, apparatus, and computer program for encoding an input data set comprising a sequence of coefficients into a packed data set or for decoding such a packed data set into an output data set in a more efficient manner than the one disclosed in the reference implementation of the JPEG XS standard, which proposes to iterate over each bit of each coefficient sequentially. Disclosure of the first innovative improvement

[0013] To this end, the first innovative improvement proposes a method, apparatus, and computer program for encoding an input data set comprising a sequence of coefficients into a packed data set in a more efficient manner than the one disclosed in the reference implementation of the JPEG XS standard. The first innovative improvement further proposes a method, apparatus, and computer program for decoding such a packed data set into an output data set in a more efficient manner than the one disclosed in the reference implementation of the JPEG XS standard. Advantageously, the first innovative improvement may be computer-implemented.

[0014] According to a first aspect of the first innovative improvement, there is provided a method for encoding an input data set V comprising a sequence of M coefficients of NS bits into a packed data set P, said method for encoding comprising the steps of: E1) grouping the M coefficients into NCG groups of Ng coefficients, Ng being greater than or equal to two; E2) providing a sequence L of bitplane counts, the sequence L comprising a bitplane count for each one of said groups of coefficients; E3) providing a set of Ngbuffers of at least K bits each, wherein each buffer uniquely corresponds to a position of a coefficient in a group of Ngcoefficients; E4) for each coefficient in a group of Ngcoefficients: i. extracting a number of bits, preferably a number of consecutive bits, of said coefficient equal to the bitplane count corresponding to said group;ii. accumulating said number of bits into the buffer corresponding to the position of said coefficient in said group; E5) repeating step E4) with a new group of Ngcoefficients until at least K bits have been accumulated in each buffer, thereby forming an array of bits in each buffer; E6) interleaving said arrays for producing an intermediate data set; E7) adding said intermediate data set to the packed data set P; E8) repeating steps E4) to E7) until all coefficients of the input data set V have been processed.

[0015] The method for encoding allows an input data set comprising a sequence of coefficients to be encoded into a packed data set in a more efficient manner than the one disclosed in the reference implementation of the JPEG XS standard.

[0016] Indeed, the method for encoding does not iterate over each bit of each coefficient sequentially. Instead, said method proposes to accumulate bits from coefficients into a set of buffers, thereby forming an array of bits in each buffer, and then to interleave said arrays for producing the packed data set. The interleaving step is typically performed after several accumulation steps. This allows bits from several coefficients to be processed in a single interleaving step. Preferably, bits from coefficients from at least two different groups of coefficients are processed simultaneously, or in parallel, in the interleaving step E6) of the method for encoding. In other words, bits from coefficients belonging to at least two different groups of coefficients are preferably interleaved simultaneously, or in parallel, in the interleaving step E6). This allows for a more efficient packing of the coefficients than the one disclosed in the reference implementation of the JPEG XS standard, i.e. with a reduced number of operations. In fact, in a typical implementation of the method for encoding, the time spent interleaving coefficients is 4 to 10 times less than the time spent accumulating coefficients.

[0017] In the method for encoding, parameters M, NS, NCG, Ng, and K are positive integers. Besides, in said method, a bitplane count value may take any value comprised between 0 and NS, including these values, the parameter NSbeing the number of bits coding the value of a coefficient. Advantageously, said method works in the same way for any such value of a bitplane count.

[0018] If M is not an integer multiple of Ng, then the last group may be partially filled, i.e. comprise less than Ngcoefficients. The method for encoding remains applicable in such a case. Besides, the parameter NCG may be generally computed as follows: NCG = ⌈M / Ng⌉, which remains valid even if M is not an integer multiple of Ng. The notation “⌈x⌉” denotes the ceilingfunction, also noted “ceil(x)”, which is a mathematical function that returns the smallest integer which is not smaller than x, where x may be a decimal value.

[0019] The fact that each buffer in the set of buffers provided in the step E3) of the method for encoding uniquely corresponds to a position of a coefficient in a group of coefficients is to be interpreted as follows. The number of buffers in said set is equal to the number of coefficients in a group of coefficients, each coefficient having a given position in said group. The unique correspondence between said buffers and said positions means that each buffer corresponds to a position and, reciprocally, that each position corresponds to a buffer.

[0020] After an execution of a step E4) of the method for encoding, all buffers provided in the step E3) of said method comprise the same number of bits. Indeed, said step E4) is executed for each coefficient in a group of coefficients, and the number of bits to be extracted is the same for each coefficient in a group, as determined by a bitplane count of the sequence of bitplane counts.

[0021] In the step E5) of the method for encoding, if each buffer already comprises at least K bits, then a new step E4) is not executed and the next step is the step E6). The number K of bits may be interpreted as a filling threshold, above which a buffer is considered full. The size of a buffer, i.e. the number of bits in a buffer, may be larger than said number K of bits. In addition, the size of an array of bits recited in the step E5), i.e. the number of bits in said array, may also be larger than said number K of bits, for instance in a case where the number of bits accumulated in a buffer in a step E4) exceeds said number K of bits.

[0022] The interleaving operation performed in step E6) of the method for encoding is applied on the arrays of bits produced through the accumulation operation performed in step E4) of said method. Therefore, said interleaving is necessarily performed after said accumulation. In other words, the accumulation operation of step E4) precedes the interleaving operation of step E6). Preferably, bits from coefficients from at least two different groups of coefficients are interleaved simultaneously, or in parallel, in the interleaving step E6). This improves the computational efficiency of the method for encoding. In particular, interleaving coefficients from different groups of coefficients simultaneously allows for a more efficient packing of the coefficients than the one disclosed in the reference implementation of the JPEG XS standard, i.e. with a reduced number of operations.

[0023] Preferably, the steps of the method for encoding are executed in the indicated order, i.e. the alphanumeric order.

[0024] Preferably, the grouping of the coefficients performed in the step E1) of the method for encoding groups consecutive coefficients in the sequence of coefficients of the input dataset, in which case said step E1) may be expressed as follows: “grouping the M coefficients into NCGgroups of Ngconsecutive coefficients in said sequence of coefficients, Ngbeing greater than or equal to two”.

[0025] Preferably, the order of the bitplane counts in the sequence of bitplane counts provided in the step E2) of the method for encoding corresponds to the order of the groups of coefficients provided in the step E1) of said method.

[0026] Preferably, buffers provided in the step E3) of the method for encoding are adjacent in memory, so as to form a single array or vector of bits, which may facilitate a parallel or vectorized implementation of some of the steps of said method.

[0027] Preferably, said buffers are implemented as registers of a processor. Herein, a processor generally designates a device able to execute computer instructions, such as for example a (micro)processor for a computer, which is also known as a central processing unit (CPU), or a graphics processing unit (GPU). A register of a processor, also referred to herein as a “processor register”, is a high-speed memory built into a processor for quick data access. Each one of said buffers may be formed by all or part of one or more processor registers. More precisely, a buffer may span part of a register. In other words, a buffer may correspond to a subset of a register, i.e. a buffer may be comprised within a (subset of) a register. In addition, a plurality of buffers may be comprised within a same register. This allows for more efficient computation by performing a same operation on a plurality of buffers comprised within the same register. Alternatively, a buffer may span a plurality of registers. In other words, a buffer may correspond to a plurality of registers, for example if the buffer is larger than an individual register.

[0028] Preferably, steps i. and ii. in the step E4) of the method for encoding may be performed in a single operation, in which case said step E4) may be expressed as follows: “for each coefficient in a group of Ng coefficients, accumulating a number of bits, preferably a number of consecutive bits, of said coefficient equal to the bitplane count corresponding to said group into the buffer corresponding to the position of said coefficient in said group”.

[0029] Preferably, the interleaving of the Ngarrays of bits performed in the step E6) of the method for encoding is computed as a Ng-dimensional Morton code, which is also known as a “bit-wise interleaving”, i.e. by taking one bit from each array successively so as to form a sequence of interleaved bits. For example, bits from the four arrays “a2a1a0”, “b2b1b0”, “c2c1c0”, and “d2d1d0” are bit-wise interleaved in the following way: a2b2c2d2a1b1c1d1a0b0c0d0.

[0030] Generally, the accumulation operation of step E4) and / or the interleaving operation of step E6) may be performed efficiently in parallel, i.e. on a plurality of bits simultaneously, by leveraging the parallel processing abilities of modern computer processors, and more particularly the vectorized and / or specialized instructions available in such processors. Vectorized instructions allow multiple data elements to be processed in a single operation according to the principle known as “Single Instruction, Multiple Data” (SIMD). In addition, there also exist specialized instructions for improving the speed of bit manipulation. An example of such specialized instructions is the "Parallel Bit Deposit” (PDEP) instruction. Such specialized instructions are available for example in extensions to the x86 instruction set architecture called “Bit manipulation instruction set” (BMI) extensions.

[0031] Herein, SIMD instructions denote a category of processor instructions configured to execute a single operation concurrently across multiple data elements. These instructions facilitate parallel data processing by operating on vectorized data representations. More precisely, SIMD instructions allow a same arithmetic or logical operation to be performed on multiple data elements in a single processor instruction. This enables a more efficient implementation of algorithms involving performing the same computation over several data elements.

[0032] SIMD instructions allow operations to be performed on packed data types comprised in registers of various widths such as 32 bit, 64 bits, 128 bits, 256 bits, 512 bits, 1024 bits, 2048 bits, or even beyond. Said registers are referred to herein as “SIMD registers”. Similarly, operations performed in a single processor instruction on data elements comprised in said registers are referred to herein as “SIMD operations”. More precisely, a SIMD operation is an operation applied in a single processor instruction on several data elements comprised in a register, possibly in a dedicated SIMD register. Said operation is therefore said to be applied simultaneously, or in parallel, on said data elements. A SIMD operation may be implemented using a SIMD instruction. A SIMD instruction is a type of processor instruction that enables the simultaneous execution of the same operation on multiple data elements. This parallel processing capability is achieved by applying a single instruction to at least a vector of data values, wherein said vector may be stored in a single register, thereby improving computational efficiency in data-parallel workloads. Operands of a SIMD instruction or operation may be located in several (SIMD) registers or in a single (SIMD) register.

[0033] SIMD instructions are supported by instruction set extensions such as the Intel SSE family, the Intel AVX family, the ARM NEON family and the ARM SVE family, which allow a single instruction to perform the same operation on multiple operands, wherein saidoperands may be packed into a single register. The various SIMD instruction set extensions enable efficient implementation of algorithms involving repetitive computations by allowing vectorized workloads, i.e. simultaneous, or parallel processing of multiple data elements in a single processor instruction.

[0034] The Intel Streaming SIMD Extensions (SSE) family refers to a series of instruction set extensions to the x86 architecture, introduced by Intel to enhance performance of applications involving data processing by enabling Single Instruction, Multiple Data (SIMD) operations. The SSE family includes several generations, each expanding the capabilities of the previous: - SSE (SSE1) – Introduced with the Pentium III, added 128-bit SIMD floating-point operations. - SSE2 – Added support for 128-bit SIMD integer operations and double-precision floating-point. - SSE3 and SSSE3 – Introduced additional instructions for horizontal operations and data rearrangement. - SSE4.1 and SSE4.2 – Added more complex operations, including string and text processing enhancements. The Intel SSE family allows instructions to be executed on registers of 128 bits (the so-called XMM registers). For example, these registers can be used to store: - four 32-bit single-precision floating-point numbers (or “floats”); - two 64-bit double-precision floating-point numbers (or “floats”); - sixteen 8-bit integers; - eight 16-bit integers; - four 32-bit integers; - two 64-bit integers. The XMM register set was introduced with SSE and was expanded in later instruction sets, such as Intel AVX and Intel AVX-512. Intel AVX introduced 256-bit YMM registers, and Intel AVX-512 introduced 512-bit ZMM registers.

[0035] The Intel Advanced Vector Extensions (AVX) is a 256-bit SIMD instruction set extension to the x86 architecture, introduced with the Sandy Bridge microarchitecture. It expands upon the earlier Intel SSE instruction sets by doubling the register width as well as the number of registers as compared to the XMM register. In addition, Intel AVX introduced new instructions for floating-point and integer operations as well as 3-operand instructions.Intel AVX uses so-called YMM registers, which are 256 bits wide, and that can be used, for example, to store: - eight 32-bit single-precision floats; - four 64-bit double-precision floats; - thirty-two 8-bit integers; - sixteen 16-bit integers; - eight 32-bit integers; - four 64-bit integers; - two 128-bit integers.

[0036] The Intel AVX2 is an expansion of the Intel AVX instruction set introduced in Intel's Haswell microarchitecture. Intel AVX2 makes the following additions among others: - expansion of most vector integer Intel SSE and Intel AVX instructions to 256 bits; - Gather support, enabling vector elements to be loaded from non-contiguous memory locations; - 32-bit and 64-bit data elements any-to-any permutes; - vector shifts.

[0037] Intel AVX-512 is a further extension of Intel AVX and Intel AVX2, introduced with Intel’s Knights Landing (Xeon Phi) and Skylake-SP processors. It features 512-bit ZMM registers, enabling even greater parallelism.

[0038] Various SIMD instruction set extensions are available on ARM platforms, such as for example ARM NEON, ARM SVE, and ARM SVE2.

[0039] ARM Advanced SIMD, also named NEON, was introduced in ARMv7-A and continued in ARMv8-A. ARM NEON operates on 128-bit SIMD registers, known as Q registers. These registers can also be accessed as two 64-bit D registers, allowing flexibility in data handling. For example, ARM NEON supports the following data types: 8-, 16-, 32-, and 64-bit integers; 32-bit (single-precision) floats, 64-bit (double-precision) floats (on some platforms), with up to 16 parallel operations on 8-bit data elements.

[0040] Following the development of the ARM NEON architecture extension, which has a fixed 128-bit vector length for the instruction set, the ARM Scalable Vector Extension (SVE) was introduced in ARMv8.2-A as a SIMD extension of the ARM AArch64 architecture. The vector length of ARM SVE can vary from a minimum of 128 bits up to a maximum of 2048 bits, but must be a power of two. Valid vector length implementations are therefore 128, 256, 512, 1024, and 2048 bits. ARM SVE allows flexible vector length implementations with a range of possible values in CPU implementations.

[0041] The ARM SVE was later expanded by the ARM SVE2 instruction set extension, which was introduced in the ARMv9-A platform. ARM SVE2 uses the same scalable model as SVE regarding the width of the registers. ARM SVE2 extends ARM SVE with enhanced support for digital signal processing (DSP), machine learning, and general-purpose vector processing. ARM SVE2 adds various operations such as for example fixed-point, saturating arithmetic, and bitwise operations.

[0042] There also exist other SIMD instruction set extensions for ARM platforms, such as ARM Vector Floating Point (VFP) with 64-bit or 128-bit registers depending on implementation, and ARM Helium with 128-bit registers.

[0043] Moreover, there exists a technique known as SIMD Within A Register (SWAR). SWAR refers to the practice of packing multiple smaller data elements into a single larger general-purpose register (e.g. packing four 8-bit integers into a 32-bit register) and performing parallel operations on these elements using standard scalar instructions (as opposed to dedicated SIMD instructions). In other words, SWAR is a technique for performing parallel operations on data contained in a single processor register, typically a general-purpose register (as opposed to a dedicated SIMD register). This enables SIMD-style behavior without requiring SIMD-specific hardware support. When such a register is treated as a vector of smaller elements, operations like bitwise AND, OR, XOR, and NOT naturally act in parallel on each element without interference. However, other operations, such as shifts or additions, may cause bits to spill across element boundaries unless additional masking or correction is applied. For example, a logical left shift by four bits on a 64-bit register affects all bits uniformly, but if the register is interpreted as eight 8-bit elements, this can result in undesired cross-byte effects not present in native SIMD operations that support byte granularity.

[0044] Furthermore, there also exist specialized instructions for improving the speed of bit manipulation. Such instructions are available for example in the so-called “Bit manipulation instruction sets” or “BMI sets”. BMI sets are extensions to the x86 instruction set architecture for microprocessors from Intel and AMD. The purpose of these instruction sets is to improve the speed of bit manipulation. All the instructions in these sets operate on general-purpose registers (as opposed to dedicated SIMD registers). There are two sets published by Intel: BMI (now referred to as BMI1) and BMI2. They were both introduced with the Haswell microarchitecture with BMI1 matching features offered by AMD's ABM instruction set and BMI2 extending them. Another two sets were published by AMD: ABM (Advanced Bit Manipulation, which is also a subset of SSE4a implemented by Intel as part of SSE4.2 and BMI1), and TBM (Trailing Bit Manipulation), an extension introduced with Piledriver-based processors as anextension to BMI1. Specialized instructions for improving the speed of bit manipulation as described hereinabove are also referred to herein as “specialized bit manipulation instructions”.

[0045] Specialized bit manipulation instructions also include, but are not limited to, the following instructions operating on general-purpose processor registers: - PDEP (Parallel bit deposit) and PEXT (Parallel bit extract): these are generalized bit- level compress and expand instructions. They take two inputs; one is a source, and the other is a selector. The selector is a bitmap selecting the bits that are to be packed or unpacked. PEXT copies selected bits from the source to contiguous low-order bits of the destination; higher-order destination bits are cleared. PDEP does the opposite for the selected bits: contiguous low-order bits are copied to selected bits of the destination; other destination bits are cleared. These instructions can be used to extract any bitfield of the input, and perform bit-level shuffling operations. - BFI (Bit Field Insert): Inserts a bit field from one register into another at a specified position. - SBFX / UBFX (Signed / Unsigned Bit Field Extract): Extracts a bit field and optionally sign or zero extends it. - BFC (Bit Field Clear): Clears a range of bits within a register. - RBIT (Reverse Bit): Reverses the order of bits in a register.

[0046] Herein, the term “accumulation of bits in a buffer”, relating to the accumulation operation performed in step E4) of the method for encoding, refers to the process by which digital data, represented in binary form, is received and stored, i.e. accumulated (or appended or packed), in a designated memory area (the buffer) for subsequent processing, transmission, or storage. Said accumulation operation does not necessarily involve iterating on individual bits. In other words, said accumulation operation does not necessarily involve performing instructions acting on a single bit only. Indeed, said accumulation operation may be performed according to, but is not limited to, the following exemplar cases: - Said accumulation operation may be performed using an instruction acting on (or processing) a plurality of bits of a coefficient and appending said plurality of bits simultaneously, or in parallel, to the buffer corresponding to said coefficient. - Said accumulation operation may also be performed using an instruction acting on (or processing) bits of a plurality of coefficients of a same group of coefficients and appending said bits simultaneously, or in parallel, to the respective bufferscorresponding to said plurality of coefficients. This may be implemented using for example a SIMD instruction applying a scalar shift. - Said accumulation operation may even be performed using an instruction acting on (or processing) bits of a plurality of coefficients of different groups of coefficients and appending said bits simultaneously, or in parallel, to the respective buffers corresponding to said plurality of coefficients. This may be implemented using for example a SIMD instruction applying variable shifts. An advantage of performing said accumulation operation according to the exemplar cases described hereinabove is to improve the computational efficiency (or speed or performance) of said accumulation operation, thereby improving the computational efficiency of the method for encoding.

[0047] In the accumulation operation, data may generally be accumulated in a buffer in units larger than bits, such as bytes (8 bits) or words (e.g., 16, 32, or 64 bits) or larger blocks (e.g., 128, 256, 512, 1024, or 2048 bits, or even beyond). The accumulation operation may be performed with or comprise SIMD instructions or specialized bit manipulation instructions or standard scalar instructions applied using the SWAR technique as described hereinabove. This allows the computational efficiency of the accumulation operation to be improved. The accumulation of bits in a buffer may serve to facilitate staged data handling. The buffer may be implemented in volatile memory, such as a processor register, cache memory, or RAM. In a case where the buffer is implemented in a processor register, said register may be a general- purpose register or a SIMD register. Furthermore, the buffer may be mapped on a whole register or on elements (or subsets) of one or multiple registers. The buffer may also be implemented in non-volatile memory, such as flash memory. The buffer may be managed by software routines (e.g., drivers, operating system components, or application-level code), hardware logic (e.g., finite state machines, memory controllers), or a combination thereof.

[0048] In the accumulation operation performed in step E4) of the method for encoding, data may be accumulated (or appended, or packed) in a buffer in a so-called “LSB-first” or “MSB-first” order, wherein “LSB” stands for “least significant bit” and “MSB” stands for “most- significant bit”. In LSB-first accumulation (or appending, or packing) of bits in a buffer, bits are accumulated in the buffer starting with the least significant encoded bit of a coefficient. An encoded bit of a coefficient is a bit comprised in the packed data set. In MSB-first accumulation (or appending, or packing) of bits in a buffer, bits are appended in the buffer starting with the most significant encoded bit of a coefficient. In both cases, new bits are preferablyaccumulated in the buffer next to bits already present in the buffer, so as not to leave empty spaces between consecutively accumulated bits.

[0049] Herein, the term “interleaving of arrays of bits”, relating to the interleaving operation performed in step E6) of the method for encoding, refers to the process of producing an interleaved output sequence from individual binary data units (bits) comprised in arrays (of bits) originally stored in two or more distinct memory buffers. In the resulting sequence, bits from the respective buffers are arranged in an alternating or otherwise predetermined order. The result of the interleaving process or operation may be a bit-wise interleaving of the bits comprised in the arrays, but not only. Indeed, the bits of the arrays may also be interleaved two-by-two, four-by-four, or with an even coarser granularity, such as eight-by-eight (in which case the interleaving may be said to be performed byte-by-byte), etc. The term “bit-wise interleaving” as used herein refers to the result of the interleaving operation, in the case of a bit-by-bit interleaving of a plurality of arrays of bits.

[0050] Importantly, the interleaving operation itself does not necessarily involve iterating on individual bits. In other words, said interleaving operation does not necessarily involve performing instructions acting on a single bit only, even when the result of the interleaving operation is a bit-by-bit (or bit-wise) interleaving of the arrays of bits. Indeed, said interleaving operation may be performed using instructions acting on a plurality of bits simultaneously, or in parallel, such as SIMD instructions or specialized bit manipulation instructions or standard scalar instructions applied using the SWAR technique. Preferably, bits from coefficients from at least two different groups of coefficients are processed simultaneously, or in parallel, in the interleaving operation performed in step E6) of the method for encoding.

[0051] Generally, the interleaving operation may be performed using data units of coarser granularity than bits, such as bytes (8 bits), words (e.g., 16, 32, 64 bits), or larger blocks (e.g., 128, 256, 512, 1024, or 2048 bits, or even beyond). The interleaving operation may be performed with or comprise SIMD instructions or specialized bit manipulation instructions or standard scalar instructions applied using the SWAR technique as described hereinabove. This allows the computational efficiency of the interleaving operation to be improved. These larger units may be processed in bulk, with subsequent operations (e.g., masking, shifting, or permutation) applied to extract and rearrange individual bits to achieve the desired interleaved output sequence.

[0052] Preferably, the accumulation of bits in a buffer performed in step E4) of the method for encoding comprises at least one operation performed on a plurality of said bits simultaneously, or in parallel. Said operation may be for example a SIMD operation, whichmay be implemented using a SIMD instruction. Said operation may also be for example a specialized operation for improving the speed of bit manipulation, which may be implemented using a specialized bit manipulation instruction. Said operation may also be implemented using a standard scalar instruction applied using the SWAR technique. This enables parallel processing of a plurality of data elements in a single processor instruction. Said operations and instructions allow for efficient manipulation of wide data registers, facilitating high-throughput accumulation operations across a plurality of bits or bytes simultaneously, or in parallel. This allows the computational efficiency of the accumulation operation to be improved, thereby improving the computational efficiency of the method for encoding.

[0053] Preferably, the interleaving of arrays of bits performed in step E6) of the method for encoding comprises at least one operation performed on a plurality of said bits simultaneously, or in parallel. Said operation may be for example a SIMD operation, which may be implemented using a SIMD instruction. Said operation may also be for example a specialized operation for improving the speed of bit manipulation, which may be implemented using a specialized bit manipulation instruction. Said operation may also be implemented using a standard scalar instruction applied using the SWAR technique. This enables parallel processing of a plurality of data elements in a single processor instruction. Said operations and instructions allow for efficient manipulation of wide data registers, facilitating high-throughput interleaving operations across a plurality of bits or bytes simultaneously, or in parallel. This allows the computational efficiency of the interleaving operation to be improved, thereby improving the computational efficiency of the method for encoding.

[0054] The accumulation of bits in the buffers performed in step E4) of the method for encoding precedes the interleaving of bits in step E6) of said method. Preferably, bits from coefficients from at least two different groups of coefficients are interleaved simultaneously, or in parallel, in the interleaving step E6). This improves the computational efficiency of the method for encoding. In addition, by implementing the interleaving of arrays of bits performed in step E6) using at least one SIMD instruction or specialized bit manipulation instruction or standard scalar instruction applied using the SWAR technique, the computational efficiency of the method for encoding may be even further improved.

[0055] Preferably, the packed data set comprises a sequence of bits. In such a case, the addition of the interleaved arrays of the intermediate data set to the packed data set in the step E7) of the method for encoding may be interpreted as an addition of interleaved arrays of bits to said sequence of bits, for example by appending or concatenating said arrays to said sequence.

[0056] Preferably, buffers are flushed in the step E8) of the method for encoding, i.e. accumulated bits are removed from the buffers, before repeating steps E4) to E7).

[0057] The inventors propose several possible embodiments comprising optional features, where some of them can be combined.

[0058] In an embodiment, bits from coefficients from at least two different groups of coefficients are processed simultaneously (or in other words in parallel, or in a single operation) in the interleaving step E6) of the method for encoding. An advantage of this embodiment is to improve the computational efficiency (or speed or performance) of said interleaving, thereby improving the computational efficiency of the method for encoding.

[0059] In an embodiment, the interleaving of arrays of bits performed in step E6) of the method for encoding comprises at least one operation performed on a plurality of said bits simultaneously, or in parallel. Said operation may be implemented using for example a SIMD instruction or a specialized bit manipulation instruction or a standard scalar instruction applied using the SWAR technique. This enables parallel processing of a plurality of data elements in a single processor instruction. An advantage of this embodiment is to improve the computational efficiency (or speed or performance) of said interleaving, thereby improving the computational efficiency of the method for encoding. In addition, this embodiment enables a more efficient manipulation of wide data registers, facilitating high-throughput interleaving operations across a plurality of bits or bytes simultaneously, or in parallel.

[0060] In an embodiment, the accumulation of bits performed in step E4) of the method for encoding comprises appending a plurality of bits of a coefficient simultaneously (or in other words in parallel, or in a single operation) to the buffer corresponding to said coefficient. Said accumulation may be implemented using for example a SIMD instruction or a specialized bit manipulation instruction or a standard scalar instruction applied using the SWAR technique. This enables parallel processing of a plurality of data elements in a single processor instruction. An advantage of this embodiment is to improve the computational efficiency (or speed or performance) of said accumulation, thereby improving the computational efficiency of the method for encoding. In addition, this embodiment enables a more efficient manipulation of wide data registers, facilitating high-throughput accumulation operations across a plurality of bits or bytes simultaneously, or in parallel.

[0061] In an embodiment, the accumulation of bits performed in step E4) of the method for encoding comprises appending bits of a plurality of coefficients of a same group of coefficients simultaneously (or in other words in parallel, or in a single operation) to the respective buffers corresponding to said plurality of coefficients. Said accumulation may beimplemented using for example a SIMD instruction (e.g. a SIMD instruction applying a scalar shift) or a specialized bit manipulation instruction or a standard scalar instruction applied using the SWAR technique. This enables parallel processing of a plurality of data elements in a single processor instruction. An advantage of this embodiment is to improve the computational efficiency (or speed or performance) of said accumulation, thereby improving the computational efficiency of the method for encoding. In addition, this embodiment enables a more efficient manipulation of wide data registers, facilitating high-throughput accumulation operations across a plurality of bits or bytes simultaneously, or in parallel.

[0062] In an embodiment, the accumulation of bits performed in step E4) of the method for encoding comprises appending bits of a plurality of coefficients of different groups of coefficients simultaneously (or in other words in parallel, or in a single operation) to the respective buffers corresponding to said plurality of coefficients. Said accumulation may be implemented using for example a SIMD instruction (e.g. a SIMD instruction applying variable shifts) or a specialized bit manipulation instruction or a standard scalar instruction applied using the SWAR technique. This enables parallel processing of a plurality of data elements in a single processor instruction. An advantage of this embodiment is to improve the computational efficiency (or speed or performance) of said accumulation, thereby improving the computational efficiency of the method for encoding. In addition, this embodiment enables a more efficient manipulation of wide data registers, facilitating high-throughput accumulation operations across a plurality of bits or bytes simultaneously, or in parallel.

[0063] In an embodiment, the number K of bits comprised in each buffer is greater than or equal to the number NS of bits of each coefficient. Indeed, it is advantageous for each buffer to be large enough to comprise at least one coefficient, in a case where all NS bits of a coefficient need to be packed.

[0064] Preferably, the number K of bits comprised in each buffer is equal to twice the number NS of bits of each coefficient, more preferably four times NS, even more preferably eight times NS, even more preferably sixteen times NS. Indeed, it is also advantageous for each buffer to be large enough to accumulate bits from a plurality of coefficients, in order to interleave bits from said coefficients in a single interleaving step, thereby increasing the efficiency of the method for encoding by reducing the number of operations needed to perform said method. For coefficients coded with NS= 16 bits, the number K of bits comprised in each buffer may therefore be equal to 16 bits, preferably 32 bits, more preferably 64 bits, even more preferably 128 bits, even more preferably 256 bits.

[0065] Generally, the number K of bits comprised in each buffer may be larger than sixteen times NS. Therefore, the number K of bits comprised in each buffer may be larger than 256 bits, for example 512 bits, 1024 bits, 2048 bits, or even beyond.

[0066] In an embodiment, the step E4) of the method for encoding is performed in parallel for each coefficient in the group of Ng coefficients. Indeed, bits from different coefficients in a group of coefficients being accumulated in different buffers, the accumulation of said bits may be performed in parallel for each coefficient in the group, thereby increasing the efficiency of the method for encoding by reducing the number of sequential operations needed to perform said method.

[0067] Preferably, the step E4) of the method for encoding is performed in parallel for a plurality of groups of Ng coefficients, preferably for a plurality of consecutive groups of Ng coefficients, thereby increasing the efficiency of the method for encoding by reducing the number of sequential operations needed to perform said method. In such a case, the step E5) of the method for encoding may be interpreted as repeating the step E4) with a new plurality of groups of coefficients, preferably a new plurality of consecutive groups of coefficients, and may be expressed as follows: “repeating step E4) with a new plurality of groups of Ng coefficients, preferably a new plurality of consecutive groups of Ng coefficients, until at least K bits have been accumulated in each buffer, thereby forming an array of bits in each buffer”. Herein, groups of coefficients are considered to be consecutive if they comprise coefficients that are consecutive in the sequence of coefficients of the input data set.

[0068] In an embodiment, the parameter Ng is smaller than or equal to eight. Preferably, the parameter Ng is equal to four.

[0069] In an embodiment, a decorrelative transform is applied on the input data set prior to the accumulation of step E4) of the method for encoding. Decorrelative transforms allow the entropy of a set of coefficients to be reduced by concentrating probabilities of occurrence on a subset of coefficient values. Said decorrelative transform may be for example a color transform, such as a reversible color transform (RCT), a temporal decorrelative transform based on interframe predictions, a discrete cosine transform (DCT), or a discrete wavelet transform (DWT).

[0070] Preferably, said decorrelative transform is a DWT 5 / 3 transform, as specified in the JPEG XS standard.

[0071] More preferably, said sequence of M coefficients corresponds to a sequence of pixels in one or more rows of an image comprising rows and columns of pixels, and said decorrelative transform is performed on said sequence of pixels in one or more rows.

[0072] In an embodiment, a quantization step is performed on the input data set prior to the accumulation of step E4) of the method for encoding. A quantization operation reduces the number of bits used for coding the value of a coefficient. In said quantization step, a quantization operation may be performed on all or some of the coefficients comprised in the input data set, so as to reduce the number of bits required to code the values of said coefficients. Said quantization operation may be for example a fixed width quantization, a deadzone quantization, or a uniform quantization, the latter two being specified in the JPEG XS standard.

[0073] In an embodiment, the packed data set P, considered as a data subpacket, is compliant with a JPEG XS standard.

[0074] According to a second aspect of the first innovative improvement, there is provided a method for decoding a packed data set P', in particular a packed data set P' obtainable by the method for encoding, into an output data set V', said method for decoding comprising the steps of: D1) providing a sequence L' of bitplane counts, the sequence L' comprising a bitplane count for each one of NCG groups of Ng coefficients, Ng being greater than or equal to two; D2) providing a set of Ng buffers of at least K' bits each, wherein each buffer uniquely corresponds to a position of a coefficient in a group of Ng coefficients; D3) extracting Ng arrays of K' bits each from the packed data set P' into an intermediate data set; D4) deinterleaving said Ng arrays of the intermediate data set into said Ng buffers; D5) repeating the following steps until each buffer contains less bits than the next bitplane count in the sequence L' of bitplane counts: i. extracting a number of bits, preferably a number of consecutive bits, from each one of said Ng buffers equal to the next bitplane count in the sequence L' of bitplane counts, thereby forming a group of Ng coefficients; ii. adding said group of Ngcoefficients to the output data set V'; iii. moving to the next bitplane count in the sequence L' of bitplane counts; D6) repeating steps D3) to D5) until NCGgroups of Ngcoefficients have been added to the output data set V'.

[0075] The method for decoding allows a packed data set, in particular a packed data set obtainable by the method for encoding, to be decoded into an output data set in a more efficient manner than the one disclosed in the reference implementation of the JPEG XS standard. Themethod for decoding may be applied on a packed data set produced or obtained by the method for encoding. The packed data set P’ on which the method for decoding is applied may be for instance the packed data set P produced or obtained by the method for encoding.

[0076] The method for decoding does not iterate over each bit of each coefficient sequentially. Instead, said method proposes to extract and deinterleave arrays of bits from the packed data set into a set of buffers, thereby forming an array of bits in each buffer, and then to extract bits of coefficients from said arrays for producing the output data set. The extraction of bits for several coefficients is typically performed after a single deinterleaving step. Preferably, bits from coefficients from at least two different groups of coefficients are processed simultaneously, or in parallel, in the deinterleaving step D4) of the method for decoding. In other words, bits from coefficients belonging to at least two different groups of coefficients are preferably deinterleaved simultaneously, or in parallel, in the deinterleaving step D4). This allows for a more efficient extraction (or unpacking) of the coefficients from the packed data set than the one disclosed in the reference implementation of the JPEG XS standard, i.e. with a reduced number of operations.

[0077] The method for encoding and the method for decoding are two aspects of the same innovative improvement, forming a single general inventive concept. Indeed, the deinterleaving operation in the step D4) of the method for decoding is the opposite operation (or mirror operation) of the interleaving operation in the step E6) of the method for encoding. In addition, the extraction of bits from the set of buffers in the step D5) of the method for decoding is the opposite operation (or mirror operation) of the accumulation of bits into the set of buffers in the step E4) of the method for encoding. Thus, both the method for encoding and the method for decoding allow coefficients to be packed into or extracted from a packed data set in a more efficient manner than the one disclosed in the reference implementation of the JPEG XS standard, i.e. with a reduced number of operations, based on a similar principle. All the possible embodiments and advantages of the method for encoding apply mutatis mutandis to the method for decoding.

[0078] The definition of the term “interleaving of arrays of bits” (provided hereinabove in relation with the interleaving operation performed in step E6) of the method for encoding) applies mutatis mutandis to the deinterleaving operation performed in step D4) of the method for decoding.

[0079] The definition of the term “accumulation of bits in a buffer” (provided hereinabove in relation with the accumulation operation performed in step E4) of the method for encoding)applies mutatis mutandis to the extraction operation performed in step E5) of the method for decoding.

[0080] In the method for decoding, parameters NCG, Ng, and K’ are positive integers. Besides, in said method, a bitplane count value may take any value comprised between zero and the number of bits coding the value of a coefficient, including these values. Advantageously, said method works in the same way for any such value of a bitplane count. Parameters in the method for decoding may have similar or identical values as the corresponding parameters in the method for encoding. In particular, parameters NCG, Ng, and K’ in the method for decoding may have similar or identical values as parameters NCG, Ng, and K in the method for encoding, respectively.

[0081] The fact that each buffer in the set of buffers provided in the step D2) of the method for decoding uniquely corresponds to a position of a coefficient in a group of coefficients is to be interpreted as follows. The number of buffers in said set is equal to the number of coefficients in a group of coefficients, each coefficient having a given position in said group. The unique correspondence between said buffers and said positions means that each buffer corresponds to a position and, reciprocally, that each position corresponds to a buffer.

[0082] The extraction of arrays of bits into an intermediate data set in step D3) and the deinterleaving of said arrays in step D4) of the method for decoding may be performed in a single operation, i.e. it is not mandatory to actually store in a memory the intermediate data set comprising said arrays.

[0083] The extraction of Ng arrays of K' bits each performed in step D3) may be viewed as the extraction of a single array of Ng * K' bits, preferably a single array of Ng * K' consecutive bits. In this case, the step D3) of the method for decoding may be expressed as “extracting an array of Ng * K' bits, preferably Ng * K' consecutive bits, from the packed data set P' into an intermediate data set”. Similarly, the step D4) of the method for decoding may be expressed in this case as “deinterleaving said array of the intermediate data set into said Ng buffers”. The variant described in the previous paragraph, wherein the step D3) and the step D4) of the method for decoding are performed in a single operation, also applies mutatis mutandis to this case.

[0084] The step D6) of the method for decoding means that steps D3) to D5) may be repeated until all bitplane counts of the sequence of bitplane counts have been processed.

[0085] The deinterleaving operation performed in step D4) of the method for decoding does not necessarily involve iterating on individual bits. In other words, said deinterleaving operation does not necessarily involve performing instructions acting on a single bit only, evenwhen the result of the deinterleaving operation is a bit-by-bit (or bit-wise) deinterleaving of the array(s) of bits. Indeed, said deinterleaving operation may be performed using instructions acting on a plurality of bits simultaneously, or in parallel, such as SIMD instructions or specialized bit manipulation instructions or standard scalar instructions applied using the SWAR technique.

[0086] The deinterleaving operation performed in step D4) of the method for decoding is applied before the extraction of bits performed in step D5) of said method. Therefore, the deinterleaving operation of step D4) precedes the extraction operation of step D5). Preferably, bits from coefficients from at least two different groups of coefficients are deinterleaved simultaneously, or in parallel, in the deinterleaving step D4). This improves the computational efficiency of the method for decoding. In particular, deinterleaving coefficients from different groups of coefficients simultaneously allows for a more efficient unpacking of the coefficients than the one disclosed in the reference implementation of the JPEG XS standard, i.e. with a reduced number of operations.

[0087] Preferably, the steps of the method for decoding are executed in the indicated order, i.e. the alphanumeric order.

[0088] Preferably, buffers provided in the step D2) of the method for decoding are adjacent in memory, so as to form a single array or vector of bits, which may facilitate a parallel or vectorized implementation of some of the steps of said method.

[0089] Preferably, said buffers are implemented as processor registers. Each one of said buffers may be formed by all or part of one or more processor registers.

[0090] Preferably, the packed data set comprises a sequence of bits. In such a case, the extraction of arrays of bits from the packed data set in the step D3) of the method for decoding may be interpreted as an extraction of arrays of bits from said sequence of bits, for example by copying said arrays from said sequence or by removing said arrays from said sequence.

[0091] Preferably, the output data set comprises a sequence of coefficients. In such a case, the addition of the group of coefficients to the output data set in the step D5) ii. of the method for decoding may be interpreted as an addition of the coefficients of said group to said sequence of coefficients, for example by appending or concatenating said coefficients to said sequence.

[0092] In an embodiment, bits from coefficients from at least two different groups of coefficients are processed simultaneously (or in other words in parallel, or in a single operation) in the deinterleaving step D4) of the method for decoding. An advantage of this embodimentis to improve the computational efficiency (or speed or performance) of said deinterleaving, thereby improving the computational efficiency of the method for decoding.

[0093] In an embodiment, the deinterleaving of arrays of bits performed in step D4) of the method for decoding comprises at least one operation performed on a plurality of said bits simultaneously, or in parallel. Said operation may be implemented using for example a SIMD instruction or a specialized bit manipulation instruction or a standard scalar instruction applied using the SWAR technique. This enables parallel processing of a plurality of data elements in a single processor instruction. An advantage of this embodiment is to improve the computational efficiency (or speed or performance) of said deinterleaving, thereby improving the computational efficiency of the method for decoding. In addition, this embodiment enables a more efficient manipulation of wide data registers, facilitating high-throughput deinterleaving operations across a plurality of bits or bytes simultaneously, or in parallel.

[0094] In an embodiment, the extraction of bits performed in step D5) of the method for decoding comprises extracting a plurality of bits of a coefficient simultaneously (or in other words in parallel, or in a single operation) from the buffer corresponding to said coefficient. Said extraction may be implemented using for example a SIMD instruction or a specialized bit manipulation instruction or a standard scalar instruction applied using the SWAR technique. This enables parallel processing of a plurality of data elements in a single processor instruction. An advantage of this embodiment is to improve the computational efficiency (or speed or performance) of said extraction, thereby improving the computational efficiency of the method for decoding. In addition, this embodiment enables a more efficient manipulation of wide data registers, facilitating high-throughput extraction operations across a plurality of bits or bytes simultaneously, or in parallel.

[0095] In an embodiment, the extraction of bits performed in step D5) of the method for decoding comprises extracting bits of a plurality of coefficients of a same group of coefficients simultaneously (or in other words in parallel, or in a single operation) from the respective buffers corresponding to said plurality of coefficients. Said extraction may be implemented using for example a SIMD instruction (e.g. a SIMD instruction applying a scalar shift) or a specialized bit manipulation instruction or a standard scalar instruction applied using the SWAR technique. This enables parallel processing of a plurality of data elements in a single processor instruction. An advantage of this embodiment is to improve the computational efficiency (or speed or performance) of said extraction, thereby improving the computational efficiency of the method for decoding. In addition, this embodiment enables a more efficientmanipulation of wide data registers, facilitating high-throughput extraction operations across a plurality of bits or bytes simultaneously, or in parallel.

[0096] In an embodiment, the extraction of bits performed in step D5) of the method for decoding comprises extracting bits of a plurality of coefficients of different groups of coefficients simultaneously (or in other words in parallel, or in a single operation) from the respective buffers corresponding to said plurality of coefficients. Said extraction may be implemented using for example a SIMD instruction (e.g. a SIMD instruction applying variable shifts) or a specialized bit manipulation instruction or a standard scalar instruction applied using the SWAR technique. This enables parallel processing of a plurality of data elements in a single processor instruction. An advantage of this embodiment is to improve the computational efficiency (or speed or performance) of said extraction, thereby improving the computational efficiency of the method for decoding. In addition, this embodiment enables a more efficient manipulation of wide data registers, facilitating high-throughput extraction operations across a plurality of bits or bytes simultaneously, or in parallel.

[0097] In an embodiment, the packed data set P’, considered as a data subpacket, is compliant with a JPEG XS standard.

[0098] Both the method for encoding and the method for decoding may be implemented for a big-endian system or a little-endian system. In addition, said methods may be implemented for coefficients in magnitude-only representation or in sign / magnitude representation. In magnitude-only representation, the value of a coefficient represents only a magnitude, i.e. an absolute value without a sign. In sign / magnitude representation, the value of a coefficient represents a signed value, which can therefore be either positive or negative.

[0099] When a quantization step is performed in the method for encoding, the value of the coefficients encoded in the packed data set P is the value of the quantized coefficients, i.e. the value of the coefficients after the quantization step. Similarly, when a dequantization step is performed in the method for decoding, the value of the coefficients extracted from the packed data set P’ is the value of the quantized coefficients, i.e. the value of the coefficients before the dequantization step.

[0100] According to a third aspect of the first innovative improvement, there is provided a method for encoding an input data set comprising a sequence of coefficients into a packed data set, and for decoding said packed data set into an output data set. In other words, the method for encoding according to the first aspect and the method for decoding according to the second aspect may be combined.

[0101] According to a fourth aspect of the first innovative improvement, there is provided a computer program comprising instructions which, when the program is executed by a computer, cause the computer to carry out the method for encoding and / or the method for decoding.

[0102] In an embodiment, there is provided a non-transitory recording medium having recorded therein a computer program comprising instructions which, when the program is executed by a computer, cause the computer to carry out the method for encoding and / or the method for decoding.

[0103] According to a fifth aspect of the first innovative improvement, there is provided an encoder comprising a processor and a memory, and configured to perform the method for encoding.

[0104] According to a sixth aspect of the first innovative improvement, there is provided a decoder comprising a processor and a memory, and configured to perform the method for decoding.

[0105] According to a seventh aspect of the first innovative improvement, there is provided a data processing apparatus comprising an encoder according to the fifth aspect and a decoder according to the sixth aspect.

[0106] An encoder according to the fifth aspect, a decoder according to the sixth aspect, and a data processing apparatus according to the seventh aspect may comprise the following means for carrying out the steps of the method for encoding and / or the method for decoding: a processor able to execute computer instructions, such as for example a CPU or a GPU, said instructions being preferably vectorized instructions according to the SIMD principle or specialized instructions for improving the speed of bit manipulation such as PDEP instructions; and at least one memory, such as for example a non-transitory computer-readable memory, a processor register, a random-access memory (RAM), a non-volatile memory, or other types of memories.

[0107] All the possible embodiments and advantages of the first aspect of the first innovative improvement apply mutatis mutandis to other aspects of the first innovative improvement. Second innovative improvement

[0108] In this section, the “method for decoding” relates to the method for decoding according to the second innovative improvement, unless otherwise specified. Technical field

[0109] The second innovative improvement relates to a method, apparatus, and computer program for parallel decoding of an encoded image obtainable by applying at least one decorrelative transform running over a plurality of image lines, whereby the parallel decoding is performed using a plurality of processing channels. Background

[0110] An image processing algorithm such as an encoding of an image, or a decoding of an encoded image may apply a decorrelative transform running over a plurality of image lines. A decorrelative transform allows the entropy of a set of coefficients or image samples to be reduced by concentrating probabilities of occurrence on a subset of coefficient values. A decorrelative transform may be for example a color transform, such as a reversible color transform (RCT), a temporal decorrelative transform based on interframe predictions, a discrete cosine transform (DCT), or a discrete wavelet transform (DWT).

[0111] There is a need for a more efficient, or faster, implementation of such an image processing algorithm, for example for processing large images with a smaller amount of resources or in a shorter amount of time or for processing a sequence of images with a higher frame rate. A known technique to implement such an image processing algorithm in a more efficient way is to rely on parallel computing, i.e. distribute computation tasks, or “jobs”, among a plurality of “processing channels”, or “workers”, such that said processing channels work in parallel to encode or decode an image. However, it may be challenging to design a parallel implementation of an image processing algorithm comprising a decorrelative transform running over an entire image, in particular because of dependencies between processing channels working in parallel.

[0112] Computing the same data several times is generally thought to decrease the overall performance of a system comprising a plurality of processing channels working together in parallel to perform some computational task such as an encoding or a decoding of an image. Therefore, a known solution for a more efficient parallel implementation of an image processing algorithm is to distribute computation tasks among a plurality of processing channels in such a way as to minimize the so-called “overhead”, i.e. data that is computed more than once.

[0113] However, distributing computation tasks among a plurality of processing channels generally requires to synchronize said channels and thus introduces dependencies between said channels, for instance so-called “synchronization points”, i.e. time points where several processing channels need to wait for each other until all of them have completed theirrespective computations. In turn, said synchronization points, or more generally said dependencies between processing channels, may decrease the overall performance of a system comprising said plurality of processing channels. Indeed, when a processing channel is waiting, it is idle and therefore does not process data, which may lead to a loss of performance.

[0114] Moreover, a plurality of processing channels may be implemented as a plurality of processing units, each one of said units having its own memory, called a “cache memory” or simply a “cache”. In such a case, said dependencies between processing channels may lead to what is known as a “data cache miss”, or simply a “cache miss”, which may also decrease the overall performance of a system comprising said plurality of processing channels.

[0115] Therefore, there is a need for a more efficient implementation of a decoding of an encoded image obtainable by applying at least one decorrelative transform running over a plurality of image lines. Disclosure of the second innovative improvement

[0116] In view of the abovementioned deficiencies of the prior art, it is an object of the second innovative improvement to provide a method, apparatus, and computer program for a more efficient parallel decoding of an encoded image obtainable by applying at least one decorrelative transform running over a plurality of image lines, whereby the parallel decoding is performed using a plurality of processing channels.

[0117] According to a first aspect of the second innovative improvement, there is provided a method for decoding an encoded image, wherein the encoded image is obtainable by the steps of: - applying a wavelet-type transformation to a rectangular array of spatial image samples representing the image, the wavelet-type transformation comprising applying a cascade of wavelet-type filter operations at least one of which is applied in a vertical direction, the wavelet- type transformation producing wavelet coefficients that are spatially related to the spatial image samples in the rectangular array; - organizing the wavelet coefficients to obtain respective groups of wavelet coefficients that are spatially related to respective slices of the rectangular array of spatial image samples; and - entropy encoding the respective groups of wavelet coefficients independently from each other; wherein the method for decoding comprises:- providing respective processing channels that reconstruct from the wavelet coefficients respective strips of spatial image samples, each of the respective processing channels reconstructing a strip of spatial image samples independently from the other processing channels, the respective strips of spatial image samples corresponding at least in size to the respective slices of the rectangular array of spatial image samples, each of the respective processing channels applying a cascade of inverse wavelet-type filter operations independently from the other processing channels for reconstructing a strip of spatial image samples; and - supplying respective extended groups of wavelet coefficients to the respective processing channels, whereby the extended groups of wavelet coefficients mutually overlap to an extent that each extended group of wavelet coefficients comprises all the wavelet coefficients required for the processing channel receiving the extended group of wavelet coefficients to independently reconstruct a strip of spatial image samples.

[0118] Preferably, the encoded image has been produced by said steps.

[0119] The encoded image comprises respective groups of wavelet coefficients that are entropy encoded independently from each other. Said respective groups of wavelet coefficients are spatially related to respective slices of a rectangular array of spatial image samples. More precisely, the wavelet coefficients are derived from spatial image samples. In other words, the wavelet coefficients are derived from image samples in spatial domain, namely through the application of a cascade of wavelet-type filter operations. The groups of wavelet coefficients are formed so as to group together wavelet coefficients derived from a same (rectangular) array of spatial image samples, or a same portion of said array of spatial image samples. Said portion is also referred to herein as a “slice”.

[0120] Generally, in the context of image processing and wavelet transforms, the term “spatially related to” refers to a correspondence or mapping between positions in two domains, typically between the spatial domain (e.g. image pixels or samples) and the transform domain (e.g. wavelet coefficients). More precisely, the term “spatially related to” means that each element (e.g. a wavelet coefficient) corresponds to or is associated with a specific location or region in the spatial domain (e.g. an image sample or group of samples), such that the coefficient reflects information derived from that location or region.

[0121] Herein, when a group of wavelet coefficients is said to be “spatially related to” a slice of a rectangular array of spatial image samples, this means that there exists a spatial correspondence between said wavelet coefficients and the spatial image samples comprised in said slice. In other words, this means that said wavelet coefficients are derived from thespatial image samples comprised in said slice, namely through the application of a cascade of wavelet-type filter operations. Due to the length of the wavelet-type filter being generally greater than one, a wavelet coefficient spatially related to an image sample is derived from that image sample and also from adjacent image samples. In other words, when a wavelet coefficient is said herein to be “spatially related to” an image sample, it means that said wavelet coefficient is derived from said image sample through the application of a wavelet-type filter, or a cascade of wavelet-type filters, centered on said image sample.

[0122] In the context of the second innovative improvement, the encoded image on which the method for decoding is applied may be characterized as follows. The encoded image comprises respective groups of wavelet coefficients that are entropy encoded independently from each other. Said respective groups of wavelet coefficients are spatially related to respective slices of a rectangular array of spatial image samples representing the image. The wavelet coefficients comprised in said groups are produced by applying a wavelet-type transformation to the rectangular array of spatial image samples representing the image, the wavelet-type transformation comprising applying a cascade of wavelet-type filter operations at least one of which is applied in a vertical direction. More precisely, said wavelet-type transformation produces wavelet coefficients that are spatially related to the spatial image samples in said rectangular array.

[0123] The method for decoding allows an image obtainable by applying at least one wavelet-type filter operation in a vertical direction to be decoded in a more efficient manner.

[0124] The method for decoding allows each processing channel to reconstruct a strip of spatial image samples independently of other processing channels, which may reduce or even remove the need for synchronization points between processing channels and, more generally, may reduce or even remove dependencies between said channels, thus also potentially reducing data cache misses, thereby increasing the performance of the decoding of the encoded image.

[0125] In order to allow each processing channel to reconstruct a strip of spatial image samples independently of other processing channels, each one of said channels is supplied with a respective extended group of wavelet coefficients, such an extended group of wavelet coefficients comprising all the wavelet coefficients needed for reconstructing a strip of spatial image samples. Therefore, the extended groups of wavelet coefficients may mutually overlap, which may introduce some overhead, i.e. some computations may be performed more than once in the respective processing channels, which may in turn decrease the performance of the decoding of the encoded image. However, the reduction of dependencies between therespective processing channels enabled by the method for decoding more than compensates for said decrease of performance due to said overhead, and the net effect of the method for decoding on the performance of the decoding of the encoded image is therefore positive, i.e. the method for decoding allows an image obtainable by applying at least one wavelet-type filter operation in a vertical direction to be decoded in a more efficient manner.

[0126] The method for decoding may allow existing coding techniques to be implemented in a more efficient manner. The JPEG XS standard is an example of an existing coding technique which may be implemented in a more efficient manner according to the method for decoding. The JPEG XS standard, formally known as ISO / IEC 21122, is an interoperable, visually lossless, low-latency, and lightweight image and video coding system. The JPEG XS standard is divided into several parts, each part specifying specific aspects of the standard. JPEG XS Part 1, formally known in its second edition as ISO / IEC 21122-1:2022, normatively defines how a compressed JPEG XS codestream can be transformed into a decoded image in a bit exact manner, a “codestream” being defined in the JPEG XS standard as a compressed image data representation that includes all necessary data to allow a (full or approximate) reconstruction of the sample values of a digital image. Moreover, JPEG XS Part 1 provides some key algorithms enabling an encoder to generate a JPEG XS codestream. Herein the expression “JPEG XS standard” generally designates the JPEG XS specification according to documents published under reference ISO / IEC 21122, including any part of said specification and any edition of said parts.

[0127] An “image” as used herein generally designates an array of image samples comprising “rows” or “lines” of image samples, and “columns” of image samples. The “horizontal direction” runs along the lines of an image, and the “vertical direction” runs along the columns of an image, i.e. across the lines of the image. An image may be encoded such as to form an “encoded image”. Encoding an image refers to the process of converting an array of image samples into a different format or representation, for instance for an easier storage, transmission, or processing. An encoded image may be decoded such as to form a “decoded image”. Decoding an encoded image refers to the process of reconstructing an array of image samples corresponding to the array of image samples of the image before encoding. The JPEG XS standard specifies coding tools for performing image encoding and decoding. An encoded image may be a codestream as defined in the JPEG XS standard.

[0128] A two-dimensional image may be represented by a two-dimensional or “rectangular” array of spatial image samples. A “slice” as used herein designates a compact subset of such a rectangular array of spatial image samples, preferably a subset of said arraycomprising a plurality of adjacent image lines. Different slices may have different sizes, i.e. different slices may contain different numbers of image lines, for instance.

[0129] A “strip” of spatial image samples as used herein comprises decoded or reconstructed spatial image samples corresponding to a slice of a rectangular array of spatial image samples. A strip may be spatially offset from the slice to which it corresponds, i.e. a strip may be shifted upwards or downwards by a number of image lines relative to the slice to which it corresponds. Different strips may have different sizes, i.e. different strips may contain different numbers of spatial image samples. In addition, “a strip corresponding at least in size to a slice” means that a strip comprises the same number of spatial image samples as the slice to which it corresponds.

[0130] A “wavelet-type filter operation” as used herein is a filtering operation using one or several wavelet filters. A wavelet filter is used in a wavelet transform and may be a low-pass filter or high-pass filter, for instance. Wavelet filters and wavelet transforms are known to a person skilled in the art. An example of a wavelet transform is a Discrete Wavelet Transform (DWT), which is a mathematical transform that decomposes a signal into different frequency components, each with a resolution matched to its scale. A wavelet filter may be applied in a “forward” way, in which case it may be applied on image samples to produce “wavelet coefficients”. Such a forward wavelet-type filter operation may also be applied on wavelet coefficients from a previous filter operation in case there are more than one wavelet filter applied. Herein, a “cascade of wavelet-type filter operations” refers to one or several wavelet- type filter operations applied one after the other. Besides, a wavelet filter may also be applied in an “inverse” way, so as to reverse a wavelet-type filter operation applied in a forward way, in which case it may be applied on wavelet coefficients to reconstruct image samples. Such an inverse wavelet-type filter operation may also be applied on wavelet coefficients to reconstruct wavelet coefficients for a subsequent filter operation in case there are more than one inverse wavelet filter applied. Herein, a “cascade of inverse wavelet-type filter operations” refers to one or several inverse wavelet-type filter operations applied one after the other. Finally, a forward wavelet-type filter operation or an inverse wavelet-type filter operation may be applied in a horizontal direction, i.e. along the lines of an image, or in a vertical direction, i.e. along the columns of an image and thus across the lines of the image. Wavelet-type filter operations applied in a horizontal direction and in a vertical direction may be combined in a cascade of wavelet-type filter operations.

[0131] In the steps allowing to obtain the encoded image, the wavelet coefficients produced by the wavelet-type transformation are organized in such a way as to obtainrespective groups of wavelet coefficients that are spatially related to respective slices of the rectangular array of spatial image samples. This means that each one of said groups of wavelet coefficients corresponds to a slice, and vice versa.

[0132] In the steps allowing to obtain the encoded image, the respective groups of wavelet coefficients are entropy encoded independently from each other. This means that there is no dependency between adjacent slices for entropy encoding the respective groups of wavelet coefficients. An example of such an entropy encoding is provided in JPEG XS Part 1 (ISO / IEC 21122-1:2022) as the vertical prediction mode for bitplane count coding, normatively defined in subclause C.6.5 of JPEG XS Part 1.

[0133] Advantageously, the second innovative improvement may be computer- implemented.

[0134] Herein, a “processor” generally designates a device able to execute computer instructions, such as for example a (micro)processor for a computer, which is also known as a central processing unit (CPU), or a graphics processing unit (GPU). A register of a processor, also referred to herein as a “processor register”, is a high-speed memory built into a processor for quick data access. Modern processors have the ability to execute instructions in parallel, i.e. executing several instructions during the same period of time, as opposed to a sequential execution of instructions, where only one instruction can be executed by a processor at any instant. Herein, a “processing unit” generally designates a part of a processor able to execute instructions in parallel to other processing units of the processor. In the case of a CPU or a GPU, such a processing unit may execute a so-called “thread of execution”, or simply a “thread”, as known to a person skilled in the art. Finally, a “processing channel” as used herein generally designates a means for executing instructions in parallel to other processing channels. A processing unit as defined hereinabove may therefore be considered as a processing channel in the context of a processor.

[0135] The inventors propose several possible embodiments comprising optional features, where some of them can be combined.

[0136] In an embodiment, at least some of the respective strips of spatial image samples are spatially offset from the respective slices of the rectangular array of spatial image samples. In this embodiment, a strip of spatial image samples may be spatially offset relative to the slice to which said strip corresponds such that the extended group of wavelet coefficients enabling a processing channel to reconstruct said strip does not comprise wavelet coefficients from a previous slice, i.e. a slice above the slice to which the strip corresponds. Indeed, it may be computationally expensive to compute wavelet coefficients from said previous slice, becauseof the entropy encoding applied to said coefficients in the steps allowing to obtain the encoded image, for instance in the case of an entropy encoding such as the vertical prediction mode for bitplane count coding as specified in the JPEG XS standard. Indeed, in this case, the entropy encoding of wavelet coefficients of a slice depends on previous wavelet coefficients in the slice, therefore requiring to decode an entire slice to compute the value of wavelet coefficients at the bottom of the slice.

[0137] In an embodiment, at least some of the extended groups of wavelet coefficients each comprise wavelet coefficients from only two adjacent groups of wavelet coefficients spatially related to two adjacent slices of the rectangular array of spatial image samples, whereby said extended groups of wavelet coefficients each comprise one of the two groups of wavelet coefficients in its entirety and only a portion of the other one of the two groups of wavelet coefficients, the portion being adjacent to the one of the two groups of wavelet coefficients that is entirely comprised in the extended group of wavelet coefficients. An advantage of this embodiment is that wavelet coefficients related to only two slices need to be computed, which may be less computationally expensive than computing wavelet coefficients from more than two slices, especially in a case where the entropy encoding of wavelet coefficients of a slice depends on previous wavelet coefficients in the slice, as described in the previous paragraph in relation with the previous embodiment. This embodiment may be combined with the previous embodiment wherein at least some of the respective strips of spatial image samples are spatially offset from the respective slices of the rectangular array of spatial image samples, in which case the advantages of both embodiments apply to the combined embodiment.

[0138] In an embodiment, the cascade of inverse wavelet-type filter operations comprises at least one inverse wavelet-type filter operation of the LeGall 5 / 3 type in the vertical direction. A wavelet-type filter operation of the LeGall 5 / 3 type is a known type of Discrete Wavelet Transform (DWT) comprising a low-pass filter with a support of 5 coefficients and a high-pass filter with a support of 3 coefficients. A wavelet-type filter operation of the LeGall 5 / 3 type is also herein referred to as a “DWT 5 / 3 transform”. The DWT 5 / 3 transform is used as a decorrelative transform in the JPEG XS standard, see e.g. subclause E.7 of JPEG XS Part 1 (ISO / IEC 21122-1:2022). Compared to other wavelet transforms, such as for example the DWT 9 / 7 transform used in JPEG 2000 (formally known as ISO / IEC 15444), the DWT 5 / 3 transform offers the following advantages. First, it is reversible because it uses only integer coefficients, so its output does not require rounding (quantization) and so it does not introduce any quantization noise. In addition, the low-pass and high-pass filters of the DWT 5 / 3 transformhave a reduced support of only 5 and 3 coefficients, respectively. Finally, the DWT 5 / 3 transform may be implemented “in-place” through the so-called “lifting scheme” technique, thereby allowing it to be implemented with a reduced computational complexity and a reduced memory footprint.

[0139] In an embodiment, the decoding of the encoded image conforms with a JPEG XS standard.

[0140] In an embodiment, the method for decoding is further characterized in that: - at least some of the respective strips of spatial image samples are spatially offset by one precinct from the respective slices of the rectangular array of spatial image samples; and - at least some of the extended groups of wavelet coefficients each comprise: - an entire group of wavelet coefficients spatially related to a slice of the rectangular array of spatial image samples; and - at least two precincts from an adjacent group of wavelet coefficients spatially related to an adjacent slice of the rectangular array of spatial image samples, the at least two precincts being adjacent to the entire group of wavelet coefficients comprised in the extended group of wavelet coefficients.

[0141] Herein, the term “precinct” is to be interpreted according to the JPEG XS standard, i.e. as a collection of wavelet coefficients contributing to a given spatial region of an image, wherein said wavelet coefficients may be optionally quantized. In addition, in an embodiment where the decoding of the encoded image conforms with the JPEG XS standard, a slice may be interpreted according to the JPEG XS standard, i.e. as an integral number of precincts whose wavelet coefficients can be entropy-decoded independently. However, a slice as defined herein may generally comprise a plurality of slices according to the JPEG XS standard.

[0142] In an embodiment, the method for decoding is further characterized in that: - the cascade of inverse wavelet-type filter operations comprises one inverse wavelet- type filter operation of the LeGall 5 / 3 type in the vertical direction; and - at least some of the extended groups of wavelet coefficients each comprise: - an entire group of wavelet coefficients spatially related to a slice of the rectangular array of spatial image samples; and - two precincts from an adjacent group of wavelet coefficients spatially related to an adjacent slice of the rectangular array of spatial image samples, the two precincts being adjacent to the entire group of wavelet coefficients comprised in the extended group of wavelet coefficients.

[0143] In an embodiment, the method for decoding is further characterized in that:- the cascade of inverse wavelet-type filter operations comprises two inverse wavelet-type filter operations of the LeGall 5 / 3 type in the vertical direction; and - at least some of the extended groups of wavelet coefficients each comprise: - an entire group of wavelet coefficients spatially related to a slice of the rectangular array of spatial image samples; and - two precincts from an adjacent group of wavelet coefficients spatially related to an adjacent slice of the rectangular array of spatial image samples, the two precincts being adjacent to the entire group of wavelet coefficients comprised in the extended group of wavelet coefficients.

[0144] According to a second aspect of the second innovative improvement, there is provided a computer program comprising instructions which, when the program is executed by a computer, cause the computer to carry out the method for decoding.

[0145] According to a third aspect of the second innovative improvement, there is provided a decoder comprising a processor and a memory, and configured to perform the method for decoding.

[0146] A decoder according to the third aspect may be a data processing device comprising the following means for carrying out the method for decoding: a processor able to execute computer instructions, such as for example a CPU, or a GPU, or another type of processor; and at least one memory, such as for example a non-transitory computer-readable memory, a processor register, a random-access memory (RAM), a non-volatile memory, or another type of memory.

[0147] All the possible embodiments and advantages of the first aspect of the second innovative improvement apply mutatis mutandis to other aspects of the second innovative improvement. Third innovative improvement

[0148] In this section, the “method for encoding” relates to the method for encoding according to the third innovative improvement, unless otherwise specified. Similarly, in this section, the “method for decoding” relates to the method for decoding according to the third innovative improvement, unless otherwise specified. Technical field

[0149] The third innovative improvement pertains to the field of image processing using decorrelative transforms, and in particular wavelet-type filter operations.Background

[0150] An image processing algorithm such as an encoding of an image, or a decoding of an encoded image may apply a decorrelative transform running over a plurality of image lines. A decorrelative transform allows the entropy of a set of coefficients or image samples (terms known by one skilled in the art) to be reduced by concentrating probabilities of occurrence on a subset of coefficient values. A decorrelative transform may be for example a color transform, such as a reversible color transform (RCT), a temporal decorrelative transform based on interframe predictions, a discrete cosine transform (DCT), or a discrete wavelet transform (DWT).

[0151] An encoder or a decoder for processing image samples or coefficients using a decorrelative transform, and in particular using a wavelet-type filter operation, may require a memory for performing said processing. The memory may need to store a large amount of data, especially when the wavelet-type filter operation is applied in a vertical direction on respective lines of image samples. However, it may be difficult to store a large amount of data on a memory comprised in a device for encoding or decoding image data. Indeed, the size of said memory may be limited and / or said memory may be fragmented, such that a large contiguous portion of free memory is not available. Herein, “free memory” designates memory that does not contain data or that contains data that is no longer in use. Free memory may also be referred to as “available memory”.

[0152] Therefore, there is a need for reducing the amount of memory required for a computer-implemented encoding or decoding of image samples, wherein the encoding or decoding comprises a wavelet-type filter operation applied in a vertical direction on respective lines of image samples. Disclosure of the third innovative improvement

[0153] It is an object of the third innovative improvement to address this need. To this end, there is provided a method, apparatus, and computer program for encoding an image comprising image samples using a wavelet-type filter operation applied in a vertical direction on respective lines of image samples, wherein said encoding may be performed with a reduced amount of memory. In addition, there is provided a method, apparatus, and computer program for decoding an encoded image obtainable by the method for encoding, wherein said decoding may be performed with a reduced amount of memory.

[0154] According to a first aspect of the third innovative improvement, there is provided a computer-implemented method for encoding an image comprising image samples, the method for encoding comprising the steps of: - providing an encoding module comprising an input line buffer, a number of intermediate line buffers and an output line buffer; - grouping the image samples into respective lines of image samples, the respective lines forming a sequence of lines; - providing the respective lines in the input line buffer; - processing with the encoding module the respective lines for producing intermediate results and final results according to a lifting scheme of a wavelet-type filter operation applied in a vertical direction; - storing the intermediate results in the intermediate line buffers; - providing the final results in the output line buffer as respective sets of coefficients spatially related to the respective lines, the respective sets forming a sequence of sets; wherein the number of intermediate line buffers is equal to the minimum number of intermediate line buffers required for producing the respective sets of coefficients according to the lifting scheme.

[0155] According to the method for encoding, one set of coefficients corresponds to one line of image samples.

[0156] Herein, when a set of coefficients is said to be “spatially related to” a line of image samples, it is to be understood that there exists a spatial correspondence or mapping between positions of the image samples (in spatial domain) and the coefficients (in frequency domain resulting from wavelet transform). More precisely, the term “spatially related to” means that each element (e.g. a wavelet coefficient) corresponds to or is associated with a specific location or region in the spatial domain (e.g. an image sample or group of samples), such that the coefficient reflects information derived from that location or region.

[0157] The “latency of a lifting scheme” as used herein refers to the difference expressed as a number of image samples or coefficients (when the lifting scheme is applied in a horizontal direction) or as a number of lines of image samples or sets of coefficients (when the lifting scheme is applied in a vertical direction) between the input and the output of the lifting scheme, wherein a set of coefficients is spatially related to (or corresponds to) a line of image samples.

[0158] Preferably, the number of intermediate line buffers is equal to the number of lines of image samples (or the number of sets of coefficients) needed to produce a first output according to the lifting scheme (applied in the vertical direction) minus one. In other words, thenumber of intermediate line buffers is preferably equal to the latency of the lifting scheme (applied in the vertical direction) expressed as a number of lines of image samples (or the number of sets of coefficients) between the input of the lifting scheme and the output of the lifting scheme. Indeed, according to the third innovative improvement, the intermediate line buffers store a number of lines of image samples (or a number of sets of coefficients) corresponding to the latency of the lifting scheme before the output of the lifting scheme may be produced. For example, the latency of a lifting scheme of a wavelet-type filter operation of the LeGall 5 / 3 type applied in a vertical direction is equal to two lines of image samples, or two sets of coefficients, wherein a set of coefficients is spatially related to (or corresponds to) a line of image samples.

[0159] In an embodiment of the method for encoding or the method for decoding, the wavelet-type filter operation is a filter operation of the LeGall 5 / 3 type and the number of intermediate line buffers is smaller than five, preferably smaller than four, preferably smaller than three, preferably equal to two line buffers. This allows the image to be encoded or decoded with a reduced amount of memory and / or with a reduced number of memory accesses. Preferably, at least some of the line buffers may be comprised in a cache memory, thereby increasing the efficiency of the encoding or decoding of the image.

[0160] Herein, the “length” of a filter, in particular a wavelet-type filter, refers to the number of coefficients or “taps” in the filter kernel. In the context of wavelet transforms, this typically applies to the low-pass (or low-frequency) and high-pass (or high-frequency) filters that define the wavelet basis.

[0161] Preferably, the total number of line buffers, i.e. the input line buffer, the intermediate line buffers, and the output line buffer, is smaller than the length of the wavelet- type filter operation applied in the vertical direction.

[0162] Several wavelet-type filters known to the skilled person are described below, namely a wavelet-type filter of the Haar type, a wavelet-type filter of the LeGall 5 / 3 type, and a wavelet-type filter of the Cohen-Daubechies-Feauveau 9 / 7 type. The third innovative improvement is applicable to, but is not limited to, each of the wavelet-type filters described below.

[0163] Haar (DWT 2 / 2) For example, a wavelet-type filter of the Haar type has a filter length equal to 2. A wavelet-type filter of the Haar type may also be referred to herein as a “Forward Discrete Wavelet Transform of the Haar type” or simply a “FDWT Haar transform”. The FDWT Haar transform decomposes a signal into its average (low-pass filter, or low-frequency (LF) filter)and difference (high-pass filter, or high-frequency (HF) filter). The LF and HF filters of the FDWT Haar transform are computed according to the following equations:The FDWT Haar low-pass and high-pass filters each have two taps, so the filter length is 2. This short length makes the Haar transform computationally efficient, though it provides limited frequency resolution compared to longer wavelet filters. An inverse wavelet-type filter of the Haar type may also be referred to herein as an “Inverse Discrete Wavelet Transform of the Haar type” or simply a “IDWT Haar transform”. The IDWT Haar transform reverses the HF and LF equations of the FDWT Haar transform according to the following equations: s0i = (2s1i + d1i) / 2 (EVEN) d0i = (2s1i – d1i) / 2 (ODD) Therefore, the inverse wavelet-type filter of the Haar type also has a filter length equal to 2.

[0164] LeGall (DWT 5 / 3) For example, a wavelet-type filter of the LeGall 5 / 3 type has a filter length equal to 5. A wavelet-type filter of the LeGall 5 / 3 type may also be referred to herein as a “Forward Discrete Wavelet Transform of the LeGall 5 / 3 type” or simply a “FDWT 5 / 3 transform”. The LF and HF filters of the FDWT 5 / 3 transform are computed according to the following equations:The FDWT 5 / 3 transform has a low-pass filter length equal to 5 and a high-pass filter length equal to 3. Therefore, the FDWT 5 / 3 has an overall filter length equal to 5. An inverse wavelet-type filter of the LeGall 5 / 3 type may also be referred to herein as an “Inverse Discrete Wavelet Transform of the LeGall 5 / 3 type” or simply a “IDWT 5 / 3 transform”. The IDWT 5 / 3 transform reverses the HF and LF equations of the FDWT 5 / 3 transform according to the following equations:Therefore, the inverse wavelet-type filter of the LeGall 5 / 3 type also has a filter length equal to 5.

[0165] Cohen-Daubechies-Feauveau (DWT 9 / 7) For example, a wavelet-type filter of the Cohen-Daubechies-Feauveau 9 / 7 type has a filter length equal to 9.A wavelet-type filter of the Cohen-Daubechies-Feauveau 9 / 7 type may also be referred to herein as a “CDF 9 / 7 transform”. To perform the CDF 9 / 7 transform, a total of four lifting steps are required: two predict and two update steps. The lifting factorization leads to the following sequence of filtering steps: dl = dl + a(sl + sl+1) sl= sl+ b(dl+ dl-1) dl= dl+ c(sl+ sl+1) sl = sl + d(dl + dl-1) dl = k1dl sl = k2sl The JPEG 2000 compression standard uses the FDWT 5 / 3 transform for lossless compression and the CDF 9 / 7 transform for lossy compression.

[0166] The method for encoding allows image samples to be encoded with a reduced amount of memory in an encoding process comprising a wavelet-type filter operation applied in a vertical direction on respective lines of image samples.

[0167] Indeed, a memory comprising the line buffers of the encoding module may be reduced because the number of intermediate line buffers is equal to the minimum number of intermediate line buffers required for producing the respective sets of coefficients according to the lifting scheme. For example, said memory does not have to store all the lines of an image to be processed. Instead, said memory may only store a reduced number of image lines corresponding to the minimum number of image lines required for producing the respective sets of coefficients according to the lifting scheme.

[0168] An image before encoding may also be referred to herein as an “original image”. An image after encoding may also be referred to herein as an “encoded image”. An image reconstructed after decoding of an encoded image may also be referred to herein as a “decoded image”.

[0169] Herein, a buffer is comprised in a memory. A buffer is therefore a subset of a memory. Herein, a memory may also designate a physical device able to store information, in particular binary information. Herein, the size of a buffer, or the size of a memory, is the total number of elements that can be stored in the buffer or the memory, respectively.

[0170] Advantageously, the performance of an encoder may be improved thanks to the method for encoding. Indeed, with a reduced amount of memory, there is a reduced risk of so- called “cache misses”. As is commonly known, a cache miss occurs when a data requested by a system is not found in a cache memory. Instead, the system needs to retrieve the datafrom a slower memory, such as a main memory or a hard disk drive. A cache miss may reduce the performance of the system because accessing data from the slower memory takes more time compared to retrieving the data from the cache memory. In modern computer systems, there are several cache memories organized in several “levels”, a lower-level cache memory being faster, but smaller, than a higher-level cache memory. When a data is not found in a lower-level cache memory, a cache miss occurs and the data needs to be retrieved from a higher-level, and therefore slower, cache memory. According to the third innovative improvement, the amount of memory required to store the buffers of the encoding module may be reduced. This allows said buffers to be stored in a lower-level, and therefore faster, cache memory, thereby reducing the cache misses and thus increasing the performance of an encoder comprising the encoding module.

[0171] Furthermore, the method for encoding may allow existing coding techniques to be implemented in a more efficient manner. The JPEG XS standard is an example of an existing coding technique which may be implemented in a more efficient manner according to the method for encoding. The JPEG XS standard, formally known as ISO / IEC 21122, is an interoperable, visually lossless, low-latency, and lightweight image and video coding system. The JPEG XS standard is divided into several parts, each part specifying specific aspects of the standard. JPEG XS Part 1, formally known in its second edition as ISO / IEC 21122-1:2022, normatively defines how a compressed JPEG XS codestream can be transformed into a decoded image in a bit exact manner, a “codestream” being defined in the JPEG XS standard as a compressed image data representation that includes all necessary data to allow a (full or approximate) reconstruction of the sample values of a digital image. Moreover, JPEG XS Part 1 provides some key algorithms enabling an encoder to generate a JPEG XS codestream. Herein the expression “JPEG XS standard” generally designates the JPEG XS specification according to documents published under reference ISO / IEC 21122, including any part of said specification and any edition of said parts.

[0172] Preferably, a line buffer of the encoding module is able to store at least one line of image samples, more preferably exactly one line of image samples.

[0173] Preferably, the encoding module according to the third innovative improvement is configured for processing the image line-by-line, i.e. processing one line at a time, in particular in a case where the input line buffer and / or the output line buffer has a size of one line of image samples.

[0174] The inventors propose several possible embodiments comprising optional features, where some of them can be combined.

[0175] In an embodiment, at least some of the respective lines provided in the input line buffer result from one or more prior operations, said one or more prior operations being performed before each of said respective lines is provided in the input line buffer. In other words, said one or more prior operations are performed before each of the at least some of the respective lines resulting from the one or more prior operations is provided in the input line buffer. Said prior operations may be performed in a pre-processing module able to provide data to the encoding module. An advantage of this embodiment is that data provided to the encoding module are likely to be located in a lower-level cache memory, thereby reducing the risk of cache miss and therefore increasing the performance of an encoder comprising the pre- processing module and the encoding module.

[0176] Preferably, all of the respective lines provided in the input line buffer result from one or more prior operations, said one or more prior operations being performed before each line of image samples in the sequence of lines is provided in the input line buffer.

[0177] Examples of said prior operations include, but are not limited to: decorrelative transforms, such as a reversible color transform (RCT), or a wavelet-type filter operation applied in a horizontal or vertical direction; conversion from user format to input line buffer format, such as a conversion from a user precision (e.g.8 bits, 16 bits) to an input line buffer precision (e.g.32 bits), an unpacking of bits from a user format to an input line buffer format, etc.

[0178] In an embodiment, at least some of the respective sets of coefficients are further processed in one or more subsequent operations, said one or more subsequent operations being performed after each of said respective sets of coefficients is provided in the output line buffer. In other words, said one or more subsequent operations are performed after each of the at least some of the respective sets further processed in the one or more subsequent operations is provided in the output line buffer. Said subsequent operations may be performed in a post-processing module able to receive data from the encoding module. An advantage of this embodiment is that said subsequent operations are performed on data that are likely to be located in a lower-level cache memory, thereby reducing the risk of cache miss and therefore increasing the performance of an encoder comprising the encoding module and the post- processing module.

[0179] Preferably, all of the respective sets of coefficients are further processed in one or more subsequent operations, said one or more subsequent operations being performed after each set of coefficients in the sequence of sets is provided in the output line buffer.

[0180] Examples of said subsequent operations include, but are not limited to: decorrelative transforms, such as a wavelet-type filter operation applied in a horizontal or vertical direction; operations for preparing an entropy encoding of a set of coefficients, such as a computation of bitplane counts of the set of coefficients as specified in a JPEG XS standard; operations for preparing a packing of a set of coefficients in packets.

[0181] Preferably, said prior and / or subsequent operations are interlaced with the processing of the data by the encoding module, i.e. the processing of the respective lines to produce the respective sets, such as to increase the probability that the processed data are located in a lower-level cache memory, thereby reducing the risk of cache miss and therefore increasing the performance of an encoder comprising the encoding module.

[0182] The pre-processing module, the encoding module and the post-processing module as used herein are software modules. Said modules should be interpreted as a way of distinguishing between different types of operations. Namely, the encoding module applies a wavelet-type filter operation on respective lines of image samples; the pre-processing module applies one or more prior operations as defined hereinbefore; and the post-processing module applies one or more subsequent operations as defined hereinbefore. Said modules may be comprised in a single system, i.e. the operations performed by said modules may be executed by a single processor. Said modules may also be comprised a distributed system, i.e. the operations performed by said modules may be executed by a plurality of processors.

[0183] In an embodiment, at least one of said prior or subsequent operations is an additional wavelet-type filter operation. Said additional wavelet-type filter operation may be applied in a horizontal or vertical direction. A wavelet-type filter operation applied in a horizontal direction is applied along a line of image samples or coefficients and may also be referred to herein as a “horizontal wavelet-type filter operation”. A wavelet-type filter operation applied in a vertical direction is applied across lines of image samples or coefficients and may also be referred to herein as a “vertical wavelet-type filter operation”. Said additional wavelet-type filter operation is preferably applied according to the lifting scheme.

[0184] In an embodiment, at least one of said subsequent operations is an operation for entropy encoding a set of coefficients. Entropy encoding generally designates techniques for reducing the size of a set of data, i.e. compressing a set of data. Known examples of entropy encoding techniques include Huffman coding, arithmetic coding, and Golomb codes, such as unary coding or Rice coding. Besides, JPEG XS Part 1 (ISO / IEC 21122-1:2022) specifies some types of entropy decoding and related encoding in its subclause C.6.

[0185] In an embodiment, after all data comprised in a buffer have been processed, said buffer is reused to store processed data. A buffer of this embodiment may be for instance a line buffer of the encoding module, such as an input line buffer, an intermediate line buffer, or an output line buffer. A buffer of this embodiment may also be a buffer of the pre-processing module or a buffer of the post-processing module. An advantage of this embodiment is to allow a more efficient use of available memory, by reusing already allocated memory rather than having to allocate additional memory. This embodiment allows limiting the size of a memory comprising the buffers. In addition, limiting the size of the memory comprising the buffers may reduce the risk of cache misses and may therefore improve the performance of an encoder comprising the encoding module. A particular case of this embodiment is the so-called “in- place” processing, wherein output data produced by a process are stored in the place of input data of the process, i.e. replace the input data in a buffer. In addition, this embodiment, its variants, and its advantages may apply mutatis mutandis to the method for decoding.

[0186] In an embodiment, the wavelet-type filter operation is a filter operation of the LeGall 5 / 3 type, and the number of intermediate line buffers is equal to two line buffers. A wavelet-type filter operation of the LeGall 5 / 3 type is a known type of Discrete Wavelet Transform (DWT) comprising a low-pass filter with a support of 5 coefficients and a high-pass filter with a support of 3 coefficients. A wavelet-type filter operation of the LeGall 5 / 3 type is also herein referred to as a “DWT 5 / 3 transform”. The DWT 5 / 3 transform is used as a decorrelative transform in the JPEG XS standard, see e.g. subclause E.7 of JPEG XS Part 1 (ISO / IEC 21122-1:2022). Compared to other wavelet transforms, such as for example the DWT 9 / 7 transform used in JPEG 2000 (formally known as ISO / IEC 15444), the DWT 5 / 3 transform offers the following advantages. First, it is reversible because it uses only integer coefficients, so its output does not require rounding (quantization) and so it does not introduce any quantization noise. In addition, the low-pass and high-pass filters of the DWT 5 / 3 transform have a reduced support of only 5 and 3 coefficients, respectively. Finally, the DWT 5 / 3 transform may be implemented “in-place” according to a lifting scheme, thereby allowing it to be implemented with a reduced computational complexity and a reduced memory footprint. Namely, in the case of the DWT 5 / 3 transform applied in a vertical direction, the minimum number of buffered lines, or in other words the minimum number of intermediate lines of image samples, required for producing the respective sets of coefficients according to the lifting scheme is equal to two lines. This embodiment and its advantages may be applied mutatis mutandis to the method for decoding.

[0187] In an embodiment, the encoding of the image conforms with a JPEG XS standard.

[0188] According to a second aspect of the third innovative improvement, there is provided a computer-implemented method for decoding an encoded image, wherein the encoded image comprises respective sets of coefficients forming a sequence of sets, the respective sets of coefficients being obtainable by a method for encoding comprising the step of: - applying a wavelet-type filter operation in a vertical direction on respective lines of image samples for producing respective sets of coefficients spatially related to the respective lines of image samples; wherein the method for decoding comprises the steps of: - providing a decoding module comprising an input line buffer, a number of intermediate line buffers and an output line buffer; - providing the respective sets of coefficients of the encoded image in the input line buffer; - processing with the decoding module the respective sets of coefficients for producing intermediate results and final results according to a lifting scheme of an inverse wavelet-type filter operation applied in a vertical direction; - storing the intermediate results in the intermediate line buffers; - providing the final results in the output line buffer as respective decoded lines of image samples spatially related to the respective sets of coefficients, the respective decoded lines forming a sequence of decoded lines; wherein the number of intermediate line buffers is equal to the minimum number of intermediate line buffers required for producing the respective decoded lines of image samples according to the lifting scheme.

[0189] Preferably, the encoded image is obtained according to the method for encoding.

[0190] The method for decoding allows respective sets of coefficients comprised in an encoded image to be decoded with a reduced amount of memory in a decoding process comprising an inverse wavelet-type filter operation applied in a vertical direction on said respective sets of coefficients.

[0191] Indeed, a memory comprising the line buffers of the decoding module may be reduced because the number of intermediate line buffers is equal to the minimum number of intermediate line buffers required for producing the respective decoded lines of image samples according to the lifting scheme. For example, said memory does not have to store all the respective sets of coefficients to be processed. Instead, said memory may only store a reduced number of sets of coefficients corresponding to the minimum number of sets of coefficientsrequired for producing the respective decoded lines of image samples according to the lifting scheme.

[0192] Advantageously, the performance of a decoder may be improved thanks to the method for decoding. Indeed, with a reduced amount of memory, there is a reduced risk of so- called “cache misses”. According to the third innovative improvement, the amount of memory required to store the buffers of the decoding module may be reduced. This allows said buffers to be stored in a lower-level, and therefore faster, cache memory, thereby reducing the cache misses and thus increasing the performance of a decoder comprising the decoding module.

[0193] Preferably, a line buffer of the decoding module is able to store at least one set of coefficients, more preferably exactly one set of coefficients.

[0194] Preferably, the decoding module according to the third innovative improvement is configured for processing the encoded image set-by-set, i.e. processing one set of coefficients at a time, in particular in a case where the input line buffer and / or the output line buffer has a size of one set of coefficients.

[0195] The method for encoding and the method for decoding are two aspects of the same innovative improvement, forming a single general inventive concept. Indeed, the steps of the method for decoding mirror the steps of the method for encoding in the reverse order. Therefore, all the possible embodiments and advantages of the method for encoding apply mutatis mutandis to the method for decoding.

[0196] In an embodiment, at least some of the respective sets of coefficients provided in the input line buffer result from one or more prior operations, said one or more prior operations being performed before each of said respective sets of coefficients is provided in the input line buffer. In other words, said one or more prior operations are performed before each of the at least some of the respective sets of coefficients resulting from the one or more prior operations is provided in the input line buffer. Said prior operations may be performed in a pre-processing module able to provide data to the decoding module. An advantage of this embodiment is that data provided to the decoding module are likely to be located in a lower-level cache memory, thereby reducing the risk of cache miss and therefore increasing the performance of a decoder comprising the pre-processing module and the decoding module.

[0197] Preferably, all of the respective sets of coefficients provided in the input line buffer result from one or more prior operations, said one or more prior operations being performed before each set of coefficients in the sequence of sets is provided in the input line buffer.

[0198] Examples of said prior operations include, but are not limited to: inverse decorrelative transforms, such as an inverse wavelet-type filter operation applied in ahorizontal or vertical direction; operations for entropy decoding a set of coefficients, such as decoding a set of coefficients based on bitplane count and data subpackets as specified in a JPEG XS standard; operations for unpacking a set of coefficients from a packet.

[0199] In an embodiment, at least some of the respective decoded lines of image samples are further processed in one or more subsequent operations, said one or more subsequent operations being performed after each of said respective decoded lines is provided in the output line buffer. In other words, said one or more subsequent operations are performed after each of the at least some of the respective decoded lines further processed in the one or more subsequent operations is provided in the output line buffer. Said subsequent operations may be performed in a post-processing module able to receive data from the decoding module. An advantage of this embodiment is that said subsequent operations are performed on data that are likely to be located in a lower-level cache memory, thereby reducing the risk of cache miss and therefore increasing the performance of a decoder comprising the decoding module and the post-processing module.

[0200] Preferably, all of the respective decoded lines of image samples are further processed in one or more subsequent operations, said one or more subsequent operations being performed after each decoded line in the sequence of decoded lines is provided in the output line buffer.

[0201] Examples of said subsequent operations include, but are not limited to: inverse decorrelative transforms, such as an inverse reversible color transform (IRCT), or an inverse wavelet-type filter operation applied in a horizontal or vertical direction; conversion from output line buffer format to user format, such as a conversion from an output line buffer precision (e.g. 32 bits) to a user precision (e.g.8 bits, 16 bits), a packing of bits from an output line buffer format to a user format, etc.

[0202] Preferably, said prior and / or subsequent operations are interlaced with the processing of the data by the decoding module, i.e. the processing of the respective sets to produce the respective decoded lines, such as to increase the probability that the processed data are located in a lower-level cache memory, thereby reducing the risk of cache miss and therefore increasing the performance of a decoder comprising the decoding module.

[0203] The pre-processing module, the decoding module and the post-processing module as used herein are software modules. Said modules should be interpreted as a way of distinguishing between different types of operations. Namely, the decoding module applies an inverse wavelet-type filter operation on respective sets of coefficients; the pre-processing module applies one or more prior operations as defined hereinbefore; and the post-processingmodule applies one or more subsequent operations as defined hereinbefore. Said modules may be comprised in a single system, i.e. the operations performed by said modules may be executed by a single processor. Said modules may also be comprised a distributed system, i.e. the operations performed by said modules may be executed by a plurality of processors.

[0204] In an embodiment, at least one of said prior or subsequent operations is an additional inverse wavelet-type filter operation. Said additional inverse wavelet-type filter operation may be applied in a horizontal or vertical direction. An inverse wavelet-type filter operation applied in a horizontal direction is applied along a line of coefficients and may also be referred to herein as a “horizontal inverse wavelet-type filter operation”. An inverse wavelet- type filter operation applied in a vertical direction is applied across lines of coefficients and may also be referred to herein as a “vertical inverse wavelet-type filter operation”. Said additional inverse wavelet-type filter operation is preferably applied according to the lifting scheme.

[0205] In an embodiment, at least one of said prior operations is an operation for entropy decoding a set of coefficients. Preferably, said entropy decoding is an entropy decoding specified in a JPEG XS standard, such as a decoding of a set of coefficients based on bitplane count and data subpackets.

[0206] In an embodiment, after all data comprised in a buffer have been processed, said buffer is reused to store processed data. A buffer of this embodiment may be for instance a line buffer of the decoding module, such as an input line buffer, an intermediate line buffer, or an output line buffer. A buffer of this embodiment may also be a buffer of the pre-processing module or a buffer of the post-processing module.

[0207] In an embodiment, the inverse wavelet-type filter operation is an inverse filter operation of the LeGall 5 / 3 type, and the number of intermediate line buffers is equal to two line buffers.

[0208] In an embodiment, the decoding of the encoded image conforms with a JPEG XS standard.

[0209] According to a third aspect of the third innovative improvement, there is provided a computer program comprising instructions which, when the program is executed by a computer, cause the computer to carry out a method for encoding or for decoding according to the third innovative improvement.

[0210] In an embodiment, there is provided a non-transitory recording medium having recorded therein an encoding program that causes a processor to execute a method for encoding according to the third innovative improvement.

[0211] In an embodiment, there is provided a non-transitory recording medium having recorded therein a decoding program that causes a processor to execute a method for decoding according to the third innovative improvement.

[0212] According to a fourth aspect of the third innovative improvement, there is provided an encoder comprising an encoding module, the encoding module comprising an input line buffer, a number of intermediate line buffers and an output line buffer, the encoder being configured for performing a method for encoding according to the third innovative improvement.

[0213] Preferably, the encoder further comprises a processor for processing data and a memory, said line buffers being comprised, or in other words stored, in said memory, i.e. said memory being configured for storing said line buffers.

[0214] According to a fifth aspect of the third innovative improvement, there is provided a decoder comprising a decoding module, the decoding module comprising an input line buffer, a number of intermediate line buffers and an output line buffer, the decoder being configured for performing a method for decoding according to the third innovative improvement.

[0215] Preferably, the decoder further comprises a processor for processing data and a memory, said line buffers being comprised, or in other words stored, in said memory, i.e. said memory being configured for storing said line buffers.

[0216] Processing an image according to the method for encoding does not necessarily imply a compression of said image, i.e. a reduction of the number of bits required to store said image or a representation of said image. Similarly, processing an encoded image according to the method for decoding does not necessarily imply a decompression of said encoded image.

[0217] All the possible embodiments and advantages of the first aspect of the third innovative improvement apply mutatis mutandis to other aspects of the third innovative improvement. Fourth innovative improvement

[0218] In this section, the “method for encoding” relates to the method for encoding according to the fourth innovative improvement, unless otherwise specified. Technical field

[0219] The fourth innovative improvement relates to the field of digital image data encoding. An aspect of the fourth innovative improvement relates to a method for encoding image data according to an encoding scheme in which an evaluation of a cost of segments ofimage coefficients is made according to a value of a quantization level. Other aspects of the fourth innovative improvement relate to an encoder of image data and a computer program for encoding image data. Background

[0220] Image compression is required when one needs to transmit or store an image that would require a larger bitrate than the available bandwidth of a communication channel or the capacity of a storage medium. This is generally possible when the image contains a significant amount of redundancy, and some amount of details that are imperceptible to the human eye, or at least that could be removed without compromising the purpose of the transmission. The compression is said to be lossless when the image is not modified by the compression- decompression cycle, and thus is identical at the emitter and the receiver. However, it is usually not possible to guarantee a lossless compression since it depends on the intrinsic characteristics of the image, in which the redundancy and the ability to remove it by a clever encoding alone may not always succeed in reducing the bitrate or data cost enough. In such case, a lossy compression scheme is required, and an encoder reduces the information contained in the image by quantization, in order to guarantee a required output bitrate at the expense of quality. The rate allocation unit computes, for all the image values, the levels of quantization that maximize the quality under a bitrate or data budget constraint. The process of encoding the resulting data and all the information necessary for a decoder to reconstruct the image is referred to as entropy encoding and is performed by the entropy encoder.

[0221] Image compression algorithms may apply a decorrelative transform before entropy encoding image data. A decorrelative transform allows the entropy of a set of image samples to be reduced by concentrating probabilities of occurrence on a subset of values. A decorrelative transform may be for example a color transform (CT), such as a reversible color transform (RCT), a temporal decorrelative transform based on interframe predictions, a discrete cosine transform (DCT), or a wavelet transform, such as a discrete wavelet transform (DWT). Image samples after a decorrelative transform are referred to herein as image coefficients. Image coefficients may be identical to image samples if no decorrelative transform is applied.

[0222] Document EP 2773122 A1 describes a method and device for lossless data compression wherein one groups data into groups of n words of m bits; one detects for each group the value of the Greatest Coded Line Index (GCLI), the GCLI being the index of the highest weight non-zero bit among the bits of the words in a group; one produces for eachgroup an output data set comprising the GCLI bits of lowest weight of the words of the group, and meta-data comprising the value of the GCLI. The values of the GCLIs are comprised between zero, when all words of a group are zero, and m, when at least one word in the group has a bit of weight m equal to 1. Therefore, binary coding of the GCLIs requires ceil(log2(m)) bits, ceil(x) being a function returning the smallest integer greater than x. This document also proposes an improvement wherein one replaces the GCLI in the output data set by the difference between the GCLI value and a predicted value of the GCLI. In doing so, the values to be coded may be smaller, and a unary coding may require less space than binary coding of the GCLIs.

[0223] Document EP 3343921 A1 describes a method and device for compressing a sequence of signed coefficients wherein coefficients are grouped, for each group, the greatest coded line index (GCLI) is determined, a quantization level t is applied and only the GCLI to t+1 weight bits of the coefficients are copied into an output stream together with the value of the GCLI, and sign bits are not coded for coefficients having a zero quantized value. Document EP 3 343 921 A1 also describes a method for determining a data budget required for compressing a sequence of signed coefficients, in dependence of a quantization level, and a method for compressing an image within the limits of a given data budget constraint.

[0224] The JPEG XS standard, formally known as ISO / IEC 21122, is an interoperable, visually lossless, low-latency, and lightweight image and video coding system. The JPEG XS standard is divided into several parts, each part specifying specific aspects of the standard. JPEG XS Part 1, formally known in its second edition as ISO / IEC 21122-1:2022, normatively defines how a compressed JPEG XS codestream can be transformed into a decoded image, a “codestream” being defined in the JPEG XS standard as a compressed image data representation that includes all necessary data to allow a (full or approximate) reconstruction of the sample values of a digital image. Moreover, JPEG XS Part 1 provides some key algorithms enabling an encoder to generate a JPEG XS codestream. In particular, JPEG XS Part 1 (ISO / IEC 21122-1:2022) specifies some types of entropy decoding and related encoding in its subclause C.6. Herein the expression “JPEG XS standard” generally designates the JPEG XS specification according to documents published under reference ISO / IEC 21122, including any part of said specification and any edition of said parts.

[0225] The following definitions and notations are used herein. An “image coefficient”, also simply referred to herein as a “coefficient”, is an integer number, coded in binary representation, and having a magnitude and an optional sign value. Parameter NSdesignates the number of bits coding the value of a coefficient, which is also herein referred to as the “size”of a coefficient. A coefficient may correspond to an image data, such as for example the value of a pixel of an image, or the value of a color component of a pixel of an image. Coefficients may be grouped into a “group of coefficients”, which is also referred to as a “code group” in the JPEG XS standard. Parameter Ngdesignates the number of coefficients in a group, which is also herein referred to as the “size” of a group. In a group of Ng coefficients, a “bitplane” is an array of Ngbits of the coefficients of the group all having the same significance. The significance, or weight, of a bit relates to the position of the bit within a binary number, the “most significant bit”, or “MSB”, having the highest weight, i.e. the highest position within a binary number, and the “least significant bit”, or “LSB”, having the lowest weight, i.e. the lowest position within a binary number.

[0226] Herein, a “significant coefficient” designates a coefficient whose value is not equal to zero. A “significant group” is a group of coefficients comprising at least one significant coefficient. A coefficient may become equal to zero, and thus no longer significant, after a quantization operation. A quantization operation reduces the number of bits used for coding the value of a coefficient or a set of coefficients. A quantization operation is performed based on the value of a quantization level. A quantization level determines the extent to which a coefficient is quantized in the quantization operation, i.e. the amount of information that is removed from the coefficient. A quantization operation may be for example a fixed width quantization, a deadzone quantization, or a uniform quantization, the latter two being specified in the JPEG XS standard. In particular, a quantization operation may be performed by truncating, i.e. removing, a number of least significant bits (LSB) from the magnitude of a coefficient or a set of coefficients. In such a case, the quantization level corresponds to a “truncation level”, indicating the number of bits removed from the magnitude of a coefficient, or the number of bitplanes removes from a set or a group of coefficients.

[0227] Herein, the term “computational complexity” generally refers to the resources needed to run a computation, in terms of the number of operations required and / or in terms of the number of memory accesses (read / write) required. A computation requiring a higher computational complexity is one that requires more operations and / or more memory accesses. A computation requiring a lower computational complexity is one that requires less operations and / or less memory accesses. Unless otherwise specified, the term “computational complexity” is used herein to designate the number of operations required for a computation, and / or the number of memory accesses required for that computation. In addition, the quantity of data retrieved from a memory is related to the size of the data bus of the memory, i.e. the quantity of data retrieved in each memory access, so that a larger number of memory accessesgenerally results in a larger quantity of data retrieved from the memory. Therefore, a higher computational complexity may also correspond to a larger quantity of data retrieved from a memory. In the particular case of a processor with a cache memory, the processor may read a whole cache line from the cache memory and then extract data from this cache line. In this case, the computational complexity may be measured in terms of the number of cache lines accessed by the processor for performing a given computation.

[0228] A known technique for determining a suitable value of the quantization level, i.e. a value that respects the budget constraint, in a rate allocation process is to search for said value using binary search. However, binary search may lead to a budget computation step requiring a high computational complexity, i.e. a large number of operations and / or a large number of memory accesses. Indeed, in a binary search approach, when a suitable value of the quantization level is found, there is no guarantee that said value is optimal, i.e. that it minimizes the loss of information between the original image and the encoded image due to the quantization operation. Therefore, it is necessary to compute the cost of all segments of image coefficients in each budget computation step when using a binary search approach, which requires a high computational complexity.

[0229] In view of the above deficiencies of the prior art, there is a need to reduce the computational complexity of a rate allocation process aiming at finding suitable quantization level values in order to achieve a target size of an encoded image. Disclosure of the fourth innovative improvement

[0230] It is an object of the fourth innovative improvement to address this need. To this end, there is provided a method, apparatus, and computer program for encoding image data wherein a budget computation is performed according to an incremental evaluation scheme based on a predetermined order.

[0231] According to a first aspect of the fourth innovative improvement, there is provided a computer-implemented method for encoding at least one portion of an original image into a corresponding portion of an encoded image according to the following steps: S1) in an initialization step, initializing a quantization level to an initial value of the quantization level and providing a target budget for the portion of the encoded image; S2) in a generation step, generating a set of segments from a set of image coefficients derived from the portion of the original image; wherein the set of segments comprises at least one segment, andwherein a segment is a software object comprising a subset of coefficients from the set of image coefficients and a cost function to be applied to the subset of coefficients with a given value of a quantization level for computing a cost of the segment for said value of the quantization level; S3) in a budget computation step, computing a cost of the set of segments incrementally for the current value of the quantization level, wherein the budget computation step is performed according to an incremental evaluation scheme based on a predetermined order, and wherein the budget computation step comprises the following substeps, starting with a first segment in the set of segments as a current segment: S3)(i) computing a cost of the current segment for the current value of the quantization level; S3)(ii) storing the cost of the current segment in a memory; S3)(iii) adding the cost of the current segment to the cost of the set of segments; S3)(iv) if the cost of the set of segments exceeds the target budget, stopping the current budget computation step S3); S3)(v) if at least one further segment is available in the set of segments, selecting a next segment in the set of segments as the new current segment, wherein the selection is made according to the predetermined order of the incremental evaluation scheme; S3)(vi) repeating the preceding substeps until the cost of each segment in the set of segments has been evaluated for the current value of the quantization level; S4) if the cost of the set of segments has exceeded the target budget, increasing the value of the quantization level and performing a new budget computation step S3) for the increased value of the quantization level; S5) if the cost of the set of segments has not exceeded the target budget, entropy encoding the set of image coefficients according to the current value of the quantization level for producing the portion of the encoded image.

[0232] The method for encoding may be performed by an encoder comprising a processor and a memory, and configured for performing said method.

[0233] The method for encoding may operate on the full original image or iteratively on respective portions of the original image for producing respective portions of the encoded image. When the method is applied on the full original image, then the method operates on asingle portion of the original image, said portion corresponding to the full original image, and steps S1) to S5) are executed once. When the method is applied iteratively on respective portions of the original image, steps S1) to S5) are executed multiple times, i.e. once for each portion of the original image.

[0234] In the step S5) of the method for encoding, the condition “if the cost of the set of segments has not exceeded the target budget” also includes the case where the cost of the set of segments is equal to the target budget.

[0235] In the method for encoding, a target budget is provided for a portion of the encoded image for which a quantization level is determined e.g. in a rate allocation process of an encoder. Based on the target budget, an encoder determines a suitable value of the quantization level for entropy encoding a set of image coefficients corresponding to the portion of the encoded image so as to respect the target budget.

[0236] In particular, the target budget is not to be confused with the size of the encoded image, which is the sum of the size of all portions of the encoded image. In order not to confuse terms, “target budget” as used herein is only meant to designate the size of a portion of the encoded image, whereas the (total) size of the encoded image is referred to herein as the “size of the encoded image”.

[0237] The method for encoding may also be applied for encoding a sequence of images, which may also be referred to as a sequence of frames. An encoded image may also be referred to herein as an encoded frame.

[0238] The method for encoding allows image samples to be encoded with a reduced computational complexity. Indeed, the progressive, or incremental, increase of the quantization level according to the fourth innovative improvement allows an encoder executing the method to avoid evaluating the whole set of segments for determining that a current quantization level does not allow to respect a target budget. Instead, the encoder may discard a quantization level as soon as the target budget is exceeded. So, with the method for encoding, i.e. starting with a low quantization level, for which the budget of the whole set of segments is likely to exceed the target budget, the encoder may quickly discard quantization levels and progressively evaluate more and more segments in each iteration, i.e. each increase in the quantization level, until finding a quantization level which respects the target budget, said quantization level being de facto the optimal quantization level, i.e. the lowest one, or in other words the one keeping the most information from the set of segments while respecting the target budget. In contrast, with an encoding scheme based on a binary search and starting at an average quantization level, the encoder will need to evaluate the cost of thewhole set of segments in case the quantization level is too high, i.e. for which the target budget is exceeded, without knowing if a given quantization level is optimal, i.e. lowest, or if a lower quantization level would also respect the target budget.

[0239] A “segment” as used herein is a software object, or more generally a software entity or a software structure, comprising image coefficients prior to entropy coding and a cost function to compute a cost of the segment from said coefficients and for a given value of a quantization level. A segment has a type depending on the nature of the cost function. Examples of segment types are: a data segment, a GCLI segment, a sign segment. A data segment may be used to compute the cost of magnitudes of coefficients after quantization. A GCLI segment may be used to compute the cost of GCLI values of groups of coefficients after quantization. A sign segment may be used to compute the cost of sign values of significant coefficients after quantization. Segments of other types are generally possible within the scope of the fourth innovative improvement. Segments of different types may be derived from the same subset of coefficients with different cost functions. Herein, when different segments share the same subset of coefficients, they are referred to as “corresponding segments”. Generally, the cost of a segment may be split into a first part that is independent from the value of the quantization level (the “quantization-independent part”) and a second part that varies with or depends on the value of the quantization level. The quantization-independent part of the cost of a segment may also be referred to as a “fixed cost” of the segment.

[0240] The portion of the encoded image may comprise “packets” and “subpackets”. A subpacket corresponds to a subset of coefficients comprised in a segment and entropy encoded for a given value of a quantization level. A subpacket has a type. The type of a subpacket is the type of the corresponding segment. Examples of subpacket types are: a data subpacket, a GCLI subpacket, a sign subpacket. A data subpacket comprises magnitudes of coefficients after quantization. A GCLI subpacket comprises GCLI values of groups of coefficients after quantization. A sign subpacket comprises sign values of significant coefficients after quantization. Subpackets of other types are generally possible within the scope of the fourth innovative improvement. A subpacket of a given type is produced from a segment of the same type whose coefficients are entropy encoded for a value of the quantization level. For example, a data subpacket is produced from a data segment whose coefficients are entropy encoded for a value of the quantization level. Similarly, a GCLI subpacket is produced from a GCLI segment whose coefficients are entropy encoded for a value of the quantization level. Similarly, a sign subpacket is produced from a sign segment whose coefficients are entropy encoded for a value of the quantization level. Subpackets maybe grouped into packets. A packet comprises all subpackets derived from a same subset of coefficients. Subpackets of different types may be derived from the same subset of coefficients in a similar way as segments of different types being derived from the same subset of coefficients with different cost functions. Herein, when different subpackets share the same subset of coefficients, they are referred to as “corresponding subpackets”.

[0241] A segment may be seen as a subpacket candidate. The cost of a segment may be evaluated for several values of the quantization level when searching for a suitable value of the quantization level, i.e. one that respects the target budget. The cost function computes a cost (e.g. the size in bytes) of a subpacket of the same type as the segment and derived from the same coefficients for a given value of a quantization level. The cost function of a segment may be a different function as the one used to compute an actual subpacket from the subset of coefficients.

[0242] The cost of a segment or a subpacket is a measure of the portion of a budget consumed by the segment or the subpacket. A cost of a segment or a subpacket typically corresponds to the size of the segment or the subpacket, which may be expressed as the number of bits or bytes occupied by the segment or the subpacket in a computer memory.

[0243] An optimal value of a quantization level is the suitable value of the quantization level that preserves the most information from a subset of coefficients. Typically, the optimal value of a quantization level is the lowest one, i.e. the one which removes the least information from the subset of coefficients.

[0244] Preferably, the set of segments comprises a plurality of segments. This allows a finer, or in other words more granular, allocation of the budget of the portion of the encoded image.

[0245] The method for encoding allows an encoder to determine a suitable value of the quantization level without having to compute the cost of segments for all possible values of the quantization level. Instead, the cost of the set of segments is computed incrementally for a given value of the quantization level in a given budget computation step S3). In other words, the cost of segments is evaluated only for a single value of the quantization level in a given budget computation step S3).

[0246] The method for encoding works in a different way from a known binary search approach. Indeed, in a binary search, if the cost of the set of segments has not exceeded the target budget, then the quantization level may be decreased for all segments and a new budget computation step may be performed, since there is no guarantee that the value of the quantization level is optimal, i.e. that it minimizes the loss of information between the originalimage and the encoded image due to the quantization operation. However, in the fourth innovative improvement, when the cost of the set of segments has not exceeded the target budget, then an optimal value of the quantization level is guaranteed to be found, and therefore the set of coefficients may be directly entropy encoded according to said value of the quantization level.

[0247] In addition, in a binary search approach, it is generally needed to evaluate the cost of all segments of a set of segments in a budget computation step, namely in the case where the quantization level is too high, since there is no guarantee that the value of the quantization level is optimal. However, in the fourth innovative improvement, only the cost of a subset of the segments is computed in the budget computation step, thereby performing a so-called “partial evaluation” of the cost of the set of segments, and the budget computation step is stopped as soon as the cost of the segments exceeds the target budget, thereby reducing the computational complexity of the budget computation step.

[0248] The partial evaluation of the cost of the set of segments according to the fourth innovative improvement allows the computational complexity of the method for encoding to be reduced. In other words, said partial evaluation allows the at least one portion of the original image to be encoded with a higher efficiency, in particular by reducing the computation time and the number of memory accesses needed for performing the evaluation of the cost of the set of segments. The evaluation of the cost of the set of segments is also referred to herein as “the budget computation”.

[0249] The initial value of the quantization level is predetermined. The initial value of the quantization level may be determined according to the following ways, where some of them can be combined: - as a quantization level corresponding to a lossless compression, i.e. with no loss of information in the encoded image as compared with the original image before encoding; - as a quantization level corresponding to an acceptable image quality for a given application; - based on statistics known a priori based on properties of the image to be encoded, such as image resolution (e.g. FHD (1920x1080 pixels), 4K (3840x2160 pixels), etc.), image bit depth (e.g.8, 10, or 12 bits per image sample), optionally combined with the target budget constraint;- based on statistics determined at run-time from previous elements, e.g. previous segments, previous precincts, or previous images, said statistics being for example the quantization level found for said elements.

[0250] Generally, the quantization level is not necessarily identical for all segments. Instead, the quantization level as used herein should be interpreted as encompassing a situation where the effective quantization level of each segment in a set of segments depends on an overall parameter, i.e. the (overall) quantization level, that is adjusted individually for each segment in a manner known a priori. This is exemplified by the quantization and refinement mechanism as specified in the JPEG XS standard, wherein the quantization level of each band in a precinct is determined based on a pair of values, namely the precinct quantization Q[p] and the precinct refinement R[p] contained in the header of each precinct, and is adjusted based on the gain G[b] and priority P[b] of each band contained in the weights table present in the codestream header, and therefore known a priori.

[0251] Furthermore, when the quantization level is increased, it is not necessarily increased for all segments at the same time. Indeed, some segments may be protected by a sufficiently high gain so that the effective quantization level of these segments is not impacted, or modified, by an increase of the overall quantization level. This may also be the case when a refinement mechanism is used. The following cases may generally occur following an increase in the overall quantization level: - increase of the effective quantization level of all segments; - increase of the effective quantization level of some segments; - increase of the effective quantization level of a single segment.

[0252] The order in which segments are evaluated in the budget computation step S3) of the method for encoding is predetermined. Having such a predetermined order may facilitate an implementation of the method for encoding, for instance by improving the predictability of future steps of the method, thereby allowing a more efficient caching of data and / or a more efficient planning and allocation of computational resources. Generally, said predetermined order may be such that segments with a higher expected cost and / or whose cost is easier to evaluate, i.e. requires a lower computational complexity, are evaluated first. In addition, said order may be predetermined for a current image based on parameters or statistics from a previous image.

[0253] Generally, the predetermined order in which segments are evaluated in the budget computation step S3) of the method for encoding may vary (or in other words be different, or be modified) for different budget computation steps S3). In other words, said predeterminedorder may be determined in a given budget computation step S3) and vary (or in other words be different, or be modified) in a further budget computation step S3).

[0254] In a case where the value of the quantization level is maintained for at least some segments between two budget computation steps S3), in particular between two successive steps S3), the predetermined order may give priority to segments whose quantization level is maintained, i.e. is not modified, for the current step S3) compared to a previous step S3). Indeed, the cost of these segments is already known and therefore it does not need to be computed again. In addition, the predetermined order may also give priority to segments whose quantization level will be maintained, i.e. will not be modified, during one or more subsequent steps S3). For those segments whose quantization level is not modified between two steps S3), it is thus possible to reuse all or part of the cost of a segment, i.e. a result already computed in a previous step. This offers the advantage of increasing the efficiency of the budget computation step S3) by reusing results that have already been computed. In order to be easily reused, said results may advantageously be stored in a memory between two budget computation steps S3), in particular between two successive steps S3). Said memory may be for instance a cache memory.

[0255] The predetermined order in which segments are evaluated in the budget computation step S3) of the method for encoding may be based on a ratio of the expected cost of each segment divided by the computational complexity required for determining said cost. A segment with a higher ratio is evaluated before a segment with a lower ratio. In other words, segments with a higher expected cost and a lower computational complexity for determining said cost are evaluated first. For example, segments that are the biggest contributors to cost and / or the fastest to evaluate may be evaluated first. Generally, the cost of data segments may be evaluated before the cost of GCLI segments. In turn, the cost of GCLI segments may be evaluated before the cost of sign segments. Indeed, data segments typically comprise more data than (corresponding) GCLI or sign segments, so their cost is typically higher. In addition, the evaluation of the cost of a data segment may be performed based on GCLI values only. For example, on a modern computer with parallel processing capabilities, 32 GCLI values may typically be processed in parallel, with one GCLI value stored in each byte of a vector of 32 bytes (256 bits).

[0256] The evaluation of the cost of a GCLI segment requires analyzing GCLI values. In particular, the evaluation of the cost of a GCLI segment may require analyzing several GCLI coding modes. In addition, some GCLI coding modes may require taking into account GCLI values in a previous line of image coefficients. Therefore, computing the cost of a GCLIsegment may require a higher computational complexity than computing the cost of a corresponding data segment. The evaluation of the cost of a GCLI segment may benefit from vectorization in a similar way as the evaluation of the cost of a data segment.

[0257] The evaluation of the cost of a sign segment requires analyzing the individual value of each coefficient of the segment, which implies reading the value of each of said coefficients from memory. Therefore, computing the cost of a sign segment may require a higher computational complexity than computing the cost of a corresponding GCLI or data segment. Let us consider the example of a group of four coefficients where the value of each coefficient is stored in 16 bits of memory and with a single GCLI value associated with the group. In this example, analyzing the sign of each coefficient of the group requires reading the value of each coefficient from memory, i.e. reading 64 bits from memory. In contrast, analyzing the GCLI of the group may be performed by reading only the single GCLI value from memory, which is typically stored in a byte, i.e.8 bits. Therefore, this example shows that analyzing the sign of the coefficients of a group may require eight times more memory accesses than analyzing the GCLI of the group, thereby requiring a higher computational complexity.

[0258] The following further elements are also relevant for the determination of the order in which segments are evaluated in the budget computation step. The effective quantization level of some segments may be adjusted, for example according to the quantization and refinement mechanism specified in the JPEG XS standard and described hereinabove. Therefore, the cost of a segment with a lower quantization level may advantageously be evaluated before the cost of a segment with a higher quantization level. Indeed, a lower quantization level means that less data will be quantized, or removed, from the coefficients of the segment and thus that the corresponding subpacket will contain more data, i.e. the cost of the corresponding subpacket will be higher. In other words, for a given computational complexity, there is an increased probability of exceeding the target budget when evaluating the cost of a segment with a lower quantization level than when evaluating the cost of a segment with a higher quantization level. Therefore, it may be advantageous to evaluate the cost of a segment with a lower quantization level before the cost of a segment with a higher quantization level. In particular, some image components may have smaller quantization values than other. For example, in the case of an image with “Y”, “Cb” and “Cr” color components, the JPEG XS standard specifies lower quantization values for coefficients from the Y component than for corresponding coefficients from the Cb and Cr components. Therefore, the cost of segments with coefficients from a less quantized image component may advantageously be evaluated before the cost of segments with coefficients from a morequantized image component. Furthermore, lower-frequency subbands typically have a lower quantization value than higher-frequency subbands. Therefore, the cost of segments with coefficients from lower-frequency subbands may advantageously be evaluated before the cost of segments with coefficients from higher-frequency subbands.

[0259] In short, the order in which segments are evaluated in the budget computation step is determined so as to achieve a balance between the computational complexity required for evaluating the cost of each segment and the expected cost of each segment. The segments requiring a lower computational complexity for computing their cost tend to be evaluated first. In addition, segments whose cost is expected to be higher also tend to be evaluated first. In other words, said order is determined so that segments with a higher expected cost and / or a lower computational complexity for determining said cost are evaluated first. Indeed, said segments are more likely to make the total cost of the set of segments exceed the target budget in a budget computation step, thereby allowing a given quantization level to be discarded more quickly and / or requiring a lower computational complexity to discard a given quantization level.

[0260] In the budget computation step S3) of the method for encoding, when a cost of the set of segments is computed incrementally, it means that said cost is computed until the cost of the set of segments exceeds the target budget or until the cost of each segment of the set has been evaluated.

[0261] Preferably, the budget computation step may be stopped as soon as the target budget is exceeded, i.e. during the computation of the cost of a segment in substep S3)(i) and with no need to wait for the completion of the computation of the cost of the segment in substep S3)(i). In this case, the cost of the segment that is stored in the memory is a partial cost of the segment, and it may be marked as such.

[0262] More preferably, the computation of the cost of a GCLI segment may be stopped as soon as the maximum cost of said segment is reached, which corresponds to the cost of the segment in the case all GCLI are encoded in a RAW coding mode, for example with 4 bits per GCLI as specified in the JPEG XS standard.

[0263] Preferably, the memory of substep S3)(ii) of the method for encoding is a cache memory. In this case, a further advantage of the fourth innovative improvement is to maximize the usefulness of the information contained in the cache memory by reducing the number of memory accesses and / or avoiding to read coefficients from the memory that are not needed to determine if the target budget is exceeded for the current value of the quantization level.

[0264] The inventors propose several possible embodiments comprising optional features. These embodiments may be implemented independently and / or be combined.

[0265] In an embodiment, the predetermined order for the evaluation of the cost of segments in the budget computation step S3) is based on a ratio of the expected cost of each segment in the set of segments divided by the computational complexity required for determining said cost, wherein a segment with a higher such ratio is evaluated before a segment with a lower such ratio. An advantage of this embodiment is to increase the efficiency of the budget computation step S3) by increasing the likelihood that the additional cost of a segment makes the total cost of the set of segments exceed the target budget, thereby allowing a given quantization level to be discarded more quickly and / or requiring a lower computational complexity to discard a given quantization level.

[0266] In an embodiment, the predetermined order for the evaluation of the cost of segments in a current budget computation step S3) gives priority to a segment whose cost has been at least partially computed in a previous budget computation step S3), in particular when the value of the quantization level of said segment in the current budget computation step S3) is the same as in the previous budget computation step S3). This embodiment offers the advantage of increasing the efficiency of the current budget computation step S3) by reusing results that have already been computed.

[0267] In an embodiment, the predetermined order for the evaluation of the cost of segments in a current budget computation step S3) gives priority to a segment whose cost will be, or is expected to be, at least partially reused in a further, or subsequent, budget computation step S3), in particular when the value of the quantization level of said segment in the further budget computation step S3) will be, or is expected to be, the same as in the current budget computation step S3). This embodiment offers the advantage of increasing the efficiency of the further budget computation step S3) by reusing results that have already been computed. This embodiment may be implemented independently from the previous embodiment and / or be combined with the previous embodiment.

[0268] In an embodiment, the encoded image conforms with a JPEG XS standard. In this embodiment, the method for encoding complies with the JPEG XS standard. In other words, the method for encoding produces an encoded image conform to the JPEG XS standard, i.e. decodable according to the specifications of the JPEG XS standard. In this embodiment, the portion of the encoded image preferably corresponds to a plurality of adjacent precincts, more preferably to a single precinct, so as to allow a low-latency encoding of the at least one portion of the original image. A GCLI as used herein corresponds to a bitplane count in the JPEG XS standard. A subband as used herein corresponds to a band in the JPEG XS standard. A group of coefficients as used herein may correspond to a code group in the JPEG XS standard.However, packets and subpackets as used herein designate a broader concept as the one specified in the JPEG XS standard.

[0269] In an embodiment, the encoded image comprises at least one sign subpacket. A sign subpacket allows signs of image coefficients represented in sign-magnitude representation to be encoded separately from the magnitude of said coefficients. Sign subpackets according to this embodiment are taken into account in the incremental evaluation scheme as respective sign segments. An advantage of this embodiment is to improve the efficiency of the encoding, i.e. the amount of information from the original image that is preserved in the encoded image for a given target size of the encoded image.

[0270] The method for encoding is particularly advantageous in cases where the encoded image comprises one or more sign subpackets, which requires computing the cost of one or more corresponding sign segments in the budget computation step S3). Indeed, said method may allow a given value of the quantization level to be discarded without having to evaluate the cost of all segments in the set of segments, and in particular without having to evaluate the cost of sign segments. This allows the computational complexity of the budget computation step S3) to be reduced. Indeed, the evaluation of the cost of a sign segment requires a high computational complexity since it requires analyzing the individual value of each coefficient of the segment. Therefore, it is advantageous to be able to discard a value of the quantization level without having to evaluate the cost of all segments in the set of segments, and in particular without having to evaluate the cost of sign segments.

[0271] Generally, the incremental evaluation scheme performed in the budget computation step S3) may be performed only for a subset of the segments, i.e. only for some segments in the set of segments. In particular, said incremental evaluation scheme may be performed only for the sign segments. The computational complexity of the evaluation of the cost of the set of segments may be reduced even in the case where the incremental evaluation scheme is performed only for a subset of the segments.

[0272] In an embodiment, the entropy encoding comprises a quantization operation performed by truncation of bitplanes of coefficients. Performing a quantization operation by simply truncating, or removing, a number of least significant bitplanes of coefficients allows reducing the computational complexity of the quantization operation. In this case, the quantization level corresponds to a truncation level, i.e. the number of least significant bitplanes truncated from the coefficients. A quantization level may be denoted herein as “t”. A truncation level may be specified by the so-called “Greatest Trimmed Line Index” (GTLI), which indicates a number of least significant bitplanes truncated from the coefficients.

[0273] In an embodiment, after a suitable value of the quantization level has been determined, the method for encoding further comprises a refinement step before entropy encoding the set of image coefficients, wherein the suitable value of the quantization level is modified for at least one segment in the refinement step. Preferably, the suitable value of the quantization level is modified only for a subset of the segments, i.e. only for some segments in the set of segments, and not for all segments in the set of segments. Preferably, the suitable value of the quantization level is decreased for at least one segment in the refinement step. A suitable value of the quantization level according to this embodiment is a value for which the cost of the portion of the encoded image does not exceed the target budget. In the refinement step according to this embodiment, a new budget computation step is performed, in which the quantization level is modified only for some segments or even for a single segment. Therefore, the computation of the cost of the segments must be performed again only for a subset of the segments and not for all segments in the set of segments. Therefore, the refinement step of this embodiment is not equivalent to a binary search, in which the quantization level of all segments may generally be increased or decreased. In addition, the refinement step of this embodiment is an optional optimization of the method for encoding, which offers the advantage of increasing the amount of information kept in the encoded image after quantization of the image coefficients.

[0274] The evaluation of the cost of a segment may be split into two parts: a first part that is easier to compute, i.e. requires a lower computational complexity, and a second part that is more complex to compute, i.e. requires a higher computational complexity. The second part may be seen as an increment, or a complement, of the first part. For instance, the first part may be a lower bound of an actual cost and the second part may be the difference between the actual cost and the lower bound of the first part. In another example, the first part may be an upper bound of an actual cost and the second part may be the difference between the upper bound of the first part and the actual cost.

[0275] In an embodiment, the cost of at least one segment is estimated using a lower bound of the cost of said segment. Computing a lower bound of the cost of a segment may be easier to compute, i.e. require less computational complexity, than computing the actual cost of the segment, as described hereinabove. Therefore, an advantage of this embodiment is to reduce the computational complexity of the budget computation step.

[0276] In an embodiment, the cost of at least one segment is estimated using an upper bound of the cost of said segment. Computing an upper bound of the cost of a segment may be easier to compute, i.e. require less computational complexity, than computing the actualcost of the segment, as described hereinabove. Therefore, an advantage of this embodiment is to reduce the computational complexity of the budget computation step. This embodiment is preferably performed in a refinement step as described hereinabove, wherein the suitable value of the quantization level is decreased for at least one segment in the refinement step.

[0277] In an embodiment, the substep S3)(i) of the method for encoding further comprises reusing a count of the number of significant groups of coefficients computed for a lower value of the quantization level when computing the cost of the current segment for the current value of the quantization level. A significant group of coefficients is a group for which the bitplane count is higher than the quantization level. The coefficients referred to in this embodiment are the coefficients belonging to the current segment. A number of coefficients are grouped together to form a group, for instance by groups of four coefficients as specified in the JPEG XS standard. For the sake of conciseness, a “count of the number of significant groups of coefficients” for a given quantization level value may also be referred to herein as a “significant count” for the quantization level value. This embodiment allows the computational complexity of the computation of the cost of the current segment to be reduced by reusing the previously computed count of the number of significant groups.

[0278] Advantageously, the count of the number of significant groups of coefficients may be stored in a memory in order to be easily reused. In this case, the computation of the cost of the current segment for the current value of the quantization level comprises the following steps: - in a previous substep S3)(i), computing a count of the number of significant groups of coefficients for a lower value of the quantization level; - in a previous substep S3)(i), storing said count in a memory; - in the current substep S3)(i), reusing said count from the memory when computing the cost of the current segment for the current value of the quantization level.

[0279] This embodiment allows reducing the computational complexity of computing the cost of a data segment. Indeed, the significant count SC(t) for a given quantization level value t can be used to compute the cost of a data segment for a higher quantization level value according to the following equations, thereby reducing the computational complexity of computing of the cost of said data segment. The cost, i.e. the number of bits, CDATA(t) of a data segment comprising NCGgroups of coefficients can be computed for a quantization level value t according to the following formula:The significant count SC(t) of said coefficients can be computed for the quantization level value t according to the following formula:The notation 1[…] in the above equation should be interpreted as having a value of one when the Boolean condition in square brackets is true and a value of zero otherwise. Therefore, SC(t) is equal to the number of significant groups, i.e. all groups i for which GCLIi > t. The cost CDATA(t) can be computed for a quantization level value t based on the cost CDATA(t- 1) and the significant count SC(t-1) for a lower quantization level value t-1 according to the following formulas:The idea behind the above formula is that the cost of a data segment CDATA(t) for a quantization level t is equal to the cost of the data segment CDATA(t-1) for a lower quantization level t-1 reduced by a number of bits equal to the number of groups SC(t-1) that were significant for the lower quantization level t-1, multiplied by the number Ng of coefficients in a group. It is generally possible to compute a cost CDATA(t) for an initial quantization level value t larger than zero by applying either the chain of formulas above or directly the following formula:The significant count SC(t) computed during the computation of the cost of a data segment can be reused for computing the cost of a corresponding GCLI segment in the “no prediction” mode, as well as a lower bound and an upper bound of the cost of a corresponding sign segment, thereby reducing the computational complexity of said computations, as detailed hereinbelow.Moreover, if a significant count SC(t) is equal to zero for a quantization level t, the significant count SC(t+1) for a quantization level t+1 will also be equal to zero. This allows the computational complexity of the evaluation of the cost of segments for the quantization level values t and above to be reduced according to the fourth innovative improvement, wherein the cost of segments is evaluated iteratively for increasing values of the quantization level in successive budget computation steps.

[0280] This embodiment also allows reducing the computational complexity of computing the cost of a GCLI segment in the “no prediction” mode. The number of bits of a unary coded GCLIi value in the “no prediction” mode for a quantization level t is equal to max(GCLIi – t + 1, 1). The cost CGCLI,nopred(t) of a segment of unary coded GCLI values in the “no prediction” mode can be computed for a quantization level t based on the cost CGCLI,nopred(t-1) and the significant count SC(t-1) for a lower quantization level t-1 in a similar way as for computing the cost CDATA(t) and according to the following formulas:^0123,456789^1^ = ^0123,456789^0^ − $^^0^^0123,456789^2^ = ^0123,456789^1^ − $^^1^^0123,456789^^^ = ^0123,456789^^ − 1^ − $^^^ − 1^It is generally possible to compute a cost CGCLI,nopred(t) for an initial quantization level value t larger than zero by applying either the chain of formulas above or directly the following formula: ^max^GCLI. − t, 0^ + 1^.

[0281] In an embodiment, the cost CDATA(t) of a data segment comprising NCG groups of Ng coefficients is computed for a quantization level value t according to the following formula, wherein SC(t-1) designates a count of the number of significant groups for a quantization levelvalue t-1:An advantage of this embodiment is to reduce the computational complexity of the computation of the cost CDATA(t). Indeed, starting from a known value of CDATA(t-1), computing SC(t-1) is enough for computing the value of CDATA(t) according to the above formula. In addition, the computed quantity SC(t-1) may advantageously be reused for computing other costs.

[0282] In an embodiment, the cost CGCLI,nopred(t) of a segment of unary coded GCLI values in the “no prediction” mode comprising NCGgroups of Ngcoefficients is computed for a quantization level value t according to the following formula, wherein SC(t-1) designates acount of the number of significant groups for a quantization level value t-1:^0123,456789^^^ = ^0123,456789^^ − 1^ − $^^^ − 1^.An advantage of this embodiment is to reduce the computational complexity of the computation of the cost CGCLI,nopred(t). Indeed, starting from a known value of CGCLI,nopred(t-1), computing SC(t- 1) is enough for computing the value of CGCLI,nopred(t) according to the above formula. In addition, the computed quantity SC(t-1) may advantageously be reused for computing other costs.

[0283] The significant count SC(t) for a given quantization level value t can be used to compute a lower bound and an upper bound of the cost CSIGN(t) of a sign segment accordingto the following formulas:^=30^^^^ ≥ 1 ∗ $^^^^ ^lower bound^;^=30^^^^ ≤ ^^ ∗ $^^^^ ^upper bound^.Indeed, for each significant group there is at least one sign bit and at most a number of sign bits equal to the number Ng of coefficients in a group.

[0284] In an embodiment, a lower bound of the cost CSIGN(t) of a sign segment comprising NCG groups of Ng coefficients is computed for a quantization level value t according to the following formula, wherein SC(t) designates a count of the number of significant groups for aquantization level value t:^=30^^^^ ≥ 1 ∗ $^^^^.An advantage of this embodiment is to reduce the computational complexity of the computation of the lower bound of the cost CSIGN(t). In addition, the computed quantity SC(t) may advantageously be reused for computing other costs.

[0285] In an embodiment, an upper bound of the cost CSIGN(t) of a sign segment comprising NCG groups of Ng coefficients is computed for a quantization level value t according to the following formula, wherein SC(t) designates a count of the number of significant groupsfor a quantization level value t:An advantage of this embodiment is to reduce the computational complexity of the computation of the upper bound of the cost CSIGN(t). In addition, the computed quantity SC(t) may advantageously be reused for computing other costs.

[0286] Generally, computing a lower bound or an upper bound of the cost CSIGN(t) of a sign segment is advantageous because it may allow a given value of the quantization level to be discarded without having to evaluate the actual cost of the sign segment. Indeed, the evaluation of the cost of a sign segment requires a high computational complexity since it requires analyzing the individual value of each coefficient of the segment.

[0287] In an embodiment, the substep S3)(i) of the method for encoding further comprises reusing a cost of a corresponding segment of a different type when computing the cost of the current segment for the current value of the quantization level. This embodiment allows the computational complexity of the computation of the cost of the current segment to be reduced by reusing the previously computed cost of said corresponding segment. For example, the cost of a GCLI segment may be computed based on the cost of a corresponding data segment. In this case, the predetermined order in which segments are evaluated in the budget computation step S3) of the method for encoding may be determined so that at least some data segments are evaluated before corresponding GCLI segments. This allows the computational complexity of the computation of the cost of said corresponding GCLI segments to be reduced by reusing the previously computed cost of said data segments.

[0288] In an embodiment, the cost CGCLI,nopred(t) of a segment of unary coded GCLI values in the “no prediction” mode comprising NCG groups of Ng coefficients is computed for a quantization level value t according to the following formula, wherein CDATA(t) designates the cost of a data segment corresponding to the GCLI segment, i.e. sharing the same subset of coefficients, for the quantization level value t: ^^^^^ ^^^ = ^ ^max^GCLI − t, 0^ + 1^ ^^^^^^^^0123,456789 . =^ + ^10.^ ! " ^An advantage of this embodiment is to reduce the computational complexity of the computation of the cost CGCLI,nopred(t). Indeed, according to the above formula, CGCLI,nopred(t) can be simply and directly computed from a previously computed value CDATA(t).

[0289] In an embodiment, costs that are independent from the value of the quantization level are subtracted from the target budget before running the budget computation step S3). Said costs are also simply referred to herein as “quantization-independent costs”, or “fixed costs”. All quantization-independent costs are taken into account, i.e. subtracted from the target budget, before starting to evaluate the cost of segments, i.e. before running the budget computation step (or steps). Herein, “all quantization-independent costs” means such costs for all segments, and not only for a single segment. This embodiment allows the computational complexity of the budget computation step to be reduced. Indeed, the target budget is reducedthrough the subtraction of the quantization-independent costs, thereby reducing the number of segments whose cost is to be computed in the budget computation step in order to reach the target budget. Quantization-independent cost typically correspond to fixed cost known before running the budget computation step. Here are some examples of quantization-independent costs: - fixed cost of headers, which depends e.g. on the number of (sub)packets, which in turn depends on the encoding profile of the encoded image; - fixed cost of significance flags, which depends e.g. on the width of the original image. Significance flags are flags signaling that a number of consecutive GCLI values are null or that a number of consecutive GCLI prediction residuals are null. Herein, said number is denoted by NSIG. Parameter NSIG designates the number of consecutive GCLI values in a significance group, i.e. corresponding to a single significance flag. For example, parameter NSIG may be equal to eight. According to the JPEG XS standard, significance flags are packed in a significance subpacket. In particular, the cost of a significance subpacket does not depend on the value of a quantization level. Significance flags and significance subpackets have thus a fixed cost. A significance flag may also be referred to as a “run mode” flag.

[0290] In particular, the cost CGCLI,nopred_sig(t) of a segment of unary coded GCLI values in the “no prediction” mode when significance flags are activated may be computed as detailed hereinbelow. In the cases below, it is considered that a significance flag indicates whether or not a group of NSIG consecutive GCLI values are significant. The function NonSigRunGroups(t) indicates the number of non-significant groups of NSIG consecutive GCLI values for a quantization level value t. Therefore, the cost CGCLI,nopred_sig(t) may be computed according to the following formula, wherein the term “NCG / NSIG” is a fixed cost of the significance flags:

[0291] Herein, a “variable cost” is a cost that depends on, or varies with, a quantization level value. In other words, the variable cost of a segment is the total cost of the segment from which the fixed costs, or in other words the quantization-independent costs, have been subtracted. For example, the variable cost C*GCLI,nopred_sig(t) of a segment of unary coded GCLI values in the “no prediction” mode when significance flags are activated may be computed from the total cost CGCLI,nopred_sig(t) of said segment according to the following formula:

[0292] In an embodiment, when the cost of a data segment is null, the computation of the cost of the corresponding GCLI and sign segments is skipped in the budget computation step. The cost of a data segment is null for a quantization level t when all groups in the segment are non-significant, i.e. when the GCLI value of each group in the segment is not higher than the quantization level t. In this case, the cost of the corresponding GCLI segment is minimal, for example Ngbits in the “RAW” mode and one bit in the “no prediction” or “vertical prediction” modes, and the cost of the corresponding sign segment is null. Therefore, in this case, the cost of the corresponding GCLI and sign segments are known a priori and thus need not be computed in the budget computation step, thereby reducing the computational complexity of the budget computation step.

[0293] In an embodiment, coefficients from non-significant groups are not read from memory when computing the cost of a sign segment in the budget computation step. Indeed, said coefficients are known to be null after quantization and therefore their sign will not be packed in the codestream. It is only required to read the GCLI value of said groups to know that they are not significant, thereby reducing the computational complexity of the computation.

[0294] Generally, it is advantageous to read GCLI values rather than coefficients from memory when computing the cost of a segment. Indeed, reading only a GCLI from memory rather than the coefficients of the group corresponding to the GCLI reduces the number of bits read from memory. As an example, let us consider a GCLI coded on 4 bits and covering a group of 4 coefficients, each coefficient being coded on 16 bits. Reading the GCLI instead of the 4 coefficients of 16 bits each therefore reduces the number of bits read from memory by a factor of (4*16) / 4 = 16. Note that this factor may vary depending on the number of coefficients comprised in a group corresponding to a GCLI as well as on the number of bits needed to code a GCLI and a coefficient. Values in the above example correspond to a typical case, in particular to a case as specified in the JPEG XS standard.

[0295] In an embodiment, the method for encoding operates according to a constant data rate encoding scheme. In this embodiment, the target budget is identical for all portions of the encoded image.

[0296] Herein, a “compression ratio” designates a ratio of the size of the original image divided by the size of the encoded image. For instance, if the encoded image is half the size of the original image, the compression ratio is equal to two.

[0297] In an embodiment, the method for encoding operates according to a compression ratio of at least two. Therefore, in this embodiment, the size of the encoded image is at most half the size of the original image.

[0298] According to a second aspect of the fourth innovative improvement, there is provided a computer program comprising instructions which, when the program is executed by a computer, cause the computer to carry out a method for encoding according to the fourth innovative improvement.

[0299] In an embodiment, there is provided a non-transitory recording medium having recorded therein a computer program that causes a processor to execute a method for encoding according to the fourth innovative improvement.

[0300] According to a third aspect of the fourth innovative improvement, there is provided an encoder comprising a processor and a memory and configured for encoding at least one portion of an original image into a corresponding portion of an encoded image according to the method for encoding.

[0301] All the possible embodiments and advantages of the first aspect of the fourth innovative improvement apply mutatis mutandis to other aspects of the fourth innovative improvement. Brief description of the figures

[0302] For a better understanding of the present invention, reference will now be made, by way of example, to the accompanying drawings. Figures 1 to 5 relate to the first innovative improvement: - Fig.1 schematically represents coefficients in an input data set before encoding by the method for encoding; - Fig.2 schematically represents a set of buffers after an accumulation step of the method for encoding; - Fig.3 schematically represents the set of buffers of Fig.2 after a further accumulation step of the method for encoding; - Fig.4 schematically represents a packed data set obtained by the method for encoding, where bits of coefficients are interleaved; - Fig.5 displays test results for the encoding of a sequence of coefficients according to the prior art and according to an embodiment. Figures 6 to 11 relate to the second innovative improvement: - Fig.6 schematically represents an encoder for encoding an image; - Fig.7 schematically represents a decoder for decoding an encoded image; - Fig.8 is a schematic representation of a lifting scheme implementation of a wavelet- type filter operation of the LeGall 5 / 3 type in a forward way;- Fig.9 is a schematic representation of a lifting scheme implementation of a wavelet- type filter operation of the LeGall 5 / 3 type in an inverse way; - Fig.10 illustrates a decoding of an encoded image according to the prior art, i.e. in several stages; - Fig.11 illustrates a decoding of an encoded image according to an embodiment, i.e. in a single stage. Figures 12 to 16 relate to the third innovative improvement: - Fig.12 schematically represents an encoder for encoding an image; - Fig.13 schematically represents a decoder for decoding an encoded image; - Fig.14 is a schematic representation of a lifting scheme implementation of a wavelet- type filter operation of the LeGall 5 / 3 type in a forward way; - Fig.15 is a schematic representation of a lifting scheme implementation of a wavelet- type filter operation of the LeGall 5 / 3 type in an inverse way; - Fig.16 schematically represents a decomposition of an image into subbands in a cascade of wavelet-type filter operations. Figures 17 to 21 relate to the fourth innovative improvement: - Fig.17 illustrates a wavelet transform of an image with exemplary two vertical and five horizontal decompositions; - Fig.18 illustrates an organization of image coefficients into precincts; - Fig.19 illustrates a principle of GCLI encoding of a group of image coefficients; - Fig.20 illustrates the determination of a quantization level according to an embodiment; - Fig.21 schematically represents an encoder according to an embodiment. Figures 22 to 36 relate to preferred use cases or embodiments of the invention: - Fig.22 schematically represents an encoder according to an embodiment; - Fig.23 schematically represents a decoder according to an embodiment; - Figures 24 to 27 display the number of samples comprised in an image for different image formats and images sizes; - Figures 28 to 31 display the number of samples per second for different image formats and sizes in a sequence of images; - Fig.32 displays the size in bytes of a line of an uncompressed image for different image formats; - Fig.33 displays test results of an encoder and a decoder according to an embodiment of the invention vs. an encoder and a decoder of the prior art;- Figures 34 and 35 respectively display test results of an encoder and a decoder according to an embodiment of the invention for different image sizes and formats; - Fig.36 displays test results illustrating the scaling of encoding and decoding performance with the number of execution threads.

[0303] The figures are not drawn to scale. Generally, identical or analogous elements are denoted by the same reference numerals or letters in the figures. Detailed description of some embodiments

[0304] The present invention will be described with respect to particular embodiments and with reference to certain drawings but the invention is not limited thereto. The described functions are not limited by the described structures. The described drawings are only schematic and are non-limiting. In the drawings, the size of some of the elements may be exaggerated and not drawn to scale for illustrative purposes.

[0305] Use of the verb “to comprise”, as well as the respective variants and conjugations, does not exclude the presence of elements other than those stated. Use of the article “a”, “an” or “the” preceding an element does not exclude the presence of a plurality of such elements.

[0306] The terms “first”, “second”, “third” and the like, in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a sequential or chronological order. The terms are interchangeable under appropriate circumstances and the embodiments described herein can operate in other sequences than those described or illustrated herein.

[0307] Furthermore, embodiments referred to as “preferred” are to be construed as exemplary manners in which the invention may be implemented rather than as limiting the scope of the invention. First innovative improvement

[0308] In this section, the “method for encoding” relates to the method for encoding according to the first innovative improvement, unless otherwise specified. Similarly, in this section, the “method for decoding” relates to the method for decoding according to the first innovative improvement, unless otherwise specified.

[0309] Fig.1 to Fig.4 illustrate an application of the method for encoding. In the figures, coefficients are referred to with two-digit reference signs (10 to 43), and individual bits of coefficients are referred to with three-digit reference signs (100-434) that are consistent throughout the figures, i.e. the same reference sign may be interpreted as referring to the sameelement, for example the same bit, throughout the figures. In addition, the first two digits of the reference sign of a bit refer to the coefficient that said bits belong to. For example, bits 100, 101, 102, and 103 all belong to coefficient 10. Finally, the last digit in a reference sign of a bit indicates the significance of said bit, a lower digit indicating a higher significance. Therefore, bit 100 is the most significant bit to be packed of coefficient 10, and bit 103 is the least significant bit to be packed of coefficient 10.

[0310] In this example application of the method for encoding, each coefficient has a size of NS = 8 bits, each group (G1 to G4) has a size of Ng = 4 coefficients, and each buffer (B1 to B8) has a size of K = 16 bits. These values have been chosen for the sake of conciseness and legibility of the figures, and should not be construed as limiting the scope of the invention. Other values are possible, for instance coefficients with a size of 16 bits each and buffers with a size of 64 bits each.

[0311] Fig.1 schematically represents coefficients in an input data set before encoding by the method for encoding. The input data set comprises 16 coefficients represented by thick- bordered rectangles. Said coefficients are grouped in 4 groups of 4 coefficients each, with the first digit of the reference sign of a coefficient corresponding to its group number, and the second digit corresponding to its position within its group: - group G1 comprises coefficients 10, 11, 12, and 13; - group G2 comprises coefficients 20, 21, 22, and 23; - group G3 comprises coefficients 30, 31, 32, and 33; - group G4 comprises coefficients 40, 41, 42, and 43. Each coefficient comprises 8 bits represented by as many rectangles. A pattern-filled rectangle represents a bit to be packed and is referred to with a three-digit reference sign (100-434). Most significant bits of each coefficient are aligned on the left of the coefficients, for instance bits 100, 110, 120, and 130 for coefficients 10, 11, 12, and 13 in group G1, respectively. Blank rectangles represent bits not to be packed. The bitplane counts for groups G1 to G4 are therefore the following: - group G1 has a bitplane count equal to 4; - group G2 has a bitplane count equal to 3; - group G3 has a bitplane count equal to 6; - group G4 has a bitplane count equal to 5. The bitplane counts specify the number of bitplanes to be packed for each group. Thus, a total of 4*(4 + 3 + 6 + 5) = 72 bits are to be packed in the packed data set in this example of application of the method for encoding.

[0312] Fig.2 schematically represents a set of buffers B1, B2, B3, and B4 after an accumulation step of the method for encoding. Each buffer has a size of K = 16 bits. There are as many buffers as the number Ngof coefficients in a group, i.e.4, each buffer corresponding to a position in a group. Therefore, bits of the following coefficients are to be packed in the following buffers: - bits of coefficients 10, 20, 30, and 40 in buffer B1; - bits of coefficients 11, 21, 31, and 41 in buffer B2; - bits of coefficients 12, 22, 32, and 42 in buffer B3; - bits of coefficients 13, 23, 33, and 43 in buffer B4. Fig.2 represents bits comprised in the buffers after coefficients from groups G1 and G2 have been accumulated in said buffers. A pattern-filled rectangle represents a bit accumulated in a buffer, with patterns and reference signs being consistent with those in Fig.1. Blank rectangles represent empty buffer spaces. Buffers are filled starting from the left, i.e. by adding each new bit in the left-most empty space successively.

[0313] Fig.3 schematically represents the set of buffers of Fig.2 after coefficients from groups G3 and G4 have been further accumulated in said buffers. Given that the total number of bits to accumulate in each buffer, i.e.18 bits, exceeds the buffer size of 16 bits, there are two excess bits for each buffer B1 to B4, which cannot fit in said buffers. Said excess bits may be for instance accumulated in a new set of buffers B5 to B8, as represented in Fig.3. Other ways of dealing with excess bits are possible. Buffers B1 to B4 being full, bits comprised therein may be interleaved in order to produce the output data set.

[0314] Fig.4 schematically represents a packed data set obtained by the method for encoding, where bits 100-434 of coefficients 10-43 are interleaved. The packed data set is formed by four arrays P1, P2, P3, and P4. Arrays P1 and P2 comprise interleaved bits from buffers B1 to B4, while arrays P3 and P4 comprise interleaved bits from buffers B5 to B8. The interleaving of bits from a set of buffers is performed as described hereinabove, i.e. by taking one bit from each buffer of the set successively until all bits from all buffers of the set have been taken. A pattern-filled rectangle represents a bit in an array of the packed data set, with patterns and reference signs being consistent with those in Fig.1, Fig.2, and Fig.3. Blank rectangles represent empty spaces in an array of the packed data set. The representation of the packed data set with the four arrays P1, P2, P3, and P4 is arbitrary and should not be construed as limiting the scope of the invention. Other representations of the packed data set are possible, for instance as one large array formed by merging arrays P1, P2, P3, and P4. The packed data set may also be viewed as a stream of bits, in which case the left-most bit100 of array P1 may be considered as the first bit of the stream, bits being streamed from left to right positions in array P1, then the same in array P2, P3, and P4, successively. In such a case, bit 434 may be considered as the last bit of the stream, the subsequent spaces in arrays P3 and P4 being empty.

[0315] Besides, the packed data set represented in Fig. 4, considered as a data subpacket, is compliant with the JPEG XS standard, according to the requirements 1) to 3) set forth hereinabove, as shown hereinafter.

[0316] Requirement 1) specifies that the order of the coefficients within a group is preserved in bitplanes packed into the data subpacket. This is indeed the case for the packed data set of Fig.4, wherein for instance bits 100, 110, 120, and 130 form a bitplane of the most significant bits of coefficients 10, 11, 12, and 13 of group G1, said bits being packed in the packed data set in the same order as the coefficients of the group they belong to.

[0317] Requirement 2) specifies that the order of bitplanes is preserved in the data subpacket, i.e. bitplanes of a group of coefficients are packed in the data subpacket by decreasing significance, starting with the most significant bitplane to be packed until the least significant bitplane to be packed. This is indeed the case for the packed data set of Fig.4, wherein bits of same significance, i.e. same last digit in the reference sign, are packed consecutively, starting with the most significant bit. For instance, bitplanes of the coefficients of group G2 are packed in the following order, wherein bits of same significance and thereby forming a bitplane are grouped with parentheses: (200, 210, 220, 230), (201, 211, 221, 231), (202, 212, 222, 232).

[0318] Requirement 3) specifies that the order of the groups of coefficients in the sequence of groups is preserved in the data subpacket. This is indeed the case for the packed data set of Fig.4, wherein bits 100-133 of coefficients of group G1 are packed before bits 200- 232 of coefficients of group G2.

[0319] An application of the method for encoding has been illustrated hereinabove with reference to Fig.1 to Fig.4, with Fig.1 illustrating coefficients in an input data set before the application of the method for encoding, and Fig.4 illustrating a packed data obtained after the application of the method for encoding.

[0320] An application of the method for decoding may be illustrated in a similar manner, the method for decoding working in an opposite way as the method for encoding. In such a case, Fig.4 would illustrate a packed data set before the application of the method for decoding, and Fig.1 would illustrate coefficients in an output data set obtained after the application of the method for decoding.

[0321] Two computer code examples are described below. These examples are written in the C programming language. These two codes are for Ng= 2 and NS= 16. The first code example illustrates how a sequence of coefficients of NSbits may be encoded into a packed data set according to the prior art, for example as disclosed in the reference implementation of the JPEG XS standard. In this code example illustrating the prior art, bits are added one by one to the packed data set. In other words, the encoding iterates over each bit of each coefficient sequentially. Code example 1 (prior art) / ** * Prior art implementation for encoding a sequence of coefficients * into a packed data set * @param[in] coeffs An array of `num_groups * 2` 16-bit * coefficients * @param[in] num_bits An array of `num_groups` bitplane counts * @param[out] out A large-enough byte array which will * contain the packed data set * @param num_groups The number of groups of 2 coefficients * @return The number of bits written in the packed * data set ** / size_t bit_interleave_prior_art( const uint16_t* restrict coeffs, const uint8_t* restrict num_bits, uint8_t* restrict out, size_t num_groups) { size_t out_index = 0; / / index of current byte in output unsigned out_bit_offset = 0; / / bit offset in output byte / / Iterate over groups of coefficients for (size_t g = 0; g < num_groups; g++) { const uint16_t a = coeffs[2 * g]; const uint16_t b = coeffs[2 * g + 1]; / / Iterate over each bit individuallyfor (int i = 0; i < num_bits[g]; i++) { / / Clear new bytes. This can be omitted if output / / memory is set to zero (i.e. reset) beforehand if (out_bit_offset == 0) { out[out_index] = 0; } / / Extract ith bit of even and odd coeff (a and b) / / ith bit of even coeff is inserted at out_bit_offset / / ith bit of odd coeff is inserted at out_bit_offset+1 out[out_index] |= ( (a >> i & 1) | ((b >> i & 1) << 1) ) << out_bit_offset; / / Increment out_bit_offset by the nbr. of bits inserted out_bit_offset += 2; / / Go to next byte when current byte is full if (out_bit_offset == 8) { out_bit_offset = 0; out_index++; } } } / / Return the number of bits written return 8 * out_index + out_bit_offset; }

[0322] The second code example illustrates how a sequence of coefficients of NS bits may be encoded into a packed data set according to the method for encoding disclosed herein. In other words, the second code example is an embodiment of the method for encoding. In this second code example, an interleaving function “bit_interleave_u64” is provided. This interleaving function is an example implementation of the interleaving operation performed in step E6) of the method for encoding. The interleaving function makes explicit use of specialized bit manipulation instructions (such as the PDEP instruction) if the target platform supports the BMI2 instruction set. In addition, the interleaving function makes explicit use of SIMDinstructions (such as the VMUL.P8 instruction) if the target platform supports the NEON instruction set. Otherwise, i.e. if the target platform does not support the BMI2 instruction set nor the NEON instruction set, the interleaving function uses the “divide and conquer” principle for interleaving the bits, with a complexity of O(log(n)), where n is the number of bits to be interleaved. In all cases, the second code example uses the SWAR technique for appending two coefficients to a register containing both accumulation buffers in a single instruction. Code example 2 (embodiment of the method for encoding) / ** * Bitwise interleaving of low 32-bit half with high 32-bit half * of a 64-bit element * @param x Accumulation buffers for even and odd coefficients, * respectively in its low and high half * @return A 64-bit bitwise interleaving of the low and high * halves of `x` * / uint64_t bit_interleave_u64(uint64_t x) { #if defined(__BMI2__) / **** Use PDEP instruction from BMI2 **** / return _pdep_u64(x, 0x5555555555555555ULL) | _pdep_u64(x >> 32, 0xAAAAAAAAAAAAAAAAULL); #elif defined(__ARM_NEON) / **** Use NEON SIMD instructions **** / / * Create a 128-bit vector `v`. The low 64-bit half of `v` is * `x` and the high 64-bit half of `v` is the 4 MSBs of each * byte of `x` shifted to the right by 4 bits * / poly8x16_t v = vreinterpretq_p8_u64(vcombine_u64( vcreate_u64(x), vcreate_u64(x >> 4) )); / * Perform bit-wise interleaving of the 4 LSBs of each byte * of `v` with zeroes using polynomial multiplication. * / uint8x16_t nib_inter = vreinterpretq_u8_p8(vmulq_p8(p, p)); / * Re-interleave bytes of the low and high half of `nib_inter`.* `coeff_bits` is an array of two 64-bit elements: * - coeff_bits.val[0] contains a byte-wise interleaving of the * first quarter of `nib_inter` with the third quarter of * `nib_inter`. In other words, it contains a 64-bit bit-wise * interleaving of the low 32-bit half of `x` with zeroes. * - coeff_bits.val[1] contains a byte-wise interleaving of the * second quarter of `nib_inter` with the fourth quarter of * `nib_inter`. In other words, it contains a 64-bit bit-wise * interleaving of the high 32-bit half of `x` with zeroes. * / uint8x8x2_t coeff_bits = vzip_u8( vget_low_u8(nib_inter), vget_high_u8(nib_inter) ); / / coeff_bits.val[1] << 1 | coeff_bits.val[1] uint8x8_t res = vorr_u8( vshl_n_u8(coeff_bits.val[1], 1), coeff_bits.val[0] ); return vget_lane_u64(vreinterpret_u64_u8(res), 0); #else / **** Use regular instructions (divide and conquer) **** / uint64_t l = x & 0xFFFFFFFFULL; uint64_t h = x & 0xFFFFFFFF00000000ULL; l = (l | l << 16) & 0xFFFF0000FFFFULL; h = (h | h >> 16) & 0xFFFF0000FFFF0000ULL; l = (l | l << 8) & 0xFF00FF00FF00FFULL; h = (h | h >> 8) & 0xFF00FF00FF00FF00ULL; l = (l | l << 4) & 0xF0F0F0F0F0F0F0FULL; h = (h | h >> 4) & 0xF0F0F0F0F0F0F0F0ULL; l = (l | l << 2) & 0x3333333333333333ULL; h = (h | h >> 2) & 0xCCCCCCCCCCCCCCCCULL; l = (l | l << 1) & 0x5555555555555555ULL; h = (h | h >> 1) & 0xAAAAAAAAAAAAAAAAULL; return l | h; #endif } / ** * Encoding of a sequence of coefficients into a packed data set * @param[in] coeffs An array of `Ncg * 2` 16-bit coefficients. * The highest set bit in a coefficient of a * group may not be higher than the * bitplane count of said group. * @param[in] num_bits An array of `Ncg` bitplane counts * @param[out] out A large-enough byte array which will contain * the packed data set * @param num_groups The number of groups of 2 coefficients Ncg * @return The number of bits written in the packed * data set ** / size_t bit_interleave( const uint16_t* restrict coeffs, const uint8_t* restrict num_bits, uint8_t* restrict out, size_t num_groups) { / / constants for masking SWAR shift overflows and underflows const uint64_t mask_overflow = UINT64_C(0xFFFF0000FFFF0000); const uint64_t mask_underflow = UINT64_C(0xFFFF0000FFFF); size_t out_index = 0; / / index of current byte in output / * `accum` contains the two accumulation buffers in a single * general-purpose register. The low 32-bit half contains * the even coefficient's bit buffer, the high 32-bit half * contains the odd coefficient's bit buffer. * `accum_bit_offset` contains the number of bits in each * buffer * / uint64_t accum = 0; int accum_bit_offset = 0; / / Iterate over groups of coefficients for (size_t g = 0; g < num_groups; g++) { uint16_t a = coeffs[2 * g]; uint16_t b = coeffs[2 * g + 1]; / * Create `tmp` with coefficients in its low and high half, * like `accum` would if `accum_bit_offset` was zero * / uint64_t tmp = a | (uint64_t) b << 32; / / Check if there is enough space to append all bits if (accum_bit_offset + num_bits[g] < 32) { / * Append coefficients' bits to both buffers at once. * Hence, this accumulation is performed using SWAR * / accum |= tmp << accum_bit_offset; / / accumulate accum_bit_offset += num_bits[g]; } else { / * Accumulation below (still using SWAR) will fill * buffers. Since the shift is applied on the whole * register and not on 32-bit data elements like it * would be with a SIMD operation, we have to mask out * overflowing bits that may be shifted from the low * half to the high half. * / accum |= tmp << accum_bit_offset & mask_overflow; / * Perform bitwise interleaving of the buffers. Since * buffers now contain 32 bits of data and a bitplane * count is at most 16=Ns, the buffers contain bits * from at least two coefficients. * / uint64_t interleaved = bit_interleave_u64(accum); / / Store the resulting bytes for (int shift = 0; shift < 64; shift += 8) { out[out_index++] = (uint8_t) (interleaved >> shift); } / / Reset the buffer content to the leftover bits accum = tmp >> (32 - accum_bit_offset) & mask_underflow; accum_bit_offset = accum_bit_offset + num_bits[g] - 32; } } / / Perform bitwise interleaving of the buffers uint64_t interleaved = bit_interleave_u64(accum); / / Store the resulting bytes for (int shift = 0; shift < 2 * accum_bit_offset; shift += 8) { out[out_index++] = (uint8_t) (interleaved >> shift); } / / Compute and return the number of bits written size_t padding = ((32 - accum_bit_offset) & 3) * 2; return 8 * out_index - padding; }

[0323] Table 1 provides test results for the encoding of a sequence of coefficients according to both code examples provided hereinabove. These test results are also represented in Fig.5. Reference signs are indicated in parentheses in Fig.5 to avoid confusing them with numerical results. Tests were run on platforms 501-506 listed in Table 1 in the following conditions: - (510) example implementation of the prior art, i.e. according to code example 1; - (511) embodiment of the method for encoding, i.e. according to code example 2, with no further optimization, i.e. with no BMI2 nor NEON instructions sets; in other words, in this condition the “divide and conquer” principle was used in the interleaving function “bit_interleave_u64”; - (512) embodiment of the method for encoding, i.e. according to code example 2, with optimized interleaving leveraging the BMI2 or NEON instruction set depending on the instruction set architecture (ISA) of the platform 501-506; on platforms 501-503 with x86-64 ISA, the interleaving was optimized with instructions from the BMI2 instruction set, such as the PDEP instruction; on platforms 504-506 with ARM64 ISA, the interleaving was optimized with instructions from the NEON instruction set, such as the VMUL.P8 instruction. The performance of the different tests (indicated by reference sign 520) is provided in arbitrary units, wherein a lower value denotes a shorter encoding time. Therefore, a lower value corresponds to a better performance of the encoding. Fig.5 shows that the method for encoding has a better performance than the prior art (condition 510), i.e. a shorter encoding time, in both conditions 511 and 512. In addition, the use of SIMD instructions or specialized bit manipulation instructions in condition 512 allows the encoding to be further improved as compared to condition 511. In other words, the computational efficiency of the method forencoding may be further improved by using processor instructions processing (or acting on) a plurality of bits simultaneously (or in parallel), such as SIMD instructions or specialized bit manipulation instructions. Finally, the rightmost column of Table 1 (“Speedup”) indicates the relative increase of performance (i.e. decreasing in encoding time expressed in arbitrary units) of the respective conditions 511 and 512 compared to the prior art condition 510.Table 1 – Performance of an embodiment of the method for encoding (according to code example 2) compared to an example implementation of the prior art (according to code example 1). Reference signs in parentheses correspond to Fig.5. “ISA” stands for “Instruction Set Architecture”. Platforms ISA Conditions Performance Speedup (520) Intel Xeon W-2133 x86-64 (510) prior art 5274 - (501) (511) method for encoding 2518 2.09 (512) method for encoding 1862 2.83 with BMI2 interleaving Intel Core i7-8705G x86-64 (510) prior art 4994 - (502) (511) method for encoding 2403 2.08 (512) method for encoding 1788 2.79 with BMI2 interleaving Intel Core i9-13900K x86-64 (510) prior art 2340 - (503) (511) method for encoding 1112 2.10 (512) method for encoding 782 2.99 with BMI2 interleaving Jetson AGX Xavier ARM64 (510) prior art 16929 - (504) (511) method for encoding 2771 6.11 (512) method for encoding 2709 6.25 with NEON interleaving Rockchip RK3588 ARM64 (510) prior art 11394 - (505) (511) method for encoding 3926 2.90 (512) method for encoding 3571 3.19 with NEON interleaving Apple M1 ARM64 (510) prior art 3633 - (506) (511) method for encoding 1428 2.54 (512) method for encoding 1207 3.01 with NEON interleaving

[0324] In summary, the first innovative improvement relates to a method for encoding an input data set comprising a sequence of coefficients into a packed data set, said method for encoding comprising a step of grouping the coefficients into groups of coefficients, a step of accumulating a number of bits of said groups into a set of buffers so as to form an array of bits in each buffer, and a step of interleaving said arrays. The first innovative improvement also relates to an apparatus and a computer program for encoding an input data set comprising a sequence of coefficients into a packed data set, and to a method, apparatus, and computer program for decoding a packed data set obtainable by the method for encoding into an output data set. Second innovative improvement

[0325] In this section, the “method for decoding” relates to the method for decoding according to the second innovative improvement, unless otherwise specified.

[0326] Fig.6 schematically represents an encoder 1100 for encoding an image 1101. Fig.6 provides a block diagram of the encoder 1100. The encoder 1100 may be configured for performing the steps allowing to obtain an encoded image according to the second innovative improvement. The encoder 1100 comprises a decorrelative transform module 1102 and an entropy coding module 1103. The encoder 1100 operates as follows. The encoder 1100 receives an image 1101 and applies at least one decorrelative transform on image samples from said image 1101 in order to reduce the correlation of said image samples. Such a decorrelative transform may be for instance a reversible color transform (RCT), a temporal decorrelative transform based on interframe predictions, a discrete cosine transform (DCT), or a discrete wavelet transform (DWT). The entropy coding module 1103 then receives decorrelated image samples from the decorrelative transform module 1102 and performs rate allocation and entropy coding of said decorrelated image samples. Finally, the entropy coding module 1103 packs the entropy-coded samples so as to produce an encoded image 1104.

[0327] Fig.7 schematically represents a decoder 1200 for decoding an encoded image 1201. Fig.7 provides a block diagram of the decoder 1200. The decoder 1200 may be configured for performing the method for decoding. The decoder 1200 comprises an entropy decoding module 1202 and an inverse decorrelative transform module 1203. The decoder 1200 operates as follows. The decoder 1200 receives an encoded image 1201 and performs entropy decoding of said encoded image 1201. The inverse decorrelative transform module 1203 then receives entropy decoded coefficients from the entropy decoding module 1202 and applies at least one inverse decorrelative transform on said entropy decoded coefficients forreconstructing a decoded image 1204. The encoded image 1201 of Fig.7 may correspond to the encoded image 1104 of Fig.6. The decoded image 1204 may correspond to the image 1101 of Fig.6 after an encoding and a decoding.

[0328] Fig.8 is a schematic representation of a lifting scheme implementation 1300 of a wavelet-type filter operation of the LeGall 5 / 3 type in a forward way. For the sake of conciseness, the wavelet-type filter operation of the LeGall 5 / 3 type in a forward way is hereinafter referred to as “FDWT 5 / 3 filtering”. Said FDWT 5 / 3 filtering comprises a so-called “prediction step” producing high-frequency (HF) outputs and a so-called “update step” producing low-frequency (LF) outputs. Said steps are computed according to the following equations:The FDWT 5 / 3 filtering operation is applied to a series of even and odd input samples, which are represented as an upper row of circles in Fig.8, said row being denoted as “IN”. Black circles in the IN row of Fig.8 represent odd input samples, for which a high-frequency output is computed according to the HF equation above and as represented in a middle row of circles in Fig.8, said row being denoted as “HF”. White circles in the IN row of Fig.8 represent even input samples, for which a low-frequency output is computed according to the LF equation above and as represented in a lower row of circles in Fig.8, said row being denoted as “LF”. Numbers next to arrows in Fig.8 represent weighting factors according to the HF and LF equations above. Dashed arrows in Fig.8 indicate that the series of input and output samples may comprise additional samples not represented in Fig.8. Horizontal dashed lines highlight the respective upper, middle, and lower rows of Fig.8.

[0329] Fig.9 is a schematic representation of a lifting scheme implementation 1400 of a wavelet-type filter operation of the LeGall 5 / 3 type in an inverse way. For the sake of conciseness, the wavelet-type filter operation of the LeGall 5 / 3 type in an inverse way is hereinafter referred to as “IDWT 5 / 3 filtering”. Said IDWT 5 / 3 filtering reverses the HF and LF equations of the FDWT 5 / 3 filtering according to the following equations:The IDWT 5 / 3 filtering is applied on high-frequency and low-frequency output samples produced by a FDWT 5 / 3 filtering, which are represented as an upper row of circles in Fig.9, said row being denoted as “IN”. White circles in the IN row of Fig.9 represent low-frequency samples, for which an even output is computed according to the EVEN equation above andas represented in a middle row of circles in Fig.9, said row being denoted as “EVEN”. Black circles in the IN row of Fig.9 represent high-frequency samples, for which an odd output is computed according to the ODD equation above and as represented in a lower row of circles in Fig.9, said row being denoted as “ODD”. Numbers next to arrows in Fig.9 represent weighting factors according to the EVEN and ODD equations above. Dashed arrows in Fig.9 indicate that the series of input and output samples may comprise additional samples not represented in Fig.9. Horizontal dashed lines highlight the respective upper, middle, and lower rows of Fig.9.

[0330] Fig.10 illustrates a decoding of an encoded image according to the prior art, i.e. in several stages. Fig.10 illustrates said decoding in a case where slices contain 4 precincts of 4 lines each, so that each slice contains 16 lines, and where a cascade of inverse wavelet- type filter operations is applied, said cascade comprising two inverse wavelet-type filter operations of the LeGall 5 / 3 type in the vertical direction. The decoding performed in said case is compatible with a decoding performed according to the JPEG XS standard.

[0331] Each large rectangle in Fig.10 such as rectangles 1501-1506 represents a precinct. Precincts are represented in rows indicating their progressive decoding from left to right in Fig.10, each row corresponding to a precinct represented at different stages of its decoding, the precincts represented furthest to the right in Fig.10 being completely decoded, or reconstructed, precincts. Said precincts are comprised in slices 1510, 1511, and 1512. The decoding represented in Fig.10 reconstructs spatial image samples comprised in slice 1511 in several stages 1520, 1521, and 1522. Vertical dashed lines 1530 and 1531 represent synchronization points between said stages. Fig.10 particularly illustrates the decoding, or reconstruction, of the first two lines 1566, 1567 and the last two lines 1576, 1577 of the slice 1511.

[0332] Stage 1520 may reverse previous wavelet-type filter operations, such as wavelet- type filter operations applied in the horizontal direction (not represented in Fig.10). Said stage 1520 may also perform other operations.

[0333] Stage 1521 reverses a first wavelet-type filter operation of the LeGall 5 / 3 type in the vertical direction according to the lifting scheme 1400 of Fig.9. First, half a line of even samples 1546 is reconstructed based on samples comprised in half-lines 1541-1543. Then, half a line of odd samples 1547 is reconstructed based on samples comprised in half-lines 1541-1545. Indeed, as shown in Fig.9, an even sample is reconstructed from 3 samples; for example, even sample s0iin Fig.9 is reconstructed from samples d1i-1, s1i, and d1i. In addition,as also shown in Fig.9, an odd sample is reconstructed from 5 samples; for example, odd sample d0iis reconstructed from samples d1i-1, s1i, d1i, s1i+1, and d1i+1.

[0334] Samples s1in Fig.9 correspond to low-frequency samples, denoted as “LF” in Fig.10, and samples d1in Fig.9 correspond to high-frequency samples, denoted as “HF” in Fig.10. In the same way, samples s0in Fig.9 correspond to even samples, denoted as “Even” in Fig.10, and samples d0in Fig.9 correspond to odd samples, denoted as “Odd” in Fig.10.

[0335] In the same way as described hereinabove regarding half-lines 1546 and 1547, half a line of even samples 1556 is reconstructed based on samples comprised in half-lines 1551-1553, and half a line of odd samples 1557 is reconstructed based on samples comprised in half-lines 1551-1555.

[0336] It can therefore be seen that stage 1521 works based on samples produced by stage 1520 and comprised in precincts from slice 1511 but also from slices 1510 and 1512 adjacent to slice 1511. Thus, the decoding of half-line 1546 requires samples from slice 1510, and the decoding of half-line 1557 requires samples from slice 1512. Assuming that the respective slices are decoded in respective processing channels, i.e. each slice is decoded in a dedicated processing channel, a synchronization point 1530 is therefore required between stages 1520 and 1521 in order to ensure that samples included in said adjacent slices 1510 and 1512 are available when decoding samples from slice 1511.

[0337] Finally, stage 1521 reverses wavelet-type filter operations applied in the horizontal direction (not represented in Fig.10), such that half-line 1546 corresponds to line 1562, and half-line 1547 corresponds to line 1564. Similarly, half-line 1557 corresponds to line 1572.

[0338] Stage 1522 works in the same way as stage 1521 and reverses a second wavelet- type filter operation of the LeGall 5 / 3 type in the vertical direction according to the lifting scheme 1400 of Fig.9. First, a line of even samples 1566 is reconstructed based on samples comprised in lines 1561-1563. Then, a line of odd samples 1567 is reconstructed based on samples comprised in lines 1561-1565. Similarly, a line of even samples 1576 is reconstructed based on samples comprised in lines 1571-1573, and a line of odd samples 1577 is reconstructed based on samples comprised in lines 1571-1575.

[0339] In the same way as a synchronization point 1530 is required between stages 1520 and 1521 because samples from adjacent slices 1510 and 1512 are needed to reconstruct some samples of slice 1511, a synchronization point 1531 is required between stages 1521 and 1522 because samples from adjacent slices 1510 and 1512 are needed to reconstruct some samples of slice 1511, namely samples from line 1561 to reconstruct line 1566 and samples from lines 1574 and 1575 to reconstruct line 1577.

[0340] As expressed hereinabove, these synchronization points 1530 and 1531 may have a negative impact on sample decoding performance, due to the waiting times they may cause, during which processing channels are idle and therefore do not compute, as well as the cache misses they may cause, said cache misses stemming from the fact that not all the data needed to reconstruct the samples of a slice are processed in the same processing channel, so that these data may have to be retrieved from the memory of one or more other processing channels in order to be processed in a current processing channel.

[0341] Fig.11 illustrates a decoding of an encoded image according to the second innovative improvement, i.e. in a single stage. Fig.11 uses the same representations as Fig.10. So, each large rectangle in Fig.11 such as large rectangles 1601-1606 represents a precinct comprising 4 lines. Precincts are represented in rows indicating their progressive decoding from left to right in Fig.11, each row corresponding to a precinct represented at different stages of its decoding, the precincts represented furthest to the right in Fig.11 being completely decoded, or reconstructed, precincts. Said precincts are comprised in slices 1610, 1611, and 1612, each slice comprising 4 precincts, i.e.16 lines.

[0342] Fig.11 illustrates the decoding of a strip 1620 of spatial image samples according to the second innovative improvement, i.e. in a single stage. The strip 1620 is represented by a dashed-line frame in Fig.11. The strip 1620 is offset by one precinct, i.e.4 lines, from the slice 1611 to which it corresponds. Fig.11 illustrates said decoding in a case where slices contain 4 precincts of 4 lines each, so that each slice contains 16 lines, and where a cascade of inverse wavelet-type filter operations is applied, said cascade comprising two inverse wavelet-type filter operations of the LeGall 5 / 3 type in the vertical direction. The decoding performed in said case is compatible with a decoding performed according to the JPEG XS standard.

[0343] The decoding illustrated in Fig.11 being performed in a single stage, it may therefore be performed by a single processing channel, unlike the case illustrated in Fig.10, where the decoding is performed according to the prior art, i.e. in several stages 1520-1522 and with dependencies between several processing channels. In the same way as in Fig.10, Fig.11 particularly illustrates the decoding, or reconstruction of the first two lines 1656, 1657 and the last two lines 1666, 1667 of the strip 1620.

[0344] The decoding illustrated in Fig.11 is performed from an extended group of wavelet coefficients comprised in precincts 1601-1606. An advantage of the offset of strip 1620 relative to the slice 1611 to which it corresponds is that said offset allows the decoding to be performed based on samples from two slices only, i.e. slices 1611 and 1612, and in particular that saiddecoding may be performed without decoding samples located at the bottom of slice 1610. Indeed, in order to decode samples located at the bottom of slice 1610, it might be necessary to decode the entire slice 1610, in a case where the entropy coding of said samples is performed based on samples from preceding lines, for instance in the case of an entropy encoding such as the vertical prediction mode for bitplane count coding as specified in the JPEG XS standard.

[0345] In the same way as in Fig.10, a first and a second wavelet-type filter operations of the LeGall 5 / 3 type in the vertical direction are reversed in Fig.11 for decoding the strip 1620 of spatial image samples.

[0346] The first inverse wavelet-type filter operation of the LeGall 5 / 3 type in the vertical direction is applied according to the lifting scheme 1400 of Fig.9 in the following way. First, half a line of even samples 1636 is reconstructed based on samples comprised in half-lines 1631-1633. Then, half a line of odd samples 1637 is reconstructed based on samples comprised in half-lines 1631-1635. Similarly, half a line of even samples 1644 is reconstructed based on samples comprised in half-lines 1641-1643.

[0347] Then, inverse wavelet-type filter operations are applied in the horizontal direction (not represented in Fig.11), such that half-line 1636 corresponds to line 1652, and half-line 1637 corresponds to line 1654. Similarly, half-line 1644 corresponds to line 1664.

[0348] The second inverse wavelet-type filter operation of the LeGall 5 / 3 type in the vertical direction is applied according to the lifting scheme 1400 of Fig.9 in the following way. First, a line of even samples 1656 is reconstructed based on samples comprised in lines 1651- 1653. Then, a line of odd samples 1657 is reconstructed based on samples comprised in lines 1651-1655. Similarly, a line of even samples 1666 is reconstructed based on samples comprised in lines 1661-1663, and a line of odd samples 1667 is reconstructed based on samples comprised in lines 1661-1665.

[0349] An advantage of the method for decoding is to allow the decoding to be performed in a single stage, so as to reduce or even remove the dependencies between processing channels. Indeed, in the single-stage decoding as illustrated in Fig.11, there is no need for synchronization points between processing channels because all data, i.e. all the wavelet coefficients, required for a processing channel to independently reconstruct a strip of spatial image samples, such as the strip 1620, are comprised in the extended group of wavelet coefficients provided to said processing channel. In addition, a loss of performance that could arise if said data or part thereof would have to be retrieved from memories of other processing channels is avoided thanks to the method for decoding. Therefore, the method for decodingimproves the efficiency of the decoding by reducing or even removing dependencies between respective processing channels decoding in parallel respective strips of spatial image samples.

[0350] In summary, the second innovative improvement relates to a method for decoding an encoded image obtainable by applying at least one wavelet-type filter operation in a vertical direction, wherein the efficiency of the decoding is improved by reducing dependencies between respective processing channels decoding in parallel respective strips of spatial image samples, wherein each processing channel reconstructs a strip of spatial image samples independently from the other processing channels from an extended group of wavelet coefficients, whereby extended groups of wavelet coefficients mutually overlap to an extent that each extended group of wavelet coefficients comprises all the wavelet coefficients required for the processing channel receiving the extended group of wavelet coefficients to independently reconstruct a strip of spatial image samples. The second innovative improvement also relates to an apparatus and a computer program for performing the method for decoding. Third innovative improvement

[0351] In this section, the “method for encoding” relates to the method for encoding according to the third innovative improvement, unless otherwise specified. Similarly, in this section, the “method for decoding” relates to the method for decoding according to the third innovative improvement, unless otherwise specified.

[0352] Herein, a “processor” generally designates a device able to execute computer instructions, such as for example a (micro)processor for a computer, which is also known as a central processing module (CPU), or a graphics processing module (GPU). A register of a processor, also referred to herein as a “processor register”, is a high-speed memory built into a processor for quick data access. A processor register is an example of a cache memory.

[0353] Cache memories may be organized in several levels, a lower-level cache memory being faster, but smaller, than a higher-level cache memory. When a data is not found in a lower-level cache memory, a cache miss occurs and the data needs to be retrieved from a higher-level, and therefore slower, cache memory. The level of a cache memory may be designated by a number, a lower number designated a lower level. As an example, a modern processor may comprise three levels of cache memories, respectively denoted as “Level 1”, “Level 2”, and “Level 3” cache memories, or L1, L2, and L3 caches for short. Table 2 provides examples of sizes of such cache memories for a modern processor, along with the number of lines of image samples that may be stored in each of said cache memories. The sizes ofcaches memories provided in Table 2 are given in KiB and MiB, which respectively designate “kibibytes”, i.e.1024 bytes, and “mebibytes”, i.e.1024 kibibytes, with a byte comprising 8 bits. In order to compute the number of lines of image samples stored in each cache memory of Table 2, the case of an image with a resolution of 3840 x 2160 pixels is considered, with each pixel comprising 3 color components. Said resolution is also commonly known as a “4K UHD resolution”. In a case where the 3 color components of each pixel are provided together at the input of an encoding module and / or at the output of a decoding module, said components are preferably processed together so as to remain contiguous in memory. This is the case considered in Table 2. In this case, a line of image samples provided to an encoding module has a size of 3 components * 3840 samples / component * 32 bits / sample = 45 KiB. Similarly, a set of coefficients provided to a decoding module has a size of 3 components * 3840 coefficients / component * 32 bits / coefficient = 45 KiB, since a set of coefficients is spatially related to a line of image samples. Table 2 – Capacity of L1, L2, and L3 cache memories on a modern multicore processor Type of cache memory Size Number of lines stored L1 cache 80 KiB per core 1 L2 cache 1280 KiB per core 28 L3 cache 24 MiB shared between cores 546 According to the third innovative improvement, the lines of image samples or the sets of coefficients may be stored in a lower-level cache memory, such as a L2 cache or even a L1 cache, thereby improving the performance of an encoding module or a decoding module by reducing cache misses. Indeed, as shown in Table 2, it may not be possible to store a whole image such as a 4K UHD image in a cache memory. However, the line buffers of the encoding module or the decoding module may fit in a cache memory, thereby improving the performance of said modules by reducing cache misses, and thus improving the overall performance of an encoder or a decoder.

[0354] Fig.12 schematically represents an encoder 2100 for encoding an image 2110 into an encoded image 2150 according to an embodiment. The image 2110 comprises a plurality of image samples 2111 grouped into respective lines 2112 of image samples 2111. The encoded image 2150 comprises respective sets of coefficients spatially related to the respective lines 2112. Fig.12 provides a block diagram of the encoder 2100. The encoder 2100 may be configured for performing the method for encoding. The encoder 2100 maycomprise a pre-processing module 2120. The pre-processing module 2120 may comprise a pre-processing buffer 2121. The pre-processing module 2120 may perform one or more prior operations. The encoder 2100 may comprise an encoding module 2130. The encoding module 2130 may comprise an input line buffer 2131. The encoding module 2130 may comprise a plurality of intermediate line buffers 2132, 2133. The encoding module 2130 may comprise an output line buffer 2134. The encoding module 2130 may process the respective lines 2112 of image samples 2111 for producing the respective sets of coefficients spatially related to the respective lines 2112. The encoder 2100 may comprise a post-processing module 2140. The post-processing module 2140 may comprise a post-processing buffer 2141. The post- processing module 2140 may perform one or more subsequent operations.

[0355] The encoder 2100 operates as follows. The encoder 2100 receives an image 2110 comprising respective lines 2112 of image samples 2111. One or more prior operations may be applied on at least some of the respective lines 2112 in the pre-processing module 2120. Said respective lines 2112 may be stored in the pre-processing buffer 2121 before or after said prior operations. The encoding module 2130 then receives the respective lines 2112. The respective lines 2112 provided to the encoding module 2130 are stored in the input line buffer 2131. The encoding module 2130 processes the respective lines 2112 for producing intermediate results and final results according to a lifting scheme of a wavelet-type filter operation. The encoding module 2130 may apply said wavelet-type filter operation in a vertical direction. The intermediate results are stored in the intermediate line buffers 2132, 2133. The final results are provided in the output line buffer 2134 as respective sets of coefficients spatially related to the respective lines 2112. One or more subsequent operations may be applied on at least some of the respective sets of coefficients in the post-processing module 2140. Said respective sets of coefficients may be stored in the post-processing buffer 2141 before or after said subsequent operations. Said respective sets of coefficients may be further processed in the encoder 2100 by being provided back to the pre-processing module 2120, as indicated by the dashed arrow in Fig.12. An example of said further processing is when a cascade of wavelet-type filter operations is performed in the encoder 2100, wherein at least some of the respective sets of coefficients are further processed in one or more additional wavelet-type filter operations. Finally, an encoded image 2150 is produced, which comprises the respective sets of coefficients.

[0356] The encoder 2100 may be comprised in a data processing device able to process image or video data, such as a computer. The encoder 2100 may compress the encoded image 2150, i.e. reduce the size of the encoded image 2150 compared to the original image2110. Said compression may enable the data processing device to store the encoded image 2150 in a memory in a more efficient manner. In addition, said compression may enable the data processing device to transfer the encoded image 2150 to another data processing device in a more efficient manner, for example via a communication channel that may be provided by a network.

[0357] Fig.13 schematically represents a decoder 2200 for decoding an encoded image 2210 into a decoded image 2250 according to an embodiment. The encoded image 2210 comprises a plurality of coefficients grouped into respective sets of coefficients. The encoded image 2210 of Fig.13 may be for instance the encoded image 2150 of Fig.12. The decoded image 2250 comprises a plurality of image samples 2251 grouped into respective decoded lines 2252 of image samples 2251. The respective decoded lines 2252 are spatially related to the respective sets of coefficients of the encoded image 2210. Fig.13 provides a block diagram of the decoder 2200. The decoder 2200 may be configured for performing the method for decoding. The decoder 2200 may comprise a pre-processing module 2220. The pre- processing module 2220 may comprise a pre-processing buffer 2221. The pre-processing module 2220 may perform one or more prior operations. The decoder 2200 may comprise a decoding module 2230. The decoding module 2230 may comprise an input line buffer 2231. The decoding module 2230 may comprise a plurality of intermediate line buffers 2232, 2233. The decoding module 2230 may comprise an output line buffer 2234. The decoding module 2230 may process the respective sets of coefficients for producing the respective decoded lines 2252 of image samples 2251. The decoder 2200 may comprise a post-processing module 2240. The post-processing module 2240 may comprise a post-processing buffer 2241. The post-processing module 2240 may perform one or more subsequent operations.

[0358] The decoder 2200 operates as follows. The decoder 2200 receives an encoded image 2210 comprising respective sets of coefficients. One or more prior operations may be applied on at least some of the respective sets of coefficients in the pre-processing module 2220. Said respective sets of coefficients may be stored in the pre-processing buffer 2221 before or after said prior operations. The decoding module 2230 then receives the respective sets of coefficients. The respective sets of coefficients provided to the decoding module 2230 are stored in the input line buffer 2231. The decoding module 2230 processes the respective sets of coefficients for producing intermediate results and final results according to a lifting scheme of an inverse wavelet-type filter operation. The decoding module 2230 may apply said inverse wavelet-type filter operation in a vertical direction. The intermediate results are stored in the intermediate line buffers 2232, 2233. The final results are provided in the output linebuffer 2234 as respective decoded lines 2252 of image samples 2251 spatially related to the respective sets of coefficients. One or more subsequent operations may be applied on at least some of the respective decoded lines 2252 in the post-processing module 2240. Said respective decoded lines 2252 may be stored in the post-processing buffer 2241 before or after said subsequent operations. Said respective decoded lines 2252 may be further processed in the decoder 2200 by being provided back to the pre-processing module 2220, as indicated by the dashed arrow in Fig.13. An example of said further processing is when a cascade of inverse wavelet-type filter operations is performed in the decoder 2200, wherein at least some of the respective decoded lines 2252 are further processed in one or more additional inverse wavelet-type filter operations. Finally, a decoded image 2250 is produced, which comprises the respective decoded lines 2252 of image samples 2251.

[0359] The decoder 2200 may be comprised in a data processing device able to process image or video data, such as a computer. The encoded image 2210 may be compressed, i.e. having its size reduced compared to an original image. In this case, the decoder 2200 may enable the encoded image 2210 to be decompressed into a decoded image 2250 similar to the original image. Compressing the encoded image 2210 may enable the data processing device to retrieve the encoded image 2210 from a memory in a more efficient manner. In addition, compressing the encoded image 2210 may enable the data processing device to receive the encoded image 2210 from another data processing device in a more efficient manner, for example via a communication channel that may be provided by a network.

[0360] Fig.14 is a schematic representation of a lifting scheme implementation 2300 of a wavelet-type filter operation of the LeGall 5 / 3 type in a forward way. The lifting scheme 2300 of Fig.14 is an example of the lifting scheme of the wavelet-type filter operation applied in the encoding module 2130. For the sake of conciseness, the wavelet-type filter operation of the LeGall 5 / 3 type in a forward way is hereinafter referred to as “FDWT 5 / 3 filtering”. Said FDWT 5 / 3 filtering comprises a so-called “prediction step” producing high-frequency (HF) outputs and a so-called “update step” producing low-frequency (LF) outputs. Said steps are computed according to the following equations:The FDWT 5 / 3 filtering operation is applied to a series of even and odd input samples, which are represented as an upper row of circles in Fig.14, said row being denoted as “IN”. Black circles in the IN row of Fig.14 represent odd input samples, for which a high-frequency output is computed according to the HF equation above and as represented in a middle row of circlesin Fig.14, said row being denoted as “HF”. White circles in the IN row of Fig.14 represent even input samples, for which a low-frequency output is computed according to the LF equation above and as represented in a lower row of circles in Fig.14, said row being denoted as “LF”. Numbers next to arrows in Fig.14 represent weighting factors according to the HF and LF equations above. Dashed arrows in Fig.14 indicate that the series of input and output samples may comprise additional samples not represented in Fig.14. Horizontal dashed lines highlight the respective upper, middle, and lower rows of Fig.14.

[0361] Fig.15 is a schematic representation of a lifting scheme implementation 2400 of a wavelet-type filter operation of the LeGall 5 / 3 type in an inverse way. The lifting scheme 2400 of Fig.15 is an example of the lifting scheme of the inverse wavelet-type filter operation applied in the decoding module 2230. For the sake of conciseness, the wavelet-type filter operation of the LeGall 5 / 3 type in an inverse way is hereinafter referred to as “IDWT 5 / 3 filtering”. Said IDWT 5 / 3 filtering reverses the HF and LF equations of the FDWT 5 / 3 filtering according to the following equations:The IDWT 5 / 3 filtering is applied on high-frequency and low-frequency output samples produced by a FDWT 5 / 3 filtering, which are represented as an upper row of circles in Fig.15, said row being denoted as “IN”. White circles in the IN row of Fig.15 represent low-frequency samples, for which an even output is computed according to the EVEN equation above and as represented in a middle row of circles in Fig.15, said row being denoted as “EVEN”. Black circles in the IN row of Fig.15 represent high-frequency samples, for which an odd output is computed according to the ODD equation above and as represented in a lower row of circles in Fig.15, said row being denoted as “ODD”. Numbers next to arrows in Fig.15 represent weighting factors according to the EVEN and ODD equations above. Dashed arrows in Fig.15 indicate that the series of input and output samples may comprise additional samples not represented in Fig.15. Horizontal dashed lines highlight the respective upper, middle, and lower rows of Fig.15.

[0362] Table 3 illustrates a FDWT 5 / 3 filtering operation applied according to the lifting scheme 2300 of Fig.14. Said filtering operation may generally be applied in a horizontal or vertical direction. However, Table 3 particularly illustrates the case of a FDWT 5 / 3 filtering operation applied in a vertical direction. Said case is an example of the wavelet-type filter operation applied in the encoding module 2130 for producing intermediate results and final results.

[0363] Table 4 illustrates an IDWT 5 / 3 filtering operation applied according to the lifting scheme 2400 of Fig.15. Said filtering operation may generally be applied in a horizontal or vertical direction. However, Table 4 particularly illustrates the case of an IDWT 5 / 3 filtering operation applied in a vertical direction. Said case is an example of the inverse wavelet-type filter operation applied in the decoding module 2230 for producing intermediate results and final results.

[0364] Tables 3 and 4 share a similar structure. The leftmost column (“Row”) is present for indicative purposes only and is used to reference rows of Tables 3 and 4. The “Phase” column indicates the different phases of the encoding or decoding, which are described below. The remaining columns indicate the content of the input line buffer, the intermediate line buffers, and the output line buffer, respectively. Since Tables 3 and 4 illustrate a wavelet-type filter operation of the LeGall 5 / 3 type, the number of intermediate line buffers is equal to two line buffers, which corresponds to the minimum number of intermediate line buffers required for producing the respective sets of coefficients or the respective decoded lines 2252 according to the lifting schemes 2300 or 2400, respectively.

[0365] The encoding or decoding of an image according to the lifting scheme 2300 or 2400, respectively, will now be described. First, an initialization phase is executed once for starting the encoding or decoding of the image. This initialization phase corresponds to rows 1 to 3 of Tables 3 and 4. Then, a regime phase takes place, which corresponds to rows 4 and 5 of Tables 3 and 4. The regime phase is executed a number n of times. This number n is linked to the number L of lines in the image to be encoded or decoded by the following relationship: n = floor((L - 4) / 2), wherein the “floor(x)” function takes as input a number x and gives as output the greatest integer less than or equal to x. Then, a closing phase is executed once, during which the input line buffer and the intermediate line buffers are flushed. Depending on the parity of the number L of lines in the image to be encoded or decoded, either a first closing phase or a second closing phase is executed. The first closing phase is executed when L is even. This first closing phase corresponds to rows 6 to 8 of Tables 3 and 4. The second closing phase is executed when L is odd. This second closing phase corresponds to rows 9 to 12 of Tables 3 and 4.

[0366] Each row of the Tables 3 and 4 corresponds to the processing of one line 2112 of image samples 2111 by the encoding module 2130 or of one set of coefficients by the decoding module 2230, respectively. As shown in Tables 3 and 4, data shift from one buffer to another during the processing of the respective lines 2112 of image samples 2111 or the respective sets of coefficients. More precisely, new data (respective lines or respective sets) are firststored in the input line buffer. Then, data shift from the input line buffer to the first intermediate line buffer, then from the first intermediate line buffer to the second intermediate line buffer, and finally from the second intermediate line buffer to the output buffer. This allows processing the respective lines 2112 or the respective sets with a reduced amount of memory according to the lifting schemes 2300 or 2400, respectively.

[0367] Table 3 – FDWT 5 / 3 filtering applied according to the lifting scheme 2300 of Fig.14 Row Phase Input Line Intermediate Intermediate Output Line Buffer Buffer Line Buffer 1 Line Buffer 2 (2131) (2132) (2133) (2134) 1 init L0 L0 - - 2 L1 L1 - L0 / 2 L0 - 3 L2 L2 High1 Low0 = L1 - L0 / 2 - L2 / 2 = L0 + 2*High1 / 4 4 regime L3 L3 - L2 / 2 L2 + High1 / 4 High1 (n 5 times) L4 L4 High3 Low2 = L3 - L2 / 2 - L4 / 2 = L2 + High1 / 4 + High3 / 4 6 closing L5 L5 - 2*L4 / 2 L4 + High3 / 4 High3 for L (2n + 3) 7 even - - High5 Low4 (end even) = L5 - 2*L4 / 2 = L4 + High3 / 4 + High5 / 4 8 - - - High5 (end odd) 9 closing L5 L5 - L4 / 2 L4 + High3 / 4 High3 for L 10 odd L6 L6 High5 Low4 (2n + 4) = L5 - L4 / 2 - L6 / 2 = L4 + High3 / 4 + High5 / 4 11 - - L6 + 2*High5 / 4 High5 (end odd) 12 - - - Low6 (end even) = L6 + 2*High5 / 4

[0368] Table 4 – IDWT 5 / 3 filtering applied according to the lifting scheme 2400 of Fig.15 Row Phase Input Line Intermediate Intermediate Output Line Buffer Line Buffer 1 Line Buffer 2 Buffer (2231) (2232) (2233) (2234) 1 init Low0 Low0 - - 2 High1 High1 L0 - = Low0 - 2*High1 / 4 3 Low2 Low2 - High1 / 4 High1 + L0 / 2 L0 4 regime High3 High3 L2 L1 (n = Low2 - High1 / 4 - = High1 + L0 / 2 + times) High3 / 4 L2 / 2 5 Low4 Low4 - High3 / 4 High3 + L2 / 2 L2 6 closing High5 High5 L4 L3 for L (2n + 3) = Low4 - High3 / 4 - = High3 + L2 / 2 + even High5 / 4 L4 / 2 7 - - High5 + 2*L4 / 2 L4 (end even) 8 - - - L5 (end odd) = High5 + 2*L4 / 2 9 closing High5 High5 L4 L3 for L = Low4 - High3 / 4 - = High3 + L2 / 2 + odd High5 / 4 L4 / 2 10 Low6 Low6 - 2*High5 / 4 High5 + L4 / 2 L4 (2n + 4) 11 - - L6 L5 (end odd) = Low6 - 2*High5 / 4 = High5 + L4 / 2 + L6 / 2 12 - - - L6 (end even)

[0369] Fig.16 schematically represents a decomposition of an image into subbands in a cascade of wavelet-type filter operations. The image may be for instance the image 2110 of Fig.12. The decomposed image 2500 comprises so-called subbands 2510-2560. Generally, the wavelet-type filter operations may comprise any wavelet-type filter. In the particular case illustrated in Fig.16, the image has been decomposed using two vertical and five horizontal FDWT 5 / 3 decomposition levels. In other words, the cascade of wavelet-type filter operations applied on the image for obtaining the decomposed image 2500 comprises two wavelet-type filter operations of the LeGall 5 / 3 type applied in a vertical direction and five wavelet-type filter operations of the LeGall 5 / 3 type applied in a horizontal direction. In said cascade of wavelet- type filter operations, a wavelet-type filter operation applied in a vertical direction is followed by a wavelet-type filter operation applied in a horizontal direction. Similarly, a wavelet-type filter operation applied in a horizontal direction is followed by a wavelet-type filter operation applied in a vertical direction, unless there are no more such vertical operation to be performed, in which case the wavelet-type filter operation applied in a horizontal direction is followed by another wavelet-type filter operation applied in a horizontal direction.

[0370] On Fig.16, the coefficients resulting from the cascade of wavelet-type filter operations have been grouped together based on the type of the subband they belong to. Other ways of grouping the coefficients are possible. The types of the subbands are listed in Table 5. Table 5 – Types of the subbands in Fig.16 Reference Subband frequency type Subband frequency type Subband type sign in the horizontal direction in the vertical direction (short name) 2510 High Low HL0 2511 Low High LH0 2512 High High HH0 2520 High Low HL1 2521 Low High LH1 2522 High High HH1 2530 High Low HL2 2540 High Low HL3 2550 High Low HL4 2560 Low Low LL4

[0371] Finally, the decomposed image 2500 may be recomposed by applying a cascade of inverse wavelet-type filter operations in the reverse order as the cascade of (forward) wavelet-type filter operations applied for obtaining the decomposed image 2500.

[0372] In summary, the third innovative improvement relates to a method for encoding an image 2110 comprising image samples 2111, the method for encoding comprising processing with an encoding module 2130 respective lines 2112 of image samples 2111 for producing intermediate results and final results according to a lifting scheme 2300 of a wavelet-type filter operation applied in a vertical direction, so as to reduce the amount of memory needed for encoding the image 2110. The third innovative improvement also relates to an apparatus and a computer program for encoding the image 2110, and to a method, apparatus and computer program for decoding an encoded image 2210 obtainable by the method for encoding into a decoded image 2250, wherein the decoding may be performed with a reduced amount of memory. Fourth innovative improvement

[0373] In this section, the “method for encoding” relates to the method for encoding according to the fourth innovative improvement, unless otherwise specified.

[0374] Herein, a “processor” generally designates a device able to execute computer instructions, such as for example a (micro)processor for a computer, which is also known as a central processing module (CPU), or a graphics processing module (GPU). A register of a processor, also referred to herein as a “processor register”, is a high-speed memory built into a processor for quick data access. A processor register is an example of a cache memory.

[0375] Cache memories may be organized in several levels, a lower-level cache memory being faster, but smaller, than a higher-level cache memory. When a data is not found in a lower-level cache memory, a cache miss occurs and the data needs to be retrieved from a higher-level, and therefore slower, cache memory. The level of a cache memory may be designated by a number, a lower number designated a lower level. As an example, a modern processor may comprise three levels of cache memories, respectively denoted as “Level 1”, “Level 2”, and “Level 3” cache memories, or L1, L2, and L3 caches for short.

[0376] Fig.17 schematically represents an exemplary decomposition of an image into subbands in a cascade of wavelet-type filter operations. In the example of Fig.17, two vertical and five horizontal wavelet decompositions have been applied to the image for producing the decomposed image 3100. The decomposed image 3100 comprises so-called subbands 3110- 3160. Generally, the wavelet-type filter operations may comprise any wavelet-type filter. In theparticular case illustrated on Fig.17, the cascade of wavelet-type filter operations applied on the image for obtaining the decomposed image 3100 comprises two wavelet-type filter operations of the LeGall 5 / 3 type applied in a vertical direction and five wavelet-type filter operations of the LeGall 5 / 3 type applied in a horizontal direction. In said cascade of wavelet- type filter operations, a wavelet-type filter operation applied in a vertical direction is followed by a wavelet-type filter operation applied in a horizontal direction. Similarly, a wavelet-type filter operation applied in a horizontal direction is followed by a wavelet-type filter operation applied in a vertical direction, unless there are no more such vertical operation to be performed, in which case the wavelet-type filter operation applied in a horizontal direction is followed by another wavelet-type filter operation applied in a horizontal direction.

[0377] On Fig.17, the coefficients resulting from the cascade of wavelet-type filter operations have been grouped together based on the type of the subband they belong to. Other ways of grouping the coefficients are possible. The types of the subbands are listed in Table 6. The subband frequency type in the horizontal or vertical direction depends on the filtering type the subband results from. A subband with a high frequency type in a horizontal or vertical direction results from a high-pass filtering in the corresponding direction. Similarly, a subband with a low frequency type in a horizontal or vertical direction results from a low-pass filtering in the corresponding direction.

[0378] Table 6 – Types of the subbands in Fig.17 Reference Subband frequency type Subband frequency type Subband type sign in the horizontal direction in the vertical direction 3110 High Low HL1 3111 Low High LH1 3112 High High HH1 3120 High Low HL2 3121 Low High LH2 3122 High High HH2 3130 High Low HL3 3140 High Low HL4 3150 High Low HL5 3160 Low Low LL5

[0379] The coefficients of the frequency transform depicted in Fig.17 are organized in so-called precincts as depicted in Fig.18. A precinct groups all coefficients from different subbands and belonging to a same spatial region in the image.

[0380] The upper portion of Fig.18 illustrates the distribution of the individual precincts within the individual subbands 3110 to 3160 illustrated in Fig.17. Dark grey areas indicate coefficients belonging to a first precinct. Light grey areas indicate coefficients belonging to a second precinct.

[0381] Typically, a precinct defines a rectangular spatial area having, for example, the same width of the image, i.e. a number of columns equal to the number of samples in a line of image, and a height equal to a number of lines. The height of a precinct is preferably equal to a number of lines that can be divided by two, more preferably equal to a number of lines that is an integer power of two.

[0382] Particularly, the lower portion of Fig.18 illustrates a precinct 3200 that comprises two lines of subband HH1, indicated as 3201 and 3202, two lines of subband LH1 indicated as 3203 and 3204, and two lines of subband HL1 indicated as 3205 and 3206. The precinct 3200 further comprises a single line of subband HH2 indicated as 3207, a single line of subband HL2 indicated as 3208, and a single line of subband LH2, indicated as 3209. The precinct 3200 further comprises a single line of subband HL3 indicated as 3210, a single line of subband HL4 indicated as 3211, a single line of subband HL5 indicated as 3212, and a single line of subband LL5 indicated as 3213. The precinct 3200 may correspond for instance to the dark grey areas of the upper portion of Fig.18, or to the light grey areas of the upper portion of Fig.18. The total number of precincts that are used for an image depends on the number of lines of the image and how many lines are included within a precinct.

[0383] Fig.19 illustrates a principle of GCLI encoding of a group of image coefficients. A group 3300 comprising a number of (consecutive) coefficients 3301 is represented in sign- magnitude representation, with reference 3302 designating the signs of the coefficients 3301 and reference 3303 designating the magnitude of the coefficients 3301 in binary representation.

[0384] The largest coefficient in the group determines the number of active bitplanes. A bitplane is called active, if at least one coefficient bit of the bitplane itself or any previous, i.e. more significant, bitplane is unequal to zero. The number of active bitplanes is given by the so- called GCLI value (Greatest Coded Line Index). A GCLI value of zero means that no bitplanes are active, and hence the complete coefficient group is zero. The GCLI of the group 3300 isindicated by reference 3304 in Fig.19. Said GCLI corresponds to the four least significant bitplanes.

[0385] In a lossy encoding, coefficients may be quantized in a quantization operation. Said quantization operation may be performed by truncation, i.e. with a quantization factor being a power of two, so that entire bitplanes are truncated, i.e. removed, from the magnitude of the coefficients. When a quantization operation is performed by truncation of bitplanes of coefficients, the quantization level becomes a truncation level. A truncation level may be specified by the so-called “Greatest Trimmed Line Index” (GTLI), which indicates a number of least significant bitplanes truncated from the coefficients. The GTLI may also be referred to as a “truncation point”. A GTLI equal to zero corresponds to no truncation. The active bitplanes remaining after the truncation are also referred to herein as “remaining bitplanes”. Fig.19 illustrates a GTLI 3305 equal to two, i.e. two bitplanes 3306 are truncated, so that two significant bitplanes 3307 remain after the truncation. In addition, after the truncation, the two rightmost coefficients are no longer significant, i.e. all their remaining bits are equal to zero after the truncation.

[0386] The remaining bitplanes 3307 may be transmitted to a decoder. For instance, bitplane 3308 may be transmitted to the decoder first, followed by bitplane 3309. Said bitplanes 3308 and 3309 may be transmitted to the decoder in a data subpacket.

[0387] In order to enable correct decoding, the decoder needs to know the number of remaining / transmitted bitplanes for each group of coefficients, which is signaled by transmitting the GCLI of each group to the decoder along with the remaining bitplanes. The GCLI values may be entropy encoded so as to reduce the number of bits needed to signal them, as described below. Entropy encoded GCLI values may be transmitted to the decoder in a GCLI subpacket.

[0388] In addition, signs of the coefficients may be transmitted along with the remaining bitplanes in a data subpacket. Advantageously, only signs of significant, i.e. non-zero, coefficients are transmitted, since the sign of a zero coefficient is not needed to reconstruct this coefficient. Alternatively, signs may be transmitted separately to the decoder in a sign subpacket. In the example of Fig.19, signs 3310 of significant coefficients after truncation may be transmitted to the decoder either with the bitplanes 3308 and 3309 in a data subpacket or separately in a sign subpacket.

[0389] Different methods, or “coding modes”, are known to encode the GCLI values efficiently. In a first coding mode, also referred to herein as a “RAW mode”, the GCLI value istransmitted in its raw binary representation. For example, a GCLI value ranging from 0 to 15 may be transmitted on four bits, as illustrated in Table 7.

[0390] Table 7 – RAW coding mode for a GCLI value GCLI value Coded value 0 0000 1 0001 2 0010 3 0011 etc. etc.

[0391] In a second coding mode, also referred to herein as an “unsigned unary coding mode”, the GCLI value is coded in a variable length unsigned unary code without prediction as represented in Table 8. This second coding mode is also referred to herein as the “no prediction mode”, since the value of the GCLI is encoded without prediction from another value.

[0392] Table 8 – Unsigned unary coding mode for a GCLI value GCLI value Coded value 0 0 1 10 2 110 3 1110 etc. etc.

[0393] In contrast, in a third coding mode, a GCLI value may also be encoded based on the value of the GCLI of another group of coefficients, more specifically a vertically neighboring group of coefficients. This third coding mode is also referred to herein as the “vertical prediction mode”.

[0394] The third coding mode works as follows. Let G1 and G2 be two vertically neighboring groups of coefficients, each group comprising a number Ng> 1 of coefficients. Let G2be the coefficient group to be encoded. Let GCLI(Gi) designate the GCLI of a group Giof coefficients and let GTLI(Gi) designate the GTLI, i.e. truncation level, applied to a group Giof coefficients. Then, GCLI(G2) can be signaled to the decoder by transmitting a prediction residual X to the decoder, computed according to the following equation:The prediction residual X may be coded in a variable length unsigned unary code in the same way as in the second coding mode (see Table 8).

[0395] The decoder recovers GCLI(G2) by computing

[0396] Table 9 provides an example of a predetermined order for evaluating the cost of segments in the budget computation step S3) according to an embodiment. This example is given in the case of a FHD 4:4:4 image which has been applied a DWT decomposition. A FHD 4:4:4 image is an image with a resolution of 1920x1080 pixels and comprising three image components, wherein each image component has the same resolution as the image. The DWT decomposition of this example consists of two vertical and five horizontal DWT decompositions, resulting in the subbands 3110-3160 as illustrated in Fig.17. Subband types in Table 9 correspond to the type of subbands 3110-3160 in Fig.17 and Fig.18 and also to subband types in Table 6.

[0397] The first column of Table 9 (“Component”) indicates the type of image component (Y, Cb, or Cr). The second column (“Subband type”) indicates the type of the subbands in each image component. The third column (“Subband width”) indicates the width of the subbands as a number of image coefficients. The fourth column (“Gain”) indicates a gain value for each subband. This gain value refers to the quantization and refinement mechanism as described hereinbefore, in which the quantization level is adjusted individually for each segment in a manner known a priori. A larger gain indicates that the coefficients of the corresponding subband are shifted upwards by a number of bits equal to the value of the gain, i.e. multiplied by a value equal to two to the power of the gain value (= 2^gain). This is equivalent to dividing the value of the quantization level of the subband by 2^gain. In other words, a larger gain corresponds to a lower quantization level for the subband.

[0398] The fifth and rightmost column of Table 9 (“Segment cost evaluation order”) indicates the predetermined order of this example. This column is divided in three sub-columns for data, GCLI, and sign segments respectively. The numbers in these sub-columns indicate the order in which segments are evaluated, whose coefficients correspond to the imagecomponent of the first column and the subband type of the second column, and whose type corresponds to the sub-column (data, GCLI, or sign), a lower number indicating that the corresponding segment is evaluated first. There is a total of 90 segments in this example: 3 image components * 10 subbands in each image component * 3 segments types for each subband. The segment cost evaluation order index starts from 0 for the first segment to be evaluated and goes until 89, the last segment to be evaluated.

[0399] Table 9 – Example of predetermined segment cost evaluation order Component Subband Subband width Gain Segment cost evaluation order type (FHD 4:4:4) DATA GCLI SIGN LL5 60 8 0 30 60 HL5 60 7 1 31 61 HL4 120 7 2 32 62 HL3 240 6 3 33 63 HL2 480 5 6 36 66 Y LH2 480 5 7 37 67 HH2 480 4 12 42 72 HL1 960 3 15 45 75 LH1 960 3 16 46 76 HH1 960 2 21 51 81 LL5 60 6 4 34 64 HL5 60 5 8 38 68 HL4 120 5 9 39 69 HL3 240 4 13 43 73 HL2 480 3 17 47 77 Cb LH2 480 3 18 48 78 HH2 480 1 22 52 82 HL1 960 1 23 53 83 LH1 960 1 24 54 84 HH1 960 0 28 58 88 LL5 60 6 5 35 65 HL5 60 5 10 40 70 HL4 120 5 11 41 71 HL3 240 4 14 44 74 HL2 480 3 19 49 79 Cr LH2 480 3 20 50 80 HH2 480 1 25 55 85 HL1 960 1 26 56 86 LH1 960 1 27 57 87 HH1 960 0 29 59 89

[0400] The principles described hereinbefore for determining the segment cost evaluation order are applied in the example provided in Table 9, namely that segments with a higher expected cost and a lower computational complexity for determining said cost are evaluated first. In particular: - data segments are evaluated before GCLI segments; - GCLI segments are evaluated before sign segments; - segments whose gain is higher are evaluated first.

[0401] Fig.20 illustrates the determination of a quantization level according to an embodiment. Values on the horizontal x-axis indicate quantization level values, a higher value corresponding to a higher quantization, i.e. more information removed from the coefficients after quantization. Values on the vertical y-axis indicate cost values of a set of segments in arbitrary units ranging from 0 to 5000, a higher value corresponding to a higher cost. Circle markers 3401 indicate an actual cost of the set of segments as a function of the quantization level. Triangle markers 3402 indicate an upper bound of the actual cost as a function of the quantization level. Square markers 3403 indicate a lower bound of the actual cost as a function of the quantization level. Dashed line 3404 indicates a target budget for the set of segments.

[0402] According to the fourth innovative improvement, a low value of the quantization level is selected first, for which the cost of the set of segments is evaluated incrementally in the budget computation step according to the predetermined evaluation order, such as for example the order provided in Table 9. When the cost of the set of segments exceeds the target budget, then the current budget computation step is stopped, the quantization level is increased, and a new budget computation step is performed for the increased value of the quantization level. Successive budget computation steps are performed iteratively for increasing values of the quantization level until a suitable value of the quantization level is found, i.e. one for which the cost of the set of segments is below the target budget. According to the fourth innovative improvement, the suitable value of the quantization level is known to be optimal, i.e. the lowest possible value of the quantization level that is below the target budget. The image coefficients of the set of segments may then be entropy encoded according to said value of the quantization level for producing the portion of the encoded image.

[0403] Reference 3410 indicate a quantization level value for which the lower bound of the cost of the set of segments is larger than the target budget. For instance, said lower bound may be based on a lower bound of the cost of a sign segment. Therefore, this value of the quantization level may be discarded with no need to compute the actual cost of the set ofsegments, thereby reducing the computational complexity of the budget computation step for this value of the quantization level.

[0404] Reference 3411 indicates a quantization level value for which the upper bound of the cost of the set of segments is smaller than the target budget. For instance, said upper bound may be based on an upper bound of the cost of a sign segment. Therefore, the cost of the set of segments for this value of the quantization level is known to be smaller (or equal) to the target budget, i.e. to be a suitable value of the quantization level, with no need to compute the actual cost of the set of segments, thereby reducing the computational complexity of the budget computation step for this value of the quantization level. However, in order to determine if this suitable value of the quantization level is optimal, i.e. the lowest possible value of the quantization level that is below the target budget, the actual cost of the set of segments must be evaluated, i.e. the cost of all segments of the set must be computed.

[0405] Reference 3420 indicates a quantization level value that is both suitable, i.e. below the target budget, and optimal, i.e. the lowest possible value of the quantization level that is below the target budget.

[0406] Fig.21 schematically represents an encoder 3500 for encoding an image according to an embodiment. Fig.21 provides a block diagram of the encoder 3500. The encoder 3500 may be configured for encoding at least one portion of an original image 3520 into a corresponding portion of an encoded image 3530 according to the method for encoding. The encoder 3500 comprises an optional color transform (CT) module 3501, and a discrete wavelet transform (DWT) module for producing image coefficients based on input image samples from the original image 3520. The CT module 3501 and the DWT module 3502 are optional; if they are not present, then the image coefficients may simply be equal to the input image samples. The encoder 3500 further comprises a GCLI extraction module 3503, a sign extraction module 3504, a rate allocation module 3505, a packetizer module 3506, and a header generation module 3507. The rate allocation module 3505 comprises a data budget module 3510, a GCLI budget module 3511, a sign budget module 3512, a rate allocation core module 3513, and a quantization level selection module 3514.

[0407] Modules 3501-3514 are software modules. Said modules should be interpreted as a way of distinguishing between different types of operations. Said modules may be comprised in a single system, i.e. the operations performed by said modules may be executed by a single processor. Said modules may also be comprised a distributed system, i.e. the operations performed by said modules may be executed by a plurality of processors.

[0408] The encoder 3500 basically operates as follows. The main purpose of the rate allocation module 3505 is to determine a suitable quantization level value so that the size of the portion of the encoded image 3530 remains below a target budget. To this end, the encoder may perform lossy compression, i.e. selectively removing information from the coefficients of the original image for producing the portion of the encoded image 3530. The encoded image 3530 contains all information enabling a decoder to reconstruct a decoded image similar to the original image 3520 before encoding, the difference between the original image 3520 and the decoded image being the loss of information due to the lossy compression. The encoding is performed with the best effort to minimize this loss of information under the target budget constraint. Input image samples from the original image 3520 may be processed by one or more optional decorrelative transforms, namely a color transform in the CT module 3501, followed by a DWT transform in the DWT module 3502, which produces decorrelated image coefficients in sign-magnitude representation. If no decorrelative transform is applied, then the image coefficients may simply be equal to the input image samples. The GCLI extraction module 3503 and the sign extraction module 3504 respectively compute GCLI and sign values from the image coefficients and transmit said values to the rate allocation module 3505 and the packetizer module 3506.

[0409] The rate allocation module determines a suitable value of the quantization level according to the method for encoding. Starting from a low quantization level value, it evaluates the cost of the set of segments incrementally according to the predetermined evaluation order until the cost of the set of segments exceeds the target budget. When the cost of the set of segments has exceeded the target budget, the value of the quantization level is increased and an new evaluation of the cost of the set of segments is performed incrementally according to the predetermined evaluation order. When the cost of the set of segments has not exceeded the target budget after the cost of all segments of the set of segments has been evaluated, then a suitable value of the quantization level is found, which is transmitted to the packetizer module 3506. The data budget module 3510, the GCLI budget module 3511, and the sign budget module 3512 are respectively configured for computing the cost of a data segment, a GCLI segment and a sign segment for a given value of the quantization level. The quantization level selection module 3514 determines the current value of the quantization level. The rate allocation core module 3513 acts as a hub for facilitating the communication between the budget modules 3510-3512, the quantization level selection module 3514, and the packetizer module 3506. Preferably, the rate allocation module 3505 works precinct by precinct, i.e. witheach set of segments comprising coefficients belonging to a single precinct, so as to allow a low-latency encoding of the original image 3520.

[0410] The packetizer 3506 receives the suitable quantization value from the rate allocation module 3505, more precisely from the rate allocation core module 3513. The packetizer 3506 further receives header information from the header generation module 3507. Based on these elements as well as on the data, GCLI and sign information received from the corresponding modules, the packetizer 3506 first entropy encodes the data, GCLI and sign information using the suitable quantization value received from the rate allocation module 3505. Then, the packetizer 3506 packs the entropy-encoded information along with the header information in a so-called codestream for producing the portion of the encoded image 3530.

[0411] In summary, the fourth innovative improvement relates to a method, apparatus, and computer program for encoding at least one portion of an original image 3520 into a corresponding portion of an encoded image 3530 according to an encoding scheme in which an evaluation of a cost of segments of image coefficients is made according to a value of a quantization level, wherein said evaluation is performed in a budget computation step according to an incremental evaluation scheme based on a predetermined order. Combinations of innovative improvements

[0412] Four innovative improvements have been described herein. These innovative improvements may work independently or be combined. The innovative improvements described herein may advantageously be implemented, independently or in combination, in a computer system comprising a processor and a memory.

[0413] The present invention as defined in the claims relates primarily to the second innovative improvement. However, the invention may advantageously be combined with one or more other innovative improvements described herein, including particular embodiments thereof. The invention may comprise further combinations of innovative improvements than those explicitly stated in the claims. Particular embodiments and related advantages of an innovative improvement as disclosed herein may be applied mutatis mutandis when said innovative improvement is combined with one or several other innovative improvements.

[0414] It is detailed hereinbelow in relation with Fig.22 and / or Fig.23 how the innovative improvements described herein may be combined. On said figures, the present innovative improvements are respectively referred to by the following letters: - “A” for the first innovative improvement; - “B” for the second innovative improvement;- “C” for the third innovative improvement; - “D” for the fourth innovative improvement. Said letters are associated with dashed arrows on Fig.22 and Fig.23 to indicate a where the respective innovative improvements may advantageously be implemented in a block diagram of an encoder 4100 and a decoder 4200 for encoding or decoding an image.

[0415] Fig.22 schematically represents an encoder 4100 for encoding an image according to an embodiment. Fig.22 provides a block diagram of the encoder 4100. The encoder 4100 may be, for example, comprised in a communication device that can capture an image, or that can store an image, or both, such as, for example, a smartphone. The encoder 4100 may enable the communication device to efficiently transfer an image to another communication device via a communication channel that may be provided by a network.

[0416] The encoder 4100 may be configured for encoding at least one portion of an original image 4130 into a corresponding portion of an encoded image 4140 according to a method for encoding as described hereinabove. The encoder 4100 comprises a (forward) decorrelative transform module 4101 and an encoding module 4102. The decorrelative transform module 4101 comprises an optional (forward) color transform (CT) module 4110, and a (forward) discrete wavelet transform (DWT) module 4111 for producing image coefficients based on input image samples from the original image 4130. Image coefficients may also be referred to herein as wavelet coefficients. The CT module 4110 and the DWT module 4111 are optional and may be bypassed; if they are not present, then the image coefficients may simply be equal to the input image samples. The encoding module 4102 comprises a GCLI extraction module 4112, a rate allocation (RA) module 4113, a quantization and encoding (Q) module 4114, and a packing (P) module 4115. The quantization and encoding module 4114 is also simply referred to herein as the “Q module” 4114.

[0417] Modules 4101-4115 are software modules. Said modules should be interpreted as a way of distinguishing between different types of operations. Said modules may be comprised in a single system, i.e. the operations performed by said modules may be executed by a single processor. Said modules may also be comprised a distributed system, i.e. the operations performed by said modules may be executed by a plurality of processors.

[0418] The encoder 4100 basically operates as follows. The encoder 4100 receives an original image 4130, which comprises image samples. In response, the encoder 4100 outputs an encoded image 4140, which may be compressed, i.e. have a lower size, than the original image 4130.

[0419] An original image 4130 may be regarded as a matrix (or an array) of pixels, which comprises lines of pixels and columns of pixels. A pixel may comprise a plurality of color components, for example three color components, which, in combination, convey brightness information and color information pertaining to the pixel. The plurality of color components are expressed in accordance with a color coordinate system, such as, for example, the color coordinate system referred to as RGB, or the color coordinate system referred to as YCbCr. The color transform (CT) module 4110 converts color components of a pixel into another color coordinate system. Such a transform may reduce entropy. Accordingly, the CT module 4110 provides a color transformed image, which may have less entropy than the original image 4130. This may contribute to image compression.

[0420] The discrete wavelet transform (DWT) module 4111 applies a wavelet transform to the color transformed image. The wavelet transform may involve applying a cascade of wavelet-type filter operations for the image. Accordingly, the DWT module 4111 produces wavelet coefficients spatially related to samples of the original image 4130. Said wavelet coefficients may be grouped into subbands (also referred to herein as bands). The wavelet transform that the DWT module 4111 carries out may be similar to that in an existing wavelet- based image coding system, such as, for example, the image coding system known as JPEG XS. In particular, the wavelet transform may comprise a wavelet-type filter operation of the LeGall 5 / 3 type as described hereinabove.

[0421] The encoding module 4102 encodes the image coefficients produced by the decorrelative transform module 4101 and produces an encoded image 4140. To this end, the encoder 4100 may perform lossy compression, i.e. selectively removing information from the coefficients of the original image for producing the encoded image 4140. The encoded image 4140 contains all information enabling a decoder to reconstruct a decoded image similar to the original image 4130 before encoding, the difference between the original image 4130 and the decoded image being the loss of information due to the lossy compression. The encoding is performed with the best effort to minimize this loss of information under a target budget constraint.

[0422] The GCLI module 4112 computes GCLI values from the wavelet coefficients produced by the DWT module 4111, or more generally from the image coefficients produced by the decorrelative transform module 4101. GCLI values may also be referred to herein as bitplane count values. Herein, the terms “GCLI” and “bitplane count” are intended to describe the same concept and should therefore be construed as equivalent. These terms may be used interchangeably in the description and in the claims.

[0423] The RA module 4113 determines a suitable quantization level value 4120 so that the size of the encoded image 4140 remains below a target budget. The quantization level value 4120 is provided by the RA module 4113 to the Q module 4114. The Q module then quantizes the image coefficients based on the quantization level value 4120 provided by the rate allocation module 4113. Accordingly, the Q module 4114 provides quantized image coefficients. The Q module 4114 then applies entropy coding operations to the quantized image coefficients. In other words, the Q module 4114 entropy encodes the quantized image coefficients. The entropy coding operations may comprise, for example, operations described in document EP 2773122 A1 already mentioned hereinbefore. In that case, the Q module 4114 receives GCLI (or bitplane count) values from the GCLI module 4112. The GCLI values indicate zero-bitplanes in the (quantized) image coefficients. The Q module 4114 may then remove these zero-bitplanes. In effect, the zero-bitplanes may be replaced by the GCLI values indicating where these bitplanes lie in the quantized image coefficients. The Q module 4114 may also apply entropy coding operations to the GCLI values so that these values are expressed (or coded) with a lower number of bits. Document EP 2773122 A1 describes some entropy encoding techniques that may be used to that effect. In addition to removing zero- bitplanes, the Q module 4114 may also truncate bits or bitplanes in the quantized image coefficients. Such truncation may involve removing one or more least significant bits or bitplanes. Accordingly, the Q module 4114 provides encoded quantized image coefficients. Encoded quantized image coefficients are also simply referred to herein as “encoded coefficients”.

[0424] The packing module 4115 then packages (or packs) several types of data into the encoded image 4140. This includes the encoded coefficients provided by the Q module 4114. This may further include, for example, GCLI values, or entropy coded GCLI values, as well as the quantization level value 4120, or any other information enabling a decoder to decode the encoded image 4140. The encoded image 4140 may also be referred to as a “codestream” or a ”bitstream”. In particular, the encoded image 4140 may be a codestream compliant with a version of the JPEG XS standard, more particularly with a profile of the JPEG XS standard.

[0425] The first innovative improvement may advantageously be implemented in the packing module 4115 when packing the encoded coefficients, as indicated by the letter “A” and the associated dashed arrow in Fig.22.

[0426] The third innovative improvement may advantageously be implemented in the discrete wavelet transform (DWT) module 4111 when computing (or producing) wavelet coefficients, as indicated by the letter “C” and the associated dashed arrow in Fig.22.

[0427] The fourth innovative improvement may advantageously be implemented in the rate allocation (RA) module 4113, when determining a suitable quantization level value 4120, as indicated by the letter “D” and the associated dashed arrow in Fig.22.

[0428] The first, third, and fourth innovative improvements may advantageously be combined in an encoder such as the encoder 4100 for improving the computational efficiency of the encoding of at least one portion of an original image 4130 into a corresponding portion of an encoded image 4140.

[0429] Fig.23 schematically represents a decoder 4200 for decoding an encoded image according to an embodiment. Fig.23 provides a block diagram of the decoder 4200. The decoder 4200 may be, for example, comprised in a communication device that can display an image, such as, for example, a smartphone. The decoder 4200 may enable the communication device to efficiently receive an encoded image from another communication device via a communication channel that may be provided by a network. More precisely, the decoder 4200 may enable the communication device to receive the encoded image and decode it into a decoded image for displaying said decoded image.

[0430] The decoder 4200 may be configured for decoding at least one portion of an encoded image 4230 into a corresponding portion of a decoded image 4240 according to a method for decoding as described hereinabove. The encoded image 4230 in Fig.23 may correspond to the encoded imag...

Claims

Claims 1. Method for decoding an encoded image (4230), wherein the encoded image (4230) is obtainable by the steps of: - applying a wavelet-type transformation to a rectangular array of spatial image samples representing the image, the wavelet-type transformation comprising applying a cascade of wavelet-type filter operations at least one of which is applied in a vertical direction, the wavelet- type transformation producing wavelet coefficients that are spatially related to the spatial image samples in the rectangular array; - organizing the wavelet coefficients to obtain respective groups of wavelet coefficients that are spatially related to respective slices of the rectangular array of spatial image samples; and - entropy encoding the respective groups of wavelet coefficients independently from each other; wherein the method for decoding comprises: - providing respective processing channels that reconstruct from the wavelet coefficients respective strips of spatial image samples, each of the respective processing channels reconstructing a strip of spatial image samples independently from the other processing channels, the respective strips of spatial image samples corresponding at least in size to the respective slices of the rectangular array of spatial image samples, each of the respective processing channels applying a cascade of inverse wavelet-type filter operations independently from the other processing channels for reconstructing a strip of spatial image samples; and - supplying respective extended groups of wavelet coefficients to the respective processing channels, whereby the extended groups of wavelet coefficients mutually overlap to an extent that each extended group of wavelet coefficients comprises all the wavelet coefficients required for the processing channel receiving the extended group of wavelet coefficients to independently reconstruct a strip of spatial image samples.

2. Method for decoding an encoded image (4230) according to claim 1, wherein at least some of the respective strips of spatial image samples are spatially offset from the respective slices of the rectangular array of spatial image samples.

3. Method for decoding an encoded image (4230) according to claim 2, wherein at least some of the extended groups of wavelet coefficients each comprise wavelet coefficients from only two adjacent groups of wavelet coefficients spatially related to two adjacent slices of the rectangular array of spatial image samples, whereby said extended groups of wavelet coefficients each comprise one of the two groups of wavelet coefficients in its entirety and only a portion of the other one of the two groups of wavelet coefficients, the portion being adjacent to the one of the two groups of wavelet coefficients that is entirely comprised in the extended group of wavelet coefficients.

4. Method for decoding an encoded image (4230) according to any of claims 1 to 3, wherein the cascade of inverse wavelet-type filter operations comprises at least one inverse wavelet- type filter operation of the LeGall 5 / 3 type in the vertical direction.

5. Method for decoding an encoded image (4230) according to any of claims 1 to 4, wherein the decoding conforms with a JPEG XS standard.

6. Method for decoding an encoded image (4230) according to claim 5, wherein: - at least some of the respective strips of spatial image samples are spatially offset by one precinct from the respective slices of the rectangular array of spatial image samples; and - at least some of the extended groups of wavelet coefficients each comprise: - an entire group of wavelet coefficients spatially related to a slice of the rectangular array of spatial image samples; and - at least two precincts from an adjacent group of wavelet coefficients spatially related to an adjacent slice of the rectangular array of spatial image samples, the at least two precincts being adjacent to the entire group of wavelet coefficients comprised in the extended group of wavelet coefficients.

7. Method for decoding an encoded image (4230) according to claim 6, wherein: - the cascade of inverse wavelet-type filter operations comprises one inverse wavelet- type filter operation of the LeGall 5 / 3 type in the vertical direction; and - at least some of the extended groups of wavelet coefficients each comprise: - an entire group of wavelet coefficients spatially related to a slice of the rectangular array of spatial image samples; and- two precincts from an adjacent group of wavelet coefficients spatially related to an adjacent slice of the rectangular array of spatial image samples, the two precincts being adjacent to the entire group of wavelet coefficients comprised in the extended group of wavelet coefficients.

8. Method for decoding an encoded image (4230) according to claim 6, wherein: - the cascade of inverse wavelet-type filter operations comprises two inverse wavelet-type filter operations of the LeGall 5 / 3 type in the vertical direction; and - at least some of the extended groups of wavelet coefficients each comprise: - an entire group of wavelet coefficients spatially related to a slice of the rectangular array of spatial image samples; and - two precincts from an adjacent group of wavelet coefficients spatially related to an adjacent slice of the rectangular array of spatial image samples, the two precincts being adjacent to the entire group of wavelet coefficients comprised in the extended group of wavelet coefficients.

9. Method for decoding an encoded image (2210) according to any of the preceding claims, wherein said method further comprises the following steps for reconstructing a strip of spatial image samples from an extended group of wavelet coefficients in a processing channel, said strip of spatial image samples comprising respective decoded lines (2252) of image samples (2251): - grouping the wavelet coefficients of said extended group of wavelet coefficients into respective sets of coefficients spatially related to said respective decoded lines (2252) of image samples (2251); - providing a decoding module (2230) comprising an input line buffer (2231), a number of intermediate line buffers (2232, 2233) and an output line buffer (2234); - providing the respective sets of coefficients of the encoded image (2210) in the input line buffer (2231); - processing with the decoding module (2230) the respective sets of coefficients for producing intermediate results and final results according to a lifting scheme (2400) of an inverse wavelet-type filter operation applied in a vertical direction; - storing the intermediate results in the intermediate line buffers (2232, 2233);- providing the final results in the output line buffer (2234) as the respective decoded lines (2252) of image samples (2251) spatially related to the respective sets of coefficients, the respective decoded lines (2252) forming a sequence of decoded lines; wherein the number of intermediate line buffers (2232, 2233) is equal to the minimum number of intermediate line buffers (2232, 2233) required for producing the respective decoded lines (2252) of image samples (2251) according to the lifting scheme (2400).

10. Method according to the preceding claim, wherein the wavelet-type filter operation is a filter operation of the LeGall 5 / 3 type, and wherein the number of intermediate line buffers (2132, 2133) is smaller than five line buffers, preferably smaller than four line buffers, preferably smaller than three line buffers, preferably equal to two line buffers.

11. Method for decoding an encoded image (4230) according to any of the preceding claims, wherein said method further comprises executing the following steps in a processing channel for producing an extended group of wavelet coefficients from the encoded image (4230), wherein the extended group of wavelet coefficients comprises NCG groups of Ng coefficients, Ng being greater than or equal to two: D1) providing a sequence L' of bitplane counts, the sequence L' comprising a bitplane count for each one of the NCG groups (G1-G4) of Ng coefficients (10-43); D2) providing a set of Ng buffers (B1-B4, B5-B8) of at least K' bits each, wherein each buffer uniquely corresponds to a position of a coefficient in a group of Ng coefficients; D3) extracting Ng arrays of K' bits each from the encoded image (4230) into an intermediate data set; D4) deinterleaving said Ng arrays of the intermediate data set into said Ng buffers; D5) repeating the following steps until each buffer contains less bits than the next bitplane count in the sequence L' of bitplane counts: i. extracting a number of bits (100-434), preferably a number of consecutive bits, from each one of said Ngbuffers equal to the next bitplane count in the sequence L' of bitplane counts, thereby forming a group of Ngcoefficients; ii. adding said group of Ngcoefficients to the extended group of wavelet coefficients; iii. moving to the next bitplane count in the sequence L' of bitplane counts; D6) repeating steps D3) to D5) until NCGgroups of Ngcoefficients have been added to the extended group of wavelet coefficients.

12. Method according to claim 11, wherein bits from coefficients from at least two different groups (G1-G4) of coefficients are processed simultaneously in the deinterleaving step D4).

13. Method according to claim 11 or 12, wherein the deinterleaving of arrays of bits performed in step D4) comprises an operation performed on a plurality of said bits simultaneously.

14. Method according to any of claims 11 to 13, wherein the extraction of bits performed in step D5) comprises extracting a plurality of bits of a coefficient simultaneously from the buffer corresponding to said coefficient.

15. Method according to any of claims 11 to 14, wherein the extraction of bits performed in step D5) comprises extracting bits of a plurality of coefficients of a same group (G1-G4) of coefficients simultaneously from the respective buffers (B1-B4, B5-B8) corresponding to said plurality of coefficients.

16. Method according to any of claims 11 to 15, wherein the extraction of bits performed in step D5) comprises extracting bits of a plurality of coefficients of different groups (G1-G4) of coefficients simultaneously from the respective buffers (B1-B4, B5-B8) corresponding to said plurality of coefficients.

17. Computer program comprising instructions which, when the program is executed by a computer, cause the computer to carry out the method according to any of claims 1 to 16.

18. Decoder comprising a processor and a memory, and configured to perform the method according to any of claims 1 to 16.

Citation Information

Patent Citations

  • Information processing apparatus and information processing method

    US20090245384A1

  • Method and apparatus for clipping coefficient values after application of each wavelet transform

    US6898325B2

  • Memory-efficient image compression

    WO2001091039A1