WO2022188021A1 - 数据存储方法、数据读取方法、装置、系统及存储介质 - Google Patents

数据存储方法、数据读取方法、装置、系统及存储介质 Download PDF

Info

Publication number
WO2022188021A1
WO2022188021A1 PCT/CN2021/079685 CN2021079685W WO2022188021A1 WO 2022188021 A1 WO2022188021 A1 WO 2022188021A1 CN 2021079685 W CN2021079685 W CN 2021079685W WO 2022188021 A1 WO2022188021 A1 WO 2022188021A1
Authority
WO
WIPO (PCT)
Prior art keywords
header information
target
image
cached
image block
Prior art date
Application number
PCT/CN2021/079685
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/CN2021/079685 priority Critical patent/WO2022188021A1/zh
Publication of WO2022188021A1 publication Critical patent/WO2022188021A1/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 application relates to the technical field of data access, and in particular, to a data storage method, a data reading method, an apparatus, a system, and a storage medium.
  • the image coding algorithm divides the image into blocks, uses the correlation between the image blocks to encode and compress the image blocks, and generates a code stream corresponding to the image blocks. For each image block, a header information is usually generated after compression, and the header information can be used to record the length of the code stream corresponding to the image block or other information (such as the encoding method used by the image block). Wait).
  • the decoding end After the encoding end generates the code stream and header information corresponding to the image block, it will be stored in the external memory.
  • the decoding end needs to obtain the header information before loading the code stream of the corresponding length from the external memory, so as to ensure the accurate decoding of the image.
  • the effective management of the access process of the header information is one of the important factors to realize the image coding and decoding.
  • one of the objectives of the present application is to provide a data storage method, a data reading method, an apparatus, a system and a storage medium.
  • an embodiment of the present application provides a data storage method, including:
  • the position of the image block in the image determine the storage location of the header information of the image block in the buffer, and cache the header information to the storage location;
  • the header information of the consecutive plurality of image blocks is written into an external memory.
  • an embodiment of the present application provides a method for reading data, the method comprising:
  • the target cache line is determined from the plurality of cache lines;
  • the adjacent header information is used to be able to retrieve the target cache line from the target cache line when decoding other image blocks to be decoded read header information;
  • the target header information is read from the target cache line.
  • an embodiment of the present application provides a data storage device, including a processor and a memory;
  • the processor is used to:
  • the position of the image block in the image determine the storage position of the header information of the image block in the memory, and cache the header information to the storage position;
  • the header information of the consecutive plurality of image blocks is written into the external memory.
  • an embodiment of the present application provides a data reading device, including a processor and a memory;
  • the processor is used to:
  • the adjacent header information is used to be able to retrieve the target cache line from the target cache line when decoding other image blocks to be decoded read header information;
  • the target header information is read from the target cache line.
  • an embodiment of the present application provides an encoding device, including one or more encoders and the data storage device described in the third aspect;
  • the encoder is used for encoding image blocks in the image, generating header information sent to the data storage device and a code stream stored in an external memory.
  • an embodiment of the present application provides a decoding apparatus, including one or more decoders and the data reading apparatus described in the fourth aspect;
  • the decoder is configured to read the code stream from the external memory for decoding according to the header information read by the data reading device.
  • an embodiment of the present application provides an encoding and decoding system, including the encoding device described in the fifth aspect and the decoding device described in the sixth aspect.
  • an embodiment of the present application provides an image processing system, including one or more image processing apparatuses, the encoding/decoding system described in the seventh aspect, and a memory.
  • an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores instructions, and when the instructions are executed by a data storage device, the data storage method according to the first aspect is implemented, Or the data reading method according to the second aspect is implemented when the instruction is executed by the data reading device.
  • the data storage method provided by the embodiment of the present application realizes the effective management of the storage process of the header information. First, obtain the header information generated by the encoder after encoding the image block in the image, and then determine the storage location of the image block's header information in the buffer according to the position of the image block in the image, and cache the header information to the storage location, and finally, in the case where the header information of a plurality of consecutive image blocks has been cached in the buffer, the header information of the consecutive plurality of image blocks is stored in the buffer. Write to external memory.
  • the buffer is used to realize The storage management of the header information of the image block, that is, this embodiment realizes that the header information of the image block can be cached in the buffer in the order of the arrangement position of the image block in the image; then, in the buffer
  • the header information of the consecutive multiple image blocks is written into the external memory, and there is no need to cache all the header information of the entire image and then read it out. Further reduce the cache capacity requirement for the cache area.
  • the data reading method provided by the embodiment of the present application realizes the effective management of the reading process of the header information.
  • the target header information and its adjacent header information can be read from the external memory at one time and buffered into the buffer, so that when decoding other image blocks to be decoded subsequently, only the header needs to be read in the buffer It is only necessary to read the partial information from the external storage, which is beneficial to improve the reading efficiency and save the reading bandwidth.
  • the buffering is taken into account.
  • Each of the cache lines in the area may be cached with header information, which may be directly obtained from the cache line when decoding other images to be decoded. Selecting the target cache line can reduce the impact on the header information already cached in the cache line.
  • FIGS. 1 and 5 are schematic diagrams of numbering image blocks in a raster scan order according to an embodiment of the present application
  • FIG. 2 and FIG. 7 are schematic diagrams of an encoding sequence of an encoder when encoding an image block according to an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of an encoding device provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a data storage method provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of the storage of header information of each region in the image provided in an embodiment of the present application in a memory
  • FIG. 8 is a schematic diagram of sub-interval division of a buffer zone provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a storage unit provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of a sub-interval provided by an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of a decoding apparatus provided by an embodiment of the present application.
  • FIG. 12 is a schematic flowchart of a data reading method provided by an embodiment of the present application.
  • FIG. 13 is a schematic diagram of a sub-range and a cache line of a buffer provided by an embodiment of the present application.
  • 15 is a schematic diagram of selecting a cache line with the smallest value of the hit identifier provided by an embodiment of the present application.
  • 16 is a schematic structural diagram of an encoding and decoding system provided by an embodiment of the present application.
  • FIG. 17 , and FIG. 18 and FIG. 19 are schematic diagrams of different structures of an image processing system provided by an embodiment of the present application.
  • the decoding end After the encoding end generates the code stream and header information corresponding to the image block, it will be stored in the external memory.
  • the decoding end needs to obtain the header information first, so as to load the code stream of the corresponding length from the external memory, so as to ensure the accurate decoding of the image.
  • the effective management of the access process of the header information is one of the important factors to realize the image coding and decoding.
  • the encoding end In the encoding process, the encoding end usually transfers the header information from the internal memory (such as a buffer) to the external memory according to the frame level, that is, it needs to cache all the header information corresponding to the entire image in the internal memory before corresponding to the image frame. If all header information is stored in the external memory, the internal memory needs to have a larger cache capacity, which increases the power consumption of the encoder.
  • the internal memory such as a buffer
  • an image can be divided into multiple image blocks, assuming that one grid represents one image block, and each image block is the basic unit of compression coding in the embodiment of the present application.
  • n-bit header information will be generated, where n is an integer greater than 0.
  • each image block will generate 4-bit header information after compression and encoding.
  • the header information is used to indicate that the image block is in The length or other information (such as encoding method, etc.) of the code stream obtained after compression encoding.
  • Each image block in the image can be numbered according to the raster order from left to right and from top to bottom, and the offset of each image block in the image relative to the image block in the upper left corner of the image can be obtained.
  • the header information of the image block is usually stored in the external memory (such as DDR memory) in this number sequence, and the header information of the image block in the upper left corner of the image has a corresponding base address in the external memory.
  • the header information generated by other image blocks in the image is sequentially stored in the external memory according to the base address and the offset (offset) of the image block relative to the upper left corner of the image.
  • the general encoder can compress and encode the image blocks in turn according to the raster order shown in Figure 1, and then output the header information of the image block; however, in some encoders, different encoding protocols are used, and the The coding sequence may not be the raster sequence as shown in Figure 1, but may be the coding sequence as shown in Figure 2.
  • the Fig. 2 is an example of the coding sequence of the image blocks (or the generation sequence of the header information) in the process of coding the image blocks.
  • coding The image block 9 outputs the header information of the image block 9.
  • the FIFO buffer area first-in, first-out buffering method in the related art cannot meet the requirements of the header information buffer.
  • the embodiments of the present application provide a data storage method, which implements effective management of the storage process of header information.
  • First obtain the header information generated by the encoder after encoding the image block in the image, and then determine the storage location of the image block's header information in the buffer according to the position of the image block in the image, and cache the header information to the storage location, and finally, in the case where the header information of a plurality of consecutive image blocks has been cached in the buffer, the header information of the consecutive plurality of image blocks is stored in the buffer.
  • write to external memory First, obtain the header information generated by the encoder after encoding the image block in the image, and then determine the storage location of the image block's header information in the buffer according to the position of the image block in the image, and cache the header information to the storage location, and finally, in the case where the header information of a plurality of consecutive image blocks has been cached in the buffer, the header information of the consecutive plurality of image blocks is stored in the buffer. Write to external memory.
  • the buffer is used to realize The storage management of the header information of the image block, that is, this embodiment realizes that the header information of the image block can be cached in the buffer in the order of the arrangement position of the image block in the image; then, in the buffer
  • the header information of the consecutive multiple image blocks is written into the external memory, and there is no need to cache all the header information of the entire image and then read it out. Further reduce the cache capacity requirement for the cache area.
  • the data storage method provided in this embodiment can be applied to a data storage device, and the data storage device may be a computer chip or an integrated circuit with data processing capability, such as a central processing unit (Central Processing Unit, CPU), a digital signal processor (Digital Signal Processor, DSP), Application Specific Integrated Circuit (ASIC) or off-the-shelf Programmable Gate Array (Field-Programmable Gate Array, FPGA), etc.
  • CPU Central Processing Unit
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • the data storage device can be installed at the encoding end.
  • FIG. 3 provides a schematic diagram of an encoding apparatus 10 .
  • the encoding apparatus 10 may include one or more encoders 11 and the data storage apparatus 12 .
  • the one or more encoders 11 are used to encode the image blocks in the image, respectively, to generate a code stream and header information, and then store the code stream to the external memory 20 and transmit the header information to the
  • the data storage device 12 can be based on the data storage method provided in this embodiment, so that the header information of the image block can be cached in the buffer in the order of the arrangement position of the image block in the image, Furthermore, when the header information of a plurality of consecutive image blocks has been buffered in the buffer, the header information of the consecutive plurality of image blocks is written into the external memory 20 . Wherein, as shown in FIG.
  • the data of the code stream and the header information may be stored in the external memory 20 through the same data link; or, the code stream and the header information may also be stored in the external memory 20.
  • the data of the two channels of external information are respectively stored in the external memory 20 through two data links, which can be specifically set according to the actual application scenario, which is not limited in this embodiment.
  • the embodiment of the present application provides a data storage method, which can be executed by a data storage device, and the method includes:
  • step S101 the header information generated after the encoder encodes the image block in the image is obtained.
  • step S102 a storage location of the header information of the image block in the buffer is determined according to the location of the image block in the image, and the header information is cached at the storage location.
  • step S103 when the buffer has buffered the header information of a plurality of consecutive image blocks, write the header information of the consecutive plurality of image blocks into an external memory.
  • the number of the encoders may be one or more.
  • the image may be divided into multiple image blocks (each grid represents an image block), and the encoder compares the images in the image.
  • the data storage device may obtain header information generated after the encoder encodes the image block, and the header information is used to indicate the image block obtained by the encoder after encoding the image block.
  • the length of the code stream and/or some other information (such as encoding mode, code table, etc.), wherein and/or represent any combination of multiple types of information.
  • the data storage device After acquiring the header information generated by the encoder encoding the image block in the image, the data storage device determines that the header information of the image block is stored in the buffer according to the position of the image block in the image storage location in the area, and then cache the header information of the image block at the storage location; the storage location is adapted to the location of the image block in the image.
  • the buffer is used to cache the header information, and there is no restriction on the coding order of the image blocks (or the generation order of the corresponding header information).
  • multiple encoders are used to encode the image, the image is correspondingly divided into multiple regions, and each region includes multiple images blocks, each of said encoders is used to encode image blocks within each region.
  • the image block is divided into 4 regions correspondingly, namely region 1, region 2, region 3 and region 4; each region includes multiple Image blocks, four encoders are used to encode image blocks in four regions respectively, and the image blocks in each region are numbered according to the raster scan order (from left to right, from top to small).
  • the image block (ie, image block 1) in the upper left corner of each area in the external memory has a corresponding base address, and the header information generated by other image blocks in each area is based on the base address and relative to the upper left of the image.
  • the offsets (offsets) of the image blocks of the corners are sequentially stored in the external memory, as shown in FIG. 6 , which is a schematic diagram of the storage situation of the four regions in the external memory. Similar to the embodiments shown in FIG. 1 and FIG. 2 , as shown in FIG. 7 , in some scenarios, due to different coding protocols, the coding sequence of each encoder when coding the image blocks in each region is not the same.
  • the data storage device realizes that the header information is sequentially buffered according to the arrangement position of the image blocks in the image through the buffer.
  • the position of the image block in the image may include: an area where the image block is located and the image block location in the area.
  • the data storage device determines the image according to the area where the image block is located and the position of the image block in the area the storage location of the header information of the block in the buffer, and then cache the header information of the image block at the storage location; the storage location is the same as the area where the image block is located and the image block The position in the area is adapted.
  • the buffering of the header information in each area is implemented, and there is no restriction on the coding order of the image blocks in each area (or the generation order of the corresponding header information).
  • a sub-interval may be maintained in the buffer for each of the encoders; generated after the encoder encodes the image blocks in the image After the header information of The location in the area determines the corresponding storage location, that is, the storage location may include: a storage address in the target sub-interval corresponding to the encoder used to encode the image block, the storage address is the same as the image block where the image block is located. position adaptation in the area described above.
  • the storage location may include: a storage address in the target sub-interval corresponding to the region where the image block is located, and the storage address is adapted to the location of the image block in the region;
  • the target sub-interval is determined from a plurality of sub-intervals according to the region where the image block is located.
  • different color components of the image are usually encoded separately; in an example, such as for an image in RGB format, when the encoder encodes the image, the The R component, G component and B component of the image are encoded separately; in another example, such as for a YUV format image, the encoder usually encodes the image's luminance (Y component) and color when encoding the image. degrees (UV components) are encoded separately.
  • the data storage device may jointly determine the header of the image block according to the position of the image block in the image and the color component of the image block the storage location of the information in the buffer, and then cache the header information of the image block at the storage location; the storage location is the same as the location of the image block in the image and the image block
  • the color components are adapted together.
  • the header information of the corresponding color components is cached in the buffer according to the arrangement order of the image blocks in the image.
  • a sub-interval can be maintained in the buffer for different encoded color components, and the image blocks in the image can be obtained when the encoder is acquired.
  • the data storage device may jointly determine that the header information of the image block is stored in the image block according to the position of the image block in the image and the color component of the image block. storage location in the buffer, and then cache the header information of the image block at the storage location.
  • the data storage device may jointly determine the storage location of the header information of the image block in the buffer, and then buffer the header information of the image block to the storage location.
  • the YUV format is used as an example for description.
  • the buffer can be divided into two sub-intervals, corresponding to luminance (Y component) and chrominance (UV component respectively).
  • the storage location of the header information of the image block in the buffer includes: the storage address in the target sub-interval corresponding to the color component of the image block, and the storage address is the same as the image block in the Position adaptation in the image.
  • the data storage device determines a corresponding target interval from a plurality of sub-intervals according to the color components of the image block, and determines the corresponding target interval in the target interval.
  • the sub-interval determine the storage address suitable for the position of the image block in the image; for example, the color component of the image block is luminance (Y component), then determine the target sub-interval corresponding to the luminance (Y component) with The storage address of the image block adapted to the position in the image.
  • the color component of the image block is luminance (Y component)
  • the image is encoded by four encoders (for example, encoder 1, encoder 2, encoder 3, and encoder 4 respectively).
  • the buffer can be divided into 8 sub-intervals, each encoder corresponds to 2 sub-intervals, and the 2 sub-intervals correspond to luminance (Y component) and chrominance (UV component) respectively.
  • the storage location includes: the encoder used to encode the image block and the storage address in the target sub-interval that is jointly corresponding to the color components of the image block, the storage address and the location of the image block in the region adaptation.
  • the data storage device can store the image according to the encoder used to encode the image block (or the region where the image block is located) and the The color component of the image block is determined, a corresponding target sub-interval is jointly determined from a plurality of sub-intervals, and a storage address adapted to the position of the image block in the area is determined in the target sub-interval.
  • each of the sub-intervals may include multiple storage units, and each of the storage units can cache header information of multiple image blocks.
  • each of the storage units can cache header information of multiple image blocks.
  • the header information of the image block is 4 bits and the bit width of the storage unit is 128 bits, then one storage unit can cache the header information of 32 image blocks.
  • the number of storage units in the sub-interval can be determined according to the coding mode of the encoder, so that the buffer capacity of the sub-interval supports the following situation: the encoder can encode image blocks in a non-raster scan order. In this case, the header information generated by the encoder is cached.
  • the storage location of the header information in the buffer specifically includes: N bits in the target storage unit corresponding to the position of the block in the image; N is an integer greater than 1, and the N is determined according to the data amount of the header information of the image block; the target storage unit It is determined from a plurality of storage units included in the target sub-interval according to the position of the image block in the image.
  • the header information of the image block is 4 bits, then N is equal to 4.
  • the storage location of the header information in the buffer specifically includes: in the corresponding target sub-interval, the area where the image block is located N bits in the target storage unit corresponding to the position of .
  • the data storage device caches the header information in the target storage unit corresponding to the position of the image block in the image of N bits.
  • FIG. 9 shows an example diagram of a storage unit.
  • the header information of the image block is 4 bits
  • the bit width of the storage unit is 64 bits.
  • a grid can store 4 bits of data, suppose The header information of the image block 1 in FIG. 1 corresponds to 0-3 bits (ie, the first grid) cached in the storage unit, then according to the raster scanning sequence, the header information of the image block 10 corresponds to the buffer of the storage unit. 36 ⁇ 39bit (ie, the 10th grid).
  • the data storage device may directly write the header information of the image block into the N bits, and write the header information for the other bits in the target storage unit.
  • the preset header information is used to facilitate the subsequent reading of the data in the target storage unit, and can easily identify the valid header information and invalid header information in the target storage unit header information (that is, preset header information); if header information has been cached in the target storage unit, after the data storage device reads out the data cached in the target storage unit, according to the image block The preset header information at the N bits in the target storage unit is rewritten, and the rewritten data is then written into the target storage unit.
  • This embodiment considers that reading and writing data in the cache area is performed in units of storage units, so it is aimed at two situations in the storage unit (the case where the header information is not cached or the case where the header information has been cached) , respectively using different writing methods to write the header information into the storage unit.
  • the state of each storage unit may be identified, so that the data storage device can accurately read and write the storage unit.
  • the state of the storage unit may be marked by a first identifier, each of the storage units corresponds to a first identifier, and the first identifier is used to indicate whether a header is cached in the storage unit information
  • the data storage unit can determine whether there is header information cached in the target storage unit according to the first identifier before writing the header information into the target storage unit, and then use the corresponding writing method to write
  • the header information is written into the storage unit; for example, if the value of the first identifier is 1, it means that header information is cached in the target storage unit, and if the value of the first identifier is 0, it means that the The header information is not cached in the target storage unit, or other values or characters may also be used to represent, which is not limited in this embodiment.
  • the value of the first identifier may be
  • the data storage device may store the image
  • the header information of the block is directly written into the N bits, and the value of the first identifier is updated to indicate that the storage unit has the header information cached, for example, changing the value of the first identifier from 0 Change to 1, so that the data storage device can effectively manage the storage unit based on the first identifier; if it is determined according to the first identifier that header information has been cached in the target storage unit, such as the first identifier If the value is 0, the preset header information at the N bits in the target storage unit is rewritten according to the header information of the image block, and there is no need to update the first identifier.
  • each of the storage units may further cache quantity information, where the quantity information is used to indicate the quantity of header information that has been cached in the storage unit; After N bits in the target storage unit, the data storage device can update the quantity information in the storage unit, thereby facilitating the data storage device to effectively manage the storage unit based on the quantity information .
  • each cache unit may further correspond to a second identifier, where the second identifier is used to indicate whether the cache of the storage unit is full, the data
  • the reading device may update the value of the second identifier to indicate that the storage unit cache is full;
  • the header information of the image block is 4 bits
  • the bit width of the storage unit is 128 bits
  • the maximum number of header information that can be stored by one storage unit is 32 image blocks.
  • the second identifier can facilitate the data storage device to determine whether the header information stored in the storage unit can be written to the external memory, and the storage unit cache is full, which means that the storage unit has cached a plurality of consecutive For the header information of the image block, it can be considered to read out and write the header information of a plurality of consecutive cached image blocks into the external memory, so as to realize the recycling of the cache unit.
  • the value of the second identifier may be indicated by a register, or the value of the second identifier may also be indicated by a software code, but is not limited thereto.
  • the value of the second flag is 1, it indicates that the cache in the storage unit is full, and if the value of the second flag is 0, it indicates that the cache in the storage unit is not full.
  • other numerical values or characters may also be used to represent the value of the second identifier, which is not limited in this embodiment.
  • FIG. 10 shows a schematic diagram of one of the sub-intervals in the buffer area.
  • the sub-interval includes multiple storage units.
  • FIG. 10 takes 64 storage units as an example.
  • the bit width of the storage unit is 133 bits
  • the header information of the image block is 4 bits
  • one header information is stored every 4 bits
  • a total of 32 header information can be stored
  • the maximum 5 bits are used to store quantity information, which represents the current 128 bits. How many header information is stored in the other 128 bits are used to cache header information, where each grid represents 4 bits, and one header information can be cached.
  • Each storage unit corresponds to a first identifier and a second identifier, the first identifier is used to indicate whether header information is cached in the storage unit; the second identifier is used to indicate whether the cache of the storage unit is full ; The value of the first identification and the value of the second identification are respectively indicated by registers.
  • the data storage device may store the consecutive plurality of image blocks
  • the header information is written into the external memory; wherein, in order to further improve the storage efficiency, the total data amount of the header information of the consecutive multiple image blocks can be based on the number of lines connected to the external memory and the number of lines of the lines.
  • the bit width is determined, wherein the bit width of the line determines the amount of data that the line can transmit at one time.
  • the data storage device may External information is read from the buffer and written to external memory.
  • the data storage device is connected to the external memory through an AXI bus
  • the number of lines of the AXI bus is 4, and the bit width of the AXI bus is 128 bits
  • the total data amount of the header information of the consecutive multiple image blocks can be up to 512 bits
  • the header information of the image blocks is 4 bits, so the headers of 128 consecutive image blocks can be transmitted at a time information.
  • the total amount of header information that can be buffered by the storage unit may be based on the number of lines connected to the external memory and the The bit width of the line is determined.
  • the total data amount of the header information that can be buffered by the storage unit may be a multiple of the maximum data amount that the line can transmit at one time, and the data storage device can determine the buffer
  • the data storage device may store the header information cached in the storage unit Write to external memory.
  • each storage unit can store 32 header information, a total of 128 bits, which is the same as the one that can be transmitted by the line at one time.
  • the maximum data amount (512bit) is in a multiple relationship, then the number of the storage units for buffering the header information of the consecutive multiple image blocks is 4, and the data storage device can store the 4 storage units.
  • the header information is written to the external memory once through the AXI4 bus.
  • each of the cache units may correspond to a second identifier, where the second identifier is used to indicate whether the storage unit is full of caches, and the data reading device may update the value of the second identifier to indicate that the storage unit caches is full, so that the data storage device can quickly determine based on the value of the second identifier that the header information of the buffered consecutive image blocks can be read out and written into the external memory.
  • the header information of the consecutive multiple image blocks may be written into the external memory in sequence according to the positions of the image blocks in the image, or in other words, the headers cached by the storage unit Part information is written to the external memory in order of the positions of the image blocks in the image.
  • the header information of image blocks 1 to 16 buffered in the buffer area into the external memory first write the header information of image blocks 1 to 16 buffered in the buffer area into the external memory, and then write the header information of image blocks 17 to 32 buffered in the buffer area in sequence. into external memory.
  • the positions in the image are written sequentially, which is not limited in this embodiment.
  • each sub-interval may also correspond to writing information, and the writing information is used to indicate that the header information in the sub-interval has been written into the external memory; After the header information cached by the unit is written to the external memory, the data storage device needs to update the write information according to the number of header information cached by the storage unit, so as to facilitate locating the header that has been written to the external memory information.
  • each of the storage units corresponds to a first identifier and/or a second identifier
  • the data storage device needs to The value of the first identifier is updated to indicate that no header information is cached in the storage unit; and/or the value of the second identifier is updated to indicate that the storage unit cache is not full;
  • the quantity indicated by the quantity information corresponding to the storage unit is modified to 0, so that the storage unit can be reused and the storage unit can be effectively managed.
  • the data storage device may determine that the header is buffered according to the first identifier in each storage unit If the value of the first identifier indicates that the storage unit has buffered header information, the header information buffered in the storage unit is directly written into the external buffer. For example, in the sub-interval corresponding to each color component of each region as shown in Figure 10, after obtaining the header information of the last image block of the color component corresponding to the region and buffering it into the sub-interval, according to each The first identifier of the storage unit directly writes all cached header information into the external buffer.
  • the header information of the image block of the image is cached to the external memory.
  • the decoding end needs to decode the code stream corresponding to the image block.
  • the header information needs to be obtained from the external memory first, and then the code stream of the corresponding length can be loaded from the external memory, thereby ensuring the accurate decoding of the image block.
  • the transmission data volume of the line connected to the external memory is usually greater than the data volume of the header information of the image block
  • the AXI bus is used to read the header information from the external memory.
  • the bit width of the AXI bus is 128 bits
  • the header information of an image block has 4 bits, that is, the header information of a maximum of 32 image blocks can be read at a time.
  • the first time is to read the header information of the image block to be decoded from the external memory. For example, if there are 10 image blocks to be decoded, the total data amount of the read header information is 40 bits, which is smaller than the data that can be transmitted by the AXI bus at one time. amount, resulting in a waste of read bandwidth.
  • this embodiment provides a data reading method, which implements effective management of the reading process of header information.
  • the target cache line is determined from the multiple cache lines according to the time length from the time when each of the cache lines is last hit to the current time; then the target header information and its adjacent header information are cached to all the cache lines in the target cache line; the adjacent header information is used to read the header information from the target cache line when decoding other image blocks to be decoded; and finally read the target cache line from the target cache line header information.
  • the target header information and its adjacent header information can be read from the external memory at one time and buffered into the buffer, so that when decoding other image blocks to be decoded subsequently, only the header needs to be read in the buffer It is only necessary to read the partial information from the external storage, which is beneficial to improve the reading efficiency and save the reading bandwidth.
  • the buffering is taken into account.
  • Each of the cache lines in the area may be cached with header information, which may be directly obtained from the cache line when decoding other images to be decoded. Selecting the target cache line can reduce the impact on the header information already cached in the cache line.
  • the data reading method provided in this embodiment may be implemented by a data reading device, and the data reading device may be a computer chip or an integrated circuit with data processing capability, such as a central processing unit (Central Processing Unit, CPU), a digital Signal processor (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC) or off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA), etc.
  • CPU Central Processing Unit
  • DSP digital Signal processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • the data reading device can be installed at the decoding end.
  • FIG. 11 provides a schematic structural diagram of a decoding apparatus 30 .
  • the decoding apparatus 30 includes one or more decoders 31 and the data reading apparatus 32 .
  • the data reading device 32 may, based on the data reading method provided in this embodiment, read the target header information of the image block to be decoded and its target header information from the external memory 20 according to the position of the image block to be decoded in the image.
  • the decoder 31 is configured to read the code stream of the image block to be decoded from the external memory 20 according to the target header information (for example, according to the code stream length indicated by the header information, from The code stream of the corresponding length is read in the external memory 20, and the code stream of the image block to be decoded is decoded to obtain the decoded image block; and, the data reading device 32 is reading the target header information.
  • the header information adjacent to the target header information is used when the decoder 31 needs to decode other to-be-decoded
  • the data reading device 32 can directly read from the buffer without reading from external storage, so that there is no need to read from the external storage. It is beneficial to improve the reading efficiency and save the reading bandwidth.
  • the data of the code stream and the header information can be read from the external memory 20 through the same data link;
  • the two pieces of data of the header information are read from the external memory 20 through two data links respectively, and can be specifically set according to the actual application scenario, which is not limited in this embodiment.
  • the embodiment of the present application also provides a data reading method, the method can be executed by a data reading device, and the method includes :
  • step S201 according to the position of the image block to be decoded in the image, the target header information of the image block to be decoded and its adjacent header information are read from the external memory.
  • step S201 for the multiple cache lines included in the buffer, the target cache line is determined from the multiple cache lines according to the duration from the time when each of the cache lines is hit last to the current time.
  • step S203 the target header information and its adjacent header information are cached in the target cache line; the adjacent header information is used to be able to retrieve data from all the image blocks to be decoded when decoding other image blocks to be decoded. Read the header information from the target cache line described above.
  • step S204 the target header information is read from the target cache line.
  • the data reading device can receive a decoding instruction sent by an external device, and the decoding instruction indicates the position of the image block to be decoded in the image.
  • the data reading The fetching device may first determine whether header information is cached in the buffer, and if no header information is cached, read the target header of the image block to be decoded from the external memory according to the position of the image block to be decoded in the image If there is header information in the cache, then further determine whether there is target header information in the stored header information according to the position of the image block to be decoded in the image.
  • target header information read the target header information of the to-be-decoded image block and its adjacent header information from the external memory according to the position of the to-be-decoded image block in the image; if there is the target header information, the target header information can be directly read from the buffer.
  • the buffer may be divided into multiple cache lines, each cache line includes multiple storage units, and each storage unit can cache multiple header information, and the data reading device may use
  • the cache behavior unit determines whether each cache line in the buffer has header information cached, and if there is a cache line with header information cached, scans the cache line with header information cached to determine whether The target header information of the image block to be decoded is cached.
  • each cache line corresponds to an occupancy flag
  • the occupancy flag is used to indicate whether header information is cached in the cache line
  • the data reading device may scan each cache line by scanning
  • the occupancy identifier of the cache line is used to determine whether header information is cached in the cache line.
  • the occupancy identifier is used to effectively manage the cache line.
  • the value of the occupation flag is 1, indicating that header information is cached in the cache line; the value of the occupation flag is 0, indicating that no header information is cached in the cache line.
  • the value of the occupation identifier may be indicated by a register, or indicated by a software code, but is not limited thereto.
  • each of the cache lines may correspond to an offset identifier, and the offset identifier is used to indicate a storage location in the external memory of the header information cached in the cache line;
  • the data reading device determines that there is a cache line with header information cached in the buffer, considering that the storage location of the header information cached in the cache line in the external memory is also based on the image
  • the blocks are stored sequentially in the image, so the offset identifier of the cache line with the header information can be scanned according to the position of the image block to be decoded in the image, so as to determine whether the cache line with the header information is cached.
  • the target header information of the image block to be decoded is cached, and in this embodiment, the offset identifier is used to quickly determine whether the target header information is cached in the cache line.
  • the value of the offset identifier may be indicated by a register, or indicated by a software code, but is not limited thereto.
  • the data The reading device may read the target header information of the to-be-decoded image block and its adjacent header information from the external memory according to the position of the to-be-decoded image block in the image, and convert the to-be-decoded image
  • the target header information of the block and its adjacent header information are cached in cache lines in the buffer.
  • the purpose of reading the header information adjacent to the target header information is to facilitate the subsequent decoding of other image blocks to be decoded, and only need to read the header information in the buffer, and no need to read from external storage. , which is beneficial to improve the reading efficiency and save the reading bandwidth.
  • the total data amount of the target header information and its adjacent header information may be determined according to the number of lines connected to the external memory and the bit width of the lines.
  • the number of lines of the AXI bus is 4 and the bit width is 128 bits
  • the header information of the image block is 4 bits
  • the total data amount of the target header information and its adjacent header information that can be read at one time is 512 bits
  • 128 header information can be read at one time.
  • the storage capacity of the cache line can be set to the target header information and its adjacent headers read from the external memory at one time
  • the total data volume of the information matches, for example, the storage capacity of the cache line is equal to the total data volume of the target header information and its adjacent header information, so as to better manage the header information.
  • the storage capacity of the cache line may also be smaller or larger than the total data amount of the target header information and its adjacent header information, which is not limited in this embodiment.
  • the header information of the image blocks in the image is stored in the external storage according to the image blocks in the image.
  • the arrangement positions are stored in order; in the case of encoding by multiple encoders, the image is correspondingly divided into multiple regions, each region includes multiple image blocks, and each encoder is used for the image in each region.
  • the block is encoded, and the header information of the image blocks in each area is stored in the external storage in the order of the arrangement positions of the image blocks in the area.
  • the header information of the image blocks in each area is stored in the external memory according to the area in the image, therefore, during the decoding process, the header information can be stored in the buffer.
  • Corresponding sub-intervals are maintained for each region in the image (or each encoder used in encoding the image), and each sub-interval is used to cache the header information in each region read from the external memory .
  • the position of the image block to be decoded in the image includes: the area where the image block to be decoded is located and the position in the area.
  • the data reading device may determine a target sub-interval from a plurality of sub-intervals according to the area where the image block to be decoded is located, and determine the target sub-interval according to the position of the image block to be decoded in the area Whether the target header information of the to-be-decoded image block is cached in .
  • the sub-interval includes multiple cache lines, each cache line includes multiple storage units, and each storage unit can cache multiple header information
  • the data reading device may Determine whether each cache line in the target sub-interval is cached with header information in the cache behavior unit, and if there is a cache line with header information cached, scan the cache line with header information cached to Determine whether the target header information of the image block to be decoded is cached; no header information is cached in all cache lines in the target sub-interval, or cache lines with header information are cached in the target sub-interval
  • the target header information is not cached in the external memory, and the target header information of the to-be-decoded image block and its adjacent header information are read from the external memory.
  • the different color components of the image are usually encoded separately during the encoding process; for example, for the image in YUV format, when the encoder encodes the image, the brightness ( Y component) and chrominance (UV component) are encoded separately; considering that the header information corresponding to each color component of the image is stored in the external memory, therefore, for different color components of the image, the buffer can be stored in the buffer The corresponding sub-range is maintained in .
  • corresponding sub-intervals may be maintained in the buffer for different color components of the image, each sub-interval being used to buffer each of the images read from the external memory
  • the header information corresponding to the color component, the sub-interval includes multiple cache lines, each cache line includes multiple storage units, and each storage unit can cache multiple header information; in an example, YUV Taking the format as an example to illustrate, the buffer can be divided into two sub-intervals, corresponding to luminance (Y component) and chrominance (UV component) respectively.
  • the data reading device can receive a decoding instruction sent by an external device, and the decoding instruction can indicate the position of the image block to be decoded in the image and the color components of the image block to be decoded, and then the data reading device can be decoded according to the image block.
  • the color component of the block determines the target sub-interval from a plurality of sub-intervals, and the multiple sub-intervals correspond to different color components, and then determines whether there is a cache line with header information cached in the target sub-interval, and if there is a cache with header information.
  • the cache line of the partial information further determine whether the target header information of the image block to be decoded is cached in the cache line with the header information cached; all cache lines in the target sub-interval are not cached with The header information, or the target header information is not buffered in the cache line in which the header information is buffered in the buffer, and the data reading device reads the target header of the image block to be decoded from the external memory header information and its adjacent header information.
  • each sub-interval is used to cache the header information corresponding to each color component of each area read from the external memory, each of the sub-intervals includes multiple cache lines, and each cache line includes multiple cache lines.
  • Each storage unit can cache multiple header information.
  • the YUV format is used as an example for description.
  • the image is correspondingly divided into four regions, and the header in the four regions is divided into four regions.
  • the information is stored in the external memory according to the regions, and the buffer is divided into sub-intervals based on each color component of each region, then 8 sub-intervals can be divided in the buffer zone, and each region corresponds to 2 sub-intervals.
  • the two sub-intervals correspond to luminance (Y component) and chrominance (UV component) respectively.
  • each of the sub-intervals includes 8 cache lines (may also be other numbers of cache lines.
  • each of the cache lines also corresponds to an occupation identifier and an offset identifier, the occupation identifier is used to indicate whether header information is cached in the cache line, and the offset identifier is used to indicate that the cache line The storage location of the cached header information in the external memory.
  • the values of the occupancy flag and the offset flag can be indicated by registers respectively; for example, the value of the occupancy flag is 1, indicating that the cache line has header information cached, and the value of the occupancy flag is 0, indicating that the cache line is not cached. header information.
  • the data reading device may receive a decoding instruction sent by an external device, and the decoding instruction may indicate the position of the image block to be decoded in the image and the color components of the image block to be decoded , the position of the image block to be decoded in the image includes: the area where the image block to be decoded is located and the position in the area.
  • the data reading device may jointly determine a target sub-interval from a plurality of sub-intervals according to the region where the image block to be decoded is located and the color components of the image block to be decoded, and the plurality of sub-intervals correspond to the respective color components of each region, Then, in the target sub-interval, it is determined whether there is a cache line with header information cached, and if there is a cache line with header information cached, it is determined whether there is a target header information cached for the image block to be decoded , no header information is cached in all cache lines in the target sub-interval, or the target header information is not cached in the cache lines with header information cached in the buffer, read from the external memory Get the target header information of the image block to be decoded and its adjacent header information.
  • the data reading device needs to determine the to-be-decoded image block The cache location of the target header information and its adjacent header information in the buffer.
  • the data reading device can read the data from multiple cache lines according to the time duration from the time when each of the cache lines in the target sub-interval was last hit to the current time. Determine the target cache line in The header information is cached into the target cache line, so as to reduce the impact on the cache line with the header information cached as much as possible, and then the data reading device reads the target header information from the target cache line.
  • the target header information is used to trigger the decoder to read the code stream corresponding to the image block to be decoded from the external memory according to the target header information.
  • each cache line corresponds to an occupation identifier and/or an offset identifier
  • the occupation identifier is used to indicate whether header information is cached in the cache line
  • the offset identifier is used to indicate the The storage location of the header information cached in the cache line in the external memory; after caching the target header information and its adjacent header information in the target cache line, the data reading device
  • the value of the occupation identifier of the target cache line may be updated to indicate that header information is cached in the target cache line, and/or according to the target header information of the image block to be decoded and its adjacent headers
  • the value of the offset identifier of the target cache line is updated at the storage location of the part information in the external memory, so as to better identify the state of the cache line, and facilitate the data reading device to perform a valid operation on the cache line. manage.
  • the data reading apparatus may cache the target header
  • the cache line of the part information is determined as the target cache line, and then the target header information is directly read from the target cache line, and the target header information is used to trigger the decoder from the external cache line according to the target header information.
  • the code stream corresponding to the image block to be decoded is read from the memory.
  • each of the cache lines also corresponds to a hit identifier, and the hit identifier is used to indicate whether the cache line has been hit recently; then After reading the target header information from the target cache line, the data reading apparatus needs to update the hit identifiers corresponding to all the cache lines in the buffer that have the header information cached.
  • the value of the hit identifier may be indicated by a register, or the value of the hit identifier may also be indicated by a software code, which is not limited in this embodiment.
  • the value of the hit identifier is negatively correlated with the duration from the time when the cache line is last hit to the current time, that is, from the time when the cache line is last hit to the current time.
  • the data reading device may modify the value of the hit identifiers corresponding to the target cache line to a preset maximum value.
  • the preset maximum value is 7
  • the default minimum value is 0,
  • the preset value is 1.
  • the target The value of the hit identifier corresponding to the cache line is modified to 7, and then the values of the hit identifiers corresponding to other cache lines cached with header information are all subtracted by 1.
  • the data reading device is based on the latest hit of each cache line.
  • the target cache line can be determined according to the value of the hit identifier, for example, the value of the hit identifier among the multiple cache lines is the smallest. A determined cache line for the target.
  • the value of the hit identifier may have a positive correlation with the duration from the time when the cache line was last hit to the current time, that is, from the time when the cache line was last hit to the current time. The shorter the time duration is, the smaller the value of the hit flag is, and vice versa, the longer the time duration from the time when the cache line is last hit to the current time is, the larger the value of the hit flag is. Then in the process of updating the hit identifiers corresponding to all cache lines with header information cached in the buffer, the data reading device may modify the value of the hit identifiers corresponding to the target cache line to a preset minimum value.
  • the data reading device may determine the target cache line according to the value of the hit identifier For the target cache line, for example, the one with the largest value of the hit identifier among the plurality of cache lines may be determined as the target cache line.
  • the data reading device can receive A decoding instruction sent by an external device, the decoding instruction can indicate the position of the image block to be decoded in the image and the color component of the image block to be decoded, and the position of the image block to be decoded in the image includes: the image block to be decoded. area and location within that area.
  • the buffer includes sub-intervals corresponding to each color component of each region. Each sub-interval includes a plurality of cache lines, each cache line corresponds to a hit flag, and the value of the hit flag has a negative correlation with the duration from the time when the cache line was last hit to the current time.
  • the data reading device may jointly determine a target sub-interval from multiple sub-intervals according to the region where the image block to be decoded is located and the color components of the image block to be decoded.
  • step S302 it is determined whether there is a cache line with header information cached in the target sub-interval.
  • step S303 for example, as shown in Figure 15, the data reading device determines the cache line with the smallest hit identifier as the target cache line;
  • step S304 according to the position of the image block to be decoded in the image and the color component of the image block to be decoded, read the target header information of the image block to be decoded and its adjacent header information from the external memory;
  • step S305 cache the target header information of the image block to be decoded and its adjacent header information in the target cache line, update the occupancy identifier and offset identifier of the target cache line, and update all caches The hit identifier of the cache line with header information;
  • step S306 the target header information is read from the target cache line.
  • step S307 determines whether there is a target cache line that caches the target header information of the image block to be decoded, if not, go to steps S303 to S306; In S308, the hit identifiers of all cache lines with header information cached are updated.
  • the embodiments of the present application also provide a data storage device, including a processor and a memory;
  • the processor is used to:
  • the position of the image block in the image determine the storage position of the header information of the image block in the memory, and cache the header information to the storage position;
  • the memory has cached the header information of a plurality of consecutive image blocks, writing the header information of the consecutive plurality of image blocks into an external memory;
  • the memory is used for buffering the header information of the image block.
  • the storage location of the header information of the image block in the memory is jointly determined according to the location of the image block in the image and the color component of the image block.
  • the memory includes subintervals corresponding to each color component of the image
  • the storage location includes: a storage address in the target sub-interval corresponding to the color component of the image block.
  • the image when there are multiple encoders, the image is correspondingly divided into multiple regions, each region includes multiple image blocks, and each of the encoders is used for each region.
  • the image blocks within are encoded.
  • the position of the image block in the image includes: an area where the image block is located and a position of the image block in the area.
  • the memory includes a sub-interval corresponding to each of the encoders
  • the storage location includes: a storage address in a target sub-interval corresponding to an encoder used to encode the image block.
  • the memory includes subintervals corresponding to each of the encoders and each color component of the image
  • the storage location includes: an encoder for encoding the image block and a storage address in a target sub-interval corresponding to the color components of the image block.
  • each of the sub-intervals includes a plurality of storage units, and each of the storage units can cache header information of a plurality of image blocks;
  • the storage location specifically includes: in the target sub-interval, N bits in the target storage unit corresponding to the position of the image block in the image; N is an integer greater than 1, and the N It is determined according to the data amount of the header information of the image block.
  • the processor is further configured to: buffer the header information to N bits in the target storage unit.
  • the processor is specifically configured to:
  • the preset header information at the N bits in the target storage unit is rewritten according to the header information of the image block.
  • each of the storage units further caches quantity information, and the quantity information is used to indicate the quantity of the cached header information in the storage unit;
  • the processor is further configured to update the quantity information in the target storage unit after buffering the header information to N bits in the target storage unit.
  • each of the cache units corresponds to a first identifier, and the first identifier is used to indicate whether header information is cached in the storage unit;
  • the processor is further configured to: determine whether header information is cached in the target storage unit according to the first identifier of the target storage unit.
  • the processor is further configured to: after the header information of the image block is written into the N bits after the header information of the image block is not cached in the target storage unit , and update the value of the first identifier to indicate that header information is cached in the target storage unit.
  • the total data amount of the header information of the consecutive multiple image blocks is determined according to the number of lines connected to the external memory and the bit width of the lines.
  • the header information of the consecutive multiple image blocks is written into the external memory in sequence according to the positions of the image blocks in the image.
  • the processor is specifically configured to: in the case where it is determined that the storage unit cache used for buffering the header information of the consecutive multiple image blocks in the memory is full, store the storage unit The cached header information is written to external memory.
  • each sub-interval corresponds to writing information, and the writing information is used to indicate the header information that has been written in the external memory in the sub-interval;
  • the processor is further configured to: after the header information cached by the storage unit is written into the external memory, update the write information according to the number of header information cached by the storage unit.
  • each of the storage units corresponds to a first identification and/or a second identification
  • the first identifier is used to indicate whether header information is cached in the storage unit; the second identifier is used to indicate whether the storage unit is cached full;
  • the processor is further configured to: after the header information cached by the storage unit is written into the external memory, update the value of the first identifier to indicate that no header information is cached in the storage unit ; and/or, updating the value of the second identifier to indicate that the storage unit cache is not full.
  • each of the storage units further caches quantity information, and the quantity information is used to indicate the quantity of the cached header information in the storage unit;
  • the processor is further configured to: in the case that each of the storage units corresponds to the second identifier, in the case that the quantity indicated by the quantity information is the maximum quantity that the storage unit can store, The value of the second identifier is updated to indicate that the storage unit cache is full.
  • the value of the first identifier and/or the value of the second identifier is indicated by a register.
  • the embodiments of the present application also provide a data reading device, including a processor and a memory;
  • the processor is configured to: read the target header information of the image block to be decoded and its adjacent header information from the external memory according to the position of the image block to be decoded in the image; For multiple cache lines, the target cache line is determined from the multiple cache lines according to the time length from the time when each of the cache lines was last hit to the current time; the target header information and its adjacent header information are cached into the target cache line; the adjacent header information is used to be able to read header information from the target cache line when decoding other image blocks to be decoded; read the header information from the target cache line target header information;
  • the memory includes a plurality of cache lines for caching header information.
  • the target cache line is the one with the longest duration from the time when the last hit to the current time among the plurality of cache lines.
  • the total data amount of the target header information and its adjacent header information is determined according to the number of lines connected to the external memory and the bit width of the lines.
  • the processor is further configured to:
  • the target header information is read from the external memory. Decode the target header information of the image block and its adjacent header information.
  • the processor is further configured to: if the target header information is cached in the cache line in which the header information is cached in the memory, determine the cache line in which the target header information is cached. cache line for the target.
  • each described cache line corresponds to a hit mark, and the hit mark is used to indicate whether the cache line is hit recently;
  • the processor is further configured to: after the target header information is read from the target cache line, update the hit identifiers corresponding to all cache lines in the memory that have the header information cached.
  • the value of the hit identifier is negatively correlated with the time period from the time when the cache line was last hit to the current time.
  • the processor is specifically configured to: modify the value of the hit identifier corresponding to the target cache line to a preset maximum value, and change the value of the hit identifier corresponding to other cache lines with header information cached. Subtract the preset value.
  • the processor is further configured to: determine the one with the smallest value of the hit identifier among the plurality of cache lines as the target cache line.
  • the value of the hit identifier is indicated by a register.
  • each of the cache lines corresponds to an occupation identifier, and the occupation identifier is used to indicate whether header information is cached in the cache line;
  • the processor is further configured to: after the target header information and its adjacent header information are cached in the target cache line, update the value of the occupancy identifier of the target cache line To indicate that header information is cached in the target cache line.
  • the value of the occupancy flag is indicated by a register.
  • each of the cache lines corresponds to an offset identifier, and the offset identifier is used to indicate a storage location in the external memory of the header information cached in the cache line;
  • the processor is further configured to: after the target header information and its adjacent header information are cached in the target cache line, according to the target header information of the image block to be decoded and its adjacent header information.
  • the value of the offset identifier of the target cache line is updated according to the storage location of the adjacent header information in the external memory.
  • the value of the offset identifier is indicated by a register.
  • the target header information is used to trigger the decoder to read the code stream corresponding to the image block to be decoded from the external memory according to the target header information.
  • the image is encoded by multiple encoders, the image is correspondingly divided into multiple regions;
  • the position of the image block to be decoded in the image includes: an area where the image block to be decoded is located and a position in the area.
  • the memory includes: a subinterval corresponding to each region of the image;
  • Each of the sub-intervals includes a plurality of cache lines
  • the processor is further configured to: determine a target subinterval from a plurality of subintervals according to the region where the image block to be decoded is located; and determine a target cache line from a plurality of cache lines included in the target subinterval.
  • the memory specifically includes: a subinterval corresponding to the area where the image is located and each color component of the image;
  • the target sub-interval is jointly determined according to the region where the image block to be decoded is located and the color component of the image block to be decoded.
  • an embodiment of the present application further provides an encoding apparatus 10 , including one or more encoders 11 and the above-mentioned data storage apparatus 12 .
  • the encoder 11 is used for encoding image blocks in the image, generating header information sent to the data storage device 12 and a code stream stored in the external memory 20 .
  • an embodiment of the present application further provides a decoding device 30, including one or more decoders 31 and the above-mentioned data reading device 32;
  • the decoder 31 is configured to read the code stream from the external memory 20 for decoding according to the header information read by the data reading device 32 .
  • an embodiment of the present application further provides an encoding and decoding system, where the encoding and decoding system includes the encoding apparatus 10 described in FIG. 3 and the decoding apparatus 30 described in FIG. 11 .
  • the encoding apparatus 10 and the decoding apparatus 30 may be installed on the same device, or may be installed on different devices, and specific settings may be made according to actual application scenarios, which are not limited in this embodiment.
  • an embodiment of the present application further provides an image processing system, including one or more image processing apparatuses, the above-mentioned encoding and decoding system, and a memory.
  • FIG. 17 is described by taking as an example that the encoding apparatus and the decoding apparatus can be installed on the same device: FIG. 17 provides an image processing system, and the image processing system includes an image processing system.
  • the processing device 40 the encoding device 10 , the decoding device 30 and the memory 20 .
  • the image processing device is mainly responsible for processing image and video data. When processing data, the image data needs to be accessed, and the required access bandwidth is often very large, which affects the work efficiency of other devices in the electronic equipment. Since image data has strong spatial and temporal local correlation, if a compression algorithm is used to compress it, it often has a relatively high compression rate.
  • an encoding device 10 can be installed at the outlet of the image processing device 40, and
  • the decoding device 30 can be installed at the entrance of the image processing device 40, which can reduce the bandwidth occupation of the electronic device by the image processing device, improve the overall work efficiency of the electronic device, and reduce the overall power consumption of the electronic device.
  • the image processing apparatus 40 outputs the image or video frame to the encoding apparatus 10 after processing the image or video frame.
  • the encoding device 10 may use a block compression algorithm, firstly, the image or video frame output by the image processing device 40 is divided into blocks, and then the image block is subjected to DPCM (Differential Pulse Code Modulation) by the encoder 11 in the encoding device 10.
  • DPCM Different Pulse Code Modulation
  • each image block generates a header information after encoding (such as used to identify the length of the code stream), the data storage device 12 in the encoding device 10 stores and manages the header information of the image block; further, the encoding device 10 stores the generated code stream and the header information in the memory 20.
  • the decoding device 30 When the image processing device 40 needs to use an image, the decoding device 30 first obtains the header information corresponding to the image block to be decoded from the memory 20, determines the length information of the compressed code stream, and then loads the compressed code stream from the memory 20 to perform A decoding operation is performed, and the decoded image or video frame is transmitted to the image processing device 40 .
  • the image processing device 40 may be an image signal processor (ISP) or the like, but is not limited thereto.
  • the memory 20 may be a DDR memory, a static random access memory (SRAM), etc., but is not limited thereto.
  • the image processing device 40 , the encoding device 10 and the decoding device 30 may be integrated in a chip, such as an SOC chip, but not limited thereto.
  • FIG. 18 takes the example that the encoding apparatus and the decoding apparatus can be installed on the same device for illustration:
  • FIG. 18 provides an image processing system, the image The processing system includes a first image processing device 41 , a second image processing device 42 , an encoding device 10 , a decoding device 30 and a memory 20 .
  • the first image processing device 41 transmits the image or video frame to the encoding device 10; the encoding device 10 is configured to encode image blocks in the image or video frame, Generate the code stream and header information, and store them in the memory 20; in the case that the second image processing device 42 needs to process the image or video frame again, the decoding device 30 reads from the memory 20.
  • the header information is taken, and the code stream is read from the memory 20 based on the header information, and after decoding the code stream, an image or video frame is obtained and transmitted to the second image processing device 42 .
  • the first image processing device may be an image signal processor (ISP)
  • the second image processing device may be an object recognition device (eg, face recognition using images, etc.), but not limited thereto.
  • FIG. 19 takes the encoding apparatus 10 and the decoding apparatus 30 installed in different devices as an example for description:
  • FIG. 19 shows an image processing system, the image processing The system includes a first device 100 and a second device 200.
  • the first device 100 includes a first image processing apparatus 41, an encoding apparatus 10, a first memory 21, and a first communication apparatus 51;
  • the second The device 200 includes a second image processing device 42 , a decoding device 30 , a second memory 22 and a second communication device 52 .
  • the first image processing device 41 of the first device 100 transmits the image or video frame to the encoding device 10; the encoding device 10 is used to process the image or video frame.
  • the image blocks are encoded to generate a code stream and header information, and are stored in the first memory 21 of the first device 100 ; the first communication device 51 of the first device 100 can read the code stream from the first memory 21 and header information and send it to the second communication device 52 of the second device 200 .
  • the second communication device 52 of the second device 200 may store the received code stream and header information in the second memory 22 of the second device 200.
  • the header information can be read from the second memory 22 of the second device 200 through the decoding device 30, and the code stream can be read from the second memory 22 based on the header information. After decoding, an image or video frame is obtained and transmitted to the second image processing device 42 .
  • the first device 100 may be a movable platform, such as an unmanned aerial vehicle, an unmanned vehicle, or a mobile robot; the second device 200 may be a terminal device communicatively connected to the movable platform, such as a mobile phone, a remote control equipment, etc., but not limited to this.
  • non-transitory computer-readable storage medium such as a memory including instructions, executable by a processor of an apparatus to perform the above-described method.
  • the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
  • a non-transitory computer-readable storage medium when instructions in the storage medium are executed by a processor of an apparatus, enable a terminal to perform the above method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

一种数据存储方法、数据读取方法、装置、系统及存储介质,所述数据存储方法实现对头部信息的有效存储,根据图像块在所述图像中的位置,将所述图像块的头部信息缓存至缓冲区中;在所述缓冲区已缓存连续的多个图像块的头部信息的情况下,将所述连续的多个图像块的头部信息写入外部存储器。所述数据读取方法实现对头部信息的有效读取,根据待解码图像块在图像中的位置,从外部存储器中读取所述待解码图像块的目标头部信息及其相邻的头部信息,并缓存至缓冲区中,然后从所述目标缓存行读出所述目标头部信息;所述相邻的头部信息用于在解码其他待解码图像块时使用。本实施例实现提高头部信息的存取效率。

Description

数据存储方法、数据读取方法、装置、系统及存储介质 技术领域
本申请涉及数据存取技术领域,具体而言,涉及一种数据存储方法、数据读取方法、装置、系统及存储介质。
背景技术
为了节省带宽,图像编码与解码在存储或者传输场景中逐渐普及。图像编码算法通过将图像进行分块,利用图像块之间的相关性对图像块进行编码压缩,产生图像块对应的码流。对于每个图像块在压缩之后通常会产生一个头部(header)信息,该头部信息可以用来记录图像块对应的码流的长度或者其他的信息(诸如所述图像块所使用的编码方式等)。
编码端在产生图像块对应的码流及头部信息之后,会将其存储至外部存储器。解码端在对码流进行解码时需要先获取头部信息,才能从外部存储器中加载相应长度的码流,从而确保图像的准确解码。其中,有效管理头部信息的存取过程是实现图像编解码的重要因素之一。
发明内容
有鉴于此,本申请的目的之一是提供一种数据存储方法、数据读取方法、装置、系统及存储介质。
第一方面,本申请实施例提供了一种数据存储方法,包括:
获取编码器对图像中的图像块进行编码后产生的头部信息;
根据所述图像块在所述图像中的位置,确定所述图像块的头部信息在缓冲区中的存储位置,并将所述头部信息缓存至所述存储位置处;
在所述缓冲区已缓存连续的多个图像块的头部信息的情况下,将所述连续的多个图像块的头部信息写入外部存储器。
第二方面,本申请实施例提供了一种数据读取方法,所述方法包括:
根据待解码图像块在图像中的位置,从外部存储器中读取所述待解码图像块的目标头部信息及其相邻的头部信息;
对于缓冲区所包括的多个缓存行,根据各个所述缓存行最近一次被命中的时刻到当前时刻的时长,从多个缓存行中确定目标缓存行;
将所述目标头部信息及其相邻的头部信息缓存至所述目标缓存行中;所述相邻的头部信息用于在解码其他待解码图像块时能够从所述目标缓存行中读取头部信息;
从所述目标缓存行读出所述目标头部信息。
第三方面,本申请实施例提供了一种数据存储装置,包括处理器和存储器;
所述处理器用于:
获取编码器对图像中的图像块进行编码后产生的头部信息;
根据所述图像块在所述图像中的位置,确定所述图像块的头部信息在所述存储器中的存储位置,并将所述头部信息缓存至所述存储位置处;
在所述存储器已缓存连续的多个图像块的头部信息的情况下,将所述连续的多个图像块的头部信息写入外部存储器。
第四方面,本申请实施例提供了一种数据读取装置,包括处理器和存储器;
所述处理器用于:
根据待解码图像块在图像中的位置,从外部存储器中读取所述待解码图像块的目标头部信息及其相邻的头部信息;
对于所述存储器所包括的多个缓存行,根据各个所述缓存行最近一次被命中的时刻到当前时刻的时长,从多个缓存行中确定目标缓存行;
将所述目标头部信息及其相邻的头部信息缓存至所述目标缓存行中;所述相邻的头部信息用于在解码其他待解码图像块时能够从所述目标缓存行中读取头部信息;
从所述目标缓存行读出所述目标头部信息。
第五方面,本申请实施例提供了一种编码装置,包括一个或多个编码器以及第三方面所述的数据存储装置;
所述编码器用于对图像中的图像块进行编码,产生发送给所述数据存储装置的头部信息以及存储至外部存储器的码流。
第六方面,本申请实施例提供了一种解码装置,包括一个或多个解码器以及第四方面所述的数据读取装置;
所述解码器用于根据所述数据读取装置读取的头部信息,从外部存储器读取码流进行解码。
第七方面,本申请实施例提供了一种编解码系统,包括第五方面所述的编码装置以及第六方面所述的解码装置。
第八方面,本申请实施例提供了一种图像处理系统,包括一个或多个图像处理装置、第七方面所述的编解码系统以及存储器。
第九方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有指令,所述指令被数据存储装置执行时实现如第一方面所述的数据存储方法,或者所述指令被数据读取装置执行时实现如第二方面所述的数据读取方法。
本申请实施例所提供的一种数据存储方法,实现对头部信息的存储过程进行有效管理。首先获取编码器对图像中的图像块进行编码后产生的头部信息,然后根据所述图像块在所述图像中的位置,确定所述图像块的头部信息在缓冲区中的存储位置,并将所述头部信息缓存至所述存储位置处,最后在所述缓冲区已缓存连续的多个图像块的头部信息的情况下,将所述连续的多个图像块的头部信息写入外部存储器。本实施例对于图像块的编码顺序(或者说头部信息的产生顺序)没有约束,即前后两次获取头部信息时,对应的两个图像块可以不相邻,进而通过所述缓冲区实现对图像块的头部信息的存储管理,即本实施例实现所述图像块的头部信息可以在所述缓冲区中按照图像块在图像中的排列位置顺序缓存;接着,在所述缓冲区中已缓存连续的多个图像块的头部信息的情况下,将所述连续的多个图像块的头部信息写入外部存储器,无需在缓存整个图像的所有头部信息之后再读出,进一步降低对缓存区的缓存容量需求。
本申请实施例所提供的一种数据读取方法,实现对头部信息的读取过程进行有效管理。首先,根据待解码图像块在图像中的位置,从外部存储器中读取所述待解码图像块的目标头部信息及其相邻的头部信息;以及对于缓冲区所包括的多个缓存行,根据各个所述缓存行最近一次被命中的时刻到当前时刻的时长,从多个缓存行中确定目标缓存行;然后将所述目标头部信息及其相邻的头部信息缓存至所述目标缓存行中;所述相邻的头部信息用于在解码其他待解码图像块时能够从所述目标缓存行中读取头部信息;最后从所述目标缓存行读出所述目标头部信息。本实施例中,能够将目标头部信息及其相邻的头部信息从外部存储器中一次读取出来缓存到缓冲区中,从而后续解码其他待解码图像块时只需要在缓冲区读取头部信息即可,无需再从外部存储读取,有利于提高读取效率以及节省读取带宽,并且本实施例在缓存目标头部信息及其相邻的头部信息的过程中,考虑到缓冲区中的各个所述缓存行可能缓存有头部信息,可能在解码其他待解码图像的时候可以直接从缓存行获取,因此根据各个所述缓存行最近一次被命中的时刻到当前时刻的时长来选择目标缓存行,可以降低对已缓存在缓存行中的头部信息的影响。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1以及图5是本申请一个实施例提供的图像块按光栅扫描顺序编号的示意图;
图2以及图7是本申请一个实施例提供的编码器在编码图像块时的编码顺序的示意图;
图3是本申请一个实施例提供的一种编码装置的结构示意图;
图4是本申请一个实施例提供的一种数据存储方法的流程示意图;
图6是本申请一个实施例提供的所述图像中各个区域的头部信息在存储器中的存储示意图;
图8是本申请一个实施例提供的缓冲区的子区间划分示意图;
图9是本申请一个实施例提供的一种存储单元的结构示意图;
图10是本申请一个实施例提供的子区间的示意图;
图11是本申请一个实施例提供的一种解码装置的结构示意图;
图12是本申请一个实施例提供的一种数据读取方法的流程示意图;
图13是本申请一个实施例提供的缓冲区的子区间及缓存行的示意图;
图14是本申请一个实施例提供的另一种数据读取方法的流程示意图;
图15是本申请一个实施例提供的选择命中标识的值最小的缓存行的示意图;
图16是本申请一个实施例提供的一种编解码系统的结构示意图;
图17、与18以及图19是本申请一个实施例提供的图像处理系统的不同结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
编码端在产生图像块对应的码流及头部信息之后,会将其存储至外部存储器。解码端在对码流进行解码时需要先获取头部(header)信息,才能从外部存储器中加载相应长度的码流,从而确保图像的准确解码。其中,有效管理头部信息的存取过程是实现图像编解码的重要因素之一。
在编码过程中,编码端通常按照帧级将header信息从内部存储器(如缓冲区)搬运至外部存储器,即需要在内部存储器中缓存完整个图像对应的所有header信息之后,才将该图像帧对应的所有header信息存储至外部存储器,则需要内部存储器有较大的缓存容量,增大了编码端的功耗。
如图1所示,图像可以被划分为多个图像块,假设一个格子表示一个图像块,每个图像块即本申请实施例压缩编码的基本单元,在对每个图像块进行压缩编码之后,最终会产生n bit的头部(header)信息,n为大于0的整数,比如每个图像块在压缩编码之后会产生4bit的头部信息,所述头部信息用于表示所述图像块在压缩编码之后获得的码流的长度或者其他的信息(如编码方式等)。对于图像中每个图像块可以按照从左到右且从上到下的光栅顺序进行编号,可以得到图像中每个图像块相对于图像左上角的图像块的偏移(offset),为了方便头部信息的存取过程,图像块的头部信息通常也按这样的编号顺序存储在外部存储器(如DDR存储器)中,图像左上角的图像块的头部信息在外部存储器中拥有对应的基地址,则图像中的其他图像块产生的头部信息根据该基地址以及相对于图像左上角的图像块的偏移(offset)在外部存储器中顺序存储。
一般的编码端可以按照如图1所示的光栅顺序依次对图像块进行压缩编码后,输出该图像块的头部信息;但在某些编码端中,采用的编码协议不同,对图像块的编码顺序可能并不是如图1所述的光栅顺序,可能是如图2所述的编码顺序,如果图像块的头部信息在外部存储器中是按如图1所示的光栅顺序存储的,以图2为例对图像块编码的过程中图像块的编码顺序(或者说头部信息的产生顺序)可能存在乱序情况,比如编码完图像块3输出图像块3的头部信息之后,接着编码图像块9输出图像块9的头部信息,在这种情况下,相关技术中的FIFO缓存区(先进先出的缓存方式)并不能满足头部信息缓存的需求。
基于此,本申请实施例提供了一种数据存储方法,实现对头部信息的存储过程进行有效管理。首先获取编码器对图像中的图像块进行编码后产生的头部信息,然后根据所述图像块在所述图像中的位置,确定所述图像块的头部信息在缓冲区中的存储位置,并将所述头部信息缓存至所述存储位置处,最后在所述缓冲区已缓存连续的多个图像块的头部信息的情况下,将所述连续的多个图像块的头部信息写入外部存储器。本实施例对于图像块的编码顺序(或者说头部信息的产生顺序)没有约束,即前后两次获取头部信息时,对应的两个图像块可以不相邻,进而通过所述缓冲区实现对图像 块的头部信息的存储管理,即本实施例实现所述图像块的头部信息可以在所述缓冲区中按照图像块在图像中的排列位置顺序缓存;接着,在所述缓冲区中已缓存连续的多个图像块的头部信息的情况下,将所述连续的多个图像块的头部信息写入外部存储器,无需在缓存整个图像的所有头部信息之后再读出,进一步降低对缓存区的缓存容量需求。
本实施例提供的数据存储方法可应用于数据存储装置中,所述数据存储装置可以是具有数据处理能力的计算机芯片或者集成电路,例如中央处理单元(Central Processing Unit,CPU)、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)或者现成可编程门阵列(Field-Programmable Gate Array,FPGA)等。
其中,所述数据存储装置可以安装在编码端。示例性的,请参阅图3,提供了一种编码装置10的示意图,所述编码装置10可以包括有一个或多个编码器11以及所述数据存储装置12。所述一个或多个编码器11用于分别对图像中的图像块进行编码处理,产生码流以及头部信息,然后将所述码流存储至外部存储器20以及将所述头部信息传输给所述数据存储装置12;所述数据存储装置12可以基于本实施例提供的数据存储方法,实现所述图像块的头部信息可以在缓冲区中按照图像块在图像中的排列位置顺序缓存,进而在所述缓冲区已缓存连续的多个图像块的头部信息的情况下,将所述连续的多个图像块的头部信息写入外部存储器20。其中,如图3所示,可以将所述码流和所述头部信息两路数据通过同一条数据链路存储至所述外部存储器20;或者,也可以将所述码流和所述头部信息两路数据分别通过两条数据链路存储至所述外部存储器20,可依据实际应用场景进行具体设置,本实施例对此不做任何限制。
接下来对本申请实施例提供的数据存储方法进行说明:请参阅图4,本申请实施例提供了一种数据存储方法,其可由数据存储装置来执行,所述方法包括:
在步骤S101中,获取编码器对图像中的图像块进行编码后产生的头部信息。
在步骤S102中,根据所述图像块在所述图像中的位置,确定所述图像块的头部信息在缓冲区中的存储位置,并将所述头部信息缓存至所述存储位置处。
在步骤S103中,在所述缓冲区已缓存连续的多个图像块的头部信息的情况下,将所述连续的多个图像块的头部信息写入外部存储器。
在一些实施例中,所述编码器的数量可以是一个或者多个。
在一些实施例中,在所述编码器为一个的情况下,如图1所示,可以将所述图像划分成多个图像块(每个格子表示一个图像块),由编码器对图像中的图像块进行编码,则所述数据存储装置可以获取所述编码器对图像块进行编码后产生的头部信息,所述头部信息用于表示所述编码器对图像块进行编码后得到的码流的长度和/或其他的一些信息(诸如编码方式、码表等等),其中,和/或表示多种信息的任何组合方式。
在获取编码器对图像中的图像块进行编码产生的头部信息之后,所述数据存储装置根据所述图像块在所述图像中的位置,确定所述图像块的头部信息在所述缓冲区中的存储位置,然后将所述图像块的头部信息缓存至所述存储位置处;所述存储位置与所述图像块在所述图像中的位置适配。本实施例中通过缓冲区实现对头部信息的缓存,对于图像块的编码顺序(或者说对应的头部信息的产生顺序)没有约束。
在一些实施例中,为了提高压缩编码效率,在某些场景下会使用多个编码器对所 述图像进行编码处理,所述图像被相应划分成多个区域,每个区域包括有多个图像块,每个所述编码器用于对每个区域内的图像块进行编码。例如如图5所示,以4个编码器为例进行说明,所述图像块被相应划分为4个区域,分别为区域1、区域2、区域3和区域4;每个区域内包括多个图像块,4个编码器用于分别对4个区域内的图像块进行编码,每个区域内的图像块按照光栅扫描顺序(从左到右从上到小的顺序)排列编号。相应的,在外部存储器中每个区域的左上角的图像块(即图像块1)均有对应的基地址,每个区域的其他图像块产生的头部信息根据该基地址以及相对于图像左上角的图像块的偏移(offset)在外部存储器中顺序存储,如图6所示,为4个区域在外部存储器中的存储情况的示意图。与图1以及图2所述实施例类似的情况,如图7所示,在某些场景下,由于编码协议的不同,各个编码器对各个区域内的图像块进行编码时的编码顺序并不是严格按照光栅扫描顺序(从左到右及从上到下的)的,针对于这种情况,本实施例中,为了实现所述图像块的头部信息按照光栅扫描顺序来存储从而方便后续的读取过程,所述数据存储装置通过所述缓冲区来实现头部信息按照图像块在图像中的排列位置来顺序缓存。
则在本实施例中,在使用多个编码器对所述图像进行编码处理的情况下,所述图像块在所述图像中的位置可以包括:所述图像块所处区域以及所述图像块在所述区域中的位置。在获取编码器对图像中的图像块进行编码后产生的头部信息之后,所述数据存储装置根据所述图像块所处区域以及所述图像块在所述区域中的位置,确定所述图像块的头部信息在所述缓冲区中的存储位置,然后将所述图像块的头部信息缓存至所述存储位置处;所述存储位置与所述图像块所处区域以及所述图像块在所述区域中的位置适配。本实施例中通过缓冲区实现对各区域内的头部信息的缓存,对于各区域内的图像块的编码顺序(或者说对应的头部信息的产生顺序)没有约束。
在一些可能的实现方式中,在编码器有多个的情况下,可以在缓冲区中针对于每个所述编码器维护一段子区间;在获取编码器对图像中的图像块进行编码后产生的头部信息之后,所述数据存储装置可以根据用于编码所述图像块的编码器,从多个子区间中确定对应的目标子区间,以及在所述目标子区间中根据所述图像块在所述区域中的位置确定相应的存储位置,即所述存储位置可以包括:用于编码所述图像块的编码器对应的目标子区间中的存储地址,该存储地址与所述图像块在所述区域中的位置适配。
由于每个所述编码器用于对每个区域内的图像块进行编码,即编码器与区域存在对应关系,也可以说,所述图像中的每个区域对应所述缓冲区中的一段子区间,则换句话说,所述存储位置可以包括:与所述图像块所处区域对应的目标子区间中的存储地址,该存储地址与所述图像块在所述区域中的位置适配;所述目标子区间根据所述图像块所处区域从多个子区间中确定。
在一些实施例中,在编码过程中,针对于图像的不同颜色分量通常是分别进行编码的;在一个例子中,比如针对于RGB格式的图像,编码器在对图像进行编码时,通常是对图像的R分量、G分量和B分量分别进行编码的;在另一个例子中,比如针对于YUV格式的图像,编码器在对图像进行编码时,通常是对图像的亮度(Y分量)和色度(UV分量)分别进行编码的。
则对于在图像中同一位置上的图像块,基于不同的颜色分量分别进行编码,可能 会产生不同的头部信息,比如针对于YUV格式的图像,在图像中同一位置上的图像块会产生关于亮度(Y分量)的头部信息以及关于色度(UV分量)的头部信息;因此,针对于图像的不同颜色分量,可以在缓冲区中对应有不同的存储地址,则在获取编码器对图像中的图像块进行编码产生的头部信息之后,所述数据存储装置可以根据所述图像块在所述图像中的位置以及所述图像块的颜色分量,共同确定所述图像块的头部信息在所述缓冲区中的存储位置,然后将所述图像块的头部信息缓存至所述存储位置处;所述存储位置与所述图像块在所述图像中的位置以及所述图像块的颜色分量共同适配。本实施例针对于图像的不同颜色分量,实现将对应颜色分量的头部信息在缓冲区中按照图像块在图像中的排列顺序进行缓存。
在一种可能的实现方式中,对于编码器数量有一个的情况,可以针对于所编码的不同颜色分量,在所述缓冲区中对应维护一段子区间,在获取编码器对图像中的图像块进行编码后产生的头部信息之后,所述数据存储装置可以根据所述图像块在所述图像中的位置以及所述图像块的颜色分量,共同确定所述图像块的头部信息在所述缓冲区中的存储位置,然后将所述图像块的头部信息缓存至所述存储位置处。
对于编码器数量有多个的情况,可以针对于每个编码器所编码的每个区域的每个颜色分量,在所述缓冲区中对应维护一段子区间,在获取编码器对图像中的图像块进行编码后产生的头部信息之后,所述数据存储装置可以根据所述图像块所处区域、所述图像块在所述区域中的位置以及所述图像块的颜色分量,共同确定所述图像块的头部信息在所述缓冲区中的存储位置,然后将所述图像块的头部信息缓存至所述存储位置处。
在一个例子中,以YUV格式为例进行说明,所述图像由一个编码器进行编码的情况下,可以在缓冲区中划分2个子区间,分别对应于亮度(Y分量)和色度(UV分量)。则所述图像块的头部信息在所述缓冲区中的存储位置包括:与所述图像块的颜色分量对应的目标子区间中的存储地址,所述存储地址与所述图像块在所述图像中的位置适配。在获取编码器对图像中的图像块进行编码后产生的头部信息之后,所述数据存储装置根据所述图像块的颜色分量,从多个子区间中确定对应的目标区间,以及在所述目标子区间中确定与所述图像块在图像中的位置适配的存储地址;比如所述图像块的颜色分量为亮度(Y分量),则在亮度(Y分量)对应的目标子区间中确定与所述图像块在图像中的位置适配的存储地址。
在一个例子中,如图8所示,以YUV格式为例进行说明,所述图像由4个编码器(比如分别有编码器1、编码器2、编码器3和编码器4)进行编码的情况下,可以在缓冲区中划分8个子区间,每个编码器对应有2个子区间,该2个子区间分别对应于亮度(Y分量)和色度(UV分量)。则所述存储位置包括:用于编码所述图像块的编码器以及所述图像块的颜色分量共同对应的目标子区间中的存储地址,所述存储地址与所述图像块在区域中的位置适配。即在获取编码器对图像中的图像块进行编码后产生的头部信息之后,所述数据存储装置根据用于编码所述图像块的编码器(或者说所述图像块所处区域)以及所述图像块的颜色分量,从多个子区间中共同确定对应的目标子区间,以及在所述目标子区间中确定与所述图像块在区域中的位置适配的存储地址。
在一些实施例中,每个所述子区间中可以包括有多个存储单元,每个所述存储单 元能够缓存多个图像块的头部信息。在一个例子中,比如所述图像块的头部信息为4bit,所述存储单元的位宽为128bit,则一个存储单元可以缓存有32个图像块的头部信息。其中,可以根据所述编码器的编码方式确定所述子区间中的存储单元的数量,以便所述子区间的缓存容量支持以下情况:能够在所述编码器不按光栅扫描顺序编码图像块的情况下缓存所述编码器产生的头部信息。
在每个所述存储单元能够缓存多个图像块的头部信息的情况下,所述头部信息在缓冲区中的存储位置具体包括:在对应的所述目标子区间中,与所述图像块在所述图像中的位置对应的目标存储单元中的N个比特位;N为大于1的整数,且所述N根据所述图像块的头部信息的数据量确定;所述目标存储单元根据所述图像块在所述图像中的位置从所述目标子区间所包括的多个存储单元中确定。在一个例子中,比如所述图像块的头部信息为4bit,则N等于4。其中,在编码器有多个的情况下,可以说,所述头部信息在缓冲区中的存储位置具体包括:在对应的所述目标子区间中,与所述图像块在所处区域中的位置对应的目标存储单元中的N个比特位。
则在将所述头部信息缓存至所述存储位置时,所述数据存储装置是将所述头部信息缓存至所述与所述图像块在所述图像中的位置对应的目标存储单元中的N个比特位处。作为例子,请参阅图9,示出了一个存储单元的示例图,比如所述图像块的头部信息为4bit,所述存储单元的位宽为64bit,假设一个格子能够存储4bit的数据,假设图1中的图像块1的头部信息对应缓存在该存储单元中的0~3bit(即第一个格子),则按照光栅扫描顺序,图像块10的头部信息对应缓存在该存储单元的36~39bit(即第10个格子)。
在一些实施例中,考虑到在缓存区中读写数据是以存储单元为单位来进行的,而一个存储单元能够缓存多个头部信息,因此,缓存所述头部信息时,如果所述目标存储单元中未缓存有头部信息,则所述数据存储装置可以将所述图像块的头部信息直接写入所述N个比特位处,并为所述目标存储单元中的其他比特位填充预设头部信息;其中,所述预设头部信息是用于方便后续在读取该目标存储单元中的数据时,能够方便识别出该目标存储单元中有效的头部信息以及无效的头部信息(即预设头部信息);如果所述目标存储单元中已缓存有头部信息,则所述数据存储装置将该目标存储单元所缓存的数据读出之后,根据所述图像块的头部信息改写所述目标存储单元中的所述N个比特位处的预设头部信息,然后将改写后的数据写入所述目标存储单元内。本实施例考虑到在缓存区中读写数据是以存储单元为单位来进行的,因此针对于存储单元中的2种情况(未缓存有头部信息的情况或者已缓存有头部信息情况),分别采用不同的写入方式来将头部信息写入所述存储单元中。
其中,为了方便所述数据存储装置针对于每个存储单元的读写过程,可以标识好每个所述存储单元的状态,以便所述数据存储装置针对于所述存储单元的准确读写。在一些实施例中,可以通过第一标识来标记所述存储单元的状态,每个所述存储单元对应有第一标识,所述第一标识用于指示所述存储单元中是否缓存有头部信息,则所述数据存储单元在将头部信息写入目标存储单元之前,可以根据所述第一标识确定所述目标存储单元中是否缓存有头部信息,进而采用对应的写入方式来将头部信息写入所述存储单元中;例如如果所述第一标识的值为1,表示所述目标存储单元中缓存有头部信息,如果所述第一标识的值为0,表示所述目标存储单元中未缓存有头部信息, 或者也可以使用其他的值或者字符来表示,本实施例对此不做任何限制。示例性的,所述第一标识的值可以通过寄存器来指示,或者所述第一标识的值也可以通过软件代码来指示,但不限于此。
在一个例子中,如果根据所述目标存储单元的第一标识确定目标存储单元中未缓存有头部信息,比如所述第一标识的值为0,则所述数据存储装置可以将所述图像块的头部信息直接写入所述N个比特位处,并且将所述第一标识的值更新为指示所述存储单元中缓存有头部信息,比如将所述第一标识的值从0改为1,以便所述数据存储装置基于所述第一标识对该存储单元进行有效管理;如果根据所述第一标识确定目标存储单元中已缓存有头部信息,比如所述第一标识的值为0,则根据所述图像块的头部信息改写所述目标存储单元中的所述N个比特位处的预设头部信息,无需更新所述第一标识。
在一些实施例中,每个所述存储单元还可以缓存有数量信息,所述数量信息用于指示所述存储单元中已缓存的头部信息的数量;在将所述头部信息缓存至所述目标存储单元中的N个比特位处之后,所述数据存储装置可以更新所述存储单元中的所述数量信息,从而方便所述数据存储装置基于所述数量信息对该存储单元进行有效管理。
在一些实施例中,为了更好地标识存储单元的状态,每个所述缓存单元还可以对应有第二标识,所述第二标识用于指示所述存储单元是否缓存已满,所述数据读取装置在检测到所述数量信息指示的数量为所述存储单元所能存储的最大数量的情况下,可以将所述第二标识的值更新为指示所述存储单元缓存已满;在一个例子中,比如所述图像块的头部信息为4bit,所述存储单元的位宽为128bit,则一个存储单元所能存储的最大数量有32个图像块的头部信息。本实施例通过所述第二标识对该存储单元进行有效管理。
其中,所述第二标识能够方便所述数据存储装置确定该存储单元中存储的头部信息是否可以写入外部存储器,所述存储单元缓存已满即表示该存储单元已缓存了连续的多个图像块的头部信息,可以考虑将缓存的连续的多个图像块的头部信息读出并写入外部存储器中,从而实现对缓存单元的循环利用。
示例性的,所述第二标识的值可以通过寄存器来指示,或者所述第二标识的值也可以通过软件代码来指示,但不限于此。在一个例子中,如果所述第二标识的值为1,表示所述存储单元中缓存已满,如果所述第二标识的值为0,表示所述存储单元中缓存未满。当然,也可以用其他的数值或者字符表示第二标识的值,本实施例对此不做任何限制。
在一个例子中,请参阅图8以及图10,图10示出了缓冲区中其中一个子区间的示意图,该子区间包括有多个存储单元,图10以64个存储单元为例,每个存储单元的位宽为133bit,所述图像块的头部信息为4bit,每4bit存储一个头部信息,共可存储32个头部信息,最高5bit用于存储数量信息,该数量信息表示当前128bit中存储了多少个头部信息,其他128bit用于缓存头部信息,其中每个格子表示4bit,可以缓存一个头部信息。每个存储单元对应有第一标识以及第二标识,所述第一标识用于指示所述存储单元中是否缓存有头部信息;所述第二标识用于指示所述存储单元是否缓存已满;所述第一标识的值和所述第二标识的值均分别通过寄存器指示。
在一些实施例中,在所述缓冲区的每个所述子区间中已缓存连续的多个图像块的 头部信息的情况下,所述数据存储装置可以将所述连续的多个图像块的头部信息写入外部存储器;其中,为了进一步提高存储效率,所述连续的多个图像块的头部信息的总数据量可以根据与所述外部存储器连接的线路的数量以及所述线路的位宽确定,其中,所述线路的位宽决定了该线路一次能够传输的数据量。即是说,在每个子区间中缓存的连续的头部信息的总数据量达到所述线路一次能够传输的最大数据量的情况下,所述数据存储装置可以将连续的多个图像块的头部信息从缓冲区读出并写入外部存储器。在一个例子中,假设所述数据存储装置通过AXI总线与所述外部存储器连接,AXI总线的线路数量为4,AXI总线的位宽为128bit,则一次可以传输的数据量为4*128bit=512bit,所述连续的多个图像块的头部信息的总数据量的总数据量最大可以是512bit,所述图像块的头部信息为4bit,则一次能够传输128个连续的图像块的头部信息。
在一个例子中,为了方便针对于所述缓冲区中的每个子区间的管理,所述存储单元能够缓存的头部信息的总数据量可以根据与所述外部存储器连接的线路的数量以及所述线路的位宽确定,比如所述存储单元能够缓存的头部信息的总数据量可以与所述线路一次能够传输的最大数据量成倍数关系,则所述数据存储装置可以在确定所述缓冲区的每个所述子区间中用于缓存所述连续的多个图像块的头部信息的存储单元缓存已满的情况下,所述数据存储装置可以将所述存储单元所缓存的头部信息写入外部存储器。
在一个例子中,假设所述数据存储装置通过AXI总线与所述外部存储器连接,AXI总线的线路数量为4,位宽为128bit,则一次可以传输的数据量为4*128bit=512bit,所述图像块的头部信息为4bit,则一次能够传输128个连续的图像块的头部信息,图10中每个存储单元可存储32个头部信息,共128bit,与所述线路一次能够传输的最大数据量(512bit)成倍数关系,则所述用于缓存所述连续的多个图像块的头部信息的存储单元的数量为4个,所述数据存储装置可以将该4个存储单元中的头部信息通过AXI4总线一次写入外部存储器中。
在一种可能的实现方式中,为了方便对存储单元进行有效管理,每个所述缓存单元可以对应有第二标识,所述第二标识用于指示所述存储单元是否缓存已满,所述数据读取装置在检测到所述存储单元中的数量信息指示的数量为所述存储单元所能存储的最大数量的情况下,可以将所述第二标识的值更新为指示所述存储单元缓存已满,从而方便所述数据存储装置可以基于所述第二标识的值快速确定可以将缓存的连续的多个图像块的头部信息读出并写入外部存储器中。
在一些实施例中,所述连续的多个图像块的头部信息可以按照所述图像块在所述图像中的位置顺序写入所述外部存储器,或者说,所述存储单元所缓存的头部信息按照所述图像块在所述图像中的位置顺序写入所述外部存储器。比如如图1所示的图像,先将缓存区中缓存的图像块1~16的头部信息写入外部存储器中,再按顺序将缓存区中缓存的图像块17~32的头部信息写入外部存储器中。当然,也可以在确定已缓存连续的多个图像块的头部信息的情况下,直接将连续的多个图像块的头部信息写入所述外部存储器,无需按照所述图像块在所述图像中的位置顺序写入,本实施例对此不做任何限制。
在一些实施例中,每个子区间还可以对应有写入信息,所述写入信息用于指示所 述子区间中已写入所述外部存储器中的头部信息;在所述将所述存储单元所缓存的头部信息写入外部存储器之后,所述数据存储装置需要根据所述存储单元所缓存的头部信息的数量更新所述写入信息,以便方便定位已写入外部存储器的头部信息。
在一些实施例中,在每个所述存储单元对应有第一标识和/或第二标识的情况下,在将存储单元中的头部信息写入外部存储器之后,所述数据存储装置需要将所述第一标识的值更新为指示所述存储单元中未缓存有头部信息;和/或,将所述第二标识的值更新为指示所述存储单元缓存未满;以及,将所述存储单元对应的数量信息指示的数量修改为0,以便所述存储单元的重复利用以及对存储单元进行有效管理。
在一些实施例中,在获取最后一个图像块在编码后产生的头部信息并缓存至所述缓冲区中之后,所述数据存储装置可以根据每个存储单元中的第一标识确定缓存有头部信息,如果第一标识的值指示该存储单元缓存有头部信息,则将该存储单元中缓存的头部信息直接写入外部缓存器中。比如如图10所示的对应于每个区域的每个颜色分量的子区间中,在获取该区域对应的颜色分量的最后一个图像块的头部信息并缓存至该子区间之后,根据每个存储单元的第一标识将缓存的所有头部信息直接写入外部缓存器中。
在编码过程中,将图像的图像块的头部信息缓存至外部存储器,相应的,在需要使用或者处理该图像中的图像块时,需要解码端对图像块对应的码流进行解码,在对码流进行解码时需要先从外部存储器获取头部(header)信息,才能从外部存储器中加载相应长度的码流,从而确保图像块的准确解码。其中,考虑到与外部存储器连接的线路的传输数据量通常大于图像块的头部信息的数据量,如果每次只是从外部存储器中读取需要解码的图像块的头部信息,在需要解码的图像块的头部信息的数据量小于与外部存储器连接的线路的传输数据量的情况下,难免造成读取带宽浪费。比如使用AXI总线实现从外部存储器读取头部信息,AXI总线的位宽有128bit,而一个图像块的头部信息有4bit,即一次最多能够读取32个图像块的头部信息,如果每次只是从外部存储器中读取需要解码的图像块的头部信息,比如需要解码的图像块为10个,则读取的头部信息的总数据量为40bit,小于AXI总线一次能够传输的数据量,造成读取带宽的浪费。
基于此,本实施例提供了一种数据读取方法,实现对头部信息的读取过程进行有效管理。首先,根据待解码图像块在图像中的位置,从外部存储器中读取所述待解码图像块对应的目标头部信息及其相邻的头部信息;以及对于缓冲区所包括的多个缓存行,根据各个所述缓存行最近一次被命中的时刻到当前时刻的时长,从多个缓存行中确定目标缓存行;然后将所述目标头部信息及其相邻的头部信息缓存至所述目标缓存行中;所述相邻的头部信息用于在解码其他待解码图像块时能够从所述目标缓存行中读取头部信息;最后从所述目标缓存行读出所述目标头部信息。本实施例中,能够将目标头部信息及其相邻的头部信息从外部存储器中一次读取出来缓存到缓冲区中,从而后续解码其他待解码图像块时只需要在缓冲区读取头部信息即可,无需再从外部存储读取,有利于提高读取效率以及节省读取带宽,并且本实施例在缓存目标头部信息及其相邻的头部信息的过程中,考虑到缓冲区中的各个所述缓存行可能缓存有头部信息,可能在解码其他待解码图像的时候可以直接从缓存行获取,因此根据各个所述缓 存行最近一次被命中的时刻到当前时刻的时长来选择目标缓存行,可以降低对已缓存在缓存行中的头部信息的影响。
本实施例提供的数据读取方法可以由数据读取装置来实现,所述数据读取装置可以是具有数据处理能力的计算机芯片或者集成电路,例如中央处理单元(Central Processing Unit,CPU)、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)或者现成可编程门阵列(Field-Programmable Gate Array,FPGA)等。
其中,所述数据读取装置可以安装在解码端。示例性的,请参阅图11,提供一种解码装置30的结构示意图,所述解码装置30包括有一个或多个解码器31以及所述数据读取装置32。所述数据读取装置32可以基于本实施例提供的数据读取方法,根据待解码图像块在图像中的位置,从外部存储器20中读取所述待解码图像块的目标头部信息及其相邻的头部信息,并将所述目标头部信息及其相邻的头部信息缓存在目标缓存行中,进而从目标缓存行中读取所述目标头部信息并传输给所述解码器31,所述解码器31用于根据所述目标头部信息从所述外部存储器20中读取所述待解码图像块的码流(比如根据所述头部信息所指示的码流长度从外部存储器20中读取相应长度的码流),并解码所述待解码图像块的码流,获取已解码的图像块;以及,所述数据读取装置32在读取所述目标头部信息的时候,还读取了与所述目标头部信息相邻的头部信息,所述与其所述目标头部信息相邻的头部信息用于在所述解码器31在需要解码其他待解码图像块时,如果所述缓冲区中有存储与其他待解码图像块的头部信息,则所述数据读取装置32可以直接从缓冲区中读取,无需再从外部存储读取,从而有利于提高读取效率以及节省读取带宽。其中,如图11所示,可以将所述码流和所述头部信息两路数据通过同一条数据链路从所述外部存储器20中读取;或者,也可以将所述码流和所述头部信息两路数据分别通过两条数据链路从所述外部存储器20中读取,可依据实际应用场景进行具体设置,本实施例对此不做任何限制。
接下来对本申请实施例提供的数据读取方法进行说明:请参阅图12,本申请实施例还提供了一种数据读取方法,所述方法可以由数据读取装置来执行,所述方法包括:
在步骤S201中,根据待解码图像块在图像中的位置,从外部存储器中读取所述待解码图像块的目标头部信息及其相邻的头部信息。
在步骤S201中,对于缓冲区所包括的多个缓存行,根据各个所述缓存行最近一次被命中的时刻到当前时刻的时长,从多个缓存行中确定目标缓存行。
在步骤S203中,将所述目标头部信息及其相邻的头部信息缓存至所述目标缓存行中;所述相邻的头部信息用于在解码其他待解码图像块时能够从所述目标缓存行中读取头部信息。
在步骤S204中,从所述目标缓存行读出所述目标头部信息。
在解码过程中,所述数据读取装置可以接收外部装置发送的解码指令,该解码指令指示待解码图像块在图像中的位置,为了避免频繁访问外部存储器造成带宽浪费的问题,所述数据读取装置可以首先确定所述缓冲区是否缓存有头部信息,如果没有缓存头部信息,则根据所述待解码图像块在图像中的位置从外部存储器读取所述待解码图像块的目标头部信息及其相邻的头部信息;如果缓存有头部信息,则进一步根据所述待解码图像块在图像中的位置确定存储的头部信息中是否有目标头部信息,如果没 有所述目标头部信息,则根据所述待解码图像块在图像中的位置从外部存储器读取所述待解码图像块的目标头部信息及其相邻的头部信息;如果有所述目标头部信息,则可以直接从缓冲区中直接读出所述目标头部信息即可。
在一些实施例中,所述缓冲区可以被划分成多个缓存行,每个缓存行包括有多个存储单元,每个存储单元能够缓存多个头部信息,所述数据读取装置可以以所述缓存行为单位确定所述缓冲区中的每个缓存行是否缓存有头部信息,以及在存在缓存有头部信息的缓存行的情况下,扫描缓存有头部信息的缓存行以确定是否缓存有所述待解码图像块的目标头部信息。
在一种可能的实现方式中,每个所述缓存行对应有占有标识,所述占有标识用于指示所述缓存行中是否缓存有头部信息;所述数据读取装置可以通过扫描每个缓存行的占有标识来确定所述缓存行中是否缓存有头部信息,本实施例实现通过占有标识来对缓存行进行有效管理。在一个例子中,比如占有标识的值为1,指示所述缓存行中缓存有头部信息;占有标识的值为0,指示所述缓存行中未缓存有头部信息。示例性的,所述占有标识的值可以通过寄存器来指示,或者通过软件代码指示,但不限于此。
在一种可能的实现方式中,每个所述缓存行可以对应有偏移标识,所述偏移标识用于指示所述缓存行中缓存的头部信息在所述外部存储器中的存储位置;在所述数据读取装置确定所述缓冲区中存在缓存有头部信息的缓存行的情况下,考虑到所述缓存行中缓存的头部信息在所述外部存储器中的存储位置也是按照图像块在图像中位置顺序存储的,因此可以根据所述待解码图像块在图像中的位置,扫描缓存有头部信息的缓存行的偏移标识,从而确定缓存有头部信息的缓存行中是否缓存有所述待解码图像块的目标头部信息,本实施例实现通过偏移标识来快速确定缓存行中是否缓存有目标头部信息。示例性的,所述偏移标识的值可以通过寄存器来指示,或者通过软件代码指示,但不限于此。
在确定所述缓冲区中的所有缓存行均未缓存有头部信息、或者所述缓冲区中缓存有头部信息的缓存行中未缓存有所述目标头部信息的情况下,所述数据读取装置可以根据所述待解码图像块在图像中的位置,从外部存储器中读取所述待解码图像块的目标头部信息及其相邻的头部信息,并将所述待解码图像块的目标头部信息及其相邻的头部信息缓存至所述缓冲区中的缓存行中。其中,读取与所述目标头部信息的相邻的头部信息,是为了方便后续解码其他待解码图像块时只需要在缓冲区读取头部信息即可,无需再从外部存储读取,有利于提高读取效率以及节省读取带宽。
其中,所述目标头部信息及其相邻的头部信息的总数据量可以根据与所述外部存储器连接的线路的数量以及所述线路的位宽确定。在一个例子中,假设所述数据读取装置通过AXI总线与所述外部存储器连接,AXI总线的线路数量为4,位宽为128bit,则一次可以传输的数据量为4*128bit=512bit,所述图像块的头部信息为4bit,则一次可以读取的所述目标头部信息及其相邻的头部信息的总数据量为512bit,一次可以读取128个头部信息。
在一个例子中,为了在所述缓冲区中更好地管理头部信息,可以设置所述缓存行的存储容量与一次从外部存储器读取的所述目标头部信息及其相邻的头部信息的总数据量匹配,比如所述缓存行的存储容量等于所述目标头部信息及其相邻的头部信息的总数据量,从而更好的管理头部信息。当然,在其他的实施例中,所述缓存行的存储 容量也可以小于或者大于所述目标头部信息及其相邻的头部信息的总数据量,本实施例对此不做任何限制。
考虑到在编码过程中一张图像可以被一个或多个编码器编码,在由一个编码器编码的情况下,所述图像中的图像块的头部信息在外部存储中按照图像块在图像中的排列位置顺序存储;在由多个编码器编码的情况下,所述图像被相应划分成多个区域,每个区域中包括多个图像块,每个编码器用于对每个区域中的图像块进行编码,每个区域中的图像块的头部信息在外部存储中按照图像块在区域中的排列位置顺序存储。
其中,在由多个编码器编码的情况下,由于各个区域中的图像块的头部信息在外部存储器中按照所述图像中的区域分别存储,因此,在解码过程中,可以在缓冲区中针对于图像中的每个区域(或者说在编码所述图像时使用的每个编码器)维护对应的子区间,每个子区间用于缓存从外部存储器读取的每个区域内的头部信息。则所述待解码图像块在图像中的位置包括:所述待解码图像块所处区域以及在所述区域中的位置。所述数据读取装置可以根据所述待解码图像块所处区域,从多个子区间中确定目标子区间,以及根据所述待解码图像块在所述区域中的位置,确定所述目标子区间中是否缓存有所述待解码图像块的目标头部信息。
在一些可能的实现方式中,所述子区间中包括有多个缓存行,每个缓存行包括有多个存储单元,每个存储单元能够缓存多个头部信息,所述数据读取装置可以以所述缓存行为单位确定所述目标子区间中的每个缓存行是否缓存有头部信息,以及在存在缓存有头部信息的缓存行的情况下,扫描缓存有头部信息的缓存行以确定是否缓存有所述待解码图像块的目标头部信息;在所述目标子区间中的所有缓存行均未缓存有头部信息、或者所述目标子区间中缓存有头部信息的缓存行中未缓存有所述目标头部信息,从外部存储器中读取所述待解码图像块的目标头部信息及其相邻的头部信息。
在一些实施例中,考虑到在编码过程中针对于图像的不同颜色分量通常是分别进行编码的;比如针对于YUV格式的图像,编码器在对图像进行编码时,通常是对图像的亮度(Y分量)和色度(UV分量)分别进行编码的;考虑到在外部存储器存储有图像的各个颜色分量对应的头部信息,因此,可以针对于图像的不同颜色分量,可以在所述缓冲区中维护对应的子区间。
在由一个编码器编码图像的情况中,可以针对于图像的不同颜色分量在所述缓冲区中维护有对应的子区间,每个子区间用于缓存从外部存储器读取的所述图像的每个颜色分量对应的头部信息,所述子区间中包括有多个缓存行,每个缓存行包括有多个存储单元,每个存储单元能够缓存多个头部信息;在一个例子中,以YUV格式为例进行说明,可以在缓冲区中划分2个子区间,分别对应于亮度(Y分量)和色度(UV分量)。
所述数据读取装置可以接收外部装置发送的解码指令,该解码指令可以指示待解码图像块在图像中的位置以及待解码图像块的颜色分量,进而所述数据读取装置可以根据待解码图像块的颜色分量从多个子区间中确定目标子区间,多个子区间分别对应于不同颜色分量,然后在所述目标子区间中确定是否存在缓存有头部信息的缓存行,以及在存在缓存有头部信息的缓存行的情况下,进一步确定缓存有头部信息的缓存行中是否缓存有所述待解码图像块的目标头部信息;在所述目标子区间中的所有缓存行均未缓存有头部信息、或者所述缓冲区中缓存有头部信息的缓存行中未缓存有所述目 标头部信息,所述数据读取装置从外部存储器中读取所述待解码图像块的目标头部信息及其相邻的头部信息。
在由多个编码器共同编码图像的情况下,可以在在缓冲区中针对于图像中的每个区域(或者说在编码所述图像时使用的每个编码器)的不同颜色分量维护对应的子区间,每个子区间用于缓存从外部存储器读取的每个区域的每个颜色分量对应的头部信息,每个所述子区间中包括有多个缓存行,每个缓存行包括有多个存储单元,每个存储单元能够缓存多个头部信息。
在一个例子中,请参阅图13,以YUV格式为例进行说明,所述图像由4个编码器进行编码的情况下,所述图像被对应划分成4个区域,4个区域内的头部信息在外部存储器中按照区域分别存储,基于每个区域的每个颜色分量在所述缓冲区中划分子区间,则可以在缓冲区中划分8个子区间,每个区域对应有2个子区间,该2个子区间分别对应于亮度(Y分量)和色度(UV分量),示例性的,每个所述子区间中包括有8个缓存行(也可以是其他数量的缓存行,本实施例对此不限制),每个缓存行包括有4个存储单元,每个存储单元的位宽为128bit,假设所述数据读取装置通过AXI总线与所述外部存储器连接,AXI总线的线路数量为4,位宽为128bit,则一次可以传输的数据量为4*128bit=512bit,即每个缓存行可以缓存一次从外部存储器中读取的512bit的头部信息。其中,每个所述缓存行还对应有占有标识和偏移标识,所述占有标识用于指示所述缓存行中是否缓存有头部信息,所述偏移标识用于指示所述缓存行中缓存的头部信息在所述外部存储器中的存储位置。示例性的,占有标志和偏移标识的值可以分别通过寄存器指示;例如,占有标识的值为1,标识该缓存行缓存有头部信息,占有标识的值为0,表示该缓存行未缓存头部信息。
在由多个编码器共同编码图像的情况下,所述数据读取装置可以接收外部装置发送的解码指令,该解码指令可以指示待解码图像块在图像中的位置以及待解码图像块的颜色分量,所述待解码图像块在图像中的位置包括:所述待解码图像块所处区域以及在所述区域中的位置。进而所述数据读取装置可以根据待解码图像块所处区域以及待解码图像块的颜色分量,从多个子区间中共同确定目标子区间,所述多个子区间对应于各个区域的各个颜色分量,然后在所述目标子区间中确定是否存在缓存有头部信息的缓存行,以及在存在缓存有头部信息的缓存行的情况下,确定是否有缓存所述待解码图像块的目标头部信息,在所述目标子区间中的所有缓存行均未缓存有头部信息、或者所述缓冲区中缓存有头部信息的缓存行中未缓存有所述目标头部信息,从外部存储器中读取所述待解码图像块的目标头部信息及其相邻的头部信息。
在一些实施例中,在从外部存储器中读取所述待解码图像块的目标头部信息及其相邻的头部信息的情况下,所述数据读取装置需要确定所述待解码图像块的目标头部信息及其相邻的头部信息在缓冲区中的缓存位置。
在一种可能的实现方式中,对于目标子区间所包括的多个缓存行,考虑到有些缓存行中已缓存有头部信息,可能在解码其他待解码图像块时可以用到,因此,为了尽量降低对已缓存有头部信息的缓存行的影响,所述数据读取装置可以根据目标子区间中的各个所述缓存行最近一次被命中的时刻到当前时刻的时长,从多个缓存行中确定目标缓存行,比如可以将所述多个缓存行中最近一次被命中的时刻到当前时刻的时长最大的一个确定为所述目标缓存行,并将所述目标头部信息及其相邻的头部信息缓存 至所述目标缓存行中,从而尽量降低对已缓存有头部信息的缓存行的影响,然后所述数据读取装置从所述目标缓存行读出所述目标头部信息,所述目标头部信息用于触发解码器根据所述目标头部信息从所述外部存储器中读取所述待解码图像块对应的码流。
其中,在每个缓存行对应有占有标识和/或偏移标识的情况下,所述占有标识用于指示所述缓存行中是否缓存有头部信息,所述偏移标识用于指示所述缓存行中缓存的头部信息在所述外部存储器中的存储位置;在将所述目标头部信息及其相邻的头部信息缓存至所述目标缓存行中之后,所述数据读取装置可以将所述目标缓存行的所述占有标识的值更新为指示所述目标缓存行中缓存有头部信息,和/或根据所述待解码图像块的目标头部信息及其相邻的头部信息在所述外部存储器中的存储位置更新所述目标缓存行的所述偏移标识的值,从而更好地标识所述缓存行的状态,方便所述数据读取装置对缓存行进行有效管理。
在一些实施例中,在确定所述目标子区间中的缓存有头部信息的缓存行中缓存有所述目标头部信息的情况下,所述数据读取装置可以将缓存有所述目标头部信息的缓存行确定为目标缓存行,然后直接从所述目标缓存行读出所述目标头部信息,所述目标头部信息用于触发解码器根据所述目标头部信息从所述外部存储器中读取所述待解码图像块对应的码流。
在一些实施例中,为了更好的标识每个所述缓存行的命中状态,每个所述缓存行还对应有命中标识,所述命中标识用于指示所述缓存行最近是否被命中;则在从所述目标缓存行读出所述目标头部信息之后,所述数据读取装置需要更新所述缓冲区中所有缓存有头部信息的缓存行对应的命中标识。示例性的,所述命中标识的值可以通过寄存器指示,或者,所述命中标识的值也可以通过软件代码指示,本实施例对此不做任何限制。
在一种可能的实现方式中,所述命中标识的值与所述缓存行最近一次被命中的时刻到当前时刻的时长成负相关关系,即所述缓存行最近一次被命中的时刻到当前时刻的时长越短,所述命中标识的值越大,反之亦然,所述缓存行最近一次被命中的时刻到当前时刻的时长越长,所述命中标识的值越小。则在更新所述缓冲区中所有缓存有头部信息的缓存行对应的命中标识的过程中,所述数据读取装置可以将所述目标缓存行对应的命中标识的值修改为预设最大值,并将缓存有头部信息的其他缓存行对应的命中标识的值减去预设值。在一个例子中,请参阅图13,假设每个子区间中有8个缓存行,所述预设最大值为7,默认最小值为0,预设值为1,在更新过程中,可以将目标缓存行对应的命中标识的值修改为7,然后将缓存有头部信息的其他缓存行对应的命中标识的值均减去1。
其中,在所述命中标识的值与所述缓存行最近一次被命中的时刻到当前时刻的时长成负相关关系的情况下,所述数据读取装置在根据各个所述缓存行最近一次被命中的时刻到当前时刻的时长从多个缓存行中确定目标缓存行的过程中,可以根据所述命中标识的值来确定目标缓存行,比如将所述多个缓存行中命中标识的值最小的一个确定为所述目标缓存行。
在另一种可能的实现方式中,所述命中标识的值可以与所述缓存行最近一次被命中的时刻到当前时刻的时长成正相关关系,即所述缓存行最近一次被命中的时刻到当前时刻的时长越短,所述命中标识的值越小,反之亦然,所述缓存行最近一次被命中 的时刻到当前时刻的时长越长,所述命中标识的值越大。则在更新所述缓冲区中所有缓存有头部信息的缓存行对应的命中标识的过程中,所述数据读取装置可以将所述目标缓存行对应的命中标识的值修改为预设最小值,并将缓存有头部信息的其他缓存行对应的命中标识的值加上预设值。其中,所述数据读取装置在根据各个所述缓存行最近一次被命中的时刻到当前时刻的时长从多个缓存行中确定目标缓存行的过程中,可以根据所述命中标识的值来确定目标缓存行,比如可以将所述多个缓存行中命中标识的值最大的一个确定为所述目标缓存行。
在一个示例性的实施例中,请参阅图13以及图14,以图像中的各区域产生的头部信息在外部存储器中按照各区域分别存储为例进行说明:所述数据读取装置可以接收外部装置发送的解码指令,该解码指令可以指示待解码图像块在图像中的位置以及待解码图像块的颜色分量,所述待解码图像块在图像中的位置包括:所述待解码图像块所处区域以及在所述区域中的位置。其中,所述缓冲区包括对应于每个区域的每个颜色分量的子区间。每个子区间包括有多个缓存行,每个缓存行对应有命中标识,所述命中标识的值与所述缓存行最近一次被命中的时刻到当前时刻的时长成负相关关系。
在图14所示的实施例中,在步骤S301中,所述数据读取装置可以根据待解码图像块所处区域以及待解码图像块的颜色分量,从多个子区间中共同确定目标子区间。
在步骤S302中,在所述目标子区间中确定是否存在缓存有头部信息的缓存行。
若否,则进行步骤S303~S305:
在步骤S303中,比如如图15所示,所述数据读取装置将命中标识最小的缓存行确定为目标缓存行;
在步骤S304中,根据待解码图像块在图像中的位置以及待解码图像块的颜色分量,从外部存储器中读取待解码图像块的目标头部信息及其相邻的头部信息;
在步骤S305中,将待解码图像块的目标头部信息及其相邻的头部信息缓存在所述目标缓存行中,更新所述目标缓存行的占有标识和偏移标识,以及更新所有缓存有头部信息的缓存行的命中标识;
在步骤S306中,从所述目标缓存行中读出所述目标头部信息。
若是,则进行步骤S307,确定是否有缓存所述待解码图像块的目标头部信息的目标缓存行,若否,则执行步骤S303~S306;否是,则执行步骤S308以及步骤S306,在步骤S308中,更新所有缓存有头部信息的缓存行的命中标识。
相应地,本申请实施例还提供了一种数据存储装置,包括处理器和存储器;
所述处理器用于:
获取编码器对图像中的图像块进行编码后产生的头部信息;
根据所述图像块在所述图像中的位置,确定所述图像块的头部信息在所述存储器中的存储位置,并将所述头部信息缓存至所述存储位置处;
在所述存储器已缓存连续的多个图像块的头部信息的情况下,将所述连续的多个图像块的头部信息写入外部存储器;
所述存储器用于缓存所述图像块的头部信息。
在一实施例中,所述图像块的头部信息在所述存储器中的存储位置根据所述图像块在所述图像中的位置以及所述图像块的颜色分量共同确定。
在一实施例中,所述存储器包括有对应于所述图像的每个颜色分量的子区间;
所述存储位置包括:所述图像块的颜色分量对应的目标子区间中的存储地址。
在一实施例中,在所述编码器有多个的情况下,所述图像被相应划分成多个区域,每个区域包括有多个图像块,每个所述编码器用于对每个区域内的图像块进行编码。
在一实施例中,所述图像块在所述图像中的位置包括:所述图像块所处区域以及所述图像块在所述区域中的位置。
在一实施例中,所述存储器包括有对应于每个所述编码器的子区间;
所述存储位置包括:用于编码所述图像块的编码器对应的目标子区间中的存储地址。
在一实施例中,所述存储器包括有对应于每个所述编码器以及所述图像的每个颜色分量的子区间;
所述存储位置包括:用于编码所述图像块的编码器以及所述图像块的颜色分量共同对应的目标子区间中的存储地址。
在一实施例中,每个所述子区间中包括多个存储单元,每个所述存储单元能够缓存多个图像块的头部信息;
所述存储位置具体包括:在所述目标子区间中,与所述图像块在所述图像中的位置对应的目标存储单元中的N个比特位;N为大于1的整数,且所述N根据所述图像块的头部信息的数据量确定。
在一实施例中,所述处理器还用于:将所述头部信息缓存至所述目标存储单元中的N个比特位处。
在一实施例中,所述处理器具体用于:
如果所述目标存储单元中未缓存有头部信息,将所述图像块的头部信息写入所述N个比特位处,并为所述目标存储单元中的其他比特位填充预设头部信息;
如果所述目标存储单元中已缓存有头部信息,根据所述图像块的头部信息改写所述目标存储单元中的所述N个比特位处的预设头部信息。
在一实施例中,每个所述存储单元还缓存有数量信息,所述数量信息用于指示所述存储单元中已缓存的头部信息的数量;
所述处理器还用于:在所述将所述头部信息缓存至所述目标存储单元中的N个比特位处之后,更新所述目标存储单元中的所述数量信息。
在一实施例中,每个所述缓存单元对应有第一标识,所述第一标识用于指示所述存储单元中是否缓存有头部信息;
所述处理器还用于:根据所述目标存储单元的所述第一标识确定所述目标存储单元中是否缓存有头部信息。
在一实施例中,所述处理器还用于:在所述如果所述目标存储单元中未缓存有头部信息,将所述图像块的头部信息写入所述N个比特位处之后,将所述第一标识的值更新为指示所述目标存储单元中缓存有头部信息。
在一实施例中,所述连续的多个图像块的头部信息的总数据量根据与所述外部存储器连接的线路的数量以及所述线路的位宽确定。
在一实施例中,所述连续的多个图像块的头部信息按照所述图像块在所述图像中的位置顺序写入所述外部存储器。
在一实施例中,所述处理器具体用于:在确定所述存储器中用于缓存所述连续的多个图像块的头部信息的存储单元缓存已满的情况下,将所述存储单元所缓存的头部信息写入外部存储器。
在一实施例中,每个子区间对应有写入信息,所述写入信息用于指示所述子区间中已写入所述外部存储器中的头部信息;
所述处理器还用于:在所述将所述存储单元所缓存的头部信息写入外部存储器之后,根据所述存储单元所缓存的头部信息的数量更新所述写入信息。
在一实施例中,每个所述存储单元对应有第一标识和/或第二标识;
所述第一标识用于指示所述存储单元中是否缓存有头部信息;所述第二标识用于指示所述存储单元是否缓存已满;
所述处理器还用于:在所述将所述存储单元所缓存的头部信息写入外部存储器之后,将所述第一标识的值更新为指示所述存储单元中未缓存有头部信息;和/或,将所述第二标识的值更新为指示所述存储单元缓存未满。
在一实施例中,每个所述存储单元还缓存有数量信息,所述数量信息用于指示所述存储单元中已缓存的头部信息的数量;
所述处理器还用于:在每个所述存储单元对应有所述第二标识的情况下,在所述数量信息指示的数量为所述存储单元所能存储的最大数量的情况下,将所述第二标识的值更新为指示所述存储单元缓存已满。
在一实施例中,所述第一标识的值和/或所述第二标识的值均通过寄存器指示。
相应地,本申请实施例还提供了一种数据读取装置,包括处理器和存储器;
所述处理器用于:根据待解码图像块在图像中的位置,从外部存储器中读取所述待解码图像块的目标头部信息及其相邻的头部信息;对于所述存储器所包括的多个缓存行,根据各个所述缓存行最近一次被命中的时刻到当前时刻的时长,从多个缓存行中确定目标缓存行;将所述目标头部信息及其相邻的头部信息缓存至所述目标缓存行中;所述相邻的头部信息用于在解码其他待解码图像块时能够从所述目标缓存行中读取头部信息;从所述目标缓存行读出所述目标头部信息;
所述存储器包括多个缓存行,所述缓存行用于缓存头部信息。
在一实施例中,所述目标缓存行为所述多个缓存行中最近一次被命中的时刻到当前时刻的时长最大的一个。
在一实施例中,所述目标头部信息及其相邻的头部信息的总数据量根据与所述外部存储器连接的线路的数量以及所述线路的位宽确定。
在一实施例中,所述处理器还用于:
如果所述存储器中的所有缓存行均未缓存有头部信息、或者所述存储器中缓存有头部信息的缓存行中未缓存有所述目标头部信息,从外部存储器中读取所述待解码图像块的目标头部信息及其相邻的头部信息。
在一实施例中,所述处理器还用于:如果所述存储器中缓存有头部信息的缓存行中缓存有所述目标头部信息,将缓存有所述目标头部信息的缓存行确定为所述目标缓存行。
在一实施例中,每个所述缓存行对应有命中标识,所述命中标识用于指示所述缓 存行最近是否被命中;
所述处理器还用于:在所述从所述目标缓存行读出所述目标头部信息之后,更新所述存储器中所有缓存有头部信息的缓存行对应的命中标识。
在一实施例中,所述命中标识的值与所述缓存行最近一次被命中的时刻到当前时刻的时长成负相关关系。
在一实施例中,所述处理器具体用于:将所述目标缓存行对应的命中标识的值修改为预设最大值,并将缓存有头部信息的其他缓存行对应的命中标识的值减去预设值。
在一实施例中,所述处理器还用于:将所述多个缓存行中命中标识的值最小的一个确定为所述目标缓存行。
在一实施例中,所述命中标识的值通过寄存器指示。
在一实施例中,每个所述缓存行对应有占有标识,所述占有标识用于指示所述缓存行中是否缓存有头部信息;
所述处理器还用于:在所述将所述目标头部信息及其相邻的头部信息缓存至所述目标缓存行中之后,将所述目标缓存行的所述占有标识的值更新为指示所述目标缓存行中缓存有头部信息。
在一实施例中,所述占有标识的值通过寄存器指示。
在一实施例中,每个所述缓存行对应有偏移标识,所述偏移标识用于指示所述缓存行中缓存的头部信息在所述外部存储器中的存储位置;
所述处理器还用于:在所述将所述目标头部信息及其相邻的头部信息缓存至所述目标缓存行中之后,根据所述待解码图像块的目标头部信息及其相邻的头部信息在所述外部存储器中的存储位置,更新所述目标缓存行的所述偏移标识的值。
在一实施例中,所述偏移标识的值通过寄存器指示。
在一实施例中,所述目标头部信息用于触发解码器根据所述目标头部信息从所述外部存储器中读取所述待解码图像块对应的码流。
在一实施例中,在所述图像被多个编码器编码的情况下,所述图像被相应划分成多个区域;
在所述外部存储器中按照所述区域存储每个区域内的头部信息;
所述待解码图像块在图像中的位置包括:所述待解码图像块所处区域以及在所述区域中的位置。
在一实施例中,所述存储器包括:与所述图像的每个区域对应的子区间;
每个所述子区间包括有多个缓存行;
所述处理器还用于:根据所述待解码图像块所处区域,从多个子区间中确定目标子区间;从所述目标子区间所包括的多个缓存行中确定目标缓存行。
在一实施例中,所述存储器具体包括:与所述图像所处区域以及所述图像的每个颜色分量共同对应的子区间;
所述目标子区间根据所述待解码图像块所处区域以及所述待解码图像块的颜色分量共同确定。
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或 者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
相应地,请参阅图3,本申请实施例还提供了一种编码装置10,包括一个或多个编码器11以及如上述的数据存储装置12。
所述编码器11用于对图像中的图像块进行编码,产生发送给所述数据存储装置12的头部信息以及存储至外部存储器20的码流。
相应地,请参阅图11,本申请实施例还提供了一种解码装置30,包括一个或多个解码器31以及上述的数据读取装置32;
所述解码器31用于根据所述数据读取装置32读取的头部信息,从外部存储器20读取码流进行解码。
示例性的,请参阅图16,本申请实施例还提供了一种编解码系统,所述编解码系统包括如图3所述的编码装置10和如图11所述的解码装置30。
其中,所述编码装置10和所述解码装置30可以安装于同一设备上,也可以安装于不同设备上,可依据实际应用场景进行具体设置,本实施例对此不做任何限制。
示例性的,本申请实施例还提供了一种图像处理系统,包括一个或多个图像处理装置、上述的编解码系统以及存储器。
示例性的,请参阅图17,图17以所述编码装置和所述解码装置可以安装于同一设备上为例进行说明:图17提供了一种图像处理系统,所述图像处理系统包括有图像处理装置40,编码装置10、解码装置30和存储器20。图像处理装置主要负责处理图像、视频数据,在处理数据时需要对图像数据进行存取,所需的存取带宽往往非常大,从而影响到电子设备中其他装置的工作效率。由于图像数据具有很强的空间、时间局部相关性,如果采用压缩算法对其进行压缩,往往具有比较高的压缩率,因此,在所述图像处理装置40的出口可以安装有编码装置10,以及在所述图像处理装置40的入口可以安装有解码装置30,能够降低图像处理装置对电子设备带宽的占用,提升电子设备整体工作效率,降低电子设备整体功耗。
在一示例性的实施例中,在图17所示的场景中,所述图像处理装置40在对图像或者视频帧处理后,向所述编码装置10输出图像或者视频帧。所述编码装置10可以采用分块压缩算法,首先对图像处理装置40输出的图像或者视频帧进行分块,然后通过所述编码装置10中的编码器11对图像块采用DPCM(Differential Pulse Code Modulation)技术进行预测,得到预测块,然后将预测图像块和原始图像块作差得到残差,残差编码采用哈弗曼编码(Huffman Coding);每个图像块在编码后产生一个头部信息(比如用于标识码流长度),由所述编码装置10中的数据存储装置12对图像块的头部信息进行存储管理;进而,所述编码装置10将产生的码流以及头部信息存储至存储器20中。
在所述图像处理装置40需要使用图像时,由解码装置30首先从存储器20中获取待解码图像块对应的头部信息,确定压缩码流的长度信息,之后从存储器20中加载压缩码流进行解码操作,并将解码得到的图像或者视频帧传输给图像处理装置40。
示例性的,所述图像处理装置40可以是图像信号处理器(ISP)等,但不限于此。 所述存储器20可以是DDR存储器、静态随机访问存储器(SRAM)等,但不限于此。所述图像处理装置40、所述编码装置10以及所述解码装置30可以集成于一芯片中,如SOC芯片,但不限于此。
在一示例性的实施例中,请参阅图18,图18以所述编码装置和所述解码装置可以安装于同一设备上为例进行说明:图18提供了一种图像处理系统,所述图像处理系统包括有第一图像处理装置41,第二图像处理装置42、编码装置10、解码装置30和存储器20。
所述第一图像处理装置41在处理图像或者视频帧之后,将图像或者视频帧传输给所述编码装置10;所述编码装置10用于对所述图像或者视频帧中的图像块进行编码,产生码流以及头部信息,并存储至存储器20中;在所述第二图像处理装置42需要对该图像或者视频帧进行再次处理的情况下,则通过所述解码装置30从存储器20中读取头部信息,并基于头部信息从存储器20中读取码流,对码流进行解码之后获得图像或者视频帧并传输给所述第二图像处理装置42。
示例性的,所述第一图像处理装置可以是图像信号处理器(ISP),所述第二图像处理装置可以是对象识别装置(比如使用图像进行人脸识别等等),但不限于此。
在一示例性的应用场景中,请参阅图19,图19以所述编码装置10和所述解码装置30安装于不同设备为例进行说明:图19示出了图像处理系统,所述图像处理系统包括第一设备100和第二设备200第一设备100第二设备200,第一设备100包括有第一图像处理装置41、编码装置10、第一存储器21和第一通信装置51;第二设备200包括有第二图像处理装置42、解码装置30、第二存储器22和第二通信装置52。
第一设备100的第一图像处理装置41在对图像或者视频帧处理完成之后,将图像或者视频帧传输给所述编码装置10;所述编码装置10用于对所述图像或者视频帧中的图像块进行编码,产生码流以及头部信息,并存储至第一设备100的第一存储器21中;所述第一设备100的第一通信装置51可以从第一存储器21中读取码流以及头部信息并发送给第二设备200的第二通信装置52。
第二设备200的第二通信装置52可以将接收的码流和头部信息存储至第二设备200的第二存储器22中,当第二设备200的第二图像处理装置42需要使用或者处理所述图像或者视频帧时,可以通过所述解码装置30从第二设备200第二存储器22中读取头部信息,并基于头部信息从第二存储器22中读取码流,对码流进行解码之后获得图像或者视频帧并传输给所述第二图像处理装置42。
示例性的,所述第一设备100可以是可移动平台,比如无人飞行器、无人驾驶车辆或者移动机器人等;第二设备200可以是与可移动平台通信连接的终端设备,比如手机、遥控设备等,但不限于此。
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器,上述指令可由装置的处理器执行以完成上述方法。例如,非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。
一种非临时性计算机可读存储介质,当存储介质中的指令由装置的处理器执行时,使得终端能够执行上述方法。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实 体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上对本申请实施例所提供的方法和装置进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (81)

  1. 一种数据存储方法,其特征在于,包括:
    获取编码器对图像中的图像块进行编码后产生的头部信息;
    根据所述图像块在所述图像中的位置,确定所述图像块的头部信息在缓冲区中的存储位置,并将所述头部信息缓存至所述存储位置处;
    在所述缓冲区已缓存连续的多个图像块的头部信息的情况下,将所述连续的多个图像块的头部信息写入外部存储器。
  2. 根据权利要求1所述的方法,其特征在于,所述图像块的头部信息在所述缓冲区中的存储位置根据所述图像块在所述图像中的位置以及所述图像块的颜色分量共同确定。
  3. 根据权利要求2所述的方法,其特征在于,所述缓冲区包括有对应于所述图像的每个颜色分量的子区间;
    所述存储位置包括:所述图像块的颜色分量对应的目标子区间中的存储地址。
  4. 根据权利要求1或2所述的方法,其特征在于,在所述编码器有多个的情况下,所述图像被相应划分成多个区域,每个区域包括有多个图像块,每个所述编码器用于对每个区域内的图像块进行编码。
  5. 根据权利要求4所述的方法,其特征在于,所述图像块在所述图像中的位置包括:所述图像块所处区域以及所述图像块在所述区域中的位置。
  6. 根据权利要求1或4所述的方法,其特征在于,所述缓冲区包括有对应于每个所述编码器的子区间;
    所述存储位置包括:用于编码所述图像块的编码器对应的目标子区间中的存储地址。
  7. 根据权利要求1或4所述的方法,其特征在于,所述缓冲区包括有对应于每个所述编码器以及所述图像的每个颜色分量的子区间;
    所述存储位置包括:用于编码所述图像块的编码器以及所述图像块的颜色分量共同对应的目标子区间中的存储地址。
  8. 根据权利要求3、6或7任意一项所述的方法,其特征在于,每个所述子区间中包括多个存储单元,每个所述存储单元能够缓存多个图像块的头部信息;
    所述存储位置具体包括:在所述目标子区间中,与所述图像块在所述图像中的位置对应的目标存储单元中的N个比特位;N为大于1的整数,且所述N根据所述图像块的头部信息的数据量确定。
  9. 根据权利要求8所述的方法,其特征在于,所述将所述头部信息缓存至所述存储位置处,包括:
    将所述头部信息缓存至所述目标存储单元中的N个比特位处。
  10. 根据权利要求9所述的方法,其特征在于,所述将所述头部信息缓存至所述目标存储单元中的N个比特位处,包括:
    如果所述目标存储单元中未缓存有头部信息,将所述图像块的头部信息写入所述N个比特位处,并为所述目标存储单元中的其他比特位填充预设头部信息;
    如果所述目标存储单元中已缓存有头部信息,根据所述图像块的头部信息改写所述目标存储单元中的所述N个比特位处的预设头部信息。
  11. 根据权利要求9所述的方法,其特征在于,每个所述存储单元还缓存有数量信息,所述数量信息用于指示所述存储单元中已缓存的头部信息的数量;
    在所述将所述头部信息缓存至所述目标存储单元中的N个比特位处之后,还包括:
    更新所述目标存储单元中的所述数量信息。
  12. 根据权利要求10所述的方法,其特征在于,每个所述缓存单元对应有第一标识,所述第一标识用于指示所述存储单元中是否缓存有头部信息;
    所述方法还包括:
    根据所述目标存储单元的所述第一标识确定所述目标存储单元中是否缓存有头部信息。
  13. 根据权利要求12所述的方法,其特征在于,在所述如果所述目标存储单元中未缓存有头部信息,将所述图像块的头部信息写入所述N个比特位处之后,还包括:
    将所述第一标识的值更新为指示所述目标存储单元中缓存有头部信息。
  14. 根据权利要求1所述的方法,其特征在于,所述连续的多个图像块的头部信息的总数据量根据与所述外部存储器连接的线路的数量以及所述线路的位宽确定。
  15. 根据权利要求1所述的方法,其特征在于,所述连续的多个图像块的头部信息按照所述图像块在所述图像中的位置顺序写入所述外部存储器。
  16. 根据权利要求8所述的方法,其特征在于,所述在所述缓冲区中已缓存连续的多个图像块的头部信息的情况下,将所述连续的多个图像块的头部信息写入外部存储器,包括:
    在确定所述缓冲区中用于缓存所述连续的多个图像块的头部信息的存储单元缓存已满的情况下,将所述存储单元所缓存的头部信息写入外部存储器。
  17. 根据权利要求16所述的方法,其特征在于,每个子区间对应有写入信息,所述写入信息用于指示所述子区间中已写入所述外部存储器中的头部信息;
    在所述将所述存储单元所缓存的头部信息写入外部存储器之后,还包括:
    根据所述存储单元所缓存的头部信息的数量更新所述写入信息。
  18. 根据权利要求16所述的方法,其特征在于,每个所述存储单元对应有第一标识和/或第二标识;
    所述第一标识用于指示所述存储单元中是否缓存有头部信息;所述第二标识用于指示所述存储单元是否缓存已满;
    在所述将所述存储单元所缓存的头部信息写入外部存储器之后,还包括:
    将所述第一标识的值更新为指示所述存储单元中未缓存有头部信息;和/或,将所述第二标识的值更新为指示所述存储单元缓存未满。
  19. 根据权利要求18所述的方法,其特征在于,每个所述存储单元还缓存有数量信息,所述数量信息用于指示所述存储单元中已缓存的头部信息的数量;
    在每个所述存储单元对应有所述第二标识的情况下,所述方法还包括:
    在所述数量信息指示的数量为所述存储单元所能存储的最大数量的情况下,将所述第二标识的值更新为指示所述存储单元缓存已满。
  20. 根据权利要求18所述的方法,其特征在于,所述第一标识的值和/或所述第二标识的值均通过寄存器指示。
  21. 一种数据读取方法,其特征在于,所述方法包括:
    根据待解码图像块在图像中的位置,从外部存储器中读取所述待解码图像块的目标头部信息及其相邻的头部信息;
    对于缓冲区所包括的多个缓存行,根据各个所述缓存行最近一次被命中的时刻到当前时刻的时长,从多个缓存行中确定目标缓存行;
    将所述目标头部信息及其相邻的头部信息缓存至所述目标缓存行中;所述相邻的头部信息用于在解码其他待解码图像块时能够从所述目标缓存行中读取头部信息;
    从所述目标缓存行读出所述目标头部信息。
  22. 根据权利要求21所述的方法,其特征在于,所述目标缓存行为所述多个缓存行中最近一次被命中的时刻到当前时刻的时长最大的一个。
  23. 根据权利要求21所述的方法,其特征在于,所述目标头部信息及其相邻的头部信息的总数据量根据与所述外部存储器连接的线路的数量以及所述线路的位宽确定。
  24. 根据权利要求21所述的方法,其特征在于,所述从外部存储器中读取所述待解码图像块的目标头部信息及其相邻的头部信息,包括:
    如果所述缓冲区中的所有缓存行均未缓存有头部信息、或者所述缓冲区中缓存有头部信息的缓存行中未缓存有所述目标头部信息,从外部存储器中读取所述待解码图像块的目标头部信息及其相邻的头部信息。
  25. 根据权利要求24所述的方法,其特征在于,所述方法还包括:
    如果所述缓冲区中缓存有头部信息的缓存行中缓存有所述目标头部信息,将缓存有所述目标头部信息的缓存行确定为所述目标缓存行。
  26. 根据权利要求21或25所述的方法,其特征在于,每个所述缓存行对应有命中标识,所述命中标识用于指示所述缓存行最近是否被命中;
    在所述从所述目标缓存行读出所述目标头部信息之后,还包括:
    更新所述缓冲区中所有缓存有头部信息的缓存行对应的命中标识。
  27. 根据权利要求26所述的方法,其特征在于,所述命中标识的值与所述缓存行最近一次被命中的时刻到当前时刻的时长成负相关关系。
  28. 根据权利要求26或27所述的方法,其特征在于,所述更新所述缓冲区中所有缓存有头部信息的缓存行对应的命中标识的值,包括:
    将所述目标缓存行对应的命中标识的值修改为预设最大值,并将缓存有头部信息的其他缓存行对应的命中标识的值减去预设值。
  29. 根据权利要求27或28所述的方法,其特征在于,所述根据各个所述缓存行最近一次被命中的时刻到当前时刻的时长,从多个缓存行中确定目标缓存行,包括:
    将所述多个缓存行中命中标识的值最小的一个确定为所述目标缓存行。
  30. 根据权利要求29所述的方法,其特征在于,所述命中标识的值通过寄存器指示。
  31. 根据权利要求21所述的方法,其特征在于,每个所述缓存行对应有占有标识,所述占有标识用于指示所述缓存行中是否缓存有头部信息;
    在所述将所述目标头部信息及其相邻的头部信息缓存至所述目标缓存行中之后,还包括:
    将所述目标缓存行的所述占有标识的值更新为指示所述目标缓存行中缓存有头部 信息。
  32. 根据权利要求31所述的方法,其特征在于,所述占有标识的值通过寄存器指示。
  33. 根据权利要求21所述的方法,其特征在于,每个所述缓存行对应有偏移标识,所述偏移标识用于指示所述缓存行中缓存的头部信息在所述外部存储器中的存储位置;
    在所述将所述目标头部信息及其相邻的头部信息缓存至所述目标缓存行中之后,还包括:
    根据所述待解码图像块的目标头部信息及其相邻的头部信息在所述外部存储器中的存储位置,更新所述目标缓存行的所述偏移标识的值。
  34. 根据权利要求33所述的方法,其特征在于,所述偏移标识的值通过寄存器指示。
  35. 根据权利要求21所述的方法,其特征在于,所述目标头部信息用于触发解码器根据所述目标头部信息从所述外部存储器中读取所述待解码图像块对应的码流。
  36. 根据权利要求21所述的方法,其特征在于,在所述图像被多个编码器编码的情况下,所述图像被相应划分成多个区域;
    在所述外部存储器中按照所述区域存储每个区域内的头部信息;
    所述待解码图像块在图像中的位置包括:所述待解码图像块所处区域以及在所述区域中的位置。
  37. 根据权利要求36所述的方法,其特征在于,所述缓冲区包括:与所述图像的每个区域对应的子区间;
    每个所述子区间包括有多个缓存行;
    所述方法还包括:根据所述待解码图像块所处区域,从多个子区间中确定目标子区间;
    所述从多个缓存行中确定目标缓存行,包括:
    从所述目标子区间所包括的多个缓存行中确定目标缓存行。
  38. 根据权利要求37所述的方法,其特征在于,所述缓冲区具体包括:与所述图像所处区域以及所述图像的每个颜色分量共同对应的子区间;
    所述目标子区间根据所述待解码图像块所处区域以及所述待解码图像块的颜色分量共同确定。
  39. 一种数据存储装置,其特征在于,包括处理器和存储器;
    所述处理器用于:
    获取编码器对图像中的图像块进行编码后产生的头部信息;
    根据所述图像块在所述图像中的位置,确定所述图像块的头部信息在所述存储器中的存储位置,并将所述头部信息缓存至所述存储位置处;
    在所述存储器已缓存连续的多个图像块的头部信息的情况下,将所述连续的多个图像块的头部信息写入外部存储器。
  40. 根据权利要求39所述的装置,其特征在于,所述图像块的头部信息在所述存储器中的存储位置根据所述图像块在所述图像中的位置以及所述图像块的颜色分量共同确定。
  41. 根据权利要求40所述的装置,其特征在于,所述存储器包括有对应于所述图像的每个颜色分量的子区间;
    所述存储位置包括:所述图像块的颜色分量对应的目标子区间中的存储地址。
  42. 根据权利要求39或40所述的装置,其特征在于,在所述编码器有多个的情况下,所述图像被相应划分成多个区域,每个区域包括有多个图像块,每个所述编码器用于对每个区域内的图像块进行编码。
  43. 根据权利要求42所述的装置,其特征在于,所述图像块在所述图像中的位置包括:所述图像块所处区域以及所述图像块在所述区域中的位置。
  44. 根据权利要求39或42所述的装置,其特征在于,所述存储器包括有对应于每个所述编码器的子区间;
    所述存储位置包括:用于编码所述图像块的编码器对应的目标子区间中的存储地址。
  45. 根据权利要求39或42所述的装置,其特征在于,所述存储器包括有对应于每个所述编码器以及所述图像的每个颜色分量的子区间;
    所述存储位置包括:用于编码所述图像块的编码器以及所述图像块的颜色分量共同对应的目标子区间中的存储地址。
  46. 根据权利要求39、44或45任意一项所述的装置,其特征在于,每个所述子区间中包括多个存储单元,每个所述存储单元能够缓存多个图像块的头部信息;
    所述存储位置具体包括:在所述目标子区间中,与所述图像块在所述图像中的位置对应的目标存储单元中的N个比特位;N为大于1的整数,且所述N根据所述图像块的头部信息的数据量确定。
  47. 根据权利要求46所述的装置,其特征在于,所述处理器还用于:将所述头部信息缓存至所述目标存储单元中的N个比特位处。
  48. 根据权利要求47所述的装置,其特征在于,所述处理器具体用于:
    如果所述目标存储单元中未缓存有头部信息,将所述图像块的头部信息写入所述N个比特位处,并为所述目标存储单元中的其他比特位填充预设头部信息;
    如果所述目标存储单元中已缓存有头部信息,根据所述图像块的头部信息改写所述目标存储单元中的所述N个比特位处的预设头部信息。
  49. 根据权利要求47所述的装置,其特征在于,每个所述存储单元还缓存有数量信息,所述数量信息用于指示所述存储单元中已缓存的头部信息的数量;
    所述处理器还用于:在所述将所述头部信息缓存至所述目标存储单元中的N个比特位处之后,更新所述目标存储单元中的所述数量信息。
  50. 根据权利要求48所述的装置,其特征在于,每个所述缓存单元对应有第一标识,所述第一标识用于指示所述存储单元中是否缓存有头部信息;
    所述处理器还用于:根据所述目标存储单元的所述第一标识确定所述目标存储单元中是否缓存有头部信息。
  51. 根据权利要求50所述的装置,其特征在于,所述处理器还用于:在所述如果所述目标存储单元中未缓存有头部信息,将所述图像块的头部信息写入所述N个比特位处之后,将所述第一标识的值更新为指示所述目标存储单元中缓存有头部信息。
  52. 根据权利要求39所述的装置,其特征在于,所述连续的多个图像块的头部信 息的总数据量根据与所述外部存储器连接的线路的数量以及所述线路的位宽确定。
  53. 根据权利要求39所述的装置,其特征在于,所述连续的多个图像块的头部信息按照所述图像块在所述图像中的位置顺序写入所述外部存储器。
  54. 根据权利要求46所述的装置,其特征在于,所述处理器具体用于:在确定所述存储器中用于缓存所述连续的多个图像块的头部信息的存储单元缓存已满的情况下,将所述存储单元所缓存的头部信息写入外部存储器。
  55. 根据权利要求54所述的装置,其特征在于,每个子区间对应有写入信息,所述写入信息用于指示所述子区间中已写入所述外部存储器中的头部信息;
    所述处理器还用于:在所述将所述存储单元所缓存的头部信息写入外部存储器之后,根据所述存储单元所缓存的头部信息的数量更新所述写入信息。
  56. 根据权利要求54所述的装置,其特征在于,每个所述存储单元对应有第一标识和/或第二标识;
    所述第一标识用于指示所述存储单元中是否缓存有头部信息;所述第二标识用于指示所述存储单元是否缓存已满;
    所述处理器还用于:在所述将所述存储单元所缓存的头部信息写入外部存储器之后,将所述第一标识的值更新为指示所述存储单元中未缓存有头部信息;和/或,将所述第二标识的值更新为指示所述存储单元缓存未满。
  57. 根据权利要求56所述的装置,其特征在于,每个所述存储单元还缓存有数量信息,所述数量信息用于指示所述存储单元中已缓存的头部信息的数量;
    所述处理器还用于:在每个所述存储单元对应有所述第二标识的情况下,在所述数量信息指示的数量为所述存储单元所能存储的最大数量的情况下,将所述第二标识的值更新为指示所述存储单元缓存已满。
  58. 根据权利要求56所述的装置,其特征在于,所述第一标识的值和/或所述第二标识的值均通过寄存器指示。
  59. 一种数据读取装置,其特征在于,包括处理器和存储器;
    所述处理器用于:
    根据待解码图像块在图像中的位置,从外部存储器中读取所述待解码图像块的目标头部信息及其相邻的头部信息;
    对于所述存储器所包括的多个缓存行,根据各个所述缓存行最近一次被命中的时刻到当前时刻的时长,从多个缓存行中确定目标缓存行;
    将所述目标头部信息及其相邻的头部信息缓存至所述目标缓存行中;所述相邻的头部信息用于在解码其他待解码图像块时能够从所述目标缓存行中读取头部信息;
    从所述目标缓存行读出所述目标头部信息。
  60. 根据权利要求59所述的装置,其特征在于,所述目标缓存行为所述多个缓存行中最近一次被命中的时刻到当前时刻的时长最大的一个。
  61. 根据权利要求59所述的装置,其特征在于,所述目标头部信息及其相邻的头部信息的总数据量根据与所述外部存储器连接的线路的数量以及所述线路的位宽确定。
  62. 根据权利要求59所述的装置,其特征在于,所述处理器还用于:
    如果所述存储器中的所有缓存行均未缓存有头部信息、或者所述存储器中缓存有 头部信息的缓存行中未缓存有所述目标头部信息,从外部存储器中读取所述待解码图像块的目标头部信息及其相邻的头部信息。
  63. 根据权利要求62所述的装置,其特征在于,所述处理器还用于:如果所述存储器中缓存有头部信息的缓存行中缓存有所述目标头部信息,将缓存有所述目标头部信息的缓存行确定为所述目标缓存行。
  64. 根据权利要求59或63所述的装置,其特征在于,每个所述缓存行对应有命中标识,所述命中标识用于指示所述缓存行最近是否被命中;
    所述处理器还用于:在所述从所述目标缓存行读出所述目标头部信息之后,更新所述存储器中所有缓存有头部信息的缓存行对应的命中标识。
  65. 根据权利要求64所述的装置,其特征在于,所述命中标识的值与所述缓存行最近一次被命中的时刻到当前时刻的时长成负相关关系。
  66. 根据权利要求64或65所述的装置,其特征在于,所述处理器具体用于:将所述目标缓存行对应的命中标识的值修改为预设最大值,并将缓存有头部信息的其他缓存行对应的命中标识的值减去预设值。
  67. 根据权利要求65或66所述的装置,其特征在于,所述处理器还用于:将所述多个缓存行中命中标识的值最小的一个确定为所述目标缓存行。
  68. 根据权利要求67所述的装置,其特征在于,所述命中标识的值通过寄存器指示。
  69. 根据权利要求59所述的装置,其特征在于,每个所述缓存行对应有占有标识,所述占有标识用于指示所述缓存行中是否缓存有头部信息;
    所述处理器还用于:在所述将所述目标头部信息及其相邻的头部信息缓存至所述目标缓存行中之后,将所述目标缓存行的所述占有标识的值更新为指示所述目标缓存行中缓存有头部信息。
  70. 根据权利要求69所述的装置,其特征在于,所述占有标识的值通过寄存器指示。
  71. 根据权利要求59所述的装置,其特征在于,每个所述缓存行对应有偏移标识,所述偏移标识用于指示所述缓存行中缓存的头部信息在所述外部存储器中的存储位置;
    所述处理器还用于:在所述将所述目标头部信息及其相邻的头部信息缓存至所述目标缓存行中之后,根据所述待解码图像块的目标头部信息及其相邻的头部信息在所述外部存储器中的存储位置,更新所述目标缓存行的所述偏移标识的值。
  72. 根据权利要求71所述的装置,其特征在于,所述偏移标识的值通过寄存器指示。
  73. 根据权利要求59所述的装置,其特征在于,所述目标头部信息用于触发解码器根据所述目标头部信息从所述外部存储器中读取所述待解码图像块对应的码流。
  74. 根据权利要求59所述的装置,其特征在于,在所述图像被多个编码器编码的情况下,所述图像被相应划分成多个区域;
    在所述外部存储器中按照所述区域存储每个区域内的头部信息;
    所述待解码图像块在图像中的位置包括:所述待解码图像块所处区域以及在所述区域中的位置。
  75. 根据权利要求74所述的装置,其特征在于,所述存储器包括:与所述图像的 每个区域对应的子区间;
    每个所述子区间包括有多个缓存行;
    所述处理器还用于:根据所述待解码图像块所处区域,从多个子区间中确定目标子区间;从所述目标子区间所包括的多个缓存行中确定目标缓存行。
  76. 根据权利要求75所述的装置,其特征在于,所述存储器具体包括:与所述图像所处区域以及所述图像的每个颜色分量共同对应的子区间;
    所述目标子区间根据所述待解码图像块所处区域以及所述待解码图像块的颜色分量共同确定。
  77. 一种编码装置,其特征在于,包括一个或多个编码器以及如权利要求39~58任意一项所述的数据存储装置;
    所述编码器用于对图像中的图像块进行编码,产生发送给所述数据存储装置的头部信息以及存储至外部存储器的码流。
  78. 一种解码装置,其特征在于,包括一个或多个解码器以及如权利要求59~76任意一项所述的数据读取装置;
    所述解码器用于根据所述数据读取装置读取的头部信息,从外部存储器读取码流进行解码。
  79. 一种编解码系统,其特征在于,包括如权利要求77所述的编码装置以及如权利要求78所述的解码装置。
  80. 一种图像处理系统,其特征在于,包括一个或多个图像处理装置、如权利要求79所述的编解码系统以及存储器。
  81. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有指令,所述指令被数据存储装置执行时实现如权利要求1至20任意一项所述的数据存储方法,或者所述指令被数据读取装置执行时实现如权利要求21至38任意一项所述的数据读取方法。
