WO2022206212A1 - Video data storage method and apparatus, and electronic device and readable storage medium - Google Patents

Video data storage method and apparatus, and electronic device and readable storage medium Download PDF

Info

Publication number
WO2022206212A1
WO2022206212A1 PCT/CN2022/077080 CN2022077080W WO2022206212A1 WO 2022206212 A1 WO2022206212 A1 WO 2022206212A1 CN 2022077080 W CN2022077080 W CN 2022077080W WO 2022206212 A1 WO2022206212 A1 WO 2022206212A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
video frame
storage
block
decoder
Prior art date
Application number
PCT/CN2022/077080
Other languages
French (fr)
Chinese (zh)
Inventor
赵娟萍
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2022206212A1 publication Critical patent/WO2022206212A1/en

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
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/137Motion inside a coding unit, e.g. average field, frame or block difference
    • H04N19/139Analysis of motion vectors, e.g. their magnitude, direction, variance or reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/156Availability of hardware or computational resources, e.g. encoding based on power-saving criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/423Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation characterised by memory arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/43Hardware specially adapted for motion estimation or compensation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • H04N19/43Hardware specially adapted for motion estimation or compensation
    • H04N19/433Hardware specially adapted for motion estimation or compensation characterised by techniques for memory access

Definitions

  • the present application relates to the technical field of video processing, and in particular, to a video data storage method, apparatus, electronic device, and computer-readable storage medium.
  • Various embodiments of the present application provide a video data storage method, apparatus, electronic device, and computer-readable storage medium.
  • a video data storage method comprising:
  • the reference video frame of the video frame to be reconstructed does not exist in the external storage of the video coder, and the reference video exists in the main storage external to the video coder frame, reading the reference video frame from the main storage;
  • the reference video frame in main storage is stored in an internal buffer of the video coder.
  • a method for reading video data comprising:
  • motion compensation or block copying is performed after the reference video block is read from the video decoder's external storage.
  • a video data storage device comprising:
  • a reference video frame storage module configured to store the reference video frame read from the main storage into an internal buffer of the video decoder.
  • a video data reading device comprising:
  • the second reading module is configured to, in response to the decoding processing of the acquired video code stream, read the reference video blocks that do not exist in the external storage of the video decoder from the external main storage of the video decoder to Motion compensation or block copying after the video decoder's internal buffering;
  • the third reading module is used for performing motion compensation or block copy after reading the reference video block from the external storage of the video decoder.
  • An electronic device includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the operations of each method.
  • a computer-readable storage medium having a computer program stored thereon, the computer program implementing the operations of each method when executed by a processor.
  • the above-mentioned video data storage method, apparatus, electronic device and readable storage medium in response to the decoding process of the video frame to be reconstructed, there is no reference video frame of the video frame to be reconstructed in the external storage of the video decoder, and in the video frame.
  • the reference video frame is read from the main storage, and the reference video frame read from the main storage is stored in the internal buffer of the video decoder;
  • the video data existing in the external storage of the video decoder is not stored in the internal buffer of the video decoder, and the video data in the main storage is stored in the internal buffer of the video decoder.
  • the decoder Compared with the traditional video data, whether it is located in the external storage or the main storage, the decoder will put it into the internal buffer of the decoder.
  • the internal buffer of the decoder reduces the use of the internal buffer of the video decoder, increases the efficiency of the internal buffer of the decoder, and further reduces the power consumption of the data that is only left in the main storage.
  • FIG. 1 is a schematic structural diagram of a conventional video data storage method in an embodiment.
  • Figure 2 is a conventional video decoder data processing architecture in one embodiment.
  • FIG. 3 is a schematic structural diagram of a conventional video data storage method in another embodiment.
  • FIG. 4 is a schematic diagram of a curve of system power consumption in a conventional manner in one embodiment.
  • FIG. 5 is a flowchart of a video data storage method in one embodiment.
  • FIG. 6 is a schematic structural diagram of video data storage in one embodiment.
  • FIG. 7 is a schematic diagram of an architecture using a system cache in one embodiment.
  • FIG. 8 is a schematic diagram of an architecture using a system buffer in one embodiment.
  • FIG. 9 is a schematic diagram of a decoding process in an embodiment.
  • FIG. 10 is a flowchart of a method for reading video data in one embodiment.
  • FIG. 11 is a schematic flowchart of reconstructing a video frame in one embodiment.
  • FIG. 12 is a schematic diagram of a storage method of internal storage of a conventional video decoder in an embodiment.
  • FIG. 13 is a schematic diagram of a storage method of internal storage of a video decoder in an embodiment.
  • FIG. 14 is a structural block diagram of a video data storage device according to an embodiment.
  • FIG. 15 is a structural block diagram of a video data reading apparatus according to an embodiment.
  • FIG. 16 is a schematic diagram of the internal structure of an electronic device in one embodiment.
  • first, second, etc. used in this application may be used herein to describe various data, but these data are not limited by these terms. These terms are only used to distinguish the first data from another.
  • first order condition may be referred to as the second order condition
  • second order condition may be referred to as the first order condition.
  • Both the first degree condition and the second degree condition are degree conditions, but they are not the same degree condition.
  • FIG. 1 it is a schematic structural diagram of a traditional video data storage manner in one embodiment.
  • Figure 1 includes a central processing unit (Central Processing Unit, CPU), a video decoder (Video Decoder, VDEC), a display processor (Display Processing Unit) and a dynamic random access memory controller (DRAM Controller, DRAMC).
  • the central processing unit includes a master port (master)
  • the video decoder includes an internal cache (cache) and a master port (master)
  • the display processor includes a master port (master)
  • the dynamic random access memory controller includes Including the slave port (slave).
  • Arrows in FIG. 1 represent video data.
  • the video decoder can obtain the video data from the dynamic random access memory controller for video decoding, reconstruct the video frame, and transmit the reconstructed video frame to the display processor for display.
  • FIG. 2 is a conventional video decoder data processing architecture in one embodiment.
  • Temporal data such as Temporal Motion Vector (TMV).
  • TMV Temporal Motion Vector
  • FIG. 3 is a schematic structural diagram of a conventional video data storage method in another embodiment.
  • the figure includes a central processing unit, a video decoder, a display processor and a multi-channel dynamic random access memory controller (Multi-channel DramCtrl).
  • the multi-channel dynamic random access memory controller can be used to control multiple dynamic random access memories ( DRAM).
  • FIG. 4 is a schematic diagram of a curve of system power consumption in a conventional manner in one embodiment.
  • the abscissa is the position in the image (Picture Position), and the ordinate is the system power.
  • the dotted line represents the System Power Barrier.
  • the system DRAM consumes relatively high system power in order to meet the operating speed requirements of the video decoder.
  • the speed of the video decoder cannot meet the demand or the system overheats due to the limited power consumption that the system can provide.
  • the traditional approach would result in higher power consumption for the video decoder when it finishes at the expected time.
  • an embodiment of the present application provides a video data storage method.
  • the reference video frame and if there is a reference video frame in the external main storage of the video decoder, read the reference video frame from the main storage; store the reference video frame read from the main storage to the video decoder In the internal buffer of the decoder; compared with the traditional video data, whether it is located in the external storage or the main storage, the decoder will put it into the internal buffer of the decoder.
  • the video data stored in the main storage is put into the internal buffer of the decoder, which reduces the use of the internal buffer of the video decoder and increases the efficiency of the internal buffer of the decoder. Power consumption is reduced.
  • FIG. 5 is a flowchart of a video data storage method in one embodiment.
  • the video data storage method in this embodiment is described by taking the operation on an electronic device as an example. As shown in FIG. 5 , the video data storage method includes operations 502 to 504 .
  • Operation 502 in response to the decoding process of the video frame to be reconstructed, the reference video frame of the video frame to be reconstructed does not exist in the external storage of the video coder, and the reference video frame exists in the main storage external to the video coder , the reference video frame is read from main storage.
  • the video frame to be reconstructed refers to a video frame that has not been successfully constructed yet. After the video is compressed, if the video frame needs to be obtained, it needs to be decoded.
  • the video coder's external storage refers to storage located in the electronic device and other than the main storage and the video coder's internal cache.
  • the external storage of the video decoder may be at least one of a system cache and a system buffer.
  • Main memory refers to the main memory (Main memory), referred to as the main memory.
  • the main storage is an important part of computer hardware, its function is to store instructions and data, and can be directly accessed randomly by the central processing unit (CPU).
  • the main storage may specifically be DRAM (Dynamic Random Access Memory, dynamic random access memory).
  • the reference video frame can be used to reconstruct the target video frame corresponding to the video frame to be reconstructed.
  • the reference video frame may be a video frame displayed before or after the video frame to be reconstructed.
  • the reference video frame is specifically the video frame that has been reconstructed before the video frame to be reconstructed, or the reference video frame can also be the reconstructed part of the video frame to be reconstructed itself, such as for intra-block copying in the screen content coding technology. copy) of the block vector (block vector) to distinguish the range of the picture to be accessed.
  • the specification of the reference picture range allowed in the screen content coding technology has been described in detail in various video standards, and will not be repeated here.
  • the electronic device acquires the target motion vector or block vector corresponding to the to-be-reconstructed video frame. It is detected whether a reference video frame of the video frame to be reconstructed exists in the external storage of the video coder. In the case that the reference video frame corresponding to the target motion vector or block vector does not exist in the external storage of the video decoder, and the reference video frame exists in the main storage external to the video decoder, the electronic device removes the The reference video frame is read, and the read reference video frame is stored in the internal buffer of the video decoder.
  • the reference video frame read from the main storage is stored into an internal buffer of the video decoder.
  • the electronic device stores the reference video frames read from the main storage into the internal buffer of the video decoder.
  • the reference video frame of the video frame to be reconstructed in response to the decoding process of the video frame to be reconstructed, does not exist in the external storage of the video decoder, and the reference video frame of the video frame to be reconstructed does not exist in the external storage of the video decoder.
  • the reference video frame is read from the main storage, and the reference video frame read from the main storage is stored in the internal buffer of the video decoder, that is, in the video decoder's internal buffer.
  • the video data existing in the external storage is not stored in the internal buffer of the video decoder, and the video data in the main storage will be stored in the internal buffer of the video decoder.
  • the decoder Compared with the traditional video data, whether it is located in the external storage or the main storage, the decoder will put it into the internal buffer of the decoder.
  • the internal buffer of the decoder reduces the use of the internal buffer of the video decoder, increases the efficiency of the internal buffer of the decoder, and further reduces the power consumption of the data that is only left in the main storage.
  • FIG. 6 it is a schematic diagram of the architecture of video data storage in one embodiment.
  • the white part indicates that it is stored in DRAM, that is, this part of the data will be stored in the internal buffer of the video decoder later, and the gray part indicates that it is stored in the external storage of the video decoder.
  • some of the video bit stream, video frame data, and temporary data in FIG. 6 are stored in the DRAM, and some are stored in the external storage of the video decoder.
  • each video frame is divided into multiple blocks.
  • the reference video frame of the video frame to be reconstructed does not exist in the external storage of the video decoder, and if the reference video frame exists in the main storage external to the video decoder, the reference video frame is read from the main storage, include:
  • the reference video block corresponding to the video frame to be reconstructed does not exist in the external storage of the video decoder, and if the reference video block exists in the external main storage of the video decoder, read from the main storage Refer to the video block.
  • the storing of the reference video frames read from the main storage into the internal buffer of the video decoder includes: storing the reference video blocks read from the main storage into the internal buffer of the video decoder.
  • the block refers to a part of the video frame.
  • the size of the block may be 16 ⁇ 16 pixels, 64 ⁇ 64 pixels, etc., but not limited thereto.
  • the electronic device divides each video frame in the video into a plurality of blocks, and obtains motion vectors corresponding to each block.
  • the electronic device determines, based on the motion vector of the current block in the current video frame, the reference video block in the reference video frame referenced by the video frame to be reconstructed.
  • the electronic device retrieves the data from the main storage. Read the reference video block.
  • the electronic device stores the reference video block read from the main storage into an internal buffer of the video decoder.
  • the electronic The device reads the reference video block from the main storage and stores it in the internal buffer of the video decoder. Since the internal buffer in the video decoder is small, the storage block method is more suitable for the internal buffer in the video decoder. Cache to improve the accuracy of video data storage.
  • the video data storage method further comprises: if the reference video frame exists in the external storage of the video decoder, reading the reference video frame from the external storage of the video decoder.
  • the electronic device reads the reference video frame from the external storage of the video decoder, and based on the reading from the external storage of the video decoder
  • the target video frame corresponding to the to-be-reconstructed video frame is obtained by reconstructing the reference video frame of .
  • the reference video frame when there is a reference video frame in the external storage of the video decoder, the reference video frame is read from the external storage of the video decoder, and data access is performed through the external storage of the video decoder,
  • the efficiency of the internal cache of the decoder can be increased, and further power consumption can be reduced specifically for the data that is still only in the main storage.
  • the reference video frame of the video frame to be reconstructed in response to the decoding process of the video frame to be reconstructed, does not exist in the external storage of the video coder and in the main storage external to the video coder In the presence of a reference video frame, before reading the reference video frame from the main storage, the video data storage method further includes:
  • a motion vector corresponding to each video frame in the video is obtained in response to the decoding process of the obtained video.
  • the types of videos are not limited. For example, it may be a downloaded video stored locally on the electronic device, or it may be a video obtained from a server.
  • the video may be a TV series video, a movie video, a TV series video, and the like.
  • the length of the video is not limited, for example, it can be 10 seconds, 1 minute, 10 minutes, etc. without limitation.
  • the decoding process refers to the process of decoding and restoring the encoded video to reconstruct the video frame.
  • the decoding process may also be referred to as a decoding process.
  • Motion Vector (MV) represents the relative displacement between the block of the current video frame and its matching block in the reference image.
  • a block vector (Block Vector, BV) represents the relative displacement between a block of the current video frame and its reconstructed matching block in the current image frame.
  • the electronic device in response to the decoding process of the acquired video, obtains the motion vector corresponding to each video frame in the video through a video decoder. It can be understood that, in response to the decoding processing of the acquired video, the electronic device performs decoding processing on some video frames in the video to obtain the motion vector corresponding to each video frame. For example, a video includes 100 video frames, and the electronic device may perform a decoding process on the first 50 video frames of the 100 video frames.
  • the reference times of each video frame is determined based on the motion vector corresponding to each video frame.
  • the number of times of being referenced refers to the number of times that the video frame is referenced by other video frames during reconstruction of the video frame.
  • the video frame A is referenced by the video frame B to be reconstructed, the video frame C to be reconstructed...
  • the video frame Z to be reconstructed is referenced 26 times in total.
  • the electronic device determines the reference video frame corresponding to each video frame based on the motion vector corresponding to each video frame in the video, and counts the number of times the reference video frame is referenced.
  • video frame X is referenced by video frame Y and video frame Z
  • video frame X is used as the reference video frame of video frame Y and video frame Z
  • video frame X is The number of references is 2 times.
  • the video frames whose reference times satisfy the condition of the first number of times are stored in the external main storage of the video decoder.
  • condition of the first number of times can be adjusted as required.
  • the number of times represented by the first degree condition is smaller than the number of times represented by the second degree condition. For example, satisfying the first degree condition is equal to 1.
  • the electronic device stores the video frames whose reference times satisfy the condition of the first number of times into the main storage outside the video decoder.
  • Subsequent video coders may read video frames that satisfy the first number of conditions from main storage and store them in an internal buffer of the video coder.
  • the video frames whose reference times satisfy the second number condition are stored in the external storage of the video decoder; wherein the number represented by the second number condition is greater than the number represented by the first number condition.
  • the second order condition can be adjusted as required.
  • the number of times represented by the second degree condition is greater than the number of times represented by the first degree condition. For example, if the number of times to be referenced satisfies the first number of times condition, the number of times to be referenced satisfies 1, and the number of times to be referenced satisfies the second condition is that the number of times to be referenced satisfies more than 1.
  • the number of times to be referenced satisfies the condition of the first number of times, the number of times to be referenced is less than or equal to 2, and the number of times to be referenced satisfies the condition of the second number of times is that the number of times to be referenced is greater than 2, and so on.
  • the electronic device stores the video frames whose reference times satisfy the condition of the second number of times into the external storage of the video decoder.
  • External storage of the video coder refers to storage located in the electronic device but not in the video coder.
  • the external storage of the video decoder may be an on-chip memory.
  • the external storage of the video decoder may be at least one of a system cache and a system buffer.
  • the motion vector corresponding to each video frame in the video is obtained, and the reference times of each video frame is determined based on the motion vector of each video frame, then It can be known how many times the video frame is to be used; the video frame whose number of references meets the condition of the first number of times is stored in the internal buffer of the video decoder, and the video frame whose number of times of reference meets the condition of the second number of times is stored in the video
  • the video frames that have been referenced less frequently are stored in the internal buffer of the video decoder, and the video frames that have been referenced more frequently are stored in the external storage of the video decoder.
  • the use of the decoder's internal cache utilizes low-power external storage, thereby reducing the power consumption of electronic equipment.
  • the internal buffer of the video decoder is limited, the video frames that are used less frequently are buffered in the video decoder, and these video frames in the external buffer can be updated faster, and the external buffer can be fully utilized to speed up the decoding. code processing.
  • the external storage of the video coder includes at least one of a system cache or a system buffer.
  • the system cache (system cache) and the system cache area (system buffer) both belong to the on-chip memory (on-chip memory). And both the system cache and the system cache area belong to static random-access memory (Static Random-Access Memory, SRAM).
  • SRAM static random-access memory
  • determining the reference times of each video frame based on the motion vector corresponding to each video frame includes: determining the reference video frame referenced by the current video frame based on the motion vector of the current video frame; number of references.
  • the electronic device performs decoding processing on the acquired video, and firstly decodes to obtain the motion vector of the video frame.
  • the motion vector of the video frame is used to represent the displacement between the current video frame and the reference video frame.
  • the electronic device determines the reference video frame referenced by the current video frame based on the motion vector of the current frame, and counts the reference times of the reference video frame, then the reference times of each video frame can be obtained.
  • the current video frame is video frame C
  • the reference video frames referenced by video frame C are video frame A and video frame B as an example for description.
  • the reference times of the video frame A is 1 at this time
  • the reference times of the video frame B is also 1.
  • the reference times of video frame A is 2, and the reference times of video frame B is also is 2, which can obtain the reference times of each video frame in the video.
  • the reference video frame referenced by the current video frame is determined based on the motion vector of the current video frame, and the number of times the reference video frame is referenced is counted, that is, the current video frame and the motion vector are known. , the reference video frame referenced by the current video frame can be obtained, and the reference times of each video frame in the video can be obtained, and the video data will be stored based on the reference times.
  • the storage or the main storage will be put into the internal buffer of the decoder by the decoder. In this embodiment, only the video data that does not exist in the external storage and exists in the main storage needs to be put into the internal buffer of the decoder, reducing the number of video data.
  • the use of the internal buffer of the decoder increases the efficiency of the internal buffer of the decoder, and further reduces the power consumption especially for the data still only in the main storage.
  • the video data storage method further includes: when the number of video frames between the current video frame and the target reference video frame reaches a preset number, stopping counting the number of times the target reference video frame is referenced, and obtaining the The number of times the target reference video frame has been referenced.
  • the preset number can be set according to actual needs.
  • the preset number is used to characterize the number of maximum interval frames between the video frame and the reference video frame. Since there are generally not too many frames between the current video frame and the referenced video frame, when the number of video frames between the current video frame and the target reference video frame reaches the preset number, the video frames after the current video frame The frame generally does not refer to the target reference video frame, so the reference times of the target reference video frame can be directly obtained.
  • each frame of video frame is divided into multiple blocks; determining the reference video frame referenced by the current video frame based on the motion vector of the current video frame, including: based on the motion vector of the current block in the current video frame , to determine the reference video block in the reference video frame referenced by the current video frame.
  • Counting the reference times of the reference video frame includes: counting the reference times of the reference video block in the reference video frame.
  • the video frame that satisfies the condition of the first number of times is stored in the external main storage of the video decoder, including: the reference video block that satisfies the condition of the first number of times is stored in the video decoder. in external primary storage.
  • Storing the video frames that meet the condition of the second number of times to be referenced in the external storage of the video decoder includes: storing the reference video blocks that meet the condition of the second number of times to be referenced in the external storage of the video decoder.
  • the block refers to a part of the video frame.
  • the size of the block may be 16 ⁇ 16 pixels, 64 ⁇ 64 pixels, etc., but not limited thereto.
  • the electronic device divides each video frame in the video into a plurality of blocks, and obtains motion vectors corresponding to each block.
  • the electronic device determines, based on the motion vector of the current block in the current video frame, the reference video block in the reference video frame referenced by the current video frame.
  • the electronic device counts the number of times the reference video block is referenced.
  • the electronic device stores the reference video block whose number of references meets the condition of the first number of times in the internal buffer of the video decoder.
  • the electronic device stores the reference video blocks whose number of references meets the condition of the second number of times in the external storage of the video decoder.
  • the reference video block to be referenced is determined based on the motion vector of the current block, the reference times of the reference video block are counted, and the reference video blocks whose reference times satisfy the condition of the first times are stored in the In the main storage, the reference video block that satisfies the condition of the second number of times by reference is stored in the external storage of the video decoder, then the reference video block referenced can be determined based on the current block, and the stored video data is more accurate , since the internal buffer in the video decoder is small, the storage block method is more suitable for the internal buffer in the video decoder.
  • FIG. 7 it is a schematic diagram of the architecture of using a system cache in one embodiment.
  • These include the central processing unit, video decoder, display processor, dynamic random access memory controller and system cache.
  • the system cache can obtain data from DRAMC.
  • the system cache size in Figure 7 is 4MB (megabytes).
  • the system cache is a kind of SRAM (Static Random-Access Memory).
  • the motion vector corresponding to each video frame in the video is obtained by the video decoder, and the reference times of each video frame is determined based on the motion vector corresponding to each video frame;
  • the video frames whose reference times meet the conditions of the first times are read from DRAM and stored in the internal buffer of the video decoder; some video frames whose reference times meet the conditions of the second times are read from DRAM and stored in the system cache.
  • the system cache may not be directly connected to the DRAMC, and FIG. 6 is just an example.
  • FIG. 8 it is a schematic diagram of the architecture of using the system buffer area in one embodiment.
  • These include the central processing unit, video decoder, display processor, dynamic random access memory controller, and system buffer.
  • the system cache size in Figure 7 is 4MB (megabytes).
  • the system buffer is a type of SRAM (Static Random-Access Memory).
  • the motion vector corresponding to each video frame in the video is obtained by the video decoder, and the reference times of each video frame is determined based on the motion vector corresponding to each video frame;
  • the video frames whose reference times meet the conditions of the first times are read from DRAM and stored in the internal buffer of the video decoder; the video frames whose reference times meet the conditions of the second times are directly stored in the system cache.
  • the video data storage method further includes: in the case that the internal buffer in the video decoder is full and a new video frame is stored, deleting the least important video frame in the internal buffer.
  • the electronic device deletes the least important video frame in the internal buffer, so as to ensure that the video decoder can always Store data to ensure the operation of the video decoder.
  • Least important can be the oldest video frame, or it can be judged in other ways.
  • FIG. 9 it is a schematic diagram of a decoding process in one embodiment.
  • the figure includes I-frames, B-frames and P-frames.
  • the I frame belongs to intra-frame compression, and only the information of the I frame itself needs to be used during decoding.
  • the P frame is a forward predictive coded frame, that is, when the P frame is decoded, it is necessary to refer to the information of the previous relevant frame before decoding.
  • the B frame is a bidirectional predictive coding frame, and it is necessary to refer to both the previous frame and the frame to be decoded later when decoding. It will be appreciated that some video standards allow both reference objects of a B-frame to be previous frames.
  • the display order is the order from left to right as shown in FIG. 9 .
  • the decoding order (Decoding Order) is the order of 0, 3, 2, 4, 1, 7, 6, 8, and 5 in FIG. 9 .
  • the decoding order in FIG. 9 is not the same as the display order.
  • the arrows indicate references, such as the B frame of display order 2, which is reconstructed by referring to the I frame of display order 0 and the P frame of display order 1, and the B frame of display order 2 can be used as display order 1 and display order. 3 frames of reference video frames. From this, video frames of the video can be reconstructed.
  • the blank part in the figure indicates that it is stored in DRAM, that is, it will be stored in the internal buffer of the video decoder later.
  • Parts in gray indicate storage in the video decoder's external storage. Then the I frame of display order 0, the B frame of display order 2, the B frame of display order 3, the P frame of display order 4, the B frame of display order 6 and the B frame of display order 8 all have partial blocks stored in the video. In the external storage of the decoder, another part is stored in the DRAM or the internal buffer of the video decoder. The B frames of display order 1, the B frames of display order 5, and the B frames of display order 7 are all stored in the DRAM.
  • the decoder After performing some analysis on the video, it is known which frames or which blocks are not suitable for storing in DRAM, or in other words, not suitable for storing in the internal cache of the video decoder, then it is suitable for storing in the video decoder.
  • the external storage outside the device such as at least one of the system cache and the system buffer.
  • the decoder will make proper use of the internal buffer of the decoder, so that the data that only exists in the external main storage of the video decoder can survive for a longer time in the internal buffer of the decoder, so as to reduce the cost of System bandwidth to achieve the ultimate power saving purpose.
  • the basic concept of the embodiments of the present application is to make proper use of each available on-chip memory (on-chip memory, that is, the external storage and internal storage of the video decoder) to reduce the amount of DRAM access.
  • the internal buffering strategy of the video decoder is Changes to be made when assisted by other on-chip memory. Store the entire reference video frame in the video or a partial block of a reference video frame, and store the data that will be reused relatively many times in the low-power storage space such as the system cache or system buffer, and the rest only needs to be The data that cannot be put into the cache or the system buffer will be transferred to the internal buffer of the video decoder for processing.
  • a video data storage method comprising:
  • the reference video block in the reference video frame referenced by the current video frame is determined based on the motion vector of the current block in the current video frame.
  • the reference video blocks whose reference times satisfy the condition of the first times are stored in the external main storage of the video decoder.
  • the reference video blocks whose reference times satisfy the condition of the second times are stored in the external storage of the video decoder.
  • the number of times represented by the second order condition is greater than the number of times represented by the first order condition.
  • the reference video block corresponding to the video frame to be reconstructed does not exist in the external storage of the video decoder, and the main storage outside the video decoder does not exist If there is a reference video block in the , the reference video block is read from the main storage.
  • the external storage of the video decoder includes at least one of a system cache or a system buffer.
  • the read reference video block is stored in the internal buffer of the video decoder.
  • the motion vector corresponding to each video frame in the video is obtained, and the reference times of each video frame is determined based on the motion vector of each video frame, then It can be known that the video frame is to be used several times; the video frame that meets the condition of the first number of times is stored in the internal buffer of the video decoder, and the video frame that meets the condition of the second number of times is stored in the decoder.
  • the video frames that have been referenced less frequently are stored in the internal buffer of the video decoder, and the video frames that have been referenced more frequently are stored in the external storage of the decoder.
  • the decoder will put it into the internal buffer of the decoder. In this embodiment, it is only necessary to put the video data that does not exist in the external storage and exists in the main storage into the decoder.
  • the cache reduces the use of the internal cache of the video decoder, increases the efficiency of the internal cache of the decoder, and further reduces power consumption for data that is still only in the main storage.
  • the internal buffer of the video decoder is limited and the processing speed of the decoding processing through the internal buffer is fast, the video frames that are used less frequently are buffered in the video decoder, and the speed at which these buffered video frames are updated can be improved. Faster, can fully utilize the buffer of the video coder to speed up the decoding process.
  • FIG. 10 is a flowchart of a method for reading video data in one embodiment.
  • the video data storage method in this embodiment is described by taking the operation on an electronic device as an example. As shown in FIG. 10 , the video data storage method includes operations 1002 to 1004 .
  • Operation 1002 in response to a decoding process on the acquired video code stream, read a reference video block that does not exist in the external storage of the video decoder from the main storage outside the video decoder to the video decoder's external storage. Motion compensation or block copying after internal caching.
  • the main storage refers to the main storage of the electronic device.
  • the main storage may be, for example, DRAM.
  • Motion Compensation also known as motion compensation, is a method to describe the difference between nearby frames (nearby means nearby in the coding relationship, and two frames may not be nearby in the playback order). Specifically, it describes the previous one. How each small block of the frame is moved to a certain position in the video frame to be reconstructed.
  • the electronic device acquires the target motion vector of the video frame to be reconstructed; the electronic device reads from the external main storage of the video decoder according to the target motion vector, which does not exist in the video decoder.
  • the reference video block stored outside the video decoder is stored in the internal buffer of the video decoder to perform motion compensation; the reference video block is the block of the video frame referenced by the video frame to be reconstructed.
  • the electronic device obtains the block vector of the video frame to be reconstructed; according to the block vector, the reference video block that does not exist in the external storage of the video decoder is read from the main storage to the internal buffer of the video decoder and then performs block copying.
  • the video frame to be reconstructed refers to a video frame that has not been successfully constructed yet.
  • the target motion vector of the video frame to be reconstructed represents the displacement between the current video frame and the reference video block.
  • the video data stored in the video decoder's internal buffer and the video decoder's external storage may or may not be the same.
  • the video contains 100 video frames, which are video frame 1, video frame 2, video frame 3...video frame 100 respectively.
  • the internal buffer of the video decoder includes video frame 1...video frame 50
  • the external storage of the video decoder includes video frame 51, video frame 52...video frame 100.
  • Operation 1004 or perform motion compensation or block copy after reading the reference video block from the external storage of the video decoder.
  • the electronic device performs motion compensation after reading the reference video block from the external storage of the video decoder.
  • the electronic device reads the reference video block from the external storage of the video decoder, and reconstructs the target video frame based on the read reference video block. For example, the electronic device performs weighted fusion reconstruction on the read reference video block to obtain the target video frame.
  • the electronic device performs block copy after reading the reference video block from the external storage of the video decoder.
  • the reference video block that does not exist in the external storage of the video decoder is read from the main storage to the video decoding.
  • Motion compensation or block copy is performed after the internal buffer of the video decoder, or motion compensation or block copy is performed after the reference video block is read from the external storage of the video decoder, that is, part of the video can be read from the outside of the video decoder.
  • Data, using low-power external storage also reduces the use of the video decoder's internal buffer to reduce the power consumption of electronic equipment.
  • a reference video block that does not exist in the external storage of the video coder is read from the main storage external to the video coder to the video coder.
  • the motion compensation is performed after the internal buffer of the video decoder; or the motion compensation or block copy is performed after reading the reference video block from the external storage of the video decoder, including:
  • the reference video block is found from the external main storage of the video decoder, and the reference video block is read from the main storage to the interior of the video decoder Motion compensation or block copying after caching.
  • the electronic device searches for the corresponding reference video block from the external storage of the video decoder according to the target motion vector of the video frame to be reconstructed.
  • motion compensation or block copying is performed after reading the reference video block corresponding to the video frame to be reconstructed from the external storage.
  • the electronic device finds the reference video block corresponding to the video frame to be reconstructed from the main storage, and reads the reference video from the main storage Motion compensation or block copying is performed after the block is stored in the video decoder's internal buffer.
  • the reference video block is a part of the video area in the reference video frame.
  • the number of reference video blocks corresponding to the video frame to be reconstructed is not limited. For example, it may be 1, 2, 3... but not limited thereto.
  • the electronic device searches for the corresponding reference video block from the system cache according to the target motion vector of the video frame to be reconstructed.
  • the system cache finds the corresponding reference video block
  • the reference video block corresponding to the video frame to be reconstructed is read from the system cache. If the reference video block corresponding to the video frame to be reconstructed is not found in the system cache, the reference video block corresponding to the video frame to be reconstructed is found from the DRAM, and the reference video is read from the main storage Motion compensation is performed after the block is sent to the VDEC cache.
  • the reference video blocks corresponding to the remaining video frames to be reconstructed are searched from the main storage, and the reference video blocks corresponding to the remaining video frames to be reconstructed are searched from the main storage.
  • the reference video block is read from the storage to the internal buffer of the video decoder for motion compensation or block copying.
  • the reference video block when the reference video block is found from the external storage of the video decoder, motion compensation or block copy is performed after reading the reference video block from the external storage; the reference video block is not found in the external storage.
  • find the reference video block from the external main storage of the video decoder find the reference video block from the main storage, read the reference video block from the main storage to the video
  • the internal buffer of the decoder performs motion compensation or block copy; the internal buffer of the video decoder reads only the data from the main storage, compared with the data stored in the internal buffer of the traditional video decoder and the external storage.
  • the data consistency method can save unnecessary buffering operations inside the video decoder, and because the amount of video data buffered in the video decoder is small, the bandwidth of the main storage can be further reduced, thereby reducing the power consumption of electronic equipment.
  • the video data reading method further includes: in response to decoding processing of the acquired video, obtaining a motion vector corresponding to each video frame in the video; determining each video frame based on the motion vector corresponding to each video frame The number of times the frame is referenced; the video frame whose number of times to be referenced meets the condition of the first number of times is read from the external main storage of the video decoder and stored in the internal buffer of the video decoder; The video frame of the number of times is stored in the external storage of the video decoder; the number of times represented by the second-order condition is greater than the number of times represented by the first-time condition.
  • the motion vector corresponding to each video frame in the video is obtained, and the number of times each video frame is referenced is determined based on the motion vector of each video frame, then the video frame can be known.
  • the video frame can be known. To be used several times; store the video frames that meet the condition of the first number of times from the main storage to the internal buffer of the video decoder, and store the video frames that meet the condition of the second number of times to the decoder
  • the video frames that have been referenced less frequently are stored in the internal buffer of the video decoder, and the video frames that have been referenced many times are stored in the external storage of the decoder; the internal buffer of the video decoder is reduced.
  • the use of low-power external storage reduces the power consumption of electronic devices.
  • the internal buffer of the video decoder is limited, the video frames that are used less frequently are buffered in the video decoder, and these video frames in the external buffer can be updated faster, and the external buffer can be fully utilized to speed up the decoding. code processing.
  • the external storage of the video decoder includes at least one of a system cache, a system buffer.
  • the system cache (system cache) and the system cache area (system buffer) both belong to the on-chip memory (on-chip memory).
  • both the system cache and the system cache area belong to static random-access memory (Static Random-Access Memory, SRAM).
  • SRAM static random-access memory
  • FIG. 11 it is a schematic flowchart of reconstructing a video frame in one embodiment. It includes A video frame 1102, B video frame 1104, C video frame 1106, and to-be-reconstructed video frame 1108, and A video frame 1102, A video frame 1104, and A video frame 1106 are all video frames that have been reconstructed, and are to be reconstructed. Video frame 1108 has not yet been reconstructed. Among them, the white parts in the A video frame 1102, the A video frame 1104 and the A video frame 1106 are stored in the DRAM, that is, stored in the internal buffer of the video decoder; the blocks in the gray shaded part are stored in the video decoder. in the external storage of the encoder.
  • the A video frame 1102 , the B video frame 1104 and the C video frame 1106 are all reference video frames of the video frame 1108 to be reconstructed.
  • different blocks of a video frame can be stored in different stores.
  • the block of 16 ⁇ 16 and the video frame 1108 to be reconstructed as a B frame are taken as an example for description.
  • a small square in the video frame to be reconstructed represents a current block.
  • the reference blocks in Figure 11 are not reused.
  • the electronic device obtains the 1st, 2nd, 3rd, 4th, 5th, 6th and 7th sub-target motion vectors of the video frame to be reconstructed, and can determine the reference based on the sub-target motion vectors block.
  • the first block of the video frame 1108 to be reconstructed can be reconstructed from the 0 block in the A video frame 1102 and the 1 block in the A video frame 1104 .
  • the second block of the video frame 1108 to be reconstructed can be reconstructed from 2 blocks in the A video frame 1102 and 3 blocks in the A video frame 1106 .
  • the third block of the video frame 1108 to be reconstructed can be reconstructed from 4 blocks in the A video frame 1104 and 5 blocks in the A video frame 1104 .
  • the fourth block of the video frame 1108 to be reconstructed can be reconstructed from 6 blocks in the A video frame 1104 and 7 blocks in the A video frame 1106 .
  • the fifth block of the video frame 1108 to be reconstructed can be reconstructed from 8 blocks in the A video frame 1102 and 9 blocks in the A video frame 1104 .
  • the sixth block of the video frame 1108 to be reconstructed can be reconstructed from the A block in the A video frame 1104 and the B block in the A video frame 1106 .
  • the seventh block of the to-be-reconstructed video frame 1108 can be reconstructed from the C block of the A video frame 1102 and the D block of the A video frame 1104 .
  • FIG. 12 it is a schematic diagram of a storage manner of internal storage of a conventional video decoder in one embodiment.
  • the storage method of the internal storage of the video decoder in FIG. 12 stores the blocks in sequence.
  • the first step stores block 0, and the second step stores blocks 1, 2, 3, 4, 5, 6, and 7.
  • the third step stores blocks 6, 7. , 8, 9, A, B, C and D. That is to say, the internal buffer of the video decoder in Figure 12 will temporarily store the blocks read from any area, whether it is read from DRAM (white part) or from outside the video decoder Stored (gray section) read.
  • the video data that does not need the internal buffer of the video decoder at all to save the throughput of the DRAM is also stored in the internal buffer of the video decoder, which wastes the read and write energy consumption of the internal buffer of the video decoder.
  • FIG. 13 it is a schematic diagram of a storage manner of internal storage of the video decoder in one embodiment.
  • the white part in the internal buffer of the video decoder refers to the block originally stored in the DRAM, that is, the block that will be subsequently stored in the internal buffer of the video decoder.
  • the internal buffer of the video decoder of FIG. 13 only stores blocks from DRAM.
  • the blocks stored in the external storage of the video decoder and the blocks stored in the internal buffer of the video decoder will not be stored repeatedly, and the blocks stored in the DRAM are distinguished and stored in the DRAM
  • the block is read into the internal buffer of the video decoder, and another part of the block is stored in the external storage of the video decoder, so that the reading of the DRAM is reduced as a whole during the decoding process, and the bandwidth of the DRAM is reduced.
  • Reduce power consumption of electronic equipment In the system buffer/cache, the data itself is power-saving, and the access speed is fast and controllable. If such data is cached again by using the VDEC internal cache, it will not help the decoding speed and consume more energy for accessing the SRAM.
  • the remaining data that is not stored in the system cache/buffer will enter the VDEC internal cache to save DRAM bandwidth.
  • Table 1 is a schematic diagram of the difference in energy consumption between SRAM and DRAM in one embodiment.
  • the power consumption of SRAM (Static Random-Access Memory, static random access memory) is about 5PJ (picojoule), while the power consumption of DRAM is about 640PJ (picojoule), the difference between the two is two orders of magnitude.
  • the relative energy consumption of SRAM is 10 2
  • the relative energy consumption of DRAM is 10 4
  • the difference between the two is 2 orders of magnitude.
  • FIG. 14 is a structural block diagram of a video data storage device according to an embodiment.
  • a video data storage device includes a first reading module 1402 and a reference video frame storage module 1404, wherein:
  • the first reading module 1402 is configured to respond to the decoding process of the video frame to be reconstructed, the reference video frame of the video frame to be reconstructed does not exist in the external storage of the video decoder, and the main external storage of the video decoder does not exist. Reading the reference video frame from main storage if the reference video frame exists in storage; and
  • the reference video frame storage module 1404 is used for storing the reference video frame read from the main storage into the internal buffer of the video decoder.
  • the reference video frame of the video frame to be reconstructed in response to the decoding process of the video frame to be reconstructed, does not exist in the external storage of the video decoder, and the reference video frame of the video frame to be reconstructed does not exist in the external storage of the video decoder.
  • the reference video frame is read from the main storage, and the reference video frame read from the main storage is stored in the internal buffer of the video decoder, that is, in the video decoder's internal buffer.
  • the video data in the external storage is not stored in the internal buffer of the video decoder, and the video data in the main storage will be stored in the internal buffer of the video decoder.
  • the main storage will be put into the internal buffer of the decoder by the decoder.
  • only the video data that does not exist in the external storage and exists in the main storage needs to be put into the internal buffer of the decoder, reducing the number of video decoders.
  • the use of the internal cache increases the efficiency of the internal cache of the decoder, and further reduces power consumption specifically for the data that remains only in the main storage.
  • each video frame is divided into multiple video blocks.
  • the first reading module 1402 is used for the situation that the reference video block corresponding to the video frame to be reconstructed does not exist in the external storage of the video decoder, and the reference video block exists in the external main storage of the video decoder Next, the reference video block is read from the main storage.
  • the reference video frame storage module 1404 is used for storing the reference video blocks read from the main storage into the internal buffer of the video decoder.
  • the reference video block corresponding to the video frame to be reconstructed does not exist in the external storage of the video decoder, and if the reference video block exists in the main storage, the electronic device reads from the main storage Refer to the video block and store it in the internal cache of the video decoder. Since the internal cache in the video decoder is small, the storage block is more suitable for the internal cache in the video decoder, improving the storage capacity of video data. precision.
  • the first reading module 1402 is further configured to read the reference video frame from the external storage of the video coder if the reference video frame exists in the external storage of the video coder.
  • the reference video frame when there is a reference video frame in the external storage of the video decoder, the reference video frame is read from the external storage of the video decoder, and data access is performed through the external storage of the video decoder,
  • the efficiency of the internal cache of the decoder can be increased, and further power consumption can be reduced specifically for the data that is still only in the main storage.
  • the video data storage device further includes a motion vector acquisition module, a number of times determination module, a first storage module and a second storage module, wherein:
  • a motion vector acquisition module used for obtaining the motion vector corresponding to each video frame in the video in response to the decoding process of the acquired video
  • a number of times determination module used for determining the number of times each video frame is referenced based on the motion vector corresponding to each video frame;
  • the first storage module is used to store the video frame whose number of references meets the condition of the first number of times in the main storage of the video decoder;
  • the second storage module is used to store the video frames whose reference times satisfy the second time condition in the external storage of the video decoder; wherein, the times represented by the second time condition is greater than the number represented by the first time condition .
  • the motion vector corresponding to each video frame in the video is obtained, and the number of times each video frame is referenced is determined based on the motion vector of each video frame, then the video frame can be known.
  • the video frames that meet the condition of the first number of times to the internal buffer of the video decoder and store the video frames that meet the condition of the second number of times to the external storage of the decoder , the video frames that will be referenced less frequently will be stored in the internal buffer of the video decoder, and the video frames that will be referenced more frequently will be stored in the external storage of the decoder.
  • Use take advantage of low-power external storage, thereby reducing the power consumption of electronic equipment.
  • the internal buffer of the video decoder is limited, the video frames that are used less frequently are buffered in the video decoder, and these video frames in the external buffer can be updated faster, and the external buffer can be fully utilized to speed up the decoding. code processing.
  • the number of times determination module is configured to determine the reference video frame referenced by the current video frame based on the motion vector of the current video frame; and count the number of times the reference video frame is referenced.
  • the video data storage device in this embodiment determines the reference video frame referenced by the current video frame based on the motion vector of the current video frame, and counts the number of times the reference video frame is referenced, that is, to know which current video frame is and what is the motion vector , the reference video frame referenced by the current video frame can be obtained, thereby obtaining the reference times of each video frame in the video, and storing video data based on the reference times to reduce the power consumption of the electronic device.
  • the number of times determination module is further configured to stop counting the number of times the target reference video frame is referenced when the number of video frames between the current video frame and the target reference video frame reaches a preset number, and obtain the target reference video frame.
  • the number of times the video frame has been referenced. Since there are generally not too many frames between the current video frame and the referenced video frame, when the number of video frames between the current video frame and the target reference video frame reaches the preset number, the video frames after the current video frame The frame generally does not refer to the target reference video frame, so the reference times of the target reference video frame can be directly obtained.
  • each video frame is divided into multiple blocks.
  • the number of times determination module is used to determine the reference video block in the reference video frame referenced by the current video frame based on the motion vector of the current block in the current video frame; count the referenced times of the reference video block in the reference video frame;
  • the reference video blocks that meet the condition of the first number of times are stored in the internal buffer of the video decoder; the reference video blocks that meet the condition of the second number of times are stored in the external storage of the video decoder.
  • the reference video block to be referenced is determined based on the motion vector of the current block, the reference times of the reference video block are counted, and the reference video blocks whose reference times satisfy the condition of the first times are stored in the In the internal storage of the video decoder, the reference video block whose number of references meets the condition of the second number of times is stored in the external storage of the video decoder, then the referenced reference video block can be determined based on the current block and stored.
  • the video data is more accurate. Since the internal buffer in the video decoder is small, the storage block method is more suitable for the internal buffer in the video decoder.
  • the external storage of the video coder includes at least one of a system cache or a system buffer.
  • the data read from the system cache and the system buffer is faster and consumes less power. Therefore, the decoding speed of the video decoder can be maintained, and the power consumption of the electronic equipment can be reduced.
  • the main storage external to the video coder includes dynamic random access memory.
  • the first storage module is further configured to delete the most unnecessary video frames in the internal buffer when the internal buffer in the video decoder is full and new video frames are stored.
  • the electronic device deletes the least-needed video frames in the internal buffer to ensure that the video decoder Data can always be stored to ensure the operation of the video decoder. For example, it is possible to determine which video frames are least needed by looking at old and new. The least needed video frames may be, for example, the oldest. In other embodiments, other judgment methods may also be used to select the least needed video frames.
  • FIG. 15 is a structural block diagram of a video data reading apparatus according to an embodiment. As shown in FIG. 15, a video data reading device includes a second reading module 1502 and a third reading module 1504, wherein:
  • the second reading module 1502 is configured to, in response to the decoding processing of the acquired video code stream, read the reference video blocks that do not exist in the external storage of the video decoder from the external main storage of the video decoder to the internal buffer of the video decoder for motion compensation or block copying;
  • the third reading module 1504 is configured to perform motion compensation or block copy after reading the reference video block from the external storage of the video decoder.
  • the device for reading video data in this embodiment reads the reference video blocks that do not exist in the external storage of the video decoder from the main storage in response to the decoding processing of the acquired video code stream to the video decoding
  • Motion compensation or block copy is performed after the internal buffer of the video decoder, or motion compensation or block copy is performed after the reference video block is read from the external storage of the video decoder, that is, part of the video data is stored outside the video decoder.
  • the use of low-power external storage reduces the use of the internal buffer of the video decoder, and also reduces the bandwidth of the main storage, thereby reducing the power consumption of electronic equipment.
  • the second reading module 1502 is configured to, in response to the decoding processing of the acquired video code stream, search from the external storage of the video decoder, and find the reference video block in the external storage. In this case, motion compensation or block copying is performed after reading the reference video block from the external storage;
  • the third reading module 1504 is used to find the reference video block from the external main storage of the video decoder when the reference video block is not found in the external storage, and read the reference video from the main storage Motion compensation or block copying is performed after the block is stored in the video decoder's internal buffer.
  • the reference video block when the reference video block is found from the external storage of the video decoder, the reference video block is read from the external storage; when the reference video block is not found in the external storage , find the reference video block from the main storage again, find the reference video block from the main storage, read the reference video block from the main storage to the internal buffer of the video decoder and perform motion compensation; then the video decoding
  • the internal buffer of the decoder only reads the data from the main storage.
  • the internal buffer is consistent with the data stored in the external storage, which can save unnecessary buffering operations inside the video decoder. , thereby reducing the power consumption of electronic equipment.
  • the video data reading device further includes a storage module, and the storage module is configured to obtain motion vectors corresponding to each video frame in the video in response to the decoding processing of the acquired video;
  • the motion vector determines the reference times of each video frame; the video frames whose reference times meet the condition of the first times are stored in the external main storage of the video decoder; the video frames whose reference times meet the conditions of the second times are stored to the external storage of the video decoder; wherein, the number of times represented by the second order condition is greater than the number of times represented by the first order condition.
  • the motion vector corresponding to each video frame in the video is obtained, and the number of times each video frame is referenced is determined based on the motion vector of each video frame, then the video frame can be known.
  • To be used several times store the video frames that meet the condition of the first number of times to the main storage, and store the video frames that meet the condition of the second number of times to the external storage of the decoder, and are about to be referenced
  • the video frames with a few times are stored in the main storage, and the video frames with a large number of references are stored in the external storage of the decoder; thereby reducing the use of the internal buffer of the video decoder, using the low-power external storage, Thereby reducing the power consumption of the electronic device.
  • the external storage of the video decoder includes at least one of a system cache, a system buffer.
  • the data read from the system cache and the system buffer is faster and consumes less power. Therefore, the internal storage of the decoder does not need to store the video data from the system cache and system buffer again, which reduces the power consumption of electronic equipment.
  • each module in the above-mentioned video data storage device and video data reading device is only used for illustration. In other embodiments, the video data storage device and the video data reading device can be divided into different modules as required to complete the All or part of the functions of the above video data storage device and video data reading device.
  • Each module in the above-mentioned video data storage device and video data reading device may be implemented in whole or in part by software, hardware, and combinations thereof.
  • the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • FIG. 16 is a schematic diagram of the internal structure of an electronic device in one embodiment.
  • the electronic device includes a processor and memory connected by a system bus.
  • the processor is used to provide computing and control capabilities to support the operation of the entire electronic device.
  • the memory may include non-volatile storage media and internal memory.
  • the nonvolatile storage medium stores an operating system and a computer program.
  • the computer program can be executed by the processor to implement the video data storage method and the video data read method provided by the following embodiments.
  • Internal memory provides a cached execution environment for operating system computer programs in non-volatile storage media.
  • the electronic device may be any terminal device such as a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales, a sales terminal), a vehicle-mounted computer, a wearable device, and the like.
  • each module in the video data storage device and the video data reading device provided in the embodiments of the present application may be in the form of computer programs.
  • the computer program can be run on a terminal or server.
  • the program modules constituted by the computer program can be stored on the memory of the electronic device.
  • the computer program is executed by the processor, the operations of the methods described in the embodiments of the present application are implemented.
  • Embodiments of the present application also provide a computer-readable storage medium.
  • One or more non-volatile computer-readable storage media containing computer-executable instructions, when executed by one or more processors, cause the processors to perform the operations of the video data storage method.
  • Embodiments of the present application also provide a computer-readable storage medium.
  • One or more non-volatile computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the operations of the video data reading method .
  • Nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM), which acts as external cache memory.
  • RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), Memory Bus (Rambus) Direct RAM (RDRAM), Direct Memory Bus Dynamic RAM (DRDRAM), and Memory Bus Dynamic RAM (RDRAM).
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR SDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous Link (Synchlink) DRAM
  • SLDRAM synchronous Link (Synchlink) DRAM
  • Memory Bus Radbus
  • RDRAM Direct RAM
  • DRAM Direct Memory Bus Dynamic RAM
  • RDRAM Memory Bus Dynamic RAM

Abstract

A video data storage method, comprising: in response to decoding processing of a video frame to be reconstructed, when a reference video frame of the video frame to be reconstructed is not present in an external memory of a video decoder, and the reference video frame is present in an external main memory of the video decoder, reading the reference video frame from the main memory; and storing the read reference video frame in an internal cache of the video decoder.

Description

视频数据存储方法、装置、电子设备和可读存储介质Video data storage method, apparatus, electronic device and readable storage medium
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求于2021年04月01日提交中国专利局、申请号为202110355145.3、发明名称为“视频数据存储方法、装置、电子设备和可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on April 1, 2021 with the application number 202110355145.3 and the invention titled "video data storage method, device, electronic device and readable storage medium", the entire content of which is Incorporated herein by reference.
技术领域technical field
本申请涉及视频处理技术领域,特别是涉及一种视频数据存储方法、装置、电子设备和计算机可读存储介质。The present application relates to the technical field of video processing, and in particular, to a video data storage method, apparatus, electronic device, and computer-readable storage medium.
背景技术Background technique
随着新型视频标准的发展,如MPEG-1/2/4/5,H.263/264/265/266,VP8/9等,视频的画面尺寸越来越大,并且视频的帧率越来越高,导致传统的视频数据存储方式,存在电子设备的功耗高的问题。With the development of new video standards, such as MPEG-1/2/4/5, H.263/264/265/266, VP8/9, etc., the picture size of the video is getting bigger and bigger, and the frame rate of the video is getting bigger and bigger. The higher the value, the higher the power consumption of electronic devices is caused by the traditional video data storage method.
发明内容SUMMARY OF THE INVENTION
根据本申请的各种实施例提供一种视频数据存储方法、装置、电子设备、计算机可读存储介质。Various embodiments of the present application provide a video data storage method, apparatus, electronic device, and computer-readable storage medium.
一种视频数据存储方法,包括:A video data storage method, comprising:
响应于对待重建视频帧的译码处理,在视频译码器的外部存储中不存在待重建视频帧的参考视频帧,且在所述视频译码器的外部的主存储中存在所述参考视频帧的情况下,从所述主存储中读取所述参考视频帧;以及In response to the coding process of the video frame to be reconstructed, the reference video frame of the video frame to be reconstructed does not exist in the external storage of the video coder, and the reference video exists in the main storage external to the video coder frame, reading the reference video frame from the main storage; and
将主存储中的所述参考视频帧存储至所述视频译码器的内部缓存中。The reference video frame in main storage is stored in an internal buffer of the video coder.
一种视频数据读取方法,所述方法包括:A method for reading video data, the method comprising:
响应于对获取的视频码流的译码处理,从视频译码器的外部的主存储中读取不存在于视频译码器的外部存储的参考视频区块至视频译码器的内部缓存后进行动作补偿或块复制;In response to the decoding process of the acquired video code stream, read the reference video block that does not exist in the external storage of the video decoder from the external main storage of the video decoder to the internal buffer of the video decoder. Perform motion compensation or block copying;
或者,从视频译码器的外部存储中读取参考视频区块后进行动作补偿或块复制。Alternatively, motion compensation or block copying is performed after the reference video block is read from the video decoder's external storage.
一种视频数据存储装置,包括:A video data storage device, comprising:
第一读取模块,用于响应于对待重建视频帧的译码处理,在视频译码器的外部存储中不存在待重建视频帧的参考视频帧,且在所述视频译码器的外部的主存储中存在所述参考视频帧的情况下,从所述主存储中读取所述参考视频帧;以及A first read module for responding to the decoding process of the video frame to be reconstructed, the reference video frame of the video frame to be reconstructed does not exist in the external storage of the video decoder, and the reference video frame of the video frame to be reconstructed does not exist in the external storage of the video decoder. reading the reference video frame from the main storage if the reference video frame exists in the main storage; and
参考视频帧存储模块,用于将从主存储中读取的所述参考视频帧存储至所述视频译码器的内部缓存中。A reference video frame storage module, configured to store the reference video frame read from the main storage into an internal buffer of the video decoder.
一种视频数据读取装置,包括:A video data reading device, comprising:
第二读取模块,用于响应于对获取的视频码流的译码处理,从视频译码器的外部的主存储中读取不存在于视频译码器的外部存储的参考视频区块至视频译码器的内部缓存后进行动作补偿或块复制;The second reading module is configured to, in response to the decoding processing of the acquired video code stream, read the reference video blocks that do not exist in the external storage of the video decoder from the external main storage of the video decoder to Motion compensation or block copying after the video decoder's internal buffering;
第三读取模块,用于从视频译码器的外部存储中读取参考视频区块后进行动作补偿或块复制。The third reading module is used for performing motion compensation or block copy after reading the reference video block from the external storage of the video decoder.
一种电子设备,包括存储器及处理器,所述存储器中储存有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行各方法的操作。An electronic device includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the operations of each method.
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现各方法的操作。A computer-readable storage medium having a computer program stored thereon, the computer program implementing the operations of each method when executed by a processor.
上述视频数据存储方法、装置、电子设备和可读存储介质,响应于对待重建视频帧的译码处理,在视频译码器的外部存储中不存在待重建视频帧的参考视频帧,且在视频译码器的 外部的主存储中存在参考视频帧的情况下,从主存储中读取参考视频帧,将从主存储中读取的参考视频帧存储至视频译码器的内部缓存中;即在视频译码器的外部存储中存在的视频数据不存进视频译码器的内部缓存中,主存储中的视频数据会存进视频译码器的内部缓存中。相较于传统的视频数据不论位于外部存储或是主存储都会被译码器放入译码器内部缓存,本实施例中只需要将不存在于外部存储的且存在于主存储的视频数据放入译码器内部缓存,减少了视频译码器的内部缓存的使用,使得译码器内部缓存的效率增加,专门针对还只留在主存储的数据进行更进一步的功耗降低。The above-mentioned video data storage method, apparatus, electronic device and readable storage medium, in response to the decoding process of the video frame to be reconstructed, there is no reference video frame of the video frame to be reconstructed in the external storage of the video decoder, and in the video frame. When there is a reference video frame in the external main storage of the decoder, the reference video frame is read from the main storage, and the reference video frame read from the main storage is stored in the internal buffer of the video decoder; The video data existing in the external storage of the video decoder is not stored in the internal buffer of the video decoder, and the video data in the main storage is stored in the internal buffer of the video decoder. Compared with the traditional video data, whether it is located in the external storage or the main storage, the decoder will put it into the internal buffer of the decoder. The internal buffer of the decoder reduces the use of the internal buffer of the video decoder, increases the efficiency of the internal buffer of the decoder, and further reduces the power consumption of the data that is only left in the main storage.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1为一个实施例中传统的视频数据存储方式的架构示意图。FIG. 1 is a schematic structural diagram of a conventional video data storage method in an embodiment.
图2为一个实施例中传统的视频译码器数据处理架构。Figure 2 is a conventional video decoder data processing architecture in one embodiment.
图3为另一个实施例中传统的视频数据存储方式的架构示意图。FIG. 3 is a schematic structural diagram of a conventional video data storage method in another embodiment.
图4为一个实施例中传统方式的系统功耗的曲线示意图。FIG. 4 is a schematic diagram of a curve of system power consumption in a conventional manner in one embodiment.
图5为一个实施例中视频数据存储方法的流程图。FIG. 5 is a flowchart of a video data storage method in one embodiment.
图6为一个实施例中视频数据存储的架构示意图。FIG. 6 is a schematic structural diagram of video data storage in one embodiment.
图7为一个实施例中使用系统高速缓存的架构示意图。FIG. 7 is a schematic diagram of an architecture using a system cache in one embodiment.
图8为一个实施例中使用系统缓存区的架构示意图。FIG. 8 is a schematic diagram of an architecture using a system buffer in one embodiment.
图9为一个实施例中译码过程示意图。FIG. 9 is a schematic diagram of a decoding process in an embodiment.
图10为一个实施例中视频数据读取方法的流程图。FIG. 10 is a flowchart of a method for reading video data in one embodiment.
图11为一个实施例中重建视频帧的流程示意图。FIG. 11 is a schematic flowchart of reconstructing a video frame in one embodiment.
图12为一个实施例中传统的视频译码器内部存储的存储方式的示意图。FIG. 12 is a schematic diagram of a storage method of internal storage of a conventional video decoder in an embodiment.
图13为一个实施例中视频译码器内部存储的存储方式的示意图。FIG. 13 is a schematic diagram of a storage method of internal storage of a video decoder in an embodiment.
图14为一个实施例的视频数据存储装置的结构框图。FIG. 14 is a structural block diagram of a video data storage device according to an embodiment.
图15为一个实施例的视频数据读取装置的结构框图。FIG. 15 is a structural block diagram of a video data reading apparatus according to an embodiment.
图16为一个实施例中电子设备的内部结构示意图。FIG. 16 is a schematic diagram of the internal structure of an electronic device in one embodiment.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.
可以理解,本申请所使用的术语“第一”、“第二”等可在本文中用于描述各种数据,但这些数据不受这些术语限制。这些术语仅用于将第一个数据与另一个数据区分。举例来说,在不脱离本申请的范围的情况下,可以将第一次数条件称为第二次数条件,且类似地,可将第二次数条件称为第一次数条件。第一次数条件和第二次数条件两者都是次数条件,但其不是同一次数条件。It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various data, but these data are not limited by these terms. These terms are only used to distinguish the first data from another. For example, without departing from the scope of the present application, the first order condition may be referred to as the second order condition, and similarly, the second order condition may be referred to as the first order condition. Both the first degree condition and the second degree condition are degree conditions, but they are not the same degree condition.
在一个实施例中,传统的电子设备基本是以DRAM作为视频帧的存放空间。如图1所示,为一个实施例中传统的视频数据存储方式的架构示意图。图1中包括中央处理器(Central Processing Unit,CPU)、视频译码器(Video Decoder,VDEC)、显示处理器(Display Processing Unit)和动态随机存取内存控制器(DRAM Controller,DRAMC)。其中,中央处理器中包括主端口(master),视频译码器中包括内部缓存(cache)和主端口(master),显示处理器中包括主端口(master),动态随机存取内存控制器中包括从端口(slave)。图1中箭头表示视频数据。当存在视频数据时,视频译码器可从动态随机存取内存控制器中获取视频数据进行视 频译码,并重建得到视频帧,将重建的视频帧传输至显示处理器进行显示。In one embodiment, traditional electronic devices basically use DRAM as a storage space for video frames. As shown in FIG. 1 , it is a schematic structural diagram of a traditional video data storage manner in one embodiment. Figure 1 includes a central processing unit (Central Processing Unit, CPU), a video decoder (Video Decoder, VDEC), a display processor (Display Processing Unit) and a dynamic random access memory controller (DRAM Controller, DRAMC). Among them, the central processing unit includes a master port (master), the video decoder includes an internal cache (cache) and a master port (master), the display processor includes a master port (master), and the dynamic random access memory controller includes Including the slave port (slave). Arrows in FIG. 1 represent video data. When there is video data, the video decoder can obtain the video data from the dynamic random access memory controller for video decoding, reconstruct the video frame, and transmit the reconstructed video frame to the display processor for display.
图2为一个实施例中传统的视频译码器数据处理架构。将视频比特流(Video Bitstreams)输入至视频译码器中进行译码处理,生成视频帧(frame buffer)和一些暂时数据(Temporary data)如时域运动矢量(Temporal Motion Vector,TMV)。并且视频比特流、视频帧和暂时数据均存储在DRAM中。Figure 2 is a conventional video decoder data processing architecture in one embodiment. Input the video bitstream (Video Bitstreams) into the video decoder for decoding processing, and generate video frame (frame buffer) and some temporary data (Temporary data) such as Temporal Motion Vector (TMV). And the video bit stream, video frame and temporary data are all stored in DRAM.
传统的视频译码器处理各种视频比特流能有相对应的缓存策略。但随着新型视频标准,如H.265/266、AV、MPEG-5等标准,针对越来越大的尺寸且越来越高帧率的视频,传统技术采用如图3所示的架构,加宽DRAM的带宽或者提高DRAM频率做到加速数据吞吐。图3为另一个实施例中传统的视频数据存储方式的架构示意图。图中包括中央处理器、视频译码器、显示处理器和多通道动态随机存储内存控制器(Multi-channel DramCtrl),其中多通道动态随机存储内存控制器可用于控制多个动态随机存储内存(DRAM)。Traditional video decoders can have corresponding buffering strategies for processing various video bit streams. However, with the new video standards, such as H.265/266, AV, MPEG-5 and other standards, for video with larger and larger size and higher frame rate, the traditional technology adopts the architecture shown in Figure 3. Widen the bandwidth of DRAM or increase the frequency of DRAM to speed up data throughput. FIG. 3 is a schematic structural diagram of a conventional video data storage method in another embodiment. The figure includes a central processing unit, a video decoder, a display processor and a multi-channel dynamic random access memory controller (Multi-channel DramCtrl). The multi-channel dynamic random access memory controller can be used to control multiple dynamic random access memories ( DRAM).
图4为一个实施例中传统方式的系统功耗的曲线示意图。图4中横坐标是图像中位置(Picture Position),纵坐标为系统功耗(system power)。虚线表示系统功耗上限(System Power Barrier)。如图4所示,系统DRAM为满足视频译码器的运作速度需求,需要消耗的系统功耗较高。视频译码器过度依赖DRAM或其他耗电存储的情况下,因系统能够提供的功耗上限有限,会使得视频译码器速度无法满足需求或者系统过热。传统的方式会造成视频译码器在预期时间完成情况下造成较高的功耗。FIG. 4 is a schematic diagram of a curve of system power consumption in a conventional manner in one embodiment. In Figure 4, the abscissa is the position in the image (Picture Position), and the ordinate is the system power. The dotted line represents the System Power Barrier. As shown in FIG. 4 , the system DRAM consumes relatively high system power in order to meet the operating speed requirements of the video decoder. When the video decoder is overly dependent on DRAM or other power-hungry storage, the speed of the video decoder cannot meet the demand or the system overheats due to the limited power consumption that the system can provide. The traditional approach would result in higher power consumption for the video decoder when it finishes at the expected time.
为了解决电子设备的高功耗问题,本申请实施例提供了一种视频数据存储方法,通过响应于对待重建视频帧的译码处理,在视频译码器的外部存储中不存在待重建视频帧的参考视频帧,且在视频译码器的外部的主存储中存在参考视频帧的情况下,从主存储中读取参考视频帧;将从主存储中读取的参考视频帧存储至视频译码器的内部缓存中;相较于传统的视频数据不论位于外部存储或是主存储都会被译码器放入译码器内部缓存,本实施例中只需要将不存在于外部存储的且存在于主存储的视频数据放入译码器内部缓存,减少了视频译码器的内部缓存的使用,使得译码器内部缓存的效率增加,专门针对还只留在主存储的数据进行更进一步的功耗降低。In order to solve the problem of high power consumption of electronic equipment, an embodiment of the present application provides a video data storage method. In response to the decoding process of the video frame to be reconstructed, there is no video frame to be reconstructed in the external storage of the video decoder. the reference video frame, and if there is a reference video frame in the external main storage of the video decoder, read the reference video frame from the main storage; store the reference video frame read from the main storage to the video decoder In the internal buffer of the decoder; compared with the traditional video data, whether it is located in the external storage or the main storage, the decoder will put it into the internal buffer of the decoder. The video data stored in the main storage is put into the internal buffer of the decoder, which reduces the use of the internal buffer of the video decoder and increases the efficiency of the internal buffer of the decoder. Power consumption is reduced.
下面结合具体的实施例来描述视频数据存储方法。本申请的实施例中以主存储为DRAM为例进行说明。图5为一个实施例中视频数据存储方法的流程图。本实施例中的视频数据存储方法,以运行于电子设备上为例进行描述。如图5所示,视频数据存储方法包括操作502至操作504。The video data storage method is described below with reference to specific embodiments. In the embodiments of the present application, the main storage is DRAM as an example for description. FIG. 5 is a flowchart of a video data storage method in one embodiment. The video data storage method in this embodiment is described by taking the operation on an electronic device as an example. As shown in FIG. 5 , the video data storage method includes operations 502 to 504 .
操作502,响应于对待重建视频帧的译码处理,在视频译码器的外部存储中不存在待重建视频帧的参考视频帧,且在视频译码器的外部的主存储中存在参考视频帧的情况下,从主存储中读取参考视频帧。 Operation 502, in response to the decoding process of the video frame to be reconstructed, the reference video frame of the video frame to be reconstructed does not exist in the external storage of the video coder, and the reference video frame exists in the main storage external to the video coder , the reference video frame is read from main storage.
其中,待重建视频帧是指还未构建成功的视频帧。视频经过压缩后,若需要得到视频帧,需要进行译码处理。视频译码器的外部存储是指位于电子设备中的、且除了主存储和视频译码器的内部缓存之外的存储。例如视频译码器的外部存储可以是系统高速缓存、系统缓冲区中至少一种。主存储是指主存储器(Main memory),简称主存。主存储是计算机硬件的一个重要部件,其作用是存放指令和数据,并能由中央处理器(CPU)直接随机存取。主存储具体可以是DRAM(Dynamic Random Access Memory,动态随机存取存储器)。The video frame to be reconstructed refers to a video frame that has not been successfully constructed yet. After the video is compressed, if the video frame needs to be obtained, it needs to be decoded. The video coder's external storage refers to storage located in the electronic device and other than the main storage and the video coder's internal cache. For example, the external storage of the video decoder may be at least one of a system cache and a system buffer. Main memory refers to the main memory (Main memory), referred to as the main memory. The main storage is an important part of computer hardware, its function is to store instructions and data, and can be directly accessed randomly by the central processing unit (CPU). The main storage may specifically be DRAM (Dynamic Random Access Memory, dynamic random access memory).
参考视频帧可用于重建出待重建视频帧所对应的目标视频帧。参考视频帧可以是在待重建视频帧之前显示的或者之后显示的视频帧。参考视频帧具体是在待重建视频帧之前已经重建完成的视频帧,或者参考视频帧还可以是待重建视频帧自身的已重建部分,例如屏幕内容编码技术中用于帧内块复制(intra block copy)的块矢量(block vector)分辨出该取用的画面范围。对于屏幕内容编码技术中允许的参考画面范围规定,已经在各种视频标准中详述,在此不赘述。The reference video frame can be used to reconstruct the target video frame corresponding to the video frame to be reconstructed. The reference video frame may be a video frame displayed before or after the video frame to be reconstructed. The reference video frame is specifically the video frame that has been reconstructed before the video frame to be reconstructed, or the reference video frame can also be the reconstructed part of the video frame to be reconstructed itself, such as for intra-block copying in the screen content coding technology. copy) of the block vector (block vector) to distinguish the range of the picture to be accessed. The specification of the reference picture range allowed in the screen content coding technology has been described in detail in various video standards, and will not be repeated here.
具体地,响应于对待重建视频帧的译码处理,电子设备获取待重建视频帧所对应的目标运动矢量或块矢量。检测视频译码器的外部存储中是否存在待重建视频帧的参考视频帧。在 视频译码器的外部存储中不存在目标运动矢量或块矢量所对应的参考视频帧,且在视频译码器的外部的主存储中存在参考视频帧的情况下,电子设备从主存储中读取参考视频帧,并将读取的参考视频帧存储至视频译码器的内部缓存中。Specifically, in response to the decoding process of the to-be-reconstructed video frame, the electronic device acquires the target motion vector or block vector corresponding to the to-be-reconstructed video frame. It is detected whether a reference video frame of the video frame to be reconstructed exists in the external storage of the video coder. In the case that the reference video frame corresponding to the target motion vector or block vector does not exist in the external storage of the video decoder, and the reference video frame exists in the main storage external to the video decoder, the electronic device removes the The reference video frame is read, and the read reference video frame is stored in the internal buffer of the video decoder.
操作504,将从主存储中读取的参考视频帧存储至视频译码器的内部缓存中。In operation 504, the reference video frame read from the main storage is stored into an internal buffer of the video decoder.
具体地,电子设备将从主存储中读取的参考视频帧存储至视频译码器的内部缓存中。Specifically, the electronic device stores the reference video frames read from the main storage into the internal buffer of the video decoder.
本实施例中的视频数据存储方法,响应于对待重建视频帧的译码处理,在视频译码器的外部存储中不存在待重建视频帧的参考视频帧,且在视频译码器的外部的主存储中存在参考视频帧的情况下,从主存储中读取参考视频帧,将从主存储中读取的参考视频帧存储至视频译码器的内部缓存中,即在视频译码器的外部存储中存在的视频数据不存进视频译码器的内部缓存中,主存储中的视频数据会存进视频译码器的内部缓存中。相较于传统的视频数据不论位于外部存储或是主存储都会被译码器放入译码器内部缓存,本实施例中只需要将不存在于外部存储的且存在于主存储的视频数据放入译码器内部缓存,减少了视频译码器的内部缓存的使用,使得译码器内部缓存的效率增加,专门针对还只留在主存储的数据进行更进一步的功耗降低。In the video data storage method in this embodiment, in response to the decoding process of the video frame to be reconstructed, the reference video frame of the video frame to be reconstructed does not exist in the external storage of the video decoder, and the reference video frame of the video frame to be reconstructed does not exist in the external storage of the video decoder. When there is a reference video frame in the main storage, the reference video frame is read from the main storage, and the reference video frame read from the main storage is stored in the internal buffer of the video decoder, that is, in the video decoder's internal buffer. The video data existing in the external storage is not stored in the internal buffer of the video decoder, and the video data in the main storage will be stored in the internal buffer of the video decoder. Compared with the traditional video data, whether it is located in the external storage or the main storage, the decoder will put it into the internal buffer of the decoder. The internal buffer of the decoder reduces the use of the internal buffer of the video decoder, increases the efficiency of the internal buffer of the decoder, and further reduces the power consumption of the data that is only left in the main storage.
在一个实施例中,如图6所示,为一个实施例中视频数据存储的架构示意图。其中白色部分表示存储在DRAM中,也即这部分数据后续会存储在视频译码器的内部缓存中,灰色部分表示存储在视频译码器的外部存储中。相较于图3的存储方式,图6中的视频比特流、视频帧数据、暂时数据,有部分存储在DRAM中,有部分存储在视频译码器的外部存储中。In one embodiment, as shown in FIG. 6 , it is a schematic diagram of the architecture of video data storage in one embodiment. The white part indicates that it is stored in DRAM, that is, this part of the data will be stored in the internal buffer of the video decoder later, and the gray part indicates that it is stored in the external storage of the video decoder. Compared with the storage method in FIG. 3 , some of the video bit stream, video frame data, and temporary data in FIG. 6 are stored in the DRAM, and some are stored in the external storage of the video decoder.
在一个实施例中,每帧视频帧被划分为多个区块。在视频译码器的外部存储中不存在待重建视频帧的参考视频帧,且在视频译码器的外部的主存储中存在参考视频帧的情况下,从主存储中读取参考视频帧,包括:In one embodiment, each video frame is divided into multiple blocks. In the case that the reference video frame of the video frame to be reconstructed does not exist in the external storage of the video decoder, and if the reference video frame exists in the main storage external to the video decoder, the reference video frame is read from the main storage, include:
在视频译码器的外部存储中不存在待重建视频帧所对应的参考视频区块,且在视频译码器的外部的主存储中存在参考视频区块的情况下,从主存储中读取参考视频区块。If the reference video block corresponding to the video frame to be reconstructed does not exist in the external storage of the video decoder, and if the reference video block exists in the external main storage of the video decoder, read from the main storage Refer to the video block.
将从主存储中读取的参考视频帧存储至视频译码器的内部缓存中,包括:将从主存储中读取的参考视频区块存储至视频译码器的内部缓存中。The storing of the reference video frames read from the main storage into the internal buffer of the video decoder includes: storing the reference video blocks read from the main storage into the internal buffer of the video decoder.
其中,区块是指视频帧的部分区域。例如,区块的大小可以为16×16个像素点、64×64个像素点等不限于此。The block refers to a part of the video frame. For example, the size of the block may be 16×16 pixels, 64×64 pixels, etc., but not limited thereto.
具体地,响应于对获取的视频的译码处理,电子设备将视频中各视频帧划分为多个区块,并获得各区块所对应的运动矢量。电子设备基于当前视频帧中的当前区块的运动矢量,确定待重建视频帧所参考的参考视频帧中的参考视频区块。在视频译码器的外部存储中不存在待重建视频帧所对应的参考视频区块,且在视频译码器的外部的主存储中存在参考视频区块的情况下,电子设备从主存储中读取参考视频区块。电子设备将从主存储中读取的参考视频区块存储至视频译码器的内部缓存中。Specifically, in response to the decoding processing of the acquired video, the electronic device divides each video frame in the video into a plurality of blocks, and obtains motion vectors corresponding to each block. The electronic device determines, based on the motion vector of the current block in the current video frame, the reference video block in the reference video frame referenced by the video frame to be reconstructed. When the reference video block corresponding to the video frame to be reconstructed does not exist in the external storage of the video decoder, and if the reference video block exists in the main storage outside the video decoder, the electronic device retrieves the data from the main storage. Read the reference video block. The electronic device stores the reference video block read from the main storage into an internal buffer of the video decoder.
本实施例中,在视频译码器的外部存储中不存在待重建视频帧所对应的参考视频区块,且在视频译码器的外部的主存储中存在参考视频区块的情况下,电子设备从主存储中读取参考视频区块并存储至视频译码器的内部缓存中,由于视频译码器中的内部缓存较小,采用存储区块的方式更加适应视频译码器中的内部缓存,提高视频数据存储的精度。In this embodiment, in the case that the reference video block corresponding to the video frame to be reconstructed does not exist in the external storage of the video decoder, and the reference video block exists in the external main storage of the video decoder, the electronic The device reads the reference video block from the main storage and stores it in the internal buffer of the video decoder. Since the internal buffer in the video decoder is small, the storage block method is more suitable for the internal buffer in the video decoder. Cache to improve the accuracy of video data storage.
在一个实施例中,该视频数据存储方法还包括:在视频译码器的外部存储中存在参考视频帧的情况下,从视频译码器的外部存储中读取参考视频帧。In one embodiment, the video data storage method further comprises: if the reference video frame exists in the external storage of the video decoder, reading the reference video frame from the external storage of the video decoder.
具体地,在视频译码器的外部存储中存在参考视频帧的情况下,电子设备从视频译码器的外部存储中读取参考视频帧,并基于从视频译码器的外部存储中读取的参考视频帧重建得到该待重建视频帧对应的目标视频帧。Specifically, in the case that the reference video frame exists in the external storage of the video decoder, the electronic device reads the reference video frame from the external storage of the video decoder, and based on the reading from the external storage of the video decoder The target video frame corresponding to the to-be-reconstructed video frame is obtained by reconstructing the reference video frame of .
本实施例中,在视频译码器的外部存储中存在参考视频帧的情况下,从视频译码器的外部存储中读取参考视频帧,通过视频译码器的外部存储进行数据存取,能将译码器内部缓存的效率增加,专门针对还只留在主存储的数据进行更进一步的功耗降低。In this embodiment, when there is a reference video frame in the external storage of the video decoder, the reference video frame is read from the external storage of the video decoder, and data access is performed through the external storage of the video decoder, The efficiency of the internal cache of the decoder can be increased, and further power consumption can be reduced specifically for the data that is still only in the main storage.
在一个实施例中,在响应于对待重建视频帧的译码处理,在视频译码器的外部存储中不 存在待重建视频帧的参考视频帧,且在视频译码器的外部的主存储中存在参考视频帧的情况下,从主存储中读取参考视频帧之前,该视频数据存储方法还包括:In one embodiment, in response to the decoding process of the video frame to be reconstructed, the reference video frame of the video frame to be reconstructed does not exist in the external storage of the video coder and in the main storage external to the video coder In the presence of a reference video frame, before reading the reference video frame from the main storage, the video data storage method further includes:
操作(a1),响应于对获取的视频的译码处理,获得视频中各视频帧所对应的运动矢量。In operation (a1), a motion vector corresponding to each video frame in the video is obtained in response to the decoding process of the obtained video.
其中,视频的种类不限。例如可以是在电子设备本地存储的已下载视频,也可以是从服务器获取的视频。视频可以是电视剧视频、电影视频、电视剧视频等。视频的长度不限,例如可以是10秒、1分钟、10分钟等不限于此。译码处理是指对已编码的视频进行解码还原以重构得到视频帧的处理。译码处理也可称为解码处理。运动矢量(Motion Vector,MV)表示当前视频帧的区块与其参考图像中的匹配块之间的相对位移。块矢量(Block Vector,BV)表示当前视频帧的区块与其已重构出的当前图像帧中的匹配块之间的相对位移。The types of videos are not limited. For example, it may be a downloaded video stored locally on the electronic device, or it may be a video obtained from a server. The video may be a TV series video, a movie video, a TV series video, and the like. The length of the video is not limited, for example, it can be 10 seconds, 1 minute, 10 minutes, etc. without limitation. The decoding process refers to the process of decoding and restoring the encoded video to reconstruct the video frame. The decoding process may also be referred to as a decoding process. Motion Vector (MV) represents the relative displacement between the block of the current video frame and its matching block in the reference image. A block vector (Block Vector, BV) represents the relative displacement between a block of the current video frame and its reconstructed matching block in the current image frame.
具体地,电子设备响应于对获取的视频的译码处理,通过视频译码器获得视频中各视频帧所对应的运动矢量。可以理解的是,电子设备响应于对获取的视频的译码处理,对视频中的部分视频帧进行译码处理,获得各视频帧所对应的运动矢量。例如,视频包括100个视频帧,电子设备可对100个视频帧中的前50个视频帧进行译码处理。Specifically, in response to the decoding process of the acquired video, the electronic device obtains the motion vector corresponding to each video frame in the video through a video decoder. It can be understood that, in response to the decoding processing of the acquired video, the electronic device performs decoding processing on some video frames in the video to obtain the motion vector corresponding to each video frame. For example, a video includes 100 video frames, and the electronic device may perform a decoding process on the first 50 video frames of the 100 video frames.
操作(a2),基于各视频帧所对应的运动矢量确定各视频帧的被参考次数。In operation (a2), the reference times of each video frame is determined based on the motion vector corresponding to each video frame.
其中,被参考次数是指在视频帧重构时的被其他视频帧参考的次数。例如,视频帧A被待重建的视频帧B、待重建的视频帧C……待重建的视频帧Z参考,一共被参考了26次。The number of times of being referenced refers to the number of times that the video frame is referenced by other video frames during reconstruction of the video frame. For example, the video frame A is referenced by the video frame B to be reconstructed, the video frame C to be reconstructed... The video frame Z to be reconstructed is referenced 26 times in total.
具体地,电子设备基于视频中各视频帧所对应的运动矢量,确定各视频帧所对应的参考视频帧;统计参考视频帧的被参考次数。以视频帧X、视频帧Y和视频帧Z为例,视频帧X被视频帧Y和视频帧Z参考,那么视频帧X作为视频帧Y和视频帧Z的参考视频帧,那么视频帧X的被参考次数为2次。Specifically, the electronic device determines the reference video frame corresponding to each video frame based on the motion vector corresponding to each video frame in the video, and counts the number of times the reference video frame is referenced. Taking video frame X, video frame Y and video frame Z as an example, video frame X is referenced by video frame Y and video frame Z, then video frame X is used as the reference video frame of video frame Y and video frame Z, then video frame X is The number of references is 2 times.
操作(a3),将被参考次数满足第一次数条件的视频帧存储至视频译码器的外部的主存储中。In operation (a3), the video frames whose reference times satisfy the condition of the first number of times are stored in the external main storage of the video decoder.
其中,第一次数条件可根据需要调整。第一次数条件所表征的次数小于第二次数条件所表征的次数。例如,满足第一次数条件为等于1。Wherein, the condition of the first number of times can be adjusted as required. The number of times represented by the first degree condition is smaller than the number of times represented by the second degree condition. For example, satisfying the first degree condition is equal to 1.
具体地,电子设备将被参考次数满足第一次数条件的视频帧存储至视频译码器的外部的主存储中。后续视频译码器可从主存储中读取满足第一次数条件的视频帧,并存储在视频译码器的内部缓存中。Specifically, the electronic device stores the video frames whose reference times satisfy the condition of the first number of times into the main storage outside the video decoder. Subsequent video coders may read video frames that satisfy the first number of conditions from main storage and store them in an internal buffer of the video coder.
操作(a4),将被参考次数满足第二次数条件的视频帧存储至视频译码器的外部存储中;其中,第二次数条件所表征的次数大于第一次数条件所表征的次数。In operation (a4), the video frames whose reference times satisfy the second number condition are stored in the external storage of the video decoder; wherein the number represented by the second number condition is greater than the number represented by the first number condition.
其中,第二次数条件可根据需要调整。第二次数条件所表征的次数大于第一次数条件所表征的次数。例如,被参考次数满足第一次数条件为被参考次数满足1,被参考次数满足第二次数条件为被参考次数满足大于1个。或者,被参考次数满足第一次数条件为被参考次数小于等于2,被参考次数满足第二次数条件为被参考次数大于2等不限于此。Wherein, the second order condition can be adjusted as required. The number of times represented by the second degree condition is greater than the number of times represented by the first degree condition. For example, if the number of times to be referenced satisfies the first number of times condition, the number of times to be referenced satisfies 1, and the number of times to be referenced satisfies the second condition is that the number of times to be referenced satisfies more than 1. Alternatively, if the number of times to be referenced satisfies the condition of the first number of times, the number of times to be referenced is less than or equal to 2, and the number of times to be referenced satisfies the condition of the second number of times is that the number of times to be referenced is greater than 2, and so on.
具体地,电子设备将被参考次数满足第二次数条件的视频帧存储至视频译码器的外部存储中。视频译码器的外部存储是指位于电子设备中、但未位于视频译码器中的存储。视频译码器的外部存储可以是片上存储器(on chip memory)例如视频译码器的外部存储可以是系统高速缓存、系统缓存区中至少一种。Specifically, the electronic device stores the video frames whose reference times satisfy the condition of the second number of times into the external storage of the video decoder. External storage of the video coder refers to storage located in the electronic device but not in the video coder. The external storage of the video decoder may be an on-chip memory. For example, the external storage of the video decoder may be at least one of a system cache and a system buffer.
本实施例中的视频数据存储方法,响应于对获取的视频的译码处理,获得视频中各视频帧所对应的运动矢量,基于各视频帧的运动矢量确定各视频帧的被参考次数,则可得知视频帧要被使用几次;将被参考次数满足第一次数条件的视频帧存储至视频译码器的内部缓存中,将被参考次数满足第二次数条件的视频帧存储至视频译码器的外部存储中,即将被参考次数较少的视频帧存在视频译码器的内部缓存中,将被参考次数较多的视频帧存储在视频译码器的外部存储中;降低了视频译码器的内部缓存的使用,利用了低功耗的外部存储,从而降低电子设备的功耗。另外由于视频译码器的内部缓存有限,因此将使用次数少的视频帧缓存在视频译码器中,而外部缓存的这些视频帧被更新的速度可以更快,能够充分利用外部缓存以加快译码处理。In the video data storage method in this embodiment, in response to the decoding processing of the acquired video, the motion vector corresponding to each video frame in the video is obtained, and the reference times of each video frame is determined based on the motion vector of each video frame, then It can be known how many times the video frame is to be used; the video frame whose number of references meets the condition of the first number of times is stored in the internal buffer of the video decoder, and the video frame whose number of times of reference meets the condition of the second number of times is stored in the video In the external storage of the decoder, the video frames that have been referenced less frequently are stored in the internal buffer of the video decoder, and the video frames that have been referenced more frequently are stored in the external storage of the video decoder. The use of the decoder's internal cache utilizes low-power external storage, thereby reducing the power consumption of electronic equipment. In addition, because the internal buffer of the video decoder is limited, the video frames that are used less frequently are buffered in the video decoder, and these video frames in the external buffer can be updated faster, and the external buffer can be fully utilized to speed up the decoding. code processing.
在一个实施例中,视频译码器的外部存储包括系统高速缓存或系统缓存区中至少一种。其中,系统高速缓存(system cache)和系统缓存区(system buffer)均属于片上存储器(on-chip memory)。且系统高速缓存和系统缓存区均属于静态随机存取存储器(Static Random-Access Memory,SRAM)。本实施例中,通过将满足第二次数条件的视频帧存储在系统高速缓存、系统缓存区中至少一种中,由于从系统高速缓存和系统缓冲区读取的数据的速度较快且功耗小,因此译码器内部存储无必要在存一次来自系统高速缓存和系统缓冲区的视频数据,且保持了译码器的译码速度,降低电子设备的功耗。In one embodiment, the external storage of the video coder includes at least one of a system cache or a system buffer. Among them, the system cache (system cache) and the system cache area (system buffer) both belong to the on-chip memory (on-chip memory). And both the system cache and the system cache area belong to static random-access memory (Static Random-Access Memory, SRAM). In this embodiment, by storing the video frames that meet the conditions of the second number of times in at least one of the system cache and the system buffer, the data read from the system cache and the system buffer is faster and consumes less power. Therefore, the internal storage of the decoder does not need to store the video data from the system cache and system buffer once, and the decoding speed of the decoder is maintained and the power consumption of the electronic device is reduced.
在一个实施例中,基于各视频帧所对应的运动矢量确定各视频帧的被参考次数,包括:基于当前视频帧的运动矢量确定当前视频帧所参考的参考视频帧;统计参考视频帧的被参考次数。In one embodiment, determining the reference times of each video frame based on the motion vector corresponding to each video frame includes: determining the reference video frame referenced by the current video frame based on the motion vector of the current video frame; number of references.
具体地,电子设备对获取的视频进行译码处理,先译码得到视频帧的运动矢量。视频帧的运动矢量用于表示当前视频帧和参考视频帧之间的位移。电子设备基于当前帧的运动矢量确定当前视频帧所参考的参考视频帧,统计参考视频帧的被参考次数,那么由此可得到各视频帧的被参考次数。例如,以当前视频帧为视频帧C、视频帧C所参考的参考视频帧为视频帧A和视频帧B为例进行说明。那么此时视频帧A的被参考次数为1,视频帧B的被参考次数也为1。那么当当前视频帧为视频帧D、视频帧D所参考的参考视频帧也为视频帧A和视频帧B,那么此时视频帧A的被参考次数为2,视频帧B的被参考次数也为2,由此可得到视频中各视频帧的被参考次数。Specifically, the electronic device performs decoding processing on the acquired video, and firstly decodes to obtain the motion vector of the video frame. The motion vector of the video frame is used to represent the displacement between the current video frame and the reference video frame. The electronic device determines the reference video frame referenced by the current video frame based on the motion vector of the current frame, and counts the reference times of the reference video frame, then the reference times of each video frame can be obtained. For example, the current video frame is video frame C, and the reference video frames referenced by video frame C are video frame A and video frame B as an example for description. Then, the reference times of the video frame A is 1 at this time, and the reference times of the video frame B is also 1. Then, when the current video frame is video frame D, and the reference video frames referenced by video frame D are also video frame A and video frame B, then the reference times of video frame A is 2, and the reference times of video frame B is also is 2, which can obtain the reference times of each video frame in the video.
本实施例中的视频数据存储方法,基于当前视频帧的运动矢量确定当前视频帧所参考的参考视频帧,统计参考视频帧的被参考次数,即得知当前视频帧是哪个,运动矢量是什么,即可得到当前视频帧所参考的参考视频帧是什么,由此可得到视频中各视频帧的被参考次数,并将基于参考次数进行视频数据存储,相较于传统的视频数据不论位于外部存储或是主存储都会被译码器放入译码器内部缓存,本实施例中只需要将不存在于外部存储的且存在于主存储的视频数据放入译码器内部缓存,减少了视频译码器的内部缓存的使用,使得译码器内部缓存的效率增加,专门针对还只留在主存储的数据进行更进一步的功耗降低。In the video data storage method in this embodiment, the reference video frame referenced by the current video frame is determined based on the motion vector of the current video frame, and the number of times the reference video frame is referenced is counted, that is, the current video frame and the motion vector are known. , the reference video frame referenced by the current video frame can be obtained, and the reference times of each video frame in the video can be obtained, and the video data will be stored based on the reference times. The storage or the main storage will be put into the internal buffer of the decoder by the decoder. In this embodiment, only the video data that does not exist in the external storage and exists in the main storage needs to be put into the internal buffer of the decoder, reducing the number of video data. The use of the internal buffer of the decoder increases the efficiency of the internal buffer of the decoder, and further reduces the power consumption especially for the data still only in the main storage.
在一个实施例中,该视频数据存储方法还包括:当当前视频帧与目标参考视频帧之间的视频帧的数量达到预设数量时,停止统计该目标参考视频帧的被参考次数,获得该目标参考视频帧的被参考次数。预设数量可根据实际需求设定。预设数量用于表征视频帧与参考视频帧之间的最大间隔帧的数量。由于当前视频帧与所参考的视频帧之间一般不会间隔太多帧,因此当当前视频帧与目标参考视频帧之间的视频帧的数量达到预设数量时,当前视频帧往后的视频帧一般不会再参考该目标参考视频帧,因此可直接获得该目标参考视频帧的被参考次数。In one embodiment, the video data storage method further includes: when the number of video frames between the current video frame and the target reference video frame reaches a preset number, stopping counting the number of times the target reference video frame is referenced, and obtaining the The number of times the target reference video frame has been referenced. The preset number can be set according to actual needs. The preset number is used to characterize the number of maximum interval frames between the video frame and the reference video frame. Since there are generally not too many frames between the current video frame and the referenced video frame, when the number of video frames between the current video frame and the target reference video frame reaches the preset number, the video frames after the current video frame The frame generally does not refer to the target reference video frame, so the reference times of the target reference video frame can be directly obtained.
在一个实施例中,每帧视频帧被划分为多个区块;基于当前视频帧的运动矢量确定当前视频帧所参考的参考视频帧,包括:基于当前视频帧中的当前区块的运动矢量,确定当前视频帧所参考的参考视频帧中的参考视频区块。In one embodiment, each frame of video frame is divided into multiple blocks; determining the reference video frame referenced by the current video frame based on the motion vector of the current video frame, including: based on the motion vector of the current block in the current video frame , to determine the reference video block in the reference video frame referenced by the current video frame.
统计参考视频帧的被参考次数,包括:统计参考视频帧中参考视频区块的被参考次数。Counting the reference times of the reference video frame includes: counting the reference times of the reference video block in the reference video frame.
将被参考次数满足第一次数条件的视频帧存储至视频译码器的外部的主存储中,包括:将被参考次数满足第一次数条件的参考视频区块存储至视频译码器的外部的主存储中。The video frame that satisfies the condition of the first number of times is stored in the external main storage of the video decoder, including: the reference video block that satisfies the condition of the first number of times is stored in the video decoder. in external primary storage.
将被参考次数满足第二次数条件的视频帧存储至视频译码器的外部存储中,包括:将被参考次数满足第二次数条件的参考视频区块存储至视频译码器的外部存储中。Storing the video frames that meet the condition of the second number of times to be referenced in the external storage of the video decoder includes: storing the reference video blocks that meet the condition of the second number of times to be referenced in the external storage of the video decoder.
其中,区块是指视频帧的部分区域。例如,区块的大小可以为16×16个像素点、64×64个像素点等不限于此。The block refers to a part of the video frame. For example, the size of the block may be 16×16 pixels, 64×64 pixels, etc., but not limited thereto.
具体地,响应于对获取的视频的译码处理,电子设备将视频中各视频帧划分为多个区块,并获得各区块所对应的运动矢量。电子设备基于当前视频帧中的当前区块的运动矢量,确定当前视频帧所参考的参考视频帧中的参考视频区块。电子设备统计参考视频区块的被参考次数。电子设备将被参考次数满足第一次数条件的参考视频区块存储至视频译码器的内部缓存 中。电子设备将被参考次数满足第二次数条件的参考视频区块存储至视频译码器的外部存储中。Specifically, in response to the decoding processing of the acquired video, the electronic device divides each video frame in the video into a plurality of blocks, and obtains motion vectors corresponding to each block. The electronic device determines, based on the motion vector of the current block in the current video frame, the reference video block in the reference video frame referenced by the current video frame. The electronic device counts the number of times the reference video block is referenced. The electronic device stores the reference video block whose number of references meets the condition of the first number of times in the internal buffer of the video decoder. The electronic device stores the reference video blocks whose number of references meets the condition of the second number of times in the external storage of the video decoder.
本实施例中,基于当前区块的运动矢量,确定所参考的参考视频区块,统计参考视频区块的被参考次数,并将被参考次数满足第一次数条件的参考视频区块存储至主存储中,将被参考次数满足第二次数条件的参考视频区块存储至视频译码器的外部存储中,那么可基于当前区块确定所参考的参考视频区块,存储的视频数据更加准确,由于视频译码器中的内部缓存较小,采用存储区块的方式更加适应视频译码器中的内部缓存。In this embodiment, the reference video block to be referenced is determined based on the motion vector of the current block, the reference times of the reference video block are counted, and the reference video blocks whose reference times satisfy the condition of the first times are stored in the In the main storage, the reference video block that satisfies the condition of the second number of times by reference is stored in the external storage of the video decoder, then the reference video block referenced can be determined based on the current block, and the stored video data is more accurate , since the internal buffer in the video decoder is small, the storage block method is more suitable for the internal buffer in the video decoder.
本实施例中,如图7所示,为一个实施例中使用系统高速缓存的架构示意图。其中包括中央处理器、视频译码器、显示处理器、动态随机存取内存控制器和系统高速缓存。系统高速缓存(system cache)可从DRAMC中获取数据。图7中的系统高速缓存大小为4MB(兆字节)。并且系统高速缓存属于SRAM(Static Random-Access Memory,静态随机存取存储器)中的一种。那么,响应于对获取的视频的译码处理,通过视频译码器获得视频中各视频帧所对应的运动矢量,基于各视频帧所对应的运动矢量确定各视频帧的被参考次数;将被参考次数满足第一次数条件的视频帧从DRAM中读取,并存储在视频译码器的内部缓存中;将被参考次数满足第二次数条件的部分视频帧从DRAM中读取,并存储在系统高速缓存中。可以理解的是,系统高速缓存可不与DRAMC直连,图6中只是一个示例。In this embodiment, as shown in FIG. 7 , it is a schematic diagram of the architecture of using a system cache in one embodiment. These include the central processing unit, video decoder, display processor, dynamic random access memory controller and system cache. The system cache can obtain data from DRAMC. The system cache size in Figure 7 is 4MB (megabytes). And the system cache is a kind of SRAM (Static Random-Access Memory). Then, in response to the decoding processing of the acquired video, the motion vector corresponding to each video frame in the video is obtained by the video decoder, and the reference times of each video frame is determined based on the motion vector corresponding to each video frame; The video frames whose reference times meet the conditions of the first times are read from DRAM and stored in the internal buffer of the video decoder; some video frames whose reference times meet the conditions of the second times are read from DRAM and stored in the system cache. It can be understood that the system cache may not be directly connected to the DRAMC, and FIG. 6 is just an example.
本实施例中,如图8所示,为一个实施例中使用系统缓存区的架构示意图。其中包括中央处理器、视频译码器、显示处理器、动态随机存取内存控制器和系统缓存区(system buffer)。图7中的系统高速缓存大小为4MB(兆字节)。并且系统缓冲区属于SRAM(Static Random-Access Memory,静态随机存取存储器)中的一种。那么,响应于对获取的视频的译码处理,通过视频译码器获得视频中各视频帧所对应的运动矢量,基于各视频帧所对应的运动矢量确定各视频帧的被参考次数;将被参考次数满足第一次数条件的视频帧从DRAM中读取,并存储在视频译码器的内部缓存中;将被参考次数满足第二次数条件的视频帧直接存储在系统高速缓存中。In this embodiment, as shown in FIG. 8 , it is a schematic diagram of the architecture of using the system buffer area in one embodiment. These include the central processing unit, video decoder, display processor, dynamic random access memory controller, and system buffer. The system cache size in Figure 7 is 4MB (megabytes). And the system buffer is a type of SRAM (Static Random-Access Memory). Then, in response to the decoding processing of the acquired video, the motion vector corresponding to each video frame in the video is obtained by the video decoder, and the reference times of each video frame is determined based on the motion vector corresponding to each video frame; The video frames whose reference times meet the conditions of the first times are read from DRAM and stored in the internal buffer of the video decoder; the video frames whose reference times meet the conditions of the second times are directly stored in the system cache.
在一个实施例中,该视频数据存储方法还包括:在视频译码器中的内部缓存已满、且存入新的视频帧的情况下,将内部缓存中最不重要的视频帧删除。In one embodiment, the video data storage method further includes: in the case that the internal buffer in the video decoder is full and a new video frame is stored, deleting the least important video frame in the internal buffer.
具体地,在视频译码器中内部缓存已满、且还需要存入新的视频帧的情况下,电子设备将内部缓存中最不重要的视频帧删除,则可保证视频译码器一直能够存进数据,保证视频译码器的运行。最不重要可以是最旧的视频帧,也可以是以其他方式评判。Specifically, when the internal buffer in the video decoder is full and new video frames need to be stored, the electronic device deletes the least important video frame in the internal buffer, so as to ensure that the video decoder can always Store data to ensure the operation of the video decoder. Least important can be the oldest video frame, or it can be judged in other ways.
在一个实施例中,如图9所示,为一个实施例中译码过程示意图。图中包括I帧、B帧和P帧。其中I帧属于帧内压缩,译码时只需要利用到I帧其本身的信息即可。P帧为前向预测编码帧,即P帧译码时需要参考前面相关帧的信息才能解码。B帧为双向预测编码帧,译码时既需要参考前面已有的帧又需要参考后面待译码的帧。可以理解的是,有些视频标准允许B帧的两个参考对象都是前面的帧。其中,显示顺序(Display Order)则为如图9所示的从左到右的顺序。而译码顺序(Decoding Order)则为图9下的顺序0、3、2、4、1、7、6、8、5。图9中的译码顺序与显示顺序不相同。箭头表示参考,例如显示顺序2的B帧,该B帧是参考显示顺序0的I帧和显示顺序1的P帧后重建的,并且显示顺序2的B帧又可作为显示顺序1和显示顺序3的帧的参考视频帧。由此,可重建视频的视频帧。图中空白部分表示存储在DRAM中,即后续会存储在视频译码器的内部缓存中。灰色部分表示存储在视频译码器的外部存储中。那么显示顺序0的I帧、显示顺序2的B帧、显示顺序3的B帧、显示顺序4的P帧、显示顺序6的B帧和显示顺序8的B帧均有部分区块存储在视频译码器的外部存储中,另一部分存储在DRAM或者说视频译码器的内部缓存中。而显示顺序1的B帧、显示顺序5的B帧和显示顺序7的B帧均全部存储在DRAM中。本实施例中,对视频进行某些分析后得知哪些帧或者哪些区块不适合存储在DRAM中,或者说不适合存储在视频译码器的内部缓存中,则适合存储在位于视频译码器外的外部存储中,如系统高速缓存、系统缓冲区中至少一种。这样的存储分布情况下,译码器会妥善利用译码器内部缓存,使得只存在视频译码 器的外部的主存储中的数据能够在译码器内部缓存中存活时间更久,以更加减低系统带宽,达到极致省电的目的。In one embodiment, as shown in FIG. 9 , it is a schematic diagram of a decoding process in one embodiment. The figure includes I-frames, B-frames and P-frames. The I frame belongs to intra-frame compression, and only the information of the I frame itself needs to be used during decoding. The P frame is a forward predictive coded frame, that is, when the P frame is decoded, it is necessary to refer to the information of the previous relevant frame before decoding. The B frame is a bidirectional predictive coding frame, and it is necessary to refer to both the previous frame and the frame to be decoded later when decoding. It will be appreciated that some video standards allow both reference objects of a B-frame to be previous frames. Among them, the display order (Display Order) is the order from left to right as shown in FIG. 9 . The decoding order (Decoding Order) is the order of 0, 3, 2, 4, 1, 7, 6, 8, and 5 in FIG. 9 . The decoding order in FIG. 9 is not the same as the display order. The arrows indicate references, such as the B frame of display order 2, which is reconstructed by referring to the I frame of display order 0 and the P frame of display order 1, and the B frame of display order 2 can be used as display order 1 and display order. 3 frames of reference video frames. From this, video frames of the video can be reconstructed. The blank part in the figure indicates that it is stored in DRAM, that is, it will be stored in the internal buffer of the video decoder later. Parts in gray indicate storage in the video decoder's external storage. Then the I frame of display order 0, the B frame of display order 2, the B frame of display order 3, the P frame of display order 4, the B frame of display order 6 and the B frame of display order 8 all have partial blocks stored in the video. In the external storage of the decoder, another part is stored in the DRAM or the internal buffer of the video decoder. The B frames of display order 1, the B frames of display order 5, and the B frames of display order 7 are all stored in the DRAM. In this embodiment, after performing some analysis on the video, it is known which frames or which blocks are not suitable for storing in DRAM, or in other words, not suitable for storing in the internal cache of the video decoder, then it is suitable for storing in the video decoder. In the external storage outside the device, such as at least one of the system cache and the system buffer. In the case of such a storage distribution, the decoder will make proper use of the internal buffer of the decoder, so that the data that only exists in the external main storage of the video decoder can survive for a longer time in the internal buffer of the decoder, so as to reduce the cost of System bandwidth to achieve the ultimate power saving purpose.
本申请实施例的基本概念是妥善利用每一份可用到的on-chip memory(片上存储器,即视频译码器外部存储与内部存储)让DRAM存取量变低,视频译码器内部缓存策略在有其他片上存储器辅助时要做改变。将视频中整张参考视频帧或是一张参考视频帧的部分区块,将重复用到相对多次的数据存于系统高速缓存或者系统缓冲区这类低功耗的存储空间,剩下只要是未能放进去高速缓存或者系统缓冲区的数据就会传输到视频译码器内部缓存中进行处理。The basic concept of the embodiments of the present application is to make proper use of each available on-chip memory (on-chip memory, that is, the external storage and internal storage of the video decoder) to reduce the amount of DRAM access. The internal buffering strategy of the video decoder is Changes to be made when assisted by other on-chip memory. Store the entire reference video frame in the video or a partial block of a reference video frame, and store the data that will be reused relatively many times in the low-power storage space such as the system cache or system buffer, and the rest only needs to be The data that cannot be put into the cache or the system buffer will be transferred to the internal buffer of the video decoder for processing.
一种视频数据存储方法,包括:A video data storage method, comprising:
操作(b1),响应于对获取的视频的译码处理,获得视频中各视频帧所对应的运动矢量。In operation (b1), in response to the decoding process of the acquired video, a motion vector corresponding to each video frame in the video is obtained.
操作(b2),基于当前视频帧中的当前区块的运动矢量,确定当前视频帧所参考的参考视频帧中的参考视频区块。In operation (b2), the reference video block in the reference video frame referenced by the current video frame is determined based on the motion vector of the current block in the current video frame.
操作(b3),统计参考视频帧中参考视频区块的被参考次数。In operation (b3), the number of times the reference video block in the reference video frame is referenced is counted.
操作(b4),将被参考次数满足第一次数条件的参考视频区块存储至视频译码器的外部的主存储中。In operation (b4), the reference video blocks whose reference times satisfy the condition of the first times are stored in the external main storage of the video decoder.
操作(b5),将被参考次数满足第二次数条件的参考视频区块存储至视频译码器的外部存储中。其中,第二次数条件所表征的次数大于第一次数条件所表征的次数。In operation (b5), the reference video blocks whose reference times satisfy the condition of the second times are stored in the external storage of the video decoder. The number of times represented by the second order condition is greater than the number of times represented by the first order condition.
操作(b6),响应于对待重建视频帧的译码处理,在视频译码器的外部存储中不存在待重建视频帧所对应的参考视频区块,且在视频译码器的外部的主存储中存在参考视频区块的情况下,从主存储中读取参考视频区块。视频译码器的外部存储包括系统高速缓存或系统缓存区中至少一种。Operation (b6), in response to the decoding process of the video frame to be reconstructed, the reference video block corresponding to the video frame to be reconstructed does not exist in the external storage of the video decoder, and the main storage outside the video decoder does not exist If there is a reference video block in the , the reference video block is read from the main storage. The external storage of the video decoder includes at least one of a system cache or a system buffer.
操作(b7),将读取的参考视频区块存储至视频译码器的内部缓存中。In operation (b7), the read reference video block is stored in the internal buffer of the video decoder.
操作(b8),在视频译码器的外部存储中存在参考视频帧的情况下,从视频译码器的外部存储中读取参考视频帧。Operation (b8), if the reference video frame exists in the external storage of the video coder, the reference video frame is read from the external storage of the video coder.
操作(b9),在视频译码器中的内部缓存已满、且存入新的视频帧的情况下,将内部缓存中最不需要的视频帧删除。(最不需要的可以是最旧的或其他评断方法选择出来的)。In operation (b9), when the internal buffer in the video decoder is full and a new video frame is stored, delete the video frame that is least needed in the internal buffer. (The least needed can be the oldest or selected by other methods of judgment).
本实施例中的视频数据存储方法,响应于对获取的视频的译码处理,获得视频中各视频帧所对应的运动矢量,基于各视频帧的运动矢量确定各视频帧的被参考次数,则可得知视频帧要被使用几次;将被参考次数满足第一次数条件的视频帧存储至视频译码器的内部缓存中,将被参考次数满足第二次数条件的视频帧存储至译码器的外部存储中,即将被参考次数较少的视频帧存在视频译码器的内部缓存中,将被参考次数较多的视频帧存储在译码器的外部存储中;相较于传统的视频数据不论位于外部存储或是主存储都会被译码器放入译码器内部缓存,本实施例中只需要将不存在于外部存储的且存在于主存储的视频数据放入译码器内部缓存,减少了视频译码器的内部缓存的使用,使得译码器内部缓存的效率增加,专门针对还只留在主存储的数据进行更进一步的功耗降低。另外由于视频译码器的内部缓存有限并且通过内部缓存进行译码处理的处理速度快,因此将使用次数少的视频帧缓存在视频译码器中,而缓存的这些视频帧被更新的速度可以更快,能够充分利用视频译码器的缓存以加快译码处理。In the video data storage method in this embodiment, in response to the decoding processing of the acquired video, the motion vector corresponding to each video frame in the video is obtained, and the reference times of each video frame is determined based on the motion vector of each video frame, then It can be known that the video frame is to be used several times; the video frame that meets the condition of the first number of times is stored in the internal buffer of the video decoder, and the video frame that meets the condition of the second number of times is stored in the decoder. In the external storage of the decoder, the video frames that have been referenced less frequently are stored in the internal buffer of the video decoder, and the video frames that have been referenced more frequently are stored in the external storage of the decoder. Whether the video data is located in the external storage or the main storage, the decoder will put it into the internal buffer of the decoder. In this embodiment, it is only necessary to put the video data that does not exist in the external storage and exists in the main storage into the decoder. The cache reduces the use of the internal cache of the video decoder, increases the efficiency of the internal cache of the decoder, and further reduces power consumption for data that is still only in the main storage. In addition, since the internal buffer of the video decoder is limited and the processing speed of the decoding processing through the internal buffer is fast, the video frames that are used less frequently are buffered in the video decoder, and the speed at which these buffered video frames are updated can be improved. Faster, can fully utilize the buffer of the video coder to speed up the decoding process.
图10为一个实施例中视频数据读取方法的流程图。本实施例中的视频数据存储方法,以运行于电子设备上为例进行描述。如图10所示,视频数据存储方法包括操作1002至操作1004。FIG. 10 is a flowchart of a method for reading video data in one embodiment. The video data storage method in this embodiment is described by taking the operation on an electronic device as an example. As shown in FIG. 10 , the video data storage method includes operations 1002 to 1004 .
操作1002,响应于对获取的视频码流的译码处理,从视频译码器的外部的主存储中读取不存在于视频译码器的外部存储的参考视频区块至视频译码器的内部缓存后进行动作补偿或块复制。 Operation 1002, in response to a decoding process on the acquired video code stream, read a reference video block that does not exist in the external storage of the video decoder from the main storage outside the video decoder to the video decoder's external storage. Motion compensation or block copying after internal caching.
其中,主存储是指电子设备的主要存储。主存储例如可以是DRAM。动作补偿(Motion Compensation),也称运动补偿,是一种描述附近帧(附近在这里表示在编码关系上附近,在播放顺序上两帧未必在附近)差别的方法,具体来说是描述前面一帧的每个小块怎样移动到 待重建视频帧中的某个位置去。Among them, the main storage refers to the main storage of the electronic device. The main storage may be, for example, DRAM. Motion Compensation, also known as motion compensation, is a method to describe the difference between nearby frames (nearby means nearby in the coding relationship, and two frames may not be nearby in the playback order). Specifically, it describes the previous one. How each small block of the frame is moved to a certain position in the video frame to be reconstructed.
具体地,响应于对获取的视频码流的译码处理,电子设备获取待重建视频帧的目标运动矢量;电子设备根据目标运动矢量从视频译码器的外部的主存储中读取不存在于视频译码器的外部存储的参考视频区块至视频译码器的内部缓存后进行动作补偿;该参考视频区块是待重建视频帧所参考的视频帧的区块。或者,电子设备获取待重建视频帧的块矢量;根据块矢量从主存储中读取不存在于视频译码器的外部存储的参考视频区块至视频译码器的内部缓存后进行块复制。其中,待重建视频帧是指还未构建成功的视频帧。待重建视频帧的目标运动矢量表示当前视频帧与参考视频区块之间的位移。视频译码器的内部缓存与视频译码器的外部存储中所存储的视频数据可以相同,也可以不相同。例如视频中包含100个视频帧,分别为视频帧1、视频帧2、视频帧3…视频帧100。视频译码器的内部缓存中包括视频帧1…视频帧50,视频译码器的外部存储中包括视频帧51、视频帧52…视频帧100。Specifically, in response to the decoding processing of the acquired video code stream, the electronic device acquires the target motion vector of the video frame to be reconstructed; the electronic device reads from the external main storage of the video decoder according to the target motion vector, which does not exist in the video decoder. The reference video block stored outside the video decoder is stored in the internal buffer of the video decoder to perform motion compensation; the reference video block is the block of the video frame referenced by the video frame to be reconstructed. Alternatively, the electronic device obtains the block vector of the video frame to be reconstructed; according to the block vector, the reference video block that does not exist in the external storage of the video decoder is read from the main storage to the internal buffer of the video decoder and then performs block copying. The video frame to be reconstructed refers to a video frame that has not been successfully constructed yet. The target motion vector of the video frame to be reconstructed represents the displacement between the current video frame and the reference video block. The video data stored in the video decoder's internal buffer and the video decoder's external storage may or may not be the same. For example, the video contains 100 video frames, which are video frame 1, video frame 2, video frame 3...video frame 100 respectively. The internal buffer of the video decoder includes video frame 1...video frame 50, and the external storage of the video decoder includes video frame 51, video frame 52...video frame 100.
操作1004,或者从视频译码器的外部存储中读取参考视频区块后进行动作补偿或块复制。 Operation 1004, or perform motion compensation or block copy after reading the reference video block from the external storage of the video decoder.
具体地,电子设备从视频译码器的外部存储中读取参考视频区块后进行动作补偿。电子设备从视频译码器的外部存储中读取参考视频区块,并基于读取的参考视频区块重建得到目标视频帧。例如,电子设备将读取的参考视频区块进行加权融合重建得到目标视频帧。或者,电子设备从视频译码器的外部存储中读取参考视频区块后进行块复制。Specifically, the electronic device performs motion compensation after reading the reference video block from the external storage of the video decoder. The electronic device reads the reference video block from the external storage of the video decoder, and reconstructs the target video frame based on the read reference video block. For example, the electronic device performs weighted fusion reconstruction on the read reference video block to obtain the target video frame. Alternatively, the electronic device performs block copy after reading the reference video block from the external storage of the video decoder.
本实施例中的视频数据读取方法,通过响应于对获取的视频码流的译码处理,从主存储中读取不存在于视频译码器的外部存储的参考视频区块至视频译码器的内部缓存后进行运动补偿或者块复制,或者从视频译码器的外部存储中读取参考视频区块后进行动作补偿或块复制,即擦可从视频译码器的外部读取部分视频数据,利用了低功耗的外部存储,也减少了视频译码器的内部缓存的使用从而降低电子设备的功耗。In the video data reading method in this embodiment, by responding to the decoding processing of the acquired video code stream, the reference video block that does not exist in the external storage of the video decoder is read from the main storage to the video decoding. Motion compensation or block copy is performed after the internal buffer of the video decoder, or motion compensation or block copy is performed after the reference video block is read from the external storage of the video decoder, that is, part of the video can be read from the outside of the video decoder. Data, using low-power external storage, also reduces the use of the video decoder's internal buffer to reduce the power consumption of electronic equipment.
在一个实施例中,响应于对获取的视频码流的译码处理,从视频译码器的外部的主存储中读取不存在于视频译码器的外部存储的参考视频区块到视频译码器的内部缓存后进行动作补偿;或者从视频译码器的外部存储中读取参考视频区块后进行动作补偿或块复制,包括:In one embodiment, in response to the decoding process on the acquired video stream, a reference video block that does not exist in the external storage of the video coder is read from the main storage external to the video coder to the video coder The motion compensation is performed after the internal buffer of the video decoder; or the motion compensation or block copy is performed after reading the reference video block from the external storage of the video decoder, including:
响应于对获取的视频码流的译码处理,从视频译码器的外部存储中查找,在外部存储中查找到参考视频区块的情况下,则从外部存储中读取参考视频区块后进行动作补偿或块复制;In response to the decoding process to the video code stream obtained, look up from the external storage of the video decoder, find the reference video block in the external storage, then read the reference video block from the external storage. Perform motion compensation or block copying;
在外部存储中未查找到参考视频区块的情况下,从视频译码器的外部的主存储中查找到参考视频区块,从主存储中读取参考视频区块至视频译码器的内部缓存后进行动作补偿或块复制。In the case where the reference video block is not found in the external storage, the reference video block is found from the external main storage of the video decoder, and the reference video block is read from the main storage to the interior of the video decoder Motion compensation or block copying after caching.
具体地,电子设备根据待重建视频帧的目标运动矢量,从视频译码器的外部存储中查找相应的参考视频区块。在外部存储中查找到待重建视频帧相应的参考视频区块的情况下,则从外部存储中读取与待重建视频帧相应的参考视频区块后进行动作补偿或块复制。在外部存储中未查找到与待重建视频帧相应的参考视频区块的情况下,电子设备从主存储中查找到与待重建视频帧相应的参考视频区块,从主存储中读取参考视频区块至视频译码器的内部缓存后进行动作补偿或块复制。其中,参考视频区块是参考视频帧中的一部分视频区域。与待重建视频帧相应的参考视频区块的数量不限。例如可以为1、2、3…不限于此。Specifically, the electronic device searches for the corresponding reference video block from the external storage of the video decoder according to the target motion vector of the video frame to be reconstructed. When the reference video block corresponding to the video frame to be reconstructed is found in the external storage, motion compensation or block copying is performed after reading the reference video block corresponding to the video frame to be reconstructed from the external storage. If the reference video block corresponding to the video frame to be reconstructed is not found in the external storage, the electronic device finds the reference video block corresponding to the video frame to be reconstructed from the main storage, and reads the reference video from the main storage Motion compensation or block copying is performed after the block is stored in the video decoder's internal buffer. The reference video block is a part of the video area in the reference video frame. The number of reference video blocks corresponding to the video frame to be reconstructed is not limited. For example, it may be 1, 2, 3... but not limited thereto.
以外部存储为system cache、主存储为DRAM、视频译码器的内部缓存为VDEC cache为例,电子设备根据待重建视频帧的目标运动矢量从system cache查找相应的参考视频区块。在system cache查找到相应的参考视频区块的情况下,则从system cache读取与待重建视频帧相应的参考视频区块。而在system cache中未查找到与待重建视频帧相应的参考视频区块的情况下,从DRAM中查找到与待重建视频帧相应的参考视频区块,并从主存储中读取该参考视频区块至VDEC cache后进行动作补偿。Taking the external storage as the system cache, the main storage as the DRAM, and the internal cache of the video decoder as the VDEC cache as an example, the electronic device searches for the corresponding reference video block from the system cache according to the target motion vector of the video frame to be reconstructed. When the system cache finds the corresponding reference video block, the reference video block corresponding to the video frame to be reconstructed is read from the system cache. If the reference video block corresponding to the video frame to be reconstructed is not found in the system cache, the reference video block corresponding to the video frame to be reconstructed is found from the DRAM, and the reference video is read from the main storage Motion compensation is performed after the block is sent to the VDEC cache.
本实施例中,在外部存储中未查找到所有与待重建视频帧相应的参考视频区块的情况下,从主存储查找到与剩余的待重建视频帧相应的参考视频区块,并从主存储中读取该参考视频区块至视频译码器的内部缓存后进行动作补偿或块复制。In this embodiment, when all reference video blocks corresponding to the video frames to be reconstructed are not found in the external storage, the reference video blocks corresponding to the remaining video frames to be reconstructed are searched from the main storage, and the reference video blocks corresponding to the remaining video frames to be reconstructed are searched from the main storage. The reference video block is read from the storage to the internal buffer of the video decoder for motion compensation or block copying.
本实施例中,从视频译码器的外部存储中查找到参考视频区块的情况下,则从外部存储中读取参考视频区块后进行动作补偿或块复制;在外部存储中未查找到参考视频区块的情况下,从视频译码器的外部的主存储中再查找到参考视频区块,从主存储中查找到参考视频区块,从主存储中读取参考视频区块至视频译码器的内部缓存后进行动作补偿或块复制;则视频译码器内部缓存读取的仅是来自主存储中的数据,相比于传统的视频译码器内部缓存与外部存储所存储的数据一致的方式,能够节省视频译码器内部不必要的缓存操作,且由于视频译码器内部缓存的视频数据量较小,因此可以进一步降低主存储的带宽,从而降低电子设备功耗。In this embodiment, when the reference video block is found from the external storage of the video decoder, motion compensation or block copy is performed after reading the reference video block from the external storage; the reference video block is not found in the external storage. In the case of the reference video block, find the reference video block from the external main storage of the video decoder, find the reference video block from the main storage, read the reference video block from the main storage to the video The internal buffer of the decoder performs motion compensation or block copy; the internal buffer of the video decoder reads only the data from the main storage, compared with the data stored in the internal buffer of the traditional video decoder and the external storage. The data consistency method can save unnecessary buffering operations inside the video decoder, and because the amount of video data buffered in the video decoder is small, the bandwidth of the main storage can be further reduced, thereby reducing the power consumption of electronic equipment.
在一个实施例中,该视频数据读取方法还包括:响应于对获取的视频的译码处理,获得视频中各视频帧所对应的运动矢量;基于各视频帧所对应的运动矢量确定各视频帧的被参考次数;将被参考次数满足第一次数条件的视频帧从视频译码器的外部的主存储读取后存储至视频译码器的内部缓存中;将被参考次数满足第二次数条件的视频帧存储至视频译码器的外部存储中;第二次数条件所表征的次数大于第一次数条件所表征的次数。In one embodiment, the video data reading method further includes: in response to decoding processing of the acquired video, obtaining a motion vector corresponding to each video frame in the video; determining each video frame based on the motion vector corresponding to each video frame The number of times the frame is referenced; the video frame whose number of times to be referenced meets the condition of the first number of times is read from the external main storage of the video decoder and stored in the internal buffer of the video decoder; The video frame of the number of times is stored in the external storage of the video decoder; the number of times represented by the second-order condition is greater than the number of times represented by the first-time condition.
本实施例中,响应于对获取的视频的译码处理,获得视频中各视频帧所对应的运动矢量,基于各视频帧的运动矢量确定各视频帧的被参考次数,则可得知视频帧要被使用几次;将被参考次数满足第一次数条件的视频帧从主存储存储至视频译码器的内部缓存中,将被参考次数满足第二次数条件的视频帧存储至译码器的外部存储中,即将被参考次数少的视频帧存在视频译码器的内部缓存中,将被参考次数多的视频帧存储在译码器的外部存储中;降低了视频译码器的内部缓存的使用,利用了低功耗的外部存储,从而降低电子设备的功耗。另外由于视频译码器的内部缓存有限,因此将使用次数少的视频帧缓存在视频译码器中,而外部缓存的这些视频帧被更新的速度可以更快,能够充分利用外部缓存以加快译码处理。In this embodiment, in response to the decoding processing of the acquired video, the motion vector corresponding to each video frame in the video is obtained, and the number of times each video frame is referenced is determined based on the motion vector of each video frame, then the video frame can be known. To be used several times; store the video frames that meet the condition of the first number of times from the main storage to the internal buffer of the video decoder, and store the video frames that meet the condition of the second number of times to the decoder In the external storage of the video decoder, the video frames that have been referenced less frequently are stored in the internal buffer of the video decoder, and the video frames that have been referenced many times are stored in the external storage of the decoder; the internal buffer of the video decoder is reduced. The use of low-power external storage reduces the power consumption of electronic devices. In addition, because the internal buffer of the video decoder is limited, the video frames that are used less frequently are buffered in the video decoder, and these video frames in the external buffer can be updated faster, and the external buffer can be fully utilized to speed up the decoding. code processing.
在一个实施例中,视频译码器的外部存储包括系统高速缓存、系统缓冲区中至少一种。其中,系统高速缓存(system cache)和系统缓存区(system buffer)均属于片上存储器(on-chip memory)。且系统高速缓存和系统缓存区均属于静态随机存取存储器(Static Random-Access Memory,SRAM)。本实施例中,通过将满足第二次数条件的视频帧存储在系统高速缓存、系统缓存区中至少一种中,由于从系统高速缓存和系统缓冲区读取的数据的速度较快且功耗小,因此可保持视频译码器的译码速度,能不将存于这些缓存中的数据放入译码器内部缓存。In one embodiment, the external storage of the video decoder includes at least one of a system cache, a system buffer. Among them, the system cache (system cache) and the system cache area (system buffer) both belong to the on-chip memory (on-chip memory). And both the system cache and the system cache area belong to static random-access memory (Static Random-Access Memory, SRAM). In this embodiment, by storing the video frames that meet the conditions of the second number of times in at least one of the system cache and the system buffer, the data read from the system cache and the system buffer is faster and consumes less power. Therefore, the decoding speed of the video decoder can be maintained, and the data stored in these buffers can not be put into the internal buffer of the decoder.
在一个实施例中,如图11所示,为一个实施例中重建视频帧的流程示意图。其中包括A视频帧1102、B视频帧1104、C视频帧1106、待重建视频帧1108,并且A视频帧1102、A视频帧1104和A视频帧1106均是已经重建完成的视频帧,而待重建视频帧1108还未重建完成。其中,A视频帧1102、A视频帧1104和A视频帧1106中的白色部分是指存储在DRAM中,也即存储在视频译码器的内部缓存中;灰色阴影部分的区块存储在视频译码器的外部存储中。并且A视频帧1102、B视频帧1104和C视频帧1106均是待重建视频帧1108的参考视频帧。由图可见,视频帧的不同区块可存储在不同的存储中。图11中以16×16的区块、待重建视频帧1108为B帧为例进行说明。In one embodiment, as shown in FIG. 11 , it is a schematic flowchart of reconstructing a video frame in one embodiment. It includes A video frame 1102, B video frame 1104, C video frame 1106, and to-be-reconstructed video frame 1108, and A video frame 1102, A video frame 1104, and A video frame 1106 are all video frames that have been reconstructed, and are to be reconstructed. Video frame 1108 has not yet been reconstructed. Among them, the white parts in the A video frame 1102, the A video frame 1104 and the A video frame 1106 are stored in the DRAM, that is, stored in the internal buffer of the video decoder; the blocks in the gray shaded part are stored in the video decoder. in the external storage of the encoder. And the A video frame 1102 , the B video frame 1104 and the C video frame 1106 are all reference video frames of the video frame 1108 to be reconstructed. As can be seen from the figure, different blocks of a video frame can be stored in different stores. In FIG. 11 , the block of 16×16 and the video frame 1108 to be reconstructed as a B frame are taken as an example for description.
待重建视频帧中一个小方块表示一个当前区块。图11中的参考区块不重复使用。电子设备获取待重建视频帧的第1个、第2个、第3个、第4个、第5个、第6个和第7个的子目标运动矢量,并且基于子目标运动矢量可确定参考区块。如待重建视频帧1108的第1个区块可由A视频帧1102中的0区块和A视频帧1104中的1区块重建而成。待重建视频帧1108的第2个区块可由A视频帧1102中的2区块和A视频帧1106中的3区块重建而成。待重建视频帧1108的第3个区块可由A视频帧1104中的4区块和A视频帧1104中的5区块重建而成。待重建视频帧1108的第4个区块可由A视频帧1104中的6区块和A视频帧1106中的7区块重建而成。待重建视频帧1108的第5个区块可由A视频帧1102中的8区块和A视频帧1104中的9区块重建而成。待重建视频帧1108的第6个区块可由A视频帧1104中的A区块和A视频帧1106中的B区块重建而成。待重建视频帧1108的第7个区块可由A视频帧1102的C 区块和A视频帧1104中的D区块重建而成。A small square in the video frame to be reconstructed represents a current block. The reference blocks in Figure 11 are not reused. The electronic device obtains the 1st, 2nd, 3rd, 4th, 5th, 6th and 7th sub-target motion vectors of the video frame to be reconstructed, and can determine the reference based on the sub-target motion vectors block. For example, the first block of the video frame 1108 to be reconstructed can be reconstructed from the 0 block in the A video frame 1102 and the 1 block in the A video frame 1104 . The second block of the video frame 1108 to be reconstructed can be reconstructed from 2 blocks in the A video frame 1102 and 3 blocks in the A video frame 1106 . The third block of the video frame 1108 to be reconstructed can be reconstructed from 4 blocks in the A video frame 1104 and 5 blocks in the A video frame 1104 . The fourth block of the video frame 1108 to be reconstructed can be reconstructed from 6 blocks in the A video frame 1104 and 7 blocks in the A video frame 1106 . The fifth block of the video frame 1108 to be reconstructed can be reconstructed from 8 blocks in the A video frame 1102 and 9 blocks in the A video frame 1104 . The sixth block of the video frame 1108 to be reconstructed can be reconstructed from the A block in the A video frame 1104 and the B block in the A video frame 1106 . The seventh block of the to-be-reconstructed video frame 1108 can be reconstructed from the C block of the A video frame 1102 and the D block of the A video frame 1104 .
在一个实施例中,如图12所示,为一个实施例中传统的视频译码器内部存储的存储方式的示意图。以图11中区块为例,图12中视频译码器内部存储的存储方式按照顺序存储区块。例如第一步存储区块0,第二步存储区块1、2、3、4、5、6和7,当有新的区块存入时,则如第三步存储区块6、7、8、9、A、B、C和D。也就是说,图12中的视频译码器的内部缓存,会对任何区域读取到的区块进行暂存,不论是从DRAM中读取的(白色部分)还是从视频译码器的外部存储(灰色部分)读取的。这种方式使得根本不需要视频译码器的内部缓存来节省DRAM吞吐量的视频数据也存入了视频译码器的内部缓存中,浪费了视频译码器的内部缓存的读写能耗。In one embodiment, as shown in FIG. 12 , it is a schematic diagram of a storage manner of internal storage of a conventional video decoder in one embodiment. Taking the block in FIG. 11 as an example, the storage method of the internal storage of the video decoder in FIG. 12 stores the blocks in sequence. For example, the first step stores block 0, and the second step stores blocks 1, 2, 3, 4, 5, 6, and 7. When a new block is stored, the third step stores blocks 6, 7. , 8, 9, A, B, C and D. That is to say, the internal buffer of the video decoder in Figure 12 will temporarily store the blocks read from any area, whether it is read from DRAM (white part) or from outside the video decoder Stored (gray section) read. In this way, the video data that does not need the internal buffer of the video decoder at all to save the throughput of the DRAM is also stored in the internal buffer of the video decoder, which wastes the read and write energy consumption of the internal buffer of the video decoder.
在一个实施例中,如图13所示,为一个实施例中视频译码器内部存储的存储方式的示意图。其中,视频译码器的内部缓存中白色部分是指原先存储在DRAM中,也即后续会存储在视频译码器的内部缓存中的区块。相较于图12的方式,图13的视频译码器的内部缓存中仅存储来自于DRAM的区块。因此,视频译码器的外部存储中所存储的区块与视频译码器的内部缓存中所存储的区块不会重复存储,区分出存于DRAM中的区块,并将存于DRAM中的区块读取至视频译码器的内部缓存中,另一部分区块存储与视频译码器的外部存储中,使得在译码过程中整体上减少DRAM的读取,降低DRAM的带宽,从而降低电子设备的功耗。在system buffer/cache中数据本身就是省电的,访问速度快且可控,这样的数据若还使用VDEC internal cache再次快取是对译码速度无帮助且多耗了一次存取SRAM能量。另外如果已经有省电的system cache/buffer存住部分frame buffer数据,剩下不存于system cache/buffer部分的数据进入VDEC internal cache才有实质省DRAM bandwidth的意义。In one embodiment, as shown in FIG. 13 , it is a schematic diagram of a storage manner of internal storage of the video decoder in one embodiment. Wherein, the white part in the internal buffer of the video decoder refers to the block originally stored in the DRAM, that is, the block that will be subsequently stored in the internal buffer of the video decoder. Compared with the method of FIG. 12 , the internal buffer of the video decoder of FIG. 13 only stores blocks from DRAM. Therefore, the blocks stored in the external storage of the video decoder and the blocks stored in the internal buffer of the video decoder will not be stored repeatedly, and the blocks stored in the DRAM are distinguished and stored in the DRAM The block is read into the internal buffer of the video decoder, and another part of the block is stored in the external storage of the video decoder, so that the reading of the DRAM is reduced as a whole during the decoding process, and the bandwidth of the DRAM is reduced. Reduce power consumption of electronic equipment. In the system buffer/cache, the data itself is power-saving, and the access speed is fast and controllable. If such data is cached again by using the VDEC internal cache, it will not help the decoding speed and consume more energy for accessing the SRAM. In addition, if there is already a power-saving system cache/buffer to store part of the frame buffer data, the remaining data that is not stored in the system cache/buffer will enter the VDEC internal cache to save DRAM bandwidth.
在一个实施例中,表1为一个实施例中SRAM和DRAM的能耗差异示意图。SRAM(Static Random-Access Memory,静态随机存取存储器)的能耗大约5PJ(皮焦耳),而DRAM的能耗大约640PJ(皮焦耳),二者之间相差2个数量级。按照相对能耗来算,SRAM的相对能耗是10 2,而DRAM的相对能耗是10 4,二者相差2个数量级。表1中虽然描述了存取DRAM相对于存取SRAM耗电100倍以上,即便电子设备中有system buffer/cache(系统缓存/高速缓存),量也是有限的,不可能无限制扩大VDEC外的on-chip SRAM。因此善用原本视频译码器的内部的缓存,能让原本使用system cache/buffer情况下更加的把需求DRAM带宽降低,达到更极致的省电与低功耗。 In one embodiment, Table 1 is a schematic diagram of the difference in energy consumption between SRAM and DRAM in one embodiment. The power consumption of SRAM (Static Random-Access Memory, static random access memory) is about 5PJ (picojoule), while the power consumption of DRAM is about 640PJ (picojoule), the difference between the two is two orders of magnitude. In terms of relative energy consumption, the relative energy consumption of SRAM is 10 2 , while the relative energy consumption of DRAM is 10 4 , the difference between the two is 2 orders of magnitude. Although it is described in Table 1 that accessing DRAM consumes more than 100 times the power compared to accessing SRAM, even if there is a system buffer/cache (system cache/cache) in an electronic device, the amount is limited, and it is impossible to unrestrictedly expand the memory outside VDEC. on-chip SRAM. Therefore, making good use of the internal cache of the original video decoder can reduce the required DRAM bandwidth even when the system cache/buffer is used, and achieve more extreme power saving and low power consumption.
表1Table 1
存储名称storage name 能耗(energy pJ)Energy consumption (energy pJ) 相对能耗(Relative Energy Cost)Relative Energy Cost
静态随机存取存储器static random access memory 55 10 2 10 2
动态随机存取存储器dynamic random access memory 640640 10 4 10 4
应该理解的是,虽然图5和图10的流程图中的各个操作按照箭头的指示依次显示,但是这些操作并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些操作的执行并没有严格的顺序限制,这些操作可以以其它的顺序执行。而且,图5和图10中的至少一部分操作可以包括多个子操作或者多个阶段,这些子操作或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子操作或者阶段的执行顺序也不必然是依次进行,而是可以与其它操作或者其它操作的子操作或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the respective operations in the flowcharts of FIG. 5 and FIG. 10 are displayed in sequence according to the arrows, these operations are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, the execution of these operations is not strictly limited in order, and these operations may be performed in other orders. Moreover, at least a part of the operations in FIG. 5 and FIG. 10 may include multiple sub-operations or multiple stages. These sub-operations or stages are not necessarily executed and completed at the same time, but may be executed at different times. These sub-operations or The order of execution of the stages is also not necessarily sequential, but may be performed alternately or alternately with other operations or sub-operations of other operations or at least a portion of a stage.
图14为一个实施例的视频数据存储装置的结构框图。如图14所示,一种视频数据存储装置包括第一读取模块1402和参考视频帧存储模块1404,其中:FIG. 14 is a structural block diagram of a video data storage device according to an embodiment. As shown in Figure 14, a video data storage device includes a first reading module 1402 and a reference video frame storage module 1404, wherein:
第一读取模块1402,用于响应于对待重建视频帧的译码处理,在视频译码器的外部存储中不存在待重建视频帧的参考视频帧,且在视频译码器的外部的主存储中存在参考视频帧的 情况下,从主存储中读取参考视频帧;以及The first reading module 1402 is configured to respond to the decoding process of the video frame to be reconstructed, the reference video frame of the video frame to be reconstructed does not exist in the external storage of the video decoder, and the main external storage of the video decoder does not exist. Reading the reference video frame from main storage if the reference video frame exists in storage; and
参考视频帧存储模块1404,用于将从主存储中读取的参考视频帧存储至视频译码器的内部缓存中。The reference video frame storage module 1404 is used for storing the reference video frame read from the main storage into the internal buffer of the video decoder.
本实施例中的视频数据存储装置,响应于对待重建视频帧的译码处理,在视频译码器的外部存储中不存在待重建视频帧的参考视频帧,且在视频译码器的外部的主存储中存在参考视频帧的情况下,从主存储中读取参考视频帧,将从主存储中读取的参考视频帧存储至视频译码器的内部缓存中,即在视频译码器的外部存储中存在的视频数据不存进视频译码器的内部缓存中,主存储中的视频数据会存进视频译码器的内部缓存中,相较于传统的视频数据不论位于外部存储或是主存储都会被译码器放入译码器内部缓存,本实施例中只需要将不存在于外部存储的且存在于主存储的视频数据放入译码器内部缓存,减少了视频译码器的内部缓存的使用,使得译码器内部缓存的效率增加,专门针对还只留在主存储的数据进行更进一步的功耗降低。In the video data storage device in this embodiment, in response to the decoding process of the video frame to be reconstructed, the reference video frame of the video frame to be reconstructed does not exist in the external storage of the video decoder, and the reference video frame of the video frame to be reconstructed does not exist in the external storage of the video decoder. When there is a reference video frame in the main storage, the reference video frame is read from the main storage, and the reference video frame read from the main storage is stored in the internal buffer of the video decoder, that is, in the video decoder's internal buffer. The video data in the external storage is not stored in the internal buffer of the video decoder, and the video data in the main storage will be stored in the internal buffer of the video decoder. The main storage will be put into the internal buffer of the decoder by the decoder. In this embodiment, only the video data that does not exist in the external storage and exists in the main storage needs to be put into the internal buffer of the decoder, reducing the number of video decoders. The use of the internal cache increases the efficiency of the internal cache of the decoder, and further reduces power consumption specifically for the data that remains only in the main storage.
在一个实施例中,每帧视频帧被划分为多个视频区块。第一读取模块1402用于在视频译码器的外部存储中不存在待重建视频帧所对应的参考视频区块,且在视频译码器的外部的主存储中存在参考视频区块的情况下,从主存储中读取参考视频区块。参考视频帧存储模块1404用于将从主存储中读取的参考视频区块存储至视频译码器的内部缓存中。In one embodiment, each video frame is divided into multiple video blocks. The first reading module 1402 is used for the situation that the reference video block corresponding to the video frame to be reconstructed does not exist in the external storage of the video decoder, and the reference video block exists in the external main storage of the video decoder Next, the reference video block is read from the main storage. The reference video frame storage module 1404 is used for storing the reference video blocks read from the main storage into the internal buffer of the video decoder.
本实施例中,在视频译码器的外部存储中不存在待重建视频帧所对应的参考视频区块,且在主存储中存在参考视频区块的情况下,电子设备从主存储中读取参考视频区块并存储至视频译码器的内部缓存中,由于视频译码器中的内部缓存较小,采用存储区块的方式更加适应视频译码器中的内部缓存,提高视频数据存储的精度。In this embodiment, the reference video block corresponding to the video frame to be reconstructed does not exist in the external storage of the video decoder, and if the reference video block exists in the main storage, the electronic device reads from the main storage Refer to the video block and store it in the internal cache of the video decoder. Since the internal cache in the video decoder is small, the storage block is more suitable for the internal cache in the video decoder, improving the storage capacity of video data. precision.
在一个实施例中,第一读取模块1402还用于在视频译码器的外部存储中存在参考视频帧的情况下,从视频译码器的外部存储中读取参考视频帧。In one embodiment, the first reading module 1402 is further configured to read the reference video frame from the external storage of the video coder if the reference video frame exists in the external storage of the video coder.
本实施例中,在视频译码器的外部存储中存在参考视频帧的情况下,从视频译码器的外部存储中读取参考视频帧,通过视频译码器的外部存储进行数据存取,能将译码器内部缓存的效率增加,专门针对还只留在主存储的数据进行更进一步的功耗降低。In this embodiment, when there is a reference video frame in the external storage of the video decoder, the reference video frame is read from the external storage of the video decoder, and data access is performed through the external storage of the video decoder, The efficiency of the internal cache of the decoder can be increased, and further power consumption can be reduced specifically for the data that is still only in the main storage.
在一个实施例中,视频数据存储装置还包括运动矢量获取模块、次数确定模块、第一存储模块和第二存储模块,其中:In one embodiment, the video data storage device further includes a motion vector acquisition module, a number of times determination module, a first storage module and a second storage module, wherein:
运动矢量获取模块,用于响应于对获取的视频的译码处理,获得视频中各视频帧所对应的运动矢量;a motion vector acquisition module, used for obtaining the motion vector corresponding to each video frame in the video in response to the decoding process of the acquired video;
次数确定模块,用于基于各视频帧所对应的运动矢量确定各视频帧的被参考次数;A number of times determination module, used for determining the number of times each video frame is referenced based on the motion vector corresponding to each video frame;
第一存储模块,用于将被参考次数满足第一次数条件的视频帧存储至视频译码器的主存储中;The first storage module is used to store the video frame whose number of references meets the condition of the first number of times in the main storage of the video decoder;
第二存储模块,用于将被参考次数满足第二次数条件的视频帧存储至视频译码器的外部存储中;其中,第二次数条件所表征的次数大于第一次数条件所表征的次数。The second storage module is used to store the video frames whose reference times satisfy the second time condition in the external storage of the video decoder; wherein, the times represented by the second time condition is greater than the number represented by the first time condition .
本实施例中,响应于对获取的视频的译码处理,获得视频中各视频帧所对应的运动矢量,基于各视频帧的运动矢量确定各视频帧的被参考次数,则可得知视频帧要被使用几次;将被参考次数满足第一次数条件的视频帧存储至视频译码器的内部缓存中,将被参考次数满足第二次数条件的视频帧存储至译码器的外部存储中,即将被参考次数较少的视频帧存在视频译码器的内部缓存中,将被参考次数较多的视频帧存储在译码器的外部存储中;降低了视频译码器的内部缓存的使用,利用了低功耗的外部存储,从而降低电子设备的功耗。另外由于视频译码器的内部缓存有限,因此将使用次数少的视频帧缓存在视频译码器中,而外部缓存的这些视频帧被更新的速度可以更快,能够充分利用外部缓存以加快译码处理。In this embodiment, in response to the decoding processing of the acquired video, the motion vector corresponding to each video frame in the video is obtained, and the number of times each video frame is referenced is determined based on the motion vector of each video frame, then the video frame can be known. To be used several times; store the video frames that meet the condition of the first number of times to the internal buffer of the video decoder, and store the video frames that meet the condition of the second number of times to the external storage of the decoder , the video frames that will be referenced less frequently will be stored in the internal buffer of the video decoder, and the video frames that will be referenced more frequently will be stored in the external storage of the decoder. Use, take advantage of low-power external storage, thereby reducing the power consumption of electronic equipment. In addition, because the internal buffer of the video decoder is limited, the video frames that are used less frequently are buffered in the video decoder, and these video frames in the external buffer can be updated faster, and the external buffer can be fully utilized to speed up the decoding. code processing.
在一个实施例中,次数确定模块用于基于当前视频帧的运动矢量确定当前视频帧所参考的参考视频帧;统计参考视频帧的被参考次数。In one embodiment, the number of times determination module is configured to determine the reference video frame referenced by the current video frame based on the motion vector of the current video frame; and count the number of times the reference video frame is referenced.
本实施例中的视频数据存储装置,基于当前视频帧的运动矢量确定当前视频帧所参考的参考视频帧,统计参考视频帧的被参考次数,即得知当前视频帧是哪个,运动矢量是什么, 即可得到当前视频帧所参考的参考视频帧是什么,由此可得到视频中各视频帧的被参考次数,并将基于参考次数进行视频数据存储,降低电子设备的功耗。The video data storage device in this embodiment determines the reference video frame referenced by the current video frame based on the motion vector of the current video frame, and counts the number of times the reference video frame is referenced, that is, to know which current video frame is and what is the motion vector , the reference video frame referenced by the current video frame can be obtained, thereby obtaining the reference times of each video frame in the video, and storing video data based on the reference times to reduce the power consumption of the electronic device.
在一个实施例中,次数确定模块还用于当当前视频帧与目标参考视频帧之间的视频帧的数量达到预设数量时,停止统计该目标参考视频帧的被参考次数,获得该目标参考视频帧的被参考次数。由于当前视频帧与所参考的视频帧之间一般不会间隔太多帧,因此当当前视频帧与目标参考视频帧之间的视频帧的数量达到预设数量时,当前视频帧往后的视频帧一般不会再参考该目标参考视频帧,因此可直接获得该目标参考视频帧的被参考次数。In one embodiment, the number of times determination module is further configured to stop counting the number of times the target reference video frame is referenced when the number of video frames between the current video frame and the target reference video frame reaches a preset number, and obtain the target reference video frame. The number of times the video frame has been referenced. Since there are generally not too many frames between the current video frame and the referenced video frame, when the number of video frames between the current video frame and the target reference video frame reaches the preset number, the video frames after the current video frame The frame generally does not refer to the target reference video frame, so the reference times of the target reference video frame can be directly obtained.
在一个实施例中,每帧视频帧被划分为多个区块。次数确定模块用于基于当前视频帧中的当前区块的运动矢量,确定当前视频帧所参考的参考视频帧中的参考视频区块;统计参考视频帧中参考视频区块的被参考次数;将被参考次数满足第一次数条件的参考视频区块存储至视频译码器的内部缓存中;将被参考次数满足第二次数条件的参考视频区块存储至视频译码器的外部存储中。In one embodiment, each video frame is divided into multiple blocks. The number of times determination module is used to determine the reference video block in the reference video frame referenced by the current video frame based on the motion vector of the current block in the current video frame; count the referenced times of the reference video block in the reference video frame; The reference video blocks that meet the condition of the first number of times are stored in the internal buffer of the video decoder; the reference video blocks that meet the condition of the second number of times are stored in the external storage of the video decoder.
本实施例中,基于当前区块的运动矢量,确定所参考的参考视频区块,统计参考视频区块的被参考次数,并将被参考次数满足第一次数条件的参考视频区块存储至视频译码器的内部存储中,将被参考次数满足第二次数条件的参考视频区块存储至视频译码器的外部存储中,那么可基于当前区块确定所参考的参考视频区块,存储的视频数据更加准确,由于视频译码器中的内部缓存较小,采用存储区块的方式更加适应视频译码器中的内部缓存。In this embodiment, the reference video block to be referenced is determined based on the motion vector of the current block, the reference times of the reference video block are counted, and the reference video blocks whose reference times satisfy the condition of the first times are stored in the In the internal storage of the video decoder, the reference video block whose number of references meets the condition of the second number of times is stored in the external storage of the video decoder, then the referenced reference video block can be determined based on the current block and stored. The video data is more accurate. Since the internal buffer in the video decoder is small, the storage block method is more suitable for the internal buffer in the video decoder.
在一个实施例中,视频译码器的外部存储包括系统高速缓存或系统缓存区中至少一种。本实施例中,通过将满足第二次数条件的视频帧存储在系统高速缓存、系统缓存区中至少一种中,由于从系统高速缓存和系统缓冲区读取的数据的速度较快且功耗小,因此可保持视频译码器的译码速度,并降低电子设备的功耗。In one embodiment, the external storage of the video coder includes at least one of a system cache or a system buffer. In this embodiment, by storing the video frames that meet the conditions of the second number of times in at least one of the system cache and the system buffer, the data read from the system cache and the system buffer is faster and consumes less power. Therefore, the decoding speed of the video decoder can be maintained, and the power consumption of the electronic equipment can be reduced.
在一个实施例中,视频译码器的外部的主存储包括动态随机存取存储器。In one embodiment, the main storage external to the video coder includes dynamic random access memory.
在一个实施例中,第一存储模块还用于在视频译码器中的内部缓存已满、且存入新的视频帧的情况下,将内部缓存中最不需要的视频帧删除。本实施例中,在视频译码器中内部缓存已满、且还需要存入新的视频帧的情况下,电子设备将内部缓存中最不需要的视频帧删除,则可保证视频译码器一直能够存进数据,保证视频译码器的运行。例如,可以通过新旧来判断哪些视频帧最不需要。最不需要的视频帧例如可以是最旧的。在其他实施例中,也可以使用其他评断方法选择出最不需要的视频帧。In one embodiment, the first storage module is further configured to delete the most unnecessary video frames in the internal buffer when the internal buffer in the video decoder is full and new video frames are stored. In this embodiment, when the internal buffer in the video decoder is full and new video frames need to be stored, the electronic device deletes the least-needed video frames in the internal buffer to ensure that the video decoder Data can always be stored to ensure the operation of the video decoder. For example, it is possible to determine which video frames are least needed by looking at old and new. The least needed video frames may be, for example, the oldest. In other embodiments, other judgment methods may also be used to select the least needed video frames.
图15为一个实施例的视频数据读取装置的结构框图。如图15所示,一种视频数据读取装置,包括第二读取模块1502和第三读取模块1504,其中:FIG. 15 is a structural block diagram of a video data reading apparatus according to an embodiment. As shown in FIG. 15, a video data reading device includes a second reading module 1502 and a third reading module 1504, wherein:
第二读取模块1502,用于响应于对获取的视频码流的译码处理,从视频译码器的外部的主存储中读取不存在于视频译码器的外部存储的参考视频区块至视频译码器的内部缓存后进行动作补偿或块复制;The second reading module 1502 is configured to, in response to the decoding processing of the acquired video code stream, read the reference video blocks that do not exist in the external storage of the video decoder from the external main storage of the video decoder to the internal buffer of the video decoder for motion compensation or block copying;
或者,or,
第三读取模块1504,用于从视频译码器的外部存储中读取参考视频区块后进行动作补偿或块复制。The third reading module 1504 is configured to perform motion compensation or block copy after reading the reference video block from the external storage of the video decoder.
本实施例中的视频数据读取装置,通过响应于对获取的视频码流的译码处理,从主存储中读取不存在于视频译码器的外部存储的参考视频区块至视频译码器的内部缓存后进行运动补偿或块复制,或者从视频译码器的外部存储中读取参考视频区块后进行动作补偿或块复制,即通过视频译码器的外部存储了部分视频数据,利用了低功耗的外部存储,减少了视频译码器的内部缓存的使用,也减少了主存储的带宽,从而降低电子设备的功耗。The device for reading video data in this embodiment reads the reference video blocks that do not exist in the external storage of the video decoder from the main storage in response to the decoding processing of the acquired video code stream to the video decoding Motion compensation or block copy is performed after the internal buffer of the video decoder, or motion compensation or block copy is performed after the reference video block is read from the external storage of the video decoder, that is, part of the video data is stored outside the video decoder, The use of low-power external storage reduces the use of the internal buffer of the video decoder, and also reduces the bandwidth of the main storage, thereby reducing the power consumption of electronic equipment.
在一个实施例中,第二读取模块1502,用于响应于对获取的视频码流的译码处理,从视频译码器的外部存储中查找,在外部存储中查找到参考视频区块的情况下,则从外部存储中读取参考视频区块后进行动作补偿或块复制;In one embodiment, the second reading module 1502 is configured to, in response to the decoding processing of the acquired video code stream, search from the external storage of the video decoder, and find the reference video block in the external storage. In this case, motion compensation or block copying is performed after reading the reference video block from the external storage;
第三读取模块1504,用于在外部存储中未查找到参考视频区块的情况下,从视频译码器 的外部的主存储中查找到参考视频区块,从主存储中读取参考视频区块至视频译码器的内部缓存后进行动作补偿或块复制。The third reading module 1504 is used to find the reference video block from the external main storage of the video decoder when the reference video block is not found in the external storage, and read the reference video from the main storage Motion compensation or block copying is performed after the block is stored in the video decoder's internal buffer.
本实施例中,从视频译码器的外部存储中查找到参考视频区块的情况下,则从外部存储中读取参考视频区块;在外部存储中未查找到参考视频区块的情况下,从主存储中再查找到参考视频区块,从主存储中查找到参考视频区块,从主存储中读取参考视频区块至视频译码器的内部缓存后进行动作补偿;则视频译码器内部缓存读取的仅是来自主存储中的数据,相比于传统的视频译码器内部缓存与外部存储所存储的数据一致的方式,能够节省视频译码器内部不必要的缓存操作,从而降低电子设备功耗。In this embodiment, when the reference video block is found from the external storage of the video decoder, the reference video block is read from the external storage; when the reference video block is not found in the external storage , find the reference video block from the main storage again, find the reference video block from the main storage, read the reference video block from the main storage to the internal buffer of the video decoder and perform motion compensation; then the video decoding The internal buffer of the decoder only reads the data from the main storage. Compared with the traditional video decoder, the internal buffer is consistent with the data stored in the external storage, which can save unnecessary buffering operations inside the video decoder. , thereby reducing the power consumption of electronic equipment.
在一个实施例中,视频数据读取装置还包括存储模块,存储模块用于响应于对获取的视频的译码处理,获得视频中各视频帧所对应的运动矢量;基于各视频帧所对应的运动矢量确定各视频帧的被参考次数;将被参考次数满足第一次数条件的视频帧存储至视频译码器的外部的主存储中;将被参考次数满足第二次数条件的视频帧存储至视频译码器的外部存储中;其中,第二次数条件所表征的次数大于第一次数条件所表征的次数。In one embodiment, the video data reading device further includes a storage module, and the storage module is configured to obtain motion vectors corresponding to each video frame in the video in response to the decoding processing of the acquired video; The motion vector determines the reference times of each video frame; the video frames whose reference times meet the condition of the first times are stored in the external main storage of the video decoder; the video frames whose reference times meet the conditions of the second times are stored to the external storage of the video decoder; wherein, the number of times represented by the second order condition is greater than the number of times represented by the first order condition.
本实施例中,响应于对获取的视频的译码处理,获得视频中各视频帧所对应的运动矢量,基于各视频帧的运动矢量确定各视频帧的被参考次数,则可得知视频帧要被使用几次;将被参考次数满足第一次数条件的视频帧存储至主存储中,将被参考次数满足第二次数条件的视频帧存储至译码器的外部存储中,即将被参考次数少的视频帧存在主存储中,将被参考次数多的视频帧存储在译码器的外部存储中;从而降低了视频译码器的内部缓存的使用,利用了低功耗的外部存储,从而降低电子设备的功耗。另外由于视频译码器的内部缓存有限,因此将使用次数少的视频帧缓存在视频译码器中,而外部缓存的这些视频帧被更新的速度可以更快,能够充分利用外部缓存以加快译码处理。在一个实施例中,视频译码器的外部存储包括系统高速缓存、系统缓冲区中至少一种。本实施例中,通过将满足第二次数条件的视频帧存储在系统高速缓存、系统缓存区中至少一种中,由于从系统高速缓存和系统缓冲区读取的数据的速度较快且功耗小,因此译码器内部存储无必要再存一次来自系统高速缓存和系统缓冲区的视频数据,降低电子设备的功耗。In this embodiment, in response to the decoding processing of the acquired video, the motion vector corresponding to each video frame in the video is obtained, and the number of times each video frame is referenced is determined based on the motion vector of each video frame, then the video frame can be known. To be used several times; store the video frames that meet the condition of the first number of times to the main storage, and store the video frames that meet the condition of the second number of times to the external storage of the decoder, and are about to be referenced The video frames with a few times are stored in the main storage, and the video frames with a large number of references are stored in the external storage of the decoder; thereby reducing the use of the internal buffer of the video decoder, using the low-power external storage, Thereby reducing the power consumption of the electronic device. In addition, because the internal buffer of the video decoder is limited, the video frames that are used less frequently are buffered in the video decoder, and these video frames in the external buffer can be updated faster, and the external buffer can be fully utilized to speed up the decoding. code processing. In one embodiment, the external storage of the video decoder includes at least one of a system cache, a system buffer. In this embodiment, by storing the video frames that meet the conditions of the second number of times in at least one of the system cache and the system buffer, the data read from the system cache and the system buffer is faster and consumes less power. Therefore, the internal storage of the decoder does not need to store the video data from the system cache and system buffer again, which reduces the power consumption of electronic equipment.
上述视频数据存储装置和视频数据读取装置中各个模块的划分仅仅用于举例说明,在其他实施例中,可将视频数据存储装置和视频数据读取装置按照需要划分为不同的模块,以完成上述视频数据存储装置和视频数据读取装置的全部或部分功能。The division of each module in the above-mentioned video data storage device and video data reading device is only used for illustration. In other embodiments, the video data storage device and the video data reading device can be divided into different modules as required to complete the All or part of the functions of the above video data storage device and video data reading device.
关于视频数据存储装置和视频数据读取装置的具体限定可以参见上文中对于方法的限定,在此不再赘述。上述视频数据存储装置和视频数据读取装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For specific limitations on the video data storage device and the video data reading device, reference may be made to the limitations on the methods above, and details are not repeated here. Each module in the above-mentioned video data storage device and video data reading device may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
图16为一个实施例中电子设备的内部结构示意图。如图16所示,该电子设备包括通过系统总线连接的处理器和存储器。其中,该处理器用于提供计算和控制能力,支撑整个电子设备的运行。存储器可包括非易失性存储介质及内存储器。非易失性存储介质存储有操作系统和计算机程序。该计算机程序可被处理器所执行,以用于实现以下各个实施例所提供的视频数据存储方法和视频数据读取方法。内存储器为非易失性存储介质中的操作系统计算机程序提供高速缓存的运行环境。该电子设备可以是手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑、穿戴式设备等任意终端设备。FIG. 16 is a schematic diagram of the internal structure of an electronic device in one embodiment. As shown in Figure 16, the electronic device includes a processor and memory connected by a system bus. Among them, the processor is used to provide computing and control capabilities to support the operation of the entire electronic device. The memory may include non-volatile storage media and internal memory. The nonvolatile storage medium stores an operating system and a computer program. The computer program can be executed by the processor to implement the video data storage method and the video data read method provided by the following embodiments. Internal memory provides a cached execution environment for operating system computer programs in non-volatile storage media. The electronic device may be any terminal device such as a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales, a sales terminal), a vehicle-mounted computer, a wearable device, and the like.
本申请实施例中提供的视频数据存储装置和视频数据读取装置中的各个模块的实现可为计算机程序的形式。该计算机程序可在终端或服务器上运行。该计算机程序构成的程序模块可存储在电子设备的存储器上。该计算机程序被处理器执行时,实现本申请实施例中所描述 方法的操作。The implementation of each module in the video data storage device and the video data reading device provided in the embodiments of the present application may be in the form of computer programs. The computer program can be run on a terminal or server. The program modules constituted by the computer program can be stored on the memory of the electronic device. When the computer program is executed by the processor, the operations of the methods described in the embodiments of the present application are implemented.
本申请实施例还提供了一种计算机可读存储介质。一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当所述计算机可执行指令被一个或多个处理器执行时,使得所述处理器执行视频数据存储方法的操作。Embodiments of the present application also provide a computer-readable storage medium. One or more non-volatile computer-readable storage media containing computer-executable instructions, when executed by one or more processors, cause the processors to perform the operations of the video data storage method.
本申请实施例还提供了一种计算机可读存储介质。一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当所述计算机可执行指令被一个或多个处理器执行时,使得所述处理器执行视频数据读取方法的操作。Embodiments of the present application also provide a computer-readable storage medium. One or more non-volatile computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the operations of the video data reading method .
一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行视频数据存储方法。A computer program product containing instructions, when executed on a computer, causes the computer to perform a video data storage method.
一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行视频数据读取方法。A computer program product containing instructions, when executed on a computer, causes the computer to perform a video data reading method.
本申请所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDR SDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)。Any reference to a memory, storage, database, or other medium as used herein may include non-volatile and/or volatile memory. Nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), Memory Bus (Rambus) Direct RAM (RDRAM), Direct Memory Bus Dynamic RAM (DRDRAM), and Memory Bus Dynamic RAM (RDRAM).
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several embodiments of the present application, and the descriptions thereof are relatively specific and detailed, but should not be construed as a limitation on the scope of the patent of the present application. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the scope of protection of the patent of the present application shall be subject to the appended claims.

Claims (20)

  1. 一种视频数据存储方法,包括:A video data storage method, comprising:
    响应于对待重建视频帧的译码处理,在视频译码器的外部存储中不存在待重建视频帧的参考视频帧,且在视频译码器的外部的主存储中存在所述参考视频帧的情况下,从所述主存储中读取所述参考视频帧;以及In response to the decoding process of the video frame to be reconstructed, the reference video frame of the video frame to be reconstructed does not exist in the external storage of the video coder, and the reference video frame of the reference video frame exists in the main storage external to the video coder. case, read the reference video frame from the main storage; and
    将从所述主存储中读取的所述参考视频帧存储至所述视频译码器的内部缓存中。The reference video frames read from the main storage are stored in an internal buffer of the video coder.
  2. 根据权利要求1所述的方法,每帧视频帧被划分为多个区块;The method according to claim 1, each frame of video frame is divided into a plurality of blocks;
    所述在视频译码器的外部存储中不存在待重建视频帧的参考视频帧,且在视频译码器的外部的主存储中存在所述参考视频帧的情况下,从所述主存储中读取所述参考视频帧,包括:The reference video frame of the video frame to be reconstructed does not exist in the external storage of the video coder, and if the reference video frame exists in the main storage external to the video coder, from the main storage Read the reference video frame, including:
    在视频译码器的外部存储中不存在待重建视频帧所对应的参考视频区块,且在视频译码器的外部的主存储中存在所述参考视频区块的情况下,从所述主存储中读取所述参考视频区块;及In the case that the reference video block corresponding to the video frame to be reconstructed does not exist in the external storage of the video coder, and the reference video block exists in the main storage external to the video coder, from the main storage reading the reference video block in storage; and
    所述将从所述主存储中读取的所述参考视频帧存储至所述视频译码器的内部缓存中,包括:The storing of the reference video frame read from the main storage into the internal buffer of the video decoder includes:
    将从所述主存储中读取的所述参考视频区块存储至所述视频译码器的内部缓存中。The reference video block read from the main storage is stored in an internal buffer of the video coder.
  3. 根据权利要求1所述的方法,所述方法还包括:The method of claim 1, further comprising:
    在视频译码器的外部存储中存在所述参考视频帧的情况下,从所述视频译码器的外部存储中读取所述参考视频帧。The reference video frame is read from the video coder's external storage if the reference video frame exists in the video coder's external storage.
  4. 根据权利要求1所述的方法,所述方法还包括:The method of claim 1, further comprising:
    响应于对获取的视频的译码处理,获得所述视频中各视频帧所对应的运动矢量;In response to the decoding process of the acquired video, obtain the motion vector corresponding to each video frame in the video;
    基于各视频帧所对应的运动矢量确定各视频帧的被参考次数;Determine the reference times of each video frame based on the motion vector corresponding to each video frame;
    将所述被参考次数满足第一次数条件的视频帧存储至视频译码器的外部的主存储中;及storing the video frame whose referenced number of times satisfies the condition of the first number of times in a main storage outside the video decoder; and
    将所述被参考次数满足第二次数条件的视频帧存储至所述视频译码器的外部存储中,其中所述第二次数条件所表征的次数大于所述第一次数条件所表征的次数。storing the video frame whose referenced number of times meets the second number of times condition in the external storage of the video decoder, wherein the number of times represented by the second number of times condition is greater than the number of times represented by the first number of times condition .
  5. 根据权利要求1至4任一项所述的方法,所述视频译码器的外部存储包括系统高速缓存或系统缓存区中至少一种。4. The method of any of claims 1 to 4, the external storage of the video coder comprising at least one of a system cache or a system buffer.
  6. 根据权利要求1至4任一项所述的方法,所述视频译码器的外部的主存储包括动态随机存取存储器。4. The method of any of claims 1 to 4, the main storage external to the video coder comprising dynamic random access memory.
  7. 一种视频数据读取方法,所述方法包括:A method for reading video data, the method comprising:
    响应于对获取的视频码流的译码处理,从视频译码器的外部的主存储中读取不存在于视频译码器的外部存储的参考视频区块至视频译码器的内部缓存后进行动作补偿或块复制;In response to the decoding process of the acquired video code stream, read the reference video block that does not exist in the external storage of the video decoder from the external main storage of the video decoder to the internal buffer of the video decoder. Perform motion compensation or block copying;
    或者从视频译码器的外部存储中读取参考视频区块后进行动作补偿或块复制。Alternatively, motion compensation or block copying is performed after the reference video block is read from the external storage of the video decoder.
  8. 根据权利要求7所述的方法,所述响应于对获取的视频码流的译码处理,从视频译码器的外部的主存储中读取不存在于视频译码器的外部存储的参考视频区块到视频译码器的内部缓存后进行动作补偿或块复制;或者从视频译码器的外部存储中读取参考视频区块后进行动作补偿或块复制,包括:The method according to claim 7, wherein in response to the decoding process of the acquired video code stream, a reference video that does not exist in the external storage of the video decoder is read from a main storage outside the video decoder Motion compensation or block copy is performed after the block is stored in the internal buffer of the video decoder; or motion compensation or block copy is performed after the reference video block is read from the external storage of the video decoder, including:
    响应于对获取的视频码流的译码处理,从所述视频译码器的外部存储中查找,在所述外部存储中查找到参考视频区块的情况下,则从所述外部存储中读取所述参考视频区块后进行动作补偿或块复制;及In response to the decoding processing of the acquired video code stream, look up from the external storage of the video decoder, and in the case of finding the reference video block in the external storage, read from the external storage performing motion compensation or block copying after taking the reference video block; and
    在所述外部存储中未查找到参考视频区块的情况下,从视频译码器的外部的主存储中查找到参考视频区块,从所述主存储中读取所述参考视频区块至所述视频译码器的内部缓存后进行动作补偿或块复制。In the case where the reference video block is not found in the external storage, the reference video block is found from the external main storage of the video decoder, and the reference video block is read from the main storage to The video coder's internal buffering is followed by motion compensation or block copying.
  9. 根据权利要求7所述的方法,所述方法还包括:The method of claim 7, further comprising:
    响应于对获取的视频的译码处理,获得所述视频中各视频帧所对应的运动矢量;In response to the decoding process of the acquired video, obtain the motion vector corresponding to each video frame in the video;
    基于各视频帧所对应的运动矢量确定各视频帧的被参考次数;Determine the reference times of each video frame based on the motion vector corresponding to each video frame;
    将所述被参考次数满足第一次数条件的视频帧存储至视频译码器的外部的主存储中;及storing the video frame whose referenced number of times satisfies the condition of the first number of times in a main storage outside the video decoder; and
    将所述被参考次数满足第二次数条件的视频帧存储至所述视频译码器的外部存储中,其中所述第二次数条件所表征的次数大于所述第一次数条件所表征的次数。storing the video frame whose referenced number of times meets the second number of times condition in the external storage of the video decoder, wherein the number of times represented by the second number of times condition is greater than the number of times represented by the first number of times condition .
  10. 根据权利要求7至9任一项所述的方法,所述视频译码器的外部存储包括系统高速缓存或系统缓存区中至少一种。9. The method of any one of claims 7 to 9, the external storage of the video coder comprising at least one of a system cache or a system buffer.
  11. 根据权利要求7至9任一项所述的方法,所述视频译码器的外部的主存储包括动态随机存取存储器。9. The method of any of claims 7 to 9, the main storage external to the video coder comprising dynamic random access memory.
  12. 一种视频数据存储装置,包括:A video data storage device, comprising:
    第一读取模块,用于响应于对待重建视频帧的译码处理,在视频译码器的外部存储中不存在待重建视频帧的参考视频帧,且在视频译码器的外部的主存储中存在所述参考视频帧的情况下,从所述主存储中读取所述参考视频帧;以及A first reading module, for responding to the decoding process of the video frame to be reconstructed, the reference video frame of the video frame to be reconstructed does not exist in the external storage of the video decoder, and the main storage outside the video decoder does not exist read the reference video frame from the main storage if the reference video frame exists in the ; and
    参考视频帧存储模块,用于将从所述主存储中读取的所述参考视频帧存储至所述视频译码器的内部缓存中。A reference video frame storage module, configured to store the reference video frame read from the main storage into an internal buffer of the video decoder.
  13. 根据权利要求12所述的装置,每帧视频帧被划分为多个区块;The device according to claim 12, each frame of video frame is divided into a plurality of blocks;
    所述第一读取模块还用于在视频译码器的外部存储中不存在待重建视频帧所对应的参考视频区块,且在视频译码器的外部的主存储中存在所述参考视频区块的情况下,从所述主存储中读取所述参考视频区块;及The first reading module is also used for the reference video block corresponding to the video frame to be reconstructed does not exist in the external storage of the video decoder, and the reference video exists in the main storage outside the video decoder In the case of a block, the reference video block is read from the main storage; and
    所述参考视频帧存储模块还用于将从所述主存储中读取的所述参考视频区块存储至所述视频译码器的内部缓存中。The reference video frame storage module is further configured to store the reference video block read from the main storage into an internal buffer of the video decoder.
  14. 根据权利要求12所述的装置,所述第一读取模块还用于在视频译码器的外部存储中存在所述参考视频帧的情况下,从所述视频译码器的外部存储中读取所述参考视频帧。13. The apparatus of claim 12, wherein the first read module is further configured to read from the external storage of the video coder if the reference video frame exists in the external storage of the video coder Take the reference video frame.
  15. 根据权利要求12所述的装置,所述装置还包括运动矢量获取模块、次数确定模块、第一存储模块和第二存储模块,其中:The apparatus according to claim 12, further comprising a motion vector acquisition module, a number of times determination module, a first storage module and a second storage module, wherein:
    所述运动矢量获取模块用于响应于对获取的视频的译码处理,获得所述视频中各视频帧所对应的运动矢量;The motion vector obtaining module is configured to obtain the motion vector corresponding to each video frame in the video in response to the decoding processing of the obtained video;
    所述次数确定模块用于基于各视频帧所对应的运动矢量确定各视频帧的被参考次数;The times determining module is configured to determine the number of times that each video frame is referenced based on the motion vector corresponding to each video frame;
    所述第一存储模块用于将所述被参考次数满足第一次数条件的视频帧存储至视频译码器的外部的主存储中;及The first storage module is configured to store the video frames whose referenced times meet the condition of the first number of times in the external main storage of the video decoder; and
    所述第二存储模块用于将所述被参考次数满足第二次数条件的视频帧存储至所述视频译码器的外部存储中,其中所述第二次数条件所表征的次数大于所述第一次数条件所表征的次数。The second storage module is configured to store the video frames whose referenced times satisfy the condition of the second number of times in the external storage of the video decoder, wherein the number of times represented by the condition of the second number of times is greater than that of the first The number of times represented by the one-count condition.
  16. 一种视频数据读取装置,包括:A video data reading device, comprising:
    第二读取模块,用于响应于对获取的视频码流的译码处理,从视频译码器的外部的主存储中读取不存在于视频译码器的外部存储的参考视频区块至视频译码器的内部缓存后进行动作补偿或块复制;The second reading module is configured to, in response to the decoding processing of the acquired video code stream, read the reference video blocks that do not exist in the external storage of the video decoder from the external main storage of the video decoder to Motion compensation or block copying after the video decoder's internal buffering;
    或者,or,
    第三读取模块,用于从视频译码器的外部存储中读取参考视频区块后进行动作补偿或块复制。The third reading module is used to perform motion compensation or block copy after reading the reference video block from the external storage of the video decoder.
  17. 根据权利要求16所述的装置,所述第二读取模块还用于响应于对获取的视频码流的译码处理,从所述视频译码器的外部存储中查找,在所述外部存储中查找到参考视频区块的情况下,则从所述外部存储中读取所述参考视频区块后进行动作补偿或块复制;The apparatus according to claim 16, wherein the second reading module is further configured to search from an external storage of the video decoder in response to the decoding processing of the acquired video code stream, and store the data in the external storage. Under the situation that the reference video block is found in the middle, then motion compensation or block copying is performed after reading the reference video block from the external storage;
    所述第三读取模块还用于在所述外部存储中未查找到参考视频区块的情况下,从视频译码器的外部的主存储中查找到参考视频区块,从所述主存储中读取所述参考视频区块至所述视频译码器的内部缓存后进行动作补偿或块复制。The third reading module is also used to find the reference video block from the external main storage of the video decoder when the reference video block is not found in the external storage, and from the main storage Motion compensation or block copy is performed after reading the reference video block into the internal buffer of the video decoder.
  18. 根据权利要求16所述的装置,所述装置还包括存储模块;所述存储模块用于响应于对获取的视频的译码处理,获得所述视频中各视频帧所对应的运动矢量;基于各视频帧所对应的运动矢量确定各视频帧的被参考次数;将所述被参考次数满足第一次数条件的视频帧存 储至视频译码器的外部的主存储中;及将所述被参考次数满足第二次数条件的视频帧存储至所述视频译码器的外部存储中,其中所述第二次数条件所表征的次数大于所述第一次数条件所表征的次数。The device according to claim 16, further comprising a storage module; the storage module is configured to, in response to decoding processing of the acquired video, obtain a motion vector corresponding to each video frame in the video; The motion vector corresponding to the video frame determines the number of times that each video frame is referenced; the video frame whose number of times to be referenced satisfies the condition of the first number of times is stored in the external main storage of the video decoder; The video frames whose number of times satisfies the second number of times condition are stored in the external storage of the video decoder, wherein the number of times represented by the second number of times condition is greater than the number of times represented by the first number of times condition.
  19. 一种电子设备,包括存储器及处理器,所述存储器中储存有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行如权利要求1至11中任一项所述的方法的操作。An electronic device, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor is made to execute the process according to any one of claims 1 to 11 method of operation.
  20. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至11中任一项所述的方法的操作。A computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the operation of the method of any one of claims 1 to 11.
