CN115883843A - Encoding method and device, decoding method and device, and system - Google Patents

Encoding method and device, decoding method and device, and system Download PDF

Info

Publication number
CN115883843A
CN115883843A CN202111155677.9A CN202111155677A CN115883843A CN 115883843 A CN115883843 A CN 115883843A CN 202111155677 A CN202111155677 A CN 202111155677A CN 115883843 A CN115883843 A CN 115883843A
Authority
CN
China
Prior art keywords
data
video format
channel data
channel
yuv444
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111155677.9A
Other languages
Chinese (zh)
Inventor
李勇
陈锐凯
赵哲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Cloud Computing Technologies 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 Huawei Cloud Computing Technologies Co Ltd filed Critical Huawei Cloud Computing Technologies Co Ltd
Priority to CN202111155677.9A priority Critical patent/CN115883843A/en
Publication of CN115883843A publication Critical patent/CN115883843A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Color Television Systems (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The application discloses a coding method and device, a decoding method and device, and a system, YUV444 video format data to be converted is obtained, the YUV444 video format data comprises first Y channel data, first U channel data and first V channel data, the YUV444 video format data can be recombined according to a YUV420 video format to obtain YUV420 video format data, the data quantity of the YUV444 video format data is the same as that of the YUV420 video format data, the YUV420 video format data comprises second Y channel data, second U channel data and second V channel data, the YUV420 video format data is subjected to data coding to obtain compressed data, so that the compressed data is subjected to data coding and data reduction to obtain the YUV444 video format data, namely, the YUV444 video format data can be coded and decoded in the form of the YUV420 video format data, the YUV444 video format data is displayed by utilizing the YUV444 video format data, better color reduction degree and smoothness are ensured, and user experience is improved.

Description

Encoding method and device, decoding method and device, and system
Technical Field
The present application relates to the field of display, and in particular, to an encoding method and apparatus, a decoding method and apparatus, and a system.
Background
YUV is a video format represented by luminance components (Y components) and chrominance components (U components and V components) together, and can be divided into different types of YUV444, YUV422, YUV420 and the like according to the proportion among the Y components, the U components and the V components, wherein the three components of Y, U and V of the YUV444 video format have the same horizontal and vertical resolution, each pixel position has 3 components, and the Y components, the U components and the V components, namely, each 2x2 luminance component data block corresponds to 12 x2 chrominance U component data block and 12 x2 chrominance V component data block. In the YUV420 video format, both the U-chrominance component resolution and the V-chrominance component resolution are half the Y-component resolution in terms of horizontal and vertical resolutions, i.e., 1 chrominance U-component data and 1 chrominance V-component data per 2x2 luminance component data block.
Although YUV420 video format has the least chrominance information compared with other video formats, the visual effect of this format is very close to that of other YUV video formats in terms of chrominance perception of human eyes, and because the chrominance information is less and the whole video data amount is less, the YUV420 video format is selected by many video coding standards as the input of video coding, and is widely applied to the fields of digital television, video conference, DVR and the like.
The computer desktop video is video data obtained by collecting and storing computer desktop video signals and is used for recording the operation and the proceeding condition of the computer desktop. Because the resolution and the refresh frequency of the computer desktop are both high, the amount of directly acquired computer desktop video data is huge, and based on bandwidth consideration, the computer desktop video in a region with frequently changed desktop needs to be encoded and compressed to reduce the amount of stored data, and video encoding (H264, H265, and the like) technologies usually adopted by cloud manufacturers are adopted. The mainstream input sources supported by the coding are input in a YUV420 mode, but the input source chrominance is down-sampled, so that the color of the image cannot be restored very high in the decoding process. And most receiving terminals only support hardware decoding of YUV420 based on cost consideration, and clients can only select between fluency and color reduction degree in a scene requiring a high frame rate.
Under the condition, before the desktop video of the computer is coded, the directly collected RGB888 or RGB55 video format is converted into YUV444 video format, and then the YUV444 video format is converted into YUV420 video format which is more suitable for being input by a universal video coder. In order to improve the color reduction degree, the currently common mode is to up-sample YUV420 data into YUV444 by a color hyper-resolution algorithm based on a mode of predicting sampling points with close physical positions, but the prediction mode cannot cover all scenes, and meanwhile, the algorithm must be processed after decoding, so that the subsequent rendering frame rate is affected, the experience fluency is reduced, and poor user experience is caused.
Disclosure of Invention
In view of this, embodiments of the present application provide an encoding method and apparatus, a decoding method and apparatus, and a system, which improve color rendition and smoothness.
In a first aspect of the embodiment of the present application, a coding method is provided, where YUV444 video format data to be converted is obtained, where the YUV444 video format data includes first Y-channel data, first U-channel data, and first V-channel data, and the YUV444 video format data may be recombined according to a YUV420 video format to obtain YUV420 video format data, where the data amounts of the YUV444 video format data and the YUV420 video format data are the same, and the YUV420 video format data includes second Y-channel data, second U-channel data, and second V-channel data, and the YUV420 video format data is subjected to data coding to obtain compressed data, so that the compressed data is subjected to data coding and data reduction to obtain YUV444 video format data, that is, in this embodiment, the YUV444 video format data may be coded and decoded in a form of YUV420 video format data, and on the basis of coding and decoding hardware that is smoothly matched with the existing YUV420 video format data, the YUV444 video format data is used to ensure a color reduction degree, and a better color reduction degree and smoothness are ensured, and a user experience is improved.
In some possible embodiments, the re-composing the YUV444 video format data according to the YUV420 video format to obtain YUV420 video format data includes:
and merging the first Y-channel data and the first U-channel data into second Y-channel data, and dividing the first V-channel data into second U-channel data and second V-channel data.
In the embodiment of the application, the first Y-channel data and the first U-channel data can be merged into the second Y-channel data, and the first V-channel data is divided into the second U-channel data and the second V-channel data, so that the recombination of the YUV444 video format data is realized, the recovery is easy, and the smoothness improvement is facilitated.
In some possible embodiments, the re-composing the YUV444 video format data according to the YUV420 video format to obtain YUV420 video format data includes:
and merging the first Y-channel data and the first V-channel data into second Y-channel data, and dividing the first U-channel data into second U-channel data and second V-channel data.
In the embodiment of the application, the first Y channel data and the first V channel data can be merged into the second Y channel data, and the first U channel data is divided into the second U channel data and the second V channel data, so that the recombination of the YUV444 video format data is realized, and the reduction is easy, which is beneficial to improving the fluency.
In some possible embodiments, the method further comprises:
and transmitting the compressed data.
In the embodiment of the application, the compressed data can be sent so that other devices can decode and restore the compressed data after receiving the compressed data, and therefore the data in the YUV444 video format is displayed, so that the data is coded, decoded and transmitted in the form of YUV420 and displayed in the form of YUV444, and the smoothness is guaranteed while the color restoration degree is improved.
In a second aspect of the embodiments of the present application, there is provided an encoding apparatus, including:
a YUV444 video format data acquisition unit for acquiring YUV444 video format data to be converted; the YUV444 video format data comprises first Y-channel data, first U-channel data and first V-channel data;
the data recombination unit is used for recombining the YUV444 video format data according to the YUV420 video format to obtain YUV420 video format data; the data volume of the YUV444 video format data is the same as that of the YUV420 video format data; the YUV420 video format data comprises second Y-channel data, second U-channel data and second V-channel data;
and the data coding unit is used for carrying out data coding on the YUV420 video format data so as to obtain the YUV444 video format data through data decoding and data recombination.
In some possible embodiments, the data reassembly unit is specifically configured to:
and merging the first Y-channel data and the first U-channel data into second Y-channel data, and dividing the first V-channel data into second U-channel data and second V-channel data.
In some possible embodiments, the data reassembly unit is specifically configured to:
and merging the first Y-channel data and the first V-channel data into second Y-channel data, and dividing the first U-channel data into second U-channel data and second V-channel data.
In some possible embodiments, the apparatus further comprises:
a communication unit for transmitting the compressed data.
In a third aspect of the embodiments of the present application, a decoding method is provided, including:
acquiring compressed data to be decoded;
decoding the compressed data to obtain YUV420 video format data; the YUV420 video format data is obtained by recombining YUV444 video format data, and the YUV420 video format data comprises second Y-channel data, second U-channel data and second V-channel data;
reducing the YUV420 video format data according to a YUV444 video format to obtain YUV444 video format data; the data volume of the YUV444 video format data is the same as that of the YUV420 video format data; the YUV444 video format data comprises first Y-channel data, first U-channel data and first V-channel data; the YUV420 video format data is restored in a manner corresponding to the YUV444 video format data reorganization manner.
In some possible embodiments, the reducing the YUV420 video format data according to the YUV444 video format to obtain YUV444 video format data includes:
and dividing the second Y-channel data into first Y-channel data and first U-channel data, and merging the second U-channel data and the second V-channel data into first V-channel data.
In some possible embodiments, the reducing the YUV420 video format data according to the YUV444 video format to obtain YUV444 video format data includes:
and dividing the second Y-channel data into first Y-channel data and first V-channel data, and merging the second V-channel data and the second U-channel data into first U-channel data.
In some possible embodiments, the obtaining compressed data to be decoded includes:
compressed data to be decoded is received.
In a fourth aspect of embodiments of the present application, there is provided a decoding apparatus, including:
a compressed data acquisition unit for acquiring compressed data to be decoded;
the data decoding unit is used for decoding the compressed data to obtain YUV420 video format data; the YUV420 video format data is obtained by recombining YUV444 video format data, and the YUV420 video format data comprises second Y-channel data, second U-channel data and second V-channel data;
the data reduction unit is used for reducing the YUV420 video format data according to the YUV444 video format to obtain YUV444 video format data; the data volume of the YUV444 video format data is the same as that of the YUV420 video format data; the YUV444 video format data comprises first Y-channel data, first U-channel data and first V-channel data; the YUV420 video format data is restored in a manner corresponding to the YUV444 video format data reorganization manner.
In some possible embodiments, the data restoring unit is specifically configured to:
and dividing the second Y-channel data into first Y-channel data and first U-channel data, and merging the second U-channel data and the second V-channel data into first V-channel data.
In some possible embodiments, the data restoring unit is specifically configured to:
and dividing the second Y-channel data into first Y-channel data and first V-channel data, and merging the second V-channel data and the second U-channel data into first U-channel data.
In some possible embodiments, the compressed data acquisition unit is specifically configured to: compressed data to be decoded is received.
In a fifth aspect of the embodiments of the present application, a system is provided, which includes an encoding device and a decoding device, where the encoding device is configured to execute the encoding method, and the decoding device is configured to execute the decoding method.
In some possible embodiments, the encoding device is a virtual machine and the decoding device is a client.
According to the technical scheme, the embodiment of the application has the following advantages:
the embodiment of the application provides an encoding method and device, a decoding method and device, and a system, to-be-converted YUV444 video format data is obtained, the YUV444 video format data comprises first Y channel data, first U channel data and first V channel data, the YUV444 video format data can be recombined according to a YUV420 video format to obtain YUV420 video format data, the data volume of the YUV444 video format data is the same as that of the YUV420 video format data, the YUV420 video format data comprises second Y channel data, second U channel data and second V channel data, the YUV420 video format data is subjected to data encoding to obtain compressed data, so that the YUV444 video format data is obtained by performing data encoding and data reduction on the compressed data, namely, the YUV444 video format data can be encoded and decoded in the form of the YUV420 video format data, and on the basis of smoothly matching the existing YUV420 video format data, the YUV444 video format data is used for ensuring the color reduction degree, meanwhile, better color reduction degree and smoothness are ensured, and user experience degree is improved.
Drawings
In order that the detailed description of the present application may be clearly understood, a brief description of the drawings that will be used when describing the detailed description of the present application will be provided. It is to be understood that these drawings are merely some of the illustrative embodiments of the present application.
Fig. 1 is a schematic flowchart of an encoding method according to an embodiment of the present application;
FIG. 2 is a diagram illustrating data conversion according to an embodiment of the present application;
FIG. 3 is a schematic diagram of another data transformation in an embodiment of the present application;
fig. 4 is a flowchart illustrating a decoding method according to an embodiment of the present application;
FIG. 5 is a schematic diagram of yet another data transformation in an embodiment of the present application;
FIG. 6 is a diagram illustrating still another example of data conversion according to the present application;
fig. 7 is a block diagram of an encoding apparatus according to an embodiment of the present disclosure;
fig. 8 is a block diagram of a decoding apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a system according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides an encoding method and device, a decoding method, device and system, and improves color reproduction and smoothness.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
YUV is a video format represented by luminance components (Y components) and chrominance components (U components and V components) together, and can be divided into different types of YUV444, YUV422, YUV420 and the like according to the proportion among the Y components, the U components and the V components, wherein the three components of Y, U and V of the YUV444 video format have the same horizontal and vertical resolution, each pixel position has 3 components, and the Y components, the U components and the V components, namely, each 2x2 luminance component data block corresponds to 12 x2 chrominance U component data block and 12 x2 chrominance V component data block. In the YUV420 video format, the U chrominance component resolution and the V chrominance component resolution are both half the Y component resolution in terms of horizontal and vertical resolution, i.e., 1 chrominance U component data and 1 chrominance V component data per 2x2 block of luminance component data.
The computer desktop video is video data obtained by collecting and storing computer desktop video signals and is used for recording the operation and the proceeding condition of the computer desktop. Because the resolution and the refresh frequency of a computer desktop are both high, the directly acquired computer desktop video data volume is huge, based on bandwidth consideration, the computer desktop video in a region with frequently changed desktop needs to be encoded and compressed to reduce the stored data volume, however, the mainstream input source of data encoding is input in a YUV420 mode, but the input source has down-sampling, so that the color of an image cannot be well restored in the decoding process, and based on cost consideration, most of receiving terminals only support hardware decoding of YUV420, and under the scene requiring a high frame rate, a client can only select between fluency and color restoration degree.
Under the condition, before the desktop video of the computer is coded, the directly collected RGB888 or RGB55 and other RGB video formats are converted into YUV444 video formats, and then the YUV444 video formats are converted into YUV420 video formats which are more suitable for being input by a universal video coder. In the process of converting the commonly used YUV444 video format of the universal video into the YUV420 video format, the chrominance components are converted into 1 corresponding chrominance data of the YUV420 format from each 2x2 chrominance data block in the YUV444 format data, so that half-scale reduction conversion of the resolution in the horizontal direction and the vertical direction is realized, and only the original 1/4 data is reserved.
In order to improve the color rendition degree, a currently more common way is to perform upsampling on YUV420 data to YUV444 by using a color hyper-segmentation algorithm based on a prediction way of sampling points with close physical positions, for example, a lost pixel value can be restored by using an interpolation way, however, this inevitably results in that a single-pixel linear type cannot be restored, for example, U channel data of 4 adjacent pixels in a natural image is [63, 64, 65, 66] can be reduced to [63, 64, 65, \8230 ] through compression to [62, 65] and then can be reduced to [63, 64, 65, \8230 ] through interpolation, the reduction is successful, the U channel data of 4 adjacent pixel points in the character graph is [0, 255, 0], the U channel data is compressed to [0,0] and then can be reduced to [0, \8230 ] through interpolation, and the reduction is unsuccessful.
Of course, in the process of obtaining YUV420 by down-sampling, Y-channel data is not down-sampled, and where the Y-channel jumps, the U-channel and the V-channel also jump at a large probability, so it can be established that U = F U (Y) and V = F V (Y) the functional relationship between U channel and V channel is restored by the value of Y channel, for example, the Y channel data for 4 adjacent pixels in the character graph is [0, 255,0]Become [0, 255, 0] after compression]By reduction to [0, 255,0],U=F U (Y) = 1Y +0, then for [0, 255,0]Becomes [0,0] after compression]And then using F U (Y) performing data reduction to obtain [0, 255,0, \8230]And the data is successfully restored.
However, the above way of up-sampling YUV420 data into YUV444 cannot cover all scenes, and meanwhile, the algorithm must be processed after decoding, which affects the subsequent rendering frame rate, resulting in reduced fluency of experience and poor user experience.
Based on the above technical problem, an embodiment of the present application provides an encoding method and apparatus, a decoding method and apparatus, and a system, to obtain YUV444 video format data to be converted, where the YUV444 video format data includes first Y-channel data, first U-channel data, and first V-channel data, and the YUV444 video format data may be recombined according to a YUV420 video format to obtain YUV420 video format data, and the data amount of the YUV444 video format data is the same as that of the YUV420 video format data, and the YUV420 video format data includes second Y-channel data, second U-channel data, and second V-channel data, and the YUV420 video format data is subjected to data encoding to obtain compressed data, so that the YUV444 video format data is subjected to data encoding and data reduction to obtain 444 video format data, that is to be encoded and decoded in a form of the YUV420 video format data, and on the basis of smoothly matching the YUV420 video format data, the YUV444 video format data is used to ensure color reduction, and at the same time, ensure better color reduction and better user experience, and improve user fluency.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, embodiments accompanying the present application are described in detail below with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of an encoding method provided in the embodiment of the present application is shown, where the encoding method may be applied to an encoding device, and the encoding device may be a Windows virtual machine, and the method may include:
s101, acquiring YUV444 video format data to be converted.
In the embodiment of the application, YUV444 video format data to be converted can be obtained, the YUV444 video format data can be virtual desktop display data, the width of one frame of YUV444 video format data can be represented as w, and the height can be represented as h. Referring to fig. 2 and fig. 3, the two data conversions in the embodiment of the present application are illustrated, where the left side is a structure of YUV444 video format data, and the right side is a structure of YUV420 video format data, the YUV444 video format data includes first Y channel data (Y), first U channel data (U), and first V channel data (V), where each 2x2 data block in the first Y channel data corresponds to 2x2 data blocks in the first U channel data and 2x2 data blocks in the first V channel data, and then the first Y channel data, the first U channel data, and the first V channel data have the same number of data blocks, that is, have the same data amount.
S102, the YUV444 video format data is recombined according to the YUV420 video format to obtain the YUV420 video format data.
In the embodiment of the application, the YUV444 video format data can be recombined according to the YUV420 video format to obtain the YUV420 video format data, wherein the YUV444 video format data and the YUV420 video format data can have the same data amount, the obtained YUV420 video format data has the YUV420 video format, but the substantial content of the YUV420 video format data is the content of the YUV444 video format data, the YUV420 video format data can be called pseudo YUV420 data (FakeYUV 420), that is, the YUV444 video format data can be disguised as the YUV420 video format data to be matched with the existing encoder.
Referring to fig. 2 and 3, the YUV420 video format data includes second Y-channel data (FakeY), second U-channel data (FakeU), and second V-channel data (FakeV), where each 2 × 2 data block in the second Y-channel data corresponds to 1 data block in the second U-channel data, and 1 data block in the second V-channel data, and then the data block of the second Y-channel data is four times as large as the data block of the second U-channel data, and is also four times as large as the data block of the second V-channel data, that is, the data amount of the second Y-channel data is four times as large as the data amounts of the second U-channel data and the second V-channel data.
The width of a frame of YUV420 video format data can be the same as that of a frame of YUV444 video format data, namely the width of a frame of YUV420 video format data can also be represented as w, and the width of a frame of YUV420 video format data can be twice that of a frame of YUV444 video format data, namely the width of a frame of YUV420 video format data can be represented as 2h.
In the embodiment of the application, the YUV444 video format data is recombined by using a recombination algorithm, and the data in the YUV444 video format data can be recombined into the data in the YUV420 video format data by using the recombination algorithm.
Specifically, referring to fig. 2, the first Y-channel data and the first U-channel data may be merged into the second Y-channel data (FakeY), the first V-channel data may be divided into the second U-channel data (FakeU) and the second V-channel data (FakeV), a data block of the second Y-channel data obtained in this way is four times as large as a data block of the second U-channel data and four times as large as a data block of the second V-channel data, and a data amount sum of the first Y-channel data, the first U-channel data, and the first V-channel data is equal to a data amount sum of the second Y-channel data, the second U-channel data, and the second V-channel data.
Specifically, referring to fig. 3, the first Y-channel data and the first V-channel data may be merged into second Y-channel data (FakeY), the first U-channel data is divided into second U-channel data (FakeU) and second V-channel data (FakeV), a data block of the second Y-channel data obtained in this way is four times as large as a data block of the second U-channel data and four times as large as a data block of the second V-channel data, and a sum of data amounts of the first Y-channel data, the first U-channel data, and the first V-channel data is equal to a sum of data amounts of the second Y-channel data, the second U-channel data, and the second V-channel data.
The above provides two ways of reconstructing YUV444 video format data to obtain YUV420 video format data, and there are other ways in actual operation, for example, merging the first U-channel data and the first V-channel data into the second Y-channel data, dividing the first Y-channel data into the second U-channel data and the second V-channel data, and so on.
S103, carrying out data coding on the YUV420 video format data to obtain compressed data.
In the embodiment of the application, after the YUV444 video format data is recombined to obtain the YUV420 video format data, the YUV420 video format data can be subjected to data coding to obtain compressed data, the data coding can be realized by using a hardware coder, and the hardware coder is usually used for coding the YUV420 video format data, so that the hardware performance can be fully utilized, and the high frame rate expression is realized for scenes with 4K and higher resolution.
Because the compressed data is obtained by recombining and encoding the YUV444 video format data, the compressed data can be subjected to data decoding and data reduction to obtain the YUV444 video format data, and thus the video format data is subjected to encoding, decoding and transmission in the YUV420 video format and displayed in the YUV444 video format, which is beneficial to improving the color reduction degree and achieving the color reduction enhancement (color enhancement) effect. Namely, the data coding mode can ensure the color reduction degree and simultaneously realize higher frame rate, thereby achieving better fluency.
After the YUV420 video format data is subjected to data coding to obtain compressed data, the compressed data can be sent, so that the device receiving the compressed data performs data decoding and data reduction on the compressed data to obtain YUV444 video format data, for example, the compressed data is sent to the client.
The embodiment of the application provides a coding method, YUV444 video format data to be converted is obtained, the YUV444 video format data comprises first Y channel data, first U channel data and first V channel data, the YUV444 video format data can be recombined according to a YUV420 video format to obtain YUV420 video format data, the data quantity of the YUV444 video format data is the same as that of the YUV420 video format data, the YUV420 video format data comprises second Y channel data, second U channel data and second V channel data, the YUV420 video format data is subjected to data coding to obtain compressed data, so that the compressed data is subjected to data coding and data reduction to obtain the YUV444 video format data, namely, the YUV444 video format data can be coded and decoded in a YUV420 video format data mode, on the basis of successfully matching the existing YUV420 video format data, the YUV444 video format data is used for guaranteeing the color reduction degree, meanwhile, the good color reduction degree and smoothness are guaranteed, and user experience is improved.
Referring to fig. 4, a flowchart of a decoding method provided in an embodiment of the present application is shown, where the decoding method may be applied to a decoding device, and the decoding device may be a client, and the method may include:
s201, obtaining compressed data to be decoded.
In the embodiment of the present application, compressed data to be decoded may be obtained, where the compressed data may be obtained by using the foregoing encoding method, that is, by recombining YUV444 video format data to obtain YUV420 video format data and encoding the YUV420 video format data. The obtaining of the compressed data to be decoded may specifically be receiving the compressed data to be decoded, for example, receiving the compressed data to be decoded from the virtual machine.
S202, decoding the compressed data to obtain YUV420 video format data.
After the compressed data is obtained, the compressed data can be decoded, and because the compressed data is obtained by encoding the YUV420 video format data, the YUV420 video format data can be obtained after the compressed data is decoded. The decoding of the compressed data can be realized by using a hardware decoder, and the hardware decoder is usually used for decoding YUV420 video format data, so that the hardware performance can be fully utilized, and the high frame rate performance is realized for scenes with 4K and higher resolution.
The YUV420 video format data obtained by decoding the compressed data is obtained by recombining the YUV444 video format data, and the YUV420 video format data and the YUV444 video format data before recombination can have the same data amount, that is, the YUV420 video format data obtained by decoding can have the YUV420 video format, but the substantial content is the content of the YUV444 video format data, that is, the YUV420 video format data is pseudo YUV420 data (FakeYUV 420), and the recombination of the data is favorable for matching with the existing decoder.
Referring to fig. 5 and fig. 6, which are schematic diagrams of two data conversions in the embodiment of the present application, the left side is a structure of YUV420 video format data, and the right side is a structure of YUV444 video format data, where the YUV420 video format data includes second Y-channel data (FakeY), second U-channel data (FakeU), and second V-channel data (FakeV), where each 2 × 2 data block in the second Y-channel data corresponds to 1 data block in the second U-channel data, and 1 data block in the second V-channel data, so that a data block of the second Y-channel data is four times as large as a data block of the second U-channel data, and is also four times as large as a data block of the second V-channel data, that is, a data amount of the second Y-channel data is four times as large as a data amount of the second U-channel data and the second V-channel data.
Specifically, the width of a frame of YUV420 video format data can be represented as w, and the height can be represented as 2h.
S203, the YUV420 video format data is restored according to the YUV444 video format to obtain YUV444 video format data.
After the compressed data is decoded to obtain YUV420 video format data, the YUV420 video format data can be reduced according to the YUV video format to obtain YUV444 video format data, and the obtained YUV444 video format data and the YUV420 video format data have the same data volume, so that the video format data is coded, decoded and transmitted in the YUV420 video format and displayed in the YUV444 video format, the color reduction degree is favorably improved, a higher frame rate can be realized, and better fluency is achieved.
The obtained YUV444 video format data can be virtual desktop display data, wherein a frame of YUV444 video format data can be obtained after a frame of YUV420 video format data is restored, the width of the frame of YUV420 video format data can be the same as that of the frame of YUV444 video format data, namely the width of the frame of YUV444 video format data can also be represented as w, the width of the frame of YUV420 video format data can be twice that of the frame of YUV444 video format data, namely the width of the frame of YUV444 video format data can be represented as h.
Referring to fig. 5 and 6, the YUV444 video format data includes first Y-channel data (Y), first U-channel data (U), and first V-channel data (V), where each 2x2 data block in the first Y-channel data corresponds to 2x2 data blocks in the first U-channel data and 2x2 data blocks in the first V-channel data, and then the first Y-channel data, the first U-channel data, and the first V-channel data have the same number of data blocks, that is, have the same data amount.
In the embodiment of the application, the YUV420 video format data is reduced by using a reduction algorithm, and the reduction algorithm corresponds to a YUV444 video format data recombination algorithm, that is, a reduction mode of the YUV420 video format data corresponds to a YUV444 video format data recombination mode.
Specifically, the reassembly method is to merge the first Y-channel data and the first U-channel data into the second Y-channel data (FakeY), and when the first V-channel data is divided into the second U-channel data (FakeU) and the second V-channel data (FakeV), as shown in fig. 5, the reduction method may be to divide the second Y-channel data into the first Y-channel data and the first U-channel data, and merge the second U-channel data and the second V-channel data into the first V-channel data, so that the obtained data blocks of the first Y-channel data, the first U-channel data, and the first V-channel data are the same in number, and the sum of the data amounts of the first Y-channel data, the first U-channel data, and the first V-channel data is equal to the sum of the data amounts of the second Y-channel data, the second U-channel data, and the second V-channel data.
Specifically, the reassembly method is to merge the first Y-channel data and the first V-channel data into the second Y-channel data (FakeY), and when the first U-channel data is divided into the second U-channel data (FakeU) and the second V-channel data (FakeV), as shown in fig. 6, the restoration method is to divide the second Y-channel data into the first Y-channel data and the first V-channel data, and merge the second U-channel data and the second V-channel data into the first U-channel data, so that the obtained data blocks of the first Y-channel data, the first U-channel data, and the first V-channel data are the same in number, and the sum of the data amounts of the first Y-channel data, the first U-channel data, and the first V-channel data is equal to the sum of the data amounts of the second Y-channel data, the second U-channel data, and the second V-channel data.
When the reassembly mode is another mode, there may be another corresponding restoration mode, for example, the reassembly mode is to merge the first U-channel data and the first V-channel data into the second Y-channel data, when the first Y-channel data is divided into the second U-channel data and the second V-channel data, the restoration mode is to divide the second Y-channel data into the first U-channel data and the first V-channel data, and merge the second U-channel data and the second V-channel data into the first Y-channel data.
After the YUV444 video format data is obtained, the YUV444 video format data can be used for displaying, and specifically, operations such as window rendering can be performed to perform desktop display.
In the embodiment of the application, the data recombination is set before encoding, the data restoration is set after decoding, and under the condition that a hardware encoder and a decoder exist, the post-processing time consumption is less, and the minimum delay of the whole experience can be ensured. By means of data reconstruction and data restoration, the peak signal to noise ratio (psnr) of an image is increased from 24 to more than 30 in terms of display quality, the color enhancement effect is better, a higher frame rate can be realized under the same resolution ratio in terms of frame rate, and the color enhancement bandwidth can be increased by 30% under the condition that the psnr is close.
The embodiment of the application provides a decoding method, compressed data to be decoded is obtained, the compressed data is decoded to obtain YUV420 video format data, the YUV420 video format data is reduced according to a YUV444 video format to obtain YUV444 video format data, the YUV444 video format data comprises first Y channel data, first U channel data and first V channel data, the data volume of the YUV444 video format data is the same as that of the YUV420 video format data, the YUV420 video format data comprises second Y channel data, second U channel data and second V channel data, namely, the YUV444 video format data can be coded and decoded in the form of the YUV420 video format data, on the basis of successfully matching with the existing coding and decoding hardware of the YUV420 video format data, the YUV444 video format data is used for guaranteeing the color reduction degree, meanwhile, the good color reduction degree and the smoothness degree are guaranteed, and user experience is improved.
Based on the encoding method provided in the foregoing embodiment, an embodiment of the present application further provides an encoding apparatus, which is shown in fig. 7 and is a structural block diagram of the encoding apparatus provided in the embodiment of the present application, and the apparatus includes:
a YUV444 video format data obtaining unit 110, configured to obtain YUV444 video format data to be converted; the YUV444 video format data comprises first Y-channel data, first U-channel data and first V-channel data;
the data restructuring unit 120 is configured to restructure the YUV444 video format data according to a YUV420 video format to obtain YUV420 video format data; the data volume of the YUV444 video format data is the same as that of the YUV420 video format data; the YUV420 video format data comprises second Y-channel data, second U-channel data and second V-channel data;
a data encoding unit 130, configured to perform data encoding on the YUV420 video format data, so as to obtain the YUV444 video format data through data decoding and data reassembly.
In some possible embodiments, the data reassembly unit is specifically configured to:
and merging the first Y-channel data and the first U-channel data into second Y-channel data, and dividing the first V-channel data into second U-channel data and second V-channel data.
In some possible embodiments, the data reorganization unit is specifically configured to:
and merging the first Y-channel data and the first V-channel data into second Y-channel data, and dividing the first U-channel data into second U-channel data and second V-channel data.
In some possible embodiments, the apparatus further comprises:
a communication unit for transmitting the compressed data.
The embodiment of the application provides a coding device, YUV444 video format data to be converted is obtained, the YUV444 video format data comprises first Y-channel data, first U-channel data and first V-channel data, the YUV444 video format data can be recombined according to the YUV420 video format to obtain YUV420 video format data, the data quantity of the YUV444 video format data and the YUV420 video format data is the same, the YUV420 video format data comprises second Y-channel data, second U-channel data and second V-channel data, the YUV420 video format data is subjected to data coding to obtain compressed data, so that the compressed data is subjected to data coding and data reduction to obtain the YUV444 video format data, namely, the YUV444 video format data can be coded and decoded in the form of the YUV420 video format data, on the basis of successfully matching the coding and decoding hardware of the existing YUV420 video format data, the YUV video format data is used for guaranteeing the color reduction degree, meanwhile, the good color reduction degree and smoothness are guaranteed, and user experience is improved.
Based on the decoding method provided in the foregoing embodiment, an embodiment of the present application further provides a decoding apparatus, which is shown in fig. 8 and is a structural block diagram of the decoding apparatus provided in the embodiment of the present application, and the apparatus includes:
a compressed data acquisition unit 210 for acquiring compressed data to be decoded;
a data decoding unit 220, configured to decode the compressed data to obtain YUV420 video format data; the YUV420 video format data is obtained by recombining YUV444 video format data, and the YUV420 video format data comprises second Y-channel data, second U-channel data and second V-channel data;
the data reduction unit 230 is configured to reduce the YUV420 video format data according to a YUV444 video format to obtain YUV444 video format data; the data volume of the YUV444 video format data is the same as that of the YUV420 video format data; the YUV444 video format data comprises first Y-channel data, first U-channel data and first V-channel data; the YUV420 video format data is restored in a manner corresponding to the YUV444 video format data reorganization manner.
In some possible embodiments, the data restoring unit is specifically configured to:
and dividing the second Y-channel data into first Y-channel data and first U-channel data, and merging the second U-channel data and the second V-channel data into first V-channel data.
In some possible embodiments, the data restoring unit is specifically configured to:
and dividing the second Y-channel data into first Y-channel data and first V-channel data, and merging the second V-channel data and the second U-channel data into first U-channel data.
In some possible embodiments, the compressed data acquisition unit is specifically configured to: compressed data to be decoded is received.
The embodiment of the application provides a decoding device, compressed data to be decoded is obtained, the compressed data is decoded to obtain YUV420 video format data, the YUV420 video format data is reduced according to a YUV444 video format to obtain YUV444 video format data, the YUV444 video format data comprises first Y channel data, first U channel data and first V channel data, the data volume of the YUV444 video format data is the same as that of the YUV420 video format data, the YUV420 video format data comprises second Y channel data, second U channel data and second V channel data, namely, the YUV444 video format data can be coded and decoded in the form of the YUV420 video format data, on the basis of successfully matching with the existing coding and decoding hardware of the YUV420 video format data, the YUV444 video format data is used for guaranteeing the color reduction degree, meanwhile, the good color reduction degree and the smoothness degree are guaranteed, and user experience is improved.
Based on the encoding method and the decoding method provided by the embodiment of the present application, the embodiment of the present application further provides a system, which includes an encoding device 10 and a decoding device 20, where the encoding device 10 is configured to execute the foregoing encoding method, and the decoding device 20 is configured to execute the foregoing decoding method, and specifically, the encoding device 10 may be a virtual machine, and the decoding device 20 may be a client.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above is a specific implementation of the present application. It should be understood that the above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (18)

