Image encoding method, image decoding method, image encoding device, image decoding device, electronic equipment and system

文档序号:1589963 发布日期:2020-01-03 浏览:12次 中文

阅读说明:本技术 图像的编码、解码方法及装置、电子设备及系统 (Image encoding method, image decoding method, image encoding device, image decoding device, electronic equipment and system ) 是由 李明 于 2018-06-27 设计创作,主要内容包括:本发明提供了一种图像的编码、解码方法及装置、电子设备及系统。其中,图像的编码方法包括:确定编码块的预测值,计算所述编码块与所述预测值的预测差值;对所述预测差值进行一次或者多次的变换,得到变换数据,使用所述变换数据确定变换系数;确定所述变换系数的扫描方式和系数组的大小,将所述变换系数划分成一个或多个系数组,根据所述扫描方式扫描每个所述系数组中包含的变换系数,将所述变换系数转换为一个或多个语法元素;对所述系数组的大小和所述语法元素的取值进行编码,将编码比特写入码流。通过本发明,有效降低系数组标志位的编码开销,提高了对变换系数的编码效率。(The invention provides an image encoding method, an image decoding method, an image encoding device, an image decoding device, electronic equipment and an image encoding system. The image coding method comprises the following steps: determining a predicted value of a coding block, and calculating a prediction difference value of the coding block and the predicted value; performing one or more times of transformation on the prediction difference value to obtain transformation data, and determining a transformation coefficient by using the transformation data; determining a scanning mode and a size of a coefficient group of the transform coefficient, dividing the transform coefficient into one or more coefficient groups, scanning the transform coefficient included in each coefficient group according to the scanning mode, and converting the transform coefficient into one or more syntax elements; and coding the size of the coefficient group and the value of the syntax element, and writing coding bits into a code stream. The invention effectively reduces the coding cost of the flag bit of the coefficient group and improves the coding efficiency of the transformation coefficient.)

1. An image encoding method, comprising:

determining a predicted value of a coding block, and calculating a prediction difference value of the coding block and the predicted value;

performing one or more times of transformation on the prediction difference value to obtain transformation data, and determining a transformation coefficient by using the transformation data;

determining a scanning mode and a size of a coefficient group of the transform coefficient, dividing the transform coefficient into one or more coefficient groups, scanning the transform coefficient included in each coefficient group according to the scanning mode, and converting the transform coefficient into one or more syntax elements;

and coding the size of the coefficient group and the value of the syntax element, and writing coding bits into a code stream.

2. The method of claim 1, wherein determining the prediction value of the coding block comprises at least one of:

determining a predicted value of a coding block by taking one or more coded pictures as reference pictures; or, taking the coded part in the image where the coding block is positioned as a reference, and determining the predicted value of the coding block.

3. The method of claim 1, wherein determining transform coefficients using the transform data comprises:

when the transformation data are judged to be quantized, the transformation data are quantized to obtain the transformation coefficient;

setting the transform coefficient using the transform data when it is determined not to quantize the transform data.

4. The method of claim 1, wherein determining the size of the coefficient group of transform coefficients comprises:

And determining the size of the coefficient group of the transformation coefficient according to the preset candidate value of the transformation coefficient.

5. The method according to claim 4, wherein determining the size of the coefficient group of the transform coefficient according to the preset candidate value comprises:

determining a size of the coefficient set of transform coefficients from the candidate values using a rate distortion optimization method.

6. The method of claim 5, comprising:

the number of encoding bits of the transform coefficient when using the value of the candidate value as the size of the coefficient group is calculated, and the value of the candidate value that can minimize the number of encoding bits is selected as the size of the coefficient group of the transform coefficient.

7. The method of claim 5, wherein determining the size of the coefficient group of the transform coefficient according to the preset candidate value comprises:

and determining the size of the coefficient group of the transformation coefficient according to the distribution of the transformation coefficient.

8. The method of claim 7, comprising:

the distribution condition of the transformation coefficients is to detect the concentration degree of non-0 coefficients in the transformation coefficients after scanning the transformation coefficients, wherein the concentration degree of the non-0 coefficients refers to the number of 0-value coefficients between the non-0 coefficients of the transformation coefficients, and the smaller the number of 0-value coefficients, the higher the concentration degree of the non-0 coefficients is;

selecting, from the candidate values, a value in the candidate value that can make the highest degree of concentration as the size of the coefficient group of the transform coefficient.

9. The method of claim 5, wherein the candidate values comprise at least one of:

one or more fixed numerical values; one or more values of the configuration; and the coding block is adjacent to the coding block and uses the coefficient group size to obtain the value.

10. The method of claim 9, wherein when the preset candidate value for the size of the coefficient group is one or more values of the configuration, the method further comprises:

writing the candidate value identification parameter into one or more data units of the code stream, wherein the identification parameter is used for indicating the configured candidate value; the data unit in the code stream comprises at least one of the following: one or more parameter sets, slice headers, block-level data units.

11. The method according to claim 10, wherein the parameter identifying the preset candidate value of the size of the coefficient group comprises at least one of:

the size of the coefficient group, the side length of the system group, the width and height of the system group.

12. The method of claim 11, wherein writing the identification parameter to the codestream using one or more of:

writing the maximum value and the minimum value of the identification parameter into the code stream;

writing the maximum value of the identification parameter and the maximum division level of the coefficient group into the code stream;

writing a difference value between the maximum value of the identification parameter and the maximum value and the minimum value of the size of the coefficient group into the code stream;

writing the minimum value of the identification parameter and the maximum upward division level of the coefficient group into the code stream;

and writing the difference value between the minimum value of the identification parameter and the maximum value and the minimum value of the size of the coefficient group into the code stream.

13. The method of claim 11, wherein writing the identification parameter to the codestream using one or more of:

and writing the default value of the identification parameter into the code stream.

14. The method according to claim 10, wherein the parameter for identifying the preset candidate value of the size of the coefficient group comprises:

the identification parameter is one or more flag bits indicating whether the size of the corresponding coefficient group is the size of the coefficient group contained in the candidate value.

15. The method according to claim 10, wherein the parameter for identifying the preset candidate value of the size of the coefficient group comprises:

the identification parameter indicates the size of one or more coefficient groups corresponding to one or more preset prediction modes.

16. The method according to claim 10, wherein the parameter for identifying the preset candidate value of the size of the coefficient group comprises:

the identification parameter indicates the size of one or more coefficient groups corresponding to the preset one or more transformations.

17. The method according to claim 10, wherein the parameter for identifying the preset candidate value of the size of the coefficient group comprises:

the identification parameter indicates the size of one or more coefficient groups corresponding to one or more preset transform types.

18. The method according to claim 10, wherein the parameter for identifying the preset candidate value of the size of the coefficient group comprises:

the identification parameter indicates the size of one or more coefficient groups corresponding to one or more preset quantization parameters;

alternatively, the first and second electrodes may be,

the identification parameter indicates the size of one or more coefficient groups corresponding to the preset value range of one or more quantization parameters.

19. The method according to claim 10, wherein the parameter for identifying the preset candidate value of the size of the coefficient group comprises:

the identification parameter indicates the size of one or more coefficient groups corresponding to a preset grade/Level Profile/Tier/Level.

20. The method of claim 1, wherein determining the size of the coefficient group of the transform coefficient comprises:

setting the size of the coefficient group of the transformation coefficient in the coding block as the size of the coefficient group corresponding to the coding parameter according to a first coding parameter of the coding block, wherein the first coding parameter at least comprises one of the following parameters: the size of a transform block included in the coding block, a prediction mode of the coding block, a transform type used by the transform block included in the coding block, a quantization parameter.

21. The method of claim 20, wherein setting the size of the coefficient group of the transform coefficient in the coding block to the size of the coefficient group corresponding to the coding parameter according to the first coding parameter of the coding block comprises:

and when the size of a transform block contained in the coding block is equal to a first preset value, setting the size of the coefficient group as the size of the coefficient group corresponding to the first preset value.

22. The method of claim 20, wherein setting the size of the coefficient group of the transform coefficient in the coding block to the size of the coefficient group corresponding to the coding parameter according to the first coding parameter of the coding block comprises:

and when the prediction mode of the coding block is equal to a first preset mode, setting the size of the coefficient group as the size of the coefficient group corresponding to the first preset mode.

23. The method of claim 20, wherein setting the size of the coefficient group of the transform coefficient in the coding block to the size of the coefficient group corresponding to the coding parameter according to the first coding parameter of the coding block comprises:

when the transform type used by a transform block included in the coding block is equal to a first transform type, the size of the coefficient group is set to the size of the coefficient group corresponding to the first transform type.

24. The method of claim 20, wherein setting the size of the coefficient group of the transform coefficient in the coding block to the size of the coefficient group corresponding to the coding parameter according to the first coding parameter of the coding block comprises:

when the value of the quantization parameter is equal to a second preset value, setting the size of the coefficient group as the size of the coefficient group corresponding to the second preset value;

alternatively, the first and second electrodes may be,

and when the value of the quantization parameter is in a first preset value range, setting the size of the coefficient group as the size of the coefficient group corresponding to the first preset value range.

25. The method of claim 1, wherein determining the scanning mode of the transform coefficients comprises:

and determining a scanning mode for the transformation coefficient according to a preset candidate scanning mode, wherein the scanning mode is a processing sequence of elements in a two-dimensional matrix of the transformation coefficient.

26. The method of claim 25, wherein determining the scan pattern for the transform coefficients according to a predetermined candidate scan pattern comprises:

and determining the scanning mode of the transformation coefficient from the candidate scanning modes by using a rate distortion optimization method.

27. The method of claim 26, comprising:

the number of encoding bits of the transform coefficient when using one of the candidate scanning methods is calculated, and the scanning method of the candidate scanning method that can minimize the number of encoding bits is selected as the scanning method of the transform coefficient.

28. The method of claim 25, wherein determining the scan pattern for the transform coefficients according to a predetermined candidate scan pattern comprises:

and determining the scanning mode of the transformation coefficient according to the distribution condition of the transformation coefficient.

29. The method of claim 28, comprising:

the distribution condition of the transformation coefficients is to detect the concentration degree of non-0 coefficients in the transformation coefficients after scanning the transformation coefficients, wherein the concentration degree of the non-0 coefficients refers to the number of 0-value coefficients between the non-0 coefficients of the transformation coefficients, and the smaller the number of 0-value coefficients, the higher the concentration degree of the non-0 coefficients is;

selecting, from the candidate scan patterns, a scan pattern that can make the highest concentration degree of the candidate values as a scan pattern of the transform coefficients.

30. The method of claim 25, wherein the candidate scan patterns comprise at least one of:

one or more fixed scanning modes; one or more scan modes of the configuration; the coding block is adjacent to the scanning mode used by the coding block.

31. The method of claim 30, wherein when the candidate scan pattern is one or more scan patterns of the configuration, the method further comprises:

writing the candidate scanning mode parameter into one or more data units of the code stream, wherein the candidate scanning mode parameter is used for indicating the configured candidate scanning mode; the data unit in the code stream comprises at least one of the following: one or more parameter sets, slice headers, block-level data units.

32. The method of claim 31, wherein the candidate scan mode parameters further comprise:

the order of processing of the elements in the two-dimensional matrix of transform coefficients.

33. The method of claim 31, wherein the candidate scan mode parameters further comprise:

a default value of the scan mode parameter.

34. The method of claim 31, wherein the candidate scan mode parameters comprise:

the candidate scan mode parameter is one or more flag bits indicating whether a corresponding scan mode is included in the candidate scan mode.

35. The method of claim 31, wherein the candidate scan mode parameters comprise:

the candidate scanning mode parameter indicates one or more scanning modes corresponding to one or more preset prediction modes.

36. The method of claim 31, wherein the candidate scan mode parameters comprise:

the candidate scanning mode parameter indicates one or more scanning modes corresponding to one or more preset transformations.

37. The method of claim 31, wherein the candidate scan mode parameters comprise:

the candidate scanning mode parameter indicates one or more scanning modes corresponding to one or more preset transformation types.

38. The method of claim 31, wherein the candidate scan mode parameters comprise:

the candidate scanning mode parameter indicates one or more scanning modes corresponding to one or more preset quantization parameters;

alternatively, the first and second electrodes may be,

the candidate scanning mode parameter indicates one or more scanning modes corresponding to one or more preset quantization parameter value ranges.

39. The method of claim 31, wherein the candidate scan mode parameters comprise:

the candidate scanning mode parameters indicate one or more scanning modes corresponding to preset Profile/Tier/Level.

40. The method of claim 1, wherein determining the scanning mode of the transform coefficients comprises:

setting the scanning mode of the transformation coefficient in the coding block as the scanning mode of a coefficient group corresponding to the second coding parameter according to the second coding parameter of the transformation block;

wherein the second encoding parameter includes at least one of: the size of a transform block contained in the coding block, the prediction mode of the coding block, the transform type used by the transform block contained in the coding block, and the size of the coding block; the scanning mode is a processing sequence of elements in the two-dimensional matrix of the transform coefficients.

41. The method as claimed in claim 40, wherein the setting the scanning mode of the transform coefficients in the coding block to the scanning mode of the coefficient group corresponding to the second coding parameter according to the second coding parameter of the transform block comprises:

and when the size of a transform block contained in the coding block is equal to a third preset value, setting the scanning mode of the transform coefficient as the scanning mode corresponding to the third preset value.

42. The method as claimed in claim 40, wherein the setting the scanning mode of the transform coefficients in the coding block to the scanning mode of the coefficient group corresponding to the second coding parameter according to the second coding parameter of the transform block comprises:

and when the prediction mode of the coding block is equal to a second preset mode, setting the scanning mode of the transformation coefficient as the scanning mode corresponding to the second preset mode.

43. The method as claimed in claim 40, wherein the setting the scanning mode of the transform coefficients in the coding block to the scanning mode of the coefficient group corresponding to the second coding parameter according to the second coding parameter of the transform block comprises:

and when the transform type used by the transform block contained in the coding block is equal to a second transform type, setting the scanning mode of the transform coefficient as the scanning mode corresponding to the second transform type.

44. The method as claimed in claim 40, wherein the setting the scanning mode of the transform coefficients in the coding block to the scanning mode of the coefficient group corresponding to the second coding parameter according to the second coding parameter of the transform block comprises:

and when the size of the coding block is equal to a fourth preset value, setting the scanning mode of the transformation coefficient as the scanning mode corresponding to the fourth preset value.

45. The method of claim 1, wherein determining the scan pattern of the transform coefficients and the size of the coefficient groups comprises:

and jointly determining the size and the scanning mode of the coefficient group of the transformation coefficient by using a rate distortion optimization method.

46. The method of claim 1, wherein converting the transform coefficients into one or more syntax elements comprises:

dividing the transform coefficients into one or more coefficient groups according to the size of the coefficient groups and a scanning manner, scanning the transform coefficients contained in the coefficient groups according to the scanning manner, and representing the transform coefficients as at least one of the following syntax elements:

a syntax element indicating a non-0 coefficient starting position;

a syntax element indicating that a non-0 coefficient is included in the coefficient group;

a syntax element indicating a non-0 coefficient position in the coefficient group;

syntax elements indicating the value of non-0 coefficients in the coefficient group.

47. The method of claim 1, wherein encoding the size of the coefficient group and the value of the syntax element and writing the encoded bits into a code stream comprises:

encoding the size of the coefficient group used by the transform coefficient using one of the following methods:

encoding a size of the coefficient group;

coding the value of the index serial number corresponding to the size of the coefficient group;

setting a zone bit corresponding to the size of the coefficient group, and coding the value of the zone bit.

48. The method of claim 1, wherein encoding the size of the coefficient group and the value of the syntax element and writing the encoded bits into a code stream comprises:

writing the coded bits into data units in the code stream, wherein the data units in the code stream comprise at least one of the following: one or more parameter sets, slice headers, block-level data units.

49. A method for decoding an image, comprising:

analyzing the code stream, and determining a predicted value of a decoding block;

analyzing the code stream, and determining the scanning mode of the transform coefficient in the decoding block, the size of the coefficient group and the value of the syntax element related to the transform coefficient;