PCT/CN2022/077080 2021-04-01 2022-02-21 Video data storage method and apparatus, and electronic device and readable storage medium WO2022206212A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110355145.3A CN115174916A (en) 2021-04-01 2021-04-01 Video data storage method and device, electronic equipment and readable storage medium
CN202110355145.3 2021-04-01

Publications (1)

Publication Number Publication Date
WO2022206212A1 true WO2022206212A1 (en) 2022-10-06

Family

ID=83455179

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/077080 WO2022206212A1 (en) 2021-04-01 2022-02-21 Video data storage method and apparatus, and electronic device and readable storage medium

Country Status (2)

Country Link
CN (1) CN115174916A (en)
WO (1) WO2022206212A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729449A (en) * 2013-12-31 2014-04-16 上海富瀚微电子有限公司 Reference data access management method and device
US20170150159A1 (en) * 2015-11-20 2017-05-25 Intel Corporation Method and system of reference frame caching for video coding
CN107018418A (en) * 2015-12-23 2017-08-04 联发科技股份有限公司 Reference data method for reusing, band width estimation method and associated video decoder
US20210127125A1 (en) * 2019-10-23 2021-04-29 Facebook Technologies, Llc Reducing size and power consumption for frame buffers using lossy compression

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729449A (en) * 2013-12-31 2014-04-16 上海富瀚微电子有限公司 Reference data access management method and device
US20170150159A1 (en) * 2015-11-20 2017-05-25 Intel Corporation Method and system of reference frame caching for video coding
CN107018418A (en) * 2015-12-23 2017-08-04 联发科技股份有限公司 Reference data method for reusing, band width estimation method and associated video decoder
US20210127125A1 (en) * 2019-10-23 2021-04-29 Facebook Technologies, Llc Reducing size and power consumption for frame buffers using lossy compression

