CN112291567B - YUV data storage method, device, equipment and storage medium - Google Patents
YUV data storage method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN112291567B CN112291567B CN202011149450.9A CN202011149450A CN112291567B CN 112291567 B CN112291567 B CN 112291567B CN 202011149450 A CN202011149450 A CN 202011149450A CN 112291567 B CN112291567 B CN 112291567B
- Authority
- CN
- China
- Prior art keywords
- data
- yuv data
- stored
- bit
- yuv
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
- 238000013500 data storage Methods 0.000 title claims abstract description 77
- 238000000034 method Methods 0.000 title claims abstract description 58
- 238000004590 computer program Methods 0.000 claims description 9
- 230000009286 beneficial effect Effects 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 6
- 230000006835 compression Effects 0.000 description 2
- 238000007906 compression Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000000750 progressive effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/184—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being bits, e.g. of the compressed video stream
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/42—Methods 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/423—Methods 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
- H04N19/426—Methods 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 using memory downsizing methods
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a YUV data storage method, which comprises the steps of obtaining YUV data; the size of any YUV data is not equal to the integral multiple of 8 bits; storing any YUV data into an integral number of bytes, and recording idle bit of the bytes without the YUV data; acquiring data to be stored; and storing the data to be stored into an idle bit in the byte. When storing YUV data, the YUV data is written in an integer number of bytes. At this time, there is a free bit in the byte where YUV data is written. And by recording the idle bit and writing the data to be stored into the idle bit when the data to be stored is acquired, the storage space of the memory can be fully utilized, and the memory utilization rate is higher. The invention also provides a device, equipment and a storage medium, which also have the beneficial effects.
Description
Technical Field
The present invention relates to the field of image data storage, and in particular, to a YUV data storage method, a YUV data storage apparatus, a YUV data storage device, and a computer-readable storage medium.
Background
YUV is a color coding method, and YUV data is generally data required for each pixel in a target image when stored. The YUV data generally includes 8bit,10bit, 116bit, and the like, depending on the size of the occupied storage space, i.e., the size occupied by any pixel during storage. And at the present stage the size of one byte is 8 bits.
When a pixel represented by YUV data occupies 8 bits or 16 bits, the pixel can be completely matched with the size of a byte, and redundancy is not generated. When the size of a YUV data is not equal to an integer multiple of 8 bits, for example, the size of a YUV data is 10 bits, then a YUV data cannot occupy exactly one byte. In general, in order to ensure the read-write efficiency of YUV data, the one 10-bit YUV data usually occupies two bytes, and at this time, a redundancy with a size of 6 bits is generated, and the spare 6 bits are usually filled with 0 in the prior art. However, in the prior art, the existence of the storage redundancy causes the utilization rate and the compression efficiency of the memory to be low. Therefore, how to provide a YUV data storage method with high storage utilization rate is a problem that needs to be solved urgently by those skilled in the art.
Disclosure of Invention
The invention aims to provide a YUV data storage method which has higher memory utilization rate; another object of the present invention is to provide a YUV data storage apparatus, a YUV data storage device, and a computer-readable storage medium, which have high memory utilization.
In order to solve the above technical problem, the present invention provides a YUV data storage method, including:
acquiring YUV data; the size of any YUV data is not equal to the integral multiple of 8 bits;
storing any YUV data into an integral number of bytes, and recording idle bit of the bytes without the YUV data;
acquiring data to be stored;
and storing the data to be stored into an idle bit in the byte.
Optionally, a value range of any one of the YUV data sizes is as follows: 9 to 15 bits, inclusive.
Optionally, the idle bit is a total bit in the byte where the YUV data is not recorded.
Optionally, the storing any one of the YUV data into an integer number of bytes includes:
when the size of the YUV data is larger than 8 bits, calling an 8-bit instruction to write the first 8-bit data of the YUV data into bytes;
and calling a write-in instruction to write the residual YUV data into bytes, wherein the data size corresponding to the write-in instruction is less than 8 bits.
Optionally, the storing any one of the YUV data into an integer number of bytes includes:
when the size of the YUV data is larger than 8 bits, calling an 8-bit instruction to write the first 8-bit data of the YUV data into bytes;
and writing the rest YUV data into a preset bit cache, and writing the rest YUV data into bytes through the bit cache.
Optionally, the data to be stored includes a corresponding required storage speed during storage;
the idle bit for storing the data to be stored into the byte comprises:
and when the required storage speed corresponds to the idle bit, storing the data to be stored into the idle bit in the byte.
Optionally, the idle bits include nibbles composed of at least 4 consecutive bits;
when the required storage speed corresponds to the idle bit, the storing the data to be stored into the idle bit in the byte comprises:
and when the required storage speed corresponds to the half byte, calling a 4-bit instruction to store the data to be stored into continuous 4 bits in the idle bits.
The invention also provides a YUV data storage device, comprising:
a YUV data acquisition module: the method is used for acquiring YUV data; the size of any YUV data is not equal to the integral multiple of 8 bits;
a YUV data storage module: the device is used for storing any YUV data into an integral number of bytes and recording idle bit which is not recorded with the YUV data in the bytes;
a to-be-stored data acquisition module: the data storage device is used for acquiring data to be stored;
the data storage module to be stored: and the idle bit is used for storing the data to be stored into the byte.
The invention also provides a YUV data storage device, which comprises:
a memory: for storing a computer program;
a processor: for implementing the steps of the YUV data storage method according to any one of the above when executing the computer program.
The present invention also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the YUV data storage method as described in any one of the above.
The invention provides a YUV data storage method, comprising the steps of obtaining YUV data; the size of any YUV data is not equal to the integral multiple of 8 bits; storing any YUV data into an integral number of bytes, and recording idle bit of the bytes without the YUV data; acquiring data to be stored; and storing the data to be stored into an idle bit in the byte.
When storing YUV data, the YUV data is written in an integer number of bytes. At this time, because the size of any YUV data is not equal to the integral multiple of 8 bits, idle bits exist in bytes written in the YUV data. By recording the idle bit and writing the data to be stored into the idle bit when the data to be stored is acquired, the storage space of the memory can be fully utilized, and the memory utilization rate is high when the YUV data and the data to be stored are stored.
The invention also provides a YUV data storage device, a YUV data storage device and a computer readable storage medium, which also have the beneficial effects and are not repeated herein.
Drawings
In order to more clearly illustrate the embodiments or technical solutions of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
Fig. 1 is a flowchart of a YUV data storage method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a distribution of data in a memory space according to an embodiment of the present invention;
fig. 3 is a flowchart of a specific YUV data storage method according to an embodiment of the present invention;
fig. 4 is a block diagram of a YUV data storage device according to an embodiment of the present invention;
fig. 5 is a block diagram of a YUV data storage device according to an embodiment of the present invention.
Detailed Description
The core of the invention is to provide a YUV data storage method. In the prior art, in order to ensure the read-write efficiency of YUV data, the one 10-bit YUV data usually occupies two bytes, a redundancy with a size of 6 bits is generated at this time, and the spare 6 bits are usually filled with 0 in the prior art. However, in the prior art, the existence of the storage redundancy causes the utilization rate of the memory and the compression efficiency to be low.
The YUV data storage method provided by the invention comprises the steps of obtaining YUV data; the size of any YUV data is not equal to the integral multiple of 8 bits; storing any YUV data into an integral number of bytes, and recording idle bits which do not record the YUV data in the bytes; acquiring data to be stored; and storing the data to be stored into an idle bit in the byte.
When storing YUV data, the YUV data is written in an integer number of bytes. At this time, because the size of any YUV data is not equal to the integral multiple of 8 bits, idle bits exist in bytes written in the YUV data. By recording the idle bit and writing the data to be stored into the idle bit when the data to be stored is acquired, the storage space of the memory can be fully utilized, and the memory utilization rate is high when the YUV data and the data to be stored are stored.
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1 and fig. 2, fig. 1 is a flowchart illustrating a YUV data storage method according to an embodiment of the present invention; FIG. 2 is a diagram illustrating a distribution of data in a memory space according to an embodiment of the present invention.
Referring to fig. 1, in an embodiment of the present invention, a YUV data storage method includes:
s101: and acquiring YUV data.
Referring to fig. 2, in the embodiment of the present invention, the size of any one of the YUV data is not equal to an integer multiple of 8 bits. The YUV data is specifically data obtained by encoding any pixel of the target image by a YUV color encoding method, and generally one piece of YUV data corresponds to one pixel in the target image in the embodiment of the present invention.
The specific steps related to the YUV data acquisition may be set according to actual conditions, and are not limited specifically herein. In this step, the size of any YUV data is not equal to an integer multiple of 8 bits, i.e., any YUV data cannot just occupy an integer number of bytes. In general, in an embodiment of the present invention, a value range of any one of the YUV data sizes is generally: 9bit to 15bit, inclusive. That is, in the embodiment of the present invention, any YUV data occupies two bytes when stored, but cannot occupy two bytes.
S102: and storing any YUV data into an integral number of bytes, and recording idle bit without YUV data recorded in the bytes.
In this step, YUV data is stored into an integer number of bytes, for example, if the size of one YUV data is larger than 8 bits and smaller than 16 bits, the YUV data occupies two bytes, so as to ensure that the start position of the YUV data can be aligned with the bytes. At this time, in the embodiment of the present invention, the end position of the YUV data is not aligned with the byte, and there is a misalignment, so that the byte in which the YUV data is stored has an idle bit not stored with the YUV data, and the idle bit is usually filled in the rear end of the YUV data to be aligned with the byte. In this step, it is specifically necessary to record an idle bit in a byte where the YUV data is not recorded, and usually, to record position information of the idle bit, so as to write data into the idle bit in the subsequent step.
It should be noted that the idle bit recorded in the embodiment of the present invention specifically needs to correspond to a read-write instruction of the YUV data. Taking YUV data as 10 bits as an example, the first 8 bits of the YUV data can be written into a certain byte by a conventional 8-bit instruction, and 2 bits of data remain at this time. The rest 2-bit data can be written into the next byte by two 1-bit instructions, and at the moment, 6-bit idle bits exist in the byte completely; if the remaining 2-bit data is written into the next byte by the nibble, i.e. the 4-bit instruction, the free bit with 4 bits in the byte can be written into the data to be stored. Specifically, in the embodiment of the present invention, the idle bits are all bits of the bytes in which the YUV data is not recorded, so as to ensure a storage utilization rate as high as possible, and the corresponding YUV data needs to be read and written by three instructions, i.e., an 8-bit instruction, a 1-bit instruction, and a 1-bit instruction, during reading and writing.
S103: and acquiring data to be stored.
The specific content of the data to be stored is not particularly limited in the embodiments of the present invention, as the case may be.
S104: and storing the data to be stored into the idle bit in the byte.
In this step, the data to be stored is stored into the free bit in the byte, so that the data to be stored is filled into the redundant space of the byte generated by storing the YUV data in a discrete form, thereby improving the storage utilization rate as much as possible.
The YUV data storage method provided by the embodiment of the invention comprises the steps of obtaining YUV data; the size of any YUV data is not equal to the integral multiple of 8 bits; storing any YUV data into an integral number of bytes, and recording idle bit of the bytes without the YUV data; acquiring data to be stored; and storing the data to be stored into an idle bit in the byte.
When storing YUV data, the YUV data is written in an integer number of bytes. At this time, because the size of any YUV data is not equal to the integral multiple of 8 bits, idle bits exist in bytes written in the YUV data. And by recording the idle bit and writing the data to be stored into the idle bit when the data to be stored is acquired, the storage space of the memory can be fully utilized, and the memory utilization rate is higher when the YUV data and the data to be stored are stored.
The details of the YUV data storage method provided by the present invention will be described in detail in the following embodiments of the present invention.
Referring to fig. 3, fig. 3 is a flowchart illustrating a specific YUV data storage method according to an embodiment of the present invention.
Referring to fig. 3, in an embodiment of the present invention, a YUV data storage method includes:
s201: and acquiring YUV data.
This step is substantially the same as S101 in the above embodiment of the present invention, and for details, reference is made to the above embodiment of the present invention, which is not repeated herein. In the embodiment of the invention, the size of any YUV data is usually between 9bit and 15bit, including an endpoint value.
S202: and when the size of the YUV data is larger than 8 bits, calling an 8-bit instruction to write the first 8 bits of the YUV data into the bytes.
In this step, when the size of the YUV data is larger than 8 bits, that is, the YUV data can fill one byte, an 8-bit instruction is called to write the first 8-bit data of the YUV data into a byte, so that one byte can be written in by one instruction. At this time, the remaining YUV data cannot be filled with one byte in general.
S203: and writing the rest YUV data into bytes.
For the remaining data of the YUV data, two writing methods are specifically provided in the embodiment of the present invention, the first method is: and calling a write-in instruction to write the residual YUV data into bytes, wherein the data size corresponding to the write-in instruction is less than 8 bits. That is, if the master control read/write of the YUV data storage method provided in the embodiment of the present invention is controllable, and when the read/write is performed, besides the 8-bit instruction, there are also a 4-bit instruction, a 1-bit instruction, and the like, in this step, the write instruction corresponding to the remaining YUV data may be specifically used, for example, if 2-bit YUV data remains, in this step, two 1-bit instructions may be called to write the remaining YUV data into bytes.
And the second method comprises the following steps: and writing the rest YUV data into a preset bit cache, and writing the rest YUV data into bytes through the bit cache. That is, if the main control read/write of the YUV data storage method provided by the embodiment of the present invention is a fixed manner, for example, only 8 bits or multiple of 8 bits are used for access, support in hardware design is required. In the embodiment of the present invention, at least one bit cache is required, and the bit cache is a cache memory capable of performing data update in units of a single bit. In this step, the remaining YUV data of the unaligned byte needs to be pulled to the bit buffer, so that the remaining YUV data is written into the byte through the bit buffer.
S204: and idle bit of YUV data is not recorded in the recording byte.
This step is described in detail in S102 in the above embodiment of the present invention, and is not described herein again.
S205: and acquiring data to be stored.
The specific content of the data to be stored is not particularly limited in the embodiments of the present invention, as the case may be. In the embodiment of the invention, the data to be stored needs to include a corresponding required storage speed when storing. Because the idle bits are distributed in the storage space in a discrete manner, when the idle bits are used, the data cannot be read and written through an 8-bit instruction, which results in that the data stored by using the idle bits has a large limitation on the reading and writing speed. In the embodiment of the present invention, a corresponding required storage speed is specifically set in the data to be stored, and the required storage speed corresponds to different storage spaces: for example, if a certain data to be stored has a fast required storage speed, it will be written into the complete byte of the storage space by an instruction corresponding to the complete byte, such as an 8-bit instruction; and if a certain data to be stored only corresponds to a slower required storage speed, the data to be stored can be written into the idle bit and can be stored through the idle bit. Correspondingly, in the following steps, the data to be stored can be stored into the free bit in the byte.
S206: and when the required storage speed corresponds to the idle bit, storing the data to be stored into the idle bit in the byte.
When the required storage speed corresponds to the idle bit, that is, the data to be stored can be stored at a slower read-write speed, and in this step, the data to be stored can be written into the idle bit by a slower read-write speed instruction such as a 1-bit instruction. Correspondingly, when the data to be stored is read, the data to be stored can only be read through an instruction with a slower reading and writing speed, such as a 1-bit instruction.
Specifically, in the embodiment of the present invention, the idle bits may include a nibble composed of at least 4 consecutive bits. At this time, the size of any one of the above YUV data is generally not more than 12 bits. At this time, in executing the above S204, continuous 4 free bits may be recorded as one free nibble in nibble units. Obviously, the read-write command corresponding to the idle nibble is usually a 4-bit command, and compared with the 1-bit command, one 4-bit command corresponds to one idle nibble, so that data stored in the idle nibble can have a certain read-write speed.
Correspondingly, the step may specifically be: and when the required storage speed corresponds to the half byte, calling a 4-bit instruction to store the data to be stored into continuous 4 bits in the idle bits. At this time, the data to be stored in the nibble can have a certain read-write speed, so that the data to be stored can have a certain read-write speed while a certain memory utilization rate is ensured.
The YUV data storage method provided by the embodiment of the invention writes YUV data into an integer number of bytes when storing the YUV data. At this time, because the size of any YUV data is not equal to the integral multiple of 8 bits, idle bits exist in bytes written in the YUV data. By recording the idle bit and writing the data to be stored into the idle bit when the data to be stored is acquired, the storage space of the memory can be fully utilized, and the memory utilization rate is high when the YUV data and the data to be stored are stored.
In the following, a YUV data storage apparatus provided by an embodiment of the present invention is introduced, and the YUV data storage apparatus described below and the YUV data storage method described above may be referred to correspondingly.
Referring to fig. 4, fig. 4 is a block diagram illustrating a YUV data storage device according to an embodiment of the present invention.
Referring to fig. 4, in an embodiment of the present invention, the YUV data storage may include:
YUV data acquisition module 100: the method is used for acquiring YUV data; the size of any YUV data is not equal to the integral multiple of 8 bits.
YUV data storage module 200: and the device is used for storing any YUV data into an integral number of bytes and recording idle bit bits which are not recorded with the YUV data in the bytes.
The to-be-stored data acquisition module 300: for obtaining data to be stored.
The to-be-stored data storage module 400: and the idle bit is used for storing the data to be stored into the byte.
Preferably, in the embodiment of the present invention, a value range of any one of the YUV data sizes is: 9 to 15 bits, inclusive.
Preferably, in the embodiment of the present invention, the idle bits are all bits of the byte where the YUV data is not recorded.
Preferably, in the embodiment of the present invention, the YUV data storage module 200 may include:
8bit instruction unit: and when the size of the YUV data is larger than 8 bits, calling an 8-bit instruction to write the first 8-bit data of the YUV data into bytes.
An instruction writing unit: and the YUV data writing device is used for calling a writing instruction to write the residual YUV data into bytes, and the data size corresponding to the writing instruction is less than 8 bits.
Preferably, in the embodiment of the present invention, the YUV data storage module 200 may include:
8bit instruction unit: and when the size of the YUV data is larger than 8 bits, calling an 8-bit instruction to write the first 8-bit data of the YUV data into bytes.
A bit cache write unit: and the device is used for writing the rest YUV data into a preset bit cache and writing the rest YUV data into bytes through the bit cache.
Preferably, in the embodiment of the present invention, the data to be stored includes a required storage speed corresponding to the storage time.
The to-be-stored data storage module 400 is specifically configured to:
and when the required storage speed corresponds to the idle bit, storing the data to be stored into the idle bit in the byte.
Preferably, in the embodiment of the present invention, the idle bits include a nibble composed of at least 4 consecutive bits.
The to-be-stored data storage module 400 is specifically configured to:
and when the required storage speed corresponds to the half byte, calling a 4-bit instruction to store the data to be stored into continuous 4 bits in the idle bits.
The YUV data storage device of this embodiment is used to implement the foregoing YUV data storage method, and therefore a specific implementation manner of the YUV data storage device may be found in the foregoing embodiments of the YUV data storage method, for example, the YUV data obtaining module 100, the YUV data storage module 200, the data to be stored obtaining module 300, and the data to be stored storage module 400 are respectively used to implement steps S101, S102, S103, and S104 in the foregoing computer system log association method, so that the specific implementation manner thereof may refer to descriptions of corresponding embodiments of each part, and is not described herein again.
In the following, a YUV data storage device according to an embodiment of the present invention is introduced, and the YUV data storage device described below, the YUV data storage method described above, and the YUV data storage apparatus may be referred to in correspondence with each other.
Referring to fig. 5, fig. 5 is a block diagram of a YUV data storage device according to an embodiment of the present invention.
Referring to fig. 5, the YUV data storage device may include a processor 11 and a memory 12.
The memory 12 is used for storing a computer program; the processor 11 is configured to implement the YUV data storage method in the above embodiment of the invention when executing the computer program.
The processor 11 in the YUV data storage device of this embodiment is used to install the YUV data storage apparatus in the above embodiment of the invention, and the processor 11 and the memory 12 may be combined to implement the YUV data storage method in any of the above embodiments of the invention. Therefore, the specific implementation of the YUV data storage device can be seen in the foregoing embodiments of the YUV data storage method, and the specific implementation thereof may refer to the description of the corresponding embodiments of each portion, which is not described herein again.
The present invention also provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements a YUV data storage method as described in any of the above embodiments of the invention. The rest can be referred to the prior art and will not be described in an expanded manner.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The YUV data storage method, the YUV data storage apparatus, the YUV data storage device, and the computer-readable storage medium according to the present invention are described in detail above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
Claims (9)
1. A YUV data storage method is characterized by comprising the following steps:
acquiring YUV data; the size of any YUV data is not equal to the integral multiple of 8 bits;
storing any YUV data into an integral number of bytes, and recording idle bit of the bytes without the YUV data;
acquiring data to be stored;
storing the data to be stored into an idle bit in the byte;
the data to be stored comprises a corresponding required storage speed during storage, and the required storage speed corresponds to a storage space;
the idle bit for storing the data to be stored into the byte comprises:
and when the storage space corresponding to the required storage speed is the idle bit, storing the data to be stored into the idle bit in the byte.
2. The method of claim 1, wherein the range of values of the YUV data size is: 9bit to 15bit, inclusive.
3. The method according to claim 2, wherein the free bits are all bits of the byte where the YUV data is not recorded.
4. The method of claim 1, wherein storing any one of the YUV data into an integer number of bytes comprises:
when the size of the YUV data is larger than 8 bits, calling an 8-bit instruction to write the first 8-bit data of the YUV data into bytes;
and calling a write-in instruction to write the residual YUV data into bytes, wherein the data size corresponding to the write-in instruction is less than 8 bits.
5. The method of claim 1, wherein storing any one of the YUV data into an integer number of bytes comprises:
when the size of the YUV data is larger than 8 bits, calling an 8-bit instruction to write the first 8-bit data of the YUV data into bytes;
and writing the rest YUV data into a preset bit cache, and writing the rest YUV data into bytes through the bit cache.
6. The method of claim 1, wherein the free bits comprise a nibble consisting of at least 4 consecutive bits;
when the storage space corresponding to the required storage speed is the idle bit, the storing the data to be stored into the idle bit in the byte comprises:
and when the storage space corresponding to the required storage speed is the half byte, calling a 4-bit instruction to store the data to be stored into continuous 4 bits in the idle bits.
7. A YUV data storage device, comprising:
a YUV data acquisition module: used for obtaining YUV data; the size of any YUV data is not equal to the integral multiple of 8 bits;
a YUV data storage module: the device is used for storing any YUV data into an integral number of bytes and recording idle bit which is not recorded with the YUV data in the bytes;
a to-be-stored data acquisition module: the data storage device is used for acquiring data to be stored;
the data storage module to be stored: an idle bit for storing the data to be stored into the byte;
the data to be stored comprises a corresponding required storage speed during storage, and the required storage speed corresponds to a storage space;
the idle bit for storing the data to be stored into the byte comprises:
and when the storage space corresponding to the required storage speed is the idle bit, storing the data to be stored into the idle bit in the byte.
8. A YUV data storage device, the device comprising:
a memory: for storing a computer program;
a processor: steps for implementing the YUV data storage method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the YUV data storage method according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011149450.9A CN112291567B (en) | 2020-10-23 | 2020-10-23 | YUV data storage method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011149450.9A CN112291567B (en) | 2020-10-23 | 2020-10-23 | YUV data storage method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112291567A CN112291567A (en) | 2021-01-29 |
CN112291567B true CN112291567B (en) | 2023-03-21 |
Family
ID=74424202
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011149450.9A Active CN112291567B (en) | 2020-10-23 | 2020-10-23 | YUV data storage method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112291567B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119440423A (en) * | 2025-01-10 | 2025-02-14 | 合肥康芯威存储技术有限公司 | Storage device and control method thereof |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004297562A (en) * | 2003-03-27 | 2004-10-21 | Fuji Photo Film Co Ltd | Image pickup device |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4079451A (en) * | 1976-04-07 | 1978-03-14 | Honeywell Information Systems Inc. | Word, byte and bit indexed addressing in a data processing system |
CN104461963B (en) * | 2014-11-27 | 2018-05-01 | 深圳市国微电子有限公司 | A kind of high speed serialization storage controlling method and device |
CN108377394B (en) * | 2018-03-06 | 2020-10-23 | 珠海全志科技股份有限公司 | Image data reading method of video encoder, computer device and computer-readable storage medium |
CN110351562A (en) * | 2019-06-25 | 2019-10-18 | 西安交通大学 | A kind of 10 bit YUV image storage formats |
CN111667679A (en) * | 2020-06-03 | 2020-09-15 | 贵州电网有限责任公司 | A data transmission method, device, terminal device and storage medium |
-
2020
- 2020-10-23 CN CN202011149450.9A patent/CN112291567B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004297562A (en) * | 2003-03-27 | 2004-10-21 | Fuji Photo Film Co Ltd | Image pickup device |
Also Published As
Publication number | Publication date |
---|---|
CN112291567A (en) | 2021-01-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8782018B2 (en) | Storage device and data processing device utilizing determined dictionary compression | |
US8892809B2 (en) | Data compression and encoding in a memory system | |
US8495464B2 (en) | Reliability support in memory systems without error correcting code support | |
JP2807017B2 (en) | Data compression method | |
US11176033B2 (en) | Data storage devices and data processing methods | |
KR20080041618A (en) | Device and method for reducing simultaneous switching noise | |
JPS60146326A (en) | Image conversion from bit map to run display | |
US20030161239A1 (en) | Apparatus for writing data and method for generating DVD format data | |
CN101751897A (en) | Method and apparatus for compressing and decompressing lookup tables | |
CN112291567B (en) | YUV data storage method, device, equipment and storage medium | |
TWI436363B (en) | Data storage device and data writing method for a flash memory | |
CN111491169A (en) | Digital image compression method, device, equipment and medium | |
US8094931B2 (en) | Method of color components compression | |
US20020123897A1 (en) | Speech data compression/expansion apparatus and method | |
CN110351562A (en) | A kind of 10 bit YUV image storage formats | |
CN112256993B (en) | Picture acceleration display method, system, equipment and medium | |
CN109189349A (en) | A kind of method and its system promoting solid state hard disk copy function | |
CN118012865A (en) | Configuration data acquisition method, device, electronic equipment and storage medium | |
CN113766243A (en) | Image data processing method and device, electronic equipment and storage medium | |
CN110795043B (en) | Distributed storage block zeroing method and device, electronic equipment and storage medium | |
CN115952226A (en) | Model storage method and device | |
US11461173B1 (en) | Method and system for facilitating efficient data compression based on error correction code and reorganization of data placement | |
JPH09191256A (en) | Storage and reproduction method for storage medium for still builtschirmtext | |
CN108876703B (en) | Data storage method | |
CN105094704A (en) | Method and device for storing video monitoring data by high scalability RAID array |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |