WO2024119420A1 - Encoding method, decoding method, code stream, encoder, decoder, and storage medium - Google Patents

Encoding method, decoding method, code stream, encoder, decoder, and storage medium Download PDF

Info

Publication number
WO2024119420A1
WO2024119420A1 PCT/CN2022/137381 CN2022137381W WO2024119420A1 WO 2024119420 A1 WO2024119420 A1 WO 2024119420A1 CN 2022137381 W CN2022137381 W CN 2022137381W WO 2024119420 A1 WO2024119420 A1 WO 2024119420A1
Authority
WO
WIPO (PCT)
Prior art keywords
value
identification information
syntax element
element identification
zero
Prior art date
Application number
PCT/CN2022/137381
Other languages
French (fr)
Chinese (zh)
Inventor
魏红莲
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2022/137381 priority Critical patent/WO2024119420A1/en
Publication of WO2024119420A1 publication Critical patent/WO2024119420A1/en

Links

Images

Definitions

  • the present application relates to the field of point cloud encoding and decoding technology, and in particular to an encoding and decoding method, a bit stream, an encoder, a decoder and a storage medium.
  • the geometric information and attribute information of the point cloud are encoded separately.
  • the attribute quantization residual of each point can be encoded/decoded in turn according to a preset order.
  • zero_run_length is used to count whether the attribute quantization residual is 0, which can be called the zero-run value.
  • the Point Cloud Reference Model (PCRM) uses a context model-based encoding/decoding method for all binarized codewords, which brings great difficulty to hardware implementation and reduces hardware throughput.
  • the present application provides a coding and decoding method, a bit stream, an encoder, a decoder and a storage medium, which can improve the hardware throughput.
  • an embodiment of the present application provides a decoding method, which is applied to a decoder, and the method includes:
  • the preset parameter meets the first preset condition, performing a context model-based decoding process on at least one first-category syntax element identification information, and performing a bypass model-based decoding process on at least one second-category syntax element identification information, to determine a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information;
  • a zero run value is determined according to a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information.
  • an embodiment of the present application provides an encoding method, which is applied to an encoder, and the method includes:
  • the value of at least one first-category syntax element identification information is coded based on the context model, and the value of at least one second-category syntax element identification information is coded based on the bypass model, and the obtained coded bits are written into the bitstream.
  • an embodiment of the present application provides a code stream, which is generated by bit encoding according to information to be encoded; wherein the information to be encoded includes at least one of the following:
  • first grammatical element identification information first grammatical element identification information
  • second grammatical element identification information third grammatical element identification information
  • fourth grammatical element identification information fifth grammatical element identification information
  • sixth grammatical element identification information sixth grammatical element identification information
  • seventh grammatical element identification information eighth grammatical element identification information, first numerical identification information and second numerical identification information.
  • an embodiment of the present application provides an encoder, the encoder comprising a first determining unit and an encoding unit; wherein,
  • a first determining unit is configured to determine a zero-run value and a preset parameter corresponding to the zero-run value; and determine a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information according to the zero-run value;
  • the encoding unit is configured to, if the preset parameter meets the first preset condition, perform context model-based encoding processing on the value of at least one first-category syntax element identification information, and perform bypass model-based encoding processing on the value of at least one second-category syntax element identification information, and write the obtained encoded bits into the bitstream.
  • an embodiment of the present application provides an encoder, the encoder comprising a first memory and a first processor; wherein,
  • a first memory for storing a computer program that can be run on the first processor
  • the first processor is used to execute the method described in the second aspect when running a computer program.
  • an embodiment of the present application provides a decoder, the decoder comprising a second determining unit and a decoding unit; wherein,
  • a second determining unit is configured to determine a preset parameter corresponding to the zero-run value
  • a decoding unit configured to, if the preset parameter meets the first preset condition, perform a decoding process on at least one first-category syntax element identification information based on a context model, and perform a decoding process on at least one second-category syntax element identification information based on a bypass model, and determine a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information;
  • the second determination unit is further configured to determine a zero run value according to a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information.
  • an embodiment of the present application provides a decoder, the decoder comprising a second memory and a second processor; wherein:
  • a second memory for storing a computer program that can be run on a second processor
  • the second processor is used to execute the method described in the first aspect when running the computer program.
  • an embodiment of the present application provides a computer-readable storage medium, which stores a computer program.
  • the computer program When executed, it implements the method described in the first aspect, or implements the method described in the second aspect.
  • the embodiment of the present application provides a coding and decoding method, a bitstream, an encoder, a decoder and a storage medium.
  • a zero run value and a preset parameter corresponding to the zero run value are determined; according to the zero run value, the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information are determined; if the preset parameter meets the first preset condition, the value of at least one first-category syntax element identification information is encoded based on a context model, and the value of at least one second-category syntax element identification information is encoded based on a bypass model, and the obtained encoded bits are written into the bitstream.
  • a preset parameter corresponding to the zero run value is determined; if the preset parameter meets the first preset condition, the at least one first-category syntax element identification information is decoded based on a context model, and the at least one second-category syntax element identification information is decoded based on a bypass model, and the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information are determined; according to the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information, the zero run value is determined.
  • the number of codewords based on the context model used in encoding and decoding can be limited, so that some syntax element identification information is encoded and decoded using a bypass model, thereby improving the hardware throughput and reducing the difficulty of hardware implementation; it can also improve the processing speed.
  • FIG1A is a schematic diagram of a three-dimensional point cloud image provided in an embodiment of the present application.
  • FIG1B is a partially enlarged schematic diagram of a three-dimensional point cloud image provided in an embodiment of the present application.
  • FIG2A is a schematic diagram of a point cloud image at different viewing angles provided in an embodiment of the present application.
  • FIG2B is a schematic diagram of a data storage format corresponding to FIG2A provided in an embodiment of the present application.
  • FIG3 is a schematic diagram of a network architecture of point cloud encoding and decoding provided in an embodiment of the present application
  • FIG4 is a schematic diagram of the structure of a point cloud encoder provided in an embodiment of the present application.
  • FIG5 is a schematic diagram of the structure of a point cloud decoder provided in an embodiment of the present application.
  • FIG6 is a schematic diagram of a flow chart of a decoding method provided in an embodiment of the present application.
  • FIG7 is a detailed flowchart of a decoding method provided in an embodiment of the present application.
  • FIG8 is a schematic diagram of a flow chart of an encoding method provided in an embodiment of the present application.
  • FIG9 is a schematic diagram of a detailed flow chart of an encoding method provided in an embodiment of the present application.
  • FIG10 is a schematic diagram of the structure of an encoder provided in an embodiment of the present application.
  • FIG11 is a schematic diagram of a specific hardware structure of an encoder provided in an embodiment of the present application.
  • FIG12 is a schematic diagram of the structure of a decoder provided in an embodiment of the present application.
  • FIG13 is a schematic diagram of a specific hardware structure of a decoder provided in an embodiment of the present application.
  • FIG. 14 is a schematic diagram of the composition structure of a coding and decoding system provided in an embodiment of the present application.
  • first ⁇ second ⁇ third involved in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that “first ⁇ second ⁇ third” can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
  • Point Cloud is a three-dimensional representation of the surface of an object.
  • Point cloud (data) on the surface of an object can be collected through acquisition equipment such as photoelectric radar, lidar, laser scanner, and multi-view camera.
  • a point cloud is a set of discrete points that are irregularly distributed in space and express the spatial structure and surface properties of a three-dimensional object or scene.
  • FIG1A shows a three-dimensional point cloud image
  • FIG1B shows a partial magnified view of the three-dimensional point cloud image. It can be seen that the point cloud surface is composed of densely distributed points.
  • Two-dimensional images have information expressed at each pixel point, and the distribution is regular, so there is no need to record its position information additionally; however, the distribution of points in point clouds in three-dimensional space is random and irregular, so it is necessary to record the position of each point in space in order to fully express a point cloud.
  • each position in the acquisition process has corresponding attribute information, usually RGB color values, and the color value reflects the color of the object; for point clouds, in addition to color information, the attribute information corresponding to each point is also commonly the reflectance value, which reflects the surface material of the object. Therefore, the points in the point cloud can include the location information of the point and the attribute information of the point.
  • the location information of the point can be the three-dimensional coordinate information (x, y, z) of the point.
  • the location information of the point can also be called the geometric information of the point.
  • the attribute information of the point can include color information (three-dimensional color information) and/or reflectance (one-dimensional reflectance information r), etc.
  • the color information can be information on any color space.
  • the color information can be RGB information. Among them, R represents red (Red, R), G represents green (Green, G), and B represents blue (Blue, B).
  • the color information may be luminance and chrominance (YCbCr, YUV) information, where Y represents brightness (Luma), Cb (U) represents blue color difference, and Cr (V) represents red color difference.
  • the points in the point cloud may include the three-dimensional coordinate information of the points and the reflectivity value of the points.
  • the points in the point cloud may include the three-dimensional coordinate information of the points and the three-dimensional color information of the points.
  • a point cloud obtained by combining the principles of laser measurement and photogrammetry may include the three-dimensional coordinate information of the points, the reflectivity value of the points and the three-dimensional color information of the points.
  • Figure 2A and 2B a point cloud image and its corresponding data storage format are shown.
  • Figure 2A provides six viewing angles of the point cloud image
  • Figure 2B 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.
  • the point cloud is in the ".ply" format, represented by ASCII code, with a total number of 207242 points, and each point has three-dimensional coordinate information (x, y, z) and three-dimensional color information (r, g, b).
  • Point clouds can be divided into the following categories according to the way they are obtained:
  • Static point cloud the object is stationary, and the device that obtains the point cloud is also stationary;
  • Dynamic point cloud The object is moving, but the device that obtains the point cloud is stationary;
  • Dynamic point cloud acquisition The device used to acquire the point cloud is in motion.
  • point clouds can be divided into two categories according to their usage:
  • Category 1 Machine perception point cloud, which can be used in autonomous navigation systems, real-time inspection systems, geographic information systems, visual sorting robots, emergency rescue robots, etc.
  • Category 2 Point cloud perceived by the human eye, which can be used in point cloud application scenarios such as digital cultural heritage, free viewpoint broadcasting, 3D immersive communication, and 3D immersive interaction.
  • Point clouds can flexibly and conveniently express the spatial structure and surface properties of three-dimensional objects or scenes. Point clouds are obtained by directly sampling real objects, so 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.
  • Point clouds can be collected mainly through the following methods: computer generation, 3D laser scanning, 3D photogrammetry, etc.
  • 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.
  • 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.
  • the number of points in each point cloud frame is 700,000, and each point has coordinate information xyz (float) and color information RGB (uchar).
  • the point cloud is a collection of massive points, storing the point cloud will not only consume a lot of memory, but also be inconvenient for transmission. There is also not enough bandwidth to support direct transmission of the point cloud at the network layer without compression. Therefore, the point cloud needs to be compressed.
  • the point cloud coding framework that can compress point clouds can be the geometry-based point cloud compression (G-PCC) codec framework or the video-based point cloud compression (V-PCC) codec framework provided by the Moving Picture Experts Group (MPEG), or the AVS-PCC codec framework provided by the Audio Video Standard (AVS).
  • G-PCC codec framework can be used to compress the first type of static point cloud and the third type of dynamically acquired point cloud, and the V-PCC codec framework can be used to compress the second type of dynamic point cloud.
  • the G-PCC codec framework is also called the point cloud codec TMC13, and the V-PCC codec framework is also called the point cloud codec TMC2.
  • FIG3 is a schematic diagram of a network architecture of a point cloud encoding and decoding provided by the embodiment of the present application.
  • the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, wherein the electronic devices 13 to 1N can perform video interaction through the communication network 01.
  • the electronic device can be various types of devices with point cloud encoding and decoding functions.
  • the electronic device can include a mobile phone, a tablet computer, a personal computer, a personal digital assistant, a navigator, a digital phone, a video phone, a television, a sensor device, a server, etc., which is not limited by the embodiment of the present application.
  • the decoder or encoder in the embodiment of the present application can be the above-mentioned electronic device. That is to say, the electronic device in the embodiment of the present application has the point cloud encoding and decoding function, generally including a point cloud encoder (ie, encoder) and a point cloud decoder (ie, decoder).
  • the electronic device in the embodiment of the present application has the point cloud encoding and decoding function, generally including a point cloud encoder (ie, encoder) and a point cloud decoder (ie, decoder).
  • the following uses the AVS-PCC encoding and decoding framework as an example to illustrate the point cloud compression technology.
  • point cloud compression generally adopts the method of compressing point cloud geometry information and attribute information separately.
  • the point cloud geometry information is first encoded in the geometry encoder, and then the reconstructed geometry information is input into the attribute encoder as additional information to assist in the compression of point cloud attributes;
  • the point cloud geometry information is first decoded in the geometry decoder, and then the decoded geometry information is input into the attribute decoder as additional information to assist in the compression of point cloud attributes.
  • the entire codec consists of pre-processing/post-processing, geometry encoding/decoding, and attribute encoding/decoding.
  • the embodiment of the present application provides a point cloud encoder, as shown in FIG4 , which is a framework of the point cloud compression reference platform PCRM provided by AVS.
  • the point cloud encoder 11 includes a geometry encoder: a coordinate translation unit 111, a coordinate quantization unit 112, an octree construction unit 113, a geometry entropy encoder 114, and a geometry reconstruction unit 115.
  • An attribute encoder an attribute recoloring unit 116, a color space conversion unit 117, a first attribute prediction unit 118, a quantization unit 119, and an attribute entropy encoder 1110.
  • the original geometric information is first preprocessed, and the geometric origin is normalized to the minimum position in the point cloud space through the coordinate translation unit 111, and the geometric information is converted from floating point numbers to integers through the coordinate quantization unit 112 to facilitate subsequent regularization processing; then the regularized geometric information is geometrically encoded, and the point cloud space is recursively divided using an octree structure in the octree construction unit 113, and the current point is divided into eight sub-blocks of the same size each time, and the occupation codeword of each sub-block is judged.
  • the sub-block does not contain a point, it is recorded as empty, otherwise it is recorded as non-empty.
  • the occupation codeword information of all blocks is recorded in the last layer of the recursive division and encoded; the geometric information expressed by the octree structure is input into the geometric entropy encoder 114 to form a geometric code stream on the one hand, and is geometrically reconstructed in the geometric reconstruction unit 115 on the other hand, and the reconstructed geometric information is input into the attribute encoder as additional information.
  • the original attribute information is first preprocessed. Since the geometric information changes after geometric encoding, the attribute value is reallocated to each point after geometric encoding through the attribute recoloring unit 116 to achieve attribute recoloring.
  • the processed attribute information is color information
  • the original color information needs to be transformed into a YUV color space that is more in line with the visual characteristics of the human eye through the color space conversion unit 117; then the preprocessed attribute information is attribute encoded through the first attribute prediction unit 118.
  • Attribute encoding first requires the point cloud to be reordered, and the reordering method is Morton code, so the traversal order of attribute encoding is Morton order.
  • the attribute prediction method in PCRM is a single-point prediction based on the Morton order, that is, trace back one point from the current point to be encoded (current point) according to the Morton order, and the node found is the prediction reference point of the current point to be encoded, and then the attribute reconstruction value of the prediction reference point is used as the attribute prediction value, and the attribute residual value is the difference between the attribute original value and the attribute prediction value of the current point to be encoded; finally, the attribute residual value is quantized by the quantization unit 119, and the quantized residual information is input into the attribute entropy encoder 1110 to form an attribute code stream.
  • the embodiment of the present application also provides a point cloud decoder, as shown in FIG5 , which is a framework of the point cloud compression reference platform PCRM provided by AVS.
  • the point cloud decoder 12 includes a geometric decoder: a geometric entropy decoder 121, an octree reconstruction unit 122, a coordinate inverse quantization unit 123, and a coordinate inverse translation unit 124.
  • An attribute decoder an attribute entropy decoder 125, an inverse quantization unit 126, a second attribute prediction unit 127, and a color space inverse transformation unit 128.
  • the geometry bitstream is first entropy decoded by the geometry entropy decoder 121 to obtain the geometry information of each node, and then the octree structure is constructed by the octree reconstruction unit 122 in the same way as the geometry encoding.
  • the geometry information expressed by the octree structure after coordinate transformation is reconstructed in combination with the decoded geometry.
  • the information is dequantized by the coordinate dequantization unit 123 and detranslated by the coordinate detranslation unit 124 to obtain the decoded geometry information.
  • it is input into the attribute decoder as additional information.
  • the Morton order is constructed in the same way as the encoding end.
  • the attribute code stream is first entropy decoded by the attribute entropy decoder 125 to obtain the quantized residual information; then the inverse quantization unit 126 performs inverse quantization to obtain the attribute residual value; similarly, in the same way as the attribute encoding, the attribute prediction value of the current point to be decoded is obtained by the second attribute prediction unit 127, and then the attribute prediction value is added to the attribute residual value to restore the attribute reconstruction value (for example, YUV attribute value) of the current point to be decoded; finally, the decoded attribute information is obtained by color space inverse transformation by the color space inverse transformation unit 128.
  • Condition 1 The geometric position is limitedly lossy and the attributes are lossy;
  • Condition 3 The geometric position is lossless, and the attributes are limitedly lossy
  • Condition 4 The geometric position and attributes are lossless.
  • the general test sequence 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 Cat1C point cloud contains both color and reflectivity attribute information.
  • Attribute compression adopts a transformation-based method, which includes two transformation algorithms, one is the wavelet transform algorithm, and the other is the k-ary discrete cosine transform (DCT) algorithm.
  • DCT discrete cosine transform
  • the current AVS-PCC uses run-length coding for attribute quantization residuals.
  • the codec uses the same order (for example, the original acquisition order of the point cloud, Morton bidirectional, Hilbert order, etc.) to encode/decode the attribute quantization residual of each point in turn, and zero_run_length is used to count whether the attribute quantization residual is 0, which can be called a zero run value.
  • the current PCRM uses context model-based encoding/decoding for all binarized codewords when encoding zero run values, which will bring great difficulty to hardware implementation. Because hardware can usually process 4 to 6 bypass model-encoded binary codewords (bins) in one clock cycle, but can only process 1 context model-encoded bin. From the perspective of hardware throughput, if the context model is fully used to encode all bins, the hardware throughput efficiency will be relatively low.
  • an embodiment of the present application provides a coding and decoding method, whether it is an encoding end or a decoding end, first determine the preset parameters corresponding to the zero run value, and then judge whether the preset parameters meet the first preset conditions; if the preset parameters meet the first preset conditions, then at least one first-category syntax element identification information is coded and decoded based on the context model, and at least one second-category syntax element identification information is coded and decoded based on the bypass model; in this way, according to the determined preset parameters, the number of codewords based on the context model used in coding and decoding can be limited, so that part of the syntax element identification information is coded and decoded using the bypass model, thereby improving the hardware throughput, reducing the difficulty of hardware implementation, and facilitating hardware implementation; and it can also improve the processing speed.
  • FIG6 a schematic flow chart of a decoding method provided by an embodiment of the present application is shown. As shown in FIG6 , the method may include:
  • S601 Determine the preset parameters corresponding to the zero-run value.
  • the decoding method of the embodiment of the present application is applied to a decoder.
  • the decoding method may specifically refer to a zero-run decoding method; more specifically, a zero-run decoding method that limits the number of codewords based on a context model to improve hardware throughput.
  • the zero run value is represented by zero_run_length, and zero_run_length is used to indicate whether the attribute quantization residual values are all 0.
  • the attribute quantization residual value can include one of the following: the color component quantization residual value and the reflectivity quantization residual value.
  • the color component quantization residual value may include: the quantization residual value Res 0 of the first color component, the quantization residual value Res 1 of the second color component, and the quantization residual value Res 2 of the third color component.
  • the zero-run value is specifically used to indicate whether the quantization residual values of the three color components are all 0.
  • the decoded zero-run value is greater than 0, it can be said that the quantization residual values of the three color components of the current node are all 0; if the decoded zero-run value is equal to 0, it can be said that the quantization residual values of the three color components of the current node are not all 0.
  • the first color component, the second color component and the third color component may be in RGB format, or may be in YUV format, or may even be in other formats.
  • the order of the three color components taking YUV as an example, may be in YUV order, UYV order, UVY order, or even VYU order, etc., that is, the format and order of the color components are not specifically limited here.
  • the zero run value is specifically used to indicate whether the reflectivity quantization residual value is 0.
  • the decoded zero run value is greater than 0, it can be said that the reflectivity quantization residual value of the current node is 0; if the decoded zero run value is equal to 0, it can be said that the reflectivity quantization residual value of the current node is not 0.
  • how to determine the attribute quantization residual value of the current node may further include:
  • the code stream is decoded to determine the attribute quantization residual value of the current node; and the step of decoding the zero-run value is continued to determine the attribute quantization residual value of the next node according to the new zero-run value.
  • the zero-run value zero_run_length is decoded first; taking the color component quantization residual value as an example, if zero_run_length is greater than 0, it means that the quantization residual values of the three color components of the current node are all 0, then the --zero_run_length operation is required, and then the next node is processed; if zero_run_length is equal to 0, it means that the quantization residual values of the three color components of the current node are not all 0, then it is necessary to first decode the bit stream to determine the quantization residual values of the three color components of the current node (Res 0 , Res 1 , Res 2 ), and then continue to decode the zero-run value zero_run_length, and then process the next node.
  • the preset parameter is represented by remBinsPass1, where the preset parameter is used to represent the budget number of codewords based on the context model allocated to zero run values.
  • the value of the preset parameter can be set to 2 24 , but is not specifically limited.
  • the preset parameter may be a pre-set parameter value or may be determined by a bitstream. Therefore, in some embodiments, determining the preset parameter corresponding to the zero run value may include: decoding the bitstream to determine the preset parameter corresponding to the zero run value. In other words, the encoder may write the value of the preset parameter into the bitstream, and then the decoder may obtain the value of the preset parameter by decoding the bitstream.
  • At least one first-category syntax element identification information is decoded based on the context model, and at least one second-category syntax element identification information is decoded based on the bypass model to determine the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information.
  • the preset parameter meets the first preset condition, which may include: determining that the value of the preset parameter is greater than or equal to the preset threshold value.
  • the preset threshold value may be a judgment value preset according to the hardware configuration. Exemplarily, the preset threshold value may be set to 4, or may be set to 8, or may even be set to other values, which are not specifically limited here.
  • the method may further include:
  • At least one first-category syntax element identification information and at least one second-category syntax element identification information are both decoded based on the bypass model to determine the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information.
  • the preset parameter meets the second preset condition, which may include: determining that the preset parameter does not meet the first preset condition; or determining that the value of the preset parameter is less than a preset threshold value.
  • the hardware can usually process 4 to 6 codewords decoded based on the bypass model in one clock cycle, but can only process 1 codeword decoded based on the context model; considering the hardware throughput, the decoding method proposed in the embodiment of the present application can avoid the situation where all codewords are decoded based on the context model.
  • a portion of the syntax elements (such as at least one first-category syntax element identification information) can be decoded based on the context model, and another portion of the syntax elements (such as at least one second-category syntax element identification information) can be decoded based on the bypass model; if the value of the preset parameter is less than the preset threshold value, then all syntax elements (such as at least one first-category syntax element identification information and at least one second-category syntax element identification information) can be decoded based on the bypass model.
  • the method may further include: for at least one first-category syntax element identification information, after each first-category syntax element identification information is decoded based on the context model, performing a subtraction operation on the value of the preset parameter.
  • a context model-based decoding method is used, and each time a first-category syntax element identification information is decoded, a --remBinsPass1 operation needs to be performed.
  • S603 Determine a zero run value according to a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information.
  • the zero run value can be determined based on the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information.
  • the zero run value when the zero run value is less than a preset threshold, the zero run value can be determined only by the value of at least one first-category syntax element identification information.
  • the method may further include:
  • the at least one first-category syntax element identification information is decoded based on the context model to determine the value of the at least one first-category syntax element identification information; and the zero run value is determined according to the value of the at least one first-category syntax element identification information; or,
  • At least one first-category syntax element identification information is decoded based on the bypass model to determine the value of at least one first-category syntax element identification information; and a zero run value is determined based on the value of at least one first-category syntax element identification information.
  • the zero run value is equal to 0, or whether the zero run value is equal to 1, or whether the zero run value is equal to 2, or whether the quotient of the zero run value minus a preset constant divided by 2 is equal to 0, equal to 1, and so on, thereby determining the zero run value.
  • the embodiment of the present application provides a decoding method, which determines the preset parameters corresponding to the zero-run value; if the preset parameters meet the first preset condition, at least one first-category syntax element identification information is decoded based on the context model, and at least one second-category syntax element identification information is decoded based on the bypass model to determine the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information; the zero-run value is determined according to the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information.
  • the number of codewords based on the context model used in decoding can be limited, so that part of the syntax element identification information is decoded using the bypass model, thereby improving the hardware throughput and reducing the difficulty of hardware implementation; and it can also improve the processing speed.
  • Figure 7 shows a detailed flow chart of a decoding method provided by an embodiment of the present application.
  • the method may include:
  • S701 Determine the preset parameters corresponding to the zero-run value.
  • S702 Determine whether the preset parameter is greater than or equal to the preset threshold value.
  • At least one first-category syntax element identification information that may appear is decoded based on the context model, and at least one second-category syntax element identification information that may appear is decoded based on the bypass model to determine the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information.
  • decoding is performed on at least one first-category syntax element identification information and at least one second-category syntax element identification information that may appear based on the bypass model to determine the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information.
  • S705 Determine a zero run value according to a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information.
  • At least one first-category syntax element identification information and at least one second-category syntax element identification information are not specifically limited.
  • at least one first-category syntax element identification information includes at least one of the following: first syntax element identification information, second syntax element identification information, third syntax element identification information, and fourth syntax element identification information; and at least one second-category syntax element identification information includes at least: first numerical identification information.
  • the first syntax element identification information is used to indicate whether the zero run value is equal to 0
  • the second syntax element identification information is used to indicate whether the zero run value is equal to 1
  • the third syntax element identification information is used to indicate whether the zero run value is equal to 2
  • the fourth syntax element identification information is used to indicate the parity characteristic of the first numerical value obtained after the zero run value is subjected to the first operation
  • the first numerical value identification information is used to indicate the second numerical value obtained after the zero run value is subjected to the second operation.
  • performing a first operation on the zero-run value may include: performing a subtraction operation on the zero-run value and a first preset value to obtain a first value.
  • performing a second operation on the zero-run value may include: performing a subtraction operation on the zero-run value and the first preset value to obtain a first value; and setting the second value to be equal to a quotient of the first value divided by 2.
  • the method may further include: performing a right shift operation on the first value by one position to obtain the second value.
  • the first preset value can be set to 3, but is not specifically limited.
  • the first syntax element identification information can be represented by zero_run_length_equal_zero
  • the second syntax element identification information can be represented by zero_run_length_equal_one
  • the third syntax element identification information can be represented by zero_run_length_equal_two
  • the fourth syntax element identification information can be represented by zero_run_length_minus3_parity
  • the first numerical identification information can be represented by zero_run_length_minus3_div2.
  • decoding the zero run value may include: decoding the first syntax element identification information, the second syntax element identification information, the third syntax element identification information and the fourth syntax element identification information based on the context model to determine the value of at least one first-category syntax element identification information; and decoding the first numerical identification information that may appear based on the bypass model to determine the value of the first numerical identification information; determining the zero run value according to the value of at least one first-category syntax element identification information and the value of the first numerical identification information.
  • decoding the zero run value may include:
  • the value of the first syntax element identification information is the first value, determining that the zero run value is equal to 0;
  • the value of the first syntax element identification information is the second value, decoding the second syntax element identification information based on the context model to determine the value of the second syntax element identification information;
  • the value of the second syntax element identification information is the second value, decoding the third syntax element identification information based on the context model to determine the value of the third syntax element identification information;
  • the value of the third syntax element identification information is the second value, decoding the fourth syntax element identification information based on the context model to determine the value of the fourth syntax element identification information; and decoding the first numerical identification information based on the bypass model to determine the value of the first numerical identification information;
  • a zero run value is determined according to the first preset value, the value of the fourth syntax element identification information, and the value of the first numerical value identification information.
  • the method may further include: after each decoding of the following syntax element identification information based on the context model is completed, performing a subtraction operation on the value of the preset parameter:
  • first syntax element identification information second syntax element identification information, third syntax element identification information and fourth syntax element identification information.
  • decoding the zero run value may include: decoding the first syntax element identification information, the second syntax element identification information, the third syntax element identification information, the fourth syntax element identification information and the first numerical identification information that may appear based on the bypass model to determine the zero run value. That is, if the preset parameters meet the second preset condition, then all binary codewords corresponding to the zero run value are decoded using the bypass model.
  • decoding the zero run value may include:
  • the value of the first syntax element identification information is the first value, determining that the zero run value is equal to 0;
  • the value of the first syntax element identification information is the second value, decoding the second syntax element identification information based on the bypass model to determine the value of the second syntax element identification information;
  • the value of the second syntax element identification information is the second value, decoding the third syntax element identification information based on the bypass model to determine the value of the third syntax element identification information;
  • a zero run value is determined according to the first preset value, the value of the fourth syntax element identification information, and the value of the first numerical value identification information.
  • the corresponding first value and the second value may be the same, or may be different, and no specific limitation is made here.
  • each syntax element identification information may be a parameter written in the profile or a value of a flag bit/identifier, which is not specifically limited here.
  • the first value may be set to 1 and the second value may be set to 0; or, the first value may be set to 0 and the second value may be set to 1; or, the first value may be set to true and the second value may be set to false; or, the first value may be set to false and the second value may be set to true.
  • the first value is set to 1 and the second value is set to 0, but this is not specifically limited.
  • the value of the third syntax element identification information is 1, then it can be determined that the zero run value is equal to 2; otherwise, if the value of the third syntax element identification information is 0, it means that the zero run value is not equal to 2, then it is necessary to continue decoding the fourth syntax element identification information and the first numerical identification information to determine the zero run value.
  • decoding the first numerical identification information based on a bypass model to determine the value of the first numerical identification information may include: decoding the first numerical identification information based on the bypass model to determine at least one binary symbol corresponding to the first numerical identification information; debinarizing at least one binary symbol to obtain the value of the first numerical identification information.
  • the codeword corresponding to the first numerical identification information is decoded based on the bypass model to obtain a set of binary symbols 011. Then, after the debinarization process, the value of the first numerical identification information is 3.
  • the fourth syntax element identification information is used to indicate the parity characteristic of the first value obtained by subtracting the first preset value from the zero run value.
  • the method may further include: if the value of the fourth syntax element identification information is the first value, determining that the first value is an odd number; if the value of the fourth syntax element identification information is the second value, determining that the first value is an even number;
  • the value of the fourth syntax element identification information is the first value, it is determined that the remainder after the first value is divided by 2 is 1; if the value of the fourth syntax element identification information is the second value, it is determined that the remainder after the first value is divided by 2 is 0.
  • the zero run value if the first value is an odd number, the zero run value needs to be added by 1; if the first value is an even number, the zero run value needs to be added by 0. That is, the zero run value is determined according to the first preset value, the value of the first value identification information, and the value of the fourth syntax element identification information.
  • determining the zero run value based on the first preset value, the value of the fourth syntax element identification information and the value of the first numerical identification information may include: performing a third operation on the value of the first numerical identification information to obtain a third numerical value; determining the zero run value based on the first preset value, the third numerical value and the value of the fourth syntax element identification information.
  • performing a third operation on the value of the first numerical identification information to obtain a third numerical value may include: multiplying the value of the first numerical identification information by 2 to obtain the third numerical value; or shifting the value of the first numerical identification information left by one position to obtain the third numerical value.
  • determining the zero run value based on the values of the first preset value, the third numerical value, and the fourth syntax element identification information may include: adding the first preset value, the third numerical value, and the values of the fourth syntax element identification information to obtain the zero run value.
  • the fourth syntax element identification information is represented by zero_run_length_minus3_parity
  • run-length decoding is used for the attribute quantization residual value, and the specific implementation steps are as follows:
  • the attribute quantization residual value is the color component quantization residual value.
  • the decoding end uses the same order (the original acquisition order of the point cloud, Morton order, Hilbert order, etc.) to decode the quantized residual values (Res 0 , Res 1 , Res 2 ) of the three color components of each node in turn.
  • Zero_run_length is used to count whether the quantized residual values of the three color components are all 0, which is called the zero run value. Its initial value is set to 0. For each node, the details are as follows:
  • zero_run_length If zero_run_length>0, it means that the quantized residual values of the three color components of the current node are all zero, then perform the --zero_run_length operation, and then process the next node;
  • the attribute quantization residual value is the reflectance quantization residual value.
  • the decoding end uses the same order (the original acquisition order of the point cloud, Morton order, Hilbert order, etc.) to decode the reflectivity quantization residual value of each node in turn.
  • Zero_run_length is used to count whether the reflectivity quantization residual value is 0, which is called the zero run value. Its initial value is set to 0. For each node, the details are as follows:
  • zero_run_length If zero_run_length>0, it means that the reflectivity quantization residual value of the current node is zero, then perform the --zero_run_length operation, and then process the next node;
  • the specific zero run value decoding process is:
  • the zero_run_length_equal_zero flag is 0;
  • the zero_run_length_equal_one flag is 0;
  • the zero_run_length_equal_two flag is 0;
  • the zero_run_length_minus3_parity flag is 1;
  • zero_run_length_minus3_div2 is 3, and 3 is binarized.
  • the result of binarizing 3 is 0 1 1;
  • the binarized codeword result is 0 0 0 1 0 1 1.
  • all codewords after the zero-run value is binarized are decoded in a context model-based manner, which will bring great difficulty to hardware implementation. Based on this, in the embodiment of the present application, the decoding process can be as follows:
  • At least one first-category grammatical element identification information includes at least one of the following: first grammatical element identification information, second grammatical element identification information, third grammatical element identification information, fourth grammatical element identification information, fifth grammatical element identification information, sixth grammatical element identification information, seventh grammatical element identification information and eighth grammatical element identification information; and at least one second-category grammatical element identification information includes at least: second numerical identification information.
  • the first syntax element identification information is used to indicate whether the zero run value is equal to 0, the second syntax element identification information is used to indicate whether the zero run value is equal to 1, the third syntax element identification information is used to indicate whether the zero run value is equal to 2, the fourth syntax element identification information is used to indicate the parity characteristic of the first numerical value obtained after the zero run value is subjected to the first operation, the fifth syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 0, the sixth syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 1, the seventh syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 2, the eighth syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 3, and the second numerical value identification information is used to indicate the fourth numerical value obtained after the zero run value is subjected to the fourth
  • performing a first operation on the zero-run value may include: performing a subtraction operation on the zero-run value and a first preset value to obtain a first value.
  • performing a second operation on the zero-run value may include: performing a subtraction operation on the zero-run value and a first preset value to obtain a first value; and setting the second value to be equal to a quotient of the first value divided by 2.
  • performing a fourth operation on the zero-run value may include: performing a subtraction operation on the zero-run value and a first preset value to obtain a first value; setting the second value to be equal to the quotient of the first value divided by 2; and performing a subtraction operation on the second value and a second preset value to obtain a fourth value.
  • the method may further include: right-shifting the first value by one bit to obtain a second value.
  • the first preset value and the second preset value may be different.
  • the first preset value may be set to 3, and the second preset value may be set to 4.
  • the first syntax element identification information may be represented by zero_run_length_equal_zero
  • the second syntax element identification information may be represented by zero_run_length_equal_one
  • the third syntax element identification information may be represented by zero_run_length_equal_two
  • the fourth syntax element identification information may be represented by zero_run_length_minus3_parity
  • the fifth syntax element identification information may be represented by zero_run_length_minus3_div2_equal_zero
  • the sixth syntax element identification information may be represented by zero_run_length_minus3_div2_equal_one
  • the seventh syntax element identification information may be represented by zero_run_length_minus3_div2_equal_two
  • the eighth syntax element identification information may be represented by zero_run_length_minus3_div2_equal_three
  • the second value identification information may be represented by
  • decoding the zero run value may include: decoding the first grammatical element identification information, the second grammatical element identification information, the third grammatical element identification information, the fourth grammatical element identification information, the fifth grammatical element identification information, the sixth grammatical element identification information, the seventh grammatical element identification information and the eighth grammatical element identification information based on the context model to determine the value of at least one first-category grammatical element identification information; and decoding the second numerical identification information that may appear based on the bypass model to determine the value of the second numerical identification information; determining the zero run value according to the value of at least one first-category grammatical element identification information and the value of the second numerical identification information.
  • decoding the zero run value may include:
  • the value of the first syntax element identification information is the first value, determining that the zero run value is equal to 0;
  • the value of the first syntax element identification information is the second value, decoding the second syntax element identification information based on the context model to determine the value of the second syntax element identification information;
  • the value of the second syntax element identification information is the second value, decoding the third syntax element identification information based on the context model to determine the value of the third syntax element identification information;
  • the value of the fifth syntax element identification information is the first value, determining that the zero run value is equal to the sum of the first preset value and the value of the fourth syntax element identification information;
  • the value of the fifth syntax element identification information is the second value, decoding the sixth syntax element identification information based on the context model to determine the value of the sixth syntax element identification information;
  • the value of the sixth syntax element identification information is the first value, determining that the zero run value is equal to the sum of the first constant, the first preset value and the value of the fourth syntax element identification information;
  • the value of the sixth grammar element identification information is the second value, decoding the seventh grammar element identification information based on the context model to determine the value of the seventh grammar element identification information;
  • the value of the seventh syntax element identification information is the first value, determining that the zero run value is equal to the sum of the second constant, the first preset value and the value of the fourth syntax element identification information;
  • the value of the seventh syntax element identification information is the second value, decoding the eighth syntax element identification information based on the context model to determine the value of the eighth syntax element identification information;
  • the value of the eighth syntax element identification information is the first value, determining that the zero run value is equal to the sum of the third constant, the first preset value and the value of the fourth syntax element identification information;
  • the value of the eighth syntax element identification information is the second value, decoding the second numerical identification information based on the bypass model to determine the value of the second numerical identification information;
  • the zero run value is determined according to the first preset value, the value of the fourth syntax element identification information and the value of the second numerical identification information.
  • the method may further include: after each decoding of the following syntax element identification information based on the context model is completed, performing a subtraction operation on the value of the preset parameter:
  • first grammatical element identification information second grammatical element identification information, third grammatical element identification information, fourth grammatical element identification information, fifth grammatical element identification information, sixth grammatical element identification information, seventh grammatical element identification information and eighth grammatical element identification information.
  • decoding the zero run value may include: decoding the first syntax element identification information, the second syntax element identification information, the third syntax element identification information, the fourth syntax element identification information, the fifth syntax element identification information, the sixth syntax element identification information, the seventh syntax element identification information, the eighth syntax element identification information and the second numerical identification information that may appear based on the bypass model to determine the zero run value. That is, if the preset parameters meet the second preset condition, then all binary codewords corresponding to the zero run value are decoded using the bypass model.
  • decoding the zero run value may include:
  • the value of the first syntax element identification information is the first value, determining that the zero run value is equal to 0;
  • the value of the first syntax element identification information is the second value, decoding the second syntax element identification information based on the bypass model to determine the value of the second syntax element identification information;
  • the value of the second syntax element identification information is the second value, decoding the third syntax element identification information based on the bypass model to determine the value of the third syntax element identification information;
  • the value of the fifth syntax element identification information is the first value, determining that the zero run value is equal to the sum of the first preset value and the value of the fourth syntax element identification information;
  • the value of the fifth syntax element identification information is the second value, decoding the sixth syntax element identification information based on the bypass model to determine the value of the sixth syntax element identification information;
  • the value of the sixth syntax element identification information is the first value, determining that the zero run value is equal to the sum of the first constant, the first preset value and the value of the fourth syntax element identification information;
  • the value of the sixth syntax element identification information is the second value, decoding the seventh syntax element identification information based on the bypass model to determine the value of the seventh syntax element identification information;
  • the value of the seventh syntax element identification information is the first value, determining that the zero run value is equal to the sum of the second constant, the first preset value and the value of the fourth syntax element identification information;
  • the value of the seventh syntax element identification information is the second value, decoding the eighth syntax element identification information based on the bypass model to determine the value of the eighth syntax element identification information;
  • the value of the eighth syntax element identification information is the first value, determining that the zero run value is equal to the sum of the third constant, the first preset value and the value of the fourth syntax element identification information;
  • the value of the eighth syntax element identification information is the second value, decoding the second numerical identification information based on the bypass model to determine the value of the second numerical identification information;
  • the zero run value is determined according to the first preset value, the value of the fourth syntax element identification information and the value of the second numerical identification information.
  • the first constant, the second constant and the third constant are all multiples of 2.
  • the first constant is set to 2
  • the second constant is set to 4
  • the third constant is set to 6.
  • the corresponding first value and the second value may be the same, or may be different, and there is no specific limitation here.
  • each syntax element identification information may be a parameter written in the profile or a value of a flag bit/identifier, which is not specifically limited here.
  • the first value may be set to 1, and the second value may be set to 0; or, the first value may be set to 0, and the second value may be set to 1; or, the first value may be set to true, and the second value may be set to false; or, the first value may be set to false, and the second value may be set to true.
  • the first value is set to 1, and the second value is set to 0, but this is not specifically limited.
  • the value of the third syntax element identification information is 1, then it can be determined that the zero run value is equal to 2; otherwise, if the value of the third syntax element identification information is 0, it means that the zero run value is not equal to 2, then it is necessary to continue decoding the fourth syntax element identification information and the fifth syntax element identification information. If the value of the fifth syntax element identification information is 1, then it can be determined that the zero run value is equal to 1.
  • the value is equal to the sum of 3 and the value of the fourth grammatical element identification information; if the value of the fifth grammatical element identification information is 0, it is necessary to continue decoding the sixth grammatical element identification information, and if the value of the sixth grammatical element identification information is 1, it can be determined that the zero-run value is equal to the sum of 5 and the value of the fourth grammatical element identification information; if the value of the sixth grammatical element identification information is 0, it is necessary to continue decoding the seventh grammatical element identification information, and if the value of the seventh grammatical element identification information is 1, it can be determined that the zero-run value is equal to the sum of 7 and the value of the fourth grammatical element identification information; if the value of the seventh grammatical element identification information is 0, it is necessary to continue decoding the eighth grammatical element identification information, and if the value of the eighth grammatical element identification information is 1, it can be determined that the zero-run value is equal to the sum of 9 and the
  • decoding the second numerical identification information based on a bypass model to determine the value of the second numerical identification information may include: decoding the second numerical identification information based on the bypass model to determine at least one binary symbol corresponding to the second numerical identification information; debinarizing at least one binary symbol to obtain the value of the second numerical identification information.
  • the fourth syntax element identification information is used to indicate the parity characteristic of the first value obtained by subtracting the first preset value from the zero run value, that is, the remainder after the first value is divided by 2. If the first value is an odd number, the zero run value needs to be added by 1; if the first value is an even number, the zero run value needs to be added by 0. In other words, the zero run value is determined according to the first preset value, the value of the second value identification information, and the value of the fourth syntax element identification information.
  • determining the zero run value according to the first preset value, the value of the fourth syntax element identification information, and the value of the second numerical identification information includes:
  • a zero run value is determined according to the first preset value, the second operation result, and the value of the fourth syntax element identification information.
  • determining the first operation result based on the value of the second numerical identification information and the second preset value may include: performing an addition operation on the value of the second numerical identification information and the second preset value to determine the first operation result.
  • performing the fifth operation on the first operation result to obtain the second operation result may include: multiplying the first operation result by 2 to obtain the second operation result; or shifting the first operation result left by one bit to obtain the second operation result.
  • determining the zero run value based on the first preset value, the second operation result and the value of the fourth syntax element identification information may include: adding the first preset value, the second operation result and the value of the fourth syntax element identification information to obtain the zero run value.
  • the fourth syntax element identification information is represented by zero_run_length_minus3_parity
  • run decoding is used for the attribute quantization residual value, and the specific zero run value decoding process is:
  • the decoding process may be as follows:
  • Table 3 and Table 4 are the test results of the prediction branch.
  • Table 3 is the test result corresponding to the test condition -- lossless geometry, limit-lossy attributes (C3-lossless geometry,limit-lossy attributes), and
  • Table 4 is the test result corresponding to the test condition -- lossless geometry, lossless attributes (C4-lossless geometry,lossless attributes).
  • Tables 5, 6, 7 and 8 are test results of multi-layer transform branches.
  • Table 5 is the test result corresponding to the test condition ---- limited lossy geometry, lossy attributes (C1-limit-lossy geometry, lossy attributes)
  • Table 6 is the test result corresponding to the test condition ---- lossless geometry, lossy attributes (C2-lossless geometry, lossy attributes)
  • Table 7 is the test result corresponding to the test condition ---- lossless geometry, limited lossy attributes (C3-lossless geometry, limit-lossy attributes)
  • Table 8 is the test result corresponding to the test condition ---- lossless geometry, lossless attributes (C4-lossless geometry, lossless attributes).
  • Tables 9 and 10 are the test results of the resource-constrained prediction transformation branch.
  • Table 9 is the test result corresponding to the test condition ---- limited-lossy geometry, lossy attributes (C1-limit-lossy geometry, lossy attributes), and
  • Table 10 is the test result corresponding to the test condition ---- lossless geometry, lossy attributes (C2-lossless geometry, lossy attributes).
  • Table 11 and Table 12 are the test results of the prediction transformation branch with unlimited resources.
  • Table 11 is the test result corresponding to the test condition ---- limited lossy geometry, lossy attributes (C1-limit-lossy geometry, lossy attributes), and
  • Table 12 is the test result corresponding to the test condition ---- lossless geometry, lossy attributes (C2-lossless geometry, lossy attributes).
  • the present embodiment provides a decoding method, and the specific implementation of the aforementioned embodiment is elaborated in detail through the aforementioned embodiment. It can be seen that according to the technical scheme of the aforementioned embodiment, the preset parameters corresponding to the zero-run value are first determined, and then it is determined whether the preset parameters meet the first preset condition; if the preset parameters meet the first preset condition, then at least one first-category syntax element identification information is decoded based on the context model, and at least one second-category syntax element identification information is decoded based on the bypass model; in this way, according to the determined preset parameters, the number of codewords based on the context model used in decoding can be limited, so that part of the syntax element identification information is decoded using the bypass model, thereby improving the hardware throughput and reducing the difficulty of hardware implementation; and it can also improve the processing speed.
  • FIG8 a schematic diagram of a flow chart of an encoding method provided in an embodiment of the present application is shown. As shown in FIG8 , the method may include:
  • S801 Determine a zero-run value and preset parameters corresponding to the zero-run value.
  • the encoding method of the embodiment of the present application is applied to an encoder.
  • the encoding method may specifically refer to a zero-run encoding method; more specifically, a zero-run encoding method that limits the number of codewords based on a context model.
  • the zero run value is represented by zero_run_length, and zero_run_length is used to indicate whether the attribute quantization residual values are all 0.
  • the attribute quantization residual value can include one of the following: the color component quantization residual value and the reflectivity quantization residual value.
  • the color component quantization residual value may include: the quantization residual value Res 0 of the first color component, the quantization residual value Res 1 of the second color component, and the quantization residual value Res 2 of the third color component.
  • the zero run value is specifically used to indicate whether the quantization residual values of the three color components are all 0.
  • the reflectivity quantization residual value there is only one reflectivity quantization residual value at this time, and the zero run value is specifically used to indicate whether the reflectivity quantization residual value is 0.
  • the first color component, the second color component and the third color component may be in RGB format, or may be in YUV format, or may even be in other formats.
  • the order of the three color components taking YUV as an example, it may be in YUV order, or in UYV order, or in UVY order, or even in VYU order, etc., that is, the format and order of the color components are not specifically limited here.
  • determining the zero run value may include:
  • attribute quantization residual value of the current node is equal to 0, then the zero run value is added by 1, and the zero run value is further determined according to the attribute quantization residual value of the next node;
  • the zero-run value is encoded, and the attribute quantization residual value of the current node is encoded, and the obtained encoding bits are written into the bitstream; and the zero-run value is reset to 0, and the zero-run value is continued to be determined according to the attribute quantization residual value of the next node.
  • the method may further include: setting an initial value of the zero-run value equal to 0.
  • the initial value of zero_run_length is 0.
  • the attribute quantization residual value is first determined. Taking the color component quantization residual value as an example, if the quantization residuals of the three color components are all zero, then ++zero_run_length is used, and then the next node is processed; if the quantization residual value of any of the three color components is not zero, the zero run value is first encoded, and then the zero run value zero_run_length is reset to 0, and then the specific color component quantization residual value (Res 0 , Res 1 , Res 2 ) is encoded, and then the next node is processed.
  • the quantized residual values of its three color components are all 0, then ++zero_run_length is used and the zero run value is encoded; if the quantized residual value of any of its three color components is not zero, the zero run value is encoded first, then the zero run value zero_run_length is reset to 0, and then the specific color component quantized residual value (Res 0 , Res 1 , Res 2 ) is encoded, and finally the zero run value is encoded.
  • the preset parameter is represented by remBinsPass1, where the preset parameter is used to represent the budget number of codewords based on the context model allocated to zero run values.
  • the value of the preset parameter can be set to 2 24 , but is not specifically limited.
  • the preset parameter may be a pre-set parameter value, or the value of the preset parameter may be written into the bitstream. Therefore, in some embodiments, the method may further include: encoding the preset parameter corresponding to the zero run value, and writing the obtained encoding bits into the bitstream. In this way, the value of the preset parameter may be obtained by decoding the bitstream at the decoding end.
  • S802 Determine, according to the zero run value, a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information.
  • the zero run value it can be represented by syntax element identification information.
  • the first syntax element identification information is used to indicate whether the zero run value is equal to 0
  • the second syntax element identification information is used to indicate whether the zero run value is equal to 1
  • the third syntax element identification information is used to indicate whether the zero run value is equal to 2, etc.
  • the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information can be determined.
  • the preset parameter meets the first preset condition, which may include: determining that the value of the preset parameter is greater than or equal to the preset threshold value.
  • the preset threshold value may be a judgment value preset according to the hardware configuration. Exemplarily, the preset threshold value may be set to 4, or 8, or even other values, which are not specifically limited here.
  • the method may further include: if the preset parameters meet the second preset conditions, encoding processing based on the bypass model is performed on at least one first-category syntax element identification information and at least one second-category syntax element identification information, and the obtained encoding bits are written into the bitstream.
  • the preset parameter meets the second preset condition, which may include: determining that the preset parameter does not meet the first preset condition; or determining that the value of the preset parameter is less than a preset threshold value.
  • the hardware can usually process 4 to 6 codewords encoded based on the bypass model in one clock cycle, but can only process 1 codeword encoded based on the context model; considering the hardware throughput, the encoding method proposed in the embodiment of the present application can avoid the situation where all codewords are encoded based on the context model.
  • a part of the syntax elements (such as at least one first-category syntax element identification information) can be encoded based on the context model, and another part of the syntax elements (such as at least one second-category syntax element identification information) can be encoded based on the bypass model; if the value of the preset parameter is less than the preset threshold value, then all syntax elements (such as at least one first-category syntax element identification information and at least one second-category syntax element identification information) can be encoded based on the bypass model.
  • the method may further include: for at least one first-category syntax element identification information, after each encoding of a first-category syntax element identification information is completed based on the context model, performing a subtraction operation on the value of the preset parameter.
  • a context model-based encoding method is used, and when each first-category syntax element identification information is encoded, a --remBinsPass1 operation needs to be performed.
  • the zero run value when the zero run value is less than a preset threshold, the zero run value can be determined only by the value of at least one first-category syntax element identification information.
  • the method may further include:
  • a context model-based encoding process is performed on the value of at least one first-category syntax element identification information, and the obtained encoding bits are written into the bitstream; or,
  • a bypass model-based encoding process is performed on the value of at least one first-category syntax element identification information, and the obtained encoding bits are written into the bitstream.
  • the encoding process can be performed only on the value indicating one first-category syntax element identification information.
  • the reflectivity quantization residual value As an example, it is assumed that there is a set of reflectivity quantization residual values: 2310004501; then in the encoding process, since the first value is 2, the zero run value is 0 at this time, the zero run value is encoded first and then 2 is encoded; the second value is 3, the zero run value is 0 at this time, the zero run value is encoded first and then 3 is encoded; the third value is 1, the zero run value is 0 at this time, the zero run value is encoded first and then 1 is encoded; the fourth value is 0, the zero run value is added by 1 at this time, that is, the zero run value is 1; the fifth value is 0, and the zero run value continues to be added by 1 , that is, the zero run value is 2; the sixth value is 0, and the zero run value continues to increase by 1, that is, the zero run value is 3; the seventh value is 4, at this time, you need to encode the zero run value 3 first, then reset the zero run value to 0, and then continue to encode 4; the
  • the embodiment of the present application provides a coding method, which determines a zero-run value and a preset parameter corresponding to the zero-run value; determines the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information according to the zero-run value; if the preset parameter meets the first preset condition, performs a context-based coding process on the value of at least one first-category syntax element identification information, and performs a bypass-model-based coding process on the value of at least one second-category syntax element identification information, and writes the obtained coded bits into a bitstream.
  • the number of codewords based on the context model used in coding can be limited, so that part of the syntax element identification information is coded using the bypass model, thereby improving the hardware throughput and reducing the difficulty of hardware implementation; and also improving the processing speed.
  • Figure 9 shows a detailed flow chart of an encoding method provided by an embodiment of the present application.
  • the method may include:
  • S901 Determine the preset parameters corresponding to the zero-run value.
  • S902 Determine whether the preset parameter is greater than or equal to a preset threshold value.
  • S903 If the preset parameter is greater than or equal to the preset threshold value, encoding is performed on at least one first-category syntax element identification information that may appear based on the context model, and encoding is performed on at least one second-category syntax element identification information that may appear based on the bypass model, and the obtained encoding bits are written into the bitstream.
  • At least one first-category syntax element identification information indicating a zero-run value and at least one second-category syntax element identification information are not specifically limited.
  • at least one first-category syntax element identification information includes at least one of the following: first syntax element identification information, second syntax element identification information, third syntax element identification information, and fourth syntax element identification information; and at least one second-category syntax element identification information includes at least: first numerical identification information.
  • the first syntax element identification information is used to indicate whether the zero run value is equal to 0
  • the second syntax element identification information is used to indicate whether the zero run value is equal to 1
  • the third syntax element identification information is used to indicate whether the zero run value is equal to 2
  • the fourth syntax element identification information is used to indicate the parity characteristic of the first numerical value obtained after the zero run value is subjected to the first operation
  • the first numerical value identification information is used to indicate the second numerical value obtained after the zero run value is subjected to the second operation.
  • performing a first operation on the zero-run value may include: performing a subtraction operation on the zero-run value and a first preset value to obtain a first value.
  • performing a second operation on the zero-run value may include: performing a subtraction operation on the zero-run value and the first preset value to obtain a first value; and setting the second value to be equal to a quotient of the first value divided by 2.
  • the method may further include: performing a right shift operation on the first value by one position to obtain the second value.
  • the first preset value can be set to 3, but is not specifically limited.
  • the first syntax element identification information can be represented by zero_run_length_equal_zero
  • the second syntax element identification information can be represented by zero_run_length_equal_one
  • the third syntax element identification information can be represented by zero_run_length_equal_two
  • the fourth syntax element identification information can be represented by zero_run_length_minus3_parity
  • the first numerical identification information can be represented by zero_run_length_minus3_div2.
  • encoding the zero run value may include: encoding the first syntax element identification information, the second syntax element identification information, the third syntax element identification information and the fourth syntax element identification information that may appear based on the context model, and encoding the first numerical identification information that may appear based on the bypass model, and writing the obtained encoded bits into the bitstream.
  • encoding the zero run value may include:
  • the value of the first syntax element identification information is the second value, determining the value of the second syntax element identification information according to the zero run value;
  • the value of the second syntax element identification information is the second value, determining the value of the third syntax element identification information according to the zero run value;
  • the value of the third syntax element identification information is the second value, determining the value of the fourth syntax element identification information and the value of the first numerical value identification information according to the zero run value;
  • the value of the fourth syntax element identification information is encoded based on the context model, and the value of the first numerical identification information is encoded based on the bypass model, and the obtained encoded bits are written into the bitstream.
  • the method may further include: after encoding the following syntax element identification information based on the context model each time, performing a subtraction operation on the value of the preset parameter:
  • first syntax element identification information second syntax element identification information, third syntax element identification information and fourth syntax element identification information.
  • encoding the zero run value may include: encoding the first syntax element identification information, the second syntax element identification information, the third syntax element identification information, the fourth syntax element identification information and the first numerical identification information that may appear based on the bypass model, and writing the obtained encoding bits into the bitstream. That is, if the preset parameters meet the second preset condition, then all binary codewords corresponding to the zero run value are encoded using the bypass model.
  • encoding the zero run value may include:
  • the value of the first syntax element identification information is the second value, determining the value of the second syntax element identification information according to the zero run value;
  • the value of the second syntax element identification information is the second value, determining the value of the third syntax element identification information according to the zero run value;
  • the value of the third syntax element identification information is the second value, determining the value of the fourth syntax element identification information and the value of the first numerical value identification information according to the zero run value;
  • the value of the fourth syntax element identification information is encoded based on the bypass model, and the value of the first numerical identification information is encoded based on the bypass model, and the obtained encoded bits are written into the bitstream.
  • determining the value of the first syntax element identification information according to the zero run value may include:
  • the value of the first syntax element identification information is determined to be the first value; if the zero-run value is not equal to 0, the value of the first syntax element identification information is determined to be the second value.
  • determining the value of the second syntax element identification information according to the zero run value may include:
  • the value of the second syntax element identification information is determined to be the first value; if the zero-run value is not equal to 1, the value of the second syntax element identification information is determined to be the second value.
  • determining the value of the third syntax element identification information according to the zero run value may include:
  • the value of the third syntax element identification information is determined to be the first value; if the zero-run value is not equal to 2, the value of the third syntax element identification information is determined to be the second value.
  • determining the value of the fourth syntax element identification information according to the zero run value may include:
  • the first value is an odd number, determining that the value of the fourth syntax element identification information is the first value; if the first value is an even number, determining that the value of the fourth syntax element identification information is the second value;
  • the value of the fourth syntax element identification information is determined to be the first value; if the remainder when the first value is divided by 2 is 0, the value of the fourth syntax element identification information is determined to be the second value.
  • the corresponding first value and the second value may be the same, or may be different, and no specific limitation is made here.
  • each syntax element identification information may be a parameter written in the profile or a value of a flag bit/identifier, which is not specifically limited here.
  • the first value may be set to 1 and the second value may be set to 0; or, the first value may be set to 0 and the second value may be set to 1; or, the first value may be set to true and the second value may be set to false; or, the first value may be set to false and the second value may be set to true.
  • the first value is set to 1 and the second value is set to 0, but this is not specifically limited.
  • these syntax element identification information can be obtained by decoding the bit stream to determine the zero run value.
  • encoding the value of the first numerical identification information based on the bypass model may include: binarizing the value of the first numerical identification information to obtain at least one binary symbol; encoding the at least one binary symbol in turn based on the bypass model, and writing the obtained encoded bits into the code stream.
  • how to determine the value of the first numerical identification information based on the zero-run value may include: performing a subtraction operation between the zero-run value and a first preset value to obtain a first numerical value; and setting the value of the first numerical identification information to be equal to the quotient of the first numerical value divided by 2.
  • 3 is first binarized.
  • a group of binary symbols 011 are obtained; then this group of binary symbols is encoded in turn based on the bypass model, and the obtained coded bits are written into the code stream.
  • run-length encoding is used for the attribute quantization residual value, and the specific implementation steps are as follows:
  • the attribute quantization residual value is the color component quantization residual value.
  • the encoding end uses the same order (the original acquisition order of the point cloud, Morton order, Hilbert order, etc.) to encode the quantized residual values (Res 0 , Res 1 , Res 2 ) of the three color components of each node in turn.
  • Zero_run_length is used to count whether the quantized residual values of the three color components are all 0, which is called the zero run value. Its initial value is set to 0. For each node, the details are as follows:
  • the zero run value is encoded first, then the zero run value zero_run_length is reset to 0, and then the specific color component quantized residual value (Res 0 , Res 1 , Res 2 ) is encoded, and then the next node is processed.
  • the quantized residual values of its three color components are all 0, then ++zero_run_length is used and the zero run value is encoded; if the quantized residual value of any of its three color components is not zero, the zero run value is encoded first, then the zero run value zero_run_length is reset to 0, and then the specific color component quantized residual value (Res 0 , Res 1 , Res 2 ) is encoded, and finally the zero run value is encoded.
  • the attribute quantization residual value is the reflectance quantization residual value.
  • the encoding end uses the same order (the original acquisition order of the point cloud, Morton order, Hilbert order, etc.) to encode the reflectivity quantization residual value of each node in turn.
  • Zero_run_length is used to count whether the reflectivity quantization residual value is 0, which is called the zero run value. Its initial value is set to 0. For each node, the details are as follows:
  • the zero run value is encoded first, then the zero run value zero_run_length is reset to 0, and then the specific reflectivity quantization residual value is encoded, and then the next node is processed.
  • step d) using "zero_run_length_equal_two" to mark whether the zero run value is equal to 2, encoding the "zero_run_length_equal_two” flag bit, if the zero run value is 2, then encoding the zero run value is completed; otherwise, proceed to step d);
  • zero_run_length_minus3_parity to mark the parity of the zero run value minus 3, that is, the remainder of the zero run value minus 3 divided by 2, and "zero_run_length_minus3_div2" is the quotient of the zero run value minus 3 divided by 2. Encode the "zero_run_length_minus3_parity” flag and the "zero_run_length_minus3_div2" value, and the encoding of the zero run value is completed.
  • PCRM when encoding zero run values, PCRM currently uses a context model-based encoding method for all binarized code words. For example, if the zero run value to be encoded is 10, the binarization process is:
  • the zero_run_length_equal_zero flag is 0;
  • the zero_run_length_equal_one flag is 0;
  • the zero_run_length_equal_two flag is 0;
  • the zero_run_length_minus3_parity flag is 1;
  • zero_run_length_minus3_div2 is 3, and 3 is binarized.
  • the result of binarizing 3 is 0 1 1;
  • the binarized codeword result is 0 0 0 1 0 1 1.
  • all codewords after the zero-run value is binarized are encoded in a context model-based manner, which will bring great difficulty to hardware implementation and the hardware throughput efficiency is relatively low. Based on this, in the embodiment of the present application, the encoding process can be as follows:
  • At least one first-category grammatical element identification information includes at least one of the following: first grammatical element identification information, second grammatical element identification information, third grammatical element identification information, fourth grammatical element identification information, fifth grammatical element identification information, sixth grammatical element identification information, seventh grammatical element identification information and eighth grammatical element identification information; and at least one second-category grammatical element identification information includes at least: second numerical identification information.
  • the first syntax element identification information is used to indicate whether the zero run value is equal to 0, the second syntax element identification information is used to indicate whether the zero run value is equal to 1, the third syntax element identification information is used to indicate whether the zero run value is equal to 2, the fourth syntax element identification information is used to indicate the parity characteristic of the first numerical value obtained after the zero run value is subjected to the first operation, the fifth syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 0, the sixth syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 1, the seventh syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 2, the eighth syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 3, and the second numerical value identification information is used to indicate the fourth numerical value obtained after the zero run value is subjected to the fourth
  • performing a first operation on the zero-run value may include: performing a subtraction operation on the zero-run value and a first preset value to obtain a first value.
  • performing a second operation on the zero-run value may include: performing a subtraction operation on the zero-run value and a first preset value to obtain a first value; and setting the second value to be equal to a quotient of the first value divided by 2.
  • the method may further include: right-shifting the first value by one bit to obtain a second value.
  • performing a fourth operation on the zero-run value may include: performing a subtraction operation on the zero-run value and a first preset value to obtain a first value; setting the second value to be equal to the quotient of the first value divided by 2; and performing a subtraction operation on the second value and a second preset value to obtain a fourth value.
  • the first preset value and the second preset value may be different.
  • the first preset value may be set to 3, and the second preset value may be set to 4.
  • the first syntax element identification information may be represented by zero_run_length_equal_zero
  • the second syntax element identification information may be represented by zero_run_length_equal_one
  • the third syntax element identification information may be represented by zero_run_length_equal_two
  • the fourth syntax element identification information may be represented by zero_run_length_minus3_parity
  • the fifth syntax element identification information may be represented by zero_run_length_minus3_div2_equal_zero
  • the sixth syntax element identification information may be represented by zero_run_length_minus3_div2_equal_one
  • the seventh syntax element identification information may be represented by zero_run_length_minus3_div2_equal_two
  • the eighth syntax element identification information may be represented by zero_run_length_minus3_div2_equal_three
  • the second value identification information may be represented by
  • encoding the zero run value may include: encoding the first syntax element identification information, the second syntax element identification information, the third syntax element identification information, the fourth syntax element identification information, the fifth syntax element identification information, the sixth syntax element identification information, the seventh syntax element identification information and the eighth syntax element identification information based on the context model, and encoding the second numerical identification information that may appear based on the bypass model, and writing the obtained encoded bits into the bitstream.
  • encoding the zero run value may include:
  • the value of the first syntax element identification information is the second value, determining the value of the second syntax element identification information according to the zero run value;
  • the value of the second syntax element identification information is the second value, determining the value of the third syntax element identification information according to the zero run value;
  • the value of the third syntax element identification information is the second value, determining the value of the fourth syntax element identification information and the value of the fifth syntax element identification information according to the zero run value;
  • the value of the second numerical identification information is encoded based on the bypass model, and the obtained encoded bits are written into the bit stream.
  • the method may further include: after encoding the following syntax element identification information based on the context model each time, performing a subtraction operation on the value of the preset parameter:
  • first grammatical element identification information second grammatical element identification information, third grammatical element identification information, fourth grammatical element identification information, fifth grammatical element identification information, sixth grammatical element identification information, seventh grammatical element identification information and eighth grammatical element identification information.
  • encoding the zero-run value may include: encoding the first syntax element identification information, the second syntax element identification information, the third syntax element identification information, the fourth syntax element identification information, the fifth syntax element identification information, the sixth syntax element identification information, the seventh syntax element identification information, the eighth syntax element identification information, and the second numerical identification information that may appear based on the bypass model, and writing the obtained encoding bits into the bitstream. That is, if the preset parameters meet the second preset condition, then all binary codewords corresponding to the zero-run value are encoded using the bypass model.
  • encoding the zero run value may include:
  • the value of the first syntax element identification information is the second value, determining the value of the second syntax element identification information according to the zero run value;
  • the value of the second syntax element identification information is the second value, determining the value of the third syntax element identification information according to the zero run value;
  • the value of the third syntax element identification information is the second value, determining the value of the fourth syntax element identification information and the value of the fifth syntax element identification information according to the zero run value;
  • the value of the second numerical identification information is encoded based on the bypass model, and the obtained encoded bits are written into the bit stream.
  • determining the value of the first syntax element identification information according to the zero run value may include:
  • the value of the first syntax element identification information is determined to be the first value; if the zero-run value is not equal to 0, the value of the first syntax element identification information is determined to be the second value.
  • determining the value of the second syntax element identification information according to the zero run value may include:
  • the value of the second syntax element identification information is determined to be the first value; if the zero-run value is not equal to 1, the value of the second syntax element identification information is determined to be the second value.
  • determining the value of the third syntax element identification information according to the zero run value may include:
  • the value of the third syntax element identification information is determined to be the first value; if the zero-run value is not equal to 2, the value of the third syntax element identification information is determined to be the second value.
  • determining the value of the fourth syntax element identification information according to the zero run value may include:
  • the first value is an odd number, determining that the value of the fourth syntax element identification information is the first value; if the first value is an even number, determining that the value of the fourth syntax element identification information is the second value;
  • the value of the fourth syntax element identification information is determined to be the first value; if the remainder when the first value is divided by 2 is 0, the value of the fourth syntax element identification information is determined to be the second value.
  • determining the value of the fifth syntax element identification information according to the zero run value may include:
  • the second value is equal to 0, it is determined that the value of the fifth syntax element identification information is the first value; if the second value is not equal to 0, it is determined that the value of the fifth syntax element identification information is the second value.
  • determining the value of the sixth syntax element identification information according to the zero run value may include:
  • the second numerical value is equal to 1, it is determined that the value of the sixth grammatical element identification information is the first value; if the second numerical value is not equal to 1, it is determined that the value of the sixth grammatical element identification information is the second value.
  • determining the value of the seventh syntax element identification information according to the zero run value may include:
  • the second numerical value is equal to 2, it is determined that the value of the seventh grammatical element identification information is the first value; if the second numerical value is not equal to 2, it is determined that the value of the seventh grammatical element identification information is the second value.
  • determining the value of the eighth syntax element identification information according to the zero run value may include:
  • the second numerical value is equal to 3, it is determined that the value of the eighth syntax element identification information is the first value; if the second numerical value is not equal to 3, it is determined that the value of the eighth syntax element identification information is the second value.
  • the corresponding first value and the second value may be the same, or may be different, and there is no specific limitation here.
  • each syntax element identification information may be a parameter written in the profile or a value of a flag bit/identifier, which is not specifically limited here.
  • the first value may be set to 1, and the second value may be set to 0; or, the first value may be set to 0, and the second value may be set to 1; or, the first value may be set to true, and the second value may be set to false; or, the first value may be set to false, and the second value may be set to true.
  • the first value is set to 1, and the second value is set to 0, but this is not specifically limited.
  • first encode the first syntax element identification information to indicate whether the zero run value is equal to 0. If the zero run value is equal to 0, the encoding of the zero run value is completed; otherwise, continue to encode the second syntax element identification information to indicate whether the zero run value is equal to 1. If the zero run value is equal to 1, the encoding of the zero run value is completed; otherwise, continue to encode the third syntax element identification information to indicate whether the zero run value is equal to 2.
  • the encoding of the zero run value is completed; otherwise, continue to encode the fourth syntax element identification information to indicate the parity characteristic of the zero run value minus 3, and encode the fifth syntax element identification information to indicate whether the quotient of the zero run value minus 3 divided by 2 is equal to 0. If the quotient of the zero run value minus 3 divided by 2 is equal to 0, the encoding of the zero run value is completed; otherwise, continue to encode the sixth syntax element identification information to indicate whether the quotient of the zero run value minus 3 divided by 2 is equal to 1.
  • the seventh syntax element identification information is continued to be encoded to indicate whether the quotient of the zero run value minus 3 and then divided by 2 is equal to 2. If the quotient of the zero run value minus 3 and then divided by 2 is equal to 2, the encoding of the zero run value is completed; otherwise, the eighth syntax element identification information is continued to be encoded to indicate whether the quotient of the zero run value minus 3 and then divided by 2 is equal to 3.
  • the second value identification information is continued to be encoded to indicate the value of the quotient of the zero run value minus 3 and then divided by 2 minus 4, and the encoding of the zero run value is completed. In this way, at the decoding end, these syntax element identification information can be obtained by decoding the bit stream to determine the zero run value.
  • encoding the value of the second numerical identification information based on the bypass model may include: binarizing the value of the second numerical identification information to obtain at least one binary symbol; encoding the at least one binary symbol in turn based on the bypass model, and writing the obtained encoded bits into the bit stream.
  • how to determine the value of the second numerical identification information according to the zero run value may include: performing a subtraction operation on the zero run value and the first preset value to obtain the first numerical value; setting the second numerical value to be equal to the quotient of the first numerical value divided by 2; performing a subtraction operation on the second numerical value and the second preset value to determine the value of the second numerical identification information.
  • the first preset value may be set to 3
  • the second preset value may be set to 4.
  • the encoding process may be as follows:
  • an embodiment of the present application also provides a code stream, which is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following: an attribute quantization residual value, a first grammatical element identification information, a second grammatical element identification information, a third grammatical element identification information, a fourth grammatical element identification information, a fifth grammatical element identification information, a sixth grammatical element identification information, a seventh grammatical element identification information, an eighth grammatical element identification information, a first numerical identification information, and a second numerical identification information.
  • the attribute quantization residual value can be a color component quantization residual value or a reflectance quantization residual value.
  • the encoder writes the information to be encoded into the bitstream after encoding it; thus, the decoder can directly obtain the information to be encoded by decoding the bitstream, and then determine the zero run value.
  • the present embodiment provides a coding method, and the specific implementation of the aforementioned embodiment is elaborated in detail through the above embodiment. It can be seen that according to the technical scheme of the aforementioned embodiment, the preset parameters corresponding to the zero-run value are first determined, and then it is determined whether the preset parameters meet the first preset condition; if the preset parameters meet the first preset condition, then at least one first-category syntax element identification information is coded based on the context model, and at least one second-category syntax element identification information is coded based on the bypass model; in this way, according to the determined preset parameters, the number of codewords based on the context model used in encoding can be limited, so that part of the syntax element identification information is coded using the bypass model, thereby improving the hardware throughput and reducing the difficulty of hardware implementation; and it can also improve the processing speed.
  • the encoder 100 may include: a first determining unit 1001 and an encoding unit 1002; wherein,
  • the first determining unit 1001 is configured to determine a zero-run value and a preset parameter corresponding to the zero-run value; and determine a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information according to the zero-run value;
  • the encoding unit 1002 is configured to, if the preset parameters meet the first preset condition, perform context model-based encoding processing on the value of at least one first-category syntax element identification information, and perform bypass model-based encoding processing on the value of at least one second-category syntax element identification information, and write the obtained encoded bits into the bitstream.
  • the encoder 100 further includes a first judgment unit 1003 configured to determine whether the value of a preset parameter is greater than or equal to a preset threshold value.
  • the encoding unit 1002 is further configured to perform bypass model-based encoding processing on at least one first-category syntax element identification information and at least one second-category syntax element identification information if the preset parameters meet the second preset condition, and write the obtained encoded bits into the bitstream.
  • the first judgment unit 1003 is further configured to determine whether the value of the preset parameter is less than a preset threshold value.
  • the encoding unit 1002 is further configured to perform encoding processing on preset parameters corresponding to the zero run value, and write the obtained encoding bits into the bit stream.
  • the first determination unit 1001 is further configured to, if the attribute quantization residual value of the current node is equal to 0, perform a plus 1 operation on the zero-run value, and continue to determine the zero-run value according to the attribute quantization residual value of the next node; if the attribute quantization residual values of the current node are not all equal to 0, encode the zero-run value, and encode the attribute quantization residual value of the current node, and write the obtained encoded bits into the bitstream; and reset the zero-run value to 0, and continue to determine the zero-run value according to the attribute quantization residual value of the next node.
  • the first determining unit 1001 is further configured to set an initial value of the zero-run value equal to 0.
  • the zero-run value is used to indicate whether the attribute quantization residual values are all 0 counts; wherein the attribute quantization residual value includes one of the following: a color component quantization residual value and a reflectance quantization residual value.
  • the first determining unit 1001 is further configured to determine a value of at least one first-category syntax element identification information according to the zero-run value when the zero-run value is less than a preset threshold;
  • the encoding unit 1002 is further configured to, if the preset parameters meet the first preset condition, perform encoding processing based on the context model on the value of at least one first-category syntax element identification information, and write the obtained coded bits into the bitstream; or, if the preset parameters meet the second preset condition, perform encoding processing based on the bypass model on the value of at least one first-category syntax element identification information, and write the obtained coded bits into the bitstream.
  • At least one first-category syntax element identification information includes at least one of the following: first syntax element identification information, second syntax element identification information, third syntax element identification information and fourth syntax element identification information; at least one second-category syntax element identification information includes at least: first numerical identification information; wherein the first syntax element identification information is used to indicate whether the zero-run value is equal to 0, the second syntax element identification information is used to indicate whether the zero-run value is equal to 1, the third syntax element identification information is used to indicate whether the zero-run value is equal to 2, the fourth syntax element identification information is used to indicate the parity characteristic of a first numerical value obtained after a first operation on the zero-run value, and the first numerical identification information is used to indicate a second numerical value obtained after a second operation on the zero-run value.
  • the first determination unit 1001 is further configured to perform a subtraction operation on the zero-run value and the first preset value to obtain a first numerical value.
  • the first determination unit 1001 is further configured to perform a subtraction operation on the zero-run value and the first preset value to obtain a first value; and set the second value to be equal to the quotient of the first value divided by 2.
  • the first determining unit 1001 is further configured to right-shift the first value by one bit to obtain a second value.
  • the encoding unit 1002 is further configured to, when the preset parameter meets the first preset condition, determine the value of the first syntax element identification information according to the zero run value; and perform encoding processing on the value of the first syntax element identification information based on the context model, and write the obtained coded bits into the bitstream; if the value of the first syntax element identification information is the second value, determine the value of the second syntax element identification information according to the zero run value; perform encoding processing on the value of the second syntax element identification information based on the context model, and write the obtained coded bits into the bitstream; if the value of the second syntax element identification information is the second value, determine the value of the third syntax element identification information according to the zero run value; perform encoding processing on the value of the third syntax element identification information based on the context model, and write the obtained coded bits into the bitstream; if the value of the third syntax element identification information is the second value, determine the value of the fourth syntax element identification information and the value of the first value identification information according to the zero run
  • the encoding unit 1002 is also configured to perform a subtraction operation on the value of the preset parameter after each encoding of the following syntax element identification information based on the context model is completed: the first syntax element identification information, the second syntax element identification information, the third syntax element identification information and the fourth syntax element identification information.
  • the encoding unit 1002 is further configured to, when the preset parameter meets the second preset condition, determine the value of the first syntax element identification information according to the zero run value; and perform encoding processing on the value of the first syntax element identification information based on the bypass model, and write the obtained coded bits into the bitstream; if the value of the first syntax element identification information is the second value, determine the value of the second syntax element identification information according to the zero run value; perform encoding processing on the value of the second syntax element identification information based on the bypass model, and write the obtained coded bits into the bitstream; if the value of the second syntax element identification information is the second value, determine the value of the third syntax element identification information according to the zero run value; perform encoding processing on the value of the third syntax element identification information based on the bypass model, and write the obtained coded bits into the bitstream; if the value of the third syntax element identification information is the second value, determine the value of the fourth syntax element identification information and the value of the first value identification information according to the zero run
  • the encoding unit 1002 is further configured to binarize the value of the first numerical identification information to obtain at least one binary symbol; and to encode the at least one binary symbol in sequence based on the bypass model, and write the obtained coded bits into the code stream.
  • At least one first-category syntax element identification information includes at least one of the following: first syntax element identification information, second syntax element identification information, third syntax element identification information, fourth syntax element identification information, fifth syntax element identification information, sixth syntax element identification information, seventh syntax element identification information, and eighth syntax element identification information; at least one second-category syntax element identification information includes at least: second numerical identification information; wherein the first syntax element identification information is used to indicate whether the zero run value is equal to 0, the second syntax element identification information is used to indicate whether the zero run value is equal to 1, and the third syntax element identification information is used to indicate whether the zero run value is equal to 2, the fourth syntax element identification information is used to indicate the parity characteristic of the first numerical value obtained after the zero-run value is subjected to the first operation, the fifth syntax element identification information is used to indicate whether the second numerical value obtained after the zero-run value is subjected to the second operation is equal to 0, the sixth syntax element identification information is used to indicate whether the second numerical value obtained after the zero-run value is subjected to the second operation is
  • the encoder 100 further includes a first computing unit 1004 configured to perform a subtraction operation on the zero-run value and a first preset value to obtain a first numerical value; and set the second numerical value to be equal to the quotient of the first numerical value divided by 2; and perform a subtraction operation on the second numerical value and a second preset value to obtain a fourth numerical value.
  • a first computing unit 1004 configured to perform a subtraction operation on the zero-run value and a first preset value to obtain a first numerical value; and set the second numerical value to be equal to the quotient of the first numerical value divided by 2; and perform a subtraction operation on the second numerical value and a second preset value to obtain a fourth numerical value.
  • the encoding unit 1002 is further configured to, when the preset parameter meets the first preset condition, determine the value of the first syntax element identification information according to the zero run value; perform encoding processing on the value of the first syntax element identification information based on the context model, and write the obtained coded bits into the bitstream; if the value of the first syntax element identification information is the second value, determine the value of the second syntax element identification information according to the zero run value; perform encoding processing on the value of the second syntax element identification information based on the context model, and write the obtained coded bits into the bitstream; if the value of the second syntax element identification information is the second value, determine the value of the third syntax element identification information according to the zero run value; perform encoding processing on the value of the third syntax element identification information based on the context model, and write the obtained coded bits into the bitstream; if the value of the third syntax element identification information is the second value, determine the value of the fourth syntax element identification information and the value of the fifth syntax element identification information according to the zero run
  • the encoding unit 1002 is further configured to perform a subtraction operation on the value of the preset parameter after each encoding of the following grammatical element identification information based on the context model is completed: the first grammatical element identification information, the second grammatical element identification information, the third grammatical element identification information, the fourth grammatical element identification information, the fifth grammatical element identification information, the sixth grammatical element identification information, the seventh grammatical element identification information and the eighth grammatical element identification information.
  • the encoding unit 1002 is further configured to, when the preset parameter meets the second preset condition, determine the value of the first syntax element identification information according to the zero run value; perform encoding processing on the value of the first syntax element identification information based on the bypass model, and write the obtained coded bits into the bitstream; if the value of the first syntax element identification information is the second value, determine the value of the second syntax element identification information according to the zero run value; perform encoding processing on the value of the second syntax element identification information based on the bypass model, and write the obtained coded bits into the bitstream; if the value of the second syntax element identification information is the second value, determine the value of the third syntax element identification information according to the zero run value; perform encoding processing on the value of the third syntax element identification information based on the bypass model, and write the obtained coded bits into the bitstream; if the value of the third syntax element identification information is the second value, determine the value of the fourth syntax element identification information and the value of the fifth syntax element identification information according to the zero run
  • the method comprises: encoding the value of the syntax element identification information based on the bypass model, and encoding the value of the fifth syntax element identification information based on the bypass model, and writing the obtained coded bits into the bitstream; if the value of the fifth syntax element identification information is the second value, determining the value of the sixth syntax element identification information according to the zero run value; encoding the value of the sixth syntax element identification information based on the bypass model, and writing the obtained coded bits into the bitstream; if the value of the sixth syntax element identification information is the second value, determining the value of the seventh syntax element identification information according to the zero run value; encoding the value of the seventh syntax element identification information based on the bypass model, and writing the obtained coded bits into the bitstream; if the value of the seventh syntax element identification information is the second value, determining the value of the eighth syntax element identification information according to the zero run value; encoding the value of the eighth syntax element identification information based on the bypass model, and writing the obtained coded bits into the bitstream; if the value of
  • the first calculation unit 1004 is also configured to perform a subtraction operation on the zero-run value and the first preset value to obtain a first numerical value; and set the second numerical value to be equal to the quotient of the first numerical value divided by 2; and perform a subtraction operation on the second numerical value and the second preset value to determine the value of the second numerical identification information.
  • the encoding unit 1002 is further configured to binarize the value of the second numerical identification information to obtain at least one binary symbol; and encode the at least one binary symbol in sequence based on the bypass model, and write the obtained coded bits into the bit stream.
  • the first determination unit 1001 is further configured to determine that the value of the first syntax element identification information is the first value if the zero run value is equal to 0; if the zero run value is not equal to 0, determine that the value of the first syntax element identification information is the second value.
  • the first determination unit 1001 is further configured to determine that the value of the second syntax element identification information is the first value if the zero run value is equal to 1; if the zero run value is not equal to 1, determine that the value of the second syntax element identification information is the second value.
  • the first determination unit 1001 is further configured to determine that the value of the third syntax element identification information is the first value if the zero run value is equal to 2; if the zero run value is not equal to 2, determine that the value of the third syntax element identification information is the second value.
  • the first determination unit 1001 is further configured to determine that the value of the fourth grammatical element identification information is the first value if the first numerical value is an odd number; determine that the value of the fourth grammatical element identification information is the second value if the first numerical value is an even number; or, if the remainder when the first numerical value is divided by 2 is 1, determine that the value of the fourth grammatical element identification information is the first value; if the remainder when the first numerical value is divided by 2 is 0, determine that the value of the fourth grammatical element identification information is the second value.
  • the first determination unit 1001 is further configured to determine that the value of the fifth grammatical element identification information is the first value if the second numerical value is equal to 0; if the second numerical value is not equal to 0, determine that the value of the fifth grammatical element identification information is the second value.
  • the first determination unit 1001 is further configured to determine that the value of the sixth grammatical element identification information is the first value if the second numerical value is equal to 1; if the second numerical value is not equal to 1, determine that the value of the sixth grammatical element identification information is the second value.
  • the first determination unit 1001 is further configured to determine that the value of the seventh grammatical element identification information is the first value if the second numerical value is equal to 2; if the second numerical value is not equal to 2, determine that the value of the seventh grammatical element identification information is the second value.
  • the first determination unit 1001 is further configured to determine that the value of the eighth grammatical element identification information is the first value if the second numerical value is equal to 3; if the second numerical value is not equal to 3, determine that the value of the eighth grammatical element identification information is the second value.
  • a "unit” may be a part of a circuit, a part of a processor, a part of a program or software, etc., and of course, it may be a module, or it may be non-modular.
  • the components in the present embodiment may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional module.
  • the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of this embodiment is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in this embodiment.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
  • an embodiment of the present application provides a computer-readable storage medium, which is applied to the encoder 100.
  • the computer-readable storage medium stores a computer program.
  • the computer program When the computer program is executed by the first processor, it implements the encoding method described in any one of the aforementioned embodiments.
  • the encoder 100 may include: a first communication interface 1101, a first memory 1102 and a first processor 1103; each component is coupled together through a first bus system 1104. It can be understood that the first bus system 1104 is used to realize the connection and communication between these components.
  • the first bus system 1104 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are marked as the first bus system 1104 in Figure 11. Among them,
  • the first communication interface 1101 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
  • a first memory 1102 used to store a computer program that can be run on the first processor 1103;
  • the first processor 1103 is configured to, when running the computer program, execute:
  • a context model-based encoding process is performed on a value of at least one first-category syntax element identification information, and a bypass model-based encoding process is performed on a value of at least one second-category syntax element identification information, and the obtained coded bits are written into a bitstream.
  • the first memory 1102 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories.
  • the non-volatile memory can 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 can be a random access memory (RAM), which is used as an external cache.
  • RAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate synchronous DRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous link DRAM
  • DRRAM direct RAM bus RAM
  • the first processor 1103 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the first processor 1103.
  • the above-mentioned first processor 1103 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • the methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed.
  • the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
  • the steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor can be executed.
  • the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc.
  • the storage medium is located in the first memory 1102, and the first processor 1103 reads the information in the first memory 1102 and completes the steps of the above method in combination with its hardware.
  • the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processors (Digital Signal Processing, DSP), digital signal processing devices (DSP Device, DSPD), programmable logic devices (Programmable Logic Device, PLD), field programmable gate arrays (Field-Programmable Gate Array, FPGA), general processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application or a combination thereof.
  • ASIC Application Specific Integrated Circuits
  • DSP Digital Signal Processing
  • DSP Device digital signal processing devices
  • PLD programmable logic devices
  • FPGA field programmable gate array
  • general processors controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application or a combination thereof.
  • the technology described in this application can be implemented by a module (such as a process, function, etc.) that performs the functions described in this application.
  • the software code can be stored in a memory and executed by a processor.
  • the memory can be implemented in the processor or outside the processor.
  • the first processor 1103 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.
  • the present embodiment provides an encoder in which, after determining the preset parameters corresponding to the zero-run value, the number of codewords based on the context model used in encoding can be limited, so that part of the syntax element identification information is encoded using a bypass model, thereby improving the hardware throughput and reducing the difficulty of hardware implementation; and also improving the processing speed.
  • the decoder 120 may include: a second determination unit 2201 and a second prediction unit 2202; wherein,
  • the second determining unit 1201 is configured to determine a preset parameter corresponding to a zero-run value
  • the decoding unit 1202 is configured to, if the preset parameter meets the first preset condition, perform a context model-based decoding process on at least one first-category syntax element identification information, and perform a bypass model-based decoding process on at least one second-category syntax element identification information, and determine a value of the at least one first-category syntax element identification information and a value of the at least one second-category syntax element identification information;
  • the second determining unit 1201 is further configured to determine a zero run value according to a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information.
  • the decoder 120 further includes a second determination unit 1203 configured to determine whether the value of the preset parameter is greater than or equal to a preset threshold value.
  • the decoding unit 1202 is further configured to perform bypass model-based decoding processing on at least one first-category syntax element identification information and at least one second-category syntax element identification information if the preset parameters meet the second preset condition, and determine the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information.
  • the second determination unit 1203 is further configured to determine whether the value of the preset parameter is less than a preset threshold value.
  • the decoding unit 1202 is further configured to decode the code stream and determine a preset parameter corresponding to the zero run value.
  • the second determination unit 1201 is further configured to determine that the attribute quantization residual value of the current node is equal to 0 if the zero-run value is greater than 0; and perform a subtraction operation on the zero-run value to determine the attribute quantization residual value of the next node according to the new zero-run value; if the zero-run value is equal to 0, decode the code stream to determine the attribute quantization residual value of the current node; and continue to perform the step of decoding the zero-run value to determine the attribute quantization residual value of the next node according to the new zero-run value.
  • the zero-run value is used to indicate whether the attribute quantization residual values are all 0 counts; wherein the attribute quantization residual value includes one of the following: a color component quantization residual value and a reflectance quantization residual value.
  • the decoding unit 1202 is further configured to, when the zero-run value is less than a preset threshold, if the preset parameters meet the first preset condition, perform context-based decoding processing on at least one first-category syntax element identification information to determine the value of at least one first-category syntax element identification information; and determine the zero-run value based on the value of at least one first-category syntax element identification information; or, if the preset parameters meet the second preset condition, perform bypass-model-based decoding processing on at least one first-category syntax element identification information to determine the value of at least one first-category syntax element identification information; and determine the zero-run value based on the value of at least one first-category syntax element identification information.
  • At least one first-category syntax element identification information includes at least one of the following: first syntax element identification information, second syntax element identification information, third syntax element identification information and fourth syntax element identification information; at least one second-category syntax element identification information includes at least: first numerical identification information; wherein the first syntax element identification information is used to indicate whether the zero-run value is equal to 0, the second syntax element identification information is used to indicate whether the zero-run value is equal to 1, the third syntax element identification information is used to indicate whether the zero-run value is equal to 2, the fourth syntax element identification information is used to indicate the parity characteristic of a first numerical value obtained after a first operation on the zero-run value, and the first numerical identification information is used to indicate a second numerical value obtained after a second operation on the zero-run value.
  • the decoder 120 further includes a second calculation unit 1204 configured to perform a subtraction operation on the zero-run value and the first preset value to obtain a first value.
  • the second calculation unit 1204 is further configured to perform a subtraction operation on the zero-run value and the first preset value to obtain a first value; and set the second value to be equal to the quotient of the first value divided by 2.
  • the second calculation unit 1204 is further configured to right-shift the first value by one bit to obtain a second value.
  • the decoding unit 1202 is further configured to decode the first syntax element identification information based on the context model to determine the value of the first syntax element identification information; if the value of the first syntax element identification information is the first value, determine that the zero run value is equal to 0; if the value of the first syntax element identification information is the second value, decode the second syntax element identification information based on the context model to determine the value of the second syntax element identification information; if the value of the second syntax element identification information is the first value, determine that the zero run value is equal to 1; if the value of the second syntax element identification information is the second value, decode the third syntax element identification information based on the context model to determine the value of the third syntax element identification information; if the value of the third syntax element identification information is the first value, determine that the zero run value is equal to 2; if the value of the third syntax element identification information is the second value, decode the fourth syntax element identification information based on the context model to determine the value of the fourth syntax element identification information; and decode the first numerical
  • the second determining unit 1201 is further configured to determine the zero run value according to the first preset value, the value of the fourth syntax element identification information and the value of the first numerical identification information.
  • the decoding unit 1202 is also configured to perform a subtraction operation on the value of the preset parameter after each decoding of the following syntax element identification information based on the context model is completed: the first syntax element identification information, the second syntax element identification information, the third syntax element identification information and the fourth syntax element identification information.
  • the decoding unit 1202 is further configured to, when the preset parameter meets the second preset condition, decode the first syntax element identification information based on the bypass model to determine the value of the first syntax element identification information; if the value of the first syntax element identification information is the first value, determine that the zero run value is equal to 0; if the value of the first syntax element identification information is the second value, decode the second syntax element identification information based on the bypass model to determine the value of the second syntax element identification information; if the value of the second syntax element identification information is the first value, determine that the zero run value is equal to 1; if the value of the second syntax element identification information is the second value, decode the third syntax element identification information based on the bypass model to determine the value of the third syntax element identification information; if the value of the third syntax element identification information is the first value, determine that the zero run value is equal to 2; if the value of the third syntax element identification information is the second value, decode the fourth syntax element identification information based on the bypass model to determine the value of
  • the second determining unit 1201 is further configured to determine the zero run value according to the first preset value, the value of the fourth syntax element identification information and the value of the first numerical identification information.
  • the decoding unit 1202 is further configured to decode the first numerical identification information based on a bypass model to determine at least one binary symbol corresponding to the first numerical identification information; and to debinarize at least one binary symbol to obtain the value of the first numerical identification information.
  • the second calculation unit 1204 is further configured to perform a third operation on the value of the first numerical identification information to obtain a third numerical value; and determine the zero run value based on the first preset value, the third numerical value and the value of the fourth syntax element identification information.
  • the second calculation unit 1204 is further configured to multiply the value of the first numerical identification information by 2 to obtain a third numerical value; or to left-shift the value of the first numerical identification information by one bit to obtain the third numerical value.
  • the second calculation unit 1204 is further configured to perform an addition operation on the first preset value, the third numerical value and the value of the fourth syntax element identification information to obtain a zero run value.
  • At least one first-category syntax element identification information includes at least one of the following: first syntax element identification information, second syntax element identification information, third syntax element identification information, fourth syntax element identification information, fifth syntax element identification information, sixth syntax element identification information, seventh syntax element identification information, and eighth syntax element identification information; at least one second-category syntax element identification information includes at least: second numerical identification information; wherein the first syntax element identification information is used to indicate whether the zero run value is equal to 0, the second syntax element identification information is used to indicate whether the zero run value is equal to 1, and the third syntax element identification information is used to indicate whether the zero run value is equal to 2, the fourth syntax element identification information is used to indicate the parity characteristic of the first numerical value obtained after the zero-run value is subjected to the first operation, the fifth syntax element identification information is used to indicate whether the second numerical value obtained after the zero-run value is subjected to the second operation is equal to 0, the sixth syntax element identification information is used to indicate whether the second numerical value obtained after the zero-run value is subjected to the second operation is
  • the second calculation unit 1204 is further configured to perform a subtraction operation on the zero-run value and the first preset value to obtain a first value; and set the second value to be equal to the quotient of the first value divided by 2; and perform a subtraction operation on the second value and the second preset value to obtain a fourth value.
  • the decoding unit 1202 is further configured to decode the first syntax element identification information based on the context model to determine the value of the first syntax element identification information; if the value of the first syntax element identification information is a first value, determine that the zero run value is equal to 0; if the value of the first syntax element identification information is a second value, decode the second syntax element identification information based on the context model to determine the value of the second syntax element identification information; if the value of the second syntax element identification information is a first value, determine that the zero run value is equal to 1; if the value of the second syntax element identification information is a second value, decode the third syntax element identification information based on the context model to determine the value of the third syntax element identification information; if the value of the third syntax element identification information is a first value, determine that the zero run value is equal to 2; if the value of the third syntax element identification information is a second value, decode the fourth syntax element identification information based on the context model to determine the value of the fourth syntax element identification information;
  • the sixth grammatical element identification information is decoded based on the context model to determine the value of the sixth grammatical element identification information; if the value of the sixth grammatical element identification information is the first value, it is determined that the zero run value is equal to the sum of the first constant, the first preset value and the value of the fourth grammatical element identification information; if the value of the sixth grammatical element identification information is the second value, the seventh grammatical element identification information is decoded based on the context model to determine the value of the seventh grammatical element identification information; if the value of the seventh grammatical element identification information is the first value, it is determined that the zero run value is equal to the sum of the second constant, the first preset value and the value of the fourth grammatical element identification information; if the value of the seventh grammatical element identification information is the second value, the eighth grammatical element
  • the second determining unit 1201 is further configured to determine the zero run value according to the first preset value, the value of the fourth syntax element identification information and the value of the second numerical identification information.
  • the decoding unit 1202 is further configured to perform a subtraction operation on the value of the preset parameter after each decoding of the following syntax element identification information is completed based on the context model: the first syntax element identification information, the second syntax element identification information, the third syntax element identification information, the fourth syntax element identification information, the fifth syntax element identification information, the sixth syntax element identification information, the seventh syntax element identification information and the eighth syntax element identification information.
  • the decoding unit 1202 is further configured to, when the preset parameter meets the second preset condition, decode the first syntax element identification information based on the bypass model to determine the value of the first syntax element identification information; if the value of the first syntax element identification information is the first value, determine that the zero run value is equal to 0; if the value of the first syntax element identification information is the second value, decode the second syntax element identification information based on the bypass model to determine the value of the second syntax element identification information; if the value of the second syntax element identification information is the first value, determine that the zero run value is equal to 1; if the value of the second syntax element identification information is the second value, decode the second syntax element identification information based on the bypass model to determine the value of the second syntax element identification information.
  • the method further comprises: performing decoding processing on the third grammatical element identification information to determine the value of the third grammatical element identification information; if the value of the third grammatical element identification information is the first value, determining that the zero-run value is equal to 2; if the value of the third grammatical element identification information is the second value, performing decoding processing on the fourth grammatical element identification information based on the bypass model to determine the value of the fourth grammatical element identification information; and performing decoding processing on the fifth grammatical element identification information based on the bypass model to determine the value of the fifth grammatical element identification information; if the value of the fifth grammatical element identification information is the first value, determining that the zero-run value is equal to the sum of the first preset value and the value of the fourth grammatical element identification information; if the fifth grammatical element identification information is the first value, determining that the zero-run value is equal to the sum of the first preset value and the value of the fourth grammatical element
  • the second determining unit 1201 is further configured to determine the zero run value according to the first preset value, the value of the fourth syntax element identification information and the value of the second numerical identification information.
  • the first constant, the second constant, and the third constant are all multiples of 2.
  • the second calculation unit 1204 is also configured to determine a second operation result based on the value of the second numerical identification information and the second preset value; and perform a fourth operation on the second operation result to obtain a third operation result; and determine the zero run value based on the first preset value, the third operation result and the value of the fourth syntax element identification information.
  • the second calculation unit 1204 is further configured to perform a multiplication operation on the second operation result and 2 to obtain a third operation result; or to perform a left shift operation on the second operation result by one bit to obtain a third operation result.
  • the second calculation unit 1204 is further configured to perform an addition operation on the first preset value, the third operation result and the value of the fourth syntax element identification information to obtain a zero run value.
  • a "unit" can be a part of a circuit, a part of a processor, a part of a program or software, etc., and of course it can also be a module, or it can be non-modular.
  • the components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional module.
  • the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • this embodiment provides a computer-readable storage medium, which is applied to the decoder 120.
  • the computer-readable storage medium stores a computer program. When the computer program is executed by the second processor, it implements any decoding method in the above embodiments.
  • the decoder 120 may include: a second communication interface 1301, a second memory 1302 and a second processor 1303; each component is coupled together through a second bus system 1304.
  • the second bus system 1304 is used to realize the connection and communication between these components.
  • the second bus system 1304 also includes a power bus, a control bus and a status signal bus.
  • various buses are marked as the second bus system 1304 in Figure 13. Among them,
  • the second communication interface 1301 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
  • the second memory 1302 is used to store a computer program that can be run on the second processor 1303;
  • the second processor 1303 is configured to, when running the computer program, execute:
  • the preset parameter meets the first preset condition, performing a context model-based decoding process on at least one first-category syntax element identification information, and performing a bypass model-based decoding process on at least one second-category syntax element identification information, to determine a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information;
  • a zero run value is determined according to a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information.
  • the second processor 1303 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.
  • the present embodiment provides a decoder in which, after determining the preset parameters corresponding to the zero-run value, the number of codewords based on the context model used in decoding can be limited, so that part of the syntax element identification information is decoded using a bypass model, thereby improving the hardware throughput and reducing the difficulty of hardware implementation; and also improving the processing speed.
  • Figure 14 shows a schematic diagram of the composition structure of a coding and decoding system provided in an embodiment of the present application.
  • the coding and decoding system 140 may include an encoder 1401 and a decoder 1402.
  • the encoder 1401 may be the encoder described in any one of the aforementioned embodiments
  • the decoder 1402 may be the decoder described in any one of the aforementioned embodiments.
  • the preset parameters corresponding to the zero-run value are first determined, and then it is determined whether the preset parameters meet the first preset conditions; if the preset parameters meet the first preset conditions, then at least one first-category syntax element identification information is encoded and decoded based on the context model, and at least one second-category syntax element identification information is encoded and decoded based on the bypass model; in this way, according to the determined preset parameters, the number of codewords based on the context model used in encoding and decoding can be limited, so that part of the syntax element identification information is encoded and decoded using the bypass model, thereby improving the hardware throughput and reducing the difficulty of hardware implementation; and it can also improve the processing speed.

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

Disclosed in embodiments of the present application are an encoding method, a decoding method, a code stream, an encoder, a decoder, and a storage medium. The decoding method comprises: determining a preset parameter corresponding to a zero run value (S601); if the preset parameter meets a first preset condition, performing context model-based decoding processing on at least one first-type syntax element identification information, and performing bypass model-based decoding processing on at least one second-type syntax element identification information, to determine a value of the at least one first-type syntax element identification information and a value of the at least one second-type syntax element identification information (S602); and determining the zero run value according to the value of the at least one first-type syntax element identification information and the value of the at least one second-type syntax element identification information (S603). In this way, the hardware throughput rate can be increased.

Description

编解码方法、码流、编码器、解码器以及存储介质Coding and decoding method, code stream, encoder, decoder and storage medium 技术领域Technical Field
本申请涉及点云编解码技术领域,尤其涉及一种编解码方法、码流、编码器、解码器以及存储介质。The present application relates to the field of point cloud encoding and decoding technology, and in particular to an encoding and decoding method, a bit stream, an encoder, a decoder and a storage medium.
背景技术Background technique
在基于音视频编码标准提供的点云压缩(Audio Video Standard-Point Cloud Compression,AVS-PCC)编解码框架中,点云的几何信息和属性信息是分开进行编码的。其中,对于每一个点的属性信息,可以按照预设顺序依次对每一个点的属性量化残差进行编码/解码。In the point cloud compression (AVS-PCC) codec framework based on the audio and video coding standard, the geometric information and attribute information of the point cloud are encoded separately. Among them, for the attribute information of each point, the attribute quantization residual of each point can be encoded/decoded in turn according to a preset order.
相关技术中,zero_run_length用于对属性量化残差进行是否为0的计数,可称为零游程值。点云压缩参考平台(Point Cloud Reference Model,PCRM)在编码零游程值时,对于二值化后的所有码字都采用基于上下文模型的编码/解码方式,给硬件实现带来了较大难度,降低了硬件吞吐率。In related technologies, zero_run_length is used to count whether the attribute quantization residual is 0, which can be called the zero-run value. When encoding the zero-run value, the Point Cloud Reference Model (PCRM) uses a context model-based encoding/decoding method for all binarized codewords, which brings great difficulty to hardware implementation and reduces hardware throughput.
发明内容Summary of the invention
本申请提供一种编解码方法、码流、编码器、解码器以及存储介质,可以提高硬件吞吐率。The present application provides a coding and decoding method, a bit stream, an encoder, a decoder and a storage medium, which can improve the hardware throughput.
本申请的技术方案可以如下实现:The technical solution of this application can be implemented as follows:
第一方面,本申请实施例提供了一种解码方法,应用于解码器,该方法包括:In a first aspect, an embodiment of the present application provides a decoding method, which is applied to a decoder, and the method includes:
确定零游程值对应的预置参数;Determine the preset parameters corresponding to the zero run value;
若预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息进行基于上下文模型的解码处理,以及对至少一个第二类语法元素标识信息进行基于旁路模型的解码处理,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值;If the preset parameter meets the first preset condition, performing a context model-based decoding process on at least one first-category syntax element identification information, and performing a bypass model-based decoding process on at least one second-category syntax element identification information, to determine a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information;
根据至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值,确定零游程值。A zero run value is determined according to a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information.
第二方面,本申请实施例提供了一种编码方法,应用于编码器,该方法包括:In a second aspect, an embodiment of the present application provides an encoding method, which is applied to an encoder, and the method includes:
确定零游程值以及零游程值对应的预置参数;Determine a zero-run value and a preset parameter corresponding to the zero-run value;
根据零游程值,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值;Determine, according to the zero-run value, a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information;
若预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息的取值进行基于上下文模型的编码处理,以及对至少一个第二类语法元素标识信息的取值进行基于旁路模型的编码处理,将所得到的编码比特写入码流。If the preset parameters meet the first preset condition, the value of at least one first-category syntax element identification information is coded based on the context model, and the value of at least one second-category syntax element identification information is coded based on the bypass model, and the obtained coded bits are written into the bitstream.
第三方面,本申请实施例提供了一种码流,该码流是根据待编码信息进行比特编码生成的;其中,待编码信息包括下述至少一项:In a third aspect, an embodiment of the present application provides a code stream, which is generated by bit encoding according to information to be encoded; wherein the information to be encoded includes at least one of the following:
属性量化残差值、第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息、第五语法元素标识信息、第六语法元素标识信息、第七语法元素标识信息、第八语法元素标识信息、第一数值标识信息和第二数值标识信息。attribute quantization residual value, first grammatical element identification information, second grammatical element identification information, third grammatical element identification information, fourth grammatical element identification information, fifth grammatical element identification information, sixth grammatical element identification information, seventh grammatical element identification information, eighth grammatical element identification information, first numerical identification information and second numerical identification information.
第四方面,本申请实施例提供了一种编码器,该编码器包括第一确定单元和编码单元;其中,In a fourth aspect, an embodiment of the present application provides an encoder, the encoder comprising a first determining unit and an encoding unit; wherein,
第一确定单元,配置为确定零游程值以及零游程值对应的预置参数;以及根据零游程值,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值;A first determining unit is configured to determine a zero-run value and a preset parameter corresponding to the zero-run value; and determine a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information according to the zero-run value;
编码单元,配置为若预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息的取值进行基于上下文模型的编码处理,以及对至少一个第二类语法元素标识信息的取值进行基于旁路模型的编码处理,将所得到的编码比特写入码流。The encoding unit is configured to, if the preset parameter meets the first preset condition, perform context model-based encoding processing on the value of at least one first-category syntax element identification information, and perform bypass model-based encoding processing on the value of at least one second-category syntax element identification information, and write the obtained encoded bits into the bitstream.
第五方面,本申请实施例提供了一种编码器,该编码器包括第一存储器和第一处理器;其中,In a fifth aspect, an embodiment of the present application provides an encoder, the encoder comprising a first memory and a first processor; wherein,
第一存储器,用于存储能够在第一处理器上运行的计算机程序;A first memory, for storing a computer program that can be run on the first processor;
第一处理器,用于在运行计算机程序时,执行如第二方面所述的方法。The first processor is used to execute the method described in the second aspect when running a computer program.
第六方面,本申请实施例提供了一种解码器,该解码器包括第二确定单元和解码单元;其中,In a sixth aspect, an embodiment of the present application provides a decoder, the decoder comprising a second determining unit and a decoding unit; wherein,
第二确定单元,配置为确定零游程值对应的预置参数;A second determining unit is configured to determine a preset parameter corresponding to the zero-run value;
解码单元,配置为若预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息进行基于 上下文模型的解码处理,以及对至少一个第二类语法元素标识信息进行基于旁路模型的解码处理,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值;a decoding unit configured to, if the preset parameter meets the first preset condition, perform a decoding process on at least one first-category syntax element identification information based on a context model, and perform a decoding process on at least one second-category syntax element identification information based on a bypass model, and determine a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information;
第二确定单元,还配置为根据至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值,确定零游程值。The second determination unit is further configured to determine a zero run value according to a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information.
第七方面,本申请实施例提供了一种解码器,该解码器包括第二存储器和第二处理器;其中,In a seventh aspect, an embodiment of the present application provides a decoder, the decoder comprising a second memory and a second processor; wherein:
第二存储器,用于存储能够在第二处理器上运行的计算机程序;A second memory for storing a computer program that can be run on a second processor;
第二处理器,用于在运行计算机程序时,执行如第一方面所述的方法。The second processor is used to execute the method described in the first aspect when running the computer program.
第八方面,本申请实施例提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,所述计算机程序被执行时实现如第一方面所述的方法、或者实现如第二方面所述的方法。In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, it implements the method described in the first aspect, or implements the method described in the second aspect.
本申请实施例提供了一种编解码方法、码流、编码器、解码器以及存储介质,在编码端,确定零游程值以及零游程值对应的预置参数;根据零游程值,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值;若预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息的取值进行基于上下文模型的编码处理,以及对至少一个第二类语法元素标识信息的取值进行基于旁路模型的编码处理,将所得到的编码比特写入码流。在解码端,确定零游程值对应的预置参数;若预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息进行基于上下文模型的解码处理,以及对至少一个第二类语法元素标识信息进行基于旁路模型的解码处理,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值;根据至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值,确定零游程值。这样,无论是编码端还是解码端,在确定出零游程值对应的预置参数之后,可以限定在编解码时使用的基于上下文模型的码字数量,使得部分语法元素标识信息采用旁路模型进行编解码处理,从而可以提高硬件吞吐率,降低了硬件实现的难度;而且还能够提升处理速度。The embodiment of the present application provides a coding and decoding method, a bitstream, an encoder, a decoder and a storage medium. At the encoding end, a zero run value and a preset parameter corresponding to the zero run value are determined; according to the zero run value, the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information are determined; if the preset parameter meets the first preset condition, the value of at least one first-category syntax element identification information is encoded based on a context model, and the value of at least one second-category syntax element identification information is encoded based on a bypass model, and the obtained encoded bits are written into the bitstream. At the decoding end, a preset parameter corresponding to the zero run value is determined; if the preset parameter meets the first preset condition, the at least one first-category syntax element identification information is decoded based on a context model, and the at least one second-category syntax element identification information is decoded based on a bypass model, and the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information are determined; according to the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information, the zero run value is determined. In this way, whether it is the encoding end or the decoding end, after determining the preset parameters corresponding to the zero-run value, the number of codewords based on the context model used in encoding and decoding can be limited, so that some syntax element identification information is encoded and decoded using a bypass model, thereby improving the hardware throughput and reducing the difficulty of hardware implementation; it can also improve the processing speed.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1A为本申请实施例提供的一种三维点云图像示意图;FIG1A is a schematic diagram of a three-dimensional point cloud image provided in an embodiment of the present application;
图1B为本申请实施例提供的一种三维点云图像的局部放大示意图;FIG1B is a partially enlarged schematic diagram of a three-dimensional point cloud image provided in an embodiment of the present application;
图2A为本申请实施例提供的一种不同观看角度下的点云图像示意图;FIG2A is a schematic diagram of a point cloud image at different viewing angles provided in an embodiment of the present application;
图2B为本申请实施例提供的一种图2A对应的数据存储格式示意图;FIG2B is a schematic diagram of a data storage format corresponding to FIG2A provided in an embodiment of the present application;
图3为本申请实施例提供的一种点云编解码的网络架构示意图;FIG3 is a schematic diagram of a network architecture of point cloud encoding and decoding provided in an embodiment of the present application;
图4为本申请实施例提供的一种点云编码器的组成结构示意图;FIG4 is a schematic diagram of the structure of a point cloud encoder provided in an embodiment of the present application;
图5为本申请实施例提供的一种点云解码器的组成结构示意图;FIG5 is a schematic diagram of the structure of a point cloud decoder provided in an embodiment of the present application;
图6为本申请实施例提供的一种解码方法的流程示意图;FIG6 is a schematic diagram of a flow chart of a decoding method provided in an embodiment of the present application;
图7为本申请实施例提供的一种解码方法的详细流程示意图;FIG7 is a detailed flowchart of a decoding method provided in an embodiment of the present application;
图8为本申请实施例提供的一种编码方法的流程示意图;FIG8 is a schematic diagram of a flow chart of an encoding method provided in an embodiment of the present application;
图9为本申请实施例提供的一种编码方法的详细流程示意图;FIG9 is a schematic diagram of a detailed flow chart of an encoding method provided in an embodiment of the present application;
图10为本申请实施例提供的一种编码器的组成结构示意图;FIG10 is a schematic diagram of the structure of an encoder provided in an embodiment of the present application;
图11为本申请实施例提供的一种编码器的具体硬件结构示意图;FIG11 is a schematic diagram of a specific hardware structure of an encoder provided in an embodiment of the present application;
图12为本申请实施例提供的一种解码器的组成结构示意图;FIG12 is a schematic diagram of the structure of a decoder provided in an embodiment of the present application;
图13为本申请实施例提供的一种解码器的具体硬件结构示意图;FIG13 is a schematic diagram of a specific hardware structure of a decoder provided in an embodiment of the present application;
图14为本申请实施例提供的一种编解码系统的组成结构示意图。FIG. 14 is a schematic diagram of the composition structure of a coding and decoding system provided in an embodiment of the present application.
具体实施方式Detailed ways
为了能够更加详尽地了解本申请实施例的特点与技术内容,下面结合附图对本申请实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本申请实施例。In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本申请实施例的目的,不是旨在限制本申请。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
还需要指出,本申请实施例所涉及的术语“第一\第二\第三”仅是用于区别类似的对象,不代表针对对象的特定排序,可以理解地,“第一\第二\第三”在允许的情况下可以互换特定的顺序或先后次序,以使这里描述的本申请实施例能够以除了在这里图示或描述的以外的顺序实施。It should also be pointed out that the terms "first\second\third" involved in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
点云(Point Cloud)是物体表面的三维表现形式,通过光电雷达、激光雷达、激光扫描仪、多视角相机等采集设备,可以采集得到物体表面的点云(数据)。Point Cloud is a three-dimensional representation of the surface of an object. Point cloud (data) on the surface of an object can be collected through acquisition equipment such as photoelectric radar, lidar, laser scanner, and multi-view camera.
点云是空间中一组无规则分布的、表达三维物体或场景的空间结构及表面属性的离散点集,图1A展示了三维点云图像和图1B展示了三维点云图像的局部放大图,可以看到点云表面是由分布稠密的点所组成的。A point cloud is a set of discrete points that are irregularly distributed in space and express the spatial structure and surface properties of a three-dimensional object or scene. FIG1A shows a three-dimensional point cloud image and FIG1B shows a partial magnified view of the three-dimensional point cloud image. It can be seen that the point cloud surface is composed of densely distributed points.
二维图像在每一个像素点均有信息表达,分布规则,因此不需要额外记录其位置信息;然而点云中的点在三维空间中的分布具有随机性和不规则性,因此需要记录每一个点在空间中的位置,才能完整地表达一幅点云。与二维图像类似,采集过程中每一个位置均有对应的属性信息,通常为RGB颜色值,颜色值反映物体的色彩;对于点云来说,每一个点所对应的属性信息除了颜色信息以外,还有比较常见的是反射率(reflectance)值,反射率值反映物体的表面材质。因此,点云中的点可以包括点的位置信息和点的属性信息。例如,点的位置信息可以是点的三维坐标信息(x,y,z)。点的位置信息也可称为点的几何信息。例如,点的属性信息可以包括颜色信息(三维颜色信息)和/或反射率(一维反射率信息r)等等。例如,颜色信息可以是任意一种色彩空间上的信息。例如,颜色信息可以是RGB信息。其中,R表示红色(Red,R),G表示绿色(Green,G),B表示蓝色(Blue,B)。再如,颜色信息可以是亮度色度(YCbCr,YUV)信息。其中,Y表示明亮度(Luma),Cb(U)表示蓝色色差,Cr(V)表示红色色差。Two-dimensional images have information expressed at each pixel point, and the distribution is regular, so there is no need to record its position information additionally; however, the distribution of points in point clouds in three-dimensional space is random and irregular, so it is necessary to record the position of each point in space in order to fully express a point cloud. Similar to two-dimensional images, each position in the acquisition process has corresponding attribute information, usually RGB color values, and the color value reflects the color of the object; for point clouds, in addition to color information, the attribute information corresponding to each point is also commonly the reflectance value, which reflects the surface material of the object. Therefore, the points in the point cloud can include the location information of the point and the attribute information of the point. For example, the location information of the point can be the three-dimensional coordinate information (x, y, z) of the point. The location information of the point can also be called the geometric information of the point. For example, the attribute information of the point can include color information (three-dimensional color information) and/or reflectance (one-dimensional reflectance information r), etc. For example, the color information can be information on any color space. For example, the color information can be RGB information. Among them, R represents red (Red, R), G represents green (Green, G), and B represents blue (Blue, B). For another example, the color information may be luminance and chrominance (YCbCr, YUV) information, where Y represents brightness (Luma), Cb (U) represents blue color difference, and Cr (V) represents red color difference.
根据激光测量原理得到的点云,点云中的点可以包括点的三维坐标信息和点的反射率值。再如,根据摄影测量原理得到的点云,点云中的点可以可包括点的三维坐标信息和点的三维颜色信息。再如,结合激光测量和摄影测量原理得到点云,点云中的点可以可包括点的三维坐标信息、点的反射率值和点的三维颜色信息。For a point cloud obtained according to the principle of laser measurement, the points in the point cloud may include the three-dimensional coordinate information of the points and the reflectivity value of the points. For another example, for a point cloud obtained according to the principle of photogrammetry, the points in the point cloud may include the three-dimensional coordinate information of the points and the three-dimensional color information of the points. For another example, a point cloud obtained by combining the principles of laser measurement and photogrammetry may include the three-dimensional coordinate information of the points, the reflectivity value of the points and the three-dimensional color information of the points.
如图2A和图2B所示为一幅点云图像及其对应的数据存储格式。其中,图2A提供了点云图像的六个观看角度,图2B由文件头信息部分和数据部分组成,头信息包含了数据格式、数据表示类型、点云总点数、以及点云所表示的内容。例如,点云为“.ply”格式,由ASCII码表示,总点数为207242,每个点具有三维坐标信息(x,y,z)和三维颜色信息(r,g,b)。As shown in Figures 2A and 2B, a point cloud image and its corresponding data storage format are shown. Figure 2A provides six viewing angles of the point cloud image, and Figure 2B 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. For example, the point cloud is in the ".ply" format, represented by ASCII code, with a total number of 207242 points, and each point has three-dimensional coordinate information (x, y, z) and three-dimensional color information (r, g, b).
点云可以按获取的途径分为:Point clouds can be divided into the following categories according to the way they are obtained:
静态点云:即物体是静止的,获取点云的设备也是静止的;Static point cloud: the object is stationary, and the device that obtains the point cloud is also stationary;
动态点云:物体是运动的,但获取点云的设备是静止的;Dynamic point cloud: The object is moving, but the device that obtains the point cloud is stationary;
动态获取点云:获取点云的设备是运动的。Dynamic point cloud acquisition: The device used to acquire the point cloud is in motion.
例如,按点云的用途分为两大类:For example, point clouds can be divided into two categories according to their usage:
类别一:机器感知点云,其可以用于自主导航系统、实时巡检系统、地理信息系统、视觉分拣机器人、抢险救灾机器人等场景;Category 1: Machine perception point cloud, which can be used in autonomous navigation systems, real-time inspection systems, geographic information systems, visual sorting robots, emergency rescue robots, etc.
类别二:人眼感知点云,其可以用于数字文化遗产、自由视点广播、三维沉浸通信、三维沉浸交互等点云应用场景。Category 2: Point cloud perceived by the human eye, which can be used in point cloud application scenarios such as digital cultural heritage, free viewpoint broadcasting, 3D immersive communication, and 3D immersive interaction.
点云可以灵活方便地表达三维物体或场景的空间结构及表面属性,并且由于点云通过直接对真实物体采样获得,在保证精度的前提下能提供极强的真实感,因而应用广泛,其范围包括虚拟现实游戏、计算机辅助设计、地理信息系统、自动导航系统、数字文化遗产、自由视点广播、三维沉浸远程呈现、生物组织器官三维重建等。Point clouds can flexibly and conveniently express the spatial structure and surface properties of three-dimensional objects or scenes. Point clouds are obtained by directly sampling real objects, so 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.
点云的采集主要有以下途径:计算机生成、3D激光扫描、3D摄影测量等。计算机可以生成虚拟三维物体及场景的点云;3D激光扫描可以获得静态现实世界三维物体或场景的点云,每秒可以获取百万级点云;3D摄影测量可以获得动态现实世界三维物体或场景的点云,每秒可以获取千万级点云。这些技术降低了点云数据获取成本和时间周期,提高了数据的精度。点云数据获取方式的变革,使大量点云数据的获取成为可能,伴随着应用需求的增长,海量3D点云数据的处理遭遇存储空间和传输带宽限制的瓶颈。Point clouds can be collected mainly through the following methods: computer generation, 3D laser scanning, 3D photogrammetry, etc. 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. These technologies reduce the cost and time cycle of point cloud data acquisition and improve the accuracy of data. The change in the way point cloud data is acquired makes it possible to acquire a large amount of point cloud data. With the growth of application demand, the processing of massive 3D point cloud data encounters bottlenecks in storage space and transmission bandwidth.
示例性地,以帧率为30帧每秒(fps)的点云视频为例,每帧点云的点数为70万,每个点具有坐标信息xyz(float)和颜色信息RGB(uchar),则10s点云视频的数据量大约为0.7million×(4Byte×3+1Byte×3)×30fps×10s=3.15GB,其中,1Byte为10bit,而YUV采样格式为4:2:0,帧率为24fps的1280×720二维视频,其10s的数据量约为1280×720×12bit×24fps×10s≈0.33GB,10s的两视角三维视频的数据量约为0.33×2=0.66GB。由此可见,点云视频的数据量远超过相同时长的二维视频和三维视频的数据量。因此,为更好地实现数据管理,节省服务器存储空间,降低服务器与客户端之间的传输流量及传输时间,点云压缩成为促进点云产业发展的关键问题。For example, taking a point cloud video with a frame rate of 30 frames per second (fps) as an example, the number of points in each point cloud frame is 700,000, and each point has coordinate information xyz (float) and color information RGB (uchar). The data volume of a 10s point cloud video is approximately 0.7 million × (4Byte × 3 + 1Byte × 3) × 30fps × 10s = 3.15GB, where 1Byte is 10bit, and the YUV sampling format is 4:2:0, and the frame rate is 24fps. For a 1280 × 720 two-dimensional video, the data volume of 10s is approximately 1280 × 720 × 12bit × 24fps × 10s ≈ 0.33GB, and the data volume of a 10s two-view three-dimensional video is approximately 0.33 × 2 = 0.66GB. It can be seen that the data volume of a point cloud video far exceeds that of a two-dimensional video and a three-dimensional video 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.
也就是说,由于点云是海量点的集合,存储点云不仅会消耗大量的内存,而且不利于传输,也没有这么大的带宽可以支持将点云不经过压缩直接在网络层进行传输,因此,需要对点云进行压缩。That is to say, since the point cloud is a collection of massive points, storing the point cloud will not only consume a lot of memory, but also be inconvenient for transmission. There is also not enough bandwidth to support direct transmission of the point cloud at the network layer without compression. Therefore, the point cloud needs to be compressed.
目前,可对点云进行压缩的点云编码框架可以是运动图像专家组(Moving Picture Experts Group,MPEG)提供的基于几何的点云压缩(Geometry-based Point Cloud Compression,G-PCC)编解码框架或基于视频的点云压缩(Video-based Point Cloud Compression,V-PCC)编解码框架,也可以是音视频编码标准(Audio Video Standard,AVS)提供的AVS-PCC编解码框架。G-PCC编解码框架可用于针对第一类静态点云和第三类动态获取点云进行压缩,V-PCC编解码框架可用于针对第二类动态点云进行压缩。G-PCC编解码框架也称为点云编解码器TMC13,V-PCC编解码框架也称为点云编解码器TMC2。At present, the point cloud coding framework that can compress point clouds can be the geometry-based point cloud compression (G-PCC) codec framework or the video-based point cloud compression (V-PCC) codec framework provided by the Moving Picture Experts Group (MPEG), or the AVS-PCC codec framework provided by the Audio Video Standard (AVS). The G-PCC codec framework can be used to compress the first type of static point cloud and the third type of dynamically acquired point cloud, and the V-PCC codec framework can be used to compress the second type of dynamic point cloud. The G-PCC codec framework is also called the point cloud codec TMC13, and the V-PCC codec framework is also called the point cloud codec TMC2.
本申请实施例提供了一种包含解码方法和编码方法的点云编解码系统的网络架构,图3为本申请实施例提供的一种点云编解码的网络架构示意图。如图3所示,该网络架构包括一个或多个电子设备13至1N和通信网络01,其中,电子设备13至1N可以通过通信网络01进行视频交互。电子设备在实施的过程中可以为各种类型的具有点云编解码功能的设备,例如,所述电子设备可以包括手机、平板电脑、个人计算机、个人数字助理、导航仪、数字电话、视频电话、电视机、传感设备、服务器等,本申请实施例不作限定。The embodiment of the present application provides a network architecture of a point cloud encoding and decoding system including a decoding method and an encoding method. FIG3 is a schematic diagram of a network architecture of a point cloud encoding and decoding provided by the embodiment of the present application. As shown in FIG3, the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, wherein the electronic devices 13 to 1N can perform video interaction through the communication network 01. During the implementation process, the electronic device can be various types of devices with point cloud encoding and decoding functions. For example, the electronic device can include a mobile phone, a tablet computer, a personal computer, a personal digital assistant, a navigator, a digital phone, a video phone, a television, a sensor device, a server, etc., which is not limited by the embodiment of the present application.
其中,本申请实施例中的解码器或编码器就可以为上述电子设备。也就是说,本申请实施例中的电子设备具有点云编解码功能,一般包括点云编码器(即编码器)和点云解码器(即解码器)。The decoder or encoder in the embodiment of the present application can be the above-mentioned electronic device. That is to say, the electronic device in the embodiment of the present application has the point cloud encoding and decoding function, generally including a point cloud encoder (ie, encoder) and a point cloud decoder (ie, decoder).
下面以AVS-PCC编解码框架为例进行点云压缩技术的说明。The following uses the AVS-PCC encoding and decoding framework as an example to illustrate the point cloud compression technology.
可以理解,点云压缩一般采用点云几何信息和属性信息分别压缩的方式,在编码端,首先在几何编码器中编码点云几何信息,然后将重建几何信息作为附加信息输入到属性编码器中,辅助点云属性的压缩;在解码端,首先在几何解码器中解码点云几何信息,然后将解码后的几何信息作为附加信息输入到属性解码器中,辅助点云属性的压缩。整个编解码器由预处理/后处理、几何编码/解码、属性编码/解码几部分组成。It can be understood that point cloud compression generally adopts the method of compressing point cloud geometry information and attribute information separately. At the encoding end, the point cloud geometry information is first encoded in the geometry encoder, and then the reconstructed geometry information is input into the attribute encoder as additional information to assist in the compression of point cloud attributes; at the decoding end, the point cloud geometry information is first decoded in the geometry decoder, and then the decoded geometry information is input into the attribute decoder as additional information to assist in the compression of point cloud attributes. The entire codec consists of pre-processing/post-processing, geometry encoding/decoding, and attribute encoding/decoding.
本申请实施例提供一种点云编码器,如图4所示为AVS所提供的点云压缩参考平台PCRM的框架,该点云编码器11包括几何编码器:坐标平移单元111、坐标量化单元112、八叉树构建单元113、几何熵编码器114、几何重建单元115。属性编码器:属性重上色单元116、颜色空间变换单元117、第一属性预测单元118、量化单元119和属性熵编码器1110。The embodiment of the present application provides a point cloud encoder, as shown in FIG4 , which is a framework of the point cloud compression reference platform PCRM provided by AVS. The point cloud encoder 11 includes a geometry encoder: a coordinate translation unit 111, a coordinate quantization unit 112, an octree construction unit 113, a geometry entropy encoder 114, and a geometry reconstruction unit 115. An attribute encoder: an attribute recoloring unit 116, a color space conversion unit 117, a first attribute prediction unit 118, a quantization unit 119, and an attribute entropy encoder 1110.
对于PCRM,在编码端的几何编码部分,首先对原始几何信息进行预处理,通过坐标平移单元111将几何原点归一化到点云空间中的最小值位置,通过坐标量化单元112将几何信息从浮点数转化为整形,便于后续的规则化处理;然后对规则化的几何信息进行几何编码,在八叉树构建单元113中采用八叉树结构对点云空间进行递归划分,每次将当前点划分成八个相同大小的子块,并判断每个子块的占有码字情况,当子块内不包含点时记为空,否则记为非空,在递归划分的最后一层记录所有块的占有码字信息,并进行编码;通过八叉树结构表达的几何信息一方面输入到几何熵编码器114中形成几何码流,另一方面在几何重建单元115进行几何重建处理,重建后的几何信息作为附加信息输入到属性编码器中。For PCRM, in the geometric coding part of the encoding end, the original geometric information is first preprocessed, and the geometric origin is normalized to the minimum position in the point cloud space through the coordinate translation unit 111, and the geometric information is converted from floating point numbers to integers through the coordinate quantization unit 112 to facilitate subsequent regularization processing; then the regularized geometric information is geometrically encoded, and the point cloud space is recursively divided using an octree structure in the octree construction unit 113, and the current point is divided into eight sub-blocks of the same size each time, and the occupation 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 occupation codeword information of all blocks is recorded in the last layer of the recursive division and encoded; the geometric information expressed by the octree structure is input into the geometric entropy encoder 114 to form a geometric code stream on the one hand, and is geometrically reconstructed in the geometric reconstruction unit 115 on the other hand, and the reconstructed geometric information is input into the attribute encoder as additional information.
在属性编码部分,首先对原始的属性信息进行预处理,由于几何信息在几何编码之后有所异动,因此,通过属性重上色单元116为几何编码后的每一个点重新分配属性值,实现属性重上色。此外,如果处理的属性信息为颜色信息,还需要将原始的颜色信息通过颜色空间变换单元117进行颜色空间变换,将其转变成更符合人眼视觉特性的YUV色彩空间;然后通过第一属性预测单元118对预处理后属性信息进行属性编码,属性编码首先需要将点云进行重排序,重排序的方式是莫顿码,因此属性编码的遍历顺序为莫顿顺序。PCRM中的属性预测方法为基于莫顿顺序的单点预测,即按照莫顿顺序从当前待编码点(当前点)向前回溯一个点,找到的节点为当前待编码点的预测参考点,然后将预测参考点的属性重建值作为属性预测值,属性残差值为当前待编码点的属性原始值与属性预测值之间的差值;最后通过量化单元119对属性残差值进行量化,将量化后的残差信息输入到属性熵编码器1110中形成属性码流。In the attribute encoding part, the original attribute information is first preprocessed. Since the geometric information changes after geometric encoding, the attribute value is reallocated to each point after geometric encoding through the attribute recoloring unit 116 to achieve attribute recoloring. In addition, if the processed attribute information is color information, the original color information needs to be transformed into a YUV color space that is more in line with the visual characteristics of the human eye through the color space conversion unit 117; then the preprocessed attribute information is attribute encoded through the first attribute prediction unit 118. Attribute encoding first requires the point cloud to be reordered, and the reordering method is Morton code, so the traversal order of attribute encoding is Morton order. The attribute prediction method in PCRM is a single-point prediction based on the Morton order, that is, trace back one point from the current point to be encoded (current point) according to the Morton order, and the node found is the prediction reference point of the current point to be encoded, and then the attribute reconstruction value of the prediction reference point is used as the attribute prediction value, and the attribute residual value is the difference between the attribute original value and the attribute prediction value of the current point to be encoded; finally, the attribute residual value is quantized by the quantization unit 119, and the quantized residual information is input into the attribute entropy encoder 1110 to form an attribute code stream.
本申请实施例还提供一种点云解码器,如图5所示为AVS所提供的点云压缩参考平台PCRM的框架,该点云解码器12包括几何解编码器:几何熵解码器121、八叉树重建单元122、坐标反量化单元123、坐标反平移单元124。属性解码器:属性熵解码器125、反量化单元126、第二属性预测单元127和颜色空间反变换单元128。The embodiment of the present application also provides a point cloud decoder, as shown in FIG5 , which is a framework of the point cloud compression reference platform PCRM provided by AVS. The point cloud decoder 12 includes a geometric decoder: a geometric entropy decoder 121, an octree reconstruction unit 122, a coordinate inverse quantization unit 123, and a coordinate inverse translation unit 124. An attribute decoder: an attribute entropy decoder 125, an inverse quantization unit 126, a second attribute prediction unit 127, and a color space inverse transformation unit 128.
在解码端,同样采用几何和属性分别解码的方式。在几何解码部分,首先通过几何熵解码器121对几何码流进行熵解码,得到每个节点的几何信息,然后按照和几何编码相同的方式通过八叉树重建单元122构建八叉树结构,结合解码几何重建出坐标变换后的、通过八叉树结构表达的几何信息,一方面将该信息通过坐标反量化单元123进行坐标反量化和通过坐标反平移单元124进行反平移,得到解码几何信息。另一方面作为附加信息输入到属性解码器中。At the decoding end, the same method of separately decoding geometry and attributes is adopted. In the geometry decoding part, the geometry bitstream is first entropy decoded by the geometry entropy decoder 121 to obtain the geometry information of each node, and then the octree structure is constructed by the octree reconstruction unit 122 in the same way as the geometry encoding. The geometry information expressed by the octree structure after coordinate transformation is reconstructed in combination with the decoded geometry. On the one hand, the information is dequantized by the coordinate dequantization unit 123 and detranslated by the coordinate detranslation unit 124 to obtain the decoded geometry information. On the other hand, it is input into the attribute decoder as additional information.
在属性解码部分,按照与编码端相同的方式构建莫顿顺序,先通过属性熵解码器125对属性码流进行熵解码,得到量化后的残差信息;然后通过反量化单元126进行反量化,得到属性残差值;类似的,按照与属性编码相同的方式,通过第二属性预测单元127获得当前待解码点的属性预测值,然后将属性 预测值与属性残差值相加,可以恢复出当前待解码点的属性重建值(例如,YUV属性值);最后,经过颜色空间反变换单元128的颜色空间反变换得到解码属性信息。In the attribute decoding part, the Morton order is constructed in the same way as the encoding end. The attribute code stream is first entropy decoded by the attribute entropy decoder 125 to obtain the quantized residual information; then the inverse quantization unit 126 performs inverse quantization to obtain the attribute residual value; similarly, in the same way as the attribute encoding, the attribute prediction value of the current point to be decoded is obtained by the second attribute prediction unit 127, and then the attribute prediction value is added to the attribute residual value to restore the attribute reconstruction value (for example, YUV attribute value) of the current point to be decoded; finally, the decoded attribute information is obtained by color space inverse transformation by the color space inverse transformation unit 128.
还可以理解,对于AVS-PCC编解码框架而言,通用测试条件如下:It can also be understood that for the AVS-PCC codec framework, the general test conditions are as follows:
(1)测试条件共4种:(1) There are 4 test conditions:
条件1:几何位置有限度有损、属性有损;Condition 1: The geometric position is limitedly lossy and the attributes are lossy;
条件2:几何位置无损、属性有损;Condition 2: The geometric position is lossless, but the attributes are lossy;
条件3:几何位置无损、属性有限度有损;Condition 3: The geometric position is lossless, and the attributes are limitedly lossy;
条件4:几何位置无损、属性无损。Condition 4: The geometric position and attributes are lossless.
(2)通用测试序列包括Cat1A,Cat1B,Cat1C,Cat2-frame和Cat3共五类。其中,Cat1A、Cat2-frame点云只包含反射率属性信息,Cat1B、Cat3点云只包含颜色属性信息,Cat1C点云同时包含颜色和反射率属性信息。(2) The general test sequence 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 Cat1C point cloud contains both color and reflectivity attribute information.
(3)技术路线:共2种,以属性压缩所采用的算法进行区分。(3) Technical routes: There are 2 types, which are differentiated by the algorithm used for attribute compression.
技术路线1:预测分支,属性压缩采用基于预测的方法;Technical route 1: predictive branching, attribute compression adopts a prediction-based method;
技术路线2:变换分支,属性压缩采用基于变换的方法,共包含两种变换算法,一种是小波变换算法,一种是k元离散余弦变换(Discrete Cosine Transform,DCT)算法。Technical route 2: Transformation branch. Attribute compression adopts a transformation-based method, which includes two transformation algorithms, one is the wavelet transform algorithm, and the other is the k-ary discrete cosine transform (DCT) algorithm.
在相关技术中,当前AVS-PCC对于属性量化残差采用游程编码。其中,编解码端采用相同的顺序(例如,点云原始采集顺序、莫顿双向、希尔伯特顺序等)依次对每一个点的属性量化残差进行编码/解码,zero_run_length用于对属性量化残差进行是否为0的计数,可称为零游程值。In the related art, the current AVS-PCC uses run-length coding for attribute quantization residuals. The codec uses the same order (for example, the original acquisition order of the point cloud, Morton bidirectional, Hilbert order, etc.) to encode/decode the attribute quantization residual of each point in turn, and zero_run_length is used to count whether the attribute quantization residual is 0, which can be called a zero run value.
然而,当前PCRM在编码零游程值时,对于二值化后的所有码字都采用基于上下文模型的编码/解码方式,这将给硬件实现带来较大难度。因为通常硬件在一个时钟周期内可以处理4~6个旁路模型编码的二进制码字(bin),但仅可以处理1个上下文模型编码的bin。从硬件吞吐率(throughput)的角度来讲,如果完全采用上下文模型来编码所有bin,硬件吞吐率效率会比较低。However, the current PCRM uses context model-based encoding/decoding for all binarized codewords when encoding zero run values, which will bring great difficulty to hardware implementation. Because hardware can usually process 4 to 6 bypass model-encoded binary codewords (bins) in one clock cycle, but can only process 1 context model-encoded bin. From the perspective of hardware throughput, if the context model is fully used to encode all bins, the hardware throughput efficiency will be relatively low.
基于此,本申请实施例提供了一种编解码方法,无论是编码端还是解码端,首先确定零游程值对应的预置参数,然后判断预置参数是否符合第一预设条件;如果预置参数符合第一预设条件,那么对至少一个第一类语法元素标识信息进行基于上下文模型的编解码处理,以及对至少一个第二类语法元素标识信息进行基于旁路模型的编解码处理;如此,根据所确定的预置参数,可以限定在编解码时使用的基于上下文模型的码字数量,使得部分语法元素标识信息采用旁路模型进行编解码处理,从而可以提高硬件吞吐率,降低了硬件实现的难度,有利于硬件实现;而且还能够提升处理速度。Based on this, an embodiment of the present application provides a coding and decoding method, whether it is an encoding end or a decoding end, first determine the preset parameters corresponding to the zero run value, and then judge whether the preset parameters meet the first preset conditions; if the preset parameters meet the first preset conditions, then at least one first-category syntax element identification information is coded and decoded based on the context model, and at least one second-category syntax element identification information is coded and decoded based on the bypass model; in this way, according to the determined preset parameters, the number of codewords based on the context model used in coding and decoding can be limited, so that part of the syntax element identification information is coded and decoded using the bypass model, thereby improving the hardware throughput, reducing the difficulty of hardware implementation, and facilitating hardware implementation; and it can also improve the processing speed.
下面将结合附图对本申请各实施例进行详细说明。The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
在本申请的一实施例中,参见图6,其示出了本申请实施例提供的一种解码方法的流程示意图。如图6所示,该方法可以包括:In one embodiment of the present application, referring to FIG6 , a schematic flow chart of a decoding method provided by an embodiment of the present application is shown. As shown in FIG6 , the method may include:
S601:确定零游程值对应的预置参数。S601: Determine the preset parameters corresponding to the zero-run value.
需要说明的是,本申请实施例的解码方法应用于解码器。另外,该解码方法具体可以是指一种零游程解码方法;更具体地,是指一种限制基于上下文模型的码字数量的零游程解码方法,以提高硬件吞吐率。It should be noted that the decoding method of the embodiment of the present application is applied to a decoder. In addition, the decoding method may specifically refer to a zero-run decoding method; more specifically, a zero-run decoding method that limits the number of codewords based on a context model to improve hardware throughput.
还需要说明的是,在本申请实施例中,零游程值用zero_run_length表示,zero_run_length用于指示属性量化残差值是否均为0的计数。其中,对于点云的属性信息,这里可以是指颜色分量,也可以是指反射率,甚至还可以是其他属性。因此,在一些实施例中,属性量化残差值可以包括下述其中之一:颜色分量量化残差值和反射率量化残差值。It should also be noted that in the embodiment of the present application, the zero run value is represented by zero_run_length, and zero_run_length is used to indicate whether the attribute quantization residual values are all 0. Among them, for the attribute information of the point cloud, it can refer to the color component, or it can refer to the reflectivity, or even other attributes. Therefore, in some embodiments, the attribute quantization residual value can include one of the following: the color component quantization residual value and the reflectivity quantization residual value.
在本申请实施例中,对于颜色分量量化残差值而言,颜色分量量化残差值可以包括:第一颜色分量的量化残差值Res 0、第二颜色分量的量化残差值Res 1和第三颜色分量的量化残差值Res 2。如此,零游程值具体用于指示三个颜色分量的量化残差值是否均为0的计数。示例性地,如果解码得到的零游程值大于0,那么可以说明当前节点的三个颜色分量的量化残差值均为0;如果解码得到的零游程值等于0,那么可以说明当前节点的三个颜色分量的量化残差值不全为0。 In the embodiment of the present application, for the color component quantization residual value, the color component quantization residual value may include: the quantization residual value Res 0 of the first color component, the quantization residual value Res 1 of the second color component, and the quantization residual value Res 2 of the third color component. In this way, the zero-run value is specifically used to indicate whether the quantization residual values of the three color components are all 0. Exemplarily, if the decoded zero-run value is greater than 0, it can be said that the quantization residual values of the three color components of the current node are all 0; if the decoded zero-run value is equal to 0, it can be said that the quantization residual values of the three color components of the current node are not all 0.
在本申请实施例中,对于第一颜色分量、第二颜色分量和第三颜色分量,可以是RGB格式,或者也可以是YUV格式,甚至还可以是其他格式。另外,对于这三个颜色分量的顺序,以YUV为例,可以是YUV顺序,也可以是UYV顺序,还可以是UVY顺序,甚至还可以是VYU顺序等等,即对于颜色分量的格式以及顺序,这里均不作具体限定。In the embodiment of the present application, the first color component, the second color component and the third color component may be in RGB format, or may be in YUV format, or may even be in other formats. In addition, the order of the three color components, taking YUV as an example, may be in YUV order, UYV order, UVY order, or even VYU order, etc., that is, the format and order of the color components are not specifically limited here.
另外,对于反射率量化残差值而言,这时候仅有一个反射率量化残差值,零游程值具体用于指示反射率量化残差值是否为0的计数。示例性地,如果解码得到的零游程值大于0,那么可以说明当前节点的反射率量化残差值为0;如果解码得到的零游程值等于0,那么可以说明当前节点的反射率量化残差值不为0。In addition, for the reflectivity quantization residual value, there is only one reflectivity quantization residual value at this time, and the zero run value is specifically used to indicate whether the reflectivity quantization residual value is 0. Exemplarily, if the decoded zero run value is greater than 0, it can be said that the reflectivity quantization residual value of the current node is 0; if the decoded zero run value is equal to 0, it can be said that the reflectivity quantization residual value of the current node is not 0.
在一些实施例中,如何确定当前节点的属性量化残差值,该方法还可以包括:In some embodiments, how to determine the attribute quantization residual value of the current node, the method may further include:
若零游程值大于0,则确定当前节点的属性量化残差值等于0;以及对零游程值执行减1操作,以根据新的零游程值确定下一节点的属性量化残差值;If the zero-run value is greater than 0, determining the attribute quantization residual value of the current node to be equal to 0; and performing a subtraction operation on the zero-run value to determine the attribute quantization residual value of the next node according to the new zero-run value;
若零游程值等于0,则解码码流,确定当前节点的属性量化残差值;以及继续执行对零游程值进行解码处理的步骤,以根据新的零游程值确定下一节点的属性量化残差值。If the zero-run value is equal to 0, the code stream is decoded to determine the attribute quantization residual value of the current node; and the step of decoding the zero-run value is continued to determine the attribute quantization residual value of the next node according to the new zero-run value.
也就是说,在解码端,首先解码零游程值zero_run_length;以颜色分量量化残差值为例,如果zero_run_length大于0,意味着当前节点三个颜色分量的量化残差值均为0,那么需要进行--zero_run_length操作,然后处理下一节点;如果zero_run_length等于0,意味着当前节点三个颜色分量的量化残差值不全为0,那么需要先通过解码码流,以确定出当前节点三个颜色分量的量化残差值(Res 0,Res 1,Res 2),再继续解码零游程值zero_run_length,然后处理下一节点。 That is to say, at the decoding end, the zero-run value zero_run_length is decoded first; taking the color component quantization residual value as an example, if zero_run_length is greater than 0, it means that the quantization residual values of the three color components of the current node are all 0, then the --zero_run_length operation is required, and then the next node is processed; if zero_run_length is equal to 0, it means that the quantization residual values of the three color components of the current node are not all 0, then it is necessary to first decode the bit stream to determine the quantization residual values of the three color components of the current node (Res 0 , Res 1 , Res 2 ), and then continue to decode the zero-run value zero_run_length, and then process the next node.
还需要说明的是,在本申请实施例中,预置参数用remBinsPass1表示,这里的预置参数用于表示为零游程值分配基于上下文模型的码字的预算数量。示例性地,预置参数的取值可以设置为2 24,但是并不作具体限定。 It should also be noted that in the embodiment of the present application, the preset parameter is represented by remBinsPass1, where the preset parameter is used to represent the budget number of codewords based on the context model allocated to zero run values. Exemplarily, the value of the preset parameter can be set to 2 24 , but is not specifically limited.
在本申请实施例中,对于预置参数而言,其可以是预先设定的参数值,也可以是通过码流确定的。因此,在一些实施例中,确定零游程值对应的预置参数,可以包括:解码码流,确定零游程值对应的预置参数。也就是说,编码端可以将预置参数的取值写入码流,然后解码端通过解码码流就可获得预置参数的取值。In the embodiments of the present application, the preset parameter may be a pre-set parameter value or may be determined by a bitstream. Therefore, in some embodiments, determining the preset parameter corresponding to the zero run value may include: decoding the bitstream to determine the preset parameter corresponding to the zero run value. In other words, the encoder may write the value of the preset parameter into the bitstream, and then the decoder may obtain the value of the preset parameter by decoding the bitstream.
这样,在零游程值解码开始前,需要先确定预置参数的取值,然后判断预置参数是否符合第一预设条件,进而能够限定在解码时使用的基于上下文模型的码字数量,提高硬件吞吐率。In this way, before the zero-run value decoding begins, it is necessary to first determine the value of the preset parameter, and then determine whether the preset parameter meets the first preset condition, thereby limiting the number of codewords based on the context model used during decoding and improving the hardware throughput.
S602:若预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息进行基于上下文模型的解码处理,以及对至少一个第二类语法元素标识信息进行基于旁路模型的解码处理,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值。S602: If the preset parameters meet the first preset condition, at least one first-category syntax element identification information is decoded based on the context model, and at least one second-category syntax element identification information is decoded based on the bypass model to determine the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information.
需要说明的是,在本申请实施例中,预置参数符合第一预设条件,可以包括:确定预置参数的取值大于或等于预设门限值。其中,预设门限值可以是根据硬件配置情况预先设置的一个判定值。示例性地,预设门限值可以设置为4,也可以设置为8,甚至还可以设置为其他数值,这里也不作具体限定。It should be noted that, in the embodiment of the present application, the preset parameter meets the first preset condition, which may include: determining that the value of the preset parameter is greater than or equal to the preset threshold value. The preset threshold value may be a judgment value preset according to the hardware configuration. Exemplarily, the preset threshold value may be set to 4, or may be set to 8, or may even be set to other values, which are not specifically limited here.
还需要说明的是,在本申请实施例中,如果预置参数不符合第一预设条件,那么在一些实施例中,该方法还可以包括:It should also be noted that, in the embodiment of the present application, if the preset parameter does not meet the first preset condition, then in some embodiments, the method may further include:
若预置参数符合第二预设条件,则对至少一个第一类语法元素标识信息和至少一个第二类语法元素标识信息均进行基于旁路模型的解码处理,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值。If the preset parameters meet the second preset condition, at least one first-category syntax element identification information and at least one second-category syntax element identification information are both decoded based on the bypass model to determine the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information.
需要说明的是,在本申请实施例中,预置参数符合第二预设条件,可以包括:确定预置参数不符合第一预设条件;或者,确定预置参数的取值小于预设门限值。It should be noted that, in the embodiment of the present application, the preset parameter meets the second preset condition, which may include: determining that the preset parameter does not meet the first preset condition; or determining that the value of the preset parameter is less than a preset threshold value.
还需要说明的是,在本申请实施例中,由于通常硬件在一个时钟周期内可以处理4~6个基于旁路模型进行解码的码字,但仅可以处理1个基于上下文模型进行解码的码字;考虑到硬件吞吐率,本申请实施例提出的解码方法,能够避免使用基于上下文模型进行解码所有码字的情况。It should also be noted that in the embodiment of the present application, since the hardware can usually process 4 to 6 codewords decoded based on the bypass model in one clock cycle, but can only process 1 codeword decoded based on the context model; considering the hardware throughput, the decoding method proposed in the embodiment of the present application can avoid the situation where all codewords are decoded based on the context model.
具体地,如果预置参数的取值大于或等于预设门限值,那么可以对一部分语法元素(如至少一个第一类语法元素标识信息)进行基于上下文模型的解码处理,以及对另一部分语法元素(如至少一个第二类语法元素标识信息)进行基于旁路模型的解码处理;如果预置参数的取值小于预设门限值,那么可以对所有语法元素(如至少一个第一类语法元素标识信息和至少一个第二类语法元素标识信息)均进行基于旁路模型的解码处理。Specifically, if the value of the preset parameter is greater than or equal to the preset threshold value, then a portion of the syntax elements (such as at least one first-category syntax element identification information) can be decoded based on the context model, and another portion of the syntax elements (such as at least one second-category syntax element identification information) can be decoded based on the bypass model; if the value of the preset parameter is less than the preset threshold value, then all syntax elements (such as at least one first-category syntax element identification information and at least one second-category syntax element identification information) can be decoded based on the bypass model.
在一些实施例中,在预置参数符合第一预设条件时,该方法还可以包括:对于至少一个第一类语法元素标识信息,在基于上下文模型每解码完成一个第一类语法元素标识信息后,对预置参数的取值执行一次减1操作。In some embodiments, when the preset parameter meets the first preset condition, the method may further include: for at least one first-category syntax element identification information, after each first-category syntax element identification information is decoded based on the context model, performing a subtraction operation on the value of the preset parameter.
也就是说,在本申请实施例中,对于可能出现的至少一个第一类语法元素标识信息,使用基于上下文模型的解码方式,且在每解码完成一个第一类语法元素标识信息时,还需要执行--remBinsPass1操作。That is to say, in an embodiment of the present application, for at least one first-category syntax element identification information that may appear, a context model-based decoding method is used, and each time a first-category syntax element identification information is decoded, a --remBinsPass1 operation needs to be performed.
S603:根据至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值,确定零游程值。S603: Determine a zero run value according to a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information.
需要说明的是,在本申请实施例中,如果解码出至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值之后,根据至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值,就可以确定出零游程值。It should be noted that in an embodiment of the present application, after decoding the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information, the zero run value can be determined based on the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information.
还需要说明的是,在本申请实施例中,在某些情况下,例如零游程值小于预设阈值,这时候仅通过至少一个第一类语法元素标识信息的取值就可以确定出零游程值。在一些实施例中,该方法还可以包括:It should also be noted that in the embodiments of the present application, in some cases, for example, when the zero run value is less than a preset threshold, the zero run value can be determined only by the value of at least one first-category syntax element identification information. In some embodiments, the method may further include:
若预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息进行基于上下文模型的解码处理,确定至少一个第一类语法元素标识信息的取值;以及根据至少一个第一类语法元素标识信息的取值,确定零游程值;或者,If the preset parameter meets the first preset condition, then the at least one first-category syntax element identification information is decoded based on the context model to determine the value of the at least one first-category syntax element identification information; and the zero run value is determined according to the value of the at least one first-category syntax element identification information; or,
若预置参数符合第二预设条件,则对至少一个第一类语法元素标识信息进行基于旁路模型的解码处理,确定至少一个第一类语法元素标识信息的取值;以及根据至少一个第一类语法元素标识信息的取值,确定零游程值。If the preset parameters meet the second preset condition, at least one first-category syntax element identification information is decoded based on the bypass model to determine the value of at least one first-category syntax element identification information; and a zero run value is determined based on the value of at least one first-category syntax element identification information.
也就是说,在某些情况下,根据至少一个第一类语法元素标识信息的取值,就可以确定零游程值是否等于0、或者零游程值是否等于1、或者零游程值是否等于2、或者零游程值减预设常数再除以2的商是否等于0、是否等于1等等,进而确定出零游程值。That is to say, in some cases, based on the value of at least one first-category syntax element identification information, it is possible to determine whether the zero run value is equal to 0, or whether the zero run value is equal to 1, or whether the zero run value is equal to 2, or whether the quotient of the zero run value minus a preset constant divided by 2 is equal to 0, equal to 1, and so on, thereby determining the zero run value.
本申请实施例提供了一种解码方法,确定零游程值对应的预置参数;若预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息进行基于上下文模型的解码处理,以及对至少一个第二类语法元素标识信息进行基于旁路模型的解码处理,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值;根据至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值,确定零游程值。这样,在确定出零游程值对应的预置参数之后,可以限定在解码时使用的基于上下文模型的码字数量,使得部分语法元素标识信息采用旁路模型进行解码处理,从而可以提高硬件吞吐率,降低了硬件实现的难度;而且还能够提升处理速度。The embodiment of the present application provides a decoding method, which determines the preset parameters corresponding to the zero-run value; if the preset parameters meet the first preset condition, at least one first-category syntax element identification information is decoded based on the context model, and at least one second-category syntax element identification information is decoded based on the bypass model to determine the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information; the zero-run value is determined according to the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information. In this way, after determining the preset parameters corresponding to the zero-run value, the number of codewords based on the context model used in decoding can be limited, so that part of the syntax element identification information is decoded using the bypass model, thereby improving the hardware throughput and reducing the difficulty of hardware implementation; and it can also improve the processing speed.
在本申请的另一实施例中,基于前述实施例所述的解码方法,参见图7,其示出了本申请实施例提供的一种解码方法的详细流程示意图。如图7所示,该方法可以包括:In another embodiment of the present application, based on the decoding method described in the above embodiment, see Figure 7, which shows a detailed flow chart of a decoding method provided by an embodiment of the present application. As shown in Figure 7, the method may include:
S701:确定零游程值对应的预置参数。S701: Determine the preset parameters corresponding to the zero-run value.
S702:判断预置参数是否大于或等于预设门限值。S702: Determine whether the preset parameter is greater than or equal to the preset threshold value.
S703:若预置参数大于或等于预设门限值,则基于上下文模型对可能出现的至少一个第一类语法元素标识信息进行解码处理,以及基于旁路模型对可能出现的至少一个第二类语法元素标识信息进行解码处理,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值。S703: If the preset parameter is greater than or equal to the preset threshold value, at least one first-category syntax element identification information that may appear is decoded based on the context model, and at least one second-category syntax element identification information that may appear is decoded based on the bypass model to determine the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information.
S704:若预置参数小于预设门限值,则基于旁路模型对可能出现的至少一个第一类语法元素标识信息和至少一个第二类语法元素标识信息进行解码处理,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值。S704: If the preset parameter is less than a preset threshold value, decoding is performed on at least one first-category syntax element identification information and at least one second-category syntax element identification information that may appear based on the bypass model to determine the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information.
S705:根据至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值,确定零游程值。S705: Determine a zero run value according to a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information.
需要说明的是,在本申请实施例中,至少一个第一类语法元素标识信息和至少一个第二类语法元素标识信息并不作具体限定。在一种可能的实现方式中,至少一个第一类语法元素标识信息包括下述至少一项:第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息和第四语法元素标识信息;以及,至少一个第二类语法元素标识信息至少包括:第一数值标识信息。It should be noted that, in the embodiment of the present application, at least one first-category syntax element identification information and at least one second-category syntax element identification information are not specifically limited. In a possible implementation, at least one first-category syntax element identification information includes at least one of the following: first syntax element identification information, second syntax element identification information, third syntax element identification information, and fourth syntax element identification information; and at least one second-category syntax element identification information includes at least: first numerical identification information.
其中,第一语法元素标识信息用于指示零游程值是否等于0,第二语法元素标识信息用于指示零游程值是否等于1,第三语法元素标识信息用于指示零游程值是否等于2,第四语法元素标识信息用于指示零游程值进行第一运算后得到的第一数值的奇偶特性,第一数值标识信息用于指示零游程值进行第二运算后得到的第二数值。Among them, the first syntax element identification information is used to indicate whether the zero run value is equal to 0, the second syntax element identification information is used to indicate whether the zero run value is equal to 1, the third syntax element identification information is used to indicate whether the zero run value is equal to 2, the fourth syntax element identification information is used to indicate the parity characteristic of the first numerical value obtained after the zero run value is subjected to the first operation, and the first numerical value identification information is used to indicate the second numerical value obtained after the zero run value is subjected to the second operation.
在一些实施例中,对零游程值进行第一运算,可以包括:根据零游程值与第一预设值进行减法运算,得到第一数值。In some embodiments, performing a first operation on the zero-run value may include: performing a subtraction operation on the zero-run value and a first preset value to obtain a first value.
在一些实施例中,对零游程值进行第二运算,可以包括:根据零游程值与第一预设值进行减法运算,得到第一数值;将第二数值设置为等于第一数值除以2的商。或者,在得到第一数值之后,还可以包括:对第一数值进行右移一位处理,得到第二数值。In some embodiments, performing a second operation on the zero-run value may include: performing a subtraction operation on the zero-run value and the first preset value to obtain a first value; and setting the second value to be equal to a quotient of the first value divided by 2. Alternatively, after obtaining the first value, the method may further include: performing a right shift operation on the first value by one position to obtain the second value.
需要说明的是,在本申请实施例中,对于除法运算,可以用右移运算替代,“>>”表示右移运算符;“除以2”相当于右移一位;对于乘法运算,可以用左移运算替代,“<<”表示左移运算符;“乘以2”相当于左移一位。It should be noted that in the embodiments of the present application, for division operations, right shift operations can be used instead, and “>>” represents the right shift operator; “divide by 2” is equivalent to shifting right by one bit; for multiplication operations, left shift operations can be used instead, and “<<” represents the left shift operator; “multiply by 2” is equivalent to shifting left by one bit.
还需要说明的是,在本申请实施例中,第一预设值可以设置为3,但是并不作具体限定。另外,第一语法元素标识信息可以用zero_run_length_equal_zero表示,第二语法元素标识信息可以用zero_run_length_equal_one表示,第三语法元素标识信息可以用zero_run_length_equal_two表示,第四语法元素标识信息可以用zero_run_length_minus3_parity表示,第一数值标识信息可以用zero_run_length_minus3_div2表示。It should also be noted that, in the embodiment of the present application, the first preset value can be set to 3, but is not specifically limited. In addition, the first syntax element identification information can be represented by zero_run_length_equal_zero, the second syntax element identification information can be represented by zero_run_length_equal_one, the third syntax element identification information can be represented by zero_run_length_equal_two, the fourth syntax element identification information can be represented by zero_run_length_minus3_parity, and the first numerical identification information can be represented by zero_run_length_minus3_div2.
在一些实施例中,在预置参数符合第一预设条件时,对零游程值进行解码处理,可以包括:基于上下文模型对可能出现的第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息和第四 语法元素标识信息进行解码处理,确定至少一个第一类语法元素标识信息的取值;以及基于旁路模型对可能出现的第一数值标识信息进行解码处理,确定第一数值标识信息的取值;根据至少一个第一类语法元素标识信息的取值和第一数值标识信息的取值,确定零游程值。In some embodiments, when the preset parameters meet the first preset condition, decoding the zero run value may include: decoding the first syntax element identification information, the second syntax element identification information, the third syntax element identification information and the fourth syntax element identification information based on the context model to determine the value of at least one first-category syntax element identification information; and decoding the first numerical identification information that may appear based on the bypass model to determine the value of the first numerical identification information; determining the zero run value according to the value of at least one first-category syntax element identification information and the value of the first numerical identification information.
在一种具体的实施例中,在预置参数符合第一预设条件时,对零游程值进行解码处理,可以包括:In a specific embodiment, when the preset parameters meet the first preset condition, decoding the zero run value may include:
基于上下文模型对第一语法元素标识信息进行解码处理,确定第一语法元素标识信息的取值;Decoding the first syntax element identification information based on the context model to determine a value of the first syntax element identification information;
若第一语法元素标识信息的取值为第一值,则确定零游程值等于0;If the value of the first syntax element identification information is the first value, determining that the zero run value is equal to 0;
若第一语法元素标识信息的取值为第二值,则基于上下文模型对第二语法元素标识信息进行解码处理,确定第二语法元素标识信息的取值;If the value of the first syntax element identification information is the second value, decoding the second syntax element identification information based on the context model to determine the value of the second syntax element identification information;
若第二语法元素标识信息的取值为第一值,则确定零游程值等于1;If the value of the second syntax element identification information is the first value, determining that the zero run value is equal to 1;
若第二语法元素标识信息的取值为第二值,则基于上下文模型对第三语法元素标识信息进行解码处理,确定第三语法元素标识信息的取值;If the value of the second syntax element identification information is the second value, decoding the third syntax element identification information based on the context model to determine the value of the third syntax element identification information;
若第三语法元素标识信息的取值为第一值,则确定零游程值等于2;If the value of the third syntax element identification information is the first value, determining that the zero run value is equal to 2;
若第三语法元素标识信息的取值为第二值,则基于上下文模型对第四语法元素标识信息进行解码处理,确定第四语法元素标识信息的取值;以及基于旁路模型对第一数值标识信息进行解码处理,确定第一数值标识信息的取值;If the value of the third syntax element identification information is the second value, decoding the fourth syntax element identification information based on the context model to determine the value of the fourth syntax element identification information; and decoding the first numerical identification information based on the bypass model to determine the value of the first numerical identification information;
根据第一预设值、第四语法元素标识信息的取值和第一数值标识信息的取值,确定零游程值。A zero run value is determined according to the first preset value, the value of the fourth syntax element identification information, and the value of the first numerical value identification information.
进一步地,在一些实施例中,该方法还可以包括:在每一次基于上下文模型对以下的语法元素标识信息解码完成后,对预置参数的取值执行一次减1操作:Furthermore, in some embodiments, the method may further include: after each decoding of the following syntax element identification information based on the context model is completed, performing a subtraction operation on the value of the preset parameter:
第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息和第四语法元素标识信息。first syntax element identification information, second syntax element identification information, third syntax element identification information and fourth syntax element identification information.
在另一些实施例中,在预置参数符合第二预设条件时,对零游程值进行解码处理,可以包括:基于旁路模型对可能出现的第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息和第一数值标识信息进行解码处理,确定零游程值。也就是说,如果预置参数符合第二预设条件,那么对于零游程值对应的所有二值化码字均采用旁路模型进行解码处理。In other embodiments, when the preset parameters meet the second preset condition, decoding the zero run value may include: decoding the first syntax element identification information, the second syntax element identification information, the third syntax element identification information, the fourth syntax element identification information and the first numerical identification information that may appear based on the bypass model to determine the zero run value. That is, if the preset parameters meet the second preset condition, then all binary codewords corresponding to the zero run value are decoded using the bypass model.
在一种具体的实施例中,在预置参数符合第二预设条件时,对零游程值进行解码处理,可以包括:In a specific embodiment, when the preset parameters meet the second preset condition, decoding the zero run value may include:
基于旁路模型对第一语法元素标识信息进行解码处理,确定第一语法元素标识信息的取值;Decoding the first syntax element identification information based on the bypass model to determine a value of the first syntax element identification information;
若第一语法元素标识信息的取值为第一值,则确定零游程值等于0;If the value of the first syntax element identification information is the first value, determining that the zero run value is equal to 0;
若第一语法元素标识信息的取值为第二值,则基于旁路模型对第二语法元素标识信息进行解码处理,确定第二语法元素标识信息的取值;If the value of the first syntax element identification information is the second value, decoding the second syntax element identification information based on the bypass model to determine the value of the second syntax element identification information;
若第二语法元素标识信息的取值为第一值,则确定零游程值等于1;If the value of the second syntax element identification information is the first value, determining that the zero run value is equal to 1;
若第二语法元素标识信息的取值为第二值,则基于旁路模型对第三语法元素标识信息进行解码处理,确定第三语法元素标识信息的取值;If the value of the second syntax element identification information is the second value, decoding the third syntax element identification information based on the bypass model to determine the value of the third syntax element identification information;
若第三语法元素标识信息的取值为第一值,则确定零游程值等于2;If the value of the third syntax element identification information is the first value, determining that the zero run value is equal to 2;
若第三语法元素标识信息的取值为第二值,则基于旁路模型对第四语法元素标识信息进行解码处理,确定第四语法元素标识信息的取值;以及基于旁路模型对第一数值标识信息进行解码处理,确定第一数值标识信息的取值;If the value of the third syntax element identification information is the second value, decoding the fourth syntax element identification information based on the bypass model to determine the value of the fourth syntax element identification information; and decoding the first numerical identification information based on the bypass model to determine the value of the first numerical identification information;
根据第一预设值、第四语法元素标识信息的取值和第一数值标识信息的取值,确定零游程值。A zero run value is determined according to the first preset value, the value of the fourth syntax element identification information, and the value of the first numerical value identification information.
需要说明的是,在本申请实施例中,针对不同的语法元素标识信息,例如第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息和第四语法元素标识信息等,各自对应的第一值和第二值可以相同,或者也可以不相同,这里不作具体限定。It should be noted that in the embodiments of the present application, for different syntax element identification information, such as the first syntax element identification information, the second syntax element identification information, the third syntax element identification information and the fourth syntax element identification information, the corresponding first value and the second value may be the same, or may be different, and no specific limitation is made here.
还需要说明的是,在本申请实施例中,第一值和第二值可以是参数形式,也可以是数字形式。具体地,每一个语法元素标识信息可以是写入在概述(profile)中的参数,也可以是一个标志位/标识符的取值,这里对此不作具体限定。It should also be noted that, in the embodiment of the present application, the first value and the second value may be in parameter form or in digital form. Specifically, each syntax element identification information may be a parameter written in the profile or a value of a flag bit/identifier, which is not specifically limited here.
示例性地,第一值可以设置为1,第二值可以设置为0;或者,第一值可以设置为0,第二值可以设置为1;或者,第一值可以设置为true,第二值可以设置为false;或者,第一值可以设置为false,第二值可以设置为true。其中,在本申请实施例中,第一值设置为1,第二值设置为0,但是对此并不作具体限定。For example, the first value may be set to 1 and the second value may be set to 0; or, the first value may be set to 0 and the second value may be set to 1; or, the first value may be set to true and the second value may be set to false; or, the first value may be set to false and the second value may be set to true. In the embodiment of the present application, the first value is set to 1 and the second value is set to 0, but this is not specifically limited.
这样,首先解码第一语法元素标识信息,如果第一语法元素标识信息的取值为1,那么可以确定零游程值等于0;否则,如果第一语法元素标识信息的取值为0,意味着零游程值不等于0,那么需要继续解码第二语法元素标识信息,如果第二语法元素标识信息的取值为1,那么可以确定零游程值等于1;否则,如果第二语法元素标识信息的取值为0,意味着零游程值不等于1,那么需要继续解码第三语法元素标识信息,如果第三语法元素标识信息的取值为1,那么可以确定零游程值等于2;否则,如果第三语法元素标识信息的取值为0,意味着零游程值不等于2,那么需要继续解码第四语法元素标识信息 和第一数值标识信息,以确定出零游程值。In this way, first decode the first syntax element identification information. If the value of the first syntax element identification information is 1, then it can be determined that the zero run value is equal to 0; otherwise, if the value of the first syntax element identification information is 0, it means that the zero run value is not equal to 0, so it is necessary to continue decoding the second syntax element identification information. If the value of the second syntax element identification information is 1, then it can be determined that the zero run value is equal to 1; otherwise, if the value of the second syntax element identification information is 0, it means that the zero run value is not equal to 1, then it is necessary to continue decoding the third syntax element identification information. If the value of the third syntax element identification information is 1, then it can be determined that the zero run value is equal to 2; otherwise, if the value of the third syntax element identification information is 0, it means that the zero run value is not equal to 2, then it is necessary to continue decoding the fourth syntax element identification information and the first numerical identification information to determine the zero run value.
在一些实施例中,对于第一数值标识信息,基于旁路模型对第一数值标识信息进行解码处理,确定第一数值标识信息的取值,可以包括:基于旁路模型对第一数值标识信息进行解码处理,确定第一数值标识信息对应的至少一个二值符号;对至少一个二值符号进行反二值化处理,得到第一数值标识信息的取值。In some embodiments, for the first numerical identification information, decoding the first numerical identification information based on a bypass model to determine the value of the first numerical identification information may include: decoding the first numerical identification information based on the bypass model to determine at least one binary symbol corresponding to the first numerical identification information; debinarizing at least one binary symbol to obtain the value of the first numerical identification information.
示例性地,以二阶指数哥伦布解码为例,基于旁路模型对第一数值标识信息对应的码字进行解码处理,可以得到一组二值符号011,那么经过反二值化处理之后,第一数值标识信息的取值为3。Exemplarily, taking the second-order exponential Golomb decoding as an example, the codeword corresponding to the first numerical identification information is decoded based on the bypass model to obtain a set of binary symbols 011. Then, after the debinarization process, the value of the first numerical identification information is 3.
还需要说明的是,在本申请实施例中,第四语法元素标识信息用于指示零游程值减去第一预设值后得到的第一数值的奇偶特性。在一些实施例中,对于第四语法元素标识信息的取值,该方法还可以包括:若第四语法元素标识信息的取值为第一值,则确定第一数值为奇数;若第四语法元素标识信息的取值为第二值,则确定第一数值为偶数;It should also be noted that, in the embodiment of the present application, the fourth syntax element identification information is used to indicate the parity characteristic of the first value obtained by subtracting the first preset value from the zero run value. In some embodiments, for the value of the fourth syntax element identification information, the method may further include: if the value of the fourth syntax element identification information is the first value, determining that the first value is an odd number; if the value of the fourth syntax element identification information is the second value, determining that the first value is an even number;
或者,若第四语法元素标识信息的取值为第一值,则确定第一数值与2进行除法运算后的余数为1;若第四语法元素标识信息的取值为第二值,则确定第一数值与2进行除法运算后的余数为0。Alternatively, if the value of the fourth syntax element identification information is the first value, it is determined that the remainder after the first value is divided by 2 is 1; if the value of the fourth syntax element identification information is the second value, it is determined that the remainder after the first value is divided by 2 is 0.
简单来说,在本申请实施例中,以第一值设置为1,第二值设置为0为例,对于零游程值,如果第一数值为奇数,那么零游程值需要加1;如果第一数值为偶数,那么零游程值需要加0。即,零游程值是根据第一预设值、第一数值标识信息的取值和第四语法元素标识信息的取值来确定的。In short, in the embodiment of the present application, taking the first value as 1 and the second value as 0 as an example, for the zero run value, if the first value is an odd number, the zero run value needs to be added by 1; if the first value is an even number, the zero run value needs to be added by 0. That is, the zero run value is determined according to the first preset value, the value of the first value identification information, and the value of the fourth syntax element identification information.
进一步地,在一些实施例中,根据第一预设值、第四语法元素标识信息的取值和第一数值标识信息的取值,确定零游程值,可以包括:对第一数值标识信息的取值进行第三运算,得到第三数值;根据第一预设值、第三数值和第四语法元素标识信息的取值,确定零游程值。Further, in some embodiments, determining the zero run value based on the first preset value, the value of the fourth syntax element identification information and the value of the first numerical identification information may include: performing a third operation on the value of the first numerical identification information to obtain a third numerical value; determining the zero run value based on the first preset value, the third numerical value and the value of the fourth syntax element identification information.
还需要说明的是,在本申请实施例中,对第一数值标识信息的取值进行第三运算,得到第三数值,可以包括:对第一数值标识信息的取值与2进行乘法运算,得到第三数值;或者,对第一数值标识信息的取值进行左移一位运算,得到第三数值。It should also be noted that, in the embodiment of the present application, performing a third operation on the value of the first numerical identification information to obtain a third numerical value may include: multiplying the value of the first numerical identification information by 2 to obtain the third numerical value; or shifting the value of the first numerical identification information left by one position to obtain the third numerical value.
进一步地,在一些实施例中,根据第一预设值、第三数值和第四语法元素标识信息的取值,确定零游程值,可以包括:对第一预设值、第三数值和第四语法元素标识信息的取值进行加法运算,得到零游程值。Further, in some embodiments, determining the zero run value based on the values of the first preset value, the third numerical value, and the fourth syntax element identification information may include: adding the first preset value, the third numerical value, and the values of the fourth syntax element identification information to obtain the zero run value.
示例性地,假定第一预设值设置为3,第四语法元素标识信息用zero_run_length_minus3_parity表示,第一数值标识信息用zero_run_length_minus3_div2表示;那么,零游程值zero_run_length=3+zero_run_length_minus3_parity+(zero_run_length_minus3_div2<<1)。Exemplarily, assuming that the first preset value is set to 3, the fourth syntax element identification information is represented by zero_run_length_minus3_parity, and the first numerical identification information is represented by zero_run_length_minus3_div2; then, the zero run value zero_run_length=3+zero_run_length_minus3_parity+(zero_run_length_minus3_div2<<1).
可以理解地,对于属性量化残差值采用游程解码,具体实施步骤如下:It can be understood that run-length decoding is used for the attribute quantization residual value, and the specific implementation steps are as follows:
(1)属性量化残差值为颜色分量量化残差值。(1) The attribute quantization residual value is the color component quantization residual value.
解码端采用相同的顺序(点云原始采集顺序、莫顿顺序、希尔伯特顺序等)依次对每个节点三个颜色分量的量化残差值(Res 0,Res 1,Res 2)进行解码处理,zero_run_length用于对三个颜色分量的量化残差值进行是否均为0的计数,称为零游程值,其初始值设为0,对于每一个节点,具体如下: The decoding end uses the same order (the original acquisition order of the point cloud, Morton order, Hilbert order, etc.) to decode the quantized residual values (Res 0 , Res 1 , Res 2 ) of the three color components of each node in turn. Zero_run_length is used to count whether the quantized residual values of the three color components are all 0, which is called the zero run value. Its initial value is set to 0. For each node, the details are as follows:
先解码零游程值zero_run_length,如果zero_run_length>0,说明当前节点三个颜色分量的量化残差值均为零,则进行--zero_run_length操作,然后处理下一个节点;First decode the zero run value zero_run_length. If zero_run_length>0, it means that the quantized residual values of the three color components of the current node are all zero, then perform the --zero_run_length operation, and then process the next node;
若zero_run_length==0,说明当前节点三个颜色分量的量化残差值不全为零,则先解码三个颜色分量的量化残差值(Res 0,Res 1,Res 2),再解码零游程值zero_run_length,然后处理下一个节点。 If zero_run_length==0, it means that the quantized residual values of the three color components of the current node are not all zero, then the quantized residual values of the three color components (Res 0 , Res 1 , Res 2 ) are decoded first, then the zero run value zero_run_length is decoded, and then the next node is processed.
(2)属性量化残差值为反射率量化残差值。(2) The attribute quantization residual value is the reflectance quantization residual value.
解码端采用相同的顺序(点云原始采集顺序、莫顿顺序、希尔伯特顺序等)依次对每个节点的反射率量化残差值进行解码处理,zero_run_length用于对反射率量化残差值进行是否为0的计数,称为零游程值,其初始值设为0,对于每一个节点,具体如下:The decoding end uses the same order (the original acquisition order of the point cloud, Morton order, Hilbert order, etc.) to decode the reflectivity quantization residual value of each node in turn. Zero_run_length is used to count whether the reflectivity quantization residual value is 0, which is called the zero run value. Its initial value is set to 0. For each node, the details are as follows:
先解码零游程值zero_run_length,如果zero_run_length>0,说明当前节点的反射率量化残差值为零,则进行--zero_run_length操作,然后处理下一个节点;First decode the zero run value zero_run_length. If zero_run_length>0, it means that the reflectivity quantization residual value of the current node is zero, then perform the --zero_run_length operation, and then process the next node;
若zero_run_length==0,说明当前节点的反射率量化残差值不为零,则先解码反射率量化残差值,再解码零游程值zero_run_length,然后处理下一个节点。If zero_run_length==0, it means that the reflectivity quantization residual value of the current node is not zero, then the reflectivity quantization residual value is decoded first, then the zero run value zero_run_length is decoded, and then the next node is processed.
具体的零游程值解码过程为:The specific zero run value decoding process is:
a)解码zero_run_length_equal_zero,如果zero_run_length_equal_zero标志位的解码值等于1,则零游程值等于0,解码完成;a) Decode zero_run_length_equal_zero. If the decoded value of the zero_run_length_equal_zero flag is equal to 1, the zero run value is equal to 0, and decoding is completed;
b)若零游程值不等于0,则继续解码zero_run_length_equal_one,如果zero_run_length_equal_one标志位的解码值等于1,则零游程值等于1,解码完成;b) If the zero run value is not equal to 0, continue decoding zero_run_length_equal_one. If the decoded value of the zero_run_length_equal_one flag is equal to 1, the zero run value is equal to 1, and the decoding is completed;
c)若零游程值不等于1,则继续解码zero_run_length_equal_two,如果zero_run_length_equal_two标志位的解码值等于1,则零游程值等于2,解码完成;c) If the zero run value is not equal to 1, continue decoding zero_run_length_equal_two. If the decoded value of the zero_run_length_equal_two flag is equal to 1, the zero run value is equal to 2, and decoding is completed.
d)若零游程值不等于2,则继续解码zero_run_length_minus3_parity,以及zero_run_length_minus3_div2,则零游程值等于zero_run_length_minus3_div2乘以2后加3再加奇偶特性标志符zero_run_length_minus3_parity的值,即zero_run_length=3+zero_run_length_minus3_parity+(zero_run_length_minus3_div2<<1)。d) If the zero run value is not equal to 2, continue decoding zero_run_length_minus3_parity and zero_run_length_minus3_div2, then the zero run value is equal to zero_run_length_minus3_div2 multiplied by 2 plus 3 plus the value of the parity characteristic indicator zero_run_length_minus3_parity, that is, zero_run_length=3+zero_run_length_minus3_parity+(zero_run_length_minus3_div2<<1).
在相关技术中,目前PCRM在解码零游程值时,对于所有二值化后的码字,均采用基于上下文模型的解码方式,例如,若要解码的零游程值为10,则将其进行二值化的过程为:In the related art, when PCRM decodes zero run values, for all binarized code words, a decoding method based on a context model is used. For example, if the zero run value to be decoded is 10, the process of binarizing it is as follows:
zero_run_length_equal_zero标志位为0;The zero_run_length_equal_zero flag is 0;
zero_run_length_equal_one标志位为0;The zero_run_length_equal_one flag is 0;
zero_run_length_equal_two标志位为0;The zero_run_length_equal_two flag is 0;
zero_run_length_minus3_parity标志符为1;The zero_run_length_minus3_parity flag is 1;
zero_run_length_minus3_div2为3,继续对3进行二值化,以二阶指数哥伦布编码为例,对3进行二值化之后的结果为0 1 1;zero_run_length_minus3_div2 is 3, and 3 is binarized. Taking the second-order exponential Golomb coding as an example, the result of binarizing 3 is 0 1 1;
因此,对于一个数值为10的零游程值,其二值化后的码字结果为0 0 0 1 0 1 1。在解码端,对于零游程值二值化后的所有码字都采用基于上下文模型的解码方式,这将给硬件实现带来较大难度。基于此,在本申请实施例中,该解码过程可以如下:Therefore, for a zero-run value of 10, the binarized codeword result is 0 0 0 1 0 1 1. At the decoding end, all codewords after the zero-run value is binarized are decoded in a context model-based manner, which will bring great difficulty to hardware implementation. Based on this, in the embodiment of the present application, the decoding process can be as follows:
(i)为零游程值分配基于上下文模型解码码字的预算remBinsPass1(初始值可设置为2 24); (i) Allocate a budget remBinsPass1 (the initial value can be set to 2 24 ) for the zero run value based on the context model decoding codeword;
(ii)在零游程解码开始前,判断remBinsPass1是否大于等于T(如设置为4);(ii) Before zero-run decoding begins, determine whether remBinsPass1 is greater than or equal to T (such as set to 4);
(iii)当remBinsPass1≥T时,对可能出现的zero_run_length_equal_zero、zero_run_length_equal_one、zero_run_length_equal_two、zero_run_length_minus3_parity采用基于上下文模型的解码方式,且每解完一个标志位/标志符,做remBinsPass1--操作,而zero_run_length_minus3_div2的所有二值化后的码字采用基于旁路模型的解码方式;(iii) When remBinsPass1 ≥ T, the possible zero_run_length_equal_zero, zero_run_length_equal_one, zero_run_length_equal_two, and zero_run_length_minus3_parity are decoded using a context model, and after each flag bit/marker is decoded, a remBinsPass1-- operation is performed, while all binary codewords of zero_run_length_minus3_div2 are decoded using a bypass model;
(iv)当不满足remBinsPass1≥T时,对零游程值的所有二值化后的码字均采用基于旁路模型的解码方式。(iv) When remBinsPass1≥T is not satisfied, the bypass model-based decoding method is used for all binary codewords with zero run values.
在实现中,本申请实施例的整个解码过程的语法表描述如表1所示。In implementation, the syntax table description of the entire decoding process of the embodiment of the present application is shown in Table 1.
表1Table 1
Figure PCTCN2022137381-appb-000001
Figure PCTCN2022137381-appb-000001
Figure PCTCN2022137381-appb-000002
Figure PCTCN2022137381-appb-000002
在另一种可能的实现方式中,至少一个第一类语法元素标识信息包括下述至少一项:第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息、第五语法元素标识信息、第六语法元素标识信息、第七语法元素标识信息和第八语法元素标识信息;以及,至少一个第二类语法元素标识信息至少包括:第二数值标识信息。In another possible implementation, at least one first-category grammatical element identification information includes at least one of the following: first grammatical element identification information, second grammatical element identification information, third grammatical element identification information, fourth grammatical element identification information, fifth grammatical element identification information, sixth grammatical element identification information, seventh grammatical element identification information and eighth grammatical element identification information; and at least one second-category grammatical element identification information includes at least: second numerical identification information.
其中,第一语法元素标识信息用于指示零游程值是否等于0,第二语法元素标识信息用于指示零游程值是否等于1,第三语法元素标识信息用于指示零游程值是否等于2,第四语法元素标识信息用于指示零游程值进行第一运算后得到的第一数值的奇偶特性,第五语法元素标识信息用于指示零游程值进行第二运算后得到的第二数值是否等于0,第六语法元素标识信息用于指示零游程值进行第二运算后得到的第二数值是否等于1,第七语法元素标识信息用于指示零游程值进行第二运算后得到的第二数值是否等于2,第八语法元素标识信息用于指示零游程值进行第二运算后得到的第二数值是否等于3,第二数值标识信息用于指示零游程值进行第四运算后得到的第四数值。Among them, the first syntax element identification information is used to indicate whether the zero run value is equal to 0, the second syntax element identification information is used to indicate whether the zero run value is equal to 1, the third syntax element identification information is used to indicate whether the zero run value is equal to 2, the fourth syntax element identification information is used to indicate the parity characteristic of the first numerical value obtained after the zero run value is subjected to the first operation, the fifth syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 0, the sixth syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 1, the seventh syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 2, the eighth syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 3, and the second numerical value identification information is used to indicate the fourth numerical value obtained after the zero run value is subjected to the fourth operation.
在一些实施例中,对零游程值进行第一运算,可以包括:根据零游程值与第一预设值进行减法运算,得到第一数值。In some embodiments, performing a first operation on the zero-run value may include: performing a subtraction operation on the zero-run value and a first preset value to obtain a first value.
在一些实施例中,对零游程值进行第二运算,可以包括:根据零游程值与第一预设值进行减法运算,得到第一数值;将第二数值设置为等于第一数值除以2的商。In some embodiments, performing a second operation on the zero-run value may include: performing a subtraction operation on the zero-run value and a first preset value to obtain a first value; and setting the second value to be equal to a quotient of the first value divided by 2.
在一些实施例中,对零游程值进行第四运算,可以包括:根据零游程值与第一预设值进行减法运算,得到第一数值;将第二数值设置为等于第一数值除以2的商;根据第二数值与第二预设值进行减法运算,得到第四数值。In some embodiments, performing a fourth operation on the zero-run value may include: performing a subtraction operation on the zero-run value and a first preset value to obtain a first value; setting the second value to be equal to the quotient of the first value divided by 2; and performing a subtraction operation on the second value and a second preset value to obtain a fourth value.
在一些实施例中,在得到第一数值之后,还可以包括:对第一数值进行右移一位处理,得到第二数值。In some embodiments, after obtaining the first value, the method may further include: right-shifting the first value by one bit to obtain a second value.
在本申请实施例中,第一预设值与第二预设值可以不同,示例性地,第一预设值可以设置为3,第二预设值可以设置为4。另外,第一语法元素标识信息可以用zero_run_length_equal_zero表示,第二语法元素标识信息可以用zero_run_length_equal_one表示,第三语法元素标识信息可以用zero_run_length_equal_two表示,第四语法元素标识信息可以用zero_run_length_minus3_parity表示,第五语法元素标识信息可以用zero_run_length_minus3_div2_equal_zero表示,第六语法元素标识信息可以用zero_run_length_minus3_div2_equal_one表示,第七语法元素标识信息可以用zero_run_length_minus3_div2_equal_two表示,第八语法元素标识信息可以用zero_run_length_minus3_div2_equal_three表示,第二数值标识信息可以用zero_run_length_minus3_div2_minus4表示。In the embodiment of the present application, the first preset value and the second preset value may be different. For example, the first preset value may be set to 3, and the second preset value may be set to 4. In addition, the first syntax element identification information may be represented by zero_run_length_equal_zero, the second syntax element identification information may be represented by zero_run_length_equal_one, the third syntax element identification information may be represented by zero_run_length_equal_two, the fourth syntax element identification information may be represented by zero_run_length_minus3_parity, the fifth syntax element identification information may be represented by zero_run_length_minus3_div2_equal_zero, the sixth syntax element identification information may be represented by zero_run_length_minus3_div2_equal_one, the seventh syntax element identification information may be represented by zero_run_length_minus3_div2_equal_two, the eighth syntax element identification information may be represented by zero_run_length_minus3_div2_equal_three, and the second value identification information may be represented by zero_run_length_minus3_div2_minus4.
在一些实施例中,在预置参数符合第一预设条件时,对零游程值进行解码处理,可以包括:基于上下文模型对可能出现的第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息、第五语法元素标识信息、第六语法元素标识信息、第七语法元素标识信息和第八语法元素标识信息进行解码处理,确定至少一个第一类语法元素标识信息的取值;以及基于旁路模型对可能出现的第二数值标识信息进行解码处理,确定第二数值标识信息的取值;根据至少一个第一类语法元素标识信息的取值和第二数值标识信息的取值,确定零游程值。In some embodiments, when the preset parameters meet the first preset condition, decoding the zero run value may include: decoding the first grammatical element identification information, the second grammatical element identification information, the third grammatical element identification information, the fourth grammatical element identification information, the fifth grammatical element identification information, the sixth grammatical element identification information, the seventh grammatical element identification information and the eighth grammatical element identification information based on the context model to determine the value of at least one first-category grammatical element identification information; and decoding the second numerical identification information that may appear based on the bypass model to determine the value of the second numerical identification information; determining the zero run value according to the value of at least one first-category grammatical element identification information and the value of the second numerical identification information.
在一种具体的实施例中,在预置参数符合第一预设条件时,对零游程值进行解码处理,可以包括:In a specific embodiment, when the preset parameters meet the first preset condition, decoding the zero run value may include:
基于上下文模型对第一语法元素标识信息进行解码处理,确定第一语法元素标识信息的取值;Decoding the first syntax element identification information based on the context model to determine a value of the first syntax element identification information;
若第一语法元素标识信息的取值为第一值,则确定零游程值等于0;If the value of the first syntax element identification information is the first value, determining that the zero run value is equal to 0;
若第一语法元素标识信息的取值为第二值,则基于上下文模型对第二语法元素标识信息进行解码处理,确定第二语法元素标识信息的取值;If the value of the first syntax element identification information is the second value, decoding the second syntax element identification information based on the context model to determine the value of the second syntax element identification information;
若第二语法元素标识信息的取值为第一值,则确定零游程值等于1;If the value of the second syntax element identification information is the first value, determining that the zero run value is equal to 1;
若第二语法元素标识信息的取值为第二值,则基于上下文模型对第三语法元素标识信息进行解码处理,确定第三语法元素标识信息的取值;If the value of the second syntax element identification information is the second value, decoding the third syntax element identification information based on the context model to determine the value of the third syntax element identification information;
若第三语法元素标识信息的取值为第一值,则确定零游程值等于2;If the value of the third syntax element identification information is the first value, determining that the zero run value is equal to 2;
若第三语法元素标识信息的取值为第二值,则基于上下文模型对第四语法元素标识信息进行解码处理,确定第四语法元素标识信息的取值;以及基于上下文模型对第五语法元素标识信息进行解码处理,确定第五语法元素标识信息的取值;If the value of the third syntax element identification information is the second value, decoding the fourth syntax element identification information based on the context model to determine the value of the fourth syntax element identification information; and decoding the fifth syntax element identification information based on the context model to determine the value of the fifth syntax element identification information;
若第五语法元素标识信息的取值为第一值,则确定零游程值等于第一预设值和第四语法元素标识信息的取值之和;If the value of the fifth syntax element identification information is the first value, determining that the zero run value is equal to the sum of the first preset value and the value of the fourth syntax element identification information;
若第五语法元素标识信息的取值为第二值,则基于上下文模型对第六语法元素标识信息进行解码处理,确定第六语法元素标识信息的取值;If the value of the fifth syntax element identification information is the second value, decoding the sixth syntax element identification information based on the context model to determine the value of the sixth syntax element identification information;
若第六语法元素标识信息的取值为第一值,则确定零游程值等于第一常数、第一预设值和第四语法元素标识信息的取值之和;If the value of the sixth syntax element identification information is the first value, determining that the zero run value is equal to the sum of the first constant, the first preset value and the value of the fourth syntax element identification information;
若第六语法元素标识信息的取值为第二值,则基于上下文模型对第七语法元素标识信息进行解码处理,确定第七语法元素标识信息的取值;If the value of the sixth grammar element identification information is the second value, decoding the seventh grammar element identification information based on the context model to determine the value of the seventh grammar element identification information;
若第七语法元素标识信息的取值为第一值,则确定零游程值等于第二常数、第一预设值和第四语法元素标识信息的取值之和;If the value of the seventh syntax element identification information is the first value, determining that the zero run value is equal to the sum of the second constant, the first preset value and the value of the fourth syntax element identification information;
若第七语法元素标识信息的取值为第二值,则基于上下文模型对第八语法元素标识信息进行解码处理,确定第八语法元素标识信息的取值;If the value of the seventh syntax element identification information is the second value, decoding the eighth syntax element identification information based on the context model to determine the value of the eighth syntax element identification information;
若第八语法元素标识信息的取值为第一值,则确定零游程值等于第三常数、第一预设值和第四语法元素标识信息的取值之和;If the value of the eighth syntax element identification information is the first value, determining that the zero run value is equal to the sum of the third constant, the first preset value and the value of the fourth syntax element identification information;
若第八语法元素标识信息的取值为第二值,则基于旁路模型对第二数值标识信息进行解码处理,确定第二数值标识信息的取值;If the value of the eighth syntax element identification information is the second value, decoding the second numerical identification information based on the bypass model to determine the value of the second numerical identification information;
根据第一预设值、第四语法元素标识信息的取值和第二数值标识信息的取值,确定零游程值。The zero run value is determined according to the first preset value, the value of the fourth syntax element identification information and the value of the second numerical identification information.
进一步地,在一些实施例中,该方法还可以包括:在每一次基于上下文模型对以下的语法元素标识信息解码完成后,对预置参数的取值执行一次减1操作:Furthermore, in some embodiments, the method may further include: after each decoding of the following syntax element identification information based on the context model is completed, performing a subtraction operation on the value of the preset parameter:
第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息、第五语法元素标识信息、第六语法元素标识信息、第七语法元素标识信息和第八语法元素标识信息。first grammatical element identification information, second grammatical element identification information, third grammatical element identification information, fourth grammatical element identification information, fifth grammatical element identification information, sixth grammatical element identification information, seventh grammatical element identification information and eighth grammatical element identification information.
在另一些实施例中,在预置参数符合第二预设条件时,对零游程值进行解码处理,可以包括:基于旁路模型对可能出现的第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息、第五语法元素标识信息、第六语法元素标识信息、第七语法元素标识信息、第八语法元素标识信息和第二数值标识信息进行解码处理,确定零游程值。也就是说,如果预置参数符合第二预设条件,那么对于零游程值对应的所有二值化码字均采用旁路模型进行解码处理。In other embodiments, when the preset parameters meet the second preset condition, decoding the zero run value may include: decoding the first syntax element identification information, the second syntax element identification information, the third syntax element identification information, the fourth syntax element identification information, the fifth syntax element identification information, the sixth syntax element identification information, the seventh syntax element identification information, the eighth syntax element identification information and the second numerical identification information that may appear based on the bypass model to determine the zero run value. That is, if the preset parameters meet the second preset condition, then all binary codewords corresponding to the zero run value are decoded using the bypass model.
在一种具体的实施例中,在预置参数符合第二预设条件时,对零游程值进行解码处理,可以包括:In a specific embodiment, when the preset parameters meet the second preset condition, decoding the zero run value may include:
基于旁路模型对第一语法元素标识信息进行解码处理,确定第一语法元素标识信息的取值;Decoding the first syntax element identification information based on the bypass model to determine a value of the first syntax element identification information;
若第一语法元素标识信息的取值为第一值,则确定零游程值等于0;If the value of the first syntax element identification information is the first value, determining that the zero run value is equal to 0;
若第一语法元素标识信息的取值为第二值,则基于旁路模型对第二语法元素标识信息进行解码处理,确定第二语法元素标识信息的取值;If the value of the first syntax element identification information is the second value, decoding the second syntax element identification information based on the bypass model to determine the value of the second syntax element identification information;
若第二语法元素标识信息的取值为第一值,则确定零游程值等于1;If the value of the second syntax element identification information is the first value, determining that the zero run value is equal to 1;
若第二语法元素标识信息的取值为第二值,则基于旁路模型对第三语法元素标识信息进行解码处理,确定第三语法元素标识信息的取值;If the value of the second syntax element identification information is the second value, decoding the third syntax element identification information based on the bypass model to determine the value of the third syntax element identification information;
若第三语法元素标识信息的取值为第一值,则确定零游程值等于2;If the value of the third syntax element identification information is the first value, determining that the zero run value is equal to 2;
若第三语法元素标识信息的取值为第二值,则基于旁路模型对第四语法元素标识信息进行解码处理,确定第四语法元素标识信息的取值;以及基于旁路模型对第五语法元素标识信息进行解码处理,确定第五语法元素标识信息的取值;If the value of the third syntax element identification information is the second value, decoding the fourth syntax element identification information based on the bypass model to determine the value of the fourth syntax element identification information; and decoding the fifth syntax element identification information based on the bypass model to determine the value of the fifth syntax element identification information;
若第五语法元素标识信息的取值为第一值,则确定零游程值等于第一预设值和第四语法元素标识信息的取值之和;If the value of the fifth syntax element identification information is the first value, determining that the zero run value is equal to the sum of the first preset value and the value of the fourth syntax element identification information;
若第五语法元素标识信息的取值为第二值,则基于旁路模型对第六语法元素标识信息进行解码处理,确定第六语法元素标识信息的取值;If the value of the fifth syntax element identification information is the second value, decoding the sixth syntax element identification information based on the bypass model to determine the value of the sixth syntax element identification information;
若第六语法元素标识信息的取值为第一值,则确定零游程值等于第一常数、第一预设值和第四语法元素标识信息的取值之和;If the value of the sixth syntax element identification information is the first value, determining that the zero run value is equal to the sum of the first constant, the first preset value and the value of the fourth syntax element identification information;
若第六语法元素标识信息的取值为第二值,则基于旁路模型对第七语法元素标识信息进行解码处理,确定第七语法元素标识信息的取值;If the value of the sixth syntax element identification information is the second value, decoding the seventh syntax element identification information based on the bypass model to determine the value of the seventh syntax element identification information;
若第七语法元素标识信息的取值为第一值,则确定零游程值等于第二常数、第一预设值和第四语法元素标识信息的取值之和;If the value of the seventh syntax element identification information is the first value, determining that the zero run value is equal to the sum of the second constant, the first preset value and the value of the fourth syntax element identification information;
若第七语法元素标识信息的取值为第二值,则基于旁路模型对第八语法元素标识信息进行解码处理,确定第八语法元素标识信息的取值;If the value of the seventh syntax element identification information is the second value, decoding the eighth syntax element identification information based on the bypass model to determine the value of the eighth syntax element identification information;
若第八语法元素标识信息的取值为第一值,则确定零游程值等于第三常数、第一预设值和第四语法元素标识信息的取值之和;If the value of the eighth syntax element identification information is the first value, determining that the zero run value is equal to the sum of the third constant, the first preset value and the value of the fourth syntax element identification information;
若第八语法元素标识信息的取值为第二值,则基于旁路模型对第二数值标识信息进行解码处理,确定第二数值标识信息的取值;If the value of the eighth syntax element identification information is the second value, decoding the second numerical identification information based on the bypass model to determine the value of the second numerical identification information;
根据第一预设值、第四语法元素标识信息的取值和第二数值标识信息的取值,确定零游程值。The zero run value is determined according to the first preset value, the value of the fourth syntax element identification information and the value of the second numerical identification information.
在本申请实施例中,第一常数、第二常数和第三常数均为2的倍数。示例性地,第一常数设置为2, 第二常数设置为4,第三常数设置为6。In the embodiment of the present application, the first constant, the second constant and the third constant are all multiples of 2. Exemplarily, the first constant is set to 2, the second constant is set to 4, and the third constant is set to 6.
需要说明的是,在本申请实施例中,针对不同的语法元素标识信息,例如第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息、第五语法元素标识信息、第六语法元素标识信息、第七语法元素标识信息和第八语法元素标识信息等,各自对应的第一值和第二值可以相同,或者也可以不相同,这里不作具体限定。It should be noted that in the embodiments of the present application, for different grammatical element identification information, such as the first grammatical element identification information, the second grammatical element identification information, the third grammatical element identification information, the fourth grammatical element identification information, the fifth grammatical element identification information, the sixth grammatical element identification information, the seventh grammatical element identification information and the eighth grammatical element identification information, etc., the corresponding first value and the second value may be the same, or may be different, and there is no specific limitation here.
还需要说明的是,在本申请实施例中,第一值和第二值可以是参数形式,也可以是数字形式。具体地,每一个语法元素标识信息可以是写入在概述(profile)中的参数,也可以是一个标志位/标识符的取值,这里对此不作具体限定。It should also be noted that, in the embodiment of the present application, the first value and the second value may be in parameter form or in digital form. Specifically, each syntax element identification information may be a parameter written in the profile or a value of a flag bit/identifier, which is not specifically limited here.
示例性地,针对每一个语法元素标识信息,第一值可以设置为1,第二值可以设置为0;或者,第一值可以设置为0,第二值可以设置为1;或者,第一值可以设置为true,第二值可以设置为false;或者,第一值可以设置为false,第二值可以设置为true。其中,在本申请实施例中,第一值设置为1,第二值设置为0,但是对此并不作具体限定。Exemplarily, for each syntax element identification information, the first value may be set to 1, and the second value may be set to 0; or, the first value may be set to 0, and the second value may be set to 1; or, the first value may be set to true, and the second value may be set to false; or, the first value may be set to false, and the second value may be set to true. In the embodiment of the present application, the first value is set to 1, and the second value is set to 0, but this is not specifically limited.
这样,以第一预设值为3为例,首先解码第一语法元素标识信息,如果第一语法元素标识信息的取值为1,那么可以确定零游程值等于0;否则,如果第一语法元素标识信息的取值为0,意味着零游程值不等于0,那么需要继续解码第二语法元素标识信息,如果第二语法元素标识信息的取值为1,那么可以确定零游程值等于1;否则,如果第二语法元素标识信息的取值为0,意味着零游程值不等于1,那么需要继续解码第三语法元素标识信息,如果第三语法元素标识信息的取值为1,那么可以确定零游程值等于2;否则,如果第三语法元素标识信息的取值为0,意味着零游程值不等于2,那么需要继续解码第四语法元素标识信息和第五语法元素标识信息,如果第五语法元素标识信息的取值为1,那么可以确定零游程值等于3与第四语法元素标识信息的取值之和;如果第五语法元素标识信息的取值为0,那么需要继续解码第六语法元素标识信息,如果第六语法元素标识信息的取值为1,那么可以确定零游程值等于5与第四语法元素标识信息的取值之和;如果第六语法元素标识信息的取值为0,那么需要继续解码第七语法元素标识信息,如果第七语法元素标识信息的取值为1,那么可以确定零游程值等于7与第四语法元素标识信息的取值之和;如果第七语法元素标识信息的取值为0,那么需要继续解码第八语法元素标识信息,如果第八语法元素标识信息的取值为1,那么可以确定零游程值等于9与第四语法元素标识信息的取值之和;如果第八语法元素标识信息的取值为0,那么需要继续解码第二数值标识信息,以确定出零游程值。In this way, taking the first preset value of 3 as an example, first decode the first syntax element identification information. If the value of the first syntax element identification information is 1, then it can be determined that the zero run value is equal to 0; otherwise, if the value of the first syntax element identification information is 0, it means that the zero run value is not equal to 0, then it is necessary to continue decoding the second syntax element identification information. If the value of the second syntax element identification information is 1, then it can be determined that the zero run value is equal to 1; otherwise, if the value of the second syntax element identification information is 0, it means that the zero run value is not equal to 1, then it is necessary to continue decoding the third syntax element identification information. If the value of the third syntax element identification information is 1, then it can be determined that the zero run value is equal to 2; otherwise, if the value of the third syntax element identification information is 0, it means that the zero run value is not equal to 2, then it is necessary to continue decoding the fourth syntax element identification information and the fifth syntax element identification information. If the value of the fifth syntax element identification information is 1, then it can be determined that the zero run value is equal to 1. The value is equal to the sum of 3 and the value of the fourth grammatical element identification information; if the value of the fifth grammatical element identification information is 0, it is necessary to continue decoding the sixth grammatical element identification information, and if the value of the sixth grammatical element identification information is 1, it can be determined that the zero-run value is equal to the sum of 5 and the value of the fourth grammatical element identification information; if the value of the sixth grammatical element identification information is 0, it is necessary to continue decoding the seventh grammatical element identification information, and if the value of the seventh grammatical element identification information is 1, it can be determined that the zero-run value is equal to the sum of 7 and the value of the fourth grammatical element identification information; if the value of the seventh grammatical element identification information is 0, it is necessary to continue decoding the eighth grammatical element identification information, and if the value of the eighth grammatical element identification information is 1, it can be determined that the zero-run value is equal to the sum of 9 and the value of the fourth grammatical element identification information; if the value of the eighth grammatical element identification information is 0, it is necessary to continue decoding the second numerical identification information to determine the zero-run value.
在一些实施例中,对于第二数值标识信息,基于旁路模型对第二数值标识信息进行解码处理,确定第二数值标识信息的取值,可以包括:基于旁路模型对第二数值标识信息进行解码处理,确定第二数值标识信息对应的至少一个二值符号;对至少一个二值符号进行反二值化处理,得到第二数值标识信息的取值。In some embodiments, for the second numerical identification information, decoding the second numerical identification information based on a bypass model to determine the value of the second numerical identification information may include: decoding the second numerical identification information based on the bypass model to determine at least one binary symbol corresponding to the second numerical identification information; debinarizing at least one binary symbol to obtain the value of the second numerical identification information.
还需要说明的是,在本申请实施例中,第四语法元素标识信息用于指示零游程值减去第一预设值后得到的第一数值的奇偶特性,即第一数值与2进行除法运算后的余数。如果第一数值为奇数,那么零游程值需要加1;如果第一数值为偶数,那么零游程值需要加0。也就是说,零游程值是根据第一预设值、第二数值标识信息的取值和第四语法元素标识信息的取值来确定的。It should also be noted that, in the embodiment of the present application, the fourth syntax element identification information is used to indicate the parity characteristic of the first value obtained by subtracting the first preset value from the zero run value, that is, the remainder after the first value is divided by 2. If the first value is an odd number, the zero run value needs to be added by 1; if the first value is an even number, the zero run value needs to be added by 0. In other words, the zero run value is determined according to the first preset value, the value of the second value identification information, and the value of the fourth syntax element identification information.
进一步地,在一些实施例中,根据第一预设值、第四语法元素标识信息的取值和第二数值标识信息的取值,确定零游程值,包括:Further, in some embodiments, determining the zero run value according to the first preset value, the value of the fourth syntax element identification information, and the value of the second numerical identification information includes:
根据第二数值标识信息的取值和第二预设值,确定第一运算结果;Determine the first operation result according to the value of the second numerical identification information and the second preset value;
对第一运算结果进行第五运算,得到第二运算结果;Performing a fifth operation on the first operation result to obtain a second operation result;
根据第一预设值、第二运算结果和第四语法元素标识信息的取值,确定零游程值。A zero run value is determined according to the first preset value, the second operation result, and the value of the fourth syntax element identification information.
还需要说明的是,在本申请实施例中,根据第二数值标识信息的取值和第二预设值,确定第一运算结果,可以包括:根据第二数值标识信息的取值与第二预设值进行加法运算,确定第一运算结果。It should also be noted that, in the embodiment of the present application, determining the first operation result based on the value of the second numerical identification information and the second preset value may include: performing an addition operation on the value of the second numerical identification information and the second preset value to determine the first operation result.
还需要说明的是,在本申请实施例中,对第一运算结果进行第五运算,得到第二运算结果,可以包括:对第一运算结果与2进行乘法运算,得到第二运算结果;或者,对第一运算结果进行左移一位运算,得到第二运算结果。It should also be noted that, in the embodiment of the present application, performing the fifth operation on the first operation result to obtain the second operation result may include: multiplying the first operation result by 2 to obtain the second operation result; or shifting the first operation result left by one bit to obtain the second operation result.
进一步地,在一些实施例中,根据第一预设值、第二运算结果和第四语法元素标识信息的取值,确定零游程值,可以包括:对第一预设值、第二运算结果和第四语法元素标识信息的取值进行加法运算,得到零游程值。Further, in some embodiments, determining the zero run value based on the first preset value, the second operation result and the value of the fourth syntax element identification information may include: adding the first preset value, the second operation result and the value of the fourth syntax element identification information to obtain the zero run value.
示例性地,假定第一预设值设置为3,第二预设值设置为4,第四语法元素标识信息用zero_run_length_minus3_parity表示,第二数值标识信息用zero_run_length_minus3_div2_minus4表示;那么,零游程值zero_run_length=3+zero_run_length_minus3_parity+((zero_run_length_minus3_div2_minus4+4)<<1)。Exemplarily, assuming that the first preset value is set to 3, the second preset value is set to 4, the fourth syntax element identification information is represented by zero_run_length_minus3_parity, and the second numerical identification information is represented by zero_run_length_minus3_div2_minus4; then, the zero run value zero_run_length=3+zero_run_length_minus3_parity+((zero_run_length_minus3_div2_minus4+4)<<1).
可以理解地,对于属性量化残差值采用游程解码,具体的零游程值解码过程为:It can be understood that run decoding is used for the attribute quantization residual value, and the specific zero run value decoding process is:
a)解码zero_run_length_equal_zero,如果zero_run_length_equal_zero标志位的解码值等于1,则零游程值等于0,解码完成;a) Decode zero_run_length_equal_zero. If the decoded value of the zero_run_length_equal_zero flag is equal to 1, the zero run value is equal to 0, and decoding is completed;
b)若零游程值不等于0,则继续解码zero_run_length_equal_one,如果zero_run_length_equal_one标志位的解码值等于1,则零游程值等于1,解码完成;b) If the zero run value is not equal to 0, continue decoding zero_run_length_equal_one. If the decoded value of the zero_run_length_equal_one flag is equal to 1, the zero run value is equal to 1, and the decoding is completed;
c)若零游程值不等于1,则继续解码zero_run_length_equal_two,如果zero_run_length_equal_two标志位的解码值等于1,则零游程值等于2,解码完成;c) If the zero run value is not equal to 1, continue decoding zero_run_length_equal_two. If the decoded value of the zero_run_length_equal_two flag is equal to 1, the zero run value is equal to 2, and decoding is completed.
d)若零游程值不等于2,则继续解码zero_run_length_minus3_parity;d) If the zero run value is not equal to 2, continue decoding zero_run_length_minus3_parity;
e)解码zero_run_length_minus3_div2_equal_zero,如果zero_run_length_equal_zero标志位的解码值等于1,则零游程值等于(3+zero_run_length_minus3_parity),解码完成;e) Decode zero_run_length_minus3_div2_equal_zero. If the decoded value of the zero_run_length_equal_zero flag is equal to 1, the zero run value is equal to (3+zero_run_length_minus3_parity), and decoding is completed;
f)若zero_run_length_minus3_div2_equal_zero标志位的解码值等于0,则继续解码zero_run_length_minus3_div2_equal_one,如果zero_run_length_minus3_div2_equal_one标志位的解码值等于1,则零游程值等于(5+zero_run_length_minus3_parity),解码完成;f) If the decoded value of the zero_run_length_minus3_div2_equal_zero flag is equal to 0, continue decoding zero_run_length_minus3_div2_equal_one. If the decoded value of the zero_run_length_minus3_div2_equal_one flag is equal to 1, the zero run value is equal to (5+zero_run_length_minus3_parity), and decoding is completed.
g)若zero_run_length_minus3_div2_equal_one标志位的解码值等于0,则继续解码zero_run_length_minus3_div2_equal_two,如果zero_run_length_minus3_div2_equal_two标志位的解码值等于1,则属性残差零游程值等于(7+zero_run_length_minus3_parity),解码完成;g) If the decoded value of the zero_run_length_minus3_div2_equal_one flag is equal to 0, continue decoding zero_run_length_minus3_div2_equal_two. If the decoded value of the zero_run_length_minus3_div2_equal_two flag is equal to 1, the attribute residual zero run value is equal to (7+zero_run_length_minus3_parity), and decoding is completed.
h)若zero_run_length_minus3_div2_equal_two标志位的解码值等于0,则继续解码zero_run_length_minus3_div2_equal_three,如果zero_run_length_minus3_div2_equal_three标志位的解码值等于1,则属性残差零游程值等于(9+zero_run_length_minus3_parity),解码完成;h) If the decoded value of the zero_run_length_minus3_div2_equal_two flag is equal to 0, continue decoding zero_run_length_minus3_div2_equal_three; if the decoded value of the zero_run_length_minus3_div2_equal_three flag is equal to 1, the attribute residual zero run value is equal to (9+zero_run_length_minus3_parity), and decoding is completed;
i)若zero_run_length_minus3_div2_equal_three标志位的解码值等于0,则解码zero_run_length_minus3_div2_minus4,则属性残差零游程值为3+zero_run_length_minus3_parity+((zero_run_length_minus3_div2_minus4+4)<<1),解码完成。i) If the decoded value of the zero_run_length_minus3_div2_equal_three flag is equal to 0, then zero_run_length_minus3_div2_minus4 is decoded, and the attribute residual zero run value is 3+zero_run_length_minus3_parity+((zero_run_length_minus3_div2_minus4+4)<<1), and the decoding is completed.
在一种具体的实施例中,为了提升硬件吞吐率,该解码过程可以如下:In a specific embodiment, in order to improve the hardware throughput, the decoding process may be as follows:
(i)为零游程值分配基于上下文模型解码码字的预算remBinsPass1(初始值可设置为2 24); (i) Allocate a budget remBinsPass1 (the initial value can be set to 2 24 ) for the zero run value based on the context model decoding codeword;
(ii)在零游程解码开始前,判断remBinsPass1是否大于等于T(如设置为8);(ii) Before zero-run decoding begins, determine whether remBinsPass1 is greater than or equal to T (e.g., set to 8);
(iii)当remBinsPass1≥T时,对可能出现的zero_run_length_equal_zero、zero_run_length_equal_one、zero_run_length_equal_two、zero_run_length_minus3_parity、zero_run_length_minus3_div2_equal_zero、zero_run_length_minus3_div2_equal_one、zero_run_length_minus3_div2_equal_two、zero_run_length_minus3_div2_equal_three采用基于上下文模型的解码方式,且每解完一个标志位/标志符,做remBinsPass1--操作,而zero_run_length_minus3_div2_minus4的所有二值化后的码字采用基于旁路模型的解码方式;(iii) When remBinsPass1 ≥ T, the possible zero_run_length_equal_zero, zero_run_length_equal_one, zero_run_length_equal_two, zero_run_length_minus3_parity, zero_run_length_minus3_div2_equal_zero, zero_run_length_minus3_div2_equal_one, zero_run_length_minus3_div2_equal_two, and zero_run_length_minus3_div2_equal_three are decoded using a context model, and after each flag bit/sign is decoded, a remBinsPass1-- operation is performed, while all binary codewords of zero_run_length_minus3_div2_minus4 are decoded using a bypass model-based decoding method;
(iv)当不满足remBinsPass1≥T时,对零游程值的所有二值化后的码字均采用基于旁路模型的解码方式。(iv) When remBinsPass1≥T is not satisfied, the bypass model-based decoding method is used for all binary codewords with zero run values.
在实现中,本申请实施例的整个解码过程的语法表描述如表2所示。In implementation, the syntax table description of the entire decoding process of the embodiment of the present application is shown in Table 2.
表2Table 2
Figure PCTCN2022137381-appb-000003
Figure PCTCN2022137381-appb-000003
Figure PCTCN2022137381-appb-000004
Figure PCTCN2022137381-appb-000004
简单来说,在本申请实施例中,设定预算remBinsPass1对零游程解码时使用的基于上下文模型的码字个数进行限制,可以提高吞吐率,提供对硬件更友好的实现方式。Simply put, in an embodiment of the present application, setting the budget remBinsPass1 to limit the number of codewords based on the context model used in zero-run decoding can improve throughput and provide a more hardware-friendly implementation.
示例性地,表3和表4为预测分支的测试结果。其中,表3为测试条件----几何位置无损、属性有限度有损(C3-lossless geometry,limit-lossy attributes)所对应的测试结果,表4为测试条件----几何位置无损、属性无损(C4-lossless geometry,lossless attributes)所对应的测试结果。For example, Table 3 and Table 4 are the test results of the prediction branch. Table 3 is the test result corresponding to the test condition -- lossless geometry, limit-lossy attributes (C3-lossless geometry,limit-lossy attributes), and Table 4 is the test result corresponding to the test condition -- lossless geometry, lossless attributes (C4-lossless geometry,lossless attributes).
表3table 3
Figure PCTCN2022137381-appb-000005
Figure PCTCN2022137381-appb-000005
表4Table 4
Figure PCTCN2022137381-appb-000006
Figure PCTCN2022137381-appb-000006
示例性地,表5、表6、表7和表8为多层变换分支的测试结果。其中,表5为测试条件----几何位置有限度有损、属性有损(C1-limit-lossy geometry,lossy attributes)所对应的测试结果,表6为测试条件----几何位置无损、属性有损(C2-lossless geometry,lossy attributes)所对应的测试结果,表7为测试条件----几何位置无损、属性有限度有损(C3-lossless geometry,limit-lossy attributes)所对应的测试结果,表8为测试条件----几何位置无损、属性无损(C4-lossless geometry,lossless attributes)所对应的测试结果。Exemplarily, Tables 5, 6, 7 and 8 are test results of multi-layer transform branches. Among them, Table 5 is the test result corresponding to the test condition ---- limited lossy geometry, lossy attributes (C1-limit-lossy geometry, lossy attributes), Table 6 is the test result corresponding to the test condition ---- lossless geometry, lossy attributes (C2-lossless geometry, lossy attributes), Table 7 is the test result corresponding to the test condition ---- lossless geometry, limited lossy attributes (C3-lossless geometry, limit-lossy attributes), and Table 8 is the test result corresponding to the test condition ---- lossless geometry, lossless attributes (C4-lossless geometry, lossless attributes).
表5table 5
Figure PCTCN2022137381-appb-000007
Figure PCTCN2022137381-appb-000007
表6Table 6
Figure PCTCN2022137381-appb-000008
Figure PCTCN2022137381-appb-000008
表7Table 7
Figure PCTCN2022137381-appb-000009
Figure PCTCN2022137381-appb-000009
表8Table 8
Figure PCTCN2022137381-appb-000010
Figure PCTCN2022137381-appb-000010
示例性地,表9和表10为在资源受限的预测变换分支的测试结果。其中,表9为测试条件----几何位置有限度有损、属性有损(C1-limit-lossy geometry,lossy attributes)所对应的测试结果,表10为测试 条件----几何位置无损、属性有损(C2-lossless geometry,lossy attributes)所对应的测试结果。For example, Tables 9 and 10 are the test results of the resource-constrained prediction transformation branch. Table 9 is the test result corresponding to the test condition ---- limited-lossy geometry, lossy attributes (C1-limit-lossy geometry, lossy attributes), and Table 10 is the test result corresponding to the test condition ---- lossless geometry, lossy attributes (C2-lossless geometry, lossy attributes).
表9Table 9
Figure PCTCN2022137381-appb-000011
Figure PCTCN2022137381-appb-000011
表10Table 10
Figure PCTCN2022137381-appb-000012
Figure PCTCN2022137381-appb-000012
示例性地,表11和表12为在资源不受限的预测变换分支的测试结果。其中,表11为测试条件----几何位置有限度有损、属性有损(C1-limit-lossy geometry,lossy attributes)所对应的测试结果,表12为测试条件----几何位置无损、属性有损(C2-lossless geometry,lossy attributes)所对应的测试结果。For example, Table 11 and Table 12 are the test results of the prediction transformation branch with unlimited resources. Table 11 is the test result corresponding to the test condition ---- limited lossy geometry, lossy attributes (C1-limit-lossy geometry, lossy attributes), and Table 12 is the test result corresponding to the test condition ---- lossless geometry, lossy attributes (C2-lossless geometry, lossy attributes).
表11Table 11
Figure PCTCN2022137381-appb-000013
Figure PCTCN2022137381-appb-000013
表12Table 12
Figure PCTCN2022137381-appb-000014
Figure PCTCN2022137381-appb-000014
本实施例提供了一种解码方法,通过上述实施例对前述实施例的具体实现进行了详细阐述,从中可以看出,根据前述实施例的技术方案,首先确定零游程值对应的预置参数,然后判断预置参数是否符合第一预设条件;如果预置参数符合第一预设条件,那么对至少一个第一类语法元素标识信息进行基于上下文模型的解码处理,以及对至少一个第二类语法元素标识信息进行基于旁路模型的解码处理;如此,根据所确定的预置参数,可以限定在解码时使用的基于上下文模型的码字数量,使得部分语法元素标识信息采用旁路模型进行解码处理,从而可以提高硬件吞吐率,降低了硬件实现的难度;而且还能够提升处理速度。The present embodiment provides a decoding method, and the specific implementation of the aforementioned embodiment is elaborated in detail through the aforementioned embodiment. It can be seen that according to the technical scheme of the aforementioned embodiment, the preset parameters corresponding to the zero-run value are first determined, and then it is determined whether the preset parameters meet the first preset condition; if the preset parameters meet the first preset condition, then at least one first-category syntax element identification information is decoded based on the context model, and at least one second-category syntax element identification information is decoded based on the bypass model; in this way, according to the determined preset parameters, the number of codewords based on the context model used in decoding can be limited, so that part of the syntax element identification information is decoded using the bypass model, thereby improving the hardware throughput and reducing the difficulty of hardware implementation; and it can also improve the processing speed.
在本申请的又一实施例中,参见图8,其示出了本申请实施例提供的一种编码方法的流程示意图。如图8所示,该方法可以包括:In another embodiment of the present application, referring to FIG8 , a schematic diagram of a flow chart of an encoding method provided in an embodiment of the present application is shown. As shown in FIG8 , the method may include:
S801:确定零游程值以及零游程值对应的预置参数。S801: Determine a zero-run value and preset parameters corresponding to the zero-run value.
需要说明的是,本申请实施例的编码方法应用于编码器。另外,该编码方法具体可以是指一种零游程编码方法;更具体地,是指一种限制基于上下文模型的码字数量的零游程编码方法。It should be noted that the encoding method of the embodiment of the present application is applied to an encoder. In addition, the encoding method may specifically refer to a zero-run encoding method; more specifically, a zero-run encoding method that limits the number of codewords based on a context model.
还需要说明的是,在本申请实施例中,零游程值用zero_run_length表示,zero_run_length用于指 示属性量化残差值是否均为0的计数。其中,对于点云的属性信息,这里可以是指颜色分量,也可以是指反射率,甚至还可以是其他属性。因此,在一些实施例中,属性量化残差值可以包括下述其中之一:颜色分量量化残差值和反射率量化残差值。It should also be noted that in the embodiment of the present application, the zero run value is represented by zero_run_length, and zero_run_length is used to indicate whether the attribute quantization residual values are all 0. Among them, for the attribute information of the point cloud, it can refer to the color component, or it can refer to the reflectivity, or even other attributes. Therefore, in some embodiments, the attribute quantization residual value can include one of the following: the color component quantization residual value and the reflectivity quantization residual value.
在本申请实施例中,对于颜色分量量化残差值而言,颜色分量量化残差值可以包括:第一颜色分量的量化残差值Res 0、第二颜色分量的量化残差值Res 1和第三颜色分量的量化残差值Res 2。如此,零游程值具体用于指示三个颜色分量的量化残差值是否均为0的计数。而对于反射率量化残差值而言,这时候仅有一个反射率量化残差值,零游程值具体用于指示反射率量化残差值是否为0的计数。 In the embodiment of the present application, for the color component quantization residual value, the color component quantization residual value may include: the quantization residual value Res 0 of the first color component, the quantization residual value Res 1 of the second color component, and the quantization residual value Res 2 of the third color component. In this way, the zero run value is specifically used to indicate whether the quantization residual values of the three color components are all 0. For the reflectivity quantization residual value, there is only one reflectivity quantization residual value at this time, and the zero run value is specifically used to indicate whether the reflectivity quantization residual value is 0.
还需要说明的是,在本申请实施例中,对于第一颜色分量、第二颜色分量和第三颜色分量,可以是RGB格式,或者也可以是YUV格式,甚至还可以是其他格式。另外,对于这三个颜色分量的顺序,以YUV为例,可以是YUV顺序,也可以是UYV顺序,还可以是UVY顺序,甚至还可以是VYU顺序等等,即对于颜色分量的格式以及顺序,这里均不作具体限定。It should also be noted that, in the embodiment of the present application, the first color component, the second color component and the third color component may be in RGB format, or may be in YUV format, or may even be in other formats. In addition, for the order of the three color components, taking YUV as an example, it may be in YUV order, or in UYV order, or in UVY order, or even in VYU order, etc., that is, the format and order of the color components are not specifically limited here.
在一些实施例中,确定零游程值,可以包括:In some embodiments, determining the zero run value may include:
若当前节点的属性量化残差值等于0,则对零游程值执行加1操作,根据下一节点的属性量化残差值继续确定零游程值;If the attribute quantization residual value of the current node is equal to 0, then the zero run value is added by 1, and the zero run value is further determined according to the attribute quantization residual value of the next node;
若当前节点的属性量化残差值不全等于0,则对零游程值进行编码处理,且对当前节点的属性量化残差值进行编码处理,将所得到的编码比特写入码流;以及将零游程值重置为0,根据下一节点的属性量化残差值继续确定零游程值。If the attribute quantization residual value of the current node is not all equal to 0, the zero-run value is encoded, and the attribute quantization residual value of the current node is encoded, and the obtained encoding bits are written into the bitstream; and the zero-run value is reset to 0, and the zero-run value is continued to be determined according to the attribute quantization residual value of the next node.
在本申请实施例中,该方法还可以包括:设置零游程值的初始值等于0。In the embodiment of the present application, the method may further include: setting an initial value of the zero-run value equal to 0.
也就是说,zero_run_length的初始值为0,对于每一个节点,在编码端,首先确定属性量化残差值。以颜色分量量化残差值为例,如果三个颜色分量的量化残差均为零,那么++zero_run_length,然后处理下一个节点;如果三个颜色分量有任意一个的量化残差值不为零,则先编码零游程值,然后将零游程值zero_run_length重置为0,再编码具体的颜色分量量化残差值(Res 0,Res 1,Res 2),然后处理下一个节点。 That is to say, the initial value of zero_run_length is 0. For each node, at the encoding end, the attribute quantization residual value is first determined. Taking the color component quantization residual value as an example, if the quantization residuals of the three color components are all zero, then ++zero_run_length is used, and then the next node is processed; if the quantization residual value of any of the three color components is not zero, the zero run value is first encoded, and then the zero run value zero_run_length is reset to 0, and then the specific color component quantization residual value (Res 0 , Res 1 , Res 2 ) is encoded, and then the next node is processed.
另外,对于最后一个节点,若其三个颜色分量的量化残差值均为0,则++zero_run_length,并编码零游程值;若其三个颜色分量有任意一个的量化残差值不为零,则先编码零游程值,然后将零游程值zero_run_length重置为0,再编码具体的颜色分量量化残差值(Res 0,Res 1,Res 2),最后编码零游程值。 In addition, for the last node, if the quantized residual values of its three color components are all 0, then ++zero_run_length is used and the zero run value is encoded; if the quantized residual value of any of its three color components is not zero, the zero run value is encoded first, then the zero run value zero_run_length is reset to 0, and then the specific color component quantized residual value (Res 0 , Res 1 , Res 2 ) is encoded, and finally the zero run value is encoded.
还需要说明的是,在本申请实施例中,预置参数用remBinsPass1表示,这里的预置参数用于表示为零游程值分配基于上下文模型的码字的预算数量。示例性地,预置参数的取值可以设置为2 24,但是并不作具体限定。 It should also be noted that in the embodiment of the present application, the preset parameter is represented by remBinsPass1, where the preset parameter is used to represent the budget number of codewords based on the context model allocated to zero run values. Exemplarily, the value of the preset parameter can be set to 2 24 , but is not specifically limited.
对于预置参数而言,其可以是预先设定的参数值,也可以是将预置参数的取值写入码流中。因此,在一些实施例中,该方法还可以包括:对零游程值对应的预置参数进行编码处理,将所得到的编码比特写入码流。这样,后续在解码端,通过解码码流就可以获得预置参数的取值。The preset parameter may be a pre-set parameter value, or the value of the preset parameter may be written into the bitstream. Therefore, in some embodiments, the method may further include: encoding the preset parameter corresponding to the zero run value, and writing the obtained encoding bits into the bitstream. In this way, the value of the preset parameter may be obtained by decoding the bitstream at the decoding end.
这样,在零游程值编码开始前,需要先确定预置参数的取值,然后判断预置参数是否符合第一预设条件,进而能够限定在编码时使用的基于上下文模型的码字数量,提高硬件吞吐率。In this way, before the zero-run value encoding begins, it is necessary to first determine the value of the preset parameter, and then determine whether the preset parameter meets the first preset condition, thereby limiting the number of codewords based on the context model used in encoding and improving hardware throughput.
S802:根据零游程值,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值。S802: Determine, according to the zero run value, a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information.
在本申请实施例中,对于零游程值,可以将其用语法元素标识信息来进行表示。示例性地,第一语法元素标识信息用于指示零游程值是否等于0,第二语法元素标识信息用于指示零游程值是否等于1,第三语法元素标识信息用于指示零游程值是否等于2等。In the embodiment of the present application, for the zero run value, it can be represented by syntax element identification information. Exemplarily, the first syntax element identification information is used to indicate whether the zero run value is equal to 0, the second syntax element identification information is used to indicate whether the zero run value is equal to 1, and the third syntax element identification information is used to indicate whether the zero run value is equal to 2, etc.
如此,根据零游程值,可以确定出至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值。In this way, according to the zero-run value, the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information can be determined.
S803:若预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息的取值进行基于上下文模型的编码处理,以及对至少一个第二类语法元素标识信息的取值进行基于旁路模型的编码处理,将所得到的编码比特写入码流。S803: If the preset parameters meet the first preset condition, the value of at least one first-category syntax element identification information is coded based on the context model, and the value of at least one second-category syntax element identification information is coded based on the bypass model, and the obtained coded bits are written into the bitstream.
需要说明的是,在本申请实施例中,预置参数符合第一预设条件,可以包括:确定预置参数的取值大于或等于预设门限值。其中,预设门限值可以是根据硬件配置情况预先设置的一个判定值。示例性地,预设门限值可以设置为4,也可以设置为8,甚至还可以设置为其他数值,这里也不作具体限定。It should be noted that, in the embodiment of the present application, the preset parameter meets the first preset condition, which may include: determining that the value of the preset parameter is greater than or equal to the preset threshold value. The preset threshold value may be a judgment value preset according to the hardware configuration. Exemplarily, the preset threshold value may be set to 4, or 8, or even other values, which are not specifically limited here.
还需要说明的是,在本申请实施例中,如果预置参数不符合第一预设条件,那么在一些实施例中,该方法还可以包括:若预置参数符合第二预设条件,则对至少一个第一类语法元素标识信息和至少一个第二类语法元素标识信息均进行基于旁路模型的编码处理,将所得到的编码比特写入码流。It should also be noted that, in an embodiment of the present application, if the preset parameters do not meet the first preset conditions, then in some embodiments, the method may further include: if the preset parameters meet the second preset conditions, encoding processing based on the bypass model is performed on at least one first-category syntax element identification information and at least one second-category syntax element identification information, and the obtained encoding bits are written into the bitstream.
需要说明的是,在本申请实施例中,预置参数符合第二预设条件,可以包括:确定预置参数不符合第一预设条件;或者,确定预置参数的取值小于预设门限值。It should be noted that, in the embodiment of the present application, the preset parameter meets the second preset condition, which may include: determining that the preset parameter does not meet the first preset condition; or determining that the value of the preset parameter is less than a preset threshold value.
还需要说明的是,在本申请实施例中,由于通常硬件在一个时钟周期内可以处理4~6个基于旁路模 型进行编码的码字,但仅可以处理1个基于上下文模型进行编码的码字;考虑到硬件吞吐率,本申请实施例提出的编码方法,能够避免使用基于上下文模型进行编码所有码字的情况。具体地,如果预置参数的取值大于或等于预设门限值,那么可以对一部分语法元素(如至少一个第一类语法元素标识信息)进行基于上下文模型的编码处理,以及对另一部分语法元素(如至少一个第二类语法元素标识信息)进行基于旁路模型的编码处理;如果预置参数的取值小于预设门限值,那么可以对所有语法元素(如至少一个第一类语法元素标识信息和至少一个第二类语法元素标识信息)均进行基于旁路模型的编码处理。It should also be noted that in the embodiment of the present application, since the hardware can usually process 4 to 6 codewords encoded based on the bypass model in one clock cycle, but can only process 1 codeword encoded based on the context model; considering the hardware throughput, the encoding method proposed in the embodiment of the present application can avoid the situation where all codewords are encoded based on the context model. Specifically, if the value of the preset parameter is greater than or equal to the preset threshold value, then a part of the syntax elements (such as at least one first-category syntax element identification information) can be encoded based on the context model, and another part of the syntax elements (such as at least one second-category syntax element identification information) can be encoded based on the bypass model; if the value of the preset parameter is less than the preset threshold value, then all syntax elements (such as at least one first-category syntax element identification information and at least one second-category syntax element identification information) can be encoded based on the bypass model.
在一些实施例中,在预置参数符合第一预设条件时,该方法还可以包括:对于至少一个第一类语法元素标识信息,在基于上下文模型每编码完成一个第一类语法元素标识信息后,对预置参数的取值执行一次减1操作。In some embodiments, when the preset parameter meets the first preset condition, the method may further include: for at least one first-category syntax element identification information, after each encoding of a first-category syntax element identification information is completed based on the context model, performing a subtraction operation on the value of the preset parameter.
也就是说,在本申请实施例中,对于可能出现的至少一个第一类语法元素标识信息,使用基于上下文模型的编码方式,且在每编码完成一个第一类语法元素标识信息时,还需要执行--remBinsPass1操作。That is to say, in an embodiment of the present application, for at least one first-category syntax element identification information that may appear, a context model-based encoding method is used, and when each first-category syntax element identification information is encoded, a --remBinsPass1 operation needs to be performed.
还需要说明的是,在本申请实施例中,在某些情况下,例如零游程值小于预设阈值,这时候仅通过至少一个第一类语法元素标识信息的取值就可以确定出零游程值。在一些实施例中,该方法还可以包括:It should also be noted that in the embodiments of the present application, in some cases, for example, when the zero run value is less than a preset threshold, the zero run value can be determined only by the value of at least one first-category syntax element identification information. In some embodiments, the method may further include:
根据零游程值,确定至少一个第一类语法元素标识信息的取值;Determine, according to the zero-run value, a value of at least one first-category syntax element identification information;
若预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息的取值进行基于上下文模型的编码处理,将所得到的编码比特写入码流;或者,If the preset parameter meets the first preset condition, a context model-based encoding process is performed on the value of at least one first-category syntax element identification information, and the obtained encoding bits are written into the bitstream; or,
若预置参数符合第二预设条件,则对至少一个第一类语法元素标识信息的取值进行基于旁路模型的编码处理,将所得到的编码比特写入码流。If the preset parameter meets the second preset condition, a bypass model-based encoding process is performed on the value of at least one first-category syntax element identification information, and the obtained encoding bits are written into the bitstream.
也就是说,在某些情况下,根据至少一个第一类语法元素标识信息的取值,就可以确定零游程值是否等于0、或者零游程值是否等于1、或者零游程值是否等于2、或者零游程值减预设常数再除以2的商是否等于0、是否等于1等等,进而确定出零游程值。这时候,可以仅针对指示一个第一类语法元素标识信息的取值进行编码处理。That is, in some cases, according to the value of at least one first-category syntax element identification information, it is possible to determine whether the zero-run value is equal to 0, or whether the zero-run value is equal to 1, or whether the zero-run value is equal to 2, or whether the quotient of the zero-run value minus a preset constant and then divided by 2 is equal to 0, equal to 1, etc., and then determine the zero-run value. In this case, the encoding process can be performed only on the value indicating one first-category syntax element identification information.
示例性地,以反射率量化残差值为例,假定存在一组反射率量化残差值:2310004501;那么在编码过程中,由于第一个数值为2,此时零游程值为0,先编码零游程值再编码2;第二个数值为3,此时零游程值为0,先编码零游程值再编码3;第三个数值为1,此时零游程值为0,先编码零游程值再编码1;第四个数值为0,此时零游程值加1操作,即零游程值为1;第五个数值为0,零游程值继续加1操作,即零游程值为2;第六个数值为0,零游程值继续加1操作,即零游程值为3;第七个数值为4,这时候需要先编码零游程值3,然后将零游程值重置为0,再继续编码4;第八个数值为5,此时零游程值为0,先编码零游程值0再编码5;第九个数值为0,此时零游程值加1操作,即零游程值为1;第十个数值为1,这时候先编码零游程值1,然后将零游程值重置为0,再继续编码1,最后再编码一次零游程值0。For example, taking the reflectivity quantization residual value as an example, it is assumed that there is a set of reflectivity quantization residual values: 2310004501; then in the encoding process, since the first value is 2, the zero run value is 0 at this time, the zero run value is encoded first and then 2 is encoded; the second value is 3, the zero run value is 0 at this time, the zero run value is encoded first and then 3 is encoded; the third value is 1, the zero run value is 0 at this time, the zero run value is encoded first and then 1 is encoded; the fourth value is 0, the zero run value is added by 1 at this time, that is, the zero run value is 1; the fifth value is 0, and the zero run value continues to be added by 1 , that is, the zero run value is 2; the sixth value is 0, and the zero run value continues to increase by 1, that is, the zero run value is 3; the seventh value is 4, at this time, you need to encode the zero run value 3 first, then reset the zero run value to 0, and then continue to encode 4; the eighth value is 5, at this time the zero run value is 0, first encode the zero run value 0 and then encode 5; the ninth value is 0, at this time the zero run value is increased by 1, that is, the zero run value is 1; the tenth value is 1, at this time first encode the zero run value 1, then reset the zero run value to 0, continue to encode 1, and finally encode the zero run value 0 again.
本申请实施例提供了一种编码方法,确定零游程值以及零游程值对应的预置参数;根据零游程值,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值;若预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息的取值进行基于上下文模型的编码处理,以及对至少一个第二类语法元素标识信息的取值进行基于旁路模型的编码处理,将所得到的编码比特写入码流。这样,在确定出零游程值对应的预置参数之后,可以限定在编码时使用的基于上下文模型的码字数量,使得部分语法元素标识信息采用旁路模型进行编码处理,从而可以提高硬件吞吐率,降低了硬件实现的难度;而且还能够提升处理速度。The embodiment of the present application provides a coding method, which determines a zero-run value and a preset parameter corresponding to the zero-run value; determines the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information according to the zero-run value; if the preset parameter meets the first preset condition, performs a context-based coding process on the value of at least one first-category syntax element identification information, and performs a bypass-model-based coding process on the value of at least one second-category syntax element identification information, and writes the obtained coded bits into a bitstream. In this way, after determining the preset parameter corresponding to the zero-run value, the number of codewords based on the context model used in coding can be limited, so that part of the syntax element identification information is coded using the bypass model, thereby improving the hardware throughput and reducing the difficulty of hardware implementation; and also improving the processing speed.
在本申请的又一实施例中,基于前述实施例所述的编码方法,参见图9,其示出了本申请实施例提供的一种编码方法的详细流程示意图。如图9所示,该方法可以包括:In another embodiment of the present application, based on the encoding method described in the above embodiment, see Figure 9, which shows a detailed flow chart of an encoding method provided by an embodiment of the present application. As shown in Figure 9, the method may include:
S901:确定零游程值对应的预置参数。S901: Determine the preset parameters corresponding to the zero-run value.
S902:判断预置参数是否大于或等于预设门限值。S902: Determine whether the preset parameter is greater than or equal to a preset threshold value.
S903:若预置参数大于或等于预设门限值,则基于上下文模型对可能出现的至少一个第一类语法元素标识信息进行编码处理,以及基于旁路模型对可能出现的至少一个第二类语法元素标识信息进行编码处理,将所得到的编码比特写入码流。S903: If the preset parameter is greater than or equal to the preset threshold value, encoding is performed on at least one first-category syntax element identification information that may appear based on the context model, and encoding is performed on at least one second-category syntax element identification information that may appear based on the bypass model, and the obtained encoding bits are written into the bitstream.
S904:若预置参数小于预设门限值,则基于旁路模型对可能出现的至少一个第一类语法元素标识信息和至少一个第二类语法元素标识信息进行编码处理,将所得到的编码比特写入码流。S904: If the preset parameter is less than the preset threshold, encoding the at least one first-category syntax element identification information and the at least one second-category syntax element identification information that may appear is performed based on the bypass model, and the obtained encoding bits are written into the bitstream.
需要说明的是,在本申请实施例中,对于指示零游程值的至少一个第一类语法元素标识信息和至少一个第二类语法元素标识信息并不作具体限定。在一种可能的实现方式中,至少一个第一类语法元素标识信息包括下述至少一项:第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息和第四语法元素标识信息;以及,至少一个第二类语法元素标识信息至少包括:第一数值标识信息。It should be noted that, in the embodiment of the present application, at least one first-category syntax element identification information indicating a zero-run value and at least one second-category syntax element identification information are not specifically limited. In a possible implementation, at least one first-category syntax element identification information includes at least one of the following: first syntax element identification information, second syntax element identification information, third syntax element identification information, and fourth syntax element identification information; and at least one second-category syntax element identification information includes at least: first numerical identification information.
其中,第一语法元素标识信息用于指示零游程值是否等于0,第二语法元素标识信息用于指示零游 程值是否等于1,第三语法元素标识信息用于指示零游程值是否等于2,第四语法元素标识信息用于指示零游程值进行第一运算后得到的第一数值的奇偶特性,第一数值标识信息用于指示零游程值进行第二运算后得到的第二数值。Among them, the first syntax element identification information is used to indicate whether the zero run value is equal to 0, the second syntax element identification information is used to indicate whether the zero run value is equal to 1, the third syntax element identification information is used to indicate whether the zero run value is equal to 2, the fourth syntax element identification information is used to indicate the parity characteristic of the first numerical value obtained after the zero run value is subjected to the first operation, and the first numerical value identification information is used to indicate the second numerical value obtained after the zero run value is subjected to the second operation.
在一些实施例中,对零游程值进行第一运算,可以包括:根据零游程值与第一预设值进行减法运算,得到第一数值。In some embodiments, performing a first operation on the zero-run value may include: performing a subtraction operation on the zero-run value and a first preset value to obtain a first value.
在一些实施例中,对零游程值进行第二运算,可以包括:根据零游程值与第一预设值进行减法运算,得到第一数值;将第二数值设置为等于第一数值除以2的商。或者,在得到第一数值之后,还可以包括:对第一数值进行右移一位处理,得到第二数值。In some embodiments, performing a second operation on the zero-run value may include: performing a subtraction operation on the zero-run value and the first preset value to obtain a first value; and setting the second value to be equal to a quotient of the first value divided by 2. Alternatively, after obtaining the first value, the method may further include: performing a right shift operation on the first value by one position to obtain the second value.
需要说明的是,在本申请实施例中,第一预设值可以设置为3,但是并不作具体限定。另外,第一语法元素标识信息可以用zero_run_length_equal_zero表示,第二语法元素标识信息可以用zero_run_length_equal_one表示,第三语法元素标识信息可以用zero_run_length_equal_two表示,第四语法元素标识信息可以用zero_run_length_minus3_parity表示,第一数值标识信息可以用zero_run_length_minus3_div2表示。It should be noted that, in the embodiment of the present application, the first preset value can be set to 3, but is not specifically limited. In addition, the first syntax element identification information can be represented by zero_run_length_equal_zero, the second syntax element identification information can be represented by zero_run_length_equal_one, the third syntax element identification information can be represented by zero_run_length_equal_two, the fourth syntax element identification information can be represented by zero_run_length_minus3_parity, and the first numerical identification information can be represented by zero_run_length_minus3_div2.
在一些实施例中,在预置参数符合第一预设条件时,对零游程值进行编码处理,可以包括:基于上下文模型对可能出现的第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息和第四语法元素标识信息进行编码处理,以及基于旁路模型对可能出现的第一数值标识信息进行编码处理,将所得到的编码比特写入码流。In some embodiments, when the preset parameters meet the first preset condition, encoding the zero run value may include: encoding the first syntax element identification information, the second syntax element identification information, the third syntax element identification information and the fourth syntax element identification information that may appear based on the context model, and encoding the first numerical identification information that may appear based on the bypass model, and writing the obtained encoded bits into the bitstream.
在一种具体的实施例中,在预置参数符合第一预设条件时,对零游程值进行编码处理,可以包括:In a specific embodiment, when the preset parameters meet the first preset condition, encoding the zero run value may include:
根据零游程值,确定第一语法元素标识信息的取值;Determining a value of first syntax element identification information according to the zero run value;
基于上下文模型对第一语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the first syntax element identification information based on the context model, and writing the obtained encoding bits into the bitstream;
若第一语法元素标识信息的取值为第二值,则根据零游程值,确定第二语法元素标识信息的取值;If the value of the first syntax element identification information is the second value, determining the value of the second syntax element identification information according to the zero run value;
基于上下文模型对第二语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the second syntax element identification information based on the context model, and writing the obtained encoding bits into the bitstream;
若第二语法元素标识信息的取值为第二值,则根据零游程值,确定第三语法元素标识信息的取值;If the value of the second syntax element identification information is the second value, determining the value of the third syntax element identification information according to the zero run value;
基于上下文模型对第三语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the third syntax element identification information based on the context model, and writing the obtained encoding bits into the bitstream;
若第三语法元素标识信息的取值为第二值,则根据零游程值,确定第四语法元素标识信息的取值和第一数值标识信息的取值;If the value of the third syntax element identification information is the second value, determining the value of the fourth syntax element identification information and the value of the first numerical value identification information according to the zero run value;
基于上下文模型对第四语法元素标识信息的取值进行编码处理,以及基于旁路模型对第一数值标识信息的取值进行编码处理,将所得到的编码比特写入码流。The value of the fourth syntax element identification information is encoded based on the context model, and the value of the first numerical identification information is encoded based on the bypass model, and the obtained encoded bits are written into the bitstream.
进一步地,在一些实施例中,该方法还可以包括:在每一次基于上下文模型对以下的语法元素标识信息编码完成后,对预置参数的取值执行一次减1操作:Furthermore, in some embodiments, the method may further include: after encoding the following syntax element identification information based on the context model each time, performing a subtraction operation on the value of the preset parameter:
第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息和第四语法元素标识信息。first syntax element identification information, second syntax element identification information, third syntax element identification information and fourth syntax element identification information.
在另一些实施例中,在预置参数符合第二预设条件时,对零游程值进行编码处理,可以包括:基于旁路模型对可能出现的第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息和第一数值标识信息进行编码处理,将所得到的编码比特写入码流。也就是说,如果预置参数符合第二预设条件,那么对于零游程值对应的所有二值化码字均采用旁路模型进行编码处理。In other embodiments, when the preset parameters meet the second preset condition, encoding the zero run value may include: encoding the first syntax element identification information, the second syntax element identification information, the third syntax element identification information, the fourth syntax element identification information and the first numerical identification information that may appear based on the bypass model, and writing the obtained encoding bits into the bitstream. That is, if the preset parameters meet the second preset condition, then all binary codewords corresponding to the zero run value are encoded using the bypass model.
在一种具体的实施例中,在预置参数符合第二预设条件时,对零游程值进行编码处理,可以包括:In a specific embodiment, when the preset parameters meet the second preset condition, encoding the zero run value may include:
根据零游程值,确定第一语法元素标识信息的取值;Determining a value of first syntax element identification information according to the zero run value;
基于旁路模型对第一语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the first syntax element identification information based on the bypass model, and writing the obtained encoding bits into the bitstream;
若第一语法元素标识信息的取值为第二值,则根据零游程值,确定第二语法元素标识信息的取值;If the value of the first syntax element identification information is the second value, determining the value of the second syntax element identification information according to the zero run value;
基于旁路模型对第二语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the second syntax element identification information based on the bypass model, and writing the obtained encoding bits into the bitstream;
若第二语法元素标识信息的取值为第二值,则根据零游程值,确定第三语法元素标识信息的取值;If the value of the second syntax element identification information is the second value, determining the value of the third syntax element identification information according to the zero run value;
基于旁路模型对第三语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the third syntax element identification information based on the bypass model, and writing the obtained encoding bits into the bitstream;
若第三语法元素标识信息的取值为第二值,则根据零游程值,确定第四语法元素标识信息的取值和第一数值标识信息的取值;If the value of the third syntax element identification information is the second value, determining the value of the fourth syntax element identification information and the value of the first numerical value identification information according to the zero run value;
基于旁路模型对第四语法元素标识信息的取值进行编码处理,以及基于旁路模型对第一数值标识信息的取值进行编码处理,将所得到的编码比特写入码流。The value of the fourth syntax element identification information is encoded based on the bypass model, and the value of the first numerical identification information is encoded based on the bypass model, and the obtained encoded bits are written into the bitstream.
在一些实施例中,根据零游程值,确定第一语法元素标识信息的取值,可以包括:In some embodiments, determining the value of the first syntax element identification information according to the zero run value may include:
若零游程值等于0,则确定第一语法元素标识信息的取值为第一值;若零游程值不等于0,则确定第一语法元素标识信息的取值为第二值。If the zero-run value is equal to 0, the value of the first syntax element identification information is determined to be the first value; if the zero-run value is not equal to 0, the value of the first syntax element identification information is determined to be the second value.
在一些实施例中,根据零游程值,确定第二语法元素标识信息的取值,可以包括:In some embodiments, determining the value of the second syntax element identification information according to the zero run value may include:
若零游程值等于1,则确定第二语法元素标识信息的取值为第一值;若零游程值不等于1,则确定第二语法元素标识信息的取值为第二值。If the zero-run value is equal to 1, the value of the second syntax element identification information is determined to be the first value; if the zero-run value is not equal to 1, the value of the second syntax element identification information is determined to be the second value.
在一些实施例中,根据零游程值,确定第三语法元素标识信息的取值,可以包括:In some embodiments, determining the value of the third syntax element identification information according to the zero run value may include:
若零游程值等于2,则确定第三语法元素标识信息的取值为第一值;若零游程值不等于2,则确定第三语法元素标识信息的取值为第二值。If the zero-run value is equal to 2, the value of the third syntax element identification information is determined to be the first value; if the zero-run value is not equal to 2, the value of the third syntax element identification information is determined to be the second value.
在一些实施例中,根据零游程值,确定第四语法元素标识信息的取值,可以包括:In some embodiments, determining the value of the fourth syntax element identification information according to the zero run value may include:
若第一数值为奇数,则确定第四语法元素标识信息的取值为第一值;若第一数值为偶数,则确定第四语法元素标识信息的取值为第二值;If the first value is an odd number, determining that the value of the fourth syntax element identification information is the first value; if the first value is an even number, determining that the value of the fourth syntax element identification information is the second value;
或者,若第一数值除以2的余数为1,则确定第四语法元素标识信息的取值为第一值;若第一数值除以2的余数为0,则确定第四语法元素标识信息的取值为第二值。Alternatively, if the remainder when the first value is divided by 2 is 1, the value of the fourth syntax element identification information is determined to be the first value; if the remainder when the first value is divided by 2 is 0, the value of the fourth syntax element identification information is determined to be the second value.
需要说明的是,在本申请实施例中,针对不同的语法元素标识信息,例如第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息和第四语法元素标识信息等,各自对应的第一值和第二值可以相同,或者也可以不相同,这里不作具体限定。It should be noted that in the embodiments of the present application, for different syntax element identification information, such as the first syntax element identification information, the second syntax element identification information, the third syntax element identification information and the fourth syntax element identification information, the corresponding first value and the second value may be the same, or may be different, and no specific limitation is made here.
还需要说明的是,在本申请实施例中,第一值和第二值可以是参数形式,也可以是数字形式。具体地,每一个语法元素标识信息可以是写入在概述(profile)中的参数,也可以是一个标志位/标识符的取值,这里对此不作具体限定。It should also be noted that, in the embodiment of the present application, the first value and the second value may be in parameter form or in digital form. Specifically, each syntax element identification information may be a parameter written in the profile or a value of a flag bit/identifier, which is not specifically limited here.
示例性地,第一值可以设置为1,第二值可以设置为0;或者,第一值可以设置为0,第二值可以设置为1;或者,第一值可以设置为true,第二值可以设置为false;或者,第一值可以设置为false,第二值可以设置为true。其中,在本申请实施例中,第一值设置为1,第二值设置为0,但是对此并不作具体限定。For example, the first value may be set to 1 and the second value may be set to 0; or, the first value may be set to 0 and the second value may be set to 1; or, the first value may be set to true and the second value may be set to false; or, the first value may be set to false and the second value may be set to true. In the embodiment of the present application, the first value is set to 1 and the second value is set to 0, but this is not specifically limited.
这样,首先编码第一语法元素标识信息来指示零游程值是否等于0,如果零游程值等于0,则编码零游程值完成;否则继续编码第二语法元素标识信息来指示零游程值是否等于1,如果零游程值等于1,则编码零游程值完成;否则继续编码第三语法元素标识信息来指示零游程值是否等于2,如果零游程值等于2,则编码零游程值完成;否则继续编码第四语法元素标识信息来指示零游程值减去3的奇偶特性,以及编码第一数值标识信息来指示零游程值减去3再除以2的商,编码零游程值完成。这样,后续在解码端,通过解码码流来获得这些语法元素标识信息,就可以确定出零游程值。In this way, firstly encode the first syntax element identification information to indicate whether the zero run value is equal to 0, if the zero run value is equal to 0, the encoding of the zero run value is completed; otherwise, continue to encode the second syntax element identification information to indicate whether the zero run value is equal to 1, if the zero run value is equal to 1, the encoding of the zero run value is completed; otherwise, continue to encode the third syntax element identification information to indicate whether the zero run value is equal to 2, if the zero run value is equal to 2, the encoding of the zero run value is completed; otherwise, continue to encode the fourth syntax element identification information to indicate the parity characteristic of the zero run value minus 3, and encode the first numerical identification information to indicate the quotient of the zero run value minus 3 and then divided by 2, and the encoding of the zero run value is completed. In this way, at the decoding end, these syntax element identification information can be obtained by decoding the bit stream to determine the zero run value.
在一些实施例中,基于旁路模型对第一数值标识信息的取值进行编码处理,可以包括:对第一数值标识信息的取值进行二值化处理,得到至少一个二值符号;基于旁路模型对至少一个二值符号依次进行编码处理,将所得到的编码比特写入码流。In some embodiments, encoding the value of the first numerical identification information based on the bypass model may include: binarizing the value of the first numerical identification information to obtain at least one binary symbol; encoding the at least one binary symbol in turn based on the bypass model, and writing the obtained encoded bits into the code stream.
需要说明的是,在本申请实施例中,对于如何根据零游程值来确定第一数值标识信息的取值,可以包括:根据零游程值与第一预设值进行减法运算,得到第一数值;将第一数值标识信息的取值设置为等于第一数值除以2的商。It should be noted that, in an embodiment of the present application, how to determine the value of the first numerical identification information based on the zero-run value may include: performing a subtraction operation between the zero-run value and a first preset value to obtain a first numerical value; and setting the value of the first numerical identification information to be equal to the quotient of the first numerical value divided by 2.
示例性地,假定第一数值标识信息的取值为3,首先对3进行二值化处理,以二阶指数哥伦布编码为例,对3进行二值化后,得到一组二值符号011;然后基于旁路模型对这一组二值符号依次进行编码处理,将所得到的编码比特写入码流。Exemplarily, assuming that the value of the first numerical identification information is 3, 3 is first binarized. Taking the second-order exponential Golomb coding as an example, after 3 is binarized, a group of binary symbols 011 are obtained; then this group of binary symbols is encoded in turn based on the bypass model, and the obtained coded bits are written into the code stream.
可以理解地,对于属性量化残差值采用游程编码,具体实施步骤如下:It can be understood that run-length encoding is used for the attribute quantization residual value, and the specific implementation steps are as follows:
(1)属性量化残差值为颜色分量量化残差值。(1) The attribute quantization residual value is the color component quantization residual value.
编码端采用相同的顺序(点云原始采集顺序、莫顿顺序、希尔伯特顺序等)依次对每个节点三个颜色分量的量化残差值(Res 0,Res 1,Res 2)进行编码处理,zero_run_length用于对三个颜色分量的量化残差值进行是否均为0的计数,称为零游程值,其初始值设为0,对于每一个节点,具体如下: The encoding end uses the same order (the original acquisition order of the point cloud, Morton order, Hilbert order, etc.) to encode the quantized residual values (Res 0 , Res 1 , Res 2 ) of the three color components of each node in turn. Zero_run_length is used to count whether the quantized residual values of the three color components are all 0, which is called the zero run value. Its initial value is set to 0. For each node, the details are as follows:
若三个分量颜色的量化残差值均为零,则++zero_run_length,然后处理下一个节点;If the quantized residual values of the three component colors are all zero, then ++zero_run_length, and then process the next node;
若三个颜色分量有任意一个的量化残差值不为零,则先编码零游程值,然后将零游程值zero_run_length重置为0,再编码具体的颜色分量量化残差值(Res 0,Res 1,Res 2),然后处理下一个节点。 If any of the quantized residual values of the three color components is not zero, the zero run value is encoded first, then the zero run value zero_run_length is reset to 0, and then the specific color component quantized residual value (Res 0 , Res 1 , Res 2 ) is encoded, and then the next node is processed.
对于最后一个节点,若其三个颜色分量的量化残差值均为0,则++zero_run_length,并编码零游程值;若其三个颜色分量有任意一个的量化残差值不为零,则先编码零游程值,然后将零游程值zero_run_length重置为0,再编码具体的颜色分量量化残差值(Res 0,Res 1,Res 2),最后编码零游程值。 For the last node, if the quantized residual values of its three color components are all 0, then ++zero_run_length is used and the zero run value is encoded; if the quantized residual value of any of its three color components is not zero, the zero run value is encoded first, then the zero run value zero_run_length is reset to 0, and then the specific color component quantized residual value (Res 0 , Res 1 , Res 2 ) is encoded, and finally the zero run value is encoded.
(2)属性量化残差值为反射率量化残差值。(2) The attribute quantization residual value is the reflectance quantization residual value.
编码端采用相同的顺序(点云原始采集顺序、莫顿顺序、希尔伯特顺序等)依次对每个节点的反射率量化残差值进行编码处理,zero_run_length用于对反射率量化残差值进行是否为0的计数,称为零游程值,其初始值设为0,对于每一个节点,具体如下:The encoding end uses the same order (the original acquisition order of the point cloud, Morton order, Hilbert order, etc.) to encode the reflectivity quantization residual value of each node in turn. Zero_run_length is used to count whether the reflectivity quantization residual value is 0, which is called the zero run value. Its initial value is set to 0. For each node, the details are as follows:
若反射率量化残差值为零,则++zero_run_length,然后处理下一个节点;If the reflectivity quantization residual value is zero, ++zero_run_length, and then process the next node;
若反射率量化残差值不为零,则先编码零游程值,然后将零游程值zero_run_length重置为0,再编码具体的反射率量化残差值,然后处理下一个节点。If the reflectivity quantization residual value is not zero, the zero run value is encoded first, then the zero run value zero_run_length is reset to 0, and then the specific reflectivity quantization residual value is encoded, and then the next node is processed.
对于最后一个节点,若其反射率量化残差值为0,则++zero_run_length,并编码零游程值;若反射 率量化残差值不为零,则先编码零游程值,然后将零游程值zero_run_length重置为0,再编码具体的反射率量化残差值,最后编码零游程值。For the last node, if its reflectivity quantization residual value is 0, then ++zero_run_length is added and the zero run value is encoded; if the reflectivity quantization residual value is not zero, the zero run value is encoded first, then the zero run value zero_run_length is reset to 0, and then the specific reflectivity quantization residual value is encoded, and finally the zero run value is encoded.
具体的零游程值编码过程为:The specific zero run value encoding process is:
a)采用"zero_run_length_equal_zero"标志零游程值是否等于0,编码"zero_run_length_equal_zero"标志位,如果零游程值为0,则编码零游程值完成;否则进入步骤b);a) Use "zero_run_length_equal_zero" to mark whether the zero run value is equal to 0, encode the "zero_run_length_equal_zero" flag bit, if the zero run value is 0, the encoding of the zero run value is completed; otherwise, go to step b);
b)采用"zero_run_length_equal_one"标志零游程值是否等于1,编码"zero_run_length_equal_one"标志位,如果零游程值为1,则编码零游程值完成;否则进入步骤c);b) Use "zero_run_length_equal_one" to mark whether the zero run value is equal to 1, encode the "zero_run_length_equal_one" flag bit, if the zero run value is 1, the encoding of the zero run value is completed; otherwise, go to step c);
c)采用"zero_run_length_equal_two"标志零游程值是否等于2,编码"zero_run_length_equal_two"标志位,如果零游程值为2,则编码零游程值完成;否则进入步骤d);c) using "zero_run_length_equal_two" to mark whether the zero run value is equal to 2, encoding the "zero_run_length_equal_two" flag bit, if the zero run value is 2, then encoding the zero run value is completed; otherwise, proceed to step d);
d)采用"zero_run_length_minus3_parity"标志零游程值减3的奇偶特性,即为零游程值减3再除以2的余数,"zero_run_length_minus3_div2"为零游程值减3再除以2的商,编码"zero_run_length_minus3_parity"标志位和"zero_run_length_minus3_div2"值,编码零游程值完成。d) Use "zero_run_length_minus3_parity" to mark the parity of the zero run value minus 3, that is, the remainder of the zero run value minus 3 divided by 2, and "zero_run_length_minus3_div2" is the quotient of the zero run value minus 3 divided by 2. Encode the "zero_run_length_minus3_parity" flag and the "zero_run_length_minus3_div2" value, and the encoding of the zero run value is completed.
在相关技术中,目前PCRM在编码零游程值时,对于所有二值化后的码字,均采用基于上下文模型的编码方式,例如,若要编码的零游程值为10,则将其进行二值化的过程为:In the related art, when encoding zero run values, PCRM currently uses a context model-based encoding method for all binarized code words. For example, if the zero run value to be encoded is 10, the binarization process is:
zero_run_length_equal_zero标志位为0;The zero_run_length_equal_zero flag is 0;
zero_run_length_equal_one标志位为0;The zero_run_length_equal_one flag is 0;
zero_run_length_equal_two标志位为0;The zero_run_length_equal_two flag is 0;
zero_run_length_minus3_parity标志符为1;The zero_run_length_minus3_parity flag is 1;
zero_run_length_minus3_div2为3,继续对3进行二值化,以二阶指数哥伦布编码为例,对3进行二值化之后的结果为0 1 1;zero_run_length_minus3_div2 is 3, and 3 is binarized. Taking the second-order exponential Golomb coding as an example, the result of binarizing 3 is 0 1 1;
因此,对于一个数值为10的零游程值,其二值化后的码字结果为0 0 0 1 0 1 1。在编码端,对于零游程值二值化后的所有码字都采用基于上下文模型的编码方式,这将给硬件实现带来较大难度,硬件吞吐率效率比较低。基于此,在本申请实施例中,该编码过程可以如下:Therefore, for a zero-run value of 10, the binarized codeword result is 0 0 0 1 0 1 1. At the encoding end, all codewords after the zero-run value is binarized are encoded in a context model-based manner, which will bring great difficulty to hardware implementation and the hardware throughput efficiency is relatively low. Based on this, in the embodiment of the present application, the encoding process can be as follows:
(i)为零游程值分配基于上下文模型编码码字的预算remBinsPass1(初始值可设置为2 24); (i) Allocate a budget remBinsPass1 for zero run values based on the context model encoding codeword (the initial value can be set to 2 24 );
(ii)在零游程编码开始前,判断remBinsPass1是否大于等于T(如设置为4);(ii) Before the start of zero-run encoding, determine whether remBinsPass1 is greater than or equal to T (such as set to 4);
(iii)当remBinsPass1≥T时,对可能出现的zero_run_length_equal_zero、zero_run_length_equal_one、zero_run_length_equal_two、zero_run_length_minus3_parity采用基于上下文模型的编码方式,且每编完一个标志位/标志符,做remBinsPass1--操作,而zero_run_length_minus3_div2的所有二值化后的码字采用基于旁路模型的编码方式;(iii) When remBinsPass1 ≥ T, the possible zero_run_length_equal_zero, zero_run_length_equal_one, zero_run_length_equal_two, and zero_run_length_minus3_parity are coded using the context model, and after each flag bit/marker is coded, a remBinsPass1-- operation is performed, while all binary codewords of zero_run_length_minus3_div2 are coded using the bypass model;
(iv)当不满足remBinsPass1≥T时,对零游程值的所有二值化后的码字均采用基于旁路模型的编码方式。(iv) When remBinsPass1≥T is not satisfied, all binarized codewords with zero run values are coded using a bypass model-based encoding method.
对于本申请实施例的整个编码过程,在实现中对应解码过程的语法表描述如前述的表1所示。For the entire encoding process of the embodiment of the present application, the syntax table description of the corresponding decoding process in the implementation is shown in the aforementioned Table 1.
在另一种可能的实现方式中,至少一个第一类语法元素标识信息包括下述至少一项:第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息、第五语法元素标识信息、第六语法元素标识信息、第七语法元素标识信息和第八语法元素标识信息;以及,至少一个第二类语法元素标识信息至少包括:第二数值标识信息。In another possible implementation, at least one first-category grammatical element identification information includes at least one of the following: first grammatical element identification information, second grammatical element identification information, third grammatical element identification information, fourth grammatical element identification information, fifth grammatical element identification information, sixth grammatical element identification information, seventh grammatical element identification information and eighth grammatical element identification information; and at least one second-category grammatical element identification information includes at least: second numerical identification information.
其中,第一语法元素标识信息用于指示零游程值是否等于0,第二语法元素标识信息用于指示零游程值是否等于1,第三语法元素标识信息用于指示零游程值是否等于2,第四语法元素标识信息用于指示零游程值进行第一运算后得到的第一数值的奇偶特性,第五语法元素标识信息用于指示零游程值进行第二运算后得到的第二数值是否等于0,第六语法元素标识信息用于指示零游程值进行第二运算后得到的第二数值是否等于1,第七语法元素标识信息用于指示零游程值进行第二运算后得到的第二数值是否等于2,第八语法元素标识信息用于指示零游程值进行第二运算后得到的第二数值是否等于3,第二数值标识信息用于指示零游程值进行第四运算后得到的第四数值。Among them, the first syntax element identification information is used to indicate whether the zero run value is equal to 0, the second syntax element identification information is used to indicate whether the zero run value is equal to 1, the third syntax element identification information is used to indicate whether the zero run value is equal to 2, the fourth syntax element identification information is used to indicate the parity characteristic of the first numerical value obtained after the zero run value is subjected to the first operation, the fifth syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 0, the sixth syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 1, the seventh syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 2, the eighth syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 3, and the second numerical value identification information is used to indicate the fourth numerical value obtained after the zero run value is subjected to the fourth operation.
在一些实施例中,对零游程值进行第一运算,可以包括:根据零游程值与第一预设值进行减法运算,得到第一数值。In some embodiments, performing a first operation on the zero-run value may include: performing a subtraction operation on the zero-run value and a first preset value to obtain a first value.
在一些实施例中,对零游程值进行第二运算,可以包括:根据零游程值与第一预设值进行减法运算,得到第一数值;将第二数值设置为等于第一数值除以2的商。In some embodiments, performing a second operation on the zero-run value may include: performing a subtraction operation on the zero-run value and a first preset value to obtain a first value; and setting the second value to be equal to a quotient of the first value divided by 2.
在一些实施例中,在得到第一数值之后,还可以包括:对第一数值进行右移一位处理,得到第二数值。In some embodiments, after obtaining the first value, the method may further include: right-shifting the first value by one bit to obtain a second value.
在一些实施例中,对零游程值进行第四运算,可以包括:根据零游程值与第一预设值进行减法运算,得到第一数值;将第二数值设置为等于第一数值除以2的商;根据第二数值与第二预设值进行减法运算,得到第四数值。In some embodiments, performing a fourth operation on the zero-run value may include: performing a subtraction operation on the zero-run value and a first preset value to obtain a first value; setting the second value to be equal to the quotient of the first value divided by 2; and performing a subtraction operation on the second value and a second preset value to obtain a fourth value.
在本申请实施例中,第一预设值与第二预设值可以不同,示例性地,第一预设值可以设置为3,第二预设值可以设置为4。另外,第一语法元素标识信息可以用zero_run_length_equal_zero表示,第二语法元素标识信息可以用zero_run_length_equal_one表示,第三语法元素标识信息可以用zero_run_length_equal_two表示,第四语法元素标识信息可以用zero_run_length_minus3_parity表示,第五语法元素标识信息可以用zero_run_length_minus3_div2_equal_zero表示,第六语法元素标识信息可以用zero_run_length_minus3_div2_equal_one表示,第七语法元素标识信息可以用zero_run_length_minus3_div2_equal_two表示,第八语法元素标识信息可以用zero_run_length_minus3_div2_equal_three表示,第二数值标识信息可以用zero_run_length_minus3_div2_minus4表示。In the embodiment of the present application, the first preset value and the second preset value may be different. For example, the first preset value may be set to 3, and the second preset value may be set to 4. In addition, the first syntax element identification information may be represented by zero_run_length_equal_zero, the second syntax element identification information may be represented by zero_run_length_equal_one, the third syntax element identification information may be represented by zero_run_length_equal_two, the fourth syntax element identification information may be represented by zero_run_length_minus3_parity, the fifth syntax element identification information may be represented by zero_run_length_minus3_div2_equal_zero, the sixth syntax element identification information may be represented by zero_run_length_minus3_div2_equal_one, the seventh syntax element identification information may be represented by zero_run_length_minus3_div2_equal_two, the eighth syntax element identification information may be represented by zero_run_length_minus3_div2_equal_three, and the second value identification information may be represented by zero_run_length_minus3_div2_minus4.
在一些实施例中,在预置参数符合第一预设条件时,对零游程值进行编码处理,可以包括:基于上下文模型对可能出现的第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息、第五语法元素标识信息、第六语法元素标识信息、第七语法元素标识信息和第八语法元素标识信息进行编码处理,以及基于旁路模型对可能出现的第二数值标识信息进行编码处理,将所得到的编码比特写入码流。In some embodiments, when the preset parameters meet the first preset condition, encoding the zero run value may include: encoding the first syntax element identification information, the second syntax element identification information, the third syntax element identification information, the fourth syntax element identification information, the fifth syntax element identification information, the sixth syntax element identification information, the seventh syntax element identification information and the eighth syntax element identification information based on the context model, and encoding the second numerical identification information that may appear based on the bypass model, and writing the obtained encoded bits into the bitstream.
在一种具体的实施例中,在预置参数符合第一预设条件时,对零游程值进行编码处理,可以包括:In a specific embodiment, when the preset parameters meet the first preset condition, encoding the zero run value may include:
根据零游程值,确定第一语法元素标识信息的取值;Determining a value of first syntax element identification information according to the zero run value;
基于上下文模型对第一语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the first syntax element identification information based on the context model, and writing the obtained encoding bits into the bitstream;
若第一语法元素标识信息的取值为第二值,则根据零游程值,确定第二语法元素标识信息的取值;If the value of the first syntax element identification information is the second value, determining the value of the second syntax element identification information according to the zero run value;
基于上下文模型对第二语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the second syntax element identification information based on the context model, and writing the obtained encoding bits into the bitstream;
若第二语法元素标识信息的取值为第二值,则根据零游程值,确定第三语法元素标识信息的取值;If the value of the second syntax element identification information is the second value, determining the value of the third syntax element identification information according to the zero run value;
基于上下文模型对第三语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the third syntax element identification information based on the context model, and writing the obtained encoding bits into the bitstream;
若第三语法元素标识信息的取值为第二值,则根据零游程值,确定第四语法元素标识信息的取值和第五语法元素标识信息的取值;If the value of the third syntax element identification information is the second value, determining the value of the fourth syntax element identification information and the value of the fifth syntax element identification information according to the zero run value;
基于上下文模型对第四语法元素标识信息的取值进行编码处理,以及基于上下文模型对第五语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;encoding the value of the fourth syntax element identification information based on the context model, and encoding the value of the fifth syntax element identification information based on the context model, and writing the obtained coded bits into the bitstream;
若第五语法元素标识信息的取值为第二值,则根据零游程值,确定第六语法元素标识信息的取值;If the value of the fifth syntax element identification information is the second value, determining the value of the sixth syntax element identification information according to the zero run value;
基于上下文模型对第六语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the sixth syntax element identification information based on the context model, and writing the obtained encoding bits into the bitstream;
若第六语法元素标识信息的取值为第二值,则根据零游程值,确定第七语法元素标识信息的取值;If the value of the sixth syntax element identification information is the second value, determining the value of the seventh syntax element identification information according to the zero run value;
基于上下文模型对第七语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the seventh syntax element identification information based on the context model, and writing the obtained encoding bits into the bitstream;
若第七语法元素标识信息的取值为第二值,则根据零游程值,确定第八语法元素标识信息的取值;If the value of the seventh syntax element identification information is the second value, determining the value of the eighth syntax element identification information according to the zero run value;
基于上下文模型对第八语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the eighth syntax element identification information based on the context model, and writing the obtained encoding bits into the bitstream;
若第八语法元素标识信息的取值为第二值,则根据零游程值,确定第二数值标识信息的取值;If the value of the eighth syntax element identification information is the second value, determining the value of the second numerical value identification information according to the zero run value;
基于旁路模型对第二数值标识信息的取值进行编码处理,将所得到的编码比特写入码流。The value of the second numerical identification information is encoded based on the bypass model, and the obtained encoded bits are written into the bit stream.
进一步地,在一些实施例中,该方法还可以包括:在每一次基于上下文模型对以下的语法元素标识信息编码完成后,对预置参数的取值执行一次减1操作:Furthermore, in some embodiments, the method may further include: after encoding the following syntax element identification information based on the context model each time, performing a subtraction operation on the value of the preset parameter:
第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息、第五语法元素标识信息、第六语法元素标识信息、第七语法元素标识信息和第八语法元素标识信息。first grammatical element identification information, second grammatical element identification information, third grammatical element identification information, fourth grammatical element identification information, fifth grammatical element identification information, sixth grammatical element identification information, seventh grammatical element identification information and eighth grammatical element identification information.
在另一些实施例中,在预置参数符合第二预设条件时,对零游程值进行编码处理,可以包括:基于旁路模型对可能出现的第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息、第五语法元素标识信息、第六语法元素标识信息、第七语法元素标识信息、第八语法元素标识信息和第二数值标识信息进行编码处理,将所得到的编码比特写入码流。也就是说,如果预置参数符合第二预设条件,那么对于零游程值对应的所有二值化码字均采用旁路模型进行编码处理。In other embodiments, when the preset parameters meet the second preset condition, encoding the zero-run value may include: encoding the first syntax element identification information, the second syntax element identification information, the third syntax element identification information, the fourth syntax element identification information, the fifth syntax element identification information, the sixth syntax element identification information, the seventh syntax element identification information, the eighth syntax element identification information, and the second numerical identification information that may appear based on the bypass model, and writing the obtained encoding bits into the bitstream. That is, if the preset parameters meet the second preset condition, then all binary codewords corresponding to the zero-run value are encoded using the bypass model.
在一种具体的实施例中,在预置参数符合第二预设条件时,对零游程值进行编码处理,可以包括:In a specific embodiment, when the preset parameters meet the second preset condition, encoding the zero run value may include:
根据零游程值,确定第一语法元素标识信息的取值;Determining a value of first syntax element identification information according to the zero run value;
基于旁路模型对第一语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the first syntax element identification information based on the bypass model, and writing the obtained encoding bits into the bitstream;
若第一语法元素标识信息的取值为第二值,则根据零游程值,确定第二语法元素标识信息的取值;If the value of the first syntax element identification information is the second value, determining the value of the second syntax element identification information according to the zero run value;
基于旁路模型对第二语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the second syntax element identification information based on the bypass model, and writing the obtained encoding bits into the bitstream;
若第二语法元素标识信息的取值为第二值,则根据零游程值,确定第三语法元素标识信息的取值;If the value of the second syntax element identification information is the second value, determining the value of the third syntax element identification information according to the zero run value;
基于旁路模型对第三语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the third syntax element identification information based on the bypass model, and writing the obtained encoding bits into the bitstream;
若第三语法元素标识信息的取值为第二值,则根据零游程值,确定第四语法元素标识信息的取值和第五语法元素标识信息的取值;If the value of the third syntax element identification information is the second value, determining the value of the fourth syntax element identification information and the value of the fifth syntax element identification information according to the zero run value;
基于旁路模型对第四语法元素标识信息的取值进行编码处理,以及基于旁路模型对第五语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;encoding the value of the fourth syntax element identification information based on the bypass model, and encoding the value of the fifth syntax element identification information based on the bypass model, and writing the obtained coded bits into the bitstream;
若第五语法元素标识信息的取值为第二值,则根据零游程值,确定第六语法元素标识信息的取值;If the value of the fifth syntax element identification information is the second value, determining the value of the sixth syntax element identification information according to the zero run value;
基于旁路模型对第六语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the sixth syntax element identification information based on the bypass model, and writing the obtained encoding bits into the bitstream;
若第六语法元素标识信息的取值为第二值,则根据零游程值,确定第七语法元素标识信息的取值;If the value of the sixth syntax element identification information is the second value, determining the value of the seventh syntax element identification information according to the zero run value;
基于旁路模型对第七语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the seventh syntax element identification information based on the bypass model, and writing the obtained encoding bits into the bitstream;
若第七语法元素标识信息的取值为第二值,则根据零游程值,确定第八语法元素标识信息的取值;If the value of the seventh syntax element identification information is the second value, determining the value of the eighth syntax element identification information according to the zero run value;
基于旁路模型对第八语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the eighth syntax element identification information based on the bypass model, and writing the obtained encoding bits into the bitstream;
若第八语法元素标识信息的取值为第二值,则根据零游程值,确定第二数值标识信息的取值;If the value of the eighth syntax element identification information is the second value, determining the value of the second numerical value identification information according to the zero run value;
基于旁路模型对第二数值标识信息的取值进行编码处理,将所得到的编码比特写入码流。The value of the second numerical identification information is encoded based on the bypass model, and the obtained encoded bits are written into the bit stream.
在一些实施例中,根据零游程值,确定第一语法元素标识信息的取值,可以包括:In some embodiments, determining the value of the first syntax element identification information according to the zero run value may include:
若零游程值等于0,则确定第一语法元素标识信息的取值为第一值;若零游程值不等于0,则确定第一语法元素标识信息的取值为第二值。If the zero-run value is equal to 0, the value of the first syntax element identification information is determined to be the first value; if the zero-run value is not equal to 0, the value of the first syntax element identification information is determined to be the second value.
在一些实施例中,根据零游程值,确定第二语法元素标识信息的取值,可以包括:In some embodiments, determining the value of the second syntax element identification information according to the zero run value may include:
若零游程值等于1,则确定第二语法元素标识信息的取值为第一值;若零游程值不等于1,则确定第二语法元素标识信息的取值为第二值。If the zero-run value is equal to 1, the value of the second syntax element identification information is determined to be the first value; if the zero-run value is not equal to 1, the value of the second syntax element identification information is determined to be the second value.
在一些实施例中,根据零游程值,确定第三语法元素标识信息的取值,可以包括:In some embodiments, determining the value of the third syntax element identification information according to the zero run value may include:
若零游程值等于2,则确定第三语法元素标识信息的取值为第一值;若零游程值不等于2,则确定第三语法元素标识信息的取值为第二值。If the zero-run value is equal to 2, the value of the third syntax element identification information is determined to be the first value; if the zero-run value is not equal to 2, the value of the third syntax element identification information is determined to be the second value.
在一些实施例中,根据零游程值,确定第四语法元素标识信息的取值,可以包括:In some embodiments, determining the value of the fourth syntax element identification information according to the zero run value may include:
若第一数值为奇数,则确定第四语法元素标识信息的取值为第一值;若第一数值为偶数,则确定第四语法元素标识信息的取值为第二值;If the first value is an odd number, determining that the value of the fourth syntax element identification information is the first value; if the first value is an even number, determining that the value of the fourth syntax element identification information is the second value;
或者,若第一数值除以2的余数为1,则确定第四语法元素标识信息的取值为第一值;若第一数值除以2的余数为0,则确定第四语法元素标识信息的取值为第二值。Alternatively, if the remainder when the first value is divided by 2 is 1, the value of the fourth syntax element identification information is determined to be the first value; if the remainder when the first value is divided by 2 is 0, the value of the fourth syntax element identification information is determined to be the second value.
在一些实施例中,根据零游程值,确定第五语法元素标识信息的取值,可以包括:In some embodiments, determining the value of the fifth syntax element identification information according to the zero run value may include:
若第二数值等于0,则确定第五语法元素标识信息的取值为第一值;若第二数值不等于0,则确定第五语法元素标识信息的取值为第二值。If the second value is equal to 0, it is determined that the value of the fifth syntax element identification information is the first value; if the second value is not equal to 0, it is determined that the value of the fifth syntax element identification information is the second value.
在一些实施例中,根据零游程值,确定第六语法元素标识信息的取值,可以包括:In some embodiments, determining the value of the sixth syntax element identification information according to the zero run value may include:
若第二数值等于1,则确定第六语法元素标识信息的取值为第一值;若第二数值不等于1,则确定第六语法元素标识信息的取值为第二值。If the second numerical value is equal to 1, it is determined that the value of the sixth grammatical element identification information is the first value; if the second numerical value is not equal to 1, it is determined that the value of the sixth grammatical element identification information is the second value.
在一些实施例中,根据零游程值,确定第七语法元素标识信息的取值,可以包括:In some embodiments, determining the value of the seventh syntax element identification information according to the zero run value may include:
若第二数值等于2,则确定第七语法元素标识信息的取值为第一值;若第二数值不等于2,则确定第七语法元素标识信息的取值为第二值。If the second numerical value is equal to 2, it is determined that the value of the seventh grammatical element identification information is the first value; if the second numerical value is not equal to 2, it is determined that the value of the seventh grammatical element identification information is the second value.
在一些实施例中,根据零游程值,确定第八语法元素标识信息的取值,可以包括:In some embodiments, determining the value of the eighth syntax element identification information according to the zero run value may include:
若第二数值等于3,则确定第八语法元素标识信息的取值为第一值;若第二数值不等于3,则确定第八语法元素标识信息的取值为第二值。If the second numerical value is equal to 3, it is determined that the value of the eighth syntax element identification information is the first value; if the second numerical value is not equal to 3, it is determined that the value of the eighth syntax element identification information is the second value.
需要说明的是,在本申请实施例中,针对不同的语法元素标识信息,例如第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息、第五语法元素标识信息、第六语法元素标识信息、第七语法元素标识信息和第八语法元素标识信息等,各自对应的第一值和第二值可以相同,或者也可以不相同,这里不作具体限定。It should be noted that in the embodiments of the present application, for different grammatical element identification information, such as the first grammatical element identification information, the second grammatical element identification information, the third grammatical element identification information, the fourth grammatical element identification information, the fifth grammatical element identification information, the sixth grammatical element identification information, the seventh grammatical element identification information and the eighth grammatical element identification information, etc., the corresponding first value and the second value may be the same, or may be different, and there is no specific limitation here.
还需要说明的是,在本申请实施例中,第一值和第二值可以是参数形式,也可以是数字形式。具体地,每一个语法元素标识信息可以是写入在概述(profile)中的参数,也可以是一个标志位/标识符的取值,这里对此不作具体限定。It should also be noted that, in the embodiment of the present application, the first value and the second value may be in parameter form or in digital form. Specifically, each syntax element identification information may be a parameter written in the profile or a value of a flag bit/identifier, which is not specifically limited here.
示例性地,针对每一个语法元素标识信息,第一值可以设置为1,第二值可以设置为0;或者,第一值可以设置为0,第二值可以设置为1;或者,第一值可以设置为true,第二值可以设置为false;或者,第一值可以设置为false,第二值可以设置为true。其中,在本申请实施例中,第一值设置为1,第二值设置为0,但是对此并不作具体限定。Exemplarily, for each syntax element identification information, the first value may be set to 1, and the second value may be set to 0; or, the first value may be set to 0, and the second value may be set to 1; or, the first value may be set to true, and the second value may be set to false; or, the first value may be set to false, and the second value may be set to true. In the embodiment of the present application, the first value is set to 1, and the second value is set to 0, but this is not specifically limited.
这样,以第一预设值为3为例,首先编码第一语法元素标识信息来指示零游程值是否等于0,如果零游程值等于0,则编码零游程值完成;否则继续编码第二语法元素标识信息来指示零游程值是否等于1,如果零游程值等于1,则编码零游程值完成;否则继续编码第三语法元素标识信息来指示零游程值是否等于2,如果零游程值等于2,则编码零游程值完成;否则继续编码第四语法元素标识信息来指示零游程值减去3的奇偶特性,以及编码第五语法元素标识信息来指示零游程值减去3再除以2的商是否等于0,如果零游程值减去3再除以2的商等于0,则编码零游程值完成;否则继续编码第六语法元素标识信息来指示零游程值减去3再除以2的商是否等于1,如果零游程值减去3再除以2的商等于1, 则编码零游程值完成;否则继续编码第七语法元素标识信息来指示零游程值减去3再除以2的商是否等于2,如果零游程值减去3再除以2的商等于2,则编码零游程值完成;否则继续编码第八语法元素标识信息来指示零游程值减去3再除以2的商是否等于3,如果零游程值减去3再除以2的商等于3,则编码零游程值完成;否则继续编码第二数值标识信息来指示零游程值减去3再除以2的商再减去4的值,编码零游程值完成。这样,后续在解码端,通过解码码流来获得这些语法元素标识信息,就可以确定出零游程值。In this way, taking the first preset value of 3 as an example, first encode the first syntax element identification information to indicate whether the zero run value is equal to 0. If the zero run value is equal to 0, the encoding of the zero run value is completed; otherwise, continue to encode the second syntax element identification information to indicate whether the zero run value is equal to 1. If the zero run value is equal to 1, the encoding of the zero run value is completed; otherwise, continue to encode the third syntax element identification information to indicate whether the zero run value is equal to 2. If the zero run value is equal to 2, the encoding of the zero run value is completed; otherwise, continue to encode the fourth syntax element identification information to indicate the parity characteristic of the zero run value minus 3, and encode the fifth syntax element identification information to indicate whether the quotient of the zero run value minus 3 divided by 2 is equal to 0. If the quotient of the zero run value minus 3 divided by 2 is equal to 0, the encoding of the zero run value is completed; otherwise, continue to encode the sixth syntax element identification information to indicate whether the quotient of the zero run value minus 3 divided by 2 is equal to 1. If the quotient of the zero run value minus 3 divided by 2 is equal to 1, Then the encoding of the zero run value is completed; otherwise, the seventh syntax element identification information is continued to be encoded to indicate whether the quotient of the zero run value minus 3 and then divided by 2 is equal to 2. If the quotient of the zero run value minus 3 and then divided by 2 is equal to 2, the encoding of the zero run value is completed; otherwise, the eighth syntax element identification information is continued to be encoded to indicate whether the quotient of the zero run value minus 3 and then divided by 2 is equal to 3. If the quotient of the zero run value minus 3 and then divided by 2 is equal to 3, the encoding of the zero run value is completed; otherwise, the second value identification information is continued to be encoded to indicate the value of the quotient of the zero run value minus 3 and then divided by 2 minus 4, and the encoding of the zero run value is completed. In this way, at the decoding end, these syntax element identification information can be obtained by decoding the bit stream to determine the zero run value.
在一些实施例中,基于旁路模型对第二数值标识信息的取值进行编码处理,可以包括:对第二数值标识信息的取值进行二值化处理,得到至少一个二值符号;基于旁路模型对至少一个二值符号依次进行编码处理,将所得到的编码比特写入码流。In some embodiments, encoding the value of the second numerical identification information based on the bypass model may include: binarizing the value of the second numerical identification information to obtain at least one binary symbol; encoding the at least one binary symbol in turn based on the bypass model, and writing the obtained encoded bits into the bit stream.
需要说明的是,在本申请实施例中,对于如何根据零游程值来确定第二数值标识信息的取值,可以包括:根据零游程值与第一预设值进行减法运算,得到第一数值;将第二数值设置为等于第一数值除以2的商;根据第二数值与第二预设值进行减法运算,确定第二数值标识信息的取值。示例性地,第一预设值可以设置为3,第二预设值可以设置为4。It should be noted that, in the embodiment of the present application, how to determine the value of the second numerical identification information according to the zero run value may include: performing a subtraction operation on the zero run value and the first preset value to obtain the first numerical value; setting the second numerical value to be equal to the quotient of the first numerical value divided by 2; performing a subtraction operation on the second numerical value and the second preset value to determine the value of the second numerical identification information. For example, the first preset value may be set to 3, and the second preset value may be set to 4.
在一种具体的实施例中,为了提升硬件吞吐率,该编码过程可以如下:In a specific embodiment, in order to improve the hardware throughput, the encoding process may be as follows:
(i)为零游程值分配基于上下文模型编码码字的预算remBinsPass1(初始值可设置为2 24); (i) Allocate a budget remBinsPass1 for zero run values based on the context model encoding codeword (the initial value can be set to 2 24 );
(ii)在零游程编码开始前,判断remBinsPass1是否大于等于T(如设置为8);(ii) Before the start of zero-run encoding, determine whether remBinsPass1 is greater than or equal to T (such as set to 8);
(iii)当remBinsPass1≥T时,对可能出现的zero_run_length_equal_zero、zero_run_length_equal_one、zero_run_length_equal_two、zero_run_length_minus3_parity、zero_run_length_minus3_div2_equal_zero、zero_run_length_minus3_div2_equal_one、zero_run_length_minus3_div2_equal_two、zero_run_length_minus3_div2_equal_three采用基于上下文模型的编码方式,且每编完一个标志位/标志符,做remBinsPass1--操作,而zero_run_length_minus3_div2_minus4的所有二值化后的码字采用基于旁路模型的编码方式;(iii) When remBinsPass1 ≥ T, the possible zero_run_length_equal_zero, zero_run_length_equal_one, zero_run_length_equal_two, zero_run_length_minus3_parity, zero_run_length_minus3_div2_equal_zero, zero_run_length_minus3_div2_equal_one, zero_run_length_minus3_div2_equal_two, and zero_run_length_minus3_div2_equal_three are coded using the context model, and after each flag bit/sign is coded, a remBinsPass1-- operation is performed, and all binary codewords of zero_run_length_minus3_div2_minus4 are coded using the bypass model;
(iv)当不满足remBinsPass1≥T时,对零游程值的所有二值化后的码字均采用基于旁路模型的编码方式。(iv) When remBinsPass1≥T is not satisfied, all binarized codewords with zero run values are coded using a bypass model-based encoding method.
对于本申请实施例的整个编码过程,在实现中,其对应解码过程的语法表描述如前述的表2所示。For the entire encoding process of the embodiment of the present application, in implementation, the syntax table description of the corresponding decoding process is shown in the aforementioned Table 2.
简单来说,在本申请实施例中,如前述表3~表12所示的测试结果,通过设定预算remBinsPass1对零游程编码时使用的基于上下文模型的码字个数进行限制,可以提高吞吐率,提供对硬件更友好的实现方式。Simply put, in the embodiments of the present application, as shown in the test results of Tables 3 to 12 above, by setting the budget remBinsPass1 to limit the number of codewords based on the context model used in zero-run encoding, the throughput can be improved and a more hardware-friendly implementation method can be provided.
进一步地,本申请实施例还提供了一种码流,该码流是根据待编码信息进行比特编码生成的;其中,待编码信息包括下述至少一项:属性量化残差值、第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息、第五语法元素标识信息、第六语法元素标识信息、第七语法元素标识信息、第八语法元素标识信息、第一数值标识信息和第二数值标识信息。Furthermore, an embodiment of the present application also provides a code stream, which is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following: an attribute quantization residual value, a first grammatical element identification information, a second grammatical element identification information, a third grammatical element identification information, a fourth grammatical element identification information, a fifth grammatical element identification information, a sixth grammatical element identification information, a seventh grammatical element identification information, an eighth grammatical element identification information, a first numerical identification information, and a second numerical identification information.
在这里,属性量化残差值可以为颜色分量量化残差值或者反射率量化残差值。编码端在对这些待编码信息进行编码后会写入码流;如此,在解码端,可以直接通过解码码流来获得这些待编码信息,进而能够确定零游程值。Here, the attribute quantization residual value can be a color component quantization residual value or a reflectance quantization residual value. The encoder writes the information to be encoded into the bitstream after encoding it; thus, the decoder can directly obtain the information to be encoded by decoding the bitstream, and then determine the zero run value.
本实施例提供了一种编码方法,通过上述实施例对前述实施例的具体实现进行了详细阐述,从中可以看出,根据前述实施例的技术方案,首先确定零游程值对应的预置参数,然后判断预置参数是否符合第一预设条件;如果预置参数符合第一预设条件,那么对至少一个第一类语法元素标识信息进行基于上下文模型的编码处理,以及对至少一个第二类语法元素标识信息进行基于旁路模型的编码处理;如此,根据所确定的预置参数,可以限定在编码时使用的基于上下文模型的码字数量,使得部分语法元素标识信息采用旁路模型进行编码处理,从而可以提高硬件吞吐率,降低了硬件实现的难度;而且还能够提升处理速度。The present embodiment provides a coding method, and the specific implementation of the aforementioned embodiment is elaborated in detail through the above embodiment. It can be seen that according to the technical scheme of the aforementioned embodiment, the preset parameters corresponding to the zero-run value are first determined, and then it is determined whether the preset parameters meet the first preset condition; if the preset parameters meet the first preset condition, then at least one first-category syntax element identification information is coded based on the context model, and at least one second-category syntax element identification information is coded based on the bypass model; in this way, according to the determined preset parameters, the number of codewords based on the context model used in encoding can be limited, so that part of the syntax element identification information is coded using the bypass model, thereby improving the hardware throughput and reducing the difficulty of hardware implementation; and it can also improve the processing speed.
在本申请的再一实施例中,基于前述实施例相同的发明构思,参见图10,其示出了本申请实施例提供的一种编码器的组成结构示意图。如图10所示,该编码器100可以包括:第一确定单元1001和编码单元1002;其中,In another embodiment of the present application, based on the same inventive concept as the above-mentioned embodiment, see FIG10 , which shows a schematic diagram of the composition structure of an encoder provided by an embodiment of the present application. As shown in FIG10 , the encoder 100 may include: a first determining unit 1001 and an encoding unit 1002; wherein,
第一确定单元1001,配置为确定零游程值以及零游程值对应的预置参数;以及根据零游程值,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值;The first determining unit 1001 is configured to determine a zero-run value and a preset parameter corresponding to the zero-run value; and determine a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information according to the zero-run value;
编码单元1002,配置为若预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息的取值进行基于上下文模型的编码处理,以及对至少一个第二类语法元素标识信息的取值进行基于旁路模型的编码处理,将所得到的编码比特写入码流。The encoding unit 1002 is configured to, if the preset parameters meet the first preset condition, perform context model-based encoding processing on the value of at least one first-category syntax element identification information, and perform bypass model-based encoding processing on the value of at least one second-category syntax element identification information, and write the obtained encoded bits into the bitstream.
在一些实施例中,参见图10,编码器100还包括第一判断单元1003,配置为确定预置参数的取值 大于或等于预设门限值。In some embodiments, referring to FIG. 10 , the encoder 100 further includes a first judgment unit 1003 configured to determine whether the value of a preset parameter is greater than or equal to a preset threshold value.
在一些实施例中,编码单元1002,还配置为若预置参数符合第二预设条件,则对至少一个第一类语法元素标识信息和至少一个第二类语法元素标识信息均进行基于旁路模型的编码处理,将所得到的编码比特写入码流。In some embodiments, the encoding unit 1002 is further configured to perform bypass model-based encoding processing on at least one first-category syntax element identification information and at least one second-category syntax element identification information if the preset parameters meet the second preset condition, and write the obtained encoded bits into the bitstream.
在一些实施例中,第一判断单元1003,还配置为确定预置参数的取值小于预设门限值。In some embodiments, the first judgment unit 1003 is further configured to determine whether the value of the preset parameter is less than a preset threshold value.
在一些实施例中,编码单元1002,还配置为对零游程值对应的预置参数进行编码处理,将所得到的编码比特写入码流。In some embodiments, the encoding unit 1002 is further configured to perform encoding processing on preset parameters corresponding to the zero run value, and write the obtained encoding bits into the bit stream.
在一些实施例中,第一确定单元1001,还配置为若当前节点的属性量化残差值等于0,则对零游程值执行加1操作,根据下一节点的属性量化残差值继续确定零游程值;若当前节点的属性量化残差值不全等于0,则对零游程值进行编码处理,且对当前节点的属性量化残差值进行编码处理,将所得到的编码比特写入码流;以及将零游程值重置为0,根据下一节点的属性量化残差值继续确定零游程值。In some embodiments, the first determination unit 1001 is further configured to, if the attribute quantization residual value of the current node is equal to 0, perform a plus 1 operation on the zero-run value, and continue to determine the zero-run value according to the attribute quantization residual value of the next node; if the attribute quantization residual values of the current node are not all equal to 0, encode the zero-run value, and encode the attribute quantization residual value of the current node, and write the obtained encoded bits into the bitstream; and reset the zero-run value to 0, and continue to determine the zero-run value according to the attribute quantization residual value of the next node.
在一些实施例中,第一确定单元1001,还配置为设置零游程值的初始值等于0。In some embodiments, the first determining unit 1001 is further configured to set an initial value of the zero-run value equal to 0.
在一些实施例中,零游程值用于指示属性量化残差值是否均为0的计数;其中,属性量化残差值包括下述其中之一:颜色分量量化残差值和反射率量化残差值。In some embodiments, the zero-run value is used to indicate whether the attribute quantization residual values are all 0 counts; wherein the attribute quantization residual value includes one of the following: a color component quantization residual value and a reflectance quantization residual value.
在一些实施例中,第一确定单元1001,还配置为在零游程值小于预设阈值时,根据零游程值,确定至少一个第一类语法元素标识信息的取值;In some embodiments, the first determining unit 1001 is further configured to determine a value of at least one first-category syntax element identification information according to the zero-run value when the zero-run value is less than a preset threshold;
编码单元1002,还配置为若预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息的取值进行基于上下文模型的编码处理,将所得到的编码比特写入码流;或者,若预置参数符合第二预设条件,则对至少一个第一类语法元素标识信息的取值进行基于旁路模型的编码处理,将所得到的编码比特写入码流。The encoding unit 1002 is further configured to, if the preset parameters meet the first preset condition, perform encoding processing based on the context model on the value of at least one first-category syntax element identification information, and write the obtained coded bits into the bitstream; or, if the preset parameters meet the second preset condition, perform encoding processing based on the bypass model on the value of at least one first-category syntax element identification information, and write the obtained coded bits into the bitstream.
在一些实施例中,至少一个第一类语法元素标识信息包括下述至少一项:第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息和第四语法元素标识信息;至少一个第二类语法元素标识信息至少包括:第一数值标识信息;其中,第一语法元素标识信息用于指示零游程值是否等于0,第二语法元素标识信息用于指示零游程值是否等于1,第三语法元素标识信息用于指示零游程值是否等于2,第四语法元素标识信息用于指示零游程值进行第一运算后得到的第一数值的奇偶特性,第一数值标识信息用于指示零游程值进行第二运算后得到的第二数值。In some embodiments, at least one first-category syntax element identification information includes at least one of the following: first syntax element identification information, second syntax element identification information, third syntax element identification information and fourth syntax element identification information; at least one second-category syntax element identification information includes at least: first numerical identification information; wherein the first syntax element identification information is used to indicate whether the zero-run value is equal to 0, the second syntax element identification information is used to indicate whether the zero-run value is equal to 1, the third syntax element identification information is used to indicate whether the zero-run value is equal to 2, the fourth syntax element identification information is used to indicate the parity characteristic of a first numerical value obtained after a first operation on the zero-run value, and the first numerical identification information is used to indicate a second numerical value obtained after a second operation on the zero-run value.
在一些实施例中,第一确定单元1001,还配置为根据零游程值与第一预设值进行减法运算,得到第一数值。In some embodiments, the first determination unit 1001 is further configured to perform a subtraction operation on the zero-run value and the first preset value to obtain a first numerical value.
在一些实施例中,第一确定单元1001,还配置为根据零游程值与第一预设值进行减法运算,得到第一数值;以及将第二数值设置为等于第一数值除以2的商。In some embodiments, the first determination unit 1001 is further configured to perform a subtraction operation on the zero-run value and the first preset value to obtain a first value; and set the second value to be equal to the quotient of the first value divided by 2.
在一些实施例中,第一确定单元1001,还配置为对第一数值进行右移一位处理,得到第二数值。In some embodiments, the first determining unit 1001 is further configured to right-shift the first value by one bit to obtain a second value.
在一些实施例中,编码单元1002,还配置为在预置参数符合第一预设条件时,根据零游程值,确定第一语法元素标识信息的取值;以及基于上下文模型对第一语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第一语法元素标识信息的取值为第二值,则根据零游程值,确定第二语法元素标识信息的取值;基于上下文模型对第二语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第二语法元素标识信息的取值为第二值,则根据零游程值,确定第三语法元素标识信息的取值;基于上下文模型对第三语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第三语法元素标识信息的取值为第二值,则根据零游程值,确定第四语法元素标识信息的取值和第一数值标识信息的取值;基于上下文模型对第四语法元素标识信息的取值进行编码处理,以及基于旁路模型对第一数值标识信息的取值进行编码处理,将所得到的编码比特写入码流。In some embodiments, the encoding unit 1002 is further configured to, when the preset parameter meets the first preset condition, determine the value of the first syntax element identification information according to the zero run value; and perform encoding processing on the value of the first syntax element identification information based on the context model, and write the obtained coded bits into the bitstream; if the value of the first syntax element identification information is the second value, determine the value of the second syntax element identification information according to the zero run value; perform encoding processing on the value of the second syntax element identification information based on the context model, and write the obtained coded bits into the bitstream; if the value of the second syntax element identification information is the second value, determine the value of the third syntax element identification information according to the zero run value; perform encoding processing on the value of the third syntax element identification information based on the context model, and write the obtained coded bits into the bitstream; if the value of the third syntax element identification information is the second value, determine the value of the fourth syntax element identification information and the value of the first value identification information according to the zero run value; perform encoding processing on the value of the fourth syntax element identification information based on the context model, and perform encoding processing on the value of the first value identification information based on the bypass model, and write the obtained coded bits into the bitstream.
在一些实施例中,编码单元1002,还配置为在每一次基于上下文模型对以下的语法元素标识信息编码完成后,对预置参数的取值执行一次减1操作:第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息和第四语法元素标识信息。In some embodiments, the encoding unit 1002 is also configured to perform a subtraction operation on the value of the preset parameter after each encoding of the following syntax element identification information based on the context model is completed: the first syntax element identification information, the second syntax element identification information, the third syntax element identification information and the fourth syntax element identification information.
在一些实施例中,编码单元1002,还配置为在预置参数符合第二预设条件时,根据零游程值,确定第一语法元素标识信息的取值;以及基于旁路模型对第一语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第一语法元素标识信息的取值为第二值,则根据零游程值,确定第二语法元素标识信息的取值;基于旁路模型对第二语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第二语法元素标识信息的取值为第二值,则根据零游程值,确定第三语法元素标识信息的取值;基于旁路模型对第三语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第三语法元素标识信息的取值为第二值,则根据零游程值,确定第四语法元素标识信息的取值和第一数值标识信息的取值;基于旁路模型对第四语法元素标识信息的取值进行编码处理,以及基于旁路模型对第一数值标识信息的取值进行编码处理,将所得到的编码比特写入码流。In some embodiments, the encoding unit 1002 is further configured to, when the preset parameter meets the second preset condition, determine the value of the first syntax element identification information according to the zero run value; and perform encoding processing on the value of the first syntax element identification information based on the bypass model, and write the obtained coded bits into the bitstream; if the value of the first syntax element identification information is the second value, determine the value of the second syntax element identification information according to the zero run value; perform encoding processing on the value of the second syntax element identification information based on the bypass model, and write the obtained coded bits into the bitstream; if the value of the second syntax element identification information is the second value, determine the value of the third syntax element identification information according to the zero run value; perform encoding processing on the value of the third syntax element identification information based on the bypass model, and write the obtained coded bits into the bitstream; if the value of the third syntax element identification information is the second value, determine the value of the fourth syntax element identification information and the value of the first value identification information according to the zero run value; perform encoding processing on the value of the fourth syntax element identification information based on the bypass model, and perform encoding processing on the value of the first value identification information based on the bypass model, and write the obtained coded bits into the bitstream.
在一些实施例中,编码单元1002,还配置为对第一数值标识信息的取值进行二值化处理,得到至少一个二值符号;以及基于旁路模型对至少一个二值符号依次进行编码处理,将所得到的编码比特写入码流。In some embodiments, the encoding unit 1002 is further configured to binarize the value of the first numerical identification information to obtain at least one binary symbol; and to encode the at least one binary symbol in sequence based on the bypass model, and write the obtained coded bits into the code stream.
在一些实施例中,至少一个第一类语法元素标识信息包括下述至少一项:第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息、第五语法元素标识信息、第六语法元素标识信息、第七语法元素标识信息和第八语法元素标识信息;至少一个第二类语法元素标识信息至少包括:第二数值标识信息;其中,第一语法元素标识信息用于指示零游程值是否等于0,第二语法元素标识信息用于指示零游程值是否等于1,第三语法元素标识信息用于指示零游程值是否等于2,第四语法元素标识信息用于指示零游程值进行第一运算后得到的第一数值的奇偶特性,第五语法元素标识信息用于指示零游程值进行第二运算后得到的第二数值是否等于0,第六语法元素标识信息用于指示零游程值进行第二运算后得到的第二数值是否等于1,第七语法元素标识信息用于指示零游程值进行第二运算后得到的第二数值是否等于2,第八语法元素标识信息用于指示零游程值进行第二运算后得到的第二数值是否等于3,第二数值标识信息用于指示零游程值进行第四运算后得到的第四数值。In some embodiments, at least one first-category syntax element identification information includes at least one of the following: first syntax element identification information, second syntax element identification information, third syntax element identification information, fourth syntax element identification information, fifth syntax element identification information, sixth syntax element identification information, seventh syntax element identification information, and eighth syntax element identification information; at least one second-category syntax element identification information includes at least: second numerical identification information; wherein the first syntax element identification information is used to indicate whether the zero run value is equal to 0, the second syntax element identification information is used to indicate whether the zero run value is equal to 1, and the third syntax element identification information is used to indicate whether the zero run value is equal to 2, the fourth syntax element identification information is used to indicate the parity characteristic of the first numerical value obtained after the zero-run value is subjected to the first operation, the fifth syntax element identification information is used to indicate whether the second numerical value obtained after the zero-run value is subjected to the second operation is equal to 0, the sixth syntax element identification information is used to indicate whether the second numerical value obtained after the zero-run value is subjected to the second operation is equal to 1, the seventh syntax element identification information is used to indicate whether the second numerical value obtained after the zero-run value is subjected to the second operation is equal to 2, the eighth syntax element identification information is used to indicate whether the second numerical value obtained after the zero-run value is subjected to the second operation is equal to 3, and the second numerical value identification information is used to indicate the fourth numerical value obtained after the zero-run value is subjected to the fourth operation.
在一些实施例中,参见图10,编码器100还包括第一计算单元1004,配置为根据零游程值与第一预设值进行减法运算,得到第一数值;以及将第二数值设置为等于第一数值除以2的商;以及根据第二数值与第二预设值进行减法运算,得到第四数值。In some embodiments, referring to FIG. 10 , the encoder 100 further includes a first computing unit 1004 configured to perform a subtraction operation on the zero-run value and a first preset value to obtain a first numerical value; and set the second numerical value to be equal to the quotient of the first numerical value divided by 2; and perform a subtraction operation on the second numerical value and a second preset value to obtain a fourth numerical value.
在一些实施例中,编码单元1002,还配置为在预置参数符合第一预设条件时,根据零游程值,确定第一语法元素标识信息的取值;基于上下文模型对第一语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第一语法元素标识信息的取值为第二值,则根据零游程值,确定第二语法元素标识信息的取值;基于上下文模型对第二语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第二语法元素标识信息的取值为第二值,则根据零游程值,确定第三语法元素标识信息的取值;基于上下文模型对第三语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第三语法元素标识信息的取值为第二值,则根据零游程值,确定第四语法元素标识信息的取值和第五语法元素标识信息的取值;基于上下文模型对第四语法元素标识信息的取值进行编码处理,以及基于上下文模型对第五语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第五语法元素标识信息的取值为第二值,则根据零游程值,确定第六语法元素标识信息的取值;基于上下文模型对第六语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第六语法元素标识信息的取值为第二值,则根据零游程值,确定第七语法元素标识信息的取值;基于上下文模型对第七语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第七语法元素标识信息的取值为第二值,则根据零游程值,确定第八语法元素标识信息的取值;基于上下文模型对第八语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第八语法元素标识信息的取值为第二值,则根据零游程值,确定第二数值标识信息的取值;基于旁路模型对第二数值标识信息的取值进行编码处理,将所得到的编码比特写入码流。In some embodiments, the encoding unit 1002 is further configured to, when the preset parameter meets the first preset condition, determine the value of the first syntax element identification information according to the zero run value; perform encoding processing on the value of the first syntax element identification information based on the context model, and write the obtained coded bits into the bitstream; if the value of the first syntax element identification information is the second value, determine the value of the second syntax element identification information according to the zero run value; perform encoding processing on the value of the second syntax element identification information based on the context model, and write the obtained coded bits into the bitstream; if the value of the second syntax element identification information is the second value, determine the value of the third syntax element identification information according to the zero run value; perform encoding processing on the value of the third syntax element identification information based on the context model, and write the obtained coded bits into the bitstream; if the value of the third syntax element identification information is the second value, determine the value of the fourth syntax element identification information and the value of the fifth syntax element identification information according to the zero run value; perform encoding processing on the value of the fourth syntax element identification information based on the context model, and perform encoding processing on the value of the third syntax element identification information based on the context model, and write the obtained coded bits into the bitstream; The method comprises: encoding the value of the fifth grammatical element identification information, and writing the obtained coded bits into the bitstream; if the value of the fifth grammatical element identification information is the second value, determining the value of the sixth grammatical element identification information according to the zero run value; encoding the value of the sixth grammatical element identification information based on the context model, and writing the obtained coded bits into the bitstream; if the value of the sixth grammatical element identification information is the second value, determining the value of the seventh grammatical element identification information according to the zero run value; encoding the value of the seventh grammatical element identification information based on the context model, and writing the obtained coded bits into the bitstream; if the value of the seventh grammatical element identification information is the second value, determining the value of the eighth grammatical element identification information according to the zero run value; encoding the value of the eighth grammatical element identification information based on the context model, and writing the obtained coded bits into the bitstream; if the value of the eighth grammatical element identification information is the second value, determining the value of the second numerical identification information according to the zero run value; encoding the value of the second numerical identification information based on the bypass model, and writing the obtained coded bits into the bitstream.
在一些实施例中,编码单元1002,还配置为在每一次基于上下文模型对以下的语法元素标识信息编码完成后,对预置参数的取值执行一次减1操作:第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息、第五语法元素标识信息、第六语法元素标识信息、第七语法元素标识信息和第八语法元素标识信息。In some embodiments, the encoding unit 1002 is further configured to perform a subtraction operation on the value of the preset parameter after each encoding of the following grammatical element identification information based on the context model is completed: the first grammatical element identification information, the second grammatical element identification information, the third grammatical element identification information, the fourth grammatical element identification information, the fifth grammatical element identification information, the sixth grammatical element identification information, the seventh grammatical element identification information and the eighth grammatical element identification information.
在一些实施例中,编码单元1002,还配置为在预置参数符合第二预设条件时,根据零游程值,确定第一语法元素标识信息的取值;基于旁路模型对第一语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第一语法元素标识信息的取值为第二值,则根据零游程值,确定第二语法元素标识信息的取值;基于旁路模型对第二语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第二语法元素标识信息的取值为第二值,则根据零游程值,确定第三语法元素标识信息的取值;基于旁路模型对第三语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第三语法元素标识信息的取值为第二值,则根据零游程值,确定第四语法元素标识信息的取值和第五语法元素标识信息的取值;基于旁路模型对第四语法元素标识信息的取值进行编码处理,以及基于旁路模型对第五语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第五语法元素标识信息的取值为第二值,则根据零游程值,确定第六语法元素标识信息的取值;基于旁路模型对第六语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第六语法元素标识信息的取值为第二值,则根据零游程值,确定第七语法元素标识信息的取值;基于旁路模型对第七语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第七语法元素标识信息的取值为第二值,则根据零游程值,确定第八语法元素标识信息的取值;基于旁路模型对第八语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;若第八语法元素标识信息的取值为第二值,则根据零游程值, 确定第二数值标识信息的取值;基于旁路模型对第二数值标识信息的取值进行编码处理,将所得到的编码比特写入码流。In some embodiments, the encoding unit 1002 is further configured to, when the preset parameter meets the second preset condition, determine the value of the first syntax element identification information according to the zero run value; perform encoding processing on the value of the first syntax element identification information based on the bypass model, and write the obtained coded bits into the bitstream; if the value of the first syntax element identification information is the second value, determine the value of the second syntax element identification information according to the zero run value; perform encoding processing on the value of the second syntax element identification information based on the bypass model, and write the obtained coded bits into the bitstream; if the value of the second syntax element identification information is the second value, determine the value of the third syntax element identification information according to the zero run value; perform encoding processing on the value of the third syntax element identification information based on the bypass model, and write the obtained coded bits into the bitstream; if the value of the third syntax element identification information is the second value, determine the value of the fourth syntax element identification information and the value of the fifth syntax element identification information according to the zero run value; perform encoding processing on the fourth syntax element identification information based on the bypass model, and write the obtained coded bits into the bitstream. The method comprises: encoding the value of the syntax element identification information based on the bypass model, and encoding the value of the fifth syntax element identification information based on the bypass model, and writing the obtained coded bits into the bitstream; if the value of the fifth syntax element identification information is the second value, determining the value of the sixth syntax element identification information according to the zero run value; encoding the value of the sixth syntax element identification information based on the bypass model, and writing the obtained coded bits into the bitstream; if the value of the sixth syntax element identification information is the second value, determining the value of the seventh syntax element identification information according to the zero run value; encoding the value of the seventh syntax element identification information based on the bypass model, and writing the obtained coded bits into the bitstream; if the value of the seventh syntax element identification information is the second value, determining the value of the eighth syntax element identification information according to the zero run value; encoding the value of the eighth syntax element identification information based on the bypass model, and writing the obtained coded bits into the bitstream; if the value of the eighth syntax element identification information is the second value, determining the value of the second numerical identification information according to the zero run value; encoding the value of the second numerical identification information based on the bypass model, and writing the obtained coded bits into the bitstream.
在一些实施例中,第一计算单元1004,还配置为根据零游程值与第一预设值进行减法运算,得到第一数值;以及将第二数值设置为等于第一数值除以2的商;以及根据第二数值与第二预设值进行减法运算,确定第二数值标识信息的取值。In some embodiments, the first calculation unit 1004 is also configured to perform a subtraction operation on the zero-run value and the first preset value to obtain a first numerical value; and set the second numerical value to be equal to the quotient of the first numerical value divided by 2; and perform a subtraction operation on the second numerical value and the second preset value to determine the value of the second numerical identification information.
在一些实施例中,编码单元1002,还配置为对第二数值标识信息的取值进行二值化处理,得到至少一个二值符号;以及基于旁路模型对至少一个二值符号依次进行编码处理,将所得到的编码比特写入码流。In some embodiments, the encoding unit 1002 is further configured to binarize the value of the second numerical identification information to obtain at least one binary symbol; and encode the at least one binary symbol in sequence based on the bypass model, and write the obtained coded bits into the bit stream.
在一些实施例中,第一确定单元1001,还配置为若零游程值等于0,则确定第一语法元素标识信息的取值为第一值;若零游程值不等于0,则确定第一语法元素标识信息的取值为第二值。In some embodiments, the first determination unit 1001 is further configured to determine that the value of the first syntax element identification information is the first value if the zero run value is equal to 0; if the zero run value is not equal to 0, determine that the value of the first syntax element identification information is the second value.
在一些实施例中,第一确定单元1001,还配置为若零游程值等于1,则确定第二语法元素标识信息的取值为第一值;若零游程值不等于1,则确定第二语法元素标识信息的取值为第二值。In some embodiments, the first determination unit 1001 is further configured to determine that the value of the second syntax element identification information is the first value if the zero run value is equal to 1; if the zero run value is not equal to 1, determine that the value of the second syntax element identification information is the second value.
在一些实施例中,第一确定单元1001,还配置为若零游程值等于2,则确定第三语法元素标识信息的取值为第一值;若零游程值不等于2,则确定第三语法元素标识信息的取值为第二值。In some embodiments, the first determination unit 1001 is further configured to determine that the value of the third syntax element identification information is the first value if the zero run value is equal to 2; if the zero run value is not equal to 2, determine that the value of the third syntax element identification information is the second value.
在一些实施例中,第一确定单元1001,还配置为若第一数值为奇数,则确定第四语法元素标识信息的取值为第一值;若第一数值为偶数,则确定第四语法元素标识信息的取值为第二值;或者,若第一数值除以2的余数为1,则确定第四语法元素标识信息的取值为第一值;若第一数值除以2的余数为0,则确定第四语法元素标识信息的取值为第二值。In some embodiments, the first determination unit 1001 is further configured to determine that the value of the fourth grammatical element identification information is the first value if the first numerical value is an odd number; determine that the value of the fourth grammatical element identification information is the second value if the first numerical value is an even number; or, if the remainder when the first numerical value is divided by 2 is 1, determine that the value of the fourth grammatical element identification information is the first value; if the remainder when the first numerical value is divided by 2 is 0, determine that the value of the fourth grammatical element identification information is the second value.
在一些实施例中,第一确定单元1001,还配置为若第二数值等于0,则确定第五语法元素标识信息的取值为第一值;若第二数值不等于0,则确定第五语法元素标识信息的取值为第二值。In some embodiments, the first determination unit 1001 is further configured to determine that the value of the fifth grammatical element identification information is the first value if the second numerical value is equal to 0; if the second numerical value is not equal to 0, determine that the value of the fifth grammatical element identification information is the second value.
在一些实施例中,第一确定单元1001,还配置为若第二数值等于1,则确定第六语法元素标识信息的取值为第一值;若第二数值不等于1,则确定第六语法元素标识信息的取值为第二值。In some embodiments, the first determination unit 1001 is further configured to determine that the value of the sixth grammatical element identification information is the first value if the second numerical value is equal to 1; if the second numerical value is not equal to 1, determine that the value of the sixth grammatical element identification information is the second value.
在一些实施例中,第一确定单元1001,还配置为若第二数值等于2,则确定第七语法元素标识信息的取值为第一值;若第二数值不等于2,则确定第七语法元素标识信息的取值为第二值。In some embodiments, the first determination unit 1001 is further configured to determine that the value of the seventh grammatical element identification information is the first value if the second numerical value is equal to 2; if the second numerical value is not equal to 2, determine that the value of the seventh grammatical element identification information is the second value.
在一些实施例中,第一确定单元1001,还配置为若第二数值等于3,则确定第八语法元素标识信息的取值为第一值;若第二数值不等于3,则确定第八语法元素标识信息的取值为第二值。In some embodiments, the first determination unit 1001 is further configured to determine that the value of the eighth grammatical element identification information is the first value if the second numerical value is equal to 3; if the second numerical value is not equal to 3, determine that the value of the eighth grammatical element identification information is the second value.
可以理解地,在本申请实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。It is understandable that in the embodiments of the present application, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., and of course, it may be a module, or it may be non-modular. Moreover, the components in the present embodiment may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional module.
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.
因此,本申请实施例提供了一种计算机可读存储介质,应用于编码器100,该计算机可读存储介质存储有计算机程序,所述计算机程序被第一处理器执行时实现前述实施例中任一项所述的编码方法。Therefore, an embodiment of the present application provides a computer-readable storage medium, which is applied to the encoder 100. The computer-readable storage medium stores a computer program. When the computer program is executed by the first processor, it implements the encoding method described in any one of the aforementioned embodiments.
基于上述编码器100的组成以及计算机可读存储介质,参见图11,其示出了本申请实施例提供的编码器100的具体硬件结构示意图。如图11所示,编码器100可以包括:第一通信接口1101、第一存储器1102和第一处理器1103;各个组件通过第一总线系统1104耦合在一起。可理解,第一总线系统1104用于实现这些组件之间的连接通信。第一总线系统1104除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图11中将各种总线都标为第一总线系统1104。其中,Based on the composition of the above-mentioned encoder 100 and the computer-readable storage medium, refer to Figure 11, which shows a specific hardware structure diagram of the encoder 100 provided in an embodiment of the present application. As shown in Figure 11, the encoder 100 may include: a first communication interface 1101, a first memory 1102 and a first processor 1103; each component is coupled together through a first bus system 1104. It can be understood that the first bus system 1104 is used to realize the connection and communication between these components. In addition to the data bus, the first bus system 1104 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are marked as the first bus system 1104 in Figure 11. Among them,
第一通信接口1101,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;The first communication interface 1101 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
第一存储器1102,用于存储能够在第一处理器1103上运行的计算机程序;A first memory 1102, used to store a computer program that can be run on the first processor 1103;
第一处理器1103,用于在运行所述计算机程序时,执行:The first processor 1103 is configured to, when running the computer program, execute:
确定零游程值以及零游程值对应的预置参数;Determine a zero-run value and a preset parameter corresponding to the zero-run value;
根据零游程值,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值;Determine, according to the zero-run value, a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information;
若预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息的取值进行基于上下文模型 的编码处理,以及对至少一个第二类语法元素标识信息的取值进行基于旁路模型的编码处理,将所得到的编码比特写入码流。If the preset parameters meet the first preset condition, a context model-based encoding process is performed on a value of at least one first-category syntax element identification information, and a bypass model-based encoding process is performed on a value of at least one second-category syntax element identification information, and the obtained coded bits are written into a bitstream.
可以理解,本申请实施例中的第一存储器1102可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请描述的系统和方法的第一存储器1102旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the first memory 1102 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can 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 can 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 RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DRRAM). The first memory 1102 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
而第一处理器1103可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过第一处理器1103中的硬件的集成逻辑电路或者软件形式的指令完成。上述的第一处理器1103可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于第一存储器1102,第一处理器1103读取第一存储器1102中的信息,结合其硬件完成上述方法的步骤。The first processor 1103 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the first processor 1103. The above-mentioned first processor 1103 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the first memory 1102, and the first processor 1103 reads the information in the first memory 1102 and completes the steps of the above method in combination with its hardware.
可以理解的是,本申请描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。对于软件实现,可通过执行本申请所述功能的模块(例如过程、函数等)来实现本申请所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。It is understood that the embodiments described in this application can be implemented in hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processors (Digital Signal Processing, DSP), digital signal processing devices (DSP Device, DSPD), programmable logic devices (Programmable Logic Device, PLD), field programmable gate arrays (Field-Programmable Gate Array, FPGA), general processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application or a combination thereof. For software implementation, the technology described in this application can be implemented by a module (such as a process, function, etc.) that performs the functions described in this application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
可选地,作为另一个实施例,第一处理器1103还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的方法。Optionally, as another embodiment, the first processor 1103 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.
本实施例提供了一种编码器,在该编码器中,在确定出零游程值对应的预置参数之后,可以限定在编码时使用的基于上下文模型的码字数量,使得部分语法元素标识信息采用旁路模型进行编码处理,从而可以提高硬件吞吐率,降低了硬件实现的难度;而且还能够提升处理速度。The present embodiment provides an encoder in which, after determining the preset parameters corresponding to the zero-run value, the number of codewords based on the context model used in encoding can be limited, so that part of the syntax element identification information is encoded using a bypass model, thereby improving the hardware throughput and reducing the difficulty of hardware implementation; and also improving the processing speed.
在本申请的再一实施例中,基于前述实施例相同的发明构思,参见图12,其示出了本申请实施例提供的一种解码器的组成结构示意图。如图12所示,该解码器120可以包括:第二确定单元2201和第二预测单元2202;其中,In another embodiment of the present application, based on the same inventive concept as the above-mentioned embodiment, see FIG12, which shows a schematic diagram of the composition structure of a decoder provided by the embodiment of the present application. As shown in FIG12, the decoder 120 may include: a second determination unit 2201 and a second prediction unit 2202; wherein,
第二确定单元1201,配置为确定零游程值对应的预置参数;The second determining unit 1201 is configured to determine a preset parameter corresponding to a zero-run value;
解码单元1202,配置为若预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息进行基于上下文模型的解码处理,以及对至少一个第二类语法元素标识信息进行基于旁路模型的解码处理,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值;The decoding unit 1202 is configured to, if the preset parameter meets the first preset condition, perform a context model-based decoding process on at least one first-category syntax element identification information, and perform a bypass model-based decoding process on at least one second-category syntax element identification information, and determine a value of the at least one first-category syntax element identification information and a value of the at least one second-category syntax element identification information;
第二确定单元1201,还配置为根据至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值,确定零游程值。The second determining unit 1201 is further configured to determine a zero run value according to a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information.
在一些实施例中,参见图12,解码器120还包括第二判断单元1203,配置为确定预置参数的取值大于或等于预设门限值。In some embodiments, referring to FIG. 12 , the decoder 120 further includes a second determination unit 1203 configured to determine whether the value of the preset parameter is greater than or equal to a preset threshold value.
在一些实施例中,解码单元1202,还配置为若预置参数符合第二预设条件,则对至少一个第一类语法元素标识信息和至少一个第二类语法元素标识信息均进行基于旁路模型的解码处理,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值。In some embodiments, the decoding unit 1202 is further configured to perform bypass model-based decoding processing on at least one first-category syntax element identification information and at least one second-category syntax element identification information if the preset parameters meet the second preset condition, and determine the value of at least one first-category syntax element identification information and the value of at least one second-category syntax element identification information.
在一些实施例中,第二判断单元1203,还配置为确定预置参数的取值小于预设门限值。In some embodiments, the second determination unit 1203 is further configured to determine whether the value of the preset parameter is less than a preset threshold value.
在一些实施例中,解码单元1202,还配置为解码码流,确定零游程值对应的预置参数。In some embodiments, the decoding unit 1202 is further configured to decode the code stream and determine a preset parameter corresponding to the zero run value.
在一些实施例中,第二确定单元1201,还配置为若零游程值大于0,则确定当前节点的属性量化残 差值等于0;以及对零游程值执行减1操作,以根据新的零游程值确定下一节点的属性量化残差值;若零游程值等于0,则解码码流,确定当前节点的属性量化残差值;以及继续执行对零游程值进行解码处理的步骤,以根据新的零游程值确定下一节点的属性量化残差值。In some embodiments, the second determination unit 1201 is further configured to determine that the attribute quantization residual value of the current node is equal to 0 if the zero-run value is greater than 0; and perform a subtraction operation on the zero-run value to determine the attribute quantization residual value of the next node according to the new zero-run value; if the zero-run value is equal to 0, decode the code stream to determine the attribute quantization residual value of the current node; and continue to perform the step of decoding the zero-run value to determine the attribute quantization residual value of the next node according to the new zero-run value.
在一些实施例中,零游程值用于指示属性量化残差值是否均为0的计数;其中,属性量化残差值包括下述其中之一:颜色分量量化残差值和反射率量化残差值。In some embodiments, the zero-run value is used to indicate whether the attribute quantization residual values are all 0 counts; wherein the attribute quantization residual value includes one of the following: a color component quantization residual value and a reflectance quantization residual value.
在一些实施例中,解码单元1202,还配置为在零游程值小于预设阈值时,若预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息进行基于上下文模型的解码处理,确定至少一个第一类语法元素标识信息的取值;以及根据至少一个第一类语法元素标识信息的取值,确定零游程值;或者,若预置参数符合第二预设条件,则对至少一个第一类语法元素标识信息进行基于旁路模型的解码处理,确定至少一个第一类语法元素标识信息的取值;以及根据至少一个第一类语法元素标识信息的取值,确定零游程值。In some embodiments, the decoding unit 1202 is further configured to, when the zero-run value is less than a preset threshold, if the preset parameters meet the first preset condition, perform context-based decoding processing on at least one first-category syntax element identification information to determine the value of at least one first-category syntax element identification information; and determine the zero-run value based on the value of at least one first-category syntax element identification information; or, if the preset parameters meet the second preset condition, perform bypass-model-based decoding processing on at least one first-category syntax element identification information to determine the value of at least one first-category syntax element identification information; and determine the zero-run value based on the value of at least one first-category syntax element identification information.
在一些实施例中,至少一个第一类语法元素标识信息包括下述至少一项:第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息和第四语法元素标识信息;至少一个第二类语法元素标识信息至少包括:第一数值标识信息;其中,第一语法元素标识信息用于指示零游程值是否等于0,第二语法元素标识信息用于指示零游程值是否等于1,第三语法元素标识信息用于指示零游程值是否等于2,第四语法元素标识信息用于指示零游程值进行第一运算后得到的第一数值的奇偶特性,第一数值标识信息用于指示零游程值进行第二运算后得到的第二数值。In some embodiments, at least one first-category syntax element identification information includes at least one of the following: first syntax element identification information, second syntax element identification information, third syntax element identification information and fourth syntax element identification information; at least one second-category syntax element identification information includes at least: first numerical identification information; wherein the first syntax element identification information is used to indicate whether the zero-run value is equal to 0, the second syntax element identification information is used to indicate whether the zero-run value is equal to 1, the third syntax element identification information is used to indicate whether the zero-run value is equal to 2, the fourth syntax element identification information is used to indicate the parity characteristic of a first numerical value obtained after a first operation on the zero-run value, and the first numerical identification information is used to indicate a second numerical value obtained after a second operation on the zero-run value.
在一些实施例中,参见图12,解码器120还包括第二计算单元1204,配置为根据零游程值与第一预设值进行减法运算,得到第一数值。In some embodiments, referring to FIG. 12 , the decoder 120 further includes a second calculation unit 1204 configured to perform a subtraction operation on the zero-run value and the first preset value to obtain a first value.
在一些实施例中,第二计算单元1204,还配置为根据零游程值与第一预设值进行减法运算,得到第一数值;以及将第二数值设置为等于第一数值除以2的商。In some embodiments, the second calculation unit 1204 is further configured to perform a subtraction operation on the zero-run value and the first preset value to obtain a first value; and set the second value to be equal to the quotient of the first value divided by 2.
在一些实施例中,第二计算单元1204,还配置为对第一数值进行右移一位处理,得到第二数值。In some embodiments, the second calculation unit 1204 is further configured to right-shift the first value by one bit to obtain a second value.
在一些实施例中,解码单元1202,还配置为基于上下文模型对第一语法元素标识信息进行解码处理,确定第一语法元素标识信息的取值;若第一语法元素标识信息的取值为第一值,则确定零游程值等于0;若第一语法元素标识信息的取值为第二值,则基于上下文模型对第二语法元素标识信息进行解码处理,确定第二语法元素标识信息的取值;若第二语法元素标识信息的取值为第一值,则确定零游程值等于1;若第二语法元素标识信息的取值为第二值,则基于上下文模型对第三语法元素标识信息进行解码处理,确定第三语法元素标识信息的取值;若第三语法元素标识信息的取值为第一值,则确定零游程值等于2;若第三语法元素标识信息的取值为第二值,则基于上下文模型对第四语法元素标识信息进行解码处理,确定第四语法元素标识信息的取值;以及基于旁路模型对第一数值标识信息进行解码处理,确定第一数值标识信息的取值;In some embodiments, the decoding unit 1202 is further configured to decode the first syntax element identification information based on the context model to determine the value of the first syntax element identification information; if the value of the first syntax element identification information is the first value, determine that the zero run value is equal to 0; if the value of the first syntax element identification information is the second value, decode the second syntax element identification information based on the context model to determine the value of the second syntax element identification information; if the value of the second syntax element identification information is the first value, determine that the zero run value is equal to 1; if the value of the second syntax element identification information is the second value, decode the third syntax element identification information based on the context model to determine the value of the third syntax element identification information; if the value of the third syntax element identification information is the first value, determine that the zero run value is equal to 2; if the value of the third syntax element identification information is the second value, decode the fourth syntax element identification information based on the context model to determine the value of the fourth syntax element identification information; and decode the first numerical identification information based on the bypass model to determine the value of the first numerical identification information;
第二确定单元1201,还配置为根据第一预设值、第四语法元素标识信息的取值和第一数值标识信息的取值,确定零游程值。The second determining unit 1201 is further configured to determine the zero run value according to the first preset value, the value of the fourth syntax element identification information and the value of the first numerical identification information.
在一些实施例中,解码单元1202,还配置为在每一次基于上下文模型对以下的语法元素标识信息解码完成后,对预置参数的取值执行一次减1操作:第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息和第四语法元素标识信息。In some embodiments, the decoding unit 1202 is also configured to perform a subtraction operation on the value of the preset parameter after each decoding of the following syntax element identification information based on the context model is completed: the first syntax element identification information, the second syntax element identification information, the third syntax element identification information and the fourth syntax element identification information.
在一些实施例中,解码单元1202,还配置为在预置参数符合第二预设条件时,基于旁路模型对第一语法元素标识信息进行解码处理,确定第一语法元素标识信息的取值;若第一语法元素标识信息的取值为第一值,则确定零游程值等于0;若第一语法元素标识信息的取值为第二值,则基于旁路模型对第二语法元素标识信息进行解码处理,确定第二语法元素标识信息的取值;若第二语法元素标识信息的取值为第一值,则确定零游程值等于1;若第二语法元素标识信息的取值为第二值,则基于旁路模型对第三语法元素标识信息进行解码处理,确定第三语法元素标识信息的取值;若第三语法元素标识信息的取值为第一值,则确定零游程值等于2;若第三语法元素标识信息的取值为第二值,则基于旁路模型对第四语法元素标识信息进行解码处理,确定第四语法元素标识信息的取值;以及基于旁路模型对第一数值标识信息进行解码处理,确定第一数值标识信息的取值;In some embodiments, the decoding unit 1202 is further configured to, when the preset parameter meets the second preset condition, decode the first syntax element identification information based on the bypass model to determine the value of the first syntax element identification information; if the value of the first syntax element identification information is the first value, determine that the zero run value is equal to 0; if the value of the first syntax element identification information is the second value, decode the second syntax element identification information based on the bypass model to determine the value of the second syntax element identification information; if the value of the second syntax element identification information is the first value, determine that the zero run value is equal to 1; if the value of the second syntax element identification information is the second value, decode the third syntax element identification information based on the bypass model to determine the value of the third syntax element identification information; if the value of the third syntax element identification information is the first value, determine that the zero run value is equal to 2; if the value of the third syntax element identification information is the second value, decode the fourth syntax element identification information based on the bypass model to determine the value of the fourth syntax element identification information; and decode the first numerical identification information based on the bypass model to determine the value of the first numerical identification information;
第二确定单元1201,还配置为根据第一预设值、第四语法元素标识信息的取值和第一数值标识信息的取值,确定零游程值。The second determining unit 1201 is further configured to determine the zero run value according to the first preset value, the value of the fourth syntax element identification information and the value of the first numerical identification information.
在一些实施例中,解码单元1202,还配置为基于旁路模型对第一数值标识信息进行解码处理,确定第一数值标识信息对应的至少一个二值符号;以及对至少一个二值符号进行反二值化处理,得到第一数值标识信息的取值。In some embodiments, the decoding unit 1202 is further configured to decode the first numerical identification information based on a bypass model to determine at least one binary symbol corresponding to the first numerical identification information; and to debinarize at least one binary symbol to obtain the value of the first numerical identification information.
在一些实施例中,第二计算单元1204,还配置为对第一数值标识信息的取值进行第三运算,得到第三数值;以及根据第一预设值、第三数值和第四语法元素标识信息的取值,确定零游程值。In some embodiments, the second calculation unit 1204 is further configured to perform a third operation on the value of the first numerical identification information to obtain a third numerical value; and determine the zero run value based on the first preset value, the third numerical value and the value of the fourth syntax element identification information.
在一些实施例中,第二计算单元1204,还配置为对第一数值标识信息的取值与2进行乘法运算,得到第三数值;或者,对第一数值标识信息的取值进行左移一位运算,得到第三数值。In some embodiments, the second calculation unit 1204 is further configured to multiply the value of the first numerical identification information by 2 to obtain a third numerical value; or to left-shift the value of the first numerical identification information by one bit to obtain the third numerical value.
在一些实施例中,第二计算单元1204,还配置为对第一预设值、第三数值和第四语法元素标识信息的取值进行加法运算,得到零游程值。In some embodiments, the second calculation unit 1204 is further configured to perform an addition operation on the first preset value, the third numerical value and the value of the fourth syntax element identification information to obtain a zero run value.
在一些实施例中,至少一个第一类语法元素标识信息包括下述至少一项:第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息、第五语法元素标识信息、第六语法元素标识信息、第七语法元素标识信息和第八语法元素标识信息;至少一个第二类语法元素标识信息至少包括:第二数值标识信息;其中,第一语法元素标识信息用于指示零游程值是否等于0,第二语法元素标识信息用于指示零游程值是否等于1,第三语法元素标识信息用于指示零游程值是否等于2,第四语法元素标识信息用于指示零游程值进行第一运算后得到的第一数值的奇偶特性,第五语法元素标识信息用于指示零游程值进行第二运算后得到的第二数值是否等于0,第六语法元素标识信息用于指示零游程值进行第二运算后得到的第二数值是否等于1,第七语法元素标识信息用于指示零游程值进行第二运算后得到的第二数值是否等于2,第八语法元素标识信息用于指示零游程值进行第二运算后得到的第二数值是否等于3,第二数值标识信息用于指示零游程值进行第四运算后得到的第四数值。In some embodiments, at least one first-category syntax element identification information includes at least one of the following: first syntax element identification information, second syntax element identification information, third syntax element identification information, fourth syntax element identification information, fifth syntax element identification information, sixth syntax element identification information, seventh syntax element identification information, and eighth syntax element identification information; at least one second-category syntax element identification information includes at least: second numerical identification information; wherein the first syntax element identification information is used to indicate whether the zero run value is equal to 0, the second syntax element identification information is used to indicate whether the zero run value is equal to 1, and the third syntax element identification information is used to indicate whether the zero run value is equal to 2, the fourth syntax element identification information is used to indicate the parity characteristic of the first numerical value obtained after the zero-run value is subjected to the first operation, the fifth syntax element identification information is used to indicate whether the second numerical value obtained after the zero-run value is subjected to the second operation is equal to 0, the sixth syntax element identification information is used to indicate whether the second numerical value obtained after the zero-run value is subjected to the second operation is equal to 1, the seventh syntax element identification information is used to indicate whether the second numerical value obtained after the zero-run value is subjected to the second operation is equal to 2, the eighth syntax element identification information is used to indicate whether the second numerical value obtained after the zero-run value is subjected to the second operation is equal to 3, and the second numerical value identification information is used to indicate the fourth numerical value obtained after the zero-run value is subjected to the fourth operation.
在一些实施例中,第二计算单元1204,还配置为根据零游程值与第一预设值进行减法运算,得到第一数值;以及将第二数值设置为等于第一数值除以2的商;以及根据第二数值与第二预设值进行减法运算,得到第四数值。In some embodiments, the second calculation unit 1204 is further configured to perform a subtraction operation on the zero-run value and the first preset value to obtain a first value; and set the second value to be equal to the quotient of the first value divided by 2; and perform a subtraction operation on the second value and the second preset value to obtain a fourth value.
在一些实施例中,解码单元1202,还配置为基于上下文模型对第一语法元素标识信息进行解码处理,确定第一语法元素标识信息的取值;若第一语法元素标识信息的取值为第一值,则确定零游程值等于0;若第一语法元素标识信息的取值为第二值,则基于上下文模型对第二语法元素标识信息进行解码处理,确定第二语法元素标识信息的取值;若第二语法元素标识信息的取值为第一值,则确定零游程值等于1;若第二语法元素标识信息的取值为第二值,则基于上下文模型对第三语法元素标识信息进行解码处理,确定第三语法元素标识信息的取值;若第三语法元素标识信息的取值为第一值,则确定零游程值等于2;若第三语法元素标识信息的取值为第二值,则基于上下文模型对第四语法元素标识信息进行解码处理,确定第四语法元素标识信息的取值;以及基于上下文模型对第五语法元素标识信息进行解码处理,确定第五语法元素标识信息的取值;若第五语法元素标识信息的取值为第一值,则确定零游程值等于第一预设值和第四语法元素标识信息的取值之和;若第五语法元素标识信息的取值为第二值,则基于上下文模型对第六语法元素标识信息进行解码处理,确定第六语法元素标识信息的取值;若第六语法元素标识信息的取值为第一值,则确定零游程值等于第一常数、第一预设值和第四语法元素标识信息的取值之和;若第六语法元素标识信息的取值为第二值,则基于上下文模型对第七语法元素标识信息进行解码处理,确定第七语法元素标识信息的取值;若第七语法元素标识信息的取值为第一值,则确定零游程值等于第二常数、第一预设值和第四语法元素标识信息的取值之和;若第七语法元素标识信息的取值为第二值,则基于上下文模型对第八语法元素标识信息进行解码处理,确定第八语法元素标识信息的取值;若第八语法元素标识信息的取值为第一值,则确定零游程值等于第三常数、第一预设值和第四语法元素标识信息的取值之和;若第八语法元素标识信息的取值为第二值,则基于旁路模型对第二数值标识信息进行解码处理,确定第二数值标识信息的取值;In some embodiments, the decoding unit 1202 is further configured to decode the first syntax element identification information based on the context model to determine the value of the first syntax element identification information; if the value of the first syntax element identification information is a first value, determine that the zero run value is equal to 0; if the value of the first syntax element identification information is a second value, decode the second syntax element identification information based on the context model to determine the value of the second syntax element identification information; if the value of the second syntax element identification information is a first value, determine that the zero run value is equal to 1; if the value of the second syntax element identification information is a second value, decode the third syntax element identification information based on the context model to determine the value of the third syntax element identification information; if the value of the third syntax element identification information is a first value, determine that the zero run value is equal to 2; if the value of the third syntax element identification information is a second value, decode the fourth syntax element identification information based on the context model to determine the value of the fourth syntax element identification information; and decode the fifth syntax element identification information based on the context model to determine the value of the fifth syntax element identification information; if the value of the fifth syntax element identification information is a first value, determine that the zero run value is equal to the first preset value and the fourth syntax element identification information. the sum of the values of the element identification information; if the value of the fifth grammatical element identification information is the second value, the sixth grammatical element identification information is decoded based on the context model to determine the value of the sixth grammatical element identification information; if the value of the sixth grammatical element identification information is the first value, it is determined that the zero run value is equal to the sum of the first constant, the first preset value and the value of the fourth grammatical element identification information; if the value of the sixth grammatical element identification information is the second value, the seventh grammatical element identification information is decoded based on the context model to determine the value of the seventh grammatical element identification information; if the value of the seventh grammatical element identification information is the first value, it is determined that the zero run value is equal to the sum of the second constant, the first preset value and the value of the fourth grammatical element identification information; if the value of the seventh grammatical element identification information is the second value, the eighth grammatical element identification information is decoded based on the context model to determine the value of the eighth grammatical element identification information; if the value of the eighth grammatical element identification information is the first value, it is determined that the zero run value is equal to the sum of the third constant, the first preset value and the value of the fourth grammatical element identification information; if the value of the eighth grammatical element identification information is the second value, the second numerical identification information is decoded based on the bypass model to determine the value of the second numerical identification information;
第二确定单元1201,还配置为根据第一预设值、第四语法元素标识信息的取值和第二数值标识信息的取值,确定零游程值。The second determining unit 1201 is further configured to determine the zero run value according to the first preset value, the value of the fourth syntax element identification information and the value of the second numerical identification information.
在一些实施例中,解码单元1202,还配置为在每一次基于上下文模型对以下的语法元素标识信息解码完成后,对预置参数的取值执行一次减1操作:第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息、第五语法元素标识信息、第六语法元素标识信息、第七语法元素标识信息和第八语法元素标识信息。In some embodiments, the decoding unit 1202 is further configured to perform a subtraction operation on the value of the preset parameter after each decoding of the following syntax element identification information is completed based on the context model: the first syntax element identification information, the second syntax element identification information, the third syntax element identification information, the fourth syntax element identification information, the fifth syntax element identification information, the sixth syntax element identification information, the seventh syntax element identification information and the eighth syntax element identification information.
在一些实施例中,解码单元1202,还配置为在预置参数符合第二预设条件时,基于旁路模型对第一语法元素标识信息进行解码处理,确定第一语法元素标识信息的取值;若第一语法元素标识信息的取值为第一值,则确定零游程值等于0;若第一语法元素标识信息的取值为第二值,则基于旁路模型对第二语法元素标识信息进行解码处理,确定第二语法元素标识信息的取值;若第二语法元素标识信息的取值为第一值,则确定零游程值等于1;若第二语法元素标识信息的取值为第二值,则基于旁路模型对第三语法元素标识信息进行解码处理,确定第三语法元素标识信息的取值;若第三语法元素标识信息的取值为第一值,则确定零游程值等于2;若第三语法元素标识信息的取值为第二值,则基于旁路模型对第四语法元素标识信息进行解码处理,确定第四语法元素标识信息的取值;以及基于旁路模型对第五语法元素标识信息进行解码处理,确定第五语法元素标识信息的取值;若第五语法元素标识信息的取值为第一值,则确定零游程值等于第一预设值和第四语法元素标识信息的取值之和;若第五语法元素标识信息 的取值为第二值,则基于旁路模型对第六语法元素标识信息进行解码处理,确定第六语法元素标识信息的取值;若第六语法元素标识信息的取值为第一值,则确定零游程值等于第一常数、第一预设值和第四语法元素标识信息的取值之和;若第六语法元素标识信息的取值为第二值,则基于旁路模型对第七语法元素标识信息进行解码处理,确定第七语法元素标识信息的取值;若第七语法元素标识信息的取值为第一值,则确定零游程值等于第二常数、第一预设值和第四语法元素标识信息的取值之和;若第七语法元素标识信息的取值为第二值,则基于旁路模型对第八语法元素标识信息进行解码处理,确定第八语法元素标识信息的取值;若第八语法元素标识信息的取值为第一值,则确定零游程值等于第三常数、第一预设值和第四语法元素标识信息的取值之和;若第八语法元素标识信息的取值为第二值,则基于旁路模型对第二数值标识信息进行解码处理,确定第二数值标识信息的取值;In some embodiments, the decoding unit 1202 is further configured to, when the preset parameter meets the second preset condition, decode the first syntax element identification information based on the bypass model to determine the value of the first syntax element identification information; if the value of the first syntax element identification information is the first value, determine that the zero run value is equal to 0; if the value of the first syntax element identification information is the second value, decode the second syntax element identification information based on the bypass model to determine the value of the second syntax element identification information; if the value of the second syntax element identification information is the first value, determine that the zero run value is equal to 1; if the value of the second syntax element identification information is the second value, decode the second syntax element identification information based on the bypass model to determine the value of the second syntax element identification information. The method further comprises: performing decoding processing on the third grammatical element identification information to determine the value of the third grammatical element identification information; if the value of the third grammatical element identification information is the first value, determining that the zero-run value is equal to 2; if the value of the third grammatical element identification information is the second value, performing decoding processing on the fourth grammatical element identification information based on the bypass model to determine the value of the fourth grammatical element identification information; and performing decoding processing on the fifth grammatical element identification information based on the bypass model to determine the value of the fifth grammatical element identification information; if the value of the fifth grammatical element identification information is the first value, determining that the zero-run value is equal to the sum of the first preset value and the value of the fourth grammatical element identification information; if the fifth grammatical element identification information is the first value, determining that the zero-run value is equal to the sum of the first preset value and the value of the fourth grammatical element identification information; if the value of is the second value, the sixth grammatical element identification information is decoded based on the bypass model to determine the value of the sixth grammatical element identification information; if the value of the sixth grammatical element identification information is the first value, it is determined that the zero run value is equal to the sum of the first constant, the first preset value and the value of the fourth grammatical element identification information; if the value of the sixth grammatical element identification information is the second value, the seventh grammatical element identification information is decoded based on the bypass model to determine the value of the seventh grammatical element identification information; if the value of the seventh grammatical element identification information is the first value, it is determined that the zero run value is equal to the sum of the second constant, the first preset value and the value of the fourth grammatical element identification information; if the value of the seventh grammatical element identification information is the second value, the eighth grammatical element identification information is decoded based on the bypass model to determine the value of the eighth grammatical element identification information; if the value of the eighth grammatical element identification information is the first value, it is determined that the zero run value is equal to the sum of the third constant, the first preset value and the value of the fourth grammatical element identification information; if the value of the eighth grammatical element identification information is the second value, the second numerical identification information is decoded based on the bypass model to determine the value of the second numerical identification information;
第二确定单元1201,还配置为根据第一预设值、第四语法元素标识信息的取值和第二数值标识信息的取值,确定零游程值。The second determining unit 1201 is further configured to determine the zero run value according to the first preset value, the value of the fourth syntax element identification information and the value of the second numerical identification information.
在一些实施例中,第一常数、第二常数和第三常数均为2的倍数。In some embodiments, the first constant, the second constant, and the third constant are all multiples of 2.
在一些实施例中,第二计算单元1204,还配置为根据第二数值标识信息的取值和第二预设值,确定第二运算结果;以及对第二运算结果进行第四运算,得到第三运算结果;以及根据第一预设值、第三运算结果和第四语法元素标识信息的取值,确定零游程值。In some embodiments, the second calculation unit 1204 is also configured to determine a second operation result based on the value of the second numerical identification information and the second preset value; and perform a fourth operation on the second operation result to obtain a third operation result; and determine the zero run value based on the first preset value, the third operation result and the value of the fourth syntax element identification information.
在一些实施例中,第二计算单元1204,还配置为对第二运算结果与2进行乘法运算,得到第三运算结果;或者,对第二运算结果进行左移一位运算,得到第三运算结果。In some embodiments, the second calculation unit 1204 is further configured to perform a multiplication operation on the second operation result and 2 to obtain a third operation result; or to perform a left shift operation on the second operation result by one bit to obtain a third operation result.
在一些实施例中,第二计算单元1204,还配置为对第一预设值、第三运算结果和第四语法元素标识信息的取值进行加法运算,得到零游程值。In some embodiments, the second calculation unit 1204 is further configured to perform an addition operation on the first preset value, the third operation result and the value of the fourth syntax element identification information to obtain a zero run value.
可以理解地,在本实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。It can be understood that in this embodiment, a "unit" can be a part of a circuit, a part of a processor, a part of a program or software, etc., and of course it can also be a module, or it can be non-modular. Moreover, the components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional module.
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本实施例提供了一种计算机可读存储介质,应用于解码器120,该计算机可读存储介质存储有计算机程序,所述计算机程序被第二处理器执行时实现前述实施例中任一项所述的解码方法。If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer-readable storage medium, which is applied to the decoder 120. The computer-readable storage medium stores a computer program. When the computer program is executed by the second processor, it implements any decoding method in the above embodiments.
基于上述解码器120的组成以及计算机可读存储介质,参见图13,其示出了本申请实施例提供的解码器120的具体硬件结构示意图。如图13所示,解码器120可以包括:第二通信接口1301、第二存储器1302和第二处理器1303;各个组件通过第二总线系统1304耦合在一起。可理解,第二总线系统1304用于实现这些组件之间的连接通信。第二总线系统1304除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图13中将各种总线都标为第二总线系统1304。其中,Based on the composition of the above-mentioned decoder 120 and the computer-readable storage medium, refer to Figure 13, which shows a specific hardware structure diagram of the decoder 120 provided in an embodiment of the present application. As shown in Figure 13, the decoder 120 may include: a second communication interface 1301, a second memory 1302 and a second processor 1303; each component is coupled together through a second bus system 1304. It can be understood that the second bus system 1304 is used to realize the connection and communication between these components. In addition to the data bus, the second bus system 1304 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are marked as the second bus system 1304 in Figure 13. Among them,
第二通信接口1301,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;The second communication interface 1301 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
第二存储器1302,用于存储能够在第二处理器1303上运行的计算机程序;The second memory 1302 is used to store a computer program that can be run on the second processor 1303;
第二处理器1303,用于在运行所述计算机程序时,执行:The second processor 1303 is configured to, when running the computer program, execute:
确定零游程值对应的预置参数;Determine the preset parameters corresponding to the zero run value;
若预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息进行基于上下文模型的解码处理,以及对至少一个第二类语法元素标识信息进行基于旁路模型的解码处理,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值;If the preset parameter meets the first preset condition, performing a context model-based decoding process on at least one first-category syntax element identification information, and performing a bypass model-based decoding process on at least one second-category syntax element identification information, to determine a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information;
根据至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值,确定零游程值。A zero run value is determined according to a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information.
可选地,作为另一个实施例,第二处理器1303还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的方法。Optionally, as another embodiment, the second processor 1303 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.
可以理解,第二存储器1302与第一存储器2102的硬件功能类似,第二处理器1303与第一处理器2103的硬件功能类似;这里不再详述。It can be understood that the hardware functions of the second memory 1302 and the first memory 2102 are similar, and the hardware functions of the second processor 1303 and the first processor 2103 are similar; they will not be described in detail here.
本实施例提供了一种解码器,在该解码器中,在确定出零游程值对应的预置参数之后,可以限定在解码时使用的基于上下文模型的码字数量,使得部分语法元素标识信息采用旁路模型进行解码处理,从而可以提高硬件吞吐率,降低了硬件实现的难度;而且还能够提升处理速度。The present embodiment provides a decoder in which, after determining the preset parameters corresponding to the zero-run value, the number of codewords based on the context model used in decoding can be limited, so that part of the syntax element identification information is decoded using a bypass model, thereby improving the hardware throughput and reducing the difficulty of hardware implementation; and also improving the processing speed.
在本申请的再一实施例中,参见图14,其示出了本申请实施例提供的一种编解码系统的组成结构示意图。如图14所示,编解码系统140可以包括编码器1401和解码器1402。其中,编码器1401可以为前述实施例中任一项所述的编码器,解码器1402可以为前述实施例中任一项所述的解码器。In another embodiment of the present application, referring to Figure 14, it shows a schematic diagram of the composition structure of a coding and decoding system provided in an embodiment of the present application. As shown in Figure 14, the coding and decoding system 140 may include an encoder 1401 and a decoder 1402. The encoder 1401 may be the encoder described in any one of the aforementioned embodiments, and the decoder 1402 may be the decoder described in any one of the aforementioned embodiments.
需要说明的是,在本申请中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, in this application, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
本申请所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
本申请所提供的几个产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
本申请所提供的几个方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
工业实用性Industrial Applicability
本申请实施例中,无论是编码端还是解码端,首先确定零游程值对应的预置参数,然后判断预置参数是否符合第一预设条件;如果预置参数符合第一预设条件,那么对至少一个第一类语法元素标识信息进行基于上下文模型的编解码处理,以及对至少一个第二类语法元素标识信息进行基于旁路模型的编解码处理;如此,根据所确定的预置参数,可以限定在编解码时使用的基于上下文模型的码字数量,使得部分语法元素标识信息采用旁路模型进行编解码处理,从而可以提高硬件吞吐率,降低了硬件实现的难度;而且还能够提升处理速度。In an embodiment of the present application, whether it is an encoding end or a decoding end, the preset parameters corresponding to the zero-run value are first determined, and then it is determined whether the preset parameters meet the first preset conditions; if the preset parameters meet the first preset conditions, then at least one first-category syntax element identification information is encoded and decoded based on the context model, and at least one second-category syntax element identification information is encoded and decoded based on the bypass model; in this way, according to the determined preset parameters, the number of codewords based on the context model used in encoding and decoding can be limited, so that part of the syntax element identification information is encoded and decoded using the bypass model, thereby improving the hardware throughput and reducing the difficulty of hardware implementation; and it can also improve the processing speed.

Claims (66)

  1. 一种解码方法,应用于解码器,所述方法包括:A decoding method, applied to a decoder, comprising:
    确定零游程值对应的预置参数;Determine the preset parameters corresponding to the zero run value;
    若所述预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息进行基于上下文模型的解码处理,以及对至少一个第二类语法元素标识信息进行基于旁路模型的解码处理,确定所述至少一个第一类语法元素标识信息的取值和所述至少一个第二类语法元素标识信息的取值;If the preset parameter meets the first preset condition, performing a context model-based decoding process on at least one first-category syntax element identification information, and performing a bypass model-based decoding process on at least one second-category syntax element identification information, to determine a value of the at least one first-category syntax element identification information and a value of the at least one second-category syntax element identification information;
    根据所述至少一个第一类语法元素标识信息的取值和所述至少一个第二类语法元素标识信息的取值,确定所述零游程值。The zero run value is determined according to a value of the at least one first-category syntax element identification information and a value of the at least one second-category syntax element identification information.
  2. 根据权利要求1所述的方法,其中,所述预置参数符合第一预设条件,包括:确定所述预置参数的取值大于或等于预设门限值。The method according to claim 1, wherein the preset parameter meets the first preset condition, comprising: determining that the value of the preset parameter is greater than or equal to a preset threshold value.
  3. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    若所述预置参数符合第二预设条件,则对所述至少一个第一类语法元素标识信息和所述至少一个第二类语法元素标识信息均进行基于旁路模型的解码处理,确定所述至少一个第一类语法元素标识信息的取值和所述至少一个第二类语法元素标识信息的取值。If the preset parameters meet the second preset condition, the at least one first-category syntax element identification information and the at least one second-category syntax element identification information are both decoded based on the bypass model to determine the value of the at least one first-category syntax element identification information and the value of the at least one second-category syntax element identification information.
  4. 根据权利要求3所述的方法,其中,所述预置参数符合第二预设条件,包括:确定所述预置参数的取值小于预设门限值。The method according to claim 3, wherein the preset parameter meets the second preset condition, comprising: determining that the value of the preset parameter is less than a preset threshold value.
  5. 根据权利要求1所述的方法,其中,所述确定零游程值对应的预置参数,包括:The method according to claim 1, wherein the determining the preset parameters corresponding to the zero run value comprises:
    解码码流,确定所述零游程值对应的预置参数。The code stream is decoded to determine the preset parameters corresponding to the zero-run value.
  6. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    若所述零游程值大于0,则确定当前节点的属性量化残差值等于0;以及对所述零游程值执行减1操作,以根据新的零游程值确定下一节点的属性量化残差值;If the zero-run value is greater than 0, determining that the attribute quantization residual value of the current node is equal to 0; and performing a subtraction operation on the zero-run value to determine the attribute quantization residual value of the next node according to the new zero-run value;
    若所述零游程值等于0,则解码码流,确定所述当前节点的属性量化残差值;以及继续执行对所述零游程值进行解码处理的步骤,以根据新的零游程值确定下一节点的属性量化残差值。If the zero-run value is equal to 0, decode the code stream to determine the attribute quantization residual value of the current node; and continue to perform the step of decoding the zero-run value to determine the attribute quantization residual value of the next node according to the new zero-run value.
  7. 根据权利要求6所述的方法,其中,所述零游程值用于指示属性量化残差值是否均为0的计数;The method according to claim 6, wherein the zero run value is used to indicate whether the attribute quantization residual values are all 0 counts;
    其中,所述属性量化残差值包括下述其中之一:颜色分量量化残差值和反射率量化残差值。The attribute quantization residual value includes one of the following: a color component quantization residual value and a reflectivity quantization residual value.
  8. 根据权利要求1所述的方法,其中,在所述零游程值小于预设阈值时,所述方法还包括:The method according to claim 1, wherein when the zero run value is less than a preset threshold, the method further comprises:
    若所述预置参数符合第一预设条件,则对所述至少一个第一类语法元素标识信息进行基于上下文模型的解码处理,确定所述至少一个第一类语法元素标识信息的取值;以及根据所述至少一个第一类语法元素标识信息的取值,确定所述零游程值;或者,If the preset parameter meets the first preset condition, the at least one first-category syntax element identification information is decoded based on the context model to determine the value of the at least one first-category syntax element identification information; and the zero run value is determined according to the value of the at least one first-category syntax element identification information; or,
    若所述预置参数符合第二预设条件,则对所述至少一个第一类语法元素标识信息进行基于旁路模型的解码处理,确定所述至少一个第一类语法元素标识信息的取值;以及根据所述至少一个第一类语法元素标识信息的取值,确定所述零游程值。If the preset parameters meet the second preset condition, the at least one first-category syntax element identification information is decoded based on the bypass model to determine the value of the at least one first-category syntax element identification information; and the zero run value is determined based on the value of the at least one first-category syntax element identification information.
  9. 根据权利要求1所述的方法,其中,所述至少一个第一类语法元素标识信息包括下述至少一项:第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息和第四语法元素标识信息;The method according to claim 1, wherein the at least one first type of syntax element identification information comprises at least one of the following: first syntax element identification information, second syntax element identification information, third syntax element identification information, and fourth syntax element identification information;
    所述至少一个第二类语法元素标识信息至少包括:第一数值标识信息;The at least one second type of syntax element identification information at least includes: first numerical identification information;
    其中,所述第一语法元素标识信息用于指示所述零游程值是否等于0,所述第二语法元素标识信息用于指示所述零游程值是否等于1,所述第三语法元素标识信息用于指示所述零游程值是否等于2,所述第四语法元素标识信息用于指示所述零游程值进行第一运算后得到的第一数值的奇偶特性,所述第一数值标识信息用于指示所述零游程值进行第二运算后得到的第二数值。Among them, the first syntax element identification information is used to indicate whether the zero run value is equal to 0, the second syntax element identification information is used to indicate whether the zero run value is equal to 1, the third syntax element identification information is used to indicate whether the zero run value is equal to 2, the fourth syntax element identification information is used to indicate the parity characteristic of a first numerical value obtained after a first operation is performed on the zero run value, and the first numerical value identification information is used to indicate a second numerical value obtained after a second operation is performed on the zero run value.
  10. 根据权利要求9所述的方法,其中,对所述零游程值进行第一运算,包括:The method according to claim 9, wherein performing a first operation on the zero-run value comprises:
    根据所述零游程值与第一预设值进行减法运算,得到所述第一数值。The first value is obtained by performing a subtraction operation on the zero-run value and a first preset value.
  11. 根据权利要求9所述的方法,其中,对所述零游程值进行第二运算,包括:The method according to claim 9, wherein performing a second operation on the zero-run value comprises:
    根据所述零游程值与第一预设值进行减法运算,得到所述第一数值;Performing a subtraction operation on the zero-run value and a first preset value to obtain the first value;
    将所述第二数值设置为等于所述第一数值除以2的商。The second value is set equal to the quotient of the first value divided by 2.
  12. 根据权利要求11所述的方法,其中,所述方法还包括:The method according to claim 11, wherein the method further comprises:
    对所述第一数值进行右移一位处理,得到所述第二数值。The first value is shifted right by one bit to obtain the second value.
  13. 根据权利要求9所述的方法,其中,在所述预置参数符合第一预设条件时,对所述零游程值进行解码处理,包括:The method according to claim 9, wherein when the preset parameter meets the first preset condition, decoding the zero run value comprises:
    基于上下文模型对所述第一语法元素标识信息进行解码处理,确定所述第一语法元素标识信息的取值;Decoding the first syntax element identification information based on a context model to determine a value of the first syntax element identification information;
    若所述第一语法元素标识信息的取值为第一值,则确定所述零游程值等于0;If the value of the first syntax element identification information is a first value, determining that the zero run value is equal to 0;
    若所述第一语法元素标识信息的取值为第二值,则基于上下文模型对所述第二语法元素标识信息进行解码处理,确定所述第二语法元素标识信息的取值;If the value of the first syntax element identification information is a second value, decoding the second syntax element identification information based on a context model to determine the value of the second syntax element identification information;
    若所述第二语法元素标识信息的取值为第一值,则确定所述零游程值等于1;If the value of the second syntax element identification information is the first value, determining that the zero run value is equal to 1;
    若所述第二语法元素标识信息的取值为第二值,则基于上下文模型对所述第三语法元素标识信息进行解码处理,确定所述第三语法元素标识信息的取值;If the value of the second syntax element identification information is the second value, decoding the third syntax element identification information based on the context model to determine the value of the third syntax element identification information;
    若所述第三语法元素标识信息的取值为第一值,则确定所述零游程值等于2;If the value of the third syntax element identification information is the first value, determining that the zero run value is equal to 2;
    若所述第三语法元素标识信息的取值为第二值,则基于上下文模型对所述第四语法元素标识信息进行解码处理,确定所述第四语法元素标识信息的取值;以及基于旁路模型对所述第一数值标识信息进行解码处理,确定所述第一数值标识信息的取值;If the value of the third syntax element identification information is the second value, decoding the fourth syntax element identification information based on the context model to determine the value of the fourth syntax element identification information; and decoding the first numerical identification information based on the bypass model to determine the value of the first numerical identification information;
    根据所述第一预设值、所述第四语法元素标识信息的取值和所述第一数值标识信息的取值,确定所述零游程值。The zero run value is determined according to the first preset value, the value of the fourth syntax element identification information and the value of the first numerical identification information.
  14. 根据权利要求13所述的方法,其中,所述方法还包括:The method according to claim 13, wherein the method further comprises:
    在每一次基于上下文模型对以下的语法元素标识信息解码完成后,对所述预置参数的取值执行一次减1操作:After each decoding of the following syntax element identification information based on the context model is completed, a subtraction operation is performed on the value of the preset parameter:
    所述第一语法元素标识信息、所述第二语法元素标识信息、所述第三语法元素标识信息和所述第四语法元素标识信息。The first syntax element identification information, the second syntax element identification information, the third syntax element identification information and the fourth syntax element identification information.
  15. 根据权利要求9所述的方法,其中,在所述预置参数符合第二预设条件时,对所述零游程值进行解码处理,包括:The method according to claim 9, wherein when the preset parameter meets the second preset condition, decoding the zero run value comprises:
    基于旁路模型对所述第一语法元素标识信息进行解码处理,确定所述第一语法元素标识信息的取值;Decoding the first syntax element identification information based on a bypass model to determine a value of the first syntax element identification information;
    若所述第一语法元素标识信息的取值为第一值,则确定所述零游程值等于0;If the value of the first syntax element identification information is a first value, determining that the zero run value is equal to 0;
    若所述第一语法元素标识信息的取值为第二值,则基于旁路模型对所述第二语法元素标识信息进行解码处理,确定所述第二语法元素标识信息的取值;If the value of the first syntax element identification information is a second value, decoding the second syntax element identification information based on a bypass model to determine the value of the second syntax element identification information;
    若所述第二语法元素标识信息的取值为第一值,则确定所述零游程值等于1;If the value of the second syntax element identification information is the first value, determining that the zero run value is equal to 1;
    若所述第二语法元素标识信息的取值为第二值,则基于旁路模型对所述第三语法元素标识信息进行解码处理,确定所述第三语法元素标识信息的取值;If the value of the second syntax element identification information is the second value, decoding the third syntax element identification information based on the bypass model to determine the value of the third syntax element identification information;
    若所述第三语法元素标识信息的取值为第一值,则确定所述零游程值等于2;If the value of the third syntax element identification information is the first value, determining that the zero run value is equal to 2;
    若所述第三语法元素标识信息的取值为第二值,则基于旁路模型对所述第四语法元素标识信息进行解码处理,确定所述第四语法元素标识信息的取值;以及基于旁路模型对所述第一数值标识信息进行解码处理,确定所述第一数值标识信息的取值;If the value of the third syntax element identification information is the second value, decoding the fourth syntax element identification information based on the bypass model to determine the value of the fourth syntax element identification information; and decoding the first numerical identification information based on the bypass model to determine the value of the first numerical identification information;
    根据所述第一预设值、所述第四语法元素标识信息的取值和所述第一数值标识信息的取值,确定所述零游程值。The zero run value is determined according to the first preset value, the value of the fourth syntax element identification information and the value of the first numerical identification information.
  16. 根据权利要求13或15所述的方法,其中,所述基于旁路模型对所述第一数值标识信息进行解码处理,确定所述第一数值标识信息的取值,包括:The method according to claim 13 or 15, wherein the decoding process of the first numerical identification information based on the bypass model to determine the value of the first numerical identification information comprises:
    基于旁路模型对所述第一数值标识信息进行解码处理,确定所述第一数值标识信息对应的至少一个二值符号;Decoding the first numerical identification information based on a bypass model to determine at least one binary symbol corresponding to the first numerical identification information;
    对所述至少一个二值符号进行反二值化处理,得到所述第一数值标识信息的取值。Debinarization is performed on the at least one binary symbol to obtain a value of the first numerical identification information.
  17. 根据权利要求13或15所述的方法,其中,所述根据所述第一预设值、所述第四语法元素标识信息的取值和所述第一数值标识信息的取值,确定所述零游程值,包括:The method according to claim 13 or 15, wherein the determining the zero run value according to the first preset value, the value of the fourth syntax element identification information and the value of the first numerical identification information comprises:
    对所述第一数值标识信息的取值进行第三运算,得到第三数值;Performing a third operation on the value of the first numerical identification information to obtain a third numerical value;
    根据所述第一预设值、所述第三数值和所述第四语法元素标识信息的取值,确定所述零游程值。The zero run value is determined according to the first preset value, the third value and the value of the fourth syntax element identification information.
  18. 根据权利要求17所述的方法,其中,所述对所述第一数值标识信息的取值进行第三运算,得到第三数值,包括:The method according to claim 17, wherein the performing a third operation on the value of the first numerical identification information to obtain a third numerical value comprises:
    对所述第一数值标识信息的取值与2进行乘法运算,得到所述第三数值;或者,multiplying the value of the first numerical identification information by 2 to obtain the third numerical value; or,
    对所述第一数值标识信息的取值进行左移一位运算,得到所述第三数值。The value of the first numerical identification information is shifted left by one bit to obtain the third numerical value.
  19. 根据权利要求17所述的方法,其中,所述根据所述第一预设值、所述第三数值和所述第四语法元素标识信息的取值,确定所述零游程值,包括:The method according to claim 17, wherein the determining the zero run value according to the first preset value, the third value, and the value of the fourth syntax element identification information comprises:
    对所述第一预设值、所述第三数值和所述第四语法元素标识信息的取值进行加法运算,得到所述零游程值。An addition operation is performed on the first preset value, the third value, and the value of the fourth syntax element identification information to obtain the zero run value.
  20. 根据权利要求1所述的方法,其中,所述至少一个第一类语法元素标识信息包括下述至少一项:第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息、第五语法元素标识信息、第六语法元素标识信息、第七语法元素标识信息和第八语法元素标识信息;The method according to claim 1, wherein the at least one first type of syntax element identification information comprises at least one of the following: first syntax element identification information, second syntax element identification information, third syntax element identification information, fourth syntax element identification information, fifth syntax element identification information, sixth syntax element identification information, seventh syntax element identification information, and eighth syntax element identification information;
    所述至少一个第二类语法元素标识信息至少包括:第二数值标识信息;The at least one second type of syntax element identification information at least includes: second numerical identification information;
    其中,所述第一语法元素标识信息用于指示所述零游程值是否等于0,所述第二语法元素标识信息用于指示所述零游程值是否等于1,所述第三语法元素标识信息用于指示所述零游程值是否等于2,所述第四语法元素标识信息用于指示所述零游程值进行第一运算后得到的第一数值的奇偶特性,所述第五语法元素标识信息用于指示所述零游程值进行第二运算后得到的第二数值是否等于0,所述第六语法元素标识信息用于指示所述零游程值进行第二运算后得到的第二数值是否等于1,所述第七语法元素标识信息用于指示所述零游程值进行第二运算后得到的第二数值是否等于2,所述第八语法元素标识信息用于指示所述零游程值进行第二运算后得到的第二数值是否等于3,所述第二数值标识信息用于指示所述零游程值进行第四运算后得到的第四数值。Among them, the first syntax element identification information is used to indicate whether the zero run value is equal to 0, the second syntax element identification information is used to indicate whether the zero run value is equal to 1, the third syntax element identification information is used to indicate whether the zero run value is equal to 2, the fourth syntax element identification information is used to indicate the parity characteristic of the first numerical value obtained after the zero run value is subjected to the first operation, the fifth syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 0, the sixth syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 1, the seventh syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 2, the eighth syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 3, and the second numerical value identification information is used to indicate the fourth numerical value obtained after the zero run value is subjected to the fourth operation.
  21. 根据权利要求20所述的方法,其中,对所述零游程值进行第四运算,包括:The method according to claim 20, wherein performing a fourth operation on the zero-run value comprises:
    根据所述零游程值与第一预设值进行减法运算,得到所述第一数值;Performing a subtraction operation on the zero-run value and a first preset value to obtain the first value;
    将所述第二数值设置为等于所述第一数值除以2的商;Setting the second value to be equal to the quotient of the first value divided by 2;
    根据所述第二数值与第二预设值进行减法运算,得到所述第四数值。The fourth value is obtained by performing a subtraction operation on the second value and the second preset value.
  22. 根据权利要求20所述的方法,其中,在所述预置参数符合第一预设条件时,对所述零游程值进行解码处理,包括:The method according to claim 20, wherein when the preset parameter meets the first preset condition, decoding the zero run value comprises:
    基于上下文模型对所述第一语法元素标识信息进行解码处理,确定所述第一语法元素标识信息的取值;Decoding the first syntax element identification information based on a context model to determine a value of the first syntax element identification information;
    若所述第一语法元素标识信息的取值为第一值,则确定所述零游程值等于0;If the value of the first syntax element identification information is a first value, determining that the zero run value is equal to 0;
    若所述第一语法元素标识信息的取值为第二值,则基于上下文模型对所述第二语法元素标识信息进行解码处理,确定所述第二语法元素标识信息的取值;If the value of the first syntax element identification information is a second value, decoding the second syntax element identification information based on a context model to determine the value of the second syntax element identification information;
    若所述第二语法元素标识信息的取值为第一值,则确定所述零游程值等于1;If the value of the second syntax element identification information is the first value, determining that the zero run value is equal to 1;
    若所述第二语法元素标识信息的取值为第二值,则基于上下文模型对所述第三语法元素标识信息进行解码处理,确定所述第三语法元素标识信息的取值;If the value of the second syntax element identification information is the second value, decoding the third syntax element identification information based on the context model to determine the value of the third syntax element identification information;
    若所述第三语法元素标识信息的取值为第一值,则确定所述零游程值等于2;If the value of the third syntax element identification information is the first value, determining that the zero run value is equal to 2;
    若所述第三语法元素标识信息的取值为第二值,则基于上下文模型对所述第四语法元素标识信息进行解码处理,确定所述第四语法元素标识信息的取值;以及基于上下文模型对所述第五语法元素标识信息进行解码处理,确定所述第五语法元素标识信息的取值;If the value of the third syntax element identification information is the second value, decoding the fourth syntax element identification information based on the context model to determine the value of the fourth syntax element identification information; and decoding the fifth syntax element identification information based on the context model to determine the value of the fifth syntax element identification information;
    若所述第五语法元素标识信息的取值为第一值,则确定所述零游程值等于所述第一预设值和所述第四语法元素标识信息的取值之和;If the value of the fifth syntax element identification information is the first value, determining that the zero run value is equal to the sum of the first preset value and the value of the fourth syntax element identification information;
    若所述第五语法元素标识信息的取值为第二值,则基于上下文模型对所述第六语法元素标识信息进行解码处理,确定所述第六语法元素标识信息的取值;If the value of the fifth syntax element identification information is the second value, decoding the sixth syntax element identification information based on the context model to determine the value of the sixth syntax element identification information;
    若所述第六语法元素标识信息的取值为第一值,则确定所述零游程值等于第一常数、所述第一预设值和所述第四语法元素标识信息的取值之和;If the value of the sixth syntax element identification information is the first value, determining that the zero run value is equal to the sum of the first constant, the first preset value and the value of the fourth syntax element identification information;
    若所述第六语法元素标识信息的取值为第二值,则基于上下文模型对所述第七语法元素标识信息进行解码处理,确定所述第七语法元素标识信息的取值;If the value of the sixth grammar element identification information is the second value, decoding the seventh grammar element identification information based on the context model to determine the value of the seventh grammar element identification information;
    若所述第七语法元素标识信息的取值为第一值,则确定所述零游程值等于第二常数、所述第一预设值和所述第四语法元素标识信息的取值之和;If the value of the seventh syntax element identification information is the first value, determining that the zero run value is equal to the sum of the second constant, the first preset value and the value of the fourth syntax element identification information;
    若所述第七语法元素标识信息的取值为第二值,则基于上下文模型对所述第八语法元素标识信息进行解码处理,确定所述第八语法元素标识信息的取值;If the value of the seventh syntax element identification information is the second value, decoding the eighth syntax element identification information based on the context model to determine the value of the eighth syntax element identification information;
    若所述第八语法元素标识信息的取值为第一值,则确定所述零游程值等于第三常数、所述第一预设值和所述第四语法元素标识信息的取值之和;If the value of the eighth syntax element identification information is the first value, determining that the zero run value is equal to the sum of the third constant, the first preset value and the value of the fourth syntax element identification information;
    若所述第八语法元素标识信息的取值为第二值,则基于旁路模型对所述第二数值标识信息进行解码处理,确定所述第二数值标识信息的取值;If the value of the eighth syntax element identification information is the second value, decoding the second numerical identification information based on the bypass model to determine the value of the second numerical identification information;
    根据所述第一预设值、所述第四语法元素标识信息的取值和所述第二数值标识信息的取值,确定所述零游程值。The zero run value is determined according to the first preset value, the value of the fourth syntax element identification information and the value of the second numerical identification information.
  23. 根据权利要求22所述的方法,其中,所述方法还包括:The method according to claim 22, wherein the method further comprises:
    在每一次基于上下文模型对以下的语法元素标识信息解码完成后,对所述预置参数的取值执行一次减1操作:After each decoding of the following syntax element identification information based on the context model is completed, a subtraction operation is performed on the value of the preset parameter:
    所述第一语法元素标识信息、所述第二语法元素标识信息、所述第三语法元素标识信息、所述第四语法元素标识信息、所述第五语法元素标识信息、所述第六语法元素标识信息、所述第七语法元素标识信息和所述第八语法元素标识信息。The first syntax element identification information, the second syntax element identification information, the third syntax element identification information, the fourth syntax element identification information, the fifth syntax element identification information, the sixth syntax element identification information, the seventh syntax element identification information and the eighth syntax element identification information.
  24. 根据权利要求20所述的方法,其中,在所述预置参数符合第二预设条件时,对所述零游程值 进行解码处理,包括:The method according to claim 20, wherein when the preset parameter meets the second preset condition, decoding the zero run value comprises:
    基于旁路模型对所述第一语法元素标识信息进行解码处理,确定所述第一语法元素标识信息的取值;Decoding the first syntax element identification information based on a bypass model to determine a value of the first syntax element identification information;
    若所述第一语法元素标识信息的取值为第一值,则确定所述零游程值等于0;If the value of the first syntax element identification information is a first value, determining that the zero run value is equal to 0;
    若所述第一语法元素标识信息的取值为第二值,则基于旁路模型对所述第二语法元素标识信息进行解码处理,确定所述第二语法元素标识信息的取值;If the value of the first syntax element identification information is a second value, decoding the second syntax element identification information based on a bypass model to determine the value of the second syntax element identification information;
    若所述第二语法元素标识信息的取值为第一值,则确定所述零游程值等于1;If the value of the second syntax element identification information is the first value, determining that the zero run value is equal to 1;
    若所述第二语法元素标识信息的取值为第二值,则基于旁路模型对所述第三语法元素标识信息进行解码处理,确定所述第三语法元素标识信息的取值;If the value of the second syntax element identification information is the second value, decoding the third syntax element identification information based on the bypass model to determine the value of the third syntax element identification information;
    若所述第三语法元素标识信息的取值为第一值,则确定所述零游程值等于2;If the value of the third syntax element identification information is the first value, determining that the zero run value is equal to 2;
    若所述第三语法元素标识信息的取值为第二值,则基于旁路模型对所述第四语法元素标识信息进行解码处理,确定所述第四语法元素标识信息的取值;以及基于旁路模型对所述第五语法元素标识信息进行解码处理,确定所述第五语法元素标识信息的取值;If the value of the third syntax element identification information is the second value, decoding the fourth syntax element identification information based on the bypass model to determine the value of the fourth syntax element identification information; and decoding the fifth syntax element identification information based on the bypass model to determine the value of the fifth syntax element identification information;
    若所述第五语法元素标识信息的取值为第一值,则确定所述零游程值等于所述第一预设值和所述第四语法元素标识信息的取值之和;If the value of the fifth syntax element identification information is the first value, determining that the zero run value is equal to the sum of the first preset value and the value of the fourth syntax element identification information;
    若所述第五语法元素标识信息的取值为第二值,则基于旁路模型对所述第六语法元素标识信息进行解码处理,确定所述第六语法元素标识信息的取值;If the value of the fifth syntax element identification information is the second value, decoding the sixth syntax element identification information based on the bypass model to determine the value of the sixth syntax element identification information;
    若所述第六语法元素标识信息的取值为第一值,则确定所述零游程值等于第一常数、所述第一预设值和所述第四语法元素标识信息的取值之和;If the value of the sixth syntax element identification information is the first value, determining that the zero run value is equal to the sum of the first constant, the first preset value and the value of the fourth syntax element identification information;
    若所述第六语法元素标识信息的取值为第二值,则基于旁路模型对所述第七语法元素标识信息进行解码处理,确定所述第七语法元素标识信息的取值;If the value of the sixth syntax element identification information is the second value, decoding the seventh syntax element identification information based on the bypass model to determine the value of the seventh syntax element identification information;
    若所述第七语法元素标识信息的取值为第一值,则确定所述零游程值等于第二常数、所述第一预设值和所述第四语法元素标识信息的取值之和;If the value of the seventh syntax element identification information is the first value, determining that the zero run value is equal to the sum of the second constant, the first preset value and the value of the fourth syntax element identification information;
    若所述第七语法元素标识信息的取值为第二值,则基于旁路模型对所述第八语法元素标识信息进行解码处理,确定所述第八语法元素标识信息的取值;If the value of the seventh syntax element identification information is the second value, decoding the eighth syntax element identification information based on the bypass model to determine the value of the eighth syntax element identification information;
    若所述第八语法元素标识信息的取值为第一值,则确定所述零游程值等于第三常数、所述第一预设值和所述第四语法元素标识信息的取值之和;If the value of the eighth syntax element identification information is the first value, determining that the zero run value is equal to the sum of the third constant, the first preset value and the value of the fourth syntax element identification information;
    若所述第八语法元素标识信息的取值为第二值,则基于旁路模型对所述第二数值标识信息进行解码处理,确定所述第二数值标识信息的取值;If the value of the eighth syntax element identification information is the second value, decoding the second numerical identification information based on the bypass model to determine the value of the second numerical identification information;
    根据所述第一预设值、所述第四语法元素标识信息的取值和所述第二数值标识信息的取值,确定所述零游程值。The zero run value is determined according to the first preset value, the value of the fourth syntax element identification information and the value of the second numerical identification information.
  25. 根据权利要求22或24所述的方法,其中,所述第一常数、所述第二常数和所述第三常数均为2的倍数。The method according to claim 22 or 24, wherein the first constant, the second constant and the third constant are all multiples of 2.
  26. 根据权利要求22或24所述的方法,其中,所述根据所述第一预设值、所述第四语法元素标识信息的取值和所述第二数值标识信息的取值,确定所述零游程值,包括:The method according to claim 22 or 24, wherein the determining the zero run value according to the first preset value, the value of the fourth syntax element identification information, and the value of the second numerical identification information comprises:
    根据所述第二数值标识信息的取值和第二预设值,确定第二运算结果;Determine a second operation result according to the value of the second numerical identification information and a second preset value;
    对所述第二运算结果进行第四运算,得到第三运算结果;Performing a fourth operation on the second operation result to obtain a third operation result;
    根据所述第一预设值、所述第三运算结果和所述第四语法元素标识信息的取值,确定所述零游程值。The zero run value is determined according to the first preset value, the third operation result and the value of the fourth syntax element identification information.
  27. 根据权利要求26所述的方法,其中,所述对所述第二运算结果进行第四运算,得到第三运算结果,包括:The method according to claim 26, wherein performing a fourth operation on the second operation result to obtain a third operation result comprises:
    对所述第二运算结果与2进行乘法运算,得到所述第三运算结果;Performing a multiplication operation on the second operation result and 2 to obtain the third operation result;
    或者,or,
    对所述第二运算结果进行左移一位运算,得到所述第三运算结果。The second operation result is shifted left by one bit to obtain the third operation result.
  28. 根据权利要求26所述的方法,其中,所述根据所述第一预设值、所述第三运算结果和所述第四语法元素标识信息的取值,确定所述零游程值,包括:The method according to claim 26, wherein the determining the zero run value according to the first preset value, the third operation result and the value of the fourth syntax element identification information comprises:
    对所述第一预设值、所述第三运算结果和所述第四语法元素标识信息的取值进行加法运算,得到所述零游程值。An addition operation is performed on the first preset value, the third operation result, and the value of the fourth syntax element identification information to obtain the zero run value.
  29. 一种编码方法,应用于编码器,所述方法包括:A coding method, applied to an encoder, comprising:
    确定零游程值以及所述零游程值对应的预置参数;Determine a zero-run value and a preset parameter corresponding to the zero-run value;
    根据所述零游程值,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值;Determine, according to the zero-run value, a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information;
    若所述预置参数符合第一预设条件,则对所述至少一个第一类语法元素标识信息的取值进行基于上下文模型的编码处理,以及对所述至少一个第二类语法元素标识信息的取值进行基于旁路模型的编码处 理,将所得到的编码比特写入码流。If the preset parameters meet the first preset condition, the value of the at least one first-category syntax element identification information is coded based on the context model, and the value of the at least one second-category syntax element identification information is coded based on the bypass model, and the obtained coded bits are written into the bitstream.
  30. 根据权利要求29所述的方法,其中,所述预置参数符合第一预设条件,包括:确定所述预置参数的取值大于或等于预设门限值。The method according to claim 29, wherein the preset parameter meets the first preset condition, comprising: determining that the value of the preset parameter is greater than or equal to a preset threshold value.
  31. 根据权利要求29所述的方法,其中,所述方法还包括:The method according to claim 29, wherein the method further comprises:
    若所述预置参数符合第二预设条件,则对所述至少一个第一类语法元素标识信息和所述至少一个第二类语法元素标识信息均进行基于旁路模型的编码处理,将所得到的编码比特写入码流。If the preset parameter meets the second preset condition, the at least one first-category syntax element identification information and the at least one second-category syntax element identification information are both coded based on the bypass model, and the obtained coded bits are written into the bitstream.
  32. 根据权利要求31所述的方法,其中,所述预置参数符合第二预设条件,包括:确定所述预置参数的取值小于预设门限值。The method according to claim 31, wherein the preset parameter meets the second preset condition, comprising: determining that the value of the preset parameter is less than a preset threshold value.
  33. 根据权利要求29所述的方法,其中,所述方法还包括:The method according to claim 29, wherein the method further comprises:
    对所述零游程值对应的预置参数进行编码处理,将所得到的编码比特写入码流。The preset parameters corresponding to the zero-run value are coded, and the obtained coded bits are written into a bit stream.
  34. 根据权利要求29所述的方法,其中,所述确定零游程值,包括:The method of claim 29, wherein determining the zero run value comprises:
    若当前节点的属性量化残差值等于0,则对所述零游程值执行加1操作,根据下一节点的属性量化残差值继续确定所述零游程值;If the attribute quantization residual value of the current node is equal to 0, then the zero run value is added by 1, and the zero run value is further determined according to the attribute quantization residual value of the next node;
    若当前节点的属性量化残差值不全等于0,则对所述零游程值进行编码处理,且对所述当前节点的属性量化残差值进行编码处理,将所得到的编码比特写入码流;以及将所述零游程值重置为0,根据下一节点的属性量化残差值继续确定所述零游程值。If the attribute quantization residual value of the current node is not all equal to 0, the zero-run value is encoded and the attribute quantization residual value of the current node is encoded, and the obtained encoding bits are written into the bit stream; and the zero-run value is reset to 0, and the zero-run value is continued to be determined according to the attribute quantization residual value of the next node.
  35. 根据权利要求29所述的方法,其中,所述方法还包括:The method according to claim 29, wherein the method further comprises:
    设置所述零游程值的初始值等于0。The initial value of the zero-run value is set equal to 0.
  36. 根据权利要求34所述的方法,其中,所述零游程值用于指示属性量化残差值是否均为0的计数;The method according to claim 34, wherein the zero-run value is used to indicate the count of whether the attribute quantization residual values are all 0;
    其中,所述属性量化残差值包括下述其中之一:颜色分量量化残差值和反射率量化残差值。The attribute quantization residual value includes one of the following: a color component quantization residual value and a reflectivity quantization residual value.
  37. 根据权利要求29所述的方法,其中,在所述零游程值小于预设阈值时,所述方法还包括:The method according to claim 29, wherein when the zero run value is less than a preset threshold, the method further comprises:
    根据所述零游程值,确定至少一个第一类语法元素标识信息的取值;Determine, according to the zero-run value, a value of at least one first-category syntax element identification information;
    若所述预置参数符合第一预设条件,则对所述至少一个第一类语法元素标识信息的取值进行基于上下文模型的编码处理,将所得到的编码比特写入码流;或者,If the preset parameter meets the first preset condition, the value of the at least one first-category syntax element identification information is coded based on the context model, and the obtained coded bits are written into the bitstream; or,
    若所述预置参数符合第二预设条件,则对所述至少一个第一类语法元素标识信息的取值进行基于旁路模型的编码处理,将所得到的编码比特写入码流。If the preset parameter meets the second preset condition, the value of the at least one first-category syntax element identification information is coded based on the bypass model, and the obtained coded bits are written into the bitstream.
  38. 根据权利要求29所述的方法,其中,所述至少一个第一类语法元素标识信息包括下述至少一项:第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息和第四语法元素标识信息;The method according to claim 29, wherein the at least one first type of syntax element identification information comprises at least one of the following: first syntax element identification information, second syntax element identification information, third syntax element identification information, and fourth syntax element identification information;
    所述至少一个第二类语法元素标识信息至少包括:第一数值标识信息;The at least one second type of syntax element identification information at least includes: first numerical identification information;
    其中,所述第一语法元素标识信息用于指示所述零游程值是否等于0,所述第二语法元素标识信息用于指示所述零游程值是否等于1,所述第三语法元素标识信息用于指示所述零游程值是否等于2,所述第四语法元素标识信息用于指示所述零游程值进行第一运算后得到的第一数值的奇偶特性,所述第一数值标识信息用于指示所述零游程值进行第二运算后得到的第二数值。Among them, the first syntax element identification information is used to indicate whether the zero run value is equal to 0, the second syntax element identification information is used to indicate whether the zero run value is equal to 1, the third syntax element identification information is used to indicate whether the zero run value is equal to 2, the fourth syntax element identification information is used to indicate the parity characteristic of a first numerical value obtained after a first operation is performed on the zero run value, and the first numerical value identification information is used to indicate a second numerical value obtained after a second operation is performed on the zero run value.
  39. 根据权利要求38所述的方法,其中,对所述零游程值进行第一运算,包括:The method of claim 38, wherein performing a first operation on the zero-run value comprises:
    根据所述零游程值与第一预设值进行减法运算,得到所述第一数值。The first value is obtained by performing a subtraction operation on the zero-run value and a first preset value.
  40. 根据权利要求38所述的方法,其中,对所述零游程值进行第二运算,包括:The method according to claim 38, wherein performing a second operation on the zero-run value comprises:
    根据所述零游程值与第一预设值进行减法运算,得到所述第一数值;Performing a subtraction operation on the zero-run value and a first preset value to obtain the first value;
    将所述第二数值设置为等于所述第一数值除以2的商。The second value is set equal to the quotient of the first value divided by 2.
  41. 根据权利要求40所述的方法,其中,所述方法还包括:The method according to claim 40, wherein the method further comprises:
    对所述第一数值进行右移一位处理,得到所述第二数值。The first value is shifted right by one bit to obtain the second value.
  42. 根据权利要求38所述的方法,其中,在所述预置参数符合第一预设条件时,对所述零游程值进行编码处理,包括:The method according to claim 38, wherein when the preset parameter meets the first preset condition, encoding the zero run value comprises:
    根据所述零游程值,确定所述第一语法元素标识信息的取值;Determining a value of the first syntax element identification information according to the zero-run value;
    基于上下文模型对所述第一语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the first syntax element identification information based on the context model, and writing the obtained encoding bits into a bitstream;
    若所述第一语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第二语法元素标识信息的取值;If the value of the first syntax element identification information is a second value, determining the value of the second syntax element identification information according to the zero run value;
    基于上下文模型对所述第二语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the second syntax element identification information based on the context model, and writing the obtained encoding bits into a bitstream;
    若所述第二语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第三语法元素标识信息的取值;If the value of the second syntax element identification information is the second value, determining the value of the third syntax element identification information according to the zero run value;
    基于上下文模型对所述第三语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the third syntax element identification information based on the context model, and writing the obtained encoding bits into a bitstream;
    若所述第三语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第四语法元素标识 信息的取值和所述第一数值标识信息的取值;If the value of the third syntax element identification information is the second value, determining the value of the fourth syntax element identification information and the value of the first value identification information according to the zero run value;
    基于上下文模型对所述第四语法元素标识信息的取值进行编码处理,以及基于旁路模型对所述第一数值标识信息的取值进行编码处理,将所得到的编码比特写入码流。The value of the fourth syntax element identification information is encoded based on the context model, and the value of the first numerical identification information is encoded based on the bypass model, and the obtained encoded bits are written into the bitstream.
  43. 根据权利要求42所述的方法,其中,所述方法还包括:The method according to claim 42, wherein the method further comprises:
    在每一次基于上下文模型对以下的语法元素标识信息编码完成后,对所述预置参数的取值执行一次减1操作:After the following syntax element identification information is encoded based on the context model each time, a subtraction operation is performed on the value of the preset parameter:
    所述第一语法元素标识信息、所述第二语法元素标识信息、所述第三语法元素标识信息和所述第四语法元素标识信息。The first syntax element identification information, the second syntax element identification information, the third syntax element identification information and the fourth syntax element identification information.
  44. 根据权利要求38所述的方法,其中,在所述预置参数符合第二预设条件时,对所述零游程值进行编码处理,包括:The method according to claim 38, wherein when the preset parameter meets the second preset condition, encoding the zero run value comprises:
    根据所述零游程值,确定所述第一语法元素标识信息的取值;Determining a value of the first syntax element identification information according to the zero-run value;
    基于旁路模型对所述第一语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the first syntax element identification information based on the bypass model, and writing the obtained encoding bits into the bitstream;
    若所述第一语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第二语法元素标识信息的取值;If the value of the first syntax element identification information is a second value, determining the value of the second syntax element identification information according to the zero run value;
    基于旁路模型对所述第二语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the second syntax element identification information based on the bypass model, and writing the obtained encoding bits into a bitstream;
    若所述第二语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第三语法元素标识信息的取值;If the value of the second syntax element identification information is the second value, determining the value of the third syntax element identification information according to the zero run value;
    基于旁路模型对所述第三语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the third syntax element identification information based on the bypass model, and writing the obtained encoding bits into a bitstream;
    若所述第三语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第四语法元素标识信息的取值和所述第一数值标识信息的取值;If the value of the third syntax element identification information is the second value, determining the value of the fourth syntax element identification information and the value of the first numerical identification information according to the zero run value;
    基于旁路模型对所述第四语法元素标识信息的取值进行编码处理,以及基于旁路模型对所述第一数值标识信息的取值进行编码处理,将所得到的编码比特写入码流。The value of the fourth syntax element identification information is encoded based on the bypass model, and the value of the first numerical identification information is encoded based on the bypass model, and the obtained encoded bits are written into the bitstream.
  45. 根据权利要求42或44所述的方法,其中,所述基于旁路模型对所述第一数值标识信息的取值进行编码处理,包括:The method according to claim 42 or 44, wherein encoding the value of the first numerical identification information based on the bypass model comprises:
    对所述第一数值标识信息的取值进行二值化处理,得到至少一个二值符号;Binarizing the value of the first numerical identification information to obtain at least one binary symbol;
    基于旁路模型对所述至少一个二值符号依次进行编码处理,将所得到的编码比特写入码流。The at least one binary symbol is encoded in sequence based on the bypass model, and the obtained encoded bits are written into a bit stream.
  46. 根据权利要求29所述的方法,其中,所述至少一个第一类语法元素标识信息包括下述至少一项:第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息、第五语法元素标识信息、第六语法元素标识信息、第七语法元素标识信息和第八语法元素标识信息;The method according to claim 29, wherein the at least one first type of syntax element identification information comprises at least one of the following: first syntax element identification information, second syntax element identification information, third syntax element identification information, fourth syntax element identification information, fifth syntax element identification information, sixth syntax element identification information, seventh syntax element identification information, and eighth syntax element identification information;
    所述至少一个第二类语法元素标识信息至少包括:第二数值标识信息;The at least one second type of syntax element identification information at least includes: second numerical identification information;
    其中,所述第一语法元素标识信息用于指示所述零游程值是否等于0,所述第二语法元素标识信息用于指示所述零游程值是否等于1,所述第三语法元素标识信息用于指示所述零游程值是否等于2,所述第四语法元素标识信息用于指示所述零游程值进行第一运算后得到的第一数值的奇偶特性,所述第五语法元素标识信息用于指示所述零游程值进行第二运算后得到的第二数值是否等于0,所述第六语法元素标识信息用于指示所述零游程值进行第二运算后得到的第二数值是否等于1,所述第七语法元素标识信息用于指示所述零游程值进行第二运算后得到的第二数值是否等于2,所述第八语法元素标识信息用于指示所述零游程值进行第二运算后得到的第二数值是否等于3,所述第二数值标识信息用于指示所述零游程值进行第四运算后得到的第四数值。Among them, the first syntax element identification information is used to indicate whether the zero run value is equal to 0, the second syntax element identification information is used to indicate whether the zero run value is equal to 1, the third syntax element identification information is used to indicate whether the zero run value is equal to 2, the fourth syntax element identification information is used to indicate the parity characteristic of the first numerical value obtained after the zero run value is subjected to the first operation, the fifth syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 0, the sixth syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 1, the seventh syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 2, the eighth syntax element identification information is used to indicate whether the second numerical value obtained after the zero run value is subjected to the second operation is equal to 3, and the second numerical value identification information is used to indicate the fourth numerical value obtained after the zero run value is subjected to the fourth operation.
  47. 根据权利要求46所述的方法,其中,对所述零游程值进行第四运算,包括:The method of claim 46, wherein performing a fourth operation on the zero-run value comprises:
    根据所述零游程值与第一预设值进行减法运算,得到所述第一数值;Performing a subtraction operation on the zero-run value and a first preset value to obtain the first value;
    将所述第二数值设置为等于所述第一数值除以2的商;Setting the second value to be equal to the quotient of the first value divided by 2;
    根据所述第二数值与第二预设值进行减法运算,得到所述第四数值。The fourth value is obtained by performing a subtraction operation on the second value and the second preset value.
  48. 根据权利要求46所述的方法,其中,在所述预置参数符合第一预设条件时,对所述零游程值进行编码处理,包括:The method according to claim 46, wherein when the preset parameter meets the first preset condition, encoding the zero run value comprises:
    根据所述零游程值,确定所述第一语法元素标识信息的取值;Determining a value of the first syntax element identification information according to the zero-run value;
    基于上下文模型对所述第一语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the first syntax element identification information based on the context model, and writing the obtained encoding bits into a bitstream;
    若所述第一语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第二语法元素标识信息的取值;If the value of the first syntax element identification information is a second value, determining the value of the second syntax element identification information according to the zero run value;
    基于上下文模型对所述第二语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the second syntax element identification information based on the context model, and writing the obtained encoding bits into a bitstream;
    若所述第二语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第三语法元素标识信息的取值;If the value of the second syntax element identification information is the second value, determining the value of the third syntax element identification information according to the zero run value;
    基于上下文模型对所述第三语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the third syntax element identification information based on the context model, and writing the obtained encoding bits into a bitstream;
    若所述第三语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第四语法元素标识信息的取值和所述第五语法元素标识信息的取值;If the value of the third syntax element identification information is the second value, determining the value of the fourth syntax element identification information and the value of the fifth syntax element identification information according to the zero run value;
    基于上下文模型对所述第四语法元素标识信息的取值进行编码处理,以及基于上下文模型对所述第五语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;encoding the value of the fourth syntax element identification information based on the context model, and encoding the value of the fifth syntax element identification information based on the context model, and writing the obtained coded bits into a bitstream;
    若所述第五语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第六语法元素标识信息的取值;If the value of the fifth syntax element identification information is the second value, determining the value of the sixth syntax element identification information according to the zero run value;
    基于上下文模型对所述第六语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the sixth syntax element identification information based on the context model, and writing the obtained encoding bits into a bitstream;
    若所述第六语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第七语法元素标识信息的取值;If the value of the sixth syntax element identification information is the second value, determining the value of the seventh syntax element identification information according to the zero run value;
    基于上下文模型对所述第七语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the seventh syntax element identification information based on the context model, and writing the obtained encoding bits into a bitstream;
    若所述第七语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第八语法元素标识信息的取值;If the value of the seventh syntax element identification information is the second value, determining the value of the eighth syntax element identification information according to the zero run value;
    基于上下文模型对所述第八语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the eighth syntax element identification information based on the context model, and writing the obtained encoding bits into a bitstream;
    若所述第八语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第二数值标识信息的取值;If the value of the eighth syntax element identification information is the second value, determining the value of the second numerical identification information according to the zero run value;
    基于旁路模型对所述第二数值标识信息的取值进行编码处理,将所得到的编码比特写入码流。The value of the second numerical identification information is encoded based on the bypass model, and the obtained encoded bits are written into the bit stream.
  49. 根据权利要求48所述的方法,其中,所述方法还包括:The method according to claim 48, wherein the method further comprises:
    在每一次基于上下文模型对以下的语法元素标识信息编码完成后,对所述预置参数的取值执行一次减1操作:After the following syntax element identification information is encoded based on the context model each time, a subtraction operation is performed on the value of the preset parameter:
    所述第一语法元素标识信息、所述第二语法元素标识信息、所述第三语法元素标识信息、所述第四语法元素标识信息、所述第五语法元素标识信息、所述第六语法元素标识信息、所述第七语法元素标识信息和所述第八语法元素标识信息。The first syntax element identification information, the second syntax element identification information, the third syntax element identification information, the fourth syntax element identification information, the fifth syntax element identification information, the sixth syntax element identification information, the seventh syntax element identification information and the eighth syntax element identification information.
  50. 根据权利要求46所述的方法,其中,在所述预置参数符合第二预设条件时,对所述零游程值进行编码处理,包括:The method according to claim 46, wherein when the preset parameter meets the second preset condition, encoding the zero run value comprises:
    根据所述零游程值,确定所述第一语法元素标识信息的取值;Determining a value of the first syntax element identification information according to the zero-run value;
    基于旁路模型对所述第一语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the first syntax element identification information based on the bypass model, and writing the obtained encoding bits into the bitstream;
    若所述第一语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第二语法元素标识信息的取值;If the value of the first syntax element identification information is a second value, determining the value of the second syntax element identification information according to the zero run value;
    基于旁路模型对所述第二语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the second syntax element identification information based on the bypass model, and writing the obtained encoding bits into a bitstream;
    若所述第二语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第三语法元素标识信息的取值;If the value of the second syntax element identification information is the second value, determining the value of the third syntax element identification information according to the zero run value;
    基于旁路模型对所述第三语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the third syntax element identification information based on the bypass model, and writing the obtained encoding bits into a bitstream;
    若所述第三语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第四语法元素标识信息的取值和所述第五语法元素标识信息的取值;If the value of the third syntax element identification information is the second value, determining the value of the fourth syntax element identification information and the value of the fifth syntax element identification information according to the zero run value;
    基于旁路模型对所述第四语法元素标识信息的取值进行编码处理,以及基于旁路模型对所述第五语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;encoding the value of the fourth syntax element identification information based on the bypass model, and encoding the value of the fifth syntax element identification information based on the bypass model, and writing the obtained coded bits into a bitstream;
    若所述第五语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第六语法元素标识信息的取值;If the value of the fifth syntax element identification information is the second value, determining the value of the sixth syntax element identification information according to the zero run value;
    基于旁路模型对所述第六语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the sixth syntax element identification information based on the bypass model, and writing the obtained encoding bits into a bitstream;
    若所述第六语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第七语法元素标识信息的取值;If the value of the sixth syntax element identification information is the second value, determining the value of the seventh syntax element identification information according to the zero run value;
    基于旁路模型对所述第七语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the seventh syntax element identification information based on the bypass model, and writing the obtained encoding bits into a bitstream;
    若所述第七语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第八语法元素标识信息的取值;If the value of the seventh syntax element identification information is the second value, determining the value of the eighth syntax element identification information according to the zero run value;
    基于旁路模型对所述第八语法元素标识信息的取值进行编码处理,将所得到的编码比特写入码流;Performing encoding processing on the value of the eighth syntax element identification information based on the bypass model, and writing the obtained encoding bits into a bitstream;
    若所述第八语法元素标识信息的取值为第二值,则根据所述零游程值,确定所述第二数值标识信息的取值;If the value of the eighth syntax element identification information is the second value, determining the value of the second numerical identification information according to the zero run value;
    基于旁路模型对所述第二数值标识信息的取值进行编码处理,将所得到的编码比特写入码流。The value of the second numerical identification information is encoded based on the bypass model, and the obtained encoded bits are written into the bit stream.
  51. 根据权利要求48或50所述的方法,其中,所述根据所述零游程值,确定所述第二数值标识信息的取值,包括:The method according to claim 48 or 50, wherein determining the value of the second numerical identification information according to the zero run value comprises:
    根据所述零游程值与第一预设值进行减法运算,得到所述第一数值;Performing a subtraction operation on the zero-run value and a first preset value to obtain the first value;
    将所述第二数值设置为等于所述第一数值除以2的商;Setting the second value to be equal to the quotient of the first value divided by 2;
    根据所述第二数值与第二预设值进行减法运算,确定所述第二数值标识信息的取值。The value of the second numerical identification information is determined by performing a subtraction operation on the second numerical value and a second preset value.
  52. 根据权利要求48或50所述的方法,其中,所述基于旁路模型对所述第二数值标识信息的取值进行编码处理,包括:The method according to claim 48 or 50, wherein the encoding processing of the value of the second numerical identification information based on the bypass model comprises:
    对所述第二数值标识信息的取值进行二值化处理,得到至少一个二值符号;Binarizing the value of the second numerical identification information to obtain at least one binary symbol;
    基于旁路模型对所述至少一个二值符号依次进行编码处理,将所得到的编码比特写入码流。The at least one binary symbol is encoded in sequence based on the bypass model, and the obtained encoded bits are written into a bit stream.
  53. 根据权利要求42、44、48和50中的任一项所述的方法,其中,所述根据所述零游程值,确定所述第一语法元素标识信息的取值,包括:The method according to any one of claims 42, 44, 48 and 50, wherein determining the value of the first syntax element identification information according to the zero run value comprises:
    若所述零游程值等于0,则确定所述第一语法元素标识信息的取值为第一值;If the zero-run value is equal to 0, determining that the value of the first syntax element identification information is a first value;
    若所述零游程值不等于0,则确定所述第一语法元素标识信息的取值为第二值。If the zero-run value is not equal to 0, it is determined that the value of the first syntax element identification information is a second value.
  54. 根据权利要求42、44、48和50中的任一项所述的方法,其中,所述根据所述零游程值,确定所述第二语法元素标识信息的取值,包括:The method according to any one of claims 42, 44, 48 and 50, wherein determining the value of the second syntax element identification information according to the zero run value comprises:
    若所述零游程值等于1,则确定所述第二语法元素标识信息的取值为第一值;If the zero-run value is equal to 1, determining that the value of the second syntax element identification information is the first value;
    若所述零游程值不等于1,则确定所述第二语法元素标识信息的取值为第二值。If the zero run value is not equal to 1, it is determined that the value of the second syntax element identification information is a second value.
  55. 根据权利要求42、44、48和50中的任一项所述的方法,其中,所述根据所述零游程值,确定所述第三语法元素标识信息的取值,包括:The method according to any one of claims 42, 44, 48 and 50, wherein determining the value of the third syntax element identification information according to the zero run value comprises:
    若所述零游程值等于2,则确定所述第三语法元素标识信息的取值为第一值;If the zero run value is equal to 2, determining that the value of the third syntax element identification information is the first value;
    若所述零游程值不等于2,则确定所述第三语法元素标识信息的取值为第二值。If the zero run value is not equal to 2, it is determined that the value of the third syntax element identification information is the second value.
  56. 根据权利要求42、44、48和50中的任一项所述的方法,其中,所述根据所述零游程值,确定所述第四语法元素标识信息的取值,包括:The method according to any one of claims 42, 44, 48 and 50, wherein determining the value of the fourth syntax element identification information according to the zero run value comprises:
    若所述第一数值为奇数,则确定所述第四语法元素标识信息的取值为第一值;If the first value is an odd number, determining that the value of the fourth syntax element identification information is the first value;
    若所述第一数值为偶数,则确定所述第四语法元素标识信息的取值为第二值;If the first value is an even number, determining that the value of the fourth syntax element identification information is a second value;
    或者,or,
    若所述第一数值除以2的余数为1,则确定所述第四语法元素标识信息的取值为第一值;If the remainder when the first value is divided by 2 is 1, determining that the value of the fourth syntax element identification information is the first value;
    若所述第一数值除以2的余数为0,则确定所述第四语法元素标识信息的取值为第二值。If the remainder when the first value is divided by 2 is 0, it is determined that the value of the fourth syntax element identification information is the second value.
  57. 根据权利要求48或50所述的方法,其中,所述根据所述零游程值,确定所述第五语法元素标识信息的取值,包括:The method according to claim 48 or 50, wherein determining the value of the fifth syntax element identification information according to the zero run value comprises:
    若所述第二数值等于0,则确定所述第五语法元素标识信息的取值为第一值;If the second value is equal to 0, determining that the value of the fifth syntax element identification information is the first value;
    若所述第二数值不等于0,则确定所述第五语法元素标识信息的取值为第二值。If the second value is not equal to 0, it is determined that the value of the fifth syntax element identification information is the second value.
  58. 根据权利要求48或50所述的方法,其中,所述根据所述零游程值,确定所述第六语法元素标识信息的取值,包括:The method according to claim 48 or 50, wherein determining the value of the sixth syntax element identification information according to the zero run value comprises:
    若所述第二数值等于1,则确定所述第六语法元素标识信息的取值为第一值;If the second value is equal to 1, determining that the value of the sixth syntax element identification information is the first value;
    若所述第二数值不等于1,则确定所述第六语法元素标识信息的取值为第二值。If the second value is not equal to 1, it is determined that the value of the sixth syntax element identification information is the second value.
  59. 根据权利要求48或50所述的方法,其中,所述根据所述零游程值,确定所述第七语法元素标识信息的取值,包括:The method according to claim 48 or 50, wherein the determining, according to the zero-run value, a value of the seventh syntax element identification information comprises:
    若所述第二数值等于2,则确定所述第七语法元素标识信息的取值为第一值;If the second value is equal to 2, determining that the value of the seventh syntax element identification information is the first value;
    若所述第二数值不等于2,则确定所述第七语法元素标识信息的取值为第二值。If the second value is not equal to 2, it is determined that the value of the seventh syntax element identification information is the second value.
  60. 根据权利要求48或50所述的方法,其中,所述根据所述零游程值,确定所述第八语法元素标识信息的取值,包括:The method according to claim 48 or 50, wherein determining the value of the eighth syntax element identification information according to the zero run value comprises:
    若所述第二数值等于3,则确定所述第八语法元素标识信息的取值为第一值;If the second value is equal to 3, determining that the value of the eighth syntax element identification information is the first value;
    若所述第二数值不等于3,则确定所述第八语法元素标识信息的取值为第二值。If the second value is not equal to 3, it is determined that the value of the eighth syntax element identification information is the second value.
  61. 一种码流,其中,所述码流是根据待编码信息进行比特编码生成的;其中,所述待编码信息包括下述至少一项:A code stream, wherein the code stream is generated by bit encoding according to information to be encoded; wherein the information to be encoded includes at least one of the following:
    属性量化残差值、第一语法元素标识信息、第二语法元素标识信息、第三语法元素标识信息、第四语法元素标识信息、第五语法元素标识信息、第六语法元素标识信息、第七语法元素标识信息、第八语法元素标识信息、第一数值标识信息和第二数值标识信息。attribute quantization residual value, first grammatical element identification information, second grammatical element identification information, third grammatical element identification information, fourth grammatical element identification information, fifth grammatical element identification information, sixth grammatical element identification information, seventh grammatical element identification information, eighth grammatical element identification information, first numerical identification information and second numerical identification information.
  62. 一种编码器,所述编码器包括第一确定单元和编码单元;其中,An encoder comprises a first determining unit and an encoding unit; wherein:
    所述第一确定单元,配置为确定零游程值以及所述零游程值对应的预置参数;以及根据所述零游程值,确定至少一个第一类语法元素标识信息的取值和至少一个第二类语法元素标识信息的取值;The first determining unit is configured to determine a zero-run value and a preset parameter corresponding to the zero-run value; and determine a value of at least one first-category syntax element identification information and a value of at least one second-category syntax element identification information according to the zero-run value;
    所述编码单元,配置为若所述预置参数符合第一预设条件,则对所述至少一个第一类语法元素标识信息的取值进行基于上下文模型的编码处理,以及对所述至少一个第二类语法元素标识信息的取值进行基于旁路模型的编码处理,将所得到的编码比特写入码流。The encoding unit is configured to, if the preset parameter meets the first preset condition, perform context model-based encoding processing on the value of the at least one first-category syntax element identification information, and perform bypass model-based encoding processing on the value of the at least one second-category syntax element identification information, and write the obtained encoded bits into the bitstream.
  63. 一种编码器,所述编码器包括第一存储器和第一处理器;其中,An encoder comprises a first memory and a first processor; wherein:
    所述第一存储器,用于存储能够在所述第一处理器上运行的计算机程序;The first memory is used to store a computer program that can be run on the first processor;
    所述第一处理器,用于在运行所述计算机程序时,执行如权利要求29至60中任一项所述的方法。The first processor is configured to execute the method according to any one of claims 29 to 60 when running the computer program.
  64. 一种解码器,所述解码器包括第二确定单元和解码单元;其中,A decoder, comprising a second determining unit and a decoding unit; wherein:
    所述第二确定单元,配置为确定零游程值对应的预置参数;The second determining unit is configured to determine a preset parameter corresponding to the zero-run value;
    所述解码单元,配置为若所述预置参数符合第一预设条件,则对至少一个第一类语法元素标识信息进行基于上下文模型的解码处理,以及对至少一个第二类语法元素标识信息进行基于旁路模型的解码处理,确定所述至少一个第一类语法元素标识信息的取值和所述至少一个第二类语法元素标识信息的取值;The decoding unit is configured to, if the preset parameter meets the first preset condition, perform a context model-based decoding process on at least one first-category syntax element identification information, and perform a bypass model-based decoding process on at least one second-category syntax element identification information, and determine a value of the at least one first-category syntax element identification information and a value of the at least one second-category syntax element identification information;
    所述第二确定单元,还配置为根据所述至少一个第一类语法元素标识信息的取值和所述至少一个第二类语法元素标识信息的取值,确定所述零游程值。The second determination unit is further configured to determine the zero run value according to a value of the at least one first-category syntax element identification information and a value of the at least one second-category syntax element identification information.
  65. 一种解码器,所述解码器包括第二存储器和第二处理器;其中,A decoder, comprising a second memory and a second processor; wherein:
    所述第二存储器,用于存储能够在所述第二处理器上运行的计算机程序;The second memory is used to store a computer program that can be run on the second processor;
    所述第二处理器,用于在运行所述计算机程序时,执行如权利要求1至28中任一项所述的方法。The second processor is configured to execute the method according to any one of claims 1 to 28 when running the computer program.
  66. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序被执行时实现如权利要求1至28中任一项所述的方法、或者实现如权利要求29至60中任一项所述的方法。A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 28 is implemented, or the method according to any one of claims 29 to 60 is implemented.
PCT/CN2022/137381 2022-12-07 2022-12-07 Encoding method, decoding method, code stream, encoder, decoder, and storage medium WO2024119420A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/137381 WO2024119420A1 (en) 2022-12-07 2022-12-07 Encoding method, decoding method, code stream, encoder, decoder, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/137381 WO2024119420A1 (en) 2022-12-07 2022-12-07 Encoding method, decoding method, code stream, encoder, decoder, and storage medium

Publications (1)

Publication Number Publication Date
WO2024119420A1 true WO2024119420A1 (en) 2024-06-13

Family

ID=91378236

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/137381 WO2024119420A1 (en) 2022-12-07 2022-12-07 Encoding method, decoding method, code stream, encoder, decoder, and storage medium

Country Status (1)

Country Link
WO (1) WO2024119420A1 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112352431A (en) * 2019-09-30 2021-02-09 浙江大学 Data encoding method, data decoding method, data encoding equipment, data decoding equipment and storage medium
CN112565734A (en) * 2020-12-03 2021-03-26 西安电子科技大学 Point cloud attribute coding and decoding method and device based on hybrid coding
US20210297685A1 (en) * 2020-03-20 2021-09-23 Qualcomm Incorporated Coefficient coding of transform skip blocks in video coding
US20210385303A1 (en) * 2020-06-09 2021-12-09 Qualcomm Incorporated Attribute residual coding in g-pcc
CN113840150A (en) * 2021-09-17 2021-12-24 中山大学 Point cloud reflectivity attribute entropy coding method
CN113905242A (en) * 2021-09-17 2022-01-07 中山大学 Point cloud color attribute self-adaptive compression stroke coding method
CN114467310A (en) * 2019-08-31 2022-05-10 Lg 电子株式会社 Image decoding method and device for residual data coding in image coding system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114467310A (en) * 2019-08-31 2022-05-10 Lg 电子株式会社 Image decoding method and device for residual data coding in image coding system
CN112352431A (en) * 2019-09-30 2021-02-09 浙江大学 Data encoding method, data decoding method, data encoding equipment, data decoding equipment and storage medium
US20210297685A1 (en) * 2020-03-20 2021-09-23 Qualcomm Incorporated Coefficient coding of transform skip blocks in video coding
US20210385303A1 (en) * 2020-06-09 2021-12-09 Qualcomm Incorporated Attribute residual coding in g-pcc
CN112565734A (en) * 2020-12-03 2021-03-26 西安电子科技大学 Point cloud attribute coding and decoding method and device based on hybrid coding
CN113840150A (en) * 2021-09-17 2021-12-24 中山大学 Point cloud reflectivity attribute entropy coding method
CN113905242A (en) * 2021-09-17 2022-01-07 中山大学 Point cloud color attribute self-adaptive compression stroke coding method

Similar Documents

Publication Publication Date Title
GB2558314A (en) Improved attribute mapping to encode and decode 3D models
US20220321912A1 (en) Point cloud data transmission device, point cloud data transmission method, point cloud data reception device, and point cloud data reception method
US12020461B2 (en) Method and apparatus for Haar-based point cloud coding
WO2022133753A1 (en) Point cloud encoding and decoding methods and systems, point cloud encoder, and point cloud decoder
CN114598883A (en) Point cloud attribute prediction method, encoder, decoder and storage medium
CN115086658A (en) Point cloud data processing method and device, storage medium and encoding and decoding equipment
WO2024119420A1 (en) Encoding method, decoding method, code stream, encoder, decoder, and storage medium
WO2024119419A1 (en) Encoding method, decoding method, bit stream, encoder, decoder, and storage medium
WO2024007144A1 (en) Encoding method, decoding method, code stream, encoders, decoders and storage medium
WO2024103304A1 (en) Point cloud encoding method, point cloud decoding method, encoder, decoder, code stream, and storage medium
WO2023240662A1 (en) Encoding method, decoding method, encoder, decoder, and storage medium
WO2023173237A1 (en) Encoding method, decoding method, bit stream, encoder, decoder, and storage medium
WO2023173238A1 (en) Encoding method, decoding method, code stream, encoder, decoder, and storage medium
WO2024119518A1 (en) Encoding method, decoding method, and decoder, encoder, code stream and storage medium
WO2023103565A1 (en) Point cloud attribute information encoding and decoding method and apparatus, device, and storage medium
WO2023240660A1 (en) Decoding method, encoding method, decoder, and encoder
WO2024082152A1 (en) Encoding and decoding methods and apparatuses, encoder and decoder, code stream, device, and storage medium
CN115474041B (en) Method and device for predicting point cloud attribute and related equipment
WO2024065269A1 (en) Point cloud encoding and decoding method and apparatus, device, and storage medium
WO2023024842A1 (en) Point cloud encoding/decoding method, apparatus and device, and storage medium
WO2022257143A1 (en) Intra-frame prediction method and apparatus, encoding method and apparatus, decoding method and apparatus, codec, device and medium
WO2024065406A1 (en) Encoding and decoding methods, bit stream, encoder, decoder, and storage medium
WO2024060161A1 (en) Encoding method, decoding method, encoder, decoder and storage medium
WO2024145953A1 (en) Decoding method, encoding method, decoder, and encoder
WO2022257145A1 (en) Point cloud attribute prediction method and apparatus, and codec