Method, apparatus, and computer program product for encoding and decoding of digital media content

The division operation in video encoding is simplified by segmented approximation method, and the division operation complexity and calculation overhead in the prior art are solved, and the efficiency and performance of video encoding are improved.

CN119318144APending Publication Date: 2025-01-14NOKIA TECHNOLOGIES OY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380044342.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-06-07
Filing Date
2023-03-21
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

The existing video encoding system has complexity and high computational overhead when performing division operations, which is difficult to implement efficiently, especially in the cross-component linear model and cross-component convolution model that need to be frequently performed in video codecs, which affects the encoding efficiency. .

Method used

Use segmented approximation method to perform division operations. By looking up tables, polynomial functions, linear interpolation and other methods, the scaling parameters and shift parameters are approximate to simplify the division operation process, and use simpler operations such as multiplication, addition and displacement bits. Operations to calculate output values, reducing calculation burden and storage requirements.

Benefits of technology

It effectively reduces the complexity and calculation overhead of division operations, improves the efficiency and performance of video encoding, reduces the demand for hardware logic circuits and software implementation, and improves coding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119318144A_ABST
    Figure CN119318144A_ABST
Patent Text Reader

Abstract

Embodiments relate to a method of encoding / decoding, the method comprising: encoding / decoding (910) a picture comprising a number of samples, where the stages of encoding / decoding comprise a division operation; determining (920) numerators and denominators; determining (930) an approximate output of a division operation between the numerator and the denominator, wherein the determining comprises using a segmented approximation to derive a scaling parameter; deriving a shift parameter and a rounding parameter, and applying the scaling parameter, the shift parameter, and the rounding parameter to the molecule; a division operation is performed using (940) the approximation output in the stage of encoding / decoding. Embodiments also relate to an apparatus and a computer program product for implementing the method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present solution generally relates to encoding and decoding of digital media content, such as video or still image data. Background Art

[0002] This section is intended to provide a background or context to the invention described in the claims. The descriptions herein may include concepts that may be pursued, but not necessarily concepts previously conceived or pursued. Therefore, unless otherwise indicated herein, what is described in this section is not prior art to the description and claims in this application and should not be considered prior art by inclusion in this section.

[0003] A video coding system may include an encoder that converts an input video into a compressed representation suitable for storage / transmission and a decoder that can decompress the compressed video representation back into a viewable form. The encoder may discard some information in the original video sequence in order to represent the video in a more compact form, for example, to enable the video information to be stored / transmitted at a lower bit rate than might otherwise be required. Summary of the invention

[0004] The independent claims define the scope of protection of various embodiments of the present invention. Embodiments and features described in this specification that do not belong to the scope of the independent claims (if any) are to be construed as examples that help understand the various embodiments of the present invention.

[0005] Various aspects include a method, an apparatus, and a computer readable medium comprising a computer program stored therein, which are characterized by what is stated in the independent claims. Various embodiments are disclosed in the dependent claims.

[0006] According to a first aspect, there is provided an apparatus comprising: means for encoding / decoding a picture comprising a certain number of samples, wherein the encoding / decoding stage comprises a division operation; means for determining a numerator and a denominator; means for determining an approximate output of the division operation between the numerator and the denominator, wherein the means for determining comprises:

[0007] o means for deriving a scaling parameter using a piecewise approximation,

[0008] o means for deriving a shift parameter and a rounding parameter, and

[0009] o means for applying scaling parameters, shifting parameters, and rounding parameters to the numerator;

[0010] Means for performing division operations using the approximate output in said encoding / decoding stages.

[0011] According to a second aspect, a method is provided, the method comprising: encoding / decoding a picture comprising a certain number of samples, wherein the encoding / decoding stage comprises a division operation; determining a numerator and a denominator; determining an approximate output of the division operation between the numerator and the denominator, wherein the determination comprises:

[0012] ο Use piecewise approximation to derive the scaling parameters,

[0013] o derives a shift parameter and a rounding parameter, and

[0014] ο applying scaling parameters, shifting parameters, and rounding parameters to the numerator;

[0015] The approximate output is used for division operation in the encoding / decoding stage.

[0016] According to a third aspect, there is provided an apparatus comprising at least one processor, a memory comprising computer program code, the memory and the computer program code being configured to, together with the at least one processor, cause the apparatus to at least perform the following: encode / decode a picture comprising a certain number of samples, wherein the encoding / decoding stage comprises a division operation; determine a numerator and a denominator; determine an approximate output of the division operation between the numerator and the denominator, wherein the apparatus is further caused to:

[0017] ο Use piecewise approximation to derive the scaling parameters,

[0018] o derives a shift parameter and a rounding parameter, and

[0019] ο applying scaling parameters, shifting parameters, and rounding parameters to the numerator;

[0020] The approximate output is used for division operation in the encoding / decoding stage.

[0021] According to a fourth aspect, there is provided a computer program product comprising computer program code configured to, when executed on at least one processor, cause an apparatus or system to:

[0022] Encoding / decoding a picture including a certain number of samples, wherein the encoding / decoding stage includes a division operation; determining a numerator and a denominator; determining an approximate output of the division operation between the numerator and the denominator, wherein the apparatus is further caused to:

[0023] ο Use piecewise approximation to derive the scaling parameters,

[0024] o derives a shift parameter and a rounding parameter, and

[0025] ο applying scaling parameters, shifting parameters, and rounding parameters to the numerator;

[0026] The approximate output is used for division operation in the encoding / decoding stage.

[0027] According to one embodiment, the encoding / decoding stage comprises: predicting at least one sample of a picture.

[0028] According to one embodiment, the encoding / decoding stage comprises filtering.

[0029] According to one embodiment, additional shift parameters are applied to the numerator.

[0030] According to one embodiment, it is determined when a numerator, a denominator, a scaling parameter, and an output parameter have different bit precisions, wherein the bit precision of the output, and the scaling parameter are used in determining the approximate output.

[0031] According to one embodiment, the scaling parameter is determined using one of the following: an interpolation operation; a polynomial process; a linear interpolation.

[0032] According to one embodiment, the method is configured to determine the scaling parameter between at least two values ​​determined based on a table lookup using an interpolation operation.

[0033] According to this embodiment, the scaling parameter is adjusted with a value to reduce the range of the denominator.

[0034] According to one embodiment, a computer program product is embodied on a non-transitory computer readable medium. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Hereinafter, various embodiments will be described in more detail with reference to the accompanying drawings, in which

[0036] Figure 1 An example of the encoding process is shown;

[0037] Figure 2 An example of the decoding process is shown;

[0038] Figure 3 An example of a lookup table for values ​​M=14 and N=8 is shown;