processing coefficient groups in the decoding block according to the scanning mode and the sizes of the coefficient groups, and converting the syntax elements into transformation coefficients in the coefficient groups;

processing the transformation coefficient to obtain a recovery value of the transformation coefficient;

carrying out one or more times of transformation on the recovery value of the transformation coefficient to obtain a prediction difference value of the decoding block;

determining a recovery value for the decoded block using the prediction value and the prediction difference.

50. The method of claim 49, wherein said parsing the code stream to determine the prediction value of the decoded block comprises at least one of:

analyzing the code stream to obtain an inter-frame prediction parameter of the decoding block; determining a predicted value of the decoded block by using one or more decoded pictures as reference pictures according to the inter-frame prediction parameters;

or, analyzing the code stream to obtain the intra-frame prediction parameter of the decoding block; and determining a predicted value of the decoded block by taking a decoded part in the image of the decoded block as a reference according to the intra-prediction parameter.

51. The method of claim 49, wherein parsing the code stream to determine the size of the coefficient groups of transform coefficients in the decoded block comprises:

analyzing the code stream, acquiring a first coefficient group parameter from a data unit in the code stream, and determining the size of the coefficient group according to the first coefficient group parameter; wherein, the data unit in the code stream comprises at least one of the following: one or more parameter sets, slice headers, block-level data units.

52. A method as defined in claim 51, wherein determining the size of the coefficient group based on the first coefficient group parameter comprises:

setting a size of the coefficient group using the first coefficient group parameter.

53. A method as defined in claim 51, wherein determining the size of the coefficient group based on the first coefficient group parameter comprises:

the first coefficient group parameter indicates a neighboring decoded block of the decoded block, a size of a coefficient group of the neighboring decoded block being used to set the size of the coefficient group.

54. A method as defined in claim 51, wherein determining the size of the coefficient group based on the first coefficient group parameter comprises:

determining a size of a coefficient group of transform coefficients of the decoded block from a candidate value of a size of coefficient group according to the first coefficient group parameter.

55. The method of claim 54, further comprising:

the first coefficient set parameter includes an index number, and the size of the coefficient set is set using the size of the coefficient set corresponding to the index number in the candidate value.

56. The method of claim 54, further comprising:

the first coefficient set parameter includes a flag bit that is used to set the size of the coefficient set corresponding to the candidate value.

57. The method of claim 54, comprising:

the candidate values for the size of the coefficient group are one or more fixed numerical values.

58. The method of claim 54, comprising:

the first coefficient group parameter includes an identification parameter, and the identification parameter is used for configuring a candidate value of the size of the coefficient group.

59. The method of claim 57, wherein the identification parameter comprises at least one of:

the size of the coefficient group, the side length of the system group, the width and height of the system group.

60. The method of claim 58, wherein configuring the candidate values for the size of the coefficient group using the identification parameter comprises one or more of:

obtaining the maximum value and the minimum value of the identification parameter, determining the values of the identification parameter except the maximum value and the minimum value according to a preset dividing mode, and setting the candidate value by using the values of the identification parameter;

obtaining the maximum value of the identification parameter and the maximum division level of the coefficient group, determining values except the maximum value of the identification parameter according to the preset division mode, and setting the candidate value by using the values of the identification parameter;

obtaining a difference value between the maximum value of the identification parameter and the maximum value and the minimum value of the coefficient group, determining values except the maximum value of the identification parameter according to the preset dividing mode, and setting the candidate value by using the values of the identification parameter;

obtaining the minimum value of the identification parameter and the maximum upward division level of the coefficient group, determining values except the minimum value of the identification parameter according to the preset division mode, and setting the candidate value by using the values of the identification parameter;

and obtaining a difference value between the minimum value of the identification parameter and the maximum value and the minimum value of the coefficient group, determining values except the minimum value of the identification parameter according to the preset dividing mode, and setting the candidate value by using the values of the identification parameter.

61. The method of claim 60, wherein the predetermined partitioning comprises at least one of:

quartering division, trisection division and dichotomy division.

62. The method of claim 59, wherein using the identification parameter to configure the candidate values for the size of the coefficient group comprises:

setting the candidate value using a default value of the identification parameter.

63. The method of claim 59, wherein using the identification parameter to configure the candidate values for the size of the coefficient group comprises:

the identification parameter is one or more flag bits indicating whether the size of the corresponding coefficient group is contained in the candidate value, and the size of the coefficient group contained in the candidate value is set according to the identification parameter.

64. The method of claim 59, wherein using the identification parameter to configure the candidate values for the size of the coefficient group comprises:

the identification parameters indicate the size of one or more coefficient groups corresponding to preset Profile/Tier/Level, and the size of the coefficient groups contained in the candidate values is set according to the identification parameters.

65. A method as defined in claim 51, wherein determining the size of the coefficient group based on the first coefficient group parameter comprises:

the first parameter group parameter includes a first decoding parameter of the decoded block, and the size of the coefficient group is set to the size of the coefficient group corresponding to the first decoding parameter according to the first decoding parameter of the decoded block, where the first decoding parameter at least includes one of: a size of a transform block included in the decoded block, a prediction mode of the decoded block, a transform type used by the transform block included in the decoded block, a quantization parameter.

66. The method of claim 65, wherein setting the size of the coefficient group to which the first decoding parameter corresponds comprises:

when the size of a transform block included in the decoded block is equal to a first preset value, setting the size of the coefficient group as the size of the coefficient group corresponding to the first preset value.

67. The method of claim 66, further comprising:

and obtaining the size of the coefficient group corresponding to the first preset value according to the first parameter group parameter.

68. The method of claim 65, wherein setting the size of the coefficient group to which the first decoding parameter corresponds comprises:

and when the prediction mode of the decoded block is equal to a first preset mode, setting the size of the coefficient group as the size of the coefficient group corresponding to the first preset mode.

69. The method of claim 68, further comprising:

and obtaining the size of the coefficient group corresponding to the first preset mode according to the first parameter group parameter.

70. The method of claim 65, wherein setting the size of the coefficient group to which the first decoding parameter corresponds comprises:

when a transform type used by a transform block included in the decoded block is equal to a first transform type, the size of the coefficient group is set to the size of a coefficient group corresponding to the first transform type.

71. The method of claim 70, further comprising:

obtaining a size of a coefficient group corresponding to the first transform type according to the first parameter set parameter.

72. The method of claim 65, wherein setting the size of the coefficient group to which the first decoding parameter corresponds comprises:

when the value of the quantization parameter is equal to a second preset value, setting the size of the coefficient group as the size of the coefficient group corresponding to the second preset value;

alternatively, the first and second electrodes may be,

and when the value of the quantization parameter is in a first preset value range, setting the size of the coefficient group as the size of the coefficient group corresponding to the first preset value range.

73. The method of claim 72, further comprising:

obtaining the size of a coefficient group corresponding to the second preset value according to the first parameter group parameter;

alternatively, the first and second electrodes may be,

and obtaining the size of the coefficient group corresponding to the first preset value range according to the first parameter group parameter.

74. The method of claim 49, wherein the parsing the code stream to determine a scanning mode of the transform coefficients comprises:

analyzing a data unit in the code stream to obtain a first scanning mode parameter, and determining a scanning mode of the conversion coefficient according to the first scanning mode parameter; wherein the scanning mode is a processing sequence of elements in a two-dimensional matrix of the transform coefficients; the data unit in the code stream comprises at least one of the following: one or more parameter sets, slice headers, block-level data units.

75. The method of claim 74, wherein analyzing the data units in the code stream to obtain a first scanning mode parameter, and determining the scanning mode of the transform coefficients according to the first scanning mode parameter comprises:

the scanning mode indicated by the first scanning mode parameter is used as the scanning mode of the transform coefficient.

76. The method according to claim 75, wherein using the scanning mode indicated by the first scanning mode parameter as the scanning mode for the transform coefficient comprises:

the first scan pattern parameter indicates a neighboring decoded block of the decoded blocks, and a scan pattern of the transform coefficients is set using the scan pattern of the neighboring decoded block.

77. The method according to claim 75, wherein using the scanning mode indicated by the first scanning mode parameter as the scanning mode for the transform coefficient, further comprises:

and determining the scanning mode of the transformation coefficient from candidate scanning modes according to the first scanning mode parameter.

78. The method of claim 77, further comprising:

the first scanning mode parameter includes a scanning mode index number, and the scanning mode of the transform coefficient is set using the scanning mode corresponding to the scanning mode index number in the candidate scanning modes.

79. The method of claim 77, further comprising:

the first scan mode parameter includes a scan mode indication flag bit, and the scan mode of the transform coefficient is set using a scan mode corresponding to the scan mode indication flag bit among the candidate scan modes.

80. The method of claim 77, wherein the candidate scan patterns comprise at least one of:

one or more fixed scanning modes; and configuring the candidate scanning mode by using the first scanning mode parameter.

81. The method according to claim 80, wherein configuring the candidate scanning mode using the first scanning mode parameter comprises:

the first scanning mode parameter comprises a default scanning mode, and the candidate scanning mode is set by using the default scanning mode.

82. The method according to claim 80, wherein configuring the candidate scanning mode using the first scanning mode parameter comprises:

the first candidate scanning mode parameter comprises one or more candidate scanning mode indicating flag bits, and the candidate scanning mode is set by using the scanning mode corresponding to the candidate scanning mode indicating flag bits.

83. The method according to claim 80, wherein configuring the candidate scanning mode using the first scanning mode parameter comprises:

and setting the candidate scanning mode by using one or more scanning modes corresponding to the preset Profile/Tier/Level indicated by the first scanning mode parameter.

84. The method according to claim 80, wherein configuring the candidate scanning mode using the first scanning mode parameter comprises:

setting the candidate scanning manner using a correspondence between the position of the transform coefficient indicated by the first scanning manner parameter and the position of the transform coefficient after scanning.

85. The method according to claim 74, wherein analyzing data units in said code stream obtains a first scanning mode parameter, and determining a scanning mode of said transform coefficients according to said first scanning mode parameter; the method comprises the following steps:

the first scanning mode parameter comprises a second decoding parameter of the decoding block;

determining a scanning mode of the transform coefficient according to the second decoding parameter, wherein the second decoding parameter at least comprises one of the following parameters: a size of a transform block included in the decoded block, a prediction mode of the decoded block, a transform type used by a transform block included in the decoded block, a size of the decoded block.

86. The method of claim 85, wherein setting the scanning mode of the transform coefficients to the scanning mode corresponding to the second decoding parameter according to the second decoding parameter comprises:

and when the size of a transformation block contained in the decoding block is equal to a third preset value, setting the scanning mode of the transformation coefficient as the scanning mode corresponding to the third preset value.

87. The method of claim 86, comprising:

and acquiring a scanning mode corresponding to the third preset value according to the first parameter group parameter.

88. The method of claim 85, wherein setting the scanning mode of the transform coefficients to the scanning mode corresponding to the second decoding parameter according to the second decoding parameter comprises:

and when the prediction mode of the decoded block is equal to a second preset mode, setting the scanning mode of the transformation coefficient as the scanning mode corresponding to the second preset mode.

89. The method of claim 88, comprising:

and obtaining a scanning mode corresponding to the second preset mode according to the first parameter group parameters.

90. The method of claim 85, wherein setting the scanning mode of the transform coefficients to the scanning mode corresponding to the second decoding parameter according to the second decoding parameter comprises:

and when the transform type used by the transform block contained in the decoding block is equal to a second transform type, setting the scanning mode of the transform coefficient as the scanning mode corresponding to the second transform type.

91. The method of claim 90, comprising:

and obtaining a scanning mode corresponding to the second transformation type according to the first parameter group parameters.

92. The method of claim 85, wherein setting the scanning mode of the transform coefficients to the scanning mode corresponding to the second decoding parameter according to the second decoding parameter comprises:

and when the size of the decoding block is equal to a fourth preset value, setting the scanning mode of the transformation coefficient as the scanning mode corresponding to the fourth preset value.

93. The method of claim 90, comprising:

and acquiring a scanning mode corresponding to a fourth preset value according to the first parameter group parameter.

94. The method of claim 49, wherein parsing the code stream to determine values of syntax elements associated with transform coefficients comprises:

the syntax element comprises at least one of:

a syntax element indicating a non-0 coefficient starting position;

a syntax element indicating that a non-0 coefficient is included in the coefficient group;

a syntax element indicating a non-0 coefficient position in the coefficient group;

syntax elements indicating the value of non-0 coefficients in the coefficient group.

95. The method of claim 49, wherein said processing the transform coefficients to obtain recovered values of transform coefficients comprises:

when the transformation coefficient is judged to be subjected to Scaling processing, Scaling processing is carried out on the transformation data to obtain a recovery value of the transformation coefficient;

when it is judged that the scaling processing is not performed on the transform data, a restoration value of the transform coefficient is set using the transform coefficient.

96. The method of claim 95, wherein prior to said processing said transform coefficients, said method further comprises:

analyzing the code stream to obtain a third parameter for constructing a recovery value of a prediction difference value of the decoding block;

and judging whether the transformation coefficient is subjected to expansion and contraction processing or not according to the third parameter.

97. The method of claim 96, wherein the prediction value and the prediction difference value are used to determine a recovery value for the decoded block, the method further comprising:

and performing loop filtering processing on the sum of the predicted value and the predicted difference value.

98. An apparatus for encoding an image in an encoder, comprising:

the first determining module is used for determining a predicted value of a coding block and calculating a prediction difference value of the coding block and the predicted value;

the transformation module is used for carrying out one or more times of transformation on the prediction difference value to obtain transformation data and determining a transformation coefficient by using the transformation data;

a second determining module, configured to determine a scanning mode of the transform coefficients and a size of a coefficient group, divide the transform coefficients into one or more coefficient groups, scan the transform coefficients included in each of the coefficient groups according to the scanning mode, and convert the transform coefficients into one or more syntax elements;

and the coding module is used for coding the size of the coefficient group and the value of the syntax element and writing the coded bits into a code stream.

99. An apparatus for decoding an image, comprising:

the decoding module is used for analyzing the code stream and determining a predicted value of the decoding block, wherein the scanning mode of a transform coefficient, the size of a coefficient group and the value of a syntax element related to the transform coefficient in the decoding block are obtained;

the conversion module is used for processing the coefficient groups in the decoding block according to the scanning mode and the sizes of the coefficient groups and converting the syntax elements into the transformation coefficients in the coefficient groups;

the processing module is used for processing the transformation coefficient to obtain a recovery value of the transformation coefficient;

the transformation module is used for processing the transformation coefficient and carrying out one or more times of transformation on the processed data to obtain a prediction difference value of the decoding block;

a calculation module for determining a recovery value of the decoded block using the prediction value and the prediction difference value.

100. An electronic device, comprising: the encoding apparatus, the collecting device, and the storing device according to claim 98,

the acquisition equipment is used for acquiring the image corresponding to the coding block, preprocessing the image and outputting the preprocessed image;

and the storage equipment is used for receiving the output code stream and storing the code stream after the code stream is subjected to system layer processing.

101. An electronic device, comprising: the encoder, receiving device, and display device of claim 99,

the receiving device is used for receiving the code stream;

and the display equipment is used for displaying the recovered image.

102. A storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the method of any of claims 1-48,49-97 when executed.

Technical Field

The present invention relates to the field of communications, and in particular, to a method and an apparatus for encoding and decoding an image, an electronic device, and a system.

Background

Compression coding techniques for digital Video (Video) and pictures (Picture) use the correlation between pixel samples in Video and pictures to remove redundancy present in Video and pictures. The image compression utilizes the spatial domain correlation between adjacent Pixel point (Pixel) Sample values (Sample) in the image, and reduces the redundancy between the adjacent Pixel points in the spatial domain by using the method of predicting the Pixel points to be coded by adjacent coded Pixel points. This type of method is commonly referred to as intra prediction (IntraPrediction). Digital video consists of a series of consecutive images. In addition to the correlation between adjacent pixels in the spatial domain in a single frame image, the digital video compression also utilizes the correlation between adjacent images in the temporal domain, for example, the method of Motion Estimation (Motion Estimation) and Motion Compensation (Motion Compensation) is used, and the current coded image is predicted by using the coded image as a reference. This type of method is commonly referred to as Inter Prediction (Inter Prediction).