PCT/CN2021/079685 2021-03-09 2021-03-09 数据存储方法、数据读取方法、装置、系统及存储介质 WO2022188021A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/079685 WO2022188021A1 (zh) 2021-03-09 2021-03-09 数据存储方法、数据读取方法、装置、系统及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/079685 WO2022188021A1 (zh) 2021-03-09 2021-03-09 数据存储方法、数据读取方法、装置、系统及存储介质

Publications (1)

Publication Number Publication Date
WO2022188021A1 true WO2022188021A1 (zh) 2022-09-15

Family

ID=83227339

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/079685 WO2022188021A1 (zh) 2021-03-09 2021-03-09 数据存储方法、数据读取方法、装置、系统及存储介质

Country Status (1)

Country Link
WO (1) WO2022188021A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008065249A1 (en) * 2006-11-28 2008-06-05 Liquid Air Lab Gmbh Image processing method
CN106331712A (zh) * 2015-06-30 2017-01-11 展讯通信(上海)有限公司 一种视频图像压缩方法
CN106792270A (zh) * 2016-12-08 2017-05-31 广东威创视讯科技股份有限公司 一种视频处理方法及系统
CN110322904A (zh) * 2019-07-05 2019-10-11 南京芯驰半导体科技有限公司 压缩图像信息读取控制方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008065249A1 (en) * 2006-11-28 2008-06-05 Liquid Air Lab Gmbh Image processing method
CN106331712A (zh) * 2015-06-30 2017-01-11 展讯通信(上海)有限公司 一种视频图像压缩方法
CN106792270A (zh) * 2016-12-08 2017-05-31 广东威创视讯科技股份有限公司 一种视频处理方法及系统
CN110322904A (zh) * 2019-07-05 2019-10-11 南京芯驰半导体科技有限公司 压缩图像信息读取控制方法及装置