[0039] Figure 4 An example of a lookup table for values ​​M=12 and N=8 is shown;

[0040] Figure 5 An example of a lookup table for values ​​M=14 and N=6 is shown;

[0041] Figure 6 An example of a lookup table for values ​​M=14 and N=2 is shown;

[0042] Figure 7a , Figure 7bAn example of a linear regression model calculated for values ​​of M=14 and N=2 is shown;

[0043] Figure 8 is a flow chart illustrating a method according to an embodiment;

[0044] Fig. 9 is a flow chart illustrating a method according to another embodiment; and

[0045] Fig.10 An apparatus according to an embodiment is shown. DETAILED DESCRIPTION

[0046] In the following, several embodiments will be described in the context of a video coding arrangement. However, it should be noted that the present embodiments are not necessarily limited to this particular arrangement. The embodiments discussed in this specification relate to intra-frame prediction in video or still image coding using sparse linear cross-component regression, which may even be other signal processing than image / video compression.

[0047] The following description and drawings are illustrative and should not be construed as unnecessary limitations. Specific details are provided for a thorough understanding of the present disclosure. However, in some cases, in order to avoid obscuring the description, well-known or conventional details are not described. In the present disclosure, references to an embodiment or embodiments may be, but are not necessarily, references to the same embodiment, and such references represent at least one embodiment.

[0048] Reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment of the invention is included in at least one embodiment of the present disclosure.

[0049] A video codec consists of an encoder and a decoder. The encoder is configured to convert the input video into a compressed representation suitable for storage / transmission. The decoder is able to decompress the compressed video representation back into a viewable form. The encoder may discard some information in the original video sequence in order to represent the video in a more compact form, such as at a lower bit rate.

[0050] In most cases, the basic unit for the input of the encoder and the output of the decoder, respectively, is a picture. A picture as input to the encoder may also be referred to as a source picture, and a picture decoded by the decoder may be referred to as a decoded picture or a reconstructed picture.

[0051] Both the source picture and the decoded picture consist of one or more sample arrays, such as one of the following sets of sample arrays:

[0052] - Luminance (Y) only (monochrome);

[0053] - Luma and dual chroma (YCbCr or YCgCo);

[0054] - Green, blue, and red (GBR, also called RGB);

[0055] - arrays representing other unspecified monochromatic or tristimulus color sampling (e.g., YZX,

[0056] Also known as XYZ).

[0057] A picture can be defined as a frame or a field. A frame consists of a matrix of luma samples and possibly corresponding chroma samples. A field is a collection of alternating sample rows of a frame, and can be used as encoder input when the source signal is interlaced. The chroma sample array may not be present (and therefore monochrome sampling may be used), or the chroma sample array may be subsampled compared to the luma sample array.

[0058] A bitstream can be defined as a sequence of bits, which in some coding formats or standards may be in the form of a network abstraction layer (NAL) unit stream or a byte stream, which forms a representation of coded pictures and associated data, which form one or more coded video sequences. The first bitstream may be followed by a second bitstream in the same logical channel, such as in the same file or the same connection of a communication protocol. An elementary stream (in the context of video coding) may be defined as a sequence of one or more bitstreams. In some coding formats or standards, the end of the first bitstream may be indicated by a specific NAL unit, which may be referred to as an end-of-bitstream (EOB) NAL unit and is the last NAL unit of the bitstream.

[0059] The phrase "along the bitstream" (e.g., indicating along the bitstream) or along the coding units of the bitstream (e.g., indicating along the coding blocks) may be used in the claims and described embodiments to refer to transmission, signaling, or storage in a manner that "out-of-band" data is associated with the bitstream or coding units, respectively, but is not included therein. The phrases decoding along the bitstream or along the coding units of the bitstream, etc. may refer to decoding the referenced out-of-band data associated with the bitstream or coding units, respectively (which may be obtained from the out-of-band transmission, signaling, or storage). For example, the phrase along the bitstream may be used when the bitstream is contained in a container file, such as a file conforming to the ISO base media file format, and certain file metadata is stored in the file in a manner that associates the metadata with the bitstream, such as a box in a sample entry of a track containing the bitstream, a sample group of a track containing the bitstream, or a timed metadata track associated with a track containing the bitstream.

[0060] Hybrid video codecs (e.g., ITU-T H.263 and H.264) can encode video information in two stages. First, the pixel values ​​in a certain picture area (or "block") are predicted, for example, by motion compensation means (finding and indicating the area in one of the previously encoded video frames that closely corresponds to the block being encoded) or by spatial means (using the pixel values ​​around the block to be encoded in a specified manner). In the first stage, predictive coding can be applied, for example, as so-called sample prediction and / or so-called syntax prediction. In sample prediction, pixels of sample values ​​in a certain picture area or "block" are predicted. For example, these pixels or sample values ​​can be predicted using one or more of motion compensation or intra-frame prediction mechanisms. Second, the prediction error (i.e., the difference between the predicted pixel block and the original pixel block) is encoded. This can be achieved by converting the difference in pixel values ​​into a specified transform (e.g., discrete cosine transform (DCT) or its variant), quantizing coefficients, and entropy encoding the quantized coefficients. By varying the fidelity of the quantization process, the encoder can control the balance between the accuracy of the pixel representation (picture quality) and the size of the final encoded video representation (file size or transmission bit rate).

[0061] An example of the encoding process is Figure 1 as shown in . Figure 1 The image to be encoded (I n ); The predicted representation of the image block (P' n ); prediction error signal (D n ); reconstructed prediction error signal (D' n ); Preliminary reconstructed image (I' n ); Final reconstructed image (R' n ); conversion (T) and inverse conversion (T -1 ), quantization (Q) and inverse quantization (Q -1 ); Entropy coding (E); Reference frame memory (RFM); Inter-frame prediction (P inter ); intra prediction (P intra ); mode selection (MS) and filtering (F).

[0062] In some video codecs such as H.265 / HEVC, a video picture is divided into coding units (CUs) covering areas of the picture. A CU includes one or more prediction units (PUs) defining a prediction process for samples within the CU and one or more transform units (TUs) defining a prediction error coding process for samples in the CU. A CU may include a square block of samples, the size of which may be selected from a set of predefined possible CU sizes. A CU with the maximum allowed size may be named an LCU (largest coding unit) or a CTU (coding tree unit), and a video picture may be divided into non-overlapping CTUs. A CTU may also be split into a combination of smaller CUs, for example, by recursively splitting a CTU and the resulting CU. Each resulting CU may have at least one PU and at least one TU associated with it. Each PU and TU may also be split into smaller PUs and TUs to increase the granularity of the prediction and prediction error coding processes, respectively. Each PU has prediction information associated with it to define which prediction will be applied to the pixels within the PU (e.g., motion vector information for an inter-prediction PU and intra-prediction directionality information for an intra-prediction PU). Similarly, each TU is associated with information describing the prediction error decoding process for the samples within the TU (including, for example, DCT coefficient information). Whether or not prediction error coding is applied to each CU can be signaled at the CU level. If there is no prediction error residual associated with a CU, then the CU can be considered to have no TUs. The division of an image into CUs and the division of a CU into PUs and TUs can be signaled in the bitstream to enable a decoder to reproduce the expected structure of these units.