In the encoding process, an encoder determines a predicted value of a coding block by using an intra-frame prediction method and an inter-frame prediction method, and calculates a difference value between a sample value of the coding block and the predicted value to be used as a predicted difference value (Residual) of the coding block. To further reduce the spatial domain redundancy present in the prediction difference, the encoder may transform (transform) the prediction difference. Generally, the prediction difference of the coding block can be represented as a two-dimensional matrix of M × N, where M and N are both positive integers, and M and N may be equal or unequal. The encoder transforms the two-dimensional matrix and processes data in the two-dimensional matrix obtained after the transformation to obtain a transform Coefficient (Coefficient) to be subjected to entropy coding, for example, in the h.265/HEVC standard, the processing may be Quantization (Quantization) of the data or may not be Quantization of the data. The encoder scans the transform coefficients represented by the two-dimensional matrix and encodes the transform coefficients. In the h.265/HEVC standard, a two-dimensional matrix of encoder transform coefficients is partitioned into one or more 4x4 fixed-size Coefficient Groups (CGs). The encoder sequentially encodes the transform coefficients in a 4x4 block using a specified scan order. This method has a major drawback that coefficient groups of a fixed size are used, so that the encoder cannot select the most efficient coding scheme of the coding coefficients according to the distribution of the transform coefficients in the two-dimensional matrix, for example, when the size of the coefficient group is fixed to 4 × 4 blocks, a flag bit indicating whether the coefficient group contains a non-0 transform coefficient needs to be coded for each coefficient group from the coefficient group containing the last non-0 coefficient in the coefficient scanning order (actually, the reverse order), so that when there are a large number of non-0 coefficients in the transform coefficient matrix, the coding overhead of the flag bit is large.

Disclosure of Invention

The embodiment of the invention provides an image coding and decoding method and device, electronic equipment and a system, which at least solve the problem that a coder cannot select the most effective coding mode of a coding coefficient according to the distribution condition of a transform coefficient in a two-dimensional matrix due to a coefficient group with a fixed size in the related technology.

According to an embodiment of the present invention, there is provided an image encoding method including: determining a predicted value of a coding block, and calculating a prediction difference value of the coding block and the predicted value; performing one or more times of transformation on the prediction difference value to obtain transformation data, and determining a transformation coefficient by using the transformation data; determining a scanning mode and a size of a coefficient group of the transform coefficient, dividing the transform coefficient into one or more coefficient groups, scanning the transform coefficient included in each coefficient group according to the scanning mode, and converting the transform coefficient into one or more syntax elements; and coding the size of the coefficient group and the value of the syntax element, and writing coding bits into a code stream.

Optionally, determining the prediction value of the coding block includes at least one of the following methods: determining a predicted value of a coding block by taking one or more coded pictures as reference pictures; or, taking the coded part in the image where the coding block is positioned as a reference, and determining the predicted value of the coding block.

Optionally, determining transform coefficients using the transform data comprises: when the transformation data are judged to be quantized, the transformation data are quantized to obtain the transformation coefficient; setting the transform coefficient using the transform data when it is determined not to quantize the transform data.

Optionally, determining a size of the coefficient group of transform coefficients comprises: and determining the size of the coefficient group of the transformation coefficient according to the preset candidate value of the transformation coefficient.

Optionally, the determining the size of the coefficient group of the transform coefficient according to the preset candidate value includes: determining a size of the coefficient set of transform coefficients from the candidate values using a rate distortion optimization method.

Alternatively, the number of encoding bits of the transform coefficient when using a numerical value of the candidate value as the size of the coefficient group is calculated, and the numerical value of the candidate value that can minimize the number of encoding bits is selected as the size of the coefficient group of the transform coefficient.

Optionally, the determining the size of the coefficient group of the transform coefficient according to the preset candidate value includes: and determining the size of the coefficient group of the transformation coefficient according to the distribution of the transformation coefficient.

Optionally, the distribution of the transform coefficients is to detect the concentration degree of non-0 coefficients in the transform coefficients after scanning the transform coefficients, where the concentration degree of the non-0 coefficients refers to the number of 0-valued coefficients between the non-0 coefficients of the transform coefficients, and a smaller number of 0-valued coefficients indicates a higher concentration degree of the non-0 coefficients; selecting, from the candidate values, a value in the candidate value that can make the highest degree of concentration as the size of the coefficient group of the transform coefficient.

Optionally, the candidate values include at least one of: one or more fixed numerical values; one or more values of the configuration; and the coding block is adjacent to the coding block and uses the coefficient group size to obtain the value.

Optionally, when the preset candidate value of the size of the coefficient group is one or more numerical values of the configuration, the method further includes: writing the candidate value identification parameter into one or more data units of the code stream, wherein the identification parameter is used for indicating the configured candidate value; the data unit in the code stream comprises at least one of the following: one or more parameter sets, slice headers, block-level data units.

Optionally, the identification parameter of the preset candidate value of the size of the coefficient group includes at least one of: the size of the coefficient group, the side length of the system group, the width and height of the system group.

Optionally, writing the identification parameter into the code stream by using one or more of the following methods, including: writing the maximum value and the minimum value of the identification parameter into the code stream; writing the maximum value of the identification parameter and the maximum division level of the coefficient group into the code stream; writing a difference value between the maximum value of the identification parameter and the maximum value and the minimum value of the size of the coefficient group into the code stream; writing the minimum value of the identification parameter and the maximum upward division level of the coefficient group into the code stream; and writing the difference value between the minimum value of the identification parameter and the maximum value and the minimum value of the size of the coefficient group into the code stream.

Optionally, writing the identification parameter into the code stream by using one or more of the following methods, further including: and writing the default value of the identification parameter into the code stream.

Optionally, the parameter for identifying the preset candidate value of the size of the coefficient group includes: the identification parameter is one or more flag bits indicating whether the size of the corresponding coefficient group is the size of the coefficient group contained in the candidate value.

Optionally, the parameter for identifying the preset candidate value of the size of the coefficient group includes: the identification parameter indicates the size of one or more coefficient groups corresponding to one or more preset prediction modes.

Optionally, the parameter for identifying the preset candidate value of the size of the coefficient group includes: the identification parameter indicates the size of one or more coefficient groups corresponding to the preset one or more transformations.

Optionally, the parameter for identifying the preset candidate value of the size of the coefficient group includes: the identification parameter indicates the size of one or more coefficient groups corresponding to one or more preset transform types.

Optionally, the parameter for identifying the preset candidate value of the size of the coefficient group includes: the identification parameter indicates the size of one or more coefficient groups corresponding to one or more preset quantization parameters; or the identification parameter indicates the size of one or more coefficient groups corresponding to the preset value range of one or more quantization parameters.

Optionally, the parameter for identifying the preset candidate value of the size of the coefficient group includes: the identification parameter indicates the size of one or more coefficient groups corresponding to a preset grade/Level Profile/Tier/Level.

Optionally, the determining the size of the coefficient group of the transform coefficient comprises: setting the size of the coefficient group of the transformation coefficient in the coding block as the size of the coefficient group corresponding to the coding parameter according to a first coding parameter of the coding block, wherein the first coding parameter at least comprises one of the following parameters: the size of a transform block included in the coding block, a prediction mode of the coding block, a transform type used by the transform block included in the coding block, a quantization parameter.

Optionally, setting, according to a first coding parameter of the coding block, a size of a coefficient group of the transform coefficient in the coding block to a size of a coefficient group corresponding to the coding parameter, includes: and when the size of a transform block contained in the coding block is equal to a first preset value, setting the size of the coefficient group as the size of the coefficient group corresponding to the first preset value.

Optionally, setting, according to a first coding parameter of the coding block, a size of a coefficient group of the transform coefficient in the coding block to a size of a coefficient group corresponding to the coding parameter, includes: and when the prediction mode of the coding block is equal to a first preset mode, setting the size of the coefficient group as the size of the coefficient group corresponding to the first preset mode.

Optionally, setting, according to a first coding parameter of the coding block, a size of a coefficient group of the transform coefficient in the coding block to a size of a coefficient group corresponding to the coding parameter, includes: when the transform type used by a transform block included in the coding block is equal to a first transform type, the size of the coefficient group is set to the size of the coefficient group corresponding to the first transform type.

