CN113473132B - Transparent video compression method, device, storage medium and terminal - Google Patents
Transparent video compression method, device, storage medium and terminal Download PDFInfo
- Publication number
- CN113473132B CN113473132B CN202110848744.9A CN202110848744A CN113473132B CN 113473132 B CN113473132 B CN 113473132B CN 202110848744 A CN202110848744 A CN 202110848744A CN 113473132 B CN113473132 B CN 113473132B
- Authority
- CN
- China
- Prior art keywords
- frame image
- transparency
- target
- information
- color
- 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
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/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
-
- 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/17—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 an image region, e.g. an object
- H04N19/172—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 an image region, e.g. an object the region being a picture, frame or field
-
- 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/182—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 pixel
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
Description
技术领域Technical Field
本申请涉及计算机技术领域,尤其涉及一种透明视频压缩方法、装置、存储介质以及终端。The present application relates to the field of computer technology, and in particular to a transparent video compression method, device, storage medium and terminal.
背景技术Background technique
阿尔法通道数值,用于表示透明度数据,代表所在像素的透明度。阿尔法通道数值可以用百分比表示,也可以用0-255这样的值表示。若一个像素的阿尔法通道数值为0%,那它就是完全透明的(也就是看不见的),而数值为100%则意味着一个完全不透明的像素(传统的数字图像)。在0%和100%之间的值则使得像素可以透过背景显示出来。The alpha channel value is used to represent transparency data and represents the transparency of the pixel. The alpha channel value can be expressed as a percentage or as a value between 0 and 255. If a pixel's alpha channel value is 0%, it is completely transparent (that is, invisible), while a value of 100% means a completely opaque pixel (traditional digital images). Values between 0% and 100% allow the pixel to show through the background.
相关技术中,在对带有阿尔法通道数值的透明视频进行压缩时,通常会采用有损压缩的方式,而随着有损压缩的比例越大,损失就越大,还原透明视频时,会丢失细节,出现视频失真的问题。In the related art, when compressing transparent videos with alpha channel values, lossy compression is usually used. As the lossy compression ratio increases, the loss increases. When restoring the transparent video, details will be lost, resulting in video distortion.
发明内容Summary of the invention
本申请实施例提供了一种透明视频压缩方法、装置、计算机存储介质以及终端,可以避免压缩后的透明视频在还原时出现失真的问题。所述技术方案如下:The embodiments of the present application provide a transparent video compression method, device, computer storage medium and terminal, which can avoid the problem of distortion of the compressed transparent video when restoring it. The technical solution is as follows:
第一方面,本申请实施例提供了一种透明视频压缩方法,所述方法包括:In a first aspect, an embodiment of the present application provides a transparent video compression method, the method comprising:
获取初始视频中初始帧图像的尺寸信息、第一颜色信息以及第一透明度信息,所述第一透明度信息包括所述初始帧图像中各像素点的第一透明度;Acquire size information, first color information, and first transparency information of an initial frame image in an initial video, where the first transparency information includes a first transparency of each pixel in the initial frame image;
生成与所述初始帧图像对应的空白帧图像,所述空白帧图像包括颜色区域和透明区域,所述颜色区域的尺寸信息以及所述透明区域的尺寸信息与所述初始帧图像的尺寸信息相同;Generate a blank frame image corresponding to the initial frame image, wherein the blank frame image includes a color area and a transparent area, and size information of the color area and size information of the transparent area are the same as size information of the initial frame image;
将所述第一颜色信息写入所述颜色区域,并将各所述第一透明度进行压缩处理后得到的第二颜色信息写入所述透明区域,得到所述初始帧图像对应的目标帧图像;Writing the first color information into the color area, and writing the second color information obtained after compressing each of the first transparency into the transparent area, to obtain a target frame image corresponding to the initial frame image;
基于各所述初始帧图像对应的目标帧图像生成目标视频。A target video is generated based on the target frame images corresponding to each of the initial frame images.
第二方面,本申请实施例提供了一种透明视频压缩装置,所述装置包括:In a second aspect, an embodiment of the present application provides a transparent video compression device, the device comprising:
信息获取模块,用于获取初始视频中初始帧图像的尺寸信息、第一颜色信息以及第一透明度信息,所述第一透明度信息包括所述初始帧图像中各像素点的第一透明度;An information acquisition module, used to acquire size information, first color information, and first transparency information of an initial frame image in an initial video, wherein the first transparency information includes a first transparency of each pixel in the initial frame image;
图像帧生成模块,用于生成与所述初始帧图像对应的空白帧图像,所述空白帧图像包括颜色区域和透明区域,所述颜色区域的尺寸信息以及所述透明区域的尺寸信息与所述初始帧图像的尺寸信息相同;An image frame generation module, used to generate a blank frame image corresponding to the initial frame image, wherein the blank frame image includes a color area and a transparent area, and the size information of the color area and the size information of the transparent area are the same as the size information of the initial frame image;
图像帧处理模块,用于将所述第一颜色信息写入所述颜色区域,并将各所述第一透明度进行压缩处理后得到的第二颜色信息写入所述透明区域,得到所述初始帧图像对应的目标帧图像;An image frame processing module, used for writing the first color information into the color area, and writing the second color information obtained after compressing each of the first transparency into the transparent area, so as to obtain a target frame image corresponding to the initial frame image;
视频生成模块,用于基于各所述初始帧图像对应的目标帧图像生成目标视频。The video generation module is used to generate a target video based on the target frame images corresponding to each of the initial frame images.
第三方面,本申请实施例提供了一种计算机存储介质,所述计算机存储介质有多条指令,所述指令适于由处理器加载并执行上述的方法步骤。In a third aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium has a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.
第四方面,本申请实施例提供了一种终端,可包括:存储器和处理器;其中,所述存储器存储有计算机程序,所述计算机程序适于由所述存储器加载并执行上述的方法步骤。In a fourth aspect, an embodiment of the present application provides a terminal, which may include: a memory and a processor; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the memory and executing the above-mentioned method steps.
本申请实施例提供的技术方案带来的有益效果至少包括:The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
本申请实施例的方案在执行时,获取初始视频中初始帧图像的尺寸信息、第一颜色信息以及第一透明度信息,所述第一透明度信息包括所述初始帧图像中各像素点的第一透明度,生成与所述初始帧图像对应的空白帧图像,所述空白帧图像包括颜色区域和透明区域,所述颜色区域的尺寸信息以及所述透明区域的尺寸信息与所述初始帧图像的尺寸信息相同,将所述第一颜色信息写入所述颜色区域,并将各所述第一透明度进行压缩处理后得到的第二颜色信息写入所述透明区域,得到所述初始帧图像对应的目标帧图像,基于各所述初始帧图像对应的目标帧图像生成目标视频。本申请通过将初始帧图像中所有像素点的透明度进行压缩后得到的颜色信息写入透明区域,再基于透明区域和颜色区域所组成的各个目标帧图像生成压缩后的初始视频,保留了初始视频中所有像素点的透明度,不会丢失细节,进而可以避免压缩后的透明视频在还原时出现失真的问题。When the scheme of the embodiment of the present application is executed, the size information, first color information and first transparency information of the initial frame image in the initial video are obtained, the first transparency information includes the first transparency of each pixel in the initial frame image, and a blank frame image corresponding to the initial frame image is generated, the blank frame image includes a color area and a transparent area, the size information of the color area and the size information of the transparent area are the same as the size information of the initial frame image, the first color information is written into the color area, and the second color information obtained after the first transparency is compressed is written into the transparent area, the target frame image corresponding to the initial frame image is obtained, and the target video is generated based on the target frame images corresponding to the initial frame images. The present application retains the transparency of all pixels in the initial frame image by writing the color information obtained by compressing the transparency of all pixels in the initial frame image into the transparent area, and then generates a compressed initial video based on each target frame image composed of the transparent area and the color area, thereby retaining the transparency of all pixels in the initial video and not losing details, thereby avoiding the problem of distortion of the compressed transparent video when it is restored.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
图1是本申请实施例提供的一种透明视频压缩方法的流程示意图;FIG1 is a schematic diagram of a flow chart of a transparent video compression method provided in an embodiment of the present application;
图2是本申请实施例提供的一种生成空白帧图像的原理示意图;FIG2 is a schematic diagram of a principle for generating a blank frame image provided by an embodiment of the present application;
图3是本申请实施例提供的另一种透明视频压缩方法的流程示意图;FIG3 is a schematic diagram of a flow chart of another transparent video compression method provided in an embodiment of the present application;
图4是本申请实施例提供的一种生成目标帧图像的原理示意图;FIG4 is a schematic diagram of a principle for generating a target frame image provided by an embodiment of the present application;
图5是本申请实施例提供的又一种透明视频压缩方法的流程示意图;FIG5 is a flow chart of another transparent video compression method provided in an embodiment of the present application;
图6是本申请实施例提供的一种透明视频压缩装置结构示意图;FIG6 is a schematic diagram of the structure of a transparent video compression device provided in an embodiment of the present application;
图7是本申请实施例提供的一种终端的结构示意图。FIG. 7 is a schematic diagram of the structure of a terminal provided in an embodiment of the present application.
具体实施方式Detailed ways
为使得本申请实施例的发明目的、特征、优点能够更加的明显和易懂,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而非全部实施例。基于本申请中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, features, and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
在本申请的描述中,需要理解的是,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性。在本申请的描述中,需要说明的是,除非另有明确的规定和限定,“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本申请中的具体含义。此外,在本申请的描述中,除非另有说明,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。In the description of the present application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In the description of the present application, it should be noted that, unless otherwise clearly specified and limited, "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood in specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And/or" describes the association relationship of associated objects, indicating that there can be three relationships, for example, A and/or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. The character "/" generally indicates that the associated objects before and after are an "or" relationship.
相关技术中,关于透明视频的方案,视频内容由两个区域组成,分别是颜色区域和透明区域,对于透明视频的压缩方案,一种是采用MPEG-2格式对视频进行特定的视频编码来实现透明区域压缩;另一种是通过生成视频时,等比例压缩透明区域的大小,并且在播放视频时,通过插值的方式来还原透明区域。In the related art, regarding the transparent video solution, the video content consists of two areas, namely the color area and the transparent area. For the compression solution of the transparent video, one is to use the MPEG-2 format to perform specific video encoding on the video to achieve transparent area compression; the other is to compress the size of the transparent area proportionally when generating the video, and restore the transparent area by interpolation when playing the video.
显然,采用上述两种方式实现透明视频的压缩,其实都是有损压缩的方式,随着压缩比例越大,损失越大,在压缩比例较大时,播放时还原出来的透明度呈阶梯状/块状分布,会丢失细节,导致视频失真。Obviously, the above two methods of compressing transparent videos are actually lossy compression methods. As the compression ratio increases, the loss increases. When the compression ratio is large, the transparency restored during playback is distributed in a stepped/blocky manner, which will lose details and cause video distortion.
为了便于理解,对本申请实施例中涉及到的名词进行解释。For ease of understanding, the terms involved in the embodiments of the present application are explained.
第一颜色信息:用于表示每一个初始帧图像中所有像素点的R值、G值以及B值。The first color information is used to represent the R value, G value, and B value of all pixels in each initial frame image.
第一透明度信息:用于表示每一个初始帧图像中所有像素点的透明度值(也就是阿尔法通道值,用A表示)。比如,有个像素点的RGBA值分别为:R=255,G=0,B=0,A=151,那么第一颜色信息就包括R=255,G=0,B=0,第一透明度信息就包括A=151。The first transparency information is used to represent the transparency value of all pixels in each initial frame image (that is, the alpha channel value, represented by A). For example, if the RGBA values of a pixel are: R=255, G=0, B=0, A=151, then the first color information includes R=255, G=0, B=0, and the first transparency information includes A=151.
第二颜色信息:用于表示每一个初始帧图像中所有像素点的透明度值经压缩处理后得到的第二R值、第二G值以及第二B值。Second color information: used to represent the second R value, the second G value, and the second B value obtained after the transparency values of all pixels in each initial frame image are compressed.
下面结合具体的实施例对本申请进行详细说明。The present application is described in detail below with reference to specific embodiments.
在下述方法实施例中,为了便于说明,仅以各步骤的执行主体为终端进行介绍说明。In the following method embodiments, for the sake of convenience, only the execution subject of each step is introduced and described as the terminal.
请参见图1,为本申请实施例提供的一种透明视频压缩方法的流程示意图。如图1所示,本申请实施例的所述方法可以包括以下步骤:Please refer to Figure 1, which is a flow chart of a transparent video compression method provided in an embodiment of the present application. As shown in Figure 1, the method in the embodiment of the present application may include the following steps:
S101,获取初始视频中初始帧图像的尺寸信息、第一颜色信息以及第一透明度信息,所述第一透明度信息包括所述初始帧图像中各像素点的第一透明度。S101, obtaining size information, first color information, and first transparency information of an initial frame image in an initial video, where the first transparency information includes a first transparency of each pixel in the initial frame image.
其中,初始视频指的是带有透明度通道的视频,也就是说,初始视频中除了有RGB三色信息外,还带有阿尔法通道信息。阿尔法通道一般用作不透明度参数。如果一个像素点的阿尔法通道数值为0%,那它就是完全透明的(也就是看不见的),而数值为100%则意味着一个完全不透明的像素点(传统的数字图像),在0%和100%之间的值则使得像素点可以透过背景显示出来。阿尔法通道值可以用百分比、整数或者像RGB参数那样用0到1的实数表示。The initial video refers to a video with a transparency channel, that is, in addition to the RGB three-color information, the initial video also has alpha channel information. The alpha channel is generally used as an opacity parameter. If the alpha channel value of a pixel is 0%, it is completely transparent (that is, invisible), and a value of 100% means a completely opaque pixel (traditional digital image), and a value between 0% and 100% allows the pixel to show through the background. The alpha channel value can be expressed as a percentage, an integer, or a real number from 0 to 1 like the RGB parameter.
其中,尺寸信息指的是初始视频中每个初始帧图像的宽度值和高度值,分别代表初始帧图像在水平方向和垂直方向的像素点数量。The size information refers to the width and height of each initial frame image in the initial video, which respectively represent the number of pixels of the initial frame image in the horizontal direction and the vertical direction.
具体的,可以通过视频工具按照视频帧率导出初始视频的各个初始帧图像,同时,也可以得到各个初始帧图像的尺寸信息、第一颜色信息以及第一透明度信息。Specifically, each initial frame image of the initial video may be exported according to the video frame rate through a video tool, and size information, first color information, and first transparency information of each initial frame image may also be obtained.
S102,生成与所述初始帧图像对应的空白帧图像,所述空白帧图像包括颜色区域和透明区域,所述颜色区域的尺寸信息以及所述透明区域的尺寸信息与所述初始帧图像的尺寸信息相同。S102, generating a blank frame image corresponding to the initial frame image, wherein the blank frame image includes a color area and a transparent area, and size information of the color area and size information of the transparent area are the same as size information of the initial frame image.
其中,空白帧图像指的是,尺寸是初始帧图像的两倍尺寸大小的图像,这里所说的两倍尺寸大小,一方面可以理解为,空白帧图像的宽度值是初始帧图像的两倍宽度值,空白帧图像的高度值等于初始帧图像的高度值;另一方面可以理解为,空白帧图像的宽度值等于初始帧图像的宽度值,空白帧图像的高度值等于初始帧图像的两倍高度值。Among them, the blank frame image refers to an image whose size is twice the size of the initial frame image. The double size mentioned here can be understood as, on the one hand, the width value of the blank frame image is twice the width value of the initial frame image, and the height value of the blank frame image is equal to the height value of the initial frame image; on the other hand, it can be understood as, the width value of the blank frame image is equal to the width value of the initial frame image, and the height value of the blank frame image is equal to twice the height value of the initial frame image.
其中,颜色区域可以理解为,用于存放初始帧图像中所有像素点的R值、G值以及B值的区域,颜色区域中的各个像素点的位置与初始帧图像中各个像素点的位置相同。透明区域可以理解为,用于存放初始帧图像中所有像素点的第二R值、第二G值以及第二B值的区域,第二R值并不等同于颜色区域中的R值,第二G值并不等同于颜色区域中的G值,第二B值并不等同于颜色区域中的B值,具体第二R值、第二G值以及第二B值的赋值过程可参见S103。透明区域中的各个像素点的位置与初始帧图像中各个像素点的位置相同。由于颜色区域的宽度值和高度值、透明区域的宽度值和高度值以及初始帧图像的宽度值和高度值都是一样的,初始帧图像中各个像素点的所在位置是固定的,所以在颜色区域和透明区域中也可以固定各个像素点的位置。Among them, the color area can be understood as an area for storing the R value, G value and B value of all pixels in the initial frame image, and the position of each pixel in the color area is the same as the position of each pixel in the initial frame image. The transparent area can be understood as an area for storing the second R value, the second G value and the second B value of all pixels in the initial frame image. The second R value is not equal to the R value in the color area, the second G value is not equal to the G value in the color area, and the second B value is not equal to the B value in the color area. The specific assignment process of the second R value, the second G value and the second B value can be referred to S103. The position of each pixel in the transparent area is the same as the position of each pixel in the initial frame image. Since the width value and height value of the color area, the width value and height value of the transparent area, and the width value and height value of the initial frame image are the same, the position of each pixel in the initial frame image is fixed, so the position of each pixel can also be fixed in the color area and the transparent area.
根据一些实施例,可参见图2所示的示意图,201为初始帧图像,一方面,2021和2022组成空白帧图像,2021和2022的尺寸大小分别都与201相同,2021可以为颜色区域,2021可以为透明区域,或者,2021可以为透明区域,2022可以为颜色区域。另一方面,2031和2032组成空白帧图像,2031和2032的尺寸大小分别都与201相同,2031可以为颜色区域,2031可以为透明区域,或者,2031可以为透明区域,2032可以为颜色区域。According to some embodiments, referring to the schematic diagram shown in FIG. 2, 201 is an initial frame image. On the one hand, 2021 and 2022 form a blank frame image. The sizes of 2021 and 2022 are respectively the same as 201. 2021 can be a color area, 2021 can be a transparent area, or 2021 can be a transparent area, and 2022 can be a color area. On the other hand, 2031 and 2032 form a blank frame image. The sizes of 2031 and 2032 are respectively the same as 201. 2031 can be a color area, 2031 can be a transparent area, or 2031 can be a transparent area, and 2032 can be a color area.
S103,将所述第一颜色信息写入所述颜色区域,并将各所述第一透明度进行压缩处理后得到的第二颜色信息写入所述透明区域,得到所述初始帧图像对应的目标帧图像。S103, writing the first color information into the color area, and writing the second color information obtained after compression processing of each of the first transparencies into the transparent area, to obtain a target frame image corresponding to the initial frame image.
其中,第一颜色信息指的是初始帧图像中所有像素点的R值、G值以及B值,第二颜色信息指的是初始帧图像中所有像素点的透明度值(第一透明度,也就是A值)经压缩处理后得到的第二R值、第二G值以及第二B值。Among them, the first color information refers to the R value, G value and B value of all pixels in the initial frame image, and the second color information refers to the second R value, second G value and second B value obtained after compression processing of the transparency value (first transparency, that is, A value) of all pixels in the initial frame image.
具体的,由每个像素点的第一透明度进行压缩处理后得到第二R值、第二G值以及第二B值的过程,可以理解为,采用三个公式,分别将A值代入三个公式,得到第二R值、第二G值以及第二B值。而这三个公式的主要作用是将较大的A值转换为较小的第二R值、第二G值以及第二B值,也就是说,第二R值、第二G值以及第二B值都小于或者等于A值。可选的,第二R值可以等于第二G值,或者,第二G值可以等于第二B值,或者第二R值可以等于第二B值。进一步的,颜色区域填充为每个像素点的R值、G值以及B值,透明区域填充为每个像素点的第二R值、第二G值以及第二B值,由于颜色区域和透明区域起初为空白帧图像,那么填充有颜色分量值的空白帧图像就变为目标帧图像。Specifically, the process of obtaining the second R value, the second G value and the second B value after compressing the first transparency of each pixel can be understood as using three formulas, substituting the A value into the three formulas respectively, to obtain the second R value, the second G value and the second B value. The main function of these three formulas is to convert the larger A value into the smaller second R value, the second G value and the second B value, that is, the second R value, the second G value and the second B value are all less than or equal to the A value. Optionally, the second R value can be equal to the second G value, or the second G value can be equal to the second B value, or the second R value can be equal to the second B value. Further, the color area is filled with the R value, G value and B value of each pixel, and the transparent area is filled with the second R value, the second G value and the second B value of each pixel. Since the color area and the transparent area are initially blank frame images, the blank frame image filled with color component values becomes the target frame image.
通常,若像素点的R值、G值以及B值三个颜色分量中单个颜色分量值越小,并且单个颜色分量值之间的差距更小(单个颜色分量之间的差值越接近于0),压缩后的透明视频的体积增量就越小。本申请实施例正是基于这一原理,将第一透明度压缩为更小的颜色分量值。Generally, if the value of a single color component among the three color components of the pixel point R value, G value, and B value is smaller, and the difference between the single color component values is smaller (the difference between the single color components is closer to 0), the volume increment of the compressed transparent video is smaller. The embodiment of the present application is based on this principle and compresses the first transparency into a smaller color component value.
S104,基于各所述初始帧图像对应的目标帧图像生成目标视频。S104: Generate a target video based on the target frame images corresponding to the initial frame images.
其中,目标视频为初始视频压缩后的视频,也就是说,目标视频为压缩后的透明视频。具体的,由各个目标帧图像生成目标视频的过程,可以理解为,对各个目标帧图像进行压缩编码,生成目标视频的过程。通常,数字视频压缩编码方法都是混合编码,即将变换编码、运动估计和运动补偿、以及熵编码三种方式相结合来进行压缩编码。The target video is a video compressed from the initial video, that is, the target video is a compressed transparent video. Specifically, the process of generating the target video from each target frame image can be understood as the process of compressing and encoding each target frame image to generate the target video. Generally, digital video compression coding methods are hybrid coding, that is, combining transform coding, motion estimation and motion compensation, and entropy coding to perform compression coding.
变换编码的作用是将空间域描述的图像信号变换到频率域,然后对变换后的系数进行编码处理。一般来说,图像在空间上具有较强的相关性,变换到频率域可以实现去相关和能量集中。常用的正交变换有离散傅里叶变换,离散余弦变换等等。数字视频压缩过程中应用广泛的是离散余弦变换。The function of transform coding is to transform the image signal described in the spatial domain into the frequency domain, and then encode the transformed coefficients. Generally speaking, images have strong correlation in space, and transforming them into the frequency domain can achieve decorrelation and energy concentration. Commonly used orthogonal transforms include discrete Fourier transform, discrete cosine transform, etc. The most widely used in the digital video compression process is discrete cosine transform.
熵编码是因编码后的平均码长接近信源熵值而得名。熵编码多用可变字长编码(Variable Length Coding,简称VLC)实现。其基本原理是对信源中出现概率大的符号赋予短码,对于出现概率小的符号赋予长码,从而在统计上获得较短的平均码长。可变字长编码通常有霍夫曼编码、算术编码、游程编码等。其中游程编码是一种十分简单的压缩方法,它的压缩效率不高,但编码、解码速度快,仍被得到广泛的应用,特别在变换编码之后使用游程编码,有很好的效果。Entropy coding is named because the average code length after coding is close to the entropy value of the source. Entropy coding is often implemented using variable length coding (VLC). The basic principle is to assign short codes to symbols with a high probability of appearing in the source, and assign long codes to symbols with a low probability of appearing, so as to obtain a shorter average code length statistically. Variable length coding usually includes Huffman coding, arithmetic coding, run-length coding, etc. Among them, run-length coding is a very simple compression method. Its compression efficiency is not high, but its encoding and decoding speeds are fast. It is still widely used, especially when run-length coding is used after transform coding, which has a good effect.
运动估计(Motion Estimation)和运动补偿(Motion Compensation)是消除图像序列时间方向相关性的有效手段。DCT变换、量化、熵编码的方法是在一帧图像的基础上进行,通过这些方法可以消除图像内部各像素间在空间上的相关性。实际上图像信号除了空间上的相关性之外,还有时间上的相关性。比如对于像新闻联播这种背景静止,画面主体运动较小的数字视频,每一幅画面之间的区别很小,画面之间的相关性很大。对于这种情况我们没有必要对每一帧图像单独进行编码,而是可以只对相邻视频帧中变化的部分进行编码,从而进一步减小数据量,这方面的工作是由运动估计和运动补偿来实现的。Motion estimation and motion compensation are effective means to eliminate the temporal correlation of image sequences. The methods of DCT transformation, quantization, and entropy coding are performed on the basis of a frame of image. These methods can eliminate the spatial correlation between pixels within the image. In fact, in addition to spatial correlation, image signals also have temporal correlation. For example, for digital videos such as the news broadcast with a static background and small motion of the main body of the picture, the difference between each picture is small, and the correlation between the pictures is large. In this case, we do not need to encode each frame of the image separately, but can only encode the changed parts of adjacent video frames, thereby further reducing the amount of data. This work is achieved by motion estimation and motion compensation.
在实际应用中上述几个编码方法不是分离的,通常将它们结合起来使用以达到最好的压缩效果。In practical applications, the above encoding methods are not separated, and they are usually used in combination to achieve the best compression effect.
本申请实施例的方案在执行时,获取初始视频中初始帧图像的尺寸信息、第一颜色信息以及第一透明度信息,所述第一透明度信息包括所述初始帧图像中各像素点的第一透明度,生成与所述初始帧图像对应的空白帧图像,所述空白帧图像包括颜色区域和透明区域,所述颜色区域的尺寸信息以及所述透明区域的尺寸信息与所述初始帧图像的尺寸信息相同,将所述第一颜色信息写入所述颜色区域,并将各所述第一透明度进行压缩处理后得到的第二颜色信息写入所述透明区域,得到所述初始帧图像对应的目标帧图像,基于各所述初始帧图像对应的目标帧图像生成目标视频。本申请通过将初始帧图像中所有像素点的透明度进行压缩后得到的颜色信息写入透明区域,再基于透明区域和颜色区域所组成的各个目标帧图像生成压缩后的初始视频,保留了初始视频中所有像素点的透明度,可以避免压缩后的透明视频出现失真的问题。When the scheme of the embodiment of the present application is executed, the size information, first color information and first transparency information of the initial frame image in the initial video are obtained, the first transparency information includes the first transparency of each pixel in the initial frame image, a blank frame image corresponding to the initial frame image is generated, the blank frame image includes a color area and a transparent area, the size information of the color area and the size information of the transparent area are the same as the size information of the initial frame image, the first color information is written into the color area, and the second color information obtained after the compression processing of each first transparency is written into the transparent area, the target frame image corresponding to the initial frame image is obtained, and the target video is generated based on the target frame images corresponding to each of the initial frame images. The present application retains the transparency of all pixels in the initial video by writing the color information obtained by compressing the transparency of all pixels in the initial frame image into the transparent area, and then generates a compressed initial video based on each target frame image composed of the transparent area and the color area. The problem of distortion in the compressed transparent video can be avoided.
在下述方法实施例中,为了便于说明,仅以各步骤的执行主体为终端进行介绍说明。In the following method embodiments, for the sake of convenience, only the execution subject of each step is introduced and described as the terminal.
请参见图3,为本申请实施例提供的一种透明视频压缩方法的流程示意图。如图3所示,本申请实施例的所述方法可以包括以下步骤:Please refer to Figure 3, which is a flow chart of a transparent video compression method provided in an embodiment of the present application. As shown in Figure 3, the method in the embodiment of the present application may include the following steps:
S301,获取初始视频中初始帧图像的尺寸信息、第一颜色信息以及第一透明度信息,所述第一透明度信息包括所述初始帧图像中各像素点的第一透明度。S301, obtaining size information, first color information, and first transparency information of an initial frame image in an initial video, where the first transparency information includes a first transparency of each pixel in the initial frame image.
S302,生成与所述初始帧图像对应的空白帧图像,所述空白帧图像包括颜色区域和透明区域,所述颜色区域的尺寸信息以及所述透明区域的尺寸信息与所述初始帧图像的尺寸信息相同。S302, generating a blank frame image corresponding to the initial frame image, wherein the blank frame image includes a color area and a transparent area, and size information of the color area and size information of the transparent area are the same as size information of the initial frame image.
S303,将所述第一颜色信息写入所述颜色区域。S303: Write the first color information into the color area.
具体的,S301-S303可参见图1中的S101-S103,在此不再赘述。Specifically, S301 - S303 may refer to S101 - S103 in FIG. 1 , which will not be described in detail here.
S304,在所述第一透明度信息中确定占比最高的目标透明度。S304: Determine the target transparency with the highest proportion in the first transparency information.
具体的,由于第一透明度信息指的是每个初始帧图像中所有像素点的第一透明度,确定占比最高的目标透明度,可以理解为,从第一透明度中选取出现频率最高的第一透明度,将出现频率最高的第一透明度作为目标透明度。因此,对于初始视频中的每个初始帧图像来说,每个初始帧图像都会有一个目标透明度。Specifically, since the first transparency information refers to the first transparency of all pixels in each initial frame image, determining the target transparency with the highest proportion can be understood as selecting the first transparency with the highest frequency from the first transparency and taking the first transparency with the highest frequency as the target transparency. Therefore, for each initial frame image in the initial video, each initial frame image will have a target transparency.
比如,某一个初始帧图像中有959*959个像素点,这些像素点的第一透明度可以为100,125,130,134,135,136等等,此处透明度的值范围为0-255,在上述第一透明度中出现频率最高的值为134,那么对于该初始帧图像来说,目标透明度就可以为134。For example, there are 959*959 pixels in an initial frame image, and the first transparency of these pixels can be 100, 125, 130, 134, 135, 136, etc. The transparency value range here is 0-255. The most frequently occurring value in the above first transparency is 134. Then for the initial frame image, the target transparency can be 134.
S305,获取在所述目标透明度下不同压缩倍率与所述目标视频的不同压缩体积之间的对应关系,从所述不同压缩倍率中选择压缩体积最小的压缩倍率,将所述压缩体积最小的压缩倍率作为所述目标透明度对应的压缩倍率。S305, obtaining the correspondence between different compression ratios and different compression volumes of the target video under the target transparency, selecting the compression ratio with the smallest compression volume from the different compression ratios, and using the compression ratio with the smallest compression volume as the compression ratio corresponding to the target transparency.
其中,压缩倍率指的是,用于压缩第一透明度的压缩值,具体如何使用压缩倍率来压缩第一透明度可参见下述S307的描述。The compression ratio refers to a compression value used to compress the first transparency. For details on how to use the compression ratio to compress the first transparency, please refer to the description of S307 below.
具体的,对于目标透明度来说,可以预先设置有多个不同压缩倍率,而采用多个压缩倍率对目标透明度进行压缩后可以得到初始帧图像中每个像素点的第二颜色信息,进一步的,可以得到初始帧图像对应的目标帧图像,目标帧图像压缩编码后可以得到压缩的透明视频,也就是目标视频。而目标视频此时的体积可以称之为压缩体积,可以理解的是,对于同一个目标透明度来说,不同压缩倍率所得到的压缩体积也是不同的,那么可以选取压缩体积最小的压缩倍率,将压缩体积最小的压缩倍率作为目标压缩倍率。因为,对透明视频进行压缩的目的,也是为了达到更小的压缩体积的效果。Specifically, for the target transparency, a plurality of different compression ratios can be pre-set, and after compressing the target transparency with a plurality of compression ratios, the second color information of each pixel in the initial frame image can be obtained. Furthermore, the target frame image corresponding to the initial frame image can be obtained, and after the target frame image is compressed and encoded, a compressed transparent video, that is, the target video, can be obtained. The volume of the target video at this time can be called the compressed volume. It can be understood that for the same target transparency, the compressed volumes obtained by different compression ratios are also different. Then, the compression ratio with the smallest compressed volume can be selected, and the compression ratio with the smallest compressed volume can be used as the target compression ratio. Because the purpose of compressing the transparent video is also to achieve a smaller compressed volume effect.
比如,目标透明度为134,预先设置的压缩倍率为1-15范围内15个整数,而这15个压缩倍率对应的压缩体积中,整数13对应的压缩体积最小,则可以将13作为目标透明度134的目标压缩倍率。For example, the target transparency is 134, and the preset compression ratios are 15 integers in the range of 1-15. Among the compression volumes corresponding to these 15 compression ratios, the compression volume corresponding to the integer 13 is the smallest. Therefore, 13 can be used as the target compression ratio for the target transparency of 134.
S306,将所述目标透明度对应的压缩倍率作为所述初始帧图像对应的目标压缩倍率。S306: Using the compression ratio corresponding to the target transparency as the target compression ratio corresponding to the initial frame image.
具体的,由S304-S305可知,目标透明度是针对每一个初始帧图像的所选出来的透明度,则可以将目标透明度对应的压缩倍率作为初始帧图像的目标压缩倍率。也就是说,可以按照目标压缩倍率对该初始帧图像中的所有像素点的第一透明度进行压缩,具体可参见S307,在此不再赘述。Specifically, as can be seen from S304-S305, the target transparency is the selected transparency for each initial frame image, and the compression ratio corresponding to the target transparency can be used as the target compression ratio of the initial frame image. In other words, the first transparency of all pixels in the initial frame image can be compressed according to the target compression ratio. For details, see S307, which will not be repeated here.
S307,按照所述目标压缩倍率分别对各所述第一透明度进行压缩处理,得到所述颜色区域中各像素点的第二颜色信息,并将所述第二颜色信息写入所述透明区域,得到所述初始帧图像对应的目标帧图像。S307, compressing each of the first transparencies according to the target compression ratio to obtain second color information of each pixel in the color area, and writing the second color information into the transparent area to obtain a target frame image corresponding to the initial frame image.
具体的,按照所述目标压缩倍率分别对各所述第一透明度进行压缩处理,可以理解为,采用预先设定的公式,预先设定的公式与目标压缩倍率有关,不同目标压缩倍率可以对应不同的公式,可以在公式中分别代入各个像素点的第一透明度,得到各个像素点的第二R值、第二G值以及第二B值,并将每个像素点的第二R值、第二G值以及第二B值分别写入透明区域中每个像素点所在的位置,进一步的,填充第二颜色信息的透明区域以及填充第一颜色信息的颜色区域可以组成目标帧图像。Specifically, each of the first transparencies is compressed according to the target compression ratio. It can be understood that a preset formula is used. The preset formula is related to the target compression ratio. Different target compression ratios may correspond to different formulas. The first transparency of each pixel point can be substituted into the formula to obtain the second R value, second G value and second B value of each pixel point, and the second R value, second G value and second B value of each pixel point are written into the position of each pixel point in the transparent area respectively. Furthermore, the transparent area filled with the second color information and the color area filled with the first color information can constitute the target frame image.
比如,用ratio表示目标压缩倍率,用R1表示第二R值,G1表示第二G值,B1表示第二B值,A表示各个像素点的第一透明度,本申请实施例根据不同目标压缩倍率,预先设定的公式可以为:For example, ratio represents the target compression ratio, R1 represents the second R value, G1 represents the second G value, B1 represents the second B value, and A represents the first transparency of each pixel. In the embodiment of the present application, according to different target compression ratios, the pre-set formula may be:
(1)ratio=1,R1=A,G1=0,B1=0;(1) ratio = 1, R1 = A, G1 = 0, B1 = 0;
(2)ratio=2,G1=R1,B1=A-R1*2;(2)ratio=2, G1=R1,B1=A-R1*2;
(3)ratio≥3,G1=R1,B1=A-R1*(ratio-1)。(3)ratio≥3, G1=R1, B1=A-R1*(ratio-1).
比如,可参见如图4所示的生成目标帧图像的原理示意图,401表示初始帧图像,4021表示空白帧图像中的颜色区域,4022表示空白帧图像中的透明区域,401中某个像素的RGBA值分别为:R=255,G=0,B=0,A=156;401所示的初始帧图像的目标透明度为255,255对应的目标压缩倍率为10,那么可以将该像素点的A值代入上述公式(3)中,得到R1=15,G1=15,B1=21。因此,可以将R=255,G=0,B=0填充到颜色区域4021中该像素点所在的位置,可以将R1=15,G1=15,B1=21填充到透明区域4022中该像素点所在的位置。For example, see the schematic diagram of the principle of generating the target frame image as shown in FIG4 , 401 represents the initial frame image, 4021 represents the color area in the blank frame image, 4022 represents the transparent area in the blank frame image, and the RGBA values of a certain pixel in 401 are: R=255, G=0, B=0, A=156; the target transparency of the initial frame image shown in 401 is 255, and the target compression ratio corresponding to 255 is 10, then the A value of the pixel point can be substituted into the above formula (3), and R1=15, G1=15, B1=21 can be obtained. Therefore, R=255, G=0, B=0 can be filled into the position where the pixel point is located in the color area 4021, and R1=15, G1=15, B1=21 can be filled into the position where the pixel point is located in the transparent area 4022.
S308,基于各所述初始帧图像对应的目标帧图像生成目标视频。S308: Generate a target video based on the target frame images corresponding to the initial frame images.
具体的,可参见图1中的S104,在此不再赘述。For details, please refer to S104 in FIG. 1 , which will not be described in detail here.
S309,将所述目标压缩倍率、所述颜色区域的尺寸信息以及所述透明区域的尺寸信息写入所述目标视频中。S309, writing the target compression ratio, the size information of the color area, and the size information of the transparent area into the target video.
其中,颜色区域的尺寸信息除了包括颜色区域的宽度值和高度值以外,还可以包括颜色区域在空白帧图像中所占的区域范围。同样的,透明区域的尺寸信息除了包括透明区域的宽度值和高度值以外,还可以包括透明区域在空白帧图像中所占的区域范围。比如,参见图2所示的空白帧图像的原理示意图,若201表示初始帧图像,2021表示颜色区域,2022表示透明区域,201的尺寸大小为100*100,2021以及2022的尺寸大小也为100*100,但是2021和2022所组成的空白帧图像或者目标帧图像的尺寸大小可以为200*100,那么2021在空白帧图像中所占的区域范围可以是宽度值为0-100,高度值为100的像素区域,2022在空白帧图像中所占的区域范围可以是宽度值为100-200,高度值为100的像素区域。Among them, the size information of the color area includes not only the width value and height value of the color area, but also the area range occupied by the color area in the blank frame image. Similarly, the size information of the transparent area includes not only the width value and height value of the transparent area, but also the area range occupied by the transparent area in the blank frame image. For example, referring to the principle schematic diagram of the blank frame image shown in FIG2, if 201 represents the initial frame image, 2021 represents the color area, 2022 represents the transparent area, the size of 201 is 100*100, and the sizes of 2021 and 2022 are also 100*100, but the size of the blank frame image or the target frame image composed of 2021 and 2022 can be 200*100, then the area range occupied by 2021 in the blank frame image can be a pixel area with a width value of 0-100 and a height value of 100, and the area range occupied by 2022 in the blank frame image can be a pixel area with a width value of 100-200 and a height value of 100.
具体的,在对初始视频进行压缩处理后得到目标视频后,还可以将目标压缩倍率、颜色区域的尺寸信息,以及透明区域的尺寸信息写入目标视频的头文件中。可以理解是,还可以将初始视频的帧率、帧数也写入目标视频的头文件中,便于后续对目标视频进行解码解压缩。Specifically, after the target video is obtained by compressing the initial video, the target compression ratio, the size information of the color area, and the size information of the transparent area can also be written into the header file of the target video. It can be understood that the frame rate and number of frames of the initial video can also be written into the header file of the target video to facilitate the subsequent decoding and decompression of the target video.
S310,在播放所述目标视频时,读取所述目标视频中的所述目标压缩倍率、所述颜色区域的尺寸信息以及所述透明区域的尺寸信息。S310, when playing the target video, reading the target compression ratio, the size information of the color area, and the size information of the transparent area in the target video.
具体的,在播放目标视频时,首先需要获取该目标视频的目标压缩倍率,以及目标帧图像中的颜色区域的尺寸信息,以及目标帧图像中的透明区域的尺寸信息。获取目标视频的目标压缩倍率,以及目标帧图像中的透明区域的尺寸信息,是为了根据透明区域中填充的第二颜色信息以及目标压缩倍率来还原各个初始帧图像中每个像素点的第一透明度。获取颜色区域的尺寸信息是为了获取各个初始帧图像中每个像素点的R值、G值以及B值。Specifically, when playing the target video, it is first necessary to obtain the target compression ratio of the target video, the size information of the color area in the target frame image, and the size information of the transparent area in the target frame image. The purpose of obtaining the target compression ratio of the target video and the size information of the transparent area in the target frame image is to restore the first transparency of each pixel in each initial frame image according to the second color information filled in the transparent area and the target compression ratio. The purpose of obtaining the size information of the color area is to obtain the R value, G value, and B value of each pixel in each initial frame image.
S311,根据所述目标压缩倍率以及所述透明区域对应的所述第二颜色信息确定所述初始帧图像中颜色区域的各像素点的第一透明度。S311 , determining a first transparency of each pixel point in a color area in the initial frame image according to the target compression ratio and the second color information corresponding to the transparent area.
具体的,由于在S307中已说明,计算透明区域的第二颜色信息时,可以采用预先设定的公式,由目标压缩倍率和各个像素点的第一透明度进行计算得到。因此,在还原各个像素点的第一透明度时,可以根据公式进行逆向运算,即可得到各个像素点的第一透明度。Specifically, as described in S307, when calculating the second color information of the transparent area, a preset formula can be used to calculate the second color information based on the target compression ratio and the first transparency of each pixel. Therefore, when restoring the first transparency of each pixel, the first transparency of each pixel can be obtained by performing a reverse operation according to the formula.
比如,沿用S307中的例子,本申请实施例在还原第一透明度时,所采用的计算公式可以为:For example, using the example in S307, the calculation formula used in the embodiment of the present application when restoring the first transparency may be:
(1)ratio=1,A=R1;(1) ratio = 1, A = R1;
(2)ratio=2,A=R1+G1+B1;(2) ratio = 2, A = R1 + G1 + B1;
(3)ratio≥3,A=R1*(ratio-2)+G1+B1。(3)ratio≥3,A=R1*(ratio-2)+G1+B1.
S312,基于各所述第一透明度、所述颜色区域对应的所述第一颜色信息、所述颜色区域的尺寸信息以及所述透明区域的尺寸信息,得到所述初始帧图像,并播放包含所有初始帧图像的所述初始视频。S312, based on the first transparencies, the first color information corresponding to the color area, the size information of the color area and the size information of the transparent area, the initial frame image is obtained, and the initial video including all the initial frame images is played.
具体的,由于初始帧图像中各个像素点的第一透明度已由上述计算过程得到,在还原初始帧图像时,还需要获取目标帧图像中颜色区域中的第一颜色信息,即各个像素点的R值、G值以及B值。在读取颜色区域的第一颜色信息时,可以按照颜色区域中各个像素点所在位置进行读取。在读取透明区域中的第二颜色区域对应的各个第一透明度时,也可以按照透明区域中各个像素点所在位置进行读取。因为,颜色区域和透明区域中各个像素点所在的位置,与各个像素点在初始帧图像中的各个像素点所在的位置是相同的。因此,可以按照各个像素点的所在位置,依次得到初始帧图像中各个像素点的RGBA值。进一步的,通过各个像素点的RGBA值得到初始视频的过程,是本领域技术人员所熟知的,在此不再赘述。Specifically, since the first transparency of each pixel in the initial frame image has been obtained by the above calculation process, when restoring the initial frame image, it is also necessary to obtain the first color information in the color area in the target frame image, that is, the R value, G value and B value of each pixel. When reading the first color information of the color area, it can be read according to the position of each pixel in the color area. When reading the first transparencies corresponding to the second color area in the transparent area, it can also be read according to the position of each pixel in the transparent area. Because the position of each pixel in the color area and the transparent area is the same as the position of each pixel in the initial frame image. Therefore, the RGBA value of each pixel in the initial frame image can be obtained in sequence according to the position of each pixel. Furthermore, the process of obtaining the initial video through the RGBA value of each pixel is well known to those skilled in the art and will not be repeated here.
在本申请实施例中,将获取到的初始帧图像的第一颜色信息写入空白帧图像中的颜色区域,在每个初始帧图像对对应的第一透明度信息中确定占比最高的目标透明度,进而确定每个目标透明度对应的目标压缩倍率,即每个初始帧图像采用各自的压缩倍率对各个初始帧图像中各像素点的第一透明度进行压缩得到各像素的第二颜色信息,再将第二颜色写入空白帧图像中的透明区域,进而可以得到目标帧图像,再由各目标帧图像得到目标视频。因此,通过目标视频还原初始视频时,根据压缩倍率以及第二颜色信息即可还原各像素点的第一透明度。通过保留各个像素点的透明度,来实现透明视频的无损压缩,可以避免压缩后的透明视频在还原时出现失真的问题。另外,本申请对各第一透明度进行压缩的过程,不同于相关技术中,透明区域中各个颜色分量可能直接等于透明度,而是可以使得透明区域的各个颜色分量的值更小,以及各个颜色分量之间的差距值更小,从而可以减小透明视频在压缩后的增量体积。In an embodiment of the present application, the first color information of the acquired initial frame image is written into the color area in the blank frame image, and the target transparency with the highest proportion is determined in the first transparency information corresponding to each initial frame image, and then the target compression ratio corresponding to each target transparency is determined, that is, each initial frame image uses its own compression ratio to compress the first transparency of each pixel in each initial frame image to obtain the second color information of each pixel, and then write the second color into the transparent area in the blank frame image, and then the target frame image can be obtained, and then the target video can be obtained from each target frame image. Therefore, when the initial video is restored by the target video, the first transparency of each pixel can be restored according to the compression ratio and the second color information. By retaining the transparency of each pixel, lossless compression of transparent video can be achieved, and the problem of distortion of the compressed transparent video during restoration can be avoided. In addition, the process of compressing each first transparency in the present application is different from the related art, in which each color component in the transparent area may be directly equal to the transparency, but can make the value of each color component in the transparent area smaller, and the difference value between each color component smaller, so that the incremental volume of the transparent video after compression can be reduced.
可选的,在图3的基础上,如图5所示,S304和S306可以被替换为S504和S506。Optionally, based on FIG. 3 , as shown in FIG. 5 , S304 and S306 may be replaced by S504 and S506 .
S504,在第二透明度信息中确定占比最高的目标透明度。S504: Determine the target transparency with the highest proportion in the second transparency information.
其中,第二透明度信息指的是,初始视频的所有初始帧图像的各个像素点的第一透明度。也就是说,第二透明度信息包含的是初始视频中所有像素点的第一透明度。The second transparency information refers to the first transparency of each pixel of all initial frame images of the initial video. In other words, the second transparency information includes the first transparency of all pixels in the initial video.
具体的,在第二透明度信息中确定占比最高的目标透明度,可以理解为,在所有像素点对应的第一透明度中选取出现频率最高的第一透明度,将出现频率最高的第一透明度作为目标透明度。因此,对于初始视频中的每个初始帧图像来说,每个初始帧图像都对应同一个目标透明度。Specifically, determining the target transparency with the highest proportion in the second transparency information can be understood as selecting the first transparency with the highest frequency among the first transparency corresponding to all pixels, and taking the first transparency with the highest frequency as the target transparency. Therefore, for each initial frame image in the initial video, each initial frame image corresponds to the same target transparency.
比如,某一个初始视频中,这些像素点的第一透明度可以为0,30,35,40,50,100,125,135,136,199,234等等,此处透明度的值范围为0-255,在上述第一透明度中出现频率最高的值为100,那么对于该初始视频来说,目标透明度就可以为100。For example, in an initial video, the first transparency of these pixels can be 0, 30, 35, 40, 50, 100, 125, 135, 136, 199, 234, etc., where the transparency value range is 0-255. The most frequently occurring value in the above first transparency is 100. Then for the initial video, the target transparency can be 100.
S506,将所述目标透明度对应的压缩倍率作为所述初始帧图像对应的目标压缩倍率。S506: Using the compression ratio corresponding to the target transparency as the target compression ratio corresponding to the initial frame image.
具体的,由S504可知,目标透明度是针对初始视频所选出来的透明度,则可以将初始视频的目标透明度所对应的压缩倍率作为所有初始帧图像的目标压缩倍率。也就是说,可以按照同一个目标压缩倍率对所有初始帧图像中的所有像素点的第一透明度进行压缩。Specifically, as can be seen from S504, the target transparency is the transparency selected for the initial video, and the compression ratio corresponding to the target transparency of the initial video can be used as the target compression ratio of all initial frame images. In other words, the first transparency of all pixels in all initial frame images can be compressed according to the same target compression ratio.
在本申请实施例中,在选取目标透明度时,根据初始视频中所有初始帧图像中的各像素点的透明度值进行确定,因此,对各像素点的透明度值进行压缩处理时,仅选择一个目标压缩倍率进行压缩即可,那么在还原各像素点的透明度值,也只需采用这一个目标压缩倍率进行还原即可。通过选取一个目标透明度以及获取一个目标压缩倍率,可以在避免压缩后的透明视频还原时出现失真问题的同时,还可以简化计算过程。In the embodiment of the present application, when selecting the target transparency, it is determined according to the transparency value of each pixel in all the initial frame images in the initial video. Therefore, when compressing the transparency value of each pixel, only one target compression ratio is selected for compression. Then, when restoring the transparency value of each pixel, only this target compression ratio is needed for restoration. By selecting a target transparency and obtaining a target compression ratio, it is possible to avoid distortion when restoring the compressed transparent video and simplify the calculation process.
请参见图6,为本申请实施例提供的一种透明视频压缩装置的结构示意图。透明视频压缩装置600可以通过软件、硬件或者两者的结合实现成为终端的全部或一部分。装置600包括:Please refer to FIG6 , which is a schematic diagram of the structure of a transparent video compression device provided in an embodiment of the present application. The transparent video compression device 600 can be implemented as all or part of a terminal through software, hardware, or a combination of both. The device 600 includes:
信息获取模块610,用于获取初始视频中初始帧图像的尺寸信息、第一颜色信息以及第一透明度信息,所述第一透明度信息包括所述初始帧图像中各像素点的第一透明度;An information acquisition module 610 is used to acquire size information, first color information, and first transparency information of an initial frame image in an initial video, where the first transparency information includes a first transparency of each pixel in the initial frame image;
图像帧生成模块620,用于生成与所述初始帧图像对应的空白帧图像,所述空白帧图像包括颜色区域和透明区域,所述颜色区域的尺寸信息以及所述透明区域的尺寸信息与所述初始帧图像的尺寸信息相同;An image frame generating module 620 is used to generate a blank frame image corresponding to the initial frame image, wherein the blank frame image includes a color area and a transparent area, and the size information of the color area and the size information of the transparent area are the same as the size information of the initial frame image;
图像帧处理模块630,用于将所述第一颜色信息写入所述颜色区域,并将各所述第一透明度进行压缩处理后得到的第二颜色信息写入所述透明区域,得到所述初始帧图像对应的目标帧图像;An image frame processing module 630 is used to write the first color information into the color area, and write the second color information obtained after compressing each of the first transparency into the transparent area, so as to obtain a target frame image corresponding to the initial frame image;
视频生成模块640,用于基于各所述初始帧图像对应的目标帧图像生成目标视频。The video generation module 640 is used to generate a target video based on the target frame images corresponding to each of the initial frame images.
可选的,图像帧处理模块630包括:Optionally, the image frame processing module 630 includes:
第一获取单元,用于获取所述初始帧图像对应的目标压缩倍率;A first acquisition unit, used to acquire a target compression ratio corresponding to the initial frame image;
第二压缩单元,用于按照所述目标压缩倍率分别对各所述第一透明度进行压缩处理,得到所述颜色区域中各像素点的第二颜色信息,并将所述第二颜色信息写入所述透明区域。The second compression unit is used to compress each of the first transparencies according to the target compression ratio to obtain second color information of each pixel in the color area, and write the second color information into the transparent area.
可选的,第一获取单元,包括:Optionally, the first acquisition unit includes:
第一获取子单元,用于在所述第一透明度信息中确定占比最高的目标透明度,并确定所述目标透明度对应的压缩倍率;A first acquisition subunit is used to determine the target transparency with the highest proportion in the first transparency information, and determine the compression ratio corresponding to the target transparency;
第二获取子单元,用于将所述目标透明度对应的压缩倍率作为所述初始帧图像对应的目标压缩倍率。The second acquisition subunit is used to use the compression ratio corresponding to the target transparency as the target compression ratio corresponding to the initial frame image.
可选的,第一获取单元,包括:Optionally, the first acquisition unit includes:
第三获取子单元,用于在第二透明度信息中确定占比最高的目标透明度,并确定所述目标透明度对应的压缩倍率,所述第二透明度信息包括所述初始视频的所有初始帧图像的各像素点的第一透明度;A third acquisition subunit is used to determine the target transparency with the highest proportion in the second transparency information, and determine the compression ratio corresponding to the target transparency, wherein the second transparency information includes the first transparency of each pixel point of all initial frame images of the initial video;
第四获取子单元,用于将所述目标透明度对应的压缩倍率作为所述初始帧图像对应的目标压缩倍率。The fourth acquisition subunit is used to use the compression ratio corresponding to the target transparency as the target compression ratio corresponding to the initial frame image.
可选的,第一获取子单元或者第三获取子单元包括:Optionally, the first acquisition subunit or the third acquisition subunit includes:
第五获取子单元,用于获取在所述目标透明度下不同压缩倍率与所述目标视频的不同压缩体积之间的对应关系;A fifth acquisition subunit, configured to acquire a correspondence between different compression ratios and different compression volumes of the target video at the target transparency;
第六获取子单元,用于从所述不同压缩倍率中选择压缩体积最小的压缩倍率,将所述压缩体积最小的压缩倍率作为所述目标透明度对应的压缩倍率。The sixth acquisition subunit is used to select a compression ratio with the smallest compression volume from the different compression ratios, and use the compression ratio with the smallest compression volume as the compression ratio corresponding to the target transparency.
可选的,装置600还包括:Optionally, the device 600 further includes:
信息写入模块,用于将所述目标压缩倍率、所述颜色区域的尺寸信息以及所述透明区域的尺寸信息写入所述目标视频中。The information writing module is used to write the target compression ratio, the size information of the color area and the size information of the transparent area into the target video.
第一播放模块,用于在播放所述目标视频时,读取所述目标视频中的所述目标压缩倍率、所述颜色区域的尺寸信息以及所述透明区域的尺寸信息;A first playback module, used for reading the target compression ratio, the size information of the color area, and the size information of the transparent area in the target video when playing the target video;
第二播放模块,用于根据所述目标压缩倍率以及所述透明区域对应的所述第二颜色信息确定所述初始帧图像中颜色区域的各像素点的第一透明度;A second playback module, configured to determine a first transparency of each pixel point in the color area of the initial frame image according to the target compression ratio and the second color information corresponding to the transparent area;
第三播放模块,用于基于各所述第一透明度、所述颜色区域对应的所述第一颜色信息、所述颜色区域的尺寸信息以及所述透明区域的尺寸信息,得到所述初始帧图像,并播放包含所有初始帧图像的所述初始视频。The third playback module is used to obtain the initial frame image based on the first transparency, the first color information corresponding to the color area, the size information of the color area and the size information of the transparent area, and play the initial video including all the initial frame images.
可选的,装置600还包括:Optionally, the device 600 further includes:
第一计算模块,当ratio=1时,R1=A,G1=0,B1=0;In the first calculation module, when ratio=1, R1=A, G1=0, B1=0;
第二计算模块,当ratio=2时,G1=R1,B1=A-R1*2;The second calculation module, when ratio = 2, G1=R1,B1=A-R1*2;
第三计算模块,当ratio≥3时,G1=R1,B1=A-R1*(ratio-1);The third calculation module, when ratio ≥ 3, G1=R1,B1=A-R1*(ratio-1);
其中,所述ratio为所述目标压缩倍率,所述A为所述初始帧图像中各像素点的第一透明度,所述R1、所述G1以及所述B1分别为所述第二颜色信息中各颜色通道的值。Among them, the ratio is the target compression ratio, A is the first transparency of each pixel in the initial frame image, and R1, G1 and B1 are the values of each color channel in the second color information respectively.
本申请实施例的方案在执行时,获取初始视频中初始帧图像的尺寸信息、第一颜色信息以及第一透明度信息,所述第一透明度信息包括所述初始帧图像中各像素点的第一透明度,生成与所述初始帧图像对应的空白帧图像,所述空白帧图像包括颜色区域和透明区域,所述颜色区域的尺寸信息以及所述透明区域的尺寸信息与所述初始帧图像的尺寸信息相同,将所述第一颜色信息写入所述颜色区域,并将各所述第一透明度进行压缩处理后得到的第二颜色信息写入所述透明区域,得到所述初始帧图像对应的目标帧图像,基于各所述初始帧图像对应的目标帧图像生成目标视频。本申请通过将初始帧图像中所有像素点的透明度进行压缩后得到的颜色信息写入透明区域,再基于透明区域和颜色区域所组成的各个目标帧图像生成压缩后的初始视频,保留了初始视频中所有像素点的透明度,可以避免压缩后的透明视频出现失真的问题。When the scheme of the embodiment of the present application is executed, the size information, first color information and first transparency information of the initial frame image in the initial video are obtained, the first transparency information includes the first transparency of each pixel in the initial frame image, a blank frame image corresponding to the initial frame image is generated, the blank frame image includes a color area and a transparent area, the size information of the color area and the size information of the transparent area are the same as the size information of the initial frame image, the first color information is written into the color area, and the second color information obtained after the first transparency is compressed is written into the transparent area, the target frame image corresponding to the initial frame image is obtained, and the target video is generated based on the target frame images corresponding to the initial frame images. The present application retains the transparency of all pixels in the initial video by writing the color information obtained by compressing the transparency of all pixels in the initial frame image into the transparent area, and then generates a compressed initial video based on each target frame image composed of the transparent area and the color area. The problem of distortion in the compressed transparent video can be avoided.
请参考图7,其示出了本申请一个示例性实施例提供的终端700的结构方框图。本申请中的终端700可以包括一个或多个如下部件:显示组件701、存储器702和处理器703。其中,显示组件701与处理器703电性相连,处理器703与存储器702电性相连。Please refer to Figure 7, which shows a block diagram of a terminal 700 provided by an exemplary embodiment of the present application. The terminal 700 in the present application may include one or more of the following components: a display component 701, a memory 702, and a processor 703. The display component 701 is electrically connected to the processor 703, and the processor 703 is electrically connected to the memory 702.
显示组件701用于播放目标视频经解压处理后的初始视频。The display component 701 is used to play the initial video after the target video is decompressed.
存储器702可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory,ROM)。可选地,该存储器702包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。存储器702可用于存储指令、程序、代码、代码集或指令集。存储器702可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现上述各个方法实施例的指令等,该操作系统可以是安卓(Android)系统(包括基于Android系统深度开发的系统)、苹果公司开发的IOS系统(包括基于IOS系统深度开发的系统)或其它系统。存储数据区还可以存储终端700在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。The memory 702 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 702 includes a non-transitory computer-readable storage medium. The memory 702 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 702 may include a storage program area and a storage data area, wherein the storage program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The operating system may be an Android system (including a system deeply developed based on an Android system), an IOS system developed by Apple (including a system deeply developed based on an IOS system) or other systems. The storage data area may also store data (such as a phone book, audio and video data, chat record data) created by the terminal 700 during use.
处理器703可以包括一个或者多个处理核心。处理器703利用各种接口和线路连接整个终端700内的各个部分,通过运行或执行存储在存储器702内的指令、程序、代码集或指令集,以及调用存储在存储器702内的数据,执行终端700的各种功能和处理数据。可选地,处理器703可以采用DSP、现场可编程门阵列(Field-ProgrammableGate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器703可集成CPU、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责触控显示屏所需要显示的内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器703中,单独通过一块通信芯片进行实现。本申请实施例中,处理器703可以获取初始视频中初始帧图像的尺寸信息、第一颜色信息以及第一透明度信息,所述第一透明度信息包括所述初始帧图像中各像素点的第一透明度,生成与所述初始帧图像对应的空白帧图像,所述空白帧图像包括颜色区域和透明区域,所述颜色区域的尺寸信息以及所述透明区域的尺寸信息与所述初始帧图像的尺寸信息相同,将所述第一颜色信息写入所述颜色区域,并将各所述第一透明度进行压缩处理后得到的第二颜色信息写入所述透明区域,得到所述初始帧图像对应的目标帧图像,再基于各所述初始帧图像对应的目标帧图像生成目标视频。因此,通过将初始帧图像中所有像素点的透明度进行压缩后得到的颜色信息写入透明区域,再基于透明区域和颜色区域所组成的各个目标帧图像生成压缩后的初始视频,保留了初始视频中所有像素点的透明度,可以避免压缩后的透明视频在还原时出现失真的问题。The processor 703 may include one or more processing cores. The processor 703 uses various interfaces and lines to connect the various parts of the entire terminal 700, and executes various functions and processes data of the terminal 700 by running or executing instructions, programs, code sets or instruction sets stored in the memory 702, and calling data stored in the memory 702. Optionally, the processor 703 can be implemented in at least one hardware form of DSP, Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 703 can integrate one or a combination of CPU, Graphics Processing Unit (GPU), and modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the touch display; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 703, but may be implemented separately through a communication chip. In an embodiment of the present application, the processor 703 can obtain the size information, first color information and first transparency information of the initial frame image in the initial video, wherein the first transparency information includes the first transparency of each pixel in the initial frame image, and generate a blank frame image corresponding to the initial frame image, wherein the blank frame image includes a color area and a transparent area, and the size information of the color area and the size information of the transparent area are the same as the size information of the initial frame image, and the first color information is written into the color area, and the second color information obtained after the compression processing of each first transparency is written into the transparent area, so as to obtain the target frame image corresponding to the initial frame image, and then generate the target video based on the target frame images corresponding to each of the initial frame images. Therefore, by writing the color information obtained after compressing the transparency of all pixels in the initial frame image into the transparent area, and then generating the compressed initial video based on each target frame image composed of the transparent area and the color area, the transparency of all pixels in the initial video is retained, and the problem of distortion of the compressed transparent video when it is restored can be avoided.
可选的,终端700中的显示组件701还可以包括触控显示屏,该触控显示屏可以为电容式触控显示屏,该电容式触控显示屏用于接收用户使用手指、触摸笔等任何适合的物体在其上或附近的触摸操作,以及显示各个应用程序的用户界面。触控显示屏通常设置在终端700的前面板。触控显示屏可被设计成为全面屏、曲面屏或异型屏。触控显示屏还可被设计成为全面屏与曲面屏的结合,异型屏与曲面屏的结合,本申请实施例对此不加以限定。Optionally, the display component 701 in the terminal 700 may also include a touch screen, which may be a capacitive touch screen, which is used to receive a touch operation on or near it by a user using any suitable object such as a finger, a touch pen, etc., and to display the user interface of each application. The touch screen is usually arranged on the front panel of the terminal 700. The touch screen may be designed as a full screen, a curved screen, or a special-shaped screen. The touch screen may also be designed as a combination of a full screen and a curved screen, or a combination of a special-shaped screen and a curved screen, which is not limited in the embodiments of the present application.
可选的,终端700中还可以包括扬声器组件中的至少一种,处理器703与扬声器组件电性相连,处理器703用于通过驱动程序控制扬声器组件对由目标视频解压缩得到的初始视频的音频进行播放。Optionally, the terminal 700 may further include at least one of the speaker components, and the processor 703 is electrically connected to the speaker component. The processor 703 is used to control the speaker component through a driver to play the audio of the initial video obtained by decompressing the target video.
除此之外,本领域技术人员可以理解,上述附图所示出的终端700的结构并不构成对终端700的限定,终端可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。比如,终端700中还包括射频电路、音频电路、无线保真(WirelessFidelity,WiFi)组件、电源、蓝牙组件等部件,在此不再赘述。In addition, those skilled in the art will appreciate that the structure of the terminal 700 shown in the above figures does not constitute a limitation on the terminal 700, and the terminal may include more or fewer components than shown, or combine certain components, or arrange the components differently. For example, the terminal 700 also includes a radio frequency circuit, an audio circuit, a wireless fidelity (WiFi) component, a power supply, a Bluetooth component, and other components, which will not be described in detail here.
本申请实施例还提供了一种计算机可读存储介质,该计算机存储介质存储有至少一条指令,所述至少一条指令用于被处理器执行以实现如上述各个实施例所述的透明视频压缩方法。An embodiment of the present application further provides a computer-readable storage medium, which stores at least one instruction, and the at least one instruction is used to be executed by a processor to implement the transparent video compression method as described in the above embodiments.
本申请实施例还提供了一种计算机程序产品,该计算机程序产品存储有至少一条指令,所述至少一条指令由所述处理器加载并执行以实现如上各个实施例所述的透明视频压缩方法。An embodiment of the present application also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the transparent video compression method described in the above embodiments.
本领域技术人员应该可以意识到,在上述一个或多个示例中,本申请实施例所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110848744.9A CN113473132B (en) | 2021-07-26 | 2021-07-26 | Transparent video compression method, device, storage medium and terminal |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110848744.9A CN113473132B (en) | 2021-07-26 | 2021-07-26 | Transparent video compression method, device, storage medium and terminal |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN113473132A CN113473132A (en) | 2021-10-01 |
| CN113473132B true CN113473132B (en) | 2024-04-26 |
Family
ID=77882607
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110848744.9A Active CN113473132B (en) | 2021-07-26 | 2021-07-26 | Transparent video compression method, device, storage medium and terminal |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN113473132B (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116489365B (en) * | 2022-01-13 | 2025-12-19 | 海信集团控股股份有限公司 | Image data transmission method, sending terminal, receiving terminal and device |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109005426A (en) * | 2017-04-08 | 2018-12-14 | 腾讯科技(深圳)有限公司 | A kind of photograph document handling method |
| CN110113615A (en) * | 2018-02-01 | 2019-08-09 | 腾讯科技(深圳)有限公司 | Image encoding method, device, calculates equipment and storage medium at coding/decoding method |
| CN110351592A (en) * | 2019-07-17 | 2019-10-18 | 深圳市蓝鲸数据科技有限公司 | Animation rendering method, device, computer equipment and storage medium |
| WO2021104079A1 (en) * | 2019-11-27 | 2021-06-03 | 深圳市万普拉斯科技有限公司 | Video processing method and apparatus, storage medium, and computer device |
| CN113115097A (en) * | 2021-03-30 | 2021-07-13 | 北京达佳互联信息技术有限公司 | Video playing method and device, electronic equipment and storage medium |
-
2021
- 2021-07-26 CN CN202110848744.9A patent/CN113473132B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109005426A (en) * | 2017-04-08 | 2018-12-14 | 腾讯科技(深圳)有限公司 | A kind of photograph document handling method |
| CN110113615A (en) * | 2018-02-01 | 2019-08-09 | 腾讯科技(深圳)有限公司 | Image encoding method, device, calculates equipment and storage medium at coding/decoding method |
| CN110351592A (en) * | 2019-07-17 | 2019-10-18 | 深圳市蓝鲸数据科技有限公司 | Animation rendering method, device, computer equipment and storage medium |
| WO2021104079A1 (en) * | 2019-11-27 | 2021-06-03 | 深圳市万普拉斯科技有限公司 | Video processing method and apparatus, storage medium, and computer device |
| CN113115097A (en) * | 2021-03-30 | 2021-07-13 | 北京达佳互联信息技术有限公司 | Video playing method and device, electronic equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113473132A (en) | 2021-10-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111580765B (en) | Screen projection method, screen projection device, storage medium, screen projection equipment and screen projection equipment | |
| CN113170140B (en) | Method for encoding data element, method for decoding data stream, device and medium | |
| CN109688465B (en) | Video enhancement control method, device and electronic device | |
| CN109640167B (en) | Video processing method, device, electronic device and storage medium | |
| JP5156655B2 (en) | Image processing device | |
| JP2014039257A (en) | Decoder and decoding method | |
| TWI524326B (en) | Dram compression scheme to reduce power consumption in motion compensation and display refresh | |
| TWI487366B (en) | Bitstream syntax for graphics mode compression in the Wireless HD1.1 specification | |
| US20230115821A1 (en) | Image processing devices and methods | |
| CN110545446A (en) | desktop image encoding and decoding methods, related devices and storage medium | |
| CN113473132B (en) | Transparent video compression method, device, storage medium and terminal | |
| CN106162192A (en) | Process the method and apparatus of video data | |
| EP2843954A1 (en) | Lossy color compression using adaptive quantization | |
| CN114079823A (en) | Video rendering method, device, equipment and medium based on Flutter | |
| CN117061789B (en) | A video transmission framework, method, device and storage medium | |
| JP6990172B2 (en) | Determination of luminance samples to be co-located with color component samples for HDR coding / decoding | |
| CN117729328A (en) | Video image encoding method, video image decoding method and related equipment | |
| CN113542739B (en) | Image encoding method and device, image decoding method and device, medium and equipment | |
| KR20160082521A (en) | Chroma down-conversion and up-conversion processing | |
| CN106664387B (en) | Computer device and method for post-processing video image frame and computer readable medium | |
| CN104581175A (en) | Image processing device and method | |
| US20210409736A1 (en) | Video encoding method and apparatus, video decoding method and apparatus, electronic device and readable storage medium | |
| CN120602651B (en) | Processor, image compression method, image decompression method, chip and device | |
| CN114640658A (en) | Media data and content data transmission method, device and system | |
| US20160191925A1 (en) | Techniques for image bitstream processing |
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 |