WO2022000324A1 - 数据编码方法、数据解码方法、数据处理方法、编码器、解码器、系统、可移动平台与计算机可读介质 - Google Patents

数据编码方法、数据解码方法、数据处理方法、编码器、解码器、系统、可移动平台与计算机可读介质 Download PDF

Info

Publication number
WO2022000324A1
WO2022000324A1 PCT/CN2020/099504 CN2020099504W WO2022000324A1 WO 2022000324 A1 WO2022000324 A1 WO 2022000324A1 CN 2020099504 W CN2020099504 W CN 2020099504W WO 2022000324 A1 WO2022000324 A1 WO 2022000324A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
code stream
block
stream data
encoded
Prior art date
Application number
PCT/CN2020/099504
Other languages
English (en)
French (fr)
Inventor
阮肇夏
赵文军
Original Assignee
深圳市大疆创新科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to PCT/CN2020/099504 priority Critical patent/WO2022000324A1/zh
Publication of WO2022000324A1 publication Critical patent/WO2022000324A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals

Definitions

  • the present disclosure relates to the technical field of data processing, and in particular, to a data encoding method, a data decoding method, a data processing method, an encoder, a decoder, a data processing system, a removable platform, and a computer-readable medium.
  • CNN Convolutional Neural Networks, Convolutional Neural Networks
  • Feature Map feature images
  • the data scale is very large, usually reaching the level of millions or even tens of millions. Therefore, the data needs to be encoded and compressed before being stored or read and written to reduce the required memory or bandwidth resources.
  • the bit lengths of the generated code stream data may not be exactly the same. For example, data with a larger value requires a higher bit length, while data with a smaller value requires a lower bit length.
  • all code stream data must be decoded in order. If only a part of the original data needs to be obtained, according to the related art, it is still necessary to decode all the data to obtain the complete original data, and then find the required part in it. Therefore, when reading data, it is necessary to read all the code stream data, which increases the occupied bandwidth, and decodes a large amount of unnecessary data, which leads to waste of resources and is not conducive to improving the performance of the encoding and decoding system.
  • the present disclosure provides a data encoding method, a data decoding method, a data processing method, an encoder, a decoder, a data processing system, a removable platform, and a computer-readable medium, thereby improving at least to a certain extent that the related art cannot decode partial data The problem.
  • a data encoding method comprising: dividing data to be encoded into a plurality of data blocks to be encoded; encoding each of the data blocks to be encoded to obtain a corresponding data block corresponding to each of the data blocks to be encoded The code stream data block; based on the base address of each code stream data block and each of the code stream data blocks, obtain the complete code stream data corresponding to the data to be encoded; the base address of the code stream data block is the The starting storage address of the code stream data block in the complete code stream data.
  • a data decoding method comprising: acquiring data to be decoded, the data block to be decoded including a plurality of code stream data blocks and a base address of each of the code stream data blocks; the code The base address of the stream data block is the starting storage address of the code stream data block in the data to be decoded; according to the base address of the target code stream data block in the plurality of code stream data blocks, from the Determining the target code stream data block in the data; reading at least one code stream data sub-block in the target code stream data block, and decoding the code stream data sub-block to generate a corresponding original data sub-block; The length of the code stream data sub-block is less than or equal to the length of the target code stream data block.
  • a data processing method which is applied to a configurator, a memory and a processor connected in sequence, the method comprising: executing the data encoding method of the first aspect or a possibility thereof by the configurator
  • the preset data to be encoded is encoded to generate code stream data
  • the generated code stream data is written into the memory to reduce the write bandwidth to the memory
  • the configurator reads all at least part of the code stream data in the memory, and decode the read code stream data to reduce the read bandwidth of the memory; run the decoded data through the processor.
  • an encoder that encodes data to be encoded by performing the data encoding method of the first aspect or a possible implementation thereof.
  • a decoder that decodes data to be decoded by executing the data decoding method of the second aspect or a possible implementation thereof.
  • a data processing system comprising: a configurator, a memory, and a processor connected in sequence; the configurator is configured to execute the data encoding method of the first aspect or a possible implementation thereof, and The preset to-be-encoded data is encoded to generate code stream data, and the generated code stream data is written into the memory to reduce the write bandwidth to the memory; the configurator is further configured to read the memory At least a part of the code stream data in the code stream data is decoded, so that the processor runs the decoded data, so as to reduce the read bandwidth of the memory.
  • a movable platform comprising: a body; a power system provided on the body, the power system being used to provide power for the movable platform; and, as in the sixth aspect above data processing system.
  • a computer-readable medium on which a computer program is stored, and when the computer program is executed by a processor, implements the data encoding method and data decoding method of the first, second or third aspect above A method, a data processing method or possible implementations thereof.
  • the data to be encoded is divided into a plurality of data blocks to be encoded, and the base address of the code stream data block corresponding to each data block to be encoded is recorded, so as to facilitate decoding according to the base address of the data block to be encoded.
  • the address finds the code stream data block where the required target data is located, so as to read and decode local data in a targeted manner, reducing the resource overhead required for encoding and decoding.
  • parallel encoding can be implemented for different data blocks to be encoded, thereby improving encoding efficiency.
  • the present disclosure is applicable to data processing of CNN feature images.
  • the base address of the code stream data block corresponding to each data block to be encoded is recorded, so as to facilitate reading the feature image when reading the feature image.
  • the required code stream data is read and decoded in a targeted manner according to the base address of each code stream data block, without reading and decoding all the code stream data, thus reducing the read bandwidth of the off-chip memory , and the computing resources required for decoding, improve the efficiency of CNN operation, and facilitate deployment in lightweight scenarios such as mobile terminals.
  • the target code stream data block can be quickly found, and the target code stream data block can be decoded in a targeted manner, without decoding other code stream data blocks, thereby The calculation amount required for decoding is reduced, the decoding efficiency is improved, and random access to data can be supported, thus broadening the application scenarios of data encoding and decoding.
  • Fig. 1 shows the structural schematic diagram of LeNet
  • Fig. 2 shows the schematic diagram of the characteristic image in Resnet 18 network
  • Fig. 3 shows the schematic diagram of CNN hardware computing platform framework
  • Fig. 4 shows the flow chart of the data encoding method in this exemplary embodiment
  • Fig. 5 shows the characteristic image schematic diagram of CNN
  • FIG. 6 shows a schematic diagram of dividing a data block to be encoded in this exemplary embodiment
  • Fig. 7 shows the flow chart of determining the base address of each to-be-encoded data block in this exemplary embodiment
  • FIG. 8 shows a flow chart of encoding a code stream data sub-block in this exemplary embodiment
  • Fig. 9 shows the sub-flow chart of the data encoding method in this exemplary embodiment
  • FIG. 10 shows a schematic diagram of encoding feature image data in this exemplary embodiment
  • FIG. 11 shows a schematic diagram of calculating residuals in this exemplary embodiment
  • FIG. 12 shows another schematic diagram of calculating residuals in this exemplary embodiment
  • FIG. 13 shows a schematic diagram of still another calculation residual in this exemplary embodiment
  • FIG. 14 shows a flowchart of the data decoding method in this exemplary embodiment
  • Fig. 15 shows the flow chart of determining the base address of the target code stream data block in this exemplary embodiment
  • Fig. 16 shows the flow chart of reading target code stream data sub-block in this exemplary embodiment
  • FIG. 17 shows a sub-flow diagram of the data decoding method in this exemplary embodiment
  • FIG. 18 shows a schematic structural diagram of a data processing system in this exemplary embodiment
  • FIG. 19 shows a flowchart of the data processing method in this exemplary embodiment
  • FIG. 20 shows an architecture diagram of an encoder in this exemplary embodiment
  • FIG. 21 shows an architecture diagram of a decoder in this exemplary embodiment
  • FIG. 22 shows a schematic structural diagram of a movable platform in this exemplary embodiment.
  • Example embodiments will now be described more fully with reference to the accompanying drawings.
  • Example embodiments can be embodied in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
  • the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
  • CNN is a feedforward neural network and one of the most representative network structures in deep learning technology. It provides an end-to-end processing method and has achieved great success in the field of image and speech processing.
  • ImageNet dataset, many successful models are based on CNN, which improves the accuracy of computer vision tasks compared to traditional neural networks.
  • Figure 1 shows the composition of LeNet (a classic CNN model), which is mainly composed of the following five structures: input layer (Input), convolution layer (Convolution, C1 in the figure indicates that the first intermediate layer is convolutional layer) layer), pooling layer (or downsampling layer, Subsampling, S2 in the figure indicates that the second intermediate layer is a pooling layer), full connection layer (Full Connection, F6 in Figure 1 indicates that the sixth intermediate layer is fully connected layer) and the output layer (Output).
  • the input layer is the input of the entire neural network, generally representing the pixel matrix of an image; the convolution layer performs convolution calculations on the input feature map through each convolution kernel, trying to make each small block in the neural network more in-depth.
  • the pooling layer does not change the depth of the three-dimensional matrix, but can reduce the size of the matrix, similar to downsampling;
  • the purpose of the fully connected layer is to complete the classification task, the previous convolutional layer and pooling
  • the transformation layer is the process of automatic image feature extraction, which needs to be classified after the feature extraction is completed;
  • the output layer is used for classification problems, and the output of the fully connected layer is Gaussian Connection (Gaussian Connection), and then normalized (such as using normalization).
  • the exponential function softmax is used to obtain the probability distribution that the current sample belongs to different types, and then complete the task of the entire network.
  • the input layer is a single-channel image of size 32x32x1, using 6 convolution kernels of 5x5x1 size, through convolution, the 6@28x28 feature image of the C1 layer can be obtained, and the number 6 represents the channel of the feature image of the C1 layer
  • the processing of images by CNN is mainly reflected in the processing of feature images of each layer.
  • the feature images are abstract representations of the input image to different degrees.
  • Figure 2 shows the Resnet 18 network (a classic residual network).
  • the feature images of different layers in the model it can be seen that with the deepening of the number of layers, the abstraction degree of the features extracted by CNN is higher, local individual features or global features are extracted, and the corresponding feature images are also more and more visually abstract.
  • LeNet and Resnet 18 are relatively simple CNN structures. According to the current development trend of CNN, the number of network layers is gradually deepening and the number of channels is gradually increasing, resulting in a sharp increase in the scale of characteristic image data of the entire network, which is occupied by chip applications. The system bandwidth is very high, which brings great challenges to the power consumption and operation speed of the device.
  • Figure 3 shows the framework of the CNN hardware computing platform. The feature images generated during the CNN computing core running CNN are first written into the on-chip memory, such as SRAM (Static Random Access Memory, static random access memory).
  • SRAM Static Random Access Memory, static random access memory
  • DMA Direct Memory Access
  • DDR Double Data Rate Synchronous Dynamic Random Access Memory, double data rate synchronous dynamic random access memory, usually referred to as DDR for short
  • the CNN computing kernel sometimes only needs the local data of the feature image, such as the feature image of one or several channels, or the image of the local area in the feature image, etc.
  • exemplary embodiments of the present disclosure provide a data encoding method, a data decoding method, a data processing method, an encoder, a decoder, a data processing system, a removable platform, and a computer-readable storage medium. It should be noted that the exemplary embodiments of the present disclosure can be applied to the processing of CNN feature image data, and can also be applied to the processing of other types of data. Various aspects of the exemplary embodiments of the present disclosure are described in detail below.
  • FIG. 4 is a flowchart of a data encoding method in this exemplary embodiment. Referring to Figure 4, the method includes the following steps S410 to S430:
  • Step S410 Divide the data to be encoded into a plurality of data blocks to be encoded.
  • the data to be encoded may be one-dimensional data (eg, one-dimensional array), two-dimensional data (eg, two-dimensional data table, single-channel image), three-dimensional data (eg, multi-channel image), and the like.
  • the data to be encoded may be divided into data blocks to be encoded.
  • the data block to be encoded is a data unit smaller than the data to be encoded, and can be divided according to the characteristics of the data to be encoded.
  • the one-dimensional data to be encoded is divided into multiple one-dimensional data blocks to be encoded
  • the two-dimensional data to be encoded is divided into A plurality of one-dimensional data blocks to be encoded or two-dimensional data blocks to be encoded
  • the three-dimensional data to be encoded is divided into a plurality of one-dimensional data blocks to be encoded, two-dimensional data blocks to be encoded or three-dimensional data blocks to be encoded.
  • the data amount of the data block to be encoded can be determined according to the hardware performance and the actual application scenario. For example, when the encoding performance is high, the data amount of each data block to be encoded can be set to be smaller to increase the number of data blocks to be encoded and improve parallel processing. efficiency, etc.
  • the present disclosure does not limit the specific manner of dividing the data blocks to be encoded and the number of the data blocks to be encoded.
  • each data block to be encoded may have the same amount of data.
  • the data to be encoded can be divided evenly to obtain data blocks to be encoded of the same size. In this way, during subsequent encoding, the encoding time required for each data block to be encoded is approximately the same, thereby improving parallel processing efficiency.
  • the data to be encoded may be an image to be encoded, such as a feature image in a CNN, or an image to be displayed transmitted between the processor and the display.
  • Figure 5 shows a schematic diagram of a multi-channel feature image in CNN, where W(Width) and H(Height) represent the width and height of the feature image, respectively, and C(Channel) represents the number of channels.
  • the feature images of each channel can be encoded separately, that is, a single feature image is the image to be encoded, and its data volume is W*H; the feature images of C channels can also be encoded together, that is, the feature images of the C channels are shared.
  • the image to be encoded is formed, and its data amount is W*H*C.
  • the preset size may be the size of the data block to be encoded.
  • the size of the image to be encoded is W*H
  • the width of each data block to be encoded and the image to be encoded may be the same, that is, the preset size of the data block to be encoded may be W*h (h ⁇ H, for example, h can be is H/4, H/8, etc.), for different data blocks to be encoded, h can be different
  • the heights of each data block to be encoded and the image to be encoded can be the same, that is, the preset size of the data block to be encoded can be w *H (w ⁇ W, for example, w can be W/4, W/8, etc.), for different data blocks to be coded, w can be different; or the data blocks to be coded are M lines in the image to be coded (that is, to be coded
  • the size of the image to be encoded may not satisfy an integer multiple of the preset size.
  • the image to be encoded of W*H is divided into When the data block to be encoded is W*M, H is not an integer multiple of M.
  • data padding may be performed on the image to be coded, so that the size of the image to be coded after filling is an integer multiple of the preset size.
  • a new row may be added below the image to be encoded, and/or a new column may be added to the right of the image to be encoded. Referring to FIG.
  • Step S420 Encode each data block to be encoded to obtain a code stream data block corresponding to each data block to be encoded.
  • the same encoding method or different encoding methods can be used, for example, run-length encoding is used for some data blocks to be encoded, residual encoding is used for some data blocks to be encoded, etc.; the same encoding bits can be used.
  • the maximum data in each data block to be encoded is 255, and a bit length of 8 bits is required, then other data are encoded in 8 bits, or different encoding bit lengths can be used, usually according to the largest data in each data block to be encoded. Determine the bit length. This disclosure does not limit this.
  • Step S430 based on the base address of each code stream data block and each code stream data block, obtain complete code stream data corresponding to the data to be encoded.
  • the base address of the code stream data block may be the initial storage address of the code stream data block in the complete code stream data, for example, the storage address where the first data in the code stream data block is located.
  • the base address of each code stream data block can be determined by the following steps S710 and S720:
  • Step S710 according to the starting address and the offset value determined by the bit length of the header code stream, determine the base address of the first code stream data block;
  • Step S720 according to the base address of the previous code stream data block and the offset value determined by the length of the previous code stream data block, sequentially determine the base addresses of each code stream data block after the first code stream data block.
  • the starting address can be 0.
  • the header stream can record some basic information of the data to be encoded, such as size information, base address information, and so on. If the bit length of the header stream is k units (1 unit can be a specific number of bytes), the k+1th unit is the base address of the first code stream data block; for example, the first code The length of the stream data block is B1 units, then the k+1+B1th unit is the base address of the second code stream data block; and so on, the base address of each code stream data block can be obtained.
  • the base address of each code stream data block is usually written into the header code stream before the code stream data block corresponding to each data block to be encoded.
  • the data to be encoded includes G data to be encoded block, the base addresses of the corresponding G code stream data blocks can be continuously set in the header code stream.
  • a size flag bit may also be set in the code stream data, and the size information of the data to be encoded is recorded according to the size flag bit.
  • size parameters such as the image width, height, and number of channels may be recorded, and the preset size of the data block to be encoded may also be recorded.
  • the size flag may be set in the header stream, for example, may be located at the beginning of the header stream.
  • the base address of each code stream data block is recorded in the code stream data.
  • the address of the data to be accessed can be determined, and then the address where the data to be accessed is located can be determined, and then read and written from the address.
  • Decode the corresponding data without decoding the entire stream data. For example, in the original data to be encoded, it is necessary to access the data in the fifth data block to be encoded; in the code stream data of the data to be encoded, read the base address of the fifth code stream data block, you can skip the previous
  • the four code stream data blocks are decoded directly from the base address to obtain the corresponding fifth data block to be encoded.
  • step S420 may include the following steps S810 and S820:
  • Step S810 further dividing each data block to be encoded into a plurality of data sub-blocks to be encoded
  • Step S820 Encode each data sub-block to be encoded to obtain a code stream data sub-block corresponding to each data sub-block to be encoded.
  • the data sub-blocks to be encoded are more finely divided on the basis of the data blocks to be encoded, which may be one-dimensional, two-dimensional or three-dimensional data structures.
  • the data block to be encoded may be divided by a uniform size, so as to ensure that each data sub-block to be encoded has the same amount of data.
  • the to-be-encoded data block is divided into a size of 10*5, and then the to-be-encoded data sub-block is divided into a 10*1 size, and each to-be-encoded data block includes 5 pieces of the same size The sub-block of data to be encoded.
  • the sub-blocks of data to be encoded may be encoded separately.
  • the same encoding mode or different encoding modes may be adopted; the same encoding bit length may be adopted, or different encoding bit lengths may be adopted; this disclosure does not limit this.
  • each to-be-coded data sub-block is encoded, a corresponding code stream data sub-block is obtained, and the code-stream data block corresponding to each to-be-coded data block includes the code corresponding to each to-be-coded data sub-block in the to-be-coded data block Stream data sub-block.
  • step S430 may include the following steps S910 to S930:
  • Step S910 taking the base address of the code stream data sub-block corresponding to the first to-be-coded data sub-block in each to-be-coded data block as the base address of the code stream data block corresponding to the to-be-coded data block;
  • Step S920 generating a header code stream according to the base address of each code stream data block and the length of each code stream data sub-block;
  • Step S930 based on the header code stream and each code stream data block, obtain complete code stream data corresponding to the data to be encoded.
  • the to-be-encoded data block T includes five to-be-encoded data sub-blocks, namely t1, t2, t3, t4, t5, the code stream data block corresponding to T is denoted as T', t1, t2, t3, t4, The code stream data sub-blocks corresponding to t5 are denoted as t'1, t'2, t'3, t'4, and t'5, respectively.
  • the base address T0 of t'1 can be used as the base address of T', and the base addresses of t'2, t'3, t'4, t'5 are also T0, that is, in a code stream data block, each code stream
  • the base addresses of the data sub-blocks are all the same, which are the base addresses of the first code stream data sub-block. Then determine the length of each code stream data sub-block. For example, the lengths of t'1, t'2, t'3, t'4, and t'5 are len1, len2, len3, len4, and len5, respectively.
  • the flag bit is recorded, for example, each length value is recorded with a certain number of codes, or the length of each data in each code stream data sub-block is recorded, instead of the total length of the code stream data sub-block, through the length of each data Multiplied by the data quantity of the data sub-block to be encoded, the total length of the code stream data sub-block can be obtained.
  • a header code stream is formed, and each code stream data block located after the header code stream is added to obtain the data to be encoded. Corresponding complete code stream data.
  • the length flag bit represents the sub-block of the code stream data without encoding the null value in it. In this way, during decoding, data sub-blocks with null values can be quickly identified according to the numerical length flag bit, thereby further improving decoding efficiency.
  • the image to be encoded is a 64*7 single-channel feature image, and the encoding process is as follows:
  • the image to be encoded includes 7 rows, row0 to row6 respectively.
  • the preset size of 64*4 is used to divide the data block to be encoded. Since the height of the image to be encoded is not an integral multiple of the preset size, it is necessary to add a row of row7 below it, fill with empty values, and then divide it into two data blocks to be encoded.
  • the first data block to be encoded includes row0 to row3
  • the second data block to be encoded includes row4 to row7.
  • each data block to be encoded is divided into multiple sub-blocks of data to be encoded.
  • each row (row) can be used as a sub-block of data to be encoded, that is, the first data block to be encoded includes 4 data blocks to be encoded.
  • Data sub-blocks respectively row0, row1, row2, row3.
  • the length of the corresponding code stream data sub-block obtained after row0 encoding is len0, such as 5B; the length of the corresponding code stream data sub-block obtained after row1 encoding is len1, such as 3B.
  • row7 is a null value, and its corresponding code stream data sub-block is also a null value, and the length len7 should be 0.
  • the code stream data block corresponding to the first data block to be encoded is recorded as slice0, including the code stream data sub-blocks corresponding to row0 to row3, and the code stream data block corresponding to the second data block to be encoded is recorded as slice1, including row4 to the code stream data sub-block corresponding to row7.
  • the header stream includes: size information of the image to be encoded, such as width W, height H, number of channels C, etc.; the base address of each code stream data block, such as the base address addr0 of slice0 and the base address addr1 of slice1; each code stream The length of the data sub-block, such as len0, len1, ..., len7. It should be noted that the base address addr0 of slice0 points to the starting storage address of slice0 in the entire code stream data, and the base address addr1 of slice1 points to the starting storage address of slice1 in the entire code stream data.
  • the header code stream and the code stream data block are combined to obtain the complete code stream data corresponding to the image to be encoded.
  • the following specifically describes how to encode each sub-block of data to be encoded.
  • the following content can also be applied to encoding the data block to be encoded.
  • Each to-be-encoded data sub-block may be encoded in a corresponding encoding manner according to the data consistency feature in each to-be-encoded data sub-block.
  • the data consistency feature refers to whether the data in the data sub-blocks to be encoded are all the same, or whether they are all a certain value. According to the data consistency feature in each data sub-block to be encoded, the corresponding encoding mode is determined.
  • the data sub-blocks to be encoded are encoded by the first encoding mode
  • the data sub-block to be encoded is encoded by the second encoding manner.
  • whether the data in the sub-block of data to be encoded is all 0 can be characterized by setting the data feature flag bit in the code stream structure of the data to be encoded, and the data feature flag bit can be set in the above-mentioned header code stream, for example After the base address information. That is, the data sub-block to be encoded can be encoded according to the data characteristic flag bit.
  • the feature flag bits of the corresponding length can be set according to the number of the data sub-blocks to be encoded, and when the data in the data sub-blocks to be encoded are all 0, the corresponding data feature flag bits are set as the first preset value (such as 0), when the data in the data sub-block to be encoded is not all 0, the corresponding data feature flag bit is set to the second preset value (eg 1).
  • the encoding of the data sub-block to be encoded by the first encoding method may include: setting the data feature flag as a first preset value, and encoding the data sub-block to be encoded according to the first preset value. That is, for the data sub-block to be encoded whose data is all 0, there is no need to encode the data in the sub-block, thereby greatly reducing the code stream overhead.
  • the encoding of the data sub-block to be encoded by the second encoding manner may include the following steps:
  • the sub-block of data to be encoded is encoded.
  • the data in the data sub-block to be encoded are p1, p2, p3, and p4.
  • p2 calculate the residual between each data and the first data p1 in the data sub-block to be encoded
  • the residual inverse operation can be performed on the following data at the same time, without decoding and calculating one by one, thereby improving the decoding efficiency.
  • the preset reference data may be any numerical value such as 0 or 1.
  • the preset reference data may be the median value of the numerical range of the data to be encoded.
  • the numerical range of the data to be encoded is [-127,127 [ Residual encoding.
  • method 4 is used to calculate the residual of the first data in the sub-block of data to be encoded
  • method 2 is used to calculate the residual of each subsequent data in the sub-block of data to be encoded. poor, so that a higher degree of parallelism can be achieved when decoding.
  • each M sub-blocks of data to be encoded can be used as a residual calculation data group, and the residual is calculated for each data in each sub-block of the data to be encoded in the residual calculation data group; M is greater than or a positive integer equal to 2.
  • the residual calculation data set can be regarded as the basic unit of residual calculation, and the residual calculation data set with larger data scale is used as the unit to calculate the residual, which can improve the efficiency;
  • the data inside is a residual calculation data group, and the residual calculation can achieve a high degree of parallelism.
  • a residual calculation data set may use the same preset reference data, calculate the residual between the first data of each data sub-block to be encoded and the preset reference data, and obtain the first data of each data sub-block to be encoded. a residual.
  • four sub-blocks of data to be encoded are used as a residual calculation data group, and each sub-block of data to be encoded includes four pieces of data.
  • the first data p1 of the first sub-block of data to be encoded differs from the preset reference data p0 to obtain the first residual d1; for the next three sub-blocks of data to be encoded, the first data can be compared with the previous 1.
  • Case 1 When the residuals in the data sub-blocks to be encoded are exactly the same, set the residual feature flag to a third preset value; according to the second preset value, the third preset value and the data sub-blocks to be encoded Coding of any residual, coding the sub-block of data to be coded.
  • the residual feature flag is used to represent the consistency feature of the residual in the data sub-blocks to be encoded. For example, when the residuals in the data sub-blocks to be encoded are exactly the same, the residual feature flag is set to a third preset value 0, the third preset value can also be other values such as 1. Since the residuals in the data sub-blocks to be encoded are all the same, any one of the residuals can be encoded. For example, if the four residuals in a certain sub-block of data to be encoded are all 1, the data feature flag is set to the second preset value, and the residual feature flag is set to the third preset value.
  • the residual 1 is encoded again to obtain the code stream data sub-block corresponding to the data sub-block to be encoded. It can be seen that the coding of one residual can represent four residuals, so the code stream overhead of this part is greatly reduced.
  • the required bit length bitLen_Diff of the code stream can be calculated by the following formula (1):
  • the coding of the residual also includes a 1-bit sign bit, usually 0 means + and 1 means -.
  • bit length of the code stream required for the encoding of any of the above residuals can be recorded according to the numerical length flag bit.
  • the bit length of the code stream of the value length flag itself can be determined according to the numerical range of the bit length bitLen_Diff of the code stream of the above-mentioned residual, so as to ensure that there is enough bit length to represent the largest bitLen, for example, in the feature image, the data to be encoded Generally in the range of [0, 255], the residual is generally in the range of [-255, 255], so the numerical range of bitLen_Diff is [2, 9], correspondingly, the 3-bit numerical length flag bit can be used to represent bitLen_Diff, and the corresponding relationship is shown in Table 1. shown.
  • the header code stream may include size information, base address, data feature flags, residual feature flags, and numerical length flags
  • the code stream data block part may include each The code stream data sub-block corresponding to the data sub-block to be encoded.
  • Case 2 When the residuals in the sub-blocks of data to be encoded are not identical, set the residual feature flag to a fourth preset value; according to the second preset value, the fourth preset value and the sub-blocks of data to be encoded In the coding of each residual, the sub-block of data to be coded is coded.
  • the fourth preset value indicates that the residuals in the sub-blocks of data to be encoded are not identical, and should be different from the above-mentioned third preset value, for example, the third preset value is 0, and the fourth preset value is 1. Since the residuals are not identical, each residual needs to be encoded separately. Generally, set the data feature flag to the second preset value and the residual feature flag to the fourth preset value, and then encode each residual separately, and these three parts together form the code stream of the data sub-block to be encoded structure.
  • the largest residual (represented by maxDiff) in the data sub-block to be encoded can be used as the standard, and the coding of the largest residual
  • the bit length of the code stream determines the bit length of the code stream for each residual.
  • the calculation method of the code stream bit length bitLen_Diff can be shown in the following formula (2):
  • the coding of the residual also includes a 1-bit sign bit, usually 0 represents a positive sign +, and 1 represents a negative sign -.
  • the bit length of the code stream required for the encoding of the largest residual can be recorded according to the numerical length flag bit.
  • the value length flag can refer to the contents of Table 1. For example, when the maximum residual is 7, 4 bits are needed to encode, the value length flag can be set to 010, and each other residual also uses 4 bits. to code. Therefore, the code stream structure of the data sub-block to be encoded includes four parts: data feature flag, residual feature flag, numerical length flag, and encoding of each residual.
  • the data when encoding the data to be encoded, the data can be scanned twice, the first scan for the data consistency of each to-be-coded data sub-block, and the second scan for the residual consistency of each to-be-coded data sub-block (For the data sub-blocks to be encoded that satisfy the data consistency in the first scan, the second scan is not required). According to the results of the two scans, the corresponding coding is adopted.
  • different encoding modes are used for encoding.
  • different coding modes may also be used for coding according to whether all the data in the data sub-blocks to be coded are the same. Specifically include the following steps:
  • the data feature flag is set as the fifth preset value
  • the to-be-encoded data sub-block is encoded according to the fifth preset value and the encoding of any data in the to-be-encoded data sub-block.
  • the fifth preset value is used to indicate that the data in the data sub-blocks to be encoded are completely the same, and the fifth preset value has nothing to do with the first preset value and the second preset value.
  • the fifth preset value can be set as 0. Since the data in the data sub-blocks to be encoded are completely the same, any one of the data can be encoded. For example, if the four data in a certain sub-block of data to be encoded are all 1, set the data feature flag to the third preset value, write it into the header stream, and then encode the data 1 to obtain the to-be-encoded data sub-block.
  • the code stream data sub-block corresponding to the encoded data sub-block. It can be seen that the encoding of one data can represent four data, so the code stream overhead of this part is greatly reduced.
  • the required bit length bitLen_Data of the code stream can be calculated by the following formula (3):
  • bitLen_Diff bit length of the residual code stream the difference from the residual coding is that when coding the data, it is generally not necessary to set the sign bit, so it is 1 bit less than the bitLen_Diff bit length of the residual code stream.
  • bitLen_Data can be added 1 based on the calculated value of formula (3).
  • a numerical length flag bit may also be set, and the bit length of the code stream required for encoding of any of the above data may be recorded according to the numerical length flag bit.
  • the code stream bit length of the numerical length flag itself can be determined according to the numerical range of the code stream bit length bitLen_Data of the above data to ensure that there is enough bit length to represent the largest bitLen_Data.
  • the data to be encoded is generally In the range of [0, 255], so the value range of bitLen is [1, 8], correspondingly, a 3-bit value length flag bit can be used to represent bitLen_Data, and the corresponding relationship is shown in Table 2.
  • the value length flag can be set to 000, and when the residual is 2 or 3, 3 bits are required for encoding, and the value length
  • the flag bits can be set to 001, and so on. Therefore, in the code stream data corresponding to the data to be encoded, the header code stream may include size information, base address, data feature flags, and numerical length flags, and the code stream data block part may include the corresponding sub-blocks of the data to be encoded.
  • the code stream data sub-block may include size information, base address, data feature flags, and numerical length flags, and the code stream data block part may include the corresponding sub-blocks of the data to be encoded.
  • the code stream data sub-block may include size information, base address, data feature flags, and numerical length flags
  • the to-be-encoded data sub-block is encoded according to the sixth preset value and the residual in the to-be-encoded data sub-block.
  • the sixth preset value is used to indicate that the data in the data sub-blocks to be encoded are not identical, and should be different from the fifth preset value.
  • the sixth preset value can be set to 1. Since the data in the data sub-blocks to be encoded are not completely the same, the data sub-blocks to be encoded are further encoded by residual coding. The same, it is divided into two cases, and is encoded in the corresponding way.
  • each residual feature flag bit can be Continuously set after the data feature flag. In this way, during decoding, the consistency characteristics of the residuals are determined before the residuals are decoded, so that the residual values can be determined faster and the decoding efficiency is improved.
  • the data to be encoded is divided into a plurality of data blocks to be encoded, and the base address of the code stream data block corresponding to each data block to be encoded is recorded, so as to facilitate decoding according to the base address.
  • parallel encoding can be implemented for different data blocks to be encoded, thereby improving encoding efficiency.
  • This scheme is suitable for data processing of CNN feature images.
  • the base address of the code stream data block corresponding to each data block to be encoded is recorded, so as to facilitate the reading of the feature image.
  • the required code stream data is read and decoded in a targeted manner according to the base address of each code stream data block, without reading and decoding all the code stream data, thus reducing the read bandwidth of the off-chip memory , and the computing resources required for decoding, improve the efficiency of CNN operation, and facilitate deployment in lightweight scenarios such as mobile terminals.
  • the exemplary embodiment of the present disclosure also provides a corresponding data decoding method.
  • the method includes the following steps S1410 to S1430:
  • Step S1410 Acquire data to be decoded, where the data to be decoded includes multiple code stream data blocks and base addresses of each code stream data block.
  • the data to be decoded is code stream data obtained by encoding the original data
  • the original data includes a plurality of original data blocks
  • each original data block corresponds to a code stream data block in the data to be decoded.
  • the base address of the code stream data block is the starting storage address of the code stream data block in the data to be decoded.
  • the data to be decoded may include two parts: a header code stream and a code stream data block.
  • the base address of each code stream data block is located in the header code stream, and each code stream data block is located after the header code stream.
  • the header stream can also record other information.
  • the header stream can include a size flag to indicate the size of the original data corresponding to the data to be decoded, or the header stream includes each code Information such as the encoding method and encoding bit length of the stream data block. This disclosure does not limit this.
  • the original data may be an original image, such as a feature image in a CNN, or an image to be displayed transmitted between the processor and the display. Further, the original data block may be a sub-image of a certain size in the original image.
  • each original data block has the same amount of data, so that during decoding, it is convenient to determine how much original data each code stream data block corresponds to, so that different code stream data blocks can be processed. Parallel decoding to improve efficiency.
  • Step S1420 Determine the target code stream data block from the data to be decoded according to the base address of the target code stream data block in the above-mentioned multiple code stream data blocks.
  • the target code stream data block is the encoded code stream data block containing the target data, that is to say, other code stream data blocks other than the target code stream data block need not be decoded during decoding.
  • the target code stream data block where the encoding of the target original data is located may be determined according to the block parameter of the original data corresponding to the data to be decoded.
  • the block parameter carries relevant information about dividing the original data into original data blocks, and may specifically include at least one of the following: the size parameter of each original data block in the original data, the number of original data blocks in the original data, and the size of each original data block in the original data block. Positional parameters in the data. For example, the size of the original image is 64*7, and the size of the original data block is 64*4.
  • the sixth row in the original image is required (refer to Figure 10, the sixth row is row5)
  • row 6 is located in the second original data block
  • its encoded data is located in the second code stream data block in the data to be decoded, then the second code stream data block is the target code stream data block.
  • the base address of the target code stream data block can be read from the base address information contained in the data to be decoded, and then it is determined which segment of the data to be decoded is the target code stream data block.
  • step S1420 specifically includes the following steps S1510 and S1520:
  • Step S1510 according to the ordinal number of the target code stream data block in each code stream data block of the data to be decoded, determine the encoding position of the base address of the target code stream data block;
  • Step S1520 Read data with a preset bit length from the encoding position of the base address of the target code stream data block and decode it to obtain the base address of the target code stream data block.
  • the encoding position of the base address refers to the position in the data to be decoded where the information of the base address is recorded;
  • the preset bit length refers to the bit length required for the encoding of the base address, usually the base address of each code stream data block Information occupies data of the same bit length, for example, both occupy 8 bits.
  • the base address information of the stream data block that is, skip 8 bits
  • read the 8bit data that is, the base address information of the second stream data block, and obtain the base address information after decoding.
  • Step S1430 Read at least one code stream data sub-block in the target code stream data block, and decode the code stream data sub-block to generate a corresponding original data sub-block.
  • each code stream data block may include multiple code stream data sub-blocks.
  • each original data block may also include multiple original data sub-blocks, and each original data sub-block corresponds to a code stream data sub-block.
  • it can be determined which specific one or several code stream data sub-blocks the required target data corresponds to in the target code stream data block, and only these code stream data sub-blocks need to be decoded without decoding other code streams.
  • Data sub-blocks so as to achieve more targeted data decoding and reduce resource overhead.
  • a base address is recorded for each code stream data block, and the base address may be the base address of the first code stream data sub-block in the code stream data block, It is also used as the base address of other codestream data sub-blocks in the codestream data block.
  • the data to be decoded may also include length information of each code stream data sub-block. Length encoding, or when the length of each code stream data sub-block is the same, it is sufficient to record one length information.
  • the target code stream data block can be determined from the base address of the target code stream data block and the length information of each code stream data sub-block of the target code stream data block. At least one target code stream data sub-block is read from the code stream data block.
  • it is necessary to determine the offset value between the base address of the target code stream data block and the actual storage address of the target code stream data sub-block, so as to actually determine which segment of data the target code stream data sub-block is.
  • it can be implemented by the following steps S1610 and S1620:
  • Step S1610 parse the above-mentioned length information to obtain the length of each code stream data sub-block before the target code stream data sub-block in the target code stream data block, and determine according to the sum of the obtained lengths of each code stream data sub-block offset value;
  • Step S1620 Read the target code stream data sub-block according to the base address of the target code stream data block and the above offset value.
  • the offset value is the sum of the lengths of the first two code stream data sub-blocks.
  • the base address of the target code stream data block is shifted to the right, and the obtained position is the actual starting storage address of the target code stream data sub-block. From this address, read a corresponding amount of data according to the length of the target code stream data sub-block to obtain the target code stream data sub-block. Then it is decoded to obtain the corresponding original data sub-block, and the required target data is located in the original data sub-block.
  • the code stream data sub-block may be a padded part, and the padded part is generally a null value, then the code with a length of 0 can be determined.
  • the original data block corresponding to the stream data sub-block is null. In this way, it is unnecessary to actually decode the code stream data sub-block whose length is 0, which further improves the decoding efficiency.
  • the decoding process will be described in more detail below by taking the image code stream data shown in FIG. 10 as the data to be decoded.
  • the decoding process is as follows:
  • the code stream data sequentially decode the width W, height H, and channel number C of the original image.
  • the preset size is pre-determined as W*M (M is 4)
  • the required target data may be located in multiple different original data sub-blocks, corresponding to multiple different target code stream data sub-blocks in the data to be decoded.
  • decoding it can be divided into the following two cases to deal with:
  • the above-mentioned multiple different target code stream data sub-blocks are located in two or more code stream data blocks. These code stream data blocks can all be used as target code stream data blocks, and each target code stream data block is determined in the data to be decoded according to its base address. and then read at least one target code stream data sub-block from each target code stream data block respectively; perform parallel decoding on each read target code stream data sub-block to generate original data corresponding to each target code stream data sub-block subblock.
  • the above-mentioned multiple different target code stream data sub-blocks are all located in the same code stream data block.
  • the code stream data block can be used as the target code stream data block, and the target code stream data block can be determined in the data to be decoded according to its base address. Further, read at least two target code stream data sub-blocks from the target code stream data block; perform parallel decoding on each read target code stream data sub-block to generate original data sub-blocks corresponding to each target code stream data sub-block .
  • each target code stream data sub-block in the to-be-decoded data can be determined at the same time, so that each target code can be read simultaneously.
  • Stream data sub-blocks for parallel decoding The search and decoding process of any target code stream data sub-block does not depend on the processing of other target code stream data sub-blocks, and the processing of each target code stream data sub-block is carried out independently, so this scheme achieves higher The degree of parallel decoding can shorten the decoding time.
  • Step S1710 decode the size flag bit in the data to be decoded to obtain the size parameter of the original data corresponding to the data to be decoded;
  • Step S1720 Arrange the original data blocks obtained by decoding each code stream data block according to the above-mentioned size parameters to obtain original data.
  • the size flag can record the width, height and number of channels of the image.
  • the original data blocks After decoding to obtain the original data blocks corresponding to each code stream data block, the original data blocks are arranged according to the width, height and number of channels to restore the original single-channel image or multi-channel image.
  • the code stream data sub-block may be decoded by using a corresponding decoding method according to the data consistency feature of the original data sub-block corresponding to the code stream data sub-block.
  • the data consistency feature of the original data sub-blocks refers to whether the data in the original data sub-blocks are all the same, or whether they are all a certain value.
  • the data consistency feature of the original data sub-block corresponding to each code stream data sub-block can be determined by the value of the data feature flag bit in the data to be decoded.
  • the data feature flag can be located at any specified position in the data to be decoded, for example, after the base address in the header stream. Specifically, it can be achieved through the following steps:
  • each data feature flag bit is analyzed respectively, and the data consistency feature of the original data sub-block corresponding to each code stream data sub-block is determined.
  • the value of the data feature flag bit is a first preset value (such as 0)
  • the data in the sub-block is not specifically encoded. Therefore, if it is determined that a certain code stream data sub-block is the first type of code stream data sub-block, it can be directly determined that the data in the corresponding original data sub-block is all 0.
  • the value of the data feature flag bit is the second preset value (such as 1)
  • the data in the corresponding original data sub-block is not all 0 .
  • residual coding is adopted for the original data sub-block whose data is not all 0. Therefore, if it is determined that a certain code stream data sub-block is the second type of code stream data sub-block, it can be decoded by the following steps:
  • the inverse operation of the residual is performed on the residual to obtain the original data sub-block corresponding to the second type of code stream data sub-block.
  • the residual Since the residual is encoded in different ways during encoding, it can also be decoded in a corresponding way during decoding. Specifically, according to the value of the residual characteristic flag bit in the data to be decoded, the corresponding residual decoding mode can be used to decode each of the second-type code stream data sub-blocks respectively to obtain the residual. Among them, the residual feature flag is used to indicate whether the residuals in each original data sub-block are all the same. The residual feature flag may be located at any specified position in the data to be decoded. In an optional implementation manner, the residual feature flag may be located after the data feature flag in the header stream. Specifically, the residual decoding method can be determined by the following steps:
  • each residual characteristic flag bit is analyzed respectively, and the residual decoding mode corresponding to each second type of code stream data sub-block is determined.
  • the corresponding second-type code stream data sub-block can be decoded to obtain a residual, and the value of the second-type code stream data sub-block can be determined.
  • the residuals are all equal to the residuals. For example, after decoding a certain second-type code stream data sub-block, a residual of 3 is obtained, and the original data sub-block corresponding to the second-type code stream data sub-block includes 4 data, then the The residual of the second type of code stream data sub-block is '3333';
  • the corresponding second-type code stream data sub-block can be decoded to obtain each residual of the second-type code stream data sub-block, for example Decode a certain second-type code stream data sub-block to obtain 4 residuals '3110', which are the residuals of the second-type code stream data sub-block.
  • the residual coding bit length in the second type of code stream data sub-block can also be determined according to the value of the numerical length flag bit, and then the corresponding residual coding is read and decoded according to the residual coding bit length.
  • the numerical length flag can be located after the residual feature flag, and the numerical length flag of each second-type code stream data sub-block occupies 3 bits, as shown in Table 1, the residual coding bit length can be determined by the corresponding relationship, That is, bitLen_Diff in formulas (1) and (2), assuming that the value of the read value length flag bit is '001 100', it is determined that the residual coding bit length of the previous second type code stream data sub-block is 3 bits, and the following The residual coding bit length of a second type of code stream data sub-block is 6 bits, and then the residual coding is read from the data to be decoded and decoded according to the bit length.
  • the inverse operation of the residual needs to be performed.
  • two calculation methods are provided for the residual of the first data (refer to the above calculation methods 3 and 4), so two corresponding residual error inverse operation methods are also provided:
  • the first residual in the second type of code stream data sub-block and the last data in the original data sub-block corresponding to the previous code stream data sub-block are summed to obtain the second type The first data in the original data sub-block corresponding to the code stream data sub-block.
  • the first residual in the second type of code stream data sub-block is summed with the preset reference data to obtain the first in the original data sub-block corresponding to the second type of code stream data sub-block.
  • the preset reference data p0 may be any predetermined data, for example, may be the median value of the value range of the original data.
  • the residual error calculation includes two methods (refer to the above calculation methods 1 and 2), two corresponding residual error inverse calculation methods are also provided:
  • each residual except the first residual in the second type of code stream data sub-block is respectively corresponding to the original data sub-block corresponding to the second type of code stream data sub-block.
  • every M second-type code stream data sub-blocks may be used as a residual decoding data group, and the residual in the residual decoding data group may be subjected to the inverse operation of the residual to obtain the residual A data block corresponding to each second-type code stream data sub-block in the differentially decoded data group; M is a positive integer greater than or equal to 2.
  • M is 4, and 4 data sub-blocks to be coded form a residual coded data group.
  • four code stream data sub-blocks can be used to form a residual decoding data group, and the residual decoding data group can be used as a unit to perform the inverse operation of the residual. direction to operate to restore all residuals to the original data.
  • the target code stream data block can be quickly found and targeted to be decoded without decoding other code stream data blocks, thereby The calculation amount required for decoding is reduced, the decoding efficiency is improved, and random access to data can be supported, thus broadening the application scenarios of data encoding and decoding.
  • the exemplary embodiment of the present disclosure also provides a data processing method, which is applied to the data processing system shown in FIG. 18 .
  • the data processing system includes a configurator 1810, a memory 1820, and a processor 1830 connected in sequence.
  • the configurator 1810 can be set in the DMA module;
  • the memory 1820 can be an off-chip memory, such as DDR, etc.;
  • the processor 1830 can be a CNN computing core, including on-chip memory, such as SRAM, etc.
  • the flow of the data processing method can be referred to as shown in FIG. 19, including the following steps S1910 to S1940:
  • Step S1910 executing any data encoding method (the method shown in FIG. 4 ) in the exemplary embodiments of the present disclosure by the configurator, encoding the preset data to be encoded, and generating code stream data;
  • Step S1920 writing the generated code stream data into the memory to reduce the write bandwidth to the memory
  • Step S1930 read at least part of the code stream data in the memory by the configurator, and decode the read code stream data to reduce the read bandwidth to the memory;
  • Step S1940 the data obtained by decoding is executed by the processor.
  • the preset data to be encoded is data that needs to be read and written between the processor and the configurator, for example, it may be characteristic image data in CNN.
  • the configurator 1810 may include an encoder 1811 , so that the configurator 1810 specifically encodes the data to be encoded through the encoder 1811 .
  • the configurator 1810 may further include a decoder 1812 , so that the configurator 1810 specifically decodes the read code stream data through the decoder 1812 .
  • the processor 1830 may also include an SRAM 1831, which is used as an on-chip memory, so that the processor 1830 specifically reads and writes data through the SRAM 1831 and the configurator 1810.
  • the data encoding method of the present exemplary embodiment can reduce the overhead of the code stream data, when the configurator 1810 writes the code stream data into the memory 1820, it can occupy less writing bandwidth; the configurator 1810 reads the code stream data from the memory 1820. can take up less read bandwidth.
  • the exemplary embodiment of the present disclosure also provides an encoder, which can refer to the encoder 1811 in FIG. 18 by performing any data encoding method in the exemplary embodiment of the present disclosure (as shown in FIG. 4 ). method) to encode the data to be encoded.
  • Figure 20 shows an exemplary architecture of an encoder.
  • the data to be encoded After the data to be encoded enters the encoder, the data to be encoded is firstly divided into multiple data blocks by the data division module; then the data consistency feature is scanned by the data scanning module, if the conditions are met (for example, all are 0, or all are the same), then directly Enter the coding mode selection module, and determine the coding mode of data consistency (such as run-length coding); if the data consistency characteristics do not meet the conditions, the residual calculation module will perform the residual calculation; then the residual scanning module (which can be combined with the data The scanning module is the same module) to scan the residual consistency feature; the encoding mode selection module determines the corresponding encoding mode according to the residual consistency feature; finally, the data encoding module executes the corresponding encoding mode to obtain the corresponding code stream data.
  • the present embodiment is only illustrative, and should not be regarded as a limitation of the present disclosure.
  • the exemplary embodiment of the present disclosure also provides a decoder, which can refer to the decoder 1812 in FIG. 18 by performing any data encoding method in the exemplary embodiment of the present disclosure (as shown in FIG. 14 ). method) to decode the data to be decoded.
  • Figure 21 shows an exemplary architecture of a decoder.
  • the encoding mode parsing module first analyzes which encoding mode is adopted for the original data block corresponding to each data segment to be decoded; then the decoding mode selection module determines the corresponding decoding mode; then the data decoding module determines the corresponding decoding mode. Execute the corresponding decoding methods, including data consistency decoding (such as run-length decoding), residual decoding, etc.; if residual decoding is used, the residual calculation module needs to perform residual inverse operation; finally, the original data corresponding to the data to be decoded is obtained.
  • data consistency decoding such as run-length decoding
  • residual decoding residual decoding
  • Exemplary embodiments of the present disclosure also provide a data processing system.
  • the data processing system may include: a configurator 1810 , a memory 1820 and a processor 1830 which are connected in sequence. in:
  • the configurator 1810 is configured to execute any data encoding method (the method shown in FIG. 4 ) in the exemplary embodiments of the present disclosure, encode the preset data to be encoded, generate code stream data, and The code stream data is written into the memory 1820 to reduce the write bandwidth to the memory 1820;
  • the configurator 1810 is further configured to read at least part of the code stream data in the memory 1820 , decode the read code stream data, and make the processor 1830 run the decoded data to reduce the read bandwidth of the memory 1820 .
  • the configurator 1810 When the configurator 1810 decodes the code stream data, it may adopt a decoding method corresponding to the encoding, such as the method shown in FIG. 14 .
  • the movable platform may include:
  • the power system 2220 is located in the body 2210, and the power system 2220 is used to provide power for the movable platform;
  • the structure of the data processing system 2230 can be referred to FIG. 18 .
  • the above-mentioned data processing system 2230 may be applied to functional systems of movable platforms such as power systems, operating systems, and the like.
  • the data processing system provided by this exemplary embodiment can reduce the required bandwidth and computing resources when running the CNN for data processing, and realize lossless encoding and decoding of the characteristic image data of the CNN, ensuring that no additional errors are introduced And there is no need to retrain the network. Therefore, it is possible to run the CNN under the condition that the hardware performance is not high.
  • Exemplary embodiments of the present disclosure also provide a computer-readable medium on which a computer program is stored, and when the computer program is executed by a processor, implements any one of the data encoding methods, data decoding methods, or data processing in the exemplary embodiments of the present disclosure
  • the method may perform the method steps in FIG. 4 , FIG. 14 or FIG. 19 .
  • the computer-readable medium may be included in the removable platform described in the above-mentioned embodiments; or may exist alone without being assembled into the removable platform.
  • the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • the computer readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
  • the exemplary embodiments described herein may be implemented by software, or may be implemented by software combined with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure may be embodied in the form of software products, and the software products may be stored in a non-volatile storage medium (which may be CD-ROM, U disk, mobile hard disk, etc.) or on the network , including several instructions to cause a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to an exemplary embodiment of the present disclosure.
  • a computing device which may be a personal computer, a server, a terminal device, or a network device, etc.
  • modules or units of the apparatus for action performance are mentioned in the above detailed description, this division is not mandatory. Indeed, according to exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above may be embodied in one module or unit. Conversely, the features and functions of one module or unit described above may be further divided into multiple modules or units to be embodied.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本公开提供了数据编码方法、数据解码方法、数据处理方法、编码器、解码器、数据处理系统、可移动平台与计算机可读介质。其中一种数据编码方法包括:将待编码数据划分为多个待编码数据块;对各所述待编码数据块进行编码,得到各所述待编码数据块对应的码流数据块;基于各所述码流数据块的基地址和各所述码流数据块,得到所述待编码数据对应的完整码流数据;所述码流数据块的基地址为所述码流数据块在所述完整码流数据中的起始存储地址。本公开实现了在解码数据时,对码流数据中的部分数据进行单独解码,降低了解码所需的带宽与计算资源,提高了处理效率。

Description

数据编码方法、数据解码方法、数据处理方法、编码器、解码器、系统、可移动平台与计算机可读介质 技术领域
本公开涉及数据处理技术领域,尤其涉及数据编码方法、数据解码方法、数据处理方法、编码器、解码器、数据处理系统、可移动平台与计算机可读介质。
背景技术
随着大数据和人工智能技术的发展,计算机需要处理的数据量越来越庞大。以CNN(Convolutional Neural Networks,卷积神经网络)为例,其运行时需要处理大量的特征图像(Feature Map),数据规模非常大,通常达到百万甚至千万的级别。因此需要对数据进行编码压缩后进行存储或读写,以降低所需的内存或带宽资源。
相关技术中,对原始数据进行编码后,生成的码流数据位长可能不完全相同,例如数值较大的数据需要较高的位长,数值较小的数据需要较低的位长。这样在解码时,必须按顺序解码所有的码流数据。如果仅需要得到一部分原始数据,根据相关技术,仍然需要对所有的数据解码,得到完整的原始数据,然后再在其中找到所需的部分。由此,在读取数据时,需要读取全部的码流数据,增加了所占用的带宽,并且解码出大量并不需要的数据,导致资源的浪费,不利于提高编解码系统的性能。
需要说明的是,在上述背景技术部分公开的信息仅用于加强对本公开的背景的理解,因此可以包括不构成对本领域普通技术人员已知的现有技术的信息。
发明内容
本公开提供了数据编码方法、数据解码方法、数据处理方法、编码器、解码器、数据处理系统、可移动平台与计算机可读介质,进而至少在一定程度上改善相关技术无法对部分数据进行解码的问题。
本公开的其他特性和优点将通过下面的详细描述变得显然,或部分地通过本公开的实践而习得。
根据本公开的第一方面,提供一种数据编码方法,包括:将待编码数据划分为多个待编码数据块;对各所述待编码数据块进行编码,得到各所述待编码数据块对应的码流数据块;基于各所述码流数据块的基地址和各所述码流数据块,得到所述待编码数据对应的完整码流数据;所述码流数据块的基地址为所述码流数据块在所述完整码流数据中的起始存储地址。
根据本公开的第二方面,提供一种数据解码方法,包括:获取待解码数据,所述待解码数据块包括多个码流数据块及各所述码流数据块的基地址;所述码流数据块的基地址为所述码流数据块在所述待解码数据中的起始存储地址;根据所述多个码流数据块中目标码流数据块的基地址,从所述待解码数据中确定所述目标码流数据块;读取所述目标码流数据块中的至少一个 码流数据子块,并对所述码流数据子块进行解码,生成对应的原始数据子块;所述码流数据子块的长度小于或等于所述目标码流数据块的长度。
根据本公开的第三方面,提供一种数据处理方法,应用于依次连接的配置器、存储器和处理器,所述方法包括:通过所述配置器执行上述第一方面的数据编码方法或其可能的实施方式,对预设的待编码数据进行编码,生成码流数据;将所生成的码流数据写入所述存储器,以降低对所述存储器的写带宽;通过所述配置器读取所述存储器内的至少部分码流数据,并对所读取的码流数据进行解码,以降低对所述存储器的读带宽;通过所述处理器运行解码所得到的数据。
根据本公开的第四方面,提供一种编码器,所述编码器通过执行上述第一方面的数据编码方法或其可能的实施方式,对待编码数据进行编码。
根据本公开的第五方面,提供一种解码器,所述解码器通过执行上述第二方面的数据解码方法或其可能的实施方式,对待解码数据进行解码。
根据本公开的第六方面,提供一种数据处理系统,包括:依次连接的配置器、存储器和处理器;所述配置器用于执行上述第一方面的数据编码方法或其可能的实施方式,对预设的待编码数据进行编码,生成码流数据,并将所生成的码流数据写入所述存储器,以降低对所述存储器的写带宽;所述配置器还用于读取所述存储器内的至少部分码流数据,对所读取的码流数据进行解码,使所述处理器运行解码所得到的数据,以降低对所述存储器的读带宽。
根据本公开的第七方面,提供一种可移动平台,包括:机体;动力系统,设于所述机体,所述动力系统用于为所述可移动平台提供动力;以及,如上述第六方面的数据处理系统。
根据本公开的第八方面,提供一种计算机可读介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述第一、第二或第三方面的数据编码方法、数据解码方法、数据处理方法或其可能的实施方式。
本公开的技术方案具有以下有益效果:
本公开的数据编码方法中,一方面,将待编码数据划分为多个待编码数据块,并记录每个待编码数据块所对应的码流数据块的基地址,以便于在解码时根据基地址找到所需的目标数据所在的码流数据块,从而有针对性地读取并解码局部数据,降低编解码所需的资源开销。另一方面,通过将待编码数据划分为多个待编码数据块,可以对不同的待编码数据块实现并行编码,从而提高了编码效率。
本公开适用于对CNN特征图像的数据处理,通过将特征图像划分为多个待编码数据块,记录每个待编码数据块所对应的码流数据块的基地址,以便于在读取特征图像的数据时,根据各码流数据块的基地址有针对性地读取所需的码流数据并进行解码,无需读取并解码全部的码流数据,从而降低了对片外存储器的读带宽,以及进行解码所需的计算资源,提高CNN运行的效率,有利于部署在移动终端等轻量化场景中。
本公开的数据解码方法中,根据待解码数据中各码流数据块的基地址,可以快速找到目 标码流数据块,并对其进行针对性地解码,无需解码其他的码流数据块,从而降低了解码所需的计算量,提高了解码效率,并可以支持对数据的随机访问,拓宽了数据编解码的应用场景。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施方式,并与说明书一起用于解释本公开的原理。显而易见地,下面描述中的附图仅仅是本公开的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示出LeNet的结构示意图;
图2示出Resnet 18网络中特征图像的示意图;
图3示出CNN硬件计算平台框架的示意图;
图4示出本示例性实施方式中数据编码方法的流程图;
图5示出CNN的特征图像示意图;
图6示出本示例性实施方式中划分待编码数据块的示意图;
图7示出本示例性实施方式中确定各待编码数据块的基地址的流程图;
图8示出本示例性实施方式中对码流数据子块进行编码的流程图;
图9示出本示例性实施方式中数据编码方法的子流程图;
图10示出本示例性实施方式中对特征图像数据编码的示意图;
图11示出本示例性实施方式中一种计算残差的示意图;
图12示出本示例性实施方式中另一种计算残差的示意图;
图13示出本示例性实施方式中再一种计算残差的示意图;
图14示出本示例性实施方式中数据解码方法的流程图;
图15示出本示例性实施方式中确定目标码流数据块的基地址的流程图;
图16示出本示例性实施方式中读取目标码流数据子块的流程图;
图17示出本示例性实施方式中数据解码方法的子流程图;
图18示出本示例性实施方式中一种数据处理系统的结构示意图;
图19示出本示例性实施方式中数据处理方法的流程图;
图20示出本示例性实施方式中一种编码器的架构图;
图21示出本示例性实施方式中一种解码器的架构图;
图22示出本示例性实施方式中一种可移动平台的结构示意图。
具体实施方式
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。
在很多数据编解码的场景中,有时仅需要解码一部分数据。例如,将多个原始文件编码为一个数据文件,有时仅需要访问其中某一个原始文件,相关技术中,需要将该数据文件完全解码,再查找要访问的原始文件。
下面以CNN特征图像的数据编解码场景为例进行说明。CNN是一种前馈神经网络,是深度学习技术中极具代表的网络结构之一,它提供了一种端到端的处理方式,在图像和语音处理领域取得了很大的成功,在国际标准的ImageNet数据集上,许多成功的模型都是基于CNN,相比传统神经网络提升计算机视觉任务的精度。
图1所示是LeNet(一种经典的CNN模型)的组成结构,主要由以下五种结构组成:输入层(Input)、卷积层(Convolution,图中C1表示第1个中间层为卷积层)、池化层(或称下采样层,Subsampling,图中S2表示第2个中间层为池化层)、全连接层(Full Connection,图1中F6表示第6个中间层为全连接层)和输出层(Output)。输入层是整个神经网络的输入,一般代表一张图像的像素矩阵;卷积层是通过每个卷积核对输入特征图进行卷积计算,试图将神经网络中的每一小块进行更加深入地分析,从而得到抽象程度更高的特征;池化层不会改变三维矩阵的深度,但可以缩小矩阵的大小,类似下采样;全连接层的目的是完成分类任务,前面的卷积层和池化层是自动图像特征提取的过程,在特征提取完成后需要进行分类;输出层用于分类问题,全连接层的输出经过高斯连接(Gaussian Connection),再经过归一化处理(如采用归一化指数函数softmax),得到当前样例属于不同种类的概率分布情况,进而完成整个网络的任务。如图1所示,输入层是大小为32x32x1的单通道图像,使用6个5x5x1大小的卷积核,通过卷积可以得到C1层的6@28x28特征图像,数字6代表C1层特征图像的通道数,C1层的特征图像数据总量为6*28*28=4704;在S2层产生6通道的14*14特征图像;在C3层产生16通道的10*10特征图像;在S4层产生16通道的5*5特征图像。可见,每层的特征图像包含了大量的数据。
实际应用中,CNN对图像的处理主要体现为对每层特征图像的处理,特征图像是对输入图像在不同程度上的抽象表示,图2示出了Resnet 18网络(一种经典的残差网络模型)中不同层的特征图像,可见随着层数的加深,CNN所提取特征的抽象程度越高,提取了局部的个别特征或全局特征,对应的特征图像在视觉上也越来越抽象。
LeNet和Resnet 18都是相对较为简单的CNN结构,按照目前CNN的发展趋势,网络层数在逐渐加深,通道数在逐渐增多,导致整个网络的特征图像数据规模急剧升高,在芯片应用时占用的系统带宽很高,这对设备功耗和运行速度带来了巨大的挑战。图3示出CNN硬件 计算平台框架,CNN计算核运行CNN过程中产生的特征图像先写入片上存储器,如SRAM(Static Random Access Memory,静态随机存取存储器)中,由于SRAM容量有限,因此需要将部分特征图像数据通过DMA(Direct Memory Access,直接存储器访问)模块搬运至片外存储器,如DDR(Double Data Rate Synchronous Dynamic Random Access Memory,双倍数据率同步动态随机存取存储器,通常简称为DDR);使用这些特征图像数据时,则执行上述搬运过程的逆过程。CNN计算核有时只需要特征图像的局部数据,例如需要某一个或几个通道的特征图像,或者需要特征图像中局部区域的图像等。按照相关技术,仍然需要从DDR读取完整的特征图像数据,并对其进行全部解码,再提取所需的局部数据;此外,在解码特征图像时,通常需要按照像素数据的排布顺序进行串行解码,而无法进行并行解码,解码效率很低,并且一旦有某个数据发生解码错误,则会影响其他数据。可见,该过程对于DDR的带宽、CNN计算核的计算资源等都造成了浪费。
鉴于上述一个或多个问题,本公开的示例性实施方式提供一种数据编码方法、数据解码方法、数据处理方法、编码器、解码器、数据处理系统、可移动平台与计算机可读存储介质。需要说明的是,本公开的示例性实施方式可以应用于对CNN特征图像数据的处理,也可以应用于对其他类型数据的处理。下面对本公开的示例性实施方式的各个方面进行具体说明。
图4出了本示例性实施方式中一种数据编码方法的流程图。参考图4所示,该方法包括以下步骤S410至S430:
步骤S410,将待编码数据划分为多个待编码数据块。
待编码数据可以是一维数据(如一维数组),二维数据(如二维数据表、单通道图像),三维数据(如多通道图像)等。
本示例性实施方式中,可以对待编码数据划分待编码数据块。待编码数据块是小于待编码数据的数据单元,可以按照待编码数据排布的特点进行划分,如一维的待编码数据划分为多个一维待编码数据块,二维的待编码数据划分为多个一维待编码数据块或二维待编码数据块,三维的待编码数据划分为多个一维待编码数据块、二维待编码数据块或三维待编码数据块。待编码数据块的数据量可以根据硬件性能与实际应用场景决定,例如编码性能较高时,可以设置每个待编码数据块的数据量较少,以增加待编码数据块的数量,提高并行处理效率等。本公开对于划分待编码数据块的具体方式,以及待编码数据块的数量不做限定。
在一种可选的实施方式中,各待编码数据块可以具有相同数量的数据。换而言之,可以对待编码数据进行均匀划分,以得到相同尺寸的待编码数据块。这样在后续编码时,各待编码数据块所需的编码时间大致相同,从而提高并行处理效率。
在一种可选的实施方式中,待编码数据可以是待编码图像,例如CNN中的特征图像,或者处理器与显示器之间传输的待显示图像等。图5示出了CNN中多通道特征图像的示意图,W(Width)和H(Height)分别表示特征图像的宽和高,C(Channel)表示通道数。可以对每个通道的特征图像分别进行编码,即单张特征图像为待编码图像,其数据量为W*H;也可 以对C个通道的特征图像一起编码,即C个通道的特征图像共同形成待编码图像,其数据量为W*H*C。
对于待编码图像,可以按照预设尺寸将其划分为多个待编码数据块。预设尺寸可以是待编码数据块的尺寸。举例来说,待编码图像的尺寸为W*H,各待编码数据块和待编码图像的宽度可以相同,即待编码数据块的预设尺寸可以是W*h(h<H,如h可以是H/4、H/8等),对于不同的待编码数据块,h可以不同;或者各待编码数据块和待编码图像的高度可以相同,即待编码数据块的预设尺寸可以是w*H(w<W,如w可以是W/4、W/8等),对于不同的待编码数据块,w可以不同;或者待编码数据块为待编码图像中的M行(即待编码数据块的尺寸均为W*M)或者M列(即待编码数据块的尺寸均为M*H),M为正整数。通过这样的方式,对待编码图像划分待编码数据块时,仅需要在一个方向上(宽度方向或高度方向)进行划分,划分方式较为简单,且在解码时更容易将解码得到的数据重组为待编码图像。
需要补充的是,在将待编码图像划分为多个待编码数据块时,可能出现待编码图像的尺寸不满足为预设尺寸的整数倍的情况,例如将W*H的待编码图像划分为W*M的待编码数据块时,H不是M的整数倍的情况。针对于这种情况,可以对待编码图像进行数据填充,使填充后的待编码图像的尺寸满足为预设尺寸的整数倍。一般的,可以根据实际情况,在待编码图像的下方增加新的行,和/或在待编码图像的右侧增加新的列。参考图6所示,假设待编码图像的W=10,H=8,待编码数据块的预设尺寸为10*5,则待编码图像在高度方向上不满足预设尺寸的整数倍,可以在待编码图像的下方增加新的两行,形成10*10的图像,则满足预设尺寸的整数倍。对于新增加的行或列,可以填入空值,在编码时不对空值进行编码,也可以复制上方或左侧相邻行/列中的数据,例如图6中增加的第9行和第10行复制第8行的数据。需要说明的是,根据实际需要,可以仅增加新的行或新的列;如果需要同时增加新的行和新的列,则无论先增加行还是先增加列,得到的填充结果相同,因此本公开对于顺序不做限定。
步骤S420,对各待编码数据块进行编码,得到各待编码数据块对应的码流数据块。
对于不同的待编码数据块,可以采用相同的编码方式,也可以采用不同的编码方式,例如一些待编码数据块采用游程编码、一些待编码数据块采用残差编码等;可以采用相同的编码位长,例如各待编码数据块中最大的数据为255,需要8bit的位长,则其他数据均采用8bit进行编码,也可以采用不同的编码位长,通常根据各待编码数据块中最大的数据确定位长。本公开对此不做限定。
步骤S430,基于各码流数据块的基地址和各码流数据块,得到待编码数据对应的完整码流数据。
其中,码流数据块的基地址可以是码流数据块在完整码流数据中的起始存储地址,例如是码流数据块中第一个数据所在的存储地址。在一种可选的实施方式中,参考图7所示,可以通过以下步骤S710和S720确定各码流数据块的基地址:
步骤S710,根据起始地址以及由头部码流的位长所确定的偏移值,确定第一个码流数据 块的基地址;
步骤S720,根据上一码流数据块的基地址以及由上一码流数据块的长度所确定的偏移值,依次确定第一个码流数据块之后的各码流数据块的基地址。
举例来说,起始地址可以是0。头部码流可以记录待编码数据的一些基本信息,如尺寸信息、基地址的信息等。如头部码流的位长为k个单位(1个单位可以是特定数量的字节Byte),则第k+1个单位为第一个码流数据块的基地址;如第一个码流数据块的长度为B1个单位,则第k+1+B1个单位为第二个码流数据块的基地址;依此类推,可以得到每个码流数据块的基地址。
在对待编码数据进行编码时,通常将各码流数据块的基地址写入头部码流中,位于各待编码数据块对应的码流数据块之前,例如待编码数据包括G个待编码数据块,则对应的G个码流数据块的基地址可以连续设置在头部码流中。
在一种可选的实施方式中,还可以在码流数据中设置尺寸标志位,根据尺寸标志位记录待编码数据的尺寸信息。例如待编码数据为图像时,可以记录图像宽、高、通道数等尺寸参数,也可以记录待编码数据块的预设尺寸等。尺寸标志位可以设置在头部码流中,例如可以位于头部码流中的起始位置。
在上述实施方式中,码流数据中记录了各码流数据块的基地址,在解码时,通过读取基地址信息,可以确定所需访问的数据所在的地址,进而从该地址读取并解码对应的数据,而无需解码全部的码流数据。例如,在原始的待编码数据中,需要访问第五个待编码数据块中的数据;在待编码数据的码流数据中,读取第五个码流数据块的基地址,可以跳过前四个码流数据块,直接从该基地址开始解码,从而得到对应的第五个待编码数据块。由此可以实现更加灵活、针对性更高的解码,减少了解码数据中的冗余结果,提高了解码效率,降低了带宽与计算资源的开销。
为了进一步提高编码与解码的灵活性与针对性,在一种可选的实施方式中,参考图8所示,步骤S420可以包括以下步骤S810和S820:
步骤S810,将每个待编码数据块进一步划分为多个待编码数据子块;
步骤S820,对各待编码数据子块进行编码,得到各待编码数据子块对应的码流数据子块。
其中,待编码数据子块是在待编码数据块的基础上,所做的更加精细的划分,其可以是一维、二维或三维的数据结构。
在一种可选的实施方式中,可以采用统一的尺寸对待编码数据块进行划分,以保证各待编码数据子块具有相同数量的数据。例如,在图6所示的待编码图像中,以10*5的尺寸划分待编码数据块,再以10*1的尺寸划分待编码数据子块,每个待编码数据块包括5个相同尺寸的待编码数据子块。
在划分待编码数据子块后,可以分别对各待编码数据子块进行编码。对于不同的待编码数据子块,可以采用相同的编码方式,也可以采用不同的编码方式;可以采用相同的编码位长, 也可以采用不同的编码位长;本公开对此不做限定。
每个待编码数据子块编码后,得到对应的一个码流数据子块,每个待编码数据块对应的码流数据块,包括该待编码数据块中各待编码数据子块所对应的码流数据子块。
在一种可选的实施方式中,参考图9所示,步骤S430可以包括以下步骤S910至S930:
步骤S910,将每个待编码数据块中第一个待编码数据子块对应的码流数据子块的基地址,作为待编码数据块对应的码流数据块的基地址;
步骤S920,根据各码流数据块的基地址和各码流数据子块的长度生成头部码流;
步骤S930,基于头部码流和各码流数据块,得到待编码数据对应的完整码流数据。
举例来说,待编码数据块T包括5个待编码数据子块,分别为t1、t2、t3、t4、t5,T对应的码流数据块记为T',t1、t2、t3、t4、t5对应的码流数据子块分别记为t'1、t'2、t'3、t'4、t'5。可以将t'1的基地址T0作为T'的基地址,且t'2、t'3、t'4、t'5的基地址也采用T0,即一个码流数据块中,各码流数据子块的基地址均相同,均为第一个码流数据子块的基地址。然后确定每个码流数据子块的长度,例如t'1、t'2、t'3、t'4、t'5的长度分别为len1、len2、len3、len4、len5,可以通过数值长度标志位进行记录,例如每个长度数值用一定数量的编码进行记录,或者记录各码流数据子块中每个数据的长度,以代替码流数据子块的总长度,通过每个数据的长度与待编码数据子块的数据数量相乘,可以得到码流数据子块的总长度。将各码流数据块的基地址信息和各码流数据子块的长度信息进行编码后,形成头部码流,再加上位于头部码流之后的各码流数据块,得到待编码数据对应的完整码流数据。
需要补充的是,如果存在数据均为空值的待编码数据子块,通常是填充部分的数据,则可以确定该待编码数据子块对应的码流数据子块的长度为0,用一个数值长度标志位表示该码流数据子块,而无需对其中的空值进行编码。这样在解码时,可以根据数值长度标志位快速识别出空值的数据子块,进一步提高解码效率。
下面结合图10对数据编码过程做进一步说明。待编码图像为64*7的单通道特征图像,其编码过程如下:
待编码图像包括7行,分别为row0到row6。首先采用64*4的预设尺寸划分待编码数据块,由于待编码图像的高度不是预设尺寸的整数倍,需要在其下方增加一行row7,并填充空值,然后划分为两个待编码数据块,第一个待编码数据块包括row0到row3,第二个待编码数据块包括row4到row7。
进一步再将每个待编码数据块划分为多个待编码数据子块,图10中可以以每一行(row)为一个待编码数据子块,即第一个待编码数据块包括4个待编码数据子块,分别为row0、row1、row2、row3。
对于每个待编码数据子块,采用固定位长进行编码,通常按照各待编码数据子块中最大的数据计算所需位长,图10中以B表示1个单位(如1B=8Byte,可以根据实际需求设定),row0编码后得到对应的码流数据子块的长度为len0,例如为5B;row1编码后得到对应的码流 数据子块长度为len1,例如为3B。需要注意的是,row7为空值,其对应的码流数据子块也是空值,长度len7应当为0。第一个待编码数据块所对应的码流数据块记为slice0,包括row0到row3对应的码流数据子块,第二个待编码数据块所对应的码流数据块记为slice1,包括row4到row7对应的码流数据子块。
确定头部码流。头部码流包括:待编码图像的尺寸信息,如宽度W、高度H、通道数C等;各码流数据块的基地址,如slice0的基地址addr0,slice1的基地址addr1;各码流数据子块的长度,如len0、len1、…、len7。需要说明的是,slice0的基地址addr0指向slice0在整个码流数据中的起始存储地址,slice1的基地址addr1指向slice1在整个码流数据中的起始存储地址。
将头部码流与码流数据块进行合并,得到待编码图像对应的完整码流数据。
下面具体说明如何对各待编码数据子块进行编码,下述内容也可以应用于对待编码数据块进行编码。
可以根据每个待编码数据子块中的数据一致性特征,分别通过对应的编码方式对每个待编码数据子块进行编码。
其中,数据一致性特征是指待编码数据子块中的数据是否全部相同,或者是否全部为某个数值。根据每个待编码数据子块中的数据一致性特征,确定对应的编码方式。
在一种可选的实施方式中,包括以下步骤:
当待编码数据子块中的数据全部为0时,通过第一编码方式对待编码数据子块进行编码;
当待编码数据子块中的数据不全为0时,通过第二编码方式对待编码数据子块进行编码。
其中,待编码数据子块中的数据是否全部为0,可以通过在待编码数据的码流结构中设置数据特征标志位来进行表征,数据特征标志位可以设置在上述头部码流中,例如位于基地址的信息之后。即,可以根据数据特征标志位对待编码数据子块进行编码。具体来说,可以按照待编码数据子块的数量设置相应长度的特征标志位,当待编码数据子块中的数据全部为0时,将对应的数据特征标志位设为第一预设数值(如0),当待编码数据子块中的数据不全为0时,将对应的数据特征标志位设为第二预设数值(如1)。
由上可知,对于数据全部为0的待编码数据子块,在解码时通过解码数据特征标志位即可确定数据全部为0,因而无需对每个数据进行编码,解码时也无需对每个数据进行解码。基于此,上述通过第一编码方式对待编码数据子块进行编码,可以包括:将数据特征标志位设为第一预设数值,并根据第一预设数值对待编码数据子块进行编码。即对于数据全部为0的待编码数据子块,无需对其中的数据编码,从而大大降低了码流开销。
在一种可选的实施方式中,上述通过第二编码方式对待编码数据子块进行编码,可以包括以下步骤:
将数据特征标志位设为第二预设数值;
计算待编码数据子块中每个数据的残差;
根据第二预设数值和残差,对待编码数据子块进行编码。
对于待编码数据子块中每个数据的残差计算,下面提供两种计算方式:
①参考图11所示,待编码数据子块中的数据为p1、p2、p3、p4,从p2开始,计算每个数据与待编码数据子块中第一个数据p1之间的残差,得到残差d2=p2-p1,d3=p3-p1,d4=p4-p1。这样在解码时,得到第一个数据后,可以同时对后面的数据执行残差逆运算,无需逐个解码并计算,从而提高解码效率。
②参考图12所示,计算待编码数据子块中每个数据与其前一数据之间的残差,得到残差d2=p2-p1,d3=p3-p2,d4=p4-p3。由于待编码数据中数据一般具有连续性,特别是在图像数据中,相邻两个数据之间可能相同或相近,由此计算得到的残差较小,便于后续对残差编码。
在上面的计算中,还需要确定第一个数据的残差,下面提供两种计算方式:
③计算第一个数据与前一待编码数据子块中最后一个数据之间的残差。一般情况下,第一个数据与前一待编码数据子块中最后一个数据之间具有一定的连续性,这样计算得到的第一个数据的残差通常较小,便于对其进行编码。
④如图11和图12所示,计算第一个数据p1与预设基准数据p0之间的残差,得到残差d1=p1-p0。预设基准数据可以是0、1等任意数值,在一种可选的实施方式中,预设基准数据可以是待编码数据的数值范围的中值,如待编码数据的数值范围为[-127,127]时,预设基准数据可以是0,待编码数据的数值范围为[0,255]时,预设基准数据可以是127,这样在计算残差时,可以尽量减小残差的数值,便于后续对残差编码。
实际应用中,可以根据需求对上述计算方式进行任意组合,例如采用方式④计算待编码数据子块中第一个数据的残差,采用方式②计算待编码数据子块中后面每个数据的残差,这样可以在解码时实现较高的并行度。
在计算残差时,可以以每M个待编码数据子块为一个残差计算数据组,对残差计算数据组的每个待编码数据子块中的每个数据计算残差;M为大于或等于2的正整数。其中,残差计算数据组可视为残差计算的基本单元,以数据规模较大的残差计算数据组为单元计算残差,可以提高效率;特别是在图像数据的编码中,以一定区域内的数据为一个残差计算数据组,进行残差计算,可以实现较高的并行度。一个残差计算数据组可以采用相同的预设基准数据,计算其中每个待编码数据子块的第一个数据与该预设基准数据的残差,得到每个待编码数据子块的第一个残差。或者参考图13所示,以4个待编码数据子块为一个残差计算数据组,每个待编码数据子块包括4个数据。其中第一个待编码数据子块的第一个数据p1与预设基准数据p0做差,得到第一个残差d1;对于后面三个待编码数据子块,可以将第一个数据与前一待编码数据子块的最后一个数据做差,得到相应的第一个残差,如d5=p5-p4,d9=p9-p8;对于各待编码数据子块中第一个数据后面的其他数据,将其分别与该待编码数据子块的第一个数据做差,得到相应的每个残差,如d2=p2-p1,d3=p3-p1,d6=p6-p5,d7=p7-p5;由此可以得到该残差 计算数据组中的每个残差。
以上说明了如何计算残差。下面继续说明如何对残差进行编码,包括两种情况:
情况一、当待编码数据子块中的残差完全相同时,将残差特征标志位设为第三预设数值;根据第二预设数值、第三预设数值和待编码数据子块中任一残差的编码,对待编码数据子块进行编码。
其中,残差特征标志位用于表征待编码数据子块中残差的一致性特征,例如待编码数据子块中的残差完全相同时,将残差特征标志位设为第三预设数值0,第三预设数值也可以是1等其他数值。由于待编码数据子块中的残差都相同,对其中的任一残差进行编码即可。举例来说,某一待编码数据子块中的四个残差均为1,设置数据特征标志位为第二预设数值,残差特征标志位为第三预设数值,这两部分写入头部码流中,再对残差1进行编码,得到该待编码数据子块对应的码流数据子块。可见,一个残差的编码能够代表四个残差,因此这部分的码流开销大大降低。
在对待编码数据子块中的任一残差(以Diff表示)编码时,其所需的码流位长bitLen_Diff,可以通过以下公式(1)计算:
Figure PCTCN2020099504-appb-000001
残差的编码中还包括1bit的符号位,通常0表示+,1表示-。
进一步的,可以根据数值长度标志位记录上述任一残差的编码所需的码流位长。数值长度标志位本身的码流位长,可以根据上述残差的码流位长bitLen_Diff的数值范围来确定,以保证有足够的位长来表示最大的bitLen,例如在特征图像中,待编码数据一般在[0,255]范围内,残差一般在[-255,255]范围内,因此bitLen_Diff的数值范围为[2,9],相应的可以采用3bit的数值长度标志位来表示bitLen_Diff,对应关系如表1所示。
表1
Figure PCTCN2020099504-appb-000002
举例来说,残差为0或1时,需要2个bit来编码(即bitLen_Diff=2),数值长度标志位可设为000,残差为2或3时,需要3个bit来编码,数值长度标志位可设为001,等等。由此,在待编码数据对应的码流数据中,头部码流可以包括尺寸信息、基地址、数据特征标志位、残差特征标志位、数值长度标志位,码流数据块部分可以包括各待编码数据子块对应的码流数据子块。
情况二、当待编码数据子块中的残差不完全相同时,将残差特征标志位设为第四预设数值;根据第二预设数值、第四预设数值和待编码数据子块中每个残差的编码,对待编码数据子块进行编码。
其中,第四预设数值表示待编码数据子块中的残差不完全相同,与上述第三预设数值应当不同,例如第三预设数值为0,第四预设数值为1。由于残差不完全相同,需要对每个残差分别进行编码。一般的,设置数据特征标志位为第二预设数值,残差特征标志位为第四预设数值,再对每个残差分别进行编码,这三部分共同形成待编码数据子块的码流结构。
在对残差编码时,不同残差可能需要不同的位长,为了统一起见,可以以待编码数据子块中最大的残差(以maxDiff表示)为标准,根据最大的残差的编码所需的码流位长确定每个残差的码流位长。码流位长bitLen_Diff的计算方法可以如下公式(2)所示:
Figure PCTCN2020099504-appb-000003
残差的编码中还包括1bit的符号位,通常0表示正号+,1表示负号-。
进一步的,可以根据数值长度标志位记录最大的残差的编码所需的码流位长。数值长度标志位可以参考表1部分的内容,举例来说,最大的残差为7时,需要4个bit来编码,数值长度标志位可设为010,其他每个残差也采用4个bit来编码。由此,在待编码数据子块的码流结构中,包括数据特征标志位、残差特征标志位、数值长度标志位和每个残差的编码这四部分。
通过上述内容,在对待编码数据进行编码时,可以对数据进行两次扫描,第一次扫描各待编码数据子块的数据一致性,第二次扫描各待编码数据子块的残差一致性(对于第一次扫描满足数据一致性的待编码数据子块,无需进行第二次扫描)。根据两次扫描结果,采取对应的方式编码。
在上述实施方式中,根据待编码数据子块中的数据是否全部为0,采用不同的编码方式进行编码。除此以外,还可以根据待编码数据子块中的数据是否全部相同,采用不同的编码方式进行编码。具体包括以下步骤:
当待编码数据子块中的数据完全相同时,将数据特征标志位设为第五预设数值;
根据第五预设数值和待编码数据子块中任一数据的编码,对待编码数据子块进行编码。
其中,第五预设数值用于表示待编码数据子块中的数据完全相同,第五预设数值与第一预设数值、第二预设数值没有关系,可以将第五预设数值设为0。由于待编码数据子块中的数据完全相同,对其中任一数据编码即可。举例来说,某一待编码数据子块中的四个数据均 为1,设置数据特征标志位为第三预设数值,写入头部码流中,再对数据1进行编码,得到该待编码数据子块对应的码流数据子块。可见,一个数据的编码能够代表四个数据,因此这部分的码流开销大大降低。
在对待编码数据子块中的任一数据(以Data表示)编码时,其所需的码流位长bitLen_Data,可以通过以下公式(3)计算:
Figure PCTCN2020099504-appb-000004
与残差的编码所不同的是,在对数据进行编码时,一般无需设置符号位,因此比残差的码流位长bitLen_Diff少1个bit。当然,在一些特别的情况中,待编码数据携带正负号,则可以设置1bit的符号位,bitLen_Data可以在公式(3)计算值的基础上加1。
进一步的,在编码时,还可以设置数值长度标志位,根据数值长度标志位记录上述任一数据的编码所需的码流位长。数值长度标志位本身的码流位长,可以根据上述数据的码流位长bitLen_Data的数值范围来确定,以保证有足够的位长来表示最大的bitLen_Data,例如在特征图像中,待编码数据一般在[0,255]范围内,因此bitLen的数值范围为[1,8],相应的可以采用3bit的数值长度标志位来表示bitLen_Data,对应关系如表2所示。
表2
Figure PCTCN2020099504-appb-000005
举例来说,数据为0或1时,需要2个bit来编码(即bitLen_Data=2),数值长度标志位可设为000,残差为2或3时,需要3个bit来编码,数值长度标志位可设为001,等等。由此,在待编码数据对应的码流数据中,头部码流可以包括尺寸信息、基地址、数据特征标志位、数值长度标志位,码流数据块部分可以包括各待编码数据子块对应的码流数据子块。
对于待编码数据子块中的数据不完全相同的情况,可以包括以下步骤:
当待编码数据子块中的数据不完全相同时,将数据特征标志位设为第六预设数值;
计算待编码数据子块中每个数据的残差;
根据第六预设数值和待编码数据子块中的残差,对待编码数据子块进行编码。
其中,第六预设数值用于表示待编码数据子块中的数据不完全相同,与第五预设数值应当不同,如可以将第六预设数值设为1。由于待编码数据子块中的数据不完全相同,进一步通过残差编码对该待编码数据子块进行编码,具体方法可以参考上述图11、图12、图13部分的内容,根据残差是否全部相同,分为两种情况,并采用对应的方式编码。
在一种可选的实施方式中,如果待编码数据对应的码流数据中包括至少一个待编码数据子块的残差特征标志位,则在码流数据中,可以将各残差特征标志位连续设置于数据特征标志位之后。这样便于在解码时,在解码残差之前即确定残差的一致性特征,从而更快地确定残差数值,提高解码效率。
本公开上述实施方式中,一方面,将待编码数据划分为多个待编码数据块,并记录每个待编码数据块所对应的码流数据块的基地址,以便于在解码时根据基地址找到所需的目标数据所在的码流数据块,从而有针对性地读取并解码局部数据,降低编解码所需的资源开销。另一方面,通过将待编码数据划分为多个待编码数据块,可以对不同的待编码数据块实现并行编码,从而提高了编码效率。
本方案适用于对CNN特征图像的数据处理,通过将特征图像划分为多个待编码数据块,记录每个待编码数据块所对应的码流数据块的基地址,以便于在读取特征图像的数据时,根据各码流数据块的基地址有针对性地读取所需的码流数据并进行解码,无需读取并解码全部的码流数据,从而降低了对片外存储器的读带宽,以及进行解码所需的计算资源,提高CNN运行的效率,有利于部署在移动终端等轻量化场景中。
针对于经过上述实施方式的数据编码方法编码后的数据,本公开的示例性实施方式还提供了对应的数据解码方法,参考图14所示,该方法包括以下步骤S1410至S1430:
步骤S1410,获取待解码数据,待解码数据包括多个码流数据块及各码流数据块的基地址。
待解码数据为原始数据经过编码后得到的码流数据,原始数据包括多个原始数据块,每个原始数据块对应于待解码数据中的一个码流数据块。码流数据块的基地址为码流数据块在待解码数据中的起始存储地址。
在一种可选的实施方式中,待解码数据可以包括两部分:头部码流和码流数据块。各码流数据块的基地址位于头部码流中,各码流数据块位于头部码流之后。除了基地址以外,头部码流还可以记录其他方面的信息,例如头部码流可以包括尺寸标志位,以表示待解码数据所对应的原始数据的尺寸,或者头部码流包括每个码流数据块的编码方式、编码位长等信息。本公开对此不做限定。
在一种可选的实施方式中,原始数据可以是原始图像,例如CNN中的特征图像,或者处理器与显示器之间传输的待显示图像等。进一步的,原始数据块可以是原始图像中一定尺寸的子图像。
在一种可选的实施方式中,各原始数据块具有相同数量的数据,这样在解码时,便于确 定每个码流数据块所对应于多少个原始数据,从而可以对不同码流数据块进行并行解码,提高效率。
步骤S1420,根据上述多个码流数据块中目标码流数据块的基地址,从待解码数据中确定目标码流数据块。
在数据编解码的场景中,有时仅需要得到其中的一部分数据,称为目标数据。目标码流数据块即包含目标数据的编码的码流数据块,也就是说,在解码时无需解码目标码流数据块以外的其他码流数据块。
在一种可选的实施方式中,可以根据待解码数据对应的原始数据的分块参数确定目标原始数据的编码所在的目标码流数据块。分块参数携带有原始数据划分为原始数据块的相关信息,可以具体包括以下至少一项:原始数据中各原始数据块的尺寸参数,原始数据中原始数据块的数量,各原始数据块在原始数据中的位置参数。举例来说,原始图像的尺寸为64*7,原始数据块的尺寸为64*4,当需要原始图像中第6行(参考图10,第6行为row5)时,根据原始数据块的尺寸可以确定,第6行位于第二个原始数据块中,其编码数据位于待解码数据中的第二个码流数据块中,则第二个码流数据块就是目标码流数据块。
在确定目标码流数据块后,可以从待解码数据所包含的基地址信息中读取目标码流数据块的基地址,进而确定目标码流数据块具体是待解码数据中的哪一段数据。
在一种可选的实施方式中,参考图15所示,步骤S1420具体包括以下步骤S1510和S1520:
步骤S1510,根据目标码流数据块在待解码数据的各码流数据块中的序数,确定目标码流数据块的基地址的编码位置;
步骤S1520,从目标码流数据块的基地址的编码位置读取预设位长的数据并进行解码,得到目标码流数据块的基地址。
其中,基地址的编码位置是指基地址的信息由待解码数据中哪个位置的数据所记录;预设位长是指基地址的编码所需的位长,通常各码流数据块的基地址信息占用相同位长的数据,例如均占用8bit位长。根据目标码流数据块在待解码数据的各码流数据块中的序数,例如目标码流数据块为第二个码流数据块时,从基地址的编码位置开始,跳过第一个码流数据块的基地址信息(即跳过8bit),然后读取8bit的数据,即第二个码流数据块的基地址信息,解码后得到该基地址信息。
步骤S1430,读取目标码流数据块中的至少一个码流数据子块,并对该码流数据子块进行解码,生成对应的原始数据子块。
其中,码流数据子块的长度小于或等于目标码流数据块的长度,一般的,每个码流数据块均可以包括多个码流数据子块。在原始数据中,每个原始数据块也可以包括多个原始数据子块,每个原始数据子块对应于一个码流数据子块。这样在解码时,可以确定所需的目标数据对应于目标码流数据块中具体哪一个或几个码流数据子块中,只需解码这些码流数据子块,而无需解码其他的码流数据子块,从而实现更加有针对性地数据解码,降低资源开销。
在一种可选的实施方式中,在待解码数据中,对每个码流数据块记录一个基地址,该基地址可以是码流数据块中第一个码流数据子块的基地址,也作为码流数据块中其他码流数据子块的基地址。为了便于确定其他码流数据子块的实际存储位置,待解码数据中还可以包括各码流数据子块的长度信息,例如头部码流可以包括数值长度标志位,为各码流数据子块的长度的编码,或者当各码流数据子块的长度相同时,记录一个长度信息即可。由此,当需要从目标码流数据块中确定目标码流数据子块时,可以根据目标码流数据块的基地址和目标码流数据块的各码流数据子块的长度信息,从目标码流数据块中读取至少一个目标码流数据子块。实际解码中,需要确定目标码流数据块的基地址与目标码流数据子块的实际存储地址之间的偏移值,以便于实际确定目标码流数据子块为哪一段数据。具体地,参考图16所示,可以通过以下步骤S1610和S1620实现:
步骤S1610,解析上述长度信息,以得到目标码流数据块中位于目标码流数据子块之前的各码流数据子块的长度,并根据所得到的各码流数据子块的长度之和确定偏移值;
步骤S1620,根据目标码流数据块的基地址和上述偏移值读取目标码流数据子块。
例如,目标码流数据子块为目标码流数据块中的第三个码流数据子块,则偏移值为前两个码流数据子块的长度之和。按照该偏移值,从目标码流数据块的基地址向右偏移,所得到的位置为目标码流数据子块的实际起始存储地址。从该地址开始,按照目标码流数据子块的长度读取相应数量的数据,即得到目标码流数据子块。进而对其进行解码,得到对应的原始数据子块,所需的目标数据位于该原始数据子块中。
需要补充的是,如果待解码数据中存在长度为0的码流数据子块,该码流数据子块可能是填充的部分,填充的部分一般为空值,则可以确定该长度为0的码流数据子块对应的原始数据块为空值。这样就无需对长度为0的码流数据子块进行实际解码,进一步提高了解码效率。
下面以图10所示的图像码流数据为待解码数据,对上述解码过程进行更具体地说明。例如,当目标数据为row5,即需要解码出row5的数据时,解码过程如下:
首先按照码流数据中头部码流的数据,依次解码得到原始图像的宽W、高H、通道数C。在预先确定预设尺寸为W*M(M取4)的情况下,通过高H计算码流数据块的数量N=ceil(H/M)=ceil(7/4)=2(ceil表示向上取整),即码流数据中共包括两个码流数据块(slice)。
再依次从头部码流中读取基地址addr0和addr1,以及每一行对应的码流数据子块的长度len0到len7。
访问row5时(使用i表示行号,这里i=5),先计算行号i所对应的slice编号n和当前slice的起始行号slice_start,其中n=i/M=floor(5/4)=1(floor表示向下取整),slice_start=n*M=4;再计算row5对应的码流数据子块相对于基地址的偏移长度,offSet=(len(slice_start)+…+len(i-1))*B=7B。
从基地址addr1,向右偏移7B,然后依次读取3B长度(即len5长度)的数据,对其进 行解码,得到row5的原始数据。
实际解码中,所需的目标数据可能位于多个不同的原始数据子块中,对应于待解码数据中的多个不同的目标码流数据子块。在解码时,可以分为以下两种情况来处理:
(一)上述多个不同的目标码流数据子块位于两个或两个以上的码流数据块中。可以将这些码流数据块均作为目标码流数据块,根据其基地址,在待解码数据中确定每个目标码流数据块。进而分别从每个目标码流数据块中读取至少一个目标码流数据子块;对读取的各目标码流数据子块进行并行解码,生成每个目标码流数据子块对应的原始数据子块。
(二)上述多个不同的目标码流数据子块均位于同一个码流数据块中。可以将该码流数据块作为目标码流数据块,根据其基地址,在待解码数据中确定该目标码流数据块。进而从目标码流数据块中读取至少两个目标码流数据子块;对读取的各目标码流数据子块进行并行解码,生成每个目标码流数据子块对应的原始数据子块。
由上可知,无论目标码流数据子块在待解码数据中是怎样的分布情况,均可以同时确定每个目标码流数据子块在待解码数据中的存储位置,从而同时读取各目标码流数据子块,进行并行解码。任一目标码流数据子块的查找与解码过程,不依赖于其他目标码流数据子块的处理,每个目标码流数据子块的处理均是独立进行的,因此本方案实现了较高的并行解码程度,可以缩短解码时间。
当需要解码全部数据时,参考图17所示,可以通过以下步骤S1710和S1720实现:
步骤S1710,对待解码数据中的尺寸标志位解码得到待解码数据对应的原始数据的尺寸参数;
步骤S1720,按照上述尺寸参数,对解码各码流数据块所得到的原始数据块进行排列,得到原始数据。
例如,原始数据为图像时,尺寸标志位可以记录图像的宽、高、通道数。在解码得到各码流数据块所对应的原始数据块后,按照宽、高、通道数来排列各原始数据块,以还原出原始的单通道图像或多通道图像。
下面具体说明如何对各码流数据子块进行解码,下述内容也可以应用于对码流数据块进行编码。
可以根据码流数据子块所对应的原始数据子块的数据一致性特征,采用对应的解码方式对码流数据子块进行解码。
原始数据子块的数据一致性特征,是指原始数据子块中的数据是否全部相同,或者是否全部为某一数值。在一种可选的实施方式中,可以通过待解码数据中数据特征标志位的数值,确定各码流数据子块所对应的原始数据子块的数据一致性特征。数据特征标志位可以位于待解码数据中的任意指定位置,例如头部码流中位于基地址之后起。具体地,可以通过以下步骤实现:
从待解码数据中读取每个码流数据子块的数据特征标志位的数值;
分别对每个数据特征标志位的数值进行解析,确定每个码流数据子块所对应的原始数据子块的数据一致性特征。
在一种可选的实施方式中,当数据特征标志位的数值为第一预设数值(如0)时,确定对应的码流数据子块为第一类码流数据子块,其对应的原始数据子块中的数据均为0。对于数据均为0的原始数据子块,仅通过数据特征标志位进行编码,而不对其中的数据进行具体编码。因此,如果确定某一码流数据子块为第一类码流数据子块,则可以直接确定对应的原始数据子块中的数据全部为0。
当数据特征标志位的数值为第二预设数值(如1)时,确定对应的码流数据子块为第二类码流数据子块,其对应的原始数据子块中的数据不全为0。对于数据不全为0的原始数据子块,采用残差编码。因此如果确定某一码流数据子块为第二类码流数据子块,可以通过以下步骤进行解码:
解码第二类码流数据子块,得到残差;
对残差进行残差的逆运算,得到第二类码流数据子块对应的原始数据子块。
由于在编码时对残差采用不同的方式进行编码,因此在解码时也可以采用对应的方式进行解码。具体地,可以通过待解码数据中残差特征标志位的数值,采用对应的残差解码方式分别解码各第二类码流数据子块,得到残差。其中,残差特征标志位用于表征各原始数据子块中的残差是否全部相同。残差特征标志位可以位于待解码数据中的任意指定位置,在一种可选的实施方式中,残差特征标志位可以位于头部码流中数据特征标志位之后。具体地,可以通过以下步骤确定残差解码方式:
从待解码数据中读取每个第二类码流数据子块的残差特征标志位的数值;
分别对每个残差特征标志位的数值进行解析,确定每个第二类码流数据子块对应的残差解码方式。
残差解码方式主要包括两种:当原始数据子块中的残差全部相同时,可以仅对其中一个残差编码,即可代表所有残差,解码时仅需要解码得到一个残差,复制该残差得到其他所有的残差;当原始数据子块中的残差不全相同时,需要对其中每个残差编码,解码时也需要分别解码得到每个残差。
具体地,上述两种解码方式可以通过以下步骤实现:
当残差特征标志位的数值为第三预设数值(如0)时,可以解码对应的第二类码流数据子块,得到一个残差,并确定该第二类码流数据子块的残差均等于该残差,例如解码某一第二类码流数据子块,得到一个残差为3,该第二类码流数据子块对应的原始数据子块包括4个数据,则该第二类码流数据子块的残差为‘3333’;
当残差特征标志位的数值为第四预设数值(如1)时,可以解码对应的第二类码流数据子块,得到该第二类码流数据子块的每个残差,例如解码某一第二类码流数据子块,得到4个残差‘3110’,即为该第二类码流数据子块的残差。
实际应用中,还可以根据数值长度标志位的数值确定第二类码流数据子块中的残差编码位长,进而根据残差编码位长读取相应的残差编码并进行解码。例如,数值长度标志位可以位于残差特征标志位之后,每个第二类码流数据子块的数值长度标志位占用3bit,可以参考表1所示,通过对应关系确定残差编码位长,即公式(1)和(2)中的bitLen_Diff,假设读取数值长度标志位的数值为‘001 100’,则确定前一个第二类码流数据子块的残差编码位长为3bit,后一个第二类码流数据子块的残差编码位长为6bit,进而按照该位长从待解码数据中读取残差编码并进行解码。
在解码出残差后,需要执行残差的逆运算。首先计算各第二类码流数据子块所对应的原始数据子块中的第一个数据。本示例性实施方式中,对于第一个数据的残差提供两种计算方式(参考上述计算方式③和④),因此也提供两种对应的残差逆运算方式:
对应于上述残差计算方式③,将第二类码流数据子块中第一个残差与前一码流数据子块所对应原始数据子块中的最后一个数据求和,得到第二类码流数据子块对应的原始数据子块中的第一个数据。
对应于上述残差计算方式④,将第二类码流数据子块中第一个残差与预设基准数据求和,得到第二类码流数据子块对应的原始数据子块中的第一个数据。例如参考上述图11与图12,p1=p0+d1。预设基准数据p0可以是预先确定的任意数据,例如可以是原始数据的数值范围的中值。
在确定第一个数据后,再计算后续的数据。由于残差计算包括两种方式(参考上述计算方式①和②),因此也提供两种对应的残差逆运算方式:
对应于上述残差计算方式①,将第二类码流数据子块中除第一个残差外的每个残差,逐个进行残差的逆运算,得到第二类码流数据子块对应的原始数据子块。例如参考上述图911所示,p2=p1+d2,p3=p1+d3,p4=p1+d4。
对应于上述残差计算方式②,将第二类码流数据子块中除第一个残差外的每个残差,分别与第二类码流数据子块对应的原始数据子块中的第一个数据求和,得到第二类码流数据子块对应的原始数据子块。例如参考上述图12所示,p2=p1+d2,p3=p2+d3,p4=p3+d4。
在一种可选的实施方式中,可以以每M个第二类码流数据子块为一个残差解码数据组,对残差解码数据组中的残差进行残差的逆运算,得到残差解码数据组中每个第二类码流数据子块对应的数据块;M为大于或等于2的正整数。例如,参考上述图13所示,M为4,以4个待编码数据子块形成一个残差编码数据组。相应的,在解码时,可以以4个码流数据子块形成一个残差解码数据组,以该残差解码数据组为单元,执行残差的逆运算,如可以按照图13所示的逆方向进行运算,以将所有残差恢复为原始数据。
本公开上述数据解码方法中,根据待解码数据中各码流数据块的基地址,可以快速找到目标码流数据块,并对其进行针对性地解码,无需解码其他的码流数据块,从而降低了解码所需的计算量,提高了解码效率,并可以支持对数据的随机访问,拓宽了数据编解码的应 用场景。
本公开示例性实施方式还提供一种数据处理方法,应用于如图18所示的数据处理系统。该数据处理系统包括:依次连接的配置器1810、存储器1820和处理器1830。该配置器1810可以设置于DMA模块中;该存储器1820可以是片外存储器,如DDR等;该处理器1830可以是CNN计算核,包括片上存储器,如SRAM等。
该数据处理方法的流程可以参考图19所示,包括以下步骤S1910至S1940:
步骤S1910,通过配置器执行本公开示例性实施方式中任一种数据编码方法(如图4所示的方法),对预设的待编码数据进行编码,生成码流数据;
步骤S1920,将所生成的码流数据写入存储器,以降低对存储器的写带宽;
步骤S1930,通过配置器读取存储器内的至少部分码流数据,并对所读取的码流数据进行解码,以降低对存储器的读带宽;
步骤S1940,通过处理器运行解码所得到的数据。
其中,预设的待编码数据为处理器和配置器之间需要读写的数据,例如可以是CNN中的特征图像数据。
在一种可选的实施方式中,配置器1810可以包括编码器1811,使配置器1810具体通过编码器1811编码待编码数据。
在一种可选的实施方式中,配置器1810还可以包括解码器1812,使配置器1810具体通过解码器1812解码所读取的码流数据。
在一种可选的实施方式中,处理器1830还可以包括SRAM 1831,其作为片上存储器,使得处理器1830具体通过SRAM 1831与配置器1810进行数据读写。
由于本示例性实施方式的数据编码方法可以降低码流数据的开销,配置器1810将码流数据写入存储器1820时,可以占用更少的写带宽;配置器1810从存储器1820读取码流数据时,可以占用更少的读带宽。
本公开示例性实施方式还提供一种编码器,该编码器可以参考图18中的编码器1811所示,通过执行本公开示例性实施方式中任一种数据编码方法(如图4所示的方法),对待编码数据进行编码。
图20示出编码器的一种示例性架构。待编码数据进入编码器后,首先由数据划分模块将待编码数据划分为多个数据块;然后由数据扫描模块扫描数据一致性特征,若满足条件(如全部为0,或者全部相同)则直接进入编码方式选择模块,确定采用数据一致性的编码方式(如游程编码);若数据一致性特征不满足条件,则由残差计算模块进行残差运算;再由残差扫描模块(可以和数据扫描模块为同一模块)扫描残差一致性特征;再由编码方式选择模块根据残差一致性特征确定对应的编码方式;最后由数据编码模块执行相应的编码方式,得到对应的码流数据。需要说明的是,本实施方式仅为示例性说明,不应当看作是对本公开的限定。
本公开示例性实施方式还提供一种解码器,该解码器可以参考图18中的解码器1812所示,通过执行本公开示例性实施方式中任一种数据编码方法(如图14所示的方法),对待解码数据进行解码。
图21示出解码器的一种示例性架构。待解码数据进入解码器后,首先由编码方式解析模块解析各待解码数据段所对应的原始数据块采用了哪种编码方式;然后由解码方式选择模块确定对应的解码方式;再由数据解码模块执行相应的解码方式,包括数据一致性解码(如游程解码)、残差解码等;如果采用残差解码,还需要由残差计算模块进行残差逆运算;最终得到待解码数据对应的原始数据。需要说明的是,本实施方式仅为示例性说明,不应当看作是对本公开的限定。
本公开示例性实施方式还提供一种数据处理系统。可以参考上述图18所示,该数据处理系统可以包括:依次连接的配置器1810、存储器1820和处理器1830。其中:
配置器1810,用于执行本公开示例性实施方式中任一种数据编码方法(如图4所示的方法),对预设的待编码数据进行编码,生成码流数据,并将所生成的码流数据写入存储器1820,以降低对存储器1820的写带宽;
配置器1810,还用于读取存储器1820内的至少部分码流数据,对所读取的码流数据进行解码,使处理器1830运行解码得到的数据,以降低对存储器1820的读带宽。
配置器1810在对码流数据进行解码时,可以采用与编码对应的解码方法,例如图14所示的方法等。
本公开示例性实施方式还提供一种可移动平台。参考图22所示,该可移动平台可以包括:
机体2210;
动力系统2220,设于机体2210,动力系统2220用于为可移动平台提供动力;
数据处理系统2230,其结构可以参考图18。
示例性的,上述数据处理系统2230可以应用于动力系统、作业系统等等可移动平台的功能系统中。
本示例性实施方式提供的数据处理系统在运行CNN进行数据处理时,能够降低所需的带宽与计算资源,且实现对CNN的特征图像数据进行无损的编码与解码,保证不会引入额外的误差且不需要重新训练网络。因而,能够满足在硬件性能不高的情况下运行CNN。
本公开示例性实施方式还提供一种计算机可读介质,其上存储有计算机程序,计算机程序被处理器执行时实现本公开示例性实施方式中任一种数据编码方法、数据解码方法或数据处理方法,例如可以执行图4、图14或图19中的方法步骤等。该计算机可读介质可以是上述实施方式中描述的可移动平台中所包含的;也可以是单独存在,而未装配入该可移动平台中。
需要说明的是,本公开所示的计算机可读介质可以是计算机可读信号介质或者计算机 可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本公开实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、终端装置、或者网络设备等)执行根据本公开示例性实施例的方法。
此外,上述附图仅是根据本公开示例性实施例的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本公开的示例性实施例,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其他实施例。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由权利要求指出。
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限定。