Optionally, setting, according to a first coding parameter of the coding block, a size of a coefficient group of the transform coefficient in the coding block to a size of a coefficient group corresponding to the coding parameter, includes: when the value of the quantization parameter is equal to a second preset value, setting the size of the coefficient group as the size of the coefficient group corresponding to the second preset value; or when the value of the quantization parameter is within a first preset value range, setting the size of the coefficient group as the size of the coefficient group corresponding to the first preset value range.

Optionally, the determining a scanning manner of the transform coefficient includes: and determining a scanning mode for the transformation coefficient according to a preset candidate scanning mode, wherein the scanning mode is a processing sequence of elements in a two-dimensional matrix of the transformation coefficient.

Optionally, determining a scanning mode for the transform coefficient according to a preset candidate scanning mode includes: and determining the scanning mode of the transformation coefficient from the candidate scanning modes by using a rate distortion optimization method.

Alternatively, the number of encoding bits of the transform coefficient when using one of the candidate scanning methods is calculated, and the scanning method of the candidate scanning method that can minimize the number of encoding bits is selected as the scanning method of the transform coefficient.

Optionally, determining a scanning mode for the transform coefficient according to a preset candidate scanning mode includes: and determining the scanning mode of the transformation coefficient according to the distribution condition of the transformation coefficient.

Optionally, the distribution of the transform coefficients is to detect the concentration degree of non-0 coefficients in the transform coefficients after scanning the transform coefficients, where the concentration degree of the non-0 coefficients refers to the number of 0-valued coefficients between the non-0 coefficients of the transform coefficients, and a smaller number of 0-valued coefficients indicates a higher concentration degree of the non-0 coefficients; selecting, from the candidate scan patterns, a scan pattern that can make the highest concentration degree of the candidate values as a scan pattern of the transform coefficients.

Optionally, the candidate scanning manner includes at least one of: one or more fixed scanning modes; one or more scan modes of the configuration; the coding block is adjacent to the scanning mode used by the coding block.

Optionally, when the candidate scanning mode is one or more configured scanning modes, the method further includes: writing the candidate scanning mode parameter into one or more data units of the code stream, wherein the candidate scanning mode parameter is used for indicating the configured candidate scanning mode; the data unit in the code stream comprises at least one of the following: one or more parameter sets, slice headers, block-level data units.

Optionally, the candidate scan mode parameter further includes: the order of processing of the elements in the two-dimensional matrix of transform coefficients.

Optionally, the candidate scan mode parameter further includes: a default value of the scan mode parameter.

Optionally, the candidate scan mode parameter includes: the candidate scan mode parameter is one or more flag bits indicating whether a corresponding scan mode is included in the candidate scan mode.

Optionally, the candidate scan mode parameter includes: the candidate scanning mode parameter indicates one or more scanning modes corresponding to one or more preset prediction modes.

Optionally, the candidate scan mode parameter includes: the candidate scanning mode parameter indicates one or more scanning modes corresponding to one or more preset transformations.

Optionally, the candidate scan mode parameter includes: the candidate scanning mode parameter indicates one or more scanning modes corresponding to one or more preset transformation types.

Optionally, the candidate scan mode parameter includes: the candidate scanning mode parameter indicates one or more scanning modes corresponding to one or more preset quantization parameters; or the candidate scanning mode parameter indicates one or more scanning modes corresponding to one or more preset quantization parameter value ranges.

Optionally, the candidate scan mode parameter includes: the candidate scanning mode parameters indicate one or more scanning modes corresponding to preset Profile/Tier/Level.

Optionally, the determining a scanning manner of the transform coefficient includes: setting the scanning mode of the transformation coefficient in the coding block as the scanning mode of a coefficient group corresponding to the second coding parameter according to the second coding parameter of the transformation block; wherein the second encoding parameter includes at least one of: the size of a transform block contained in the coding block, the prediction mode of the coding block, the transform type used by the transform block contained in the coding block, and the size of the coding block; the scanning mode is a processing sequence of elements in the two-dimensional matrix of the transform coefficients.

Optionally, setting, according to a second encoding parameter of the transform block, a scanning mode of the transform coefficient in the encoding block to a scanning mode of a coefficient group corresponding to the second encoding parameter includes: and when the size of a transform block contained in the coding block is equal to a third preset value, setting the scanning mode of the transform coefficient as the scanning mode corresponding to the third preset value.

Optionally, setting, according to a second encoding parameter of the transform block, a scanning mode of the transform coefficient in the encoding block to a scanning mode of a coefficient group corresponding to the second encoding parameter includes: and when the prediction mode of the coding block is equal to a second preset mode, setting the scanning mode of the transformation coefficient as the scanning mode corresponding to the second preset mode.

Optionally, setting, according to a second encoding parameter of the transform block, a scanning mode of the transform coefficient in the encoding block to a scanning mode of a coefficient group corresponding to the second encoding parameter includes: and when the transform type used by the transform block contained in the coding block is equal to a second transform type, setting the scanning mode of the transform coefficient as the scanning mode corresponding to the second transform type.

Optionally, setting, according to a second encoding parameter of the transform block, a scanning mode of the transform coefficient in the encoding block to a scanning mode of a coefficient group corresponding to the second encoding parameter includes: and when the size of the coding block is equal to a fourth preset value, setting the scanning mode of the transformation coefficient as the scanning mode corresponding to the fourth preset value.

Optionally, the determining the scanning mode of the transform coefficients and the size of the coefficient group includes: and jointly determining the size and the scanning mode of the coefficient group of the transformation coefficient by using a rate distortion optimization method.

Optionally, the converting the transform coefficients into one or more syntax elements comprises: dividing the transform coefficients into one or more coefficient groups according to the size of the coefficient groups and a scanning manner, scanning the transform coefficients contained in the coefficient groups according to the scanning manner, and representing the transform coefficients as at least one of the following syntax elements: a syntax element indicating a non-0 coefficient starting position; a syntax element indicating that a non-0 coefficient is included in the coefficient group; a syntax element indicating a non-0 coefficient position in the coefficient group; syntax elements indicating the value of non-0 coefficients in the coefficient group.

Optionally, the encoding the size of the coefficient group and the value of the syntax element, and writing the encoded bits into a code stream includes: encoding the size of the coefficient group used by the transform coefficient using one of the following methods: encoding a size of the coefficient group; coding the value of the index serial number corresponding to the size of the coefficient group; setting a zone bit corresponding to the size of the coefficient group, and coding the value of the zone bit.

Optionally, the encoding the size of the coefficient group and the value of the syntax element, and writing the encoded bits into a code stream includes: writing the coded bits into data units in the code stream, wherein the data units in the code stream comprise at least one of the following: one or more parameter sets, slice headers, block-level data units.

According to another embodiment of the present invention, there is provided a method of decoding an image, including: analyzing the code stream, and determining a predicted value of a decoding block; analyzing the code stream, and determining the scanning mode of the transform coefficient in the decoding block, the size of the coefficient group and the value of the syntax element related to the transform coefficient; processing coefficient groups in the decoding block according to the scanning mode and the sizes of the coefficient groups, and converting the syntax elements into transformation coefficients in the coefficient groups; processing the transformation coefficient to obtain a recovery value of the transformation coefficient; carrying out one or more times of transformation on the recovery value of the transformation coefficient to obtain a prediction difference value of the decoding block; determining a recovery value for the decoded block using the prediction value and the prediction difference.

Optionally, parsing the code stream to determine a prediction value of the decoded block includes at least one of the following methods: analyzing the code stream to obtain an inter-frame prediction parameter of the decoding block; and determining a predicted value of the decoded block by taking one or more decoded pictures as reference pictures according to the inter-frame prediction parameters. Or, analyzing the code stream to obtain the intra-frame prediction parameter of the decoding block; and determining a predicted value of the decoded block by taking a decoded part in the image of the decoded block as a reference according to the intra-prediction parameter.

Optionally, parsing the code stream, and determining a size of a coefficient group of a transform coefficient in the decoded block includes: analyzing the code stream, acquiring a first coefficient group parameter from a data unit in the code stream, and determining the size of the coefficient group according to the first coefficient group parameter; wherein, the data unit in the code stream comprises at least one of the following: one or more parameter sets, slice headers, block-level data units.

Optionally, determining the size of the coefficient group according to the first coefficient group parameter comprises: setting a size of the coefficient group using the first coefficient group parameter.

Optionally, determining the size of the coefficient group according to the first coefficient group parameter comprises: the first coefficient group parameter indicates a neighboring decoded block of the decoded block, a size of a coefficient group of the neighboring decoded block being used to set the size of the coefficient group.

Optionally, determining the size of the coefficient group according to the first coefficient group parameter comprises: determining a size of a coefficient group of transform coefficients of the decoded block from a candidate value of a size of coefficient group according to the first coefficient group parameter.

Optionally, the first coefficient group parameter includes an index number, and the size of the coefficient group is set using the size of the coefficient group corresponding to the index number in the candidate value.

Optionally, the first coefficient group parameter includes a flag bit, and the size of the coefficient group is set using the size of the coefficient group to which the flag bit corresponds in the candidate value.

Optionally, the candidate values for the size of the coefficient group are one or more fixed numerical values.

Optionally, the first coefficient group parameter includes an identification parameter, and the identification parameter is used to configure a candidate value of the size of the coefficient group.

Optionally, the identification parameter comprises at least one of: the size of the coefficient group, the side length of the system group, the width and height of the system group.

Optionally, configuring candidates for the size of the coefficient group using the identification parameter using one or more of the following methods, including: obtaining the maximum value and the minimum value of the identification parameter, determining the values of the identification parameter except the maximum value and the minimum value according to a preset dividing mode, and setting the candidate value by using the values of the identification parameter; obtaining the maximum value of the identification parameter and the maximum division level of the coefficient group, determining values except the maximum value of the identification parameter according to the preset division mode, and setting the candidate value by using the values of the identification parameter; obtaining a difference value between the maximum value of the identification parameter and the maximum value and the minimum value of the coefficient group, determining values except the maximum value of the identification parameter according to the preset dividing mode, and setting the candidate value by using the values of the identification parameter; obtaining the minimum value of the identification parameter and the maximum upward division level of the coefficient group, determining values except the minimum value of the identification parameter according to the preset division mode, and setting the candidate value by using the values of the identification parameter; and obtaining a difference value between the minimum value of the identification parameter and the maximum value and the minimum value of the coefficient group, determining values except the minimum value of the identification parameter according to the preset dividing mode, and setting the candidate value by using the values of the identification parameter.

Optionally, the preset dividing manner includes at least one of the following: quartering division, trisection division and dichotomy division.

Optionally, configuring a candidate value for the size of the coefficient group using the identification parameter comprises: setting the candidate value using a default value of the identification parameter.

Optionally, configuring a candidate value for the size of the coefficient group using the identification parameter comprises: the identification parameter is one or more flag bits indicating whether the size of the corresponding coefficient group is contained in the candidate value, and the size of the coefficient group contained in the candidate value is set according to the identification parameter.

Optionally, configuring a candidate value for the size of the coefficient group using the identification parameter comprises: the identification parameters indicate the size of one or more coefficient groups corresponding to preset Profile/Tier/Level, and the size of the coefficient groups contained in the candidate values is set according to the identification parameters.

Optionally, determining the size of the coefficient group according to the first coefficient group parameter comprises: the first parameter group parameter includes a first decoding parameter of the decoded block, and the size of the coefficient group is set to the size of the coefficient group corresponding to the first decoding parameter according to the first decoding parameter of the decoded block, where the first decoding parameter at least includes one of: a size of a transform block included in the decoded block, a prediction mode of the decoded block, a transform type used by the transform block included in the decoded block, a quantization parameter.

Optionally, the setting the size of the coefficient group to the size of the coefficient group corresponding to the first decoding parameter includes: when the size of a transform block included in the decoded block is equal to a first preset value, setting the size of the coefficient group as the size of the coefficient group corresponding to the first preset value.

Optionally, according to the first parameter group parameter, the size of the coefficient group corresponding to the first preset value is obtained.

Optionally, the setting the size of the coefficient group to the size of the coefficient group corresponding to the first decoding parameter includes: and when the prediction mode of the decoded block is equal to a first preset mode, setting the size of the coefficient group as the size of the coefficient group corresponding to the first preset mode.

Optionally, the size of the coefficient group corresponding to the first preset pattern is obtained according to the first parameter group parameter.

Optionally, the setting the size of the coefficient group to the size of the coefficient group corresponding to the first decoding parameter includes: when a transform type used by a transform block included in the decoded block is equal to a first transform type, the size of the coefficient group is set to the size of a coefficient group corresponding to the first transform type.

Optionally, the size of the coefficient group corresponding to the first transform type is obtained according to the first parameter set parameter.

Optionally, the setting the size of the coefficient group to the size of the coefficient group corresponding to the first decoding parameter includes: when the value of the quantization parameter is equal to a second preset value, setting the size of the coefficient group as the size of the coefficient group corresponding to the second preset value; or when the value of the quantization parameter is within a first preset value range, setting the size of the coefficient group as the size of the coefficient group corresponding to the first preset value range.

Optionally, the size of the coefficient group corresponding to the second preset value is obtained according to the first parameter group parameter. Or obtaining the size of the coefficient group corresponding to the first preset value range according to the first parameter group parameter.

Optionally, the analyzing the code stream and determining a scanning mode of the transform coefficient includes: analyzing a data unit in the code stream to obtain a first scanning mode parameter, and determining a scanning mode of the conversion coefficient according to the first scanning mode parameter; wherein the scanning mode is a processing sequence of elements in a two-dimensional matrix of the transform coefficients; the data unit in the code stream comprises at least one of the following: one or more parameter sets, slice headers, block-level data units.

Optionally, analyzing a data unit in the code stream to obtain a first scanning mode parameter, and determining a scanning mode of the transform coefficient according to the first scanning mode parameter includes: the scanning mode indicated by the first scanning mode parameter is used as the scanning mode of the transform coefficient.

Optionally, using the scanning mode indicated by the first scanning mode parameter as the scanning mode of the transform coefficient includes: the first scan pattern parameter indicates a neighboring decoded block of the decoded blocks, and a scan pattern of the transform coefficients is set using the scan pattern of the neighboring decoded block.

Optionally, using the scanning mode indicated by the first scanning mode parameter as the scanning mode of the transform coefficient, further includes: and determining the scanning mode of the transformation coefficient from candidate scanning modes according to the first scanning mode parameter.

Optionally, the first scan mode parameter includes a scan mode index number, and the scan mode of the transform coefficient is set using a scan mode corresponding to the scan mode index number in the candidate scan modes.

Optionally, the method further comprises: the first scan mode parameter includes a scan mode indication flag bit, and the scan mode of the transform coefficient is set using a scan mode corresponding to the scan mode indication flag bit among the candidate scan modes.

Optionally, the candidate scanning manner includes at least one of: one or more fixed scanning modes; and configuring the candidate scanning mode by using the first scanning mode parameter.

Optionally, configuring the candidate scanning manner by using the first scanning manner parameter includes: the first scanning mode parameter comprises a default scanning mode, and the candidate scanning mode is set by using the default scanning mode.

Optionally, configuring the candidate scanning manner by using the first scanning manner parameter includes: the first candidate scanning mode parameter comprises one or more candidate scanning mode indicating flag bits, and the candidate scanning mode is set by using the scanning mode corresponding to the candidate scanning mode indicating flag bits.

Optionally, configuring the candidate scanning manner by using the first scanning manner parameter includes: and setting the candidate scanning mode by using one or more scanning modes corresponding to the preset Profile/Tier/Level indicated by the first scanning mode parameter.

Optionally, configuring the candidate scanning manner by using the first scanning manner parameter includes: setting the candidate scanning manner using a correspondence between the position of the transform coefficient indicated by the first scanning manner parameter and the position of the transform coefficient after scanning.

Optionally, analyzing a data unit in the code stream to obtain a first scanning mode parameter, and determining a scanning mode of the transform coefficient according to the first scanning mode parameter; the method comprises the following steps: the first scanning mode parameter comprises a second decoding parameter of the decoding block; determining a scanning mode of the transform coefficient according to the second decoding parameter, wherein the second decoding parameter at least comprises one of the following parameters: a size of a transform block included in the decoded block, a prediction mode of the decoded block, a transform type used by a transform block included in the decoded block, a size of the decoded block.

Optionally, setting the scanning mode of the transform coefficient to the scanning mode corresponding to the second decoding parameter according to the second decoding parameter includes: and when the size of a transformation block contained in the decoding block is equal to a third preset value, setting the scanning mode of the transformation coefficient as the scanning mode corresponding to the third preset value.

Optionally, a scanning mode corresponding to the third preset value is obtained according to the first parameter group parameter.

Optionally, setting the scanning mode of the transform coefficient to the scanning mode corresponding to the second decoding parameter according to the second decoding parameter includes: and when the prediction mode of the decoded block is equal to a second preset mode, setting the scanning mode of the transformation coefficient as the scanning mode corresponding to the second preset mode.

Optionally, a scanning mode corresponding to the second preset mode is obtained according to the first parameter set parameter.

Optionally, setting the scanning mode of the transform coefficient to the scanning mode corresponding to the second decoding parameter according to the second decoding parameter includes: and when the transform type used by the transform block contained in the decoding block is equal to a second transform type, setting the scanning mode of the transform coefficient as the scanning mode corresponding to the second transform type.

Optionally, a scanning mode corresponding to the second transform type is obtained according to the first parameter set parameter.

Optionally, setting the scanning mode of the transform coefficient to the scanning mode corresponding to the second decoding parameter according to the second decoding parameter includes: and when the size of the decoding block is equal to a fourth preset value, setting the scanning mode of the transformation coefficient as the scanning mode corresponding to the fourth preset value.

Optionally, a scanning mode corresponding to a fourth preset value is obtained according to the first parameter group parameter.

Optionally, parsing the code stream to determine a value of a syntax element related to a transform coefficient includes: the syntax element comprises at least one of: a syntax element indicating a non-0 coefficient starting position; a syntax element indicating that a non-0 coefficient is included in the coefficient group; a syntax element indicating a non-0 coefficient position in the coefficient group; syntax elements indicating the value of non-0 coefficients in the coefficient group.

Optionally, the processing the transform coefficient to obtain a recovery value of the transform coefficient includes: when the transformation coefficient is judged to be subjected to Scaling processing, Scaling processing is carried out on the transformation data to obtain a recovery value of the transformation coefficient; when it is judged that the scaling processing is not performed on the transform data, a restoration value of the transform coefficient is set using the transform coefficient.

Optionally, before the processing the transform coefficient, the method further includes: analyzing the code stream to obtain a third parameter for constructing a recovery value of a prediction difference value of the decoding block; and judging whether the transformation coefficient is subjected to expansion and contraction processing or not according to the third parameter.

Optionally, the method further comprises determining a recovery value of the decoded block using the prediction value and the prediction difference value: and performing loop filtering processing on the sum of the predicted value and the predicted difference value.

According to another embodiment of the present invention, there is provided an image encoding apparatus including: the first determining module is used for determining a predicted value of a coding block and calculating a prediction difference value of the coding block and the predicted value; the transformation module is used for carrying out one or more times of transformation on the prediction difference value to obtain transformation data and determining a transformation coefficient by using the transformation data; a second determining module, configured to determine a scanning mode of the transform coefficients and a size of a coefficient group, divide the transform coefficients into one or more coefficient groups, scan the transform coefficients included in each of the coefficient groups according to the scanning mode, and convert the transform coefficients into one or more syntax elements; and the coding module is used for coding the size of the coefficient group and the value of the syntax element and writing the coded bits into a code stream.

According to another embodiment of the present invention, there is provided an image decoding apparatus including: the decoding module is used for analyzing the code stream and determining a predicted value of the decoding block, wherein the scanning mode of a transform coefficient, the size of a coefficient group and the value of a syntax element related to the transform coefficient in the decoding block are obtained; the conversion module is used for processing the coefficient groups in the decoding block according to the scanning mode and the sizes of the coefficient groups and converting the syntax elements into the transformation coefficients in the coefficient groups; the processing module is used for processing the transformation coefficient to obtain a recovery value of the transformation coefficient; the transformation module is used for processing the transformation coefficient and carrying out one or more times of transformation on the processed data to obtain a prediction difference value of the decoding block; a calculation module to determine a recovery value for the decoded block using the prediction value and the prediction difference.

According to another embodiment of the present invention, there is provided an electronic apparatus including: the encoding device, the acquisition equipment and the storage equipment are provided; the acquisition equipment is used for acquiring the image corresponding to the coding block, preprocessing the image and outputting the preprocessed image; and the storage equipment is used for receiving the output code stream and storing the code stream after the code stream is subjected to system layer processing.

According to another embodiment of the present invention, there is provided an electronic apparatus including: the decoding apparatus, the receiving device, and the display device described above, wherein the receiving device is configured to receive a code stream; and the display equipment is used for displaying the recovered image.

According to a further embodiment of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.

According to the invention, because the non-fixed-size coefficient group is allowed to be used for coding and decoding the transformation coefficient matrix, and meanwhile, the problem that the most effective coding mode of the coding coefficient cannot be selected by the coder according to the distribution condition of the transformation coefficient in the two-dimensional matrix due to the fixed-size coefficient group can be solved, thereby effectively reducing the coding overhead of the flag bit of the coefficient group and improving the coding efficiency of the transformation coefficient.

Drawings

The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:

fig. 1 is a block diagram of a hardware configuration of a mobile terminal of an image encoding method according to an embodiment of the present invention;

fig. 2 is a flowchart of an encoding method of an image according to an embodiment of the present invention;

FIG. 3 is a flow diagram of a data process for encoding the size of a coefficient group according to an embodiment of the present invention;

FIG. 4 is a data processing flow diagram of an encoding scan mode parameter according to an embodiment of the present invention;

FIG. 5 is a flow diagram of decoding of an image according to an embodiment of the present invention;

FIG. 6 is a flow diagram of a data process for resolving the size of a coefficient group according to an embodiment of the present invention;

FIG. 7 is a data processing flow diagram for parsing scan mode parameters according to an embodiment of the invention;

fig. 8 is a block diagram of a structure of an apparatus for encoding an image according to an embodiment of the present invention;

fig. 9 is a block diagram of another image encoding apparatus according to an embodiment of the present invention;

fig. 10 is a block diagram of a decoding apparatus for an image according to an embodiment of the present invention;

fig. 11 is a block diagram of another image decoding apparatus according to an embodiment of the present invention;

FIG. 12 is a diagram of an electronic device including an encoding apparatus for the above-described illustrated image;

FIG. 13 is a diagram of an electronic device including a decoding apparatus for the above-described illustrated image;

fig. 14 is an electronic system incorporating the electronic device shown above.

Detailed Description

The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.

It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.

In the following embodiments, video refers to a sequence of images composed of images. The code stream refers to a code stream generated by a video encoder encoding a video, and also refers to a transport stream and/or a media file which is obtained by processing the code stream generated by the video encoder encoding the video through a system layer and contains the code stream generated by the video encoder encoding the video, and the video can be obtained by decoding the code stream. The system layer processing is an encapsulation operation performed on a video stream, for example, the video stream is encapsulated as a data payload into a transport stream, or the video stream is encapsulated as a payload into a media file. The system layer processing also includes encapsulating transport streams or media files containing video streams as data payloads into streams for transmission or files for storage. Data units generated by the system layer processing are also referred to as system layer data units, and information added in the system layer data units during the system layer processing of the encapsulated data payload (e.g., header information of the system layer data units, etc.) is referred to as system layer information. The sub-code stream refers to a partial code stream obtained by performing extraction operation from a code stream, and decoding the sub-code stream can obtain a video image, where the video image can be an image with a resolution lower than that of a video image obtained by decoding the code stream, and can also be an image with a frame rate lower than that of a video obtained by decoding the code stream, and the video image includes partial content in the video image obtained by decoding the code stream.

66页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:生成合并候选列表的方法、装置以及电子设备、存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类