[0063] The decoder can reconstruct the output video by applying a prediction component similar to the encoder to form a predicted representation of the pixel block (using the motion or spatial information created by the encoder and stored in the compressed representation) and prediction error decoding (the inverse operation of prediction error encoding, recovering the quantized prediction error signal in the spatial pixel domain). After applying the prediction and prediction error decoding components, the decoder is configured to add the prediction and prediction error signals (pixel values) to form the output video frame. The decoder (and encoder) may also apply additional filtering components to improve the quality of the output video before passing the output video for display and / or storing the output video as a prediction reference for upcoming frames in the video sequence. An example of the decoding process is shown in FIG. Figure 2 as shown in . Figure 2 The predicted representation of the image block (P' n ); reconstructed prediction error signal (D' n ); Preliminary reconstructed image (I' n ); Final reconstructed image (R' n ); inverse conversion (T -1 ); inverse quantization (Q -1 ); Entropy decoding (E-1 ); reference frame memory (RFM); prediction (inter or intra) (P); and filtering (F).

[0064] As an alternative or supplement to the method of indicating the coded sample value using sample value prediction and conversion coding, palette-based coding can also be used. Palette-based coding refers to a series of methods in which a palette, i.e., a set of colors and related indexes, is defined, and the value of each sample in the coding unit is represented by indicating its index in the palette. Palette-based coding can achieve good coding efficiency in coding units with a relatively small number of colors (such as image areas representing computer screen content, such as text or simple graphics). In order to improve the coding efficiency of palette coding, different types of palette index prediction methods can be used, or the palette index can be run-length encoded so that larger uniform areas can be efficiently represented. In addition, if the CU contains sample values ​​that are not repeated within the CU, escape coding can be used. The transmission of escape-coded samples does not refer to any palette index. Instead, their values ​​can be indicated individually for each escape-coded sample.

[0065] When a CU is encoded in palette mode, various prediction strategies are used to exploit the correlation between pixels within the CU. For example, mode information can be signaled for each row or pixel to indicate one of the following: the mode can be horizontal mode, which means that a single palette index is signaled and the entire pixel row shares the index; the mode can be vertical mode, in which the entire pixel row is the same as the above row, and no additional information is signaled; the mode can be normal mode, in which a flag is signaled for each pixel position to indicate whether it is the same as one of the left and other pixels, and if not, the color index itself is sent separately.

[0066] In a video codec, motion information can be indicated by a motion vector associated with each motion compensated image block. Each of these motion vectors can represent the displacement of an image block in a picture to be encoded (on the encoder side) or decoded (on the decoder side), and the displacement of a prediction source block in one of the pictures previously encoded or decoded. In order to efficiently represent motion vectors, these motion vectors can be differentially encoded relative to block-specific prediction motion vectors. In a video codec, prediction motion vectors can be created in a predefined manner, such as calculating decoded motion vectors of media or adjacent blocks of an encoder. Another method for creating motion vector predictions is to generate a candidate prediction list from adjacent blocks and / or collocated blocks in a temporal reference picture, and signal the selected candidate as a motion vector predictor. In addition to predicting motion vector values, reference indexes of previously encoded / decoded pictures can also be predicted. Reference indexes can be predicted based on adjacent blocks and / or collocated blocks in a temporal reference picture. Furthermore, the high efficiency video codec may employ an additional motion information encoding / decoding mechanism, generally referred to as merge mode, in which all motion field information, including motion vectors and corresponding reference picture indices for each available reference picture list, is predicted and used without any modification / correction. Similarly, motion field information prediction may be performed using motion field information of neighboring blocks and / or collocated blocks in temporal reference pictures, and the used motion field information may be signaled in a list of motion field candidate lists populated with motion field information of available neighboring / collocated blocks.

[0067] Video codecs may support motion compensated prediction from one source image (uni-prediction) and from two sources (bi-prediction). In the case of uni-prediction, a single motion vector may be applied, while in the case of bi-prediction, two motion vectors may be signaled and the motion compensated predictions from the two sources may be averaged to create the final sample prediction. In the case of weighted prediction, the relative weights of the two predictions may be adjusted or a signaled offset may be added to the prediction signal.

[0068] In addition to applying motion compensation to inter-picture prediction, a similar approach can also be applied to intra-picture prediction. In this case, the displacement vector indicates where a block of samples can be copied from the same picture to form a prediction of the block to be encoded or decoded. This intra-block copying approach can significantly improve coding efficiency in the presence of repetitive structures within a frame, such as text or other graphics.

[0069] In a video codec, the prediction residuals after motion compensation or intra prediction can be first transformed with a transform kernel (such as DCT "discrete cosine transform") and then encoded. The reason for this is that there is usually still some correlation between the residuals, and in many cases, the transform can help reduce this correlation and provide more efficient coding.

[0070] Video encoders can use Lagrangian cost functions to find the best coding mode, e.g., desired macroblock mode and associated motion vectors. This cost function uses a weighting factor λ to relate the (exact or estimated) image distortion caused by the lossy coding method to the (exact or estimated) amount of information needed to represent the pixel values ​​in the image region:

[0071] C = D + λR (Equation 1)

[0072] where C is the Lagrangian cost to be minimized, D is the image distortion (e.g., mean square error) taking into account mode and motion vectors, and R is the number of bits required to represent the data needed to reconstruct the image block in the decoder (including the amount of data used to represent the candidate motion vectors).

[0073] Scalable video coding refers to a coding structure in which one bitstream can contain multiple representations of content at different bitrates, resolutions, or frame rates. In these cases, the receiver can extract the desired representation based on its characteristics (e.g., the resolution that best matches the display device). Alternatively, a server or network element can extract part of the bitstream to be sent to the receiver based on, for example, the network characteristics or processing capabilities of the receiver. A scalable bitstream can include a "base layer" that provides the lowest quality video available and one or more enhancement layers that can improve the video quality when received and decoded with the lower layers. In order to improve the coding efficiency of the enhancement layer, the coded representation of the layer can depend on the lower layers. For example, the motion and mode information of the enhancement layer can be predicted from the lower layers. Similarly, the pixel data of the lower layer can be used to create a prediction of the enhancement layer.