Also Published As

Publication number Publication date
CN115174916A (en) 2022-10-11

Similar Documents

Publication Publication Date Title
US9612962B2 (en) Performing cache bank operations in offset sequences from first bank
US8619862B2 (en) Method and device for generating an image data stream, method and device for reconstructing a current image from an image data stream, image data stream and storage medium carrying an image data stream
US9336558B2 (en) Wavefront encoding with parallel bit stream encoding
US8203648B2 (en) Motion vector detecting apparatus and motion vector detecting method
US20070071099A1 (en) External memory device, method of storing image data for the same, and image processor using the method
US20200374534A1 (en) Ai-assisted programmable hardware video codec
US10070134B2 (en) Analytics assisted encoding
US20220279224A1 (en) Systems and methods for video processing
US10757430B2 (en) Method of operating decoder using multiple channels to reduce memory usage and method of operating application processor including the decoder
TW201637444A (en) Methods, systems, and devices including an encoder for image processing
CN103109535A (en) Image reproduction method, image reproduction device, image reproduction program, imaging system, and reproduction system
WO2022206212A1 (en) Video data storage method and apparatus, and electronic device and readable storage medium
TWI601075B (en) Motion compensation image processing apparatus and image processing method
WO2022115999A1 (en) Data processing method and data processing device
US20130278775A1 (en) Multiple Stream Processing for Video Analytics and Encoding
KR100891116B1 (en) Apparatus and method for bandwidth aware motion compensation
Jubran et al. Sequence-level reference frames in video coding
CN110945872A (en) Video processing apparatus and method
Lee et al. Memory bandwidth reduction using frame pipeline in video codec chips
Isquierdo et al. VVC decoder intra prediction using approximate storage: an error resilience evaluation
Liu et al. Design of an H. 264/AVC decoder with memory hierarchy and line-pixel-lookahead
CN114374848A (en) Video coding optimization method and system
Lin et al. Reduction of Frame Memory Accesses and Motion Estimation Computations in MPEG Video Encoder

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

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

Country of ref document: EP

Kind code of ref document: A1