Claims (33)

  1. 一种数据编码方法,其特征在于,包括:
    将待编码数据划分为多个待编码数据块;
    对各所述待编码数据块进行编码,得到各所述待编码数据块对应的码流数据块;
    基于各所述码流数据块的基地址和各所述码流数据块,得到所述待编码数据对应的完整码流数据;所述码流数据块的基地址为所述码流数据块在所述完整码流数据中的起始存储地址。
  2. 根据权利要求1所述的方法,其特征在于,各所述待编码数据块具有相同数量的数据。
  3. 根据权利要求1所述的方法,其特征在于,所述对各所述待编码数据块进行编码,得到各所述待编码数据块对应的码流数据块,包括:
    将每个所述待编码数据块进一步划分为多个待编码数据子块;
    对各所述待编码数据子块进行编码,得到各所述待编码数据子块对应的码流数据子块。
  4. 根据权利要求3所述的方法,其特征在于,所述基于各所述码流数据块的基地址和各所述码流数据块,得到所述待编码数据对应的完整码流数据,包括:
    将每个所述待编码数据块中第一个待编码数据子块对应的码流数据子块的基地址,作为所述待编码数据块对应的所述码流数据块的基地址;
    根据各所述码流数据块的基地址和各所述码流数据子块的长度生成头部码流;
    基于所述头部码流和各所述码流数据块,得到所述待编码数据对应的完整码流数据。
  5. 根据权利要求3所述的方法,其特征在于,各所述待编码数据子块具有相同数量的数据。
  6. 根据权利要求3所述的方法,其特征在于,如果存在数据均为空值的待编码数据子块,则确定所述待编码数据子块对应的所述码流数据子块的长度为0。
  7. 根据权利要求1所述的方法,其特征在于,通过以下方式确定各所述码流数据块的基地址:
    根据起始地址以及由所述头部码流的位长所确定的偏移值,确定第一个码流数据块的基地址;
    根据上一码流数据块的基地址以及由上一码流数据块的长度所确定的偏移值,依次确定所述第一个码流数据块之后的各码流数据块的基地址。
  8. 根据权利要求1所述的方法,其特征在于,所述待编码数据为待编码图像。
  9. 根据权利要求8所述的方法,其特征在于,所述将待编码数据划分为多个待编码数据块,包括:
    按照预设尺寸将所述待编码图像划分为多个待编码数据块。
  10. 根据权利要求9所述的方法,其特征在于,各所述待编码数据块和所述待编码图像的宽度相同,或者各所述待编码数据块和所述待编码图像的高度相同。
  11. 根据权利要求9所述的方法,其特征在于,在将所述待编码图像划分为多个待编码数据块时,如果所述待编码图像的尺寸不满足为所述预设尺寸的整数倍,则对所述待编码图像进行数据填充,使填充后的所述待编码图像的尺寸满足为所述预设尺寸的整数倍。
  12. 根据权利要求11所述的方法,其特征在于,所述对所述待编码图像进行数据填充,包括:
    在所述待编码图像的下方增加新的行,在其中填入空值;和/或
    在所述待编码图像的右侧增加新的列,在其中填入空值。
  13. 根据权利要求8所述的方法,其特征在于,所述待编码数据块为所述待编码图像中的M行或者M列,M为正整数。
  14. 根据权利要求8所述的方法,其特征在于,所述待编码图像包括卷积神经网络中的特征图像。
  15. 根据权利要求1至14中任一项所述的方法,其特征在于,所述方法还包括:
    设置尺寸标志位,根据所述尺寸标志位记录所述待编码数据的尺寸信息。
  16. 一种数据解码方法,其特征在于,包括:
    获取待解码数据,所述待解码数据块包括多个码流数据块及各所述码流数据块的基地址;所述码流数据块的基地址为所述码流数据块在所述待解码数据中的起始存储地址;
    根据所述多个码流数据块中目标码流数据块的基地址,从所述待解码数据中确定所述目标码流数据块;
    读取所述目标码流数据块中的至少一个码流数据子块,并对所述码流数据子块进行解码,生成对应的原始数据子块;所述码流数据子块的长度小于或等于所述目标码流数据块的长度。
  17. 根据权利要求16所述的方法,其特征在于,所述目标码流数据块的数量为两个或两个以上;
    所述读取所述目标码流数据块中的至少一个码流数据子块,并对所述码流数据子块进行解码,生成对应的原始数据子块,包括:
    分别从每个所述目标码流数据块中读取至少一个目标码流数据子块;
    对读取的各所述目标码流数据子块进行并行解码,生成每个所述目标码流数据子块对应的原始数据子块。
  18. 根据权利要求16所述的方法,其特征在于,所述读取所述目标码流数据块中的至少一个码流数据子块,并对所述码流数据子块进行解码,生成对应的原始数据 子块,包括:
    从所述目标码流数据块中读取至少两个目标码流数据子块;
    对读取的各所述目标码流数据子块进行并行解码,生成每个所述目标码流数据子块对应的原始数据子块。
  19. 根据权利要求16所述的方法,其特征在于,每个所述码流数据块均包括多个码流数据子块,所述待解码数据中包括各所述码流数据子块的长度信息,所述码流数据块的基地址为所述码流数据块中第一个码流数据子块的基地址。
  20. 根据权利要求19所述的方法,其特征在于,所述读取所述目标码流数据块中的至少一个码流数据子块,包括:
    根据所述目标码流数据块的基地址和所述目标码流数据块的各码流数据子块的长度信息,从所述目标码流数据块中读取至少一个目标码流数据子块。
  21. 根据权利要求20所述的方法,其特征在于,所述根据所述目标码流数据块的基地址和所述目标码流数据块的各码流数据子块的长度信息,从所述目标码流数据块中读取至少一个目标码流数据子块,包括:
    解析所述长度信息,以得到所述目标码流数据块中位于所述目标码流数据子块之前的各码流数据子块的长度,并根据所得到的各码流数据子块的长度之和确定偏移值;
    根据所述目标码流数据块的基地址和所述偏移值读取所述目标码流数据子块。
  22. 根据权利要求16所述的方法,其特征在于,在从所述待解码数据中确定所述目标码流数据块前,所述方法还包括:
    根据所述待解码数据对应的原始数据的分块参数确定目标原始数据的编码所在的目标码流数据块;
    其中,所述原始数据包括多个原始数据块,每个所述码流数据块对应于一个所述原始数据块;
    所述分块参数包括以下至少一项:所述原始数据中各所述原始数据块的尺寸参数,所述原始数据中所述原始数据块的数量,各所述原始数据块在所述原始数据中的位置参数。
  23. 根据权利要求16所述的方法,其特征在于,在从所述待解码数据中确定所述目标码流数据块前,所述方法还包括:
    根据所述目标码流数据块在所述待解码数据的各码流数据块中的序数,确定所述目标码流数据块的基地址的编码位置;
    从所述目标码流数据块的基地址的编码位置读取预设位长的数据并进行解码,得到所述目标码流数据块的基地址。
  24. 根据权利要求16所述的方法,其特征在于,所述原始数据为原始图像。
  25. 根据权利要求24所述的方法,其特征在于,所述原始图像为卷积神经网络中的特征图像。
  26. 根据权利要求16所述的方法,其特征在于,如果所述待解码数据中存在长度为0的码流数据子块,则确定所述长度为0的码流数据子块对应的原始数据块为空值。
  27. 根据权利要求16至26中任一项所述的方法,其特征在于,所述方法还包括:
    对所述待解码数据中的尺寸标志位解码得到所述待解码数据对应的原始数据的尺寸参数;
    按照所述尺寸参数,对解码各所述码流数据块所得到的原始数据块进行排列,得到所述原始数据。
  28. 一种数据处理方法,其特征在于,应用于依次连接的配置器、存储器和处理器,所述方法包括:
    通过所述配置器执行权利要求1至15中任一项所述的数据编码方法,对预设的待编码数据进行编码,生成码流数据;
    将所生成的码流数据写入所述存储器,以降低对所述存储器的写带宽;
    通过所述配置器读取所述存储器内的至少部分码流数据,并对所读取的码流数据进行解码;
    通过所述处理器运行所解码得到的数据。
  29. 一种编码器,其特征在于,所述编码器通过执行权利要求1至15中任一项所述的数据编码方法,对待编码数据进行编码。
  30. 一种解码器,其特征在于,所述解码器通过执行权利要求16至27中任一项所述的数据解码方法,对待解码数据进行解码。
  31. 一种数据处理系统,其特征在于,包括:依次连接的配置器、存储器和处理器;
    所述配置器用于执行权利要求1至15中任一项所述的数据编码方法,对预设的待编码数据进行编码,生成码流数据,并将所生成的码流数据写入所述存储器;
    所述配置器还用于读取所述存储器内的至少部分码流数据,对所读取的码流数据进行解码,使所述处理器运行解码得到的数据,以降低对所述存储器的读带宽。
  32. 一种可移动平台,其特征在于,包括:
    机体;
    动力系统,设于所述机体,所述动力系统用于为所述可移动平台提供动力;以及,
    如权利要求31所述的数据处理系统。
  33. 一种计算机可读介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至28任一项所述的方法。
