CN111406404B - Compression method, decompression method, system and storage medium for obtaining video file - Google Patents

Compression method, decompression method, system and storage medium for obtaining video file Download PDF

Info

Publication number
CN111406404B
CN111406404B CN201980005157.4A CN201980005157A CN111406404B CN 111406404 B CN111406404 B CN 111406404B CN 201980005157 A CN201980005157 A CN 201980005157A CN 111406404 B CN111406404 B CN 111406404B
Authority
CN
China
Prior art keywords
image data
color
image
pixel
video file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201980005157.4A
Other languages
Chinese (zh)
Other versions
CN111406404A (en
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.)
Shanghai Uhdvision Technology Co ltd
Original Assignee
Shanghai Uhdvision 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 Shanghai Uhdvision Technology Co ltd filed Critical Shanghai Uhdvision Technology Co ltd
Publication of CN111406404A publication Critical patent/CN111406404A/en
Application granted granted Critical
Publication of CN111406404B publication Critical patent/CN111406404B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/186Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/182Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder

Abstract

The application relates to the technical field of image processing, in particular to a compression method, a decompression method, a system and a storage medium for obtaining a video file, which comprises the following steps: acquiring a plurality of image data to be compressed according to a time sequence; respectively mapping color values of all pixels in each image data to all pixel positions in a plurality of image blocks based on color attributes of all pixels in the image data; and compressing image blocks which correspond to each image data in the plurality of image data and have the same color attribute to obtain a video file. The scheme provided by the application can effectively reduce the code stream and ensure high fidelity image quality at the same time. Since the compression method in the present application can effectively reduce the data amount, the encoding of 8K video can be performed by a 4K encoder in the prior art. The uplink stable peak value between the current 5G is 90Mbps, so that the 5G real-time transmission of 8K videos can be realized, and meanwhile, high-fidelity image quality is achieved.

Description

