Memory structure, storage and entropy decoding method, chip, equipment and storage medium

By adopting a combined structure of row storage module, column storage module and diagonal storage module in the memory structure, the problem of large area occupancy of the memory structure in the prior art is solved, and more efficient storage and fast entropy decoding are achieved.

CN120020951APending Publication Date: 2025-05-20AMLOGIC (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311551452.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-20
Publication Date
2025-05-20

Smart Images

  • Figure CN120020951A_ABST
    Figure CN120020951A_ABST
Patent Text Reader

Abstract

A memory structure, a storage and entropy decoding method, a chip, a device and a storage medium, the memory structure comprising: a row storage module comprising a plurality of row storage units having the same row number as a decoding unit, the row storage units being in one-to-one correspondence with the ordinates of the decoding unit, each row storage unit is used for storing the coding coefficient under the corresponding ordinate and the abscissa of the coding coefficient; the column storage module comprises a plurality of column storage units with the same column number as the decoding unit, the column storage units are in one-to-one correspondence with the horizontal coordinates of the decoding unit, and each column storage unit is used for storing coding coefficients under the corresponding horizontal coordinates and vertical coordinates of the stored coding coefficients; and the number of the diagonal storage units is equal to the sum of the row number and the column number of the decoding units minus one, and each diagonal storage unit is used for storing the coding coefficient on the corresponding diagonal position line and the abscissa or the ordinate of the stored coding coefficient. The occupied area of the memory structure is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of video processing, and in particular, to a memory structure, a storage and entropy decoding method, a chip, a device, and a storage medium. Background Art

[0002] With the continuous development of network technology and video technology, the application of video in all walks of life is increasing, and digital video has become an important part of modern human society. Since the amount of data carried by video is huge, in practical applications, video data needs to be compressed and encoded to reduce the pressure of storage and transmission. The encoder processes video data through processes such as prediction, transformation, quantization, and entropy coding to generate a video bitstream for data compression. The video bitstream can be used for storage or network transmission. The decoder decodes the video bitstream through entropy decoding, inverse quantization, inverse transformation, and prediction compensation to reconstruct the video data.

[0003] The coding unit (CU) is the basic unit of video coding, and usually, entropy coding is performed on the coefficient coding block corresponding to the coding unit. Since there are coding coefficients in the coefficient coding block, the inverse operation is performed through entropy decoding to obtain the coding coefficients in the coefficient coding block, thereby realizing the decoding of the video bitstream.

[0004] However, the memory structure currently used for storing coding coefficients has a large occupied area. Summary of the Invention

[0005] The problem solved by the embodiments of the present invention is to provide a memory structure, a storage and entropy decoding method, a chip, a device, and a storage medium, which reduce the number of storage units in the memory structure, thereby reducing the occupied area of the memory structure.

[0006] To solve the above problems, an embodiment of the present invention provides a memory structure for storing encoded coefficients in a coefficient encoded block obtained by entropy decoding. The memory structure includes: a row storage module including a plurality of row storage units having the same number as the number of rows of a decoding unit, the row storage units corresponding one by one to the ordinates of the decoding unit, and each row storage unit being used to store the encoded coefficients under the corresponding ordinate and the abscissa of the stored encoded coefficient in the coefficient encoded block; a column storage module including a plurality of column storage units having the same number as the number of columns of the decoding unit, the column storage units corresponding one by one to the abscissas of the decoding unit, and each column storage unit being used to store the encoded coefficients under the corresponding abscissa and the ordinate of the stored encoded coefficient in the coefficient encoded block; a diagonal storage module including a plurality of diagonal storage units, the number of the diagonal storage units being equal to the sum of the number of rows and columns of the decoding unit minus one, the diagonal storage units corresponding one by one to diagonal position lines, the diagonal position lines including the diagonal of the decoding unit and a plurality of parallel lines parallel to the diagonal, and each diagonal storage unit being used to store the encoded coefficients on the corresponding diagonal position line and the abscissa or ordinate of the stored encoded coefficient in the coefficient encoded block.

[0007] Correspondingly, an embodiment of the present invention further provides a coefficient storage method using the memory structure of the foregoing embodiment for storing encoded coefficients in a coefficient encoded block obtained by entropy decoding. The coefficient storage method includes: storing the encoded coefficient and its abscissa in the coefficient encoded block together into a corresponding row storage unit based on the ordinate of the encoded coefficient in the coefficient encoded block; storing the encoded coefficient and its ordinate in the coefficient encoded block together into a corresponding column storage unit based on the abscissa of the encoded coefficient in the coefficient encoded block; and storing the encoded coefficient and its abscissa or ordinate in the coefficient encoded block together into a corresponding diagonal storage unit based on the diagonal position line where the encoded coefficient is located.

[0008] Correspondingly, an embodiment of the present invention further provides an entropy decoding method. The entropy decoding method is based on the coding coefficients stored in the memory structure of the foregoing embodiment. The entropy decoding method includes: determining the abscissa and ordinate of a target point in a coefficient coding block, where the target point is the position point to be currently decoded in the coefficient coding block; based on the abscissa and ordinate corresponding to the target point, performing a first search in the row storage unit corresponding to the ordinate, where the first search is used to extract the coding coefficients of several reference points that are continuously adjacent to the target point in the row direction as first reference coefficients; based on the abscissa and ordinate corresponding to the target point, performing a second search in the column storage unit corresponding to the abscissa, where the second search is used to extract the coding coefficients of several reference points that are continuously adjacent to the target point in the column direction as second reference coefficients; based on the abscissa and ordinate corresponding to the target point, performing a third search in the diagonal storage unit corresponding to the diagonal position line where the abscissa and ordinate are located, where the third search is used to extract the coding coefficients of several reference points that are continuously adjacent to the target point in the diagonal direction as third reference coefficients; and performing entropy decoding on the target point based on the extraction results of the first reference coefficients, second reference coefficients, and third reference coefficients.

[0009] Correspondingly, an embodiment of the present invention further provides a chip, including the memory structure provided in the foregoing embodiment.

[0010] Correspondingly, an embodiment of the present invention further provides a device, including at least one memory and at least one processor. The memory stores one or more computer instructions, where the one or more computer instructions are executed by the processor to implement the coefficient storage method described in the embodiment of the present invention, or to implement the entropy decoding method described in the embodiment of the present invention.

[0011] Correspondingly, an embodiment of the present invention further provides a storage medium. The storage medium stores one or more computer instructions, and the one or more computer instructions are used to implement the coefficient storage method described in the embodiment of the present invention, or to implement the entropy decoding method described in the embodiment of the present invention.

[0012] Compared with the prior art, the technical solution of the embodiment of the present invention has the following advantages:

[0013] In the memory structure provided by the embodiment of the present invention, the memory structure includes a row storage module, a column storage module, and a diagonal storage module. When performing entropy decoding operations, after determining the target point to be decoded currently in the coefficient coding block, entropy decoding calculations are usually performed through other coding coefficients around the target point, that is, entropy decoding calculations are performed based on the coding coefficients of several reference points that are continuously adjacent in the row direction, the coding coefficients of several reference points that are continuously adjacent in the column direction, and the coding coefficients of several reference points that are continuously adjacent in the diagonal direction. Therefore, based on this entropy decoding method, the row storage units are in one-to-one correspondence with the ordinates of the decoding units, and each row storage unit is used to store the coding coefficients under the corresponding ordinate. After determining the coordinates corresponding to the target point, the corresponding row storage unit can be found according to the ordinate of the target point, and several coding coefficients adjacent in the row direction with the same ordinate are searched through the abscissa of the target point. The column storage units are in one-to-one correspondence with the abscissas of the decoding units, and each column storage unit is used to store the coding coefficients under the corresponding abscissa. After determining the coordinates corresponding to the target point, the corresponding column storage unit can be found according to the abscissa of the target point, and several coding coefficients adjacent in the column direction with the same abscissa are searched through the ordinate of the target point. The diagonal storage units are in one-to-one correspondence with the diagonal position lines of the decoding units, and each diagonal storage unit is used to store the coding coefficients on the corresponding diagonal position line. After determining the coordinates corresponding to the target point, the corresponding diagonal storage unit can be found according to the ordinate and abscissa of the target point, and several coding coefficients adjacent in the diagonal direction with a preset coordinate offset are searched through the abscissa or ordinate of the target point; In summary, compared with the solution of the storage array with the same layout as the decoding unit, the embodiment of the present invention adopts a row storage module, a column storage module, and a diagonal storage module, reducing the number of storage units in the memory structure, thereby reducing the occupied area of the memory structure.

[0014] In an alternative solution, the memory structure includes a register (Flip Flop) structure, that is, the storage units in the row storage module, the column storage module, and the diagonal storage module are all registers. The response speed of the registers is faster, so that while reducing the occupied area of the memory structure, the speed of entropy decoding can be increased to meet the speed requirements of video decoding. Description of the Drawings

[0015] Figure 1 It is a schematic diagram of the structure of the row storage module provided by an embodiment of the memory structure of the present invention and a schematic diagram of its working process;

[0016] Figure 2 It is a schematic diagram of the structure of the column storage module provided by an embodiment of the memory structure of the present invention and a schematic diagram of its working process;

[0017] Figure 3 It is a schematic diagram of the structure of the diagonal storage module provided by an embodiment of the memory structure of the present invention and a schematic diagram of its working process;

[0018] Figure 4 It is a schematic flowchart of an embodiment of the coefficient storage method of the present invention;

[0019] Figure 5 It is a schematic flowchart of an embodiment of the entropy decoding method of the present invention;

[0020] Figure 6 It is a hardware structure diagram of the device provided by an embodiment of the present invention. Detailed implementation manners

[0021] As can be seen from the background art, currently, the memory structure for storing the coded coefficients obtained by entropy decoding has a large occupied area.

[0022] Specifically, in order to store the coded coefficients in the coefficient coding block, the memory structure usually adopts a storage array with the same layout as the decoding unit (i.e., the same layout as the coefficient coding block). That is, the memory structure includes a plurality of storage units arranged in an array, and the coordinate information of the position points of the storage array and the coefficient coding block corresponds one by one. Therefore, when performing entropy decoding on a certain target point in the coefficient coding block, the coded coefficients of the position points around the target point can be quickly located in the storage array.

[0023] However, if the memory structure adopts a storage array, the number of storage units is large, resulting in a large occupied area of the memory structure. For example, if the coefficient coding block is an N×N matrix, the number of storage units is N 2 pieces.

[0024] To solve the above technical problem, an embodiment of the present invention provides a memory structure, which is used to store the encoded coefficients in the coefficient encoded block obtained by entropy decoding. The memory structure includes: a row storage module, including a plurality of row storage units having the same number as the number of rows of the decoding unit. The row storage units correspond one-to-one with the vertical coordinates of the decoding unit, and each row storage unit is used to store the encoded coefficients under the corresponding vertical coordinate and the horizontal coordinate of the stored encoded coefficient in the coefficient encoded block; a column storage module, including a plurality of column storage units having the same number as the number of columns of the decoding unit. The column storage units correspond one-to-one with the horizontal coordinates of the decoding unit, and each column storage unit is used to store the encoded coefficients under the corresponding horizontal coordinate and the vertical coordinate of the stored encoded coefficient in the coefficient encoded block; a diagonal storage module, including a plurality of diagonal storage units. The number of diagonal storage units is equal to the sum of the number of rows and columns of the decoding unit minus one. The diagonal storage units correspond one-to-one with the diagonal position lines. The diagonal position lines include the diagonal of the decoding unit and a plurality of parallel lines parallel to the diagonal. Each diagonal storage unit is used to store the encoded coefficients on the corresponding diagonal position line and the horizontal or vertical coordinate of the stored encoded coefficient in the coefficient encoded block.

[0025] Compared with the solution of the storage array having the same layout as the decoding unit, the embodiment of the present invention adopts a row storage module, a column storage module, and a diagonal storage module. For the row storage module, each encoded coefficient under the same vertical coordinate is stored in the same row storage unit. For the column storage module, each encoded coefficient under the same horizontal coordinate is stored in the same column storage unit. For the diagonal storage module, each encoded coefficient on the same diagonal position line is stored in the same diagonal storage unit, reducing the number of storage units in the memory structure, thereby reducing the occupied area of the memory structure.

[0026] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following detailed description of the specific embodiments of the present invention will be given with reference to the accompanying drawings.

[0027] With reference to Figures 1 to 3 , a schematic structural diagram of an embodiment of the memory structure of the present invention and a schematic diagram of its working process are shown.

[0028] Among them, Figure 1 is a schematic structural diagram of the row storage module 100 provided by an embodiment of the memory structure of the present invention and a schematic diagram of its working process, Figure 2 is a schematic structural diagram of the column storage module 200 provided by an embodiment of the memory structure of the present invention and a schematic diagram of its working process, Figure 3It is a schematic diagram of the structure of the diagonal storage module 300 provided by an embodiment of the memory structure of the present invention and a schematic diagram of its working process.

[0029] In this embodiment, the memory structure is used to store the coding coefficients in the coefficient coding block (CB) obtained by entropy decoding, so as to provide the information required for the entropy decoding of the next target point (for example, the coding coefficients of the position points around the target point and the number of non-zero values of the coding coefficients).

[0030] It should be noted that in video coding, coding operations are performed on coding units (CUs). Specifically, after obtaining the coefficient coding block corresponding to the coding unit, an entropy coding operation is performed based on the coding coefficients in the coefficient coding block.

[0031] The coding unit is a matrix. Correspondingly, the coefficient coding block is also a matrix. Specifically, the coefficient coding block is also an m×n matrix, where m is the number of rows of the matrix, n is the number of columns of the matrix, both m and n are natural numbers, the value of m is from 1 to 32, the value of n is from 1 to 32, and the values of m and n can be the same or different. For example, the size of the coefficient coding block can be 32×32, 16×16, 8×8, or 4×4.

[0032] Specifically, the memory structure is used to store the coding coefficients obtained after entropy decoding. By storing the coding coefficients obtained after entropy decoding, it is prepared for the next entropy decoding operation. Specifically, when performing entropy decoding on the target point subsequently, other coding coefficients around the target point are extracted from the memory structure, and then the entropy decoding calculation of the target point is performed based on the extracted coding coefficients. Here, the target point is the position currently to be decoded in the coefficient coding block.

[0033] During the video processing process, video data is encoded through processes such as prediction, transformation, quantization, and entropy coding to achieve data compression and generate a video bitstream, and the video bitstream is decoded through entropy decoding, inverse quantization, inverse transformation, and prediction compensation to reconstruct the video data. Therefore, by storing the coding coefficients obtained after entropy decoding, the coding coefficients of the surrounding adjacent position points required for the entropy decoding of the next coding coefficient can be quickly provided, thereby improving the efficiency of entropy decoding.

[0034] Therefore, in this embodiment, the coding coefficients are non-zero coefficients. In other words, the memory structure is used to store non-zero coefficients. When performing entropy coding operations, only non-zero coefficients are encoded, and the number of non-zero coefficients is usually small, thus saving the bit rate of the video bitstream.

[0035] It should be noted that since the entropy decoding process includes absolute value decoding and sign bit decoding, and only the absolute values of the coefficients at adjacent positions are required to solve the absolute value of the next encoded coefficient through entropy decoding, the encoded coefficients stored in the memory structure are absolute values of the coefficients. Taking the size of the coefficient coding block as 32×32 as an example, the bit width of the encoded coefficients stored in the memory structure is 15 bits.

[0036] Specifically, the bit width of the original data corresponding to the encoded coefficients is 16 bits, and the memory structure is used to store the absolute values of the coefficients. Since the sign bit for representing positive and negative occupies 1 bit, the bit width of the encoded coefficients stored in the memory structure is 15 bits.

[0037] In addition, when storing the encoded coefficients obtained by entropy decoding into the memory structure based on the write abscissa and write ordinate, the bit widths of both the write abscissa and the write ordinate are 5 bits.

[0038] In this embodiment, the encoded coefficients are obtained based on the Versatile Video Coding (VVC) standard, that is, the memory structure is applicable to the general video coding.

[0039] In this embodiment, the memory structure includes: a row storage module 100 (as Figure 1 shown), including a plurality of row storage units 110 having the same number as the number of rows of the decoding unit. The row storage units 110 correspond one-to-one with the vertical coordinates of the decoding unit, and each row storage unit 110 is used to store the encoded coefficients under the corresponding vertical coordinate and the abscissa of the stored encoded coefficients in the coefficient coding block; a column storage module 200 (as Figure 2 shown), including a plurality of column storage units 210 having the same number as the number of columns of the decoding unit. The column storage units 210 correspond one-to-one with the horizontal coordinates of the decoding unit, and each column storage unit 210 is used to store the encoded coefficients under the corresponding horizontal coordinate and the vertical coordinate of the stored encoded coefficients in the coefficient coding block; a diagonal storage module 300 (as Figure 3 shown), including a plurality of diagonal storage units 310. The number of diagonal storage units 310 is equal to the sum of the number of rows and columns of the decoding unit minus one. The diagonal storage units 310 correspond one-to-one with the diagonal position lines, and the diagonal position lines include the diagonal of the decoding unit and a plurality of parallel lines parallel to the diagonal. Each diagonal storage unit 310 is used to store the encoded coefficients on the corresponding diagonal position line and the abscissa or vertical coordinate of the stored encoded coefficients in the coefficient coding block.

[0040] Here, the abscissa and ordinate of the coding coefficient in the coefficient coding block are used to represent: the position information of the coding coefficient within its corresponding coefficient coding block.

[0041] It can be understood that the memory structure is used to store the coding coefficients in the coefficient coding block obtained by entropy decoding, and the coding coefficients are the coefficients obtained by entropy coding. Therefore, the coding coefficients that the memory structure is used to store are the coefficients that are used for the inverse quantization operation after entropy decoding.

[0042] When performing the entropy decoding operation, after determining the target point to be decoded currently in the coefficient coding block, the entropy decoding calculation is usually performed through other coding coefficients around the target point, that is, the entropy decoding calculation is performed according to the coding coefficients of several reference points that are continuously adjacent in the row direction, the coding coefficients of several reference points that are continuously adjacent in the column direction, and the coding coefficients of several reference points that are continuously adjacent in the diagonal direction. Therefore, based on this entropy decoding method, the row storage unit 110 corresponds one-to-one with the ordinate of the decoding unit, and each row storage unit 110 is used to store the coding coefficients under the corresponding ordinate. Then, after determining the coordinates corresponding to the target point, the corresponding row storage unit 110 can be found according to the ordinate of the target point, and several coding coefficients that are adjacent in the row direction and have the same ordinate are searched through the abscissa of the target point. The column storage unit 210 corresponds one-to-one with the abscissa of the decoding unit, and each column storage unit 210 is used to store the coding coefficients under the corresponding abscissa. Then, after determining the coordinates corresponding to the target point, the corresponding column storage unit 210 can be found according to the abscissa of the target point, and several coding coefficients that are adjacent in the column direction and have the same abscissa are searched through the ordinate of the target point. The diagonal storage unit 310 corresponds one-to-one with the diagonal position line of the decoding unit, and each diagonal storage unit 310 is used to store the coding coefficients on the corresponding diagonal position line. Then, after determining the coordinates corresponding to the target point, the corresponding diagonal storage unit 310 can be found according to the ordinate and abscissa of the target point, and several coding coefficients that are adjacent in the diagonal direction and have a preset coordinate offset are searched through the abscissa or ordinate of the target point.

[0043] Compared with the solution of the storage array with the same layout as the decoding unit, the embodiment of the present invention adopts the row storage module 100, the column storage module 200, and the diagonal storage module 300. For the row storage module 100, each coding coefficient under the same ordinate is stored in the same row storage unit 110. For the column storage module 200, each coding coefficient under the same abscissa is stored in the same column storage unit 210. For the diagonal storage module 300, each coding coefficient located on the same diagonal position line is stored in the same diagonal storage unit 310, reducing the number of storage units in the memory structure, thereby reducing the occupied area of the memory structure.

[0044] Moreover, during entropy decoding, through the row storage module 100, column storage module 200, and diagonal storage module 300, the encoded coefficients of several consecutively adjacent reference points in the row direction, the encoded coefficients of several consecutively adjacent reference points in the column direction, and the encoded coefficients of several consecutively adjacent reference points in the diagonal direction can be extracted simultaneously, thereby improving the speed of entropy decoding and meeting the speed requirements of video decoding.

[0045] The coding unit is the basic unit of video coding. Correspondingly, the decoding unit is the basic unit of video decoding.

[0046] It should be noted that both the coding unit and the decoding unit are matrices, so there are row and column directions of the matrix.

[0047] In this embodiment, the number of the row storage units 110 is the same as the number of rows of the maximum decoding unit; the number of the column storage units 210 is the same as the number of columns of the maximum decoding unit; the number of the diagonal storage units 310 is equal to the sum of the number of rows and columns of the maximum decoding unit minus one.

[0048] Design the memory structure according to the number of rows and columns of the maximum decoding unit to be compatible with coefficient coding blocks of various sizes.

[0049] Specifically, the number of rows and columns of the maximum decoding unit is the same, and the maximum decoding unit is an N×N matrix, where N is a natural number. As an example, 32×32 is the largest decoding unit in general video coding. Therefore, the size of the maximum decoding unit is 32×32.

[0050] It can be understood that when the maximum decoding unit is further increased, the number of the row storage units 110, the number of the column storage units 210, and the number of the diagonal storage units 310 increase correspondingly.

[0051] It can be understood that there is a corresponding relationship between the coding unit and the coefficient coding block, and the decoding operation is the inverse operation of the coding operation. Therefore, there is a corresponding relationship between the decoding unit and the coding unit. Correspondingly, there is a corresponding relationship between the decoding unit and the coefficient coding block.

[0052] Reference Figure 1 As described above, the maximum decoding unit is an N×N matrix. Therefore, the number of the row storage units 110 is N groups, and each row storage unit 110 corresponds to one ordinate of the maximum decoding unit.

[0053] Specifically, after the row storage module 100 receives the write address from the previous stage (the write address includes the write abscissa and the write ordinate) and the write data (i.e., the coded coefficients obtained after entropy decoding), it stores the coded coefficients and their corresponding write abscissas into the row storage module 100, and stores them into the corresponding row storage unit 110 according to the write ordinate, so that each row storage unit 110 stores the coded coefficients under the corresponding write ordinate.

[0054] Meanwhile, the abscissas of the stored coded coefficients in the coefficient coding block are also stored into the corresponding row storage unit 110. Then, when performing entropy decoding on the target point to be decoded currently, calculations can be performed based on the difference between the abscissa of the target point and the abscissas of the coded coefficients already stored in the row storage unit 110, so as to determine whether the coded coefficients already stored in the row storage unit 110 are the coded coefficients required for entropy decoding of the target point.

[0055] Correspondingly, the reading of the row storage unit 110 is controlled by the input read ordinate. When performing entropy decoding on the target point to be decoded currently in the coefficient coding block, after determining the read coordinates corresponding to the target point, the corresponding row storage unit 110 can be found according to the input read ordinate, so as to search for several adjacent coded coefficients in the row direction with the same read ordinate through the read abscissa as the reference coefficients in the row direction.

[0056] In this embodiment, each row storage unit 110 includes: a first row storage unit 111, which is used to store the coded coefficients under the corresponding ordinate and the abscissas of the stored coded coefficients in the coefficient coding block, and the coded coefficients stored in the first row storage unit 111 are used as the first latest coded coefficients; a second row storage unit 112, which is used to store the first newly obtained coded coefficients obtained after saturation processing of the first latest coded coefficients currently stored in the first row storage unit 111 and the abscissas corresponding to the first newly obtained coded coefficients when the first row storage unit 111 updates and stores the coded coefficients. The saturation processing is used to make the bit width of the first newly obtained coded coefficients equal to the preset number of bits required for the reference point that is sub-adjacent to the target point in the row direction, and the target point is the position point to be decoded currently in the coefficient coding block.

[0057] The row storage unit 110 includes a first row storage unit 111 and a second row storage unit 112 corresponding to the first row storage unit 111, so that the first latest coded coefficients in the row storage unit 110 are stored with a complete bit width, and the first newly obtained coded coefficients are stored with a bit width after saturation processing.

[0058] In one embodiment, according to the actual calculation method, when performing entropy decoding on the target point to be decoded currently in the coefficient coding block, it is necessary to calculate using the coding coefficients of 5 reference points around the target point. Among them, the 5 reference points are respectively: the reference point closest to the target point in the row direction, the reference point next closest to the target point in the row direction, the reference point closest to the target point in the column direction, the reference point next closest to the target point in the column direction, and the reference point closest to the target point in the diagonal direction.

[0059] Specifically, entropy decoding of the coefficient coding block is performed by scanning. Taking three times of entropy decoding as an example, according to the scanning order, the coding coefficients obtained from the first entropy decoding are stored in the first row storage unit 111. After the second entropy decoding, the coding coefficients obtained from the second entropy decoding are stored in the first row storage unit 111. At this time, the coding coefficients stored in the first row storage unit 111 after the first entropy decoding become old values and are overwritten, and the old values are stored in the second row storage unit 112 after saturation processing. The coding coefficients stored in the first row storage unit 111 after the second entropy decoding become new values. Therefore, based on the entropy decoding method and the setting method of the row storage unit 110, it means that for the target point corresponding to the third entropy decoding, the first latest coding coefficient currently stored in the first row storage unit 111 may be the coding coefficient of the nearest point (i.e., the closest position point) in the row direction of the target point, the next nearest point (i.e., the next closest position point), or the coding coefficient of a farther position point, while the first new coding coefficient currently stored in the second row storage unit 112 may be the coding coefficient of the next nearest point or a farther position point, but not the coding coefficient of the nearest point.

[0060] Therefore, the row storage unit 110 includes the first row storage unit 111 and the second row storage unit 112. When performing entropy decoding on a certain target point, the first row storage unit 111 is used to output the coding coefficients of the reference point closest to the target point in the row direction, and the second row storage unit 112 is used to output the coding coefficients of the reference point next closest to the target point in the row direction, so as to meet the calculation requirements of entropy decoding. Here, the closest in the row direction means that the difference from the abscissa of the target point is 1; the next closest in the row direction means that the difference from the abscissa of the target point is 2.

[0061] Among them, by setting the first row storage unit 111 and the second row storage unit 112, it is possible to output simultaneously the coding coefficients of the reference point closest to the target point in the row direction and the coding coefficients of the reference point next closest to the target point in the row direction, thereby improving the speed of entropy decoding.

[0062] Secondly, when performing entropy decoding, the number of preset bits required for the sub-adjacent reference points in the row direction is less. After obtaining the write data of the row storage module 100, the coding coefficients in the write data are written into the first row storage unit 111 and used as the first latest coding coefficients. When the first row storage unit 111 updates and stores the coding coefficients (i.e., when new coding coefficients are written), the currently stored first latest coding coefficients (i.e., the old values) in the first row storage unit 111 will be overwritten by the newly written coding coefficients. Therefore, by performing saturation processing on the first latest coding coefficients in the first row storage unit 111 and storing the first newly obtained coding coefficients after the saturation processing of the first latest coding coefficients, the data bit width of the first newly obtained coding coefficients is reduced, thereby saving storage space.

[0063] Moreover, in the second row storage unit 112, the bit width of the first newly obtained coding coefficients is equal to the number of preset bits required for the reference points that are sub-adjacent to the target point in the row direction, thereby saving storage space as much as possible while avoiding affecting the calculation of entropy decoding.

[0064] It can be understood that the abscissa corresponding to the first newly obtained coding coefficients is the same as the abscissa corresponding to the first latest coding coefficients.

[0065] It should be noted that according to the algorithm of entropy decoding, the most adjacent reference points in the row direction and the column direction, the sub-adjacent reference points in the row direction and the column direction, and the most adjacent reference points in the diagonal direction each have the number of bits required to satisfy the entropy decoding calculation.

[0066] In a specific embodiment, the number of bits required for the most adjacent reference points in the row direction and the column direction is 15 bits each, the number of preset bits required for the sub-adjacent reference points in the row direction and the column direction is 6 bits each, and the number of preset bits required for the most adjacent reference points in the diagonal direction is 6 bits.

[0067] It should also be noted that the most adjacent reference points in the row direction and the most adjacent reference points in the column direction are located on the same diagonal position line, and the sub-adjacent reference points in the row direction, the sub-adjacent reference points in the column direction, and the most adjacent reference points in the diagonal direction are located on the same diagonal position line.

[0068] As an example, the coding coefficients obtained by entropy decoding are the absolute values of the coefficients. The bit width of the coding coefficients obtained by entropy decoding is 15 bits, and the bit width of the written abscissa is 5 bits. Then, the 20-bit data obtained by combining the coding coefficients and the written abscissa is stored in the first row storage unit 111 of the corresponding row storage unit 110.

[0069] Correspondingly, in this embodiment, in the first row storage unit 111, the bit width of the first latest coding coefficient is 15 bits.

[0070] Specifically, taking one of the row storage units 110 as an example, when the first row storage unit 111 updates and stores the coding coefficient (that is, when the latest coding coefficient is written), saturation processing is performed on the currently stored first latest coding coefficient in the first row storage unit 111 (that is, the old value stored in the first row storage unit 111), so as to store the first newly encoded coefficient after the bit width is reduced and its corresponding abscissa together into the second row storage unit 112 of the same row storage unit 110.

[0071] As an example, in the second row storage unit 112, the bit width of the first newly encoded coefficient is equal to 6 bits. Correspondingly, after the first latest coding coefficient in the first row storage unit 111 undergoes saturation processing, the 11-bit data obtained by combining the first newly encoded coefficient and the written abscissa is stored in the second row storage unit 112 of the corresponding row storage unit 110.

[0072] Specifically, when the bit width of the coding coefficient obtained after entropy decoding is j bits, if the highest (j - k) bit positions in the coding coefficient are all 0, then the first newly encoded coefficient is the same as the lowest k bit positions in the first latest coding coefficient; otherwise, the lowest bit position of the first newly encoded coefficient is the same as the lowest bit position in the first latest coding coefficient, and the remaining (k - 1) bit positions are all 1. Here, k represents the number of preset bit positions required for the reference point that is sub-adjacent to the target point in the row direction.

[0073] Taking the bit width of the first latest coding coefficient as 15 bits and the number of preset bit positions required for the reference point that is sub-adjacent to the target point in the row direction as 6 bits as an example, if the highest 9 bit positions in the coding coefficient (that is, the first latest coding coefficient in the first row storage unit 111) are all 0, then the bit width of the first newly encoded coefficient is equal to 6 bits, and the first newly encoded coefficient is the same as the lowest 6 bit positions in the first latest coding coefficient; otherwise, the lowest bit position of the first newly encoded coefficient is the same as the lowest bit position in the first latest coding coefficient, and the remaining 5 bit positions are all 1.

[0074] It should be noted that since the lowest bit position of the first newly encoded coefficient is always retained, the parity of the lowest bit position of the first newly encoded coefficient does not change, thereby avoiding affecting the subsequent calculations based on the parity of the bit positions respectively.

[0075] Correspondingly, the reading of the first row storage unit 111 and the second row storage unit 112 are both controlled by the input reading ordinate. After determining the reading coordinates corresponding to the target point, the corresponding row storage unit 110 can be found according to the input reading ordinate, so that the first latest coding coefficient written in the row corresponding to the reading ordinate can be output through the first row storage unit 111, and the first new coding coefficient written in the row corresponding to the reading ordinate can be output through the second row storage unit 112.

[0076] For example, as Figure 1 shown, the coding coefficient output by the first row storage unit 111 is the row output coefficient 1, and the coding coefficient output by the second row storage unit 112 is the row output coefficient 2.

[0077] Referring to Figure 2 , the maximum decoding unit is an N×N matrix. Therefore, the number of column storage units 210 is also N groups, and each column storage unit 210 corresponds to a write abscissa of the maximum decoding unit.

[0078] Specifically, after the column storage module 200 receives the write address (the write address includes the write abscissa and the write ordinate) and the write data from the previous stage, it stores the coding coefficient and its corresponding write ordinate into the column storage module 200 together, and stores them into the corresponding column storage unit 210 according to the write ordinate, so that each column storage unit 210 stores the coding coefficient under the corresponding write abscissa.

[0079] At the same time, the ordinate of the stored coding coefficient in the coefficient coding block is also stored into the corresponding column storage unit 210. Then, when performing entropy decoding on the current target point to be decoded, it can be calculated based on the difference between the ordinate of the target point and the ordinate of the coding coefficient already stored in the column storage unit 210, to determine whether the coding coefficient already stored in the column storage unit 210 is the coding coefficient required for entropy decoding of the target point.

[0080] Correspondingly, the reading of the column storage unit 210 is controlled by the input reading abscissa. When performing entropy decoding on the current target point to be decoded in the coefficient coding block, after determining the reading coordinates corresponding to the target point, the corresponding column storage unit 210 can be found according to the input reading abscissa, so as to search for several adjacent coding coefficients in the column direction with the same reading abscissa through the reading ordinate, as the reference coefficients in the column direction.

[0081] In this embodiment, each of the column storage units 210 includes: a first column storage unit 211, which is used to store the encoded coefficients at the corresponding abscissa and the ordinate of the stored encoded coefficients in the coefficient encoding block, and the encoded coefficients stored in the first column storage unit 211 serve as the second latest encoded coefficients; a second column storage unit 212, which is used to store the second newly generated encoded coefficients obtained after saturation processing of the currently stored second latest encoded coefficients in the first column storage unit 211 and the ordinate corresponding to the second newly generated encoded coefficients when the first column storage unit 211 updates and stores the encoded coefficients. The saturation processing is used to make the bit width of the second newly generated encoded coefficients equal to the preset number of bits required for a reference point that is sub-adjacent to the target point in the column direction. The target point is the position point currently to be decoded in the coefficient encoding block.

[0082] The column storage unit 210 includes a first column storage unit 211 and a second column storage unit 212 corresponding to the first column storage unit 211, so that the second latest encoded coefficients in the column storage unit 210 are stored with a complete bit width, and the second newly generated encoded coefficients are stored with a bit width after saturation processing.

[0083] It can be understood that the ordinate corresponding to the second newly generated encoded coefficient is the same as the ordinate corresponding to the second latest encoded coefficient.

[0084] According to the actual calculation method, when performing entropy decoding on the target point currently to be decoded in the coefficient encoding block, the encoded coefficients of 5 reference points around the target point need to be used for calculation.

[0085] When performing entropy decoding on a certain target point, the first column storage unit 211 is used to output the encoded coefficients of the reference point that is most adjacent to the target point in the column direction, and the second column storage unit 212 is used to output the encoded coefficients of the reference point that is sub-adjacent to the target point in the column direction. Here, being most adjacent in the column direction means that the difference from the ordinate of the target point is 1; being sub-adjacent in the column direction means that the difference from the ordinate of the target point is 2.

[0086] First, by setting the first column storage unit 211 and the second column storage unit 212, it is possible to simultaneously output the encoded coefficients of the reference point that is most adjacent to the target point in the column direction and the encoded coefficients of the reference point that is sub-adjacent to the target point in the column direction, thereby improving the speed of entropy decoding.

[0087] Secondly, when performing entropy decoding, the number of preset bits required for the sub-adjacent reference points in the column direction is less. After obtaining the write data of the row storage module 100, the coding coefficients in the write data are written into the first column storage unit 211 and used as the second latest coding coefficients. When the first column storage unit 211 updates and stores the coding coefficients (i.e., when a new coding coefficient is written), the currently stored second latest coding coefficient (i.e., the old value) in the first column storage unit 211 will be overwritten by the newly written coding coefficient. Therefore, by performing saturation processing on the second latest coding coefficient in the first column storage unit 211 and storing the second new coding coefficient obtained after the saturation processing of the second latest coding coefficient, the data bit width of the second new coding coefficient is reduced, thereby saving storage space.

[0088] Moreover, in the second column storage unit 212, the bit width of the second new coding coefficient is equal to the number of preset bits required for the reference point that is sub-adjacent to the target point in the column direction, so as to save storage space as much as possible while avoiding affecting the calculation of entropy decoding.

[0089] The analysis of the reason for making the column storage unit 210 include the first column storage unit 211 and the second column storage unit 212 is similar to that of the row storage unit 210. For details, reference can be made to the relevant description of the row storage unit 210 above, and no further elaboration will be given.

[0090] As an example, if the coding coefficient obtained by entropy decoding is the absolute value of the coefficient, the bit width of the coding coefficient is 15 bits, and the bit width of the written ordinate is 5 bits, then the 20-bit data obtained by combining the coding coefficient and the written ordinate is stored in the first column storage unit 211 of the corresponding column storage unit 210.

[0091] Correspondingly, in this embodiment, in the first column storage unit 211, the bit width of the second latest coding coefficient is 15 bits.

[0092] Specifically, taking one of the column storage units 210 as an example, when the first column storage unit 211 updates and stores the coding coefficients (i.e., when the latest coding coefficient is written), saturation processing will be performed on the currently stored second latest coding coefficient (i.e., the old value stored in the first column storage unit 211), so that the second new coding coefficient with a reduced bit width and its corresponding ordinate are stored in the second column storage unit 212 of the same column storage unit 210 together.

[0093] As an example, the number of preset bits required for the reference point that is sub-adjacent to the target point in the column direction is 6 bits. Therefore, in the second column storage unit 212, the bit width of the second new coding coefficient is equal to 6 bits.

[0094] Correspondingly, after the second latest coding coefficient in the first column storage unit 211 is saturated, the 11-bit data obtained by combining the second new coding coefficient and the write ordinate is stored in the second column storage unit 212 of the corresponding column storage unit 210.

[0095] Specifically, when the bit width of the coding coefficient obtained after entropy decoding is j bits, if the highest (j - k) bit positions in the coding coefficient are all 0, then the lowest k bit positions of the second new coding coefficient are the same as those of the second latest coding coefficient; otherwise, the lowest bit position of the second new coding coefficient is the same as the lowest bit position of the second latest coding coefficient, and the remaining (k - 1) bit positions are all 1. Here, k represents the preset number of bit positions required for the reference point that is sub-adjacent to the target point in the column direction.

[0096] For the description of the second new coding coefficient, reference can be made to the relevant description of the first new coding coefficient in the second row storage unit 112 above, which will not be elaborated here.

[0097] It should be noted that according to the relevant algorithms in the general video coding, the saturation processing of the latest coding coefficient in this embodiment will not change the final parameter calculation result, and still can satisfy the entropy decoding calculation that depends on the absolute values of the surrounding coding coefficients in the general video coding.

[0098] Correspondingly, the reading of the first column storage unit 211 and the second column storage unit 212 are both controlled by the input reading abscissa. After determining the reading coordinates corresponding to the target point, the corresponding column storage unit 210 can be found according to the input reading abscissa, so that the second latest coding coefficient written in the column corresponding to the reading abscissa can be output through the first column storage unit 211, and the second new coding coefficient written in the column corresponding to the reading abscissa can be output through the second column storage unit 212. For example, as Figure 2 shown, the coding coefficient output by the first column storage unit 211 is the column output coefficient 1, and the coding coefficient output by the second column storage unit 212 is the column output coefficient 2.

[0099] Since the decoding unit is a matrix, in the diagonal direction, the number of diagonal position lines is equal to the sum of the number of rows and columns of the decoding unit minus one, and the diagonal storage unit 310 corresponds to the diagonal position lines of the decoding unit one by one.

[0100] Refer to Figure 3 , since the maximum decoding unit is an N×N matrix, the number of diagonal storage units 310 is 2N - 1 groups.

[0101] Specifically, after receiving the write address (the write address includes the write abscissa and the write ordinate) and the write data from the previous stage, the diagonal storage module 300 stores the coding coefficient and its corresponding write abscissa or write ordinate into the diagonal storage module 300, and obtains the write diagonal coordinates according to the write abscissa and the write ordinate. The diagonal coordinates are used to indicate which diagonal storage unit 310 corresponding to the diagonal position line the data is written into. Therefore, according to the write diagonal coordinates, the data is stored into the corresponding diagonal storage unit 310, so that each diagonal storage unit 310 stores the coding coefficients on the corresponding diagonal position line.

[0102] Meanwhile, the abscissa or ordinate of the stored coding coefficient in the coefficient coding block is stored into the corresponding diagonal storage unit 310. Then, when performing entropy decoding on the target point to be decoded currently, calculation can be performed based on the difference between the abscissa of the target point and the abscissa of the coding coefficients already stored in the row storage unit 110, or based on the difference between the ordinate of the target point and the ordinate of the coding coefficients already stored in the row storage unit 110, to determine whether the coding coefficients already stored in the diagonal storage unit 310 are the coding coefficients required for entropy decoding of the target point.

[0103] Correspondingly, the reading of the diagonal storage unit 310 is controlled by the input read abscissa and read ordinate. When performing entropy decoding on the target point to be decoded currently in the coefficient coding block, after determining the read coordinates corresponding to the target point, the corresponding diagonal storage unit 310 can be found according to the input read abscissa and read ordinate, so that several adjacent coding coefficients in a plurality of diagonal directions with a preset coordinate offset can be searched through the read abscissa or read ordinate as the reference coefficients in the diagonal direction.

[0104] For example, as Figure 3 shown, the coding coefficient output by the diagonal storage unit 310 is the diagonal coefficient output.

[0105] It should be noted that for the same diagonal position line, after any one of the abscissa and the ordinate is determined, the other can be obtained. Therefore, only one of the write abscissa and the write ordinate needs to be stored into the diagonal storage module 300, thus saving storage space.

[0106] In this embodiment, the diagonal storage unit 310 corresponding to the coding coefficient is determined based on the expression (N - 1) - X + Y. That is to say, the diagonal coordinates are obtained through the expression (N - 1) - X + Y. Wherein, N represents the maximum value of the number of rows and columns of the decoding unit, X represents the abscissa of the coding coefficient in the coefficient coding block, and Y represents the ordinate of the coding coefficient in the coefficient coding block.

[0107] In this embodiment, the diagonal storage unit 310 is used to store the third latest coding coefficient obtained after the coding coefficient is saturated. The bit width of the third latest coding coefficient is equal to the preset number of bits required for the reference point that is most adjacent to the target point in the diagonal direction, where the target point is the position point to be decoded currently in the coefficient coding block.

[0108] It should be noted that according to the relevant algorithms in the general video coding, when performing entropy decoding, the preset number of bits required for the reference point that is most adjacent to the target point in the diagonal direction is relatively small. Therefore, the coding coefficient obtained from the previous entropy decoding is saturated, and the third latest coding coefficient obtained after the coding coefficient is saturated is stored in the diagonal storage unit 310, thereby reducing the data bit width of the third latest coding coefficient, and further saving the storage space.

[0109] The bit width of the third latest coding coefficient stored in the diagonal storage unit 310 is equal to the preset number of bits required for the reference point that is most adjacent to the target point in the diagonal direction. Therefore, it will not change the result of the subsequent entropy decoding calculation, and still can meet the entropy decoding calculation that depends on the absolute value of the surrounding coding coefficients in the general video coding.

[0110] It should also be noted that based on the parameter calculation method of the general video coding, for any target point, it depends on the coding coefficient of an adjacent position in its diagonal direction for calculation, that is, only one coding coefficient that is most adjacent in the diagonal direction is required (for example, the adjacent coding coefficient in the upper left corner of the target point). Therefore, the third latest coding coefficient stored by the diagonal storage unit 310 does not need to store the second latest coding coefficient in a saturated manner.

[0111] As an example, the preset number of bits required for the reference point that is most adjacent to the target point in the diagonal direction is 6 bits. Therefore, in the diagonal storage unit 310, the bit width of the third latest coding coefficient is equal to 6 bits.

[0112] Therefore, the bit width of the third latest coding coefficient stored in the diagonal storage unit 310 is 6 bits, and the bit width of the written abscissa or the written ordinate is 5 bits. Then, the 11-bit data obtained by combining the third latest coding coefficient and the written abscissa is stored in the corresponding diagonal storage unit 310, or the 11-bit data obtained by combining the third latest coding coefficient and the written ordinate is stored in the corresponding diagonal storage unit 310.

[0113] It should be noted that in this embodiment, the write abscissa and the read abscissa are used to represent the coordinates in the write state and the read state respectively. Similarly, the write ordinate and the read ordinate are used to represent the ordinate in the write state and the ordinate in the read state respectively. Among them, the write abscissa is used to indicate which column the write data is written into, and the write ordinate is used to indicate which row the write data is written into.

[0114] It should also be noted that if one of the top corners of the coefficient coding block is used as the coordinate origin, then one of the diagonal position lines is the diagonal line passing through the coordinate origin, and the abscissa and ordinate of the coding coefficients located on this diagonal line are equal. The remaining diagonal position lines are all lines parallel to the diagonal line passing through the coordinate origin.

[0115] The coding coefficients are obtained based on the general video coding standard. In general video coding, for a specific target point, entropy decoding calculation is performed based on the absolute values of the coding coefficients at its surrounding adjacent positions. Therefore, each coding coefficient under the same ordinate can be stored in the same row storage unit 110, each coding coefficient under the same abscissa can be stored in the same column storage unit 210, and each coding coefficient located on the same diagonal position line can be stored in the same diagonal storage unit 310. The memory structure can be compatible with the entropy decoding method in general video coding.

[0116] In this embodiment, the memory structure is a register structure, that is, the storage units in the row storage module 100, the column storage module 200, and the diagonal storage module 300 are all registers. Correspondingly, through the memory structure described in this embodiment, the number of registers is reduced.

[0117] For example, if a storage array scheme with the same layout as the maximum decoding unit is adopted, for a 32×32 maximum decoding unit, 16K bits of registers are required. However, by using the memory structure described in this embodiment, in the case of including a row storage module 100 composed of a first row storage unit 111 and a second row storage unit 112, a column storage module 200 composed of a first column storage unit 111 and a second column storage unit 112, and a diagonal storage module 300 composed of diagonal storage units 310, considering the data of the write address stored at the same time, the number of registers can be reduced to 2677 bits, which can be reduced to 16.7% of the existing storage array scheme, and can meet the parameter calculation based on the absolute values of the surrounding coding coefficients.

[0118] In addition, since the response speed of the registers is faster, the data in different registers can be read simultaneously, so that while reducing the occupied area of the memory structure, the speed of entropy decoding can be improved to meet the speed requirements of video decoding.

[0119] In other embodiments, the memory structure may also be an SRAM device structure. By adopting the solution of the embodiments of the present invention, the occupied area of the memory structure is reduced.

[0120] Correspondingly, an embodiment of the present invention further provides a coefficient storage method using the foregoing memory structure. The coefficient storage method is used to store the coded coefficients in the coefficient coded block obtained by entropy decoding.

[0121] Refer to Figure 4 , Figure 4 which is a schematic flowchart of an embodiment of the coefficient storage method of the present invention.

[0122] With reference to Figure 1 , perform step S01, and store the coded coefficient and its abscissa in the coefficient coded block into the corresponding row storage unit 110 based on the ordinate of the coded coefficient in the coefficient coded block.

[0123] By storing the coded coefficient into the row storage unit 110, it is convenient to search for the coded coefficients of several position points that are continuously adjacent to the target point in the row direction from the row storage unit 110 in the subsequent process, so as to perform the calculation of entropy decoding on the target point. Here, the target point is the position point to be decoded currently in the coefficient coded block.

[0124] As Figure 1 shown, the number of row storage units 110 is N groups, and each row storage unit 110 corresponds to an ordinate of the maximum decoding unit. Therefore, when the ordinate of the coded coefficient is determined, the row storage unit 110 into which the coded coefficient is to be stored can be determined.

[0125] Specifically, after the row storage module 100 receives the write address (the write address includes the write abscissa and the write ordinate) and the write data from the previous stage, it stores the coded coefficient and its corresponding write abscissa into the row storage module 100, and based on the write ordinate of the coded coefficient, stores the coded coefficient and its corresponding write abscissa into the corresponding row storage unit 110.

[0126] It should be noted that the write abscissa and the write ordinate are respectively used to represent the abscissa and the ordinate in the write state. The write abscissa of the coded coefficient is the abscissa of the coded coefficient in the corresponding coefficient coded block, and the write ordinate of the coded coefficient is the ordinate of the coded coefficient in the corresponding coefficient coded block.

[0127] As an example, the coded coefficient obtained by entropy decoding is the absolute value of the coefficient. Therefore, the bit width of the stored coded coefficient is 15 bits, and the bit width of the write abscissa is 5 bits. Then, the 20-bit data obtained by combining the coded coefficient and the write abscissa is stored into the corresponding row storage unit 110.

[0128] In this embodiment, each of the row storage units 110 includes a first row storage unit 111 and a second row storage unit 112. Therefore, storing the coding coefficient and its abscissa in the coefficient coding block into the corresponding row storage unit 110 includes: based on the ordinate of the coding coefficient in the coefficient coding block, storing the coding coefficient and its abscissa in the coefficient coding block into the first row storage unit 111 of the corresponding row storage unit 110, and the coding coefficient stored in the first row storage unit 111 is used as the first latest coding coefficient; when the next coding coefficient is stored into the first row storage unit 111, storing the first newly generated coding coefficient obtained after saturating the currently stored first latest coding coefficient in the first row storage unit 111 and the abscissa corresponding to the first newly generated coding coefficient into the corresponding second row storage unit 112, and the saturation processing is used to make the bit width of the first newly generated coding coefficient equal to the preset number of bits required for the reference point that is next adjacent to the target point in the row direction, and the target point is the position point to be decoded currently in the coefficient coding block.

[0129] That is to say, the step of storing the coding coefficient and its abscissa in the coefficient coding block into the corresponding row storage unit 110 further includes: when the next coding coefficient is stored into the first row storage unit 111, performing saturation processing on the currently stored first latest coding coefficient in the first row storage unit 111 to obtain the first newly generated coding coefficient.

[0130] Correspondingly, after performing saturation processing on the first latest coding coefficient, storing the first newly generated coding coefficient and its abscissa into the second row storage unit 112.

[0131] First, storing the coding coefficient obtained from the most recent entropy decoding operation into the first row storage unit 111, and storing the coding coefficient obtained from the previous entropy decoding operation after saturation processing into the second row storage unit 112. Then, when performing the next entropy decoding, the first row storage unit 111 is used to output the coding coefficient of the reference point that is most adjacent to the target point in the row direction, and the second row storage unit 112 is used to output the coding coefficient of the reference point that is next adjacent to the target point in the row direction, so as to meet the calculation requirements of entropy decoding.

[0132] When performing entropy decoding, when the first row storage unit 111 updates and stores the coding coefficient (i.e., when a new coding coefficient is written), the currently stored first latest coding coefficient (i.e., the old value) in the first row storage unit 111 will be overwritten by the newly written coding coefficient. Moreover, the number of preset bits required for the reference point that is adjacent to the previous one in the row direction is less. Therefore, by performing saturation processing on the first latest coding coefficient in the first row storage unit 111 and storing the first newly obtained coding coefficient after the saturation processing of the first latest coding coefficient, the data bit width of the first newly obtained coding coefficient is reduced, thereby saving storage space.

[0133] Moreover, in the second row storage unit 112, the bit width of the first newly obtained coding coefficient is equal to the number of preset bits required for the reference point that is adjacent to the target point in the row direction, so as to avoid affecting the calculation of entropy decoding while saving storage space as much as possible.

[0134] It can be understood that the abscissa corresponding to the first newly obtained coding coefficient is the same as the abscissa corresponding to the first latest coding coefficient.

[0135] It should be noted that according to the entropy decoding algorithm, the most adjacent reference points in the row and column directions, the reference points that are adjacent to the previous one in the row and column directions, and the most adjacent reference point in the diagonal direction each have the number of bits required to satisfy the entropy decoding calculation.

[0136] In a specific embodiment, the number of bits required for the most adjacent reference points in the row and column directions is 15 bits each, the number of preset bits required for the reference points that are adjacent to the previous one in the row and column directions is 6 bits each, and the number of preset bits required for the most adjacent reference point in the diagonal direction is 6 bits.

[0137] It should also be noted that the most adjacent reference points in the row direction and the most adjacent reference points in the column direction are located on the same diagonal position line, and the reference points that are adjacent to the previous one in the row direction, the reference points that are adjacent to the previous one in the column direction, and the most adjacent reference point in the diagonal direction are located on the same diagonal position line.

[0138] As an example, the 20-bit data obtained by combining the coding coefficient and the written abscissa is stored in the first row storage unit 111 of the corresponding row storage unit 110. Correspondingly, in the first row storage unit 111, the bit width of the first latest coding coefficient is 15 bits.

[0139] Specifically, when the bit width of the coded coefficient obtained after entropy decoding is j bits, the saturation processing method includes: determining whether the highest (j - k) bits of the coded coefficient are all 0. If so, retain the lowest k bits of the coded coefficient; otherwise, only retain the lowest bit of the coded coefficient, and fill the remaining (k - 1) bits with 1; where k represents the number of preset bits required for the reference point that is sub-adjacent to the target point in the row direction.

[0140] It should be noted that the coded coefficient obtained after entropy decoding is the first latest coded coefficient stored in the first row storage unit 111.

[0141] As an example, in the step of performing saturation processing on the first latest coded coefficient, the bit width of the first new coded coefficient is equal to 6 bits.

[0142] Correspondingly, taking the bit width of the coded coefficient obtained after entropy decoding as 15 bits and the number of preset bits required for the reference point that is sub-adjacent to the target point in the row direction as 6 bits as an example, in the step of performing saturation processing, determine whether the highest 9 bits of the coded coefficient are all 0. If the highest 9 bits of the coded coefficient are all 0, retain the lowest 6 bits of the coded coefficient; otherwise, only retain the lowest bit of the coded coefficient, and fill the remaining 5 bits with 1.

[0143] Correspondingly, after performing saturation processing on the first latest coded coefficient in the first row storage unit 111, store the 11-bit data obtained by combining the first new coded coefficient and the written abscissa into the second row storage unit 112 of the corresponding row storage unit 110.

[0144] It should be noted that since the lowest bit of the first new coded coefficient is always retained, the parity of the lowest bit of the first new coded coefficient remains unchanged, thereby avoiding affecting the subsequent calculation based on the parity of the bit positions.

[0145] Combined with reference Figure 2 , execute step S02, and store the coded coefficient and its ordinate in the coefficient coding block into the corresponding column storage unit 210 based on the abscissa of the coded coefficient in the coefficient coding block.

[0146] By storing the coded coefficient into the column storage unit 210, it is convenient to search for the coded coefficients of several position points that are continuously adjacent to the target point in the column direction from the column storage unit 210 for calculating the entropy decoding of the target point.

[0147] Such as Figure 2As shown, the number of column storage units 210 is N groups, and each column storage unit 210 corresponds to a write abscissa of the maximum decoding unit. Therefore, when the abscissa of the encoding coefficient is determined, the column storage unit 210 where the encoding coefficient is to be stored can be determined.

[0148] Specifically, after the column storage module 200 receives the write address from the previous stage (the write address includes the write abscissa and the write ordinate) and the write data, it stores the encoding coefficient and its corresponding write ordinate into the column storage module 200, and based on the write ordinate of the encoding coefficient, stores the encoding coefficient and its corresponding write ordinate into the corresponding column storage unit 210.

[0149] As an example, if the bit width of the stored encoding coefficient is 15 bits and the bit width of the write ordinate is 5 bits, then the 20-bit data obtained by combining the encoding coefficient and the write ordinate is stored into the corresponding column storage unit 210.

[0150] In this embodiment, each column storage unit 210 includes a first column storage unit 211 and a second column storage unit 212. Therefore, storing the encoding coefficient and its ordinate in the coefficient encoding block into the corresponding column storage unit 210 includes: based on the abscissa of the encoding coefficient in the coefficient encoding block, storing the encoding coefficient and its ordinate in the coefficient encoding block into the first column storage unit 211 of the corresponding column storage unit 210, and the encoding coefficient stored in the first column storage unit 211 is used as the second latest encoding coefficient; when the next encoding coefficient is stored into the first column storage unit 211, storing the second new encoding coefficient obtained by saturating the currently stored second latest encoding coefficient in the first column storage unit 211 and the ordinate corresponding to the second new encoding coefficient into the corresponding second column storage unit 212, and the saturation process is used to make the bit width of the second new encoding coefficient equal to the preset number of bits required for the reference point that is sub-adjacent to the target point in the column direction, and the target point is the position point to be decoded currently in the coefficient encoding block.

[0151] That is to say, the step of storing the encoding coefficient and its ordinate in the coefficient encoding block into the corresponding column storage unit 210 further includes: when the next encoding coefficient is stored into the first column storage unit 211, performing a saturation process on the currently stored second latest encoding coefficient in the first column storage unit 211 to obtain a second new encoding coefficient.

[0152] Correspondingly, after performing the saturation process on the second latest encoding coefficient, storing the second new encoding coefficient and its ordinate into the second column storage unit 212.

[0153] The coding coefficients obtained from the most recent entropy decoding operation are first stored in the first-column storage unit 211, and the coding coefficients obtained from the previous entropy decoding operation are saturated and then stored in the second-column storage unit 212. Then, when the next entropy decoding is performed, the first-column storage unit 211 is used to output the coding coefficients of the reference point that is most adjacent to the target point in the column direction, and the second-column storage unit 212 is used to output the coding coefficients of the reference point that is second adjacent to the target point in the column direction, so as to meet the calculation requirements of entropy decoding.

[0154] Correspondingly, when the next coding coefficient is stored in the first-column storage unit 211, the second most recent coding coefficient currently stored in the first-column storage unit 211 is saturated.

[0155] Moreover, in the second-column storage unit 212, the bit width of the second new coding coefficient is equal to the preset number of bits required for the reference point that is second adjacent to the target point in the column direction, so as to save storage space as much as possible while avoiding affecting the calculation of entropy decoding.

[0156] It can be understood that the ordinate corresponding to the second new coding coefficient is the same as the ordinate corresponding to the second most recent coding coefficient.

[0157] Specifically, taking one of the column storage units 210 as an example, when the first-column storage unit 211 is written with the latest coding coefficient, the old value stored in it (i.e., the second most recent coding coefficient written last time) is saturated, so that the second new coding coefficient with a reduced bit width and its corresponding ordinate are stored together in the second-column storage unit 212 of the same column storage unit 210.

[0158] As an example, in the step of saturating the second most recent coding coefficient, the bit width of the second new coding coefficient is equal to 6 bits.

[0159] Correspondingly, after saturating the second most recent coding coefficient in the first-column storage unit 211, the 11-bit data obtained by combining the second new coding coefficient and the written ordinate is stored in the second-column storage unit 212 of the corresponding column storage unit 210.

[0160] For the specific description of the method of saturating the second most recent coding coefficient in the first-column storage unit 211, reference can be made to the relevant description of saturating the first most recent coding coefficient in the first-row storage unit 111 above, which will not be elaborated here.

[0161] Combined reference Figure 3, perform step S03, and based on the diagonal position line where the encoding coefficient is located, store the encoding coefficient and its abscissa or ordinate in the coefficient encoding block into the corresponding diagonal storage unit 310 together.

[0162] By storing the encoding coefficient into the diagonal storage unit 310, it is convenient to subsequently search for the encoding coefficients of several position points that are continuously adjacent to the target point in the diagonal direction from the diagonal storage unit 310 to perform entropy decoding calculation on the target point.

[0163] Such as Figure 3 shown, the number of diagonal storage units 310 is 2N - 1 groups, and each diagonal storage unit 310 corresponds to a diagonal position line of the maximum decoding unit. Therefore, when the abscissa and ordinate of the encoding coefficient are determined, the diagonal storage unit 310 into which the encoding coefficient is to be stored can be determined.

[0164] Specifically, after the diagonal storage module 300 receives the write address (the write address includes the write abscissa and the write ordinate) and the write data from the previous stage, it stores the encoding coefficient and its corresponding write abscissa or write ordinate into the diagonal storage module 300 together, and obtains the write diagonal coordinate according to the write abscissa and the write ordinate. The diagonal coordinate is used to indicate which diagonal storage unit 310 corresponding to which diagonal position line the data is written into, so as to store it into the corresponding diagonal storage unit 310 according to the write diagonal coordinate.

[0165] It should be noted that for the same diagonal position line, after any one of the abscissa and the ordinate is determined, the other can be obtained. Therefore, only one of the write abscissa and the write ordinate needs to be stored into the diagonal storage module 300, thus saving storage space.

[0166] In this embodiment, based on the diagonal position line where the encoding coefficient is located, storing the encoding coefficient and its abscissa or ordinate in the coefficient encoding block into the corresponding diagonal storage unit 310 includes: determining the diagonal storage unit corresponding to the encoding coefficient based on the expression (N - 1) - X + Y; where N represents the maximum value of the number of rows and columns of the decoding unit, X represents the abscissa of the encoding coefficient in the coefficient encoding block, and Y represents the ordinate of the encoding coefficient in the coefficient encoding block.

[0167] It should be noted that determining the diagonal storage unit corresponding to the encoding coefficient based on the expression (N - 1) - X + Y means that the diagonal coordinate is obtained through the expression (N - 1) - X + Y.

[0168] In this embodiment, before storing the encoding coefficient and its abscissa or ordinate in the coefficient encoding block into the corresponding diagonal storage unit 310, the following steps are further included: performing step S04 to perform saturation processing on the encoding coefficient to obtain a third latest encoding coefficient, where the saturation processing is used to make the bit width of the third latest encoding coefficient equal to the preset number of bits required for the reference point that is closest to the target point in the diagonal direction, and the target point is the position point to be decoded currently in the coefficient encoding block.

[0169] Here, in the step of performing saturation processing on the encoding coefficient, the encoding coefficient is the write data stored in the memory structure, that is, the encoding coefficient obtained by entropy decoding.

[0170] According to the relevant algorithms in the general video coding, when performing entropy decoding, the preset number of bits required for the reference point that is closest to the target point in the diagonal direction is relatively small. Therefore, the encoding coefficient obtained by the previous entropy decoding is subjected to saturation processing, and the third latest encoding coefficient obtained after the encoding coefficient is subjected to saturation processing is stored in the diagonal storage unit 310, thereby reducing the data bit width of the third latest encoding coefficient and further saving storage space.

[0171] Moreover, the bit width of the third latest encoding coefficient stored in the diagonal storage unit 310 is equal to the preset number of bits required for the reference point that is closest to the target point in the diagonal direction, so the result of the subsequent entropy decoding calculation will not be changed, and it can still meet the entropy decoding calculation in the general video coding that depends on the absolute value of the surrounding encoding coefficients.

[0172] Correspondingly, in the step of storing the encoding coefficient and its abscissa or ordinate in the coefficient encoding block into the corresponding diagonal storage unit 310, the third latest encoding coefficient is stored in the diagonal storage unit 310.

[0173] It should be noted that based on the parameter calculation method of the general video coding, for any target point, it is necessary to rely on the encoding coefficient at an adjacent position in its diagonal direction for calculation, that is, only one encoding coefficient that is closest to the target point in the diagonal direction (for example, the adjacent encoding coefficient in the upper left corner of the target point) is required. Therefore, the third latest encoding coefficient stored in the diagonal storage unit 310 does not need to store the second latest encoding coefficient in a saturated processing manner.

[0174] As an example, the preset number of bits required for the reference point that is closest to the target point in the diagonal direction is 6 bits. Therefore, in the diagonal storage unit 310, the bit width of the third latest encoding coefficient is equal to 6 bits.

[0175] Therefore, the bit width of the third latest encoded coefficient stored in the diagonal storage unit 310 is 6 bits, and the bit width of the written abscissa or the written ordinate is 5 bits. Then, the 11-bit data obtained by combining the third latest encoded coefficient and the written abscissa is stored in the corresponding diagonal storage unit 310, or the 11-bit data obtained by combining the third latest encoded coefficient and the written ordinate is stored in the corresponding diagonal storage unit 310.

[0176] It should be noted that for the specific description of the memory structure, reference can be made to the relevant description in the foregoing embodiments, which will not be elaborated in this embodiment.

[0177] Correspondingly, an embodiment of the present invention further provides an entropy decoding method, and the entropy decoding method is performed based on the encoded coefficients stored in the memory structure described in the foregoing embodiments.

[0178] Figure 5 It is a schematic flowchart of an embodiment of the entropy decoding method of the present invention.

[0179] Refer to Figure 5 , and perform step S101 to determine the abscissa and ordinate of the target point in the coefficient coding block, where the target point is the position point to be decoded currently in the coefficient coding block.

[0180] By determining the abscissa and ordinate of the target point, so as to subsequently search for the encoded coefficients of several consecutive adjacent reference points in the row direction, the encoded coefficients of several consecutive adjacent reference points in the column direction, and the encoded coefficients of several consecutive adjacent reference points in the diagonal direction according to the abscissa and ordinate of the target point.

[0181] For example, the coordinates of the target point in its corresponding coefficient coding block are (X, Y).

[0182] Continue to refer to Figure 5 , and in combination with reference to Figure 1 , perform step S102 to perform a first search from the row storage unit 110 corresponding to the ordinate based on the abscissa and ordinate corresponding to the target point, where the first search is used to extract the encoded coefficients of several reference points that are consecutively adjacent to the target point in the row direction as the first reference coefficients.

[0183] For a specific target point, entropy decoding calculation needs to be performed based on the absolute values of the encoded coefficients at its adjacent positions. Therefore, extracting the encoded coefficients of several reference points that are consecutively adjacent to the target point in the row direction prepares for the subsequent entropy decoding calculation of the target point.

[0184] Specifically, the reading of the row storage unit 110 is controlled by the input reading ordinate. After determining the reading coordinates (X, Y) corresponding to the target point, the corresponding row storage unit 110 can be found according to the input reading ordinate Y, so as to search for a plurality of coding coefficients adjacent in the row direction with the same reading ordinate through the reading abscissa and use them as the reference coefficients in the row direction.

[0185] As an example, based on the principle of entropy decoding calculation, in the step of performing the first search from the row storage unit corresponding to the ordinate, the first search is used to extract the coding coefficients of two reference points that are continuously adjacent to the target point in the row direction.

[0186] Taking the first search for finding two continuously adjacent reference points on the left side of the target point as an example, if there are two reference points stored in the row storage unit 110 that are continuously adjacent to the target point in the row direction, the abscissas of the two reference points are X - 1 and X - 2 respectively.

[0187] In other embodiments, when the first search is used to find two continuously adjacent reference points on the right side of the target point, the abscissas of the two reference points can also be X + 1 and X + 2 respectively.

[0188] That is to say, the difference between the abscissa of the reference point closest to the target point in the row direction and the abscissa of the target point is 1, and the difference between the abscissa of the reference point next closest to the target point in the row direction and the abscissa of the target point is 2.

[0189] Since the coding coefficients of the same ordinate are stored in the same row storage unit 110, and the data stored in the row storage unit 110 includes the abscissa of the coding coefficient, therefore, by comparing the abscissa of the target point with the abscissa of the coding coefficient stored in the row storage unit 110, it is possible to determine whether the coding coefficient stored in the row storage unit 110 is the coding coefficient required for entropy decoding of the target point.

[0190] In this embodiment, each of the row storage units 110 includes a first row storage unit 111 and a second row storage unit 112. The first row storage unit 111 is used to store the encoded coefficients at the corresponding ordinate and the abscissa of the stored encoded coefficients in the coefficient encoding block. The encoded coefficients stored in the first row storage unit 111 are used as the first latest encoded coefficients. The second row storage unit 112 is used to store the first newly encoded coefficients obtained after saturating the currently stored first latest encoded coefficients in the first row storage unit 111 and the abscissas corresponding to the first newly encoded coefficients when the first row storage unit 111 updates and stores the encoded coefficients. The saturation process is used to make the bit width of the first newly encoded coefficients equal to the preset number of bits required for the reference points that are next adjacent to the target point in the row direction. The target point is the position point to be decoded currently in the coefficient encoding block.

[0191] For the specific descriptions of the first row storage unit 111 and the second row storage unit 112, reference can be made to the relevant descriptions in the foregoing embodiments, and details are not described herein again.

[0192] Correspondingly, the step of performing the first search from the row storage unit 110 corresponding to the ordinate includes: searching, from the first row storage unit 111 of the row storage unit 110 corresponding to the ordinate, for the first latest encoded coefficient of the reference point that is most adjacent to the target point in the row direction as the first reference coefficient; searching, from the second row storage unit 112 of the row storage unit 110 corresponding to the ordinate, for the first newly encoded coefficient of the reference point that is next adjacent to the target point in the row direction as the first reference coefficient.

[0193] Continue to refer to Figure 5 and, in combination with referring to Figure 2 , execute step S103. Based on the abscissa and ordinate corresponding to the target point, perform a second search from the column storage unit 210 corresponding to the abscissa. The second search is used to extract the encoded coefficients of several reference points that are continuously adjacent to the target point in the column direction as the second reference coefficients.

[0194] Extracting the encoded coefficients of several reference points that are continuously adjacent to the target point in the row direction prepares for the subsequent entropy decoding calculation of the target point.

[0195] Specifically, the reading of the storage units in the column storage unit 210 is controlled by the input reading abscissa. After determining the reading coordinates (X, Y) corresponding to the target point, the corresponding column storage unit 210 can be found according to the input reading abscissa X, so that several encoded coefficients adjacent in the column direction with the same reading abscissa X can be searched by reading the ordinate Y and used as the reference coefficients in the column direction.

[0196] As an example, in the step of performing a second search on the column storage unit corresponding to the abscissa based on the principle of entropy decoding calculation, the second search is used to extract the coding coefficients of two reference points that are continuously adjacent to the target point in the column direction.

[0197] Taking the second search for finding two continuously adjacent second reference points above the target point as an example, if the column storage unit 210 stores two reference points that are continuously adjacent to the target point in the row direction, the ordinates of these two reference points are Y + 1 and Y + 2 respectively.

[0198] In other embodiments, in the case where the second search is used to find two continuously adjacent reference points below the target point, the ordinates of the two reference points can also be Y - 1 and Y - 2 respectively.

[0199] That is to say, the difference between the ordinate of the reference point that is most adjacent to the target point in the column direction and the ordinate of the target point is 1, and the difference between the ordinate of the reference point that is second adjacent to the target point in the column direction and the ordinate of the target point is 2.

[0200] Since the coding coefficients of the same abscissa are stored in the same column storage unit 210, and the data stored in the column storage unit 210 includes the ordinate of the coding coefficient, therefore, by comparing the ordinate of the target point with the ordinate of the coding coefficient stored in the column storage unit 210, it is determined whether the coding coefficient stored in the column storage unit 210 is the coding coefficient required for entropy decoding of the target point.

[0201] In this embodiment, each column storage unit 210 includes a first column storage unit 211 and a second column storage unit 212. The first column storage unit 211 is used to store the coding coefficients under the corresponding abscissa and the ordinate of the stored coding coefficient in the coefficient coding block. The coding coefficients stored in the first column storage unit 211 are used as the second latest coding coefficients. The second column storage unit 212 is used to store the second newly generated coding coefficients obtained by saturating the second latest coding coefficients currently stored in the first column storage unit 211 and the ordinates corresponding to the second newly generated coding coefficients when the first column storage unit 211 updates the stored coding coefficients. The saturation processing is used to make the bit width of the second newly generated coding coefficients equal to the preset number of bits required for the reference point that is second adjacent to the target point in the column direction. The target point is the position point currently to be decoded in the coefficient coding block.

[0202] For the specific descriptions of the first column storage unit 211 and the second column storage unit 212, reference can be made to the relevant descriptions in the foregoing embodiments, and details are not described herein again.

[0203] Correspondingly, the step of performing the second search from the column storage unit 210 corresponding to the abscissa includes: searching for the second latest coding coefficient of the reference point that is most adjacent to the target point in the column direction from the first column storage unit 211 of the column storage unit 210 corresponding to the abscissa as the second reference coefficient; searching for the second new coding coefficient of the reference point that is the second most adjacent to the target point in the column direction from the second column storage unit 212 of the column storage unit 210 corresponding to the abscissa as the second reference coefficient.

[0204] Continue to refer to Figure 5 and in combination with reference to Figure 3 , perform step S104. Based on the abscissa and ordinate corresponding to the target point, perform a third search from the diagonal storage unit 310 corresponding to the diagonal position line where the abscissa and ordinate are located. The third search is used to extract the coding coefficients of several reference points that are continuously adjacent to the target point in the diagonal direction as the third reference coefficients.

[0205] Extracting the coding coefficients of several reference points that are continuously adjacent to the target point in the diagonal direction prepares for subsequent entropy decoding calculation of the target point.

[0206] Specifically, the reading of the diagonal storage unit 310 is controlled by the input reading abscissa and reading ordinate. After determining the reading coordinates (X, Y) corresponding to the target point, the corresponding diagonal storage unit 310 can be found according to the input reading abscissa X and reading ordinate Y, so that several coding coefficients that are continuously adjacent in the diagonal direction can be extracted by the reading abscissa X or the reading ordinate Y.

[0207] As an example, based on the principle of entropy decoding calculation, in the step of performing the third search from the diagonal storage unit 310 corresponding to the diagonal position line where the abscissa and ordinate are located, the third search is used to extract the coding coefficient of a reference point that is adjacent to the target point in the diagonal direction.

[0208] Taking the third search for finding a most adjacent reference point in the upper left corner of the target point as an example, the abscissa of the third reference point is X - 1, and the ordinate is Y + 1.

[0209] In some other embodiments, when the third search is used to find a continuous third reference point in the upper right corner of the target point, the abscissa of the third reference point is X + 1, and the ordinate is Y + 1. In other embodiments, when the third search is used to find a continuous third reference point in the lower left corner of the target point, the abscissa of the third reference point is X + 1, and the ordinate is Y - 1.

[0210] That is to say, the difference between the abscissa of the reference point closest to the target point in the diagonal direction and the abscissa of the target point is 1, and the difference between the ordinate of the reference point closest to the target point in the diagonal direction and the ordinate of the target point is 1.

[0211] In this embodiment, since the coding coefficients located on the same diagonal position line are stored in the same diagonal storage unit 310, and the data stored in the diagonal storage unit 310 includes the abscissa of the coding coefficient, therefore, by comparing the abscissa of the target point with the abscissa of the coding coefficient stored in the diagonal storage unit 310, it is determined whether the coding coefficient stored in the diagonal storage unit 310 is the coding coefficient required for entropy decoding of the target point.

[0212] In other embodiments, the data stored in the diagonal storage unit 310 includes the ordinate of the coding coefficient, and then by comparing the ordinate of the target point with the ordinate of the coding coefficient stored in the diagonal storage unit 310, it is determined whether the coding coefficient stored in the diagonal storage unit 310 is the coding coefficient required for entropy decoding of the target point.

[0213] In this embodiment, the diagonal storage unit 310 is used to store the third latest coding coefficient obtained after the saturation processing of the coding coefficient. The bit width of the third latest coding coefficient is equal to the preset number of bits required for the reference point closest to the target point in the diagonal direction. The target point is the position point to be decoded currently in the coefficient coding block. Therefore, in the step of performing the third search from the diagonal storage unit 310 corresponding to the diagonal position line where the abscissa and ordinate are located, the coding coefficient of the reference point closest to the target point in the diagonal direction is searched as the third reference coefficient.

[0214] Specifically, in the step of performing the third search from the diagonal storage unit 310 corresponding to the diagonal position line where the abscissa and ordinate are located, the diagonal storage unit corresponding to the target point is determined based on the expression (N - 1) - X + Y; where N represents the maximum value of the number of rows and columns of the decoding unit, X represents the abscissa of the target point in the coefficient coding block, and Y represents the ordinate of the target point in the coefficient coding block.

[0215] Continue to refer to Figure 5 , execute step S105, and perform entropy decoding on the target point based on the extraction results of the first reference coefficient, the second reference coefficient, and the third reference coefficient.

[0216] The method of entropy decoding calculation is the same as the prior art, specifically the entropy decoding calculation in Versatile Video Coding (VVC), which will not be elaborated here.

[0217] It can be understood that when the reference coefficient of a certain reference point of the target point is not extracted, it means that the coding coefficient of this reference point has not been written into the memory structure, that is, the coding coefficient of this reference point is 0.

[0218] Correspondingly, an embodiment of the present invention further provides a chip, and the chip includes the memory structure described in the foregoing embodiment.

[0219] The occupied area of the memory structure is relatively small, which is beneficial to improving the integration degree of the chip.

[0220] Moreover, when the memory structure includes a register (Flip Flop) structure, the response speed of the register is faster, so that while improving the integration degree of the chip, the performance of the chip is improved.

[0221] For example, the chip may be an SOC (System on Chip) chip in a smart TV or a smart set-top box.

[0222] Correspondingly, an embodiment of the present invention further provides a device. The device can implement the coefficient storage method provided by the embodiment of the present invention by loading the above coefficient storage method in the form of a program, or the device can implement the entropy decoding method provided by the embodiment of the present invention by loading the above coefficient storage method in the form of a program.

[0223] Reference Figure 6 , which shows the hardware structure diagram of an electronic device provided by an embodiment of the present invention. The device in this embodiment includes: at least one processor 01, at least one communication interface 02, at least one memory 03, and at least one communication bus 04.

[0224] In this embodiment, the numbers of the processor 01, the communication interface 02, the memory 03, and the communication bus 04 are all at least one, and the processor 01, the communication interface 02, and the memory 03 complete mutual communication through the communication bus 04.

[0225] The communication interface 02 may be an interface of a communication module for network communication, for example, an interface of a GSM module.

[0226] The processor 01 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the coefficient storage method or the entropy decoding method of this embodiment.

[0227] The memory 03 may include a high-speed RAM memory and may also include a non-volatile memory, such as at least one magnetic disk memory. Among them, the memory 03 stores one or more computer instructions, and the one or more computer instructions are executed by the processor 01 to implement the coefficient storage method provided in the foregoing embodiments, or to implement the entropy decoding method provided in the foregoing embodiments.

[0228] It should be noted that the above-mentioned implementation electronic device may also include other devices (not shown) that may not be necessary for the disclosure of the embodiments of the present invention; since these other devices may not be necessary for understanding the disclosure of the embodiments of the present invention, the embodiments of the present invention do not introduce them one by one.

[0229] The embodiments of the present invention also provide a storage medium, and the storage medium stores one or more computer instructions, and the one or more computer instructions are used to implement the coefficient storage method provided in the foregoing embodiments, or to implement the entropy decoding method provided in the foregoing embodiments.

[0230] The above embodiments of the present invention are combinations of elements and features of the present invention. Unless otherwise mentioned, the elements or features can be regarded as selective. Each element or feature can be practiced without being combined with other elements or features. In addition, the embodiments of the present invention can be constructed by combining some elements and / or features. The operation sequences described in the embodiments of the present invention can be rearranged. Some configurations of any embodiment can be included in another embodiment and can be replaced by the corresponding configuration of another embodiment. It is obvious to those skilled in the art that the claims that do not have an explicit citation relationship with each other in the appended claims can be combined into the embodiments of the present invention, or can be included as new claims in the amendments after the submission of this application.

[0231] The embodiments of the present invention can be implemented by various means such as hardware, firmware, software, or a combination thereof. In the hardware configuration mode, the method according to the exemplary embodiments of the present invention can be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, etc.

[0232] In the firmware or software configuration mode, the embodiments of the present invention can be implemented in the form of modules, processes, functions, etc. The software code can be stored in the memory unit and executed by the processor. The memory unit is located inside or outside the processor and can send data to the processor and receive data from the processor through various known means.

[0233] The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the broadest scope consistent with the principles and novel features disclosed herein.

[0234] Although the present invention has been disclosed as above, it is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention should be determined by the scope defined by the claims.

Claims

1. A memory structure, characterized in that: The memory structure is used to store the coding coefficients in the coefficient coding block obtained by entropy decoding, and the memory structure includes: A row storage module, comprising a plurality of row storage units having the same number as the number of rows of the decoding units, wherein the row storage units correspond to the ordinates of the decoding units one by one, and each row storage unit is used to store a coding coefficient under the corresponding ordinate and a horizontal coordinate of the stored coding coefficient in the coefficient coding block; A column storage module, comprising a plurality of column storage units having the same number as the number of columns of the decoding unit, wherein the column storage units correspond to the horizontal coordinates of the decoding unit one by one, and each of the column storage units is used to store the coding coefficient under the corresponding horizontal coordinate and the vertical coordinate of the stored coding coefficient in the coefficient coding block; A diagonal storage module includes multiple diagonal storage units, the number of which is equal to the sum of the number of rows and the number of columns of the decoding unit minus one, and the diagonal storage units correspond one-to-one to the diagonal position lines, the diagonal position lines include the diagonal lines of the decoding unit and multiple parallel lines parallel to the diagonal lines, and each of the diagonal storage units is used to store the coding coefficients on the corresponding diagonal position lines, as well as the horizontal coordinate or vertical coordinate of the stored coding coefficients in the coefficient coding block.

2. The memory structure according to claim 1, characterized in that: Each of the row storage units comprises: a first row storage unit, the first row storage unit being used to store the coding coefficients at the corresponding ordinates and the abscissas of the stored coding coefficients in the coefficient coding block, and the coding coefficients stored in the first row storage unit being used as the first latest coding coefficients; A second row storage unit, the second row storage unit is used to store a first new coding coefficient obtained after saturation processing of the first latest coding coefficient currently stored in the first row storage unit when the first row storage unit updates the stored coding coefficient, and the horizontal coordinate corresponding to the first new coding coefficient, the saturation processing is used to make the bit width of the first new coding coefficient equal to the preset number of bits required for the reference point that is second adjacent to the target point in the row direction, and the target point is the current position point to be decoded in the coefficient coding block.

3. The memory structure according to claim 1, characterized in that: Each of the column storage units comprises: a first column storage unit, the first column storage unit being used to store the coding coefficients under the corresponding abscissas and the ordinates of the stored coding coefficients in the coefficient coding block, and the coding coefficients stored in the first column storage unit being used as the second latest coding coefficients; A second column storage unit, the second column storage unit is used to store a second new coding coefficient obtained after saturation processing of the second latest coding coefficient currently stored in the first column storage unit when the first column storage unit updates the stored coding coefficient, and the vertical coordinate corresponding to the second new coding coefficient, the saturation processing is used to make the bit width of the second new coding coefficient equal to the preset number of bits required for the reference point adjacent to the target point in the column direction, and the target point is the current position point to be decoded in the coefficient coding block.

4. The memory structure according to claim 1, characterized in that: The diagonal storage unit is used to store the third latest coding coefficient obtained after the coding coefficient is saturated, and the bit width of the third latest coding coefficient is equal to the preset number of bits required for the reference point most adjacent to the target point in the diagonal direction. The target point is the current position point to be decoded in the coefficient coding block.

5. The memory structure according to any one of claims 2 to 4, characterized in that: The preset number of bits required for the reference point is equal to 6 bits.

6. The memory structure according to any one of claims 1 to 4, characterized in that: The diagonal storage unit corresponding to the coding coefficient is determined based on the expression (N-1)-X+Y; wherein N represents the maximum value of the number of rows and columns of the decoding unit, X represents the horizontal coordinate of the coding coefficient in the coefficient coding block, and Y represents the vertical coordinate of the coding coefficient in the coefficient coding block.

7. The memory structure according to any one of claims 1 to 4, characterized in that: The number of the row storage units is the same as the number of rows of the maximum decoding unit; the number of the column storage units is the same as the number of columns of the maximum decoding unit; the number of the diagonal storage units is equal to the sum of the number of rows and the number of columns of the maximum decoding unit minus one.

8. The memory structure according to claim 7, characterized in that: The size of the maximum decoding unit is 32×32.

9. The memory structure according to any one of claims 1 to 4, characterized in that: The memory structure includes a register structure or an SRAM device structure.

10. A coefficient storage method using the memory structure according to any one of claims 1 to 9, characterized in that: The coefficient storage method is used to store the coding coefficients in the coefficient coding block obtained by entropy decoding, and the coefficient storage method includes: Based on the ordinate of the coding coefficient in the coefficient coding block, storing the coding coefficient and its abscissa in the coefficient coding block in a corresponding row storage unit; Based on the abscissa of the coding coefficient in the coefficient coding block, storing the coding coefficient and its ordinate in the coefficient coding block in a corresponding column storage unit; Based on the diagonal position line where the coding coefficient is located, the coding coefficient and its horizontal coordinate or vertical coordinate in the coefficient coding block are stored together in the corresponding diagonal storage unit.

11. The coefficient storage method according to claim 10, characterized in that: Each of the row storage units includes a first row storage unit and a second row storage unit; Storing the coding coefficient and its horizontal coordinate in the coefficient coding block together in a corresponding row storage unit, comprising: based on the vertical coordinate of the coding coefficient in the coefficient coding block, storing the coding coefficient and its horizontal coordinate in the coefficient coding block together in a first row storage unit of the corresponding row storage unit, wherein the coding coefficient stored in the first row storage unit is used as the first latest coding coefficient; When the next coding coefficient is stored in the first row storage unit, the first new coding coefficient obtained after saturation processing of the first latest coding coefficient currently stored in the first row storage unit and the horizontal coordinate corresponding to the first new coding coefficient are stored in the corresponding second row storage unit together. The saturation processing is used to make the bit width of the first new coding coefficient equal to the preset number of bits required for the reference point that is second adjacent to the target point in the row direction. The target point is the current position point to be decoded in the coefficient coding block.

12. The coefficient storage method according to claim 10, characterized in that: Each of the column storage units includes a first column storage unit and a second column storage unit; Storing the coding coefficient and its ordinate in the coefficient coding block together in a corresponding column storage unit, comprising: based on the abscissa of the coding coefficient in the coefficient coding block, storing the coding coefficient and its ordinate in the coefficient coding block together in a first column storage unit of the corresponding column storage unit, wherein the coding coefficient stored in the first column storage unit is used as the second latest coding coefficient; When the next coding coefficient is stored in the first column storage unit, the second new coding coefficient currently stored in the first column storage unit is obtained after saturation processing, and the vertical coordinate corresponding to the second new coding coefficient are stored in the corresponding second column storage unit together. The saturation processing is used to make the bit width of the second new coding coefficient equal to the preset number of bits required for the reference point adjacent to the target point in the column direction, and the target point is the current position point to be decoded in the coefficient coding block.

13. The coefficient storage method according to claim 10, characterized in that: Before storing the coding coefficient and its abscissa or ordinate in the coefficient coding block in the corresponding diagonal storage unit, the method further includes: performing saturation processing on the coding coefficient to obtain a third latest coding coefficient, wherein the saturation processing is used to make the bit width of the third latest coding coefficient equal to the preset bit number required by the reference point that is most adjacent to the target point in the diagonal direction, and the target point is the current position point to be decoded in the coefficient coding block; In the step of storing the coding coefficient and its horizontal coordinate or vertical coordinate in the coefficient coding block in the corresponding diagonal storage unit, the third latest coding coefficient is stored in the diagonal storage unit.

14. The coefficient storage method according to any one of claims 11 to 13, characterized in that: The preset number of bits required for the reference point is equal to 6 bits.

15. The coefficient storage method according to any one of claims 11 to 13, characterized in that: The bit width of the coding coefficient obtained after entropy decoding is j bits, and the saturation processing method includes: determining whether the highest (jk) bits in the coding coefficient are all 0, and if so, retaining the lowest k bits in the coding coefficient; otherwise, only retaining the lowest bit in the coding coefficient, and filling the remaining (k-1) bits with 1; wherein k represents the preset number of bits required for the reference point.

16. The coefficient storage method according to any one of claims 10 to 13, characterized in that: Based on the diagonal position line where the coding coefficient is located, the coding coefficient and its horizontal coordinate or vertical coordinate in the coefficient coding block are stored in the corresponding diagonal storage unit, including: determining the diagonal storage unit corresponding to the coding coefficient based on the expression (N-1)-X+Y; wherein N represents the maximum value of the number of rows and columns of the decoding unit, X represents the horizontal coordinate of the coding coefficient in the coefficient coding block, and Y represents the vertical coordinate of the coding coefficient in the coefficient coding block.

17. An entropy decoding method, characterized in that: The entropy decoding method is performed based on coding coefficients stored in a memory structure according to any one of claims 1 to 9, and the entropy decoding method comprises: Determine the abscissa and ordinate of a target point in a coefficient coding block, wherein the target point is a position point currently to be decoded in the coefficient coding block; Based on the abscissa and the ordinate corresponding to the target point, performing a first search from the row storage unit corresponding to the ordinate, the first search being used to extract coding coefficients of a plurality of reference points that are continuously adjacent to the target point in the row direction as first reference coefficients; Based on the abscissa and the ordinate corresponding to the target point, performing a second search from the column storage unit corresponding to the abscissa, the second search being used to extract coding coefficients of a plurality of reference points that are continuously adjacent to the target point in the column direction as second reference coefficients; Based on the abscissa and ordinate corresponding to the target point, a third search is performed from the diagonal storage unit corresponding to the diagonal position line where the abscissa and ordinate are located, wherein the third search is used to extract coding coefficients of a plurality of reference points that are continuously adjacent to the target point in the diagonal direction as third reference coefficients; Based on the extraction results of the first reference coefficient, the second reference coefficient and the third reference coefficient, entropy decoding is performed on the target point.

18. The entropy decoding method according to claim 17, characterized in that: Each of the row storage units comprises: a first row storage unit, the first row storage unit being used to store the coding coefficients at the corresponding ordinates and the abscissas of the stored coding coefficients in the coefficient coding block, the coding coefficients stored in the first row storage unit being used as the first latest coding coefficients; a second row storage unit, the second row storage unit being used to store, when the first row storage unit updates the stored coding coefficient, a first new coding coefficient obtained after saturation processing of the first latest coding coefficient currently stored in the first row storage unit, and a horizontal coordinate corresponding to the first new coding coefficient, wherein the saturation processing is used to make the bit width of the first new coding coefficient equal to the preset number of bits required for a reference point that is second adjacent to a target point in a row direction, the target point being a position point currently to be decoded in the coefficient coding block; The step of performing a first search from the row storage unit corresponding to the vertical coordinate includes: searching, from the first row storage unit of the row storage unit corresponding to the vertical coordinate, the first latest coding coefficient of the reference point most adjacent to the target point in the row direction as the first reference coefficient; and searching, from the second row storage unit of the row storage unit corresponding to the vertical coordinate, the first new coding coefficient of the reference point second adjacent to the target point in the row direction as the first reference coefficient.

19. The entropy decoding method according to claim 17, characterized in that: Each of the column storage units comprises: a first column storage unit, the first column storage unit being used to store the coding coefficients under the corresponding abscissas and the ordinates of the stored coding coefficients in the coefficient coding block, the coding coefficients stored in the first column storage unit being used as the second latest coding coefficients; a second column storage unit, the second column storage unit being used to store, when the first column storage unit updates the stored coding coefficient, a second new coding coefficient obtained after saturation processing of the second latest coding coefficient currently stored in the first column storage unit, and a ordinate corresponding to the second new coding coefficient, wherein the saturation processing is used to make the bit width of the second new coding coefficient equal to the preset number of bits required by a reference point that is secondarily adjacent to a target point in a column direction, the target point being a position point currently to be decoded in the coefficient coding block; The step of performing a second search from the column storage unit corresponding to the horizontal coordinate includes: searching from the first column storage unit of the column storage unit corresponding to the horizontal coordinate the second latest coding coefficient of the reference point most adjacent to the target point in the column direction as the second reference coefficient; searching from the second column storage unit of the column storage unit corresponding to the horizontal coordinate the second latest coding coefficient of the reference point second adjacent to the target point in the column direction as the second reference coefficient.

20. The entropy decoding method according to claim 17, wherein: The diagonal storage unit is used to store the third latest coding coefficient obtained after the coding coefficient is saturated, and the bit width of the third latest coding coefficient is equal to the preset bit number required by the reference point that is most adjacent to the target point in the diagonal direction, and the target point is the position point currently to be decoded in the coefficient coding block; In the step of performing a third search from the diagonal storage unit corresponding to the diagonal position line where the horizontal coordinate and the vertical coordinate are located, the coding coefficient of the reference point that is most adjacent to the target point in the diagonal direction is searched as the third reference coefficient.

21. The entropy decoding method according to any one of claims 17 to 20, characterized in that: In the step of performing a third search from the diagonal storage units corresponding to the diagonal position lines where the horizontal and vertical coordinates are located, the diagonal storage unit corresponding to the target point is determined based on the expression (N-1)-X+Y; wherein N represents the maximum value of the number of rows and columns of the decoding unit, X represents the horizontal coordinate of the target point in the coefficient coding block, and Y represents the vertical coordinate of the target point in the coefficient coding block.

22. A chip, characterized in that: The invention comprises the memory structure as claimed in any one of claims 1 to 9.

23. A device, characterized in that The method comprises at least one memory and at least one processor, wherein the memory stores one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the coefficient storage method according to any one of claims 10 to 16, or to implement the entropy decoding method according to any one of claims 17 to 21.

24. A storage medium, characterized in that: The storage medium stores one or more computer instructions, and the one or more computer instructions are used to implement the coefficient storage method according to any one of claims 10 to 16, or to implement the entropy decoding method according to any one of claims 17 to 21.