CN114125448B - Video coding method, decoding method and related devices - Google Patents
Video coding method, decoding method and related devices Download PDFInfo
- Publication number
- CN114125448B CN114125448B CN202010903064.8A CN202010903064A CN114125448B CN 114125448 B CN114125448 B CN 114125448B CN 202010903064 A CN202010903064 A CN 202010903064A CN 114125448 B CN114125448 B CN 114125448B
- Authority
- CN
- China
- Prior art keywords
- image
- format
- yuv4
- components
- pixel values
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods 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/186—Methods 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/132—Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/154—Measured or subjectively estimated visual quality after decoding, e.g. measurement of distortion
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
- Color Television Systems (AREA)
Abstract
本申请实施例提供一种视频编码方法、解码方法及相关装置,该方法包括:根据YUV4:4:4格式的图像确定目标格式的第一图像;YUV4:4:4格式的图像中第四部分像素值、第五部分像素值、第六部分像素值分别用于转换为第一图像中的Y分量、U分量、V分量;三部分部分像素值分别占YUV4:4:4格式的图像的像素值总数的2/3、1/6和1/6;对第一图像进行编码,得到第一码流;相应的,视频解码装置解析包括目标格式数据的第一码流,得到第一图像;根据第一图像确定YUV4:4:4格式的图像。这种方法既可兼容目标格式的编/解码器,还能保留YUV4:4:4格式的色彩显示优势。
An embodiment of the present application provides a video encoding method, a decoding method, and a related device, the method including: determining the first image in the target format according to the image in the YUV4:4:4 format; the fourth part in the image in the YUV4:4:4 format The pixel value, the fifth part of the pixel value, and the sixth part of the pixel value are used to convert to the Y component, U component, and V component in the first image respectively; the three parts of the pixel value respectively occupy the pixels of the image in the YUV4:4:4 format 2/3, 1/6 and 1/6 of the total number of values; encode the first image to obtain the first code stream; correspondingly, the video decoding device parses the first code stream including the target format data to obtain the first image; An image in YUV4:4:4 format is determined according to the first image. This method is not only compatible with the codec/decoder of the target format, but also retains the color display advantages of the YUV4:4:4 format.
Description
技术领域technical field
本申请涉及视频编码技术领域,尤其涉及一种视频编码方法、解码方法及相关装置。The present application relates to the technical field of video coding, and in particular, to a video coding method, a decoding method and related devices.
背景技术Background technique
近年来,随着智能手机,智能监控,互联网视频等行业的快速发展,对网络带宽和存储容量的需求越来越大。视频编解码技术可以将原视频数据进行压缩,显著降低对存储和传输带宽的消耗,然后在接收端进行视频解码,最后获得与原视频数据画质接近视角体验。In recent years, with the rapid development of smart phones, smart surveillance, Internet video and other industries, the demand for network bandwidth and storage capacity is increasing. Video codec technology can compress the original video data, significantly reducing the consumption of storage and transmission bandwidth, and then perform video decoding at the receiving end, and finally obtain an experience close to the quality of the original video data.
由于人眼对色度分量的感知能力比亮度分量的感知能力更弱,在大多数场景下,YUV4:2:0格式的图像的显示效果和YUV4:4:4格式的图像的显示效果相近,因此,本领域技术人员通常可以把YUV4:4:4格式的图像的颜色(色度)分量的行和列分别进行1/2下采样,得到YUV4:2:0格式的图像,再进行编码传输。Since the human eye's perception of chroma components is weaker than that of luminance components, in most scenarios, the display effect of images in YUV4:2:0 format is similar to that of images in YUV4:4:4 format. Therefore, those skilled in the art can usually perform 1/2 downsampling on the row and column of the color (chroma) component of the image in YUV4:4:4 format, respectively, to obtain an image in YUV4:2:0 format, and then perform encoding and transmission .
但是,对于特定显示元素,如电脑桌面文字,图标,动画等具有显著色彩边界,或含有大量色彩信息的视频内容,人眼可以明显感知到YUV4:4:4格式的特定显示元素比YUV4:2:0格式的特定元素有更好的色彩显示效果。因此,如何在编码过程中既能兼容YUV4:2:0编码器/NV12编码器,还能保留YUV4:4:4格式的色彩显示优势,是本领域的技术人员正在研究的技术问题。However, for specific display elements, such as computer desktop text, icons, animations, etc., which have significant color boundaries, or video content containing a large amount of color information, the human eye can clearly perceive specific display elements in YUV4:4:4 format than YUV4:2 Certain elements in the :0 format have better color rendering. Therefore, how to be compatible with the YUV4:2:0 encoder/NV12 encoder while retaining the color display advantages of the YUV4:4:4 format during the encoding process is a technical issue being studied by those skilled in the art.
发明内容Contents of the invention
本申请实施例公开了一种视频编码方法、解码方法及相关装置,既可兼容目标格式(如YUV4:2:0)的编/解码器,还能保留YUV4:4:4格式的色彩显示优势。The embodiment of the present application discloses a video coding method, a decoding method and related devices, which are compatible with the coder/decoder of the target format (such as YUV4:2:0), and can also retain the color display advantages of the YUV4:4:4 format .
第一方面,本申请实施例提供一种视频编码方法,该方法包括:根据YUV4:4:4格式的图像确定目标格式的第一图像;其中,该YUV4:4:4格式的图像中第四部分像素值用于转换为该第一图像中的Y分量,该YUV4:4:4格式的图像中第五部分像素值用于转换为该第一图像中的U分量,该YUV4:4:4格式的图像中第六部分像素值用于转换为该第一图像中的V分量;该第四部分像素值、该第五部分像素值和该第六部分像素值分别占该YUV4:4:4格式的图像的像素值总数的2/3、1/6和1/6;该目标格式包括YUV4:2:0、NV12和NV21中的一种;对该第一图像进行编码,得到第一码流。In the first aspect, the embodiment of the present application provides a video encoding method, the method including: determining the first image in the target format according to the image in the YUV4:4:4 format; wherein, the fourth image in the image in the YUV4:4:4 format Part of the pixel value is used to convert to the Y component in the first image, and the fifth part of the pixel value in the image in the YUV4:4:4 format is used to convert to the U component in the first image. The YUV4:4:4 The sixth part of the pixel value in the format image is used to convert to the V component in the first image; the fourth part of the pixel value, the fifth part of the pixel value and the sixth part of the pixel value respectively occupy the YUV4:4:4 2/3, 1/6, and 1/6 of the total number of pixel values of the image in the format; the target format includes one of YUV4:2:0, NV12, and NV21; encode the first image to obtain the first code flow.
采用上述方法,在编码端对YUV4:4:4格式的图像中的Y分量,U分量,V分量进行转换,得到目标格式的图像,然后目标格式(如YUV4:2:0)的编码器对目标格式的图像进行编码;后续在解码端解码出目标格式的图像后,对目标格式的图像中的Y分量,U分量,V分量进行转换,得到YUV4:4:4格式的图像。这种方法既可兼容目标格式的编/解码器,还能保留YUV4:4:4格式的色彩显示优势,同时也降低了色差,以及降低了参考帧管理复杂度。Using the above method, the Y component, U component, and V component in the image of the YUV4:4:4 format are converted at the encoding end to obtain an image of the target format, and then the encoder of the target format (such as YUV4:2:0) pairs The image in the target format is encoded; after the image in the target format is decoded at the decoding end, the Y component, U component, and V component in the image in the target format are converted to obtain an image in the YUV4:4:4 format. This method is not only compatible with the codec/decoder of the target format, but also retains the color display advantages of the YUV4:4:4 format, and also reduces the color difference and the complexity of reference frame management.
结合第一方面,在一种可选的方案中,该根据YUV4:4:4格式的图像确定目标格式的第一图像,包括:将该YUV4:4:4格式的图像存储为目标格式的第一图像,其中,该YUV4:4:4格式的图像中第四部分像素值用于存储为该第一图像中的Y分量,该YUV4:4:4格式的图像中第五部分像素值用于存储为该第一图像中的U分量,该YUV4:4:4格式的图像中第六部分像素值用于存储为该第一图像中的V分量。In conjunction with the first aspect, in an optional solution, determining the first image in the target format according to the image in the YUV4:4:4 format includes: storing the image in the YUV4:4:4 format as the first image in the target format An image, wherein the fourth part of the pixel values in the YUV4:4:4 format image is used to store as the Y component in the first image, and the fifth part of the pixel values in the YUV4:4:4 format image is used for Stored as the U component in the first image, the sixth part of pixel values in the image in the YUV4:4:4 format is used to be stored as the V component in the first image.
结合第一方面,或者第一方面的上述任一种可选的方案,在又一种可选的方案中,该根据YUV4:4:4格式的图像确定目标格式的第一图像之前,还包括:In combination with the first aspect, or any of the above optional solutions of the first aspect, in yet another optional solution, before determining the first image in the target format according to the image in the YUV4:4:4 format, further includes :
将RGB格式的图像转换为该YUV4:4:4格式的图像;若该RGB格式的图像应用于第一场景,根据YUV4:4:4格式的图像确定目标格式的第一图像;若该RGB格式的图像应用于第二场景,对YUV4:4:4格式的图像进行下采样,以及根据YUV4:2:0格式的编码器对下采样后的图像进行编码,得到第二码流;向该视频解码器发送该第二码流;其中,该第二场景的图像分辨率的要求低于该第一场景的图像分辨率的要求。Convert the image in RGB format to the image in the YUV4:4:4 format; if the image in the RGB format is applied to the first scene, determine the first image in the target format according to the image in the YUV4:4:4 format; if the RGB format The image of the image is applied to the second scene, the image in the YUV4:4:4 format is down-sampled, and the image after the down-sampling is encoded according to the encoder in the YUV4:2:0 format to obtain the second code stream; to the video The decoder sends the second code stream; wherein, the image resolution requirement of the second scene is lower than the image resolution requirement of the first scene.
这种方式中,针对图像分辨率的要求较低的场景,采用传统的下采样的方式进行预处理并编码,针对图像分辨率的要求较高的场景,使用不丢失像素值(即不丢失Y分量、U分量和V分量)的方式进行编码,不仅可以最大限度地满足图像分辨率的要求较高的场景对色度的特殊需求,还可以最大限度地减小图像分辨率的要求较低的场景中的编码的数据量。In this method, for scenes with lower image resolution requirements, the traditional downsampling method is used for preprocessing and encoding, and for scenes with higher image resolution requirements, no loss of pixel values (that is, no loss of Y component, U component, and V component), which can not only meet the special requirements for chroma in scenes with high image resolution requirements to the greatest extent, but also minimize the The amount of encoded data in the scene.
结合第一方面,或者第一方面的上述任一种可选的方案,在又一种可选的方案中,该第一场景包括办公文档场景,桌面图标场景,文字场景,LOGO场景中的至少一项;该第二场景包括视频场景,游戏场景,自然风景场景中的至少一项。In combination with the first aspect, or any of the above optional solutions of the first aspect, in another optional solution, the first scene includes at least one of the office document scene, the desktop icon scene, the text scene, and the LOGO scene One; the second scene includes at least one of a video scene, a game scene, and a natural scenery scene.
结合第一方面,或者第一方面的上述任一种可选的方案,在又一种可选的方案中,还包括:若该RGB图像的像素与上一帧RGB图像的像素值的差异超过预设阈值,则将RGB格式的图像转换为该YUV4:4:4格式的图像;若该RGB图像的像素与上一帧RGB图像的像素的差异不超过预设阈值,则向该解码器发送指示信息,该指示信息用于指示该RGB图像的像素与该上一帧RGB图像的像素相同。In combination with the first aspect, or any of the above optional solutions of the first aspect, in another optional solution, it also includes: if the difference between the pixel value of the RGB image and the pixel value of the previous frame RGB image exceeds If the preset threshold value is used, the image in RGB format is converted to the image in YUV4:4:4 format; if the difference between the pixels of the RGB image and the pixels of the previous RGB image does not exceed the preset threshold value, it is sent to the decoder Indication information, where the indication information is used to indicate that the pixels of the RGB image are the same as the pixels of the previous frame of RGB image.
这种方式中,当某一帧RGB图像(也可能是RGB图像中的一部分)与上一帧RGB图像(也可能是RGB图像中的一部分)的像素值相差较小时,就无需对该某一帧RGB图像重新进行编码,直接复用上一帧RGB图像即可,这样能够减小计算压力,提高整体编码效率。In this way, when the pixel values of a frame of RGB image (may also be a part of RGB image) and the previous frame of RGB image (maybe a part of RGB image) have a small difference, there is no need to A frame of RGB image is re-encoded, and the previous frame of RGB image can be directly multiplexed, which can reduce the calculation pressure and improve the overall encoding efficiency.
结合第一方面,或者第一方面的上述任一种可选的方案,在又一种可选的方案中,该根据YUV4:4:4格式的图像确定目标格式的第一图像,包括:将该YUV4:4:4格式的图像转换为NV12格式的过渡图像,其中,该YUV4:4:4格式的图像中第四部分像素值用于转换为该过渡图像中的Y分量,该YUV4:4:4格式的图像中第五部分像素值用于转换为该过渡图像中的U分量,该YUV4:4:4格式的图像中第六部分像素值用于转换为该过渡图像中的V分量,这里提及的转换方式可以是对YUV4:4:4格式的图像中的像素值进行重新定义,例如将U分量重新定义(或者说标记)为Y分量。然后将该NV12格式的过渡图像存储为YUV4:2:0格式的第一图像,将NV12格式的过渡图像存储为YUV4:2:0格式的第一图像属于比较成熟的技术,实现方式有很多,此处不一一列举。结合第一方面,或者第一方面的上述任一种可选的方案,在又一种可选的方案中:该第四部分像素值包括该YUV4:4:4格式的图像中的全部Y分量和全部U分量;该第五部分像素值包括该YUV4:4:4格式的图像中全部V分量的一半;该第六部分像素值包括该YUV4:4:4格式的图像中全部V分量的另一半。In combination with the first aspect, or any of the above optional solutions of the first aspect, in another optional solution, determining the first image in the target format according to the image in the YUV4:4:4 format includes: The image in the YUV4:4:4 format is converted into a transitional image in the NV12 format, wherein the fourth part of the pixel values in the image in the YUV4:4:4 format is used to convert to the Y component in the transitional image, the YUV4:4 The fifth part of the pixel value in the :4 format image is used to convert to the U component in the transition image, and the sixth part of the pixel value in the YUV4:4:4 format image is used to convert to the V component in the transition image. The conversion method mentioned here may be to redefine the pixel values in the image in the YUV4:4:4 format, for example, redefining (or marking) the U component as the Y component. Then store the transition image in NV12 format as the first image in YUV4:2:0 format, and store the transition image in NV12 format as the first image in YUV4:2:0 format, which is a relatively mature technology, and there are many ways to implement it. They are not listed here. In combination with the first aspect, or any of the above optional solutions of the first aspect, in another optional solution: the fourth part of pixel values includes all Y components in the image in the YUV4:4:4 format and all U components; the fifth part of the pixel value includes half of all the V components in the image of the YUV4:4:4 format; the sixth part of the pixel value includes another part of all the V components in the image of the YUV4:4:4 format half.
其中,该全部V分量的一半为该全部V分量中的奇数列的V分量,该全部V分量的另一半为该全部V分量中的偶数列的V分量。Wherein, half of the all V components are V components of odd columns among all the V components, and the other half of all V components are V components of even columns among all V components.
或者,该全部V分量的一半为该全部V分量中的奇数行的V分量,该全部V分量的另一半为该全部V分量中的偶数行的V分量。Alternatively, half of the total V components are V components of odd lines in the total V components, and the other half of the total V components are V components of even lines in the total V components.
第二方面,本申请实施例提供一种视频解码方法,该方法包括:In a second aspect, an embodiment of the present application provides a video decoding method, the method including:
获取包括目标格式数据的第一码流,其中,所述目标格式包括YUV4:2:0、NV12或NV21中的一种或多种的组合;解析该第一码流,得到第一图像;根据该第一图像确定YUV4:4:4格式的图像;其中,该第一图像中第一部分像素值用于转换为该YUV4:4:4格式的图像的Y分量,该第一图像中第二部分像素值用于转换为该YUV4:4:4格式的图像的U分量,该第一图像中第三部分像素值用于转换为该YUV4:4:4格式的图像的V分量;该第一部分像素值、该第二部分像素值和该第三部分像素值各占该第一图像的像素值总数的1/3。Obtaining a first code stream including target format data, wherein the target format includes one or more combinations of YUV4:2:0, NV12 or NV21; parsing the first code stream to obtain a first image; according to The first image determines an image in the YUV4:4:4 format; wherein, the first part of the pixel values in the first image is used to convert to the Y component of the image in the YUV4:4:4 format, and the second part in the first image The pixel value is used to convert to the U component of the image in the YUV4:4:4 format, and the third part of the pixel value in the first image is used to convert to the V component of the image in the YUV4:4:4 format; the first part of the pixels value, the second part of pixel values and the third part of pixel values each account for 1/3 of the total number of pixel values of the first image.
采用上述方法,在编码端对YUV4:4:4格式的图像中的Y分量,U分量,V分量进行转换,得到目标格式的图像,然后目标格式(如YUV4:2:0)的编码器对目标格式的图像进行编码;后续在解码端解码出目标格式的图像后,对目标格式的图像中的Y分量,U分量,V分量进行转换,得到YUV4:4:4格式的图像。这种方法既可兼容目标格式的编/解码器,还能保留YUV4:4:4格式的色彩显示优势,同时也降低了色差,以及降低了参考帧管理复杂度。Using the above method, the Y component, U component, and V component in the image of the YUV4:4:4 format are converted at the encoding end to obtain an image of the target format, and then the encoder of the target format (such as YUV4:2:0) pairs The image in the target format is encoded; after the image in the target format is decoded at the decoding end, the Y component, U component, and V component in the image in the target format are converted to obtain an image in the YUV4:4:4 format. This method is not only compatible with the codec/decoder of the target format, but also retains the color display advantages of the YUV4:4:4 format, and also reduces the color difference and the complexity of reference frame management.
结合第二方面,在第二方面的一种可选的方案中,该根据该第一图像确定YUV4:4:4格式的图像,包括:将该第一图像存储为YUV4:4:4格式的图像,该第一图像中第一部分像素值用于存储为该YUV4:4:4格式的图像的Y分量,该第一图像中第二部分像素值用于存储为该YUV4:4:4格式的图像的U分量,该第一图像中第三部分像素值用于存储为该YUV4:4:4格式的图像的V分量。In conjunction with the second aspect, in an optional solution of the second aspect, determining the image in YUV4:4:4 format according to the first image includes: storing the first image as an image in YUV4:4:4 format Image, the first part of the pixel values in the first image is used to store the Y component of the image in the YUV4:4:4 format, and the second part of the pixel values in the first image is used to store the YUV4:4:4 format The U component of the image, the third part of the pixel values in the first image is used to store as the V component of the image in the YUV4:4:4 format.
结合第二方面,或者第二方面的上述任一种可选的方案,在第二方面的又一种可选的方案中,该第一图像为YUV4:2:0格式的图像,该根据该第一图像确定YUV4:4:4格式的图像,包括:将YUV4:2:0格式的图像存储为NV12格式的过渡图像,该YUV4:2:0格式的图像中第一部分像素值用于存储为该过渡图像的Y分量,该YUV4:2:0格式的图像中第二部分像素值用于存储为该过渡图像的U分量,该YUV4:2:0格式的图像中第三部分像素值用于存储为该过渡图像的V分量,将YUV4:2:0格式的第一图像存储为NV12格式的过渡图像属于比较成熟的技术,实现方式有很多,此处不一一列举。然后,将该过渡图像转换为YUV4:4:4格式的图像,这里提及的转换方式可以是对NV12格式的过渡图像中的像素值进行重新定义,例如将部分Y分量重新定义(或者说标记)为U分量。In combination with the second aspect, or any of the above optional solutions of the second aspect, in yet another optional solution of the second aspect, the first image is an image in YUV4:2:0 format, according to the The first image determines the image in YUV4:4:4 format, including: storing the image in YUV4:2:0 format as a transitional image in NV12 format, and the first part of the pixel values in the image in YUV4:2:0 format are used to store as The Y component of the transition image, the second part of the pixel values in the YUV4:2:0 format image is used to store the U component of the transition image, and the third part of the pixel values in the YUV4:2:0 format image is used for It is relatively mature technology to store the first image in YUV4:2:0 format as the transition image in NV12 format as the V component of the transition image, and there are many implementation methods, which are not listed here. Then, convert the transitional image into an image in YUV4:4:4 format. The conversion method mentioned here can be to redefine the pixel values in the transitional image in NV12 format, for example, redefining part of the Y component (or marking ) is the U component.
结合第二方面,或者第二方面的上述任一种可选的方案,在又一种可选的方案中:该第一部分像素值包括该第一图像中全部Y分量的一半;该第二部分像素值包括该第一图像中全部Y分量的另一半;该第三部分像素值包括该第一图像中全部U分量和全部V分量;In combination with the second aspect, or any of the above optional solutions of the second aspect, in yet another optional solution: the first part of pixel values includes half of all Y components in the first image; the second part The pixel value includes the other half of all Y components in the first image; the third part of pixel values includes all U components and all V components in the first image;
其中,该第一图像中的全部U分量用于作为该YUV4:4:4格式的图像的奇数行V分量,该第一图像中的全部V分量用于作为该YUV4:4:4格式的图像的偶数行V分量;Wherein, all the U components in the first image are used as the odd row V components of the image in the YUV4:4:4 format, and all the V components in the first image are used as the image in the YUV4:4:4 format The even-numbered row V component of ;
或者,该第一图像中的全部U分量用于作为该YUV4:4:4格式的图像的奇数列V分量,该第一图像中的全部V分量用于作为该YUV4:4:4格式的图像的偶数列V分量。Or, all the U components in the first image are used as the odd column V components of the image in the YUV4:4:4 format, and all the V components in the first image are used as the image in the YUV4:4:4 format The even-numbered columns of V components.
第三方面,本申请实施例提供一种视频编码装置,该装置包括:In a third aspect, an embodiment of the present application provides a video encoding device, which includes:
确定单元,用于根据YUV4:4:4格式的图像确定目标格式的第一图像;A determining unit, configured to determine the first image of the target format according to the image of the YUV4:4:4 format;
其中,该YUV4:4:4格式的图像中第四部分像素值用于转换为该第一图像中的Y分量,该YUV4:4:4格式的图像中第五部分像素值用于转换为该第一图像中的U分量,该YUV4:4:4格式的图像中第六部分像素值用于转换为该第一图像中的V分量;该第四部分像素值、该第五部分像素值和该第六部分像素值分别占该YUV4:4:4格式的图像的像素值总数的2/3、1/6和1/6;该目标格式包括YUV4:2:0、NV12和NV21中的一种;Wherein, the fourth part of pixel values in the YUV4:4:4 format image is used to convert to the Y component in the first image, and the fifth part of the pixel values in the YUV4:4:4 format image is used to convert to the The U component in the first image, the sixth part of the pixel value in the YUV4:4:4 format image is used to convert to the V component in the first image; the fourth part of the pixel value, the fifth part of the pixel value and The pixel values of the sixth part respectively account for 2/3, 1/6 and 1/6 of the total number of pixel values of the image in the YUV4:4:4 format; the target format includes one of YUV4:2:0, NV12 and NV21 kind;
第一编码单元,用于对该第一图像进行编码,得到第一码流。The first encoding unit is configured to encode the first image to obtain a first code stream.
采用上述方法,在编码端对YUV4:4:4格式的图像中的Y分量,U分量,V分量进行转换,得到目标格式的图像,然后目标格式(如YUV4:2:0)的编码器对目标格式的图像进行编码;后续在解码端解码出目标格式的图像后,对目标格式的图像中的Y分量,U分量,V分量进行转换,得到YUV4:4:4格式的图像。这种方法既可兼容目标格式的编/解码器,还能保留YUV4:4:4格式的色彩显示优势,同时也降低了色差,以及降低了参考帧管理复杂度。Using the above method, the Y component, U component, and V component in the image of the YUV4:4:4 format are converted at the encoding end to obtain an image of the target format, and then the encoder of the target format (such as YUV4:2:0) pairs The image in the target format is encoded; after the image in the target format is decoded at the decoding end, the Y component, U component, and V component in the image in the target format are converted to obtain an image in the YUV4:4:4 format. This method is not only compatible with the codec/decoder of the target format, but also retains the color display advantages of the YUV4:4:4 format, and also reduces the color difference and the complexity of reference frame management.
结合第三方面,在一种可选的方案中,该确定单元具体用于:With reference to the third aspect, in an optional solution, the determining unit is specifically configured to:
将该YUV4:4:4格式的图像存储为目标格式的第一图像,其中,该YUV4:4:4格式的图像中第四部分像素值用于存储为该第一图像中的Y分量,该YUV4:4:4格式的图像中第五部分像素值用于存储为该第一图像中的U分量,该YUV4:4:4格式的图像中第六部分像素值用于存储为该第一图像中的V分量。The image in the YUV4:4:4 format is stored as the first image in the target format, wherein the fourth part of the pixel values in the image in the YUV4:4:4 format is used to store as the Y component in the first image, the The fifth part of the pixel values in the YUV4:4:4 format image is used to store as the U component in the first image, and the sixth part of the pixel values in the YUV4:4:4 format image is used to store as the first image The V component in .
结合第三方面,或者第三方面的上述任一种可选的方案,在又一种可选的方案中,该视频编码装置还包括:In combination with the third aspect, or any of the above optional solutions of the third aspect, in another optional solution, the video encoding device further includes:
转换单元,用于将RGB格式的图像转换为该YUV4:4:4格式的图像;A conversion unit for converting an image in RGB format into an image in this YUV4:4:4 format;
若该RGB格式的图像应用于第一场景,该确定单元用于根据YUV4:4:4格式的图像确定目标格式的第一图像;If the image in RGB format is applied to the first scene, the determining unit is used to determine the first image in the target format according to the image in YUV4:4:4 format;
若该RGB格式的图像应用于第二场景,第二编码单元用于对YUV4:4:4格式的图像进行下采样,以及根据YUV4:2:0格式的编码器对下采样后的图像进行编码,得到第二码流;If the image in RGB format is applied to the second scene, the second encoding unit is used to downsample the image in YUV4:4:4 format, and encode the downsampled image according to the encoder in YUV4:2:0 format , get the second code stream;
该发送单元,还用于向该视频解码器发送该第二码流;The sending unit is further configured to send the second code stream to the video decoder;
其中,该第二场景的图像分辨率的要求低于该第一场景的图像分辨率的要求。Wherein, the image resolution requirement of the second scene is lower than the image resolution requirement of the first scene.
这种方式中,针对图像分辨率的要求较低的场景,采用传统的下采样的方式进行预处理并编码,针对图像分辨率的要求较高的场景,使用不丢失像素值(即不丢失Y分量、U分量和V分量)的方式进行编码,不仅可以最大限度地满足图像分辨率的要求较高的场景对色度的特殊需求,还可以最大限度地减小图像分辨率的要求较低的场景中的编码的数据量。In this method, for scenes with lower image resolution requirements, the traditional downsampling method is used for preprocessing and encoding, and for scenes with higher image resolution requirements, no loss of pixel values (that is, no loss of Y component, U component, and V component), which can not only meet the special requirements for chroma in scenes with high image resolution requirements to the greatest extent, but also minimize the The amount of encoded data in the scene.
结合第三方面,或者第三方面的上述任一种可选的方案,在又一种可选的方案中,该第一场景包括办公文档场景,桌面图标场景,文字场景,LOGO场景中的至少一项;该第二场景包括视频场景,游戏场景,自然风景场景中的至少一项。In combination with the third aspect, or any of the above optional solutions of the third aspect, in yet another optional solution, the first scene includes at least one of the office document scene, the desktop icon scene, the text scene, and the LOGO scene One; the second scene includes at least one of a video scene, a game scene, and a natural scenery scene.
结合第三方面,或者第三方面的上述任一种可选的方案,在又一种可选的方案中:In combination with the third aspect, or any of the above optional solutions of the third aspect, in another optional solution:
若该RGB图像的像素与上一帧RGB图像的像素值的差异超过预设阈值,则该转换单元用于将RGB格式的图像转换为该YUV4:4:4格式的图像;If the difference between the pixel of the RGB image and the pixel value of the previous frame of RGB image exceeds a preset threshold, the conversion unit is used to convert the image in RGB format into the image in YUV4:4:4 format;
若该RGB图像的像素与上一帧RGB图像的像素的差异不超过预设阈值,则该发送单元用于向该视频解码器发送指示信息,该指示信息用于指示该RGB图像的像素与该上一帧RGB图像的像素相同。If the difference between the pixels of the RGB image and the pixels of the previous RGB image does not exceed a preset threshold, the sending unit is used to send indication information to the video decoder, and the indication information is used to indicate that the pixels of the RGB image are different from the pixels of the RGB image. The pixels of the RGB image from the previous frame are the same.
这种方式中,当某一帧RGB图像(也可能是RGB图像中的一部分)与上一帧RGB图像(也可能是RGB图像中的一部分)的像素值相差较小时,就无需对该某一帧RGB图像重新进行编码,直接复用上一帧RGB图像即可,这样能够减小计算压力,提高整体编码效率。In this way, when the pixel values of a frame of RGB image (may also be a part of RGB image) and the previous frame of RGB image (maybe a part of RGB image) have a small difference, there is no need to A frame of RGB image is re-encoded, and the previous frame of RGB image can be directly multiplexed, which can reduce the calculation pressure and improve the overall encoding efficiency.
结合第三方面,或者第三方面的上述任一种可选的方案,在又一种可选的方案中,该根据YUV4:4:4格式的图像确定目标格式的第一图像方面,该确定单元具体用于:将该YUV4:4:4格式的图像转换为NV12格式的过渡图像,其中,该YUV4:4:4格式的图像中第四部分像素值用于转换为该过渡图像中的Y分量,该YUV4:4:4格式的图像中第五部分像素值用于转换为该过渡图像中的U分量,该YUV4:4:4格式的图像中第六部分像素值用于转换为该过渡图像中的V分量,这里提及的转换方式可以是对YUV4:4:4格式的图像中的像素值进行重新定义,例如将U分量重新定义(或者说标记)为Y分量。然后将该NV12格式的过渡图像存储为YUV4:2:0格式的第一图像,将NV12格式的过渡图像存储为YUV4:2:0格式的第一图像属于比较成熟的技术,实现方式有很多,此处不一一列举。结合第一方面,或者第一方面的上述任一种可选的方案,在又一种可选的方案中:该第四部分像素值包括该YUV4:4:4格式的图像中的全部Y分量和全部U分量;该第五部分像素值包括该YUV4:4:4格式的图像中全部V分量的一半;该第六部分像素值包括该YUV4:4:4格式的图像中全部V分量的另一半。In combination with the third aspect, or any of the above optional solutions of the third aspect, in another optional solution, the first image aspect of the target format is determined according to the image in the YUV4:4:4 format, the determination The unit is specifically used to: convert the image in YUV4:4:4 format into a transitional image in NV12 format, wherein the fourth part of the pixel values in the image in YUV4:4:4 format is used to convert to Y in the transitional image component, the fifth part of the pixel value in the YUV4:4:4 format image is used to convert to the U component in the transition image, and the sixth part of the pixel value in the YUV4:4:4 format image is used to convert to the transition For the V component in the image, the conversion method mentioned here may be to redefine the pixel value in the image in the YUV4:4:4 format, for example, redefining (or marking) the U component as the Y component. Then store the transition image in NV12 format as the first image in YUV4:2:0 format, and store the transition image in NV12 format as the first image in YUV4:2:0 format, which is a relatively mature technology, and there are many ways to implement it. They are not listed here. In combination with the first aspect, or any of the above optional solutions of the first aspect, in another optional solution: the fourth part of pixel values includes all Y components in the image in the YUV4:4:4 format and all U components; the fifth part of the pixel value includes half of all the V components in the image of the YUV4:4:4 format; the sixth part of the pixel value includes another part of all the V components in the image of the YUV4:4:4 format half.
其中,该全部V分量的一半为该全部V分量中的奇数列的V分量,该全部V分量的另一半为该全部V分量中的偶数列的V分量。Wherein, half of the all V components are V components of odd columns among all the V components, and the other half of all V components are V components of even columns among all V components.
或者,该全部V分量的一半为该全部V分量中的奇数行的V分量,该全部V分量的另一半为该全部V分量中的偶数行的V分量。Alternatively, half of the total V components are V components of odd lines in the total V components, and the other half of the total V components are V components of even lines in the total V components.
第四方面,本申请实施例提供一种视频解码装置,该装置包括:In a fourth aspect, the embodiment of the present application provides a video decoding device, which includes:
获取单元,用于获取包括目标格式数据的第一码流,其中,所述目标格式包括YUV4:2:0、NV12或NV21中的一种或多种的组合;An acquisition unit, configured to acquire a first code stream including target format data, wherein the target format includes one or more combinations of YUV4:2:0, NV12 or NV21;
解析单元,用于解析该第一码流,得到第一图像;A parsing unit, configured to parse the first code stream to obtain a first image;
确定单元,用于根据该第一图像确定YUV4:4:4格式的图像;其中,该第一图像中第一部分像素值用于转换为该YUV4:4:4格式的图像的Y分量,该第一图像中第二部分像素值用于转换为该YUV4:4:4格式的图像的U分量,该第一图像中第三部分像素值用于转换为该YUV4:4:4格式的图像的V分量;该第一部分像素值、该第二部分像素值和该第三部分像素值各占该第一图像的像素值总数的1/3。A determining unit, configured to determine an image in YUV4:4:4 format according to the first image; wherein, the first part of pixel values in the first image is used to convert to the Y component of the image in YUV4:4:4 format, and the first part The second part of pixel values in an image is used to convert to the U component of the image in the YUV4:4:4 format, and the third part of the pixel values in the first image is used to convert to the V of the image in the YUV4:4:4 format Components; the first part of pixel values, the second part of pixel values and the third part of pixel values each account for 1/3 of the total number of pixel values of the first image.
采用上述方法,在编码端对YUV4:4:4格式的图像中的Y分量,U分量,V分量进行转换,得到目标格式的图像,然后目标格式(如YUV4:2:0)的编码器对目标格式的图像进行编码;后续在解码端解码出目标格式的图像后,对目标格式的图像中的Y分量,U分量,V分量进行转换,得到YUV4:4:4格式的图像。这种方法既可兼容目标格式的编/解码器,还能保留YUV4:4:4格式的色彩显示优势,同时也降低了色差,以及降低了参考帧管理复杂度。Using the above method, the Y component, U component, and V component in the image of the YUV4:4:4 format are converted at the encoding end to obtain an image of the target format, and then the encoder of the target format (such as YUV4:2:0) pairs The image in the target format is encoded; after the image in the target format is decoded at the decoding end, the Y component, U component, and V component in the image in the target format are converted to obtain an image in the YUV4:4:4 format. This method is not only compatible with the codec/decoder of the target format, but also retains the color display advantages of the YUV4:4:4 format, and also reduces the color difference and the complexity of reference frame management.
结合第四方面,在一种可选的方案中,该确定单元具体用于:With reference to the fourth aspect, in an optional solution, the determining unit is specifically configured to:
将该YUV4:4:4格式的图像存储为YUV4:2:0格式的第一图像,该第一图像中第一部分像素值用于存储为该YUV4:4:4格式的图像的Y分量,该第一图像中第二部分像素值用于存储为该YUV4:4:4格式的图像的U分量,该第二图像中第三部分像素值用于存储为该YUV4:4:4格式的图像的V分量。The image in the YUV4:4:4 format is stored as a first image in the YUV4:2:0 format, and the first part of the pixel values in the first image is used to store the Y component of the image in the YUV4:4:4 format, the The second part of the pixel values in the first image is used to store as the U component of the image in the YUV4:4:4 format, and the third part of the pixel values in the second image is used to store as the U component of the image in the YUV4:4:4 format V component.
结合第四方面,或者第四方面的上述任一种可选的方案,在第四方面的又一种可选的方案中,该第一图像为YUV4:2:0格式的图像,该根据该第一图像确定YUV4:4:4格式的图像,包括:将YUV4:2:0格式的图像存储为NV12格式的过渡图像,该YUV4:2:0格式的图像中第一部分像素值用于存储为该过渡图像的Y分量,该YUV4:2:0格式的图像中第二部分像素值用于存储为该过渡图像的U分量,该YUV4:2:0格式的图像中第三部分像素值用于存储为该过渡图像的V分量,将YUV4:2:0格式的第一图像存储为NV12格式的过渡图像属于比较成熟的技术,实现方式有很多,此处不一一列举。然后,将该过渡图像转换为YUV4:4:4格式的图像,这里提及的转换方式可以是对NV12格式的过渡图像中的像素值进行重新定义,例如将部分Y分量重新定义(或者说标记)为U分量。In combination with the fourth aspect, or any of the above optional solutions of the fourth aspect, in yet another optional solution of the fourth aspect, the first image is an image in YUV4:2:0 format, according to the The first image determines the image in YUV4:4:4 format, including: storing the image in YUV4:2:0 format as a transitional image in NV12 format, and the first part of the pixel values in the image in YUV4:2:0 format are used to store as The Y component of the transition image, the second part of the pixel values in the YUV4:2:0 format image is used to store the U component of the transition image, and the third part of the pixel values in the YUV4:2:0 format image is used for It is relatively mature technology to store the first image in YUV4:2:0 format as the transition image in NV12 format as the V component of the transition image, and there are many implementation methods, which are not listed here. Then, convert the transitional image into an image in YUV4:4:4 format. The conversion method mentioned here can be to redefine the pixel values in the transitional image in NV12 format, for example, redefining part of the Y component (or marking ) is the U component.
结合第四方面,或者第四方面的上述任一种可选的方案,在又一种可选的方案中,In combination with the fourth aspect, or any of the above optional solutions of the fourth aspect, in another optional solution,
该第一部分像素值包括该第一图像中全部Y分量的一半;The first partial pixel value includes half of all Y components in the first image;
该第二部分像素值包括该第一图像中全部Y分量的另一半;The second portion of pixel values includes the other half of all Y components in the first image;
该第三部分像素值包括该第一图像中全部U分量和全部V分量;The third part of pixel values includes all U components and all V components in the first image;
其中,该第一图像中的全部U分量用于作为该YUV4:4:4格式的图像的奇数行V分量,该第一图像中的全部V分量用于作为该YUV4:4:4格式的图像的偶数行V分量;Wherein, all the U components in the first image are used as the odd row V components of the image in the YUV4:4:4 format, and all the V components in the first image are used as the image in the YUV4:4:4 format The even-numbered row V component of ;
或者,该第一图像中的全部U分量用于作为该YUV4:4:4格式的图像的奇数列V分量,该第一图像中的全部V分量用于作为该YUV4:4:4格式的图像的偶数列V分量。Or, all the U components in the first image are used as the odd column V components of the image in the YUV4:4:4 format, and all the V components in the first image are used as the image in the YUV4:4:4 format The even-numbered columns of V components.
第五方面,本申请实施例提供一种电子设备,该电子设备包括处理器和存储器,该处理器和该存储器耦合,该存储器用于存储计算机程序代码,该计算机程序代码包括计算机软件指令,当该计算机软件指令被该电子设备执行时,使得该电子设备执行第一方面或者第一方面的任一种可选的方案所描述的视频编码方法,或者,执行第二方面或者第二方面的任一种可选的方案所描述的视频解码方法。In the fifth aspect, the embodiment of the present application provides an electronic device, the electronic device includes a processor and a memory, the processor is coupled to the memory, and the memory is used to store computer program code, the computer program code includes computer software instructions, when When the computer software instructions are executed by the electronic device, the electronic device executes the video coding method described in the first aspect or any optional solution of the first aspect, or executes the second aspect or any optional solution of the second aspect. An alternative scheme is described for the video decoding method.
第六方面,本申请实施例提供一种计算机可读存储介质,包括:计算机软件指令;In a sixth aspect, the embodiment of the present application provides a computer-readable storage medium, including: computer software instructions;
当该计算机软件指令在电子设备中运行时,使得该电子设备执行第一方面或者第一方面的任一种可选的方案所描述的视频编码方法,或者,执行第二方面或者第二方面的任一种可选的方案所描述的视频解码方法。When the computer software instructions run in the electronic device, the electronic device executes the video encoding method described in the first aspect or any optional solution of the first aspect, or executes the second aspect or the second aspect The video decoding method described in any optional solution.
第七方面,本申请实施例提供一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得该电子设备执行第一方面或者第一方面的任一种可选的方案所描述的视频编码方法,或者,执行第二方面或者第二方面的任一种可选的方案所描述的视频解码方法。In the seventh aspect, the embodiment of the present application provides a computer program product. When the computer program product is run on a computer, the electronic device executes the video described in the first aspect or any optional solution of the first aspect. An encoding method, or execute the video decoding method described in the second aspect or any optional solution of the second aspect.
通过实施本申请实施例,在编码端对YUV4:4:4格式的图像中的Y分量,U分量,V分量进行转换,得到目标格式的图像,然后目标格式(如YUV4:2:0)的编码器对目标格式的图像进行编码;后续在解码端解码出目标格式的图像后,对目标格式的图像中的Y分量,U分量,V分量进行转换,得到YUV4:4:4格式的图像。这种方法既可兼容目标格式的编/解码器,还能保留YUV4:4:4格式的色彩显示优势,同时也降低了色差,以及降低了参考帧管理复杂度。By implementing the embodiment of the present application, the Y component, U component, and V component in the image of the YUV4:4:4 format are converted at the encoding end to obtain an image in the target format, and then the target format (such as YUV4:2:0) The encoder encodes the image in the target format; after the image in the target format is decoded at the decoder, the Y component, U component, and V component in the image in the target format are converted to obtain an image in the YUV4:4:4 format. This method is not only compatible with the codec/decoder of the target format, but also retains the color display advantages of the YUV4:4:4 format, and also reduces the color difference and the complexity of reference frame management.
附图说明Description of drawings
以下对本申请实施例用到的附图进行介绍。The accompanying drawings used in the embodiments of the present application are introduced below.
图1A是本申请实施例提供的一种YUV4:4:4格式的图像的像素值配比关系示意图;FIG. 1A is a schematic diagram of the pixel value ratio relationship of an image in a YUV4:4:4 format provided by an embodiment of the present application;
图1B是本申请实施例提供的一种YUV4:2:0格式的图像的像素值配比关系示意图;FIG. 1B is a schematic diagram of the pixel value ratio relationship of an image in a YUV4:2:0 format provided by an embodiment of the present application;
图1C是本申请实施例提供的一种NV12格式的图像的像素值配比关系示意图;Fig. 1C is a schematic diagram of the pixel value ratio relationship of an image in NV12 format provided by the embodiment of the present application;
图2A是本申请实施例提供的一种对YUV4:4:4格式的图像进行编码、解码的场景示意图;FIG. 2A is a schematic diagram of a scene for encoding and decoding an image in YUV4:4:4 format provided by an embodiment of the present application;
图2B是本申请实施例提供的一种对YUV4:4:4格式的图像进行编码的场景示意图;FIG. 2B is a schematic diagram of a scene encoding an image in YUV4:4:4 format provided by an embodiment of the present application;
图3是本申请实施例提供的又一种对YUV4:4:4格式的图像进行编码的场景示意图;Fig. 3 is a schematic diagram of another scene encoding an image in YUV4:4:4 format provided by the embodiment of the present application;
图4是本申请实施例提供的一种基于YUV4:4:4的视频编解码系统的框图;Fig. 4 is a block diagram of a YUV4:4:4-based video codec system provided by an embodiment of the present application;
图5是本申请实施例提供的一种视频编码、解码方法的流程示意图;FIG. 5 is a schematic flowchart of a video encoding and decoding method provided by an embodiment of the present application;
图6A是本申请实施例提供的一种视频编码、解码方法的流程示意图;FIG. 6A is a schematic flowchart of a video encoding and decoding method provided by an embodiment of the present application;
图6B是本申请实施例提供的一种对比图像差异的场景示意图;FIG. 6B is a schematic diagram of a scene comparing image differences provided by an embodiment of the present application;
图6C是本申请实施例提供的一种YUV4:4:4格式转换为YUV4:2:0格式的场景示意图;FIG. 6C is a schematic diagram of a scene where a YUV4:4:4 format is converted into a YUV4:2:0 format according to an embodiment of the present application;
图6D是本申请实施例提供的又一种YUV4:4:4格式转换为YUV4:2:0格式的场景示意图;FIG. 6D is a schematic diagram of another scene where the YUV4:4:4 format is converted into the YUV4:2:0 format provided by the embodiment of the present application;
图6E是本申请实施例提供的又一种YUV4:4:4格式转换为YUV4:2:0格式的场景示意图;FIG. 6E is a schematic diagram of another scene where the YUV4:4:4 format is converted into the YUV4:2:0 format provided by the embodiment of the present application;
图6F是本申请实施例提供的一种YUV4:4:4格式转换为NV12格式,再转换为YUV4:2:0格式的场景示意图;FIG. 6F is a schematic diagram of a scene where the YUV4:4:4 format is converted to the NV12 format and then converted to the YUV4:2:0 format provided by the embodiment of the present application;
图6G是本申请实施例提供的又一种YUV4:4:4格式转换为NV12格式,再转换为YUV4:2:0格式的场景示意图;FIG. 6G is a schematic diagram of another scene where the YUV4:4:4 format is converted to the NV12 format and then converted to the YUV4:2:0 format provided by the embodiment of the present application;
图6H是本申请实施例提供的一种YUV4:2:0格式转换为YUV4:4:4格式的场景示意图;FIG. 6H is a schematic diagram of a scene where a YUV4:2:0 format is converted to a YUV4:4:4 format according to an embodiment of the present application;
图6I是本申请实施例提供的又一种YUV4:2:0格式转换为YUV4:4:4格式的场景示意图;FIG. 61 is a schematic diagram of another scene where the YUV4:2:0 format is converted into the YUV4:4:4 format provided by the embodiment of the present application;
图6J是本申请实施例提供的又一种YUV4:2:0格式转换为YUV4:4:4格式的场景示意图;FIG. 6J is a schematic diagram of another scene where the YUV4:2:0 format is converted into the YUV4:4:4 format provided by the embodiment of the present application;
图6K是本申请实施例提供的一种YUV4:2:0格式转换为NV12格式,再转换为YUV4:4:4格式的场景示意图;FIG. 6K is a schematic diagram of a scene where the YUV4:2:0 format is converted to the NV12 format and then converted to the YUV4:4:4 format provided by the embodiment of the present application;
图6L是本申请实施例提供的又一种YUV4:2:0格式转换为NV12格式,再转换为YUV4:4:4格式的场景示意图;FIG. 6L is a schematic diagram of another scene where the YUV4:2:0 format is converted to the NV12 format and then converted to the YUV4:4:4 format provided by the embodiment of the present application;
图7是本申请实施例提供的一种视频编码装置的结构示意图;FIG. 7 is a schematic structural diagram of a video encoding device provided by an embodiment of the present application;
图8是本申请实施例提供的一种视频解码装置的结构示意图;FIG. 8 is a schematic structural diagram of a video decoding device provided by an embodiment of the present application;
图9是本申请实施例提供的一种电子设备的结构示意图。FIG. 9 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面结合本申请实施例中的附图对本申请实施例进行描述。Embodiments of the present application are described below with reference to the drawings in the embodiments of the present application.
首先,下面对本申请涉及的相关技术及专业术语进行介绍。First, the relevant technologies and technical terms involved in this application are introduced below.
视频编码(video encoding):将图像序列压缩成视频码流的处理过程。Video encoding (video encoding): The process of compressing an image sequence into a video stream.
视频解码(video decoding):将视频码流按照特定的语法规则和处理方法恢复成重建图像的处理过程。Video decoding (video decoding): the process of restoring the video code stream into a reconstructed image according to specific grammatical rules and processing methods.
峰值信噪比(Peak Signal to Noise Ratio,PSNR):计算原图像和被处理图像之间均方误差相对某固定值大小的一种数据处理方式,单位是db,常被用作评价图像质量的客观标准。Peak Signal to Noise Ratio (PSNR): A data processing method that calculates the mean square error between the original image and the processed image relative to a fixed value, the unit is db, and is often used to evaluate image quality objective criteria.
码率:即图像序列在编码时每秒编码的平均比特数。Bit rate: the average number of bits encoded per second when an image sequence is encoded.
BD-rate:用于评估不同的视频编码器的率失真(RD)性能。例如,取编码器的4个码流和对应的PSNR的点,进行曲线拟合,计算R-D曲线积分,对比两种编码算法的R-D曲线积分的差值,即可得到率失真。BD-rate: Used to evaluate the rate-distortion (RD) performance of different video encoders. For example, take the 4 code streams of the encoder and the corresponding PSNR points, perform curve fitting, calculate the R-D curve integral, and compare the difference between the R-D curve integrals of the two encoding algorithms to obtain the rate-distortion.
编码复杂度:由视频的纹理复杂度和运动复杂度共同决定。通常,视频图像越均匀,运动越平缓其编码复杂度越低;反之,其编码复杂度越高。Coding complexity: determined by the texture complexity and motion complexity of the video. Generally, the more uniform the video image and the smoother the motion, the lower the encoding complexity; otherwise, the higher the encoding complexity.
双线性内插法:利用待求像素的4个邻域像素值在水平和竖直方向作线性差值。Bilinear interpolation method: use the four neighboring pixel values of the pixel to be obtained to make a linear difference in the horizontal and vertical directions.
最邻近元法:通过判断待插值位置到已知像素距离,取距离最近的像素值为待插值位置的像素值。The nearest neighbor method: By judging the distance from the position to be interpolated to the known pixel, the nearest pixel value is taken as the pixel value of the position to be interpolated.
YUV:是一种颜色编码方法,其中Y是亮度信息,Luminance,U和V则是色度信息Chrominance,作用是描述图像的色彩及饱和度,用于指定像素的颜色。YUV: is a color coding method, where Y is brightness information, Luminance, U and V are chrominance information Chrominance, which is used to describe the color and saturation of the image, and is used to specify the color of the pixel.
YUV4:4:4:是YUV的一种存储格式,一个Y分量对应一个U分量和一个V分量,其中Y分量,U分量,V分量所占字节数相等,色度值(U,V)没有进行采样,内存中存储顺序是先存Y分量,再存U分量,最后存V分量。如图1A所示。YUV4:4:4: It is a storage format of YUV. A Y component corresponds to a U component and a V component, where the Y component, U component, and V component occupy the same number of bytes, and the chroma value (U, V) Without sampling, the storage order in the memory is to store the Y component first, then the U component, and finally the V component. As shown in Figure 1A.
YUV4:2:0:是YUV的一种存储格式,每4个Y分量共用一组UV分量,其中,U和V占用字节数分别为Y的1/4,其中色度值(U,V)是YUV4:4:4的色度分量的行和列的1/2采样,内存中存储顺序是先存Y分量,再存U分量,最后存V分量,如图1B所示。YUV4:2:0: is a storage format of YUV. Every 4 Y components share a set of UV components. Among them, U and V occupy 1/4 of the bytes of Y, and the chroma value (U, V ) is the 1/2 sampling of the row and column of the chroma component of YUV4:4:4. The storage order in the memory is to store the Y component first, then the U component, and finally the V component, as shown in Figure 1B.
NV12:是YUV的一种存储格式,其中每4个Y分量共用一组UV分量,其中,U分量和V分量占用字节数分别为Y分量的1/4,内存中存储顺序是先存Y分量,再U分量,V分量交替存储,如图1C所示。NV12: It is a storage format of YUV, in which every 4 Y components share a set of UV components, among which, the U component and V component occupy 1/4 of the bytes of the Y component, and the storage order in the memory is to store Y first component, U component, and V component are stored alternately, as shown in Figure 1C.
NV21:是YUV的一种存储格式,其中每4个Y分量共用一组UV分量,其中,U分量和V分量占用字节数分别为Y分量的1/4,内存中存储顺序是先存Y分量,再U分量,V分量交替存储,和NV12的区别在于,NV12中U分量在前,V分量在后,NV21中V分量在前,U分量在后。NV21: It is a storage format of YUV, in which every 4 Y components share a set of UV components, among which, the U component and V component occupy 1/4 of the bytes of the Y component, and the storage order in memory is to store Y first component, U component, and V component are stored alternately. The difference from NV12 is that in NV12, the U component is in the front and the V component is in the back. In NV21, the V component is in the front and the U component is in the back.
本申请的申请人例举了三种在编码过程中,既能兼容YUV4:2:0编码器,还能保留YUV4:4:4格式的色彩显示优势的技术方案,但是这三种技术方案均存不同程度的缺陷,下面分别介绍。The applicant of this application cites three technical solutions that are compatible with the YUV4:2:0 encoder and retain the color display advantages of the YUV4:4:4 format during the encoding process, but these three technical solutions are all There are different degrees of defects, which are introduced separately below.
方案一,如图2A所示,在编码端将YUV4:4:4格式的图像的色度分量的行和列分别进行1/2下采样得到YUV4:2:0格式的图像,再对YUV格式的图像进行编码,编码得到的码流传输到解码端,解码端解码得到YUV4:2:0格式的图像后,将色度分量进行上采样恢复得到YUV4:4:4格式的图像,然后将恢复得到的YUV4:4:4格式的图像送显示,其中对色度量进行下采样和上采样的算法很多,比如双线性内插法,最邻近元法等。
然而,图2A所示的方法的显示效果取决于从YUV4:4:4格式的图像下采样到YUV4:2:0格式的图像,和从YUV4:2:0格式的图像恢复到YUV4:4:4格式的图像的色度采样算法。其中,从YUV4:2:0格式的图像恢复到YUV4:4:4格式的图像,目前普遍采用参考临近的色度或亮度分量在局部范围的分布或占比,估计出空缺的色度分量。由于需要参考临近像素值进行计算,在色彩差异明显的边界区域或含有离散色彩点的区域,补全的色彩和真实颜色差异明显。However, the display effect of the method shown in Fig. 2A depends on downsampling from an image in YUV4:4:4 format to an image in YUV4:2:0 format, and restoring from an image in YUV4:2:0 format to YUV4:4: 4-format chroma sampling algorithm for images. Among them, from the YUV4:2:0 format image to the YUV4:4:4 format image, it is generally used to estimate the vacant chroma component by referring to the distribution or proportion of the adjacent chroma or luminance components in the local range. Due to the need to refer to adjacent pixel values for calculation, the complementary color is significantly different from the real color in the boundary area with obvious color difference or the area with discrete color points.
方案二,将YUV4:4:4格式的图像转换为2幅YUV4:2:0格式的图像,然后对这2幅YUV4:2:0格式的图像进行编码,编码得到的码流传输到解码端后,解码端解码得到这2幅YUV4:2:0格式的图像,再将这2幅YUV4:2:0格式的图像组合为1幅YUV4:4:4格式的图像,然后将该1幅YUV4:4:4格式的图像送显示。如图2B所示,YUV4:4:4格式的图像的像素总量为YUV4:2:0格式的图像的像素总量的两倍,因此可以分为2幅YUV4:2:0格式的图像,第一幅YUV4:2:0格式的图像称为主图,是一个标准的YUV4:2:0格式的图像,其Y分量是YUV4:4:4格式的图像的Y分量,其U和V分量分别是YUV4:4:4格式的图像中U和V分量的1/4采样。第二幅YUV4:2:0格式的图像称为副图,其Y分量是YUV4:4:4格式的图像中U和V分量的1/2采样,U和V分量上下放置,副图的U分量和V分量分别是YUV4:4:4格式的图像中U和V分量剩余的1/4采样。按照这种转换方式获得的YUV4:2:0格式的图像,可以充分保证Y、U、V分量的几何一致性,有利于YUV4:2:0编码器结合该几何一致性进行编码,获得更低码率。解码端解码后,2幅YUV4:2:0格式的图像再进行相应的逆变换,可以将2幅YUV4:2:0格式的图像合成1幅YUV4:4:4格式的图像,最大限度防止了色度损失。
然而,将YUV4:4:4格式的图像分成2幅YUV4:2:0格式的子图,其中副图的Y、U、V分量均是对YUV4:4:4的U和V分量进行采样,采样点数较多,计算量较大。其次,幅图的Y、U、V分量的内容均为上下结构排列,排列结构复杂,会导致编码后码率增大,且会输出2幅YUV4:2:0格式的图像,送入编码器后,导致编码器参考帧管理复杂化。However, the image in YUV4:4:4 format is divided into two sub-images in YUV4:2:0 format, where the Y, U, and V components of the sub-image are all sampled for the U and V components of YUV4:4:4, The number of sampling points is large, and the amount of calculation is large. Secondly, the contents of the Y, U, and V components of the picture are all arranged in a top-down structure, and the arrangement structure is complex, which will increase the code rate after encoding, and will output two images in the YUV4:2:0 format and send them to the encoder Finally, it leads to the complexity of encoder reference frame management.
方案三,将YUV4:4:4格式的图像转换为2幅YUV4:2:0格式的图像,然后对这2幅YUV4:2:0格式的图像进行编码,编码得到的码流传输到解码端后,解码端解码得到这2幅YUV4:2:0格式的图像,再将这2幅YUV4:2:0格式的图像组合为1幅YUV4:4:4格式的图像,然后将该1幅YUV4:4:4格式的图像送显示。如图3所示,标号103为YUV4:4:4格式的图像,标号104示意了格式转换过程,标号105示意了输出的YUV4:2:0格式的图像,其中,标号202和203分别为两幅YUV4:2:0格式的子图。
标号202的YUV4:2:0格式的图像中,Y分量为标号103的YUV4:4:4格式的图像中的Y分量,标号203的YUV4:2:0格式的图像中,Y分量为标号103中YUV4:4:4格式的图像的U分量,再将标号103的YUV4:4:4格式的图像中的V分量,进行采样得到标号201中四个子图,分别表示为V11,V12,V21,V22,之后将V11和V12分别作为标号202的YUV4:2:0格式的图像中的U,V分量,将V21,V22分别作为标号203的YUV4:2:0格式的图像中的U,V分量。该方案中,将YUV4:4:4格式的图像转换为2副YUV4:2:0格式的图像时,2副YUV4:2:0格式的图像的Y分量分别是YUV4:4:4格式的图像的Y和U分量,无需采样,计算量较小。In the image of the YUV4:2:0 format of the
然而,将YUV4:4:4格式的图像分成2幅YUV4:2:0格式的子图,需要对YUV4:4:4格式的图像的V分量采样,并将采样结果分别作为2副YUV4:2:0格式的图像的U,V分量,采样过程计算量较大,且会输出2帧YUV4:2:0,送入编码器后,导致编码器参考帧管理复杂化。However, dividing an image in YUV4:4:4 format into two subimages in YUV4:2:0 format requires sampling the V component of an image in YUV4:4:4 format, and taking the sampling results as two YUV4:2 The U and V components of the :0 format image have a large amount of calculation during the sampling process, and will
本申请的申请人进一步提供视频编码方法、解码方法及相关装置,既能兼容YUV4:2:0编码器,还能保留YUV4:4:4格式的色彩显示优势,同时又能够避免上述三种方案的缺陷。The applicant of this application further provides a video coding method, a decoding method and related devices, which can not only be compatible with the YUV4:2:0 encoder, but also retain the color display advantages of the YUV4:4:4 format, while avoiding the above three solutions Defects.
请参见图4,图4为本申请实施例中所描述的一种基于YUV4:4:4的视频编解码系统的框图。如图4中所示,视频译码系统包含源装置10和目的地装置20。源装置10产生经编码的视频数据。因此源装置10可被称为视频编码装置。目的地装置20可对由源装置10所产生的经编码的视频数据进行解码。因此,目的地装置20可被称为视频解码装置。源装置10、目的地装置20或两个的各种实施方案可包含一或多个处理器以及耦合到该一或多个处理器的存储器。该存储器可包含但不限于RAM、ROM、EEPROM、快闪存储器或可用于以可由计算机存取的指令或数据结构的形式存储所要的程序代码的任何其它媒体,如本文所描述。Please refer to FIG. 4, which is a block diagram of a YUV4:4:4-based video encoding and decoding system described in the embodiment of the present application. As shown in FIG. 4 , the video coding system includes
源装置10和目的地装置20可以包括各种装置,包含桌上型计算机、移动计算装置、笔记型(例如,膝上型)计算机、平板计算机、机顶盒、例如所谓的“智能”电话等电话手持机、电视机、相机、显示装置、数字媒体播放器、视频游戏控制台、车载计算机或其类似者。
目的地装置20可经由链路30从源装置10接收经编码视频数据。链路30可包括能够将经编码视频数据从源装置10移动到目的地装置20的一或多个媒体或装置。在一个实例中,链路30可包括使得源装置10能够实时将经编码视频数据直接发射到目的地装置20的一或多个通信媒体。在此实例中,源装置10可根据通信标准(例如无线通信协议)来调制经编码视频数据,且可将经调制的视频数据发射到目的地装置20,发射的经调制的视频数据可以称为码流,或者码流。该一或多个通信媒体可包含无线和/或有线通信媒体,例如射频(RF)频谱或一或多个物理传输线。该一或多个通信媒体可形成基于分组的网络的一部分,基于分组的网络例如为局域网、广域网或全球网络(例如,因特网)。该一或多个通信媒体可包含路由器、交换器、基站或促进从源装置10到目的地装置20的通信的其它设备。Destination device 20 may receive encoded video data from
在另一实例中,可将经编码数据从输出接口140输出到存储装置40。类似地,可通过输入接口240从存储装置40存取出编码数据。存储装置40可包含多种分布式或本地存取的数据存储媒体中的任一者,例如硬盘驱动器、蓝光光盘、DVD、CD-ROM、快闪存储器、易失性或非易失性存储器,或用于存储经编码视频数据的任何其它合适的数字存储媒体。In another example, encoded data may be output from
在另一实例中,存储装置40可对应于文件服务器或可保持由源装置10产生的经编码视频的另一中间存储装置。目的地装置20可经由流式传输或下载从存储装置40存取所存储的视频数据。文件服务器可为任何类型的能够存储经编码的视频数据并且将经编码的视频数据发射到目的地装置20的服务器。文件服务器包含网络服务器(例如,用于网站)、FTP服务器、网络附接式存储(NAS)装置或本地磁盘驱动器。目的地装置20可通过任何标准数据连接(如因特网连接)来存取经编码视频数据。这可包含无线信道(例如,Wi-Fi连接)、有线连接(例如,DSL、电缆调制解调器等),或适合于存取存储在文件服务器上的经编码视频数据的两者的组合。经编码视频数据从存储装置40的传输可为流式传输、下载传输或两者的组合。In another example,
本申请的运动矢量预测技术可应用于视频编解码以支持多种多媒体应用,例如空中电视广播、有线电视发射、卫星电视发射、串流视频发射(例如,经由因特网)、用于存储于数据存储媒体上的视频数据的编码、存储在数据存储媒体上的视频数据的解码,或其它应用。在一些实例中,视频译码系统可用于支持单向或双向视频传输以支持例如视频流式传输、视频回放、视频广播和/或视频电话等应用。The motion vector prediction technology of the present application can be applied to video codec to support various multimedia applications, such as over-the-air television broadcasting, cable television transmission, satellite television transmission, streaming video transmission (for example, via the Internet), for storage in data storage Encoding of video data on a medium, decoding of video data stored on a data storage medium, or other applications. In some examples, a video coding system may be used to support one-way or two-way video transmission to support applications such as video streaming, video playback, video broadcasting, and/or video telephony.
图4中所说明的视频译码系统仅为示例,并且本申请的技术可适用于未必包含编码装置与解码装置之间的任何数据通信的视频译码设置(例如,视频编码或视频解码)。在其它实例中,数据从本地存储器检索、在网络上流式传输等等。视频编码装置可对数据进行编码并且将数据存储到存储器,和/或视频解码装置可从存储器检索数据并且对数据进行解码。在许多实例中,由并不彼此通信而是仅编码数据到存储器和/或从存储器检索数据且解码数据的装置执行编码和解码。The video coding system illustrated in FIG. 4 is merely an example, and the techniques of this disclosure may be applicable to video coding settings (eg, video encoding or video decoding) that do not necessarily include any data communication between an encoding device and a decoding device. In other instances, data is retrieved from local storage, streamed over a network, and so on. A video encoding device may encode and store data to memory, and/or a video decoding device may retrieve and decode data from memory. In many instances, encoding and decoding are performed by devices that do not communicate with each other but merely encode and/or retrieve data from memory and decode data to memory.
在图4的实例中,源装置10包含视频源120、视频编码器100和输出接口140。在一些实例中,输出接口140可包含调节器/解调器(调制解调器)和/或发射器。视频源120可包括视频捕获装置(例如,摄像机)、含有先前捕获的视频数据的视频存档、用以从视频内容提供者接收视频数据的视频馈入接口,和/或用于产生视频数据的计算机图形系统,或视频数据的此些来源的组合。In the example of FIG. 4 ,
视频编码器100可对来自视频源120的视频数据进行编码。在一些实例中,源装置10经由输出接口140将经编码视频数据直接发射到目的地装置20。在其它实例中,经编码视频数据还可存储到存储装置40上,供目的地装置20以后存取来用于解码和/或播放。Video encoder 100 may encode video data from
在图4的实例中,目的地装置20包含输入接口240、视频解码器200和显示装置220。在一些实例中,输入接口240包含接收器和/或调制解调器。输入接口240可经由链路30和/或从存储装置40接收经编码视频数据。显示装置220可与目的地装置20集成或可在目的地装置20外部。一般来说,显示装置220显示经解码视频数据。显示装置220可包括多种显示装置,例如,液晶显示器(LCD)、等离子显示器、有机发光二极管(OLED)显示器或其它类型的显示装置。In the example of FIG. 4 , destination device 20 includes
尽管图4中未图示,但在一些方面,视频编码器100和视频解码器200可各自与音频编码器和解码器集成,且可包含适当的多路复用器-多路分用器单元或其它硬件和软件,以处置共同数据流或单独数据流中的音频和视频两者的编码。在一些实例中,如果适用的话,那么MUX-DEMUX单元可符合ITU H.223多路复用器协议,或例如用户数据报协议(UDP)等其它协议。Although not shown in FIG. 4 , in some aspects video encoder 100 and
视频编码器100和视频解码器200各自可实施为例如以下各项的多种电路中的任一者:一或多个微处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)、离散逻辑、硬件或其任何组合。如果部分地以软件来实施本申请,那么装置可将用于软件的指令存储在合适的非易失性计算机可读存储媒体中,且可使用一或多个处理器在硬件中执行该指令从而实施本申请技术。前述内容(包含硬件、软件、硬件与软件的组合等)中的任一者可被视为一或多个处理器。视频编码器100和视频解码器200中的每一者可包含在一或多个编码器或解码器中,该编码器或解码器中的任一者可集成为相应装置中的组合编码器/解码器(编码解码器)的一部分。Video encoder 100 and
本申请可大体上将视频编码器100称为将某些信息“发信号通知”或“发射”到例如视频解码器200的另一装置。术语“发信号通知”或“发射”可大体上指代用以对经压缩视频数据进行解码的语法元素和/或其它数据的传送。此传送可实时或几乎实时地发生。替代地,此通信可经过一段时间后发生,例如可在编码时在经编码位流中将语法元素存储到计算机可读存储媒体时发生,解码装置接着可在该语法元素存储到此媒体之后的任何时间检索该语法元素。This application may generally refer to video encoder 100 as “signaling” or “transmitting” certain information to another device, such as
视频编码器100和视频解码器200可根据例如高效视频编码(HEVC)等视频压缩标准或其扩展来操作,并且可符合HEVC测试模型(HM)。或者,视频编码器100和视频解码器200也可根据其它业界标准来操作,该标准例如是ITU-T H.264、H.265标准,或此类标准的扩展。然而,本申请的技术不限于任何特定编解码标准。The video encoder 100 and the
本申请实施例中的视频编码器100可以为YUV4:2:0编码器、或者NV12编码器、或者NV21编码器。本申请实施例中的视频解码器100可以为YUV4:2:0解码器、或者NV12解码器、或者NV21解码器。通常,视频编码器采用什么格式对图像进行编码,视频解码器则需要通过相同的格式对图像进行解码。例如,视频解码器通过YUV4:2:0编码器对图像进行编码,则视频解码器需要通过YUV4:2:0解码器对来自该视频编码器的码流进行解码。The video encoder 100 in this embodiment of the present application may be a YUV4:2:0 encoder, or an NV12 encoder, or an NV21 encoder. The video decoder 100 in the embodiment of the present application may be a YUV4:2:0 decoder, or an NV12 decoder, or an NV21 decoder. Usually, what format the video encoder uses to encode the image, the video decoder needs to decode the image in the same format. For example, if a video decoder encodes an image through a YUV4:2:0 encoder, the video decoder needs to decode the code stream from the video encoder through a YUV4:2:0 decoder.
视频编码和视频解码针对的是视频,由于视频时由图像序列构成,后关于视频编码和视频解码的描述中,编码和解码的对象均以视频中的图像为例进行说明。Video encoding and decoding are aimed at videos. Since videos are composed of image sequences, in the following descriptions of video encoding and decoding, the objects of encoding and decoding are explained using images in videos as examples.
请参见图5,图5是本申请实施例提供的编解码场景示意图,该场景中包括如下模块:Please refer to Figure 5. Figure 5 is a schematic diagram of a coding and decoding scenario provided by the embodiment of the present application. This scenario includes the following modules:
RGB正向转换单元501,用于将RGB格式的源图像转换为YUV4:4:4格式的图像。RGB
YUV正向转换单元502,用于将YUV4:4:4格式的图像中Y,U,V分量按照目标格式进行转换,得到目标格式的图像,本申请中转换的过程不丢弃原有Y,U,V分量,例如,将YUV4:4:4格式的图像中的U分量转换(或者说重新定义)为Y分量。The YUV
转换的目的,就是为了让YUV4:4:4格式的图像在被目标编码器503编码时,目标编码器503对YUV4:4:4格式的图像进行编码后得到的码流中保留了YUV4:4:4格式的图像中全部的Y、U、V分量。The purpose of the conversion is to keep the YUV4:4 in the code stream obtained after the
本申请实施例中,将RGB格式的源图像转换为YUV4:4:4格式的图像,再将YUV4:4:4格式的图像转换为目标格式的图像,可以通过一个函数(或者说算法流程)来实现,也可以分为两个函数来实现。例如,通过一个函数来实现时,处理过程有一次输入一次输出,输入为RGB格式的图像,输出为目标格式的图像;再如,通过两个函数来实现时,处理过程有两次输入两次输出,第一次输入为RGB格式的图像,第一次输出为YUV4:4:4格式的图像,第二次输入为YUV4:4:4格式的图像,第二次输出为目标格式的图像。In the embodiment of this application, the source image in RGB format is converted into an image in YUV4:4:4 format, and then the image in YUV4:4:4 format is converted into an image in target format, which can be done through a function (or algorithm flow) To achieve, can also be divided into two functions to achieve. For example, when it is implemented by one function, the processing process has one input and one output, the input is an image in RGB format, and the output is an image in the target format; for another example, when it is implemented by two functions, the processing process has two inputs and two times Output, the first input is an image in RGB format, the first output is an image in YUV4:4:4 format, the second input is an image in YUV4:4:4 format, and the second output is an image in the target format.
目标编码器503,用于对YUV正向转换单元502转换后的目标格式的图像进行编码,此处目标格式的图像可以称为第一图像,以方便后续描述。The
目标解码器504,用于对包含第一图像的码流进行解码,从而解码出该第一图像。目标解码器504采用了与目标编码器503耦合的技术,即目标解码器504解码的技术原理,是目标编码器503编码的技术原理的逆向操作。The
可选的,目标编码器503和目标解码器504可以分别部署在不同的装置上面,如图4所示,该目标编码器503可以部署在源装置10中,该目标解码器可以部署在目的地装置20中,因此,该第一图像可以通过源装置10中的输出接口140输出码流,该码流包括该第一图像;相应地,目的地装置20通过输入接口240获取该码流,然后由目标解码器504从该码流中解码出该第一图像。Optionally, the
YUV逆向转换单元505,用于对第一图像中的Y,U,V分量进行重新定义,本申请中重新定义的过程不丢弃原有的Y,U,V分量,只是将原有的Y,U,V分量的类型进行了全部或部分的重新定义。例如,将第一图像中的部分Y分量重新定义为U分量。The YUV
重新定义的目的,是为了让目标格式的第一图像中已有的Y,U,V分量的分布符合YUV4:4:4格式。The purpose of the redefinition is to make the distribution of the existing Y, U, and V components in the first image of the target format comply with the YUV4:4:4 format.
RGB逆向转换单元506,用于将YUV逆向转换单元505转换出的符合YUV4:4:4格式的图像转换为RGB格式的图像,即待显示图像。The RGB
请参见图6A,图6A是本申请实施例提供的一种编码、解码方法的流程示意图,该方法可以基于图4所示的系统架构,以及图5所示的场景来实现,该方法包括但不限于如下步骤:Please refer to FIG. 6A. FIG. 6A is a schematic flowchart of an encoding and decoding method provided by an embodiment of the present application. This method can be implemented based on the system architecture shown in FIG. 4 and the scenario shown in FIG. 5. The method includes but Not limited to the following steps:
步骤S600:视频编码装置比较RGB图像的像素与上一帧RGB图像的像素。Step S600: The video encoding device compares the pixels of the RGB image with the pixels of the previous frame of the RGB image.
本申请实施例中,该RGB图像可以为一张完整的图像,也可以认为是一张完成图像中划分出来的一块区域,即一张子图像,图像划分方式不限,例如,可以采用高度等分,或者宽度等分,或高度不等分,或者宽度不等分的方式来划分,当然还可以以其他方式来划分。In the embodiment of the present application, the RGB image can be a complete image, or it can be considered as a region divided from a completed image, that is, a sub-image, and the image division method is not limited, for example, height, etc. can be used Divide, or width equal division, or height unequal division, or the mode of width unequal division, of course, can also be divided in other ways.
需要说明的是,当该RGB图像是一张完整图像中划分出来的一块区域时,这一张完整图像的上一帧图像也会以相同的方式进行划分,可称一张完整图像的上一帧图像为参考图像以方便后续描述,本申请实施例中,该RGB图像在该一张完整图像中的位置,与该RGB图像的上一帧图像在参考图像中的位置可以相同也可以不相同,即该RGB图像与该RGB图像的上一帧图像的区位可以相同也可以不相同。例如,参照图6B,该一张完整图像为第n帧图像,按照预先设定的划分方式依次可以划分出图像区域1、图像区域2、图像区域3,……,图像区域m,因此该目标图像为第n-1帧图像,也按照同样的划分方式依次可以划分出图像区域1、图像区域2、图像区域3,……,图像区域m,因此该目标图像为第n-1帧图像。一种可选的方案,假若该RGB图像为第n帧图像中的图像区域1,则该GRB图像的上一帧图像为第n-1帧图像的图像区域1;假若该RGB图像为第n帧图像中的图像区域2,则该GRB图像的上一帧图像为第n-1帧图像的图像区域2;其余依此类推。另一种可选的方案,假若该RGB图像为第n帧图像中的图像区域1,则该GRB图像的上一帧图像为第n-1帧图像的任意一个图像区域,例如,该GRB图像的上一帧图像为第n-1帧图像的图像区域1、图像区域2、图像区域3、或者其他图像区域。It should be noted that when the RGB image is an area divided from a complete image, the previous frame image of this complete image will also be divided in the same way, which can be called the previous frame of a complete image. The frame image is a reference image to facilitate subsequent descriptions. In the embodiment of the present application, the position of the RGB image in the complete image may be the same as or different from the position of the previous frame image of the RGB image in the reference image. , that is, the location of the RGB image and the previous frame of the RGB image may or may not be the same. For example, referring to Fig. 6B, the complete image is the nth frame image, which can be divided into
如果RGB图像的像素与上一帧RGB图像的像素值的差异(如差值)超过预设阈值,则执行步骤S601;如图6B,如果第n帧的图像区域1(即该RGB图像)与第n-1帧的图像区域1(即该RGB图像的上一帧图像)的像素值的差异超过预设阈值,则执行步骤S601。If the difference (such as the difference) between the pixel of the RGB image and the pixel value of the previous frame RGB image exceeds the preset threshold, then perform step S601; If the pixel value difference of the
如果RGB图像的像素与上一帧RGB图像的像素值的差异(如差值)不超过预设阈值,则不对该RGB图像进行编码,而是向视频解码器发送指示信息,该指示信息用于指示该RGB图像的解码信息与上一帧RGB图像的解码信息相同,即指示解码端(如视频解码器)需要确定该RGB图像的像素值时,直接复用该RGB图像的上一帧图像的像素值即可。如图6B,如果第n帧的图像区域1(即该RGB图像)与第n-1帧的图像区域1(即该RGB图像的上一帧图像)的像素值的差异未超过预设阈值,则不编码,而是向视频解码器发送指示信息。If the difference (such as difference) between the pixel of the RGB image and the pixel value of the previous frame RGB image does not exceed the preset threshold, the RGB image is not encoded, but the instruction information is sent to the video decoder, and the instruction information is used for Indicates that the decoding information of the RGB image is the same as that of the previous frame of RGB image, that is, when the decoding end (such as a video decoder) needs to determine the pixel value of the RGB image, it directly multiplexes the previous frame of the RGB image pixel value. As shown in Figure 6B, if the difference in pixel values between the
该预设阈值为预设的用于衡量像素值的参考值,其具体大小可根据实际需要来进行配置,可选的,可以针对不同的图像应用场景设置不同大小的参考值。The preset threshold is a preset reference value for measuring pixel values, and its specific size can be configured according to actual needs. Optionally, different reference values can be set for different image application scenarios.
在一种可选的方案中,执行后续步骤S601不需要依赖于步骤S600。In an optional solution, the execution of the subsequent step S601 does not need to depend on the step S600.
步骤S601:视频编码装置将RGB格式的源图像转换为YUV4:4:4格式的图像。Step S601: the video encoding device converts the source image in RGB format into an image in YUV4:4:4 format.
可选的,该转换操作可以具体由视频编码装置中的RGB正向转换单元来完成。Optionally, the conversion operation may be specifically performed by an RGB forward conversion unit in the video encoding device.
在一种可选的方案中,转换得到YUV4:4:4格式的图像后,继续执行步骤S602。In an optional solution, after the converted image in YUV4:4:4 format is obtained, step S602 is continued.
在又一种可选的方案中,转换得到YUV4:4:4格式的图像后,要对RGB图像的应用场景进行判断,针对不同的应用场景执行不同的操作,具体如下:In another optional solution, after converting the image in YUV4:4:4 format, it is necessary to judge the application scenario of the RGB image, and perform different operations for different application scenarios, as follows:
若该RGB格式的图像为应用于第一场景,则执行步骤S602。可选的,这种情况下,可以在执行步骤S602、S603之后得到的第一码流中携带标志位,用于让获取到该第一码流数据的对象通过该标识位获知应用场景,或者说获知需要通过什么方式对第一码流进行解码。例如,假若该标志位设置为11,则获取到该第一码流的对象就知道要通过后面的步骤S606、S607的方式来解码,假若该标志位不为11,则不通过步骤S606、S607的方式来解码。If the image in RGB format is applied to the first scene, step S602 is performed. Optionally, in this case, a flag can be carried in the first code stream obtained after steps S602 and S603 are performed, so that the object that has obtained the data of the first code stream can know the application scenario through the flag, or It is said to know in what way the first code stream needs to be decoded. For example, if the flag bit is set to 11, then the object that has obtained the first code stream will know that it will be decoded in the following steps S606 and S607; if the flag bit is not 11, then steps S606 and S607 will not be passed. way to decode.
若该RGB格式的图像应用于第二场景,则对YUV4:4:4格式的图像进行下采样,然后根据目标格式(如YUV4:2:0)的编码器对下采样后的图像进行编码(例如,图2B所示的方案二,以及图3所示的方案三都是通过下采样先得到两幅YUV4:2:0格式的图像,然后对这两幅YUV4:2:0格式的图像进行编码。当然,还存在很多其他先进行下采样再进行编码的实现方式,此处不一一举例),得到第二码流,然后向该视频解码器发送第二码流。可选的,这种情况下,可以在得到的第二码流中携带标志位,用于让获取到该第二码流的对象通过该标识位获知应用场景,或者说获知需要通过什么方式对第二码流进行解码。例如,假若该标志位设置为00,则获取到该第二码流的对象就知道要通过后面的步骤S608的方式来解码,假若该标志位不为00,则不通过步骤S608的方式来解码。If the image in the RGB format is applied to the second scene, the image in the YUV4:4:4 format is down-sampled, and then the down-sampled image is encoded according to the encoder of the target format (such as YUV4:2:0) ( For example, the second scheme shown in Figure 2B and the third scheme shown in Figure 3 both obtain two images in the YUV4:2:0 format by downsampling, and then perform a process on the two images in the YUV4:2:0 format Encoding. Of course, there are many other implementations of first downsampling and then encoding, which are not listed here), to obtain the second code stream, and then send the second code stream to the video decoder. Optionally, in this case, a flag bit can be carried in the obtained second code stream, so that the object that obtains the second code stream can know the application scenario through the flag bit, or know what method needs to be used to The second code stream is decoded. For example, if the flag bit is set to 00, then the object that has obtained the second code stream will know that it will be decoded by the method of step S608 later, if the flag bit is not 00, it will not be decoded by the method of step S608 .
本申请实施例中,码流中包括对图像或视频进行编码后得到的数据。In this embodiment of the present application, the code stream includes data obtained after encoding images or videos.
其中,该第二场景的图像分辨率的要求低于该第一场景的图像分辨率的要求。Wherein, the image resolution requirement of the second scene is lower than the image resolution requirement of the first scene.
例如,该第一场景包括办公文档,桌面图标,文字,标志(LOGO)等场景;该第二场景包括视频,游戏,自然风景等场景。具体哪些应当归类为第一场景,哪些归类为第二场景可以有用户根据需求预先配置好。For example, the first scene includes office documents, desktop icons, text, logos (LOGO) and other scenes; the second scene includes video, games, natural scenery and other scenes. Specifically which ones should be classified as the first scenario and which ones should be classified as the second scenario can be pre-configured by the user according to requirements.
步骤S602:视频编码装置根据YUV4:4:4格式的图像确定目标格式的第一图像。Step S602: The video encoding device determines the first image in the target format according to the image in the YUV4:4:4 format.
其中,YUV4:4:4格式的图像中第四部分像素值用于转换为第一图像中的Y分量,YUV4:4:4格式的图像中第五部分像素值用于转换为第一图像中的U分量,YUV4:4:4格式的图像中第六部分像素值用于转换为第一图像中的V分量;第四部分像素值、第五部分像素值和第六部分像素值分别占YUV4:4:4格式的图像的像素值总数的2/3、1/6和1/6;目标格式包括YUV4:2:0、NV12和NV21中的一种。Among them, the fourth part of the pixel value in the YUV4:4:4 format image is used to convert to the Y component in the first image, and the fifth part of the pixel value in the YUV4:4:4 format image is used to convert to the first image The U component, the sixth part of the pixel value in the YUV4:4:4 format image is used to convert to the V component in the first image; the fourth part of the pixel value, the fifth part of the pixel value and the sixth part of the pixel value respectively account for YUV4 : 2/3, 1/6, and 1/6 of the total number of pixel values of an image in 4:4 format; the target format includes one of YUV4:2:0, NV12, and NV21.
下面例举几种可选的确定目标格式的第一图像的方式。Several optional ways of determining the first image in the target format are exemplified below.
方式一,在编码协议中规定目标格式的编码器的编码规则,使得目标格式的编码器在对YUV4:4:4格式的图像进行编码时,将该YUV4:4:4格式的图像中第四部分像素值视作Y分量,将该YUV4:4:4格式的图像中第五部分像素值视作U分量,将该YUV4:4:4格式的图像中第六部分像素值视作V分量;期中,该第四部分像素值的数量占该YUV4:4:4格式的图像的像素值总数的2/3,该第五部分像素值的数量占该YUV4:4:4格式的图像的像素值总数的1/6,该第六部分像素值的数量分别占该YUV4:4:4格式的图像的像素值总数的1/6。Method 1: Specify the encoding rules of the encoder in the target format in the encoding protocol, so that when the encoder in the target format encodes an image in the YUV4:4:4 format, the fourth image in the image in the YUV4:4:4 format Part of the pixel value is regarded as the Y component, the fifth part of the pixel value in the image of the YUV4:4:4 format is regarded as the U component, and the sixth part of the pixel value in the image of the YUV4:4:4 format is regarded as the V component; During the period, the number of pixel values in the fourth part accounts for 2/3 of the total number of pixel values of the image in the YUV4:4:4 format, and the number of pixel values in the fifth part accounts for the pixel values in the image in the YUV4:4:4
例如,将YUV4:4:4格式的图像中的Y分量和U分量视为Y分量,即该第四部分像素值包括该YUV4:4:4格式的图像中的全部Y分量和全部U分量;将YUV4:4:4格式的图像中的V分量的一半视作U分量,即该第五部分像素值包括该YUV4:4:4格式的图像中全部V分量的一半;以及将YUV4:4:4格式的图像中的V分量的另一半视作V分量,该第六部分像素值包括该YUV4:4:4格式的图像中全部V分量的另一半。For example, the Y component and the U component in the image of the YUV4:4:4 format are regarded as the Y component, that is, the fourth part of the pixel value includes all the Y components and all the U components in the image of the YUV4:4:4 format; Half of the V component in the image of the YUV4:4:4 format is regarded as the U component, that is, the fifth part of the pixel value includes half of all the V components in the image of the YUV4:4:4 format; and YUV4:4: The other half of the V component in the image in the 4 format is regarded as the V component, and the sixth part of pixel values includes the other half of all the V components in the image in the YUV4:4:4 format.
可选的,该全部V分量的一半为该全部V分量中的奇数行的V分量;该全部V分量的另一半为该全部V分量中的偶数行的V分量。Optionally, half of the all V components are V components of odd lines among the all V components; the other half of all V components are V components of even lines among all V components.
方式二,对YUV4:4:4格式的图像中的Y,U,V分量(全部或部分)进行重新存储,重新存储的过程不丢弃原有Y分量,U分量,V分量,也不更改Y分量,U分量,V分量的内容,存储到Y分量位置的像素值就相当于重新定义为了Y分量,存储到U分量位置的像素值就相当于重新定义为了U分量,存储到V分量位置的像素值相当于重新定义为了V分量。The second way is to re-store the Y, U, V components (all or part) of the image in the YUV4:4:4 format. The process of re-storage does not discard the original Y component, U component, V component, and does not change the Y Component, U component, V component content, the pixel value stored in the Y component position is equivalent to redefining the Y component, and the pixel value stored in the U component position is equivalent to redefining the U component and storing in the V component position The pixel value is equivalent to being redefined as the V component.
具体地,将YUV4:4:4格式的图像中第四部分像素值存储为Y分量,将YUV4:4:4格式的图像中第五部分像素值存储为U分量,将YUV4:4:4格式的图像中第六部分像素值存储为V分量;该第四部分像素值的数量占该YUV4:4:4格式的图像的像素值总数的2/3,该第五部分像素值的数量占该YUV4:4:4格式的图像的像素值总数的1/6,该第六部分像素值的数量占该YUV4:4:4格式的图像的像素值总数的1/6。Specifically, the fourth part of the pixel value in the YUV4:4:4 format image is stored as the Y component, the fifth part of the pixel value in the YUV4:4:4 format image is stored as the U component, and the YUV4:4:4 format The sixth part of the pixel value in the image is stored as the V component; the number of the fourth part of the pixel value accounts for 2/3 of the total number of pixel values of the image in the YUV4:4:4 format, and the number of the fifth part of the pixel value accounts for the 1/6 of the total number of pixel values of the image in the YUV4:4:4 format, and the number of the sixth part of the pixel values accounts for 1/6 of the total number of pixel values of the image in the YUV4:4:4 format.
例如,如图6C所示,将YUV4:4:4格式的图像中的Y分量存储为Y分量,将YUV4:4:4格式的图像中的U分量存储为Y分量,即上述第四部分像素值包括YUV4:4:4格式的图像中的全部Y分量和全部U分量。将YUV4:4:4格式的图像中的V分量中的一半存储为U分量,即上述第五部分像素值包括YUV4:4:4格式的图像中全部V分量的一半。将YUV4:4:4格式的图像中的V分量中的另一半存储为V分量,即第六部分像素值包括YUV4:4:4格式的图像中全部V分量的另一半,图6C以存储得到的目标格式的图像为YUV4:2:0格式的图像为例进行示意。For example, as shown in Figure 6C, the Y component in the image in the YUV4:4:4 format is stored as the Y component, and the U component in the image in the YUV4:4:4 format is stored as the Y component, that is, the above-mentioned fourth part of pixels Values include all Y components and all U components in images in YUV4:4:4 format. Store half of the V components in the image in the YUV4:4:4 format as the U component, that is, the fifth part of pixel values includes half of all the V components in the image in the YUV4:4:4 format. The other half of the V component in the image in the YUV4:4:4 format is stored as the V component, that is, the sixth part of the pixel value includes the other half of all the V components in the image in the YUV4:4:4 format, and Figure 6C is obtained by storing The image in the target format is an image in YUV4:2:0 format as an example.
为了便于理解,下面结合图6D对像素值在图像中的位置分布情况做了更详细示意,可选的,如图6D所示,将YUV4:4:4格式的图像中的Y分量保持为Y分量,将YUV4:4:4格式的图像中的U分量存储为Y分量,将YUV4:4:4格式的图像中的V分量中的奇数行存储为U分量,将YUV4:4:4格式的图像中的V分量中的偶数行保持为V分量,也即是说,上述全部V分量的一半为上述全部V分量中的奇数行的V分量;上述全部V分量的另一半为上述全部V分量中的偶数行的V分量。For ease of understanding, the position distribution of pixel values in the image is shown in more detail below in conjunction with Figure 6D. Optionally, as shown in Figure 6D, the Y component in the image in the YUV4:4:4 format is kept as Y Component, store the U component in the YUV4:4:4 format image as the Y component, store the odd lines in the V component in the YUV4:4:4 format image as the U component, and store the YUV4:4:4 format The even-numbered lines in the V components in the image remain as V components, that is, half of the above-mentioned all V components are the V components of the odd-numbered lines in the above-mentioned all V components; the other half of the above-mentioned all V components are the above-mentioned all V components The V components of the even rows in .
在另一种可选的方案中,也可以将YUV4:4:4格式的图像中的Y分量保持为Y分量,将YUV4:4:4格式的图像中的U分量存储为Y分量,将YUV4:4:4格式的图像中的V分量中的奇数列存储为U分量,将YUV4:4:4格式的图像中的V分量中的偶数列保持为V分量,也即是说,上述全部V分量的一半为上述全部V分量中的奇数列的V分量;上述全部V分量的另一半为上述全部V分量中的偶数列的V分量,具体参见图6E。In another optional solution, it is also possible to keep the Y component in the YUV4:4:4 format image as the Y component, store the U component in the YUV4:4:4 format image as the Y component, and store the YUV4 : The odd columns in the V component in the 4:4 format image are stored as U components, and the even columns in the V component in the YUV4:4:4 format image are kept as V components, that is to say, all the above V Half of the components are V components of odd columns among all the V components; the other half of all V components are V components of even columns among all V components, see FIG. 6E for details.
本申请实施例中,对YUV4:4:4格式的图像中的Y,U,V分量的类型进行重新存储的模块可以称为YUV正向转换单元502,当然也可以有其他叫法。In the embodiment of the present application, the module that re-stores the types of the Y, U, and V components in the image in the YUV4:4:4 format can be called the YUV
对YUV4:4:4格式的图像中的Y,U,V分量重新存储之后,原来的YUV4:4:4格式的图像实质上已经成为了一个符合目标格式的编码器编码要求的第一图像。After the Y, U, and V components in the YUV4:4:4 format image are re-stored, the original YUV4:4:4 format image has essentially become the first image that meets the encoding requirements of the target format encoder.
方式三,上述目标格式为YUV4:2:0格式;可以先将YUV4:4:4格式的图像转换为NV12格式的过渡图像,然后将NV12格式的过渡图像转换为YUV4:2:0格式的第一图像。
具体地,将YUV4:4:4格式的图像中第四部分像素值的类型重新定义为Y分量,将YUV4:4:4格式的图像中第五部分像素值的类型重新定义U分量,将YUV4:4:4格式的图像中第六部分像素值的类型重新定义V分量;该第四部分像素值的数量占该YUV4:4:4格式的图像的像素值总数的2/3,该第五部分像素值的数量占该YUV4:4:4格式的图像的像素值总数的1/6,该第六部分像素值的数量占该YUV4:4:4格式的图像的像素值总数的1/6。Specifically, redefine the type of the fourth part of the pixel value in the image in the YUV4:4:4 format as the Y component, redefine the type of the fifth part of the pixel value in the image in the YUV4:4:4 format as the U component, and use YUV4 : The type of the sixth part of the pixel value in the 4:4 format image redefines the V component; the number of the fourth part of the pixel value accounts for 2/3 of the total number of pixel values of the YUV4:4:4 format image, and the fifth The number of partial pixel values accounts for 1/6 of the total number of pixel values of the image in the YUV4:4:4 format, and the number of the sixth part of pixel values accounts for 1/6 of the total number of pixel values of the image in the YUV4:4:4 format .
例如,如图6F所示,YUV4:4:4格式的图像中的Y分量的类型保持不变,将YUV4:4:4格式的图像中的U分量的类型重新定义Y分量,即上述第四部分像素值包括YUV4:4:4格式的图像中的全部Y分量和全部U分量。将YUV4:4:4格式的图像中的V分量中的一半的类型重新定义U分量,即上述第五部分像素值包括YUV4:4:4格式的图像中全部V分量的一半。将YUV4:4:4格式的图像中的V分量中的另一半的类型依旧还是V分量,即第六部分像素值包括YUV4:4:4格式的图像中全部V分量的另一半,从而得到NV12格式的过渡图像。For example, as shown in Figure 6F, the type of the Y component in the image of the YUV4:4:4 format remains unchanged, and the type of the U component in the image of the YUV4:4:4 format is redefined as the Y component, that is, the above-mentioned fourth Partial pixel values include all Y components and all U components in an image in YUV4:4:4 format. Redefine the type of half of the V components in the image in the YUV4:4:4 format to the U component, that is, the fifth part of the pixel values includes half of all the V components in the image in the YUV4:4:4 format. The type of the other half of the V component in the image in the YUV4:4:4 format is still the V component, that is, the sixth part of the pixel value includes the other half of all the V components in the image in the YUV4:4:4 format, thus obtaining NV12 format transition image.
为了便于理解,下面结合图6G对像素值的在图像中的分布情况做了更详细示意,可选的,如图6G所示,YUV4:4:4格式的图像中的Y分量保持为Y分量,将YUV4:4:4格式的图像中的U分量重新定义为Y分量,将YUV4:4:4格式的图像中的V分量中的奇数列重新定义为U分量,将YUV4:4:4格式的图像中的V分量中的偶数列保持为V分量。也即是说,上述全部V分量的一半为上述全部V分量中的奇数列的V分量;上述全部V分量的另一半为上述全部V分量中的偶数列的V分量,具体如图6G所示;按照这种方式处理之后即可得到NV12格式的图像。For ease of understanding, the distribution of pixel values in the image is shown in more detail below in conjunction with Figure 6G. Optionally, as shown in Figure 6G, the Y component in the image in the YUV4:4:4 format remains as the Y component , redefining the U component in the YUV4:4:4 format image as the Y component, redefining the odd column in the V component in the YUV4:4:4 format image as the U component, and redefining the YUV4:4:4 format Even columns in the V component of the image remain as V components. That is to say, half of the above-mentioned all V components are the V components of the odd-numbered columns in the above-mentioned all V components; the other half of the above-mentioned all V components are the V components of the even-numbered columns in the above-mentioned all V components, as shown in Figure 6G ; After processing in this way, an image in NV12 format can be obtained.
本申请实施例中,重新定义像素值的过程就是重新划分或者说标记像素值的过程,例如,为原来的V分量打上标记U的标记信息,这样该V分量就被重新定义为了一个U分量。为了便于描述,本申请称对YUV4:4:4格式的图像重新定义后的NV12格式的图像为过渡图像。In the embodiment of the present application, the process of redefining the pixel value is the process of re-dividing or marking the pixel value, for example, marking the original V component with the marking information of U, so that the V component is redefined as a U component. For ease of description, this application refers to the image in NV12 format after redefining the image in YUV4:4:4 format as a transitional image.
本申请实施例中,对YUV4:4:4格式的图像中的Y,U,V分量的类型进行重新定义的模块可以称为YUV分量正向转换单元502,当然也可以有其他叫法。In the embodiment of the present application, the module that redefines the types of Y, U, and V components in the YUV4:4:4 format image may be called the YUV component forward
得到NV12格式的过渡图像后,将过渡图像转换为YUV4:2:0格式的第一图像,将过渡图像转换为YUV4:2:0格式的第一图像的方式有很多,例如,可以将NV12格式的过渡图像中的全部或部分像素值进行重新存储,得到YUV4:2:0格式的第一图像,通常情况下,该过渡图像中会有2/3的像素值转换为第一图像中的Y分量,该过渡图像中会有1/6的像素值转换为第一图像中的U分量,该过渡图像中会有1/6的像素值转换为第一图像中的V分量;由于过渡图像中的像素值全部来源于YUV4:4:4格式的图像,因此,可以认为存在如下间接关系:该YUV4:4:4格式的图像中有第四部分像素值最终被转换为了Y分量(该第四部分像素值先是转换为过渡图像中的第四部分像素值,该过渡图像中的第四部分像素值再转换为第一图像中的Y分量),该YUV4:4:4格式的图像中有第五部分像素值最终被转换为了U分量(该第五部分像素值先是转换为过渡图像中的第五部分像素值,该过渡图像中的第五部分像素值再转换为第一图像中的U分量),该YUV4:4:4格式的图像中有第六部分像素值最终被转换为了V分量(该第六部分像素值先是转换为过渡图像中的第六部分像素值,该过渡图像中的第六部分像素值再转换为第一图像中的V分量),该第四部分像素值的数量占该YUV4:4:4格式的图像的像素值总数的2/3,该第五部分像素值的数量占该YUV4:4:4格式的图像的像素值总数的1/6,该第六部分像素值的数量占该YUV4:4:4格式的图像的像素值总数的1/6。After obtaining the transitional image in NV12 format, convert the transitional image into the first image in YUV4:2:0 format, and there are many ways to convert the transitional image into the first image in YUV4:2:0 format, for example, you can convert the NV12 format All or part of the pixel values in the transition image are re-stored to obtain the first image in YUV4:2:0 format. Usually, 2/3 of the pixel values in the transition image are converted to Y in the first image component, 1/6 of the pixel values in the transition image will be converted to the U component in the first image, and 1/6 of the pixel values in the transition image will be converted to the V component in the first image; The pixel values of all come from the image in YUV4:4:4 format. Therefore, it can be considered that there is an indirect relationship as follows: in the image in YUV4:4:4 format, a fourth part of the pixel values is finally converted into the Y component (the fourth part Part of the pixel value is first converted to the fourth part of the pixel value in the transition image, and the fourth part of the pixel value in the transition image is then converted to the Y component in the first image), the image in the YUV4:4:4 format has the first Five parts of pixel values are finally converted into U components (the fifth part of pixel values are first converted into the fifth part of pixel values in the transition image, and the fifth part of pixel values in the transition image are then converted into U components in the first image ), the sixth part of the pixel value in the YUV4:4:4 format image is finally converted to the V component (the sixth part of the pixel value is first converted into the sixth part of the pixel value in the transition image, and the sixth part of the pixel value in the transition image Six parts of pixel values are then converted into V components in the first image), the fourth part of pixel values accounts for 2/3 of the total number of pixel values of the image in the YUV4:4:4 format, and the fifth part of pixel values The number accounts for 1/6 of the total number of pixel values of the image in the YUV4:4:4 format, and the number of the sixth part of pixel values accounts for 1/6 of the total number of pixel values of the image in the YUV4:4:4 format.
可选的,将NV12格式的过渡图像中像素值进行重新存储,得到YUV4:2:0格式的第一图像的过程中,可以仅对其中部分像素值进行存储,例如,NV12格式的过渡图像中的Y分量依旧作为YUV4:2:0格式的第一图像中的Y分量,因此无需重新存储;而NV12格式的过渡图像中的部分U分量需要存储为YUV4:2:0格式的第一图像中的V分量,NV12格式的过渡图像中的部分V分量需要存储为YUV4:2:0格式的第一图像中的U分量,具体参见图6G。Optionally, in the process of re-storing the pixel values in the transition image in NV12 format to obtain the first image in YUV4:2:0 format, only some of the pixel values may be stored, for example, in the transition image in NV12 format The Y component is still used as the Y component in the first image in the YUV4:2:0 format, so there is no need to store it again; while part of the U component in the transition image in the NV12 format needs to be stored in the first image in the YUV4:2:0 format Part of the V component in the transition image in the NV12 format needs to be stored as the U component in the first image in the YUV4:2:0 format, see FIG. 6G for details.
本申请实施例中,根据YUV4:4:4格式的图像中Y分量、U分量和V分量的配比关系,以及目标格式(如YUV4:2:0、或NV12、或NV21)的图像中Y分量、U分量和V分类的配比关系可知,在转换过程不丢失Y分量、U分量和V分量的情况下,转换得到的目标格式的第一图像的分辨率是转换前的YUV4:4:4格式的图像的分辨率的两倍。可选的,从长或宽的角度对比的话,如果第一图像与转换前的YUV4:4:4格式的图像的长相等,那么第一图像的宽是转换前的YUV4:4:4格式的图像的宽的两倍;如果第一图像与转换前的YUV4:4:4格式的图像的宽相等,那么第一图像的长是转换前的YUV4:4:4格式的图像的长的两倍。In the embodiment of this application, according to the ratio relationship of Y component, U component and V component in the image of YUV4:4:4 format, and the Y component in the image of the target format (such as YUV4:2:0, or NV12, or NV21) It can be seen from the proportioning relationship of component, U component and V classification that, under the condition that Y component, U component and V component are not lost in the conversion process, the resolution of the first image in the converted target format is YUV4:4 before conversion: 4 format images with twice the resolution. Optionally, if compared from the perspective of length or width, if the length of the first image is equal to the image in YUV4:4:4 format before conversion, then the width of the first image is in YUV4:4:4 format before conversion twice the width of the image; if the width of the first image is equal to that of the image in YUV4:4:4 format before conversion, then the length of the first image is twice the length of the image in YUV4:4:4 format before conversion .
步骤S603:视频编码装置对第一视频编码,得到第一码流。Step S603: The video encoding device encodes the first video to obtain a first code stream.
可选的,由于前面得到的第一图像为目标格式,因此,这里通过目标格式的编码器对第一图像进行编码。Optionally, since the first image obtained above is in the target format, here the first image is encoded by an encoder of the target format.
步骤S604:视频编码装置向视频解码装置发送第一码流。Step S604: the video encoding device sends the first code stream to the video decoding device.
具体地,可以通过图4所示的输出接口140进行发送,具体原理此处不再赘述。Specifically, the transmission may be performed through the
需要说明的是,步骤S604为可选步骤,即该视频编码装置也在编码得到第一码流之后,也可以不向解码视频解码装置进行发送,而是自存,或者通过其他手段输出。It should be noted that step S604 is an optional step, that is, after the video encoding device obtains the first stream through encoding, it may not send it to the decoding video decoding device, but store it in itself, or output it through other means.
步骤S605:视频解码装置获取视频编码装置发送的码流或指示信息。Step S605: The video decoding device acquires the code stream or indication information sent by the video encoding device.
具体地,可以通过图4所示的输入接口240进行接收,具体原理此处不再赘述。Specifically, the reception may be performed through the
需要说明的是,此处获取码流或者指示信息的方式可以具体为接收,例如,前面的视频编码装置发送码流或者指示信息,相应的,该视频解码装置接收该码流或者指示信息。It should be noted that the manner of acquiring the code stream or indication information here may specifically be receiving, for example, the previous video encoding device sends the code stream or indication information, and correspondingly, the video decoding device receives the code stream or indication information.
该码流可能为上述第一码流,也可能为上述第二码流,具体是那种码流取决于视频编码设备发送的是什么类型的码流。The code stream may be the above-mentioned first code stream or the above-mentioned second code stream, and the specific code stream depends on what type of code stream is sent by the video encoding device.
如果接收的是第一码流(由前文可知,该第一码流为包括目标格式数据的码流),则执行步骤S606。If the first code stream is received (as known from the foregoing, the first code stream is a code stream including data in the target format), step S606 is executed.
如果接收的是第二码流,则执行步骤S608。If the second code stream is received, step S608 is executed.
如果接收的是指示信息,则执行步骤S609。If indication information is received, step S609 is performed.
步骤S606:视频解码装置解析第一码流,得到第一图像。Step S606: The video decoding device parses the first code stream to obtain the first image.
可选的,由于上述第一图像是在编码端由目标格式的编码器编码得到的,因此可以通过目标格式的解码器从该第一码流中解码出上述第一图像。Optionally, since the above-mentioned first image is encoded by an encoder of the target format at the encoding end, the above-mentioned first image may be decoded from the first code stream by a decoder of the target format.
例如,假若上述第一图像是在编码端由YUV4:2:0格式的编码器编码得到的,则可以通过YUV4:2:0格式的解码器从该第一码流中解码出上述第一图像。再如,假若上述第一图像是在编码端由NV12格式的编码器编码得到的,则可以通过NV12格式的解码器从该第一码流中解码出上述第一图像。For example, if the above-mentioned first image is encoded by a YUV4:2:0 format encoder at the encoding end, the above-mentioned first image can be decoded from the first code stream by a YUV4:2:0 format decoder . For another example, if the above-mentioned first image is encoded by an NV12-format encoder at the encoding end, the above-mentioned first image can be decoded from the first code stream by an NV12-format decoder.
步骤S607:视频解码装置根据第一图像确定YUV4:4:4格式的图像。Step S607: The video decoding device determines an image in YUV4:4:4 format according to the first image.
其中,该第一图像中第一部分像素值用于转换为该YUV4:4:4格式的图像的Y分量,该第一图像中第二部分像素值用于转换为该YUV4:4:4格式的图像的U分量,该第二图像中第三部分像素值用于转换为该YUV4:4:4格式的图像的V分量;该第一部分像素值的数量、该第二部分像素值的数量和该第三部分像素值的数量各占该第一图像的像素值总数的1/3。Wherein, the first part of pixel values in the first image is used to convert to the Y component of the image in the YUV4:4:4 format, and the second part of the pixel values in the first image is used to convert to the YUV4:4:4 format The U component of the image, the third part of the pixel values in the second image is used to convert to the V component of the image in the YUV4:4:4 format; the number of the first part of pixel values, the number of the second part of pixel values and the The number of pixel values in the third part each accounts for 1/3 of the total number of pixel values in the first image.
可选的,根据第一图像确定YUV4:4:4格式的图像可以由YUV4:4:4逆向转换单元来完成。Optionally, determining the image in the YUV4:4:4 format according to the first image may be completed by a YUV4:4:4 inverse conversion unit.
下面举例几种可选的根据第一图像确定YUV4:4:4格式的图像的方式:The following are examples of several optional ways of determining an image in YUV4:4:4 format according to the first image:
方式四,是上述方式一的逆向操作,在解码协议中规定目标格式的解码器的解码规则,使得通过目标格式的解码器解码得到目标格式的图像后,后续处理过程均将该目标格式的图像视为YUV4:4:4格式的图像。具体来说,将该目标格式的图像中第一部分像素值视作Y分量,将目标格式的图像中第二部分像素值视作U分量,将该目标格式的图像中第三部分像素值视作V分量;其中,该第一部分像素值的数量、该第二部分像素值的数量和该第三部分像素值的数量各占该目标格式的图像的像素值总数的1/3。
例如,目标格式的第一图像中的全部Y分量的一半依旧视为Y分量;将目标格式的第一图像中的全部Y分量的另一半视为U分量;将目标格式的第一图像中的全部U分量和全部V分量均视为V分量。可选的,该第一图像中的全部U分量具体视为YUV4:4:4格式的图像的奇数行V分量,该第一图像中的全部V分量具体视为YUV4:4:4格式的图像的偶数行V分量。For example, half of all Y components in the first image in the target format are still regarded as Y components; the other half of all Y components in the first image in the target format are regarded as U components; All U components and all V components are regarded as V components. Optionally, all U components in the first image are specifically regarded as odd line V components of an image in YUV4:4:4 format, and all V components in the first image are specifically regarded as images in YUV4:4:4 format The even-numbered row V components.
方式五,是上述方式二的逆向操作,对目标格式的第一图像中的Y,U,V分量(全部或部分)进行重新存储,得到YUV4:4:4格式的图像。重新存储的过程不丢弃原有Y分量,U分量,V分量,也不更改Y分量,U分量,V分量的内容,存储到Y分量位置的像素值就相当于重新定义为了Y分量,存储到U分量位置的像素值就相当于重新定义为了U分量,存储到V分量位置的像素值就相当于重新定义为了V分量。
具体地,将目标格式的第一图像中第一部分像素值存储为Y分量,将目标格式的第一图像中第二部分像素值存储为U分量,将目标格式的第一图像中第三部分像素值存储为V分量;该第一部分像素值、该第二部分像素值和该第三部分像素值各占该目标格式的图像的像素值的1/3,从而得到YUV4:4:4格式的图像。Specifically, store the first part of pixel values in the first image in the target format as the Y component, store the second part of the pixel values in the first image in the target format as the U component, and store the third part of the pixel values in the first image in the target format The value is stored as a V component; the first part of the pixel value, the second part of the pixel value and the third part of the pixel value each account for 1/3 of the pixel value of the image in the target format, thereby obtaining an image in the YUV4:4:4 format .
例如,如图6H所示,将目标格式的第一图像中的全部Y分量的一半的类型保持不变,依旧为Y分量;将目标格式的第一图像中的全部Y分量的另一半存储为U分量;将目标格式的第一图像中的全部U分量存储为V分量;将目标格式的第一图像中的全部V分量存储为V分量,图6H以存储得到的目标格式的图像为YUV4:2:0格式的图像为例进行示意。For example, as shown in Figure 6H, the type of half of all Y components in the first image of the target format remains unchanged, still being the Y component; the other half of all the Y components in the first image of the target format is stored as U component; All U components in the first image of the target format are stored as V components; All V components in the first image of the target format are stored as V components, and Fig. 6H stores the image of the target format obtained as YUV4: An image in 2:0 format is used as an example for illustration.
为了便于理解,下面结合图6I对像素值在图像中的位置分布情况做了更详细示意,可选的,如图6I所示,将目标格式的第一图像中的全部Y分量的一半的类型保持不变,依旧为Y分量;将目标格式的第一图像中的全部Y分量的另一半存储为U分量;将目标格式的第一图像中的全部U分量存储为奇数行V分量;将目标格式的第一图像中的全部V分量存储为偶数行的V分量,也即是说,上述第一图像中的全部U分量用于存储为YUV4:4:4格式的图像的奇数行V分量,该第一图像中的全部V分量用于存储为YUV4:4:4格式的图像的偶数行V分量。In order to facilitate understanding, the position distribution of pixel values in the image is shown in more detail below in conjunction with FIG. 6I. Optionally, as shown in FIG. 6I, the type of half of all Y components in the first image in the target format Keep unchanged, it is still Y component; store the other half of all Y components in the first image of the target format as U components; store all U components in the first image of the target format as odd-numbered row V components; store the target All the V components in the first image of the format are stored as the V components of the even lines, that is, all the U components in the above-mentioned first image are used to store the V components of the odd lines of the image in the YUV4:4:4 format, All the V components in the first image are used to store the V components of the even lines of the image in the YUV4:4:4 format.
在另一种可选的方案中,也可以将目标格式的第一图像中的全部Y分量的一半的类型保持不变,依旧为Y分量;将目标格式的第一图像中的全部Y分量的另一半存储为U分量;将目标格式的第一图像中的全部U分量存储为奇数列V分量;将目标格式的第一图像中的全部V分量存储为偶数列的V分量,也即是说,上述第一图像中的全部U分量用于存储为YUV4:4:4格式的图像的奇数列V分量,该第一图像中的全部V分量用于存储为YUV4:4:4格式的图像的偶数列V分量,如图6J所示。In another optional solution, half of the types of all Y components in the first image of the target format can also be kept unchanged, still being Y components; the types of all Y components in the first image of the target format The other half is stored as the U component; store all the U components in the first image in the target format as odd column V components; store all the V components in the first image in the target format as V components in even columns, that is to say , all the U components in the above first image are used to store the odd column V components of the image in the YUV4:4:4 format, and all the V components in the first image are used to store the image in the YUV4:4:4 format Even column V components, as shown in Figure 6J.
本申请实施例中,对目标格式的图像中的Y,U,V分量的类型进行重新存储的模块可以称为YUV逆向转换单元505,当然也可以有其他叫法。In the embodiment of the present application, the module for re-storing the types of the Y, U, and V components in the image in the target format may be called the YUV
对目标格式的图像中的Y,U,V分量重新存储之后,原来的目标格式的第一图像实质上已经成为了一个YUV4:4:4格式的图像。After the Y, U, and V components in the image in the target format are re-stored, the original first image in the target format has essentially become an image in the YUV4:4:4 format.
方式六,是上述方式三的逆向操作,上述目标格式为YUV4:2:0格式;可以先将目标格式的第一图像转换为NV12格式的过渡图像,然后将过渡图像转换为YUV4:4:4格式的图像。
将YUV4:2:0格式的第一图像转换为NV12格式的过渡图像,将YUV4:2:0格式的第一图像转换为NV12格式的过渡图像的方式有很多,例如,可以将目标格式的第一图像中的全部或部分像素值进行重新存储,得到NV12格式的过渡图像,通常情况下,该第一图像中会有2/3的像素值转换为过渡图像中的Y分量,该第一图像中会有1/6的像素值转换为过渡图像中的U分量,该第一图像中会有1/6的像素值转换为过渡图像中的V分量。Convert the first image in YUV4:2:0 format to a transitional image in NV12 format. There are many ways to convert the first image in YUV4:2:0 format to a transitional image in NV12 format. For example, you can convert the first image in the target format to All or part of the pixel values in an image are re-stored to obtain a transitional image in NV12 format. Usually, 2/3 of the pixel values in the first image are converted to the Y component in the transitional image. The
可选的,将YUV4:2:0格式的第一图像中像素值进行重新存储,得到NV12格式的过渡图像的过程中,可以仅对其中部分像素值进行存储,例如,YUV4:2:0格式的第一图像中的Y分量依旧作为NV12格式的过渡图像中的Y分量,因此无需重新存储;而YUV4:2:0格式的第一图像中的部分U分量需要存储为NV12格式的过渡图像中的V分量,YUV4:2:0格式的第一图像中的部分V分量需要存储为NV12格式的过渡图像中的U分量,如图6K所示。Optionally, during the process of re-storing the pixel values in the first image in the YUV4:2:0 format to obtain the transition image in the NV12 format, only some of the pixel values can be stored, for example, in the YUV4:2:0 format The Y component in the first image is still used as the Y component in the transition image in NV12 format, so it does not need to be stored again; while part of the U component in the first image in YUV4:2:0 format needs to be stored as a transition image in NV12 format Part of the V component in the first image in the YUV4:2:0 format needs to be stored as the U component in the transition image in the NV12 format, as shown in FIG. 6K .
得到NV12格式的过渡图像之后,将过渡图像中第一部分像素值的类型重新定义为Y分量,将过渡图像中第二部分像素值的类型重新定义U分量,将过渡图像中第三部分像素值的类型重新定义V分量;该第一部分像素值的数量、该第二部分像素值的数量和该第三部分像素值的数量各占该过渡图像的像素值总数的1/3。After obtaining the transition image in NV12 format, redefine the type of the first part of the pixel value in the transition image as the Y component, redefine the type of the second part of the pixel value in the transition image as the U component, and redefine the type of the third part of the pixel value in the transition image The type redefines the V component; the number of the first part of pixel values, the number of the second part of pixel values and the number of the third part of pixel values each account for 1/3 of the total number of pixel values of the transition image.
例如,如图6L所示,过渡图像中的全部Y分量的一半保持不变,该过渡图像中的全部Y分量的另一半的类型重新定义U分量,即上述第一部分像素值包括过渡图像中的一半Y分量,上述第二部分像素值包括过渡图像中的另一半Y分量。将过渡图像中的U分量重新定义为YUV4:4:4格式的图像奇数列的V分量,渡图像中的V分量重新定义为YUV4:4:4格式的图像的偶数列V分量,即上述第三部分像素值包括过渡图像中的全部U分量和全部V分量。For example, as shown in Figure 6L, half of all Y components in the transition image remain unchanged, and the type of the other half of all Y components in this transition image redefines the U component, that is, the above-mentioned first part of pixel values includes Half of the Y component, the second part of pixel values includes the other half of the Y component in the transition image. Redefine the U component in the transition image as the V component of the odd column of the image in the YUV4:4:4 format, and redefine the V component in the transition image as the V component of the even column of the image in the YUV4:4:4 format, that is, the above-mentioned The three-part pixel value includes all U components and all V components in the transition image.
本申请实施例中,重新定义像素值的过程就是重新划分或者说标记像素值的过程,例如,为原来的V分量打上标记U的标记信息,这样该V分量就被重新定义为了一个U分量。In the embodiment of the present application, the process of redefining the pixel value is the process of re-dividing or marking the pixel value, for example, marking the original V component with the marking information of U, so that the V component is redefined as a U component.
本申请实施例中,对过渡图像中的Y,U,V分量的类型进行重新定义的模块可以称为YUV逆向转换单元505,当然也可以有其他叫法。In the embodiment of the present application, the module that redefines the types of Y, U, and V components in the transition image may be called the YUV
由于YUV4:4:4格式的图像中的像素值全部来源于目标格式的第一图像,因此,可以认为存在如下间接关系:该目标格式的第一图像中有第一部分像素值最终被转换为了Y分量(该第一部分像素值先是转换为过渡图像中的第一部分像素值,该过渡图像中的第一部分像素值再转换为YUV4:4:4格式的图像中的Y分量),该第一图像中有第二部分像素值最终被转换为了U分量(该第二部分像素值先是转换为过渡图像中的第二部分像素值,该过渡图像中的第二部分像素值再转换为YUV4:4:4格式的图像中的U分量),该第一图像中有第三部分像素值最终被转换为了V分量(该第三部分像素值先是转换为过渡图像中的第三部分像素值,该过渡图像中的第三部分像素值再转换为YUV4:4:4格式的图像中的V分量),该第一部分像素值的数量、该第二部分像素值的数量和该第三部分像素值的数量各占该第一图像的像素值总数的1/3。Since the pixel values in the image in the YUV4:4:4 format all come from the first image in the target format, it can be considered that there is an indirect relationship as follows: the first part of the pixel values in the first image in the target format are finally converted to Y component (the first part of the pixel value is first converted to the first part of the pixel value in the transition image, and the first part of the pixel value in the transition image is then converted to the Y component in the image in the YUV4:4:4 format), in the first image There is a second part of the pixel value that is finally converted to the U component (the second part of the pixel value is first converted to the second part of the pixel value in the transition image, and the second part of the pixel value in the transition image is then converted to YUV4:4:4 The U component in the image of format), the third part of the pixel value in the first image is finally converted to the V component (the third part of the pixel value is first converted into the third part of the pixel value in the transition image, and the transition image The third part of the pixel value is converted to the V component in the image of the YUV4:4:4 format), the number of the first part of the pixel value, the number of the second part of the pixel value and the number of the third part of the pixel value account for 1/3 of the total number of pixel values for this first image.
本申请实施例中,根据YUV4:4:4格式的图像中Y分量、U分量和V分量的配比关系,以及目标格式(如YUV4:2:0、或NV12、或NV21)的图像中Y分量、U分量和V分类的配比关系可知,在转换过程不丢失Y分量、U分量和V分量的情况下,转换得到的YUV4:4:4格式的图像的分辨率是转换前的目标格式的第一图像的分辨率的一半。可选的,从长或宽的角度对比的话,如果YUV4:4:4格式的图像与转换前的第一图像的长相等,那么YUV4:4:4格式的图像的宽是转换前的第一图像的宽的一半;如果YUV4:4:4格式的图像与转换前的第一图像的宽相等,那么YUV4:4:4格式的图像的长是转换前的第一图像的长的一半。In the embodiment of this application, according to the ratio relationship of Y component, U component and V component in the image of YUV4:4:4 format, and the Y component in the image of the target format (such as YUV4:2:0, or NV12, or NV21) The proportioning relationship of component, U component and V classification shows that, in the case of not losing Y component, U component and V component in the conversion process, the resolution of the converted image in YUV4:4:4 format is the target format before conversion Half the resolution of the first image. Optionally, in terms of length or width, if the length of the image in YUV4:4:4 format is equal to the length of the first image before conversion, then the width of the image in YUV4:4:4 format is the first image before conversion Half the width of the image; if the image in YUV4:4:4 format is equal to the width of the first image before conversion, then the length of the image in YUV4:4:4 format is half the length of the first image before conversion.
之后,视频解码装置(例如,通过上述RGB逆向转换单元)对该YUV4:4:4格式的图像进行转换,得到RGB格式的图像,即相当于在视频解码端还原了编码端的RGB格式的图像。Afterwards, the video decoding device (for example, through the above-mentioned RGB inverse conversion unit) converts the image in YUV4:4:4 format to obtain an image in RGB format, which is equivalent to restoring the image in RGB format at the encoding end at the video decoding end.
在图6E、图6G、图6J、图6L中,不同的U分量通过不同的附加标号示意,例如,U11和U13为两个不同的U分量;不同的V分量通过不同的附加标号示意,例如,V12和V14为两个不同的V分量。本申请实施例中,在NV12格式的图像和YUV4:2:0格式的图像中,附加标号相同的U为同一个U分量,例如,NV12格式的图像中的U11和YUV4:2:0格式的图像中的U11为同一个U分量。附加标号相同的V为同一个V分量,NV12格式的图像中的V12和YUV4:2:0格式的图像中的V12为同一个V分量。另外,标号相同的U和V表示U是由V转换得到的,或者V是由U转换得到的,例如,图6E中,V11用于转换为U11。In Fig. 6E, Fig. 6G, Fig. 6J, Fig. 6L, different U components are indicated by different additional labels, for example, U11 and U13 are two different U components; different V components are indicated by different additional labels, for example , V12 and V14 are two different V components. In the embodiment of this application, in the NV12 format image and the YUV4:2:0 format image, the U with the same label is the same U component, for example, the U11 in the NV12 format image and the YUV4:2:0 format U11 in the image is the same U component. The V with the same label is the same V component, and the V12 in the NV12 format image and the V12 in the YUV4:2:0 format image are the same V component. In addition, U and V with the same label indicate that U is converted from V, or V is converted from U. For example, in FIG. 6E, V11 is used to convert to U11.
步骤S608:视频解码装置解析第二码流,得到YUV4:2:0格式的图像。Step S608: the video decoding device parses the second code stream to obtain an image in YUV4:2:0 format.
之后,视频解码装置对该YUV4:2:0格式的图像进行转换,得到RGB格式的图像,即相当于在视频解码端还原了编码端的RGB格式的图像。Afterwards, the video decoding device converts the image in YUV4:2:0 format to obtain an image in RGB format, which is equivalent to restoring the image in RGB format at the encoding end at the video decoding end.
步骤S609:视频解码装置解析指示信息。Step S609: The video decoding device parses the indication information.
该视频解码装置根据该指示信息可以获知该RGB图像的像素值与该RGB图像的上一帧图像的像素值相同,即该GRB的显示效果与上一帧图像的显示效果相同。因此,该视频解码装置在确定该RGB图像的像素值时,直接复用该RGB图像的上一帧图像的像素值即可,无需重新计算该RGB图像的像素值。According to the indication information, the video decoding device can know that the pixel values of the RGB image are the same as those of the previous frame of the RGB image, that is, the display effect of the GRB is the same as that of the previous frame of image. Therefore, when determining the pixel value of the RGB image, the video decoding device can directly multiplex the pixel value of the previous frame of the RGB image without recalculating the pixel value of the RGB image.
在图6A所示的方法中,在编码端对YUV4:4:4格式的图像中的Y分量,U分量,V分量进行转换,得到目标格式的图像,然后目标格式(如YUV4:2:0)的编码器对目标格式的图像进行编码;后续在解码端解码出目标格式的图像后,对目标格式的图像中的Y分量,U分量,V分量进行转换,得到YUV4:4:4格式的图像。这种方法既可兼容目标格式的编/解码器,还能保留YUV4:4:4格式的色彩显示优势,同时也降低了色差,以及降低了参考帧管理复杂度。In the method shown in Figure 6A, the Y component in the image of YUV4:4:4 format is converted at the coding end, U component, and V component is converted to obtain the image of the target format, and then the target format (such as YUV4:2:0 ) encoder encodes the image in the target format; after the image in the target format is decoded at the decoding end, the Y component, U component, and V component in the image in the target format are converted to obtain the YUV4:4:4 format image. This method is not only compatible with the codec/decoder of the target format, but also retains the color display advantages of the YUV4:4:4 format, and also reduces the color difference and the complexity of reference frame management.
上述详细阐述了本申请实施例的方法,下面提供了本申请实施例的装置。The method of the embodiment of the present application has been described in detail above, and the device of the embodiment of the present application is provided below.
请参见图7,图7是本申请实施例提供的一种视频编码装置70的结构示意图,该视频编码装置可以上述源装置10,或者该源装置10中的器件,例如,视频编码器。该视频编码装置70可以包括确定单元701、第一编码单元702,各个单元的详细描述如下。Please refer to FIG. 7 . FIG. 7 is a schematic structural diagram of a video encoding device 70 provided in an embodiment of the present application. The video encoding device may be the above-mentioned
确定单元701,用于根据YUV4:4:4格式的图像确定目标格式的第一图像;A determining unit 701, configured to determine a first image in a target format according to an image in a YUV4:4:4 format;
其中,该YUV4:4:4格式的图像中第四部分像素值用于转换为该第一图像中的Y分量,该YUV4:4:4格式的图像中第五部分像素值用于转换为该第一图像中的U分量,该YUV4:4:4格式的图像中第六部分像素值用于转换为该第一图像中的V分量;该第四部分像素值、该第五部分像素值和该第六部分像素值分别占该YUV4:4:4格式的图像的像素值总数的2/3、1/6和1/6;该目标格式包括YUV4:2:0、NV12和NV21中的一种;Wherein, the fourth part of pixel values in the YUV4:4:4 format image is used to convert to the Y component in the first image, and the fifth part of the pixel values in the YUV4:4:4 format image is used to convert to the The U component in the first image, the sixth part of the pixel value in the YUV4:4:4 format image is used to convert to the V component in the first image; the fourth part of the pixel value, the fifth part of the pixel value and The pixel values of the sixth part respectively account for 2/3, 1/6 and 1/6 of the total number of pixel values of the image in the YUV4:4:4 format; the target format includes one of YUV4:2:0, NV12 and NV21 kind;
第一编码单元702,用于对该第一图像进行编码,得到第一码流。The first encoding unit 702 is configured to encode the first image to obtain a first code stream.
采用上述方法,在编码端对YUV4:4:4格式的图像中的Y分量,U分量,V分量进行转换,得到目标格式的图像,然后目标格式(如YUV4:2:0)的编码器对目标格式的图像进行编码;后续在解码端解码出目标格式的图像后,对目标格式的图像中的Y分量,U分量,V分量进行转换,得到YUV4:4:4格式的图像。这种方法既可兼容目标格式的编/解码器,还能保留YUV4:4:4格式的色彩显示优势,同时也降低了色差,以及降低了参考帧管理复杂度。Using the above method, the Y component, U component, and V component in the image of the YUV4:4:4 format are converted at the encoding end to obtain an image of the target format, and then the encoder of the target format (such as YUV4:2:0) pairs The image in the target format is encoded; after the image in the target format is decoded at the decoding end, the Y component, U component, and V component in the image in the target format are converted to obtain an image in the YUV4:4:4 format. This method is not only compatible with the codec/decoder of the target format, but also retains the color display advantages of the YUV4:4:4 format, and also reduces the color difference and the complexity of reference frame management.
在一种可选的方案中,该确定单元701具体用于:In an optional solution, the determining unit 701 is specifically configured to:
将该YUV4:4:4格式的图像存储为目标格式的第一图像,其中,该YUV4:4:4格式的图像中第四部分像素值用于存储为该第一图像中的Y分量,该YUV4:4:4格式的图像中第五部分像素值用于存储为该第一图像中的U分量,该YUV4:4:4格式的图像中第六部分像素值用于存储为该第一图像中的V分量。The image in the YUV4:4:4 format is stored as the first image in the target format, wherein the fourth part of the pixel values in the image in the YUV4:4:4 format is used to store as the Y component in the first image, the The fifth part of the pixel values in the YUV4:4:4 format image is used to store as the U component in the first image, and the sixth part of the pixel values in the YUV4:4:4 format image is used to store as the first image The V component in .
在又一种可选的方案中,该视频编码装置还包括:In another optional solution, the video encoding device also includes:
转换单元,用于将RGB格式的图像转换为该YUV4:4:4格式的图像;A conversion unit for converting an image in RGB format into an image in this YUV4:4:4 format;
若该RGB格式的图像应用于第一场景,该确定单元用于根据YUV4:4:4格式的图像确定目标格式的第一图像;If the image in RGB format is applied to the first scene, the determining unit is used to determine the first image in the target format according to the image in YUV4:4:4 format;
若该RGB格式的图像应用于第二场景,第二编码单元用于对YUV4:4:4格式的图像进行下采样,以及根据YUV4:2:0格式的编码器对下采样后的图像进行编码,得到第二码流;If the image in RGB format is applied to the second scene, the second encoding unit is used to downsample the image in YUV4:4:4 format, and encode the downsampled image according to the encoder in YUV4:2:0 format , get the second code stream;
该发送单元,还用于向该视频解码器发送该第二码流;The sending unit is further configured to send the second code stream to the video decoder;
其中,该第二场景的图像分辨率的要求低于该第一场景的图像分辨率的要求。Wherein, the image resolution requirement of the second scene is lower than the image resolution requirement of the first scene.
这种方式中,针对图像分辨率的要求较低的场景,采用传统的下采样的方式进行预处理并编码,针对图像分辨率的要求较高的场景,使用不丢失像素值(即不丢失Y分量、U分量和V分量)的方式进行编码,不仅可以最大限度地满足图像分辨率的要求较高的场景对色度的特殊需求,还可以最大限度地减小图像分辨率的要求较低的场景中的编码的数据量。In this method, for scenes with lower image resolution requirements, the traditional downsampling method is used for preprocessing and encoding, and for scenes with higher image resolution requirements, no loss of pixel values (that is, no loss of Y component, U component, and V component), which can not only meet the special requirements for chroma in scenes with high image resolution requirements to the greatest extent, but also minimize the The amount of encoded data in the scene.
在又一种可选的方案中,该第一场景包括办公文档场景,桌面图标场景,文字场景,LOGO场景中的至少一项;该第二场景包括视频场景,游戏场景,自然风景场景中的至少一项。In yet another optional solution, the first scene includes at least one of an office document scene, a desktop icon scene, a text scene, and a LOGO scene; the second scene includes a video scene, a game scene, and a scene of natural scenery. at least one.
在又一种可选的方案中:In yet another alternative:
若该RGB图像的像素与上一帧RGB图像的像素值的差异超过预设阈值,则该转换单元用于将RGB格式的图像转换为该YUV4:4:4格式的图像;If the difference between the pixel of the RGB image and the pixel value of the previous frame of RGB image exceeds a preset threshold, the conversion unit is used to convert the image in RGB format into the image in YUV4:4:4 format;
若该RGB图像的像素与上一帧RGB图像的像素的差异不超过预设阈值,则该发送单元用于向该视频解码器发送指示信息,该指示信息用于指示该RGB图像的像素与该上一帧RGB图像的像素相同。If the difference between the pixels of the RGB image and the pixels of the previous RGB image does not exceed a preset threshold, the sending unit is used to send indication information to the video decoder, and the indication information is used to indicate that the pixels of the RGB image are different from the pixels of the RGB image. The pixels of the RGB image from the previous frame are the same.
这种方式中,当某一帧RGB图像(也可能是RGB图像中的一部分)与上一帧RGB图像(也可能是RGB图像中的一部分)的像素值相差较小时,就无需对该某一帧RGB图像重新进行编码,直接复用上一帧RGB图像即可,这样能够减小计算压力,提高整体编码效率。In this way, when the pixel values of a frame of RGB image (may also be a part of RGB image) and the previous frame of RGB image (maybe a part of RGB image) have a small difference, there is no need to A frame of RGB image is re-encoded, and the previous frame of RGB image can be directly multiplexed, which can reduce the calculation pressure and improve the overall encoding efficiency.
在又一种可选的方案中,该根据YUV4:4:4格式的图像确定目标格式的第一图像方面,该确定单元具体用于:将该YUV4:4:4格式的图像转换为NV12格式的过渡图像,其中,该YUV4:4:4格式的图像中第四部分像素值用于转换为该过渡图像中的Y分量,该YUV4:4:4格式的图像中第五部分像素值用于转换为该过渡图像中的U分量,该YUV4:4:4格式的图像中第六部分像素值用于转换为该过渡图像中的V分量,这里提及的转换方式可以是对YUV4:4:4格式的图像中的像素值进行重新定义,例如将U分量重新定义(或者说标记)为Y分量。然后将该NV12格式的过渡图像存储为YUV4:2:0格式的第一图像,将NV12格式的过渡图像存储为YUV4:2:0格式的第一图像属于比较成熟的技术,实现方式有很多,此处不一一列举。结合第一方面,或者第一方面的上述任一种可选的方案,在又一种可选的方案中:该第四部分像素值包括该YUV4:4:4格式的图像中的全部Y分量和全部U分量;该第五部分像素值包括该YUV4:4:4格式的图像中全部V分量的一半;该第六部分像素值包括该YUV4:4:4格式的图像中全部V分量的另一半。In yet another optional solution, the first image aspect of the target format is determined according to the image in the YUV4:4:4 format, and the determining unit is specifically configured to: convert the image in the YUV4:4:4 format into an NV12 format transition image, wherein the fourth part of the pixel values in the YUV4:4:4 format image is used to convert to the Y component in the transition image, and the fifth part of the pixel values in the YUV4:4:4 format image is used for Converted to the U component in the transition image, the sixth part of the pixel value in the YUV4:4:4 format image is used to convert to the V component in the transition image, the conversion method mentioned here can be YUV4:4: 4 format image, for example, redefining (or marking) the U component as the Y component. Then store the transition image in NV12 format as the first image in YUV4:2:0 format, and store the transition image in NV12 format as the first image in YUV4:2:0 format, which is a relatively mature technology, and there are many ways to implement it. They are not listed here. In combination with the first aspect, or any of the above optional solutions of the first aspect, in another optional solution: the fourth part of pixel values includes all Y components in the image in the YUV4:4:4 format and all U components; the fifth part of the pixel value includes half of all the V components in the image of the YUV4:4:4 format; the sixth part of the pixel value includes another part of all the V components in the image of the YUV4:4:4 format half.
其中,该全部V分量的一半为该全部V分量中的奇数列的V分量,该全部V分量的另一半为该全部V分量中的偶数列的V分量。Wherein, half of the all V components are V components of odd columns among all the V components, and the other half of all V components are V components of even columns among all V components.
或者,该全部V分量的一半为该全部V分量中的奇数行的V分量,该全部V分量的另一半为该全部V分量中的偶数行的V分量。Alternatively, half of the total V components are V components of odd lines in the total V components, and the other half of the total V components are V components of even lines in the total V components.
需要说明的是,各个单元的实现及有益效果还可以对应参照图6A所示的方法实施例的相应描述。It should be noted that the implementation and beneficial effects of each unit may also refer to the corresponding description of the method embodiment shown in FIG. 6A .
请参见图8,图8是本申请实施例提供的一种视频编码装置80的结构示意图,该视频编码装置80可以上述目的地装置20,或者目的地装置20中的器件,例如,视频解码器。该视频编码装置可以包括获取单元801、解析单元802、确定单元803,各个单元的详细描述如下。Please refer to FIG. 8. FIG. 8 is a schematic structural diagram of a video encoding device 80 provided by an embodiment of the present application. The video encoding device 80 may be the above-mentioned destination device 20, or a device in the destination device 20, for example, a video decoder . The video coding apparatus may include an acquiring unit 801, an analyzing unit 802, and a determining unit 803, and the detailed description of each unit is as follows.
获取单元801,用于获取包括目标格式数据的第一码流,其中,所述目标格式包括YUV4:2:0、NV12或NV21中的一种或多种的组合;An acquisition unit 801, configured to acquire a first code stream including data in a target format, where the target format includes a combination of one or more of YUV4:2:0, NV12 or NV21;
解析单元802,用于解析该第一码流,得到第一图像;An parsing unit 802, configured to parse the first code stream to obtain a first image;
确定单元803,用于根据该第一图像确定YUV4:4:4格式的图像;其中,该第一图像中第一部分像素值用于转换为该YUV4:4:4格式的图像的Y分量,该第一图像中第二部分像素值用于转换为该YUV4:4:4格式的图像的U分量,该第一图像中第三部分像素值用于转换为该YUV4:4:4格式的图像的V分量;该第一部分像素值、该第二部分像素值和该第三部分像素值各占该第一图像的像素值总数的1/3。A determining unit 803, configured to determine an image in YUV4:4:4 format according to the first image; wherein, the first part of pixel values in the first image is used to convert to the Y component of the image in YUV4:4:4 format, the The second part of the pixel values in the first image is used to convert to the U component of the image in the YUV4:4:4 format, and the third part of the pixel values in the first image is used to convert to the U component of the image in the YUV4:4:4 format V component; the first part of pixel values, the second part of pixel values and the third part of pixel values each account for 1/3 of the total number of pixel values of the first image.
采用上述方法,在编码端对YUV4:4:4格式的图像中的Y分量,U分量,V分量进行转换,得到目标格式的图像,然后目标格式(如YUV4:2:0)的编码器对目标格式的图像进行编码;后续在解码端解码出目标格式的图像后,对目标格式的图像中的Y分量,U分量,V分量进行转换,得到YUV4:4:4格式的图像。这种方法既可兼容目标格式的编/解码器,还能保留YUV4:4:4格式的色彩显示优势,同时也降低了色差,以及降低了参考帧管理复杂度。Using the above method, the Y component, U component, and V component in the image of the YUV4:4:4 format are converted at the encoding end to obtain an image of the target format, and then the encoder of the target format (such as YUV4:2:0) pairs The image in the target format is encoded; after the image in the target format is decoded at the decoding end, the Y component, U component, and V component in the image in the target format are converted to obtain an image in the YUV4:4:4 format. This method is not only compatible with the codec/decoder of the target format, but also retains the color display advantages of the YUV4:4:4 format, and also reduces the color difference and the complexity of reference frame management.
在一种可选的方案中,该确定单元803具体用于:In an optional solution, the determining unit 803 is specifically configured to:
将该YUV4:4:4格式的图像存储为YUV4:2:0格式的第一图像,该第一图像中第一部分像素值用于存储为该YUV4:4:4格式的图像的Y分量,该第一图像中第二部分像素值用于存储为该YUV4:4:4格式的图像的U分量,该第二图像中第三部分像素值用于存储为该YUV4:4:4格式的图像的V分量。The image in the YUV4:4:4 format is stored as a first image in the YUV4:2:0 format, and the first part of the pixel values in the first image is used to store the Y component of the image in the YUV4:4:4 format, the The second part of the pixel values in the first image is used to store as the U component of the image in the YUV4:4:4 format, and the third part of the pixel values in the second image is used to store as the U component of the image in the YUV4:4:4 format V component.
在又一种可选的方案中,该第一图像为YUV4:2:0格式的图像,该根据该第一图像确定YUV4:4:4格式的图像,包括:将YUV4:2:0格式的图像存储为NV12格式的过渡图像,该YUV4:2:0格式的图像中第一部分像素值用于存储为该过渡图像的Y分量,该YUV4:2:0格式的图像中第二部分像素值用于存储为该过渡图像的U分量,该YUV4:2:0格式的图像中第三部分像素值用于存储为该过渡图像的V分量,将YUV4:2:0格式的第一图像存储为NV12格式的过渡图像属于比较成熟的技术,实现方式有很多,此处不一一列举。然后,将该过渡图像转换为YUV4:4:4格式的图像,这里提及的转换方式可以是对NV12格式的过渡图像中的像素值进行重新定义,例如将部分Y分量重新定义(或者说标记)为U分量。In another optional solution, the first image is an image in YUV4:2:0 format, and determining the image in YUV4:4:4 format according to the first image includes: converting the image in YUV4:2:0 format The image is stored as a transitional image in NV12 format, the first part of the pixel value in the YUV4:2:0 format image is used to store the Y component of the transitional image, and the second part of the pixel value in the YUV4:2:0 format image is used Stored as the U component of the transition image, the third part of the pixel values in the YUV4:2:0 format image is used to store as the V component of the transition image, and the first image in the YUV4:2:0 format is stored as NV12 The transition image format is a relatively mature technology, and there are many implementation methods, which are not listed here. Then, convert the transitional image into an image in YUV4:4:4 format. The conversion method mentioned here can be to redefine the pixel values in the transitional image in NV12 format, for example, redefining part of the Y component (or marking ) is the U component.
在又一种可选的方案中,In yet another alternative,
该第一部分像素值包括该第一图像中全部Y分量的一半;The first partial pixel value includes half of all Y components in the first image;
该第二部分像素值包括该第一图像中全部Y分量的另一半;The second portion of pixel values includes the other half of all Y components in the first image;
该第三部分像素值包括该第一图像中全部U分量和全部V分量;The third part of pixel values includes all U components and all V components in the first image;
其中,该第一图像中的全部U分量用于作为该YUV4:4:4格式的图像的奇数行V分量,该第一图像中的全部V分量用于作为该YUV4:4:4格式的图像的偶数行V分量;Wherein, all the U components in the first image are used as the odd row V components of the image in the YUV4:4:4 format, and all the V components in the first image are used as the image in the YUV4:4:4 format The even-numbered row V component of ;
或者,该第一图像中的全部U分量用于作为该YUV4:4:4格式的图像的奇数列V分量,该第一图像中的全部V分量用于作为该YUV4:4:4格式的图像的偶数列V分量。Or, all the U components in the first image are used as the odd column V components of the image in the YUV4:4:4 format, and all the V components in the first image are used as the image in the YUV4:4:4 format The even-numbered columns of V components.
需要说明的是,各个单元的实现及有益效果还可以对应参照图6A所示的方法实施例的相应描述。It should be noted that the implementation and beneficial effects of each unit may also refer to the corresponding description of the method embodiment shown in FIG. 6A .
图9为本申请实施例的一种电子设备900的一种实现方式的示意性框图,该电子设备可以为编码设备或解码设备。其中,电子设备可以包括处理器910、存储器930和总线系统950。其中,处理器和存储器通过总线系统相连,该存储器用于存储计算机程序代码,该处理器用于执行该存储器存储的计算机程序代码。例如,编码设备的存储器存储计算机程序代码,编码设备的处理器调用存储器中的计算机程序代码,实现图6A所示的方法实施例中由视频编码装置实现的步骤。再如,解码设备的存储器存储计算机程序代码,解码设备的处理器调用存储器中的计算机程序代码,实现图6A所示的方法实施例中由视频解码装置实现的步骤。FIG. 9 is a schematic block diagram of an implementation manner of an electronic device 900 according to an embodiment of the present application. The electronic device may be an encoding device or a decoding device. Wherein, the electronic device may include a
在本申请实施例中,处理器910可以是中央处理单元(Central Processing Unit,简称为“CPU”),处理器910还可以是其他通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。In the embodiment of the present application, the
该存储器930可以包括只读存储器(ROM)设备或者随机存取存储器(RAM)设备。任何其他适宜类型的存储设备也可以用作存储器930。存储器930可以包括由处理器910使用总线950访问的代码和数据931。存储器930可以进一步包括操作系统933和应用程序935,该应用程序935包括允许处理器910实现图6A所示的方法实施例中由视频解码装置实现的步骤,或者实现图6A所示的方法实施例中由视频编码装置实现的步骤。例如,应用程序935可以包括应用1至N,其进一步包括执行图6A所示方法的应用。The
该总线系统950除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都标为总线系统950。In addition to the data bus, the
可选的,电子设备900还可以包括一个或多个输出设备,诸如显示器970。在一个示例中,显示器970可以是触感显示器,其将显示器与可操作地感测触摸输入的触感单元合并。显示器970可以经由总线950连接到处理器910。Optionally, the electronic device 900 may also include one or more output devices, such as a
可选的,以上提及的编码设备可以为图4所示的源装置10,以上提及的解码设备可以为图4所示的目的地装置20。Optionally, the above-mentioned encoding device may be the
本申请实施例还提供一种芯片系统,所述芯片系统包括至少一个处理器,存储器和接口电路,所述存储器、所述接口电路和所述至少一个处理器通过线路互联,所述至少一个存储器中存储有计算机程序;所述计算机程序被所述处理器执行时,使得视频编码装置实现图6A所示的方法流程中所提及的相应操作,或者使得视频解码装置实现图6A所示的方法流程中所提及的相应操作。The embodiment of the present application also provides a chip system, the chip system includes at least one processor, a memory and an interface circuit, the memory, the interface circuit and the at least one processor are interconnected by a line, and the at least one memory A computer program is stored in the computer program; when the computer program is executed by the processor, the video encoding device realizes the corresponding operations mentioned in the method flow shown in FIG. 6A , or the video decoding device realizes the method shown in FIG. 6A The corresponding action mentioned in the process.
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当其在处理器上运行时,使得视频编码装置实现图6A所示的方法流程中所提及的相应操作,或者使得视频解码装置实现图6A所示的方法流程中所提及的相应操作。The embodiment of the present application also provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is run on a processor, the video encoding device implements the steps in the method flow shown in FIG. 6A . The corresponding operations mentioned, or make the video decoding device implement the corresponding operations mentioned in the method flow shown in FIG. 6A .
本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在处理器上运行时,使得视频编码装置实现图6A所示的方法流程中所提及的相应操作,或者使得视频解码装置实现图6A所示的方法流程中所提及的相应操作。The embodiment of the present application also provides a computer program product. When the computer program product is run on a processor, the video encoding device is enabled to implement the corresponding operations mentioned in the method flow shown in FIG. 6A , or the video decoding device is enabled to The corresponding operations mentioned in the method flow shown in FIG. 6A are implemented.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来计算机程序相关的硬件完成,该计算机程序可存储于计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储计算机程序代码的介质。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments are realized. The processes can be completed by computer programs or hardware related to the computer programs. The computer programs can be stored in computer-readable storage media. The computer programs During execution, it may include the processes of the foregoing method embodiments. The aforementioned storage medium includes: ROM or random access memory RAM, magnetic disk or optical disk, and other various media that can store computer program codes.
Claims (16)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010903064.8A CN114125448B (en) | 2020-08-31 | 2020-08-31 | Video coding method, decoding method and related devices |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010903064.8A CN114125448B (en) | 2020-08-31 | 2020-08-31 | Video coding method, decoding method and related devices |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN114125448A CN114125448A (en) | 2022-03-01 |
| CN114125448B true CN114125448B (en) | 2023-04-04 |
Family
ID=80360670
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010903064.8A Active CN114125448B (en) | 2020-08-31 | 2020-08-31 | Video coding method, decoding method and related devices |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114125448B (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114827620A (en) * | 2022-07-01 | 2022-07-29 | 深圳市东微智能科技股份有限公司 | Image processing method, apparatus, device and medium |
| CN115209145A (en) * | 2022-09-15 | 2022-10-18 | 苏州浪潮智能科技有限公司 | Video compression method, system, device and readable storage medium |
| CN115695915A (en) * | 2022-11-01 | 2023-02-03 | 山东云海国创云计算装备产业创新中心有限公司 | A video data processing system, method, device and storage medium |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR100657268B1 (en) * | 2004-07-15 | 2006-12-14 | 학교법인 대양학원 | Flexible coding and decoding method and apparatus for color image |
| EP2144432A1 (en) * | 2008-07-08 | 2010-01-13 | Panasonic Corporation | Adaptive color format conversion and deconversion |
| US8958474B2 (en) * | 2012-03-15 | 2015-02-17 | Virtualinx, Inc. | System and method for effectively encoding and decoding a wide-area network based remote presentation session |
| JP6344082B2 (en) * | 2014-06-19 | 2018-06-20 | 株式会社ニコン | Encoding device, decoding device, encoding method, and decoding method |
| CN106899861B (en) * | 2017-04-08 | 2018-09-04 | 腾讯科技(深圳)有限公司 | Image file processing method, device and system thereof |
-
2020
- 2020-08-31 CN CN202010903064.8A patent/CN114125448B/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| CN114125448A (en) | 2022-03-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12238310B2 (en) | Hybrid backward-compatible signal encoding and decoding | |
| US8233527B2 (en) | Software video transcoder with GPU acceleration | |
| CN101889447B (en) | Extension of the AVC standard to encode high resolution digital still pictures in series with video | |
| US20160316215A1 (en) | Scalable video coding system with parameter signaling | |
| CN111491168A (en) | Video coding and decoding method, decoder, encoder and related equipment | |
| CN114125448B (en) | Video coding method, decoding method and related devices | |
| JP2011505781A (en) | Extension of the AVC standard to encode high-resolution digital still images in parallel with video | |
| TWI626841B (en) | Adaptive processing of video streams with reduced color resolution | |
| TW201725905A (en) | Entropy coding techniques for display stream compression (DSC) of non-4:4:4 chroma sub-sampling | |
| CA2774976C (en) | Embedded graphics coding: reordered bitstream for parallel decoding | |
| CN112204971A (en) | Video image coding method and device and movable platform | |
| WO2021056575A1 (en) | Low-delay joint source-channel coding method, and related device | |
| KR20180102565A (en) | Systems and methods for calculating distortion in display stream compression (DSC) | |
| WO2011031592A2 (en) | Bitstream syntax for graphics-mode compression in wireless hd 1.1 | |
| CN111447442B (en) | Intra-frame encoding method, intra-frame decoding method, device, and medium | |
| WO2021057686A1 (en) | Video decoding method and apparatus, video encoding method and apparatus, storage medium and electronic device | |
| US10609411B1 (en) | Cross color prediction for image/video compression | |
| US10721484B2 (en) | Determination of a co-located luminance sample of a color component sample, for HDR coding/decoding | |
| CN106954073B (en) | Video data input and output method, device and system | |
| US20210076048A1 (en) | System, apparatus and method for data compaction and decompaction | |
| CN118612446A (en) | Coding and decoding method, device, equipment, storage medium and computer program | |
| WO2023197717A1 (en) | Image decoding method and apparatus, and image coding method and apparatus | |
| CN115866244A (en) | Image coding method and device |
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 |