PCT/CN2020/099504 2020-06-30 2020-06-30 数据编码方法、数据解码方法、数据处理方法、编码器、解码器、系统、可移动平台与计算机可读介质 WO2022000324A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/099504 WO2022000324A1 (zh) 2020-06-30 2020-06-30 数据编码方法、数据解码方法、数据处理方法、编码器、解码器、系统、可移动平台与计算机可读介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/099504 WO2022000324A1 (zh) 2020-06-30 2020-06-30 数据编码方法、数据解码方法、数据处理方法、编码器、解码器、系统、可移动平台与计算机可读介质

Publications (1)

Publication Number Publication Date
WO2022000324A1 true WO2022000324A1 (zh) 2022-01-06

Family

ID=79317327

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/099504 WO2022000324A1 (zh) 2020-06-30 2020-06-30 数据编码方法、数据解码方法、数据处理方法、编码器、解码器、系统、可移动平台与计算机可读介质

Country Status (1)

Country Link
WO (1) WO2022000324A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118433393A (zh) * 2024-07-05 2024-08-02 Tcl华星光电技术有限公司 数据编码方法及芯片、数据解码方法及芯片以及显示装置

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1407458A (zh) * 2001-08-30 2003-04-02 华为技术有限公司 一种异步先进先出(fifo)数据缓存的方法
CN101060629A (zh) * 2007-04-27 2007-10-24 华为技术有限公司 图像压缩/解压方法及图像编/解码器和解码电路
CN101527849A (zh) * 2009-03-30 2009-09-09 清华大学 集成视频解码器的存储系统
JP2012134669A (ja) * 2010-12-20 2012-07-12 Canon Inc 画像処理装置、画像処理方法
CN103051977A (zh) * 2013-01-11 2013-04-17 乐视网信息技术(北京)股份有限公司 一种处理p2p缓存数据的方法
CN108881923A (zh) * 2018-08-13 2018-11-23 昆山动芯微电子有限公司 减少jpeg编解码行缓冲容量的方法
CN109491968A (zh) * 2018-11-13 2019-03-19 浙江鲸腾网络科技有限公司 一种文件处理方法、装置、设备及计算机可读存储介质
CN109799947A (zh) * 2017-11-16 2019-05-24 浙江宇视科技有限公司 分布式存储方法及装置
CN111190765A (zh) * 2018-11-14 2020-05-22 深圳市茁壮网络股份有限公司 一种数据备份方法及系统

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1407458A (zh) * 2001-08-30 2003-04-02 华为技术有限公司 一种异步先进先出(fifo)数据缓存的方法
CN101060629A (zh) * 2007-04-27 2007-10-24 华为技术有限公司 图像压缩/解压方法及图像编/解码器和解码电路
CN101527849A (zh) * 2009-03-30 2009-09-09 清华大学 集成视频解码器的存储系统
JP2012134669A (ja) * 2010-12-20 2012-07-12 Canon Inc 画像処理装置、画像処理方法
CN103051977A (zh) * 2013-01-11 2013-04-17 乐视网信息技术(北京)股份有限公司 一种处理p2p缓存数据的方法
CN109799947A (zh) * 2017-11-16 2019-05-24 浙江宇视科技有限公司 分布式存储方法及装置
CN108881923A (zh) * 2018-08-13 2018-11-23 昆山动芯微电子有限公司 减少jpeg编解码行缓冲容量的方法
CN109491968A (zh) * 2018-11-13 2019-03-19 浙江鲸腾网络科技有限公司 一种文件处理方法、装置、设备及计算机可读存储介质
CN111190765A (zh) * 2018-11-14 2020-05-22 深圳市茁壮网络股份有限公司 一种数据备份方法及系统

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118433393A (zh) * 2024-07-05 2024-08-02 Tcl华星光电技术有限公司 数据编码方法及芯片、数据解码方法及芯片以及显示装置

Similar Documents

Publication Publication Date Title
RU2762005C2 (ru) Способ и устройство для того, чтобы кодировать и декодировать двумерные облака точек
CN114501029B (zh) 图像编码、图像解码方法、装置、计算机设备和存储介质
WO2019127926A1 (zh) 一种稀疏神经网络的计算方法及计算装置、电子装置、计算机可读存储介质以及计算机程序产品
WO2022073160A1 (zh) 编码方法、解码方法、编码器、解码器以及存储介质
JP2020021208A (ja) ニューラルネットワーク用プロセッサ、ニューラルネットワーク用処理方法、および、プログラム
WO2022000324A1 (zh) 数据编码方法、数据解码方法、数据处理方法、编码器、解码器、系统、可移动平台与计算机可读介质
WO2023172703A1 (en) Geometry point cloud coding
CN115955571A (zh) 一种用于嵌入式设备的图像储存方法、装置及系统
WO2023205969A1 (zh) 点云几何信息的压缩、解压缩及点云视频编解码方法、装置
WO2021237870A1 (zh) 数据编码方法、数据解码方法、数据处理方法、编码器、解码器、系统、可移动平台与计算机可读介质
WO2023028177A1 (en) Attribute coding in geometry point cloud coding
WO2023272432A1 (zh) 图像处理方法和图像处理装置
CN103891272B (zh) 用于视频分析和编码的多个流处理
US11019366B2 (en) Image compression and decompression using triangulation
Du et al. Out-of-core progressive lossless compression and selective decompression of large triangle meshes
US10075716B2 (en) Parallel encoding of weight refinement in ASTC image processing encoders
WO2021120067A1 (zh) 数据编码方法、数据解码方法、数据处理方法、编码器、解码器、系统、可移动平台与计算机可读介质
WO2023173238A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
CN116894457B (zh) 深度学习模型的网络权重存取方法
CN115456858B (zh) 图像处理方法、装置、计算机设备及计算机可读存储介质
WO2023173237A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
WO2024074123A1 (en) Method, apparatus, and medium for point cloud coding
WO2023179705A1 (zh) 编码、解码方法、装置及设备
CN118830235A (zh) 几何点云编码
WO2024012381A1 (en) Method, apparatus, and medium for point cloud coding

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20943366

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20943366

Country of ref document: EP

Kind code of ref document: A1