Compression method, decompression method, system and storage medium for obtaining video file
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a compression method, a decompression method, a system, and a storage medium for obtaining a video file.
Background
With the increasing playing quality of multimedia playing data, the data volume of multimedia playing data is also increasing. For multimedia playing data with large data volume, after the multimedia playing data is compressed and coded by adopting a traditional mode, the data volume still can not be controlled within a range capable of being stably transmitted. In order to stably transmit multimedia playing data, usually, multimedia playing data can only be further compressed, but this method can cause color information to be seriously lost, and cannot meet the requirement of high image quality. Therefore, it is desirable to have a better compression method to achieve the effect of high fidelity to multimedia playing data with large data volume while ensuring the transmission stability.
Disclosure of Invention
In view of the above-mentioned shortcomings of the prior art, the present application aims to provide a compression method, a decompression method, a system and a storage medium for obtaining a video file, which are used for solving the problem of difficulty in transmission of ultra-high-definition video data in the prior art.
To achieve the above and other related objects, a first aspect of the present application provides a compression method for obtaining a video file, comprising the steps of: acquiring a plurality of pieces of image data to be compressed according to a time sequence; the image data is used to display video images of pixels UHD4K and above; respectively mapping color values of all pixels in each image data to all pixel positions in a plurality of image blocks based on color attributes of all pixels in the image data; and compressing image blocks which correspond to each image data in the plurality of image data and have the same color attribute to obtain a video file.
In certain embodiments of the first aspect of the present application, in a case that each pixel in the image data represents a single color attribute, the step of mapping the color value of each pixel in each image data to each pixel position in the plurality of image blocks respectively based on the color attribute of each pixel in the image data comprises: traversing the image data in a color format set based on a Bayer format in the image data; during traversal, extracting a color value of each pixel from the image data based on the color attribute of each pixel in the color format, and mapping to a pixel position in a corresponding image block.
In certain embodiments of the first aspect of the present application, where each pixel in the image data represents RGB color attributes; the step of mapping the color value of each pixel in each image data to each pixel position in the plurality of image blocks based on the color attribute of each pixel in the image data includes: traversing the image data in a color format set based on a pixel row format in the image data; wherein, during traversal, based on the color attribute of each pixel in the color format, a color principal component or a color fitting component of each pixel is extracted from the image data and mapped to a pixel position in the corresponding image block.
In certain embodiments of the first aspect of the present application, the compressing image blocks corresponding to each of the plurality of image data and having the same color attribute includes: and sequentially inputting a plurality of image blocks corresponding to the plurality of image data into a first encoder for compression processing according to the color attributes in the color format.
In certain embodiments of the first aspect of the present application, the compressing image blocks corresponding to each of the plurality of image data and having the same color attribute includes: and under synchronous control, a plurality of second encoders are used for respectively compressing a plurality of image blocks with the same color attribute.
In certain embodiments of the first aspect of the present application, the video file resulting from the compression process using the plurality of second encoders includes synchronization information provided for decompressing the video file to recover the plurality of image data.
The second aspect of the present application further provides a method for decompressing a video file, including: acquiring a video file; decompressing the video file according to the compression mode used by the corresponding video file to obtain a plurality of image blocks; the obtained image blocks correspond to each image data in the image data to be generated according to the color attributes of the image blocks; mapping the color value of each pixel position in each corresponding image block to the pixel of the image data according to the color attribute; and generating a video image for displaying the UHD4K and above pixels based on the color value of each pixel in the image data.
In some embodiments of the second aspect of the present application, the decompressing the video file according to the compression method to obtain a plurality of image blocks includes: under the synchronous control, a plurality of second decoders are used for respectively decompressing the video files according to the color attributes; wherein each second decoder outputs a plurality of image blocks having the same color attribute; wherein each image block corresponds to an image data to be generated.
In certain embodiments of the second aspect of the present application, each second decoder determines a correspondence between the decompressed plurality of image blocks and the image data to be generated according to synchronization information in the video file.
In some embodiments of the second aspect of the present application, the decompressing the video file according to the compression method to obtain a plurality of image blocks includes: decompressing the received video file by using a first decoder to obtain a plurality of groups of image blocks divided according to different color attributes in a color format; each image block in each group of image blocks corresponds to image data to be generated.
In some embodiments of the second aspect of the present application, the mapping color values of pixel positions in respective image blocks into pixels of image data according to color attributes includes: traversing pixel positions in the image blocks of each color attribute according to the color format, and mapping color values of corresponding pixel positions in each image block to the pixel positions in the corresponding image data during traversal to generate image data; wherein the color value of each pixel location in the image data represents a single color attribute.
In certain embodiments of the second aspect of the present application, the step of generating a video image for displaying the UHD4K and above pixels based on the color values of the pixels mapped in the image data further includes: and according to the color format, performing interpolation processing on each pixel position in the obtained image data to obtain a video image containing RGB color attributes in each pixel.
The third aspect of the present application also provides a compression apparatus comprising: a communication interface for communication connection with an external decompression device; a memory for storing at least one program and image data to be compressed; and a processor, configured to coordinate the communication interface and the memory to execute the program, during which the image data is compressed according to the method for compressing a video file described in any of the first aspects of the present application, so as to obtain the video file.
The fourth aspect of the present application also provides a decompression apparatus, comprising: the communication interface is used for being in communication connection with external compression equipment; a memory for storing at least one program and a video file to be decompressed; a processor for coordinating the communication interface and the memory to execute the program, and during the execution, performing the decompression processing on the video file according to the video file decompression method according to any one of the second aspect of the present application, so as to play the video file.
A fifth aspect of the present application also provides a video transmission system, including: a compression apparatus as described in the third aspect of the present application; and a decompression apparatus as claimed in the fourth aspect of the present application.
A sixth aspect of the present application also provides a computer-readable storage medium comprising: at least one program is stored; the at least one program, when invoked, performs the method of obtaining a compression of a video file as described in any of the first aspects of the present application; alternatively, the at least one program, when invoked, performs a method of decompressing a video file as described in any of the second aspects of the present application.
As described above, the compression method, decompression method, system and storage medium for obtaining video files according to the present application have the following advantages: the compression method, the decompression method, the system and the storage medium for obtaining the video file can effectively reduce the code stream and ensure high-fidelity image quality. In the application, the data size of the added image blocks is far lower than that of the compressed image blocks obtained by the traditional method. Wherein, compared with YUV222 format, the data size is only half of that; compared with the YUV444 format, the data size is only 1/3, but the information amount carried by the compression method of the application is equivalent to that of the YUV444 format. Taking 8K video as an example, the image block of each color attribute is equivalent to the YUV400 format of 4K video with only luminance information, and the data amount is only half of that compared with the YUV422 format. Since the compression method in the present application can effectively reduce the data amount, the encoding of 8K video can be performed by a 4K encoder in the prior art. Similarly, according to the compression method of the present application, 4K video may be encoded by a 2K video encoder, or 16K video may be encoded by an 8K video encoder. Moreover, the compression method can directly utilize the RGB video image or the Bayer format image for compression without converting the RGB video image or the Bayer format image into YUV format. In addition, the code flow rate generated by the compression method can be controlled to be about half of YUV422, namely 24-80 Mbps, and the up stable peak value between the current 5G is 90Mbps, so that 8K video can be transmitted in real time by 5G, and meanwhile, high-fidelity image quality is achieved.
Drawings
FIG. 1 is a flow chart of a compression method in one embodiment of the present application;
FIG. 2 is a schematic diagram of image data in one embodiment of the present application;
fig. 3 is a schematic diagram illustrating an exemplary mapping method for mapping color values of pixels in each image data to pixel positions in a plurality of image blocks according to the present application;
FIG. 4 shows a schematic diagram of an embodiment of representing RGB color attributes for each pixel in image data in the present application;
FIG. 5 is a schematic diagram illustrating another embodiment of a mapping method for mapping color values of pixels in each image data to pixel positions in a plurality of image blocks according to the present application;
FIG. 6 is a schematic diagram of an embodiment of a compression process using a first encoder according to the present application;
FIG. 7 is a schematic diagram of another embodiment of the present application in which a first encoder is used for compression;
FIG. 8 shows a schematic diagram of another embodiment of representing RGB color attributes for each pixel in image data in the present application;
fig. 9 is a schematic diagram of another embodiment of the present application when the compression device does not know the principal component in each pixel in advance;
fig. 10 is a schematic diagram illustrating an embodiment of a mapping method for mapping color values of pixels in each image data to pixel positions in a plurality of image blocks when a compression device in the present application does not know a principal component in each pixel in advance;
fig. 11 is a schematic diagram of another embodiment of the present application when the compression device does not know the principal component in each pixel in advance;
fig. 12 is a schematic diagram illustrating another embodiment of a mapping method for mapping color values of pixels in each image data to pixel positions in a plurality of image blocks when a compression device does not know a principal component in each pixel in advance in the present application;
fig. 13 is a schematic diagram showing another embodiment of the present application when the compression apparatus does not know the principal component in each pixel in advance;
fig. 14 is a schematic diagram illustrating another embodiment of a mapping method for mapping color values of pixels in each image data to pixel positions in a plurality of image blocks when a compression device in the present application does not know a principal component in each pixel in advance.
FIG. 15 is a flow diagram illustrating an embodiment of the decompression method;
FIG. 16 is a schematic diagram of an embodiment of a decompression process performed by a first decoder;
FIG. 17 is a schematic diagram of another embodiment of a decompression process performed by a first decoder;
FIG. 18 is a schematic diagram illustrating an embodiment of a decompression apparatus mapping color values of pixel locations in corresponding image blocks to pixels in image data according to the present application;
FIG. 19 is a schematic diagram of an embodiment of a compression apparatus of the present application;
fig. 20 is a schematic diagram of an embodiment of a decompression apparatus in the present application;
fig. 21 is a schematic structural diagram of a video transmission system according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application is provided for illustrative purposes, and other advantages and capabilities of the present application will become apparent to those skilled in the art from the present disclosure.
Although the terms first, second, etc. may be used herein to describe various elements in some instances, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first decoder may be referred to as a second decoder, and similarly, a second decoder may be referred to as a first decoder, without departing from the scope of the various described embodiments. The first decoder and decoder are both describing a threshold, but they are not the same decoder unless the context clearly indicates otherwise.
Also, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It will be further understood that the terms "comprises," "comprising," "includes" and/or "including," when used in this specification, specify the presence of stated features, steps, operations, elements, components, items, species, and/or groups, but do not preclude the presence, or addition of one or more other features, steps, operations, elements, components, species, and/or groups thereof. The terms "or" and/or "as used herein are to be construed as inclusive or meaning any one or any combination. Thus, "A, B or C" or "A, B and/or C" means "any of the following: a; b; c; a and B; a and C; b and C; A. b and C ". An exception to this definition will occur only when a combination of elements, functions, steps or operations are inherently mutually exclusive in some way.
With the increasing requirements of users on the playing quality of multimedia playing data, for example, in scenes such as program live broadcasting, video conference, or security monitoring, technicians need to transmit multimedia playing data with better stability and higher fidelity rate. However, as the playing quality of multimedia playing data is higher and higher, the data volume of the multimedia playing data is also larger and larger. For multimedia playing data with large data volume, the code stream obtained by compressing and encoding the multimedia playing data in a traditional way is also large, and usually, an RGB image needs to be compressed and encoded after being converted into a YUV format. Taking 30 frames 8K as an example, if YUV444 format is taken as an example, the data volume reaches 7680 × 4320 × 24 bits × 30fps ≈ 3GByte/s, and if YUV422 format is taken, although half of the color component is lost, the data volume still reaches 2 Gbyte/s. Under the data volume, if the mode in the prior art is adopted for compression coding, the code stream is 48-160 Mbps, and even if the latest 5G technology is adopted, the requirement of stable transmission cannot be met because the average value of the uplink speed peak values of the 5G CPE is 80-90 Mbps. On the other hand, in some embodiments, the compression of multimedia playing data mostly adopts YUV422 or YUV420 format, and the color information is seriously lost, which cannot meet the requirement of high image quality. People expect to have a better compression method, and can realize the effect of high fidelity under the condition of low code rate for multimedia playing data with large data volume.
Therefore, the application provides a compression method for obtaining a video file to solve the problems and enable the high-definition video to be played more smoothly and with higher fidelity. The compression method is mainly completed by a compression device of the image, wherein the compression device can be a terminal device or a server. Here, the terminal apparatus includes, but is not limited to, an image pickup apparatus, an electronic terminal apparatus for personal use, and the like.
It should be understood that the image pickup apparatus includes an image pickup device, a storage device, a processing device, and may further include an interface device, and the like. The image pickup device is configured to acquire image data composed of a plurality of paths of image data set based on colors. The image pickup apparatus at least includes a lens formed by a lens group, a light sensing device, and the like, wherein the light sensing device includes a CCD device, a CMOS device, and the like, for example. The storage may include high speed random access memory and may also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other non-volatile solid state storage devices. The storage device also includes a memory controller that can control access to the memory by other components of the device, such as the CPU and peripheral interfaces. The storage device is used for storing at least one program and image data to be encoded. Programs stored in the storage device include an operating system, a communications module (or set of instructions), a graphics module (or set of instructions), a text input module (or set of instructions), and an application (or set of instructions). The program in the storage device also includes a set of instructions for performing encoding operations on image data in a time sequence based on the solution provided by the compression method. The processing means include, but are not limited to: a CPU, a GPU, an FPGA (Field-Programmable Gate Array), an ISP (Image Signal Processing chip), or other Processing chip (e.g., AI dedicated chip) including at least one program dedicated to Processing stored in the storage device. The processing device calls and executes at least one program stored in the storage device to perform compression processing on the stored image data according to the compression method. The interface devices include, but are not limited to: a data line interface and a network interface; the data line interface comprises at least one of the following: a serial interface such as USB, a bus interface capable of parallel interfacing, etc. Examples of network interfaces include at least one of: such as a network interface based on a bluetooth protocol, a WiFi network interface, etc., a wireless network interface based on a 3G, 4G, or 5G protocol, such as a wired network interface including a network card, etc. In some scenes, the camera device is arranged on a holder above a road and used for monitoring vehicle violation, such as speeding, running a red light and the like. In other scenarios, the camera is configured on a minimally invasive medical device, and the camera is arranged at the front end of the hose through an optical fiber or other special data line. In other scenes, the camera device is configured on a track moving at a high speed in a stadium and is used for shooting high-definition pictures of the competitive game.
It should be understood that the electronic terminal devices used by the individuals include desktop computers, notebook computers, tablet computers, splicing devices dedicated to making television programs, movies, television shows, and the like. The electronic terminal equipment comprises a storage device and a processing device. The storage means and the processing means may be the same as or similar to the corresponding means in the aforementioned image pickup apparatus, and will not be described in detail here. The electronic terminal equipment can also comprise a camera device for shooting image data. Here, in some examples, the hardware and software modules of the image pickup apparatus may be the same as or similar to the corresponding apparatuses in the aforementioned image pickup apparatus, and are not repeated here. In still other examples, the electronic terminal device may further include an image acquisition interface for acquiring image data. The image acquisition interface may be a network interface, a data line interface, or a program interface. The network interface and the data line interface may be the same as or similar to corresponding devices in the aforementioned image pickup apparatus, and are not described in detail herein. For example, the processing device of the electronic terminal device downloads image data from the internet through the network interface. For another example, with the aid of the program interface, the processing device of the electronic terminal device obtains image data displayed on the display screen by the drawing software. The drawing software is, for example, PS software or screen capture software. For another example, the processing device of the electronic terminal device obtains one frame of image data in the high-definition video without clipping processing from the storage device through the data line interface.
The server includes, but is not limited to, a single server, a server cluster, a distributed server, a server based on cloud technology, and the like. The server comprises a storage device, a processing device, an image acquisition interface and the like. The storage device and the processing device can be configured in the same entity server equipment or configured in a plurality of entity server equipment according to the division of the work of each entity server equipment. The image acquisition interface may be a network interface, or a data line interface. The storage means, processing means, image acquisition interface, and the like included in the server may be the same as the corresponding means mentioned in the aforementioned terminal device; or each corresponding device for a server that is specifically set based on the throughput, processing power, storage requirements of the server. For example, the storage device may also include a solid state disk or the like. For example, the processing device may also include a CPU or the like dedicated to the server. An image acquisition interface in the server acquires image data and coding instructions from the Internet, and a processing device executes the compression method on the acquired image data based on the coding instructions.
The video file may be stored in a storage medium, or may be transmitted to a compression device using a communication transmission method of 60Mbps or more. Wherein, the transmission modes include but are not limited to: wireless transmission mode based on 5G communication protocol, or optical fiber transmission.
Based on the requirements for compression encoding of image data generated in any of the above scenarios, the present application provides a compression method for obtaining a video file, please refer to fig. 1, which is a flowchart illustrating the compression method in an embodiment.
In step S110, a plurality of image data to be compressed are acquired in time order; the image data is used to display video images of pixels UHD4K and above.
Wherein the image data includes, but is not limited to: ultra high definition images (such as 4K images or 8K images), and images that have been compressed and decompressed. For example, the image data is a high-definition image derived from an original video captured by a high-definition camera. In another example, the image data is a high-definition image transmitted through a dedicated data channel. As another example, the image data is an image that originates from the internet and needs to be re-encoded. The format of the image data may be a Bayer format, or an RGB image generated by Debayer, or a YUV format, etc. For example, the image data is a Bayer format generated directly by a sensor of a high-definition camera. For another example, a Bayer format generated by a sensor of a high-definition camera is subjected to Debayer, that is, two other color components are fitted to a color component of each pixel in the Bayer format, thereby generating an RGB image, and the RGB image is taken as image data to be processed.
It should be understood that Debayer is mosaic processing, which is a digital image processing algorithm for reconstructing a full-Color image from incomplete Color samples output from photosensitive elements covered with a Color Filter Array (CFA). This method is also called Color filter array interpolation (cfaintervision) or Color reconstruction (Color reconstruction).
It should be understood that the video file is composed of several frames of image data, and therefore, the compression apparatus acquires several frames of image data to be processed in chronological order to process the several frames of image data sequentially in chronological order.
It should be understood that UHD is Ultra High Definition, Ultra High Definition. UHD4K and above refers to video images with a resolution of 4K pixels and above, e.g., 8K pixels, 16K pixels, etc. For the sake of understanding, the present embodiment is described by taking 8K pixels as an example, but the principle of the present invention can also be used for compressing video images with 4K pixels, 16K pixels and even higher definition.
Here, the image data for displaying a video image of UHD4K and above pixels may be the aforementioned image data of Bayer format or image data of RGB format. The image data in RGB format includes image data in RGB format itself and image data in other formats (such as YUV format) that can be converted into RGB format.
Referring to fig. 1, in step S120, the compression apparatus maps the color value of each pixel in each image data to the pixel positions in the image blocks respectively based on the color attribute of each pixel in the image data.
It should be understood that a pixel is a basic unit of image display. Each pixel has different color attributes depending on the format of the image data in which it is located. For example, for image data in the Bayer format, the color attribute of its pixel is a single color component; for image data in RGB format or the like, color attributes of pixels thereof include three color components of red (R), green (G), and blue (B). Since the human eye is more sensitive to green than to other colors, the number of G components is typically 2 times the number of other color components. Thus, in certain embodiments, the G component is represented by a Gr component or a Gb component. Wherein each pixel has a color value corresponding to its color attribute. For example, when the image data is in Bayer format, please refer to fig. 2, which is a schematic diagram of the image data in this application in an embodiment, as shown in the figure, each square block represents a pixel, each pixel has only a single color component of R, G, or B, where the G component is represented by a Gr component and a Gb component, and a color value of each pixel in the image data is a luminance value of the single color component, that is, a color value of each pixel; when the image data is in an RGB format, the color value of each pixel in the image data includes a brightness value of each color component in the pixel.
For ease of understanding, a single image data is illustrated herein. It should be understood that the processing method of the plurality of image data is to process the plurality of image data according to the processing method of the single image data, and provide the processed results to step S130, respectively.
In this embodiment, the compression device divides the image data into a plurality of image blocks based on the color attributes, and in order to ensure the correlation between each pixel in the image data and each pixel in the image blocks so as to restore the image data when decoding, the compression device maps the color value of each pixel in each image data to each pixel position in the plurality of image blocks, respectively.
In an exemplary embodiment, in the case that each pixel in the image data represents a single color attribute, the step S120 includes: traversing the image data in a color format set based on a Bayer format in the image data; during traversal, extracting a color value of each pixel from the image data based on the color attribute of each pixel in the color format, and mapping to a pixel position in a corresponding image block.
With continued reference to fig. 2, each pixel in the image data represents a single color attribute. In the present embodiment, 4 (2 × 2) pixels are determined as the color format 101, and since the Bayer data is scanned so that G, R, G, R … … is output on odd lines and B, G, B, G … … is output on even lines, there are pixel data of 4 different color attributes in one color format 101. And traversing the image data by taking the relative positions of the pixel data with different color attributes in the pixel unit as a pixel row format, thereby extracting each pixel data and forming a plurality of image blocks.
In some embodiments, please refer to fig. 3, which shows a schematic diagram of an exemplary mapping method for mapping color values of pixels in each image data to pixel positions in a plurality of image blocks. As shown in the drawing, in the present embodiment, odd lines Gr, R, Gr, R … … and even lines B, Gb, B, Gb … … in the image data are determined, where Gr, R in the odd lines and B, Gb in the even lines are determined as one color format 101. For the sake of understanding, the coordinates of all pixels in the color format 101 where the pixel in the first row and the first column is located are defined as the origin (0, 0), i.e., Gr (0, 0), R (0, 0), B (0, 0), and Gb (0, 0) are included in the color format 101. As shown in fig. 3, with the color format 101 as a reference, the coordinates of each pixel in the color format shifted rightward by 1 unit in the horizontal direction of the color format 101 are determined as (0, 1), the coordinates of each pixel in the color format shifted rightward by 2 units in the horizontal direction of the color format 101 are determined as (0, 2), and the coordinates of each pixel in the color format shifted rightward by 3 units in the horizontal direction of the color format 101 are determined as (0, 3) … …; similarly, with the color format 101 as a reference, the coordinates of each pixel in the color format shifted downward by 1 unit in the vertical direction of the color format 101 are determined as (1, 0), the coordinates of each pixel in the color format shifted downward by 2 units in the vertical direction of the color format 101 are determined as (2, 0), and the coordinates of each pixel in the color format shifted downward by 3 units in the vertical direction of the color format 101 are determined as (3, 0) … …. When the whole image data is traversed according to the rule, each pixel in the image data has the position information thereof, so that the image data is restored by using the position information during decoding.
After the positional information of each pixel is determined, the compression device extracts a color value of each pixel from the image data based on a color attribute of each pixel. Here, the compression apparatus divides all pixel data in the image data into a plurality of image blocks based on color attributes, and each image block includes only one color attribute. Referring to fig. 3, since the color attributes in the present embodiment include 4 attributes of R, Gr, Gb, and B, all the pixel data in the image data are divided into 4 image blocks of R, Gr, Gb, and B based on the color attributes in the present embodiment. For example, Gr (0, 0) is divided into the image blocks of the Gr color attribute, Gr (0, 1) is divided into the image blocks of the Gr color attribute and shifted rightward by 1 unit in the horizontal direction of Gr (0, 0), Gr (0, 2) is divided into the image blocks of the Gr color attribute and shifted rightward by 2 units in the horizontal direction of Gr (0, 0), Gr (0, 3) is divided into the image blocks of the Gr color attribute and shifted rightward by 3 units in the horizontal direction of Gr (0, 0); gr (1, 0) is divided into image blocks of the Gr color attribute and is shifted downward by 1 unit in the vertical direction of Gr (0, 0), Gr (2, 0) is divided into image blocks of the Gr color attribute and is shifted downward by 2 units in the vertical direction of Gr (0, 0), Gr (3, 0) is divided into image blocks of the Gr color attribute and is shifted downward by 3 units in the vertical direction of Gr (0, 0) … … similarly, pixels of the R, Gb, B color attributes are also divided into image blocks one by one, and each pixel position in each image block has a corresponding relationship with its pixel position in the image data, which is not described herein in detail.
In another exemplary embodiment, please refer to fig. 4, which shows a schematic diagram of an embodiment of representing RGB color attributes for each pixel in the image data in the present application. As shown in the figure, the image data obtained by the compression device is an RGB image, for example, the image data is subjected to Debayer on the basis of a Bayer format, that is, two other color components are fitted to the color component of each pixel shown in fig. 2, thereby generating an RGB image. Here, in the case where each pixel in the image data represents an RGB color attribute, the step S120 includes: traversing the image data in a color format set based on a pixel row format in the image data; wherein, during traversal, based on the color attribute of each pixel in the color format, a color principal component or a color fitting component of each pixel is extracted from the image data and mapped to a pixel position in the corresponding image block.
It should be appreciated that since the data output by the sensors of the image capture device are typically in the Bayer format, each pixel has only a single component. The encoder cannot directly encode the Bayer format, and the display device cannot directly display images in the Bayer format. Therefore, the Bayer format is usually processed by Debayer to form an RGB format. However, the data amount after Debayer processing is large and is three times of that of the Bayer format, so that the code stream is too large, and the transmission efficiency is affected. Therefore, in some embodiments, the RGB format is also converted into YUV format, i.e. into luminance and chrominance format, and the chrominance is subtracted, thereby reducing the amount of data. In which YUV422 will reduce the amount of data 1/3 and YUV420 will reduce the amount of data 1/2, but the amount of data is still 2 times and 1.5 times that of the Bayer pattern, respectively. Meanwhile, the conversion of the format into YUV422 or YUV420 also causes a problem of serious color information loss, and cannot meet the requirement of high image quality.
With continued reference to fig. 4, in the present embodiment, each pixel in the image data has three color components, wherein the bold-faced bold part in each pixel represents the principal component in the pixel, and the non-bold-faced bold part in each pixel represents the other two components that are fitted based on the principal component in the pixel. Since each pixel has three color components in one color format 101, only one color component is extracted from each pixel here in order to save and reduce the code stream after compression encoding.
In some embodiments, the compression device knows the principal component in each pixel in advance, and directly determines the principal component in each pixel as the color component to be extracted. In other embodiments, the compression device cannot know the principal component in each pixel in advance, and then a certain component in each pixel can be determined as the color component to be extracted according to a preset rule. Here, the preset rule is, for example and without limitation: according to the rules of odd line extraction G, R and even line extraction B, G; or according to the rules of odd line extraction G, B and even line extraction R, G; or according to the rules of odd line extraction R, G and even line extraction G, B; or according to the rules of odd line extraction B, G, even line extraction G, R, etc. Wherein, when the G component is represented as a Gr component and a Gb component, the preset rule may further be, for example and without limitation: extracting Gr and R according to odd lines, and extracting B, Gb according to even lines; or according to the rule that Gb and B are extracted from odd lines and R, Gr is extracted from even lines; or according to the rule that the odd lines are extracted R, Gr, and the even lines are extracted Gb and B; or according to the rules of odd line extraction B, Gb and even line extraction Gr and R. It should be understood that, because the degree of recognition of the image by the human eye is limited, the influence of any one of the above extraction methods on the final imaging effect is negligible.
With continued reference to fig. 4, in the present embodiment, the compression apparatus knows the principal component in each pixel in advance. Here, the compression apparatus determines the principal component in each pixel as the color component to be extracted, and the color format 101 is determined as the odd lines Gr, R, and the even lines B, Gb.
Please refer to fig. 5, which is a diagram illustrating another exemplary mapping method for mapping color values of pixels in each image data to pixel positions in a plurality of image blocks according to the present application. As shown in the figure, for convenience of understanding, the coordinates of all pixels in the color format 101 where the pixel in the first row and the first column of the image data is located are defined as the origin (0, 0), i.e., the color format 101 includes R Gr B (0, 0), R G B (0, 0), and R Gb B (0, 0). As shown in fig. 5, with the color format 101 as a reference, the coordinates of each pixel in the color format shifted rightward by 1 unit in the horizontal direction of the color format 101 are determined as (0, 1), the coordinates of each pixel in the color format shifted rightward by 2 units in the horizontal direction of the color format 101 are determined as (0, 2), and the coordinates of each pixel in the color format shifted rightward by 3 units in the horizontal direction of the color format 101 are determined as (0, 3) … …; similarly, with the color format 101 as a reference, the coordinates of each pixel in the color format shifted downward by 1 unit in the vertical direction of the color format 101 are determined as (1, 0), the coordinates of each pixel in the color format shifted downward by 2 units in the vertical direction of the color format 101 are determined as (2, 0), and the coordinates of each pixel in the color format shifted downward by 3 units in the vertical direction of the color format 101 are determined as (3, 0) … …. When the whole image data is traversed according to the rule, each pixel in the image data has the position information thereof, so that the image data is restored by using the position information during decoding.
After the positional information of each pixel is determined, the compression device extracts a color value of each pixel from the image data based on a color attribute of each pixel. Since the compression device knows the principal component in each pixel in advance, the compression device only extracts the principal component in each pixel. Here, the compression apparatus divides all principal components in the image data into a plurality of image blocks based on color attributes, and each image block includes only one color attribute. Referring to fig. 5, since the color attributes in the present embodiment include 4 attributes of R, Gr, Gb, and B, all the pixel data in the image data are divided into 4 image blocks of R, Gr, Gb, and B based on the color attributes in the present embodiment. For example, Gr (0, 0) is divided into the image blocks of the Gr color attribute, Gr (0, 1) is divided into the image blocks of the Gr color attribute and shifted rightward by 1 unit in the horizontal direction of Gr (0, 0), Gr (0, 2) is divided into the image blocks of the Gr color attribute and shifted rightward by 2 units in the horizontal direction of Gr (0, 0), Gr (0, 3) is divided into the image blocks of the Gr color attribute and shifted rightward by 3 units in the horizontal direction of Gr (0, 0); gr (1, 0) is divided into image blocks of the Gr color attribute and is shifted downward by 1 unit in the vertical direction of Gr (0, 0), Gr (2, 0) is divided into image blocks of the Gr color attribute and is shifted downward by 2 units in the vertical direction of Gr (0, 0), Gr (3, 0) is divided into image blocks of the Gr color attribute and is shifted downward by 3 units in the vertical direction of Gr (0, 0) … … similarly, pixels of the R, Gb, B color attributes are also divided into image blocks one by one, and each pixel position in each image block has a corresponding relationship with its pixel position in the image data, which is not described herein in detail.
In other embodiments, the compression device does not know the principal components in each pixel in advance. Here, the rules of Gr and R are extracted for odd-numbered lines and B, Gb is extracted for even-numbered lines; extracting Gb and B according to odd lines and extracting R, Gr according to even lines; according to the rule that the odd lines are extracted R, Gr, and the even lines are extracted Gb and B; the rule for extracting Gr and R according to the odd line B, Gb and the even line is illustrated.
Please refer to fig. 8, which is a schematic diagram illustrating another embodiment of representing RGB color attributes for each pixel in the image data in the present application. In the present embodiment, the compression device does not know the principal component in each pixel in advance. Here, the rule of odd-numbered line extraction Gr, R and even-numbered line extraction B, Gb determines the color components to be extracted, and then the color format is determined as odd-numbered line Gr, R and even-numbered line B, Gb. Since the compression method is the same as that of the embodiment shown in fig. 5 when the color format is the odd lines Gr, R, and the even line B, Gb, it is not repeated.
Referring to fig. 9, a schematic diagram of another embodiment of the present application when the compression apparatus does not know the principal component in each pixel in advance is shown. In this embodiment, the color components to be extracted are determined according to the rule of extracting Gb and B in odd rows and extracting R, Gr in even rows, and then the color format 101 is determined as the odd rows Gb and B and the even rows R, Gr.
Please refer to fig. 10, which is a diagram illustrating an embodiment of a mapping method for mapping color values of pixels in each image data to pixel positions in a plurality of image blocks when a compression device does not know principal components in each pixel in advance. As shown in the figure, for convenience of understanding, the coordinates of all pixels in the color format 101 where the pixel in the first row and the first column of the image data is located are defined as the origin (0, 0), i.e., the color format 101 includes R Gb B (0, 0), R G B (0, 0), and R Gr B (0, 0). As shown in fig. 10, with the color format 101 as a reference, the coordinates of each pixel in the color format shifted rightward by 1 unit in the horizontal direction of the color format 101 are determined as (0, 1), the coordinates of each pixel in the color format shifted rightward by 2 units in the horizontal direction of the color format 101 are determined as (0, 2), and the coordinates of each pixel in the color format shifted rightward by 3 units in the horizontal direction of the color format 101 are determined as (0, 3) … …; similarly, with the color format 101 as a reference, the coordinates of each pixel in the color format shifted downward by 1 unit in the vertical direction of the color format 101 are determined as (1, 0), the coordinates of each pixel in the color format shifted downward by 2 units in the vertical direction of the color format 101 are determined as (2, 0), and the coordinates of each pixel in the color format shifted downward by 3 units in the vertical direction of the color format 101 are determined as (3, 0) … …. When the whole image data is traversed according to the rule, each pixel in the image data has the position information thereof, so that the image data is restored by using the position information during decoding.
After the position information of each pixel is determined, the compression device extracts the color value of each pixel from the image data and divides the color value into a plurality of image blocks based on the color attribute of each pixel, and each image block only contains one color attribute. Referring to fig. 10, since the color attributes in the present embodiment include 4 attributes of R, Gr, Gb, and B, all the pixel data in the image data are divided into 4 image blocks of R, Gr, Gb, and B based on the color attributes in the present embodiment. For example, Gb (0, 0) is divided into image blocks of Gb color attributes, Gb (0, 1) is divided into image blocks of Gb color attributes and shifted rightward by 1 unit in the horizontal direction of Gb (0, 0), Gb (0, 2) is divided into image blocks of Gb color attributes and shifted rightward by 2 units in the horizontal direction of Gb (0, 0), Gb (0, 3) is divided into image blocks of Gb color attributes and shifted rightward by 3 units in the horizontal direction of Gb (0, 0); gb (1, 0) is divided into image blocks of Gb color attributes and shifted downward by 1 unit in the vertical direction of Gb (0, 0), Gb (2, 0) is divided into image blocks of Gb color attributes and shifted downward by 2 units in the vertical direction of Gb (0, 0), Gb (3, 0) is divided into image blocks of Gb color attributes and shifted downward by 3 units … … in the vertical direction of Gb (0, 0) each pixel of B, R, Gr color attributes is also divided into each image block one by one, and each pixel position in each image block has a corresponding relationship with its pixel position in the image data, which is not described herein in detail.
Referring to fig. 11, a schematic diagram of another embodiment of the present application when the compression device does not know the principal component in each pixel in advance is shown. In this embodiment, the color components to be extracted are determined according to the rule that the odd lines are extracted R, Gr and the even lines are extracted Gb and B, and then the color format 101 is determined as the odd lines R, Gr and the even lines Gb and B.
Please refer to fig. 12, which is a diagram illustrating another embodiment of a mapping method for mapping color values of pixels in each image data to pixel positions in a plurality of image blocks when a compression device does not know a principal component in each pixel in advance. As shown in the figure, for convenience of understanding, the coordinates of all pixels in the color format 101 where the pixel in the first row and the first column of the image data is located are defined as the origin (0, 0), i.e., the color format 101 includes R G B (0, 0), R Gr B (0, 0), R Gb B (0, 0), and R G B (0, 0). As shown in fig. 10, with the color format 101 as a reference, the coordinates of each pixel in the color format shifted rightward by 1 unit in the horizontal direction of the color format 101 are determined as (0, 1), the coordinates of each pixel in the color format shifted rightward by 2 units in the horizontal direction of the color format 101 are determined as (0, 2), and the coordinates of each pixel in the color format shifted rightward by 3 units in the horizontal direction of the color format 101 are determined as (0, 3) … …; similarly, with the color format 101 as a reference, the coordinates of each pixel in the color format shifted downward by 1 unit in the vertical direction of the color format 101 are determined as (1, 0), the coordinates of each pixel in the color format shifted downward by 2 units in the vertical direction of the color format 101 are determined as (2, 0), and the coordinates of each pixel in the color format shifted downward by 3 units in the vertical direction of the color format 101 are determined as (3, 0) … …. When the whole image data is traversed according to the rule, each pixel in the image data has the position information thereof, so that the image data is restored by using the position information during decoding.
After the position information of each pixel is determined, the compression device extracts the color value of each pixel from the image data and divides the color value into a plurality of image blocks based on the color attribute of each pixel, and each image block only contains one color attribute. With reference to fig. 10, since the color attributes in the present embodiment include 4 attributes of R, Gr, Gb, and B, all the pixel data in the image data are divided into 4 image blocks of R, Gr, Gb, and B based on the color attributes in the present embodiment. For example, R (0, 0) is divided into image blocks of the R color attribute, R (0, 1) is divided into image blocks of the R color attribute and shifted rightward by 1 unit in the horizontal direction of R (0, 0), R (0, 2) is divided into image blocks of the R color attribute and shifted rightward by 2 units in the horizontal direction of R (0, 0), R (0, 3) is divided into image blocks of the R color attribute and shifted rightward by 3 units in the horizontal direction of R (0, 0); r (1, 0) is divided into image blocks of the R color attribute and shifted downward by 1 unit in the vertical direction of R (0, 0), R (2, 0) is divided into image blocks of the R color attribute and shifted downward by 2 units in the vertical direction of R (0, 0), R (3, 0) is divided into image blocks of the R color attribute and shifted downward by 3 units in the vertical direction of R (0, 0) … … and similarly, pixels of Gr, Gb, B color attributes are also divided into image blocks one by one, and each pixel position in each image block has a corresponding relationship with its pixel position in the image data, which is not described in detail herein.
Referring to fig. 13, a schematic diagram of another embodiment of the present application is shown when the compression device does not know the principal component in each pixel in advance. In this embodiment, the color components to be extracted are determined according to the rules of odd line extraction B, Gb and even line extraction Gr and R, and then the color format 101 is determined as the odd line B, Gb and the even line Gr and R.
Please refer to fig. 14, which shows a schematic diagram of another embodiment of the mapping method for mapping color values of pixels in each image data to pixel positions in a plurality of image blocks when the compression device does not know the principal component in each pixel in advance in the present application. As shown in the figure, for convenience of understanding, the coordinates of all pixels in the color format 101 where the pixel in the first row and the first column of the image data is located are defined as the origin (0, 0), i.e., the color format 101 includes R G B (0, 0), R Gb B (0, 0), R Gr B (0, 0), and R G B (0, 0). As shown in fig. 14, with the color format 101 as a reference, the coordinates of each pixel in the color format shifted rightward by 1 unit in the horizontal direction of the color format 101 are determined as (0, 1), the coordinates of each pixel in the color format shifted rightward by 2 units in the horizontal direction of the color format 101 are determined as (0, 2), and the coordinates of each pixel in the color format shifted rightward by 3 units in the horizontal direction of the color format 101 are determined as (0, 3) … …; similarly, with the color format 101 as a reference, the coordinates of each pixel in the color format shifted downward by 1 unit in the vertical direction of the color format 101 are determined as (1, 0), the coordinates of each pixel in the color format shifted downward by 2 units in the vertical direction of the color format 101 are determined as (2, 0), and the coordinates of each pixel in the color format shifted downward by 3 units in the vertical direction of the color format 101 are determined as (3, 0) … …. When the whole image data is traversed according to the rule, each pixel in the image data has the position information thereof, so that the image data is restored by using the position information during decoding.
After the position information of each pixel is determined, the compression device extracts the color value of each pixel from the image data and divides the color value into a plurality of image blocks based on the color attribute of each pixel, and each image block only contains one color attribute. Referring to fig. 10, since the color attributes in the present embodiment include 4 attributes of R, Gr, Gb, and B, all the pixel data in the image data are divided into 4 image blocks of R, Gr, Gb, and B based on the color attributes in the present embodiment. For example, B (0, 0) is divided into image blocks of the B color attribute, B (0, 1) is divided into image blocks of the B color attribute and shifted rightward by 1 unit in the horizontal direction of B (0, 0), B (0, 2) is divided into image blocks of the B color attribute and shifted rightward by 2 units in the horizontal direction of B (0, 0), and B (0, 3) is divided into image blocks of the B color attribute and shifted rightward by 3 units in the horizontal direction of B (0, 0); b (1, 0) is divided into image blocks of B color attribute and shifted downward by 1 unit in the vertical direction of B (0, 0), B (2, 0) is divided into image blocks of B color attribute and shifted downward by 2 units in the vertical direction of B (0, 0), B (3, 0) is divided into image blocks of B color attribute and shifted downward by 3 units in the vertical direction of B (0, 0) … … and pixels of Gb, Gr, R color attribute are also divided into image blocks correspondingly one by one, and each pixel position in each image block has a corresponding relationship with its pixel position in the image data, which is not described herein in detail.
It should be understood that, for convenience of understanding, the mapping relationship is determined in the form of coordinates in the above embodiments, but in some embodiments, the method for extracting the color value of each pixel from the image data based on the color attribute of each pixel in the color format and mapping the color value to the pixel position in the corresponding image block is not limited to determining the mapping relationship by coordinates, and may also include any information that can be recognized by a compression device to determine the mapping relationship, such as a serial number.
In step S130, the compressing device compresses an image block corresponding to each of the plurality of image data and having the same color attribute, so as to obtain a video file. Here, the plurality of image blocks obtained in step S120 are input to an encoder and encoded. Wherein, the standard of the coding can adopt and include but not limited to: h.265 or AVS2, second generation digital audio video codec standards, etc.
In some embodiments, the encoder may be integrated in the compression device, for example, the processing means of the compression device coordinates the encoder to perform step S130 after performing steps S110 and S120. Alternatively, the encoder may be a separate terminal device or server. The encoder comprises a processing module capable of logic control and digital operations, and a storage module for storing intermediate data generated during operation of the processing module. Wherein, the processing module includes any one or more of the following combinations: FPGA, MCU, CPU, etc. The memory module comprises any one or more of the following combinations: volatile memories such as registers, stacks, and caches.
It should be understood that a video encoder is a program or device capable of compressing digital video. In general, Bayer formatted data cannot be directly encoded by an encoder because each pixel has only a single color attribute and lacks the color attributes of the other two bits. The Bayer format data needs to be processed by Debayer to generate RGB format, or converted into YUV format before entering into encoder for encoding. In this embodiment, since the pixels in each image block only include a single color attribute, the insufficient number of bits can be temporarily filled with 0 when entering the encoder, so that the image block can be compatible with the encoder in the prior art on the one hand, and the encoder is convenient to calculate on the other hand, thereby ensuring the processing efficiency of the encoder.
In an exemplary embodiment, the plurality of image blocks may be processed by one encoder, where the step S130 includes: and sequentially inputting a plurality of image blocks corresponding to the plurality of image data into a first encoder for compression processing according to the color attributes in the color format.
Please refer to fig. 6, which is a schematic diagram illustrating an embodiment of the present application in which a first encoder is utilized for compression. As shown in the figure, a plurality of image blocks generated from image data of 4 different frames are shown, where each image block in each serial number includes only a single color attribute. Here, the image blocks are input to a first encoder in a predetermined order for compression encoding. Wherein the preset order includes but is not limited to: based on the time when the image data corresponding to the image block is acquired, or based on the color attribute of the image block.
In some embodiments, the predetermined order is determined based on a time at which image data corresponding to the image block is acquired. Please refer to fig. 7, which is a diagram illustrating another embodiment of the present application in which a first encoder is utilized for compression. As shown in the figure, in this embodiment, the four image blocks with sequence numbers (i) are first input into the first encoder 102 for compression, then the four image blocks with sequence numbers (ii) are input into the first encoder 102 for compression, then the four image blocks with sequence numbers (iii) are input into the first encoder 102 for compression, and finally the four image blocks with sequence numbers (iv) are input into the first encoder 102 for compression.
In other embodiments, the preset order is determined based on the color attributes of the image blocks, please continue to refer to fig. 6, the image block with the color attribute Gr is input to the first encoder 102 for compression, the image block with the color attribute R is input to the first encoder 102 for compression, the image block with the color attribute B is input to the first encoder 102 for compression, and the image block with the color attribute Gb is input to the first encoder 102 for compression. Because the color difference value between the adjacent frames is small, the operation amount can be greatly reduced and the compression efficiency is improved by the method in the embodiment.
In an exemplary embodiment, to improve the efficiency of the compression process, a plurality of image blocks may be processed by a plurality of encoders, where the step S130 includes: and under synchronous control, respectively compressing a plurality of image blocks with the same color attribute by using a plurality of second encoders.
In some embodiments, in order to distinguish image blocks generated from image data of different frames, the step S130 further includes: the video file resulting from the compression processing by the plurality of second encoders contains synchronization information provided for decompressing the video file to restore the plurality of image data. Here, the second encoder generates synchronization information for each image block, the synchronization information includes but is not limited to a timestamp, a sequence number, and the like, for example: the images of the same frame have the same time stamp, and the images of different frames have different time stamps, so that the image blocks with the same time stamp are restored into image data at a decoding end. For another example, the pictures of the same frame have the same sequence number, and the pictures of different frames have different sequence numbers, so that the image blocks with the same sequence number are restored to one image data at the decoding end. Because the time mechanisms of different second encoders have errors, a synchronization server can perform time synchronization on the plurality of second encoders to coordinate the time mechanisms of the plurality of second encoders to keep consistent or control the errors within an acceptable range. The server includes, but is not limited to, an ntp (network Time protocol) server, and the like. In some embodiments, the other second encoders may be synchronously controlled by one of the second encoders based on a synchronization protocol to coordinate the other second encoders to be in the same time scheme or to control the error within an acceptable range. Wherein, the synchronization protocol includes but is not limited to 1588 protocol and the like.
In an exemplary embodiment, the image data is in a Bayer format or other format than RGB format, such as YUV format or the like. The image data needs to be converted into RGB or Bayer format and then compressed according to the above compression processing method, which is not repeated here.
The image data compressed by the technical idea provided by the compression method can be stored in a storage medium, or transmitted between devices or inside the devices by using a communication transmission method of 60Mbps or more. For example, in a camcorder integrated with recording and playback, hardware constituting a compression device compresses captured image data into corresponding compressed image data under instruction scheduling of software, and stores the compressed image data in a storage device. When the user operates the camcorder to play the compressed image data, the hardware constituting the decompression device decompresses the compressed image data under the instruction scheduling of the software, and plays (or is called as displaying). For another example, the image capturing apparatus capable of executing the compression method compresses the captured image data into corresponding compressed image data (such as a compressed file or a code stream), transmits the compressed image data to a server by using a transmission method such as a wireless transmission method and an optical fiber transmission method based on a 5G communication protocol, and decompresses and plays (or is called as displaying) the compressed image data by a decompression apparatus arranged in the server.
The compression mode through this application can guarantee the stability when transmission when the clear video definition of superelevation, and the data bulk after the compression mode compression coding through this application can realize the transmission of 8K image by current 4K encoder, has solved the problem of the clear video transmission difficulty of superelevation among the prior art.
In an embodiment of the second aspect of the present application, a method for decompressing a video file is further provided, where the method for decompressing a video file is mainly performed by a decompression device of an image, where the decompression device may be a terminal device or a server. Here, the terminal device may be a terminal device, a server, or the like.
The terminal device includes, but is not limited to, a playing device, an electronic terminal device for personal use, and the like. The playing device comprises a storage device, a processing device, and may further comprise an interface device, etc. The storage may include, among other things, high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other non-volatile solid-state storage devices. The storage device also includes a memory controller that can control access to the memory by other components of the device, such as the CPU and peripheral interfaces. The storage device is used for storing at least one program and image data to be decompressed. Programs stored in the storage device include an operating system, a communications module (or set of instructions), a graphics module (or set of instructions), a text input module (or set of instructions), and an application (or set of instructions). The program in the storage device further includes an instruction set for performing decompression operations on image data in time series based on the technical scheme provided by the decompression method. The processing means include, but are not limited to: a CPU, a GPU, an FPGA (Field-Programmable Gate Array), an ISP (Image Signal Processing chip), or another Processing chip (e.g., AI-specific chip) including at least one program exclusively used for Processing stored in the storage device. The processing device calls and executes at least one program stored in the storage device to decompress the stored image data according to the decompression method. The processing device which can process matrix data in parallel, such as FPGA, is more suitable for decompressing the acquired image data efficiently and in real time. The interface devices include, but are not limited to: a data line interface and a network interface; the data line interface includes, for example: display interfaces such as VGA interfaces, HDMI interfaces, serial interfaces such as USB, and parallel interfaces such as data buses. Examples of network interfaces include at least one of: such as a network interface based on a bluetooth protocol, a WiFi network interface, etc., a wireless network interface based on a 3G, 4G, or 5G protocol, such as a wired network interface including a network card, etc. The playing device further comprises a display device for displaying the decompressed image data. The display device at least comprises a display screen, a display screen controller and the like, wherein the display screen comprises a liquid crystal display screen, a curved surface display screen, a touch screen and the like. Examples of the display screen controller include a processor dedicated to the display apparatus, a processor integrated with a processor in the processing apparatus, and the like. In some scenarios, the playback device is provided with a traffic guidance center for decompressing and displaying the compressed image data transmitted from the camera device. In other scenarios, the playback device is configured on a computer device communicatively connected to the minimally invasive medical device, which is connected to the minimally invasive medical device through an optical fiber or other dedicated data line, and decompresses and plays the compressed image data provided by the current minimally invasive medical device. In other scenes, the playing device is configured in a machine room of a television forwarding center and is used for decompressing and playing the compressed image data transmitted by the camera device arranged on the playing field for video editing. In other scenarios, the playing device is a set-top box, which is configured to decompress and output the code stream in the corresponding television channel in the television signal to a television for display.
The electronic terminal devices for personal use include desktop computers, notebook computers, tablet computers, splicing devices dedicated to making television programs, movies, television shows, and the like. The electronic terminal equipment comprises a storage device and a processing device. The storage means and the processing means may be the same as or similar to the corresponding means in the aforementioned image pickup apparatus, and will not be described in detail here. The electronic terminal device may further include a display device for displaying the decompressed image data. Here, in some examples, the hardware and software modules of the electronic terminal may be the same as or similar to the corresponding devices in the aforementioned playing device, and are not repeated here. In still other examples, the electronic terminal device may further include an image acquisition interface to acquire compressed image data derived from the compression. The image acquisition interface may be a network interface, a data line interface, or a program interface. The network interface and the data line interface may be the same as or similar to the corresponding devices in the aforementioned playing device, and are not described in detail here. For example, the processing device of the electronic terminal device downloads compressed image data from the internet through the network interface. For another example, the processing device of the electronic terminal device obtains the edited file from the storage device through the data line interface.
The server includes, but is not limited to, a single server, a server cluster, a distributed server, a server based on cloud technology, and the like. The server comprises a storage device, a processing device, an image acquisition interface and the like. The storage device and the processing device can be configured in the same entity server equipment or configured in a plurality of entity server equipment according to the division of the work of each entity server equipment. The image acquisition interface may be a network interface, or a data line interface. The storage means, processing means, image acquisition interface, and the like included in the server may be the same as the corresponding means mentioned in the aforementioned terminal device; or each corresponding device for a server that is specifically set based on the throughput, processing power, storage requirements of the server. For example, the storage device may also include a solid state disk or the like. For example, the processing device may also include a CPU or the like dedicated to the server. The image acquisition interface in the server acquires compressed image data and a playing instruction from the internet, and the processing device executes the decompression method based on the playing instruction on the acquired compressed image data.
Based on the requirement for decompressing image data generated in any of the above scenarios, the present application provides a method for decompressing a video file, please refer to fig. 15, which is a flowchart illustrating an embodiment of the method for decompressing.
In step S210, a video file is acquired. The video file is obtained by compressing the graphic data according to the compression method in the application.
In some embodiments, the video file may be from a storage medium, and may also be transmitted to the decompression device using a communication transmission mode of 60Mbps or more. Wherein, the transmission modes include but are not limited to: wireless transmission mode based on 5G communication protocol, or optical fiber transmission.
In step S220, decompressing the video file according to the compression method used by the corresponding video file to obtain a plurality of image blocks; the obtained plurality of image blocks correspond to each image data of a plurality of image data to be generated according to the color attribute of each image block.
Here, the video file obtained in step S210 is input to a decoder for decoding. Wherein the decoding standard may employ standards including, but not limited to: h.265 or AVS2, second generation digital audio video codec standards, etc.
In some embodiments, the decoder may be integrated in the decompression apparatus, for example, the processing means of the decompression apparatus coordinates the decoder to perform step S220 after performing step S210. Alternatively, the decoder may be a stand-alone terminal device or a server. The decoder comprises a processing module capable of logic control and digital operation, and a storage module for storing intermediate data generated during operation of the processing module. Wherein, the processing module includes any one or more of the following combinations: FPGA, MCU, CPU, etc. The memory module comprises any one or more of the following combinations: volatile memories such as registers, stacks, and caches.
In an exemplary embodiment, a plurality of image blocks may be processed by a decoder, where the step S220 includes: and decompressing the received video file by using a first decoder to obtain a plurality of groups of image blocks divided according to different color attributes in the color format. Each image block in each group of image blocks corresponds to image data to be generated.
Here, the first decoder decompresses the received video file according to a compression encoding method of the image block by the encoder at the time of compression encoding. And after a plurality of groups of image blocks are obtained by decoding through a first decoder, the first decoder determines the corresponding relation among the plurality of image blocks according to the obtained sequence of the image blocks and the rules of compression coding so as to generate the image data by the plurality of image blocks.
In some embodiments, please refer to fig. 16, which shows a schematic diagram of an embodiment of the present application in which a first decoder is used for decompression. In the present embodiment, during compression encoding, the encoder compression-encodes a plurality of image blocks based on a rule of times at which image data corresponding to the image blocks are acquired. Therefore, as shown in fig. 16, the first decoder sequentially obtains an image block of the Gr color attribute numbered (R), an image block of the R color attribute numbered (R), an image block of the B color attribute numbered (B), an image block of the Gb color attribute numbered (R), an image block of the Gr color attribute numbered (c), and an image block … … of the R color attribute numbered (c). Here, according to the rules of the encoder during compression encoding, the correspondence relationship between a plurality of image blocks is determined, for example, an image block with the Gr color attribute numbered (i), an image block with the R color attribute numbered (i), an image block with the B color attribute numbered (i), and an image block with the Gb color attribute numbered (i) are all from the same image data, an image block with the Gr color attribute numbered (ii), an image block with the R color attribute numbered (ii), an image block with the B color attribute numbered (ii), and an image block with the Gb color attribute numbered (ii) are all from the same image data and are located in the order after (i).
In other embodiments, please refer to fig. 17, which is a diagram illustrating another embodiment of decompression processing performed by a first decoder. In the present embodiment, during compression encoding, the encoder compression-encodes a plurality of image blocks based on the rule of the color attribute of the image block. Therefore, as shown in fig. 17, the first decoder sequentially acquires an image block of the Gr color attribute numbered i, an image block of the Gr color attribute numbered ii, an image block of the Gr color attribute numbered iii, an image block of the Gr color attribute numbered iv, an image block of the R color attribute numbered i, and an image block … … of the R color attribute numbered ii. Here, according to the rules of the encoder during compression encoding, the correspondence relationship between a plurality of image blocks is determined, for example, an image block with the Gr color attribute numbered (i), an image block with the R color attribute numbered (i), an image block with the B color attribute numbered (i), and an image block with the Gb color attribute numbered (i) are all from the same image data, an image block with the Gr color attribute numbered (ii), an image block with the R color attribute numbered (ii), an image block with the B color attribute numbered (ii), and an image block with the Gb color attribute numbered (ii) are all from the same image data and are located in the order after (i).
In another exemplary embodiment, to improve the efficiency of the decompression process, a plurality of image blocks may be processed by a plurality of decoders, respectively, where the step S220 includes: under the synchronous control, a plurality of second decoders are used for respectively decompressing the video files according to the color attributes; wherein each second decoder outputs a plurality of image blocks having the same color attribute; wherein each image block corresponds to an image data to be generated. In some embodiments, in order to distinguish image blocks generated from image data of different frames, each second decoder determines a correspondence between a plurality of decompressed image blocks and image data to be generated according to synchronization information in the video file.
Here, the second decoder generates synchronization information for each tile, the synchronization information includes but is not limited to a timestamp, a sequence number, etc., such as: the images of the same frame have the same time stamp, and the images of different frames have different time stamps, so that the image blocks with the same time stamp are restored into image data at a decoding end. For another example, the pictures of the same frame have the same sequence number, and the pictures of different frames have different sequence numbers, so that the image blocks with the same sequence number are restored to one image data at the decoding end. Because the time mechanisms of different second decoders have errors, the time mechanisms of the second decoders can be coordinated to be consistent or the errors can be controlled within an acceptable range by performing time synchronization on the second decoders through a synchronization server. The server includes, but is not limited to, an ntp (network Time protocol) server, and the like. In some embodiments, the other second decoders may be synchronously controlled by one of the plurality of second decoders based on a synchronization protocol to coordinate the other second decoders to be in the same time scheme or to control the error within an acceptable range. Wherein, the synchronization protocol includes but is not limited to 1588 protocol and the like.
With continuing reference to fig. 15, after obtaining a plurality of image blocks by the above decompression method, the decompression apparatus provides the obtained plurality of image blocks to step S230.
In step S230, color values at pixel positions in the corresponding image blocks are mapped to pixels of the image data according to the color attributes.
It should be understood that a pixel is a basic unit of image display. Each pixel has different color attributes according to the format of the image data in which it is located. For example, for image data in the Bayer format, the color attribute of its pixel is a single color component; for image data in RGB format or the like, the color attributes of the pixels include three color components of red (R), green (G), and blue (B). Since the human eye is more sensitive to green than to other colors, the number of G components is typically 2 times the number of other color components. Thus, in certain embodiments, the G component is represented by a Gr component or a Gb component. Wherein each pixel has a color value corresponding to its color attribute. For example, when the image data is in a Bayer format, each pixel has only a single color component of R, G, or B, where the G component is represented by a Gr component and a Gb component, and the color value of each pixel in the image data is the luminance value of the single color component, i.e., the color value of each pixel; when the image data is in an RGB format, the color value of each pixel in the image data includes the luminance value of each color component in the pixel.
In an exemplary embodiment, please refer to fig. 18, which shows a schematic diagram of an embodiment of a decompression apparatus mapping color values of pixel positions in corresponding image blocks to pixels of image data according to the present application. After the decompression device acquires the plurality of image blocks, according to the mapping relationship between the pixel positions in the image blocks and the pixel positions in the image data corresponding to the image blocks, the color values of the pixels in the image blocks are mapped to the pixel positions in the corresponding image data, so that the plurality of image blocks are restored to the image data. As shown in fig. 18, each pixel in the plurality of image blocks of the decompression apparatus is mapped into image data according to its location information, wherein pixels of different color attributes of the same location information are arranged according to their color format upon compression. For example: gr (0, 0), R (0, 0), B (0, 0), and Gb (0, 0) are each mapped to a (0, 0) position in the image data, and Gr (0, 0), R (0, 0), B (0, 0), and Gb (0, 0) are arranged in the color format according to the format in which Gr, R, and even line are extracted B, Gb at the time of compression. Similarly, other pixels in the image block are mapped to the image data according to the above method. Therefore, the step S230 further includes: traversing pixel positions in the image blocks with the color attributes according to the color formats, and mapping color values of corresponding pixel positions in the image blocks to the pixel positions in the corresponding image data during traversal to generate image data; wherein the color value of each pixel location in the image data represents a single color attribute. Here, the decompression apparatus processes the plurality of image blocks respectively according to the above-described method, and sequentially transmits the generated plurality of image data to step S240.
It should be understood that the color format in this embodiment is determined according to the color format during compression, and the manner of determining the color format is described in the embodiment of the first aspect of the present application, and therefore, will not be repeated here.
In step S240, a video image for displaying pixels of UHD4K or more is generated based on the color value of each pixel in the image data.
It should be understood that UHD is Ultra High Definition, Ultra High Definition. UHD4K and above refers to video images with a resolution of 4K pixels and above, e.g., 8K pixels, 16K pixels, etc. For the sake of understanding, the present embodiment is described by taking 8K pixels as an example, but the principle of the present invention can also be used for compressing video images with 4K pixels, 16K pixels and even higher definition.
Here, the image data supplied in step S230 corresponds to image data in the Bayer format. In some embodiments, for display purposes, the decompression device performs Debayer or the like on the image data provided in step S230 to generate an RGB image for display. Therefore, the step S240 further includes: and according to the color format, performing interpolation processing on each pixel position in the obtained image data to obtain a video image containing RGB color attributes in each pixel. The RGB image includes image data in RGB format itself and image data in other formats (such as YUV format) that can be converted into RGB format.
It should be understood that Debayer is mosaic processing, which is a digital image processing algorithm for reconstructing a full-Color image from incomplete Color samples output from photosensitive elements covered with a Color Filter Array (CFA). This method is also called Color filter array interpolation (cfaintervision) or Color reconstruction (Color reconstruction).
Referring to fig. 19, which is a schematic diagram of an embodiment of a compression apparatus of the present application, as shown, the compression apparatus includes: a communication interface for communication connection with an external decompression device; a memory for storing at least one program and image data to be compressed; a processor for coordinating the communication interface and the memory to execute the program, and during the execution, compressing the image data according to the compression method for obtaining video file as described in any of the embodiments of the first aspect of the present application to obtain video file.
The memory includes a nonvolatile memory, a storage server, and the like. The nonvolatile memory is, for example, a solid state disk or a usb disk. The storage server is used for storing the acquired various electricity utilization related information and power supply related information. The communication interface includes a network interface, a data line interface, and the like. Wherein the network interfaces include, but are not limited to: network interface devices based on ethernet, network interface devices based on mobile networks (3G, 4G, 5G, etc.), network interface devices based on near field communication (WiFi, bluetooth, etc.), and the like. The data line interface includes, but is not limited to: USB interface, RS232, etc. The communication interface is connected with data such as each sensing device, a third-party system, the Internet and the like. The processor is connected with the communication interface and the memory, and comprises: a CPU or a chip integrated with a CPU, a programmable logic device (FPGA), and a multi-core processor. The processor also includes memory, registers, and the like for temporarily storing data.
The communication interface is used for being in communication connection with an external decompression device. Here, the communication interface includes, for example, a network card, which is communicatively connected to the decompression device through the internet or a built-up dedicated network. For example, the communication interface transmits a video file compressed by the compression device to the decompression device.
The memory is used for storing at least one program and image data to be compressed. Here, the memory includes, for example, a memory card provided in a compression device.
The processor is configured to invoke the at least one program to coordinate the communication interface and the memory to perform the compression method mentioned in any of the preceding examples.
Referring to fig. 20, which is a schematic diagram of an embodiment of a decompression apparatus according to the present application, as shown, the decompression apparatus includes: the communication interface is used for being in communication connection with external compression equipment; a memory for storing at least one program and a video file to be decompressed; a processor for coordinating the communication interface and the memory to execute the program, and during the execution, performing a decompression process on the video file according to the video file decompression method according to any one of the embodiments of the second aspect of the present application, so as to play the video file.
The memory includes a nonvolatile memory, a storage server, and the like. The nonvolatile memory is, for example, a solid state disk or a usb disk. The storage server is used for storing the acquired various electricity utilization related information and power supply related information. The communication interface includes a network interface, a data line interface, and the like. Wherein the network interfaces include, but are not limited to: network interface devices based on ethernet, network interface devices based on mobile networks (3G, 4G, 5G, etc.), network interface devices based on near field communication (WiFi, bluetooth, etc.), and the like. The data line interface includes but is not limited to: USB interface, RS232, etc. The communication interface is connected with data such as each sensing device, a third-party system, the Internet and the like. The processor is connected with the communication interface and the memory, and comprises: a CPU or a chip integrated with a CPU, a programmable logic device (FPGA), and a multi-core processor. The processor also includes memory, registers, and the like for temporarily storing data.
The communication interface is used for being in communication connection with external compression equipment. Here, the communication interface includes, for example, a network card, which is communicatively connected to the compression device via the internet or a built-up private network. For example, the communication interface receives a video file compressed by a compression device and provides the video file to the processor.
The memory is used for storing at least one program and a video file to be decompressed. Here, the memory includes, for example, a memory card provided in the decompression device.
The processor is configured to invoke the at least one program to coordinate the communication interface and the memory to execute the decompression method mentioned in any of the foregoing examples, so as to decompress the video file, so as to play the video file.
Based on any of the compression and decompression methods provided above, the present application further provides a video transmission system, please refer to fig. 21, which is a schematic structural diagram of an embodiment of the video transmission system in the present application. The video transmission system comprises a compression device and a decompression device as described in any of the preceding.
Here, the video transmission system includes a communication interface, a memory, and a processor. The communication interface may include a network interface, a data line interface, a program interface, or the like. During compression, image data in an image pickup device or the internet is acquired through a communication interface of the compression apparatus, and a processing device performs a compression operation by calling a program stored in a memory to compression-encode the acquired image data into a video file and store it in a storage device. When the video transmission system displays the video file based on user operation, the processing device executes decompression operation by calling the program in the storage device, and displays the image data obtained after decompression in the display screen. The compression and decompression operations in the video transmission system can be performed based on the corresponding methods provided in the present application, and will not be repeated here.
It should be noted that, through the above description of the embodiments, those skilled in the art can clearly understand that part or all of the present application can be implemented by software and combined with necessary general hardware platform. The functions may also be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the present application also provides a computer-readable storage medium storing at least one program which, when executed, implements any one of the compression methods or the decompression methods described above.
With this understanding in mind, the technical solutions of the present application and/or portions thereof that contribute to the prior art may be embodied in the form of a software product that may include one or more machine-readable media having stored thereon machine-executable instructions that, when executed by one or more machines such as a computer, network of computers, or other electronic devices, may cause the one or more machines to perform operations in accordance with embodiments of the present application. Such as steps in a compression method or decompression method, etc. The machine-readable medium may include, but is not limited to, floppy diskettes, optical disks, CD-ROMs (compact disc-read only memories), magneto-optical disks, ROMs (read only memories), RAMs (random access memories), EPROMs (erasable programmable read only memories), EEPROMs (electrically erasable programmable read only memories), magnetic or optical cards, flash memory, or other type of media/machine-readable medium suitable for storing machine-executable instructions.
Also, any connection is properly termed a computer-readable medium. For example, if the instructions are transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. It should be understood, however, that computer-readable-and-writable storage media and data storage media do not include connections, carrier waves, signals or other transitory media, but are intended to be non-transitory, tangible storage media. Disk and disc, as used in this application, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), floppy disk and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers.
It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do 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.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In summary, the video file compression method provided by the application can effectively reduce the code stream and ensure high fidelity image quality. In the application, the data size of the added image blocks is far lower than that of the compressed image blocks obtained by the traditional method. Wherein, compared with YUV222 format, the data size is only half of that; compared with the YUV444 format, the data size is only 1/3, but the information amount carried by the compression method of the application is equivalent to that of the YUV444 format. Taking 8K video as an example, the image block of each color attribute is equivalent to the YUV400 format of 4K video with only luminance information, and the data amount is only half of that compared with the YUV422 format. Since the compression method in the present application can effectively reduce the data amount, the 8k video can be encoded by the encoder in the prior art. Similarly, according to the compression method of the present application, 4K video may be encoded by a 2K video encoder, or 16K video may be encoded by an 8K video encoder. In addition, the code flow rate generated by the compression method can be controlled to be about half of YUV422, namely 24-80 Mbps, and the up stable peak value between the current 5G is 90Mbps, so that 8K video can be transmitted in real time by 5G, and meanwhile, high-fidelity image quality is achieved.
The above embodiments are merely illustrative of the principles and utilities of the present application and are not intended to limit the application. Any person skilled in the art can modify or change the above-described embodiments without departing from the spirit and scope of the present application. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical concepts disclosed in the present application shall be covered by the claims of the present application.

