CN101742317A - Video compressing and encoding method with alpha transparent channel - Google Patents

Video compressing and encoding method with alpha transparent channel Download PDF

Info

Publication number
CN101742317A
CN101742317A CN 200910312983 CN200910312983A CN101742317A CN 101742317 A CN101742317 A CN 101742317A CN 200910312983 CN200910312983 CN 200910312983 CN 200910312983 A CN200910312983 A CN 200910312983A CN 101742317 A CN101742317 A CN 101742317A
Authority
CN
China
Prior art keywords
data
video
image
transparent channel
encoding
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.)
Granted
Application number
CN 200910312983
Other languages
Chinese (zh)
Other versions
CN101742317B (en
Inventor
邓伟
褚震宇
张�浩
朱宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dayang Technology Development Inc
Original Assignee
Beijing Dayang Technology Development Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dayang Technology Development Inc filed Critical Beijing Dayang Technology Development Inc
Priority to CN 200910312983 priority Critical patent/CN101742317B/en
Publication of CN101742317A publication Critical patent/CN101742317A/en
Application granted granted Critical
Publication of CN101742317B publication Critical patent/CN101742317B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to a video compressing and encoding method with an alpha transparent channel, comprising the following steps of: inverting the acquired video image to the image in the format of RGB or YUV4:4:4/YUV4:2:2/YUV4:2:0; compressing the acquired data in the alpha transparent channel in a no-damage mode; encoding and compressing video data for the video image in the specific format according to the frame format of MPEG-2 I and saving the compressed data in the alpha transparent channel in the compressed data structure of the video image. The method realizes the encoding of a specific video picture, can use a standard MPEG2 encoder for encoding, and effectively reduces video bitrate when ensuring the high quality of the video so as to realize the video data encoding with high quality, high efficiency and low cost. Because the data of the alpha transparent channel and the compressed data of the video image are saved in the same file, the video compressing and encoding method not only simplifies the process of processing the image at the later period and the information sharing between file management and a program, but also reserves the original video which is not added with the data of the alpha transparent channel.

Description

A kind of video compressing and encoding method with alpha transparent channel
Technical field
The invention belongs to field of broadcast televisions, be particularly related to a kind of video compressing and encoding method with alpha transparent channel, this method adopts the custom coding form to realize a kind of coding of particular video frequency picture, this coded format at the video pattern of the input be RGB or YUV4:4:4/YUV4:2:2/YUV4:2:0 form, and can select Alpha (alpha) transparent channel data, transparent channel deposit data behind the compressed encoding is at ad-hoc location, and other standard decoders can normal decoder.
Background technology
In professional program making process, often need utilize Alpha (alpha) transparent channel to make various special effects.The alpha channel data are represented with 8 bit binary number, represent the additional information of each pixel transparency in the memory image file.Utilize the transparent characteristic of alpha channel can create very abundant image effect,, and extensive application is all arranged at aspects such as film, TV, animations not only in media work.In making, movie and video programs finish the stack of special frame with synthetic with alpha transparent channel, make in the image certain part transparent according to different principle, selected color or brightness are removed from image, thereby make the image section that removes color appear background, the part of not removing color still keeps original image.Include the rest image of alpha transparent channel information for a width of cloth, can save as the no packed record method of ARGB, TYUV form; The professional format of Photoshop; Also can use standard image format such as preservations such as TIF, TGA.But at present not having similar reference format for the moving image in the professional program making process can preserve simultaneously and contain the alpha transparent channel data, usually can adopt dual mode: the one, utilize moving image to form by several rest images, the moving image that will contain the transparent channel data decomposes several rest images, and every width of cloth image uses standard image format; Another method is that moving image encoding is become a reference format (such as forms such as MPEG-2 or DV), and the transparent channel data are preserved in addition.This dual mode all has tangible deficiency: dual mode all needs to preserve a plurality of files, and every two field picture is unintelligible with corresponding alpha channel data corresponding relation; Be unfavorable for the information sharing between file management and program, and first kind of mode ignored the very strong spatial coherence that moving image had originally, the data volume that has caused is big, has wasted memory space.
Therefore need a kind of compression coding and decoding form of design, the moving image of being with alpha transparent channel is carried out suitable compression,, effectively reduce video code rate guaranteeing the high-quality while of video.So just greatly made things convenient for the information sharing between different application.In the video pictures of normal play, add specific data, for example programme is added in the picture that is broadcasting, perhaps add advertisings such as some literal; Image with video pictures and specific band transparent channel in the video data of a frame transmits simultaneously.
Video data through overcompression can directly form file applications.Also can further be packaged into general file format, such as avi file, MXF file etc.
Summary of the invention
At the defective of above-mentioned technology, the objective of the invention is to propose a kind of video compressing and encoding method with alpha transparent channel, realize the compressed encoding of particular video frequency picture; This method has realized embedding in the video image coding of specific picture data, the input video form of original MPEG-2 regulation is expanded to YUV4:2:0, YUV4:2:2, YUV4:4:4 and four input video forms of RGB by YUV4:2:0 and two input video forms of YUV4:2:2, every two field picture and corresponding alpha channel data are encoded respectively, then the packed data of alpha transparent channel is kept at ad-hoc location in the MPEG-2 bit stream; The present invention when carrying out high-quality coding, the clear and definite corresponding relation of every two field picture with corresponding alpha channel data; Simplified the flow process that later image is handled; The original video that has kept the alpha channel data that do not superpose, other standard decoders can the coded data of normal decoder except that the alpha channel data.
To achieve these goals, the object of the present invention is achieved like this: a kind of video compressing and encoding method with alpha transparent channel, adopt the MPEG-2 form that the video image file that contains alpha transparent channel is carried out compressed encoding and decompression according to the range of code rates of user's appointment, the process of compressed encoding and decompression is to the compressed encoding of each frame video image and decompression, it is characterized in that, the compressed encoding of a described frame video image is, at first compression set obtains video image and alpha transparent channel video data, and the step of its coding comprises:
A. the video image that obtains is converted to the specific format image;
B. the data in the described alpha transparent channel are carried out the lossless manner compression;
C. with the specific format video image according to MPEG-2 I coded compressed video data, the I frame bitstream data structural order after the compression includes: sequence head, sequence extension, the expansion ﹠amp; The user, figure organizes head, and figure organizes head expansion ﹠amp; The user, image head, image encoding expansion, expansion ﹠amp; The user, view data;
D. the packed data in the alpha channel is kept at after the video image compression in the data structure in the expansion and user data after the image encoding expansion;
Whether the data volume of e. judging present frame is in the range of code rates of customer requirements; If not in scope, then adjust MPEG-2 form coding parameter again packed data until data volume in range of code rates, obtain containing frame MPEG-2 I coded data of alpha channel packed data;
The decompression of a described frame video image is, according to MPEG-2 I frame format decoding video images, according to alpha transparent channel coding/decoding method decoding alpha transparent channel data, described alpha transparent channel coding/decoding method step is: when running into continuous code word start mark, according to pleonasm joint number duplication code word and counting; When running into discontinuous code word start mark, the code word that repeats the back finishes up to running into continuous code word start mark or code line.
When described specific format is the YUV4:4:4 form, described video data is divided into macro block by the MPEG-2 format standard, each macro block comprises the luminance block of 4 8X8, the U chrominance block of 4 8X8, the V chrominance block of 4 8X8, in order each image block is transformed from a spatial domain to frequency domain, promptly use the discrete cosine transform formula
f nm = 1 4 c n c m Σ i = 0 7 Σ j = 0 7 cos πn ( 2 i + 1 ) 16 cos πm ( 2 j + 1 ) 16 x ij - - - ( 1 )
Obtain frequency domain data; N in the cosine transform formula, m, i, the numerical value of j, number range is 0-7.
The described data volume of the judging current encoded frame whether sequence of steps in the range of code rates of customer requirements is: frequency domain data is carried out quantization matrix handle, according to scanning sequency the two-dimensional array of a 8X8 of image block reorganized and be arranged in the one-dimension array that contains 64 data.After doing Run-Length Coding behind the data-measuring after rearranging, do Huffman encoding again, judge the quantization step in the described coding parameter quantizing process.
When described specific format was rgb format, described video data was divided into macro block by the MPEG-2 format standard, and each macro block comprises the red chrominance block of R of 4 8X8, the blue chrominance block of the G greenness piece of 4 8X8 and the B of 4 8X8.In order each image block is transformed from a spatial domain to frequency domain, use described discrete cosine transform formula to obtain frequency domain data;
The described data volume of the judging current encoded frame whether sequence of steps in the range of code rates of customer requirements is: frequency domain data is carried out quantization matrix handle, according to scanning sequency the two-dimensional array of a 8X8 of image block reorganized and be arranged in the one-dimension array that contains 64 data.After doing Run-Length Coding behind the data-measuring after rearranging, do Huffman encoding again, judge the quantization step in the described coding parameter quantizing process.
When described specific format was YUV4:2:2 or YUV4:2:0 form, described video data was pressed the MPEG-2 format standard and is divided macro block, and each macro block of YUV4:2:2 form comprises the Y luminance block of 4 8X8, the U chrominance block of 2 8X8 and the V chrominance block of 2 8X8; Each macro block of YUV4:2:0 form comprises the Y luminance block of 4 8X8, the U chrominance block of 1 8X8 and the V chrominance block of 1 8X8; In order each image block is transformed from a spatial domain to frequency domain, use described discrete cosine transform formula to obtain frequency domain data;
The described data volume of the judging current encoded frame whether sequence of steps in the range of code rates of customer requirements is: frequency domain data is carried out quantization matrix handle, according to scanning sequency the two-dimensional array of a 8X8 of image block reorganized and be arranged in the one-dimension array that contains 64 data.After behind the data-measuring after rearranging, do Huffman encoding again, judge the quantization step in the described coding parameter quantizing process.
Described lossless manner compression is: adopt Run-Length Coding, coding begins with continuous code word start mark for continuous code word with behavior unit, and the back is immediately following the code word of a byte, and the byte number that repeats for this code word accounts for 2 bytes afterwards; Discontinuous code word begins with discontinuous code word start mark, is unpressed data afterwards.
The beneficial effect that the present invention produces is:
1. the video image compression code data stream that contains the alpha transparent channel data can use standard MPEG2 decoder decode, the decoder that can discern self-defining data can make up alpha transparent channel data decode and video data, thereby obtains the reconstructed image of band alpha transparent channel.
2. the present invention effectively reduces video code rate guaranteeing the high-quality while of video, realizes a kind of high-quality, high efficiency, video data stream compaction coding method cheaply.
3. the present invention is kept at alpha transparent channel data and video image compression data in the same file, has not only simplified the information sharing between flow process, file management and the program that later image handles; The original video that has kept the alpha channel data that do not superpose simultaneously.
Below in conjunction with drawings and Examples the present invention is done a detailed description.
Description of drawings
Fig. 1 is the flow chart of steps to the vedio data coding;
Fig. 2 is the syntactic structure of MPEG-2 video bit stream;
Fig. 3 is the MPEG-2 cataloged procedure;
Fig. 4 is YUV4:2:0 macroblock structure figure;
Fig. 5 is YUV4:2:2 macroblock structure figure;
Fig. 6 is YUV4:4:4/RGB macroblock structure figure.
Embodiment
Embodiment 1:
A kind of video compressing and encoding method embodiment with alpha transparent channel, referring to Fig. 1, Fig. 2 and Fig. 3, a kind of video compressing and encoding method with alpha transparent channel, adopting the MPEG-2 form (is a given value according to user's the prior appointment of requirement to the video image file that contains alpha transparent channel according to the range of code rates of user's appointment, normally the factors such as requirement of video quality are determined according to the user) carry out compressed encoding and decompression, the process of compressed encoding and decompression is to the compressed encoding of each frame video image and decompression, the compressed encoding of a described frame video image is, at first compression set obtains video image and alpha transparent channel video data, and the step of its coding comprises:
A. the video image that obtains is converted to the specific format image;
B. the data in the described alpha transparent channel are carried out the lossless manner compression;
C. with the specific format video image according to MPEG-2 I coded compressed video data, as shown in Figure 2 the compression after I frame bitstream data structural order include: sequence head, sequence extension, the expansion ﹠amp; The user, figure organizes head, and figure organizes head expansion ﹠amp; The user, image head, image encoding expansion, expansion ﹠amp; The user, view data;
D. the packed data in the alpha channel is kept at after the video image compression in the data structure in the expansion and user data after the image encoding expansion; (method of preservation is this area usual way)
Whether the data volume of e. judging present frame is in the range of code rates of customer requirements; If not in scope, then adjust MPEG-2 form coding parameter again packed data until data volume in range of code rates, obtain containing frame MPEG-2 I coded data of alpha channel packed data;
The decompression of a described frame video image is, MPEG-2 I frame format decoding video images according to standard, according to alpha transparent channel coding/decoding method decoding alpha transparent channel data, described alpha transparent channel coding/decoding method step is: when running into continuous code word start mark, according to pleonasm joint number duplication code word and counting; When running into discontinuous code word start mark, the code word that repeats the back finishes up to running into continuous code word start mark or code line.
Described cataloged procedure is according to following steps: every frame of video is obtained frequency domain data to each piece with discrete cosine transform according to the order of piece; Frequency domain data is carried out quantization matrix handle, according to scanning sequency the two-dimensional array of a 8X8 of image block reorganized and be arranged in the one-dimension array that contains 64 data, after doing Run-Length Coding behind the data-measuring after rearranging, do Huffman encoding again.To the highest syntactic structure formation sequence head 2-1 of each frame in the video sequence according to video bit stream shown in Figure 2, sequence extension 2-2, expansion ﹠amp; User 2-3, a figure group 2-4, figure organizes head expansion ﹠amp; User 2-5, image head 2-6, image encoding expansion 2-7, Tu Xiangkuozhan ﹠amp; User 2-8, described huffman coded data are kept among the view data 2-9, and all frame codings finish in sequence, just obtain complete video file.It is pointed out that translation title, different idioms is arranged in the uri information of the industry, for example " expansion ﹠amp for each part of sequence; The user " 2-3 is called as " user data " in standard GB/T17975.2-2000; But the difference of translation title does not influence understanding and the use of each codec to each data block.
Described lossless manner compression is: according to the alpha channel data characteristic, adopt Run-Length Coding, coding is with behavior unit, begin with continuous code word start mark for continuous code word, the back is immediately following the code word of a byte, and the byte number that repeats for this code word accounts for 2 bytes afterwards; Discontinuous code word begins with discontinuous code word start mark, is unpressed data afterwards; Avoiding code stream to produce ambiguity, by chance is the situation of continuous code word start mark for code word, need carry out the escape coding.
The MPEG-2 I frame format decoding video images of standard is a kind of known method, and at first decoding end is obtained coded data, and the step of its decoding comprises:
A. according to high level syntax structure elucidation coded data, obtain the packed data of video image;
B. packed data is carried out decoding length changeable code according to the standard code table;
C. decoded data are arranged in the two-dimensional array of 8X8 according to scanning sequency.
D. the data behind the inverse quantization are carried out anti-dct transform, obtain decoded data.
Self-defined decoder is read expansion ﹠amp to video data decoding the time; After the user 2-8 data, read continuous code word start mark or discontinuous code word start mark, just can identify the packed data that this is an alpha transparent channel and its decoding be restored the data of alpha transparent channel; Standard decoder can be read expansion ﹠amp; Packed data among the user 2-8 is that the packed data of alpha transparent channel can not be decoded but can not identify, and can this part data be abandoned according to Moving Picture Experts Group-2.Because it is YUV4:2:0 and YUV4:2:2 coding method that compaction coding method provided by the present invention does not change pattern of the input, standard decoder can be correctly decoded video image, but for pattern of the input is YUV4:4:4 and RGB situation, and standard decoder can not be correctly decoded video image.
Embodiment 2:
A kind of preferred 1 embodiment of video compressing and encoding method that embeds specific picture, referring to embodiment 1,
When described specific pattern of the input was the YUV4:4:4 form, described video data was divided into macro block by the MPEG-2 format standard, and each macro block comprises the Y luminance block of 4 8X8, the U chrominance block of 4 8X8 and the V chrominance block of 4 8X8.According to numerical order shown in Figure 6 each image block is transformed from a spatial domain to frequency domain, use the discrete cosine transform formula to obtain frequency domain data; The discrete cosine transform formula is as follows:
f nm = 1 4 c n c m Σ i = 0 7 Σ j = 0 7 cos πn ( 2 i + 1 ) 16 cos πm ( 2 j + 1 ) 16 x ij - - - ( 1 )
N in the cosine transform formula, m, i, the numerical value of j, number range is 0-7.
The described data volume of the judging present frame whether sequence of steps in the range of code rates of customer requirements is: frequency domain data is carried out quantization matrix handle, according to scanning sequency the two-dimensional array of a 8X8 of image block reorganized and be arranged in the one-dimension array that contains 64 data.After doing Run-Length Coding behind the data-measuring after rearranging, do Huffman encoding again, judge that described coding parameter is the quantization step in the quantizing process.
Described discrete cosine transform formula, Run-Length Coding and Huffman encoding are known technologies.
Embodiment 3:
A kind of preferred 2 embodiment of video compressing and encoding method that embed specific picture, referring to embodiment 1,
Since Moving Picture Experts Group-2 at the chroma format of input encoded data be YUV4:2:0 and YUV4:2:2, originally the quantization matrix that defines in the standard is not considered RGB input data characteristic, so when pattern of the input is RGB, need to use other quantization matrix, in the hope of obtaining higher compression efficiency.
Therefore when described specific pattern of the input was rgb format, the described data volume of the judging current encoded frame whether sequence of steps in the range of code rates of customer requirements was:
When described specific pattern of the input was rgb format, described video data was divided into macro block by the MPEG-2 format standard, and each macro block comprises the red chrominance block of R of 4 8X8, the blue chrominance block of the G greenness piece of 4 8X8 and the B of 4 8X8.Order according to numeral in Fig. 6 transforms from a spatial domain to frequency domain to each image block, uses the discrete cosine transform formula to obtain frequency domain data; The discrete cosine transform formula is as follows:
f nm = 1 4 c n c m Σ i = 0 7 Σ j = 0 7 cos πn ( 2 i + 1 ) 16 cos πm ( 2 j + 1 ) 16 x ij - - - ( 1 )
N in the cosine transform formula, m, i, the numerical value of j, number range is 0-7.
The described data volume of the judging present frame whether sequence of steps in the range of code rates of customer requirements is: frequency domain data is carried out quantization matrix handle, according to scanning sequency the two-dimensional array of a 8X8 of image block reorganized and be arranged in the one-dimension array that contains 64 data, do Huffman encoding again after doing Run-Length Coding behind the data-measuring after rearranging; Judge that described coding parameter is the quantization step in the quantizing process.
Embodiment 4:
A kind of preferred 3 embodiment of video compressing and encoding method that embed specific picture, referring to embodiment 1,
When described specific pattern of the input is YUV4:2:2 or YUV4:2:0 form, described video data is divided into the macro block of 16X16 by the MPEG-2 format standard, each macro block of YUV4:2:2 form comprises the Y luminance block of 4 8X8, the U chrominance block of 2 8X8 and the V chrominance block of 2 8X8; Each macro block of YUV4:2:0 form comprises the Y luminance block of 4 8X8, the U chrominance block of 1 8X8 and the V chrominance block of 1 8X8; According to Fig. 4 numerical order shown in Figure 5 each image block is transformed from a spatial domain to frequency domain, use the discrete cosine transform formula to obtain frequency domain data; The discrete cosine transform formula is as follows:
f nm = 1 4 c n c m Σ i = 0 7 Σ j = 0 7 cos πn ( 2 i + 1 ) 16 cos πm ( 2 j + 1 ) 16 x ij - - - ( 1 )
N in the cosine transform formula, m, i, the numerical value of j, number range is 0-7.
The described data volume of the judging present frame whether sequence of steps in the range of code rates of customer requirements is: frequency domain data is carried out quantization matrix handle, according to scanning sequency the two-dimensional array of a 8X8 of image block reorganized and be arranged in the one-dimension array that contains 64 data, after doing Run-Length Coding behind the data-measuring after rearranging, do Huffman encoding again, judge that described coding parameter is the quantization step in the quantizing process.
Compression of video data adopts Moving Picture Experts Group-2 in the foregoing description.MPEG-2 is one of extensive compression method that adopts of present radio, TV and film industries.The MPEG-2 image compression has been utilized two specific characters in the image: spatial coherence and temporal correlation.These two kinds of correlations make and have a large amount of redundant informations in the image.Compression process is removed these redundant informations, only keep a small amount of irrelevant information and encode, and decoder utilizes these irrelevant information, according to certain decoding algorithm, can recover original image under the prerequisite that guarantees certain picture quality.The coded image of MPEG-2 is divided into I frame, P frame and B frame three classes, and the I frame has utilized the spatial coherence of image; And P frame and B frame have utilized the spatial coherence and the temporal correlation of image simultaneously.In order to obtain high-quality coded data, the foregoing description uses the mode of I frame coding.The minimum code unit of MPEG-2 is a macro block, each macro block all comprises the luminance block of 4 8X8, according to the difference of color format, a macro block also comprises two 8X8 chrominance block (U and V are each during the 4:2:0 sampling) or four 8X8 chrominance block (U and V are each two during the 4:2:2 sampling).When colourity being carried out 4:2:0 or 4:2:2 sampling,, can cause coding quality to descend owing to lost the part chrominance information.Fig. 3 has represented each macroblock encoding process at image 3-1, and described cataloged procedure is according to following steps: the order according to piece obtains frequency domain data to each image block 3-2 with discrete cosine transform 3-3; Frequency domain data is carried out quantization matrix to be handled 3-4, according to scanning sequency the one-dimension array that 3-5 becomes to contain 64 data is arranged in the two-dimensional array reorganization of the 8X8 of an image block.After being Run-Length Coding 3-6 behind the data-measuring after rearranging, be Huffman encoding 3-7 again.
Mpeg compliant, the highest syntactic structure of coded video bit stream is a video sequence.As shown in Figure 2, video sequence is from sequence head 2-1, and sequence head can also comprise sequence extension 2-2 and expansion ﹠amp; User 2-3 can follow a figure group 2-4 behind the sequence head, be one or more coded frame then, and coded frame comprises figure group head expansion ﹠amp; User 2-5, image head 2-6, image encoding expansion 2-7, expansion ﹠amp; User 2-8, view data 2-9 are sequence tail 2-10 at last.At the each point place of sequence, specific coded frame front can have repeating sequences head or figure to organize head or the both has.
Video data compression is partly followed MPEG-2 (ISO13818-2) standard, adopts compress mode in the MPEG-2 frame.
Three passage (YUV except that alpha transparent channel for the input coding device, sample format may for 4:2:0 as shown in Figure 4, perhaps 4:2:2 as shown in Figure 5, perhaps 4:4:4 as shown in Figure 6, or RGB) all be divided into macro block according to Moving Picture Experts Group-2, each macro block all is made up of the piece of several 8X8.For each different chroma format, the order of piece is also different in the macro block, and the order numeral in the figure center is a serial number, and letter r, G, B, Y, Cb, Cr have represented color.
Color format to YUV4:2:0 sampling and YUV4:2:2 sampling is carried out intraframe coding by Moving Picture Experts Group-2; When YUV4:4:4 sampling and chroma format are RGB, all be divided into the macro block of 16X16 according to Moving Picture Experts Group-2 for three passages (YUV or RGB) outside the Alpha transparent channel, and carry out intraframe coding by macro block, represent this two chroma formats with the chroma_format=3 in the bit stream (retention in the Moving Picture Experts Group-2), distinguish YUV and RGB with other reserved field again.
First coding alpha transparent channel data in the cataloged procedure, coding video frequency data is controlled to guarantee overall code check again.Adopt frame of video recodification mode to guarantee that code check meets desired value in case of necessity.
The foregoing description is followed MPEG-2 (ISO13818-2) standard, adopts compress mode in the MPEG-2 frame; 420 and 422 color format are encoded by the ISO13818-2 standard.When pattern of the input YUV4:4:4 that increases newly for the present invention and RGB chroma format, three passages except that the alpha transparent channel all are divided into the macro block of 16X16 according to Moving Picture Experts Group-2, and carry out intraframe coding according to macro block; Alpha transparent channel data after the compression are placed on " image encoding expansion " " the Yong Hu ﹠amp afterwards among Fig. 2; Expansion " in.The advantage of such design is to contain the yuv420 of alpha transparent channel data and the compressed bit stream of yuv422 form can use standard MPEG2 decoder decode, the decoder that can discern self-defining data can make up data decode of alpha transparent channel and video data, thereby obtains the reconstructed image of band alpha transparent channel.

Claims (9)

1. video compressing and encoding method with alpha transparent channel, adopt the MPEG-2 form that the video image file that contains alpha transparent channel is carried out compressed encoding and decompression according to the range of code rates of user's appointment, the process of compressed encoding and decompression is to the compressed encoding of each frame video image and decompression, it is characterized in that, the compressed encoding of a described frame video image is, at first compression set obtains video image and alpha transparent channel video data, and the step of its coding comprises:
A. the video image that obtains is converted to the specific format image;
B. the data in the described alpha transparent channel are carried out the lossless manner compression;
C. with the specific format video image according to MPEG-2I coded compressed video data, the I frame bitstream data structural order after the compression includes: sequence head, sequence extension, the expansion ﹠amp; The user, figure organizes head, and figure organizes head expansion ﹠amp; The user, image head, image encoding expansion, expansion ﹠amp; The user, view data;
D. the packed data in the alpha channel is kept at after the video image compression in the data structure in the expansion and user data after the image encoding expansion;
Whether the data volume of e. judging present frame is in the range of code rates of customer requirements; If not in scope, then adjust MPEG 2 form coding parameters again packed data until data volume in range of code rates, obtain containing the I frame MPEG-2 form coded data of alpha channel packed data;
The decompression of a described frame video image is, according to MPEG-2I frame format decoding video images, according to alpha transparent channel coding/decoding method decoding alpha transparent channel data, described alpha transparent channel coding/decoding method step is: when running into continuous code word start mark, according to pleonasm joint number duplication code word and counting; When running into discontinuous code word start mark, the code word that repeats the back finishes up to running into continuous code word start mark or code line.
2. according to the described a kind of video compressing and encoding method of claim 1 with alpha transparent channel, it is characterized in that, described specific format is YUV4:4:4, described video data is divided into macro block by the MPEG-2 format standard, each macro block comprises the luminance block of 4 8X8, the U chrominance block of 4 8X8 and the V chrominance block of 4 8X8.
3. according to the described a kind of video compressing and encoding method of claim 1 with alpha transparent channel, it is characterized in that, described specific format is YUV4:2:2, described video data is pressed the MPEG-2 format standard and is divided macro block, each macro block comprises the Y luminance block of 4 8X8, the U chrominance block of 2 8X8 and the V chrominance block of 2 8X8.
4. according to the described a kind of video compressing and encoding method of claim 1 with alpha transparent channel, it is characterized in that, described specific format is YUV4:2:0, described video data is pressed the MPEG-2 format standard and is divided macro block, each macro block comprises the Y luminance block of 4 8X8, the U chrominance block of 1 8X8 and the V chrominance block of 1 8X8.
5. according to the described a kind of video compressing and encoding method of claim 1 with alpha transparent channel, it is characterized in that, described specific format is RGB, described video data is divided into macro block by the MPEG-2 format standard, each macro block comprises the red chrominance block of R of 4 8X8, the blue chrominance block of the G greenness piece of 4 8X8 and the B of 4 8X8.
6. according to the described a kind of video compressing and encoding method of claim 1 with alpha transparent channel, it is characterized in that, described lossless manner compression is: coding is with behavior unit, begin with continuous code word start mark for continuous code word, the back is immediately following the code word of a byte, the byte number that repeats for this code word accounts for 2 bytes afterwards; Discontinuous code word begins with discontinuous code word start mark, is unpressed data afterwards.
7. according to the described a kind of video compressing and encoding method with alpha transparent channel of claim 1, it is characterized in that described coding step is: the order according to piece obtains frequency domain data to each image block with discrete cosine transform; Frequency domain data is carried out quantization matrix handle, according to scanning sequency the two-dimensional array of a 8X8 of image block reorganized and be arranged in the one-dimension array that contains 64 data, after doing Run-Length Coding behind the data-measuring after rearranging, do Huffman encoding again.
8. according to the described a kind of video compressing and encoding method of claim 1 with alpha transparent channel, it is characterized in that, whether the described data volume of judging present frame in the video code rate scope is: according to scanning sequency the two-dimensional array of a 8X8 of image block is reorganized and be arranged in the one-dimension array that contains 64 data, to doing Run-Length Coding behind the data-measuring after rearranging, do Huffman encoding afterwards again, judge the quantization step in the described coding parameter quantizing process.
9. according to the described a kind of video encoding/decoding method of claim 1 with alpha transparent channel, it is characterized in that, described I frame MPEG-2 formats video image step is: coded data is carried out variable length decoding according to the Moving Picture Experts Group-2 code table, 64 data of each piece are arranged in the two-dimensional array of 8X8 according to scanning sequency, inverse quantization then, anti-dct transform, the data that obtain are at last arranged according to the macro block present position, form view data.
CN 200910312983 2009-12-31 2009-12-31 Video compressing and encoding method with alpha transparent channel Active CN101742317B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200910312983 CN101742317B (en) 2009-12-31 2009-12-31 Video compressing and encoding method with alpha transparent channel

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200910312983 CN101742317B (en) 2009-12-31 2009-12-31 Video compressing and encoding method with alpha transparent channel

Publications (2)

Publication Number Publication Date
CN101742317A true CN101742317A (en) 2010-06-16
CN101742317B CN101742317B (en) 2012-03-28

Family

ID=42465088

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200910312983 Active CN101742317B (en) 2009-12-31 2009-12-31 Video compressing and encoding method with alpha transparent channel

Country Status (1)

Country Link
CN (1) CN101742317B (en)

Cited By (32)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011035658A1 (en) * 2009-09-25 2011-03-31 腾讯科技(深圳)有限公司 Method, device and system for compressing and decompressing transparent image
CN102103463A (en) * 2011-02-17 2011-06-22 杭州华三通信技术有限公司 Processing method and equipment of user interface information with transparency
CN102231836A (en) * 2011-06-27 2011-11-02 深圳市茁壮网络股份有限公司 Graphics interchange format (GIF) file processing method and device for digital television system
CN102231834A (en) * 2011-06-27 2011-11-02 深圳市茁壮网络股份有限公司 Animated portable network graphics (APNG) file processing method and device for digital television system
CN102244784A (en) * 2011-06-09 2011-11-16 杭州典能科技有限公司 Method for compressing and displaying picture including transparent information
CN102289829A (en) * 2011-07-12 2011-12-21 北京朗玛数联科技有限公司 Method and device for storing and restoring image and system for processing image
CN102682415A (en) * 2011-03-09 2012-09-19 腾讯科技(深圳)有限公司 Image processing method and device
CN102821279A (en) * 2012-07-31 2012-12-12 北京天神互动科技有限公司 Picture compression method keeping with alpha channel
CN104995918A (en) * 2013-01-08 2015-10-21 微软公司 Method for converting the format of a frame into a chroma subsampling format
CN105938625A (en) * 2016-03-18 2016-09-14 浙江万朋教育科技股份有限公司 Method for processing alpha channel data in PNG picture format
CN105979282A (en) * 2016-06-02 2016-09-28 腾讯科技(深圳)有限公司 Animation frame processing method, animation frame processing server, terminal and system
CN106375759A (en) * 2016-08-31 2017-02-01 深圳超多维科技有限公司 Video image data coding method and device, and video image data decoding method and device
CN106937132A (en) * 2017-04-08 2017-07-07 腾讯科技(深圳)有限公司 A kind of photograph document handling method
CN107071514A (en) * 2017-04-08 2017-08-18 腾讯科技(深圳)有限公司 A kind of photograph document handling method and intelligent terminal
CN107071516A (en) * 2017-04-08 2017-08-18 腾讯科技(深圳)有限公司 A kind of photograph document handling method
CN107071515A (en) * 2017-04-08 2017-08-18 腾讯科技(深圳)有限公司 A kind of photograph document handling method and system
CN108307163A (en) * 2018-02-07 2018-07-20 重庆虚拟实境科技有限公司 Image processing method and device, computer installation and readable storage medium storing program for executing
CN108449569A (en) * 2018-03-13 2018-08-24 重庆虚拟实境科技有限公司 Virtual meeting method, system, device, computer installation and storage medium
CN108471536A (en) * 2018-03-14 2018-08-31 重庆虚拟实境科技有限公司 Alpha channel transmission methods and device, terminal installation and storage medium
CN108668169A (en) * 2018-06-01 2018-10-16 北京市商汤科技开发有限公司 Image information processing method and device, storage medium
WO2018205878A1 (en) * 2017-05-11 2018-11-15 腾讯科技(深圳)有限公司 Method for transmitting video information, terminal, server and storage medium
CN108989807A (en) * 2017-06-03 2018-12-11 上海天荷电子信息有限公司 Each component uses the data compression method and device of respective corresponding data array format
CN108989810A (en) * 2017-06-03 2018-12-11 上海天荷电子信息有限公司 The data compression method and device of byte stream or bit stream is respectively adopted in different components
CN109151503A (en) * 2017-04-08 2019-01-04 腾讯科技(深圳)有限公司 A kind of photograph document handling method and its equipment
CN109547849A (en) * 2017-09-21 2019-03-29 腾讯科技(北京)有限公司 A kind of video information playback method, device, terminal and computer storage medium
CN110087082A (en) * 2018-01-26 2019-08-02 三星电子株式会社 Image processing apparatus and method for operating image processing apparatus
CN110719484A (en) * 2019-09-17 2020-01-21 广州魅视电子科技有限公司 Image processing method
CN113115041A (en) * 2021-03-15 2021-07-13 广州匠芯创科技有限公司 Lossless picture compression method, device and medium supporting alpha channel
CN113613008A (en) * 2021-08-20 2021-11-05 百果园技术(新加坡)有限公司 Video encoding and decoding method and device, electronic equipment and storage medium
CN113645469A (en) * 2020-05-11 2021-11-12 腾讯科技(深圳)有限公司 Image processing method and device, intelligent terminal and computer readable storage medium
CN114173157A (en) * 2021-12-10 2022-03-11 广州博冠信息科技有限公司 Video stream transmission method and device, electronic equipment and storage medium
CN114760525A (en) * 2021-01-08 2022-07-15 北京字节跳动网络技术有限公司 Video generation and playing method, device, equipment and medium

Cited By (71)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011035658A1 (en) * 2009-09-25 2011-03-31 腾讯科技(深圳)有限公司 Method, device and system for compressing and decompressing transparent image
CN102103463A (en) * 2011-02-17 2011-06-22 杭州华三通信技术有限公司 Processing method and equipment of user interface information with transparency
CN102103463B (en) * 2011-02-17 2013-03-13 浙江宇视科技有限公司 Processing method and equipment of user interface information with transparency
CN102682415A (en) * 2011-03-09 2012-09-19 腾讯科技(深圳)有限公司 Image processing method and device
CN102682415B (en) * 2011-03-09 2015-02-18 腾讯科技(深圳)有限公司 Image processing method and device
CN102244784A (en) * 2011-06-09 2011-11-16 杭州典能科技有限公司 Method for compressing and displaying picture including transparent information
CN102244784B (en) * 2011-06-09 2014-03-26 杭州典能科技有限公司 Method for compressing and displaying picture including transparent information
CN102231836A (en) * 2011-06-27 2011-11-02 深圳市茁壮网络股份有限公司 Graphics interchange format (GIF) file processing method and device for digital television system
CN102231836B (en) * 2011-06-27 2013-06-26 深圳市茁壮网络股份有限公司 Graphics interchange format (GIF) file processing method and device for digital television system
CN102231834A (en) * 2011-06-27 2011-11-02 深圳市茁壮网络股份有限公司 Animated portable network graphics (APNG) file processing method and device for digital television system
CN102289829A (en) * 2011-07-12 2011-12-21 北京朗玛数联科技有限公司 Method and device for storing and restoring image and system for processing image
CN102821279A (en) * 2012-07-31 2012-12-12 北京天神互动科技有限公司 Picture compression method keeping with alpha channel
CN104995918A (en) * 2013-01-08 2015-10-21 微软公司 Method for converting the format of a frame into a chroma subsampling format
CN104995918B (en) * 2013-01-08 2019-05-17 微软技术许可有限责任公司 Method for the format of frame to be converted into chroma sub-sampling format
CN105938625A (en) * 2016-03-18 2016-09-14 浙江万朋教育科技股份有限公司 Method for processing alpha channel data in PNG picture format
CN105938625B (en) * 2016-03-18 2018-10-12 浙江万朋教育科技股份有限公司 A method of alpha channel datas in processing PNG picture formats
CN105979282A (en) * 2016-06-02 2016-09-28 腾讯科技(深圳)有限公司 Animation frame processing method, animation frame processing server, terminal and system
CN105979282B (en) * 2016-06-02 2019-08-06 腾讯科技(深圳)有限公司 A kind of animation frame processing method, server, terminal and system
CN106375759A (en) * 2016-08-31 2017-02-01 深圳超多维科技有限公司 Video image data coding method and device, and video image data decoding method and device
WO2018184464A1 (en) * 2017-04-08 2018-10-11 腾讯科技(深圳)有限公司 Picture file processing method and device, and storage medium
CN107071516A (en) * 2017-04-08 2017-08-18 腾讯科技(深圳)有限公司 A kind of photograph document handling method
TWI725299B (en) * 2017-04-08 2021-04-21 大陸商騰訊科技(深圳)有限公司 Picture file processing method, device, and storage medium
CN109151503B (en) * 2017-04-08 2022-03-15 腾讯科技(深圳)有限公司 Picture file processing method and equipment
WO2018184468A1 (en) * 2017-04-08 2018-10-11 腾讯科技(深圳)有限公司 Image file processing method, device and storage medium
TWI707309B (en) * 2017-04-08 2020-10-11 大陸商騰訊科技(深圳)有限公司 Method, system and storage medium for processing image file
WO2018184483A1 (en) * 2017-04-08 2018-10-11 腾讯科技(深圳)有限公司 Picture file processing method and system, and storage medium
WO2018184458A1 (en) * 2017-04-08 2018-10-11 腾讯科技(深圳)有限公司 Picture file processing method and device, and storage medium
CN107071515A (en) * 2017-04-08 2017-08-18 腾讯科技(深圳)有限公司 A kind of photograph document handling method and system
CN109040789B (en) * 2017-04-08 2021-05-28 腾讯科技(深圳)有限公司 Picture file processing method
CN107071514B (en) * 2017-04-08 2018-11-06 腾讯科技(深圳)有限公司 A kind of photograph document handling method and intelligent terminal
CN109005426B (en) * 2017-04-08 2021-04-30 腾讯科技(深圳)有限公司 Picture file processing method
TWI677232B (en) * 2017-04-08 2019-11-11 大陸商騰訊科技(深圳)有限公司 Picture file processing method, device, and storage medium
CN106937132B (en) * 2017-04-08 2018-12-07 腾讯科技(深圳)有限公司 A kind of photograph document handling method
CN107071515B (en) * 2017-04-08 2018-12-07 腾讯科技(深圳)有限公司 A kind of photograph document handling method and system
CN109194962B (en) * 2017-04-08 2022-07-22 腾讯科技(深圳)有限公司 Picture file processing method and system
CN109089162B (en) * 2017-04-08 2021-05-28 腾讯科技(深圳)有限公司 Picture file processing method and system
CN109005426A (en) * 2017-04-08 2018-12-14 腾讯科技(深圳)有限公司 A kind of photograph document handling method
CN109040789A (en) * 2017-04-08 2018-12-18 腾讯科技(深圳)有限公司 A kind of photograph document handling method
CN109089162A (en) * 2017-04-08 2018-12-25 腾讯科技(深圳)有限公司 A kind of photograph document handling method and system
CN109151503A (en) * 2017-04-08 2019-01-04 腾讯科技(深圳)有限公司 A kind of photograph document handling method and its equipment
CN109194962A (en) * 2017-04-08 2019-01-11 腾讯科技(深圳)有限公司 A kind of photograph document handling method and system
CN109348226A (en) * 2017-04-08 2019-02-15 腾讯科技(深圳)有限公司 A kind of photograph document handling method and intelligent terminal
US11012489B2 (en) 2017-04-08 2021-05-18 Tencent Technology (Shenzhen) Company Limited Picture file processing method, picture file processing device, and storage medium
CN107071514A (en) * 2017-04-08 2017-08-18 腾讯科技(深圳)有限公司 A kind of photograph document handling method and intelligent terminal
US20190222623A1 (en) * 2017-04-08 2019-07-18 Tencent Technology (Shenzhen) Company Limited Picture file processing method, picture file processing device, and storage medium
US11012716B2 (en) 2017-04-08 2021-05-18 Tencent Technology (Shenzhen) Company Ltd Image file processing method, system and storage medium
CN106937132A (en) * 2017-04-08 2017-07-07 腾讯科技(深圳)有限公司 A kind of photograph document handling method
TWI672939B (en) * 2017-04-08 2019-09-21 大陸商騰訊科技(深圳)有限公司 Method, device and storage medium for processing image file
CN108881920A (en) * 2017-05-11 2018-11-23 腾讯科技(深圳)有限公司 A kind of method of transmission of video information, terminal and server
WO2018205878A1 (en) * 2017-05-11 2018-11-15 腾讯科技(深圳)有限公司 Method for transmitting video information, terminal, server and storage medium
CN108881920B (en) * 2017-05-11 2022-06-10 腾讯科技(深圳)有限公司 Method, terminal and server for transmitting video information
CN108989807A (en) * 2017-06-03 2018-12-11 上海天荷电子信息有限公司 Each component uses the data compression method and device of respective corresponding data array format
CN108989810A (en) * 2017-06-03 2018-12-11 上海天荷电子信息有限公司 The data compression method and device of byte stream or bit stream is respectively adopted in different components
CN109547849A (en) * 2017-09-21 2019-03-29 腾讯科技(北京)有限公司 A kind of video information playback method, device, terminal and computer storage medium
CN110087082A (en) * 2018-01-26 2019-08-02 三星电子株式会社 Image processing apparatus and method for operating image processing apparatus
CN108307163B (en) * 2018-02-07 2019-11-19 重庆虚拟实境科技有限公司 Image processing method and device, computer installation and readable storage medium storing program for executing
CN108307163A (en) * 2018-02-07 2018-07-20 重庆虚拟实境科技有限公司 Image processing method and device, computer installation and readable storage medium storing program for executing
CN108449569A (en) * 2018-03-13 2018-08-24 重庆虚拟实境科技有限公司 Virtual meeting method, system, device, computer installation and storage medium
CN108471536B (en) * 2018-03-14 2021-04-06 重庆虚拟实境科技有限公司 Alpha channel transmission method and device, terminal device and storage medium
CN108471536A (en) * 2018-03-14 2018-08-31 重庆虚拟实境科技有限公司 Alpha channel transmission methods and device, terminal installation and storage medium
CN108668169A (en) * 2018-06-01 2018-10-16 北京市商汤科技开发有限公司 Image information processing method and device, storage medium
CN108668169B (en) * 2018-06-01 2021-10-29 北京市商汤科技开发有限公司 Image information processing method and device, and storage medium
CN110719484A (en) * 2019-09-17 2020-01-21 广州魅视电子科技有限公司 Image processing method
CN110719484B (en) * 2019-09-17 2020-08-04 广州魅视电子科技有限公司 Image processing method
CN113645469B (en) * 2020-05-11 2022-06-24 腾讯科技(深圳)有限公司 Image processing method and device, intelligent terminal and computer readable storage medium
CN113645469A (en) * 2020-05-11 2021-11-12 腾讯科技(深圳)有限公司 Image processing method and device, intelligent terminal and computer readable storage medium
CN114760525A (en) * 2021-01-08 2022-07-15 北京字节跳动网络技术有限公司 Video generation and playing method, device, equipment and medium
CN113115041A (en) * 2021-03-15 2021-07-13 广州匠芯创科技有限公司 Lossless picture compression method, device and medium supporting alpha channel
CN113115041B (en) * 2021-03-15 2023-03-10 广州匠芯创科技有限公司 Lossless picture compression method, device and medium supporting alpha channel
CN113613008A (en) * 2021-08-20 2021-11-05 百果园技术(新加坡)有限公司 Video encoding and decoding method and device, electronic equipment and storage medium
CN114173157A (en) * 2021-12-10 2022-03-11 广州博冠信息科技有限公司 Video stream transmission method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN101742317B (en) 2012-03-28

Similar Documents

Publication Publication Date Title
CN101742317B (en) Video compressing and encoding method with alpha transparent channel
JP6768122B2 (en) Coding of adaptive color space transformations
CN101267563B (en) Adaptive variable-length coding
US10013746B2 (en) High dynamic range video tone mapping
US8848789B2 (en) Method and system for coding and decoding information associated with video compression
CN101222644B (en) Moving image encoding/decoding device and moving image encoding/decoding method
CN100542282C (en) Encoding and decoding of video device and method that can minimizing random access delay
US5568200A (en) Method and apparatus for improved video display of progressively refreshed coded video
US6677868B2 (en) Entropy coding with adaptive syntax to replace high probability symbols with lower probabilities symbols
CN110301134A (en) The image shaping of integration and Video coding
JP2018532316A (en) Video decoder adaptation for high dynamic range (HDR) video coding using core video standards
US20090034612A1 (en) Quantization method and apparatus in encoding/decoding
TW201711470A (en) Adaptive constant-luminance approach for high dynamic range and wide color gamut video coding
CN107864379B (en) Compression method applied to video coding and decoding
CN101218831A (en) Image encoding method and image decoding method, image encoder and image decoder, and image encoded bit stream and recording medium
CN101889447A (en) Extension of the AVC standard to encode high resolution digital still pictures in series with video
CN102835107A (en) Super-block for high performance video coding
CA2250284C (en) A perceptual compression and robust bit-rate control system
KR20100014282A (en) Device for encoding video data, device for decoding video data, stream of digital data
CN113613004A (en) Image encoding method, image encoding device, electronic device, and storage medium
US5694172A (en) Method and apparatus for reproducing picture data
JP2006527518A (en) Video compression
WO2008147142A2 (en) Method and system of inserting watermark for h.264/avc video stream
CN102333223A (en) Video data coding method, decoding method, coding system and decoding system
KR20050090302A (en) Video encoder/decoder, video encoding/decoding method and computer readable medium storing a program for performing the method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant