CN113038108A - Image format conversion method, device, equipment and storage medium - Google Patents

Image format conversion method, device, equipment and storage medium Download PDF

Info

Publication number
CN113038108A
CN113038108A CN202110208219.0A CN202110208219A CN113038108A CN 113038108 A CN113038108 A CN 113038108A CN 202110208219 A CN202110208219 A CN 202110208219A CN 113038108 A CN113038108 A CN 113038108A
Authority
CN
China
Prior art keywords
image
data
format conversion
image data
format
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.)
Pending
Application number
CN202110208219.0A
Other languages
Chinese (zh)
Inventor
张文强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xian Wanxiang Electronics Technology Co Ltd
Original Assignee
Xian Wanxiang Electronics Technology Co Ltd
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 Xian Wanxiang Electronics Technology Co Ltd filed Critical Xian Wanxiang Electronics Technology Co Ltd
Priority to CN202110208219.0A priority Critical patent/CN113038108A/en
Publication of CN113038108A publication Critical patent/CN113038108A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals

Landscapes

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

Abstract

The disclosure provides an image format conversion method, an image format conversion device, image format conversion equipment and a storage medium, relates to the technical field of image processing, can reduce DDR read-write operation once, and solves the problem that DDR bandwidth is occupied in the conventional image format conversion. The specific technical scheme is as follows: the image format conversion unit receives first image data sent by the image acquisition unit in a stream format; performing image format conversion on the first image data to obtain second image data, and sending the second image data to a data format conversion unit by adopting a stream pipeline format; the data format conversion unit converts the second image data in the stream pipeline format into second image data in the AXI format and stores the second image data in the storage unit.

Description

Image format conversion method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to an image format conversion method, an image format conversion apparatus, an image format conversion device, and a storage medium.
Background
After the existing image acquisition is completed, for the convenience of subsequent processing, image format conversion is often required, for example, converting YUV to RGB, or converting RGB to YUV. Taking YUV to RGB as an example, referring to fig. 1, the current implementation manner in the prior art is: the image acquisition unit writes the acquired YUV image into a DDR (Double Data Rate SDRAM) through an AXI (advanced eXtensible interface) bus interface, then reads out the YUV image from the DDR, realizes format conversion from YUV to RGB through the image format conversion unit, and stores the converted RGB image into the DDR again through the AXI bus interface. In order to realize the image format conversion, the operations of reading and rewriting the image from and into the DDR are required, and there is a problem that the DDR bandwidth is occupied.
Disclosure of Invention
The embodiment of the disclosure provides an image format conversion method, an image format conversion device and a storage medium, which can reduce DDR read-write operation once and solve the problem that DDR bandwidth is occupied in the conventional image format conversion. The technical scheme is as follows:
according to a first aspect of embodiments of the present disclosure, there is provided an image format conversion method, including:
the image format conversion unit receives first image data sent by the image acquisition unit in a stream format;
performing image format conversion on the first image data to obtain second image data, and sending the second image data to a data format conversion unit by adopting a stream pipeline format;
the data format conversion unit converts the second image data in the stream pipeline format into second image data in the AXI format and stores the second image data in the storage unit.
According to the embodiment of the disclosure, before the image data is stored in the DDR, the conversion of the image format is completed by adopting the stream format, and then the image data after the image format conversion is stored after the data format conversion.
In one embodiment, the second image data includes at least one frame of image, and the data format conversion unit is a two-dimensional DMA unit; the data format conversion unit storing the AXI-formatted second image data in a storage unit includes:
the data format conversion unit writes the second image data of the AXI format in the storage unit in the form of one frame in order through an AXI bus interface.
In one embodiment, each frame of image in the second image data comprises at least one macroblock of size M × N; the data format conversion unit writing the second image data of the AXI format in the storage unit in the sequential form of one frame through an AXI bus includes:
the data format conversion unit writes, in consecutive pixels, macroblock data of each frame in second image data of the AXI format to the storage unit through an AXI bus interface, the writing the macroblock data of each frame to the storage unit in consecutive pixels including: after the line data of the ith macro block of the jth frame is written, the line data storage address of the (i + 1) th macro block jumps to the next line address of the jth frame image.
In one embodiment, the first image data is YUV data, and the second image data is RGB data; or the first image data is RGB data, and the second image data is YUV data.
According to a second aspect of the embodiments of the present disclosure, there is provided an image format conversion apparatus including: the device comprises an image acquisition unit, an image format conversion unit, a data format conversion unit and a storage unit;
the image acquisition unit is used for acquiring first image data and sending the acquired first image data to the image format conversion unit by adopting a stream format;
the image format conversion unit is used for carrying out format conversion on the first image data to obtain a second image and sending the second image data to the data format conversion unit by adopting a stream pipeline format;
the data format conversion unit is configured to convert the second image data in the stream pipeline format into second image data in an AXI format, and write the second image data in the AXI format into the storage unit;
the storage unit is configured to store the second image data in the AXI format.
In one embodiment, the second image data includes at least one frame of image, and the data format conversion unit is a two-dimensional DMA unit;
the data format conversion unit is used for writing the second image data in the AXI format into the storage unit through an AXI bus interface in a sequential form of one frame.
In one embodiment, each frame of image in the second image data comprises at least one macroblock of M x N;
the data format conversion unit is configured to write, through an AXI bus interface, macroblock data of each frame in second image data of the AXI format in the storage unit in consecutive pixels, the writing the macroblock data of each frame in the storage unit in consecutive pixels including: after the line data of the ith macro block of the jth frame is written, the line data storage address of the (i + 1) th macro block jumps to the next line address of the jth frame image.
In one embodiment, the memory cells are DDR cells.
According to a third aspect of the embodiments of the present disclosure, there is provided an image format conversion device, including a processor and a memory, where at least one computer instruction is stored, the instruction being loaded and executed by the processor to implement the steps performed in the image format conversion method described in the first aspect and any of the embodiments of the first aspect.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, in which at least one computer instruction is stored, the instruction being loaded and executed by a processor to implement the steps performed in the image format conversion method described in the first aspect and any one of the embodiments of the first aspect.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flowchart of an image format conversion method provided by an embodiment of the present disclosure;
fig. 2 is a flowchart of an image format conversion method provided by an embodiment of the present disclosure;
fig. 3 is a structural diagram of an image format conversion device according to an embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
An embodiment of the present disclosure provides an image format conversion method, as shown in fig. 1, the image format conversion method includes the following steps:
101. the image format conversion unit receives first image data sent by the image acquisition unit in a stream format.
In the embodiment of the present disclosure, the first image data may be YUV data or RGB data. When the image acquisition unit acquires the first image data, the first image data is sent to the image format conversion unit in a stream format.
102. And converting the image format of the first image data to obtain second image data, and sending the second image data to the data format conversion unit by adopting a stream format.
In the embodiment of the present disclosure, the image format conversion unit performs image format conversion to convert the first image data into the second image data. When the first image data is YUV data, the second image data is RGB data, namely the YUV data is converted into RGB data; when the first image data is RGB data, the second image data is YUV data, that is, the RGB data is converted into YUV data. After the image format conversion unit converts the first image data into the second image data, the second image data is sent to the data format conversion unit in a stream pipeline format.
103. The data format conversion unit converts the second image data in the stream pipeline format into second image data in the AXI format and stores the second image data in the storage unit.
The memory unit is a DDR unit. Specifically, the data format conversion unit converts the second image data in the stream pipeline format into the second image data in the AXI format, and writes the second image data in the AXI format into the storage unit through the AXI bus interface, and the storage unit stores the written second image data.
In the embodiment of the present disclosure, the data format conversion unit is a two-dimensional DMA (Direct Memory Access) unit, the second image data includes at least one frame of image, and the data format conversion unit stores the second image data in the AXI format in the DDR through the AXI bus interface in order of one frame. Specifically, each frame of image in the second image data includes at least one macroblock with a size of M × N, where M and N may be the same or different. Then, the writing of the second image data in the AXI format into the storage unit in the sequential form of one frame by the data format conversion unit through the AXI bus interface includes: the data format conversion unit writes the macro block data of each frame in the second image data of the AXI format in the storage unit in consecutive pixels through the AXI bus interface, and the writing the macro block data of each frame in the storage unit in consecutive pixels includes: after the line data of the ith macro block of the jth frame is written, the line data storage address of the (i + 1) th macro block jumps to the next line address of the jth frame image.
Taking M ═ N ═ 16 as an example, the two-dimensional DMA unit stores the second image data in AXI format in the DDR in order of one frame, that is, the macro block data of each frame in the second image data in AXI format is stored in the DDR in consecutive pixels, that is, after one macro block line of 16 pixels is sent out, the next macro block line data storage address needs to jump to the next line address of the frame image, that is, the two-dimensional DMA transfer is performed.
Referring to fig. 2, the first image data is YUV data, and the second image data is RGB data. The image acquisition unit sends acquired YUV data to the image format conversion unit in a stream format, the image format conversion unit converts the YUV data into RGB data and sends the RGB data to the data format conversion unit in the stream format, and the data format conversion unit converts the RGB data in the stream format into RGB data in an AXI format and then stores the RGB data in the AXI format into a DDR through an AXI bus interface.
According to the image format conversion method provided by the embodiment of the disclosure, an image format conversion unit receives first image data sent by an image acquisition unit in a stream format; the image format conversion unit converts the first image data into second image data in an AXI format and then stores the second image data in a storage unit. According to the embodiment of the disclosure, before the image data is stored in the DDR, the conversion of the image format is completed by adopting the stream format, and then the image data after the image format conversion is stored after the data format conversion.
Based on the image format conversion method described in the embodiment corresponding to fig. 1, the following is an embodiment of the apparatus of the present disclosure, which can be used to execute an embodiment of the method of the present disclosure.
An embodiment of the present disclosure provides an image format conversion apparatus, as shown in fig. 3, the image format conversion including: an image acquisition unit 301, an image format conversion unit 302, a data format conversion unit 303, and a storage unit 304;
the image acquisition unit 301 is configured to acquire first image data and send the acquired first image data to the image format conversion unit by using a stream format;
an image format conversion unit 302, configured to perform format conversion on the first image data to obtain a second image, and send the second image data to the data format conversion unit by using a stream format;
a data format conversion unit 303 configured to convert the second image data in the stream pipeline format into second image data in the AXI format, and write the second image data in the AXI format into the storage unit through the AXI bus interface;
a storage unit 304 for storing the second image data in the AXI format.
In one embodiment, the second image data includes at least one frame of image, and the data format conversion unit is a two-dimensional DMA unit;
the data format conversion unit 303 is configured to write the second image data in the AXI format in the memory unit in the sequential form of one frame through the AXI bus interface.
In one embodiment, each frame of image in the second image data comprises at least one macroblock of M x N;
the data format conversion unit 303 is configured to write, in consecutive pixels, the macro block data of each frame in the second image data in the AXI format to the storage unit through the AXI bus interface, where writing the macro block data of each frame to the storage unit in consecutive pixels includes: after the line data of the ith macro block of the jth frame is written, the line data storage address of the (i + 1) th macro block jumps to the next line address of the jth frame image.
In one embodiment, the memory cells are DDR cells.
In one embodiment, the first image data is YUV data and the second image data is RGB data; or the first image data is RGB data, and the second image data is YUV data.
In the image format conversion device provided by the embodiment of the disclosure, the image acquisition unit is used for acquiring first image data and sending the acquired first image data to the image format conversion unit by adopting a stream format; the image format conversion unit is used for carrying out format conversion on the first image data to obtain a second image and sending the second image data to the data format conversion unit by adopting a stream format; the data format conversion unit is used for converting the second image data in the stream pipeline format into second image data in the AXI format and writing the second image data in the AXI format into the storage unit; the storage unit is used for storing the second image data in AXI format. According to the embodiment of the disclosure, before the image data is stored in the DDR, the conversion of the image format is completed by adopting the stream format, and then the image data after the image format conversion is stored after the data format conversion.
The embodiment of the present disclosure further provides an image format conversion device, where the image format conversion device includes a receiver, a transmitter, a memory, and a processor, where the transmitter and the memory are respectively connected to the processor, the memory stores at least one computer instruction, and the processor is configured to load and execute the at least one computer instruction, so as to implement the image format conversion method described in the embodiment corresponding to fig. 1.
Based on the image format conversion method described in the embodiment corresponding to fig. 1 and fig. 2, the embodiment of the present disclosure further provides a computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a Read Only Memory (ROM), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. The storage medium stores computer instructions for executing the image format conversion method described in the embodiment corresponding to fig. 1 and fig. 2, which is not described herein again.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. An image format conversion method, characterized in that the method comprises:
the image format conversion unit receives first image data sent by the image acquisition unit in a stream format;
performing image format conversion on the first image data to obtain second image data, and sending the second image data to a data format conversion unit by adopting a stream pipeline format;
the data format conversion unit converts the second image data in the stream pipeline format into second image data in the AXI format and stores the second image data in the storage unit.
2. The method of claim 1, wherein the second image data comprises at least one frame of image, and the data format conversion unit is a two-dimensional DMA unit; the data format conversion unit storing the AXI-formatted second image data in a storage unit includes:
the data format conversion unit writes the second image data of the AXI format in the storage unit in the form of one frame in order through an AXI bus interface.
3. The method of claim 2, wherein each frame of image in the second image data comprises at least one macroblock of size M x N; the data format conversion unit writing the second image data of the AXI format in the storage unit in a sequential form of one frame through an AXI bus interface includes:
the data format conversion unit writes, in consecutive pixels, macroblock data of each frame in second image data of the AXI format to the storage unit through an AXI bus interface, the writing the macroblock data of each frame to the storage unit in consecutive pixels including: after the line data of the ith macro block of the jth frame is written, the line data storage address of the (i + 1) th macro block jumps to the next line address of the jth frame image.
4. The method according to claim 1, wherein the first image data is YUV data, and the second image data is RGB data; or the first image data is RGB data, and the second image data is YUV data.
5. An image format conversion apparatus, characterized by comprising: the device comprises an image acquisition unit, an image format conversion unit, a data format conversion unit and a storage unit;
the image acquisition unit is used for acquiring first image data and sending the acquired first image data to the image format conversion unit by adopting a stream format;
the image format conversion unit is used for carrying out format conversion on the first image data to obtain a second image and sending the second image data to the data format conversion unit by adopting a stream pipeline format;
the data format conversion unit is configured to convert the second image data in the stream pipeline format into second image data in an AXI format, and write the second image data in the AXI format into the storage unit;
the storage unit is configured to store the second image data in the AXI format.
6. The apparatus according to claim 5, wherein the second image data includes at least one frame image, and the data format conversion unit is a two-dimensional DMA unit;
the data format conversion unit is used for writing the second image data in the AXI format into the storage unit through an AXI bus interface in a sequential form of one frame.
7. The apparatus of claim 5, wherein each frame of image in the second image data comprises at least one M N macroblock;
the data format conversion unit is configured to write, through an AXI bus interface, macroblock data of each frame in second image data of the AXI format in the storage unit in consecutive pixels, the writing the macroblock data of each frame in the storage unit in consecutive pixels including: after the line data of the ith macro block of the jth frame is written, the line data storage address of the (i + 1) th macro block jumps to the next line address of the jth frame image.
8. The apparatus of any of claims 5 to 7, wherein the memory unit is a DDR unit.
9. An image format conversion device, characterized in that the image format conversion device comprises a processor and a memory, in which at least one computer instruction is stored, which is loaded and executed by the processor to implement the steps performed in the image format conversion method according to any one of claims 1 to 4.
10. A computer-readable storage medium having stored therein at least one computer instruction, which is loaded and executed by a processor, to implement the steps performed in the image format conversion method according to any one of claims 1 to 4.
CN202110208219.0A 2021-02-24 2021-02-24 Image format conversion method, device, equipment and storage medium Pending CN113038108A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110208219.0A CN113038108A (en) 2021-02-24 2021-02-24 Image format conversion method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110208219.0A CN113038108A (en) 2021-02-24 2021-02-24 Image format conversion method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113038108A true CN113038108A (en) 2021-06-25