[0074] A scalable video codec for quality scalability (also known as signal-to-noise ratio or SNR) and / or spatial scalability can be implemented as follows. For the base layer, a conventional non-scalable video encoder and decoder are used. The reconstructed / decoded pictures of the base layer are included in the reference picture buffer for the enhancement layer. In H.264 / AVC, HEVC, and similar codecs that use (multiple) reference picture lists for inter-frame prediction, the base layer decoded pictures can be inserted into (multiple) reference picture lists for encoding / decoding the enhancement layer pictures similarly to the decoded reference pictures of the enhancement layer. Therefore, the encoder can select the base layer reference picture as an inter-frame prediction reference and can indicate its use in the coded bitstream with a reference picture index. The decoder decodes the base layer picture from the bitstream (e.g., from the reference picture index) to be used as an inter-frame prediction reference for the enhancement layer. When the decoded base layer picture is used as a prediction reference for the enhancement layer, it is called an inter-layer reference picture.

[0075] In addition to quality scalability, the following scalability modes exist:

[0076] - Spatial scalability: Base layer pictures are coded at a lower resolution than enhancement layer pictures.

[0077] - Bit depth scalability: The coding bit depth of base layer pictures is lower (e.g., 8 bits) than that of enhancement layer pictures (e.g., 10 or 12 bits).

[0078] - Chroma format scalability: Enhancement layer pictures provide higher chroma fidelity (eg, encoded in 4:4:4 chroma format) than base layer pictures (eg, 4:2:0 format).

[0079] In the above scalability case, the base layer information can be used to encode the enhancement layer to minimize the additional bit rate overhead.

[0080] Scalability can be achieved in two ways: a) by introducing new coding modes for performing prediction of pixel values ​​or syntax from the lower layers of the scalable representation; or b) by placing lower layer pictures into the reference picture buffer (decoded picture buffer DPB) of the higher layer. Method a) is more flexible and can therefore provide better coding efficiency in most cases. However, method b), i.e. reference frame based scalability, can be implemented very efficiently with minimal changes to the single layer codec while still achieving most of the available coding efficiency gains. The reference frame based scalability codec can be implemented using the same hardware or software implementation for all layers, with only DPB management being done by external means.

[0081] In order to be able to take advantage of parallel processing, images can be split into independently encodable and decodable image segments (slices or tiles). A slice may refer to an image segment consisting of a certain number of basic coding units that are processed in a default encoding or decoding order, while a tile may refer to an image segment defined as a rectangular image area that is processed, at least to some extent, as an individual frame.

[0082] Video can be encoded in YUV or YCbCr color space, which reflects some characteristics of the human visual system and allows the use of lower quality Cb and Cr channel representations because human perception is less sensitive to the chrominance fidelity of these channel representations.

[0083] Different parts of a video codec may need to use a division operation or an approximation of such an operation. For example, in the Versatile Video Coding (VVC / H.266) standard, a cross-component linear model (CCLM) is used as a linear model for predicting samples in the chrominance channels (e.g., Cb and Cr) based on the reconstructed luma samples. The prediction model for the CCLM can be

[0084] predC (i, j) = α·re L ′(i, j)+β

[0085] where pred C (i, j) represents the predicted chrominance sample in the coding unit, rec L ′(i, j) represents the downsampled reconstructed luma samples of the same coding unit.

[0086] The parameters α and β are derived from at most four adjacent chroma samples and their corresponding downsampled luma samples as follows:

[0087]

[0088] β=Y b -α·X b

[0089] Therefore, when calculating CCLM parameters, a division operation is usually required. The division operation can be implemented using a lookup table.

[0090] On the other hand, in the cross-component convolutional model (CCCM), division operations are usually also required when filtering the prediction coefficients.

[0091] The division operation is a relatively complex operation that is implemented on a hardware-based video codec implementation and requires additional logic circuitry, or implemented in a software-based implementation running on a general-purpose processor and requires additional cycles to perform the division operation.

[0092] For example, the division operation required by the cross-component linear model prediction (CCLM) used in the VVC / H.266 and ECM 3.0 video codecs uses a table-based approach to approximate the division operation. In this approach, a lookup table of 2^4=16 entries is used to derive 4-bit valid values ​​that approximate the inverse of the input with an accuracy of 1 / 2^4.

[0093] The present embodiment is intended to determine scaling values ​​and shift values ​​that can be used for approximate division operations, for example, in video encoding applications. The method includes decoupling the precision of the entries and the size of the lookup table used to generate an approximate reciprocal for the input data. Therefore, when the lookup table is used to derive an M-bit effective value, the size of the lookup table is configured to be less than 2^M entries. The effective values ​​of the intermediate entries are not included in the table, but are obtained by rounding to existing entries in the table or interpolating using a set of existing entries in the lookup table. Both rounding of existing entries and interpolation of existing entries provide a segmented representation of the relationship between input and output scaling values.

[0094] An alternative method for deriving the value of an entry is to use a polynomial (e.g., power of 2) function. In particular, if the form of the polynomial function and its parameters are carefully chosen, implementing the polynomial function using low bit precision integer arithmetic can generate accurate results with minimal impact of parameterization errors. This allows a video encoder or video decoder to generate a high accuracy estimate for the result of a division operation with minimal computational burden and minimal memory requirements for the required lookup table(s). Performance can be further improved by creating a segmented model using different approximations for different segments of the input value, where each segment has its own polynomial function.

[0095] The method operating in accordance with the present invention uses an undersampled lookup table to determine an approximate output of a division operation. That is, the goal is to compute an output value that closely represents the result of a division operation between the numerator nom and the denominator denom by using simpler operations such as multiplication, addition, and bit shift operations:

[0096] output≈nom / denom.

[0097] Therefore, the present embodiment provides a non-division inverse function. Typically, the output is approximated by deriving release, rounding, and shift parameters so that the output can be calculated as:

[0098] output=(nom*scale+round)>>shift

[0099] If the inputs (nom and denom) and outputs of an operation use fixed-point arithmetic, an additional shift can be performed on the nom value to align the decimal bits of the input and output:

[0100] output=((nom<<shiftDecim)*scale+round)>>shift

[0101] In this case, the value of shiftDecim can be configured as a function of the number of digits used to represent the decimal portion of a number. The value of shifttDecim can also depend on other parameters, such as the precision of the scaling value used in the equation.

[0102] The rounding parameter round in the equation can be used to increase the precision of the calculation and can be set, for example, as follows:

[0103] round=1<<shift>>1, or

[0104] round=1<<(Shift-1), or

[0105] rouund=0

[0106] In the general case, when the nom, denom, scale, and output parameters have different bit precisions, the output value can be calculated using the following equation, where N_output and N_scale are the bit precisions or the number of bits used to represent the fractional part of the output and scaling parameters, respectively. And the rounding parameter is calculated using (shift+N_scale)

[0107] output=((nom<<(N_denom+N_output))*scale+round)>>(shift+N_scale+N_nom)

[0108] round=1<<(shift+N_scale+N_nom-1)

[0109] Alternative methods for calculating the output are as follows:

[0110] delta_shift=(shift+N_scale+N_nom)-(N_denom+N_output)output=(delta_shift>0)?

[0111] (nom*scale+round)>>(delta_shift): (nom*scale+round)<<(delta_shift)round=(delta_shift>0)?

[0112] 1<<(delta_shift-1): 0

[0113] If the scaling is set to zero, it can naturally be omitted from the equation, resulting in a less accurate result, but it can also save the number of operations required to calculate the output value.

[0114] The shift parameter shift can be configured in different ways. For example, it can be set equal to the logarithm of 2 of the denominator denom. The logarithm of 2 can be configured to round down to the nearest integer value. Alternatively, it can be rounded to the nearest integer value or it can be rounded up to the nearest integer value. Alternatively, the shift can be configured to also include a term associated with the precision of the scaling parameter. For example, if the scaling parameter is represented by an M-bit integer, the shift parameter can be configured to compensate for this by adding M to the logarithm of 2 of the denominator.

[0115] shift=floorLog2(denom), or

[0116] shift=floorLog2(denom)+M

[0117] where floorLog2 is a function that returns the closest integer less than or equal to the base-2 logarithm of the input parameter denom.

[0118] The scaling value can be determined in different ways. One alternative is to use a lookup table that represents values with M-bit (or N_scale-bit) precision between 1 and one-half. That is, in the table, for a selected M, the value 2^M represents 1 and the value 2^(M - 1) represents one-half. Since values in such a range vary between 2^(M - 1) and 2^M, the values in the table can optionally be reduced by 2^(M - 1) to reduce the storage bit depth required for the table. In this case, when reading a value from the table, 2^(M - 1) can be added back to the read value to restore the values over the entire range. Such addition can also be performed by a bitwise "OR" operation between the value read from the table and the value of 2^(M - 1).

[0119] The size of the table is chosen to be less than 2^M so that, compared to a full-size table with 2^M entries, operations can be performed using less memory. For example, a table of size 2^N or (2^N)+1 can be chosen, where N < M. The difference D between the table entry precision parameter M and the table size parameter N represents the subsampling ratio between the "full" 2^M table that would typically be required for M-bit scaling values and the actual table size 2^N. Let:

[0120] D = M - N

[0121] The subsampling ratio 2^(M - N) between the tables can be expressed as 2^D.

[0122] For example, the entries in such a lookup table can be determined using the following pseudocode:

[0123]

[0124] where << is used to represent a bitwise left shift operation, x += y is used to represent adding the value of y to the value of x. double(x) is used to represent converting an integer to a double-precision floating-point number, and round(x) represents rounding to the nearest integer value.

[0125] Thus, the lookup table T can have the values as Figure 3 shown (where M = 14 and N = 8).

[0126] In another example, values M = 12 and N = 8 are chosen, where the lookup table T will be as Figure 4 shown.

[0127] As another example, choosing M = 14 and N = 6, the lookup table T can be configured as Figure 5 shown.

[0128] As another example, choose M=14 and N=2, the lookup table T can be configured as follows Figure 6 as shown in .

[0129] It should be understood that such a lookup table may be generated using different parameters and different algorithms for M and N. For example, different rounding methods may be used, or calculations of different precisions may be used to determine the values ​​in the lookup table.

[0130] An alternative method for calculating the entries in the lookup table is to use linear regression. There are 2^D-1 scaling values ​​missing between the entries in the lookup table. In other words, there are 2^D-1 scaling values ​​missing before and after each entry. Therefore, a linear regression model can be calculated for each side of each entry, and then the value of the entry point can be evaluated based on these two regression models to calculate two values. The value of the entry can then be set to the average of these two values. For example, when M=14 and N=2, there are four sections, and the regression models for the first and second sections are as follows: Figure 7a and Figure 7b . The values ​​of the second entry using the first regression model and the second regression model are evaluated to be 12996.72 (i.e., -0.7964*20480+29306.85) and 13039.67 (i.e., -0.5317*20480+23929.43), respectively. The final value of the entry can then be the average of these two values, i.e., truncated to (12996.72+12996.72) / 2=13018.12, which can be truncated to 13018. This value is slightly lower than the value created using the previous method (i.e., 13107). As a result of this method, the lookup table T can be configured, for example, as follows:

[0131]

[0132] The table constructed in this manner represents scaled values ​​subsampled by a factor of 2^D, and the missing 2^D-1 scaled values ​​between the scaled values ​​included in the table can be determined using interpolation. Alternatively, to achieve lower complexity but lower precision of the output, the denominator can be mapped to the nearest available entry in the table or the nearest available entry in the table obtained by rounding. Using linear 2-tap interpolation, the approximate output of the division operation between the numerator nom and the denominator denom can be determined, for example, as shown below:

[0133] / / Phase 1

[0134]

[0135] / / Phase 2

[0136] D=MN

[0137] diffFull=normDiff>>D

[0138] diffFrac=normDiff&((1< <D)-1)

[0139] tapRound=1<<D>>1

[0140] scale0 = T[diffFull]

[0141] scale = T[diffFull+1]

[0142] scale=scale0+((diffFrac*(scale1-scale0)+tapRound)>>D)

[0143] / / Phase 3

[0144] output=((nom<<(FP_BITS-M))*scale+round0)>>Shift0

[0145] In this case, as described above, the operation sequence can be considered to have three stages. In stage 1, shift0 and normDiff parameters are determined. This represents the tabulation of the input denominator denom to a series of data. The normDiff parameter is configured to map the denominator denom to the precision of the table entry precision parameter M. In stage 2, normDiff is split into a full entry parameter diffFull and a fractional entry parameter diffFrac. The full entry parameter diffFull is used to identify the entry in table T, and the fractional entry parameter diffFrac is used to determine the final scaling parameter based on the entry read from table T or the parameter generated according to the entry read from table T. Parameters scale0 and scale1 are determined using table T at entry positions diffFull and diffFull+1, respectively. The final scaling parameter scale is then calculated based on scale0, scale1, and the fractional entry part diffFrac using linear interpolation. In the final stage 3, the output is calculated based on release, rounding, and shift parameters. If a fixed-point representation with a decimal point of FP_BITS is used, the numerator nom can be adjusted by moving left (FP_BITS-M) before multiplying by scale. Alternatively, the final shift value may be set to shift0+M, and the final rounding parameters calculated based on the new final shift. In this alternative, the output of stage 3 may be determined as:

[0146] / / Phase 3, Alternative 1

[0147] shift=shift0+M

[0148] round=1<<shift>>1

[0149] output=((nom<<FP_BITS)*scale+round)>>shift

[0150] Alternatively, if the computation does not use fixed-point representation, it can be simplified further, for example:

[0151] / / Stage 3, Alternative 2

[0152] shift=shift0+M

[0153] round=1<<shift>>1

[0154] output=(nom*scale+round)>>shift

[0155] In all of these examples, rounding can naturally be configured to be done in different ways. For example, the parameter round or round0 can be set to 0, or to another value derived using shift or other parameters.

[0156] The interpolation in stage 2 may also be performed differently. For example, it may include more than two entries in table T in the calculation of different coefficients based on the diffFrac value. It is also possible to calculate a weighted sum of entries read from table T or parameters derived from values ​​in table T, for example, as shown below:

[0157] / / Phase 2, Alternative 1

[0158] D=MN

[0159] diffFull=normDiff>>D

[0160] diffFrac=normDiff&((1< <D)-1)

[0161] tapSum=1< <D

[0162] tapRound=1< <d>>1

[0163] scale0=T[diffFullI

[0164] scale1 = T[diffFull+1]

[0165] w0=tapSum-diffFrac

[0166] w1=diffFrac

[0167] scale=(w0*scale0+w1*scale1+tapRound)>>D

[0168] Instead of or in addition to using an interpolation operation to refine the scaling value in stage 2, alternative methods may be used, such as methods based on derivatives of the scaling function.

[0169] As a further simplification, the interpolation performed in stage 2 can be omitted. In this case, the table size parameter N can be advantageously used during the first stage calculation of the normDiff parameters, and the table entry precision parameter M can only be used to determine the final shift and optional rounding parameters. This example can be illustrated in pseudo code as follows:

[0170] shift0 = floorLog2(denom)

[0171] round0=1<<shift0>>1

[0172] normDiff=(((denom<<N)+round0)> >shift0)&((1< <N)-1)scale=T[normDiff]

[0173] shift=shift0+M

[0174] round=1<<shift>>1

[0175] output=(nom*scale+round)>>shift

[0176] Likewise, if one operates with fixed-point numbers with decimal places as FP_BITS, the final shift can be equal to floorLog2(denom), and the effect of the decimal point can be handled as part of the scaling of the numerator nom, as follows:

[0177] shift = floorLog2(denom)

[0178] round=1<<shift>>1

[0179] normDiff=(((denom<<N)+round)> >shift)&((1< <N)-1)

[0180] scale = T[normDiff]

[0181] output=((nom<<(FP_BITS-M)*scale+round)>>shift

[0182] If the same division operation with the same denominator needs to be performed on several different numerators, the scale and shift values ​​can be calculated by reusing these values ​​only when performing the division operation. In this way, the number of computation operations can be significantly reduced, because most of the operations required are related to calculating the scale and shift values, while the actual operations to calculate the output only require multiplication by scale and shifting by shift, with optional additional shifting and rounding.

[0183] An alternative method for calculating scaling is to use piecewise polynomial estimation or polynomial interpolation. In this case, the range of the input data is divided into multiple regions (e.g., 4 or 8 regions) and a polynomial function is used to estimate the scaling value. For example, for a 2nd power polynomial function, the scaling value can be estimated using the following equation:

[0184]

[0185] Where a0, a1, a2, b1, and b2 are predefined values ​​for the model for each region, and "^" is a 2-power operation. The values ​​of a0, a1, and a2 can be calculated using regression and MSE minimization. Parameter b2 can be defined in a way that minimizes or reduces the dynamic range of (normDiff-b2), for example, b2 can be set to the middle value of normDiff in the region.

[0186] In order to benefit from integer operations, the parameters can be converted to integer values ​​with a specific bit precision. In this case, the scaling value can be calculated as follows, where n1 and n2 are the number of precision bits of a1 and a2 respectively. In this case, these parameters can be quantized to this precision bit. The value of b2 can be selected in such a way that the original (fractional) parameter of a2 is quantized to an integer value with minimum quantization error.

[0187] scale=a2*(((normDiff-b2)^2)>>n2)+a1*((normDiff-b1)>>n1)+a0

[0188] Powers of 2 can have a large dynamic range. To limit their dynamic range and the number of bits required for arithmetic operations, the powers of 2 can be right-shifted by a predefined number of shifts. In special cases, this number of shifts can be set to the bit depth of the normDiff parameter. In general, the right shift can be performed in two steps using the following equation to maintain the best accuracy in the calculation of the scaling parameters.

[0189] scale=((a2*(((normDiff-b2)^2)>>n21))>>n22)+((a1*((normDiff-b1)>>n11))>>n12)+a0

[0190] In special cases, b1 and b2 can have the same value and be equal to b. In this case, the scaling value is calculated using the following equation. The value of b can be selected to optimize the value of a0, a1, or a2. For example, if the value of b in this area is carefully selected, a1 becomes a power of 2 (with a positive or negative power), and the resulting term a1*(normDiff-b) can be implemented by a shift (left or right) operation. Another benefit of having a power of 2 value for a1 is that it reduces the error of quantizing a1 to an integer value.

[0191] scale=a2*(normDiff-b)^2+a1*(normDiff-b)+a0

[0192] As a result, when there are R=4 regions and M=14, the input value denom is in the range of {16384, 32767} and is precisely scaled in the range of {16384, 8192}, and the region value is calculated using the following equation

[0193] region=(denom-16384)>>(M-floorLog2(R))

[0194] The value of the region parameter can be calculated in different ways, where & is a bitwise AND operation.

[0195] For example

[0196] region=((denom<<floorLog2(R))>>M)&((1< <floorLog2(R)-1)

[0197] Then based on the area, the scaling can be calculated using appropriate parameters.

[0198] For example, for the case of 4 regions (R=4), the parameters are as follows:

[0199] a2[4] = {182, 99, 60, 39};

[0200] a0[4]={12348, 11570, 11926, 13273};

[0201] b[4]={21850,231982243419170};

[0202] region=r=(denom-16384)>>(M-2)

[0203] normDiff=(((denom<<M)+round0)> >shift0)&((1<<(M+1))-1);

[0204] normDiff2 - = b[r];

[0205] scale=((a2[r]*((normDiff2*normDiff2)>>(10)))>>(12))-(normDiff2>>1)+a0[r];

[0206] As another example, when there are R=8 regions and M=14, the input value denom is in the range of {16384, 32767}, the exact scaling is in the range of {16384, 8192}, and the scaling value is estimated using the following equation

[0207] a2[8]={214, 153, 113, 86, 67, 53, 43, 35};

[0208] a0[8]={12784,12054,11670,11583,11764,12195,12870,13782};

[0209] b[8]={21206, 22336, 23008, 23176, 22792, 21808, 20176, 17850};

[0210] a0[4]={1234811570, 11926, 13273}

[0211] b[4]={21850, 23198, 22434, 19170};

[0212] region=r=(denom-16384)>>(M-2)

[0213] normDiff=(((denom<<M)+round0)> >shift0)&((1<<(M+1))-1);

[0214] normDiff2 - = b[r];

[0215] scale=((a2[r]*((normDiff2*normDiff2)>>(10)))>>(12))-(normDiff2>>1)+a0[r];

[0216] The values ​​of the parameters b and a2 for a given M can be calculated based on the denom or normDiff values ​​using quadratic equations, e.g.

[0217] normDiff3 = (normDiff - 19314)

[0218] b=(-288*normDiff3*normDiff3)>>22+normDiff3>>1+22326normDiff4=(normDiff-26569)

[0219] a2=(4*normDiff3*normDiff3)>>22+normDiff3>>7+55

[0220] Alternatively, the middle value normDiff can be calculated using a slightly different equation so it is in the range {0, 16383}, and the region value is calculated using the following equation

[0221] region=normDiff>>(M-floorLog2(R))

[0222] Then based on the area, the scaling can be calculated using appropriate parameters.

[0223] For example, for the case of 4 regions (R=4), the parameters are as follows:

[0224] a2[4] = {182, 99, 60, 39};

[0225] a0[4]={12348, 1157011926, 13273};

[0226] b[4]={5466, 6814, 6050, 2786};

[0227] normDiff=(((denom<<M)+round0)> >shift0)&((1< <M)-1);

[0228] region=r=normDiff>>(M-2)

[0229] normDiff2 - = b[r];

[0230] scale=((a2[r]*((normDiff2*normDiff2)>>(10)))>>(12))-(normDiff2>>1)+a0[r];

[0231] As another example, when there are R=8 regions and M=14, the input value denom is in the range of {16384, 32767}, the exact scaling is in the range of {16384, 8192}, and the scaling value is estimated using the following equation

[0232] a2[8]={214,153,113,86,67,53,43,35};

[0233] a0[8]={12784,12054,11670,11583,11764,12195,12870,13782};

[0234] b[8]={4822,5952,6624,6792,64085424,3792,1466};

[0235] a0[4]={12348, 11570, 11926, 13273};

[0236] b[4]={21850,23198,22434,19170};

[0237] normDiff=(((denom<<M)+round0)>>shift0)&((1< <M)-1);

[0238] region=r=normDiff>>(M-2)

[0239] normDiff2 - = b[r];

[0240] scale=((a2[r]*((normDiff2*normDiff2)>>(10)))>>(12))-(normDiff2>>1)+a0[r];

[0241] Parameter values ​​(such as a2, a1, a0, and b) for different values ​​of M′ can be calculated using scaling based on a particular value of M, for example, M=14;

[0242] a0'=(M'>M)? (a0<<(M'-M)): (a0>>(M-M'))

[0243] a1'=(M'>M)? (a1<<(M'-M)): (a1>>(M-M'))

[0244] a2'=(M'>M)? (a2<<(M'-M)): (a2>>(MM))

[0245] b'=(M'>M)? (b<<(M'-M)): (b>>(M-M'))

[0246] The values ​​of the parameters b and a2 for a given M can be calculated based on the denom or normDiff values ​​using quadratic equations, e.g.

[0247] normDiff3 = (normDiff - 2930)

[0248] b=(-288*normDiff3*normDiff3)>>22+normDiff3>>1+5942

[0249] normDiff4 = (normDiff - 10185)

[0250] a2=(4*normDiff3*normDiff3)>>22+normDiff3>>7+55

[0251] In one embodiment, the entire range of normDiff can be divided into unequal regions, and the a2, a1, a0, and b parameters can be optimized for each region to achieve a more friendly implementation while reducing truncation or quantization errors. The range used to calculate each parameter can be an overlapping region. For example, for the case of M=14, when normDiff is in the range of {16383, 25472}, these parameters can be set to the following values, which can be easily implemented with low quantization errors:

[0252] a2=128 (power of 2 can be achieved by shifting right by 7 bits)

[0253] a1=-1

[0254] a0=17745

[0255] b = 14895

[0256] The fixed parameters in the above equations may be one or several units smaller or larger based on the way these values ​​are quantized to integer values ​​to optimize division approximation error and / or software / hardware implementation.

[0257] The functions described in this article can be used in various situations. For example, the output of the calculation can be used to determine the exact or estimated average sample value of a set of samples. In this case, the sum of the sample values ​​in the set can be used as the numerator nom, and the number of samples in the set can be used as the denominator denom. As another example, the method can be used to determine filter coefficients in a least squares sense. Some algorithms used in video and image coding require the use of, for example, LDL decomposition or Cholesky decomposition to decompose the matrix. Both of these require the performance of a division operation to perform the selected decomposition. In this case, replacing the full division operation with the method proposed here can significantly reduce complexity while minimizing deviation from the mathematical optimal solution.

[0258] According to one embodiment, an output value for approximating a result of a division operation between a numerator and a denominator is determined using a scaling value and a shifting value, wherein the scaling value is determined using an interpolation operation.

[0259] According to one embodiment, an output value for approximating a result of a division operation between a numerator and a denominator is determined using a scaling value and a shifting value, wherein the scaling value is determined using polynomial interpolation.

[0260] According to one embodiment, an output value for approximating a result of a division operation between a numerator and a denominator is determined using a scaling value and a shifting value, wherein the scaling value is determined using linear interpolation.

[0261] According to one embodiment, an output value for approximating a result of a division operation between a numerator and a denominator is determined using a scaling value and a shift value, wherein the scaling value is determined using an interpolation operation between at least two values ​​determined based on a table lookup.

[0262] According to the method of the embodiment Figure 8 As shown in . The method generally includes: receiving 810 a numerator and a denominator; and determining 820 an approximate output of a division operation between the numerator and the denominator, wherein the determination includes deriving a scaling parameter using a piecewise approximation; deriving a shift parameter and a rounding parameter, and applying the scaling parameter, the shift parameter, and the rounding parameter to the numerator. Each step can be implemented by a corresponding module of a computer system.

[0263] According to the method of the embodiment Fig. 9 As shown in . The method generally includes: encoding / decoding 910 a picture including a certain number of samples, wherein the encoding / decoding stage includes a division operation; determining 920 a numerator and a denominator; determining 930 an approximate output of the division operation between the numerator and the denominator, wherein the determination includes using a piecewise approximation to derive a scaling parameter; deriving a shift parameter and a rounding parameter, applying the scaling parameter, the shift parameter, and the rounding parameter to the numerator; and using 940 the division operation in the encoding / decoding stage. Each step can be implemented by a corresponding module of a computer system.

[0264] An apparatus according to an embodiment includes a method for implementing Figure 8 or Fig. 9 The device is a device for performing any method of the present invention. The device comprises at least one processor and a memory comprising computer program code, wherein the processor may also include a processor circuit system. The memory and the computer program code are configured to, together with the at least one processor, cause the device to perform the method according to various embodiments.

[0265] Fig.10 The apparatus according to the embodiment is illustrated. The general structure of the apparatus will be explained in terms of the functional blocks of the system. Several functions may be performed using a single physical device, for example, all computing processes may be performed in a single processor if desired. Fig.10 The data processing system of the apparatus of the example includes a main processing unit 1000, a memory 1002, a storage device 1004, an input device 1006, an output device 1008, and a graphics subsystem 1010, all of which are connected to each other via a data bus 1012. A client may be understood as a client device or a software client running on the apparatus.

[0266] The main processing unit 1000 is a processing unit arranged to process data in a data processing system. The main processing unit 1000 may include or be implemented as one or more processors or processor circuit systems. Memory 1002, storage device 1004, input device 1006, and output device 1008 may include other components recognized by those skilled in the art. Memory 1002 and storage device 1004 store data in the data processing system 1000. Computer program code resides in memory 1002 for implementing, for example, machine learning processes. Input device 1006 inputs data into the system, and output device 1008 receives data from the data processing system, and forwards the data to, for example, a display. Although data bus 1012 is shown as a single line, it can be any combination of the following items: processor bus, PCI bus, graphics bus, ISA bus. Therefore, it is easy for those skilled in the art to recognize that the device can be any data processing device, such as computer equipment, personal computer, server computer, mobile phone, smart phone, or Internet access device, such as an Internet tablet computer.

[0267] Various embodiments may be implemented with the aid of a computer program code that resides in a memory and causes an associated device to perform the method. For example, a device may include circuitry and electronics for processing, receiving, and sending data, computer program code in a memory, and a processor that, when running the computer program code, causes the device to perform features of the embodiments. In addition, a network device such as a server may include circuitry and electronics for processing, receiving, and sending data, computer program code in a memory, and a processor that, when running the computer program code, causes the network device to perform features of various embodiments.

[0268] If desired, the different functions discussed herein may be performed in different orders and / or concurrently with other functions. In addition, if desired, one or more of the above functions and embodiments may be optional or may be combined.

[0269] Although various aspects of the embodiment are listed in the independent claim, further aspects include other combinations of features of the described embodiment and / or dependent claims with features of the independent claim and not just the combinations explicitly listed in the claim.

[0270] It is also noted herein that while the above describes example embodiments, these descriptions should not be viewed in a limiting sense. Rather, several variations and modifications may be made without departing from the scope of the present disclosure as defined in the appended claims.< / d>

Claims

1. A device comprising: - means for encoding / decoding a picture comprising a certain number of samples, wherein the encoding / decoding stage comprises a division operation; - components for determining the numerator and denominator; - means for determining an approximate output of the division operation between the numerator and the denominator, wherein the means for determining comprises: ○ means for deriving a scaling parameter using a piecewise approximation, ○ means for deriving shift parameters and rounding parameters, and o means for applying said scaling parameter, said shifting parameter, and said rounding parameter to said numerator; - means for performing said division operation using said approximate output in said stage of said encoding / decoding.

2. The apparatus according to claim 1, wherein the encoding / decoding stage comprises: At least one sample of the picture is predicted.

3. The apparatus of claim 1, wherein the stage of the encoding / decoding comprises filtering.

4. The device according to claim 1, 2 or 3, further comprising: Component for applying additional shift parameters to the molecule.

5. The device according to any one of claims 1 to 4, further comprising: Means for determining when said numerator, said denominator, said scaling parameter, and said output parameter have different bit precisions, wherein said bit precision of said output, and said scaling parameter are used in determining said approximate output.

6. The device according to any one of claims 1 to 5, further comprising: means for determining the scaling parameter using one of: an interpolation operation; Polynomial process; linear interpolation.

7. The apparatus according to claim 6, further comprising: Means for determining the scaling parameter between at least two values ​​determined based on a table lookup using the interpolation operation.

8. The apparatus according to claim 7, further comprising: Means for adjusting the scaling parameter by a value to reduce the range of the denominator.

9. A method comprising: - encoding / decoding a picture comprising a certain number of samples, wherein the encoding / decoding stage comprises a division operation; - Determine the numerator and denominator; - determining an approximate output of a division operation between the numerator and the denominator, wherein the determining comprises: ○ Use piecewise approximation to derive the scaling parameters, ○ derive the shift parameter and the rounding parameter, and o applying the scaling parameter, the shifting parameter, and the rounding parameter to the numerator; - using said approximate output to perform said division operation in said stage of said encoding / decoding.

10. The method of claim 9, wherein the stages of the encoding / decoding comprise: At least one sample of the picture is predicted.

11. A method according to claim 9 or 10, wherein the stage of the encoding / decoding comprises filtering.

12. The method according to any one of claims 9 to 11, further comprising: Determining when the numerator, the denominator, the scaling parameter, and the output parameter have different bit precisions, wherein the bit precision of the output, and the scaling parameter are used in determining the approximate output.

13. The method according to any one of claims 9 to 12, further comprising: Determining the scaling parameter using one of: an interpolation operation; Polynomial process; linear interpolation.

14. The method according to claim 13, further comprising: The scaling parameter is determined between at least two values ​​determined based on a table lookup using the interpolation operation.

15. An apparatus comprising at least one processor, a memory comprising computer program code, the memory and the computer program code being configured to, with the at least one processor, cause the apparatus to at least perform the following: - encoding / decoding a picture comprising a certain number of samples, wherein the encoding / decoding stage comprises a division operation; - Determine the numerator and denominator; - determining an approximate output of a division operation between the numerator and the denominator, wherein the apparatus is further caused to: ○ Use piecewise approximation to derive the scaling parameters, ○ derive the shift parameter and the rounding parameter, and o applying the scaling parameter, the shifting parameter, and the rounding parameter to the numerator; - using said approximate output to perform said division operation in said stage of said encoding / decoding.