Matrix transpose circuit with low power consumption, electronic component and electronic equipment
By adding a cache module and using the SPSRAM storage structure in the matrix transposition circuit, the area and power consumption problems caused by the increase in the number of transposition module memory banks in the two-dimensional DCT/IDCT operation are solved, and efficient transposition of matrix data with low power is achieved. consumption design.
Patent Information
- Application Number
- CN202410626422.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-20
- Publication Date
- 2024-08-23
AI Technical Summary
In video encoding and decoding technology, during two-dimensional DCT/IDCT operations, the increase in the number of memory banks in the transposition module leads to a sharp increase in memory area and high read and write power consumption, which affects the miniaturization and low-power design of the chip.
A cache module is added to the matrix transposition circuit to cache the data to be written and then write it into the transposition storage module to reduce the number of storage units. The SPSRAM storage structure is adopted and the writing strategy is combined to realize the transposition operation of the matrix data and reduce the storage cost. Read and write power consumption and area of the module.
It effectively reduces the memory area and read and write power consumption, optimizes the chip design, and realizes the transposition operation of matrix data without increasing too many read and write cycles.
Smart Images

Figure CN118540504A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of digital circuit technology, and in particular to a low-power matrix transposition circuit, an electronic component, and an electronic device. Background Art
[0002] In video coding and decoding technology, DCT (Discrete Cosine Transform) and IDCT (Inverse Discrete Cosine Transformation) are the most common transformation algorithms. From the coding standard H.261 in 1990 to the current AVS3, H.266, AV1, etc., the encoders in them are all based on DCT and IDCT technology, which shows that they are widely used.
[0003] In hardware implementation, the two-dimensional DCT / IDCT operation is usually split into two one-dimensional DCT / IDCT operations for implementation. Taking the implementation of two-dimensional DCT as an example, if the size of the image block to be processed is 8x8, the image block is first taken out row by row and sent to the one-dimensional DCT to obtain the row operation result, and then the row operation result is sent to the transposition module. The column-sorted result obtained after transposition is written into the storage module. After the row operation results of the 8-row one-dimensional DCT are written into the storage module, the data is read out from the storage module in sequence and sent to the next level of one-dimensional DCT for column operation.
[0004] In the common transposition module design, the row-column transposition is combined with the storage module to achieve the multi-bank memory structure, and the diagonal address writing method is adopted to meet the row writing and column reading without causing address conflicts in a certain bank. Since each bank of the multi-bank memory only stores one operation result, when the number of DCT / IDCT points increases from 8 points to 64 points, the number of banks of the memory needs to increase accordingly, and the area required for the memory will also increase sharply. At the same time, each operation needs to complete the reading or writing of the corresponding DCT / IDCT points to the memory, which will also generate large power consumption, which is not conducive to the miniaturization and low power consumption of chip design. Summary of the invention
[0005] The present invention provides a low-power matrix transposition circuit, an electronic component and an electronic device for reducing the reading and writing power consumption of a storage module in a circuit structure of two-dimensional discrete data transformation, that is, the area required for storage.
[0006] To solve the above technical problems, the present invention is achieved as follows:
[0007] On the one hand, the present invention provides a low-power matrix transposition circuit, which is applied to a circuit structure of two-dimensional discrete data transformation. The matrix transposition circuit includes a first transposition storage module, and also includes: a cache module arranged before the first transposition storage module, for caching at least part of the data to be written and then writing it into the first transposition storage module; wherein the data to be written is generated by a one-dimensional transformation module corresponding to the two-dimensional discrete data transformation, and the maximum data width of the data to be written is N, N>8; the first transposition storage module has R storage units, R is less than N.
[0008] On the other hand, the present invention also provides a low-power matrix transposition circuit, which is applied to a circuit structure for two-dimensional discrete data transformation. The matrix transposition circuit includes the transposition circuit as described above, and also includes a second transposition storage module. The cache module is also used to cache at least part of the second data to be written in a multiplexing manner and then write it into the second transposition storage module, and cooperate with the first transposition storage module to implement a ping-pong operation.
[0009] On the other hand, the present invention also provides a low-power matrix transposition method, which is applied to a circuit structure for two-dimensional discrete data transformation. The method includes: caching at least part of the data to be written and then writing it into a transposition memory; wherein the data to be written is generated by a one-dimensional transformation module corresponding to the two-dimensional discrete data transformation, and the maximum data width of the data to be written is N, N>8; the transposition storage module has R storage units, R is less than N.
[0010] In another aspect, the present invention further provides an electronic component for video encoding and decoding, which comprises a two-dimensional DCT circuit, wherein the two-dimensional DCT circuit comprises the transposition circuit as described above.
[0011] In another aspect, the present invention further provides an electronic device, comprising the electronic component as described above.
[0012] The technical solution of the present invention adds a write cache design to the front end of the transposition memory when performing row and column transposition on matrix data. At this time, increasing the read and write bit width of the transposition memory can reduce the number of required storage units, thereby reducing the area of the memory. In conjunction with the corresponding write strategy, the transposition operation of the matrix data can be completed through the write cache. Utilizing this technical solution, the read and write power consumption and occupied area of the overall storage module can be reduced without increasing too many read and write cycles, which is conducive to the miniaturization and low power consumption design of the chip.
[0013] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0015] Figure 1 Schematic diagram of pipeline circuit architecture for implementing two-dimensional DCT;
[0016] Figure 2 Schematic diagram of the folded circuit architecture for implementing two-dimensional DCT;
[0017] Figure 3 Schematic diagram of the structure of a transposition circuit according to an embodiment of the present invention;
[0018] Figure 4 A schematic diagram of the structure of a transposition circuit according to another embodiment of the present invention;
[0019] Figure 5 A schematic diagram of the structure of a transposition circuit according to another embodiment of the present invention;
[0020] Figure 6 Schematic diagram of the data format of the shift module and its output in an embodiment of the present invention;
[0021] Figure 7 A schematic diagram of a data storage format in a cache module according to an embodiment of the present invention;
[0022] Figure 8 is a schematic diagram of a data writing mode in an embodiment of the present invention;
[0023] Fig. 9 Schematic diagram of a data writing mode in Swap 3 mode in an embodiment of the present invention;
[0024] Fig.10 A schematic diagram of a write state machine in an embodiment of the present invention;
[0025] Fig.11 FIG. 4 is a schematic diagram of a transposition circuit structure according to another embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application. In addition, for the sake of clarity, parts not related to the description of the exemplary embodiments are omitted in the drawings.
[0027] In this specification, it should be understood that terms such as "including" or "having" are intended to indicate the existence of features, numbers, steps, behaviors, components, parts or combinations thereof disclosed in this specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, behaviors, components, parts or combinations thereof exist or are added. It should also be noted that the embodiments in this specification and the features in the embodiments may be combined with each other if there is no conflict.
[0028] When transforming two-dimensional discrete data, some two-dimensional algorithms are often split into two one-dimensional operations plus transposition operations when implemented in hardware. Such common two-dimensional algorithms include discrete cosine transform DCT and IDCT, discrete sine transform DST and IDST. The matrix transposition circuit provided by the present invention can be applied to the circuit structure of such two-dimensional discrete data transformation processing. The circuit structure of two-dimensional DCT will be used as an example for explanation below.
[0029] First, let's briefly explain the implementation circuit of the two-dimensional DCT. The two-dimensional DCT operation is usually divided into two one-dimensional DCT operations, that is, the input image data block is first subjected to a one-dimensional DCT row operation, the intermediate operation result is transposed, and then a one-dimensional DCT column operation is performed. This process can be implemented in two circuit architectures: one is the pipeline DCT architecture, such as Figure 1 As shown in the figure, 1-D Row DCT completes the row transformation, passes through Transpose Memory, and then is sent to 1-D Col DCT to complete the column transformation. The other is the folded DCT architecture, such as Figure 2 As shown, only one 1-D DCT is used, and through a two-to-one data selector MUX, one is selected from the data block to be processed and the transposed row operation result as the input data of the 1D-DCT.
[0030] In the circuit for implementing two-dimensional DCT, transposition storage is an essential module. The operation result of one-dimensional DCT is transposed to the intermediate result matrix through the process of "shifting - writing according to diagonal addresses - reading according to sequential addresses - shifting again". The transposition storage module can use the design of Multi-banks Memory, including multi-bank structure DPSRAM (DoublePort Static Random-Access Memory) or multi-bank structure SPSRAM (Single Port Static Random-Access Memory). However, when only one operation result is stored in each bank, when the number of DCT points increases from 8 points to 64 points, the number of banks of the corresponding memory will increase accordingly, and the area required for storage will also increase sharply, which is not conducive to the miniaturization design of the chip. Each operation requires the transposition storage module to read or write the corresponding DCT points, which will generate a large power consumption.
[0031] The inventors of the present invention compared the effects of different numbers of banks on storage area and read / write power consumption in a Multi-banks Memory storage structure under actual process conditions (22 nanometer ultra-low power process technology). The comparison results are shown in Table 1.
[0032] Table 1 Comparison of area and read / write power consumption of Multi-banks Memory
[0033] Component Area / % Read Power / % Write Power / % Leakage Power / % 32-banks DPSRAM 100% 100.0% 100.0% 100.0% 16-banks DPSRAM 82.1% 94.9% 64.9% 72.2% 8-banks DPSRAM 73.2% 82.2% 55.9% 58.3% 4-banks DPSRAM 68.7% 75.5% 51.5% 51.3% 32-banks SPSRAM 37.8% 15.4% 11.5% 25.7% 16-banks SPSRAM 37.2% 11.5% 8.4% 17.2% 8-banks SPSRAM 20.0% 9.6% 6.9% 13.0% 4-banks SPSRAM 17.1% 8.6% 6.1% 10.9%
[0034] Table 1 uses DPSRAM to implement the transposition memory of 32×32 matrix as the comparison benchmark. It can be seen from Table 1 that as the number of banks decreases, the storage area (Area) and various power consumption (Read Power, Write Power, Leakage Power) will decrease accordingly. When SPSRAM is used, the required storage area and read and write power consumption will be reduced even more. For example, when implementing the transposition of 32×32 matrix, the 4-banks SPSRAM reduces the read and write power consumption by nearly half, the Leakage Power by more than half, and the area occupied by the memory by more than half compared to the storage structure of 32-banks SPSRAM. The reduction is more obvious compared to 32-banks DPSRAM. Such a storage structure is obviously more conducive to chip design and improves chip performance.
[0035] Based on the comparison results, the storage area and read / write power consumption of the transposition module of the DCT circuit can be reduced by reducing the number of banks and using SPSRAM. However, simply reducing the number of banks cannot complete the data transposition operation.
[0036] To this end, an embodiment of the present invention provides a low-power matrix transposition circuit, which is applied to a circuit structure for two-dimensional discrete data transformation.
[0037] like Figure 3 As shown, the circuit includes: a first transposition storage module, and also includes a cache module arranged before the first transposition storage module, which is used to cache at least part of the data to be written and then write it into the first transposition storage module; wherein the data to be written is generated by a one-dimensional transformation module corresponding to the two-dimensional discrete data transformation, and the maximum data width of the data to be written is N, N>8; the first transposition storage module has R storage units, R is less than N.
[0038] The matrix transposition circuit in each embodiment of the present invention can be applied to a circuit structure for implementing a two-dimensional DCT or IDCT, wherein a one-dimensional DCT or IDCT reads a data block by row or column and then performs an operation, and the output operation result is used as input data of the matrix transposition circuit, that is, data to be written. Similarly, the matrix transposition circuit in each embodiment of the present invention can also be applied to a circuit structure for implementing a two-dimensional DST or IDST, which will not be described in detail below.
[0039] The following describes the parameters involved in the embodiments of the present invention.
[0040] (1) Parameters of DCT
[0041] The maximum processing capacity of the two-dimensional DCT module is determined by the maximum DCT width and the maximum DCT height. Generally, these two parameters are equal.
[0042] The maximum input data matrix of the two-dimensional DCT has a row width of N and a column height of M. The size of the matrix does not exceed the maximum processing capacity of the DCT module. When processing the one-dimensional DCT, the data block is taken out in batches by row and then operated. Each row has N data, and N DCT row coefficients (Row Coefficient) are output after the operation. A total of M row operations need to be performed, and the results of these row operations will enter the transposition storage module as the data to be written. Usually, N and M are powers of 2, and the common ones are 8, 16, 32, 64, etc.
[0043] (2) Parameters of the transposition circuit
[0044] The transposition storage module has multiple banks (storage units), and each bank can support S words for each read and write. The size of the word is related to the bit width of the data to be written. For example, when the precision of the DCT row coefficient is 8 bits, each word has 8 bits of data, and at most S*8 bits of data can be written to a bank each time. For example, if each bank has a storage capacity of 16 bits, 2 8-bit data can be allowed to be written into the high-order area and the low-order area respectively. The number of banks in the transposition storage module is R, R = N / S.
[0045] The N operation results output by the one-dimensional DCT can be divided into S lines, and each line has R data.
[0046] The cache module has W groups of Cache, N≥8, each group of Cache has S Lines, and each Line can store R Words. When N=8, W is 0, indicating that it is not necessary to write to the cache at this time. When N is less than 8, it is also not necessary to write to the cache, and the same writing method as when N is 8 is executed, which is the same as the method of directly writing to the transposed storage in the prior art. When designing the transposed storage circuit of the embodiment of the present invention, the specifications of the transposed storage module and the cache module can be designed according to the maximum processing capacity of the DCT module. When applied, the writing and transposition operations are performed according to the size of the actual input data block.
[0047] Cache can be implemented using flip-flops or register files with gated clocks. This circuit structure has a great advantage in terms of area when implementing small-capacity caches. Compared with the area occupied by a bank of a transposition storage module, the area occupied by such a cache with a capacity of 256 bits is much smaller. For example, the area occupied by such a cache with a capacity of 256 bits is in the order of hundreds of microns, while the area occupied by a bank of SPSRAM is in the order of thousands to tens of thousands of microns. Therefore, after adding a cache module to the transposition circuit, the increased area and power consumption will not significantly affect the chip performance.
[0048] In the embodiment of the present invention, writing to the transposed storage module after caching does not consume too much writing time and does not affect the time of reading data from the transposed storage module. In some embodiments, the time required for writing data matrices of different sizes to be written to the transposed storage module, that is, the number of cycles consumed (Cycles) is shown in Table 2, and Table 3 shows the time required to read the transposed data from the transposed storage module.
[0049] Table 2 Time consumed in writing the transposed storage module
[0050] Line width(Width) Column height(Height) Cycles 8 8 8 8 16 16 8 32 32 16 8 9 16 16 17 16 32 33 32 8 11 32 16 19 32 32 35
[0051] Table 3. Time consumed in reading the transposed storage module
[0052] Line width(Width) Column height(Height) Cycles 8 8 8+1 8 16 16+1 8 32 32+1 16 8 8+1 16 16 16+1 16 32 32+1 32 8 8+1 32 16 16+1 32 32 32+1
[0053] When the row width (Width) of the data matrix to be written is 8, the number of cache groups W required is 0, that is, the data to be written at this time does not need to be cached and is directly written to the transposed storage module. The total writing time required for the data matrix to be written does not increase, which is the same as the column height (Height) of the data matrix to be written. When the Width of the data to be written is greater than 8, these data are written to the transposed storage module after being cached, and the required writing time is increased by W cycles on the basis of the Height. When reading, read according to the sequential address, and only need to meet the read timing of the SRAM delay of one beat, and no additional reading time will be added.
[0054] The transposition storage circuit in the prior art needs to support the transposition of a matrix with a row width of N and a column height of M. At least N storage units need to be merged into a transposition memory, and simply reducing the storage units cannot achieve the transposition operation. In the solution of the embodiment of the present invention, the number of storage units R required is less than N, which reduces the area required for storage and the reading power consumption; the introduction of the buffer can improve the writing performance, and by changing S, the transposition circuit that meets the function and has the smallest area under the current process can be found. When applied, after the N row operation results of the DCT enter, at most only an additional W write cycles are required to completely write all the data into the transposition storage module. Therefore, the solution of the embodiment of the present invention effectively reduces the area required for storage and the reading power consumption without increasing too many write cycles, and optimizes the chip design.
[0055] The transposition circuit of the embodiment of the present invention may further include a control module for controlling the data writing operation of the cache module and the first transposition storage module according to the writing mode in the current writing cycle, where the writing mode is determined by N, R and the current number of write cycles.
[0056] The transposition circuit of the embodiment of the present invention may also include: a shift module arranged before the cache module, used to shift the data to be written to obtain S rows of shifted data; the control module at this time is also used to calculate the shift distance of the data to be written, and execute operations to write the S rows of shifted data into the cache module and the first transposition storage module accordingly. The purpose of shifting the data to be written by the shift module is to meet the purpose of "diagonal writing and sequential reading" of the transposition storage module. The shift distance is calculated according to the number of times the current data is written.
[0057] thus, Figure 4 A schematic diagram of the structure of a transposition circuit according to another embodiment of the present invention is given.
[0058] like Figure 4As shown, the transposition circuit of the embodiment of the present invention includes a first transposition storage module, a cache module, a shift module and a control module.
[0059] Furthermore, in the transposition circuit of the embodiment of the present invention, the shift module may be S unidirectional barrel shifters, which shift the data to be written to obtain S rows of shifted data, where S=N / R.
[0060] In the embodiment of the present invention, there may be multiple write modes, and the write operation performed by the control module includes:
[0061] If the current write cycle is in the first write mode, the first row of S rows of shifted data is written into the first transposition storage module, and the remaining rows of data are written into the cache module.
[0062] If the current write cycle is in the second write mode, the existing data in the cache module is written into the first transposition storage module, and each row of data of the S rows of shifted data is written into the cache module.
[0063] If the current write cycle is the third write mode, the first row of S rows of shifted data is written into the first transposition storage module, and the remaining rows of data are written into the cache module, and the cache data of the first row of the cache module is written into the first transposition storage module, and the cache data of the remaining rows of the cache module are exchanged.
[0064] The specific implementation of the write mode may refer to the next embodiment.
[0065] Furthermore, the transposition circuit of the embodiment of the present invention may also include an input selection module arranged before the shift module, which is used to select input data sent to the shift module, and the input data includes the data to be written and the data read from the first transposition storage module; at this time, the shift module is also used to output the data read from the first transposition storage module in the order after transposition under the control of the control module. The circuit structure can refer to Figure 5 An example is given. By setting the input selection module to reuse the shift module, the number of required devices is reduced, which is beneficial to reducing the chip area. In some embodiments, during the writing time period, the shift module shifts the data to be written to obtain multiple rows of shifted data, and writes the corresponding addresses of the cache module and the first transposition storage module; during the reading time period, the shift module shifts the multiple rows of data read from the first transposition storage module and outputs them as a transposition data sequence. The data format in the specific processing process can be referred to Figure 6 The example given.
[0066] Figure 5 A schematic diagram of the structure of a transposition circuit according to another embodiment of the present invention is given.
[0067] In this embodiment, the transposition of a maximum 32×32 matrix is realized, and the corresponding parameters are N=32, R=8, that is, the width (Width) of the data to be written is 32, and the transposition storage module adopts a multi-Bank storage structure, and the number of Banks is 8.
[0068] like Figure 5 As shown, the transposition circuit in this embodiment includes a two-choice data selector MUX, a shift module (CSFT), a cache module and a transposition storage module, and a control module (CTRL) to control the above-mentioned unit modules to complete the read and write operations.
[0069] The transposition memory module has 8 banks, and each bank can be implemented using an SPSRAM that supports Byte WriteEnable.
[0070] The two-choice data selector MUX is used to select the input data sent to the shift module. These input data come from the output of the one-dimensional DCT or the reading result from the transposition storage module. When the data sent to the data selector MUX is the data read from the transposition storage module, the shift module is also used to output the data read from the transposition storage module in the order after transposition under the control of the control module, that is, Figure 5 The Col Coeff of the OUT branch output in is the transposed column coefficient.
[0071] The shift module CSFT is four 8-bit unidirectional barrel shifters.
[0072] The data format after shifting by the shift module is as follows Figure 6 As shown. Among them, Figure 6 (a) is the data format written into the cache module after shifting. The shift module outputs 4 lines of data in parallel, and each line has 8 data. Figure 6 (b) is the transposed data directly output after shifting, that is, a sequence with a serial output length of 32.
[0073] The cache module has three groups of caches. The data storage format in each group is shown in Figure 7. The data to be written (i.e., DCT row coefficients) Coeff0~31 will be divided into 4 rows for cache, where:
[0074] Coeff7~0 is cached in Line 0;
[0075] Coeff 15-8 is cached in Line 1;
[0076] Coeff23~16 are cached in Line 2;
[0077] Coeff31~24 are cached in Line 3.
[0078] By designing the cache write strategy, it is possible to write diagonally to the transposed storage module and then read it sequentially.
[0079] Figure 8 and Fig. 9 A schematic diagram of a data writing mode in an embodiment of the present invention is given.
[0080] The write strategy in the embodiment of the present invention designs the following three modes, which can be referred to Figure 8 and Fig. 9 .
[0081] (1) Distribute mode
[0082] The first line of multiple-line shifted data from CSFT is written directly to SRAM from the cache bypass, and the remaining lines are written to corresponding lines in different groups of caches. For example, in this embodiment, in the first write cycle, the first line of data is written to Line 0 in SRAM after bypassing, and the rest are written to corresponding Line 0 in different groups of caches.
[0083] When the Width of the data to be written is 8, that is, the DCT coefficients of the one-dimensional DCT output are 8, Line 0 of the data to be written is not cached and is directly written to the transposed storage module. Since the data width is 8 and there is only one line, it means that the data to be written does not need to be cached.
[0084] When the width of the data to be written is 16, Line 0 of the data to be written is not cached, and Line 1 is cached;
[0085] When the width of the data to be written is 32, Line 0 of the data to be written is not cached, and the remaining lines are cached accordingly.
[0086] Figure 8 An example is given when the width of the data to be written is 32. The mark "x" in each row storage space of the cache indicates that there is no data in the row.
[0087] (2) Direct mode
[0088] Each row of data to be written is written into the same Cache group, and the data cached in the current Cache group is written into the transposition storage module.
[0089] When the width of the data to be written is 8, Direct mode caching will not be performed;
[0090] When the width of the data to be written is 16, Direct 0 caching is performed;
[0091] When the width of the data to be written is 32, Direct 0 / 1 / 2 caching is performed.
[0092] (3) Swap mode
[0093] The first line of data to be written is not cached, but written directly to the transposition storage module. The rest are written to the corresponding lines in different cache groups. The first line of each cache group is written to the transposition storage module, and the rest of the data in the cache needs to be swapped. The data exchange in the cache needs to meet the principle of "the data position after the exchange can complete the Direct 0 cache later". For specific exchange methods, please refer to Fig. 9 A detailed enlarged picture of Swap 3 is given. Fig. 9 Different colors represent data from different cache groups, and different line types represent data in different lines.
[0094] When the width of the data to be written is 8, Swap mode caching will not be performed;
[0095] When the width of the data to be written is 16, perform Swap 1 cache
[0096] When the width of the data to be written is 32, Swap 3 cache is performed.
[0097] In the embodiment of the present invention, the control module can realize writing and reading and writing control through the state machine, which includes independent writing state machine and reading state machine, both of which are controlled by the upper state machine. The jump timing of the state machine is related to the size of the data matrix to be written and the scale of the transposition storage module.
[0098] Start the write state machine in the write state, and the write state machine jump sequence is as follows: Fig.10 As shown (the "Dist" in the figure is an abbreviation for the distribution mode).
[0099] When the write state machine is started, the operations performed by the control module include the following aspects:
[0100] ① Select the jump direction and end condition according to the width and height of the data matrix to be written;
[0101] ②Control the cache write mode and current update status;
[0102] ③Complete SPSRAM write address, write valid, and write byte valid control according to the current data write times;
[0103] ④Complete the barrel shift distance calculation according to the current data write times to realize the diagonal storage of SPSRAM.
[0104] according to Fig.10In the write state machine, when the width of the data to be written is 32, the shifted data undergoes the write cycle of dist0—dist 1—dist 2—dist 3—direct 0—direct 1—direct 2—swap 3—direct 0—direct 1—direct 2—swap 3. When the write counter reaches 11, 19, or 35 (corresponding to the height of the data matrix to be written is 8, 16, or 32, refer to Table 2), a transposition write is completed. The write jump method when the width of the data to be written is other lengths is similar.
[0105] After the read state machine is started, the controller performs the following operations:
[0106] ① Select the end condition according to the width and height of the data matrix to be written;
[0107] ②Complete SPSRAM read address and read valid control according to the current data read times;
[0108] ③Complete the shift calculation according to the current data readout times so as to restore the order of the data stored diagonally and then output it;
[0109] ④ To effectively control the transposed data output, a delay of one beat is required to meet the read timing requirements of the SRAM.
[0110] Fig.11 A schematic diagram of the structure of a transposition circuit according to another embodiment of the present invention is given.
[0111] The above-mentioned various embodiments of the invention can be applied to the implementation of the transposition storage module in the folded DCT architecture. Figure 1 ), when the data throughput of the transposition module needs to be improved, the transposition storage provided by the above embodiment may not meet the pipeline performance. In this case, two sets of transposition storage modules can be used to implement the ping-pong operation. The circuit structure is as follows Fig.11 .
[0112] like Fig.11 As shown, the transposition circuit of this embodiment includes a first transposition storage module, a second storage module and a cache module. The first transposition storage module and the second storage module have the same or similar structure. The specific implementation method can refer to the aforementioned embodiment of the present invention. In addition to implementing the operations in the aforementioned embodiment, the cache module is also used to cache at least part of the second data to be written in a multiplexing manner and then write it into the second transposition storage module, and cooperate with the first transposition storage module to implement the ping-pong operation. For example, the current data block A is written into the first transposition storage module through the cache, and the next data block B is written into the second transposition storage module through the cache. When outputting, the data is read out from the first transposition storage module and the second transposition storage module in sequence.
[0113] In the non-folded DCT architecture, this solution can still reduce the number of banks required for the transposition storage module as a whole, thereby reducing the read and write power consumption and storage area of the transposition storage.
[0114] Based on the same inventive concept, the present specification also provides a low-power matrix transposition method, which is applied to a circuit structure of two-dimensional discrete data transformation, and the method includes: caching at least part of the data to be written and then writing it into a transposition memory; wherein the data to be written is generated by a one-dimensional transformation module corresponding to the two-dimensional discrete data transformation, and the maximum data width of the data to be written is N, N>8; the transposition memory module has R storage units, R is less than N. By writing data to the transposition memory through the write cache, the demand for the number of banks of the transposition memory can be reduced, the area of the transposition memory can be reduced, and the number of communications for each read and write can be reduced, thereby reducing the power consumption during the transposition operation.
[0115] Based on the same inventive concept, this specification also provides an electronic component for video encoding and decoding, the electronic component includes a two-dimensional DCT circuit, including any of the aforementioned matrix transposition circuits. The electronic component can be used to implement video encoding and decoding at low cost and low power consumption.
[0116] Based on the same inventive concept, this specification also provides an electronic device, which includes the electronic component as described above. For example, a smart phone including the electronic component can improve the heating situation when processing videos.
[0117] The above describes specific embodiments of the present invention. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0118] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0119] The methods, electronic components, electronic devices and circuit structures provided in the embodiments of this specification correspond to each other. Therefore, the methods, electronic components and electronic devices also have beneficial technical effects similar to those of the corresponding circuit structures. Since the beneficial technical effects of the circuit structures have been described in detail above, they will not be repeated here.
[0120] The above is only an embodiment of this specification and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A low-power matrix transposition circuit, applied to a circuit structure for two-dimensional discrete data transformation, the matrix transposition circuit comprising a first transposition storage module, It is characterized in that Also includes: A cache module disposed before the first transposition storage module, used for caching at least part of the data to be written before writing it into the first transposition storage module; in, The data to be written is generated by a one-dimensional transformation module corresponding to the two-dimensional discrete data transformation, and the maximum data width of the data to be written is N, where N>8; The first transposed storage module has R storage units, where R is less than N.
2. The circuit according to claim 1, It is characterized in that At least some of the storage units in the first transposition storage module support reading and writing at least S data to be written at one time, where S>1; The cache module includes at least W groups of caches, each group of caches has at least S rows of storage space, where W=2 (log2N)-3 -1.
3. The circuit according to claim 1, It is characterized in that Also includes: A control module is used to control the data writing operation of the cache module and the first transposition storage module according to a writing mode in a current writing cycle, wherein the writing mode is determined by N, R and the current number of writing cycles.
4. The circuit according to claim 3, It is characterized in that Also includes: The shift module arranged before the cache module is used to shift the data to be written to obtain S rows of shifted data; the control module is also used to calculate the shift distance of the data to be written, and execute operations to write the S rows of shifted data into the cache module and the first transposition storage module accordingly.
5. The circuit according to claim 4, It is characterized in that The operations performed by the control module include: If the current write cycle is in the first write mode, the first row of data of the S rows of shifted data is written into the first transposition storage module, and the remaining rows of data are written into the cache module.
6. The circuit according to claim 4, It is characterized in that The operations performed by the control module include: If the current write cycle is in the second write mode, the existing data in the cache module is written into the first transposition storage module, and each row of data of the S rows of shifted data is written into the cache module.
7. The circuit according to claim 4, It is characterized in that The operations performed by the control module include: If the current write cycle is the third write mode, the first row of data of the S rows of shifted data is written into the first transposition storage module, and the remaining rows of data are written into the cache module, and the cache data of the first row of the cache module is written into the first transposition storage module, and the cache data of the remaining rows of the cache module are swapped.
8. The circuit according to claim 1, It is characterized in that The cache module is implemented by a trigger or a register file with a gated clock.
9. The circuit according to claim 4, It is characterized in that Also includes: An input selection module disposed before the shift module, used for selecting input data sent to the shift module, the input data including the data to be written and the data read from the first transposition storage module; The shift module is further used to output the data read from the first transposition storage module in a transposed order under the control of the control module.
10. A low-power matrix transposition circuit, used in a circuit structure for two-dimensional discrete data transformation, It is characterized in that The matrix transposition circuit comprises: The transposition circuit as described in any one of claims 1 to 9 further includes a second transposition storage module, and the cache module is also used to cache at least part of the second data to be written in a multiplexing manner and then write it into the second transposition storage module, and cooperate with the first transposition storage module to implement a ping-pong operation.
11. A low-power matrix transposition method, applied to a circuit structure for two-dimensional discrete data transformation, It is characterized in that The method comprises: caching at least part of the data to be written before writing it into the transposition memory; in, The data to be written is generated by a one-dimensional transformation module corresponding to the two-dimensional discrete data transformation, and the maximum data width of the data to be written is N, where N>8; The transposition storage module has R storage units, where R is less than N.
12. An electronic component for video encoding and decoding, It is characterized in that It comprises a two-dimensional DCT circuit, wherein the two-dimensional DCT circuit comprises the transposition circuit according to any one of claims 1-10.
13. An electronic device, It is characterized in that Comprising the electronic component as claimed in claim 12.
