YUV data storage method, device, equipment and storage medium
By adjusting the P010 format YUV data to be continuously arranged before storage and writing it to high or low bits of RAM, the problem of waste of storage RAM space is solved, and more efficient storage performance in P010 format is achieved .
Patent Information
- Application Number
- CN202411635835.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-15
AI Technical Summary
When storing P010 format YUV data of 10-bit video, the prior art has a problem of wasting space in 128-bit internal storage RAM, especially when switching from NV12 format to P010 format, it is impossible to effectively reduce the wasted space in storage RAM.
By judging the storage format of YUV data, if it is P010 format, the arrangement method of the data units of Y data and UV data in the transition storage space is continuous arrangement, and the adjusted data units are written to the high bits of RAM. or low bits to reduce resource waste.
It effectively reduces resource waste in storage RAM and improves storage capabilities, so that devices can have better storage performance in NV12 and P010 formats.
Smart Images

Figure CN119172511B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image data storage, and in particular to a YUV data storage method, device, equipment and storage medium. Background Art
[0002] For 8-bit video encoding, many hardware encoders natively support NV12 format image input. In the NV12 format, YUV data is sampled in 4:2:0. The storage order is to store all Y data in an internal storage RAM (Y-RAM) first, and then store UV data alternately and mixed in another internal storage RAM (UV-RAM). For each data unit of Y / U / V data, it is 8 bits, each occupying one byte. Since the bus data width is 128 bits, in order to ensure bus performance, the collected Y / UV data needs to be able to be written directly to the internal storage RAM. Therefore, the data width of the unit storage space of the internal storage RAM is designed to be 128 bits, corresponding to 16 bytes.
[0003] However, with the advancement of technology, 10-bit videos with higher color depth have become popular. When storing YUV data in P010 format, the data units of the received Y / U / V data are all 10 bits in size, and for the Y / UV data just received, its storage format in the transitional storage space occupies two bytes for each data unit, resulting in a waste of 6 bits of resources in the second byte. At this time, in order to enable the above-mentioned device supporting NV12 format storage to support P010 format storage, the Y / UV data in the above case is directly stored in the RAM unit storage space, which will also result in only 10 bits of space being used for every two bytes in the RAM, resulting in 6 bits of wasted space. The next data unit will be stored again in the next two bytes, and when the number of high-bit bytes is insufficient, the low-bit space will be further occupied. Finally, the following is formed. Figure 1 It can be seen from the storage method that in the P010 format, the Y / UV data will occupy part of the high-bit storage space and the low-bit storage space at the same time, which will eventually lead to a large space waste in each unit storage space of the 128-bit internal storage RAM.
[0004] Therefore, for devices that can support two working modes, when their storage mode is switched from NV12 to P010, how to reduce the wasted space in the storage RAM is a direction that needs to be improved. Summary of the invention
[0005] The present application provides a YUV data storage method, device, equipment and storage medium, which can solve the related technical problems existing in the above-mentioned prior art.
[0006] In a first aspect, an embodiment of the present application provides a YUV data storage method, which adopts the following technical solution:
[0007] A YUV data storage method, the method comprising:
[0008] Acquire YUV data to be stored; wherein the YUV data is one of Y data and UV data received in batches;
[0009] Determine whether the storage format of the YUV data is NV12 format or P010 format;
[0010] If the format is P010, the arrangement of the data units in the Y data / UV data in the transition storage space is adjusted to be continuous arrangement;
[0011] The adjusted data unit of the Y data is written into the continuous high bit positions in the unit storage space in the first RAM or the second RAM, or the adjusted data unit of the UV data is written into the continuous low bit positions in the unit storage space in the first RAM and the second RAM.
[0012] In combination with the first aspect, in one implementation, writing the adjusted data unit of the Y data into consecutive high bits in the unit storage space in the first RAM or the second RAM, or writing the adjusted data unit of the UV data into consecutive low bits in the unit storage space in the first RAM and the second RAM, comprises the following steps:
[0013] Determine a global address corresponding to the Y data / the UV data according to an image block number and an internal address of the image block of the Y data / the UV data;
[0014] According to the global address of the Y data / the UV data and the respective address ranges of the first RAM and the second RAM, the data unit of the Y data is written into the continuous high bit bits in the corresponding first RAM or second RAM unit storage space, or the UV data is written into the continuous low bit bits in the corresponding first RAM or second RAM unit storage space.
[0015] In combination with the first aspect, in one implementation, writing the data unit of the Y data into consecutive high bits in a corresponding first RAM or second RAM unit storage space, or writing the UV data into consecutive low bits in a corresponding first RAM or second RAM unit storage space according to the global address of the Y data / the UV data and the respective address ranges of the first RAM and the second RAM, comprises the following steps:
[0016] If the global address of the Y data is greater than the address range of the first RAM, determine the high bit of the corresponding unit storage space in the second RAM according to the global address of the Y data and write it;
[0017] If the global address of the UV data is larger than the address range of the first RAM, the corresponding low bit of the unit storage space is determined in the second RAM according to the global address of the UV data and written into the low bit.
[0018] In combination with the first aspect, in one implementation, the Y data and the UV data each include 8 data units, each of the data units has a total of 10 bits and occupies two bytes of storage space, and the two Y data respectively correspond to half of the data units in the UV data; the unit storage space of the first RAM and the second RAM includes 10 bytes of high bits and 6 bytes of low bits.
[0019] In combination with the first aspect, in one implementation, the step of writing the adjusted data unit of the Y data into consecutive high bits in the unit storage space in the first RAM or the second RAM, or before writing the adjusted data unit of the UV data into consecutive low bits in the unit storage space in the first RAM and the second RAM, includes the following steps:
[0020] According to the validity flag of each data unit before the arrangement mode adjustment, the validity flag of each data unit after the adjustment is determined;
[0021] The adjusted data unit of the Y data is written into the continuous high bit positions in the unit storage space in the first RAM or the second RAM, or the adjusted data unit of the UV data is written into the continuous low bit positions in the unit storage space in the first RAM and the second RAM,
[0022] Whether the data unit of the Y data / the UV data is valid is determined according to the validity flag, and the valid data unit of the Y data / the UV data is written into the high bit / low bit of the corresponding first RAM or second RAM unit storage space according to the global address.
[0023] In combination with the first aspect, in one implementation, the adjusted data unit of the UV data is written into consecutive low bits in the unit storage space in the first RAM and the second RAM,
[0024] The data units of the UV data respectively corresponding to the two Y data are written into the low bits of the storage space of the first RAM or the second RAM unit in beats.
[0025] In combination with the first aspect, in one implementation, the Y data at high bits and the UV data at low bits in the unit storage spaces of the first RAM and the second RAM correspond to each other.
[0026] In a second aspect, the embodiment of the present application provides a YUV data storage device, which adopts the following technical solution:
[0027] A YUV data storage device, the device comprising:
[0028] An acquisition module, configured to acquire YUV data to be stored; wherein the YUV data is one of Y data and UV data received in batches;
[0029] A determination module configured to determine whether the storage format of the YUV data is NV12 format or P010 format;
[0030] The processing module is configured to adjust the arrangement of the data units in the Y data / the UV data in the transition storage space to a continuous arrangement if the format is P010; write the adjusted data units of the Y data into continuous high bits in the unit storage space in the first RAM or the second RAM, or write the adjusted data units of the UV data into continuous low bits in the unit storage space in the first RAM and the second RAM.
[0031] In a third aspect, an embodiment of the present application provides a YUV data storage device, which adopts the following technical solution:
[0032] A YUV data storage device comprises a processor, a memory, and a YUV data storage program stored in the memory and executable by the processor, wherein when the YUV data storage program is executed by the processor, the steps of the YUV data storage method described above are implemented.
[0033] In a fourth aspect, an embodiment of the present application provides a storage medium, which adopts the following technical solution:
[0034] A storage medium stores a YUV data storage program, wherein when the YUV data storage program is executed by a processor, the steps of the YUV data storage method described above are implemented.
[0035] The beneficial effects brought by the technical solution provided in the embodiments of the present application include:
[0036] By judging the storage format of the YUV data before storing it, it is possible to adjust the storage strategy when the storage format is P010. Before writing the data unit of the Y data / UV data in the YUV data into the unit storage space in the first RAM or the second RAM, the arrangement of the data unit in the Y data or UV data is adjusted to be a continuous arrangement, so that it can be smoothly and continuously written into the high bit / low bit of the first RAM or the second RAM unit storage space in the subsequent process. Compared with the method of storing P010 format data in the prior art, the waste of resources is effectively reduced, and the storage capacity of the first RAM or the second RAM is greatly improved. Finally, the relevant equipment can not only have sufficient storage performance in the NV12 storage format, but also have better storage performance when stored in the P010 format. In addition, since the Y data and UV data are respectively stored in the high bit and low bit of the same unit storage space, a unit storage space under this storage method is capable of storing a complete YUV data, which is convenient for addressing and reading and writing. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of the distribution of Y data of YUV data in the related art when it is stored in a unit storage space in a P010 format;
[0038] Figure 2 This is a flow chart of an embodiment of a YUV data storage method of the present application;
[0039] Figure 3 This is a schematic diagram of the distribution of Y data of YUV data in the YUV data storage method of this application when it is stored in the unit storage space in the P010 format;
[0040] Figure 4 This is a schematic diagram of the distribution of YUV data in the unit storage space in the YUV data storage method of this application;
[0041] Figure 5 This is a functional module diagram of an embodiment of a YUV data storage device of the present application;
[0042] Figure 6 This is a schematic diagram of the hardware structure of the YUV data storage device involved in the embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0044] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0045] In a first aspect, an embodiment of the present application provides a YUV data storage method.
[0046] The YUV data storage method provided in the present application is mainly used for related devices with high-performance storage effects for NV12 format data when storing data in P010 format. For example, this embodiment takes the first RAM and the second RAM composed of high bit: low bit = 2:1 as an example. These internal storage RAMs are generally composed of multiple 128-bit unit storage spaces, and each unit storage space has 80 bits of high bits, a total of 10 bytes, and 48 bits of low bits, a total of 6 bytes. When storing image data in NV12 format, the first RAM and the second RAM will store the Y data and UV data in the YUV data respectively. When executing the storage of P010 format data, in order to achieve the ability to store the received YUV data with a data unit of 10 bits without wasting too much resource space, refer to Figure 2 The YUV data storage method of this application specifically adopts the following steps:
[0047] S100, obtaining YUV data to be stored; wherein the YUV data is one of Y data and UV data received in batches;
[0048] S200, determining whether the storage format of the YUV data is NV12 format or P010 format;
[0049] S300, if the format is P010, adjusting the arrangement of the data units in the Y data / UV data in the transition storage space to be continuous arrangement;
[0050] S400, writing the adjusted data unit of the Y data into continuous high bits in the unit storage space in the first RAM or the second RAM, or writing the adjusted data unit of the UV data into continuous low bits in the unit storage space in the first RAM and the second RAM.
[0051] In this embodiment, refer to Figure 3 and Figure 4 Taking YUV data with a sampling mode of 4:2:0 as an example, by judging the storage format of the YUV data before storing it, when the storage format is P010, the storage strategy can be adjusted, and before the data unit of the Y data or UV in the YUV data is written into the unit storage space in the first RAM or the second RAM, the arrangement mode of the data unit in the Y data or UV data is adjusted to be continuously arranged, so that it can be smoothly and continuously written into the high bit / low bit of the unit storage space of the first RAM or the second RAM in the subsequent process. Not only a complete YUV data is stored in the same unit storage space, which is convenient for addressing, but also compared with the method of storing P010 format data in the prior art, the waste of resources is effectively reduced, and the storage capacity of the first RAM or the second RAM is greatly improved, so that the relevant equipment can not only have sufficient storage performance in the NV12 storage format, but also have better storage performance when stored in the P010 format. In addition, in other embodiments, for YUV data with other types of sampling methods, such as YUV data in the form of 4:4:4 or 4:2:2, the above scheme can also be adopted, and the Y data and UV data in the YUV data are respectively stored in the high bit and low bit of the internal storage RAM, and the ratio of the high bit to the low bit of the internal storage RAM may also be different in different embodiments, and the present application does not impose any restrictions on this.
[0052] It is worth noting that, since the UV data of a YUV image is half of the Y data, and in order to ensure transmission efficiency, the number of data units in the UV data transmitted each time is consistent with the Y data, that is, each received UV data will have two parts of UV data corresponding to two YUV data respectively. Therefore, it is necessary to divide the UV data into two parts, and write the two parts of UV data as a whole into the continuous low bits of a unit storage space in the first RAM or the second RAM, that is, write the received UV data into two parts into the continuous low bits of a unit storage space in the first RAM or the second RAM.
[0053] In order to write the Y data or UV data to the corresponding storage location, further, in one embodiment, the step S400, writing the adjusted data unit of the Y data into the continuous high bit positions in the unit storage space in the first RAM or the second RAM, or writing the adjusted data unit of the UV data into the continuous low bit positions in the unit storage space in the first RAM and the second RAM, includes the following steps:
[0054] S410, determining a global address corresponding to the Y data / the UV data according to an image block number and an internal address of an image block of the Y data / the UV data;
[0055] S420. According to the global address of the Y data / the UV data and the respective address ranges of the first RAM and the second RAM, write the data unit of the Y data into continuous high bits in the corresponding first RAM or second RAM unit storage space, or write the UV data into continuous low bits in the corresponding first RAM or second RAM unit storage space.
[0056] Exemplarily, in this embodiment, the first RAM and the second RAM have 192 storage units respectively. Since the high bits of the first RAM and the second RAM in this application will be used to store Y data, the Y data corresponding to the 1st to 192nd global addresses will be stored in the first RAM, and the Y data with global addresses greater than 192 will be stored in the second RAM. The same is true for UV data, which will not be described in detail.
[0057] In addition, for the received Y data or UV data, each data unit therein does not necessarily need to be stored. Specifically, each data unit on the received Y data or UV data has a corresponding validity flag (MASK). However, in the just received Y data or UV data, the validity flag corresponds to the byte. Figure 1 In order to enable the Y data or UV data whose arrangement is adjusted in the present application to be selectively stored smoothly according to the validity mark, it is necessary to establish an available validity mark for the Y data or UV data whose arrangement is adjusted. Therefore, in the present embodiment, further, before writing the adjusted data unit of the Y data into the continuous high bit positions in the unit storage space in the first RAM or the second RAM in step S400, or writing the adjusted data unit of the UV data into the continuous low bit positions in the unit storage space in the first RAM and the second RAM, the following steps are included:
[0058] S310, determining the validity flag of each data unit after the adjustment according to the validity flag of each data unit before the arrangement mode adjustment;
[0059] Specifically, after determining the data unit to be written according to the validity flag of the Y data or UV data before the arrangement mode is adjusted, a corresponding validity flag reflecting the need to be written is established in units of bits for each data unit after the arrangement mode is adjusted, referring to Figure 3 .
[0060] After the validity flag is adjusted, in the subsequent writing step, whether the data unit of the Y data / the UV data is valid can be determined according to the validity flag, and the valid data unit of the Y data / the UV data can be written into the corresponding high bit / low bit of the first RAM or the second RAM unit storage space according to the global address.
[0061] In addition, to further facilitate read and write addressing, the Y data at high bits and the UV data at low bits in the unit storage space of the first RAM and the second RAM correspond to each other and belong to the same YUV data.
[0062] In a second aspect, an embodiment of the present application also provides a YUV data storage device.
[0063] In one embodiment, referring to Figure 5 , Figure 5 This is a functional module diagram of an embodiment of the YUV data storage device of the present application. Figure 5 As shown, the YUV data storage device comprises:
[0064] An acquisition module, configured to acquire YUV data to be stored; wherein the YUV data is one of Y data and UV data received in batches;
[0065] A determination module configured to determine whether the storage format of the YUV data is NV12 format or P010 format;
[0066] A processing module is configured to, if the format is NV12, write the Y data of the YUV data into the unit storage space of the first RAM, or write the UV data of the YUV data into the unit storage space of the second RAM; and, if the format is P010, adjust the arrangement of the data units in the Y data / the UV data in the transition storage space to a continuous arrangement, write the adjusted data units of the Y data into continuous high bits in the unit storage space in the first RAM or the second RAM, or write the adjusted data units of the UV data into continuous low bits in the unit storage space in the first RAM and the second RAM.
[0067] Among them, the functional implementation of each module in the above-mentioned YUV data storage device corresponds to each step in the above-mentioned YUV data storage method embodiment, and its functions and implementation processes are no longer repeated here.
[0068] In a third aspect, an embodiment of the present application provides a YUV data storage device, which may be a device with data processing function, such as a personal computer (PC), a laptop computer, or a server.
[0069] Reference Figure 6 , Figure 6 Schematic diagram of the hardware structure of the YUV data storage device involved in the embodiment of the present application. In the embodiment of the present application, the YUV data storage device may include a processor, a memory, a communication interface and a communication bus.
[0070] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.
[0071] The communication interface includes input / output (I / O) interface, physical interface and logical interface, which are used to realize the interconnection of devices inside the YUV data storage device, and the interface used to realize the interconnection between the YUV data storage device and other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, a fiber optic interface, an ATM interface, etc.; the user device can be a display (Display), a keyboard (Keyboard), etc.
[0072] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0073] The processor may be a general-purpose processor, and the general-purpose processor may call the YUV data storage program stored in the memory and execute the YUV data storage method provided in the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the YUV data storage program is called may refer to the various embodiments of the YUV data storage method of the present application, and will not be repeated here.
[0074] Those skilled in the art will understand that Figure 6 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0075] In a fourth aspect, an embodiment of the present application also provides a storage medium.
[0076] The storage medium of the present application stores a YUV data storage program, wherein when the YUV data storage program is executed by a processor, the steps of the above-mentioned YUV data storage method are implemented.
[0077] Among them, the method implemented when the YUV data storage program is executed can refer to the various embodiments of the YUV data storage method of the present application, and will not be repeated here.
[0078] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.
[0079] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.
[0080] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.
[0081] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.
[0082] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.
[0083] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.
[0084] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A YUV data storage method, characterized in that: The method comprises: Acquire YUV data to be stored; wherein the YUV data is one of Y data and UV data received in batches; Determine whether the storage format of the YUV data is NV12 format or P010 format; If the format is P010, the arrangement of the data units in the Y data and the UV data in the transition storage space is adjusted to be a continuous arrangement; The adjusted data unit of the Y data is written into continuous high bits in the unit storage space in the first RAM or the second RAM, and the adjusted data unit of the UV data is written into continuous low bits in the unit storage space in the first RAM and the second RAM, and a complete YUV data is stored in the same unit storage space.
2. The YUV data storage method according to claim 1, characterized in that: The step of writing the adjusted data unit of the Y data into the continuous high bit positions in the unit storage space in the first RAM or the second RAM, and writing the adjusted data unit of the UV data into the continuous low bit positions in the unit storage space in the first RAM and the second RAM comprises the following steps: Determine the global addresses corresponding to the Y data and the UV data according to the image block numbers and internal addresses of the image blocks of the Y data and the UV data; According to the global addresses of the Y data and the UV data and the respective address ranges of the first RAM and the second RAM, the data unit of the Y data is written into the continuous high bit bits in the corresponding first RAM or second RAM unit storage space, and the UV data is written into the continuous low bit bits in the corresponding first RAM or second RAM unit storage space.
3. The YUV data storage method according to claim 2, characterized in that: The method of writing the data unit of the Y data into the continuous high bit positions in the corresponding first RAM or second RAM unit storage space and writing the UV data into the continuous low bit positions in the corresponding first RAM or second RAM unit storage space according to the global addresses of the Y data and the UV data and the respective address ranges of the first RAM and the second RAM comprises the following steps: If the global address of the Y data is greater than the address range of the first RAM, determine the high bit of the corresponding unit storage space in the second RAM according to the global address of the Y data and write it; If the global address of the UV data is larger than the address range of the first RAM, the corresponding low bit of the unit storage space is determined in the second RAM according to the global address of the UV data and written into the low bit.
4. The YUV data storage method according to claim 2, characterized in that: The method of writing the adjusted data unit of the Y data into the continuous high bit positions in the unit storage space in the first RAM or the second RAM, and before writing the adjusted data unit of the UV data into the continuous low bit positions in the unit storage space in the first RAM and the second RAM, comprises the following steps: According to the validity flag of each data unit before the arrangement mode adjustment, the validity flag of each data unit after the adjustment is determined; The adjusted data unit of the Y data is written into the continuous high bit positions in the unit storage space in the first RAM or the second RAM, and the adjusted data unit of the UV data is written into the continuous low bit positions in the unit storage space in the first RAM and the second RAM, Whether the data units of the Y data and the UV data are valid is determined according to the validity flag, and the valid data units of the Y data and the UV data are written into the high bit and the low bit of the corresponding first RAM or second RAM unit storage space according to the global address.
5. The YUV data storage method according to claim 1, characterized in that: The adjusted data unit of the UV data is written into the continuous low bits in the unit storage space in the first RAM and the second RAM, The data units of the UV data respectively corresponding to the two Y data are written into the low bits of the storage space of the first RAM or the second RAM unit in beats.
6. The YUV data storage method according to claim 1, characterized in that: The Y data and the UV data each include 8 data units, each of the data units has a total of 10 bits and occupies two bytes of storage space, and the two Y data correspond to half of the data units in the UV data respectively; the unit storage space of the first RAM and the second RAM includes 10 bytes of high bits and 6 bytes of low bits.
7. The YUV data storage method according to claim 4, characterized in that: The Y data at high bits and the UV data at low bits in the unit storage spaces of the first RAM and the second RAM correspond to each other.
8. A YUV data storage device, characterized in that: The device comprises: An acquisition module, configured to acquire YUV data to be stored; wherein the YUV data is one of Y data and UV data received in batches; A determination module configured to determine whether the storage format of the YUV data is NV12 format or P010 format; The processing module is configured to adjust the arrangement of the data units in the Y data and the UV data in the transition storage space to a continuous arrangement if the format is P010; write the adjusted data units of the Y data into continuous high bits in the unit storage space in the first RAM or the second RAM, write the adjusted data units of the UV data into continuous low bits in the unit storage space in the first RAM and the second RAM, and store a complete YUV data in the same unit storage space.
9. A YUV data storage device, characterized in that The YUV data storage device comprises a processor, a memory, and a YUV data storage program stored in the memory and executable by the processor, wherein when the YUV data storage program is executed by the processor, the steps of the YUV data storage method according to any one of claims 1 to 7 are implemented.
10. A storage medium, characterized in that: The storage medium stores a YUV data storage program, wherein when the YUV data storage program is executed by the processor, the steps of the YUV data storage method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
10-bit YUV image storage format
CN110351562A