Inverse Mapping Simplification
By converting the inverse mapping function into a piecewise linear function of equal length intervals and constructing an approximate inverse mapping function, the problems of complexity and low efficiency of inverse mapping in the existing technology are solved, and an efficient inverse mapping process of video coding is realized.
Patent Information
- Application Number
- CN201980087750.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-02-22
- Filing Date
- 2019-12-16
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2039-12-16
AI Technical Summary
The inverse mapping process in existing video coding technology is complex and inefficient, especially due to the unequal distribution of segment indices of the inverse mapping function, which makes it difficult to apply the inverse mapping immediately and affects the coding performance.
The inverse mapping function is converted into a piecewise linear function with equal length intervals to simplify the inverse mapping process. By constructing the approximate inverse mapping function invMapBis, a limited-size lookup table is used to implement instant inverse mapping and reduce the number of accesses to the lookup table.
The efficiency and coding performance of the inverse mapping process are improved, the design is simplified, while the potential coding gain of signal shaping is retained, and the implementation complexity is reduced.
Smart Images

Figure CN113273215B_ABST
Abstract
Description
Technical Field
[0001] The present embodiment generally relates to a method and apparatus for video encoding or decoding, and more particularly to a method and apparatus for simplifying inverse mapping in video data shaping. Background Art
[0002] In order to achieve high compression efficiency, image and video coding schemes usually use prediction and transformation to exploit spatial and temporal redundancy in video content. Typically, intra-frame or inter-frame prediction is used to exploit intra-frame or inter-frame picture correlation, and then the difference between the original block and the predicted block, which is usually represented as a prediction error or prediction residual, is transformed, quantized, and entropy decoded. To reconstruct the video, the compressed data is decoded by the inverse process corresponding to entropy decoding, quantization, transformation, and prediction. Summary of the invention
[0003] According to one embodiment, a method for video encoding or decoding is provided, comprising: performing forward mapping on predicted samples corresponding to samples of a block of a picture based on a forward mapping function; and performing inverse mapping on a reconstructed version of the samples of the block based on an inverse mapping function, wherein the inverse mapping function is an approximation of the inverse function of the forward mapping function, wherein the inverse mapping function is modeled as a piecewise linear function, and wherein each segment in the piecewise linear model is defined as having the same interval length.
[0004] According to another embodiment, a device for video encoding or decoding is provided, comprising one or more processors, wherein the one or more processors are configured to: perform forward mapping on a predicted sample corresponding to a sample of a block of a picture based on a forward mapping function; and perform inverse mapping on a reconstructed version of the sample of the block based on an inverse mapping function, wherein the inverse mapping function is an approximation of an inverse function of the forward mapping function, wherein the inverse mapping function is modeled as a piecewise linear function, and wherein each segment in the piecewise linear model is defined to have the same interval length. The device may further include one or more memories coupled to the one or more processors.
[0005] According to another embodiment, a video encoding or decoding device is provided, comprising: a device for performing forward mapping on predicted samples corresponding to samples of a block of a picture based on a forward mapping function; and a device for performing inverse mapping on a reconstructed version of the samples of the block based on an inverse mapping function, wherein the inverse mapping function is an approximation of the inverse function of the forward mapping function, wherein the inverse mapping function is modeled as a piecewise linear function, and wherein each segment in the piecewise linear model is defined as having the same interval length.
[0006] According to another embodiment, a signal including an encoded video is formed by performing the following steps: based on a forward mapping function, forward mapping is performed on predicted samples corresponding to samples of a block of a picture; and based on an inverse mapping function, inverse mapping is performed on a reconstructed version of the samples of the block, wherein the inverse mapping function is an approximation of the inverse function of the forward mapping function, wherein the inverse mapping function is modeled as a piecewise linear function, and wherein each segment in the piecewise linear model is defined to have the same interval length. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] Figure 1 (a) and Figure 1 (b) shows video data shaping in the encoder and decoder respectively.
[0008] Figure 2 A block diagram of an embodiment of a video encoder is shown.
[0009] Figure 3 A block diagram of an embodiment of a video decoder is shown.
[0010] Figure 4 is a diagrammatic example showing the construction of a forward mapping function.
[0011] Figure 5 is a diagrammatic example showing the construction of an inverse mapping function.
[0012] Figure 6 The process of inverse mapping function simplification according to an embodiment is shown.
[0013] Figure 7 is a graphical example showing an approximation of an inverse mapping function.
[0014] Figure 8 is a graphical example showing examples of forward mapping and inverse mapping functions.
[0015] Fig. 9 A process for improving the approximate inverse mapping function according to an embodiment is shown.
[0016] Fig.10 A block diagram of another embodiment of a video encoder is shown.
[0017] Fig.11 A block diagram of a system is shown in which aspects of the present embodiments may be implemented. DETAILED DESCRIPTION
[0018] For better decoding efficiency, signal mapping can be used. Mapping (also called shaping) aims to better utilize the sample value distribution of the video image. Mapping and inverse mapping can be outside the decoding loop. In this case, the mapping is applied directly to the input samples of the encoder before core encoding. The inverse mapping process is applied to the output samples from the decoder on the decoder side. Mapping and inverse mapping can also be in the decoding loop, for example, as proposed in JVET-L0247 (see Taoran Lu et al., "CE12-related: Universal low complexity reshaper for SDR and HDR video", 12th JVET Conference, Macau, CN, October 3-12, 2018, JVET-L0247-v2, hereinafter referred to as "JVET-L0247").
[0019] JVET-L0247 describes an in-loop mapping solution for improving decoding efficiency. In this solution, the mapping of the luminance or chrominance signal is implemented internally in the encoding loop. The mapping is applied to the prediction signal, and in the encoder or decoder, additional mapping and inverse mapping blocks are added to the traditional encoder and decoder block diagram. This is in Figure 1 , where forward mapping is applied to predict the luminance or chrominance signal.
[0020] At the encoder, the residual signal Res_source before transformation and quantization is generated according to the following formula:
[0021] Res_source(p)=fwdMap[Orig(p)]−fwdMap[Pred(p)] (Equation 1)
[0022] Where Orig(p) is the value of the source sample (to be decoded) at position p(x, y) in the picture, Pred(p) is the value of the prediction sample, and Res_source(p) is the value of the prediction residual sample before transformation and quantization, and fwdMap[.] is the mapping function. Res_source(p) is then transformed and quantized. The inverse quantized and inverse transformed residual signal is denoted Res(p).
[0023] At the decoder, according to the following formula ( Figure 1 (b) Reconstructed signal:
[0024] Rec(p) = invMap[fwdMap[Pred(p)] + Res(p)] (Equation 2)
[0025] Refactor as follows:
[0026] Forward mapping:
[0027] Rec0(p)=fwdMap[Pred(p)] (Equation 3)
[0028] Sum:
[0029] Rec1(p)=Rec0(p)+Res(p) (Equation 4)
[0030] Inverse mapping:
[0031] Rec(p) = invMap[Rec1(p)] (Equation 5)
[0032] Where Rec(p) is the value of the reconstructed sample and invMap[.] is the inverse mapping function (the inverse of fwdMap[.], such that invMap[fwdMap[x]] = x, not taking into account possible rounding errors). In JVET-L0247, this process is performed for each sample of the processing block. The mapping and inverse mapping functions are global for the entire picture or a region of a picture. In different blocks or regions of a block of a picture, the same functions are used.
[0033] Figure 2 An example of a video encoder 200, such as a High Efficiency Video Coding (HEVC) encoder, is shown in which a shaping process is added. Figure 2 It may also describe an encoder in which improvements are made to the HEVC standard or an encoder that adopts a technique similar to HEVC, such as the VVC (Versatile Video Coding) encoder developed by the JVCT (Joint Video Discovery Team).
[0034] In this application, the terms "reconstruction" and "decoding" can be used interchangeably, the terms "encoding" or "decoding" can be used interchangeably, and the terms "image", "picture" and "frame" can be used interchangeably. Usually, but not necessarily, the term "reconstruction" is used on the encoder side, while "decoding" is used on the decoder side.
[0035] Before being encoded, a video sequence may undergo pre-encoding processing, for example, applying a color transform to the input color picture (e.g., conversion from RGB 4:4:4 to YCbCr 4:2:0), or performing a remapping of the input picture components in order to obtain a signal distribution that is more resilient to compression (e.g., using histogram equalization of one of the color components). Metadata may be associated with the pre-processing and appended to the bitstream.
[0036] In HEVC, to encode a video sequence with one or more pictures, the pictures are partitioned into one or more slices, where each slice may include one or more slice segments. Slice segments are organized into coding units, prediction units, and transform units. The HEVC specification distinguishes between "blocks" and "units", where a "block" addresses a specific area in the sample array (e.g., luma, Y), and a "unit" includes a concatenated block of all coded color components (e.g., Y, Cb, Cr, or monochrome), syntax elements, and prediction data (e.g., motion vectors) associated with the block.
[0037] For decoding in HEVC, pictures are divided into coding tree blocks (CTBs) of square shape with configurable size, and continuous sets of coding tree blocks are grouped into slices. A coding tree unit (CTU) contains CTBs for coded color components. CTB is the root of the quadtree partition into coding blocks (CBs), and the coding blocks can be partitioned into one or more prediction blocks (PBs) and form the root of the quadtree partition into transform blocks (TBs). Corresponding to the coding blocks, prediction blocks, and transform blocks, a coding unit (CU) includes a tree structure set of prediction units (PUs) and transform units (TUs), the PU includes prediction information for all color components, and the TU includes a residual coding syntax structure for each color component. The sizes of the CB, PB, and TB of the luminance component apply to the corresponding CU, PU, and TU. In the present application, the term "block" may be used to represent, for example, any of CTU, CU, PU, TU, CB, PB, and TB. Additionally, "block" may also be used to refer to macroblocks and partitions as specified in H.264 / AVC or other video coding standards, and more generally to data arrays of various sizes.
[0038] In encoder 200, as described below, a picture is encoded by an encoder element. An input signal is mapped (201). The mapping in 201 may correspond to the forward mapping in 291, or may also include other mappings for preprocessing. The picture to be encoded is processed in units of CUs (202). Each CU is encoded using intra or inter mode. When a CU is encoded in intra mode, it performs intra prediction (260). In inter mode, motion estimation (275) and compensation (270) are performed. The forward mapping (291) is applied to the prediction signal. The encoder decides (205) which of intra mode or inter mode to use to encode the CU, and indicates the intra / inter decision by a prediction mode flag. The prediction residual (210) is calculated by subtracting the mapped prediction block (from step 291) from the mapped original image block (from step 201).
[0039] The prediction residual is then transformed (225) and quantized (230). The quantized transform coefficients as well as the motion vectors and other syntax elements are entropy decoded (245) to output a bitstream. The encoder can also skip the transform and apply quantization directly to the untransformed residual signal on a 4×4TU basis. The encoder can also bypass the transform and quantization, i.e., directly decode the residual without applying the transform or quantization process. In direct PCM decoding, no prediction is applied, and the coding unit samples are decoded directly into the bitstream.
[0040] The encoder decodes the coded block to provide a reference for further prediction. The quantized transform coefficients are dequantized (240) and inverse transformed (250) to decode the prediction residual. The decoded prediction residual is combined with the prediction block (255) to reconstruct the image block. Inverse mapping (290) and an in-loop filter (265) are applied to the reconstructed signal, for example, to perform deblocking / SAO (sample adaptive offset) filtering to reduce coding artifacts. The filtered image is stored in a reference picture buffer (280).
[0041] Figure 3 A block diagram of an example of a video decoder 300, such as an HEVC decoder, with an added shaping process is shown. In the decoder 300, the bitstream is decoded by decoder elements as described below. The video decoder 300 generally performs the same Figure 2 The encoding pass described in is reciprocal to the decoding pass, which performs video decoding as part of encoding the video data. Figure 3 Decoders in which improvements are made to the HEVC standard or decoders that employ techniques similar to HEVC, such as VVC decoders, may also be described.
[0042] Specifically, the input to the decoder comprises a video bitstream, which may be generated by the video encoder 200. The bitstream is first entropy decoded (330) to obtain transform coefficients, motion vectors, picture partitioning information, and other coding information. The picture partitioning information indicates the size of the CTU, and the manner in which the CTU is partitioned into CUs and, if applicable, PUs. Thus, the decoder may partition (335) the picture into CTUs and each CTU into CUs based on the decoded picture partitioning information. The transform coefficients are dequantized (340) and inverse transformed (350) to decode the prediction residual.
[0043] The decoded prediction residual is combined with the prediction block (355) to reconstruct the image block. The prediction block can be obtained (370) from intra-frame prediction (360) or motion compensated prediction (i.e., inter-frame prediction) (375). In addition, forward mapping (395) is applied to the prediction signal. In the case of bidirectional prediction, the two motion compensated predictions can be combined using a weighted sum. Inverse mapping (396) and an in-loop filter (365) are applied to the reconstructed signal. The filtered image is stored in a reference picture buffer (380).
[0044] The output from the in-loop filter may undergo an inverse mapping (390) that performs the inverse of the mapping process (201) performed in pre-processing. The decoded picture may further undergo other post-decoding processing, such as an inverse color transform (e.g., conversion from YCbCr 4:2:0 to RGB 4:4:4). The post-decoding processing may use metadata derived in the pre-encoding process and signaled in the bitstream.
[0045] As mentioned above, JVET-L0247 describes an in-loop shaping process. In particular, the mapping function implementation in JVET-L0247 is based on a table of scales, scale[k], where k=0 to N-1, and N is a power of 2 (usually 16 or 32). Each scale applies to a range of luminance values. The range R is fixed and is a power of 2 (R=2 K ), and is equal to the full brightness range (rangeY) divided by N, for example, for a 10-bit brightness signal, and for N=16, R=1024 / N=64=2 6 (K=6). The mapping function fwdMap is conceptually defined as follows:
[0046] -fwdMap[0]=0
[0047] - Then, for k=0 to N-1, the value of each k*R index is calculated as follows:
[0048] ○fwdMap[(k+1)*R]=fwdMap[k*R]+R*scale[k]
[0049] ○ Note that, equivalently, scale[k] corresponds to 1 / R*(fwdMap[(k+1)*R]-fwdMap[k*R])
[0050] - The intermediate value at index x = (k*R+1) to ((k+1)*R-1) is linearly interpolated from its surrounding values fwdMap[(k+1)*R] and fwdMap[k*R] as follows:
[0051] ○fwdMap[x]=fwdMap[k*R]+(x–k*R)*(fwdMap[(k+1)*R]-fwdMap[k*R]) / R
[0052] The process Figure 4 Each scale is associated with a segment of the piecewise linear mapping function. Each segment is specified over a luminance range of the same length (R). Note that this process requires the LUT fwdMap to have (rangeY+1) elements, from Y=0 to rangeY, even if the actual maximum sample value Y is equal to (rangeYY-1).
[0053] The advantage of using equal-length intervals of length R is that the mapping of sample values Y can be easily performed on the fly by simply accessing a lookup table of finite size (size N) using an index calculated from the value Y shifted by K bits. The process is conceptually as follows:
[0054] - Calculation of index k=Y / R=Y>K
[0055] -Ymap=scale[k]*Y+A[k],
[0056] Where A is a pre-built lookup table of size N, derived as follows (for k = 0 to N-1):
[0057] -A[k]=fwdMap[k*R]–k*R*scale[k]
[0058] The inverse mapping function invMap is constructed as the inverse of the forward mapping function. It is mathematically established as a symmetric function of fwdMap associated with the line defined by the equation y=x, such as Figure 5 The problem with this inverse mapping is that it cannot be applied on the fly as easily as the forward mapping. Indeed, even if the inverse mapping function remains piecewise linear, identification of the index of the segment to which the value Y belongs is not straightforward. In contrast to the forward mapping case, where a simple shift operation can be applied, this is more complicated for the inverse mapping case, since the index of the inverse mapping function is not a multiple of the predetermined length (a power of 2), which is not always the case. Figure 5 As shown in the figure, due to the construction of idx k =fwdMap[k*R], the segment index of the inverse mapping function (idx 0 to idx 4 ) are not equally spaced along the horizontal axis.
[0059] To perform the inverse mapping, different solutions exist. Two solutions are described below.
[0060] Solution 1
[0061] The complete lookup table invMap[x] for x=0 to rangeY-1, where rangeY is the full luma range (e.g., 1024 for a 10-bit luma signal), is initially constructed at the encoder and decoder from a forward mapping function by mathematical symmetry associated with the line defined by the equation y=x. Then for each sample to be inverse mapped, Y, its inverse mapped version Ymap is derived as:
[0062] Ymap = invMap[Y], where Y belongs to the range [0, range Y-1]
[0063] This process requires per-sample access to a large-sized lookup table (LUT), which can be problematic for implementation. Per-sample access to a 1024-element lookup table is generally considered problematic. Typically, a maximum LUT size of 32 or 64 elements is considered acceptable, and 16 or less is generally preferred.
[0064] Solution 2
[0065] An alternative solution is to identify on the fly the index to which the sample value Y belongs and use k ,idx k+1 ]The associated index idx k To do this, it is necessary to perform a process equivalent to the following process (pseudocode):
[0066] -k=0
[0067] -while (Y<idx k+1 )
[0068] ○k=k+1
[0069] The index of the interval containing Y is identified as idx k .
[0070] This requires multiple checks for each sample value Y, which is also a problem for practical implementation. For example, consider the case where M=8, and the index set IdxTab={idx0=0,idx1=200,idx2=300,idx3=500,idx4=600,idx5=700,idx6=800,idx7=900,idx8=1024}. For any sample value Y greater than 900, (M-1) checks are required. Even in better implementations, having to perform several checks for each sample may be problematic.
[0071] In one embodiment, the method aims to simplify the inverse mapping process by converting the inverse mapping function into a piecewise linear function with equal length intervals, where the length is a power of 2. Therefore, the inverse mapping can be performed on the fly by a simple process, as described above for forward mapping. The disclosed technology can be generally applied to video content (e.g., SDR, HDR), but it is particularly applicable when forward mapping and inverse mapping processes are used in encoders and decoders to achieve improved encoding performance.
[0072] Advantageously, the process can achieve a simple implementation of the per-sample inverse mapping process using simple shift operations and access to a lookup table of limited size (e.g., less than 64 elements). Therefore, the proposed technique can simplify the design of the inverse mapping process while retaining most of the potential coding gain based on the shaping (i.e., forward mapping, inverse mapping of the signal).
[0073] According to one embodiment, the inverse mapping function generation process is Figure 6 , it uses data characterizing the forward mapping function as input. This can be composed of a function fwdMap or a scale table scale[]. In step 601, an inverse mapping function invMap is constructed based on the input data. This can be achieved as described above by the mathematical symmetry of the forward mapping function fwdMap related to the line y=x. An approximation of the inverse mapping function invMap is generated in step 602. The approximation can use a piecewise linear model of the function, wherein each segment is defined by equal length intervals, and the intervals have the same length equal to a power of 2.
[0074] Specification of the approximate inverse mapping function
[0075] The approximate inverse mapping function, denoted invMapBis, can be specified as follows:
[0076] -Lookup table size M, where M is a power of 2 lower than rangeY.
[0077] - Initial offset value invMapBis[0].
[0078] - Inverse scale table invScale[k], k=0 to (M-1).
[0079] The interval length of the piecewise linear function invMapBis is denoted by Rinv and is calculated as Rinv = rangeY / M. It is a power of 2, Rinv = 2 KinvNote that in some examples, M is set to be greater than or equal to N (the number of segments in the forward mapping function) in order to have higher precision for the inverse mapping than for the forward mapping, and to ensure that the two operations (forward mapping then inverse mapping) are cascaded in an operation that approaches the identity function (invMapBis[fwdMap[x]] approaches x). In these embodiments, Rinv is less than or equal to R, and therefore Kinv is less than or equal to K.
[0080] Figure 7 An example is shown in FIG, where the inverse mapping function invMap is indicated by a dashed line, and the approximated version invMapBis is indicated by a solid line and is linear for each segment length Rinv. The slope k of each segment corresponds to invScale[k] (shown only for blocks 0, 2, 7 in the figure).
[0081] Derivation of approximate inverse mapping function
[0082] In an embodiment, step 602 for constructing the approximate inverse function invMapBis is implemented as follows:
[0083] - For k = 0 to M-1
[0084] ○invMapBis[(k+1)*Rinv]=invMapBis[k*Rinv]+Rinv*invScale[k]
[0085] - Intermediate values at index x=(k*Rinv+1) to ((k+1)*Rinv-1) are linearly interpolated from their surrounding values invMapBis[(k+1)*Rinv] and invMapBis[k*Rinv] as follows:
[0086] ○ For x = (k*Rinv+1) to ((k+1)*Rinv-1)
[0087] ■invMapBis[x]=invMapBis[k*Rinv]+(x–k*Rinv)*(invMapBis[(k+1)*Rinv]-invMapBis[k*Rinv]) / Rinv (Equation 6)
[0088] Note that this process requires the LUT invMapBis to have (rangeY+1) elements, from Y=0 to rangeY, even though the actual maximum sample value Y is equal to (rangeY-1).
[0089] Simplified on-the-fly inverse mapping
[0090] The inverse mapping can be obtained by applying the complete LUT invMapBis:
[0091] Yinvmap=invMapBis[Y]
[0092] However, instead of using the full LUT invMapBis, the inverse mapping of sample Y can be easily performed on the fly by simply accessing a lookup table of limited size (size M) using an index calculated from the value Y shifted by Kinv bits. The process is as follows:
[0093] - Calculate the index k = Y / Rinv = Y>Kinv.
[0094] - Yinvmap = invScale[k]*Y+Ainv[k], where Ainv is a pre-established lookup table of size M, which is derived as follows (for k=0 to M-1):
[0095] -Ainv[k]=invMapBis[k*Rinv]-k*Rinv*invScale[k].
[0096] This implementation is more efficient and simpler than the two solutions described previously (Solution 1, Solution 2).
[0097] Parameters used to define the approximate inverse mapping function
[0098] In an embodiment, the initial offset value invMapBis[0] is set to startPt, where (startPt+1) is the first index where fwdMap is non-zero. In other words, startPt is such that for any x≤startPt, fwdMap[x]=0.
[0099] In an embodiment, the value of invScale[k] is derived as follows:
[0100] invScale[k]=1 / Rinv*(invMap[(k+1)*Rinv]-invMap[k*Rinv]), where Rinv=RangeY / M.
[0101] Examples of scale and invScale values are given below (a table commonly used for HDR content). Figure 8 The corresponding functions (LUT) fwdMap and invMapBis are also described.
[0102] k 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 scale[k] 0 47 46 47 47 50 57 64 71 79 89 100 110 125 133 0
[0103] The table contains 16 elements (N=16), and all values are multiplied by R=64 (neutral value represents a scaling factor of 1.0)
[0104]
[0105] The table contains 32 elements (M=32), and all values are multiplied by Rinv=32 (neutral values represent a scaling factor of 1.0)
[0106] Improved approximate inverse function
[0107] In an embodiment, step 602 comprises an improvement process that is applied iteratively to reduce the total error of applying a forward mapping and then an inverse mapping. This process is performed at the encoder if the inverse function is explicitly signaled, or at the decoder if the inverse function is derived. This process results in modifying the table invScale.
[0108] Fig. 9 The improved process according to this embodiment is shown. Initially, the variable distMin is initialized to a very large value in step 901, and the variable Change is initialized to 0. In step 902, a loop of the variable k from 0 to M is performed. For example, as described in the "Derivation of the Approximate Inverse Mapping Function" section in step 903, the variable initVal is initialized to invMapBis[k*Rinv].
[0109] In step 904, a loop of the variable n from -S to +S is performed. Typically, in step 905, S is set to 2 and invMapBis[k*Rinv] is set to (initVal+n). In step 906, the inverse mapping function invMapBis is reconstructed to the modified value invMapBis[k*Rinv], as explained in the "Derivation of the approximate inverse mapping function" section (see (Equation 6)). In step 907, the distortion measure dist is calculated using the modified function invMapBis.
[0110] Step 908 checks whether dist is lower than distMin. If dist is lower than distMin, then in step 909, the variable best is set to n, distMin is set to dist, and Change is set to 1. If dist is not lower than distMin, the process proceeds to step 910. In step 910, it is checked whether the end of the loop of step 904 is reached. If the end of the loop of step 904 is not reached, the process returns to step 904. If the end of the loop of step 904 is reached, in step 911 invMapBis[k*Rinv] is set to (initVal+best). In step 912, it is checked whether the end of the loop of step 902 is reached. If the end of the loop of step 902 is not reached, the process returns to step 902. If the end of the loop of step 902 is reached, then in step 913 it is checked whether Change is equal to 1. If Change is equal to 1, the process returns to step 901. If Change is not equal to 1, the process ends by updating the invScale table (step 914) as follows:
[0111] ○ For k = 0 to M-1,
[0112] ■invScale[k]=1 / Rinv*(invMapBis[(k+1)*Rinv]-invMapBis[k*Rinv]).
[0113] The distortion (used in steps 907, 908) can be calculated as follows:
[0114]
[0115] where error(Y), y0 and y1 are defined as follows:
[0116] -error(Y)=Y–invMapBis[fwdMap[Y]].
[0117] -y0 is calculated as follows
[0118] ○y0=0
[0119] ○And (fwdMap[y0+1]==fwdMap[y0]), y0=y0+1.
[0120] -y1 is calculated as follows
[0121] ○y1=rangeY-1
[0122] ○And (fwdMap[y1-1]==fwdMap[y1]), y1=y1-1.
[0123] Alternatively, error(Y), y0, and y1 can be defined as follows:
[0124] -error(Y)=invMapBis[Y]–invMap[Y].
[0125] -y0=0 and y1=rangeY-1.
[0126] Inferring an approximate inverse mapping function at the decoder
[0127] In an embodiment, an approximate inverse mapping function is derived at the decoder. The number of segments of the function is signaled in the bitstream. This is indicated in the following syntax table (in italics). The rest of the syntax corresponds to the signaling of the forward mapping function. A new syntax element, reshaper_model_inv_log2_size, is introduced to specify the number of segments of the inverse mapping function. With reference to the notation used in this document, M is derived as follows:
[0128] M=2 reshaper_model_inv_log2_size =(1< <reshaper_model_inv_log2_size)。
[0129]
[0130] In an embodiment, this parameter is a factor to be applied to the number of segments N used to model the forward mapping function:
[0131] M=N*2 reshaper_model_inv_log2_size =(N< <reshaper_model_inv_log2_size)。
[0132] In this embodiment, the value of the number of segments (M) is determined at the encoder. For example, it can be determined to ensure that the above-mentioned distortion dist is below a given threshold (e.g., T*rangeY 2 , T = 0.02). This can be achieved by iteration, starting from M = N. First, use this value M to generate an approximate inverse mapping function. If the distortion dist obtained using the obtained approximate inverse mapping function is higher than the threshold (T*rangeY 2 ), then double M (M is set to (M*2)), and reiterate the process until the distortion dist is below the threshold (T*rangeY 2 ), or until M reaches a maximum value Mmax (e.g., 128). Alternatively, M can be set arbitrarily based on actual experiments. In our experiments, it was observed that a value of 32 was relevant in most cases.
[0133] As mentioned before, an approximate inverse function can be derived at the decoder depending on the number of segments (M).
[0134] Signaling of approximate inverse mapping function
[0135] In an embodiment, the approximate inverse mapping function is explicitly signaled in the bitstream. This is indicated in the following syntax table (in italics). The remainder of the syntax corresponds to the signaling of the forward mapping function.
[0136] On the encoder side, the table invScale, its size M, and the first value of invMapBis (invMapBis[0]) are derived from the forward mapping function fwdMap. This is typically achieved according to the above method, for example, by (1). Deriving the inverse mapping function invMap from the forward mapping function fwdMap, (2). Generating the approximate inverse mapping function invMapBis from the inverse mapping function invMap (in this step, M can be arbitrarily selected or adaptively calculated as described above), (3). Deriving the table invScale from the approximate inverse mapping function invMapBis. invMapBis is used to perform inverse mapping in the encoder. Then, the encoder encodes the parameters characterizing the approximate mapping function, such as M, invMapBis[0], and the table invScale, in the bitstream according to the syntax described in the following table.
[0137] On the decoder side, following the syntax described in the following table, the parameters characterizing the approximate inverse mapping function are decoded from the bitstream. Then, the approximate inverse mapping function invMapBis is derived from these parameters. invMapBis is used to perform inverse mapping in the decoder. Alternatively, it is not necessary to construct invMapBis, and the inverse mapping is performed immediately as described in the "Simplified immediate inverse mapping" section.
[0138] The syntax elements added in the following syntax table (in italics) indicate:
[0139] - The number of segments of the inverse mapping function, which can be derived from the syntax element reshaper_model_inv_log2_size as follows:
[0140] ○ reshaperModelInvSize = 1 << reshaper_model_inv_log2_size or
[0141] ○ reshaperModelInvSize = N << reshaper_model_inv_log2_size
[0142] - The offset value of the inverse mapping function reshaper_model_inv_offset (corresponding to invMapBis[0] in the above text).
[0143] - Scale value reshapeModelInvScale[i] (sign: reshape_model_sign_CW, absolute value: reshape_model_abs_CW).
[0144]
[0145] In another embodiment, the offset value reshaper_model_inv_offset is not decoded but inferred from the forward function. reshaper_model_inv_offset(invMapBis[0]) is set equal to y0, where y0 is the first value of fwdMap[y0] that differs from fwdMap[y0+1].
[0146] The parameter reshapeModelInvScale[i] can be differentially encoded with respect to a neutral value (e.g. Rinv) or with respect to the previously decoded value reshapeModelInvScale[i–1]. A mixture of the two approaches can be used:
[0147] - For the first element (i=0), reshapeModelInvScale[0] is differentially encoded relative to a neutral value (eg, Rinv).
[0148] - For the next elements (i>0), reshapeModelInvScale[i] is differentially decoded relative to the previously decoded value reshapeModelInvScale[i-1].
[0149] In another embodiment, the encoder derives the table invMap according to the table fwdMap, and then performs the initialization of the table invScale (denoted as invScaleInit) as described above by the following operations:
[0150] ○ For k = 0 to M-1,
[0151] ■invScaleInit[k]=1 / Rinv*(invMap[(k+1)*Rinv]-invMap[k*Rinv]).
[0152] The encoder then improves this table and derives the table invMapBis by, for example, the process described in the "Improving the Approximate Inverse Function" section. The final table invScale is derived as follows:
[0153] ○ For k = 0 to M-1,
[0154] ■invScale[k]=1 / Rinv*(invMapBis[(k+1)*Rinv]-invMapBis[k*Rinv]).
[0155] For any k=0 to M-1, the parameter reshapeModelInvScale[k] can be decoded as the difference between the initial table invScaleInit and the final table invScale:
[0156] ○ For k = 0 to M-1,
[0157] ■reshapeModelInvScale[k]=invScale[k]-invScaleInit[k].
[0158] The decoder derives the table invMap from the table fwdMap and then the initialization of the table invScaleInit as explained before by the following operations:
[0159] ○ For k = 0 to M-1,
[0160] ■invScaleInit[k]=1 / Rinv*(invMap[(k+1)*Rinv]-invMap[k*Rinv]).
[0161] The decoder then derives the actual final table invScale as follows:
[0162] ○ For k = 0 to M-1,
[0163] ■invScale[k]=invScaleInit[k]+reshapeModelInvScale[k].
[0164] Alternatively, for any k=0 to M-1, the parameter reshapeModelInvScale[k] can be decoded as the difference between the initial inverse mapping LUT value at index (k*Rinv) (i.e., InvMap[k*Rinv]) and the final inverse mapping LUT value at index (k*Rinv) (i.e., the value of InvMap[k*Rinv]):
[0165] ○ For k = 0 to M-1,
[0166] ■reshapeModelInvScale[k]=InvMapBis[k*Rinv]–InvMap[k*Rinv].
[0167] The decoder then derives the actual value InvMapBis[k*Rinv] as follows:
[0168] ○ For k = 0 to M-1,
[0169] ■InvMapBis[k]=InvMap[k]+reshapeModelInvScale[k].
[0170] The decoder can then calculate the table invScale as follows:
[0171] ○ For k = 0 to M-1,
[0172] ■invScale[k]=1 / Rinv*(invMapBis[(k+1)*Rinv]-invMapBis[k*Rinv]).
[0173] This may result in a reduction in the bit cost of the decoding table ReformModelInvscale, since most values of InvMapBis[i*Rinv] are expected to not be significantly different from InvMap[i*Rinv].
[0174] Since the different processes described above are in principle implemented using a fixed-point implementation, the different formulas used in this application can be adjusted in order to ensure a fixed-point implementation. However, conceptually, the implementation will be different from that described in this application.
[0175] When the prediction residual is equal to 0
[0176] In the case where the prediction residual is equal to 0, Equation 2 becomes the following equation:
[0177] Rec(p) = invMap[fwdMap[Pred(p)] (Equation 7)
[0178] Therefore, the inverse mapping after the forward mapping is equivalent to the identity function (denoted as Id), and it is not necessary to perform these two mapping steps (Rec(p)=Pred(p)).
[0179] In an embodiment, in case the prediction residual is equal to 0 for a given sample position, the forward mapping and inverse mapping steps are skipped for the given sample position.
[0180] In an embodiment, in case the prediction residual is equal to 0 for all samples of the block, the forward mapping and inverse mapping steps are skipped for all samples of the block.
[0181] In an embodiment, for a coding unit that is coded using skip mode (eg, when referring to the VVC 4 draft specification document JVET-M1001, where the syntax element cu_skip_flag is equal to 1), the forward mapping and inverse mapping steps are skipped.
[0182] In an embodiment, the forward mapping and inverse mapping steps are skipped for blocks with a coding block flag equal to 0 (eg, when referring to the VVC 4 draft specification document JVET-M1001, where the syntax element cu_cbf is equal to 0, indicating that all transform coefficients of the current coding unit are zero).
[0183] Residual Adjustment
[0184] In an embodiment, Figure 2 Between steps 210 and 225, a step of performing residual adjustment on the encoder side ( Fig.10 Step 211).
[0185] This step aims to reduce the error produced by applying the forward mapping and then the inverse mapping. The error measure for a given position p is:
[0186] Error(p)=Orig(p)–invMapBis[fwdMap[Pred(p)]+Res_source(p)]
[0187] The closer invMapBis[fwdMap[]] corresponds to the exact identification function (Id[]), the closer Error(p) should be to zero. However, since invMapBis[] is an approximation of the inverse function of fwdMap[], and also due to possible rounding errors, invMapBis[fwdMap[]] may differ from Id[]. In order to compensate for the error caused by the approximation of the inverse mapping function, the residual samples Res_source(p) may be adjusted.
[0188] In the residual adjustment step, for a given block under consideration, the residual value Res_source(p) at each sample position p is modified such that abs(Error(p)) or (Error(p)) 2 minimum, where abs(x) corresponds to the absolute value of x. In practice, this may consist of scanning a number of values around the initial value and keeping the value that gives the error with the smallest magnitude. For each position p of the block under consideration, this process may be implemented as follows:
[0189] -Set initVal = Res_source(p)
[0190] -Calculate minError = abs(Error(p))
[0191] -If minError is not equal to 0
[0192] - Set bestS = 0
[0193] - For s = -S to S, S is a given value (e.g. S = 2)
[0194] Set Res_source(p) = initVal + s
[0195] Calculate Error(p)
[0196] if (abs(error(p))<minError)
[0197] Set bestS=s
[0198] Set minError = abs(Error(p))
[0199] - Set Res_source(p) = initVal + bestS
[0200] In an alternative embodiment, the error also takes into account the effects of transformation and quantization. This process works per transform unit and can be performed as follows:
[0201] - Apply the transform and quantization to the block of residual values Res_source(p) for all p positions in the block
[0202] - Set minError to a larger value
[0203] - For k = 0 to BS-1, scan each transform coefficient Coef[k], BS is the number of transform coefficients in the considered block
[0204] - Set initVal = Coef[k]
[0205] - For t = -T to T, T is a given value (e.g. T = 1)
[0206] - Set Coef[k] = initVal + t
[0207] - Perform inverse quantization and inverse transform on coefficient blocks
[0208] - Calculate the sum of the error margins over the block
[0209] SumErr=∑ p abs(Error(p)), where Res(p) is used instead of Res_source(p) to calculate Error(p)
[0210] -If(SumErr <minError)
[0211] - Set bestT = t
[0212] - Set minError = SumErr
[0213] - Set Coef[k] = initVal + bestT
[0214] In another embodiment, the interval length of the inverse mapping function is not a power of 2 and can vary from one segment to another, as in the default design. However, the number of segments is reduced compared to the forward mapping function. For example, it is reduced by a factor of 2 in order to reduce the number of checks required to identify the index of the block to which the value that must be inverse mapped belongs. This leads to a simplification of the design.
[0215] According to this embodiment, in addition to the scale value of the inverse mapping function, the interval length needs to be signaled. Examples of corresponding signaling are provided in the following table. A new syntax element "reshape_interval_length[i]" is inserted into the syntax. reshape_interval_length[i] represents the length of the i-th interval (i.e., the i-th segment). These values can be differentially decoded as "default" interval values derived from the forward function. For example, for i=0 to reshaperModelInvSize, the default interval value of segment i is equal to (fwdMap[(i+1)*Rinv]–fwdMap[i*Rinv]).
[0216]
[0217] Various methods are described herein, and each method includes one or more steps or actions for implementing the described method. Unless a specific order of steps or actions is required for proper operation of the method, the order and / or use of specific steps and / or actions may be modified or combined.
[0218] Various methods and other aspects described in this application can be used to modify modules, such as Figure 2 and Figure 3 The inverse mapping modules (290, 291, 390, 396) of the video encoder 200 and decoder 300 are shown. In addition, aspects of the present invention are not limited to VVC or HEVC, and can be applied to other standards and recommendations, as well as extensions of any such standards and recommendations. Unless otherwise specified or technically excluded, the aspects described in this application can be used alone or in combination.
[0219] Various numerical values are used in this application, for example, the slope used in the mapping function. The specific values are for example purposes, and the described aspects are not limited to these specific values.
[0220] Fig.11A block diagram of an example of a system in which various aspects and embodiments are implemented is shown. System 1100 may be embodied as a device comprising various components described below, and is configured to perform one or more of the aspects described in this application. Examples of such devices include, but are not limited to, various electronic devices, such as personal computers, laptop computers, smart phones, tablet computers, digital multimedia set-top boxes, digital television receivers, personal video recording systems, connected home appliances and servers. The elements of system 1100 may be implemented individually or in combination in a single integrated circuit, multiple ICs and / or discrete components. For example, in at least one embodiment, the processing and encoder / decoder elements of system 1100 are distributed on multiple ICs and / or discrete components. In various embodiments, system 1100 is coupled to other systems or other electronic devices via, for example, a communication bus or by a dedicated input and / or output port communication. In various embodiments, system 1100 is configured to implement one or more of the aspects described in this application.
[0221] System 1100 includes at least one processor 1110, which is configured to execute instructions loaded therein, for implementing various aspects described in the present application, for example. Processor 1110 may include embedded memory, input and output interfaces, and various other circuits known in the art. System 1100 includes at least one memory 1120 (e.g., volatile memory device and / or non-volatile memory device). System 1100 includes storage device 1140, which may include non-volatile memory and / or volatile memory, including but not limited to EEPROM, ROM, PROM, RAM, DRAM, SRAM, flash memory, disk drive, and / or optical drive. As a non-limiting example, storage device 1140 may include internal storage device, attached storage device, and / or network accessible storage device.
[0222] The system 1100 includes an encoder / decoder module 1130, which is configured to process data, for example, to provide encoded video or decoded video, and the encoder / decoder module 1130 may include its own processor and memory. The encoder / decoder module 1130 represents a module (one or more) that may be included in a device to perform encoding and / or decoding functions. As is known, a device may include one or both of the encoding and decoding modules. In addition, the encoder / decoder module 1130 may be implemented as a separate element of the system 1100, or may be incorporated into the processor 1110 as a combination of hardware and software known to those skilled in the art.
[0223] Program code to be loaded onto the processor 1110 or the encoder / decoder 1130 to perform various aspects described in this application may be stored in the storage device 1140 and subsequently loaded onto the memory 1120 for execution by the processor 1110. According to various embodiments, one or more of the processor 1110, the memory 1120, the storage device 1140, and the encoder / decoder module 1130 may store one or more of various items during the execution of the processes described in this application. These stored items may include, but are not limited to, input video, decoded video or portions of decoded video, bitstreams, matrices, variables, and intermediate or final results from the processing of equations, formulas, operations, and operational logic.
[0224] In several embodiments, memory inside the processor 1110 and / or the encoder / decoder module 1130 is used to store instructions and provide working memory for processing required during encoding or decoding. However, in other embodiments, memory outside the processing device (e.g., the processing device may be the processor 1110 or the encoder / decoder module 1130) is used for one or more of these functions. The external memory may be a memory 1120 and / or a storage device 1140, such as a dynamic volatile memory and / or a non-volatile flash memory. In several embodiments, an external non-volatile flash memory is used to store the operating system of the television. In at least one embodiment, a fast external dynamic volatile memory such as RAM is used as working memory for video coding and decoding operations such as MPEG-2, HEVC, or VVC.
[0225] As shown in block 1105, input to the elements of system 1100 may be provided through various input devices. Such input devices include, but are not limited to, (i) an RF section that receives an RF signal transmitted over the air, for example, by a broadcaster, (ii) a composite input terminal, (iii) a USB input terminal, and / or (iv) an HDMI input terminal.
[0226] In various embodiments, the input device of block 1105 has associated corresponding input processing elements known in the art. For example, the RF portion may be associated with elements suitable for: (i) selecting a desired frequency (also referred to as selecting a signal, or band limiting a signal to a frequency band), (ii) down-converting the selected signal, (iii) again band-limiting to a narrower frequency band to select a signal frequency band that may be referred to as a channel in some embodiments, (iv) demodulating the down-converted and band-limited signal, (v) performing error correction, and (vi) demultiplexing to select a desired data packet stream. The RF portion of various embodiments includes one or more elements to perform these functions, such as a frequency selector, a signal selector, a band limiter, a channel selector, a filter, a down-converter, a demodulator, an error corrector, and a demultiplexer. The RF portion may include a tuner that performs various of these functions, including, for example, down-converting a received signal to a lower frequency (e.g., an intermediate frequency or a near-baseband frequency) or a baseband. In a set-top box embodiment, the RF part and its relevant input processing element receive the RF signal transmitted by wired (for example, cable) medium, and filter to the frequency band of expectation again by filtering, down-conversion and perform frequency selection.Various embodiments rearrange the order of above-mentioned (and other) elements, remove some in these elements, and / or add other elements of performing similar or different functions.Adding element can include inserting element between existing element, for example, inserting amplifier and analog-to-digital converter.In various embodiments, the RF part comprises antenna.
[0227] In addition, the USB and / or HDMI terminals may include corresponding interface processors for connecting the system 1100 to other electronic devices via USB and / or HDMI connections. It should be understood that various aspects of input processing, such as Reed-Solomon error correction, can be implemented as needed, for example, in a separate input processing IC or processor 1110. Similarly, various aspects of USB or HDMI interface processing can be implemented as needed in a separate interface IC or in the processor 1110. The demodulated, error-corrected, and demultiplexed streams are provided to various processing elements, including, for example, the processor 1110 and an encoder / decoder 1130 operating in conjunction with memory and storage elements, so as to process the data stream as needed for presentation on an output device.
[0228] The various components of system 1100 may be disposed within an integrated housing. The various components may be interconnected and transmit data therebetween using a suitable connection arrangement 1115, such as an internal bus known in the art, including an I2C bus, wiring, and a printed circuit board.
[0229] The system 1100 includes a communication interface 1150 that enables communication with other devices via a communication channel 1190. The communication interface 1150 may include, but is not limited to, a transceiver configured to send and receive data through the communication channel 1190. The communication interface 1150 may include, but is not limited to, a modem or a network card, and the communication channel 1190 may be implemented, for example, within a wired and / or wireless medium.
[0230] In various embodiments, data is streamed to the system 1100 using a Wi-Fi network such as IEEE 802.11. The Wi-Fi signals of these embodiments are received through a communication channel 1190 and a communication interface 1150 suitable for Wi-Fi communications. The communication channel 1190 of these embodiments is typically connected to an access point or router that provides access to external networks including the Internet to allow streaming applications and other over-the-top communications. Other embodiments use a set-top box that delivers data through an HDMI connection of an input box 1105 to provide streaming data to the system 1100. Still other embodiments use an RF connection of an input box 1105 to provide streaming data to the system 1100.
[0231] The system 1100 can provide output signals to various output devices, including a display 1165, a speaker 1175, and other peripherals 1185. In various examples of embodiments, the other peripherals 1185 include one or more of a stand-alone DVR, a disk player, a stereo system, a lighting system, and other devices that provide functions based on the output of the system 1100. In various embodiments, control signals are transmitted between the system 1100 and the display 1165, the speaker 1175, or other peripherals 1185 using signaling, such as AV. Link, CEC, or other communication protocols that enable device-to-device control with or without user intervention. The output devices can be communicatively coupled to the system 1100 via dedicated connections through the corresponding interfaces 1160, 1170, and 1180. Alternatively, the output devices can be connected to the system 1100 via the communication interface 1150 using the communication channel 1190. The display 1165 and the speaker 1175 can be integrated into a single unit in an electronic device (e.g., a television) along with the other components of the system 1100. In various embodiments, the display interface 1160 includes a display driver, such as a timing controller (T Con) chip.
[0232] For example, if the RF portion of input 1105 is part of a separate set-top box, the display 1165 and speaker 1175 may alternatively be separate from one or more of the other components. In various embodiments where the display 1165 and speaker 1175 are external components, the output signals may be provided via dedicated output connections, including, for example, an HDMI port, a USB port, or a COMP output.
[0233] According to one embodiment, a method for video encoding or decoding is provided, comprising: performing forward mapping on predicted samples corresponding to samples of a block of a picture based on a forward mapping function; and performing inverse mapping on a reconstructed version of the samples of the block based on an inverse mapping function, wherein the inverse mapping function is an approximation of the inverse function of the forward mapping function, wherein the inverse mapping function is modeled as a piecewise linear function, and wherein each segment in the piecewise linear model is defined as having the same interval length.
[0234] According to another embodiment, a device for video encoding or decoding is provided, comprising one or more processors, wherein the one or more processors are configured to: perform forward mapping on a predicted sample corresponding to a sample of a block of a picture based on a forward mapping function; and perform inverse mapping on a reconstructed version of the sample of the block based on an inverse mapping function, wherein the inverse mapping function is an approximation of an inverse function of the forward mapping function, wherein the inverse mapping function is modeled as a piecewise linear function, and wherein each segment in the piecewise linear model is defined to have the same interval length. The device may further include one or more memories coupled to the one or more processors.
[0235] According to another embodiment, a video encoding or decoding device is provided, comprising: a device for performing forward mapping on predicted samples corresponding to samples of a block of a picture based on a forward mapping function; and a device for performing inverse mapping on a reconstructed version of the samples of the block based on an inverse mapping function, wherein the inverse mapping function is an approximation of the inverse function of the forward mapping function, wherein the inverse mapping function is modeled as a piecewise linear function, and wherein each segment in the piecewise linear model is defined as having the same interval length.
[0236] According to another embodiment, a signal including an encoded video is formed by performing the following steps: based on a forward mapping function, forward mapping is performed on predicted samples corresponding to samples of a block of a picture; and based on an inverse mapping function, inverse mapping is performed on a reconstructed version of the samples of the block, wherein the inverse mapping function is an approximation of the inverse function of the forward mapping function, wherein the inverse mapping function is modeled as a piecewise linear function, and wherein each segment in the piecewise linear model is defined to have the same interval length.
[0237] In one embodiment, the reconstructed version of the samples of the block is generated as the sum of: (1) the forward mapped prediction samples and (2) inverse quantized and inverse transformed prediction residuals corresponding to the samples.
[0238] In one embodiment, the interval length in the piecewise linear model is equal to a power of 2. In another embodiment, the intervals may have different lengths.
[0239] In one embodiment, the piecewise linear model is specified by the number of segments in the piecewise linear model, an initial offset value, and a slope of each segment in the piecewise linear model.
[0240] In one embodiment, the inverse mapping is further applied to the output samples at the decoder.
[0241] In one embodiment, the forward mapping is further applied to input samples at an encoder.
[0242] In one embodiment, in-loop filtering is applied to filter the inverse mapped reconstructed version of the samples of the block.
[0243] According to one embodiment, the encoder or decoder may skip forward mapping and inverse mapping when one or more of the following conditions are met:
[0244] (1) The prediction residual corresponding to the sample is zero;
[0245] (2) The prediction residuals of all samples of the block are zero;
[0246] (3) the block is encoded in skip mode; and
[0247] (4) The flag indicates that all transform coefficients are zero for the block.
[0248] In one embodiment, the number of segments in the piecewise linear model of the inverse mapping function is greater than or equal to the number of segments of the piecewise linear function used for the forward mapping function.
[0249] In one embodiment, the number of segments in the piecewise linear model is indicated in the bitstream.
[0250] In one embodiment, the initial offset value and the slope are indicated in a bitstream.
[0251] In one embodiment, the slope difference between: (1) an initial set of slope values to be derived at the decoder and (2) a set of slope values to be used to perform the inverse mapping is indicated in the bitstream.
[0252] In one embodiment, based on the forward mapping function, one or more parameters for performing the inverse mapping are derived.
[0253] In one embodiment, the inverse mapping function is first derived as the inverse function of the forward mapping and then adjusted to the piecewise linear function.
[0254] In one embodiment, the prediction residual corresponding to the sample of the block is adjusted before transformation. In another embodiment, the transform coefficients are adjusted before quantization. In one example, the prediction residual or transform coefficients are adjusted to reduce the error between the original sample and the inverse mapping of the sum of (1) the forward mapped prediction sample and (2) the prediction residual corresponding to the sample.
[0255] An embodiment provides a computer program including instructions, which, when executed by one or more processors, cause the one or more processors to perform an encoding method or a decoding method according to any one of the above embodiments. One or more of the embodiments of the present invention also provides a computer-readable storage medium on which instructions for encoding or decoding video data according to the method described above are stored. One or more embodiments also provide a computer-readable storage medium on which a bit stream generated according to the above method is stored. One or more embodiments also provide a method and apparatus for sending or receiving a bit stream generated according to the above method.
[0256] Various implementations involve decoding. "Decoding" as used in this application may include, for example, all or part of a process performed on a received coded sequence to produce a final output suitable for display. In various embodiments, such processes include one or more of the processes typically performed by a decoder, such as entropy decoding, inverse quantization, inverse transform, and differential decoding. Whether the phrase "decoding process" is intended to specifically refer to a subset of operations or generally refer to a broader decoding process will be clear based on the context of the specific description and is believed to be fully understood by those skilled in the art.
[0257] Various implementations involve encoding.In a manner similar to the discussion above regarding "decoding," "encoding" as used in this application may include, for example, all or part of a process performed on an input video sequence to produce an encoded bitstream.
[0258] Note that the syntax elements used here, such as the syntax used to characterize the inverse mapping function, are descriptive terms. Therefore, they do not exclude the use of other syntax element names.
[0259] The implementations and aspects described herein can be implemented in, for example, methods or processes, devices, software programs, data streams, or signals. Even if only discussed in the context of a single form of implementation (e.g., discussed only as a method), the implementation of the features discussed can also be implemented in other forms (e.g., devices or programs). For example, the device can be implemented with appropriate hardware, software, and firmware. The method can be implemented in, for example, a device, such as a processor, which generally refers to a processing device, including, for example, a computer, a microprocessor, an integrated circuit, or a programmable logic device. The processor also includes a communication device, such as a computer, a cellular phone, a portable / personal digital assistant ("PDA"), and other devices that facilitate information communication between end users.
[0260] References to "one embodiment" or "an embodiment" or "an implementation" or "an implementation" and other variations mean that a particular feature, structure, characteristic, etc. described in connection with the embodiment is included in at least one embodiment. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" or "in an implementation" or "in an implementation" and any other variations in various places in this application do not necessarily all refer to the same embodiment.
[0261] Additionally, the present application may refer to “determining” various information. Determining information may include, for example, one or more of estimating information, calculating information, predicting information, or retrieving information from a memory.
[0262] Furthermore, the present application may involve "accessing" various information. Accessing information may include, for example, receiving information, retrieving information (e.g., from a memory), storing information, moving information, copying information, calculating information, determining information, predicting information, or estimating information.
[0263] Additionally, the present application may refer to "receiving" various information. Like "accessing," receiving is intended to be a broad term. Receiving information may include, for example, one or more of accessing information or retrieving information (e.g., from a memory). Furthermore, during operations such as storing information, processing information, sending information, moving information, copying information, erasing information, calculating information, determining information, predicting information, or estimating information, "receiving" is often involved in one way or another.
[0264] It should be understood that the use of any of the following " / ", "and / or", and "at least one of" (e.g., in the case of "A / B", "A and / or B", and "at least one of A and B") is intended to cover selection of only the first listed option (A), or only the second listed option (B), or both options (A and B). As a further example, in the case of "A, B, and / or C" and "at least one of A, B, and C", such wording is intended to include selection of only the first listed option (A), or only the second listed option (B), or only the third listed option (C), or only the first and second listed options (A and B), or only the first and third listed options (A and C), or only the second and third listed options (B and C), or all three options (A and B and C). This can be extended to multiple items listed, as will be apparent to one of ordinary skill in this and related arts.
[0265] In addition, as used herein, the word "signal / signaling" especially refers to a corresponding decoder indicating something. For example, in some embodiments, the encoder signals the number of segments in the piecewise linear model to the decoder. In this way, in one embodiment, the same parameters are used on the encoder side and the decoder side. Therefore, for example, the encoder can send (explicit signaling) specific parameters to the decoder so that the decoder can use the same specific parameters. On the contrary, if the decoder already has specific parameters and other parameters, signaling can be used without sending (implicit signaling) to simply allow the decoder to know and select specific parameters. By avoiding the transmission of any actual function, bit saving is achieved in various embodiments. It should be understood that signaling can be implemented in various ways. For example, in various embodiments, one or more syntax elements, flags, etc. are used to signal information to the corresponding decoder. Although the foregoing relates to the verb form of the word "signal / signaling", the word "signal / signaling" can also be used as a noun in this article.
[0266] As will be apparent to one of ordinary skill in the art, implementations may generate various signals formatted to carry information that may be stored or transmitted, for example. The information may include, for example, instructions for executing a method, or data generated by one of the described implementations. For example, a signal may be formatted to carry a bitstream of the described embodiments. Such a signal may be formatted as, for example, an electromagnetic wave (e.g., using a radio frequency portion of a spectrum) or a baseband signal. Formatting may include, for example, encoding a data stream and modulating a carrier with the encoded data stream. The information carried by the signal may be, for example, analog or digital information. As is known, the signal may be transmitted over a variety of different wired or wireless links. The signal may be stored on a processor readable medium.
Claims
1. A method for video encoding or decoding, comprising: applying forward mapping to prediction samples corresponding to samples of a block of a picture based on a forward mapping function, wherein the forward mapping function is modeled as a first piecewise linear function, and wherein each segment in the first piecewise linear function is defined to have a same first interval length; as well as applying an inverse mapping to a reconstructed version of the samples of the block based on an inverse mapping function, wherein the inverse mapping function is based on the inverse function of the forward mapping function, wherein the inverse mapping function is modeled as a second piecewise linear function, and Each segment in the second piecewise linear function is defined to have the same second interval length.
2. The method according to claim 1, wherein: The second interval length in the second piecewise linear function is equal to a power of 2.
3. The method according to claim 1, wherein: The second piecewise linear function is specified by: the number of segments in the second piecewise linear function, an initial offset value, and a slope of each segment in the second piecewise linear function.
4. The method according to claim 1, wherein: The inverse mapping is further applied to the output samples at the decoder.
5. The method according to claim 1, wherein: The forward mapping is further applied to the input samples at the encoder.
6. The method according to claim 1, wherein: Whether the forward mapping and the inverse mapping are performed is responsive to whether one or more of the following conditions are satisfied: (1) The prediction residual corresponding to the sample is zero; (2) The prediction residuals of all samples of the block are zero; (3) the block is encoded in skip mode; and (4) The flag indicates that all transform coefficients are zero for the block.
7. The method according to claim 1, wherein: The number of segments in the second piecewise linear function used for the inverse mapping function is greater than or equal to the number of segments in the first piecewise linear function used for the forward mapping function.
8. The method according to claim 1, wherein: The number of segments in the second piecewise linear function is indicated in the bitstream.
9. The method according to claim 3, wherein: The initial offset value and the slope are indicated in the bitstream.
10. The method according to claim 9, wherein: The slope difference between (1) an initial set of slope values to be derived at the decoder and (2) a set of slope values to be used to perform the inverse mapping is indicated in the bitstream.
11. The method according to claim 1, wherein: One or more parameters for performing the inverse mapping are derived based on the forward mapping function.
12. The method according to claim 11, wherein: The inverse mapping function is first derived as the inverse function of the forward mapping and then adjusted to the second piecewise linear function.
13. An apparatus for video encoding or decoding, comprising one or more processors and at least one memory coupled to the one or more processors, wherein the one or more processors are configured to: applying forward mapping to prediction samples corresponding to samples of a block of a picture based on a forward mapping function, wherein the forward mapping function is modeled as a first piecewise linear function, and wherein each segment in the first piecewise linear function is defined to have a same first interval length; and applying an inverse mapping to a reconstructed version of the samples of the block based on an inverse mapping function, wherein the inverse mapping function is based on the inverse function of the forward mapping function, wherein the inverse mapping function is modeled as a second piecewise linear function, and Each segment in the second piecewise linear function is defined to have the same second interval length.
14. The device according to claim 13, wherein: The second interval length in the second piecewise linear function is equal to a power of 2.
15. The device according to claim 13, wherein: The second piecewise linear function is specified by: the number of segments in the second piecewise linear function, an initial offset value, and a slope of each segment in the second piecewise linear function.
16. The device according to claim 13, wherein: Whether the forward mapping and the inverse mapping are performed is responsive to whether one or more of the following conditions are satisfied: (1) The prediction residual corresponding to the sample is zero; (2) The prediction residuals of all samples of the block are zero; (3) the block is encoded in skip mode; and (4) The flag indicates that all transform coefficients are zero for the block.
17. The device according to claim 13, wherein: The number of segments in the second piecewise linear function is indicated in the bitstream.
18. The device according to claim 15, wherein: The initial offset value and the slope are indicated in the bitstream.
19. The device according to claim 13, wherein: One or more parameters for performing the inverse mapping are derived based on the forward mapping function.
20. The device according to claim 13, wherein: Prediction residuals corresponding to said samples of said block are adjusted before being transformed.