1. A method of encoding, comprising:
acquiring YUV444 video format data to be converted; the YUV444 video format data comprises first Y-channel data, first U-channel data and first V-channel data;
recombining the YUV444 video format data according to a YUV420 video format to obtain YUV420 video format data; the data volume of the YUV444 video format data is the same as that of the YUV420 video format data; the YUV420 video format data comprises second Y-channel data, second U-channel data and second V-channel data;
and carrying out data coding on the YUV420 video format data to obtain compressed data so as to carry out data decoding and data reduction on the compressed data to obtain the YUV444 video format data.
2. The method of claim 1, wherein said re-assembling said YUV444 video format data according to YUV420 video format to obtain YUV420 video format data comprises:
and merging the first Y-channel data and the first U-channel data into second Y-channel data, and dividing the first V-channel data into second U-channel data and second V-channel data.
3. The method of claim 1, wherein the re-organizing the YUV444 video format data according to the YUV420 video format to obtain YUV420 video format data comprises:
and merging the first Y-channel data and the first V-channel data into second Y-channel data, and dividing the first U-channel data into second U-channel data and second V-channel data.
4. The method according to any one of claims 1-3, further comprising:
and transmitting the compressed data.
5. An encoding apparatus, comprising:
a YUV444 video format data acquisition unit for acquiring YUV444 video format data to be converted; the YUV444 video format data comprises first Y-channel data, first U-channel data and first V-channel data;
the data recombination unit is used for recombining the YUV444 video format data according to the YUV420 video format to obtain YUV420 video format data; the data volume of the YUV444 video format data is the same as that of the YUV420 video format data; the YUV420 video format data comprises second Y-channel data, second U-channel data and second V-channel data;
and the data coding unit is used for carrying out data coding on the YUV420 video format data so as to obtain the YUV444 video format data through data decoding and data recombination.
6. The apparatus according to claim 5, wherein the data reassembly unit is specifically configured to:
and merging the first Y-channel data and the first U-channel data into second Y-channel data, and dividing the first V-channel data into second U-channel data and second V-channel data.
7. The apparatus according to claim 5, wherein the data reassembly unit is specifically configured to:
and merging the first Y-channel data and the first V-channel data into second Y-channel data, and dividing the first U-channel data into second U-channel data and second V-channel data.
8. The apparatus of any one of claims 5-7, further comprising:
a communication unit for transmitting the compressed data.
9. A method of decoding, comprising:
acquiring compressed data to be decoded;
decoding the compressed data to obtain YUV420 video format data; the YUV420 video format data is obtained by recombining YUV444 video format data, and the YUV420 video format data comprises second Y-channel data, second U-channel data and second V-channel data;
restoring the YUV420 video format data according to the YUV444 video format to obtain YUV444 video format data; the data volume of the YUV444 video format data is the same as that of the YUV420 video format data; the YUV444 video format data comprises first Y-channel data, first U-channel data and first V-channel data; the YUV420 video format data is restored in a manner corresponding to the YUV444 video format data reorganization manner.
10. The method of claim 9, wherein the recovering the YUV420 video format data according to the YUV444 video format to obtain YUV444 video format data comprises:
and dividing the second Y-channel data into first Y-channel data and first U-channel data, and merging the second U-channel data and the second V-channel data into first V-channel data.
11. The method of claim 9, wherein the recovering the YUV420 video format data according to the YUV444 video format to obtain YUV444 video format data comprises:
and dividing the second Y-channel data into first Y-channel data and first V-channel data, and merging the second V-channel data and the second U-channel data into first U-channel data.
12. The method according to any of claims 9-11, wherein said obtaining compressed data to be decoded comprises:
compressed data to be decoded is received.
13. A decoding apparatus, comprising:
a compressed data acquisition unit for acquiring compressed data to be decoded;
the data decoding unit is used for decoding the compressed data to obtain YUV420 video format data; the YUV420 video format data is obtained by recombining YUV444 video format data, and the YUV420 video format data comprises second Y-channel data, second U-channel data and second V-channel data;
the data reduction unit is used for reducing the YUV420 video format data according to the YUV444 video format to obtain YUV444 video format data; the data volume of the YUV444 video format data is the same as that of the YUV420 video format data; the YUV444 video format data comprises first Y-channel data, first U-channel data and first V-channel data; and the recovery mode of the YUV420 video format data corresponds to the recombination mode of the YUV444 video format data.
14. The apparatus according to claim 13, wherein the data restoring unit is specifically configured to:
and dividing the second Y-channel data into first Y-channel data and first U-channel data, and merging the second U-channel data and the second V-channel data into first V-channel data.
15. The apparatus according to claim 13, wherein the data restoring unit is specifically configured to:
and dividing the second Y-channel data into first Y-channel data and first V-channel data, and merging the second V-channel data and the second U-channel data into first U-channel data.
16. The apparatus according to any of claims 13-15, wherein the compressed data obtaining unit is configured to: compressed data to be decoded is received.
17. A system comprising an encoding device for performing the encoding method of any one of claims 1 to 4 and a decoding device for performing the decoding method of any one of claims 9 to 12.
18. The system of claim 17, wherein the encoding device is a virtual machine and the decoding device is a client.
CN202111155677.9A 2021-09-29 2021-09-29 Encoding method and device, decoding method and device, and system Pending CN115883843A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111155677.9A CN115883843A (en) 2021-09-29 2021-09-29 Encoding method and device, decoding method and device, and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111155677.9A CN115883843A (en) 2021-09-29 2021-09-29 Encoding method and device, decoding method and device, and system