Family

ID=76461648

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110208219.0A Pending CN113038108A (en) 2021-02-24 2021-02-24 Image format conversion method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113038108A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113554721A (en) * 2021-07-23 2021-10-26 北京百度网讯科技有限公司 Image data format conversion method and device
CN114415951A (en) * 2022-01-04 2022-04-29 平头哥(杭州)半导体有限公司 Image data access unit, method, acceleration unit and electronic equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113554721A (en) * 2021-07-23 2021-10-26 北京百度网讯科技有限公司 Image data format conversion method and device
CN113554721B (en) * 2021-07-23 2023-11-14 北京百度网讯科技有限公司 Image data format conversion method and device
CN114415951A (en) * 2022-01-04 2022-04-29 平头哥(杭州)半导体有限公司 Image data access unit, method, acceleration unit and electronic equipment
CN114415951B (en) * 2022-01-04 2024-04-05 杭州中天微***有限公司 Image data access unit, method, acceleration unit and electronic equipment

Similar Documents

Publication Publication Date Title
US10861133B1 (en) Super-resolution video reconstruction method, device, apparatus and computer-readable storage medium
CN109064399B (en) Image super-resolution reconstruction method and system, computer device and storage medium thereof
CN113038108A (en) Image format conversion method, device, equipment and storage medium
US20100232513A1 (en) Video compression circuit and method thereof
CN111176725B (en) Data processing method, device, equipment and storage medium
US9826237B2 (en) Analytics assisted encoding
TWI526050B (en) Capturing multiple video channels for video analytics and encoding
EP3855754A1 (en) Video processing method and apparatus, electronic device, and storage medium
KR20170113011A (en) Apparatus and method of using a slice update map
JP2007164355A (en) Non-volatile storage device, data reading method therefor, and data writing method therefor
CN110351562A (en) A kind of 10 bit YUV image storage formats
US8548275B2 (en) Image processing device and image processing method
CN104025028B (en) video coding in video analysis
CN108460729A (en) A kind of computer readable storage medium and the Image Reversal device using the medium
KR20050006489A (en) Image processing method and apparatus in image forming system
CN112292660B (en) Method for scheduling data in memory, data scheduling equipment and system
KR20070008516A (en) Method and apparatus for image processing in a handheld device
KR101937718B1 (en) Image Processing Method and Apparatus Using Bus Protocol Based Valid Pixel
KR20190093143A (en) Method and apparatus for generating hdr images with reduced clipped areas
CN117011146B (en) Image scaling method and device, electronic equipment and storage medium
CN114359029B (en) Image processing method, image processing apparatus, image processing system, and storage medium
CN111754387B (en) Image processing method and device
US9179156B2 (en) Memory controller for video analytics and encoding
CN113472944B (en) Voice self-adaptive processing method, device, equipment and storage medium of intelligent terminal
JP7081477B2 (en) Image processing device, control method of image processing device, and program

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