Claims (16)

1. A compression method for obtaining a video file, comprising the steps of:
acquiring a plurality of image data to be compressed according to a time sequence; the image data is used to display video images of UHD4K and above pixels;
dividing the image data into a plurality of image blocks based on the color attribute of each pixel in the image data, wherein each image block only contains one color attribute, and mapping the color value of each pixel in each image data to each pixel position in the plurality of image blocks respectively so as to enable each pixel in the image data to have relevance with each pixel in the image blocks;
filling other digits in each pixel position in the image block with 0, and compressing the image block which corresponds to each image data in the plurality of image data and has the same color attribute to obtain a video file; compressing image blocks corresponding to each of the plurality of image data and having the same color attribute comprises encoding the image blocks.
2. The method of claim 1, wherein in the case that each pixel in the image data represents a single color attribute, the step of mapping the color value of each pixel in each image data to the pixel position in each image block respectively based on the color attribute of each pixel in the image data comprises:
traversing the image data in a color format set based on a Bayer format in the image data;
during traversal, extracting a color value of each pixel from the image data based on the color attribute of each pixel in the color format, and mapping to a pixel position in a corresponding image block.
3. The compression method for obtaining a video file according to claim 1, wherein in the case where each pixel in the image data represents an RGB color attribute; the step of mapping the color value of each pixel in each image data to each pixel position in the plurality of image blocks based on the color attribute of each pixel in the image data comprises:
traversing the image data in a color format set based on a pixel row format in the image data;
wherein, during traversal, based on the color attribute of each pixel in the color format, a color principal component or a color fitting component of each pixel is extracted from the image data and mapped to a pixel position in the corresponding image block.
4. The compression method for obtaining video files according to claim 2 or 3, wherein the step of compressing the image blocks corresponding to each of the plurality of image data and having the same color attribute comprises:
and sequentially inputting a plurality of image blocks corresponding to the plurality of image data into a first encoder for compression processing according to the color attributes in the color format.
5. The compression method for obtaining video files according to any one of claims 1 to 3, wherein the step of compressing the image blocks corresponding to each of the plurality of image data and having the same color attribute comprises:
and under synchronous control, a plurality of second encoders are used for respectively compressing a plurality of image blocks with the same color attribute.
6. The compression method for obtaining a video file according to claim 5, wherein the video file obtained by the compression processing using the plurality of second encoders includes synchronization information provided for decompressing the video file to recover a plurality of image data.
7. A method for decompressing a video file, comprising:
acquiring a video file;
decompressing the video file according to the compression mode used by the corresponding video file to obtain a plurality of image blocks; each image block only contains one color attribute, and other digits in each pixel position in the image block are filled with 0; the decompression processing comprises decoding; according to the color attribute of each image block, the obtained plurality of image blocks correspond to each image data in the plurality of image data to be generated;
mapping the color value of each pixel position in each corresponding image block to the pixel of the image data according to the color attribute; the color value of each pixel position in the image data represents a single color attribute;
and generating a video image for displaying the UHD4K and above pixels based on the color value of each pixel in the image data.
8. The method for decompressing a video file according to claim 7, wherein the step of decompressing the video file according to the compression scheme to obtain the plurality of image blocks comprises:
under the synchronous control, decompressing the video file by utilizing a plurality of second decoders according to the color attributes respectively; wherein each second decoder outputs a plurality of image blocks having the same color attribute; wherein each image block corresponds to an image data to be generated.
9. The method of claim 8, wherein each second decoder determines a correspondence between the plurality of decompressed image blocks and image data to be generated according to synchronization information in the video file.
10. The method for decompressing a video file according to claim 7, wherein the step of decompressing the video file according to the compression scheme to obtain the plurality of image blocks comprises:
decompressing the received video file by using a first decoder to obtain a plurality of groups of image blocks divided according to different color attributes in a color format; each image block in each group of image blocks corresponds to image data to be generated.
11. The method for decompressing a video file according to claim 7, wherein the step of mapping the color value of each pixel position in each corresponding image block to a pixel of the image data according to the color attribute comprises:
traversing pixel positions in the image blocks with the color attributes according to the color formats, and mapping color values of corresponding pixel positions in the image blocks to the pixel positions in the corresponding image data during traversal to generate image data; wherein the color value of each pixel location in the image data represents a single color attribute.
12. The method for decompressing a video file according to claim 11, wherein the step of generating a video image for displaying UHD4K and above pixels based on the color value of each pixel mapped in the image data further comprises:
and according to the color format, performing interpolation processing on each pixel position in the obtained image data to obtain a video image containing RGB color attributes in each pixel.
13. A compression apparatus, comprising
A communication interface for communication connection with an external decompression device;
a memory for storing at least one program and image data to be compressed;
a processor for coordinating the communication interface and the memory to execute the program, during which the image data is compressed according to the method for obtaining a video file as claimed in any one of claims 1-6 to obtain a video file.
14. A decompression apparatus, comprising:
the communication interface is used for being in communication connection with external compression equipment;
a memory for storing at least one program and a video file to be decompressed;
a processor for coordinating the communication interface and the memory to execute the program, and performing decompression processing on the video file according to the decompression method of the video file according to any one of claims 7-12 during the execution so as to play the video file.
15. A video transmission system, comprising:
the compression device of claim 13; and
a decompression apparatus according to claim 14.
16. A computer-readable storage medium, comprising: at least one program is stored; -said at least one program, when invoked, executing a compression method for obtaining video files according to any one of claims 1 to 6; alternatively, said at least one program, when invoked, performs a method of decompressing a video file according to any of claims 7-12.
CN201980005157.4A 2019-07-15 2019-07-15 Compression method, decompression method, system and storage medium for obtaining video file Active CN111406404B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/095965 WO2021007742A1 (en) 2019-07-15 2019-07-15 Compression method for obtaining video file, decompression method, system, and storage medium

Publications (2)

Publication Number Publication Date
CN111406404A CN111406404A (en) 2020-07-10
CN111406404B true CN111406404B (en) 2022-07-12

Family

ID=71414906

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201980005157.4A Active CN111406404B (en) 2019-07-15 2019-07-15 Compression method, decompression method, system and storage medium for obtaining video file

Country Status (2)

Country Link
CN (1) CN111406404B (en)
WO (1) WO2021007742A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114189689B (en) * 2021-11-25 2024-02-02 广州思德医疗科技有限公司 Image compression processing method, device, electronic equipment and storage medium
CN115883839B (en) * 2023-03-09 2023-06-06 湖北芯擎科技有限公司 Image verification method, device, equipment and computer readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104284167A (en) * 2013-07-08 2015-01-14 三星显示有限公司 Image capture device, image display device, system and method using same
CN107846589A (en) * 2016-09-19 2018-03-27 上海臻瞳电子科技有限公司 A kind of method for compressing image quantified based on local dynamic station

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10231613B4 (en) * 2002-07-12 2004-12-30 Atvisican Ag Method for compressing and decompressing video image data or the like
CN100502507C (en) * 2006-09-14 2009-06-17 浙江大学 Video data compaction coding method
CN102457722B (en) * 2010-10-26 2014-01-22 珠海全志科技股份有限公司 Processing method and device for Bayer image
CN102075688B (en) * 2010-12-28 2012-07-25 青岛海信网络科技股份有限公司 Wide dynamic processing method for single-frame double-exposure image
BR112018010367A2 (en) * 2015-11-24 2018-12-04 Koninklijke Philips Nv apparatus for combining two images or two image videos, and method for combining two images or two image videos
US10812820B2 (en) * 2016-11-30 2020-10-20 Qualcomm Incorporated Systems and methods for signaling and constraining a high dynamic range (HDR) video system with dynamic metadata

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104284167A (en) * 2013-07-08 2015-01-14 三星显示有限公司 Image capture device, image display device, system and method using same
CN107846589A (en) * 2016-09-19 2018-03-27 上海臻瞳电子科技有限公司 A kind of method for compressing image quantified based on local dynamic station