Publications (1)

Publication Number Publication Date
CN115883843A true CN115883843A (en) 2023-03-31

Family

ID=85756497

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111155677.9A Pending CN115883843A (en) 2021-09-29 2021-09-29 Encoding method and device, decoding method and device, and system

Country Status (1)

Country Link
CN (1) CN115883843A (en)

Similar Documents

Publication Publication Date Title
US8630346B2 (en) System and method for introducing virtual zero motion vector candidates in areas of a video sequence involving overlays
US8699574B2 (en) System and method for boundary motion vector correction in motion compensated frame rate
US6665343B1 (en) Methods and arrangements for a converting a high definition image to a lower definition image using wavelet transforms
KR100893276B1 (en) Resolution downscaling of video images
EP1442603A1 (en) Spatial scalable compression scheme using spatial sharpness enhancement techniques
US20090052528A1 (en) Method and Apparatus for Encoding/Decoding Video Signal Using Block Prediction Information
KR20150010903A (en) Method And Apparatus For Generating 3K Resolution Display Image for Mobile Terminal screen
EP1062626A1 (en) Apparatus and method for optimized compression of interlaced motion images
EP1613097A1 (en) Digital video signal compression and decompression method and apparatus
CN110545433B (en) Video encoding and decoding method and device and storage medium
KR20060027778A (en) Method and apparatus for encoding/decoding video signal using base layer
US20070086666A1 (en) Compatible interlaced sdtv and progressive hdtv
TW201540045A (en) Adaptive processing of video streams with reduced color resolution
CN110572673A (en) Video encoding and decoding method and device, storage medium and electronic device
KR100679027B1 (en) Method and apparatus for coding image without DC component loss
CN110572677B (en) Video encoding and decoding method and device, storage medium and electronic device
CN110572672B (en) Video encoding and decoding method and device, storage medium and electronic device
CN114125448A (en) Video encoding method, decoding method and related devices
CN115883843A (en) Encoding method and device, decoding method and device, and system
CN110798705A (en) Video image transmission method, device and equipment
US9049448B2 (en) Bidimensional bit-rate reduction processing
CN110572674A (en) Video encoding and decoding method and device, storage medium and electronic device
Wu et al. Tunneling high-resolution color content through 4: 2: 0 HEVC and AVC video coding systems
KR100374717B1 (en) Method and apparatus for subsampling chrominance signal shape information for interlaced scan type image
CN110636295B (en) Video encoding and decoding method and device, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication