CN110969672A - Image compression method and device - Google Patents

Image compression method and device Download PDF

Info

Publication number
CN110969672A
CN110969672A CN201911113419.7A CN201911113419A CN110969672A CN 110969672 A CN110969672 A CN 110969672A CN 201911113419 A CN201911113419 A CN 201911113419A CN 110969672 A CN110969672 A CN 110969672A
Authority
CN
China
Prior art keywords
image
compressed
compression
vehicle
gpu
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
CN201911113419.7A
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.)
Hangzhou Fabu Technology Co Ltd
Original Assignee
Hangzhou Fabu 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 Hangzhou Fabu Technology Co Ltd filed Critical Hangzhou Fabu Technology Co Ltd
Priority to CN201911113419.7A priority Critical patent/CN110969672A/en
Publication of CN110969672A publication Critical patent/CN110969672A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/005Statistical coding, e.g. Huffman, run length coding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/007Transform coding, e.g. discrete cosine transform

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Discrete Mathematics (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention provides an image compression method and device, which are applied to a Graphic Processing Unit (GPU) in vehicle-mounted equipment, and the method comprises the following steps: receiving an image compression instruction sent by a Central Processing Unit (CPU) in vehicle-mounted equipment, wherein the image compression instruction carries an image to be compressed around a vehicle, which is acquired when the vehicle is unmanned; parallelly operating a compression process of the image to be compressed to generate a compressed image corresponding to the image to be compressed; and sending the compressed image to the CPU so that the CPU sends the compressed image to the server. The image compression method provided by the invention is based on the GPU to carry out image compression, improves the image compression speed, and does not influence the image compression effect.

Description

Image compression method and device
Technical Field
The present invention relates to the field of image processing, and in particular, to an image compression method and apparatus.
Background
In the unmanned system, the requirement for real-time data transmission is high, and further, a higher requirement is placed on the compression speed of an image. Joint Photographic Experts Group (JPEG) is a compression coding standard for still images jointly established by the international organization for standardization (ISO) and the international telex council (CCITT). Due to the extremely high compression rate of JPEG, JPEG is now widely used in the fields of image storage, digital cameras, network multimedia, and the like.
In the prior art, a JPEG compression algorithm technology based on discrete cosine transform can remove redundant image data in a lossy compression manner, thereby obtaining an extremely high compression ratio and simultaneously displaying a very rich and vivid image.
Although both discrete cosine transform and inverse discrete cosine transform based fast algorithms exist, for an unmanned system, the processing speed of the existing JPEG compression algorithm technology is still slow, and the requirement of data transmission real-time property cannot be met.
Disclosure of Invention
The invention provides an image compression method and device, which aim to solve the problem of low image compression speed in the prior art.
The invention provides an image compression method, which is applied to a Graphic Processing Unit (GPU) in vehicle-mounted equipment and comprises the following steps:
receiving an image compression instruction sent by a Central Processing Unit (CPU) in the vehicle-mounted equipment, wherein the image compression instruction carries an image to be compressed around a vehicle, which is acquired when the vehicle is unmanned;
parallelly operating the compression process of the image to be compressed to generate a compressed image corresponding to the image to be compressed;
and sending the compressed image to the CPU so that the CPU sends the compressed image to a server.
In an optional embodiment, the running the compression process of the image to be compressed in parallel includes:
and under the parallel computing architecture of the GPU, the compression process of the image to be compressed is run in parallel by calling an acceleration process library function of the GPU, and a compressed image corresponding to the image to be compressed is generated.
In an optional embodiment, the compression process of the image to be compressed includes: color mode conversion, Discrete Cosine Transform (DCT), quantization and Huffman coding.
In an optional embodiment, the image compression instruction further carries a quantization table and a huffman table of the image to be compressed;
the parallel operation of the compression process of the image to be compressed comprises the following steps:
and according to the quantization table and the Huffman table of the image to be compressed, running the quantization and the Huffman coding in parallel.
In an optional implementation manner, before the receiving the compression instruction sent by the central processing unit CPU, the method further includes:
and initializing the GPU, and reserving a memory required by image compression.
The second aspect of the present invention provides an image compression apparatus, which is applied to a GPU (graphics processing unit) in an in-vehicle device, and the apparatus includes:
the receiving module is used for receiving an image compression instruction sent by a Central Processing Unit (CPU) in the vehicle-mounted equipment, wherein the image compression instruction carries an image to be compressed around the vehicle, which is acquired when the vehicle is in unmanned driving;
the compression module is used for running the compression process of the image to be compressed in parallel and generating a compressed image corresponding to the image to be compressed;
and the sending module is used for sending the compressed image to the CPU so that the CPU sends the compressed image to a server.
In an optional implementation manner, the compression module is specifically configured to, under the parallel computing architecture of the GPU, invoke an acceleration process library function of the GPU to run a compression process of the image to be compressed in parallel, and generate a compressed image corresponding to the image to be compressed.
In an optional embodiment, the compression process of the image to be compressed includes: color mode conversion, Discrete Cosine Transform (DCT), quantization and Huffman coding.
In an optional embodiment, the image compression instruction further carries a quantization table and a huffman table of the image to be compressed;
the compression module is specifically configured to run the quantization and the huffman coding in parallel according to the quantization table and the huffman table of the image to be compressed.
In an optional embodiment, the apparatus further comprises:
and the initialization module is used for initializing the GPU and reserving a memory required by image compression.
A third aspect of the present invention provides an electronic apparatus comprising: a memory and a processor;
the memory for storing executable instructions of the processor;
the processor is configured to perform the method of any of the first aspects via execution of the executable instructions.
A fourth aspect of the present invention provides a storage medium having stored thereon a computer program for executing the method of any one of the first aspects.
The image compression method and the device provided by the invention receive the image compression instruction sent by the CPU, wherein the image compression instruction carries the image to be compressed around the vehicle, which is acquired when the vehicle is unmanned; parallelly operating a compression process of the image to be compressed to generate a compressed image corresponding to the image to be compressed; and sending the compressed image to the CPU so that the CPU sends the compressed image to the server. Because the image compression is carried out based on the GPU, the image compression speed can be improved, and meanwhile, the image compression effect cannot be influenced, so that the transmission rate of the acquired image in the automatic driving process can be improved.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the following briefly introduces the drawings needed to be used in the description of the embodiments or the prior art, and obviously, the drawings in the following description are some embodiments of the present invention, and those skilled in the art can obtain other drawings according to the drawings without inventive labor.
Fig. 1 is a scene schematic diagram of an image compression method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of an image compression method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another image compression method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another image compression method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an image compression apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of another image compression apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. 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 application.
It should be understood that, in the various embodiments of the present application, the size of the serial number of each process does not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
It should be understood that, in this application, "comprises" and "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present application, "B corresponding to a", "a corresponds to B", or "B corresponds to a" means that B is associated with a, from which B can be determined. Determining B from a does not mean determining B from a alone, but may be determined from a and/or other information.
In the unmanned system, the requirement for real-time data transmission is high, and further, a higher requirement is placed on the compression speed of an image. Joint Photographic Experts Group (JPEG) is a compression coding standard for still images jointly established by the international organization for standardization (ISO) and the international telex council (CCITT). Due to the extremely high compression rate of JPEG, JPEG is now widely used in the fields of image storage, digital cameras, network multimedia, and the like.
In the prior art, a JPEG compression algorithm technology based on discrete cosine transform can remove redundant image data in a lossy compression manner, thereby obtaining an extremely high compression ratio and simultaneously displaying a very rich and vivid image. Although both discrete cosine transform and inverse discrete cosine transform based fast algorithms exist, for an unmanned system, the processing speed of the existing JPEG compression algorithm technology is still slow, and the requirement of data transmission real-time property cannot be met.
In view of the foregoing, the present invention provides an image compression method and apparatus, which perform image compression based on a Graphics Processing Unit (GPU), so as to increase the image compression speed without affecting the image compression effect.
Fig. 1 is a scene schematic diagram of an image compression method according to an embodiment of the present application. As shown in fig. 1, when a vehicle 101 is automatically driven, a camera on the vehicle acquires an image of the periphery of the vehicle in real time and sends the image to a server 102, so that a route is planned for the vehicle and an obstacle is avoided. Before the vehicle-mounted terminal sends the acquired image to the server 102, the image needs to be compressed, so that network resources consumed by image transmission are reduced.
It can be understood that the image compression method provided by the embodiment of the present application can be applied not only to the automatic driving scene shown in fig. 1, but also to other scenes requiring image compression, such as real-time monitoring, remote desktop, and the like.
The following takes a GPU with a relevant execution code integrated or installed on a vehicle-mounted device as an example, and details the technical solution of the embodiment of the present application with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 2 is a schematic flowchart of an image compression method according to an embodiment of the present application. The embodiment relates to a specific process of how the GPU in the vehicle-mounted equipment performs image compression. As shown in fig. 2, the method includes:
s201, receiving an image compression instruction sent by a central processing unit CPU in the vehicle-mounted equipment, wherein the image compression instruction carries an image to be compressed around the vehicle, which is acquired when the vehicle is in unmanned driving.
In this step, when the vehicle is unmanned, the image around the vehicle may be acquired in real time as the image to be compressed, and after receiving the image to be compressed around the vehicle, a Central Processing Unit (CPU) may send an image compression instruction to the GPU, where the image compression instruction may carry the image to be compressed around the vehicle acquired when the vehicle is unmanned.
The images to be compressed around the vehicle can be acquired through cameras mounted on the vehicle, for example, the images to be compressed around the vehicle can be mounted on the cameras in four directions of the front, the back, the left and the right of the vehicle, when the vehicle is in unmanned driving, the images to be compressed around the vehicle are collected in real time and sent to the CPU, and after the images to be compressed sent by the cameras are received by the CPU, image compression instructions can be sent to the CPU.
S202, a compression process of the image to be compressed is executed in parallel, and a compressed image corresponding to the image to be compressed is generated.
In this step, after receiving the image compression instruction sent by the CPU, the GPU may run the compression process of the image to be compressed in parallel, thereby accelerating the compression process of the image to be compressed and generating a compressed image corresponding to the image to be compressed.
The compression process of the image to be compressed may include: color mode conversion, Discrete Cosine Transform (DCT), quantization, and huffman coding.
In some embodiments, the GPU may execute a compression process of the image to be compressed in parallel by calling an acceleration process library function of the GPU under a parallel computing architecture of the GPU, and generate a compressed image corresponding to the image to be compressed.
The parallel computing architecture of the GPU comprises a plurality of threads, wherein one thread is a single instruction stream in a program, and the threads form a parallel computing grid. The parallel computing grid is formed by a plurality of stream processors, each of which comprises n blocks. Compared with the parallel computation of a CPU, the parallel computation of the GPU can process larger task amount, the switching speed between threads is higher, and the switching-in and switching-out can be performed quickly when the threads are blocked. The GPU-based parallel computing architecture may speed up image compression rates.
The acceleration process library function of the GPU may be, for example, a performance primitive library (NPP), which is a library function having an acceleration process function for images and videos.
In some embodiments, the image compression process by the GPU may conform to the compression coding standard of JPEG. Among them, JPEG has a function of adjusting image quality, which allows a file to be compressed at different compression ratios, the compression ratio is usually between 10:1 and 40:1, and the quality is lower when the compression ratio is larger; conversely, the smaller the compression ratio, the better the quality.
S203, the compressed image is sent to the CPU, so that the CPU sends the compressed image to the server.
In this step, after the GPU completes compression of the image to be compressed, the GPU may send the compressed image to the CPU. When the vehicle is unmanned, the CPU may send the compressed image to the server, so that the server plans the course of the vehicle or controls the vehicle to avoid obstacles.
In some embodiments, after the CPU receives the compressed pictures sent by the GPU, the CPU may further store the compressed pictures in a memory of the in-vehicle terminal, or may further process the compressed pictures, for example, sort the compressed pictures in a time sequence, and the like.
In the application, the image compression speed based on the GPU is greatly increased, and correspondingly, the image transmission rate can be increased, so that the server can timely acquire images around the vehicle when the vehicle is unmanned. Compared with the prior art, the acceleration is realized by using the NPP through the GPU, and compared with the traditional libjpeg library compressed by using the CPU, the dependency on the computing power of the CPU is reduced, the processing speed is greatly improved, and meanwhile, the JPEG compression result is not influenced. In addition, the method also has the function of adjusting the image quality.
According to the image compression method provided by the embodiment of the application, an image compression instruction sent by a Central Processing Unit (CPU) in vehicle-mounted equipment is received, and the image compression instruction carries an image to be compressed around a vehicle, which is acquired when the vehicle is unmanned; parallelly operating a compression process of the image to be compressed to generate a compressed image corresponding to the image to be compressed; and sending the compressed image to the CPU so that the CPU sends the compressed image to the server. Because the image compression is carried out based on the GPU, the image compression speed can be improved, and meanwhile, the image compression effect cannot be influenced, so that the transmission rate of the acquired image in the automatic driving process can be improved.
On the basis of the above embodiments, compressing an image may include a plurality of compression processes, and the following takes quantization and huffman coding as an example to specifically describe an image compression method. Fig. 3 is a schematic flowchart of another image compression method according to an embodiment of the present application. The embodiment relates to a specific process of how a GPU in vehicle-mounted equipment runs a compression process in parallel. As shown in fig. 3, on the basis of the above embodiment, the method includes:
s301, receiving an image compression instruction sent by a central processing unit CPU in the vehicle-mounted equipment, wherein the image compression instruction carries an image to be compressed around the vehicle, which is acquired when the vehicle is unmanned, and the image compression instruction also carries a quantization table and a Huffman table of the image to be compressed.
Technical terms, technical effects, technical features and optional embodiments of step S301 can be understood with reference to step S201 shown in fig. 2, and repeated contents will not be described herein.
S302, according to the quantization table and the Huffman table of the image to be compressed, quantization and Huffman coding are operated in parallel.
In this step, after receiving the image compression instruction, the GPU runs quantization of image compression according to the quantization table if the image compression instruction includes the quantization table and the huffman table of the image to be compressed, and runs huffman coding of image compression in parallel according to the huffman table.
The quantization table may be a JPEG standard quantization table, and may be preset according to human visual perception. In the image compression process, after a pixel to be coded is predicted by predictive coding, a quantization process is required, that is, a predicted residual error process is quantized according to a quantization table.
The Huffman table is encoded as follows: (1) sequencing the information source symbols according to a probability sequence; (2) adding the two smallest probabilities as the probability of the new symbol; (3) repeating the steps (1) and (2) until the probability sum reaches 1; (4) assigning the merged messages to 1 and 0 or 0 and 1 each time the messages are merged; (5) searching a path from each information source symbol to a position with the probability of 1, and recording 1 and 0 on the path; (6) a sequence of "1" and "0" is written for each symbol.
The Huffman table is formed when the Huffman coding is carried out on the information source, the Huffman table must be stored and transmitted firstly in the storage and transmission processes of the information source, and the bit number occupied by the Huffman table needs to be considered when the compression effect is calculated.
In some embodiments, the image compression process may also include color mode conversion and DCT. The color mode conversion is to convert the RGB color model into an optimized color video signal (YCrCb) color model. The RGB color model is to decompose the color into three components of red, green and blue, so that one image can be decomposed into three grayscale images. The YCrCb color model, namely the YUV color model, is mainly used for optimizing the transmission of color video signals. Wherein "Y" represents brightness (luma) or gray scale, and "U" and "V" represent Chroma (Chroma or Chroma) for specifying the color of the pixel.
In the color mode conversion process, each pixel point in the image can be independently calculated and is realized by parallel acceleration of the GPU. The DCT can separate the data in the image into two parts, a dc component and an ac component, which provides sufficient padding for further compression.
And S303, sending the compressed image to a CPU (central processing unit) so that the CPU sends the compressed image to a server.
The technical terms, technical effects, technical features and optional embodiments of step S303 can be understood by referring to step S203 shown in fig. 2, and repeated contents will not be described herein.
According to the image compression method provided by the embodiment of the application, an image compression instruction sent by a Central Processing Unit (CPU) in vehicle-mounted equipment is received, and the image compression instruction carries an image to be compressed around a vehicle, which is acquired when the vehicle is unmanned; parallelly operating a compression process of the image to be compressed to generate a compressed image corresponding to the image to be compressed; and sending the compressed image to the CPU so that the CPU sends the compressed image to the server. Because the image compression is carried out based on the GPU, the image compression speed can be improved, and meanwhile, the image compression effect cannot be influenced, so that the transmission rate of the acquired image in the automatic driving process can be improved.
On the basis of the above embodiments, before performing image compression, the GPU needs to be initialized, and the initialization of the GPU is described below. Fig. 4 is a schematic flowchart of another image compression method according to an embodiment of the present application. As shown in fig. 4, on the basis of the above embodiment, the method includes:
s401, initializing the GPU, and reserving a memory required by image compression.
In this step, before compressing the image, the GPU needs to be initialized, and the memory required by the GPU (Device end) to run the image compression program is determined, so as to reserve the required memory for image compression.
In some implementations, the CPU may also be initialized to determine the memory line required by the CPU (Host side) to run the image compression program, thereby reserving the memory required for image compression reservation at the CPU as well.
S402, receiving an image compression instruction sent by a Central Processing Unit (CPU) in the vehicle-mounted equipment, wherein the image compression instruction carries an image to be compressed around the vehicle, which is acquired when the vehicle is unmanned;
s403, running a compression process of the image to be compressed in parallel to generate a compressed image corresponding to the image to be compressed;
s404, sending the compressed image to a CPU (central processing unit) so that the CPU sends the compressed image to a server.
The technical terms, technical effects, technical features, and alternative embodiments of steps S402-S404 can be understood with reference to steps S201-S203 shown in fig. 2, and repeated content will not be described herein.
According to the image compression method provided by the embodiment of the application, an image compression instruction sent by a Central Processing Unit (CPU) in vehicle-mounted equipment is received, and the image compression instruction carries an image to be compressed around a vehicle, which is acquired when the vehicle is unmanned; parallelly operating a compression process of the image to be compressed to generate a compressed image corresponding to the image to be compressed; and sending the compressed image to the CPU so that the CPU sends the compressed image to the server. Because the image compression is carried out based on the GPU, the image compression speed can be improved, and meanwhile, the image compression effect cannot be influenced, so that the transmission rate of the acquired image in the automatic driving process can be improved.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Fig. 5 is a schematic structural diagram of an image compression apparatus according to an embodiment of the present application. The image compression device may be implemented by software, hardware or a combination of the two, and may be the GPU in the aforementioned vehicle-mounted device.
As shown in fig. 5, the image compression apparatus includes:
the receiving module 501 is configured to receive an image compression instruction sent by a central processing unit CPU in the vehicle-mounted device, where the image compression instruction carries an image to be compressed around a vehicle, which is acquired when the vehicle is unmanned;
the compression module 502 is configured to run a compression process of an image to be compressed in parallel, and generate a compressed image corresponding to the image to be compressed;
a sending module 503, configured to send the compressed image to the CPU, so that the CPU sends the compressed image to the server.
In an optional implementation manner, the compression module 502 is specifically configured to execute a compression process of an image to be compressed in parallel by calling an acceleration process library function of the GPU under a parallel computing architecture of the GPU, and generate a compressed image corresponding to the image to be compressed.
In an alternative embodiment, the compression process of the image to be compressed includes: color mode conversion, Discrete Cosine Transform (DCT), quantization and Huffman coding.
In an alternative embodiment, the image compression instruction further carries a quantization table and a huffman table of the image to be compressed;
the compressing module 502 is specifically configured to run quantization and huffman coding in parallel according to a quantization table and a huffman table of an image to be compressed.
In an alternative embodiment, the apparatus further comprises:
the initialization module 504 is configured to initialize the GPU and reserve a memory required for image compression.
The image compression device provided in the embodiment of the present application can execute the actions of the GPU in the above method embodiments, and the implementation principle and technical effect are similar, which are not described herein again.
Fig. 6 is a schematic structural diagram of another image compression apparatus according to an embodiment of the present application. As shown in fig. 6, the image compression apparatus may include: at least one processor 61 and a memory 62. Fig. 6 shows an electronic device as an example of a processor.
And a memory 62 for storing programs. In particular, the program may include program code including computer operating instructions.
The memory 62 may comprise high-speed RAM memory and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
Processor 61 is operative to execute computer-executable instructions stored by memory 62 to implement an information query method.
The processor 61 may be a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement the embodiments of the present Application.
Alternatively, in a specific implementation, if the communication interface, the memory 62 and the processor 61 are implemented independently, the communication interface, the memory 62 and the processor 61 may be connected to each other through a bus and perform communication with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. Buses may be classified as address buses, data buses, control buses, etc., but do not represent only one bus or type of bus.
Alternatively, in a specific implementation, if the communication interface, the memory 62 and the processor 61 are integrated into a chip, the communication interface, the memory 62 and the processor 61 may complete communication through an internal interface.
The present invention also provides a computer-readable storage medium, which may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and in particular, the computer-readable storage medium stores program instructions, and the program instructions are used in the method in the foregoing embodiments.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. An image compression method is applied to a Graphics Processing Unit (GPU) in vehicle-mounted equipment, and comprises the following steps:
receiving an image compression instruction sent by a Central Processing Unit (CPU) in the vehicle-mounted equipment, wherein the image compression instruction carries an image to be compressed around a vehicle, which is acquired when the vehicle is unmanned;
parallelly operating the compression process of the image to be compressed to generate a compressed image corresponding to the image to be compressed;
and sending the compressed image to the CPU so that the CPU sends the compressed image to a server.
2. The method according to claim 1, wherein the parallel execution of the compression process of the image to be compressed comprises:
and under the parallel computing architecture of the GPU, the compression process of the image to be compressed is run in parallel by calling an acceleration process library function of the GPU, and a compressed image corresponding to the image to be compressed is generated.
3. The method according to claim 1, wherein the compression process of the image to be compressed comprises: color mode conversion, Discrete Cosine Transform (DCT), quantization and Huffman coding.
4. The method of claim 3, wherein the image compression instruction further carries a quantization table and a Huffman table of the image to be compressed;
the parallel operation of the compression process of the image to be compressed comprises the following steps:
and according to the quantization table and the Huffman table of the image to be compressed, running the quantization and the Huffman coding in parallel.
5. The method according to any of claims 1-4, wherein before said receiving a compression instruction sent by a Central Processing Unit (CPU), further comprising:
and initializing the GPU, and reserving a memory required by image compression.
6. An image compression apparatus, applied to a Graphics Processor (GPU) in an in-vehicle device, the apparatus comprising:
the receiving module is used for receiving an image compression instruction sent by a Central Processing Unit (CPU) in the vehicle-mounted equipment, wherein the image compression instruction carries an image to be compressed around the vehicle, which is acquired when the vehicle is in unmanned driving;
the compression module is used for running the compression process of the image to be compressed in parallel and generating a compressed image corresponding to the image to be compressed;
and the sending module is used for sending the compressed image to the CPU so that the CPU sends the compressed image to a server.
7. The apparatus according to claim 6, wherein the compression module is specifically configured to, under a parallel computing architecture of the GPU, generate a compressed image corresponding to the image to be compressed by invoking an accelerated process library function of the GPU to run a compression process of the image to be compressed in parallel.
8. The apparatus of any of claims 6-7, further comprising:
and the initialization module is used for initializing the GPU and reserving a memory required by image compression.
9. An electronic device, comprising: a memory and a processor;
the memory for storing executable instructions of the processor;
the processor is configured to perform the method of any of claims 1-5 via execution of the executable instructions.
10. A storage medium having a computer program stored thereon, comprising: the program, when executed by a processor, implements the method of any of claims 1-5.
CN201911113419.7A 2019-11-14 2019-11-14 Image compression method and device Pending CN110969672A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911113419.7A CN110969672A (en) 2019-11-14 2019-11-14 Image compression method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911113419.7A CN110969672A (en) 2019-11-14 2019-11-14 Image compression method and device

Publications (1)

Publication Number Publication Date
CN110969672A true CN110969672A (en) 2020-04-07

Family

ID=70030669

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911113419.7A Pending CN110969672A (en) 2019-11-14 2019-11-14 Image compression method and device

Country Status (1)

Country Link
CN (1) CN110969672A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114245173A (en) * 2021-12-17 2022-03-25 中国平安财产保险股份有限公司 Image compression method, device, terminal equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101415117A (en) * 2008-11-18 2009-04-22 浙江大学 Transmission method for high presence image based on GPGPU
CN105678680A (en) * 2015-12-30 2016-06-15 魅族科技(中国)有限公司 Image processing method and device
CN109391816A (en) * 2018-10-26 2019-02-26 大连理工大学 The method for parallel processing of HEVC medium entropy coding link is realized based on CPU+GPU heterogeneous platform
CN109741456A (en) * 2018-12-17 2019-05-10 深圳市航盛电子股份有限公司 3D based on GPU concurrent operation looks around vehicle assistant drive method and system
CN109842803A (en) * 2018-09-19 2019-06-04 华为技术有限公司 A kind of method and device of compression of images

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101415117A (en) * 2008-11-18 2009-04-22 浙江大学 Transmission method for high presence image based on GPGPU
CN105678680A (en) * 2015-12-30 2016-06-15 魅族科技(中国)有限公司 Image processing method and device
CN109842803A (en) * 2018-09-19 2019-06-04 华为技术有限公司 A kind of method and device of compression of images
CN109391816A (en) * 2018-10-26 2019-02-26 大连理工大学 The method for parallel processing of HEVC medium entropy coding link is realized based on CPU+GPU heterogeneous platform
CN109741456A (en) * 2018-12-17 2019-05-10 深圳市航盛电子股份有限公司 3D based on GPU concurrent operation looks around vehicle assistant drive method and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
伊小素;刘婧;王明;: "车载通信系统中JPEG压缩算法的量化表改进" *
张敏华等: "基于OpenCL的JPEG压缩算法并行化设计与实现" *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114245173A (en) * 2021-12-17 2022-03-25 中国平安财产保险股份有限公司 Image compression method, device, terminal equipment and storage medium
CN114245173B (en) * 2021-12-17 2023-04-25 中国平安财产保险股份有限公司 Image compression method, device, terminal equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110381322B (en) Video stream decoding method and device, terminal equipment and storage medium
CN111681167B (en) Image quality adjusting method and device, storage medium and electronic equipment
US10110936B2 (en) Web-based live broadcast
US20170302978A1 (en) Video coding method, system and server
EP3410302B1 (en) Graphic instruction data processing method, apparatus
CN107665128B (en) Image processing method, system, server and readable storage medium
CN116803082A (en) Device and method for point cloud processing
WO2023132919A1 (en) Scalable framework for point cloud compression
CN110545432A (en) image encoding and decoding methods, related devices and storage medium
CN114339412A (en) Video quality enhancement method, mobile terminal, storage medium and device
CN110969672A (en) Image compression method and device
CN115225881A (en) Data transmission method, device, equipment and storage medium
CN111246208B (en) Video processing method and device and electronic equipment
CN111225214B (en) Video processing method and device and electronic equipment
CN108668170B (en) Image information processing method and device, and storage medium
CN113613024B (en) Video preprocessing method and device
CN110891195A (en) Method, device and equipment for generating screen image and storage medium
CN113766319A (en) Image information processing method and device, and storage medium
CN113996056A (en) Data sending and receiving method of cloud game and related equipment
CN114694007A (en) Video structuring processing method and video structuring engine
CN111314701A (en) Video processing method and electronic equipment
US12003743B2 (en) Video stream decoding method and apparatus, terminal device, and storage medium
JP3839054B2 (en) Method for encoding an image in a transmission unit
US12003732B2 (en) Scene aware video content encoding
CN117412064A (en) Video decoding method, device, electronic equipment and computer storage medium

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