Similar Documents

Publication Publication Date Title
US11398833B2 (en) Low-latency encoding using a bypass sub-stream and an entropy encoded sub-stream
CN101248430B (zh) 视频处理的转置缓冲
US8908982B2 (en) Image encoding device and image encoding method
JP2009272724A (ja) ビデオ符号化・復号化装置
JP2019521554A (ja) ルマ成分と2つのクロマ成分とを含む入力ビデオを符号化する方法であって、前記方法は、再形成関数に基づく前記入力ビデオの再形成を含む、方法
CN108377394B (zh) 视频编码器的图像数据读取方法、计算机装置及计算机可读存储介质
JP2011077837A (ja) 画像処理装置
US7689047B2 (en) Reduced buffer size for JPEG encoding
US10602174B2 (en) Lossless pixel compression for random video memory access
US10459646B2 (en) Semiconductor device, data processing system, and semiconductor device control method
CN101783958B (zh) Avs视频标准中时域直接模式运动矢量的计算方法和装置
JP2010098352A (ja) 画像情報符号化装置
WO2022188021A1 (zh) 数据存储方法、数据读取方法、装置、系统及存储介质
US8655088B2 (en) Image encoder, image decoder and method for encoding original image data
US20040247185A1 (en) Image processing apparatus and image processing method
US11503299B2 (en) Systems and methods for performing binary arithmetic coding in video coding
US10531125B2 (en) Video compression method and video compressor
CN114257879B (zh) 一种播放视频的方法及系统
US20140185928A1 (en) Hardware-supported huffman coding of images
US20210075440A1 (en) System, Apparatus and Method for Data Compaction and Decompaction
US10026149B2 (en) Image processing system and image processing method
US10271059B2 (en) Decoder, decoding system including the decoder and method of operating the decoder
US11683509B1 (en) Prediction unit skip detection in encoder
US20230024560A1 (en) Systems and methods for performing binary arithmetic coding in video coding
KR100710305B1 (ko) 비디오 디코딩 장치의 데이터 관리기

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: 21929503

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: 21929503

Country of ref document: EP

Kind code of ref document: A1