Decoding method, encoding method, decoder, and encoder
Patent Information
- Application Number
- CN202380090219.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-15
- Publication Date
- 2025-08-12
AI Technical Summary
In the existing technology, there are still challenges in improving the performance of entropy encoding and decoding in point cloud encoding and decoding. Especially when processing a large amount of point cloud data, the compression requirements caused by storage and transmission have not been effectively solved.
By obtaining and splitting the two decoding parameters to determine the zero-run value, the decoding codeword is reduced, thereby improving the encoding and decoding performance.
The performance of point cloud encoding and decoding is improved, the code stream length and decoding time are reduced, and the point cloud compression efficiency is improved.
Smart Images

Figure CN120476598A_ABST
Abstract
Description
Decoding method, encoding method, decoder and encoder Technical Field
[0001] The embodiments of the present application relate to the field of coding and decoding technology, and more specifically, to a decoding method, an encoding method, a decoder, and an encoder. Background Art
[0002] Point clouds have become ubiquitous in various fields, such as virtual / augmented reality, robotics, geographic information systems, and medicine. With the continuous improvement of the accuracy and speed of scanning equipment, large amounts of point clouds can be accurately acquired from object surfaces, often corresponding to hundreds of thousands of points in a single scene. This massive number of points also poses challenges for computer storage and transmission. Therefore, point compression has become a hot topic.
[0003] For point cloud compression, it is mainly necessary to compress its geometric information and attribute information. Specifically, the encoder first divides the geometric information of the point cloud into octrees, and then uses an entropy coding algorithm to entropy encode the geometric information expressed by the octree structure to obtain a geometric code stream. At the same time, the encoder reconstructs the geometric information based on the geometric information expressed by the octree structure, and predicts the attribute coefficients of the current point based on the reconstructed geometric information. The residual of the current point is obtained by subtracting it from the original value of the attribute information, and then the residual is quantized to obtain a quantized residual. The quantized residual is entropy encoded using an entropy coding algorithm to obtain an attribute code stream.
[0004] However, how to improve the entropy encoding and decoding performance is still a technical problem that needs to be solved urgently in this field.
[0005] Summary of the Invention
[0006] The embodiments of the present application provide a decoding method, an encoding method, a decoder, and an encoder, which can improve encoding and decoding performance.
[0007] In a first aspect, an embodiment of the present application provides a decoding method, comprising:
[0008] Get the first parameter and the second parameter;
[0009] Based on the first parameter and the second parameter, a first zero-run value is determined.
[0010] In a second aspect, an embodiment of the present application provides an encoding method, including:
[0011] Get the first zero run value;
[0012] determining a first parameter and a second parameter based on the first zero-run value;
[0013] The first parameter and the second parameter are encoded.
[0014] In a third aspect, an embodiment of the present application provides a decoder, including:
[0015] an acquiring unit, configured to acquire a first parameter and a second parameter;
[0016] The determining unit is configured to determine a first zero-run value based on the first parameter and the second parameter.
[0017] In a fourth aspect, an embodiment of the present application provides an encoder, including:
[0018] an acquiring unit, configured to acquire a first zero-run value;
[0019] a determining unit, configured to determine a first parameter and a second parameter based on the first zero-run value;
[0020] The encoding unit is configured to encode the first parameter and the second parameter.
[0021] In a fifth aspect, an embodiment of the present application provides a decoder, including:
[0022] a processor adapted to implement computer instructions; and,
[0023] Computer-readable storage medium, the computer-readable storage medium stores computer instructions, and the computer instructions are suitable for being loaded by a processor and executing the decoding method in the above-mentioned first aspect or its various implementations.
[0024] In one implementation, there are one or more processors and one or more memories.
[0025] In one implementation, the computer-readable storage medium may be integrated with the processor, or the computer-readable storage medium may be provided separately from the processor.
[0026] In a sixth aspect, an embodiment of the present application provides an encoder, including:
[0027] a processor adapted to implement computer instructions; and,
[0028] A computer-readable storage medium stores computer instructions, wherein the computer instructions are suitable for being loaded by a processor and executing the encoding method in the second aspect or its various implementations.
[0029] In one implementation, there are one or more processors and one or more memories.
[0030] In one implementation, the computer-readable storage medium may be integrated with the processor, or the computer-readable storage medium may be provided separately from the processor.
[0031] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are read and executed by a processor of a computer device, the computer device executes the decoding method involved in the first aspect or the encoding method involved in the second aspect.
[0032] In an eighth aspect, embodiments of the present application provide a computer program product or computer program, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the decoding method of the first aspect or the encoding method of the second aspect.
[0033] In a ninth aspect, an embodiment of the present application provides a code stream, which is the code stream involved in the method described in the first aspect or the code stream generated by the method described in the second aspect.
[0034] Based on the above technical solution, for the decoding method provided in the embodiment of the present application, the decoder obtains the first parameter and the second parameter, and determines the first zero-run value based on the first parameter and the second parameter; this is equivalent to splitting and decoding the first zero-run value, which can reduce the decoding codeword and thus improve the encoding and decoding performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] FIG1 is an example of a point cloud image provided by an embodiment of the present application.
[0036] FIG2 is a partially enlarged view of the point cloud image shown in FIG1 .
[0037] FIG3 is an example of a point cloud image with six viewing angles provided by an embodiment of the present application.
[0038] FIG4 is a schematic block diagram of a G-PCC coding framework provided in an embodiment of the present application.
[0039] FIG5 is a schematic block diagram of a G-PCC decoding framework provided in an embodiment of the present application.
[0040] FIG6 is a schematic block diagram of an AVS PCC coding framework provided in an embodiment of the present application.
[0041] FIG7 is a schematic block diagram of an AVS PCC decoding framework provided in an embodiment of the present application.
[0042] FIG8 is a schematic flowchart of a decoding method provided in an embodiment of the present application.
[0043] FIG9 is a schematic flowchart of the encoding method provided in an embodiment of the present application.
[0044] FIG10 is a schematic flow chart of a decoder provided in an embodiment of the present application.
[0045] FIG11 is a schematic flow chart of an encoder provided in an embodiment of the present application.
[0046] FIG12 is a schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
[0048] A point cloud is a collection of irregularly distributed discrete points in space that represent the spatial structure and surface properties of a three-dimensional object or scene. Figures 1 and 2 show a 3D point cloud image and a zoomed-in view, respectively. The point cloud surface is composed of densely distributed points.
[0049] A two-dimensional image contains information at every pixel, so there's no need to record its location information separately. However, the distribution of points in a point cloud in three-dimensional space is random and irregular, so it's necessary to record the location of each point in space to fully represent a point cloud. Similar to a two-dimensional image, each point in a point cloud has corresponding attribute information, typically an RGB color value, which reflects the color of the object. For a point cloud, in addition to color, the attribute information corresponding to each point can also be a reflectance value, which reflects the surface material of the object. Each point in a point cloud can include both geometric and attribute information. The geometric information of each point in a point cloud refers to the Cartesian three-dimensional coordinate data of that point, and the attribute information of each point in a point cloud can include, but is not limited to, at least one of the following: color information, material information, and laser reflection intensity information. Color information can be information in any color space. For example, color information can be red, green, and blue (RGB) information. For another example, color information can also be luminance and chrominance (YCbCr, YUV) information. Here, Y represents brightness (Luma), Cb (U) represents the blue chromaticity component, and Cr (V) represents the red chromaticity component. Each point in a point cloud has the same amount of attribute information. For example, each point in a point cloud has two types of attribute information: color information and laser reflection intensity. Another example is that each point in a point cloud has three types of attribute information: color information, material information, and laser reflection intensity information.
[0050] Point cloud images can have multiple viewing angles. For example, the point cloud image shown in Figure 3 can have six viewing angles. The data storage format of the point cloud image consists of a file header information part and a data part. The header information includes the data format, data representation type, the total number of point cloud points, and the content represented by the point cloud.
[0051] For example, the data storage format of the point cloud image can be implemented in the following format:
[0052] ply
[0053] format ascii 1.0
[0054] element vertex 207242
[0055] property float x
[0056] property float y
[0057] property float z
[0058] property uchar red
[0059] property uchar green
[0060] property uchar blue
[0061] 75 318 0 0 142 0
[0062] 75 319 0 0 143 0
[0063] 75 319 1 1 9 9
[0064] 75 315 0 1 9 9.
[0065] The data storage format of the above point cloud image is ".ply" format, represented by ASCII code, with a total number of points of 207242, and each point has three-dimensional position information xyz and three-dimensional color information rgb.
[0066] Point clouds can flexibly and conveniently express the spatial structure and surface properties of three-dimensional objects or scenes. Moreover, since point clouds are obtained by directly sampling real objects, they can provide a strong sense of reality while ensuring accuracy. Therefore, they are widely used, including virtual reality games, computer-aided design, geographic information systems, automatic navigation systems, digital cultural heritage, free viewpoint broadcasting, three-dimensional immersive remote presentation, and three-dimensional reconstruction of biological tissues and organs.
[0067] For example, point clouds can be divided into two categories based on application scenarios: machine-perceived point clouds and human-perceived point clouds. Application scenarios for machine-perceived point clouds include, but are not limited to, autonomous navigation systems, real-time inspection systems, geographic information systems, visual sorting robots, and disaster relief robots. Application scenarios for human-perceived point clouds include, but are not limited to, digital cultural heritage, free-viewpoint broadcasting, 3D immersive communication, and 3D immersive interaction. Accordingly, point clouds can be divided into dense and sparse point clouds based on their acquisition method. They can also be divided into static and dynamic point clouds based on their acquisition approach. More specifically, point clouds can be divided into three types: first-class static point clouds, second-class dynamic point clouds, and third-class dynamically acquired point clouds. For the first-class static point clouds, the object is stationary and the device acquiring the point cloud is also stationary. For the second-class dynamic point clouds, the object is moving, but the device acquiring the point cloud is stationary. For the third-class dynamically acquired point clouds, the device acquiring the point cloud is moving.
[0068] Exemplarily, point cloud acquisition methods include, but are not limited to, computer generation, 3D laser scanning, and 3D photogrammetry. Computers can generate point clouds of virtual three-dimensional objects and scenes; 3D laser scanning can obtain point clouds of static real-world three-dimensional objects or scenes, and can obtain millions of point clouds per second; 3D photogrammetry can obtain point clouds of dynamic real-world three-dimensional objects or scenes, and can obtain tens of millions of point clouds per second. Specifically, point clouds on the surface of an object can be acquired through acquisition equipment such as photoelectric radars, lidars, laser scanners, and multi-view cameras. The point cloud obtained according to the principle of laser measurement may include the three-dimensional coordinate information of the point and the laser reflection intensity (reflectance) of the point. The point cloud obtained according to the principle of photogrammetry may include the three-dimensional coordinate information of the point and the color information of the point. The point cloud obtained by combining the principles of laser measurement and photogrammetry may include the three-dimensional coordinate information of the point, the laser reflection intensity (reflectance) of the point, and the color information of the point. These technologies reduce the cost and time cycle of point cloud data acquisition and improve the accuracy of the data. For example, in the medical field, magnetic resonance imaging (MRI), computed tomography (CT), and electromagnetic positioning information can be used to generate point clouds of biological tissues and organs. These technologies reduce the cost and time required to acquire point clouds, while improving data accuracy. While changes in point cloud data acquisition methods have made it possible to acquire large amounts of point cloud data, the processing of massive amounts of 3D point cloud data is facing bottlenecks due to storage space and transmission bandwidth limitations, as application demands grow.
[0069] Taking a point cloud video with a frame rate of 30 as an example, each frame contains 700,000 points. Each point in each point cloud frame has coordinate information (xyz, float) and color information (RGB, uchar). Therefore, the data volume of a 10-second point cloud video is approximately 0.7 million × (4 bytes × 3 + 1 byte × 3) × 30 fps × 10 seconds = 3.15 GB. For a 2D video with a resolution of 1280 × 720, a YUV sampling format of 4:2:0, and a frame rate of 24, the data volume per 10 seconds is approximately 1280 × 720 × 12 bits × 24 frames × 10 seconds, which is approximately 0.33 GB. A 10-second two-view 3D video has a data volume of approximately 0.33 × 2 = 0.66 GB. This shows that the data volume of a point cloud video far exceeds that of 2D and 3D videos of the same length. Therefore, in order to better realize data management, save server storage space, and reduce the transmission traffic and transmission time between the server and the client, point cloud compression has become a key issue in promoting the development of the point cloud industry.
[0070] Point cloud compression generally compresses point cloud geometry and attribute information separately. On the encoding side, the point cloud geometry is first encoded in the geometry encoder, and the reconstructed geometry is then fed into the attribute encoder as additional information to assist in attribute compression. On the decoding side, the point cloud geometry is first decoded in the geometry decoder, and the decoded geometry is then fed into the attribute decoder as additional information to assist in attribute compression. The entire codec consists of pre-processing / post-processing, geometry encoding / decoding, and attribute encoding / decoding.
[0071] Exemplarily, the point cloud can be encoded and decoded respectively by various types of encoding frameworks and decoding frameworks. As an example, the encoding and decoding framework can be the Geometry Point Cloud Compression (G-PCC) encoding and decoding framework or the Video Point Cloud Compression (V-PCC) encoding and decoding framework provided by the Moving Picture Experts Group (MPEG), or it can be the AVS-PCC encoding and decoding framework or the Point Cloud Compression Reference Platform (PCRM) framework provided by the Audio Video Standard (AVS) Task Force. The G-PCC encoding and decoding framework can be used to compress the first static point cloud and the third type of dynamically acquired point cloud, and the V-PCC encoding and decoding framework can be used to compress the second type of dynamic point cloud. The G-PCC encoding and decoding framework is also called the point cloud codec TMC13, and the V-PCC encoding and decoding framework is also called the point cloud codec TMC2. Both G-PCC and AVS-PCC can be used to compress static sparse point clouds, and their encoding frameworks are roughly the same.
[0072] The following describes the applicable coding and decoding frameworks using the G-PCC framework and the AVS PCC framework as examples.
[0073] FIG4 is a schematic block diagram of a G-PCC coding framework provided in an embodiment of the present application.
[0074] As shown in Figure 4, in the G-PCC coding framework, the input point cloud is first sliced, and then the resulting slices are independently encoded. Within the slices, the geometric information of the point cloud and the attribute information corresponding to the points in the point cloud are encoded separately.
[0075] For geometric information, the G-PCC encoding framework first performs coordinate transformation on the geometric information so that all point clouds are contained in a bounding box. Quantization is then performed. This quantization step mainly serves the purpose of scaling. Due to quantization rounding, the geometric information of some points is made identical. Parameters are used to determine whether to remove duplicate points. This process of quantization and removing duplicate points is also called voxelization. Next, the bounding box is divided based on an octree. Depending on the depth of the octree division level, the encoding of geometric information is divided into an octree-based geometric information encoding framework and a triangle soup (trisoup)-based geometric information encoding framework.
[0076] In the octree-based geometric information coding framework, the bounding box is first divided into eight equal parts, or eight sub-cubes. The placeholder bits of the sub-cubes are recorded (1 for non-empty, 0 for empty). The non-empty sub-cubes are then divided into eight equal parts, usually stopping when the resulting leaf node is a 1x1x1 unit cube. During this process, the placeholder bits are intra-predicted using the spatial correlation between the node and its surrounding nodes. Based on the prediction results, the corresponding binary arithmetic encoder is selected for arithmetic encoding, implementing context-based adaptive binary arithmetic coding (CABAC) and generating a binary bitstream.
[0077] In the geometric information coding framework based on triangle face sets, octree partitioning must also be performed first. However, unlike the geometric information coding framework based on octree, the geometric information coding framework based on triangle face sets does not need to divide the point cloud into unit cubes with a side length of 1x1x1 step by step. Instead, the division is stopped when the block has a side length of W. Based on the surface formed by the distribution of the point cloud in each block, at most twelve intersections (vertex) generated by the surface and the twelve edges of the block are obtained, and then the coordinates of the intersection of each block are encoded in turn to generate a binary code stream.
[0078] After encoding the geometric information, the G-PCC coding framework reconstructs the geometry and uses the reconstructed geometry to encode the attribute information of the point cloud. Attribute encoding of the point cloud primarily involves encoding the color information of the points in the point cloud. First, the G-PCC coding framework can perform color space conversion on the color information of the points. For example, when the color information of the points in the input point cloud is represented in the RGB color space, the G-PCC coding framework can convert the color information from RGB to YUV. The G-PCC coding framework then uses the reconstructed geometry to recolor the point cloud, aligning the unencoded attribute information with the reconstructed geometry. There are two main transformation methods for color information encoding: one relies on a distance-based lifting transform based on level of detail (LOD) partitioning, and the other directly performs a region-adaptive hierarchical transform (RAHT). Both methods transform the color information from the spatial domain to the frequency domain, obtaining high-frequency and low-frequency coefficients. Finally, these coefficients are quantized and encoded to generate a binary bitstream.
[0079] FIG5 is a schematic block diagram of a G-PCC decoding framework provided in an embodiment of the present application.
[0080] As shown in Figure 5, the G-PCC decoding framework can obtain the point cloud code stream from the G-PCC encoding framework, and obtain the position information and attribute information of the points in the point cloud by parsing the code. The decoding of the point cloud includes position decoding and attribute decoding. The position decoding process includes: performing arithmetic decoding on the geometric code stream; reconstructing the octree based on the decoded data, and then reconstructing the position information of the point to obtain the reconstructed information of the point position information; performing coordinate transformation on the reconstructed information of the point position information to obtain the position information of the point. The position information of the point can also be called the geometric information of the point. The attribute decoding process includes: obtaining the residual value of the attribute information of the point in the point cloud by parsing the attribute code stream; obtaining the residual value of the attribute information of the point after dequantization by dequantizing the residual value of the attribute information of the point; selecting one of the three prediction modes for point cloud prediction based on the reconstructed information of the point position information obtained during the position decoding process to obtain the attribute reconstruction value of the point; and performing color space inverse transformation on the attribute reconstruction value of the point to obtain the decoded point cloud.
[0081] The general test conditions for G-PCC may include the following aspects:
[0082] 1) Test conditions, which include the following 4 types:
[0083] Condition 1: Geometric position lossless, attribute lossy;
[0084] Condition 2: Geometric position loss and attribute loss;
[0085] Condition 3: Geometric position and attribute lossless;
[0086] Condition 4: Geometric position is lossless, and attributes are lossy to a limited extent.
[0087] 2) General test sequence, which includes 6 categories: Solid, Dense, Sparse, Scant, Am-fused, and Am-frame. Among them, Am-frame point cloud only contains reflectance attribute information, Solid, Dense, Sparse, and Scant point clouds only contain color attribute information, and Am-fused point cloud can contain both color and reflectance attribute information.
[0088] 3) Technical route: The attribute coding framework of MPEG G-PCC is distinguished by the algorithm used for attribute compression, which can be divided into the following three types:
[0089] Technical Route 1: Predicting (Pred) branch, only for conditions 3 and 4.
[0090] At the encoding end, the prediction method of the prediction branch is used to obtain the attribute residual coefficients, and the attribute residual coefficients are entropy coded.
[0091] At the decoding end, entropy decoding obtains the attribute residual coefficients, and the prediction method of the prediction branch is used to restore the original values.
[0092] Technical route 2: Predicting lifting transform (PredLift) branch, only for conditions 1 and 2.
[0093] At the encoding end, the attribute transformation coefficients are obtained by using the prediction lifting transformation branch method, and the attribute transformation coefficients are entropy coded.
[0094] At the decoding end, entropy decoding obtains the attribute transformation coefficients, and the prediction lifting transformation branch method is used to restore the original value.
[0095] Technical route 3: Region Adaptive Hierarchal Transform (RAHT) branch, only for conditions 1 and 2.
[0096] At the encoding end, the attribute transformation coefficients are obtained using the RAHT branch method, and entropy coding is performed on the attribute transformation coefficients.
[0097] At the decoding end, entropy decoding is used to obtain the attribute transformation coefficients, and the RAHT branch method is used to restore the original values.
[0098] For the attribute residual coefficients (attribute residual coefficients generated by using prediction branch encoding) or attribute transform coefficients (attribute transform coefficients generated by using prediction lifting transform branch or RAHT branch encoding) generated by the above technical route, attribute entropy encoding and decoding are performed.
[0099] FIG6 is a schematic block diagram of an AVS PCC coding framework provided in an embodiment of the present application.
[0100] As shown in Figure 6, in the point cloud AVS PCC encoder framework, the geometric information of the point cloud and the attribute information corresponding to each point are encoded separately.
[0101] In the geometric coding part of the encoding end, first, the original geometric information is preprocessed, that is, the geometric origin is normalized to the minimum position in the point cloud space through coordinate translation, and the geometric information is converted from floating point numbers to integers through coordinate quantization to facilitate subsequent regularization processing. Since the geometric information of some points is the same due to quantization rounding, it is necessary to decide whether to remove duplicate points. Removing duplicate points is also a preprocessing process; then, the regularized geometric information is geometrically encoded, that is, the point cloud space is recursively divided using an octree structure, and the current block is divided into eight sub-blocks of the same size each time, and the occupancy codeword of each sub-block is judged. When the sub-block does not contain a point, it is recorded as empty, otherwise it is recorded as non-empty. The occupancy codeword information of all blocks is recorded in the last layer of the recursive division and encoded; that is, the geometric information expressed by the octree structure is input into the geometric entropy encoder to form a geometric code stream on the one hand, and on the other hand, it is used to reconstruct the geometric information and encode the attribute information based on the reconstructed geometric information.
[0102] In the attribute encoding part, first, it is determined whether to perform color space conversion. If the attribute information being processed is color information, the original color space needs to be transformed into a YUV color space that is more consistent with the visual characteristics of the human eye. Then, in the case of lossy geometric coding, since the geometric information changes after geometric encoding, it is necessary to reassign attribute values to each point after geometric encoding to minimize the attribute error between the reconstructed point cloud and the original point cloud. This process is called attribute interpolation or attribute recoloring. Next, attribute encoding is performed on the preprocessed attribute information. During the attribute encoding process, the point cloud needs to be reordered using Morton code, so the traversal order of attribute encoding is Morton order. Then, single-point prediction is performed based on the Morton order, that is, the Morton order is used to trace back one point from the current point to be encoded. The point found is the prediction reference point for the current point to be encoded. The attribute reconstructed value of the predicted reference point is then used as the attribute prediction value. The attribute residual is the difference between the attribute value of the current point to be encoded and the attribute prediction value. Finally, the residual is quantized and input into the attribute entropy encoder to form the attribute code stream.
[0103] FIG7 is a schematic block diagram of an AVS PCC decoding framework provided in an embodiment of the present application.
[0104] As shown in Figure 7, the decoding end also adopts the method of decoding geometry and attributes separately. In the geometry decoding part, the geometry bitstream is first entropy decoded to obtain the geometric information of each point. Then, the octree structure is reconstructed in the same way as the geometry encoding. The decoded geometry is combined to reconstruct the geometric information expressed by the octree structure after coordinate transformation. On the one hand, the coordinates of this information are dequantized and detranslated to obtain the decoded geometry information. On the other hand, it is input into the attribute decoder as additional information. In the attribute decoding part, the Morton order is constructed in the same way as the encoding end. First, the attribute bitstream is entropy decoded to obtain the quantized residual information; then, dequantization is performed to obtain the point cloud residual; similarly, in the same way as the attribute encoding, the attribute prediction value of the current point to be decoded is obtained. Then, the attribute prediction value is added to the residual value to restore the YUV attribute value of the current point to be decoded; finally, the decoded attribute information is obtained through color space inverse transformation.
[0105] The general test conditions of AVS PCC may include the following aspects:
[0106] 1) Test conditions, which include the following 4 types:
[0107] Condition 1: Geometric position is lossy to a limited extent and attributes are lossy.
[0108] Condition 2: Geometric position lossless, attribute lossy.
[0109] Condition 3: Geometric position lossless, attribute loss limited.
[0110] Condition 4: Geometric position and attributes are lossless.
[0111] 2) General test sequence, which includes five categories: Cat1A, Cat1B, Cat1C, Cat2-frame and Cat3. Among them, Cat1A and Cat2-frame point clouds only contain reflectivity attribute information, Cat1B and Cat3 point clouds only contain color attribute information, and Cat1B point cloud contains color and reflectivity attribute information.
[0112] 3) Technical route: When the AVS PCC coding framework compresses the attribute information of the point cloud, it can be divided into the following three technical routes based on the adopted algorithm:
[0113] Technical route 1: Prediction branch.
[0114] For technical route 1, its attribute compression adopts a method based on intra-frame prediction.
[0115] At the encoding end, the points in the point cloud are processed in a certain order (the original acquisition order of the point cloud, the Morton order, the Hilbert order, etc.). First, the prediction algorithm is used to obtain the attribute prediction value. The attribute residual is obtained based on the attribute value and the attribute prediction value. Then, the attribute residual is quantized to generate the quantized residual. Finally, the quantized residual is encoded.
[0116] At the decoding end, the points in the point cloud are processed in a certain order (the original acquisition order of the point cloud, Morton order, Hilbert order, etc.). First, the prediction algorithm is used to obtain the attribute prediction value, then the decoding is performed to obtain the quantized residual, and then the quantized residual is dequantized. Finally, the attribute reconstruction value is obtained based on the attribute prediction value and the dequantized residual.
[0117] Technical route 2: Predicting and transform (Predtrans) branch with limited resources.
[0118] For technical route 2, its attribute compression adopts a method based on intra-frame prediction and DCT transformation. When encoding or decoding the quantized transform coefficients, there is a maximum point number X (such as 4096), that is, at most every X points can be encoded as a group.
[0119] At the encoding end, the points in the point cloud are processed in a certain order (the original acquisition order of the point cloud, Morton order, Hilbert order, etc.). First, the entire point cloud is divided into several small groups with a maximum length of Y (such as 2). These small groups are then combined into several large groups (the number of points in each large group does not exceed X, such as 4096). A prediction algorithm is then used to obtain attribute prediction values. Attribute residuals are obtained based on the attribute values and attribute prediction values. DCT transforms are performed on the attribute residuals in small groups to generate transform coefficients. The transform coefficients are then quantized to generate quantized transform coefficients. Finally, the quantized transform coefficients are encoded in large groups.
[0120] At the decoding end, the points in the point cloud are processed in a certain order (the original acquisition order of the point cloud, Morton order, Hilbert order, etc.). First, the entire point cloud is divided into several small groups with a maximum length of Y (such as 2). Then these small groups are combined into several large groups (the number of points in each large group does not exceed X, such as 4096). The quantized transform coefficients are decoded in large groups, and then the prediction algorithm is used to obtain the attribute prediction value. The quantized transform coefficients are then dequantized and inversely transformed in small groups. Finally, the attribute reconstruction value is obtained based on the attribute prediction value and the dequantized and inversely transformed coefficients.
[0121] Technical route 3: Predicting and transform (Predtrans) branch with unlimited resources.
[0122] For technical route 3, its attribute compression adopts a method based on intra-frame prediction and DCT transformation. When encoding or decoding the quantized transformation coefficients, there is no limit on the maximum number of points X, that is, all coefficients are encoded together.
[0123] At the encoding end, the points in the point cloud are processed in a certain order (the original acquisition order of the point cloud, Morton order, Hilbert order, etc.). First, the entire point cloud is divided into several small groups with a maximum length of Y (such as 2). Then, the prediction algorithm is used to obtain the attribute prediction value. The attribute residual is obtained based on the attribute value and the attribute prediction value. The attribute residual is transformed by DCT in groups to generate transformation coefficients. The transformation coefficients are then quantized to generate quantized transformation coefficients. Finally, the quantized transformation coefficients of the entire point cloud are encoded.
[0124] At the decoding end, the points in the point cloud are processed in a certain order (the original acquisition order of the point cloud, Morton order, Hilbert order, etc.). First, the entire point cloud is divided into several small groups with a maximum length of Y (such as 2). The quantized transformation coefficients of the entire point cloud are obtained by decoding, and then the prediction algorithm is used to obtain the attribute prediction value. The quantized transformation coefficients are then dequantized and inversely transformed in groups. Finally, the attribute reconstruction value is obtained based on the attribute prediction value and the dequantized and inversely transformed coefficients.
[0125] Technical route 4: Multi-layer transformation (Trans) branch.
[0126] For technical route 4, its attribute compression adopts a method based on multi-layer wavelet transform.
[0127] At the encoding end, multi-layer wavelet transform is performed on the entire point cloud to generate transform coefficients, which are then quantized to generate quantized transform coefficients. Finally, the quantized transform coefficients of the entire point cloud are encoded.
[0128] At the decoding end, decoding obtains the quantized transform coefficients of the entire point cloud, and then dequantizes and inversely transforms the quantized transform coefficients to obtain attribute reconstruction values.
[0129] Based on the above content, it can be seen that for both the G-PCC framework and the AVS-PCC framework, for the compression of point clouds, the encoder needs to compress its position information and attribute information; specifically, the encoder first performs octree-based encoding on the position information of the point cloud; at the same time, the encoder selects neighboring points from the encoded points for predicting the attribute values of the current point according to the encoded position information of the current point, and predicts the current point with reference to the selected neighboring points to obtain the attribute prediction value of the current point. Then, the residual value of the current point is calculated based on the attribute prediction value of the current point and the original attribute value of the current point. The encoder then quantizes the residual value of the current point and obtains a quantized residual value. Finally, the encoder transmits the quantized residual value of the current point to the decoder in the form of a code stream; the decoder can obtain the quantized residual value of the current point by receiving and parsing the code stream, and obtains the residual value of the current point by inverse transforming and inverse quantizing the quantized residual value. The decoder predicts the attribute prediction value by the same process, and superimposes it with the residual value obtained by parsing the code stream to obtain the attribute reconstruction value of the current point. The predicted attribute value of the current point to be coded (predictedvalue) can also be called the predicted value of the attribute information or the predicted color value (predictedColor); the attribute value of the current point to be coded can also be called the true value of the attribute coefficient of the current point or the original color value. The residual value of the current point to be coded can also be called the difference between the attribute value of the current point to be coded and the attribute predicted value of the current point, or the residual color value of the current point (residualColor); the reconstructed attribute value of the current point to be coded (reconstructedvalue) can also be called the reconstructed value of the attribute of the current point to be coded or the reconstructed color value (reconstructedColor).
[0130] It is worth noting that for the AVS-PCC framework, after obtaining the quantized residual value (or quantized transform coefficient), the encoder can perform zero-run encoding on the quantized residual value (or quantized transform coefficient) in a similar manner to the G-PCC framework encoding value, and obtain an attribute bitstream. To facilitate understanding of the technical solution of this application, the relevant content is explained below.
[0131] (1) Zero-run encoding and zero-run decoding.
[0132] Encoding side:
[0133] for loop(int i=0;i<(minimum of runlength and 3);i++);
[0134] Encode the binary number 1 using a fixed context (a different fixed context is used in each loop).
[0135] If runlength is less than 3:
[0136] End the encoding with the fixed context encoded binary number 0.
[0137] otherwise:
[0138] runlength is equal to runlength minus 3;
[0139] Calculate the quotient of runlength divided by 2, and record it as prefix;
[0140] for loop(int i=0;i<(minimum of prefix and 4);i++);
[0141] Encode the binary number 1 using a fixed context (a different fixed context is used in each loop).
[0142] If runlength is less than 8:
[0143] Encoded binary number 0 with fixed context;
[0144] Directly encode the remainder of runlength divided by 2;
[0145] End encoding.
[0146] otherwise:
[0147] runlength is equal to runlength minus 8;
[0148] Use K-order (e.g., 2nd-order) Exponential Golomb encoding for runlength.
[0149] For example, the runlength to be encoded can be converted into a binary number encoded using a fixed context and a value (when available) encoded using a K-order (e.g., 2nd-order) Exponential Golomb code. Specifically, when the runlength to be encoded is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, the converted binary number encoded using a fixed context and the value (when available) encoded using a K-order (e.g., 2nd-order) Exponential Golomb code are: 0, 10, 110, 111-00, 111-01, 111-100, 111-101, 111-1100, 111-1101, 111-11100, 111-11101, 111-1111-0, 111-1111-1, 111-1111-2.
[0150] The specific conversion process is as follows:
[0151] When the runlength to be encoded is 0, for the for loop (int i = 0; i < (the minimum of runlength and 3); i++), the minimum of the runlength to be encoded and 3 is 0. Since i = 0 < 0 does not hold, the encoder ends the for loop (int i = 0; i < (the minimum of runlength and 3); i++). Furthermore, since the runlength to be encoded (i.e., 0) is less than 3, the encoder encodes the binary number 0 using the fixed context and ends encoding. That is, the converted binary number encoded using the fixed context is 0.
[0152] When the runlength to be encoded is 1, for the for loop (int i = 0; i < (the minimum of runlength and 3); i++), the minimum of the runlength to be encoded and 3 is 1. Since i = 0 < 1, the encoder encodes the binary number 1 using the fixed context. Then, since i = 0 + 1 = 1 < 1 does not hold, the encoder ends the for loop (int i = 0; i < (the minimum of runlength and 3); i++). Furthermore, since the runlength to be encoded (i.e., 1) is less than 3, the encoder encodes the binary number 0 using the fixed context and ends encoding. That is, the converted binary number encoded using the fixed context is 10.
[0153] When the runlength to be encoded is 2, for the for loop (int i = 0; i < (the minimum of runlength and 3); i++), the minimum of the runlength to be encoded and 3 is 2. Since i = 0 < 2, the encoder encodes the binary number 1 using the fixed context. Then, since i = 0 + 1 = 1 < 2, the encoder encodes the binary number 1 using the fixed context. Then, since i = 1 + 1 = 2 < 2 does not hold, the encoder ends the for loop (int i = 0; i < (the minimum of runlength and 3); i++). Further, since the runlength to be encoded (i.e., 2) is less than 3, the encoder encodes the binary number 0 using the fixed context and ends encoding. That is, the converted binary number encoded using the fixed context is 110.
[0154] When the runlength to be encoded is 3, for the for loop (int i=0; i<(the minimum value of runlength and 3); i++), the minimum value of the runlength to be encoded and 3 is 3. Since i=0<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=0+1=1<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=1+1=2<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=2+1=3<3 is not true, the encoder ends the for loop (int i=0; i<(the minimum value of runlength and 3); i++); further, since the runlength to be encoded (i.e., 3) is less than 3 is not true, the encoder updates the runlength to be encoded to 3-3=0 and calculates prefix=0 / 2=0, i.e., for the for loop (int i = 0; i < (the minimum of the prefix and 4); i++), the minimum of the prefix and 4 is 0; since i = 0 < 0 does not hold, the encoder ends the for loop (int i = 0; i < (the minimum of the prefix and 4); i++); further, since the runlength to be encoded = 0 is less than 8, the encoder uses the fixed context to encode the binary number 0 and directly encodes the remainder of 0 / 2 (i.e., 0), and then ends the encoding. That is, the converted binary number encoded using the fixed context is 111-00.
[0155] When the runlength to be encoded is 4, for the for loop (int i=0; i<(the minimum value of runlength and 3); i++), the minimum value of the runlength to be encoded and 3 is 3. Since i=0<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=0+1=1<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=1+1=2<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=2+1=3<3 is not true, the encoder ends the for loop (int i=0; i<(the minimum value of runlength and 3); i++); further, since the runlength to be encoded (i.e., 4) is less than 3 is not true, the encoder updates the runlength to be encoded to 4-3=1 and calculates prefix=1 / 2=0, i.e., for the for loop (int i = 0; i < (the minimum of the prefix and 4); i++), the minimum of the prefix and 4 is 0; since i = 0 < 0 does not hold, the encoder ends the for loop (int i = 0; i < (the minimum of the prefix and 4); i++); further, since the runlength to be encoded = 1 is less than 8, the encoder uses the fixed context to encode the binary number 0 and directly encodes the remainder of 1 / 2 (i.e., 1), and then ends the encoding. That is, the converted binary number encoded using the fixed context is 111-01.
[0156] When the runlength to be encoded is 5, for the for loop (int i=0; i<(the minimum of runlength and 3); i++), the minimum of the runlength to be encoded and 3 is 3. Since i=0<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=0+1=1<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=1+1=2<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=2+1=3<3 is not true, the encoder ends the for loop (int i=0; i<(the minimum of runlength and 3); i++); further, since the runlength to be encoded (i.e., 5) is less than 3 is not true, the encoder updates the runlength to be encoded to 5-3=2 and calculates prefix=2 / 2=1, i.e., for the for loop (int i = 0; i < (the minimum of the prefix and 4); i++), the minimum of the prefix and 4 is 1; since i = 0 < 1, the encoder encodes the binary number 1 using the fixed context; then, since i = 0 + 1 = 1 < 1 does not hold, the encoder ends the for loop (int i = 0; i < (the minimum of the prefix and 4); i++); further, since the runlength to be encoded = 2 is less than 8, the encoder encodes the binary number 0 using the fixed context and directly encodes the remainder of 2 / 2 (i.e., 0), and then ends the encoding. That is, the converted binary number encoded using the fixed context is 111-100.
[0157] When the runlength to be encoded is 6, for the for loop (int i=0; i<(the minimum value of runlength and 3); i++), the minimum value of the runlength to be encoded and 3 is 3. Since i=0<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=0+1=1<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=1+1=2<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=2+1=3<3 is not true, the encoder ends the for loop (int i=0; i<(the minimum value of runlength and 3); i++); further, since the runlength to be encoded (i.e., 6) is less than 3 is not true, the encoder updates the runlength to be encoded to 6-3=3 and calculates prefix=3 / 2=1, i.e., for the for loop (int i = 0; i < (the minimum of the prefix and 4); i++), the minimum of the prefix and 4 is 1; since i = 0 < 1, the encoder encodes the binary number 1 using the fixed context; then, since i = 0 + 1 = 1 < 1 does not hold, the encoder ends the for loop (int i = 0; i < (the minimum of the prefix and 4); i++); further, since the runlength to be encoded = 3 is less than 8, the encoder encodes the binary number 0 using the fixed context and directly encodes the remainder of 3 / 2 (i.e., 1), and then ends the encoding. That is, the converted binary number encoded using the fixed context is 111-101.
[0158] When the runlength to be encoded is 7, for the for loop (int i=0; i<(the minimum of runlength and 3); i++), the minimum of the runlength to be encoded and 3 is 3. Since i=0<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=0+1=1<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=1+1=2<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=2+1=3<3 is not true, the encoder ends the for loop (int i=0; i<(the minimum of runlength and 3); i++); further, since the runlength to be encoded (i.e., 7) is less than 3 is not true, the encoder updates the runlength to be encoded to 7-3=4 and calculates prefix=4 / 2=2, i.e., for the for loop (int i=0; i<(the minimum of prefix and 4); i++), the minimum of prefix and 4 is 2; since i=0<2, the encoder encodes the binary number 1 using a fixed context; then, since i=0+1=1<2, the encoder encodes the binary number 1 using a fixed context; then, since i=1+1=2<2 does not hold, the encoder ends the for loop (int i=0; i<(the minimum of prefix and 4); i++); further, since the runlength to be encoded=4 is less than 8, the encoder encodes the binary number 0 using a fixed context and directly encodes the remainder of 4 / 2 (i.e., 0), and then ends the encoding. That is, the converted binary number encoded using a fixed context is 111-1100.
[0159] When the runlength to be encoded is 8, for the for loop (int i=0; i<(the minimum of runlength and 3); i++), the minimum of the runlength to be encoded and 3 is 3. Since i=0<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=0+1=1<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=1+1=2<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=2+1=3<3 is not true, the encoder ends the for loop (int i=0; i<(the minimum of runlength and 3); i++); further, since the runlength to be encoded (i.e., 8) is less than 3 is not true, the encoder updates the runlength to be encoded to 8-3=5 and calculates prefix=5 / 2=2, i.e., for the for loop (int i=0; i<(the minimum of prefix and 4); i++), the minimum of prefix and 4 is 2; since i=0<2, the encoder encodes the binary number 1 using a fixed context; then, since i=0+1=1<2, the encoder encodes the binary number 1 using a fixed context; then, since i=1+1=2<2 does not hold, the encoder ends the for loop (int i=0; i<(the minimum of prefix and 4); i++); further, since the runlength to be encoded=5 is less than 8, the encoder encodes the binary number 0 using a fixed context and directly encodes the remainder of 5 / 2 (i.e., 1), and then ends the encoding. That is, the converted binary number encoded using a fixed context is 111-1101.
[0160] When the runlength to be encoded is 9, for the for loop (int i=0; i<(the minimum value of runlength and 3); i++), the minimum value of the runlength to be encoded and 3 is 3. Since i=0<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=0+1=1<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=1+1=2<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=2+1=3<3 is not true, the encoder ends the for loop (int i=0; i<(the minimum value of runlength and 3); i++); further, since the runlength to be encoded (i.e., 9) is less than 3 is not true, the encoder updates the runlength to be encoded to 9-3=6 and calculates prefix=6 / 2=3, i.e., for the for loop (int i=0; i<(the minimum of prefix and 4); i++), the minimum of prefix and 4 is 3; since i=0<3, the encoder encodes the binary number 1 using a fixed context; then, since i=0+1=1<3, the encoder encodes the binary number 1 using a fixed context; then, since i=1+1=2<3, the encoder encodes the binary number 1 using a fixed context; then, since i=2+1=3<3 does not hold, the encoder ends the for loop (int i=0; i<(the minimum of prefix and 4); i++); further, since the runlength to be encoded=6 is less than 8, the encoder encodes the binary number 0 using a fixed context and directly encodes the remainder of 6 / 2 (i.e., 0), and then ends the encoding. That is, the converted binary number encoded using a fixed context is 111-11100.
[0161] When the runlength to be encoded is 10, for the for loop (int i=0; i<(the minimum of runlength and 3); i++), the minimum of the runlength to be encoded and 3 is 3. Since i=0<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=0+1=1<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=1+1=2<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=2+1=3<3 is not true, the encoder ends the for loop (int i=0; i<(the minimum of runlength and 3); i++); further, since the runlength to be encoded (i.e., 10) is less than 3 is not true, the encoder updates the runlength to be encoded to 10-3=7 and calculates prefix=7 / 2=3, i.e., for the for loop (int i=0; i<(the minimum of prefix and 4); i++), the minimum of prefix and 4 is 3; since i=0<3, the encoder encodes the binary number 1 using a fixed context; then, since i=0+1=1<3, the encoder encodes the binary number 1 using a fixed context; then, since i=1+1=2<3, the encoder encodes the binary number 1 using a fixed context; then, since i=2+1=3<3 does not hold, the encoder ends the for loop (int i=0; i<(the minimum of prefix and 4); i++); further, since the runlength to be encoded=7 is less than 8, the encoder encodes the binary number 0 using a fixed context and directly encodes the remainder of 7 / 2 (i.e., 1), and then ends the encoding. That is, the converted binary number encoded using a fixed context is 111-11101.
[0162] When the runlength to be encoded is 11, for the for loop (int i=0; i<(the minimum of runlength and 3); i++), the minimum of the runlength to be encoded and 3 is 3. Since i=0<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=0+1=1<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=1+1=2<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=2+1=3<3 is not true, the encoder ends the for loop (int i=0; i<(the minimum of runlength and 3); i++); further, since the runlength to be encoded (i.e., 11) is less than 3 is not true, the encoder updates the runlength to be encoded to 11-3=8 and calculates prefix=8 / 2=4, i.e., for the for loop (int i=0; i<(the minimum value of prefix and 4); i++), the minimum value of prefix and 4 is 4; since i=0<4, the encoder encodes the binary number 1 using a fixed context; then, since i=0+1=1<4, the encoder encodes the binary number 1 using a fixed context; then, since i=1+1=2<4, the encoder encodes the binary number 1 using a fixed context; then, since i=2+1=3<4, the encoder encodes the binary number 1 using a fixed context; then, since i=3+1=4<4 does not hold, the encoder ends the for loop (int i=0; i<(the minimum value of prefix and 4); i++); further, since the runlength to be encoded=8 is less than 8, the encoder updates the runlength to be encoded to 8-8=0, and uses K-order (e.g., 2nd-order) exponential Golomb encoding to encode the updated runlength to be encoded (i.e., 0), and then ends the encoding. That is, the converted binary number using fixed context coding is 111-1111, and the converted value using K-order (eg, 2nd-order) Exponential Golomb coding is 0.
[0163] When the runlength to be encoded is 12, for the for loop (int i=0; i<(the minimum of runlength and 3); i++), the minimum of the runlength to be encoded and 3 is 3. Since i=0<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=0+1=1<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=1+1=2<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=2+1=3<3 is not true, the encoder ends the for loop (int i=0; i<(the minimum of runlength and 3); i++); further, since the runlength to be encoded (i.e., 12) is less than 3 is not true, the encoder updates the runlength to be encoded to 12-3=9 and calculates prefix=9 / 2=4, i.e., for the for loop (int i=0; i<(the minimum value of prefix and 4); i++), the minimum value of prefix and 4 is 4; since i=0<4, the encoder encodes the binary number 1 using a fixed context; then, since i=0+1=1<4, the encoder encodes the binary number 1 using a fixed context; then, since i=1+1=2<4, the encoder encodes the binary number 1 using a fixed context; then, since i=2+1=3<4, the encoder encodes the binary number 1 using a fixed context; then, since i=3+1=4<4 does not hold, the encoder ends the for loop (int i=0; i<(the minimum value of prefix and 4); i++); further, since the runlength to be encoded=9 is less than 8, the encoder updates the runlength to be encoded to 9-8=1, and uses K-order (e.g., 2nd-order) exponential Golomb encoding to encode the updated runlength to be encoded (i.e., 1), and then ends the encoding. That is, the converted binary number using the fixed context coding is 111-1111, and the converted value using the K-order (eg, 2nd-order) Exponential Golomb coding is 1.
[0164] When the runlength to be encoded is 13, for the for loop (int i=0; i<(the minimum of runlength and 3); i++), the minimum of the runlength to be encoded and 3 is 3. Since i=0<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=0+1=1<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=1+1=2<3 is true, the encoder uses a fixed context to encode the binary number 1; then, since i=2+1=3<3 is not true, the encoder ends the for loop (int i=0; i<(the minimum of runlength and 3); i++); further, since the runlength to be encoded (i.e., 13) is less than 3 is not true, the encoder updates the runlength to be encoded to 13-3=10 and calculates prefix=10 / 2=5, i.e., for the for loop (int i=0; i<(the minimum value of prefix and 4); i++), the minimum value of prefix and 4 is 4; since i=0<4, the encoder encodes the binary number 1 using a fixed context; then, since i=0+1=1<4, the encoder encodes the binary number 1 using a fixed context; then, since i=1+1=2<4, the encoder encodes the binary number 1 using a fixed context; then, since i=2+1=3<4, the encoder encodes the binary number 1 using a fixed context; then, since i=3+1=4<4 does not hold, the encoder ends the for loop (int i=0; i<(the minimum value of prefix and 4); i++); further, since the runlength to be encoded=10 is less than 8, the encoder updates the runlength to be encoded to 10-8=2, and uses K-order (e.g., 2nd-order) exponential Golomb encoding to encode the updated runlength to be encoded (i.e., 2), and then ends the encoding. That is, the converted binary number using fixed context coding is 111-1111, and the converted value using K-order (eg, 2nd-order) Exponential Golomb coding is 2.
[0165] Decoding end:
[0166] for loop (runlength=0; runlength<3; runlength++);
[0167] Decode a bit using a fixed context (a different fixed context is used in each loop);
[0168] If this bit is equal to 0, the decoder ends decoding, and the current value of runlength is the final value of runlength.
[0169] Otherwise, runlength is equal to runlength plus one, and the loop continues.
[0170] for loop (i=0; i<4; i++);
[0171] Decode a bit using a fixed context (a different fixed context is used in each loop);
[0172] If the bit is equal to 0, the decoder directly decodes one bit, and the runlength is equal to the runlength plus the decoded bit and the decoding ends. The current value of runlength is the final value of runlength;
[0173] Otherwise, runlength is equal to runlength plus 2, and the loop continues.
[0174] The decoded value is obtained by using K-order (e.g., 2nd-order) Exponential Golomb decoding. Runlength is equal to runlength plus the decoded value obtained by using K-order (e.g., 2nd-order) Exponential Golomb decoding. The decoding ends and the current value of runlength is the value of runlength.
[0175] For example, the values obtained by decoding using a fixed context and the values obtained by K-order (e.g., order 2) exponential Golomb decoding (when available) can be converted to runlengths. Specifically, if the decoded values are 0, 10, 110, 111-00, 111-01, 111-100, 111-101, 111-1100, 111-1101, 111-11100, 111-11101, 111-1111-0, 111-1111-1, 111-1111-2, then the decoded runlengths are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13.
[0176] The specific conversion process is as follows:
[0177] Assuming that the value obtained by using fixed context decoding and the value obtained by K-order (for example, 2nd order) exponential Golomb decoding (when present) are 0, then for the for loop (runlength=0; runlength<3; runlength++), since runlength=0<3 holds, the decoder uses the fixed context to decode a binary number. Since the value of this binary number is 0, the decoder ends decoding and directly determines that the final value of runlength is the current value of runlength (i.e., 0).
[0178] Assuming that the value obtained by using fixed context decoding and the value obtained by K-order (for example, 2nd order) exponential Golomb decoding (when present) is 10, then for the for loop (runlength=0; runlength<3; runlength++), since runlength=0<3 holds, the decoder uses the fixed context to decode a binary number, and since the value of this binary number is 1, the decoder updates runlength=0+1=1; then, since runlength=1<3 holds, the decoder uses the fixed context to decode a binary number, and since the value of this binary number is 0, the decoder directly determines that the final value of runlength is the current value of runlength (i.e., 1).
[0179] Assuming that the value obtained by decoding using a fixed context and the value obtained by K-order (for example, 2nd order) exponential Golomb decoding (when present) are 110, then for the for loop (runlength=0; runlength<3; runlength++), since runlength=0<3 holds, the decoder uses the fixed context to decode a binary number, and since the value of this binary number is 1, the decoder updates runlength=0+1=1; then, since runlength=1<3 holds, the decoder uses the fixed context to decode a binary number, and since the value of this binary number is 1, the decoder updates runlength=1+1=2; then, since runlength=2<3 holds, the decoder uses the fixed context to decode a binary number, and since the value of this binary number is 0, the decoder directly determines that the final value of runlength is the current value of runlength (i.e., 2).
[0180] Assuming that the value obtained by decoding using a fixed context and the value obtained by K-order (for example, 2nd order) exponential Golomb decoding (when present) are 111-00, then for the for loop (runlength=0; runlength<3; runlength++), since runlength=0<3 holds, the decoder decodes a binary number using a fixed context, and since the value of this binary number is 1, the decoder updates runlength=0+1=1; then, since runlength=1<3 holds, the decoder decodes a binary number using a fixed context, and since the value of this binary number is 1, the decoder updates runlength=1+1=2; then, since runlength=2<3 holds, the decoder uses a fixed context to decode a binary number, and since the value of this binary number is 1, the decoder updates runlength=1+1=2; then, since runlength=2<3 holds, the decoder uses a fixed context to decode a binary number. The decoder decodes a binary number using a fixed context. Since the value of this binary number is 1, the decoder updates runlength=2+1=3; further, since runlength=3<3 does not hold, the decoder ends the for loop (runlength=0; runlength<3; runlength++) and executes the for loop (i=0; i<4; i++); for the for loop (i=0; i<4; i++), since i=0<4, the decoder decodes a binary number using a fixed context. Since the value of this binary number is 0, the decoder decodes another binary number (i.e., 0) and sets the final value of runlength to the sum (i.e., 3) of the current value of runlength and this binary number (i.e., 0).
[0181] Assuming that the value obtained by decoding using a fixed context and the value obtained by K-order (for example, 2nd order) exponential Golomb decoding (when present) are 111-01, then for the for loop (runlength=0; runlength<3; runlength++), since runlength=0<3 holds, the decoder decodes a binary number using a fixed context, and since the value of this binary number is 1, the decoder updates runlength=0+1=1; then, since runlength=1<3 holds, the decoder decodes a binary number using a fixed context, and since the value of this binary number is 1, the decoder updates runlength=1+1=2; then, since runlength=2<3 holds, the decoder uses a fixed context to decode a binary number, and since the value of this binary number is 1, the decoder updates runlength=1+1=2; then, since runlength=2<3 holds, the decoder uses a fixed context to decode a binary number. The decoder decodes a binary number using a fixed context. Since the value of this binary number is 1, the decoder updates runlength=2+1=3; further, since runlength=3<3 does not hold, the decoder ends the for loop (runlength=0; runlength<3; runlength++) and executes the for loop (i=0; i<4; i++); for the for loop (i=0; i<4; i++), since i=0<4, the decoder decodes a binary number using a fixed context. Since the value of this binary number is 0, the decoder decodes another binary number (i.e., 1) and sets the final value of runlength to the sum (i.e., 4) of the current value of runlength (i.e., 3) and this binary number (i.e., 1).
[0182] Assuming that the value obtained by decoding using a fixed context and the value obtained by K-order (for example, 2nd order) exponential Golomb decoding (when present) are 111-100, then for the for loop (runlength=0; runlength<3; runlength++), since runlength=0<3 holds, the decoder decodes a binary number using a fixed context, and since the value of this binary number is 1, the decoder updates runlength=0+1=1; then, since runlength=1<3 holds, the decoder decodes a binary number using a fixed context, and since the value of this binary number is 1, the decoder updates runlength=1+1=2; then, since runlength=2<3 holds, the decoder decodes a binary number using a fixed context, and since the value of this binary number is 1, the decoder updates runlength=1+1=2. New runlength = 2 + 1 = 3; further, since runlength = 3 < 3 does not hold, the decoder ends the for loop (runlength = 0; runlength < 3; runlength++) and executes the for loop (i = 0; i < 4; i++); for the for loop (i = 0; i < 4; i++), since i = 0 < 4, the decoder uses a fixed context to decode a binary number, and since the value of this binary number is 1, the decoder updates runlength = 3 + 2 = 5, and since i = 0 + 1 < 4, the decoder uses a fixed context to decode a binary number, and since the value of this binary number is 0, the decoder decodes another binary number (i.e., 0), and sets the final value of runlength to the sum (i.e., 5) of the current value of runlength (i.e., 5) and this binary number (i.e., 0).
[0183] Assuming that the value obtained by decoding using a fixed context and the value obtained by K-order (for example, 2nd order) exponential Golomb decoding (when present) are 111-101, then for the for loop (runlength=0; runlength<3; runlength++), since runlength=0<3 holds, the decoder decodes a binary number using a fixed context, and since the value of this binary number is 1, the decoder updates runlength=0+1=1; then, since runlength=1<3 holds, the decoder decodes a binary number using a fixed context, and since the value of this binary number is 1, the decoder updates runlength=1+1=2; then, since runlength=2<3 holds, the decoder decodes a binary number using a fixed context, and since the value of this binary number is 1, the decoder updates runlength=1+1=2. New runlength = 2 + 1 = 3; further, since runlength = 3 < 3 does not hold, the decoder ends the for loop (runlength = 0; runlength < 3; runlength++) and executes the for loop (i = 0; i < 4; i++); for the for loop (i = 0; i < 4; i++), since i = 0 < 4, the decoder uses a fixed context to decode a binary number, and since the value of this binary number is 1, the decoder updates runlength = 3 + 2 = 5, and since i = 0 + 1 < 4, the decoder uses a fixed context to decode a binary number, and since the value of this binary number is 0, the decoder decodes another binary number (i.e., 1), and sets the final value of runlength to the sum (i.e., 6) of the current value of runlength (i.e., 5) and this binary number (i.e., 1).
[0184] Assuming that the value obtained by decoding using a fixed context and the value obtained by K-order (for example, 2nd order) exponential Golomb decoding (when present) are 111-1100, then for the for loop (runlength=0; runlength<3; runlength++), since runlength=0<3 holds, the decoder decodes a binary number using a fixed context, and since the value of this binary number is 1, the decoder updates runlength=0+1=1; then, since runlength=1<3 holds, the decoder decodes a binary number using a fixed context, and since the value of this binary number is 1, the decoder updates runlength=1+1=2; then, since runlength=2<3 holds, the decoder decodes a binary number using a fixed context, and since the value of this binary number is 1, the decoder updates runlength=2+1=3; further, since runlength=3<3 It does not hold, so the decoder ends the for loop (runlength=0; runlength<3; runlength++) and executes the for loop (i=0; i<4; i++); for the for loop (i=0; i<4; i++), since i=0<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=3+2=5. Since i=0+1=1<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=5+2=7. Since i=1+1=2<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 0, the decoder decodes another binary number (i.e., 0) and sets the final value of runlength to the sum of the current value of runlength (i.e., 7) and this binary number (i.e., 0) (i.e., 7).
[0185] Assuming that the value obtained by decoding using a fixed context and the value obtained by K-order (for example, 2nd order) exponential Golomb decoding (when present) are 111-1101, then for the for loop (runlength=0; runlength<3; runlength++), since runlength=0<3 holds, the decoder decodes a binary number using a fixed context, and since the value of this binary number is 1, the decoder updates runlength=0+1=1; then, since runlength=1<3 holds, the decoder decodes a binary number using a fixed context, and since the value of this binary number is 1, the decoder updates runlength=1+1=2; then, since runlength=2<3 holds, the decoder decodes a binary number using a fixed context, and since the value of this binary number is 1, the decoder updates runlength=2+1=3; further, since runlength=3<3 It does not hold, so the decoder ends the for loop (runlength=0; runlength<3; runlength++) and executes the for loop (i=0; i<4; i++); for the for loop (i=0; i<4; i++), since i=0<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=3+2=5. Since i=0+1=1<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=5+2=7. Since i=1+1=2<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 0, the decoder decodes another binary number (i.e., 1) and sets the final value of runlength to the sum of the current value of runlength (i.e., 7) and this binary number (i.e., 1) (i.e., 8).
[0186] Assuming that the value obtained by decoding using a fixed context and the value obtained by K-order (for example, 2nd order) exponential Golomb decoding (when present) are 111-11100, then for the for loop (runlength=0; runlength<3; runlength++), since runlength=0<3 holds true, the decoder decodes a binary number using the fixed context, and since the value of this binary number is 1, the decoder updates runlength=0+1=1; then, since runlength=1<3 holds true, the decoder decodes a binary number using the fixed context, and since the value of this binary number is 1, the decoder updates runlength=1+1=2; then, since runlength=2<3 holds true, the decoder decodes a binary number using the fixed context, and since the value of this binary number is 1, the decoder updates runlength=2+1=3; further, since runlength=3<3 does not hold true, the decoder ends the for loop (runlength=0; runlen gth<3;runlength++) and execute the for loop (i=0;i<4;i++); for the for loop (i=0;i<4;i++), since i=0<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=3+2=5. Since i=0+1=1<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=5 +2=7. Since i=1+1=2<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=7+2=9. Since i=2+1=3<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 0, the decoder decodes another binary number (i.e. 0) and sets the final value of runlength to the sum (i.e. 9) of the current value of runlength and this binary number (i.e. 0).
[0187] Assuming that the value obtained by decoding using a fixed context and the value obtained by K-order (for example, 2nd order) exponential Golomb decoding (when present) are 111-11101, then for the for loop (runlength=0; runlength<3; runlength++), since runlength=0<3 holds true, the decoder decodes a binary number using the fixed context, and since the value of this binary number is 1, the decoder updates runlength=0+1=1; then, since runlength=1<3 holds true, the decoder decodes a binary number using the fixed context, and since the value of this binary number is 1, the decoder updates runlength=1+1=2; then, since runlength=2<3 holds true, the decoder decodes a binary number using the fixed context, and since the value of this binary number is 1, the decoder updates runlength=2+1=3; further, since runlength=3<3 does not hold true, the decoder ends the for loop (runlength=0; runlen gth<3;runlength++) and execute the for loop (i=0;i<4;i++); for the for loop (i=0;i<4;i++), since i=0<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=3+2=5. Since i=0+1=1<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=5+ 2=7. Since i=1+1=2<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=7+2=9. Since i=2+1=3<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 0, the decoder decodes another binary number (i.e. 1) and sets the final value of runlength to the sum of the current value of runlength (i.e. 9) and this binary number (i.e. 1) (i.e. 10).
[0188] Assuming that the value obtained by decoding using a fixed context and the value obtained by K-order (for example, 2nd order) exponential Golomb decoding (when present) are 111-1111-0, then for the for loop (runlength=0; runlength<3; runlength++), since runlength=0<3 holds true, the decoder decodes a binary number using the fixed context, and since the value of this binary number is 1, the decoder updates runlength=0+1=1; then, since runlength=1<3 holds true, the decoder decodes a binary number using the fixed context, and since the value of this binary number is 1, the decoder updates runlength=1+1=2; then, since runlength=2<3 holds true, the decoder decodes a binary number using the fixed context, and since the value of this binary number is 1, the decoder updates runlength=2+1=3; further, since runlength=3<3 does not hold true, the decoder ends the for loop (runlength=0; runlength<3; runlength++) and executes the for loop (i=0;i<4;i++); For the for loop (i=0;i<4;i++), since i=0<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=3+2=5. Since i=0+1=1<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=5+2=7. Since i=1+1=2<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=7+2=9. Since i=2+1=3<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=9+2=11. Since i=3+1=4<4 does not hold, the decoder uses a K-order (for example, 2nd-order) exponential Golomb algorithm to decode and obtain the decimal number 0, and the final value of runlength is the sum (i.e., 11) of the current value of runlength (i.e., 11) and this decimal number (i.e., 0).
[0189] Assuming that the value obtained by decoding using a fixed context and the value obtained by K-order (for example, 2nd order) exponential Golomb decoding (when present) are 111-1111-1, then for the for loop (runlength=0; runlength<3; runlength++), since runlength=0<3 holds true, the decoder decodes a binary number using the fixed context, and since the value of this binary number is 1, the decoder updates runlength=0+1=1; then, since runlength=1<3 holds true, the decoder decodes a binary number using the fixed context, and since the value of this binary number is 1, the decoder updates runlength=1+1=2; then, since runlength=2<3 holds true, the decoder decodes a binary number using the fixed context, and since the value of this binary number is 1, the decoder updates runlength=2+1=3; further, since runlength=3<3 does not hold true, the decoder ends the for loop (runlength=0; runlength<3; runlength++) and executes the for loop (i=0;i<4;i++); For the for loop (i=0;i<4;i++), since i=0<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=3+2=5. Since i=0+1=1<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=5+2=7. Since i=1+1=2<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=7+2=9. Since i=2+1=3<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=9+2=11. Since i=3+1=4<4 does not hold, the decoder uses a K-order (for example, 2nd-order) exponential Golomb algorithm to decode and obtain the decimal number 1, and the final value of runlength is the sum (i.e., 12) of the current value of runlength (i.e., 11) and this decimal number (i.e., 1).
[0190] Assuming that the value obtained by decoding using a fixed context and the value obtained by K-order (for example, 2nd order) exponential Golomb decoding (when present) are 111-1111-2, then for the for loop (runlength=0; runlength<3; runlength++), since runlength=0<3 holds, the decoder decodes a binary number using the fixed context, and since the value of this binary number is 1, the decoder updates runlength=0+1=1; then, since runlength=1<3 holds, the decoder decodes a binary number using the fixed context, and since the value of this binary number is 1, the decoder updates runlength=1+1=2; then, since runlength=2<3 holds, the decoder decodes a binary number using the fixed context, and since the value of this binary number is 1, the decoder updates runlength=2+1=3; further, since runlength=3<3 does not hold, the decoder ends the for loop (runlength=0; runlength<3; runlength++) and executes the for loop (i=0;i<4;i++); For the for loop (i=0;i<4;i++), since i=0<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=3+2=5. Since i=0+1=1<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=5+2=7. Since i=1+1=2<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=7+2=9. Since i=2+1=3<4, the decoder uses a fixed context to decode a binary number. Since the value of this binary number is 1, the decoder updates runlength=9+2=11. Since i=3+1=4<4 does not hold, the decoder uses a K-order (for example, 2nd order) exponential Golomb algorithm to decode and obtain the decimal number 2, and the final value of runlength is the sum of the current value of runlength (i.e., 11) and this decimal number (i.e., 2) (i.e., 13).
[0191] (2) Use K-order Exponential Columbus encoding value.
[0192] The main encoding format of K-order Exponential Golomb coding is the structure of [prefix 0][1][bit information]. The encoding steps are as follows:
[0193] (1) Express the data to be encoded in binary form, remove the lowest k bits, and then add 1 to obtain the new value T1;
[0194] (2) Subtract 1 from the number of bits remaining after removing the lowest k bits in the first step to obtain T2, which is the number of prefix 0s;
[0195] (3) Add a prefix of 0 before T1 and add the lowest k bits removed in the first step after T1 to complete the encoding.
[0196] For example, suppose we perform a 1st-order Exponential Golomb coding on 7, where k = 1. First, calculate the number of leading zeros: 7 is represented as 111 in binary. Removing the least significant bit equals 11, and then adding 1 yields T1 = 100. Since T1 contains 3 bits, T2 = 3 - 1 = 2, so the number of leading zeros is 2. Adding two leading zeros before T1 = 100 and filling in the missing bit yields 001001, resulting in the final encoded result of 001001.
[0197] Accordingly, the decoding end can decode the attribute code stream in the following manner to obtain the quantized residual value (or quantized transform coefficient):
[0198] First, decode the first flag bit to see if the value is greater than 0. If not, end the decoding. If yes, continue.
[0199] Continue decoding the second flag bit to indicate whether value-1 is greater than 0. If not, end the encoding. If yes, continue.
[0200] Use K-order Exponential Columbus decoding to decode value; finally, value = value + 2.
[0201] From the above description of the principles of zero-run encoding and zero-run decoding, it can be seen that when the zero-run value is too large, a fixed exponential Golomb algorithm needs to be used for encoding, which will result in an excessively large encoded codeword, thereby reducing decoding performance. In view of this, the embodiments of the present application provide a decoding method, an encoding method, a decoder, and an encoder. By splitting and decoding two parameters and then determining the zero-run value based on these two parameters, it is possible to reduce the decoded codeword and thus improve encoding and decoding performance.
[0202] FIG8 is a schematic flow chart of a decoding method 100 provided in an embodiment of the present application. It should be understood that the decoding method 100 can be performed by a decoder or a decoding framework. For example, it can be applied to the decoding framework shown in FIG5 or FIG7 . For ease of description, the decoding method 100 is exemplified below using a decoder as an example.
[0203] As shown in FIG8 , the decoding method 100 may include:
[0204] S110: The decoder obtains a first parameter and a second parameter.
[0205] Exemplarily, the first parameter and the second parameter may be values obtained by the decoder based on the code stream of the point cloud. For example, the first parameter and the second parameter may be values obtained by the decoder based on decoding the code stream.
[0206] Exemplarily, the first parameter may be a decimal number.
[0207] Of course, in other alternative embodiments, the first parameter may also be a multi-bit binary number, which is not specifically limited in the embodiments of the present application.
[0208] Exemplarily, the second parameter may be a P-bit binary number, which refers to a binary string of length P.
[0209] For example, assuming P is 2, the second parameter can be: 00, 10, 01, 11.
[0210] Exemplarily, the second parameter may be P binary numbers, which are P binary numbers with a length of 1.
[0211] For example, assuming P is 2, the second parameter may be: (0,0), (1,0), (0,1), (1,1).
[0212] Of course, in other alternative embodiments, the second parameter can also be replaced by a decimal value, and the embodiment of the present application does not specifically limit this.
[0213] S120: The decoder determines a first zero-run value based on the first parameter and the second parameter.
[0214] Exemplarily, the first parameter is less than the first zero-run value.
[0215] Exemplarily, the second parameter is smaller than the first zero-run value.
[0216] In some embodiments, the method 100 further includes:
[0217] The decoder determines the first zero-run value as the number of points whose attribute coefficients are zero and continuous.
[0218] For example, the decoder may obtain the first parameter and the second parameter based on the bitstream, determine the first zero-run value based on the first parameter and the second parameter, and then determine the number of points whose property coefficients are zero and continuous based on the first zero-run value. For example, if the first zero-run value is N1, the decoder may determine that the number of points whose property coefficients are zero and continuous is N1.
[0219] Accordingly, the encoder may determine the first zero-run value based on the attribute coefficients of the one or more points, then determine the first parameter and the second parameter based on the first zero-run value, and encode the first parameter and the second parameter to obtain a bitstream. For example, if the encoder determines that the attribute coefficients of N1 consecutive points are zero, then the first zero-run value is N1.
[0220] For example, if the symbol sequence obtained by zero-run decoding is (0)4(0)5(3)2(0)1(1)2, then the values in the brackets in (0)4(0)5(3)2(0)1(1)2 are zero-run values, that is, the zero-run values in (0)4(0)5(3)2(0)1(1)2 include 0 0 3 0 1; that is, the first zero-run value can be any one of 0 0 3 0 1. Furthermore, after the decoder decodes the zero-run value through the zero-run decoding algorithm, the symbol sequence 4 5 0 0 0 2 1 0 2 can be obtained. If the symbol sequence 4 5 0 0 0 2 1 0 2 is a sequence formed by the attribute coefficients of the points of the point cloud, then each value in the symbol sequence 4 5 0 0 0 2 1 0 2 represents the attribute coefficient of a point. It is worth noting that the symbols in the symbol sequence that are not zero-run values can use the decoding method provided by this application, that is, the same entropy decoding method as the zero-run value can be used, or an entropy decoding method different from the decoding algorithm provided by this application can be used. For example, the CABAC decoding algorithm can be directly used to decode symbols that are not zero-run values. This application does not make specific restrictions on this.
[0221] In some embodiments, the attribute coefficient being zero includes all color components being zero.
[0222] Exemplarily, the decoder may determine the first zero-run value as the number of points where all color components are zero and continuous.
[0223] In some embodiments, the property coefficient being zero includes a reflectivity of zero.
[0224] Exemplarily, the decoder may determine the first zero-run value as the number of points whose reflectivity is zero and continuous.
[0225] It should be noted that the first zero-run value can be used by the decoder to determine the number of points at which the attribute coefficient (for example, the color attribute coefficient or reflectance attribute coefficient including all color components) is zero and continuous. The attribute coefficient involved in this application can be an attribute residual coefficient, the absolute value of the attribute residual coefficient, the attribute transform coefficient, or the absolute value of the attribute transform coefficient. In other words, the decoder can obtain the attribute residual coefficient, the absolute value of the attribute residual coefficient, the attribute transform coefficient, or the number of points at which the absolute value of the attribute transform coefficient is zero and continuous based on the first zero-run value.
[0226] It should be understood that the attribute coefficients involved in this application can be attribute residual coefficients, absolute values of attribute residual coefficients, attribute transformation coefficients, or absolute values of attribute transformation coefficients involved in any of the technical routes described in the G-PCC above, or can be attribute residual coefficients, absolute values of attribute residual coefficients, attribute transformation coefficients, or absolute values of attribute transformation coefficients involved in any of the technical routes described in the AVS PCC above. This embodiment of the application does not specifically limit this.
[0227] Of course, in other alternative embodiments, the first zero-run value may also be a zero-run value defined for the first color component in the attribute coefficient. In other words, the decoder may determine the first zero-run value as the number of consecutive points where the first color component is all zero. The first color component may be any one of Y, U, and V.
[0228] In this embodiment, the decoder obtains the first parameter and the second parameter, and determines the first zero-run value based on the first parameter and the second parameter; this is equivalent to splitting and decoding the first zero-run value, which can reduce the decoding codeword and thus improve the encoding and decoding performance.
[0229] The results obtained by testing the solution provided in this application are described below in conjunction with Table 2.
[0230] Among them, the end-to-end attribute rate distortion (End-to-End Bit distortion, End-to-End BD-rate) is an indicator to measure the performance of the algorithm or coding performance, which indicates the changes in the bit rate and PSNR of the coding algorithm provided by this application relative to the original coding algorithm. An overall negative value indicates that the performance has improved. The bit rate refers to the ratio between the size of the code stream after point cloud encoding and the number of points in the input point cloud. A smaller bit rate indicates that the length of the code word (or code stream) has become smaller, which can improve the compression performance of the point cloud. The end-to-end attribute Hausdorff rate distortion is a unique criterion for judging performance under the condition of limited loss of attributes. It indicates the maximum difference between attribute values, and when the overall value is negative, it indicates that the performance of the new algorithm has improved. Furthermore, L, Cb and Cr (also called Y, U, V) represent the brightness component and chrominance component of the point cloud color attribute information.
[0231] Table 1
[0232] As shown in Table 1, under the test conditions of lossless geometric position and lossy attributes, the end-to-end attribute rate distortion of the Solid sequence, Dense sequence, Sparse sequence, Scant sequence, and Am-fused sequence has performance improvement in each component; the average end-to-end attribute rate distortion of each sequence is improved by 0.1 in L, Cb, and Cr; the performance of the Am-fused sequence in reflectivity is improved by 0.1; in addition, the decoding time can also be reduced; that is, the solution provided in this application can improve encoding performance and decoding performance.
[0233] Table 2
[0234] As shown in Table 2, under the test conditions of lossy geometric position and lossy attributes, the end-to-end attribute rate distortion of the Solid sequence, Dense sequence, Sparse sequence, Scant sequence, and Am-fused sequence has performance improvement in each component; the average end-to-end attribute rate distortion of each sequence is improved by 0.1 in L, Cb, and Cr; the performance of the Am-fused sequence in reflectivity is improved by 0.1; in addition, the encoding time can also be reduced; that is, the solution provided in this application can improve encoding and decoding performance.
[0235] In some embodiments, S120 may include:
[0236] Shifting the first parameter bit left by P bits obtains a first intermediate value; P is a positive integer;
[0237] determining a second intermediate value based on the first intermediate value and the second parameter;
[0238] Based on the second intermediate value, the first zero-run value is determined.
[0239] Exemplarily, the first parameter may be a multi-bit binary number or a decimal value. If the first parameter is a decimal number, the decoder may first convert the first parameter into a multi-bit binary number and then perform a bit shift P bits left on the converted multi-bit binary number to obtain the first intermediate value. If the first parameter is a multi-bit binary number, the decoder may directly perform a bit shift P bits left on the first parameter to obtain the first intermediate value.
[0240] Exemplarily, the value of P may be a predefined value, a value obtained by decoding the code stream, or a value determined by negotiation between the decoder and the encoder, which is not specifically limited in this application.
[0241] It is worth noting that the pre-definition of terms involved in this application can be implemented by pre-saving corresponding codes, tables or other methods that can be used to indicate relevant information in a device (for example, including a decoder), and this application does not limit its specific implementation method. For example, pre-definition can refer to a definition in a protocol. It should also be understood that in the embodiments of this application, the "protocol" can refer to a standard protocol in the field of coding and decoding, for example, it can include the field of image coding and decoding, the field of video coding and decoding, the field of hardware video coding and decoding, the field of dedicated circuit video coding and decoding, and the field of real-time video coding and decoding, as well as related protocols used in future coding and decoding systems, and this application does not limit this.
[0242] In some embodiments, the second parameter is a P-bit binary number.
[0243] Exemplarily, the decoder may default the second parameter to be a P-bit binary number, that is, the decoder defaults the second parameter to be a binary string of length P.
[0244] In some embodiments, the decoder adds the first intermediate value and the P-bit binary number to obtain the second intermediate value.
[0245] Exemplarily, when the decoder assumes that the second parameter is a P-bit binary number, the first intermediate value is added to the P-bit binary number to obtain the second intermediate value.
[0246] In some embodiments, the second parameter is P binary numbers.
[0247] Exemplarily, the decoder may default the second parameter to P binary numbers, that is, the decoder defaults the second parameter to P binary numbers with a length of 1.
[0248] In some embodiments, the decoder determines the number of shifts of each binary number in the P binary numbers based on the decoding order of the P binary numbers; then left-shifts each binary number based on the number of shifts of each binary number to obtain P third parameters; and then sums the first intermediate value and the P third parameters to obtain the second intermediate value.
[0249] Exemplarily, the number of shifts of each binary number is positively correlated with the sequence number of each binary number in the decoding order. For example, the number of shifts of the i-th binary number in the P binary numbers in the decoding order is positively correlated with the value of i; that is, the smaller the value of i, the smaller the shift of the i-th binary number; or, in other words, the larger the value of i, the larger the shift of the i-th binary number.
[0250] Exemplarily, the shift bit number of each binary number is negatively correlated with the sequence number of each binary number in the decoding order. For example, the shift bit number of the i-th binary number among the P binary numbers in accordance with the decoding order is negatively correlated with the value of i; that is, when the value of i is smaller, the shift bit number of the i-th binary number is larger; or, when the value of i is larger, the shift bit number of the i-th binary number is smaller.
[0251] In some embodiments, the decoder determines i - 1 as the shift bit number of the i-th binary number among the P binary numbers; i is a positive integer.
[0252] Exemplarily, the decoder determines i - 1 as the shift bit number of the binary number located at the i-th position among the P binary numbers in accordance with the decoding order of the P binary numbers. In other words, the decoder assigns the shift bit number of the i-th binary number among the P binary numbers as i - 1 in accordance with the decoding order of the P binary numbers. Or, for the P binary numbers, the binary number decoded first by the decoder has a smaller shift bit number; conversely, the binary number decoded later by the decoder has a larger shift bit number.
[0253] Exemplarily, the decoder can determine the second intermediate value based on the first intermediate value and the second parameter in the following manner:
[0254] Shift the i-th binary number bit among the P binary numbers to the left by i - 1 to obtain the P third parameters; then sum the first intermediate value and the P third parameters to obtain the second intermediate value. In other words, the decoder can determine the second intermediate value based on the first parameter and the second parameter according to the following formula:
[0255] mid2 = (V1 << P) + (W1 << 0) + (W2 << 1) + … + (W P << P - 1).
[0256] Where, mid2 represents the second intermediate value, V1 represents the first parameter, V1 << P represents the first intermediate value, W1 represents the binary number located at the 1st position and with a shift bit number of 0 among the P binary numbers in accordance with the decoding order, W2 represents the binary number located at the 2nd position and with a shift bit number of 1 among the P binary numbers in accordance with the decoding order, and so on, W P represents the binary number located at the P-th position and with a shift bit number of P - 1 among the P binary numbers in accordance with the decoding order.
[0257] Exemplarily, if the first parameter is 4, the decoder can first convert 4 into a binary string, i.e., 100. Further, assuming that the second parameter is (0, 0) (i.e., P = 2), the decoder first shifts 100 bits two positions to the left to get 10000. The decoder shifts the first binary digit in the second parameter (0, 0) 0 positions to the left to get 0. The decoder shifts the second binary digit in the second parameter (0, 0) 1 position to the left to get 00. Then calculate 10000 + 0 + 00 = 10000 = 16 to obtain the second intermediate value, that is, the second intermediate value is converted to the decimal number 16.
[0258] Of course, in other alternative embodiments, the initial value of i can also be 0. At this time, the decoder can determine i as the number of positions to shift for the i-th binary digit among the P binary digits.
[0259] In some embodiments, the decoder determines P - i as the number of positions to shift for the i-th binary digit among the P binary digits; i is a positive integer.
[0260] Exemplarily, the decoder determines P - i as the number of positions to shift for the binary digit located at the i-th position in the P binary digits according to the decoding order of the P binary digits. In other words, the decoder assigns the number of positions to shift for the i-th binary digit among the P binary digits as P - i according to the decoding order of the P binary digits. Or rather, for the P binary digits, the binary digit decoded first by the decoder has a larger number of positions to shift; conversely, the binary digit decoded later by the decoder has a smaller number of positions to shift.
[0261] Exemplarily, the decoder can determine the second intermediate value based on the first intermediate value and the second parameter in the following manner:
[0262] Shift the i-th binary digit among the P binary digits P - i positions to the left to obtain the P third parameters; then sum the first intermediate value and the P third parameters to obtain the second intermediate value. In other words, the decoder can determine the second intermediate value based on the first parameter and the second parameter according to the following formula:
[0263] mid2 = (V1 << P) + (W1 << P - 1) + (W2 << P - 2) + … + (W P << 0).
[0264] Where, mid2 represents the second intermediate value, V1 represents the first parameter, V1 << P represents the first intermediate value, W1 represents the binary digit located at the first position and having P - 1 positions to shift according to the decoding order of the P binary digits, W2 represents the binary digit located at the second position and having P - 2 positions to shift according to the decoding order of the P binary digits, and so on, W Prepresents the binary number that is at the Pth position according to the decoding order of the P binary numbers and has a shift number of 0.
[0265] Exemplarily, if the first parameter is 4, the decoder can first convert 4 into a binary string, that is, 100; further, assuming that the second parameter is (0,0) (that is, P=2), the decoder first shifts the 100 bit left by two bits to obtain 10000, and the decoder shifts the first binary bit in the second parameter (0,0) left by 1 bit to obtain 00; the decoder shifts the second binary bit in the second parameter (0,0) left by 0 bits to obtain 0; then calculate 10000+00+0=10000=16 to obtain the second intermediate value, that is, the second intermediate value converted to a decimal number of 16.
[0266] Of course, in other alternative embodiments, the initial value of i may also be 0. In this case, the decoder may determine Pi-1 as the number of shift bits of the i-th binary number among the P binary numbers.
[0267] In some embodiments, the decoder determines the second intermediate value as the first zero-run value.
[0268] Exemplarily, the decoder shifts the first parameter bits left by P bits to obtain a first intermediate value; then determines a second intermediate value based on the first intermediate value and the second parameter; and determines the second intermediate value as the first zero-run value. For example, the decoder determines the second intermediate value as the first zero-run value by default.
[0269] Of course, in other alternative embodiments, if the second parameter is equivalently replaced with a decimal value, the decoding end can directly sum the first intermediate value and the decimal value to obtain the second intermediate value.
[0270] In some embodiments, the decoder adds the second intermediate value and O to obtain the first zero-run value; O is a positive integer.
[0271] Exemplarily, the decoder shifts the first parameter bits left by P bits to obtain a first intermediate value; then determines a second intermediate value based on the first intermediate value and the second parameter; and adds the second intermediate value to 0 to obtain the first zero-run value. For example, the decoder defaults to adding the second intermediate value to 0 to obtain the first zero-run value.
[0272] Exemplarily, the value of O may be a predefined value, a value indicated by a bitstream, or a value determined by negotiation between an encoder and a decoder, and this application does not impose any specific limitation on this.
[0273] Exemplarily, the first zero-run value is a value greater than or equal to 0.
[0274] In some embodiments, the decoder obtains a first value of the first variable; and determines the sum of the first value and the second intermediate value as the first zero-run value.
[0275] Exemplarily, the decoder obtains the value of the first variable. When the value of the first variable is equal to the first value, the decoder can obtain the first parameter and the second parameter, and shift the first parameter left by P bits to obtain a first intermediate value, and then obtain a second intermediate value based on the first intermediate value and the second parameter, and then determine the sum of the second intermediate value and the first value as the first zero-run value.
[0276] Exemplarily, the initial value of the first variable is 0 or other numerical values.
[0277] Exemplarily, the first value is greater than or equal to the initial value of the first variable.
[0278] Exemplarily, the first value may be a predefined value, a value obtained by decoding the code stream, or a value determined by negotiation between the decoder and the encoder, which is not specifically limited in this application.
[0279] In some embodiments, the decoder determines the value of the first variable; if the value of the first variable is greater than or equal to E, the value of the second variable is determined; if the value of the second variable is greater than or equal to G, the value of the first variable is determined to be the first value; wherein E and G are both positive integers.
[0280] Exemplarily, the decoder obtains the value of a first variable. If the value of the first variable is greater than or equal to E, the decoder determines the value of a second variable. If the value of the second variable is greater than or equal to G, the decoder may obtain the first parameter and the second parameter, left-shift the first parameter by P bits to obtain a first intermediate value, then obtain a second intermediate value based on the first intermediate value and the second parameter, and then determine the sum of the second intermediate value and the value of the first variable as the first zero-run value. The values of the first variable and the second variable may be updated based on the result of decoding the bitstream. Specifically, the decoder obtains an initial value of the first variable. When the value of the first variable is less than E, based on the result of decoding the code stream, the value of the first variable may be increased according to a certain strategy until the value of the first variable is greater than or equal to G. The decoder obtains an initial value of the second variable. When the value of the second variable is less than G, the decoder may increase the values of the first variable and the second variable according to a certain strategy until the value of the second variable is greater than or equal to G, and then determines the value of the first variable as the first value. The initial value of the first variable and the initial value of the second variable may be 0 or other values.
[0281] Exemplarily, the values of E and / or F may be predefined values, values obtained by decoding the bitstream, or values determined by negotiation between the decoder and the encoder, which is not specifically limited in this application.
[0282] For example, the values of E and F may be 3 and 1, respectively. Of course, in other alternative embodiments, the values of E and F may also be other values, which are not specifically limited in the embodiments of the present application.
[0283] In some embodiments, the first value may be E×F+G×H, where G and H are both positive integers.
[0284] Exemplarily, the decoder obtains the value of the first variable, and when the value of the first variable is equal to E×F+G×H, the decoder can obtain the first parameter and the second parameter, and shift the first parameter left by P bits to obtain a first intermediate value, and then obtain a second intermediate value based on the first intermediate value and the second parameter, and then determine the sum of the second intermediate value and E×F+G×H as the first zero-run value.
[0285] Exemplarily, the values of G and / or H may be predefined values, values obtained by decoding the bitstream, or values determined by negotiation between the decoder and the encoder, which is not specifically limited in this application.
[0286] For example, the values of G and H may be 4 and 2, respectively. Of course, in other alternative embodiments, the values of G and H may also be other values, which are not specifically limited in the embodiments of the present application.
[0287] In some embodiments, before the decoder determines the value of the second variable, the method 100 may further include:
[0288] If the value of the first variable is less than E, a first binary number is obtained using a fixed context;
[0289] If the first binary number is equal to U, the value of the first variable is determined to be the first zero-run value.
[0290] Exemplarily, if the value of the first variable is less than E, the decoder uses a fixed context to obtain a first binary number; if the first binary number is equal to U, the decoder defaults to determining the value of the first variable as the first zero-run value.
[0291] Exemplarily, U is 0 or 1.
[0292] Exemplarily, the value of U may be a predefined value, a value obtained by decoding the code stream, or a value determined by negotiation between the decoder and the encoder, which is not specifically limited in this application.
[0293] In some embodiments, the method 100 may further include:
[0294] If the first binary number is equal to V, then the value of the first variable is updated from the second value to the sum of the second value and F;
[0295] Wherein, F is a positive integer, and U is not equal to V.
[0296] Exemplarily, if the value of the first variable is less than E, the decoder uses a fixed context to obtain a first binary number; if the first binary number is equal to U, the decoder defaults to determining the value of the first variable as the first zero-run value; if the first binary number is equal to V, F is added to the value of the first variable. Furthermore, the decoder performs the next loop based on the value of the second variable until the value of the binary number obtained using the fixed context is equal to U, in which case the value of the first variable is determined as the first zero-run value, or until the value of the first variable is greater than or equal to E, in which case the first zero-run value is determined using other methods.
[0297] Illustratively, V is 0 or 1.
[0298] For example, if U=1, then V=0.
[0299] For example, if U=0, then V=1.
[0300] Exemplarily, the value of V may be a predefined value, a value obtained by decoding the code stream, or a value determined by negotiation between the decoder and the encoder, which is not specifically limited in this application.
[0301] For example, when F=1, if the first binary number is equal to V, the value of the first variable is updated from the second value to the sum of the second value and 1. Of course, in other alternative embodiments, F may also be any value other than 1.
[0302] In some embodiments, the method 100 may further include:
[0303] If the sum of the second value and F is less than E, a second binary number is obtained using the fixed context;
[0304] The context index value used by the first binary number is different from the context index value used by the second binary number.
[0305] Exemplarily, if the value of the first variable is less than E, the decoder uses a fixed context to obtain a first binary number; if the first binary number is equal to U, the decoder determines the value of the first variable as the first zero-run value; if the first binary number is equal to V, the value of the first variable is updated from the second value to the sum of the second value and F. If the sum of the second value and F is less than E, a second binary number is obtained using a fixed context; wherein the context index value used by the first binary number is different from the context index value used by the second binary number; if the second binary number is equal to U, the decoder determines the value of the first variable (i.e., the sum of the second value and F) as the first zero-run value; if the second binary number is equal to V, the value of the first variable is updated from the sum of the second value and F to the sum of the second value and 2×F (i.e., the decoder adds F to the value of the first variable); and so on, until the value of the binary number obtained using the fixed context is equal to U, the value of the first variable is determined as the first zero-run value, or until the value of the first variable is greater than or equal to E, the first zero-run value is determined by other methods.
[0306] Exemplarily, assuming that the first variable is recorded as r1, the decoder can determine the first zero run value through the following for loop:
[0307] for loop(r1=0;r1 <E;r1++);
[0308] Decode a bit using a fixed context (a different fixed context is used in each loop);
[0309] If the bit is equal to U, the decoder ends decoding and the value of r1 is the first zero-run value;
[0310] Otherwise, r1=r1+F and continue the loop.
[0311] For example, E = 3, F = 1, and U = 0. Of course, in other alternative embodiments, E and / or U may also have other values, which are not specifically limited in the embodiments of the present application.
[0312] In some embodiments, before the decoder determines the value of the first variable as the first value, the method 100 may further include:
[0313] If the value of the second variable is less than G, a third binary number is obtained using a fixed context; G is a positive integer;
[0314] If the third binary number is equal to U, obtaining a fourth binary number;
[0315] The sum of the value of the first variable and the fourth binary number is determined as the first zero-run value.
[0316] Exemplarily, if the value of the first variable is greater than or equal to E, the decoder determines the value of the second variable; if the value of the second variable is less than G, a third binary number is obtained using a fixed context; if the third binary number is equal to U, a fourth binary number is obtained; and the sum of the value of the first variable and the fourth binary number is determined as the first zero-run value.
[0317] In some embodiments, the method 100 may further include:
[0318] If the third binary number is equal to V, the value of the first variable is updated from the third value to the sum of the third value and H, and the value of the second variable is updated from the fourth value to the sum of the fourth value and L;
[0319] Wherein, H and L are both positive integers, and U is not equal to V.
[0320] Exemplarily, if the value of the first variable is greater than or equal to E, the decoder determines the value of the second variable. If the value of the second variable is less than G, the decoder obtains a third binary number using a fixed context. If the third binary number is equal to U, the decoder obtains a fourth binary number. The sum of the value of the first variable and the fourth binary number is determined as the first zero-run value. If the third binary number is equal to V, the value of the first variable is updated from the third value to the sum of the third value and H, and the value of the second variable is updated from the fourth value to the sum of the fourth value and L. Further, the decoder performs the next loop based on the value of the second variable until the binary number obtained by the decoder using the fixed context is equal to U, and the sum of the value of the first variable and the next binary number is determined as the first zero-run value, or until the value of the second variable is greater than or equal to G, the decoder obtains the first parameter and the second parameter, and determines the first zero-run value based on the value of the first variable, the first parameter, and the second parameter.
[0321] In some embodiments, the method 100 may further include:
[0322] If the sum of the fourth value and L is less than G, a fifth binary number is obtained using a fixed context;
[0323] The context index value used by the third binary number is different from the context index value used by the fifth binary number.
[0324] Exemplarily, if the value of the first variable is greater than or equal to E, the decoder determines the value of the second variable; if the value of the second variable is less than G, the third binary number is obtained using a fixed context; if the third binary number is equal to V, the value of the first variable is updated from the third value to the sum of the third value and H, and the value of the second variable is updated from the fourth value to the sum of the fourth value and L; further, if the value of the second variable (that is, the sum of the fourth value and L) is less than G, the first binary number after the third binary number is obtained using a fixed context. Further, if the first binary number after the third binary number is equal to U, the second binary number after the third binary number is obtained, and the value of the first variable (that is, the sum of the third value and H) and the sum of the second binary number after the third binary number are determined as the first zero-run value; if the first binary number after the third binary number is equal to V, H is added to the value of the first variable (that is, the sum of the third value and 2×H), and L is added to the value of the second variable (that is, the sum of the fourth value and 2×L); until the value of the second variable is equal to or greater than G, the decoder obtains the first parameter and the second parameter, and determines the first zero-run value based on the value of the first variable, the first parameter and the second parameter.
[0325] Exemplarily, assuming that the first variable is recorded as r1 and the second variable is recorded as r2, the decoder can determine the first zero run value through the following for loop:
[0326] for loop(r1=0;r1 <E;r1++);
[0327] Decode a bit using a fixed context (a different fixed context is used in each loop);
[0328] If the bit is equal to U, the decoder ends decoding, and the value of r1 is the first zero-run value.
[0329] Otherwise, r1=r1+F and continue the loop.
[0330] for loop(r2=0;r2 <G;r2++);
[0331] Decode a bit using a fixed context (a different fixed context is used in each loop);
[0332] If the bit is equal to U, the decoder directly decodes another bit, assuming it is recorded as b (i.e. 0 or 1), then r1 = r1 + b, and the value of r1 is the first zero run value;
[0333] Otherwise, r1=r1+H and the cycle continues.
[0334] Obtain the first parameter and the second parameter, shift the first parameter to the left by P bits to obtain a first intermediate value, and then obtain a second intermediate value based on the first intermediate value and the second parameter. Assume it is denoted as mid2, then r1 = r1 + mid2, and the value of r1 is the first zero run value.
[0335] In short, the decoder first executes the for loop (r1 = 0; r1 < E; r1++), and when r1 < E does not hold, it executes the for loop (r2 = 0; r2 < G; r2++); then, when r2 < G does not hold, the decoder obtains the first parameter and the second parameter, shifts the first parameter to the left by P bits to obtain a first intermediate value, and then obtains a second intermediate value based on the first intermediate value and the second parameter. Assume it is denoted as mid2, then r1 = r1 + mid2, and the value of r1 is the first zero run value.
[0336] For example, assume E = 3, F = 1, G = 4, H = 2, U = 0, then the decoder can determine the first zero run value through the following for loop:
[0337] for loop (r1 = 0; r1 < 3; r1++);
[0338] Decode a bit using a fixed context (using a different fixed context for each loop);
[0339] If the bit is equal to 0, the decoder ends decoding, and the value of r1 is the first zero run value.
[0340] Otherwise, r1 = r1 + 1, and continue the loop.
[0341] for loop (r2 = 0; r2 < 4; r2++);
[0342] Decode a bit using a fixed context (using a different fixed context for each loop);
[0343] If the bit is equal to U, the decoder directly decodes another bit. Assume it is denoted as b (i.e., 0 or 1), then r1 = r1 + b, and the value of r1 is the first zero run value;
[0344] Otherwise, r1 = r1 + 2, and continue the loop.
[0345] Obtain the first parameter and the second parameter, shift the first parameter to the left by P bits to obtain a first intermediate value, and then obtain a second intermediate value based on the first intermediate value and the second parameter. Assume it is denoted as mid2, then r1 = r1 + mid2, and the value of r1 is the first zero run value.
[0346] In short, the decoder first executes a for loop (r1=0; r1<3; r1++), and when r1<3 is not true, it executes a for loop (r2=0; r2<4; r2++); then, when r2<4 is not true, the decoder obtains the first parameter and the second parameter, and shifts the first parameter left by P bits to obtain a first intermediate value, and then obtains a second intermediate value based on the first intermediate value and the second parameter, assuming it is denoted as mid2, then r1=r1+mid2, and the value of r1 is the first zero-run value.
[0347] Of course, in other alternative embodiments, the above-mentioned E, F, G, H or U may also be other values, and the embodiments of the present application do not specifically limit this.
[0348] In some embodiments, the decoder determines whether the first zero-run value is a value between 0 and M; M is a positive integer; if the first zero-run value is not a value between 0 and M, the sum of the second intermediate value and M+1 is determined as the first zero-run value.
[0349] For example, if the first zero-run value is a value between 0 and M, the decoder can determine the value between 0 and M as the first zero-run value; otherwise, the decoder obtains the first parameter and the second parameter, and shifts the first parameter left by P bits to obtain a first intermediate value, then obtains a second intermediate value based on the first intermediate value and the second parameter, and then determines the sum of the second intermediate value and M+1 as the first zero-run value. It should be understood that the embodiments of the present application do not specifically limit the implementation method of how the decoder determines whether the first zero-run value is a value between 0 and M.
[0350] Exemplarily, the value of M can be 1, 2, 3 or 4, or other values greater than 4, and the embodiments of the present application do not specifically limit this.
[0351] In some embodiments, the decoder determines the i-th flag bit among the M+1 flag bits; the value of the i-th flag bit indicates whether the first zero run value is equal to i-1, and the values of the first i-1 flag bits among the M+1 flag bits indicate that the first zero run value is not equal to a value between 0 and i-2.
[0352] Exemplarily, if the value of the i-th flag bit indicates that the first zero run value is equal to i-1, the decoder determines i-1 as the first zero run value; otherwise, the decoder needs to further obtain and determine the i+1-th flag bit among the M+1 flag bits, and the value of the i+1-th flag bit indicates whether the first zero run value is equal to i.
[0353] Exemplarily, when the i-th flag bit is 0 (or 1), it indicates that the first zero run value is not equal to i-1; when the i-th flag bit is 1 (or 0), it indicates that the first zero run value is equal to i-1. When the M+1 flag bits do not exist, it can be inferred that the value of each of the M+1 flag bits is 0 (or 1), that is, the first zero run value is not a value between 0 and M.
[0354] For example, assuming M=3, there are 4 flag bits for indicating whether the first zero run value is 0 to 3. Specifically,
[0355] When the value of the first flag bit of the four flag bits is 0, it indicates that the first zero run value is 0; when the value is 1, it indicates that the first zero run value is not 0;
[0356] When the value of the second flag bit among the four flag bits is 0, it indicates that the first zero run value is 1; when the value is 1, it indicates that the first zero run value is not 1;
[0357] When the value of the third flag bit among the four flag bits is 0, it indicates that the first zero run value is 2; when it is 1, it indicates that the first zero run value is not 2;
[0358] When the value of the fourth flag bit among these four flag bits is 0, it indicates that the first zero run value is 3; when it is 1, it indicates that the first zero run value is not 3.
[0359] Exemplarily, if the values of the M+1 flag bits are all 0 or all 1, the decoder determines that the first zero-run value is not a value between 0 and M.
[0360] Exemplarily, the decoder decodes the M+1 flag bits in sequence. If the value of the i-th flag bit in the M+1 flag bits indicates that the first zero run value is equal to i-1, the decoder determines i-1 as the first zero run value and ends decoding the remaining flag bits. If the value of the i-th flag bit in the M+1 flag bits indicates that the first zero run value is not equal to i-1, the decoder continues to decode the i+1-th flag bit. If the value of the i+1-th flag bit indicates that the first zero run value is equal to i, the decoder determines i as the first zero run value and ends decoding the remaining flag bits. The decoding of the first zero-run value is performed on the first flag bit; if the value of the i-th flag bit indicates that the first zero-run value is not equal to i, the decoder continues to decode i+2, and so on, until the decoded flag bit indicates that the first zero-run value is a value between 0 and M, the first zero-run value is determined and the decoding of the remaining flag bits is ended, or, until the last flag bit of the M+1 flag bits is decoded and the last flag bit indicates that the first zero-run value is not equal to M, the decoder needs to further obtain the first parameter and the second parameter, and determine the first zero-run value based on the first parameter and the second parameter.
[0361] Of course, in other alternative embodiments, a flag bit may be used to indicate whether the first zero-run value is a value between 0 and M, and this application does not make any specific limitation on this.
[0362] In some embodiments, the decoder may determine the i-th flag bit using a fixed context, no context, or an adaptive context.
[0363] Exemplarily, when the decoder decodes the i-th flag bit, the selected context index value (used to identify the context model) is a fixed context index value; in other words, when the decoder decodes the i-th flag bit, the selected context model is a fixed context model. For example, the entropy decoding algorithm of the i-th flag bit is the CABAC decoding algorithm. At this time, the context used by the CABAC decoding algorithm is a fixed context. The fixed context can be a predefined context, a context indicated by a bitstream, a context determined by negotiation between the encoder and the decoder, or even a context set by the user. This application does not make specific restrictions on this.
[0364] Exemplarily, when the decoder decodes the i-th flag bit, it is not necessary to determine the context index value (for identifying the context model) or select the context model. For example, the entropy decoding algorithm for the i-th flag bit is a binary arithmetic decoding algorithm.
[0365] Exemplarily, when the decoder decodes the i-th flag bit, the context index value selected (used to identify the context model) is the context index value adapted to the prior information of the i-th flag bit; in other words, when the decoder decodes the i-th flag bit, the context model selected is the context model adapted to the prior information of the i-th flag bit. For example, the entropy decoding algorithm of the i-th flag bit is the CABAC decoding algorithm. In this case, the context model adopted by the CABAC decoding algorithm is the context adapted to the prior information of the i-th flag bit. The prior information of the i-th flag bit may include any information related to the i-th flag bit that has been decoded or determined by the decoder. For example, the prior information of the i-th flag bit includes but is not limited to: the attribute coefficient of the decoded point, the context index value adopted by the decoded point, the decoded zero run value, the context index value adopted by the decoded zero run value, or other determined information.
[0366] Of course, in other alternative embodiments, the present application may not limit the meaning of the M+1 flag bits.
[0367] In some embodiments, the decoder may directly determine whether the first zero-run value is a value between 0 and M based on the values of the M+1 flag bits. For example, if the value of the i-th flag bit in the M+1 flag bits is 0, the decoder may determine the first zero-run value based on the sum of the values of the M+1 flag bits, where the values of the flag bits after the i-th flag bit are default values (e.g., 0). If the values of the M+1 flag bits are all 1, the decoder may determine that the first zero-run value is not a value between 0 and M, that is, the decoder may determine the first zero-run value based on the sum of the values of the first parameter, the second parameter, and the four flag bits.
[0368] For example, assuming M=3, there are 4 flag bits for indicating whether the first zero run value is 0 to 3. Specifically,
[0369] When there is a flag bit that is 0, it is determined that the first zero run value is 0; when it is 1, it is determined that the first zero run value is not 0;
[0370] When there is a flag bit that is 0, it is determined that the first zero run value is 1; when it is 1, it is determined that the first zero run value is not 1;
[0371] When there is a flag bit that is 0, it is determined that the first zero run value is 2; when it is 1, it is determined that the first zero run value is not 2;
[0372] When there is a flag bit that is 0, it is determined that the first zero run value is 3; when it is 1, it is determined that the first zero run value is not 3;
[0373] When the above flag bit does not exist (ie, decoding is not required), it can be inferred that the value of the flag bit is a default value (eg, 0).
[0374] In other words, the decoder may determine the first zero-run value as follows:
[0375] Decode a flag bit using adaptive context. If its value is 0, then: terminate decoding of subsequent flag bits and determine the first zero-run value to be 0, or determine the first zero-run value to be the sum of the values of the four flag bits 0+0+0+0=0, where the values of the non-existent flag bits are inferred to be 0; if not, then:
[0376] Decode a flag bit using adaptive context. If its value is 0, then: terminate decoding of subsequent flag bits and determine the first zero run value to be 1, or determine the first zero run value to be the sum of the values of the four flag bits (1+0+0+0=1), where the values of the non-existent flag bits are inferred to be 0; if not, then:
[0377] Decode a flag bit using adaptive context. If its value is 0, then: terminate decoding of subsequent flag bits and determine the first zero run value to be 2, or determine the first zero run value to be the sum of the values of the four flag bits (1+1+0+0=2), where the values of non-existent flag bits are inferred to be 0; if not, then:
[0378] A flag is decoded using adaptive context. If its value is 0, then: the decoding of subsequent flags is terminated and the first zero-run value is determined to be 3, or the first zero-run value is determined to be the sum of the values of the four flags, 1+1+1+0=3, where the value of the non-existent flag is inferred to be 0; if not, the decoder obtains the first parameter and the second parameter, and determines the first zero-run value based on the first parameter, the second parameter, and the sum of the values of the four flags.
[0379] In this embodiment, by accumulating the values of the M+1 flag bits, the values of the M+1 flag bits can be used for decoding while indicating whether the first zero run value is a value between 0 and M, further improving the compression ratio and decoding efficiency.
[0380] In some embodiments, if the first flag bit among the M+1 flag bits whose value is 0 is the i-th flag bit, the decoder can determine the first zero-run value as the sum of the first i flag bits. If the value of the i-th flag bit is 1, the decoder can determine that the first zero-run value is not the sum of the first i flag bits, that is, the decoder can determine that the first zero-run value is not a value between 0 and (i-1). If the values of the M+1 flag bits are all 1, the decoder can determine that the first zero-run value is not a value between 0 and M, that is, the decoder can determine the first zero-run value based on the first parameter, the second parameter, and the sum of the values of the four flag bits.
[0381] For example, assuming M=3, there are 4 flag bits for indicating whether the first zero run value is 0 to 3. Specifically,
[0382] When there is a flag bit that is 0, it is determined that the first zero run value is 0; when it is 1, it is determined that the first zero run value is not 0;
[0383] When there is a flag bit that is 0, it is determined that the first zero run value is 1; when it is 1, it is determined that the first zero run value is not 1;
[0384] When there is a flag bit that is 0, it is determined that the first zero run value is 2; when it is 1, it is determined that the first zero run value is not 2;
[0385] When there is a flag bit that is 0, it is determined that the first zero run value is 3; when it is 1, it is determined that the first zero run value is not 3;
[0386] When the above flag bit does not exist (ie, decoding is not required), it can be inferred that the value of the flag bit is a default value (eg, 0).
[0387] In other words, the decoder may determine the first zero-run value as follows:
[0388] Decode a flag bit using adaptive context. If its value is 0, then: end decoding of subsequent flag bits and determine the first zero run value to be 0, or determine the first zero run value to be the sum of the values of the previous flag bit and 0; if not, then:
[0389] Decode a flag bit using adaptive context. If its value is 0, then: terminate decoding of subsequent flag bits and determine the first zero run value to be 1, or determine the first zero run value to be the sum of the values of the four flag bits (1+0=1), where the values of the non-existent flag bits are inferred to be 0; if not, then:
[0390] Decode a flag bit using adaptive context. If its value is 0, then: terminate decoding of subsequent flag bits and determine the first zero run value to be 2, or determine the first zero run value to be the sum of the values of the four flag bits (1+1+0=2), where the values of the non-existent flag bits are inferred to be 0; if not, then:
[0391] A flag is decoded using adaptive context. If its value is 0, then: the decoding of subsequent flags is terminated and the first zero-run value is determined to be 3, or the first zero-run value is determined to be the sum of the values of the four flags, 1+1+1+0=3, where the value of the non-existent flag is inferred to be 0; if not, the decoder obtains the first parameter and the second parameter, and determines the first zero-run value based on the first parameter, the second parameter, and the sum of the values of the four flags.
[0392] In this embodiment, by accumulating the values of the first i flag bits, the values of the first i flag bits can be used for decoding while indicating whether the first zero run value is a value between 0 and (i-1), further improving the compression ratio and decoding efficiency.
[0393] As can be seen from the above, the decoder can determine the first zero-run value based on the first parameter, the second parameter, and the values of the M+1 flag bits (or the values of the first i flag bits in the M+1 flag bits when the value of the i-th flag bit in the M+1 flag bits is 0). Specifically, the decoder can left-shift the first parameter by P bits to obtain a first intermediate value, obtain a second intermediate value based on the first intermediate value and the second parameter, and then add the second intermediate value to the sum of the values of the M+1 flag bits (or the values of the first i flag bits in the M+1 flag bits when the value of the i-th flag bit in the M+1 flag bits is 0) to obtain the first zero-run value.
[0394] Exemplarily, the decoder left-shifts the first parameter bit by P bits to obtain a first intermediate value; then determines a second intermediate value based on the first intermediate value and the second parameter; and adds the second intermediate value to O to obtain the first zero run value. For example, the decoder defaults to adding the second intermediate value to O to obtain the first zero run value. Here, O = M + 1 (for example, when the values of the M + 1 flag bits are all 1); or, O = i - 1 (for example, when the value of the i-th flag bit among the M + 1 flag bits is 0).
[0395] In some embodiments, S110 may include:
[0396] Determine the first parameter using a first entropy decoding algorithm.
[0397] In some embodiments, the first entropy decoding algorithm is the Golomb decoding algorithm.
[0398] Of course, in other alternative embodiments, the first entropy decoding algorithm may also be any other entropy decoding algorithm capable of decoding a binary string, and the present application does not make specific limitations thereon. For example, the first entropy decoding algorithm may also be a unary decoding algorithm, a truncated unary decoding algorithm, a fixed-length decoding algorithm, a variable-length decoding algorithm, an entropy decoding algorithm based on a look-up table, or an entropy decoding algorithm for joint decoding of multiple entropy decoding algorithms, etc.
[0399] Among them, the unary decoding algorithm is an entropy decoding algorithm for decoding the encoding result of the unary encoding algorithm. The encoding rule of the unary encoding algorithm is: for the symbol "x" >= 0 to be encoded, the unary encoding encodes it as x "1"s followed by a "0". For example, assume x = 5, then after unary encoding, it is encoded as "111110". The truncated unary decoding algorithm is an entropy decoding algorithm for decoding the encoding of the truncated unary encoding algorithm. Among them, the truncated unary encoding algorithm belongs to a variant of the unary encoding algorithm and is used in the case where the maximum value Max of the syntax element to be encoded is known. Assume the symbol to be encoded is x: if 0 < x < Max, x is binarized in the way of the unary code; if x = Max, the binary string of x binarization consists entirely of 1s and has a length of Max. For example, assume Max = 6, then when encoding the symbol "6", the result is "111111", and when encoding the symbol "3", according to the encoding method of the unary code, the result is "1110".
[0400] In some embodiments, S110 may include:
[0401] Determine the second parameter using a fixed context.
[0402] Exemplarily, when the decoder decodes each binary number in the second parameter, the selected context index value (used to identify the context model) is a fixed context index value; in other words, when the decoder decodes each binary number in the second parameter, the selected context model is a fixed context model. For example, the entropy decoding algorithm for each binary number in the second parameter is the CABAC decoding algorithm. At this time, the context used by the CABAC decoding algorithm is a fixed context. The fixed context can be a predefined context, a context indicated by a bitstream, a context determined by negotiation between the encoder and the decoder, or even a context set by the user. This application does not specifically limit this.
[0403] In some embodiments, the decoder determines the first binary in the second parameter using a fixed context.
[0404] Exemplarily, when the decoder decodes the first binary number, the selected context index value (used to identify the context model) is a fixed context index value; in other words, when the decoder decodes the first binary number, the selected context model is a fixed context model. For example, the entropy decoding algorithm of the first binary number is the CABAC decoding algorithm. In this case, the context used by the CABAC decoding algorithm is a fixed context. The fixed context can be a predefined context, a context indicated by a bitstream, a context determined by negotiation between the encoder and the decoder, or even a context set by the user. This application does not specifically limit this.
[0405] Of course, in other alternative embodiments, when the decoder cannot obtain prior information about the current binary number, the decoder may also use a fixed context to determine the current binary number.
[0406] In some embodiments, S110 may include:
[0407] No context is used to determine the second parameter.
[0408] Exemplarily, when the decoder decodes each binary number in the second parameter, it is not necessary to determine a context index value (for identifying a context model) or select a context model. For example, the entropy decoding algorithm for each binary number in the second parameter is a binary arithmetic decoding algorithm.
[0409] In some embodiments, S110 may include:
[0410] The second parameter is determined using the adaptation context.
[0411] Exemplarily, the decoder uses the adaptive context to determine a binary number other than the first binary number in the second parameter. In other words, the decoder uses the adaptive context to determine a current binary number in the second parameter, wherein the current binary number is a binary number other than the first binary number in the second parameter.
[0412] In some embodiments, the decoder determines a first index value based on prior information of the current binary number in the second parameter; then, the decoder determines the current binary number based on a context indicated by the first index value.
[0413] Exemplarily, when the decoder decodes the current binary number, the context index value (used to identify the context model) selected is a context index value that is adapted to the prior information of the current binary number; in other words, when the decoder decodes the current binary number, the context model selected is a context model that is adapted to the prior information of the current binary number. For example, if the entropy decoding algorithm for each binary number in the second parameter is a CABAC decoding algorithm, then the context model used by the CABAC decoding algorithm is a context that is adapted to the prior information of the current binary number.
[0414] Exemplarily, the first index value is a context index value (for identifying a context model) determined by the decoder and adapted to the prior information of the current binary number.
[0415] Exemplarily, the decoder determines the current binary number using a CABAC decoding algorithm based on the context indicated by the first index value.
[0416] Exemplarily, when the decoder is able to obtain a priori information of the current binary number, the decoder may determine the first index value based on the a priori information of the current binary number.
[0417] The a priori information of the current binary number may include any information related to the current binary number that has been decoded or determined by a decoder.
[0418] In some embodiments, the prior information includes at least one of the following:
[0419] The attribute coefficient of the decoded point, the context index value used by the decoded point, the decoded zero run value, the context index value used by the decoded zero run value, and the binary number determined in the second parameter.
[0420] Exemplarily, the first index value can be a context index value determined by the decoder to be adapted to the attribute coefficient of the decoded point and used to decode the current binary number; and / or, the first index value can be a context index value determined by the decoder to be adapted to the context index value adopted by the decoded point and used to decode the current binary number; and / or, the first index value can be a context index value determined by the decoder to be applicable to the decoded zero-run value and used to decode the current binary number; and / or, the first index value can be a context index value determined by the decoder to be applicable to the context index value adopted by the decoded zero-run value and used to decode the current binary number; and / or, the first index value can be a context index value determined by the decoder to be applicable to the context index value adopted by the decoded zero-run value and used to decode the current binary number. Taking the example where the prior information includes the determined binary number in the second parameter, if the current binary number is not the first binary number in the second parameter, it means that there is a determined binary number for the current binary number. Therefore, the decoder can determine the context index value applicable to the determined binary number in the second parameter as the first index value, and then decode the current binary number based on the first index value.
[0421] For example, the determined binary number may be all the binary numbers determined in the second parameter, or may be a portion of the binary numbers determined in the second parameter. The portion of the binary number may be the first or last binary number determined in the second parameter, or may be one or more binary numbers at other positions, which is not specifically limited in this application.
[0422] In other words, the a priori information may be information related to a decoded point, information related to a decoded zero-run value, or information related to a determined binary number.
[0423] In some embodiments, the first index value is a one-dimensional index value determined based on the determined binary number.
[0424] Exemplarily, the decoder may determine the first index value (i.e., one-dimensional index value) based on the prior information of the current binary number (i.e., the determined binary number). When the determined binary number is a single binary number, the decoder may use the single binary number as the first index value. For another example, when the at least one binary number is a plurality of binary numbers, the decoder may use the plurality of binary numbers as input and output the first index value using a fixed calculation function. For example, if the context index value used by the first binary number in the second parameter is a fixed context index value, and the context index value used by the second binary number in the second parameter is a context index value determined based on the first binary number, then the context index value used by the first binary number and the context index value used by the second binary number are implemented by the following syntax elements:
[0425] Among them, for the first binary number in the second parameter, its first index value (i.e., paritymodel1) is a fixed index value (i.e., 1), and for the second binary number in the second parameter, its first index value (i.e., paritymodel2[a1]) is a context index value (i.e., a1) determined based on the first binary number.
[0426] Of course, the above grammatical elements are merely examples of the present application and should not be construed as limiting the present application.
[0427] In addition, in other alternative embodiments, the first index value may also be a multi-dimensional index value determined based on the determined binary number, and the embodiments of the present application do not impose specific limitations on this.
[0428] In some embodiments, the method 100 may further include:
[0429] A first flag bit is determined; the value of the first flag bit indicates whether the first zero-run value is determined based on the first parameter and the second parameter.
[0430] Exemplarily, the first flag bit can be a point cloud-level flag bit. That is, the value of the first flag bit indicates whether the zero-run value in the bitstream of the current point cloud is determined based on the first parameter and the second parameter. For example, if the value of the first flag bit indicates that the zero-run value in the bitstream of the current point cloud is determined based on the first parameter and the second parameter, the decoder determines each zero-run value in the bitstream of the current point cloud based on the first parameter and the second parameter.
[0431] Exemplarily, the first flag bit may be a slice-level flag bit. That is, the value of the first flag bit indicates whether to determine zero-run values in the slice stream of the current point cloud based on the first parameter and the second parameter. For example, if the value of the first flag bit indicates that zero-run values in the slice stream of the current point cloud are determined based on the first parameter and the second parameter, the decoder determines each zero-run value in the slice stream of the current point cloud based on the first parameter and the second parameter.
[0432] Exemplarily, the first flag bit may be a flag bit at the run value level. That is, the value of the first flag bit indicates whether the current zero run value to be decoded is determined based on the first parameter and the second parameter. For example, if the value of the first flag bit indicates that the current zero run value is determined based on the first parameter and the second parameter, the decoder determines the current zero run value based on the first parameter and the second parameter.
[0433] In this embodiment, the first flag is used to indicate whether it is enabled or not. The first flag is placed in the attribute header of the high-level syntax element. The first flag can be enabled (i.e., appear in the code stream) under certain specific conditions (e.g., a specific type of point cloud). The first flag may not appear in the code stream under certain specific conditions (e.g., a specific type of point cloud). Furthermore, if the first flag does not appear in the code stream, the value of the first flag can be a fixed value (i.e., a default value). In other words, the decoder needs to decode the first flag. If the first flag does not appear in the code stream, it will not be decoded, i.e., it is defaulted to a fixed value.
[0434] It is worth noting that in the embodiment of the present application, even if the value of the first flag bit indicates that the first zero-run value is determined based on the first parameter and the second parameter. If the decoder decodes the i-th flag bit of the M+1 flag bits involved above and indicates that the first zero-run value is i-1, then the decoder will directly (or based on the i-th flag bit) determine i-1 as the first zero-run value and end the decoding of the remaining flag bits. In addition, there is no need to determine the first zero-run value based on the first parameter and the second parameter. In other words, if the value of the first flag bit indicates that the first zero-run value is determined based on the first parameter and the second parameter, then when the M+1 flag bits indicate that the first zero-run value is not a value between 0 and M, the decoder needs to obtain the first parameter and the second parameter, and determine the first zero-run value based on the first parameter and the second parameter.
[0435] The following describes a preferred embodiment of the decoder provided by the present application using a for loop to determine the first zero run value.
[0436] Example 1:
[0437] In this embodiment, the decoder determines the first zero run value by using a for loop (r1 = 0; r1 < E; r1++) and a for loop (r2 = 0; r2 < G; r2++). Specifically, when r1 < E does not hold, the for loop (r2 = 0; r2 < G; r2++) is executed, and when r2 < G does not hold, the decoder obtains the first parameter and the second parameter, left-shifts the first parameter by P bits to obtain a first intermediate value, then obtains a second intermediate value based on the first intermediate value and the second parameter, and then adds the sum of the second intermediate value and the value of r1 to determine the first zero run value.
[0438] Exemplarily, assuming that the second variable is denoted as r2, the decoder can determine the first zero run value through the following for loop:
[0439] for loop (r1 = 0; r1 < E; r1++);
[0440] Decode one bit using a fixed context (a different fixed context is used for each loop);
[0441] If the bit is equal to U, the decoder ends decoding, and the value of r1 is the first zero run value.
[0442] Otherwise, r1 = r1 + F, and continue the loop.
[0443] for loop (r2 = 0; r2 < G; r2++);
[0444] Decode one bit using a fixed context (a different fixed context is used for each loop);
[0445] If the bit is equal to U, the decoder directly decodes one more bit, assuming it is denoted as b (i.e., 0 or 1), then r1 = r1 + b, and the value of r1 is the first zero run value;
[0446] Otherwise, r1 = r1 + H, and continue the loop.
[0447] Obtain the first parameter and the second parameter, left-shift the first parameter by P bits to obtain a first intermediate value, then obtain a second intermediate value based on the first intermediate value and the second parameter, assuming it is denoted as mid2, then r1 = r1 + mid2, and the value of r1 is the first zero run value.
[0448] Briefly, the decoder first executes the for loop (r1 = 0; r1 < E; r1++), and when r1 < E does not hold, it executes the for loop (r2 = 0; r2 < G; r2++); then, when r2 < G does not hold, the decoder obtains the first parameter and the second parameter, left-shifts the first parameter by P bits to obtain a first intermediate value, and then obtains a second intermediate value based on the first intermediate value and the second parameter. Assuming it is denoted as mid2, then r1 = r1 + mid2, and the value of r1 is the first zero run length value.
[0449] Exemplarily, the decoder can obtain the first parameter and the second parameter based on the following method, and obtain the first zero run length value based on the first parameter and the second parameter:
[0450] Assume that the second parameter is P binary numbers. The decoder can use fixed context, no context, or adaptive context to obtain the first binary number in the second parameter, denoted as W1, and its shift position is P - 1; then use fixed context, no context, or adaptive context to obtain the second binary number in the second parameter, denoted as W2, and its shift position is P - 2; and so on, until using fixed context, no context, or adaptive context to obtain the last binary number in the second parameter, denoted as W P , and its shift position is P - P = 0, thus obtaining the second parameter. For example, when the decoder decodes the second parameter, as an implementable solution, it can first use the corresponding input parameter to select a context index to decode W1, then use the already decoded W1 and / or the corresponding input parameter to jointly select an appropriate context index to decode W2, and then use at least one of the already decoded W1, the already decoded W2, and the corresponding input parameter to select an appropriate context index to decode W3, and so on, until the decoding of W P is completed. The corresponding input parameter can be a fixed context index value.
[0451] In addition, the decoder also needs to use the Exponential Golomb decoding algorithm to obtain the first parameter.
[0452] It should be noted that the embodiments of the present application do not limit the decoding order of the first parameter and the second parameter.
[0453] After the decoder obtains the first parameter and the second parameter (i.e., W1 to W P ), it left-shifts the first parameter by P bits to obtain a first intermediate value, and combines the first intermediate value and the second parameter (i.e., W1 to W P ) to obtain a second intermediate value; for example, the second intermediate value can be determined according to the following formula: mid2 = (V1 << P) + (W1 << P - 1) + (W2 << P - 2) + … + (WP <<0).
[0454] Among them, mid2 represents the second intermediate value, V1 represents the first parameter, V1<<P represents the first intermediate value, W1 represents the binary number at the 1st position in the decoding order of the P binary numbers and with a shift bit number of P-1, W2 represents the binary number at the 2nd position in the decoding order of the P binary numbers and with a shift bit number of P-2, and so on, W P represents the binary number at the Pth position in the decoding order of the P binary numbers and with a shift bit number of 0.
[0455] In other words, since W P <<0 is still W P , therefore, the above formula can also be described as: mid2 = (V1<<P) + (W1<<P-1) + (W2<<P-2) + … + W P .
[0456] Among them, mid2 represents the second intermediate value, V1 represents the first parameter, V1<<P represents the first intermediate value, W1 represents the binary number at the 1st position in the decoding order of the P binary numbers and with a shift bit number of P-1, W2 represents the binary number at the 2nd position in the decoding order of the P binary numbers and with a shift bit number of P-2, and so on, W P represents the binary number at the Pth position in the decoding order of the P binary numbers and with a shift bit number of 0.
[0457] After the decoder obtains the second intermediate value, it can add its value to the value of r1 to obtain the first zero run value; that is, the first zero run value is equal to the sum of the second intermediate value and the value of r1.
[0458] Taking E = 3, F = 1, G = 4, H = 2, U = 0 as an example below, an exemplary description of the implementation method for the decoder to determine the first zero run value through a for loop is as follows:
[0459] for loop (r1 = 0; r1 < 3; r1++);
[0460] Decode a bit using a fixed context (each loop uses a different fixed context);
[0461] If the bit is equal to 0, the decoder ends decoding, and the value of r1 is the first zero run value.
[0462] Otherwise, r1 = r1 + 1, and continue the loop.
[0463] for loop (r2 = 0; r2 < 4; r2++);
[0464] Decode a bit using a fixed context (a different fixed context is used in each loop);
[0465] If the bit is equal to U, the decoder directly decodes another bit, assuming it is recorded as b (i.e. 0 or 1), then r1 = r1 + b, and the value of r1 is the first zero run value;
[0466] Otherwise, r1=r1+2 and the loop continues.
[0467] Obtain the first parameter and the second parameter, and shift the first parameter left by P bits to obtain a first intermediate value, and then obtain a second intermediate value based on the first intermediate value and the second parameter. Assuming it is recorded as mid2, then r1=r1+mid2, and the value of r1 is the first zero-run value.
[0468] In short, the decoder first executes a for loop (r1=0; r1<3; r1++), and when r1<3 is not true, it executes a for loop (r2=0; r2<4; r2++); then, when r2<4 is not true, the decoder obtains the first parameter and the second parameter, and shifts the first parameter left by P bits to obtain a first intermediate value, and then obtains a second intermediate value based on the first intermediate value and the second parameter, assuming it is denoted as mid2, then r1=r1+mid2, and the value of r1 is the first zero-run value.
[0469] Assuming that P=2, the decoder may obtain the first parameter and the second parameter in the following manner, and obtain the first zero-run value based on the first parameter and the second parameter:
[0470] The second parameter is decoded using a fixed context, no context, or an adaptive context.
[0471] Specifically, the decoder can use a fixed context, no context, or an adaptive context to obtain the first binary number in the second parameter, denoted as W1, with a shift of 1. Then, using the fixed context, no context, or an adaptive context, the decoder can obtain the second binary number in the second parameter, denoted as W2, with a shift of 0. When decoding the second parameter, as an implementable solution, the decoder can first use the input corresponding parameter to select a context index to decode W1, and then use the decoded W1 and / or the input corresponding parameter to jointly select an adaptive context index to decode W2. For example, the decoder can use the decoded W1 and the input corresponding parameter to jointly select an adaptive context index to decode W2. For another example, the decoder can use the decoded W1 to select an adaptive context index to decode W2. For another example, the decoder can use the input corresponding parameter to select an adaptive context index to decode W2. The input corresponding parameter can be a fixed context index value.
[0472] In addition, the decoder also needs to use the Exponential Golomb decoding algorithm to obtain the first parameter.
[0473] It should be noted that the embodiments of this application do not limit the decoding order of the first parameter and the second parameter.
[0474] After the decoder obtains the first parameter and the second parameter (i.e., W1, W2), it shifts the first parameter to the left by P = 2 bits to obtain a first intermediate value, and combines the first intermediate value and the second parameter (i.e., W1, W2) to obtain a second intermediate value; for example, the second intermediate value can be determined according to the following formula:
[0475] mid2 = (V1 << 2) + (W1 << 1) + W2.
[0476] Where, mid2 represents the second intermediate value, V1 represents the first parameter, V1 << P represents the first intermediate value, W1 represents the binary number at the 1st position according to the decoding order of the P binary numbers and with a shift bit of 1, and W2 represents the binary number at the 2nd position according to the decoding order of the P binary numbers and with a shift bit of 0.
[0477] After the decoder obtains the second intermediate value, it can add the value of r1 to it to obtain the first zero run value; that is, the first zero run value is equal to the sum of the second intermediate value and the value of r1.
[0478] The following takes E = 3, F = 1, G = 4, H = 2, U = 0 as an example to exemplarily illustrate the implementation method of the decoder to determine the first zero run value through a for loop:
[0479] for loop (r1 = 0; r1 < 3; r1++);
[0480] Decode one bit using a fixed context (each loop uses a different fixed context);
[0481] If the bit is equal to 0, the decoder ends decoding, and the value of r1 is the first zero run value.
[0482] Otherwise, r1 = r1 + 1, and continue the loop.
[0483] for loop (r2 = 0; r2 < 4; r2++);
[0484] Decode one bit using a fixed context (each loop uses a different fixed context);
[0485] If the bit is equal to U, the decoder directly decodes another bit, assuming it is recorded as b (i.e. 0 or 1), then r1 = r1 + b, and the value of r1 is the first zero run value;
[0486] Otherwise, r1=r1+2 and the loop continues.
[0487] Obtain the first parameter and the second parameter, and shift the first parameter left by P bits to obtain a first intermediate value, and then obtain a second intermediate value based on the first intermediate value and the second parameter. Assuming it is recorded as mid2, then r1=r1+mid2, and the value of r1 is the first zero-run value.
[0488] In short, the decoder first executes a for loop (r1=0; r1<3; r1++), and when r1<3 is not true, it executes a for loop (r2=0; r2<4; r2++); then, when r2<4 is not true, the decoder obtains the first parameter and the second parameter, and shifts the first parameter left by P bits to obtain a first intermediate value, and then obtains a second intermediate value based on the first intermediate value and the second parameter, assuming it is denoted as mid2, then r1=r1+mid2, and the value of r1 is the first zero-run value.
[0489] Assuming P=1, at this time, the decoder can obtain the first parameter and the second parameter based on the following method, and obtain the first zero-run value based on the first parameter and the second parameter:
[0490] The decoder may use a fixed context, no context, or an adaptive context to obtain the first binary number in the second parameter, denoted as W1;
[0491] In addition, the decoder also needs to use the exponential Golomb decoding algorithm to obtain the first parameter.
[0492] It is worth noting that the embodiment of the present application does not limit the decoding order of the first parameter and the second parameter.
[0493] mid2=(V1<<1)+W1。
[0494] Wherein, mid2 represents the second intermediate value, V1 represents the first parameter, and W1 represents the binary number located at the first position according to the decoding order of the P binary numbers.
[0495] After obtaining the second intermediate value, the decoder may add the second intermediate value to the value of r1 to obtain the first zero-run value; that is, the first zero-run value is equal to the sum of the second intermediate value and the value of r1.
[0496] Example 2:
[0497] In this embodiment, when the decoder determines that the first zero-run value is not a value between 0 and M, it obtains a first parameter and a second parameter, and determines the first zero-run value based on the first and second parameters. Specifically, the decoder shifts the first parameter left by P bits to obtain a first intermediate value, combines the first intermediate value with the second parameter to obtain a second intermediate value, and then adds the second intermediate value to M+1 to obtain the first zero-run value; that is, the first zero-run value is equal to the sum of the second intermediate value and M+1. The second parameter is P binary numbers.
[0498] Of course, the decoder can also add the second intermediate value to the sum of the values of the M+1 flag bits (or the values of the first i flag bits in the M+1 flag bits when the value of the i-th flag bit in the M+1 flag bits is 0) to obtain the first zero-run value. For example, if the values of the M+1 flag bits are all 1, then the first zero-run value is equal to the sum of the second intermediate value and M+1 ones. Here, the second parameter is P binary numbers. For another example, if the value of the i-th flag bit in the M+1 flag bits is 0, then the first zero-run value is equal to the sum of the second intermediate value and i-1 ones.
[0499] Exemplarily, the decoder may decode the first zero-run value through the following process:
[0500] Adaptive context decoding is used to decode a flag bit to indicate whether the first zero run value is 0. If yes, then: end decoding of subsequent flag bits and determine the first zero run value to be 0; if no, then:
[0501] Adaptive context decoding is used to decode a flag bit to represent whether the first zero run value is 1. If so, then: end decoding of subsequent flag bits and determine the first zero run value as 1; and so on, until the decoded flag bit indicates that the first zero run value is equal to i-1, determine i-1 as the first zero run value and end decoding of the remaining flag bits, or, until the last flag bit of the M+1 flag bits is decoded and the last flag bit indicates that the first zero run value is not equal to M, the decoder needs to further obtain the first parameter and the second parameter, and then determine the first zero run value based on the first parameter and the second parameter.
[0502] Specifically, the second parameter is P binary numbers. The decoder can obtain the first binary number in the second parameter, denoted as W1, with a shift bit number of P - 1, by using fixed context, no context, or adaptive context; then obtain the second binary number in the second parameter, denoted as W2, with a shift bit number of P - 2, by using fixed context, no context, or adaptive context; and so on, until obtaining the last binary number in the second parameter, denoted as W P , with a shift bit number of P - P = 0, thereby obtaining the second parameter. For example, when the decoder decodes the second parameter, as an implementable solution, it can first use the corresponding input parameter to select a context index to decode W1, then use the decoded W1 and / or the corresponding input parameter to jointly select an appropriate context index to decode W2, and then use at least one of the decoded W1, the decoded W2, and the corresponding input parameter to select an appropriate context index to decode W3, and so on, until completing the decoding of W P . The corresponding input parameter can be a fixed context index value.
[0503] In addition, the decoder also needs to use the Exponential Golomb decoding algorithm to obtain the first parameter.
[0504] It should be noted that the present application embodiment does not limit the decoding order of the first parameter and the second parameter.
[0505] After the decoder obtains the first parameter and the second parameter (i.e., W1 to W P ), it shifts the first parameter left by P bits to obtain a first intermediate value, and combines the first intermediate value and the second parameter (i.e., W1 to W P ) to obtain a second intermediate value; for example, the second intermediate value can be determined according to the following formula: mid2 = (V1 << P) + (W1 << P - 1) + (W2 << P - 2) + … + (W P << 0).
[0506] Where, mid2 represents the second intermediate value, V1 represents the first parameter, V1 << P represents the first intermediate value, W1 represents the binary number at the 1st position in the decoding order of the P binary numbers and with a shift bit number of P - 1, W2 represents the binary number at the 2nd position in the decoding order of the P binary numbers and with a shift bit number of P - 2, and so on, W P represents the binary number at the Pth position in the decoding order of the P binary numbers and with a shift bit number of 0.
[0507] In other words, since W P << 0 is still WP , therefore, the above formula can also be described as: mid2 = (V1 << P) + (W1 << P - 1) + (W2 << P - 2) + … + W P .
[0508] Among them, mid2 represents the second intermediate value, V1 represents the first parameter, V1 << P represents the first intermediate value, W1 represents the binary number in the 1st position according to the decoding order of the P binary numbers and with a shift number of P - 1, W2 represents the binary number in the 2nd position according to the decoding order of the P binary numbers and with a shift number of P - 2, and so on, W P represents the binary number in the Pth position according to the decoding order of the P binary numbers and with a shift number of 0.
[0509] After the decoder obtains the second intermediate value, it can add the second intermediate value to M + 1 to obtain the first zero run value; that is, the first zero run value is equal to the sum of the second intermediate value and M + 1. Of course, the decoder can also add the sum of the second intermediate value and the values of M + 1 flag bits to obtain the first zero run value. For example, if the values of the M + 1 flag bits are all 1, then the first zero run value is equal to the sum of the second intermediate value and M + 1 1s.
[0510] The following uses M = 3, P = 2 as an example to illustrate this decoding method:
[0511] Using adaptive context to decode a flag bit represents whether the first zero run value is 0. If so, then: end the decoding of subsequent flag bits and determine the first zero run value as 0; if not, then:
[0512] Using adaptive context to decode a flag bit represents whether the first zero run value is 1. If so, then: end the decoding of subsequent flag bits and determine the first zero run value as 1; if not, then:
[0513] Using adaptive context to decode a flag bit represents whether the first zero run value is 2. If so, then: end the decoding of subsequent flag bits and determine the first zero run value as 2; if not, then:
[0514] Using adaptive context to decode a flag bit represents whether the first zero run value is 3. If so, then: end the decoding of subsequent flag bits and determine the first zero run value as 3; if not, then:
[0515] Decode the second parameter using fixed context, without using context, or adaptive context.
[0516] Assume P = 2. The decoder can obtain the first binary number in the second parameter, denoted as W1, with a shift bit number of 1, by using fixed context, no context, or adaptive context; then obtain the second binary number in the second parameter, denoted as W2, with a shift bit number of 0, by using fixed context, no context, or adaptive context. When the decoder decodes the second parameter, as an implementable solution, it can first use the corresponding input parameter to select a context index to decode W1, and then use the already decoded W1 and / or the corresponding input parameter to jointly select an adaptive context index to decode W2. For example, the decoder can jointly use the already decoded W1 and the corresponding input parameter to select an adaptive context index to decode W2. Another example is that the decoder can use the already decoded W1 to select an adaptive context index to decode W2. Another example is that the decoder can use the corresponding input parameter to select an adaptive context index to decode W2. The corresponding input parameter can be a fixed context index value.
[0517] In addition, the decoder also needs to use the Exponential Golomb decoding algorithm to obtain the first parameter.
[0518] It should be noted that the embodiments of the present application do not limit the decoding order of the first parameter and the second parameter.
[0519] After the decoder obtains the first parameter and the second parameter (i.e., W1, W2), it shifts the first parameter left by P = 2 bits to obtain a first intermediate value, and combines the first intermediate value and the second parameter (i.e., W1, W2) to obtain a second intermediate value; for example, the second intermediate value can be determined according to the following formula: mid2 = (V1 << 2) + (W1 << 1) + W2.
[0520] Where, mid2 represents the second intermediate value, V1 represents the first parameter, V1 << P represents the first intermediate value, W1 represents the binary number in the first position according to the decoding order of the P binary numbers and with a shift bit number of 1, and W0 represents the binary number in the second position according to the decoding order of the P binary numbers and with a shift bit number of zero.
[0521] After the decoder obtains the second intermediate value, it can add the second intermediate value to M + 1 (i.e., 4) to obtain the first zero run value; that is, the first zero run value is equal to the sum of the second intermediate value and 4. Of course, the decoder can also add the second intermediate value to the sum of the values of these 4 flag bits to obtain the first zero run value. For example, if the values of these 4 flag bits are all ¹, the first zero run value is equal to the sum of the second intermediate value and the sum of 4 ¹s.
[0522] The following takes M = 3, P = 1 as an example to illustrate the decoding method:
[0523] Adaptive context decoding is used to decode a flag bit to indicate whether the first zero run value is 0. If yes, then: end decoding of subsequent flag bits and determine the first zero run value to be 0; if no, then:
[0524] Adaptive context decoding is used to decode a flag bit to indicate whether the first zero run value is 1. If yes, then: end decoding of subsequent flag bits and determine the first zero run value to be 1; if not, then:
[0525] Adaptive context decoding is used to decode a flag bit to indicate whether the first zero run value is 2. If yes, then: end decoding of subsequent flag bits and determine the first zero run value to be 2; if no, then:
[0526] Adaptive context decoding is used to decode a flag bit to indicate whether the first zero run value is 3. If yes, then: end decoding of subsequent flag bits and determine the first zero run value to be 3; if no, then:
[0527] The second parameter is decoded using a fixed context, no context, or an adaptive context.
[0528] Assuming P=1, the decoder can use a fixed context, no context, or an adaptive context to obtain the first binary number in the second parameter, denoted as W1;
[0529] In addition, the decoder also needs to use the exponential Golomb decoding algorithm to obtain the first parameter.
[0530] It is worth noting that the embodiment of the present application does not limit the decoding order of the first parameter and the second parameter. mid2 = (V1<<1) + W1.
[0531] Wherein, mid2 represents the second intermediate value, V1 represents the first parameter, and W1 represents the binary number located at the first position according to the decoding order of the P binary numbers.
[0532] After obtaining the second intermediate value, the decoder can add the second intermediate value to M+1 (i.e., 4) to obtain the first zero-run value; that is, the first zero-run value is equal to the sum of the second intermediate value and 4. Of course, the decoder can also add the second intermediate value to the sum of the values of the four flag bits to obtain the first zero-run value. For example, if the values of the four flag bits are all 1, then the first zero-run value is equal to the sum of the second intermediate value and four 1s.
[0533] The following takes M=1, P=2 as an example to illustrate the decoding method:
[0534] Decode a flag bit using adaptive context to represent whether the first zero run value is 0. If so, end decoding of subsequent flag bits and determine the first zero run value as 0; if not, then:
[0535] Decode a flag bit using adaptive context to represent whether the first zero run value is 1. If so, end decoding of subsequent flag bits and determine the first zero run value as 1; if not, then:
[0536] Decode the second parameter using fixed context, no context, or adaptive context.
[0537] Assume P = 2. The decoder can use fixed context, no context, or adaptive context to obtain the first binary number in the second parameter, denoted as W1, with a shift bit of 1; then use fixed context, no context, or adaptive context to obtain the second binary number in the second parameter, denoted as W2, with a shift bit of 0. When the decoder decodes the second parameter, as an implementable solution, it can first use the corresponding input parameter to select a context index to decode W1, and then use the already decoded W1 and / or the corresponding input parameter to jointly select an appropriate context index to decode W2. For example, the decoder can jointly use the already decoded W1 and the corresponding input parameter to select an appropriate context index to decode W2. Another example, the decoder can use the already decoded W1 to select an appropriate context index to decode W2. Another example, the decoder can use the corresponding input parameter to select an appropriate context index to decode W2. The corresponding input parameter can be a fixed context index value.
[0538] In addition, the decoder also needs to use the Exponential Golomb decoding algorithm to obtain the first parameter.
[0539] It should be noted that the embodiments of the present application do not limit the decoding order of the first parameter and the second parameter.
[0540] After the decoder obtains the first parameter and the second parameter (i.e., W1, W2), shift the first parameter left by P = 2 bits to obtain a first intermediate value, and combine the first intermediate value and the second parameter (i.e., W1, W2) to obtain a second intermediate value; for example, the second intermediate value can be determined according to the following formula: mid2 = (V1 << 2)+(W1 << 1)+W2.
[0541] Where, mid2 represents the second intermediate value, V1 represents the first parameter, V1 << P represents the first intermediate value, W1 represents the binary number at the 1st position in the decoding order of the P binary numbers and with a shift bit of 1, and W2 represents the binary number at the 2nd position in the decoding order of the P binary numbers and with a shift bit of 0.
[0542] After obtaining the second intermediate value, the decoder can add the second intermediate value to M+1 (i.e., 2) to obtain the first zero-run value; that is, the first zero-run value is equal to the sum of the second intermediate value and 2. Of course, the decoder can also add the second intermediate value to the sum of the values of the two flag bits to obtain the first zero-run value. For example, if the values of the two flag bits are both 1, then the first zero-run value is equal to the sum of the second intermediate value and two 1s.
[0543] The following takes M=1, P=1 as an example to illustrate the decoding method:
[0544] Adaptive context decoding is used to decode a flag bit to indicate whether the first zero run value is 0. If yes, then: end decoding of subsequent flag bits and determine the first zero run value to be 0; if no, then:
[0545] Adaptive context decoding is used to decode a flag bit to indicate whether the first zero run value is 1. If yes, then: end decoding of subsequent flag bits and determine the first zero run value to be 1; if not, then:
[0546] The second parameter is decoded using a fixed context, no context, or an adaptive context.
[0547] Assuming P=1, the decoder can use a fixed context, no context, or an adaptive context to obtain the first binary number in the second parameter, denoted as W1;
[0548] In addition, the decoder also needs to use the exponential Golomb decoding algorithm to obtain the first parameter.
[0549] It is worth noting that the embodiment of the present application does not limit the decoding order of the first parameter and the second parameter. mid2 = (V1<<1) + W1.
[0550] Wherein, mid2 represents the second intermediate value, V1 represents the first parameter, and W1 represents the binary number located at the first position according to the decoding order of the P binary numbers.
[0551] After obtaining the second intermediate value, the decoder can add the second intermediate value to M+1 (i.e., 2) to obtain the first zero-run value; that is, the first zero-run value is equal to the sum of the second intermediate value and 2. Of course, the decoder can also add the second intermediate value to the sum of the values of the two flag bits to obtain the first zero-run value. For example, if the values of the two flag bits are both 1, then the first zero-run value is equal to the sum of the second intermediate value and two 1s.
[0552] Example 3:
[0553] In this embodiment, when the decoder determines that the first zero-run value is not a value between 0 and M, it obtains a first parameter and a second parameter, and determines the first zero-run value based on the first parameter and the second parameter. Specifically, the decoder shifts the first parameter left by P bits to obtain a first intermediate value, combines the first intermediate value with the second parameter to obtain a second intermediate value, and then directly determines the second intermediate value as the first zero-run value. The second parameter may be P binary numbers.
[0554] Exemplarily, the decoder may decode the first zero-run value through the following process:
[0555] Adaptive context decoding is used to decode a flag bit to indicate whether the first zero run value is 0. If yes, then: end decoding of subsequent flag bits and determine the first zero run value to be 0; if no, then:
[0556] Adaptive context decoding is used to decode a flag bit to represent whether the first zero run value is 1. If so, then: end decoding of subsequent flag bits and determine the first zero run value as 1; and so on, until the decoded flag bit indicates that the first zero run value is equal to i-1, determine i-1 as the first zero run value and end decoding of the remaining flag bits, or, until the last flag bit of the M+1 flag bits is decoded and the last flag bit indicates that the first zero run value is not equal to M, the decoder needs to further obtain the first parameter and the second parameter, and then determine the first zero run value based on the first parameter and the second parameter.
[0557] Specifically, the second parameter is P binary numbers. The decoder can use a fixed context, no context, or an adaptive context to obtain the first binary number in the second parameter, which is recorded as W1, and the number of shifts is P-1; then use a fixed context, no context, or an adaptive context to obtain the second binary number in the second parameter, which is recorded as W2, and the number of shifts is P-2; and so on, until the last binary number in the second parameter is obtained using a fixed context, no context, or an adaptive context, which is recorded as W P , the shift bit is PP=0, thereby obtaining the second parameter. For example, when the decoder decodes the second parameter, as an achievable solution, it can first use the input corresponding parameter to select the context index to decode W1, then use the decoded W1 and the input corresponding parameter to jointly select the adapted context index to decode W2, and then use the decoded W1, the decoded W2 and the input corresponding parameter to jointly select the adapted context index to decode W3, and so on, until the decoding of W is completed. P The corresponding input parameter may be a fixed context index value.
[0558] In addition, the decoder also needs to use the Exponential Golomb decoding algorithm to obtain the first parameter.
[0559] It should be noted that the embodiments of this application do not limit the decoding order of the first parameter and the second parameter.
[0560] After the decoder obtains the first parameter and the second parameter (i.e., W1 to W P ), it shifts the first parameter to the left by P bits to obtain a first intermediate value, and combines the first intermediate value and the second parameter (i.e., W1 to W P ) to obtain a second intermediate value; for example, the second intermediate value can be determined according to the following formula:
[0561] mid2 = (V1 << P) + (W1 << P - 1) + (W2 << P - 2) + … + (W P << 0).
[0562] Among them, mid2 represents the second intermediate value, V1 represents the first parameter, V1 << P represents the first intermediate value, W1 represents the binary number in the first position according to the decoding order of the P binary numbers and with a shift number of P - 1, W2 represents the binary number in the second position according to the decoding order of the P binary numbers and with a shift number of P - 2, and so on, W P represents the binary number in the Pth position according to the decoding order of the P binary numbers and with a shift number of 0.
[0563] In other words, since W P << 0 is still W P , therefore, the above formula can also be described as: mid2 = (V1 << P) + (W1 << P - 1) + (W2 << P - 2) + … + W P。
[0564] Among them, mid2 represents the second intermediate value, V1 represents the first parameter, V1 << P represents the first intermediate value, W1 represents the binary number in the first position according to the decoding order of the P binary numbers and with a shift number of P - 1, W2 represents the binary number in the second position according to the decoding order of the P binary numbers and with a shift number of P - 2, and so on, W P represents the binary number in the Pth position according to the decoding order of the P binary numbers and with a shift number of 0.
[0565] After the decoder obtains the second intermediate value, it can directly determine the second intermediate value as the first zero run value.
[0566] The following takes M = 3 and P = 2 as an example to illustrate the decoding method:
[0567] Adaptive context decoding is used to decode a flag bit to indicate whether the first zero run value is 0. If yes, then: end decoding of subsequent flag bits and determine the first zero run value to be 0; if no, then:
[0568] Adaptive context decoding is used to decode a flag bit to indicate whether the first zero run value is 1. If yes, then: end decoding of subsequent flag bits and determine the first zero run value to be 1; if not, then:
[0569] Adaptive context decoding is used to decode a flag bit to indicate whether the first zero run value is 2. If yes, then: end decoding of subsequent flag bits and determine the first zero run value to be 2; if no, then:
[0570] Adaptive context decoding is used to decode a flag bit to indicate whether the first zero run value is 3. If yes, then: end decoding of subsequent flag bits and determine the first zero run value to be 3; if no, then:
[0571] The second parameter is decoded using a fixed context, no context, or an adaptive context.
[0572] Assuming P = 2, the decoder can use a fixed context, no context, or an adaptive context to obtain the first binary number in the second parameter, denoted as W1, with a shift of 1. Then, using a fixed context, no context, or an adaptive context, the decoder can obtain the second binary number in the second parameter, denoted as W2, with a shift of 0. When decoding the second parameter, as an implementable solution, the decoder can first use the input corresponding parameter to select a context index to decode W1, and then use the decoded W1 and / or the input corresponding parameter to jointly select an adaptive context index to decode W2. For example, the decoder can use the decoded W1 and the input corresponding parameter to jointly select an adaptive context index to decode W2. For another example, the decoder can use the decoded W1 to select an adaptive context index to decode W2. For another example, the decoder can use the input corresponding parameter to select an adaptive context index to decode W2. The input corresponding parameter can be a fixed context index value.
[0573] In addition, the decoder also needs to use the exponential Golomb decoding algorithm to obtain the first parameter.
[0574] It is worth noting that the embodiment of the present application does not limit the decoding order of the first parameter and the second parameter.
[0575] After the decoder obtains the first parameter and the second parameter (i.e., W1, W2), it shifts the first parameter left by P = 2 bits to obtain a first intermediate value, and combines the first intermediate value and the second parameter (i.e., W1, W2) to obtain a second intermediate value; for example, the second intermediate value can be determined according to the following formula: mid2 = (V1 << 2) + (W1 << 1) + W2.
[0576] Among them, mid2 represents the second intermediate value, V1 represents the first parameter, V1 << P represents the first intermediate value, W1 represents the binary number in the first position according to the decoding order of the P binary numbers and with a shift number of 1, and W0 represents the binary number in the second position according to the decoding order of the P binary numbers and with a shift number of 0.
[0577] After the decoder obtains the second intermediate value, it can directly use the second intermediate value as the first zero run value.
[0578] The following uses M = 3, P = 1 as an example to illustrate this decoding method:
[0579] Use adaptive context to decode a flag bit to represent whether the first zero run value is 0. If so, end the decoding of the subsequent flag bits and determine the first zero run value as 0; if not, then:
[0580] Use adaptive context to decode a flag bit to represent whether the first zero run value is 1. If so, end the decoding of the subsequent flag bits and determine the first zero run value as 1; if not, then:
[0581] Use adaptive context to decode a flag bit to represent whether the first zero run value is 2. If so, end the decoding of the subsequent flag bits and determine the first zero run value as 2; if not, then:
[0582] Use adaptive context to decode a flag bit to represent whether the first zero run value is 3. If so, end the decoding of the subsequent flag bits and determine the first zero run value as 3; if not, then:
[0583] Decode the second parameter using fixed context, no context, or adaptive context.
[0584] Assume P = 1. The decoder can use fixed context, no context, or adaptive context to obtain the first binary number in the second parameter, denoted as W1;
[0585] In addition, the decoder also needs to use the exponential Golomb decoding algorithm to obtain the first parameter.
[0586] It is worth noting that the embodiment of the present application does not limit the decoding order of the first parameter and the second parameter. mid2 = (V1<<1) + W1.
[0587] Wherein, mid2 represents the second intermediate value, V1 represents the first parameter, and W1 represents the binary number located at the first position according to the decoding order of the P binary numbers.
[0588] After obtaining the second intermediate value, the decoder may directly use the second intermediate value as the first zero-run value.
[0589] The following takes M=1, P=2 as an example to illustrate the decoding method:
[0590] Adaptive context decoding is used to decode a flag bit to indicate whether the first zero run value is 0. If yes, then: end decoding of subsequent flag bits and determine the first zero run value to be 0; if no, then:
[0591] Adaptive context decoding is used to decode a flag bit to indicate whether the first zero run value is 1. If yes, then: end decoding of subsequent flag bits and determine the first zero run value to be 1; if not, then:
[0592] The second parameter is decoded using a fixed context, no context, or an adaptive context.
[0593] Assuming P = 2, the decoder can use a fixed context, no context, or an adaptive context to obtain the first binary number in the second parameter, denoted as W1, with a shift of 1. Then, using a fixed context, no context, or an adaptive context, the decoder can obtain the second binary number in the second parameter, denoted as W2, with a shift of 0. When decoding the second parameter, as an implementable solution, the decoder can first use the input corresponding parameter to select a context index to decode W1, and then use the decoded W1 and / or the input corresponding parameter to jointly select an adaptive context index to decode W2. For example, the decoder can use the decoded W1 and the input corresponding parameter to jointly select an adaptive context index to decode W2. For another example, the decoder can use the decoded W1 to select an adaptive context index to decode W2. For another example, the decoder can use the input corresponding parameter to select an adaptive context index to decode W2. The input corresponding parameter can be a fixed context index value.
[0594] In addition, the decoder also needs to use the exponential Golomb decoding algorithm to obtain the first parameter.
[0595] It is worth noting that the embodiment of the present application does not limit the decoding order of the first parameter and the second parameter.
[0596] After obtaining the first parameter and the second parameter (i.e., W1, W2), the decoder shifts the first parameter left by P = 2 bits to obtain a first intermediate value, and combines the first intermediate value and the second parameter (i.e., W1, W2) to obtain a second intermediate value; for example, the second intermediate value can be determined according to the following formula: mid2 = (V1 << 2)+(W1 << 1)+W2.
[0597] Where, mid2 represents the second intermediate value, V1 represents the first parameter, V1 << P represents the first intermediate value, W1 represents the binary number located at the first position and with a shift bit of 1 in the decoding order of the P binary numbers, and W2 represents the binary number located at the second position and with a shift bit of 0 in the decoding order of the P binary numbers.
[0598] After obtaining the second intermediate value, the decoder can directly use the second intermediate value as the first zero run value.
[0599] The following takes M = 1, P = 1 as an example to illustrate the decoding method:
[0600] Use adaptive context to decode a flag bit representing whether the first zero run value is 0. If so, end the decoding of subsequent flag bits and determine the first zero run value as 0; if not, then:
[0601] Use adaptive context to decode a flag bit representing whether the first zero run value is 1. If so, end the decoding of subsequent flag bits and determine the first zero run value as 1; if not, then:
[0602] Decode the second parameter using fixed context, no context, or adaptive context.
[0603] Assume P = 1. The decoder can use fixed context, no context, or adaptive context to obtain the first binary number in the second parameter, denoted as W1;
[0604] In addition, the decoder also needs to use the exponential Golomb decoding algorithm to obtain the first parameter.
[0605] It should be noted that the embodiments of the present application do not limit the decoding order of the first parameter and the second parameter. mid2 = (V1 << 1)+W1.
[0606] Where, mid2 represents the second intermediate value, V1 represents the first parameter, and W1 represents the binary number located at the first position in the decoding order of the P binary numbers.
[0607] After obtaining the second intermediate value, the decoder can directly use the second intermediate value as the first zero run value.
[0608] It is worth noting that when the decoder obtains the second intermediate value and directly uses the second intermediate value as the first zero-run value, in other alternative embodiments, the decoder may not need to obtain the M+1 flag bits mentioned above (i.e., not use the M+1 flag bits). The following is an exemplary explanation using P=1 and P=2:
[0609] The following describes the decoding method by taking the case where M+1 flag bits are not used and P=1 as an example:
[0610] Assuming P=1, the decoder can use a fixed context, no context, or an adaptive context to obtain the first binary number in the second parameter, denoted as W1;
[0611] In addition, the decoder also needs to use the exponential Golomb decoding algorithm to obtain the first parameter.
[0612] It is worth noting that the embodiment of the present application does not limit the decoding order of the first parameter and the second parameter. mid2 = (V1<<1) + W1.
[0613] Wherein, mid2 represents the second intermediate value, V1 represents the first parameter, and W1 represents the binary number located at the first position according to the decoding order of the P binary numbers.
[0614] After obtaining the second intermediate value, the decoder may directly use the second intermediate value as the first zero-run value.
[0615] The following describes the decoding method by taking the case where M+1 flag bits are not used and P=2 as an example:
[0616] The second parameter is decoded using a fixed context, no context, or an adaptive context.
[0617] Assuming P = 2, the decoder can use a fixed context, no context, or an adaptive context to obtain the first binary number in the second parameter, denoted as W1, with a shift of 1. Then, using a fixed context, no context, or an adaptive context, the decoder can obtain the second binary number in the second parameter, denoted as W2, with a shift of 0. When decoding the second parameter, as an implementable solution, the decoder can first use the input corresponding parameter to select a context index to decode W1, and then use the decoded W1 and / or the input corresponding parameter to jointly select an adaptive context index to decode W2. For example, the decoder can use the decoded W1 and the input corresponding parameter to jointly select an adaptive context index to decode W2. For another example, the decoder can use the decoded W1 to select an adaptive context index to decode W2. For another example, the decoder can use the input corresponding parameter to select an adaptive context index to decode W2. The input corresponding parameter can be a fixed context index value.
[0618] In addition, the decoder also needs to use the exponential Golomb decoding algorithm to obtain the first parameter.
[0619] It should be noted that the decoding order of the first parameter and the second parameter in the embodiments of the present application is not limited.
[0620] After the decoder obtains the first parameter and the second parameter (i.e., W1, W2), it shifts the first parameter to the left by P = 2 bits to obtain a first intermediate value, and combines the first intermediate value and the second parameter (i.e., W1, W2) to obtain a second intermediate value; for example, the second intermediate value can be determined according to the following formula: mid2 = (V1 << 2)+(W1 << 1)+W2.
[0621] Among them, mid2 represents the second intermediate value, V1 represents the first parameter, V1 << P represents the first intermediate value, W1 represents the binary number at the first position in the decoding order of the P binary numbers and with a shift bit of 1, and W2 represents the binary number at the second position in the decoding order of the P binary numbers and with a shift bit of 0.
[0622] After the decoder obtains the second intermediate value, it can directly use the second intermediate value as the first zero run value.
[0623] Embodiment 4:
[0624] In this embodiment, when the decoder determines that the first zero run value is not a value in 0 to M, it obtains the first parameter and the second parameter, and determines the first zero run value based on the first parameter and the second parameter. Specifically, the decoder shifts the first parameter to the left by P bits to obtain a first intermediate value, adds the first intermediate value and the second parameter to obtain a second intermediate value, and then can add the second intermediate value to M + 1 to obtain the first zero run value; that is, the first zero run value is equal to the sum of the second intermediate value and M + 1. Among them, the second parameter is a P-bit binary number.
[0625] Of course, the decoder can also add the sum of the second intermediate value and the value of the M + 1 flag bits (or the value of the first i flag bits when the value of the i-th flag bit in the M + 1 flag bits is 0) to obtain the first zero run value. For example, if the values of the M + 1 flag bits are all 1, then the first zero run value is equal to the sum of the second intermediate value and M + 1 1s. Among them, the second parameter is P binary numbers. Again, if the value of the i-th flag bit in the M + 1 flag bits is 0, then the first zero run value is equal to the sum of the second intermediate value and i - 1 1s.
[0626] Exemplarily, the decoder can decode the first zero run value through the following process:
[0627] Decode a flag bit using adaptive context to represent whether the first zero run value is 0. If so, end decoding of subsequent flag bits and determine the first zero run value as 0. If not, then:
[0628] Decode a flag bit using adaptive context to represent whether the first zero run value is 1. If so, end decoding of subsequent flag bits and determine the first zero run value as 1, and so on, until the decoded flag bit indicates that the first zero run value is equal to i - 1, then determine i - 1 as the first zero run value and end decoding of the remaining flag bits, or until the last flag bit among the M + 1 flag bits is decoded and the last flag bit indicates that the first zero run value is not equal to M, the decoder needs to further obtain the first parameter and the second parameter, and determine the first zero run value based on the first parameter and the second parameter.
[0629] Specifically, the second parameter is a P-bit binary number, and the decoder can obtain the P-bit binary number by using fixed context, without using context, or adaptive context.
[0630] It should be noted that the decoding order of the first parameter and the second parameter in the embodiments of this application is not limited.
[0631] After the decoder obtains the first parameter and the second parameter (i.e., the P-bit binary number), shift the first parameter to the left by P bits to obtain a first intermediate value, and combine the first intermediate value and the second parameter (i.e., the P-bit binary number) to obtain a second intermediate value. For example, the second intermediate value can be determined according to the following formula:
[0632] mid2 = (V1 << P) + P-bit binary number.
[0633] Where, mid2 represents the second intermediate value, V1 represents the first parameter, and V1 << P represents the first intermediate value.
[0634] After the decoder obtains the second intermediate value, it can add the second intermediate value to M + 1 to obtain the first zero run value, that is, the first zero run value is equal to the sum of the second intermediate value and M + 1. Of course, the decoder can also add the sum of the second intermediate value and the values of the M + 1 flag bits to obtain the first zero run value. For example, if the values of the M + 1 flag bits are all 1, then the first zero run value is equal to the sum of the second intermediate value and M + 1 1s.
[0635] The following takes M = 3 and P = 2 as an example to illustrate the decoding method:
[0636] Decode a flag bit using adaptive context to represent whether the first zero run value is 0. If so, end decoding of subsequent flag bits and determine the first zero run value as 0. If not, then:
[0637] Decode a flag bit using adaptive context to represent whether the first zero run value is 1. If so, end decoding of subsequent flag bits and determine the first zero run value as 1. If not, then:
[0638] Decode a flag bit using adaptive context to represent whether the first zero run value is 2. If so, end decoding of subsequent flag bits and determine the first zero run value as 2. If not, then:
[0639] Decode a flag bit using adaptive context to represent whether the first zero run value is 3. If so, end decoding of subsequent flag bits and determine the first zero run value as 3. If not, then:
[0640] Decode the second parameter using fixed context, no context, or adaptive context.
[0641] Assume P = 2. The decoder can obtain the second parameter, denoted as W1W2, using fixed context, no context, or adaptive context.
[0642] In addition, the decoder also needs to obtain the first parameter using the Exponential Golomb decoding algorithm.
[0643] It should be noted that the decoding order of the first parameter and the second parameter in the embodiments of this application is not limited.
[0644] After the decoder obtains the first parameter and the second parameter (i.e., W1W2), shift the first parameter left by P = 2 bits to obtain the first intermediate value, and combine the first intermediate value and the second parameter (i.e., W1W2) to obtain the second intermediate value. For example, the second intermediate value can be determined according to the following formula: mid2 = (V1 << 2) + W1W2.
[0645] Where, mid2 represents the second intermediate value, V1 represents the first parameter, V1 << P represents the first intermediate value, and W1W2 represents the second parameter.
[0646] After the decoder obtains the second intermediate value, it can add the second intermediate value to M + 1 (i.e., 4) to obtain the first zero run value. That is, the first zero run value is equal to the sum of the second intermediate value and 4. Of course, the decoder can also add the second intermediate value to the sum of the values of 4 flag bits to obtain the first zero run value. For example, if the values of the 4 flag bits are all 1, the first zero run value is equal to the sum of the second intermediate value and 4 1s.
[0647] Example 5:
[0648] In this embodiment, when the decoder determines that the first zero run value is not a value in the range of 0 to M, it obtains the first parameter and the second parameter, and determines the first zero run value based on the first parameter and the second parameter. Specifically, the decoder left-shifts the first parameter by P bits to obtain a first intermediate value, adds the first intermediate value and the second parameter to obtain a second intermediate value, and then may determine the second intermediate value as the first zero run value. Here, the second parameter is a P-bit binary number.
[0649] Exemplarily, the decoder can decode the first zero run value through the following process:
[0650] Use adaptive context to decode a flag bit representing whether the first zero run value is 0. If so, end the decoding of subsequent flag bits and determine the first zero run value as 0; if not, then:
[0651] Use adaptive context to decode a flag bit representing whether the first zero run value is 1. If so, end the decoding of subsequent flag bits and determine the first zero run value as 1; and so on, until the decoded flag bit indicates that the first zero run value is equal to i - 1, then determine i - 1 as the first zero run value and end the decoding of the remaining flag bits, or until the last flag bit among the M + 1 flag bits is decoded and the last flag bit indicates that the first zero run value is not M, the decoder needs to further obtain the first parameter and the second parameter, and determine the first zero run value based on the first parameter and the second parameter.
[0652] Specifically, the second parameter is a P-bit binary number, and the decoder can obtain the P-bit binary number by using fixed context, not using context, or adaptive context.
[0653] It should be noted that the present application embodiment does not limit the decoding order of the first parameter and the second parameter.
[0654] After the decoder obtains the first parameter and the second parameter (i.e., the P-bit binary number), it left-shifts the first parameter by P bits to obtain a first intermediate value, and combines the first intermediate value and the second parameter (i.e., the P-bit binary number) to obtain a second intermediate value; for example, the second intermediate value can be determined according to the following formula:
[0655] mid2 = (V1 << P) + P-bit binary number.
[0656] Here, mid2 represents the second intermediate value, V1 represents the first parameter, and V1 << P represents the first intermediate value.
[0657] After the decoder obtains the second intermediate value, it can directly use this second intermediate value as the first zero run value.
[0658] The following uses M = 3 and P = 2 as examples to illustrate this decoding method:
[0659] Use adaptive context to decode a flag bit representing whether the first zero run value is 0. If so, then: end the decoding of subsequent flag bits and determine the first zero run value as 0; if not, then:
[0660] Use adaptive context to decode a flag bit representing whether the first zero run value is 1. If so, then: end the decoding of subsequent flag bits and determine the first zero run value as 1; if not, then:
[0661] Use adaptive context to decode a flag bit representing whether the first zero run value is 2. If so, then: end the decoding of subsequent flag bits and determine the first zero run value as 2; if not, then:
[0662] Use adaptive context to decode a flag bit representing whether the first zero run value is 3. If so, then: end the decoding of subsequent flag bits and determine the first zero run value as 3; if not, then:
[0663] Decode the second parameter using fixed context, no context, or adaptive context.
[0664] Assume P = 2. The decoder can use fixed context, no context, or adaptive context to obtain this second parameter, denoted as W1W2.
[0665] In addition, the decoder also needs to use the exponential Golomb decoding algorithm to obtain the first parameter.
[0666] It should be noted that the embodiments of this application do not limit the decoding order of the first parameter and the second parameter.
[0667] After the decoder obtains the first parameter and the second parameter (i.e., W1W2), it shifts the first parameter left by P = 2 bits to obtain a first intermediate value, and combines this first intermediate value and the second parameter (i.e., W1W2) to obtain a second intermediate value; for example, this second intermediate value can be determined according to the following formula: mid2 = (V1 << 2) + W1W2.
[0668] Where, mid2 represents this second intermediate value, V1 represents the first parameter, V1 << P represents the first intermediate value, and W1W2 represents the second parameter.
[0669] After the decoder obtains the second intermediate value, it can directly use this second intermediate value as the first zero run value.
[0670] It should be understood that the above embodiments are only examples of the present application and should not be construed as limitations on the present application. For example, in other alternative embodiments, the decoder can determine the first zero run value through a for loop and M + 1 flag bits. In one implementation, the decoder can use a for loop (r1 = 0; r1 < E; r1++), a for loop (r2 = 0; r2 < G; r2++), and the M + 1 flag bits to determine the first zero run value. Specifically, when r1 < E does not hold, the decoder executes the for loop (r2 = 0; r2 < G; r2++), and when r2 < G does not hold, the decoder determines whether the second intermediate value involved above is a value from 0 to M. When the second intermediate value is a value from 0 to M, the decoder does not need to obtain the first parameter and the second parameter and can directly assign the sum of the value of r1 and the second intermediate value to the first zero run value; when the second intermediate value is not a value from 0 to M, the decoder obtains the first parameter and the second parameter, combines the first parameter shifted left by P bits with the second parameter, then determines the sum of the combined value and M + 1 as the second intermediate value, and then assigns the sum of the value of r1 and the second intermediate value to the first zero run value.
[0671] The decoding method according to the embodiments of the present application has been described in detail from the perspective of the decoder above. Next, the encoding method according to the embodiments of the present application will be described from the perspective of the encoder in conjunction with FIG. 9.
[0672] FIG. 9 is a schematic flowchart of an encoding method 200 provided by an embodiment of the present application. It should be understood that the encoding method 200 can be executed by an encoder. For example, it is applied to the encoding frameworks shown in FIGS. 4 or 6. For ease of description, the encoding method 200 will be exemplarily described below taking the encoder as an example.
[0673] As shown in FIG. 9, the encoding method 200 may include:
[0674] S210, obtaining the first zero run value;
[0675] S220, determining the first parameter and the second parameter based on the first zero run value;
[0676] S230, encoding the first parameter and the second parameter.
[0677] In some embodiments, S220 may include:
[0678] Subtracting O from the first zero run value to obtain a third intermediate value; O is a positive integer;
[0679] Determining the first parameter and the second parameter based on the third intermediate value.
[0680] In some embodiments, if the first zero-run value is greater than or equal to E×F+G×H, a difference between the first zero-run value and E×F+G×H is determined as the third intermediate value;
[0681] Among them, E, F, H, and G are all positive integers.
[0682] In some embodiments, before S210, the method 200 may further include:
[0683] Get the value of the third variable;
[0684] If the value of the third variable is less than the first minimum value, a binary number having a value of V is encoded using a fixed context, and L is added to the value of the third variable;
[0685] The first minimum value is the minimum value of the first zero-run value and E, and L is a positive integer.
[0686] In some embodiments, the method 200 may further include:
[0687] If the first zero-run value is less than E×F, a binary number with a value of U is encoded using a fixed context; U is not equal to V.
[0688] In some embodiments, the method 200 may further include:
[0689] If the first zero-run value is greater than or equal to E×F, the value obtained by subtracting E×F from the first zero-run value is divided by H to obtain a first quotient value;
[0690] Determine the value of the fourth variable;
[0691] If the value of the fourth variable is less than the second minimum value, a binary number having a value of V is encoded using a fixed context, and L is added to the current value of the fourth variable;
[0692] The second minimum value is the minimum value of the first quotient and G.
[0693] In some embodiments, the method 200 may further include:
[0694] If the first zero-run value is less than E×F+G×H, a binary number having a value of U is encoded using a fixed context, and a remainder of the first quotient is encoded.
[0695] In some embodiments, it is determined whether the first zero-run value is a value between 0 and M; M is a positive integer; if the first zero-run value is not a value between 0 and M, the difference between the first zero-run value and M+1 is determined as the third intermediate value.
[0696] In some embodiments, determining an i-th flag bit among the M+1 flag bits;
[0697] The value of the i-th flag bit indicates whether the first zero-run value is equal to i-1, and the values of the first i-1 flag bits in the M+1 flag bits indicate that the first zero-run value is not equal to a value between 0 and i-2;
[0698] The method 200 may further include:
[0699] Encode the i-th flag bit.
[0700] In some embodiments, the i-th flag bit is encoded using a fixed context, no context, or an adaptive context.
[0701] In some embodiments, the third intermediate value bit is shifted right by P bits to obtain the first parameter and the second parameter; the first parameter is the value obtained after the third intermediate value bit is shifted right by P bits; the second parameter includes the P-bit binary number shifted out when the third intermediate value bit is shifted right by P bits; P is a positive integer.
[0702] In some embodiments, the third intermediate value is bit-shifted right P times to obtain the first parameter and the second parameter; the number of shifts of each bit-shift of the third intermediate value is 1, and the first parameter is the value obtained after the third intermediate value is bit-shifted right P times; the second parameter includes P binary numbers shifted out when the third intermediate value is bit-shifted right P times; P is a positive integer.
[0703] In some embodiments, the first zero-run value bit is shifted right by P bits to obtain the first parameter and the second parameter; the first parameter is the value obtained after the first zero-run value bit is shifted right by P bits, and the second parameter includes the P-bit binary number shifted out when the first zero-run value bit is shifted right by P bits; P is a positive integer.
[0704] In some embodiments, the first zero-run value bit is shifted right P times to obtain the first parameter and the second parameter; the number of shift bits for each right shift of the first zero-run value is 1, and the first parameter is the value obtained after the first zero-run value bit is shifted right P times; the second parameter includes P binary numbers shifted out when the first zero-run value bit is shifted right P times; P is a positive integer.
[0705] In some embodiments, the first parameter is encoded using a first entropy coding algorithm.
[0706] In some embodiments, the first entropy coding algorithm is a Golomb coding algorithm.
[0707] In some embodiments, the second parameter is encoded using a fixed context.
[0708] In some embodiments, the first binary number in the second parameter is encoded using a fixed context.
[0709] In some embodiments, the second parameter is not encoded using a context.
[0710] In some embodiments, the second parameter is encoded using an adaptive context.
[0711] In some embodiments, a first index value is determined based on prior information of the current binary number in the second parameter; and the current binary number is encoded based on a context indicated by the first index value.
[0712] In some embodiments, the prior information includes at least one of the following:
[0713] The attribute coefficient of the encoded point, the context index value used by the encoded point, the encoded zero run value, the context index value used by the encoded zero run value, and the binary number determined in the second parameter.
[0714] In some embodiments, the first index value is a one-dimensional index value determined based on the determined binary number.
[0715] In some embodiments, the method 200 may further include:
[0716] Determine a first flag bit; the value of the first flag bit indicates whether to encode the first parameter and the second parameter;
[0717] The first flag bit is encoded.
[0718] In some embodiments, S210 may include:
[0719] The number of points whose attribute coefficients are zero and continuous is determined as the first zero-run value.
[0720] In some embodiments, the attribute coefficient being zero includes each color component being zero; or the attribute coefficient being zero includes reflectivity being zero.
[0721] It should be understood that the decoding method 100 is the inverse process or reverse operation of the encoding method 200 , and therefore the steps in the encoding method 200 may refer to the corresponding steps in the decoding method 100 , which will not be described again for the sake of brevity.
[0722] The preferred embodiments provided in this application are described below.
[0723] Example 6:
[0724] In this embodiment, it is assumed that the third variable and the fourth variable are respectively recorded as r3 and r4, and their initial values are both 0. The encoder uses a for loop (int r3=0; r3<(the minimum value between the first zero-run value and E); i++) and a for loop (int r4=0; r4<(the minimum value between the prefix and G); r4++) to determine the first parameter and the second parameter. Specifically, when r3<(the minimum value between the first zero-run value and E) does not hold, the for loop (int r4=0; r4<(the minimum value between the prefix and G); r4++) is executed, and when r4<(the minimum value between the prefix and G) does not hold, the encoder will determine the first parameter and the second parameter, and then encode the first parameter and the second parameter.
[0725] Exemplarily, the encoder may encode the first parameter and the second parameter through the following process:
[0726] for loop (int r3=0; r3<(the first zero run value and the minimum value in E); i++);
[0727] Encode the binary number V using a fixed context (a different fixed context is used in each loop).
[0728] If the first zero-run value is less than E×F:
[0729] The encoding ends with the fixed context encoded binary number U.
[0730] otherwise:
[0731] Calculate the difference between the first zero-run value and E×F, and record it as dif1;
[0732] Calculate the quotient of dif1 divided by H, denoted as prefix;
[0733] for loop(int r4=0; r4<(minimum value between prefix and G); r4++);
[0734] Encode the binary number V using a fixed context (a different fixed context is used in each loop).
[0735] If dif1 is less than G×H:
[0736] Use the encoded binary number U with a fixed context;
[0737] Directly encode the remainder of dif1 divided by H;
[0738] End encoding;
[0739] otherwise:
[0740] Calculate the difference between dif1 and G×H, recorded as dif2;
[0741] A first parameter and a second parameter are determined based on dif2, and the first parameter and the second parameter are encoded.
[0742] In short, when r3<(the minimum value between the first zero-run value and E) does not hold, determine whether the first zero-run value is less than E×F, and perform encoding based on the determination result; that is, when the first zero-run value is less than E×F, use the fixed context encoding binary number U and end encoding. When the first zero-run value is less than E×F does not hold, execute a for loop (int r4=0; r4<(the minimum value between prefix and G); r4++); and when r4<(the minimum value between prefix and G) does not hold, determine whether dif1 is less than G×H. When dif1 is less than G×H, use the fixed context encoding binary number U, directly encode the remainder of dif1 divided by H, and then end encoding. When dif1 is less than G×H does not hold, the encoder determines the first parameter and the second parameter based on dif2, and encodes the first parameter and the second parameter.
[0743] Exemplarily, the encoder may determine the first parameter and the second parameter based on the first zero-run value and encode the first parameter and the second parameter in the following manner:
[0744] Specifically, the encoder subtracts E×F+G×H from the first zero-run value to obtain a third intermediate value, and then determines the value obtained by right shifting the third intermediate value by P bits as the first parameter, and determines the shifted binary number as the second parameter; based on this, the first parameter can be encoded using exponential Columbus encoding, and each binary number in the second parameter can be entropy encoded using a fixed context, no context, or an adaptive context.
[0745] It is worth noting that the embodiment of the present application does not limit the encoding order of the first parameter and the second parameter.
[0746] In addition, when determining the second parameter, the encoder may first shift the third intermediate value right by one position to obtain the first binary number in the second parameter, which is recorded as W1; then shift right by one position again to obtain the second binary number in the second parameter, which is recorded as W2; and so on, until the last binary number in the second parameter is obtained, which is recorded as W P, thereby obtaining the second parameter. Of course, it is also possible to right shift P bits at a time, that is, to obtain the second parameter at a time, and this application does not make specific restrictions on this. When the encoder encodes the second parameter, as a feasible solution, it can first use the input corresponding parameter to select the context index to encode W1, and then use the encoded W1 and / or the input corresponding parameter to select the adapted context index to encode W2, and then use the encoded W1, the encoded W2 and at least one of the input corresponding parameters to select the adapted context index to encode W3, and so on, until the encoding of W is completed. P The corresponding input parameter can be a fixed context index value.
[0747] The following describes the encoding method using E=3, F=1, G=4, H=2, U=0, and V=1 as an example:
[0748] for loop (int r3=0; r3<(the minimum value of the first zero run value and 3); i++);
[0749] Encode the binary number 1 using a fixed context (a different fixed context is used in each loop).
[0750] If the first zero-run value is less than 3:
[0751] End the encoding with the fixed context encoded binary number 0.
[0752] otherwise:
[0753] The difference between the first zero-run value and 3 is recorded as dif1;
[0754] Calculate the quotient of dif1 divided by 2, denoted as prefix;
[0755] for loop(int r4=0; r4<(minimum of prefix and 4); r4++);
[0756] Encode the binary number V using a fixed context (a different fixed context is used in each loop).
[0757] If dif1 is less than 8:
[0758] Encoded binary number 0 with fixed context;
[0759] Directly encode the remainder of dif1 divided by 2;
[0760] End encoding.
[0761] otherwise:
[0762] Calculate the difference between dif1 and 8, record it as dif2;
[0763] A first parameter and a second parameter are determined based on dif2, and the first parameter and the second parameter are encoded.
[0764] In short, when r3<(the minimum value of the first zero-run value and 3) is not established, it is determined whether the first zero-run value is less than 3, and encoding is performed based on the determination result; that is, when the first zero-run value is less than 3, the fixed context encoding binary number U is used and the encoding is ended. When the first zero-run value is less than 3 is not established, a for loop (int r4=0; r4<(the minimum value of the prefix and 4); r4++) is executed; and when r4<(the minimum value of the prefix and 4) is not established, it is determined whether dif1 is less than 8. When dif1 is less than 8, the fixed context encoding binary number U is used, and the remainder of dif1 divided by 2 is directly encoded, and then the encoding is ended. When dif1 is less than 8 is not established, the encoder determines the first parameter and the second parameter based on dif2, and encodes the first parameter and the second parameter.
[0765] Exemplarily, the encoder may determine the first parameter and the second parameter based on the first zero-run value and encode the first parameter and the second parameter in the following manner:
[0766] Assuming P=2, the encoder subtracts 12 (i.e., 3+8) from the first zero-run value to obtain a third intermediate value, and then determines the value obtained by right-shifting the third intermediate value by 2 bits as the first parameter, and determines the shifted 2-bit binary number as the second parameter; based on this, the first parameter can be encoded using exponential Golomb coding, and each binary number in the second parameter can be entropy encoded using a fixed context, no context, or an adaptive context.
[0767] It is worth noting that the embodiment of the present application does not limit the encoding order of the first parameter and the second parameter.
[0768] In addition, when determining the second parameter, the encoder may first right-shift the value of the third intermediate value by one position to obtain the first binary number in the second parameter, denoted as W1; and then right-shift it by one position again to obtain the second binary number in the second parameter, denoted as W2. Of course, it is also possible to right-shift 2 positions at a time, that is, to obtain the second parameter at one time, and this application does not specifically limit this. When the encoder encodes the second parameter, as a feasible solution, it may first use the input corresponding parameter to select a context index to encode W1, and then use the already encoded W1 and / or the input corresponding parameter to jointly select an adaptive context index to encode W2. For example, the encoder may use the already encoded W1 and the input corresponding parameter to jointly select an adaptive context index to encode W2. For another example, the encoder may use the already encoded W1 to select an adaptive context index to encode W2. For another example, the encoder may use the input corresponding parameter to select an adaptive context index to encode W2. The input corresponding parameter may be a fixed context index value.
[0769] The following describes the encoding method using E=3, F=1, G=4, H=2, U=0, and V=1 as an example:
[0770] for loop (int r3=0; r3<(the minimum value of the first zero run value and 3); i++);
[0771] Encode the binary number 1 using a fixed context (a different fixed context is used in each loop).
[0772] If the first zero-run value is less than 3:
[0773] End the encoding with the fixed context encoded binary number 0.
[0774] otherwise:
[0775] The difference between the first zero-run value and 3 is recorded as dif1;
[0776] Calculate the quotient of dif1 divided by 2, denoted as prefix;
[0777] for loop(int r4=0; r4<(minimum of prefix and 4); r4++);
[0778] Encode the binary number V using a fixed context (a different fixed context is used in each loop).
[0779] If dif1 is less than 8:
[0780] Encoded binary number 0 with fixed context;
[0781] Directly encode the remainder of dif1 divided by 2;
[0782] End encoding.
[0783] otherwise:
[0784] Calculate the difference between dif1 and 8, record it as dif2;
[0785] A first parameter and a second parameter are determined based on dif2, and the first parameter and the second parameter are encoded.
[0786] In short, when r3<(the minimum value of the first zero-run value and 3) is not established, it is determined whether the first zero-run value is less than 3, and encoding is performed based on the determination result; that is, when the first zero-run value is less than 3, the fixed context encoding binary number U is used and the encoding is ended. When the first zero-run value is less than 3 is not established, a for loop (int r4=0; r4<(the minimum value of the prefix and 4); r4++) is executed; and when r4<(the minimum value of the prefix and 4) is not established, it is determined whether dif1 is less than 8. When dif1 is less than 8, the fixed context encoding binary number U is used, and the remainder of dif1 divided by 2 is directly encoded, and then the encoding is ended. When dif1 is less than 8 is not established, the encoder determines the first parameter and the second parameter based on dif2, and encodes the first parameter and the second parameter.
[0787] Exemplarily, the encoder may determine the first parameter and the second parameter based on the first zero-run value and encode the first parameter and the second parameter in the following manner:
[0788] Assuming P=1, the encoder subtracts 12 (i.e., 3+8) from the first zero-run value to obtain a third intermediate value, and then determines the value obtained by shifting the third intermediate value right by 1 bit as the first parameter, and determines the 1-bit binary number shifted out as the second parameter; based on this, the first parameter can be encoded using exponential Golomb coding, and each binary number in the second parameter can be entropy encoded using a fixed context, no context, or an adaptive context.
[0789] It is worth noting that the embodiment of the present application does not limit the encoding order of the first parameter and the second parameter.
[0790] Example 7:
[0791] In this embodiment, when the encoder determines that the first zero-run value is not a value between 0 and M, it determines a first parameter and a second parameter based on the first zero-run value, and then encodes the first parameter and the second parameter. Specifically, the encoder subtracts M+1 from the first zero-run value to obtain a third intermediate value, then right-shifts the third intermediate value by P bits to obtain a value as the first parameter, and determines the shifted binary number as the second parameter. Based on this, the first parameter can be encoded using Exponential Golomb coding, and each binary number in the second parameter can be entropy encoded using a fixed context, no context, or an adaptive context.
[0792] Exemplarily, the encoder may encode the first parameter and the second parameter through the following process:
[0793] Adaptive context encoding is used to encode a flag bit to indicate whether the first zero run value is 0. If yes, then: end encoding of subsequent flag bits and determine the first zero run value to be 0; if not, then:
[0794] Adaptive context encoding is used to encode a flag bit to represent whether the first zero run value is 1. If so, then: end the encoding of subsequent flag bits and determine the first zero run value as 1; and so on, until the i-th flag bit encoded indicates that the first zero run value is equal to i-1, end the encoding of the remaining flag bits, or, until the last flag bit of the M+1 flag bits is encoded, and the last flag bit indicates that the first zero run value is not equal to M, the encoder needs to further determine the first parameter and the second parameter based on the first zero run value, and encode the first parameter and the second parameter.
[0795] Specifically, the encoder subtracts M+1 from the first zero-run value to obtain a third intermediate value, and then determines the value obtained by right-shifting the third intermediate value by P bits as the first parameter, and determines the shifted binary number as the second parameter; based on this, the first parameter can be encoded using exponential Columbus encoding, and each binary number in the second parameter can be entropy encoded using a fixed context, no context, or an adaptive context.
[0796] It is worth noting that the embodiment of the present application does not limit the encoding order of the first parameter and the second parameter.
[0797] In addition, when determining the second parameter, the encoder may first shift the third intermediate value right by one position to obtain the first binary number in the second parameter, which is recorded as W1; then shift right by one position again to obtain the second binary number in the second parameter, which is recorded as W2; and so on, until the last binary number in the second parameter is obtained, which is recorded as W P, thereby obtaining the second parameter. Of course, it is also possible to right shift P bits at a time, that is, to obtain the second parameter at a time, and this application does not make specific restrictions on this. When the encoder encodes the second parameter, as a feasible solution, it can first use the input corresponding parameter to select the context index to encode W1, and then use the encoded W1 and / or the input corresponding parameter to select the adapted context index to encode W2, and then use the encoded W1, the encoded W2 and at least one of the input corresponding parameters to select the adapted context index to encode W3, and so on, until the encoding of W is completed. P The corresponding input parameter can be a fixed context index value.
[0798] The following takes M=3, P=2 as an example to illustrate the encoding method:
[0799] Adaptive context encoding is used to encode a flag bit to indicate whether the first zero run value is 0. If yes, then: end encoding of subsequent flag bits and determine the first zero run value to be 0; if not, then:
[0800] Adaptive context encoding is used to encode a flag bit to indicate whether the first zero run value is 1. If yes, then: end encoding of subsequent flag bits and determine the first zero run value to be 1; if not, then:
[0801] Adaptive context encoding is used to encode a flag bit to indicate whether the first zero run value is 2. If yes, then: end encoding of subsequent flag bits and determine the first zero run value to be 2; if no, then:
[0802] Adaptive context encoding is used to encode a flag bit to represent whether the first zero run value is 3. If so, then: end the encoding of subsequent flag bits and determine the first zero run value as 3; if not, the encoder needs to further determine the first parameter and the second parameter based on the first zero run value, and encode the first parameter and the second parameter.
[0803] Specifically, the encoder subtracts 4 from the first zero-run value to obtain a third intermediate value, and then determines the value obtained by right-shifting the third intermediate value by 2 bits as the first parameter, and determines the shifted binary number as the 2-bit binary number; based on this, the first parameter can be encoded using exponential Columbus encoding, and each binary number in the second parameter can be entropy encoded using a fixed context, no context, or an adaptive context.
[0804] It is worth noting that the embodiment of the present application does not limit the encoding order of the first parameter and the second parameter.
[0805] In addition, when determining the second parameter, the encoder may first right-shift the third intermediate value by one position to obtain the first binary number in the second parameter, denoted as W1; and then right-shift it by one position again to obtain the second binary number in the second parameter, denoted as W2. Of course, it is also possible to right-shift 2 positions at a time, that is, to obtain the second parameter at one time, and this application does not impose specific restrictions on this. When the encoder encodes the second parameter, as a feasible solution, it may first use the input corresponding parameter to select a context index to encode W1, and then use the already encoded W1 and / or the input corresponding parameter to jointly select an adaptive context index to encode W2. For example, the encoder may use the already encoded W1 and the input corresponding parameter to jointly select an adaptive context index to encode W2. For another example, the encoder may use the already encoded W1 to select an adaptive context index to encode W2. For another example, the encoder may use the input corresponding parameter to select an adaptive context index to encode W2. The input corresponding parameter may be a fixed context index value.
[0806] The following takes M=3, P=1 as an example to illustrate the encoding method:
[0807] Adaptive context encoding is used to encode a flag bit to indicate whether the first zero run value is 0. If yes, then: end encoding of subsequent flag bits and determine the first zero run value to be 0; if not, then:
[0808] Adaptive context encoding is used to encode a flag bit to indicate whether the first zero run value is 1. If yes, then: end encoding of subsequent flag bits and determine the first zero run value to be 1; if not, then:
[0809] Adaptive context encoding is used to encode a flag bit to indicate whether the first zero run value is 2. If yes, then: end encoding of subsequent flag bits and determine the first zero run value to be 2; if no, then:
[0810] Adaptive context encoding is used to encode a flag bit to represent whether the first zero run value is 3. If so, then: end the encoding of subsequent flag bits and determine the first zero run value as 3; if not, the encoder needs to further determine the first parameter and the second parameter based on the first zero run value, and encode the first parameter and the second parameter.
[0811] Specifically, the encoder subtracts 4 from the first zero-run value to obtain a third intermediate value, and then determines the value obtained by right-shifting the third intermediate value by 1 bit as the first parameter, and determines the shifted 1-bit binary number as the second parameter; based on this, the first parameter can be encoded using exponential Columbus encoding, and each binary number in the second parameter can be entropy encoded using a fixed context, no context, or an adaptive context.
[0812] It is worth noting that the embodiment of the present application does not limit the encoding order of the first parameter and the second parameter.
[0813] Example 8:
[0814] In this embodiment, when the encoder determines that the first zero-run value is not a value between 0 and M, it determines a first parameter and a second parameter based on the first zero-run value, and then encodes the first parameter and the second parameter. Specifically, the encoder determines the value obtained by right-shifting the first zero-run value by P bits as the first parameter, and determines the shifted binary number as the second parameter. Based on this, the first parameter can be encoded using Exponential Golomb coding, and each binary number in the second parameter can be entropy encoded using a fixed context, no context, or an adaptive context.
[0815] Exemplarily, the encoder may determine and encode the first parameter and the second parameter through the following process:
[0816] Adaptive context encoding is used to encode a flag bit to indicate whether the first zero run value is 0. If yes, then: end encoding of subsequent flag bits and determine the first zero run value to be 0; if not, then:
[0817] Adaptive context encoding is used to encode a flag bit to represent whether the first zero run value is 1. If so, then: end the encoding of subsequent flag bits and determine the first zero run value as 1; and so on, until the i-th flag bit encoded indicates that the first zero run value is equal to i-1, end the encoding of the remaining flag bits, or, until the last flag bit of the M+1 flag bits is encoded, and the last flag bit indicates that the first zero run value is not equal to M, the encoder needs to further determine the first parameter and the second parameter based on the first zero run value, and encode the first parameter and the second parameter.
[0818] Specifically, the encoder determines the numerical value obtained by directly right shifting the first zero-run value by P bits as the first parameter, and determines the shifted binary number as the second parameter; based on this, the first parameter can be encoded using exponential Golomb coding, and each binary number in the second parameter can be entropy encoded using a fixed context, no context or an adaptive context.
[0819] It is worth noting that the embodiment of the present application does not limit the encoding order of the first parameter and the second parameter.
[0820] In addition, when determining the second parameter, the encoder may first shift the first zero-run value right by one position to obtain the first binary number in the second parameter, which is recorded as W1; then shift right by one position again to obtain the second binary number in the second parameter, which is recorded as W2; and so on, until the last binary number in the second parameter is obtained, which is recorded as WP , thereby obtaining the second parameter. Of course, it is also possible to right shift P bits at a time, that is, to obtain the second parameter at a time, and this application does not make specific restrictions on this. When the encoder encodes the second parameter, as a feasible solution, it can first use the input corresponding parameter to select the context index to encode W1, and then use the encoded W1 and / or the input corresponding parameter to select the adapted context index to encode W2, and then use the encoded W1, the encoded W2 and at least one of the input corresponding parameters to select the adapted context index to encode W3, and so on, until the encoding of W is completed. P The corresponding input parameter can be a fixed context index value.
[0821] The following takes M=3, P=2 as an example to illustrate the encoding method:
[0822] Adaptive context encoding is used to encode a flag bit to indicate whether the first zero run value is 0. If yes, then: end encoding of subsequent flag bits and determine the first zero run value to be 0; if not, then:
[0823] Adaptive context encoding is used to encode a flag bit to indicate whether the first zero run value is 1. If yes, then: end encoding of subsequent flag bits and determine the first zero run value to be 1; if not, then:
[0824] Adaptive context encoding is used to encode a flag bit to indicate whether the first zero run value is 2. If yes, then: end encoding of subsequent flag bits and determine the first zero run value to be 2; if no, then:
[0825] Adaptive context encoding is used to encode a flag bit to represent whether the first zero run value is 3. If so, then: end the encoding of subsequent flag bits and determine the first zero run value as 3; if not, the encoder needs to further determine the first parameter and the second parameter based on the first zero run value, and encode the first parameter and the second parameter.
[0826] Specifically, the encoder determines the value obtained by directly shifting the first zero-run value right by 2 bits as the first parameter, and determines the shifted binary number as the 2-bit binary number; based on this, the first parameter can be encoded using exponential Golomb coding, and each binary number in the second parameter can be entropy encoded using a fixed context, no context or an adaptive context.
[0827] It is worth noting that the embodiment of the present application does not limit the encoding order of the first parameter and the second parameter.
[0828] In addition, when determining the second parameter, the encoder may first right-shift the third intermediate value by one position to obtain the first binary number in the second parameter, denoted as W1; and then right-shift it by one position again to obtain the second binary number in the second parameter, denoted as W2. Of course, it is also possible to right-shift 2 positions at a time, that is, to obtain the second parameter at one time, and this application does not impose specific restrictions on this. When the encoder encodes the second parameter, as a feasible solution, it may first use the input corresponding parameter to select a context index to encode W1, and then use the already encoded W1 and / or the input corresponding parameter to jointly select an adaptive context index to encode W2. For example, the encoder may use the already encoded W1 and the input corresponding parameter to jointly select an adaptive context index to encode W2. For another example, the encoder may use the already encoded W1 to select an adaptive context index to encode W2. For another example, the encoder may use the input corresponding parameter to select an adaptive context index to encode W2. The input corresponding parameter may be a fixed context index value.
[0829] The following takes M=3, P=1 as an example to illustrate the encoding method:
[0830] Adaptive context encoding is used to encode a flag bit to indicate whether the first zero run value is 0. If yes, then: end encoding of subsequent flag bits and determine the first zero run value to be 0; if not, then:
[0831] Adaptive context encoding is used to encode a flag bit to indicate whether the first zero run value is 1. If yes, then: end encoding of subsequent flag bits and determine the first zero run value to be 1; if not, then:
[0832] Adaptive context encoding is used to encode a flag bit to indicate whether the first zero run value is 2. If yes, then: end encoding of subsequent flag bits and determine the first zero run value to be 2; if no, then:
[0833] Adaptive context encoding is used to encode a flag bit to represent whether the first zero run value is 3. If so, then: end the encoding of subsequent flag bits and determine the first zero run value as 3; if not, the encoder needs to further determine the first parameter and the second parameter based on the first zero run value, and encode the first parameter and the second parameter.
[0834] Specifically, the encoder determines the value obtained by directly shifting the first zero-run value right by 1 bit as the first parameter, and determines the shifted 1-bit binary number as the second parameter; based on this, the first parameter can be encoded using exponential Golomb coding, and each binary number in the second parameter can be entropy encoded using a fixed context, no context or an adaptive context.
[0835] It is worth noting that the embodiment of the present application does not limit the encoding order of the first parameter and the second parameter.
[0836] The preferred embodiments of the present application are described in detail above in conjunction with the accompanying drawings. However, the present application is not limited to the specific details in the above embodiments. Within the technical concept of the present application, the technical solution of the present application can be subjected to a variety of simple modifications, and these simple modifications all fall within the scope of protection of the present application. For example, the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present application will no longer describe the various possible combinations separately. For another example, the various different embodiments of the present application can also be arbitrarily combined, as long as they do not violate the idea of the present application, they should also be regarded as the contents disclosed in the present application. It should also be understood that in the various method embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0837] The method embodiment of the present application is described in detail above. The following describes in detail an apparatus embodiment of the present application in conjunction with FIG. 10 and FIG. 11 .
[0838] FIG10 is a schematic block diagram of a decoder 300 according to an embodiment of the present application.
[0839] As shown in FIG10 , the decoder 300 may include:
[0840] An acquiring unit 310 is configured to acquire a first parameter and a second parameter;
[0841] The determining unit 320 is configured to determine the first zero-run value based on the first parameter and the second parameter.
[0842] In some embodiments, the determining unit 320 is specifically configured to:
[0843] Shifting the first parameter bit left by P bits obtains a first intermediate value; P is a positive integer;
[0844] determining a second intermediate value based on the first intermediate value and the second parameter;
[0845] Based on the second intermediate value, the first zero-run value is determined.
[0846] In some embodiments, the second parameter is a P-bit binary number.
[0847] In some embodiments, the determining unit 320 is specifically configured to:
[0848] The first intermediate value and the P-bit binary number are added to obtain the second intermediate value.
[0849] In some embodiments, the second parameter is P binary numbers.
[0850] In some embodiments, the determining unit 320 is specifically configured to:
[0851] Determining a shift number for each binary number in the P binary numbers based on a decoding order of the P binary numbers;
[0852] Left-shift each binary number based on the number of shift bits of each binary number to obtain P third parameters;
[0853] The first intermediate value and the P third parameters are summed to obtain the second intermediate value.
[0854] In some embodiments, the determining unit 320 is specifically configured to:
[0855] Let i-1 be determined as the number of shifts of the i-th binary number among the P binary numbers; i is a positive integer.
[0856] In some embodiments, the determining unit 320 is specifically configured to:
[0857] Pi is determined as the number of shifts of the i-th binary number among the P binary numbers; i is a positive integer.
[0858] In some embodiments, the determining unit 320 is specifically configured to:
[0859] The second intermediate value is determined as the first zero-run value.
[0860] In some embodiments, the determining unit 320 is specifically configured to:
[0861] determining a value of the first variable;
[0862] If the value of the first variable is greater than or equal to E, the value of the second variable is determined;
[0863] If the value of the second variable is greater than or equal to G, the value of the first variable is determined to be the first value;
[0864] Wherein, E and G are both positive integers.
[0865] In some embodiments, the first value is E×F+G×H, wherein G and H are both positive integers.
[0866] In some embodiments, before determining the value of the second variable, the determining unit 320 is further configured to:
[0867] If the value of the first variable is less than E, a first binary number is obtained using a fixed context;
[0868] If the first binary number is equal to U, the value of the first variable is determined to be the first zero-run value.
[0869] In some embodiments, the determining unit 320 is further configured to:
[0870] If the first binary number is equal to V, then the value of the first variable is updated from the second value to the sum of the second value and F;
[0871] Wherein, F is a positive integer, and U is not equal to V.
[0872] In some embodiments, the determining unit 320 is further configured to:
[0873] If the sum of the second value and F is less than E, a second binary number is obtained using the fixed context;
[0874] The context index value used by the first binary number is different from the context index value used by the second binary number.
[0875] In some embodiments, before determining the value of the first variable as the first value, the determining unit 320 is further configured to:
[0876] If the value of the second variable is less than G, a third binary number is obtained using a fixed context; G is a positive integer;
[0877] If the third binary number is equal to U, obtaining a fourth binary number;
[0878] The sum of the value of the first variable and the fourth binary number is determined as the first zero-run value.
[0879] In some embodiments, the determining unit 320 is further configured to:
[0880] If the third binary number is equal to V, the value of the first variable is updated from the third value to the sum of the third value and H, and the value of the second variable is updated from the fourth value to the sum of the fourth value and L;
[0881] Wherein, H and L are both positive integers, and U is not equal to V.
[0882] In some embodiments, the determining unit 320 is further configured to:
[0883] If the sum of the fourth value and L is less than G, a fifth binary number is obtained using a fixed context;
[0884] The context index value used by the third binary number is different from the context index value used by the fifth binary number.
[0885] In some embodiments, the acquiring unit 310 is specifically configured to:
[0886] Determine whether the first zero-run value is a value between 0 and M, where M is a positive integer;
[0887] If the first zero-run value is not a value between 0 and M, the sum of the second intermediate value and M+1 is determined as the first zero-run value.
[0888] In some embodiments, the acquiring unit 310 is specifically configured to:
[0889] Determine the i-th flag bit among the M+1 flag bits;
[0890] Among them, the value of the i-th flag bit indicates whether the first zero run value is equal to i-1; the values of the first i-1 flag bits among the M+1 flag bits indicate that the first zero run value is not equal to a value between 0 and i-2.
[0891] In some embodiments, the acquiring unit 310 is specifically configured to:
[0892] The i-th flag bit is determined using a fixed context, no context, or an adaptive context.
[0893] In some embodiments, the acquiring unit 310 is specifically configured to:
[0894] The first parameter is determined using a first entropy decoding algorithm.
[0895] In some embodiments, the first entropy decoding algorithm is a Golomb decoding algorithm.
[0896] In some embodiments, the acquiring unit 310 is specifically configured to:
[0897] The second parameter is determined using a fixed context.
[0898] In some embodiments, the acquiring unit 310 is specifically configured to:
[0899] The first binary number in the second parameter is determined using a fixed context.
[0900] In some embodiments, the acquiring unit 310 is specifically configured to:
[0901] No context is used to determine the second parameter.
[0902] In some embodiments, the acquiring unit 310 is specifically configured to:
[0903] The second parameter is determined using the adaptation context.
[0904] In some embodiments, the acquiring unit 310 is specifically configured to:
[0905] Determining a first index value based on prior information of a current binary number in the second parameter;
[0906] The current binary number is determined based on the context indicated by the first index value.
[0907] In some embodiments, the prior information includes at least one of the following:
[0908] The attribute coefficient of the decoded point, the context index value used by the decoded point, the decoded zero run value, the context index value used by the decoded zero run value, and the binary number determined in the second parameter.
[0909] In some embodiments, the first index value is a one-dimensional index value determined based on the determined binary number.
[0910] In some embodiments, the acquiring unit 310 is further configured to:
[0911] A first flag bit is determined; the value of the first flag bit indicates whether the first zero-run value is determined based on the first parameter and the second parameter.
[0912] In some embodiments, the determining unit 320 is further configured to:
[0913] The first zero-run value is determined as the number of points whose attribute coefficients are zero and continuous.
[0914] In some embodiments, the attribute coefficient being zero includes each color component being zero; or the attribute coefficient being zero includes reflectivity being zero.
[0915] FIG11 is a schematic block diagram of an encoder 400 according to an embodiment of the present application.
[0916] As shown in FIG11 , the encoder 400 may include:
[0917] An acquiring unit 410 is configured to acquire the first zero-run value;
[0918] A determining unit 420 is configured to determine the first parameter and the second parameter based on the first zero-run value;
[0919] The encoding unit 430 is configured to encode the first parameter and the second parameter.
[0920] In some embodiments, the determining unit 420 is specifically configured to:
[0921] Subtract 0 from the first zero-run value to obtain a third intermediate value; 0 is a positive integer;
[0922] Based on the third intermediate value, the first parameter and the second parameter are determined.
[0923] In some embodiments, the determining unit 420 is specifically configured to:
[0924] If the first zero-run value is greater than or equal to E×F+G×H, a difference between the first zero-run value and E×F+G×H is determined as the third intermediate value;
[0925] Among them, E, F, H, and G are all positive integers.
[0926] In some embodiments, before determining the first parameter and the second parameter based on the first zero-run value, the determining unit 420 is further configured to:
[0927] Get the value of the third variable;
[0928] If the value of the third variable is less than the first minimum value, a binary number having a value of V is encoded using a fixed context, and L is added to the value of the third variable;
[0929] The first minimum value is the minimum value of the first zero-run value and E, and L is a positive integer.
[0930] In some embodiments, the determining unit 420 is further configured to:
[0931] If the first zero-run value is less than E×F, a binary number with a value of U is encoded using a fixed context; U is not equal to V.
[0932] In some embodiments, the determining unit 420 is further configured to:
[0933] If the first zero-run value is greater than or equal to E×F, the value obtained by subtracting E×F from the first zero-run value is divided by H to obtain a first quotient value;
[0934] Determine the value of the fourth variable;
[0935] If the value of the fourth variable is less than the second minimum value, a binary number having a value of V is encoded using a fixed context, and L is added to the current value of the fourth variable;
[0936] The second minimum value is the minimum value of the first quotient and G.
[0937] In some embodiments, the determining unit 420 is further configured to:
[0938] If the first zero-run value is less than E×F+G×H, a binary number having a value of U is encoded using a fixed context, and a remainder of the first quotient is encoded.
[0939] In some embodiments, the determining unit 420 is specifically configured to:
[0940] Determine whether the first zero-run value is a value between 0 and M; M is a positive integer; if the first zero-run value is not a value between 0 and M, determine the difference between the first zero-run value and M+1 as the third intermediate value.
[0941] In some embodiments, the determining unit 420 is further configured to:
[0942] Determine the i-th flag bit among the M+1 flag bits;
[0943] The value of the i-th flag bit indicates whether the first zero-run value is equal to i-1, and the values of the first i-1 flag bits in the M+1 flag bits indicate that the first zero-run value is not equal to a value between 0 and i-2;
[0944] The encoding unit 430 is further configured to:
[0945] Encode the i-th flag bit.
[0946] In some embodiments, the encoding unit 430 is specifically configured to:
[0947] The i-th flag bit is encoded using a fixed context, no context, or an adaptive context.
[0948] In some embodiments, the determining unit 420 is specifically configured to:
[0949] The third intermediate value bit is shifted right by P bits to obtain the first parameter and the second parameter; the first parameter is the value obtained after the third intermediate value bit is shifted right by P bits; the second parameter includes the P-bit binary number shifted out when the third intermediate value bit is shifted right by P bits; P is a positive integer.
[0950] In some embodiments, the determining unit 420 is specifically configured to:
[0951] The third intermediate value is bit-shifted right P times to obtain the first parameter and the second parameter; the number of shift bits of each bit-shift of the third intermediate value is 1, and the first parameter is the value obtained after the third intermediate value is bit-shifted right P times; the second parameter includes P binary numbers shifted out when the third intermediate value is bit-shifted right P times; P is a positive integer.
[0952] In some embodiments, the determining unit 420 is specifically configured to:
[0953] The first zero-run value bit is shifted right by P bits to obtain the first parameter and the second parameter; the first parameter is the value obtained after the first zero-run value bit is shifted right by P bits, and the second parameter includes the P-bit binary number shifted out when the first zero-run value bit is shifted right by P bits; P is a positive integer.
[0954] In some embodiments, the determining unit 420 is specifically configured to:
[0955] The first zero-run value bit is shifted right P times to obtain the first parameter and the second parameter; the number of shift bits for each right shift of the first zero-run value is 1, and the first parameter is the value obtained after the first zero-run value is bit-shifted right P times; the second parameter includes P binary numbers shifted out when the first zero-run value bit is bit-shifted right P times; P is a positive integer.
[0956] In some embodiments, the encoding unit 430 is specifically configured to:
[0957] The first parameter is encoded using a first entropy coding algorithm.
[0958] In some embodiments, the first entropy coding algorithm is a Golomb coding algorithm.
[0959] In some embodiments, the encoding unit 430 is specifically configured to:
[0960] The second parameter is encoded using a fixed context.
[0961] In some embodiments, the encoding unit 430 is specifically configured to:
[0962] The first binary number in the second parameter is encoded using a fixed context.
[0963] In some embodiments, the encoding unit 430 is specifically configured to:
[0964] This second parameter is not encoded using a context.
[0965] In some embodiments, the encoding unit 430 is specifically configured to:
[0966] The second parameter is encoded using the adaptive context.
[0967] In some embodiments, the encoding unit 430 is specifically configured to:
[0968] Determining a first index value based on prior information of a current binary number in the second parameter;
[0969] The current binary number is encoded based on the context indicated by the first index value.
[0970] In some embodiments, the prior information includes at least one of the following:
[0971] The attribute coefficient of the encoded point, the context index value used by the encoded point, the encoded zero run value, the context index value used by the encoded zero run value, and the binary number determined in the second parameter.
[0972] In some embodiments, the first index value is a one-dimensional index value determined based on the determined binary number.
[0973] In some embodiments, the encoding unit 430 is further configured to:
[0974] Determine a first flag bit; the value of the first flag bit indicates whether to encode the first parameter and the second parameter;
[0975] The first flag bit is encoded.
[0976] In some embodiments, the acquiring unit 410 is specifically configured to:
[0977] The number of points whose attribute coefficients are zero and continuous is determined as the first zero-run value.
[0978] In some embodiments, the attribute coefficient being zero includes each color component being zero; or the attribute coefficient being zero includes reflectivity being zero.
[0979] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, they will not be described here. Specifically, the decoder 300 shown in Figure 10 may correspond to the corresponding subject in the method 100 for executing the embodiment of the present application, and the aforementioned and other operations and / or functions of the various units in the decoder 300 are respectively for implementing the corresponding processes in various methods such as method 100. Similarly, the encoder 400 shown in Figure 11 may correspond to the corresponding subject in the method 200 for executing the embodiment of the present application, that is, the aforementioned and other operations and / or functions of the various units in the encoder 400 are respectively for implementing the corresponding processes in various methods such as method 200.
[0980] It should also be understood that the various units in the decoder 300 or encoder 400 involved in the embodiment of the present application can be separately or all merged into one or several other units to constitute, or some (some) units therein can also be split into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the function of a unit can also be implemented by multiple units, or the function of multiple units is implemented by one unit. In other embodiments of the present application, the decoder 300 or encoder 400 can also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units. According to another embodiment of the present application, the decoder 300 or encoder 400 involved in the embodiment of the present application can be constructed by running a computer program (including program code) that can execute each step involved in the corresponding method on a general-purpose computing device including processing elements and storage elements such as a central processing unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), etc., to construct the decoder 300 or encoder 400 involved in the embodiment of the present application, and to implement the encoding method or decoding method of the embodiment of the present application. The computer program can be recorded on, for example, a computer-readable storage medium, loaded into an electronic device via the computer-readable storage medium, and run therein to implement the corresponding method of the embodiment of the present application.
[0981] In other words, the units mentioned above can be implemented in the form of hardware, can be implemented by instructions in the form of software, or can be implemented in the form of a combination of hardware and software. Specifically, the steps of the method embodiments in the embodiments of the present application can be completed by the hardware integrated logic circuit and / or software instructions in the processor, and the steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software in a decoding processor. Optionally, the software can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory and completes the steps in the above method embodiments in combination with its hardware.
[0982] FIG12 is a schematic structural diagram of an electronic device 500 provided in an embodiment of the present application.
[0983] As shown in Figure 12, the electronic device 500 includes at least a processor 510 and a computer-readable storage medium 520. The processor 510 and the computer-readable storage medium 520 may be connected via a bus or other means. The computer-readable storage medium 520 is used to store a computer program 521, which includes computer instructions. The processor 510 is used to execute the computer instructions stored in the computer-readable storage medium 520. The processor 510 is the computing core and control core of the electronic device 500 and is suitable for implementing one or more computer instructions, specifically loading and executing one or more computer instructions to implement the corresponding method flow or corresponding function.
[0984] As an example, the processor 510 may also be referred to as a central processing unit (CPU). The processor 510 may include, but is not limited to, a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic devices, discrete hardware components, and the like.
[0985] As an example, the computer-readable storage medium 520 may be a high-speed RAM memory, or a non-volatile memory (Non-Volatile Memory), such as at least one disk storage; optionally, it may also be at least one computer-readable storage medium located away from the aforementioned processor 510. Specifically, the computer-readable storage medium 520 includes, but is not limited to: volatile memory and / or non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).
[0986] In one implementation, the electronic device 500 may be an encoder or encoding framework involved in an embodiment of the present application; a first computer instruction is stored in the computer-readable storage medium 520; the processor 510 loads and executes the first computer instruction stored in the computer-readable storage medium 520 to implement the corresponding steps in the encoding method provided in an embodiment of the present application; in other words, the first computer instruction in the computer-readable storage medium 520 is loaded by the processor 510 and the corresponding steps are executed. To avoid repetition, it will not be repeated here.
[0987] In one implementation, the electronic device 500 may be a decoder or decoding framework involved in an embodiment of the present application; a second computer instruction is stored in the computer-readable storage medium 520; the processor 510 loads and executes the second computer instruction stored in the computer-readable storage medium 520 to implement the corresponding steps in the decoding method provided in an embodiment of the present application; in other words, the second computer instruction in the computer-readable storage medium 520 is loaded by the processor 510 and the corresponding steps are executed, which will not be repeated here to avoid repetition.
[0988] According to another aspect of the present application, an embodiment of the present application further provides a coding and decoding system, including the encoder and decoder mentioned above.
[0989] According to another aspect of the present application, an embodiment of the present application further provides a computer-readable storage medium (Memory), which is a memory device in the electronic device 500 for storing programs and data. For example, a computer-readable storage medium 520. It can be understood that the computer-readable storage medium 520 here can include both the built-in storage medium in the electronic device 500 and, of course, the extended storage medium supported by the electronic device 500. The computer-readable storage medium provides a storage space, which stores the operating system of the electronic device 500. In addition, one or more computer instructions suitable for being loaded and executed by the processor 510 are also stored in the storage space. These computer instructions can be one or more computer programs 521 (including program codes).
[0990] According to another aspect of the present application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. For example, computer program 521 is provided. In this case, data processing device 500 may be a computer, processor 510 may read the computer instructions from computer-readable storage medium 520, and processor 510 may execute the computer instructions, causing the computer to perform the encoding method or decoding method provided in the various optional embodiments described above.
[0991] In other words, when implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process of the embodiment of the present application is run in whole or in part or the functions of the embodiment of the present application are implemented. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode.
[0992] Those skilled in the art will appreciate that the units and process steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0993] Finally, it should be noted that the above content is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A decoding method, characterized in that: include: Get the first parameter and the second parameter; Based on the first parameter and the second parameter, a first zero-run value is determined.
2. The method according to claim 1, characterized in that The determining a first zero-run value based on the first parameter and the second parameter comprises: Shift the first parameter bit left by P bits to obtain a first intermediate value; P is a positive integer; determining a second intermediate value based on the first intermediate value and the second parameter; Based on the second intermediate value, the first zero-run value is determined.
3. The method according to claim 2, characterized in that The second parameter is a P-bit binary number.
4. The method according to claim 3, characterized in that The determining a second intermediate value based on the first intermediate value and the second parameter comprises: The first intermediate value and the P-bit binary number are added to obtain the second intermediate value.
5. The method according to claim 2, characterized in that: The second parameter is P binary numbers.
6. The method according to claim 5, characterized in that The determining a second intermediate value based on the first intermediate value and the second parameter comprises: Determining the number of shift bits of each binary number in the P binary numbers based on the decoding order of the P binary numbers; Left-shift each binary number based on the number of shift bits of each binary number to obtain P third parameters; The first intermediate value and the P third parameters are summed to obtain the second intermediate value.
7. The method according to claim 6, characterized in that The step of determining the number of shift bits of each binary number in the P binary numbers based on the decoding order of the P binary numbers comprises: i-1 is determined as the number of shifts of the i-th binary number among the P binary numbers; i is a positive integer.
8. The method according to claim 6, characterized in that The step of determining the number of shift bits of each binary number in the P binary numbers based on the decoding order of the P binary numbers comprises: Pi is determined as the number of shifts of the i-th binary number among the P binary numbers; i is a positive integer.
9. The method according to any one of claims 2 to 8, characterized in that The determining the first zero-run value based on the second intermediate value comprises: The second intermediate value is determined as the first zero-run value.
10. The method according to any one of claims 2 to 8, characterized in that The determining the first zero-run value based on the second intermediate value comprises: The second intermediate value is added to O to obtain the first zero-run value; O is a positive integer.
11. The method according to any one of claims 2 to 8, characterized in that The determining the first zero-run value based on the second intermediate value comprises: Get a first value of a first variable; The sum of the first value and the second intermediate value is determined as the first zero-run value.
12. The method according to claim 11, characterized in that The obtaining of a first value of the first variable includes: determining a value of the first variable; If the value of the first variable is greater than or equal to E, then determine the value of the second variable; If the value of the second variable is greater than or equal to G, the value of the first variable is determined to be the first value; Wherein, E and G are both positive integers.
13. The method according to claim 12, characterized in that The first value is E×F+G×H, wherein G and H are both positive integers.
14. The method according to claim 12 or 13, characterized in that Before determining the value of the second variable, the method further includes: If the value of the first variable is less than E, obtaining a first binary number using a fixed context; If the first binary number is equal to U, the value of the first variable is determined to be the first zero-run value.
15. The method according to claim 14, characterized in that The method further comprises: If the first binary number is equal to V, the value of the first variable is updated from the second value to the sum of the second value and F; Among them, F is a positive integer, and U is not equal to V.
16. The method according to claim 15, characterized in that The method further comprises: If the sum of the second value and F is less than E, obtaining a second binary number using a fixed context; The context index value used by the first binary number is different from the context index value used by the second binary number.
17. The method according to any one of claims 13 to 16, characterized in that Before determining the value of the first variable as the first value, the method further includes: If the value of the second variable is less than G, a third binary number is obtained using a fixed context; G is a positive integer; If the third binary number is equal to U, obtaining a fourth binary number; The sum of the value of the first variable and the fourth binary number is determined as the first zero-run value.
18. The method according to claim 17, characterized in that The method further comprises: If the third binary number is equal to V, the value of the first variable is updated from the third value to the sum of the third value and H, and the value of the second variable is updated from the fourth value to the sum of the fourth value and L; Wherein, H and L are both positive integers, and U is not equal to V.
19. The method according to claim 18, characterized in that The method further comprises: If the sum of the fourth value and L is less than G, obtaining a fifth binary number using a fixed context; The context index value used by the third binary number is different from the context index value used by the fifth binary number.
20. The method according to any one of claims 2 to 8, characterized in that The determining the first zero-run value based on the second intermediate value comprises: Determine whether the first zero-run value is a value between 0 and M, where M is a positive integer; If the first zero-run value is not a value between 0 and M, the sum of the second intermediate value and M+1 is determined as the first zero-run value.
21. The method according to claim 20, characterized in that The determining whether the first zero-run value is a value between 0 and M includes: Determine the i-th flag bit among the M+1 flag bits; Among them, the value of the i-th flag bit indicates whether the first zero run value is equal to i-1; the values of the first i-1 flag bits among the M+1 flag bits indicate that the first zero run value is not equal to a value between 0 and i-2.
22. The method according to claim 21, characterized in that The determining the i-th flag bit among the M+1 flag bits includes: The i-th flag bit is determined using a fixed context, no context, or an adaptive context.
23. The method according to any one of claims 1 to 22, characterized in that The obtaining of the first parameter and the second parameter comprises: The first parameter is determined using a first entropy decoding algorithm.
24. The method according to claim 23, characterized in that The first entropy decoding algorithm is a Columbus decoding algorithm.
25. The method according to any one of claims 1 to 22, characterized in that The obtaining of the first parameter and the second parameter comprises: The second parameter is determined using a fixed context.
26. The method according to claim 25, characterized in that The determining the second parameter by using a fixed context includes: The first binary number in the second parameter is determined using a fixed context.
27. The method according to any one of claims 1 to 22, characterized in that The obtaining of the first parameter and the second parameter comprises: The second parameter is determined without using a context.
28. The method according to any one of claims 1 to 22, characterized in that The obtaining of the first parameter and the second parameter comprises: The second parameter is determined using an adaptive context.
29. The method according to claim 28, characterized in that The determining the second parameter by using the adaptive context includes: Determine a first index value based on a priori information of the current binary number in the second parameter; The current binary number is determined based on the context indicated by the first index value.
30. The method according to claim 29, characterized in that The prior information includes at least one of the following: The attribute coefficient of the decoded point, the context index value adopted by the decoded point, the decoded zero run value, the context index value adopted by the decoded zero run value, and the binary number determined in the second parameter.
31. The method according to claim 30, characterized in that The first index value is a one-dimensional index value determined based on the determined binary number.
32. The method according to any one of claims 1 to 31, characterized in that The method further comprises: Determine a first flag bit; the value of the first flag bit indicates whether the first zero-run value is determined based on the first parameter and the second parameter.
33. The method according to any one of claims 1 to 32, characterized in that The method further comprises: The first zero-run value is determined as the number of points whose attribute coefficients are zero and continuous.
34. The method according to claim 33, characterized in that The attribute coefficient being zero includes that each color component is zero; or the attribute coefficient being zero includes that the reflectivity is zero.
35. A coding method, characterized in that: include: Get the first zero run value; determining a first parameter and a second parameter based on the first zero-run value; The first parameter and the second parameter are encoded.
36. The method according to claim 35, characterized in that The determining of the first parameter and the second parameter based on the first zero-run value comprises: Subtract 0 from the first zero-run value to obtain a third intermediate value; 0 is a positive integer; Based on the third intermediate value, the first parameter and the second parameter are determined.
37. The method according to claim 36, characterized in that The determining the first parameter and the second parameter based on the third intermediate value includes: The third intermediate value bit is shifted right by P bits to obtain the first parameter and the second parameter; the first parameter is the value obtained after the third intermediate value bit is shifted right by P bits; the second parameter includes the P-bit binary number shifted out when the third intermediate value bit is shifted right by P bits; P is a positive integer.
38. The method according to claim 36, characterized in that The determining the first parameter and the second parameter based on the third intermediate value includes: The third intermediate value is bit-shifted right P times to obtain the first parameter and the second parameter; the number of shift bits for each bit-shift right of the third intermediate value is 1, and the first parameter is the value obtained after the third intermediate value is bit-shifted right P times; the second parameter includes P binary numbers shifted out when the third intermediate value is bit-shifted right P times; P is a positive integer.
39. The method according to any one of claims 36 to 38, characterized in that The step of subtracting 0 from the first zero-run value to obtain a third intermediate value comprises: If the first zero-run value is greater than or equal to E×F+G×H, a difference between the first zero-run value and E×F+G×H is determined as the third intermediate value; Among them, E, F, H, and G are all positive integers.
40. The method according to claim 37, characterized in that Before determining the first parameter and the second parameter based on the first zero-run value, the method further includes: Get the value of the third variable; If the value of the third variable is less than the first minimum value, a binary number whose value is V is encoded using a fixed context, and L is added to the value of the third variable; The first minimum value is the minimum value of the first zero-run value and E, and L is a positive integer.
41. The method according to claim 40, characterized in that The method further comprises: If the first zero-run value is less than E×F, a binary number with a value of U is encoded using a fixed context; U is not equal to V.
42. The method according to claim 40 or 41, characterized in that The method further comprises: If the first zero-run value is greater than or equal to E×F, a value obtained by subtracting E×F from the first zero-run value is divided by H to obtain a first quotient value; Determine the value of the fourth variable; If the value of the fourth variable is less than the second minimum value, a binary number whose value is V is encoded using a fixed context, and L is added to the current value of the fourth variable; The second minimum value is the minimum value of the first quotient and G.
43. The method according to claim 42, characterized in that The method further comprises: If the first zero-run value is less than E×F+G×H, a binary number with a value of U is encoded using a fixed context, and the remainder of the first quotient value is encoded.
44. The method according to any one of claims 36 to 38, characterized in that The step of subtracting 0 from the first zero-run value to obtain a third intermediate value comprises: Determine whether the first zero-run value is a value between 0 and M, where M is a positive integer; If the first zero-run value is not a value between 0 and M, the difference between the first zero-run value and M+1 is determined as the third intermediate value.
45. The method according to claim 44, characterized in that The determining whether the first zero-run value is a value between 0 and M includes: Determine the i-th flag bit among the M+1 flag bits; The value of the i-th flag bit indicates whether the first zero-run value is equal to i-1, and the values of the first i-1 flag bits among the M+1 flag bits indicate that the first zero-run value is not equal to a value between 0 and i-2; The method further comprises: The i-th flag bit is encoded.
46. The method according to claim 45, characterized in that The encoding of the i-th flag bit includes: The i-th flag bit is encoded using a fixed context, no context, or an adaptive context.
47. The method according to claim 35, characterized in that The determining of the first parameter and the second parameter based on the first zero-run value comprises: The first zero-run value bit is shifted right by P bits to obtain the first parameter and the second parameter; the first parameter is the value obtained after the first zero-run value bit is shifted right by P bits, and the second parameter includes the P-bit binary number shifted out when the first zero-run value bit is shifted right by P bits; P is a positive integer.
48. The method according to claim 35, characterized in that The determining of the first parameter and the second parameter based on the first zero-run value comprises: The first zero-run value bit is shifted right P times to obtain the first parameter and the second parameter; the number of shift bits for each right shift of the first zero-run value is 1, and the first parameter is the value obtained after the first zero-run value bit is shifted right P times; the second parameter includes P binary numbers shifted out when the first zero-run value bit is shifted right P times; P is a positive integer.
49. The method according to any one of claims 35 to 48, characterized in that The encoding of the first parameter and the second parameter comprises: The first parameter is encoded using a first entropy coding algorithm.
50. The method according to claim 49, characterized in that The first entropy coding algorithm is a Golomb coding algorithm.
51. The method according to any one of claims 35 to 50, characterized in that The encoding of the first parameter and the second parameter comprises: The second parameter is encoded using a fixed context.
52. The method according to claim 51, characterized in that The encoding the second parameter by using a fixed context includes: The first binary number in the second parameter is encoded using a fixed context.
53. The method according to any one of claims 35 to 50, characterized in that The encoding of the first parameter and the second parameter comprises: The second parameter is encoded without using a context.
54. The method according to any one of claims 35 to 50, characterized in that The encoding of the first parameter and the second parameter comprises: The second parameter is encoded using an adaptive context.
55. The method according to claim 54, characterized in that The encoding the second parameter by using the adaptive context includes: Determine a first index value based on a priori information of the current binary number in the second parameter; The current binary number is encoded based on the context indicated by the first index value.
56. The method according to claim 55, characterized in that The prior information includes at least one of the following: The attribute coefficient of the encoded point, the context index value adopted by the encoded point, the encoded zero run value, the context index value adopted by the encoded zero run value, and the binary number determined in the second parameter.
57. The method according to claim 56, characterized in that The first index value is a one-dimensional index value determined based on the determined binary number.
58. The method according to any one of claims 35 to 57, characterized in that The method further comprises: Determine a first flag bit; the value of the first flag bit indicates whether to encode the first parameter and the second parameter; The first flag bit is encoded.
59. The method according to any one of claims 35 to 58, characterized in that The obtaining of the first zero run value comprises: The number of points whose attribute coefficients are zero and continuous is determined as the first zero-run value.
60. The method according to claim 59, characterized in that The attribute coefficient being zero includes that each color component is zero; or the attribute coefficient being zero includes that the reflectivity is zero.
61. A decoder, characterized in that include: An acquisition unit, used to acquire a first parameter and a second parameter; A determination unit is used to determine a first zero-run value based on the first parameter and the second parameter.
62. A coding method, characterized in that include: An acquisition unit, used for acquiring a first zero-run value; a determining unit, configured to determine a first parameter and a second parameter based on the first zero-run value; An encoding unit, configured to encode the first parameter and the second parameter.
63. A decoder, characterized in that include: a processor adapted to execute a computer program; A computer-readable storage medium having a computer program stored therein, wherein the computer program, when executed by the processor, implements the method according to any one of claims 1 to 34.
64. An encoder, characterized in that include: a processor adapted to execute a computer program; A computer-readable storage medium having a computer program stored therein, wherein the computer program, when executed by the processor, implements the method according to any one of claims 35 to 60.
65. A computer-readable storage medium, characterized in that Used to store a computer program, the computer program causing a computer to execute the method according to any one of claims 1 to 34 or the method according to any one of claims 35 to 60.
66. A computer program product comprising a computer program / instructions, characterized in that The computer program / instructions, when executed by a processor, implement the method according to any one of claims 1 to 34 or the method according to any one of claims 35 to 60.
67. A code stream, characterized in that The code stream is a code stream decoded by the method according to any one of claims 1 to 34 or a code stream generated by the method according to any one of claims 35 to 60.