Also Published As

Publication number Publication date
CN111406404A (en) 2020-07-10
WO2021007742A1 (en) 2021-01-21

Similar Documents

Publication Publication Date Title
US11871011B2 (en) Efficient lossless compression of captured raw image information systems and methods
CN109074161B (en) Hybrid graphics and pixel domain architecture for 360 degree video
CN112219398B (en) Method and apparatus for depth coding and decoding
KR102617258B1 (en) Image processing method and apparatus
KR20160070720A (en) Decoding device and decoding method, and coding device and coding method
US10958950B2 (en) Method, apparatus and stream of formatting an immersive video for legacy and immersive rendering devices
CN104704810A (en) Image capture accelerator
RU2276470C2 (en) Method for compacting and unpacking video data
CN111406404B (en) Compression method, decompression method, system and storage medium for obtaining video file
CN112511896A (en) Video rendering method and device
WO2019199510A1 (en) A method and apparatus for encoding/decoding a point cloud representing a 3d object
US20200195967A1 (en) Point cloud auxiliary information coding
CN111246208B (en) Video processing method and device and electronic equipment
TW201138476A (en) Joint scalar embedded graphics coding for color images
CN105376585B (en) A kind of method that group of picture closes raising transmission of video speed
CN111316644B (en) Image encoding method, decoding method, and applicable devices and systems
WO2016183154A1 (en) Improved color space compression
JP2013518458A (en) Method for transferring information and / or application data in a digital video stream and associated apparatus for generating and playing a video stream
US20230306687A1 (en) Mesh zippering
Ilola et al. Real-time Delivery of Visual Volumetric Video-based Coding Data
CN114513675A (en) Construction method of panoramic video live broadcast system
CN116437123A (en) Image processing method, related device and computer readable storage medium
WO2023180844A1 (en) Mesh zippering
KR20220155823A (en) Device and method for providing video and media play device for synthesizing object and contents
CN116996637A (en) 8K video shooting and recording system and 8K video shooting and recording all-in-one machine

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant