Detailed Description
The technical solutions of the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which are derived by a person skilled in the art based on the embodiments of the application, fall within the scope of protection of the application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or otherwise described herein, and that the "first" and "second" distinguishing between objects generally are not limited in number to the extent that the first object may, for example, be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/" generally means a relationship in which the associated object is an "or" before and after.
The list construction device corresponding to the list construction method in the embodiment of the application may be a terminal, which may also be referred to as a terminal device or a User Equipment (UE), and the terminal may be a Mobile phone, a tablet (Tablet Personal Computer), a Laptop (Laptop Computer) or a terminal-side device called a notebook, a Personal digital assistant (Personal DIGITAL ASSISTANT, PDA), a palm Computer, a netbook, an ultra-Mobile Personal Computer (ultra-Mobile Personal Computer, UMPC), a Mobile internet appliance (Mobile INTERNET DEVICE, MID), an augmented reality (augmented reality, AR)/Virtual Reality (VR) device, a robot, a wearable device (Wearable Device) or a vehicle-mounted device (VUE), a pedestrian terminal (PUE), a smart home device with a wireless communication function, such as a refrigerator, a television, a washing machine, or furniture, a game machine, a Personal Computer (Personal Computer, PC), a teller machine, or a self-service machine, and the like, and the wearable device includes a smart watch, a smart ring, a headset, a smart glasses, a smart bracelet, a smart necklace, a smart bracelet, a smart leg, and the like. It should be noted that, the embodiment of the present application is not limited to a specific type of terminal.
For ease of understanding, some of the following descriptions are directed to embodiments of the present application:
Referring to fig. 1, as shown in fig. 1, in the digital audio/video codec technology standard, a point cloud compression (Geometry Point Cloud Compression, G-PCC) point cloud encoding device based on geometry may be used to encode attribute information of a point cloud. The method comprises the steps of carrying out color conversion and re-coloring on attribute information of point cloud, carrying out region self-adaptive transformation based on up-sampling prediction on the attribute information after re-coloring based on reconstruction geometric information, or carrying out lifting transformation based on hierarchical structure division to obtain a transformation coefficient, quantizing the transformation coefficient to obtain a quantization coefficient, and finally carrying out arithmetic coding on the quantization coefficient to obtain an attribute bit stream.
The method comprises the steps of constructing a transformation tree structure of a point cloud, carrying out up-sampling prediction and Region self-adaptive transformation (Region ADAPTIVE HARR Transform, RAHT) layer by layer from a root node of the transformation tree structure, directly carrying out RAHT transformation on attribute information of a current node if the current node is the root node to obtain a DC coefficient and an AC coefficient, and judging whether to predict the current node according to a grandfather node and a father node of the current node if the current node is not the root node. If the current node is required to be predicted, the attribute information of the current node is predicted to obtain an attribute predicted value, then the attribute predicted value and the original attribute value of the current node are respectively subjected to RAHT transformation, an AC coefficient residual error is calculated, and if the current node is not required to be predicted, the original attribute value of the current node is directly subjected to RAHT transformation to obtain an AC coefficient.
Firstly, carrying out hierarchical division on point cloud through Level of Detail (LoD) division, and establishing a hierarchical structure of the point cloud;
Then, the nodes of the bottom level and the nodes which are positioned at the same level with the current node are used as reference points, the current node searches in the reference points, a plurality of nearest reference points are selected as prediction reference points, linear interpolation prediction is carried out by using the reconstruction attribute values of the plurality of prediction reference points, and the predicted values obtained by prediction are subjected to lifting transformation.
It should be understood that the above arithmetic coding includes zero run coding and transform coefficient coding, and generates a code stream by performing zero run coding on quantized transform coefficients and then performing transform coefficient coding on the transform coefficients. The following briefly describes the implementation process of zero run coding (1) by determining whether the run (length) value of the transform coefficient is 0 through the context probability model 1, if 0, coding one bit 0 to end the current coding, and if not, coding one bit 1 to continue the following determination.
(2) And judging whether the run value of the transformation coefficient is 1 or not through the context probability model 2, if the run value is 1, encoding one bit of 0 to finish the current encoding, and if the run value is not 1, encoding one bit of 1 to continue the following judgment.
(3) Judging whether the run value of the transformation coefficient is 2 or not through the context probability model 3, if the run value is 2, encoding one bit 0 to finish the current encoding, and if the run value is not 2, encoding one bit 1 to continue the following judgment.
(4) Updating the run value, and subtracting 3 from the run value to obtain an updated run value.
(5) Dividing the run value by 2 to obtain a prefix (prefix) value;
(6) Performing unitary code encoding on the prefix value through a context probability model 4;
Judging whether the prefix value is 0, if so, encoding one bit of 0, and using a bypass encoding mode to encode the remainder of the run value taking 2, if not, encoding one bit of 1, and continuing the following judgment;
Judging whether the prefix value is 1, if so, encoding one bit of 0, and using a bypass encoding mode to encode the remainder of the run value taking 2, if not, encoding one bit of 1, and continuing the following judgment;
judging whether the prefix value is 2, if so, encoding one bit of 0, and using a bypass encoding mode to encode a run value to take the remainder of 2, if not, encoding one bit of 1, and continuing the following judgment;
judging whether the prefix value is 3, if 3, encoding one bit of 0, and using a bypass encoding mode to encode the remainder of the run value taking 2, if not 3, encoding one bit of 1, and ending the encoding.
(7) And updating the run value, and subtracting 8 from the run value to obtain an updated run value.
(8) The updated run values are encoded using second order exponential golomb with the context probability model 5.
The implementation of transform coefficient coding is briefly described below:
(1) Judging whether the value (value) of the transformation coefficient is equal to 0 or not through the context probability model 1, ending the coding if the value (value) is equal to 0, coding 1 if the value (value) is not equal to 0, and continuing the following coding;
(2) Judging whether the value (value) of the transformation coefficient is equal to 1 or not through the context probability model 1, ending the coding if the value (value) is equal to 1, coding 1 if the value (value) is not equal to 1, and continuing the following coding;
(3) The prefix codes of the generated code stream are encoded by a first set of context probability models (comprising context probability model 3, context probability model 4 and context probability model 5), and the suffix codes of the generated code stream are encoded by a second set of context probability models (comprising context probability model 6, context probability model 7 and context probability model 8).
Referring to fig. 2, as shown in fig. 2, in the digital audio/video codec technology standard, a point cloud decoding device based on geometric point cloud compression (Geometry Point Cloud Compression, G-PCC) may be used to decode attribute information of a point cloud. It should be understood that the implementation process of the above-mentioned G-PCC point cloud decoding device for decoding the attribute information of the point cloud is the inverse of the encoding process, and will not be repeated here. As can be seen from the above, in the process of coding the transform coefficients, the context probability model 1 and the context probability model 2 need to be used for coding the transform coefficients according to the values of the transform coefficients, and then the two sets of context probability models need to be used for coding the transform coefficients, which results in a larger number of bits of the code stream generated by the coding.
In order to solve the technical problems, the application provides a transform coefficient coding method which can be applied to a coding end. The transform coefficient coding method provided by the embodiment of the application is described in detail below through some embodiments and application scenarios thereof with reference to the accompanying drawings.
Referring to fig. 3, fig. 3 is a flowchart of a transform coefficient encoding method according to an embodiment of the application. The transform coefficient coding method provided by the embodiment comprises the following steps:
S301, the encoding end obtains a transformation coefficient corresponding to the point cloud.
It should be understood that the above-mentioned transform coefficient is a transform coefficient corresponding to the point cloud, that is, a quantized transform coefficient obtained by performing an area adaptive transform based on upsampling prediction or performing a lifting transform based on hierarchical structure division on attribute information of the point cloud. The attribute information includes color information, and the transform coefficient is obtained by performing an area adaptive transform based on upsampling prediction on the color information or performing a lifting transform based on hierarchical structure division, that is, the transform coefficient includes three color components, i.e., a Y component, a U component, and a V component, respectively.
In this step, the encoding end obtains a transform coefficient corresponding to the point cloud, where the transform coefficient includes a DC coefficient and at least two AC coefficients.
S302, the encoding end encodes the DC coefficient according to a first order corresponding to the DC coefficient and a context probability model corresponding to each component of the DC coefficient.
In this step, the DC coefficient may be encoded according to the first order and the context probability model corresponding to each component of the DC coefficient, for a specific implementation, please refer to the following examples.
And S303, the encoding end encodes each AC coefficient according to the second order corresponding to each AC coefficient and the context probability model corresponding to each component of each AC coefficient.
In this step, a second level corresponding to the AC coefficient may be determined based on the first level and the level corresponding to the transform coefficient, and each AC coefficient may be encoded according to the second level and the context probability model corresponding to each component of each AC coefficient, for a specific implementation, please refer to the following embodiments.
S304, the encoding end generates a target code stream based on the encoding result of the DC coefficient and the encoding result of each AC coefficient.
The encoding end encodes the DC coefficients to obtain a binary number set, which can be understood as the encoding result of the DC coefficients, and encodes each AC coefficient to obtain a binary number set, which can be understood as the encoding result of the AC coefficients. That is, the encoding end generates a target code stream by encoding the DC coefficient and the AC coefficient in one encoding process.
Compared with the related art, the method for encoding the transformation coefficient provided by the embodiment of the application has the advantages that the DC coefficient and the AC coefficient included in the transformation coefficient are directly encoded through the context probability model after the transformation coefficient is acquired, so that the transformation coefficient encoding of the transformation coefficient can be realized through fewer context probability models, and the bit number of a code stream is further reduced.
Optionally, before the encoding of the DC coefficient according to the first order corresponding to the DC coefficient and the context probability model corresponding to each component of the DC coefficient, the method further comprises:
and determining a first order corresponding to the DC coefficient according to the Columbus order corresponding to at least part of the components of the DC coefficient.
In this embodiment, the first order corresponding to the DC coefficient may be determined according to the golomb order corresponding to at least a part of the components of the DC coefficient.
Optionally, after the golomb orders respectively corresponding to the Y component, the U component, and the V component of the DC coefficient are acquired, the golomb order corresponding to any one component is determined as the first order.
Optionally, the determining the first order corresponding to the DC coefficient according to the golomb order corresponding to at least part of the component of the DC coefficient includes:
Acquiring the Columbus order corresponding to each component of the DC coefficient;
and determining the Columbus order with the highest occurrence frequency in the Columbus orders corresponding to each component as the first order corresponding to the DC coefficient.
In this embodiment, the golomb orders corresponding to the Y component, the U component, and the V component of the DC coefficient may be obtained, for example, log2 may be taken for the Y component of the DC coefficient, to obtain the golomb orders corresponding to the Y component. And then, the golomb order with the highest occurrence frequency among the 3 golomb orders is determined as the first order.
In an embodiment, if the occurrence frequency of the golomb order corresponding to each component is the same, the golomb order corresponding to any component may be determined as the first order.
Optionally, the determining the first order corresponding to the DC coefficient according to the golomb order corresponding to at least part of the component of the DC coefficient includes:
Acquiring the Columbus order corresponding to each component of the DC coefficient;
and rounding the average value of the Columbus orders corresponding to each component of the DC coefficient to obtain a first order corresponding to the DC coefficient.
In this embodiment, after the golomb orders corresponding to the Y component, the U component, and the V component of the DC coefficient are obtained, the average value of the 3 golomb orders is rounded to obtain the first order.
Optionally, the DC coefficient includes a Y component, a U component, and a V component, and the encoding the DC coefficient according to a first order corresponding to the DC coefficient and a context probability model corresponding to each component of the DC coefficient includes:
Performing Columbus encoding on the U component and the V component in the DC coefficient through a first set of context probability models;
The Y component of the DC coefficient is golomb encoded by a second set of context probability models.
In this embodiment, the U component and the V component in the DC coefficient are golomb encoded by a first set of context probability models, which includes a plurality of context probability models, optionally, 3 context probability models. It should be appreciated that the coding order of golomb coding the U and V components is the same as the first order.
In this embodiment, the Y component in the DC coefficient is golomb encoded by a second set of context probability models comprising a plurality of context probability models, optionally 3 context probability models. It should be appreciated that the coding order of the golomb coding of the Y component is the same as the first order.
The plurality of context probability models included in the second set of context probability models are different from the plurality of context probability models included in the first set of context probability models, the DC coefficients are encoded by the first set of context probability models to generate prefix codes corresponding to the DC coefficients, and the DC coefficients are encoded by the second set of context probability models to generate suffix codes corresponding to the DC coefficients.
In this embodiment, the DC coefficient is subjected to higher-order exponential golomb coding according to the first order, the first set of context probability models, and the second set of context probability models, so as to reduce the number of bits of the code stream generated by the coding.
Optionally, before the encoding of each AC coefficient according to the second order corresponding to each AC coefficient and the context probability model corresponding to each component of each AC coefficient, the method further includes:
And determining the difference between the first order and the first numerical value as a second order.
In this embodiment, the second order may be determined by the following formula:
color_ExpGolomb_order_AC=color_ExpGolomb_order_DC-(n+n*(level_max-level_cur)/3)
Color_ ExpGolomb _order_ac represents the second order, color_ ExpGolomb _order_dc represents the first order, n represents the first preset value, level_max represents the preset total level, and level_cur represents the level to which the transform coefficient corresponds.
Optionally, the DC coefficient includes a Y component, a U component, and a V component, and the encoding the DC coefficient according to a first order corresponding to the DC coefficient and a context probability model corresponding to each component of the DC coefficient includes:
determining the coding order of each component of the DC coefficient for performing Columbus coding according to the first order corresponding to the DC coefficient;
each component of the DC coefficient is golombly encoded with a first set of context probability models and a second set of context probability models based on the encoding order.
In this embodiment, after determining the first order corresponding to the DC coefficient, each component of the DC coefficient may be golombly encoded by the first set of context probability models and the second set of context probability models.
One possible situation is that the first order corresponding to the DC coefficient is greater than the third preset value and less than or equal to the fourth preset value. In this case, the coding order of golomb coding the Y component in the DC coefficient is the first order, and the coding order of golomb coding the U component and the V component in the DC coefficient is 1.
Another possible situation is that the first order corresponding to the DC coefficient is larger than the fourth preset value. In this case, the encoding order of the golomb encoding of the U component and the V component in the DC coefficient is a difference between the first order and the fourth preset value, and the encoding order of the golomb encoding of the Y component in the DC coefficient is 1.
Another possible situation is that the first order corresponding to the DC coefficient is smaller than or equal to the third preset value. In this case, the encoding order of golomb encoding each component of the DC coefficient is 1.
Optionally, the third preset value is 1, and the fourth preset value is 2.
In this embodiment, at least some components in the DC coefficients are higher order exponential golomb encoded according to the first order, the first set of context probability models, and the second set of context probability models, thereby reducing the number of bits of the encoded code stream.
Optionally, the AC coefficients include a Y component, a U component, and a V component, and the encoding each AC coefficient according to the second order corresponding to each AC coefficient and the context probability model corresponding to each component of each AC coefficient includes:
determining the coding order of each component of the AC coefficient for performing Columbus coding according to the second order corresponding to each AC coefficient;
each component of the AC coefficient is golombly encoded with a first set of context probability models and a second set of context probability models based on the encoding order.
As described above, the first set of context probability models comprises a plurality of context probability models, optionally the context probability models comprise 3 context probability models, and the second set of context probability models comprises a plurality of context probability models, optionally the second set of context probability models comprises 3 context probability models.
It should be noted that, the multiple context probability models included in the second set of context probability models are different from the multiple context probability models included in the first set of context probability models, the AC coefficients are encoded by the first set of context probability models, prefix codes corresponding to the AC coefficients are generated, and the AC coefficients are encoded by the second set of context probability models, so as to generate suffix codes corresponding to the AC coefficients.
In this embodiment, after determining the second order corresponding to the AC coefficient, each component of the AC coefficient may be golombly encoded by the first set of context probability models and the second set of context probability models.
One possible situation is that the second order corresponding to the AC coefficient is greater than the third preset value and less than or equal to the fourth preset value. In this case, the encoding order of golomb encoding the Y component in the AC coefficient is the second order, and the encoding order of golomb encoding the U component and the V component in the AC coefficient is 1.
Another possible situation is that the second order corresponding to the AC coefficient is larger than the fourth preset value. In this case, the encoding order of the golomb encoding of the U component and the V component in the AC coefficient is a difference between the second order and the fourth preset value, and the encoding order of the golomb encoding of the Y component in the AC coefficient is 1.
Another possible situation is that the second order corresponding to the AC coefficient is less than or equal to the third preset value. In this case, the encoding order of golomb encoding each component of the AC coefficient is 1.
Optionally, the third preset value is 1, and the fourth preset value is 2.
In this embodiment, at least some components in the AC coefficients are higher order exponential golomb encoded according to the second order, the first set of context probability models, and the second set of context probability models, thereby reducing the number of bits of the encoded code stream.
Optionally, the AC coefficients include a Y component, a U component, and a V component, and the encoding each AC coefficient according to the second order corresponding to each AC coefficient and the context probability model corresponding to each component of each AC coefficient includes:
performing golomb coding on a U component and a V component in the AC coefficient by a first set of context probability models;
the Y component in the AC coefficients is golomb encoded by a second set of context probability models.
In this embodiment, the U component and the V component in the AC coefficient are golombly encoded by the first set of context probability models, and the Y component in the AC coefficient is golombly encoded by the second set of context probability models, where the encoding order of the golomb encoding of the AC coefficient is the same as the second order.
It should be noted that, the multiple context probability models included in the second set of context probability models are different from the multiple context probability models included in the first set of context probability models, the AC coefficients are encoded by the first set of context probability models, prefix codes corresponding to the AC coefficients are generated, and the AC coefficients are encoded by the second set of context probability models, so as to generate suffix codes corresponding to the AC coefficients.
In this embodiment, the AC coefficients are higher order exponential golomb encoded according to the second order, the first set of context probability models, and the second set of context probability models, thereby reducing the number of bits of the encoded code stream.
Optionally, the initial probability of the context probability model is a preset probability value.
It should be understood that in the related art, the initial probabilities of the context probability models are all 0.5, that is, the number of bits required for the context probability model to encode 1 and the number of bits required for encoding 0 are the same, which makes the convergence speed of the arithmetic encoding process slower and the encoding efficiency lower.
In this embodiment, the user may set the initial probability of the context probability model by modifying the relevant parameters of the encoder, so as to set the initial probability according to the data distribution rule of the point cloud, thereby facilitating faster convergence of arithmetic coding and improving coding efficiency.
Optionally, the attribute information parameter set of the target code stream includes the first order.
Alternatively, the first order may be represented by a parameter attr_golomb_num. In this embodiment, the parameter is transmitted into the attribute information parameter set of the target code stream, so that the decoding end can decode the transform coefficient according to the parameter.
For a more intuitive understanding of the technical effects of transform coefficient encoding provided by the embodiments of the present application, please refer to table one and table two.
Table one:
| |
Y component |
U component |
V component |
| Point cloud type 1 |
-0.1052% |
-0.1164% |
-0.1291% |
| Point cloud type 2 |
-0.0938% |
-0.1126% |
-0.1188% |
| Point cloud type 2 |
-0.0442% |
-0.0443% |
-0.0449% |
| Point cloud type 4 |
-0.0823% |
-0.0645% |
-0.0825% |
| Point cloud type 5 |
-0.0167% |
-0.0093% |
-0.0097% |
And (II) table:
| |
Y component |
U component |
V component |
| Point cloud type 1 |
-0.6487% |
-0.7946% |
-0.6480% |
| Point cloud type 2 |
-0.5550% |
-0.5573% |
-0.4797% |
| Point cloud type 2 |
-0.1397% |
-0.1586% |
-0.1443% |
| Point cloud type 4 |
-0.0469% |
-0.0548% |
-0.0580% |
| Point cloud type 5 |
-0.0260% |
-0.0179% |
-0.0171% |
The values in the first table and the second table are used for representing the code rate ratio between the code stream generated by the transform coefficient coding and the code stream generated by using the related technology under the condition that the peak signal-to-noise ratio is the same, and it is understood that the lower the value is, the more the code rate is reduced.
For example, "0.1052%" in the second row and the second column in table one indicates that the code rate of the code stream corresponding to the Y component generated by the transform coefficient coding provided in the embodiment of the present application is reduced by 0.1052% compared with the code stream corresponding to the Y component generated by using the related technology.
Referring to fig. 4, fig. 4 is a flowchart illustrating a transform coefficient decoding method according to an embodiment of the application. The transform coefficient decoding method provided by the embodiment comprises the following steps:
S401, the decoding end obtains a target code stream.
The target code stream includes the encoding result of the direct current DC coefficient in the transform coefficient and the encoding result of at least two alternating current AC coefficients in the transform coefficient.
S402, the decoding end decodes the coding result of the DC coefficient according to the first order corresponding to the DC coefficient and the context probability model corresponding to each component of the DC coefficient to obtain the DC coefficient.
In this step, the decoding end may decode the encoding result of the DC coefficient according to the first order and the context probability model corresponding to each component of the DC coefficient.
S403, the decoding end decodes the encoding result of each AC coefficient according to the second order corresponding to each AC coefficient and the context probability model corresponding to each component of each AC coefficient to obtain at least two AC coefficients.
In this step, the decoding end may determine a second order based on the first order and the level corresponding to the transform coefficient, and decode the encoding result of each AC coefficient according to the second order and the context probability model corresponding to each component of each AC coefficient.
S404, the decoding end determines a transformation coefficient according to the DC coefficient and the at least two AC coefficients.
It should be understood that the transform coefficient decoding method provided in this embodiment is an inverse process of the transform coefficient encoding method described above, and will not be repeated here.
Optionally, before the decoding of the encoding result of the DC coefficient according to the first order corresponding to the DC coefficient and the context probability model corresponding to each component of the DC coefficient, the method further includes:
And acquiring the first order from the attribute information parameter set of the target code stream.
As described above, since the encoding side has the first order introduced into the attribute information parameter, the decoding side can acquire the first order from the attribute information parameter set.
Optionally, the DC coefficient includes a Y component, a U component, and a V component, and decoding the encoding result of the DC coefficient according to a first order corresponding to the DC coefficient and a context probability model corresponding to each component of the DC coefficient includes:
And performing Columbus decoding on the encoding result of the DC coefficient through the first set of context probability models and the second set of context probability models.
It should be appreciated that the decoding order of the golomb decoding of the encoding result of the DC coefficient is the same as the first order. As described above, the first set of context probability models comprises a plurality of context probability models, alternatively the first set of context probability models comprises 3 context probability models, and the second set of context probability models comprises a plurality of context probability models, alternatively the second set of context probability models comprises 3 context probability models. The second set of context probability models includes a plurality of context probability models that are different from the plurality of context probability models included in the first set of context probability models.
Optionally, before the decoding of the encoding result of each AC coefficient according to the second order corresponding to each AC coefficient and the context probability model corresponding to each component of each AC coefficient, the method further includes:
determining the difference between the first order and the first numerical value as a second order;
The first value is a sum value between a first preset value and a second value, the second value is a multiplication result between the first preset value and the second value divided by the second preset value, and the second value is a difference value between a preset total level and a level corresponding to the transformation coefficient.
The decoding end can substitute the first order into the calculation formula related to the encoding end to determine the second order. The manner in which the decoding end calculates the second order is identical to that of the encoding end and will not be repeated here.
Optionally, the DC coefficient includes a Y component, a U component, and a V component, and decoding the encoding result of the DC coefficient according to a first order corresponding to the DC coefficient and a context probability model corresponding to each component of the DC coefficient includes:
Determining a decoding order for performing Columbus decoding on each component of each DC coefficient according to a first order corresponding to each DC coefficient;
based on the decoding order, performing Columbus decoding on the encoding result of the DC coefficient through a first context probability model and a second context probability model.
In this embodiment, after determining the first order corresponding to the DC coefficient, the encoding result of the DC coefficient may be subjected to golomb decoding through the first set of context probability models and the second set of context probability models.
One possible situation is that the first order corresponding to the DC coefficient is greater than the third preset value and less than or equal to the fourth preset value. In this case, the decoding order of performing golomb decoding on the Y component in the DC coefficient is the first order, and the decoding order of performing golomb decoding on the U component and the V component in the DC coefficient is 1.
Another possible situation is that the first order corresponding to the DC coefficient is larger than the fourth preset value. In this case, the decoding order of performing golomb decoding on the U component and the V component in the DC coefficient is a difference between the first order and the fourth preset value, and the decoding order of performing golomb decoding on the Y component in the DC coefficient is 1.
Another possible situation is that the first order corresponding to the DC coefficient is smaller than or equal to the third preset value. In this case, the decoding order of golomb decoding each component of the DC coefficient is 1.
Optionally, the AC coefficients include a Y component, a U component, and a V component, and decoding the encoding result of each AC coefficient according to the second order corresponding to each AC coefficient and the context probability model corresponding to each component of each AC coefficient includes:
Determining a decoding order for performing Columbus decoding on each component of each AC coefficient according to a second order corresponding to each AC coefficient;
based on the decoding order, performing Columbus decoding on the encoding result of the AC coefficient through a first context probability model and a second context probability model.
In this embodiment, after determining the second order corresponding to the AC coefficient, the encoding result of the AC coefficient may be subjected to golomb decoding by the first set of context probability models and the second set of context probability models.
One possible situation is that the second order corresponding to the AC coefficient is greater than the third preset value and less than or equal to the fourth preset value. In this case, the decoding order of golomb decoding the Y component in the AC coefficient is the second order, and the decoding order of golomb decoding the U component and the V component in the AC coefficient is 1.
Another possible situation is that the second order corresponding to the AC coefficient is larger than the fourth preset value. In this case, the decoding order of performing golomb decoding on the U component and the V component in the AC coefficient is a difference between the second order and the fourth preset value, and the decoding order of performing golomb decoding on the Y component in the AC coefficient is 1.
Another possible situation is that the second order corresponding to the AC coefficient is less than or equal to the third preset value. In this case, the decoding order of golomb decoding each component of the AC coefficient is 1.
Optionally, the AC coefficients include a Y component, a U component, and a V component, and decoding the encoding result of each AC coefficient according to the second order corresponding to each AC coefficient and the context probability model corresponding to each component of each AC coefficient includes:
and performing Columbus decoding on the encoding result of the AC coefficient through the first set of context probability models and the second set of context probability models.
It should be appreciated that the decoding order of the golomb decoding of the encoding result of the AC coefficient is the same as the second order.
Optionally, the third preset value is 1, and the fourth preset value is 2.
Optionally, the initial probability of the context probability model is a preset probability value.
In this embodiment, the initial probability of the context probability model can be set in a self-defined manner, so that the initial probability conforming to the data distribution characteristic can be set according to the data distribution rule of the point cloud, thereby facilitating faster convergence of arithmetic decoding and improving decoding efficiency.
According to the transform coefficient coding method provided by the embodiment of the application, the execution main body can be a transform coefficient coding device. In the embodiment of the present application, a transform coefficient encoding method performed by a transform coefficient encoding apparatus is taken as an example, and the transform coefficient encoding apparatus provided by the embodiment of the present application is described.
As shown in fig. 5, an embodiment of the present application further provides a transform coefficient encoding apparatus 500, including:
The acquisition module 501 is configured to acquire a transformation coefficient corresponding to the point cloud, where the transformation coefficient includes a direct current DC coefficient and at least two alternating current AC coefficients;
A first encoding module 502, configured to encode a DC coefficient according to a first order corresponding to the DC coefficient and a context probability model corresponding to each component of the DC coefficient;
A second encoding module 503, configured to encode each AC coefficient according to a second order corresponding to each AC coefficient and a context probability model corresponding to each component of each AC coefficient;
A generating module 504, configured to generate a target code stream based on the encoding result of the DC coefficient and the encoding result of each AC coefficient.
Optionally, the transform coefficient encoding apparatus 500 further includes:
and the first determining module is used for determining a first order corresponding to the DC coefficient according to the Columbus order corresponding to at least part of the components of the DC coefficient.
Optionally, the first determining module is specifically configured to:
Acquiring the Columbus order corresponding to each component of the DC coefficient;
and determining the Columbus order with the highest occurrence frequency in the Columbus orders corresponding to each component as the first order corresponding to the DC coefficient.
Optionally, the first determining module is further specifically configured to:
Acquiring the Columbus order corresponding to each component of the DC coefficient;
and rounding the average value of the Columbus orders corresponding to each component of the DC coefficient to obtain a first order corresponding to the DC coefficient.
Optionally, the DC coefficient includes a Y component, a U component, and a V component, and the first encoding module 502 is specifically configured to:
Performing Columbus encoding on a U component and a V component in the DC coefficient through a first set of context probability models, wherein the encoding order of the Columbus encoding on the U component and the V component is the same as the first order, and the first set of context probability models comprises a plurality of context probability models;
And performing Golomb encoding on the Y component in the DC coefficient through a second set of context probability models, wherein the encoding order of the Golomb encoding on the Y component is the same as the first order, the second set of context probability models comprises a plurality of context probability models, and the plurality of context probability models included by the second set of context probability models are different from the plurality of context probability models included by the first set of context probability models.
Optionally, the transform coefficient encoding apparatus 500 further includes:
a second determining module, configured to determine a difference between the first order and the first numerical value as a second order;
The first value is a sum value between a first preset value and a second value, the second value is a multiplication result between the first preset value and the second value divided by the second preset value, and the second value is a difference value between a preset total level and a level corresponding to the transformation coefficient.
Optionally, the DC coefficient includes a Y component, a U component, and a V component, and the first encoding module 502 is further specifically configured to:
determining the coding order of each component of the DC coefficient for performing Columbus coding according to the first order corresponding to the DC coefficient;
Performing golomb coding on each component of the DC coefficient by a first set of context probability models and a second set of context probability models based on the coding order;
Wherein, when the first order corresponding to the DC coefficient is larger than a third preset value and smaller than or equal to a fourth preset value, the coding order of the Columbus coding of the Y component in the DC coefficient is the first order, the coding order of the Columbus coding of the U component and the V component in the DC coefficient is 1, or,
When the first order corresponding to the DC coefficient is larger than a fourth preset value, the coding order of the Columbus coding of the U component and the V component in the DC coefficient is the difference value between the first order and the fourth preset value, the coding order of the Columbus coding of the Y component in the DC coefficient is 1, or,
Under the condition that the first order corresponding to the DC coefficient is smaller than or equal to a third preset value, carrying out Columbus coding on each component of the DC coefficient, wherein the coding order is 1;
The first set of context probability models includes a plurality of context probability models, the second set of context probability models includes a plurality of context probability models, and the plurality of context probability models included by the second set of context probability models are different from the plurality of context probability models included by the first set of context probability models.
Optionally, the AC coefficient includes a Y component, a U component, and a V component, and the second encoding module 503 is specifically configured to:
determining the coding order of each component of the AC coefficient for performing Columbus coding according to the second order corresponding to each AC coefficient;
Performing golomb encoding on each component of the AC coefficient by a first set of context probability models and a second set of context probability models based on the encoding order;
Wherein, when the second order corresponding to the AC coefficient is larger than a third preset value and smaller than or equal to a fourth preset value, the coding order of the Columbus coding of the Y component in the AC coefficient is the second order, the coding order of the Columbus coding of the U component and the V component in the AC coefficient is 1, or,
Under the condition that the second order corresponding to the AC coefficient is larger than a fourth preset value, the coding order of the Columbus coding of the U component and the V component in the AC coefficient is the difference value between the second order and the fourth preset value, the coding order of the Columbus coding of the Y component in the AC coefficient is 1, or,
Under the condition that the second order corresponding to the AC coefficient is smaller than or equal to a third preset value, carrying out Columbus coding on each component of the AC coefficient, wherein the coding order is 1;
The first set of context probability models includes a plurality of context probability models, the second set of context probability models includes a plurality of context probability models, and the plurality of context probability models included by the second set of context probability models are different from the plurality of context probability models included by the first set of context probability models.
Optionally, the AC coefficient includes a Y component, a U component, and a V component, and the second encoding module 503 is further specifically configured to:
performing Columbus encoding on a U component and a V component in the AC coefficient through a first set of context probability models, wherein the encoding order of the Columbus encoding on the U component and the V component is the same as the second order;
and performing Golomb encoding on the Y component in the AC coefficient through a second set of context probability models, wherein the encoding order of the Golomb encoding on the Y component is the same as the second order, the second set of context probability models comprises a plurality of context probability models, and the plurality of context probability models included by the second set of context probability models are different from the plurality of context probability models included by the first set of context probability models.
Optionally, the initial probability of the context probability model is a preset probability value.
Optionally, the attribute information parameter set of the target code stream includes the first order.
Compared with the related art, the method for encoding the transformation coefficient provided by the embodiment of the application has the advantages that the DC coefficient and the AC coefficient included in the transformation coefficient are directly encoded through the context probability model after the transformation coefficient is acquired, so that the transformation coefficient encoding of the transformation coefficient can be realized through fewer context probability models, and the bit number of a code stream is further reduced.
The embodiment of the device corresponds to the embodiment of the transform coefficient coding method shown in fig. 3, and each implementation process and implementation manner of the coding end in the embodiment of the method are applicable to the embodiment of the device, and the same technical effects can be achieved.
According to the transform coefficient decoding method provided by the embodiment of the application, the execution main body can be a transform coefficient decoding device. In the embodiment of the present application, a transform coefficient decoding device is taken as an example to execute a transform coefficient decoding method.
As shown in fig. 6, an embodiment of the present application further provides a transform coefficient decoding apparatus 600, including:
A first obtaining module 601, configured to obtain a target code stream, where the target code stream includes a coding result of a direct current DC coefficient in a transform coefficient and a coding result of at least two alternating current AC coefficients in the transform coefficient;
A first decoding module 602, configured to decode a coding result of a DC coefficient according to a first order corresponding to the DC coefficient and a context probability model corresponding to each component of the DC coefficient, to obtain the DC coefficient;
A second decoding module 603, configured to decode a coding result of each AC coefficient according to a second order corresponding to each AC coefficient and a context probability model corresponding to each component of each AC coefficient, to obtain at least two AC coefficients;
a first determining module 604 for determining a transform coefficient based on the DC coefficient and the at least two AC coefficients.
Optionally, the transform coefficient decoding apparatus 600 further includes:
and the second acquisition module is used for acquiring the first order from the attribute information parameter set of the target code stream.
Optionally, the DC coefficient includes a Y component, a U component, and a V component, and the first decoding module 602 is specifically configured to:
Performing Columbus decoding on the encoding result of the DC coefficient through a first set of context probability models and a second set of context probability models;
The decoding order of the encoding result of the DC coefficient for performing Columbus decoding is the same as the first order, the first set of context probability models comprises a plurality of context probability models, the second set of context probability models comprises a plurality of context probability models, and the plurality of context probability models comprised by the second set of context probability models are different from the plurality of context probability models comprised by the first set of context probability models.
Optionally, the transform coefficient decoding apparatus 600 further includes:
a second determining module, configured to determine a difference between the first order and the first numerical value as a second order;
The first value is a sum value between a first preset value and a second value, the second value is a multiplication result between the first preset value and the second value divided by the second preset value, and the second value is a difference value between a preset total level and a level corresponding to the transformation coefficient.
Optionally, the DC coefficient includes a Y component, a U component, and a V component, and the first decoding module 601 is further specifically configured to:
Determining a decoding order for performing Columbus decoding on each component of each DC coefficient according to a first order corresponding to each DC coefficient;
Performing Columbus decoding on the encoding result of the DC coefficient through a first context probability model and a second context probability model based on the decoding order;
wherein, when the first order corresponding to the DC coefficient is larger than a third preset value and smaller than or equal to a fourth preset value, the decoding order of performing the Columbus decoding on the Y component in the DC coefficient is the first order, the decoding order of performing the Columbus decoding on the U component and the V component in the DC coefficient is 1, or,
When the first order corresponding to the DC coefficient is larger than a fourth preset value, the decoding order of performing the Columbus decoding on the U component and the V component in the DC coefficient is the difference between the first order and the fourth preset value, the decoding order of performing the Columbus decoding on the Y component in the DC coefficient is 1, or,
And when the first order corresponding to the DC coefficient is smaller than or equal to a third preset value, performing Columbus decoding on the encoding result of the DC coefficient, wherein the decoding order is 1.
Optionally, the AC coefficient includes a Y component, a U component, and a V component, and the second decoding module 603 is specifically configured to:
Determining a decoding order for performing Columbus decoding on each component of each AC coefficient according to a second order corresponding to each AC coefficient;
performing Columbus decoding on the encoding result of the AC coefficient through a first context probability model and a second context probability model based on the decoding order;
wherein, when the second order corresponding to the AC coefficient is larger than a third preset value and smaller than or equal to a fourth preset value, the decoding order of performing the Columbus decoding on the Y component in the AC coefficient is the second order, the decoding order of performing the Columbus decoding on the U component and the V component in the AC coefficient is 1, or,
When the second order corresponding to the AC coefficient is larger than a fourth preset value, the decoding order of performing the Columbus decoding on the U component and the V component in the AC coefficient is the difference between the second order and the fourth preset value, the decoding order of performing the Columbus decoding on the Y component in the AC coefficient is 1, or,
And when the second order corresponding to the AC coefficient is smaller than or equal to a third preset value, performing Columbus decoding on the encoding result of the AC coefficient, wherein the decoding order is 1.
Optionally, the AC coefficient includes a Y component, a U component, and a V component, and the second decoding module 603 is further specifically configured to:
Performing Columbus decoding on the encoding result of the AC coefficient through a first set of context probability models and a second set of context probability models;
The decoding order of the encoding result of the AC coefficient for performing Columbus decoding is the same as the second order, the first set of context probability models comprises a plurality of context probability models, the second set of context probability models comprises a plurality of context probability models, and the plurality of context probability models comprised by the second set of context probability models are different from the plurality of context probability models comprised by the first set of context probability models.
Optionally, the initial probability of the context probability model is a preset probability value.
The transform coefficient decoding device provided by the embodiment of the present application can implement each process implemented by the method embodiment of fig. 4, and achieve the same technical effects, and in order to avoid repetition, a detailed description is omitted here.
The transform coefficient encoding apparatus and the transform coefficient decoding apparatus in the embodiments of the present application may be electronic devices, for example, electronic devices having an operating system, or may be components in electronic devices, for example, integrated circuits or chips. The electronic device may be a terminal, or may be other devices than a terminal. By way of example, the terminals may include, but are not limited to, the types of terminals listed above, other devices may be servers, network attached storage (Network Attached Storage, NAS), etc., and embodiments of the present application are not limited in detail.
Optionally, as shown in fig. 7, the embodiment of the present application further provides a communication device 700, including a processor 701 and a memory 702, where the memory 702 stores a program or an instruction that can be executed on the processor 701, for example, when the communication device 700 is a terminal, the program or the instruction is executed by the processor 701 to implement each step of the above-mentioned transform coefficient encoding method embodiment, or implement each step of the above-mentioned transform coefficient decoding method embodiment, and achieve the same technical effects.
The embodiment of the application also provides a terminal, which comprises a processor and a communication interface, wherein the processor is used for executing the following operations:
Obtaining a transformation coefficient corresponding to the point cloud;
encoding a DC coefficient according to a first order corresponding to the DC coefficient and a context probability model corresponding to each component of the DC coefficient;
Encoding each AC coefficient according to a second order corresponding to each AC coefficient and a context probability model corresponding to each component of each AC coefficient;
A target code stream is generated based on the encoding result of the DC coefficient and the encoding result of each AC coefficient.
Or the processor is configured to perform the following operations:
obtaining a target code stream;
Decoding the coding result of the DC coefficient according to a first order corresponding to the DC coefficient and a context probability model corresponding to each component of the DC coefficient to obtain the DC coefficient;
decoding the encoding result of each AC coefficient according to a second order corresponding to each AC coefficient and a context probability model corresponding to each component of each AC coefficient to obtain at least two AC coefficients;
a transform coefficient is determined from the DC coefficient and the at least two AC coefficients.
The terminal embodiment corresponds to the terminal-side method embodiment, and each implementation process and implementation manner of the method embodiment can be applied to the terminal embodiment, and the same technical effects can be achieved. Specifically, fig. 8 is a schematic diagram of a hardware structure of a terminal for implementing an embodiment of the present application.
The terminal 800 includes, but is not limited to, a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, and a processor 810.
Those skilled in the art will appreciate that the terminal 800 may further include a power source (e.g., a battery) for powering the various components, and that the power source may be logically coupled to the processor 810 by a power management system for performing functions such as managing charging, discharging, and power consumption by the power management system. The terminal structure shown in fig. 8 does not constitute a limitation of the terminal, and the terminal may include more or less components than shown, or may combine certain components, or may be arranged in different components, which will not be described in detail herein.
It should be appreciated that in embodiments of the present application, the input unit 804 may include a graphics processor (Graphics Processing Unit, GPU) 8041 and a microphone 8042, with the graphics processor 8041 processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The display unit 806 may include a display panel 8061, and the display panel 8061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 807 includes at least one of a touch panel 8071 and other input devices 8072. Touch panel 8071, also referred to as a touch screen. The touch panel 8071 may include two parts, a touch detection device and a touch controller. Other input devices 8072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and so forth, which are not described in detail herein.
In the embodiment of the application, after receiving the downlink data from the network side device, the radio frequency unit 801 may transmit the downlink data to the processor 88 for processing, and the radio frequency unit 801 may send the uplink data to the network side device. In general, the radio frequency unit 801 includes, but is not limited to, an antenna, an amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like.
The memory 809 may be used to store software programs or instructions and various data. The memory 809 may mainly include a first storage area storing programs or instructions and a second storage area storing data, wherein the first storage area may store an operating system, application programs or instructions (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like. Further, the memory 809 may include volatile memory or nonvolatile memory, or the memory 809 may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM), static random access memory (STATIC RAM, SRAM), dynamic random access memory (DYNAMIC RAM, DRAM), synchronous Dynamic Random Access Memory (SDRAM), double data rate Synchronous dynamic random access memory (Double DATA RATE SDRAM, DDRSDRAM), enhanced Synchronous dynamic random access memory (ENHANCED SDRAM, ESDRAM), synchronous link dynamic random access memory (SYNCH LINK DRAM, SLDRAM), and Direct random access memory (DRRAM). Memory 809 in embodiments of the application includes, but is not limited to, these and any other suitable types of memory.
Processor 810 may include one or more processing units, and optionally, processor 810 integrates an application processor that primarily processes operations involving an operating system, user interface, application program, etc., and a modem processor that primarily processes wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into the processor 810.
The processor 801 is configured to perform the following operations:
Obtaining a transformation coefficient corresponding to the point cloud;
encoding a DC coefficient according to a first order corresponding to the DC coefficient and a context probability model corresponding to each component of the DC coefficient;
Encoding each AC coefficient according to a second order corresponding to each AC coefficient and a context probability model corresponding to each component of each AC coefficient;
A target code stream is generated based on the encoding result of the DC coefficient and the encoding result of each AC coefficient.
Or the processor 801 is further configured to:
obtaining a target code stream;
Decoding the coding result of the DC coefficient according to a first order corresponding to the DC coefficient and a context probability model corresponding to each component of the DC coefficient to obtain the DC coefficient;
decoding the encoding result of each AC coefficient according to a second order corresponding to each AC coefficient and a context probability model corresponding to each component of each AC coefficient to obtain at least two AC coefficients;
a transform coefficient is determined from the DC coefficient and the at least two AC coefficients.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored, where the program or the instruction implements each process of the above-mentioned transform coefficient encoding method embodiment or implements each process of the above-mentioned transform coefficient decoding method embodiment when executed by a processor, and the process can achieve the same technical effect, so that repetition is avoided and no further description is given here.
Wherein the processor is a processor in the terminal described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
The embodiment of the application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used for running a program or instructions, implementing each process of the above transform coefficient coding method embodiment, or implementing each process of the above transform coefficient decoding method embodiment, and achieving the same technical effect, so that repetition is avoided, and no further description is provided herein.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, or the like.
The embodiments of the present application further provide a computer program/program product stored in a storage medium, where the computer program/program product is executed by at least one processor to implement each process of the above transform coefficient coding method embodiment, or implement each process of the above transform coefficient decoding method embodiment, and achieve the same technical effects, so that repetition is avoided and no further description is given here.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.