WO2023020560A1 - Video coding and decoding method and apparatus, electronic device and storage medium - Google Patents

Video coding and decoding method and apparatus, electronic device and storage medium Download PDF

Info

Publication number
WO2023020560A1
WO2023020560A1 PCT/CN2022/113182 CN2022113182W WO2023020560A1 WO 2023020560 A1 WO2023020560 A1 WO 2023020560A1 CN 2022113182 W CN2022113182 W CN 2022113182W WO 2023020560 A1 WO2023020560 A1 WO 2023020560A1
Authority
WO
WIPO (PCT)
Prior art keywords
alpha
block
encoding
prediction block
luma
Prior art date
Application number
PCT/CN2022/113182
Other languages
French (fr)
Chinese (zh)
Inventor
包佳晶
Original Assignee
百果园技术(新加坡)有限公司
包佳晶
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 百果园技术(新加坡)有限公司, 包佳晶 filed Critical 百果园技术(新加坡)有限公司
Publication of WO2023020560A1 publication Critical patent/WO2023020560A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/186Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods 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/176Methods 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 block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding

Definitions

  • the embodiments of the present application relate to the technical field of video processing, for example, to a video encoding and decoding method, device, electronic equipment, and storage medium.
  • the mainstream video compression standards deal with data in YUV format.
  • the data in YUV format is encoded and then transmitted to the decoding end. After decoding by the decoding end, the data in YUV format is also obtained. Then the display device or post-processing part converts the YUV data Convert to RGB data for display and presentation.
  • RGBBA RGBBA is a color space representing red (Red), green (Green), blue (Blue) and alpha (Alpha)) format
  • the present application provides a video encoding and decoding method, device, electronic equipment, and storage medium to encode and decode videos containing Alpha data, save the transmission bandwidth of Alpha data, and improve the efficiency of encoding and decoding videos with Alpha data .
  • the embodiment of the present application provides a video coding method, including:
  • a video frame comprising a luma component, a chrominance component, and an alpha Alpha component into a plurality of coding units CU, wherein the plurality of CUs include a luma encoding block, a chrominance encoding block, and an Alpha encoding block;
  • the embodiment of the present application also provides a video decoding method, including:
  • the video code stream to be decoded includes a luma bit stream, a chrominance bit stream, an Alpha Alpha bit stream and related syntax elements;
  • the luminance bitstream, chrominance bitstream, and Alpha bitstream are respectively decoded to obtain reconstructed video frames comprising luminance data, chrominance data, and Alpha data.
  • the embodiment of the present application also provides a video encoding device, including:
  • a CU division module configured to divide a video frame comprising a luma component, a chrominance component, and an alpha Alpha component into a plurality of coding units CU, wherein the plurality of CUs include a luma encoding block, a chrominance encoding block, and an Alpha encoding block;
  • the CU encoding module is configured to perform encoding and compression processing on the luminance encoding block, the chrominance encoding block and the Alpha encoding block respectively, and input the encoding and compression results and related syntax elements into a code stream for transmission, and the related
  • the syntax elements include syntax elements corresponding to the Alpha coding block.
  • the embodiment of the present application also provides a video decoding device, including:
  • the code stream receiving module is configured to receive the video code stream of the video frame to be decoded, the video code stream to be decoded includes a luma bit stream, a chrominance bit stream, an Alpha Alpha bit stream and related syntax elements;
  • the decoding module is configured to decode the luminance bit stream, chrominance bit stream, and Alpha bit stream respectively according to the relevant syntax elements, to obtain reconstructed video frames including luminance data, chrominance data, and Alpha data.
  • An embodiment of the present application also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and operable on the processor, and the processor implements the method provided by any of the above-mentioned embodiments when executing the program .
  • the embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the method provided in any of the above-mentioned embodiments is implemented.
  • FIG. 1 is a flow chart of a video encoding method embodiment provided in Embodiment 1 of the present application;
  • FIG. 2 is a flowchart of a video decoding method embodiment provided in Embodiment 2 of the present application;
  • FIG. 3 is a structural block diagram of a video coding device embodiment provided in Embodiment 3 of the present application.
  • FIG. 4 is a structural block diagram of a video decoding device embodiment provided in Embodiment 4 of the present application.
  • FIG. 5 is a schematic structural diagram of an electronic device provided in Embodiment 5 of the present application.
  • FIG. 1 is a flow chart of a video coding method embodiment provided in Embodiment 1 of the present application.
  • This embodiment can be used in a scenario where a video stream containing alpha channel (Alpha channel) data is coded.
  • the Alpha channel data is used to represent the additional information of the transparency of multiple pixels in a frame of image, and the transparency characteristics of the Alpha channel can be used to create rich image effects.
  • a bitmap that uses 16 bits per pixel to store, for each pixel in the picture, 5 bits may represent red (R), 5 bits may represent green (G), and 5 bits may represent blue Color (B), the last bit is Alpha.
  • the alpha channel data is either transparent or opaque, because the value of the alpha bit has two different possibilities of representing 0 or 1.
  • Alpha channel data can not only represent transparency and opacity, but also It can represent 256 levels of translucency, because the Alpha channel has 8 bits and can have 256 different data representation possibilities.
  • This embodiment can be applied to an encoder, as shown in Figure 1, this embodiment can include the following steps:
  • Step 110 divide the video frame comprising the luma component, the chrominance component and the Alpha Alpha component into a plurality of coding units (Coding Unit, CU), wherein the plurality of CUs include a luma coding block, a chrominance coding block and an Alpha Alpha code block.
  • CU Coding Unit
  • each coding block is a CU.
  • the video frame to be encoded may include a luma component, a chroma component, and an Alpha component
  • the encoder may be an encoder capable of encoding the luma component, the chroma component, and the Alpha component.
  • a video frame comprising a luminance component, a chrominance component and an Alpha component can be obtained in the following manner: RGB data and Alpha data in the video frame are extracted from a video frame in the RGBA image format to be encoded ; Converting the RGB data into YUV data; Embedding the Alpha data in the YUV data to generate a video frame comprising a brightness component, a chrominance component and an Alpha Alpha component.
  • the video stream to be encoded may be a video stream in RGBA format, and each video frame in the video stream is also an image in RGBA format.
  • RGBA data is a color space representing red (Red), green (Green), blue (Blue) and transparency information (Alpha), and RGB is a color standard in the industry. G), the change of the three color channels of blue (B) and their mutual superposition to obtain different colors.
  • the pixel value in each pixel point is an RGBA value, that is, the pixel value of each pixel point includes an R component pixel value, a G component pixel value, a B component pixel value, and an Alpha component pixel value.
  • the RGB pixel value of each pixel it can be converted into a YUV value, where the Y channel data represents the brightness, that is, the grayscale value; the U and V two channel data represent the chroma, which can be used to specify the color of the pixel .
  • the following formula can be used to convert the RGB color data of each pixel into YUV data:
  • the Alpha channel data of each pixel can be combined with the YUV data of the pixel to finally generate a YUVA (YUV+Alpha) video frame.
  • HEVC High Efficiency Video Coding
  • the video frame can first be divided into multiple coding tree units (Coding Tree Unit, CTU) , these coding tree units are blocks of a predefined size (eg, 64 pixels by 64 pixels).
  • CTU includes brightness pixels, chroma pixels and Alpha pixels.
  • An encoding tree can then be employed to divide each CTU into blocks and recursively subdivide these blocks until a configuration that supports further encoding is obtained.
  • the luma component of a frame can be subdivided until each luma block (i.e. luma coding block) includes a relatively uniform luma value; the chrominance component of a frame can also be subdivided until each chrominance block (i.e. Chroma encoding block) includes relatively uniform color values; the Alpha component of the frame can also be subdivided until each Alpha block (ie, Alpha encoding block) includes relatively uniform transparency values.
  • Step 120 Perform encoding and compression processing on the luminance encoding block, the chrominance encoding block, and the Alpha Alpha encoding block, and input the encoding and compression results and related syntax elements into the code stream for transmission, and the related syntax elements Include syntax elements corresponding to the Alpha coding block.
  • the Alpha channel data is introduced, and the entire encoding process adds the processing of the Alpha channel data, so that the While the Alpha channel data is compressed, the synchronous processing of the Alpha channel data, luminance data and chrominance data is guaranteed.
  • the coding and compression process may include the following processing stages: prediction processing, transform and quantization processing, entropy coding processing, inverse transform and quantization processing, filtering processing, reconstruction processing, and the like.
  • the encoding and compression process may include the following process: first, the video encoder divides the input video image into non-overlapping coding units; then predictive coding is performed on the coding units, mainly using the spatial correlation and temporal correlation of the video, respectively using frame Intra-prediction and inter-frame prediction remove redundant information in space-time domain, so as to obtain the predicted image block; then the predicted image block is made difference with the original image block to obtain the prediction residual block, and then the discrete cosine transform (Discrete Cosine Transform, DCT) and quantization to obtain quantized DCT coefficients; finally, entropy coding is performed on the quantized DCT coefficients to obtain compressed code streams.
  • DCT discrete cosine Transform
  • multiple prediction units (Prediction Unit, PU) divided according to multiple CUs may include a luma prediction block (Prediction Block, PB), color Degree PB and AlphaPB, also includes related syntax elements.
  • Prediction Block, PB Prediction Block
  • PB luma prediction block
  • AlphaPB also includes related syntax elements.
  • intra-frame prediction and inter-frame prediction on the luma PB, chroma PB, and Alpha PB respectively to determine the optimal prediction blocks corresponding to the luma PB, chroma PB, and Alpha PB respectively; finally calculate the luma PB and its corresponding optimal
  • the residual signal between prediction blocks, the residual signal between chrominance PB and its corresponding optimal prediction block, and the residual signal between Alpha PB and its corresponding optimal prediction block are used as the processing results of prediction processing.
  • multiple CUs are divided into multiple PUs, and multiple PUs include luma PB, chroma PB and Alpha PB, each luma encoding block may be divided into multiple luma PB, and each chrominance encoding block Divide into multiple chroma PBs, and divide each Alpha coding block into multiple Alpha PBs.
  • each chroma PB After dividing the PB, perform intra-frame prediction and inter-frame prediction on each luma PB, each chroma PB, and each Alpha PB to determine the optimal PB corresponding to each luma PB and the optimal PB corresponding to each chroma PB. Excellent PB and the optimal PB corresponding to each Alpha PB.
  • the process of the optimal prediction mode for each PB can be described as: Based on a mode selection criterion, traverse possible candidate modes, calculate the encoding cost of each candidate mode under the current criterion, and select the candidate mode with the smallest encoding cost as Optimal forecasting model.
  • the residual signal of the prediction block is obtained.
  • the residual signal needs to be transformed and quantized.
  • the residual signal corresponding to the luma prediction block, the residual signal corresponding to the chroma prediction block and the residual signal corresponding to the Alpha prediction block are divided into multiple transform units TU, and the multiple PUs may include luma transform blocks ( Transform Block, TB), chroma transform block TB and Alpha transform block TB, and also includes related syntax elements.
  • DCT transform processing and quantization processing are performed on the luma TB, chroma TB, and Alpha TB respectively to obtain the quantization parameters corresponding to the luma transform block, the quantization parameters corresponding to the chroma transform block, and the quantization parameters corresponding to the Alpha transform block.
  • each chroma PB and the optimal PB corresponding to each chroma PB After the residual signal between each Alpha PB and the optimal PB corresponding to each Alpha PB, the multiple residual signals calculated according to multiple brightness PBs are transformed into multiple brightness TBs , converting multiple residual signals calculated according to multiple chroma PBs into multiple chrominance TBs, and transforming multiple residual signals calculated according to multiple Alpha PBs into multiple Alpha TBs.
  • each luma TB After the TB is obtained, discrete cosine transform processing and quantization processing are performed on each luma TB, each chroma TB, and each Alpha TB, respectively, to obtain quantization parameters corresponding to each luma TB, quantization parameters corresponding to each chroma TB, and Quantization parameters corresponding to each Alpha TB.
  • the process of transformation processing and quantization processing can be as follows: DCT transformation is performed on TB to obtain direct current (Direct Current, DC) coefficients and alternating current (Alternating Current, AC) coefficients, and then the DC coefficients are subjected to Hadamard product (Hadamard) transformation, The transformed DC and AC coefficients are then quantized. Quantization reduces the bit rate through many-to-one mapping. There are mainly uniform quantization, non-uniform quantization and adaptive quantization. According to the optimal quantizer design criterion: the boundary value of the optimal quantization interval is the average of two adjacent optimal quantization values, and the optimal quantization value is the mean value of the quantization interval.
  • entropy encoding is performed on the quantization parameters corresponding to luma TB, quantization parameters corresponding to chroma TB, and quantization parameters corresponding to Alpha TB, so that the result of entropy encoding is output in the form of bit stream.
  • descriptive sentences for Alpha data are also added to the entropy coding syntax generated in the entropy coding stage, so as to ensure that the decoding end can correctly decode and restore the alpha data.
  • the entropy coding syntax may include: a sequence parameter set (Sequence Paramater Set, sps) including an Alpha component, as shown in the following table:
  • Enable_alpha_flag is the new sps about Alpha data.
  • the entropy encoding syntax may further include: a residual entropy syntax including an Alpha component, and the newly added residual entropy syntax of the Alpha component is shown in the following table:
  • the "" part is the entropy coding syntax in the related art, and the entropy coding syntax may include description information for chrominance data and luminance data.
  • the Alpha data and the YUV data are encoded and compressed synchronously.
  • the bandwidth occupation of Alpha data thereby improving the compression efficiency of the video.
  • FIG. 2 is a flowchart of a video decoding method embodiment provided in Embodiment 2 of the present application. This embodiment can be used in a scenario where a video code stream containing alpha data is decoded. May include the following steps:
  • Step 210 receiving a video code stream of a video frame to be decoded, the video code stream to be decoded includes a luma bit stream, a chrominance bit stream, an Alpha bit stream and related syntax elements.
  • Step 220 Decode the luminance bit stream, chrominance bit stream, and Alpha bit stream respectively according to the relevant syntax elements to obtain reconstructed video frames including luminance data, chrominance data, and Alpha data.
  • the video decoding process is exactly the opposite of the encoding process.
  • the code stream is first entropy decoded to obtain the quantized coefficients after scanning, and then through inverse scanning, inverse quantization and inverse transformation to obtain the decoded residual coefficients, and then A decoded reconstructed image is obtained through motion compensation, and the reconstructed image includes luminance data, chrominance data and Alpha data.
  • the display device or post-processing part can convert the luminance data and chrominance data into RGB data, and then combine the RGB data and Alpha data into RGBA data display for users to use.
  • the Alpha data in the code stream can be obtained, which is convenient for subsequent background removal and Alpha mixing. processing and template processing etc.
  • Fig. 3 is a structural block diagram of a video encoding device embodiment provided in Embodiment 3 of the present application, which may include the following modules: CU division module 310, configured to divide video frames containing luminance components, chrominance components, and alpha Alpha components into a plurality of coding units CU, wherein the plurality of CUs include a luma coding block, a chrominance coding block, and an Alpha Alpha coding block; Perform encoding and compression processing with the Alpha encoding block, and input the encoding and compression result and related syntax elements into a code stream for transmission, and the related syntax elements include syntax elements corresponding to the Alpha encoding block.
  • CU division module 310 configured to divide video frames containing luminance components, chrominance components, and alpha Alpha components into a plurality of coding units CU, wherein the plurality of CUs include a luma coding block, a chrominance coding block, and an Alpha Alpha coding block
  • the encoding and compression processing includes prediction processing
  • the CU encoding module 320 may include the following submodules: a prediction processing submodule configured to divide the multiple CUs into multiple prediction units PU, so that The plurality of PUs include a luma prediction block, a chroma prediction block, and an Alpha prediction block; intra-frame prediction and inter-frame prediction are respectively performed on the luma prediction block, the chroma prediction block, and the Alpha prediction block to determine the The optimal prediction block corresponding to the luminance prediction block, the optimal prediction block corresponding to the chroma prediction block, and the optimal prediction block corresponding to the Alpha prediction block; The residual signal between the optimal prediction block, the residual signal between the chroma prediction block and the optimal prediction block corresponding to the chroma prediction block, and the Alpha prediction block corresponding to the Alpha prediction block The residual signal between optimally predicted blocks of .
  • the encoding and compression processing further includes transform and quantization processing;
  • the CU encoding module 320 may include the following submodules: a transform and quantization submodule, configured to convert the residual signal corresponding to the luma prediction block, the chroma prediction
  • the residual signal corresponding to the block and the residual signal corresponding to the Alpha prediction block are divided into a plurality of transformation units TU, and the plurality of TUs include a luma transformation block, a chrominance transformation block, and an Alpha transformation block;
  • the chroma transform block and the Alpha transform block perform DCT transform processing and quantization processing to obtain quantization parameters corresponding to the luma transform block, quantization parameters corresponding to the chroma transform block, and quantization parameters corresponding to the Alpha transform block.
  • the encoding and compression processing further includes entropy encoding processing;
  • the CU encoding module 320 may include the following submodules: an entropy encoding submodule, configured to perform quantization parameters corresponding to the luma transformation block, chrominance The quantization parameters corresponding to the transform block and the quantization parameters corresponding to the Alpha transform block are entropy encoded, and the entropy encoded result is output in the form of a bit stream.
  • the relevant syntax elements include entropy coding syntax generated in the entropy coding stage; the entropy coding syntax includes: a sequence parameter including an Alpha component, and a residual entropy syntax including an Alpha component.
  • the device also includes a video frame acquisition module, configured to extract the RGB data and Alpha data in the video frame from the video frame of the RGBA image format to be encoded; convert the RGB data into YUV data; embedding the Alpha data in the YUV data to generate a video frame comprising a brightness component, a chrominance component and an Alpha Alpha component.
  • a video frame acquisition module configured to extract the RGB data and Alpha data in the video frame from the video frame of the RGBA image format to be encoded; convert the RGB data into YUV data; embedding the Alpha data in the YUV data to generate a video frame comprising a brightness component, a chrominance component and an Alpha Alpha component.
  • the above-mentioned video coding device provided in the embodiment of the present application can execute the video coding method provided in the first embodiment of the present application, and has corresponding functional modules and effects for executing the method.
  • FIG. 4 is a structural block diagram of a video decoding device embodiment provided in Embodiment 4 of the present application, which may include the following modules: a code stream receiving module 410, configured to receive a video code stream of a video frame to be decoded, and the video code stream to be decoded
  • the code stream includes a luminance bit stream, a chrominance bit stream, an Alpha Alpha bit stream, and related syntax elements;
  • the decoding module 420 is configured to, respectively, perform operations on the luminance bit stream, the chrominance bit stream, and the Alpha bit stream according to the related syntax elements.
  • the stream is decoded to obtain a reconstructed video frame including luminance data, chrominance data, and Alpha data.
  • the above-mentioned video decoding device provided in the embodiment of the present application can execute the video decoding method provided in the second embodiment of the present application, and has corresponding functional modules and effects for executing the method.
  • FIG. 5 is a schematic structural diagram of an electronic device provided in Embodiment 5 of the present application.
  • the electronic device includes a processor 510, a memory 520, an input device 530, and an output device 540;
  • the quantity can be one or more, and a processor 510 is taken as an example in FIG. Take the bus connection as an example.
  • the memory 520 can be configured to store software programs, computer-executable programs and modules, such as program instructions/modules corresponding to the methods in the embodiments of the present application.
  • the processor 510 executes various functional applications and data processing of the electronic device by running software programs, instructions and modules stored in the memory 520 , that is, implements the above-mentioned method.
  • the memory 520 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application program required by at least one function; the data storage area may store data created according to the use of the terminal, and the like.
  • the memory 520 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage devices.
  • memory 520 may include memory located remotely from processor 510, and such remote memory may be connected to the electronic device through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the input device 530 can be configured to receive input numbers or character information, and generate key signal input related to user settings and function control of the electronic device.
  • the output device 540 may include a display device such as a display screen.
  • Embodiment 6 of the present application further provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute the method in any embodiment of the present application when executed by a processor of the server.
  • the present application can be implemented by means of software and general hardware, and of course can also be implemented by means of hardware.
  • the technical solution of the present application can be embodied in the form of software products, and the computer software products can be stored in computer-readable storage media, such as computer floppy disks, read-only memory (Read-Only Memory, ROM), Random access memory (Random Access Memory, RAM), flash memory (FLASH), hard disk or optical disc, etc., including at least one instruction to make a computer device (which can be a personal computer, server, or network device, etc.) execute multiple The method described in an example.
  • the multiple units and modules included are only divided according to the functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the specific names of the multiple functional units It is only for the convenience of distinguishing each other, and is not used to limit the protection scope of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

Disclosed in the present application are a video coding and decoding method and apparatus, an electronic device, and a storage medium. The coding method comprises: dividing a video frame comprising a luma component, a chroma component, and an Alpha component into a plurality of coding units (CUs), wherein the plurality of CUs comprise a luma coding block, a chroma coding block, and an Alpha coding block; and performing coding compression processing on the luma coding block, the chroma coding block, and the Alpha coding block respectively, and inputting the coding compression result and a related syntax element into a bitstream for transmission, the related syntax element comprising a syntax element corresponding to the Alpha coding block.

Description

视频编解码的方法、装置、电子设备及存储介质Video encoding and decoding method, device, electronic equipment and storage medium
本申请要求在2021年08月20日提交中国专利局、申请号为202110962461.7的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with application number 202110962461.7 submitted to the China Patent Office on August 20, 2021, the entire content of which is incorporated in this application by reference.
技术领域technical field
本申请实施例涉及视频处理技术领域,例如涉及一种视频编解码的方法、装置、电子设备及存储介质。The embodiments of the present application relate to the technical field of video processing, for example, to a video encoding and decoding method, device, electronic equipment, and storage medium.
背景技术Background technique
主流的视频压缩标准处理的都是YUV格式的数据,YUV格式的数据经过编码后传输至解码端,由解码端进行解码后得到的也是YUV格式的数据,然后显示装置或者后处理部分将YUV数据转换成RGB数据进行显示呈现。The mainstream video compression standards deal with data in YUV format. The data in YUV format is encoded and then transmitted to the decoding end. After decoding by the decoding end, the data in YUV format is also obtained. Then the display device or post-processing part converts the YUV data Convert to RGB data for display and presentation.
普通的视频采用上述视频传输技术是没有问题的,但对于RGBA(RGBA是代表红色(Red)、绿色(Green)、蓝色(Blue)和阿尔法(Alpha)的色彩空间)格式的视频,当使用上述视频传输技术进行处理时,会将Alpha通道信息丢掉,只会进行RGB通道的转码、压码,转码为YUV数据。Alpha信息的缺失使得后续无法进行后续背景剔除、Alpha混合处理以及模板处理等。There is no problem with the above-mentioned video transmission technology for ordinary video, but for video in RGBA (RGBA is a color space representing red (Red), green (Green), blue (Blue) and alpha (Alpha)) format, when using When the above video transmission technology is processed, the Alpha channel information will be lost, and only the RGB channel will be transcoded, compressed, and transcoded into YUV data. The lack of Alpha information makes it impossible to perform subsequent background removal, Alpha blending processing, and template processing.
发明内容Contents of the invention
本申请提供一种视频编解码的方法、装置、电子设备及存储介质,以对包含Alpha数据的视频进行编解码,节省了Alpha数据的传输带宽,提高了对存在Alpha数据的视频的编解码效率。The present application provides a video encoding and decoding method, device, electronic equipment, and storage medium to encode and decode videos containing Alpha data, save the transmission bandwidth of Alpha data, and improve the efficiency of encoding and decoding videos with Alpha data .
本申请实施例提供了一种视频编码的方法,包括:The embodiment of the present application provides a video coding method, including:
将包含亮度分量、色度分量以及阿尔法Alpha分量的视频帧划分成多个编码单元CU,其中,所述多个CU包括亮度编码块、色度编码块及Alpha编码块;Divide a video frame comprising a luma component, a chrominance component, and an alpha Alpha component into a plurality of coding units CU, wherein the plurality of CUs include a luma encoding block, a chrominance encoding block, and an Alpha encoding block;
分别对所述亮度编码块、所述色度编码块和所述Alpha编码块进行编码压缩处理,并将编码压缩结果以及相关语法元素输入至码流进行传输,所述相关语法元素包括与所述Alpha编码块对应的语法元素。Perform encoding and compression processing on the luma encoding block, the chrominance encoding block, and the Alpha encoding block, and input the encoding and compression results and related syntax elements into a code stream for transmission, and the related syntax elements include the The syntax element corresponding to the Alpha code block.
本申请实施例还提供了一种视频解码的方法,包括:The embodiment of the present application also provides a video decoding method, including:
接收视频帧的待解码视频码流,所述待解码视频码流中包括亮度比特流、色度比特流、阿尔法Alpha比特流以及相关语法元素;Receiving a video code stream of a video frame to be decoded, the video code stream to be decoded includes a luma bit stream, a chrominance bit stream, an Alpha Alpha bit stream and related syntax elements;
根据所述相关语法元素,分别对所述亮度比特流、色度比特流、Alpha比特 流进行解码,获得包含亮度数据、色度数据以及Alpha数据的重建视频帧。According to the relevant syntax elements, the luminance bitstream, chrominance bitstream, and Alpha bitstream are respectively decoded to obtain reconstructed video frames comprising luminance data, chrominance data, and Alpha data.
本申请实施例还提供了一种视频编码的装置,包括:The embodiment of the present application also provides a video encoding device, including:
CU划分模块,设置为将包含亮度分量、色度分量以及阿尔法Alpha分量的视频帧划分成多个编码单元CU,其中,所述多个CU包括亮度编码块、色度编码块及Alpha编码块;A CU division module configured to divide a video frame comprising a luma component, a chrominance component, and an alpha Alpha component into a plurality of coding units CU, wherein the plurality of CUs include a luma encoding block, a chrominance encoding block, and an Alpha encoding block;
CU编码模块,设置为分别对所述亮度编码块、所述色度编码块和所述Alpha编码块进行编码压缩处理,并将编码压缩结果以及相关语法元素输入至码流进行传输,所述相关语法元素包括与所述Alpha编码块对应的语法元素。The CU encoding module is configured to perform encoding and compression processing on the luminance encoding block, the chrominance encoding block and the Alpha encoding block respectively, and input the encoding and compression results and related syntax elements into a code stream for transmission, and the related The syntax elements include syntax elements corresponding to the Alpha coding block.
本申请实施例还提供了一种视频解码的装置,包括:The embodiment of the present application also provides a video decoding device, including:
码流接收模块,设置为接收视频帧的待解码视频码流,所述待解码视频码流中包括亮度比特流、色度比特流、阿尔法Alpha比特流以及相关语法元素;The code stream receiving module is configured to receive the video code stream of the video frame to be decoded, the video code stream to be decoded includes a luma bit stream, a chrominance bit stream, an Alpha Alpha bit stream and related syntax elements;
解码模块,设置为根据所述相关语法元素,分别对所述亮度比特流、色度比特流、Alpha比特流进行解码,获得包含亮度数据、色度数据以及Alpha数据的重建视频帧。The decoding module is configured to decode the luminance bit stream, chrominance bit stream, and Alpha bit stream respectively according to the relevant syntax elements, to obtain reconstructed video frames including luminance data, chrominance data, and Alpha data.
本申请实施例还提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述任意实施例提供的方法。An embodiment of the present application also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and operable on the processor, and the processor implements the method provided by any of the above-mentioned embodiments when executing the program .
本申请实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述任意实施例提供的方法。The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the method provided in any of the above-mentioned embodiments is implemented.
附图说明Description of drawings
图1是本申请实施例一提供的一种视频编码的方法实施例的流程图;FIG. 1 is a flow chart of a video encoding method embodiment provided in Embodiment 1 of the present application;
图2是本申请实施例二提供的一种视频解码的方法实施例的流程图;FIG. 2 is a flowchart of a video decoding method embodiment provided in Embodiment 2 of the present application;
图3是本申请实施例三提供的一种视频编码的装置实施例的结构框图;FIG. 3 is a structural block diagram of a video coding device embodiment provided in Embodiment 3 of the present application;
图4是本申请实施例四提供的一种视频解码的装置实施例的结构框图;FIG. 4 is a structural block diagram of a video decoding device embodiment provided in Embodiment 4 of the present application;
图5是本申请实施例五提供的一种电子设备的结构示意图。FIG. 5 is a schematic structural diagram of an electronic device provided in Embodiment 5 of the present application.
具体实施方式Detailed ways
下面结合附图和实施例对本申请作说明。可以理解的是,此处所描述的实施例仅仅用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部结构。The application will be described below in conjunction with the accompanying drawings and embodiments. It should be understood that the embodiments described here are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only some structures related to the present application are shown in the drawings but not all structures.
实施例一Embodiment one
图1为本申请实施例一提供的一种视频编码的方法实施例的流程图,本实施例可以用于对包含阿尔法通道(Alpha通道)数据的视频流进行编码的场景。其中,Alpha通道数据用于表征一帧图像中多个像素点透明度的附加信息,利用Alpha通道的透明特性可以制作丰富的图像效果。例如:一幅每个像素使用16比特存储的位图,对于图中的每一个像素而言,可能以5个比特表示红色(R),5个比特表示绿色(G),5个比特表示蓝色(B),最后一个比特是Alpha。在这种情况下,Alpha通道数据要么表示透明要么表示不透明,因为Alpha比特的值有0或1两种不同表示的可能性。又如,一幅每个像素使用32个比特存储的位图,R、G、B和Alpha分别用8个比特表示,,在这种情况下,Alpha通道数据就不光可以表示透明和不透明,还可以表示256级的半透明度,因为Alpha通道有8个比特可以有256种不同的数据表示可能性。FIG. 1 is a flow chart of a video coding method embodiment provided in Embodiment 1 of the present application. This embodiment can be used in a scenario where a video stream containing alpha channel (Alpha channel) data is coded. Among them, the Alpha channel data is used to represent the additional information of the transparency of multiple pixels in a frame of image, and the transparency characteristics of the Alpha channel can be used to create rich image effects. For example: a bitmap that uses 16 bits per pixel to store, for each pixel in the picture, 5 bits may represent red (R), 5 bits may represent green (G), and 5 bits may represent blue Color (B), the last bit is Alpha. In this case, the alpha channel data is either transparent or opaque, because the value of the alpha bit has two different possibilities of representing 0 or 1. As another example, a bitmap stored with 32 bits per pixel, R, G, B, and Alpha are represented by 8 bits respectively. In this case, Alpha channel data can not only represent transparency and opacity, but also It can represent 256 levels of translucency, because the Alpha channel has 8 bits and can have 256 different data representation possibilities.
本实施例可以应用于编码器中,如图1所示,本实施例可以包括如下步骤:This embodiment can be applied to an encoder, as shown in Figure 1, this embodiment can include the following steps:
步骤110,将包含亮度分量、色度分量以及阿尔法Alpha分量的视频帧划分成多个编码单元(Coding Unit,CU),其中,所述多个CU包括亮度编码块、色度编码块及阿尔法Alpha编码块。 Step 110, divide the video frame comprising the luma component, the chrominance component and the Alpha Alpha component into a plurality of coding units (Coding Unit, CU), wherein the plurality of CUs include a luma coding block, a chrominance coding block and an Alpha Alpha code block.
本实施例中,每个编码块都是一个CU。In this embodiment, each coding block is a CU.
在本实施例中,待编码的视频帧中可以包括亮度分量、色度分量以及阿尔法Alpha分量,则编码器可以为能够对亮度分量、色度分量以及Alpha分量进行编码处理的编码器。在一种实施例中,可以采用如下方式获得包含亮度分量、色度分量以及Alpha分量的视频帧:从待编码的RGBA图像格式的视频帧中提取出所述视频帧中的RGB数据以及Alpha数据;将所述RGB数据转换成YUV数据;将所述Alpha数据嵌入所述YUV数据中,生成包含亮度分量、色度分量以及阿尔法Alpha分量的视频帧。In this embodiment, the video frame to be encoded may include a luma component, a chroma component, and an Alpha component, and the encoder may be an encoder capable of encoding the luma component, the chroma component, and the Alpha component. In one embodiment, a video frame comprising a luminance component, a chrominance component and an Alpha component can be obtained in the following manner: RGB data and Alpha data in the video frame are extracted from a video frame in the RGBA image format to be encoded ; Converting the RGB data into YUV data; Embedding the Alpha data in the YUV data to generate a video frame comprising a brightness component, a chrominance component and an Alpha Alpha component.
待编码的视频流可以为RGBA格式的视频流,视频流中每个视频帧也是RGBA格式的图像。其中,RGBA数据是代表红色(Red)、绿色(Green)、蓝色(Blue)和透明度信息(Alpha)的色彩空间,RGB是工业界的一种颜色标准,通过对红(R)、绿(G)、蓝(B)三个颜色通道的变化以及它们相互之间的叠加来得到不同的颜色。The video stream to be encoded may be a video stream in RGBA format, and each video frame in the video stream is also an image in RGBA format. Among them, RGBA data is a color space representing red (Red), green (Green), blue (Blue) and transparency information (Alpha), and RGB is a color standard in the industry. G), the change of the three color channels of blue (B) and their mutual superposition to obtain different colors.
对于RGBA格式的视频帧,其每个像素点中的像素值为RGBA值,即,每个像素点的像素值包括R分量像素值、G分量像素值、B分量像素值和Alpha分量像素值。通过对每个像素点的RGBA像素值进行分离,可以得到每个像素点的RGB像素值以及Alpha分量像素值。For a video frame in RGBA format, the pixel value in each pixel point is an RGBA value, that is, the pixel value of each pixel point includes an R component pixel value, a G component pixel value, a B component pixel value, and an Alpha component pixel value. By separating the RGBA pixel value of each pixel, the RGB pixel value and Alpha component pixel value of each pixel can be obtained.
然后对于每个像素点的RGB像素值,可以将其转换为YUV值,其中,Y通道数据表示亮度,也即灰阶值;U、V二通道数据表示色度,可以用于指定像素的颜色。Then for the RGB pixel value of each pixel, it can be converted into a YUV value, where the Y channel data represents the brightness, that is, the grayscale value; the U and V two channel data represent the chroma, which can be used to specify the color of the pixel .
在一实施方式中,可以采用如下公式,将每个像素点的RGB颜色数据转换为YUV数据:In one embodiment, the following formula can be used to convert the RGB color data of each pixel into YUV data:
Y=0.299R+0.587G+0.114BY=0.299R+0.587G+0.114B
U=-0.1687R-0.3313G+0.5B+128U=-0.1687R-0.3313G+0.5B+128
V=0.5R-0.4187G-0.0813B+128V=0.5R-0.4187G-0.0813B+128
在得到每个像素点的YUV数据以后,可以将每个像素点的Alpha通道数据与该像素点的YUV数据结合,最终生成YUVA(YUV+Alpha)视频帧。After obtaining the YUV data of each pixel, the Alpha channel data of each pixel can be combined with the YUV data of the pixel to finally generate a YUVA (YUV+Alpha) video frame.
针对YUVA格式的视频帧,可以按照设定分割机制将其划分成多个CU。其中,根据视频帧内容或者编码标准的不同,可以有不同的分割机制。例如,在高效视频编码(High Efficiency Video Coding,HEVC)(也称为H.265和MPEG-H第2部分)中,可以首先将视频帧分为多个编码树单元(Coding Tree Unit,CTU),这些编码树单元是预定义大小(例如,64个像素×64个像素)的块。CTU包括亮度像素点、色度像素点和Alpha像素点。然后可以采用编码树将每个CTU分成块,并递归地细分这些块,直到获得支持进一步编码的配置。比如,可以对帧的亮度分量进行细分,直到每个亮度块(即亮度编码块)包括相对均匀的亮度值;还可以对帧的色度分量进行细分,直到每个色度块(即色度编码块)包括相对均匀的颜色值;还可以对帧的Alpha分量进行细分,直到每个Alpha块(即Alpha编码块)包括相对均匀的透明度值。For video frames in YUVA format, it can be divided into multiple CUs according to the set division mechanism. Wherein, there may be different segmentation mechanisms according to different video frame contents or encoding standards. For example, in High Efficiency Video Coding (HEVC) (also known as H.265 and MPEG-H Part 2), the video frame can first be divided into multiple coding tree units (Coding Tree Unit, CTU) , these coding tree units are blocks of a predefined size (eg, 64 pixels by 64 pixels). CTU includes brightness pixels, chroma pixels and Alpha pixels. An encoding tree can then be employed to divide each CTU into blocks and recursively subdivide these blocks until a configuration that supports further encoding is obtained. For example, the luma component of a frame can be subdivided until each luma block (i.e. luma coding block) includes a relatively uniform luma value; the chrominance component of a frame can also be subdivided until each chrominance block (i.e. Chroma encoding block) includes relatively uniform color values; the Alpha component of the frame can also be subdivided until each Alpha block (ie, Alpha encoding block) includes relatively uniform transparency values.
步骤120,分别对所述亮度编码块、所述色度编码块和所述阿尔法Alpha编码块进行编码压缩处理,并将编码压缩结果以及相关语法元素输入至码流进行传输,所述相关语法元素包括与所述Alpha编码块对应的语法元素。Step 120: Perform encoding and compression processing on the luminance encoding block, the chrominance encoding block, and the Alpha Alpha encoding block, and input the encoding and compression results and related syntax elements into the code stream for transmission, and the related syntax elements Include syntax elements corresponding to the Alpha coding block.
在本实施例中,基于相关技术中的HEVC视频编码技术标准,在亮度数据以及色度数据的基础上,引入Alpha通道数据,整个编码环节都新增了对Alpha通道数据的处理,从而在对Alpha通道数据进行压缩的同时,保证了Alpha通道数据与亮度数据及色度数据的同步处理。In this embodiment, based on the HEVC video coding technical standard in the related art, on the basis of luminance data and chrominance data, the Alpha channel data is introduced, and the entire encoding process adds the processing of the Alpha channel data, so that the While the Alpha channel data is compressed, the synchronous processing of the Alpha channel data, luminance data and chrominance data is guaranteed.
基于相关技术中的HEVC视频编码技术标准,编码压缩流程可以包括如下处理阶段:预测处理、变换量化处理、熵编码处理、反变换量化处理、滤波处理、重建处理等。编码压缩流程可以包括如下过程:首先,视频编码器将输入的视频图像划分为互不重叠的编码单元;然后对编码单元进行预测编码,主要利用视频的空间相关性和时间相关性,分别采用帧内预测和帧间预测去除时空 域冗余信息,从而得到预测图像块;然后将预测图像块与原始图像块作差得到预测残差块,再对预测残差进行离散余弦变换(Discrete Cosine Transform,DCT)和量化,获得量化后的DCT系数;最后对量化后的DCT系数进行熵编码,得到压缩码流。Based on the HEVC video coding standard in the related art, the coding and compression process may include the following processing stages: prediction processing, transform and quantization processing, entropy coding processing, inverse transform and quantization processing, filtering processing, reconstruction processing, and the like. The encoding and compression process may include the following process: first, the video encoder divides the input video image into non-overlapping coding units; then predictive coding is performed on the coding units, mainly using the spatial correlation and temporal correlation of the video, respectively using frame Intra-prediction and inter-frame prediction remove redundant information in space-time domain, so as to obtain the predicted image block; then the predicted image block is made difference with the original image block to obtain the prediction residual block, and then the discrete cosine transform (Discrete Cosine Transform, DCT) and quantization to obtain quantized DCT coefficients; finally, entropy coding is performed on the quantized DCT coefficients to obtain compressed code streams.
在本实施例中,增加了Alpha通道数据以后,在预测处理阶段,根据多个CU划分出的多个预测单元(Prediction Unit,PU)中,可以包括亮度预测块(Prediction Block,PB)、色度PB以及AlphaPB,同时还包括相关的语法元素。然后分别对亮度PB、色度PB以及Alpha PB进行帧内预测和帧间预测,以确定亮度PB、色度PB以及Alpha PB分别对应的最优预测块;最后分别计算亮度PB与其对应的最优预测块之间的残差信号、色度PB与其对应的最优预测块之间的残差信号以及Alpha PB与其对应的最优预测块之间的残差信号,作为预测处理的处理结果。In this embodiment, after the Alpha channel data is added, in the prediction processing stage, multiple prediction units (Prediction Unit, PU) divided according to multiple CUs may include a luma prediction block (Prediction Block, PB), color Degree PB and AlphaPB, also includes related syntax elements. Then perform intra-frame prediction and inter-frame prediction on the luma PB, chroma PB, and Alpha PB respectively to determine the optimal prediction blocks corresponding to the luma PB, chroma PB, and Alpha PB respectively; finally calculate the luma PB and its corresponding optimal The residual signal between prediction blocks, the residual signal between chrominance PB and its corresponding optimal prediction block, and the residual signal between Alpha PB and its corresponding optimal prediction block are used as the processing results of prediction processing.
示例性的,将多个CU划分成多个PU,多个PU包括亮度PB,色度PB以及Alpha PB,可以是将每个亮度编码块划分成多个亮度PB,将每个色度编码块划分成多个色度PB,以及将每个Alpha编码块划分成多个Alpha PB。Exemplarily, multiple CUs are divided into multiple PUs, and multiple PUs include luma PB, chroma PB and Alpha PB, each luma encoding block may be divided into multiple luma PB, and each chrominance encoding block Divide into multiple chroma PBs, and divide each Alpha coding block into multiple Alpha PBs.
划分PB后,分别对每个亮度PB、每个色度PB以及每个Alpha PB进行帧内预测和帧间预测,以确定每个亮度PB对应的最优PB、每个色度PB对应的最优PB以及每个Alpha PB对应的最优PB。After dividing the PB, perform intra-frame prediction and inter-frame prediction on each luma PB, each chroma PB, and each Alpha PB to determine the optimal PB corresponding to each luma PB and the optimal PB corresponding to each chroma PB. Excellent PB and the optimal PB corresponding to each Alpha PB.
确定最优PB后,分别计算每个亮度PB与所述每个亮度PB对应的最优PB之间的残差信号、每个色度PB与所述每个色度PB对应的最优PB之间的残差信号以及每个Alpha PB与所述每个Alpha PB其对应的最优PB之间的残差信号。After determining the optimal PB, calculate the residual signal between each brightness PB and the optimal PB corresponding to each brightness PB, and the difference between each chroma PB and the optimal PB corresponding to each chroma PB and the residual signal between each Alpha PB and its corresponding optimal PB of each Alpha PB.
关于每个PB的最优预测模式的流程可描述为:基于一种模式选择判据,遍历可能候选模式,计算每种候选模式在当前判据下的编码代价,选择编码代价最小的候选模式作为最优预测模式。The process of the optimal prediction mode for each PB can be described as: Based on a mode selection criterion, traverse possible candidate modes, calculate the encoding cost of each candidate mode under the current criterion, and select the candidate mode with the smallest encoding cost as Optimal forecasting model.
经过预测处理后,得到预测块的残差信号,为了压缩残差信号的统计冗余,需要对残差信号进行变换处理和量化处理。在变换处理阶段,将亮度预测块对应的残差信号、色度预测块对应的残差信号和Alpha预测块对应的残差信号划分成多个变换单元TU,多个PU可以包括亮度变换块(Transform Block,TB)、色度变换块TB以及Alpha变换块TB,同时还包括相关的语法元素。然后分别对亮度TB、色度TB以及Alpha TB进行DCT变换处理和量化处理,获得亮度变换块对应的量化参数、色度变换块对应的量化参数以及Alpha变换块对应的量化参数。After the prediction process, the residual signal of the prediction block is obtained. In order to compress the statistical redundancy of the residual signal, the residual signal needs to be transformed and quantized. In the transform processing stage, the residual signal corresponding to the luma prediction block, the residual signal corresponding to the chroma prediction block and the residual signal corresponding to the Alpha prediction block are divided into multiple transform units TU, and the multiple PUs may include luma transform blocks ( Transform Block, TB), chroma transform block TB and Alpha transform block TB, and also includes related syntax elements. Then DCT transform processing and quantization processing are performed on the luma TB, chroma TB, and Alpha TB respectively to obtain the quantization parameters corresponding to the luma transform block, the quantization parameters corresponding to the chroma transform block, and the quantization parameters corresponding to the Alpha transform block.
示例性地,在分别计算出每个亮度PB与所述每个亮度PB对应的最优PB 之间的残差信号、每个色度PB与所述每个色度PB对应的最优PB之间的残差信号以及每个Alpha PB与所述每个Alpha PB对应的最优PB之间的残差信号之后,将根据多个亮度PB计算出的多个残差信号变换为多个亮度TB,将根据多个色度PB计算出的多个残差信号变换为多个色度TB,以及将根据多个Alpha PB计算出的多个残差信号变换为多个Alpha TB。Exemplarily, after calculating the residual signal between each luminance PB and the optimal PB corresponding to each luminance PB, each chroma PB and the optimal PB corresponding to each chroma PB, After the residual signal between each Alpha PB and the optimal PB corresponding to each Alpha PB, the multiple residual signals calculated according to multiple brightness PBs are transformed into multiple brightness TBs , converting multiple residual signals calculated according to multiple chroma PBs into multiple chrominance TBs, and transforming multiple residual signals calculated according to multiple Alpha PBs into multiple Alpha TBs.
得到TB后,分别对每个亮度TB、每个色度TB以及每个Alpha TB进行离散余弦变换处理和量化处理,获得每个亮度TB对应的量化参数、每个色度TB对应的量化参数以及每个Alpha TB对应的量化参数。After the TB is obtained, discrete cosine transform processing and quantization processing are performed on each luma TB, each chroma TB, and each Alpha TB, respectively, to obtain quantization parameters corresponding to each luma TB, quantization parameters corresponding to each chroma TB, and Quantization parameters corresponding to each Alpha TB.
其中,变换处理和量化处理的流程可以为:对TB进行DCT变换,得到直流(Direct Current,DC)系数和交流(Alternating Current,AC)系数,然后对DC系数进行哈达玛积(Hadamard)变换,然后对变换后的DC系数和AC系数进行量化。量化是通过多对一的映射,降低比特率。主要有均匀量化、非均匀量化和自适应量化等。根据最优量化器设计准则:最佳量化区间的边界值为相邻两个最佳量化值的平均数,最佳量化值为所在量化区间的均值。Wherein, the process of transformation processing and quantization processing can be as follows: DCT transformation is performed on TB to obtain direct current (Direct Current, DC) coefficients and alternating current (Alternating Current, AC) coefficients, and then the DC coefficients are subjected to Hadamard product (Hadamard) transformation, The transformed DC and AC coefficients are then quantized. Quantization reduces the bit rate through many-to-one mapping. There are mainly uniform quantization, non-uniform quantization and adaptive quantization. According to the optimal quantizer design criterion: the boundary value of the optimal quantization interval is the average of two adjacent optimal quantization values, and the optimal quantization value is the mean value of the quantization interval.
在熵编码处理阶段,通过对亮度TB对应的量化参数、色度TB对应的量化参数以及Alpha TB对应的量化参数进行熵编码,从而将熵编码后的结果以比特流的形式输出。本实施例在熵编码阶段产生的熵编码语法中也增加了对Alpha数据的描述性语句,以保证解码端可以正确解码还原alpha数据。In the entropy encoding processing stage, entropy encoding is performed on the quantization parameters corresponding to luma TB, quantization parameters corresponding to chroma TB, and quantization parameters corresponding to Alpha TB, so that the result of entropy encoding is output in the form of bit stream. In this embodiment, descriptive sentences for Alpha data are also added to the entropy coding syntax generated in the entropy coding stage, so as to ensure that the decoding end can correctly decode and restore the alpha data.
在一种示例中,熵编码语法中可以包括:包含Alpha分量的序列参数集(Sequence Paramater Set,sps),如下表所示:In an example, the entropy coding syntax may include: a sequence parameter set (Sequence Paramater Set, sps) including an Alpha component, as shown in the following table:
Figure PCTCN2022113182-appb-000001
Figure PCTCN2022113182-appb-000001
“enable_alpha_flag”就是新增的关于Alpha数据的sps。"enable_alpha_flag" is the new sps about Alpha data.
在另一种示例中,熵编码语法中还可以包括:包含Alpha分量的残差熵语法,新增的Alpha分量的残差熵语法如下表所示:In another example, the entropy encoding syntax may further include: a residual entropy syntax including an Alpha component, and the newly added residual entropy syntax of the Alpha component is shown in the following table:
Figure PCTCN2022113182-appb-000002
Figure PCTCN2022113182-appb-000002
Figure PCTCN2022113182-appb-000003
Figure PCTCN2022113182-appb-000003
Figure PCTCN2022113182-appb-000004
Figure PCTCN2022113182-appb-000004
上表中,“……”部分为相关技术中的熵编码语法,该熵编码语法中可以包括对色度数据、亮度数据的描述信息。In the above table, the "..." part is the entropy coding syntax in the related art, and the entropy coding syntax may include description information for chrominance data and luminance data.
在本实施例中,在对CU进行编码压缩时,将Alpha数据与YUV数据同步编码压缩,Alpha数据保持了和YUV数据一样的压缩率,保证了Alpha数据与YUV数据同步性的同时,降低了Alpha数据的带宽占用,从而提高视频的压缩效率。In this embodiment, when encoding and compressing the CU, the Alpha data and the YUV data are encoded and compressed synchronously. The bandwidth occupation of Alpha data, thereby improving the compression efficiency of the video.
实施例二Embodiment two
图2为本申请实施例二提供的一种视频解码的方法实施例的流程图,本实施例可以用于对包含阿尔法数据的视频码流进行解码的场景。可以包括如下步骤:FIG. 2 is a flowchart of a video decoding method embodiment provided in Embodiment 2 of the present application. This embodiment can be used in a scenario where a video code stream containing alpha data is decoded. May include the following steps:
步骤210,接收视频帧的待解码视频码流,所述待解码视频码流中包括亮度比特流、色度比特流、Alpha比特流以及相关语法元素。 Step 210, receiving a video code stream of a video frame to be decoded, the video code stream to be decoded includes a luma bit stream, a chrominance bit stream, an Alpha bit stream and related syntax elements.
步骤220,根据所述相关语法元素,分别对所述亮度比特流、色度比特流、Alpha比特流进行解码,获得包含亮度数据、色度数据以及Alpha数据的重建视频帧。Step 220: Decode the luminance bit stream, chrominance bit stream, and Alpha bit stream respectively according to the relevant syntax elements to obtain reconstructed video frames including luminance data, chrominance data, and Alpha data.
视频解码的流程和编码流程正好相反,在进行解码时,首先对码流进行熵解码,得到扫描后的量化系数,再经过反扫描、反量化和反变换,得到解码后的残差系数,然后经过运动补偿得到解码的重建图像,该重建图像包括亮度数据、色度数据以及Alpha数据。The video decoding process is exactly the opposite of the encoding process. When decoding, the code stream is first entropy decoded to obtain the quantized coefficients after scanning, and then through inverse scanning, inverse quantization and inverse transformation to obtain the decoded residual coefficients, and then A decoded reconstructed image is obtained through motion compensation, and the reconstructed image includes luminance data, chrominance data and Alpha data.
解码器输出包含亮度数据、色度数据以及Alpha数据的视频帧以后,可以由显示装置或者后处理部分将亮度数据以及色度数据转换成RGB数据,然后将 RGB数据与Alpha数据结合成RGBA数据显示给用户使用。After the decoder outputs video frames containing luminance data, chrominance data and Alpha data, the display device or post-processing part can convert the luminance data and chrominance data into RGB data, and then combine the RGB data and Alpha data into RGBA data display for users to use.
在本实施例中,通过对包括亮度比特流、色度比特流、Alpha比特流以及相关语法元素的视频码流进行解码,可以获得码流中的Alpha数据,便于后续进行后续背景剔除、Alpha混合处理以及模板处理等。In this embodiment, by decoding the video code stream including luminance bit stream, chrominance bit stream, Alpha bit stream and related syntax elements, the Alpha data in the code stream can be obtained, which is convenient for subsequent background removal and Alpha mixing. processing and template processing etc.
实施例三Embodiment three
图3为本申请实施例三提供的一种视频编码的装置实施例的结构框图,可以包括如下模块:CU划分模块310,设置为将包含亮度分量、色度分量以及阿尔法Alpha分量的视频帧划分成多个编码单元CU,其中,所述多个CU包括亮度编码块、色度编码块及阿尔法Alpha编码块;CU编码模块320,设置为分别对所述亮度编码块、所述色度编码块和所述Alpha编码块进行编码压缩处理,并将编码压缩结果以及相关语法元素输入至码流进行传输,所述相关语法元素包括与所述Alpha编码块对应的语法元素。Fig. 3 is a structural block diagram of a video encoding device embodiment provided in Embodiment 3 of the present application, which may include the following modules: CU division module 310, configured to divide video frames containing luminance components, chrominance components, and alpha Alpha components into a plurality of coding units CU, wherein the plurality of CUs include a luma coding block, a chrominance coding block, and an Alpha Alpha coding block; Perform encoding and compression processing with the Alpha encoding block, and input the encoding and compression result and related syntax elements into a code stream for transmission, and the related syntax elements include syntax elements corresponding to the Alpha encoding block.
在一种实施例中,所述编码压缩处理包括预测处理,所述CU编码模块320可以包括如下子模块:预测处理子模块,设置为将所述多个CU划分成多个预测单元PU,所述多个PU包括亮度预测块、色度预测块以及Alpha预测块;分别对所述亮度预测块、所述色度预测块以及所述Alpha预测块进行帧内预测和帧间预测,以确定所述亮度预测块对应的最优预测块、所述色度预测块对应的最优预测块以及所述Alpha预测块对应的最优预测块;分别计算所述亮度预测块与所述亮度预测块对应的最优预测块之间的残差信号、所述色度预测块与所述色度预测块对应的最优预测块之间的残差信号以及所述Alpha预测块与所述Alpha预测块对应的最优预测块之间的残差信号。In an embodiment, the encoding and compression processing includes prediction processing, and the CU encoding module 320 may include the following submodules: a prediction processing submodule configured to divide the multiple CUs into multiple prediction units PU, so that The plurality of PUs include a luma prediction block, a chroma prediction block, and an Alpha prediction block; intra-frame prediction and inter-frame prediction are respectively performed on the luma prediction block, the chroma prediction block, and the Alpha prediction block to determine the The optimal prediction block corresponding to the luminance prediction block, the optimal prediction block corresponding to the chroma prediction block, and the optimal prediction block corresponding to the Alpha prediction block; The residual signal between the optimal prediction block, the residual signal between the chroma prediction block and the optimal prediction block corresponding to the chroma prediction block, and the Alpha prediction block corresponding to the Alpha prediction block The residual signal between optimally predicted blocks of .
在一种实施例中,所述编码压缩处理还包括变换量化处理;所述CU编码模块320可以包括如下子模块:变换量化子模块,设置为将亮度预测块对应的残差信号、色度预测块对应的残差信号和Alpha预测块对应的残差信号划分成多个变换单元TU,所述多个TU包括亮度变换块、色度变换块以及Alpha变换块;分别对所述亮度变换块、色度变换块以及Alpha变换块进行DCT变换处理和量化处理,获得亮度变换块对应的量化参数、色度变换块对应的量化参数以及Alpha变换块对应的量化参数。In one embodiment, the encoding and compression processing further includes transform and quantization processing; the CU encoding module 320 may include the following submodules: a transform and quantization submodule, configured to convert the residual signal corresponding to the luma prediction block, the chroma prediction The residual signal corresponding to the block and the residual signal corresponding to the Alpha prediction block are divided into a plurality of transformation units TU, and the plurality of TUs include a luma transformation block, a chrominance transformation block, and an Alpha transformation block; The chroma transform block and the Alpha transform block perform DCT transform processing and quantization processing to obtain quantization parameters corresponding to the luma transform block, quantization parameters corresponding to the chroma transform block, and quantization parameters corresponding to the Alpha transform block.
在一种实施例中,所述编码压缩处理还包括熵编码处理;所述CU编码模块320可以包括如下子模块:熵编码子模块,设置为对所述亮度变换块对应的量化参数、色度变换块对应的量化参数以及Alpha变换块对应的量化参数进行熵编码,并将熵编码后的结果以比特流的形式输出。In one embodiment, the encoding and compression processing further includes entropy encoding processing; the CU encoding module 320 may include the following submodules: an entropy encoding submodule, configured to perform quantization parameters corresponding to the luma transformation block, chrominance The quantization parameters corresponding to the transform block and the quantization parameters corresponding to the Alpha transform block are entropy encoded, and the entropy encoded result is output in the form of a bit stream.
在一种实施例中,所述相关语法元素包括熵编码阶段产生的熵编码语法;所述熵编码语法包括:包含Alpha分量的序列参数,以及包含Alpha分量的残差熵语法。In an embodiment, the relevant syntax elements include entropy coding syntax generated in the entropy coding stage; the entropy coding syntax includes: a sequence parameter including an Alpha component, and a residual entropy syntax including an Alpha component.
在一种实施例中,所述装置还包括视频帧获取模块,设置为从待编码的RGBA图像格式的视频帧中提取出所述视频帧中的RGB数据以及Alpha数据;将所述RGB数据转换成YUV数据;将所述Alpha数据嵌入所述YUV数据中,生成包含亮度分量、色度分量以及阿尔法Alpha分量的视频帧。In one embodiment, the device also includes a video frame acquisition module, configured to extract the RGB data and Alpha data in the video frame from the video frame of the RGBA image format to be encoded; convert the RGB data into YUV data; embedding the Alpha data in the YUV data to generate a video frame comprising a brightness component, a chrominance component and an Alpha Alpha component.
需要说明的是,本申请实施例所提供的上述一种视频编码的装置可执行本申请实施例一所提供的一种视频编码的方法,具备执行方法相应的功能模块和效果。It should be noted that the above-mentioned video coding device provided in the embodiment of the present application can execute the video coding method provided in the first embodiment of the present application, and has corresponding functional modules and effects for executing the method.
实施例四Embodiment four
图4为本申请实施例四提供的一种视频解码的装置实施例的结构框图,可以包括如下模块:码流接收模块410,设置为接收视频帧的待解码视频码流,所述待解码视频码流中包括亮度比特流、色度比特流、阿尔法Alpha比特流以及相关语法元素;解码模块420,设置为根据所述相关语法元素,分别对所述亮度比特流、色度比特流、Alpha比特流进行解码,获得包含亮度数据、色度数据以及Alpha数据的重建视频帧。FIG. 4 is a structural block diagram of a video decoding device embodiment provided in Embodiment 4 of the present application, which may include the following modules: a code stream receiving module 410, configured to receive a video code stream of a video frame to be decoded, and the video code stream to be decoded The code stream includes a luminance bit stream, a chrominance bit stream, an Alpha Alpha bit stream, and related syntax elements; the decoding module 420 is configured to, respectively, perform operations on the luminance bit stream, the chrominance bit stream, and the Alpha bit stream according to the related syntax elements. The stream is decoded to obtain a reconstructed video frame including luminance data, chrominance data, and Alpha data.
需要说明的是,本申请实施例所提供的上述一种视频解码的装置可执行本申请实施例二所提供的一种视频解码的方法,具备执行方法相应的功能模块和效果。It should be noted that the above-mentioned video decoding device provided in the embodiment of the present application can execute the video decoding method provided in the second embodiment of the present application, and has corresponding functional modules and effects for executing the method.
实施例五Embodiment five
图5为本申请实施例五提供的一种电子设备的结构示意图,如图5所示,该电子设备包括处理器510、存储器520、输入装置530和输出装置540;电子设备中处理器510的数量可以是一个或多个,图5中以一个处理器510为例;电子设备中的处理器510、存储器520、输入装置530和输出装置540可以通过总线或其他方式连接,图5中以通过总线连接为例。FIG. 5 is a schematic structural diagram of an electronic device provided in Embodiment 5 of the present application. As shown in FIG. 5 , the electronic device includes a processor 510, a memory 520, an input device 530, and an output device 540; The quantity can be one or more, and a processor 510 is taken as an example in FIG. Take the bus connection as an example.
存储器520作为一种计算机可读存储介质,可设置为存储软件程序、计算机可执行程序以及模块,如本申请实施例中的方法对应的程序指令/模块。处理器510通过运行存储在存储器520中的软件程序、指令以及模块,从而执行电子设备的多种功能应用以及数据处理,即实现上述的方法。The memory 520, as a computer-readable storage medium, can be configured to store software programs, computer-executable programs and modules, such as program instructions/modules corresponding to the methods in the embodiments of the present application. The processor 510 executes various functional applications and data processing of the electronic device by running software programs, instructions and modules stored in the memory 520 , that is, implements the above-mentioned method.
存储器520可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据终端的使用所创建的数据等。此外,存储器520可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实例中,存储器520可包括相对于处理器510远程设置的存储器,这些远程存储器可以通过网络连接至电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 520 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application program required by at least one function; the data storage area may store data created according to the use of the terminal, and the like. In addition, the memory 520 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage devices. In some examples, memory 520 may include memory located remotely from processor 510, and such remote memory may be connected to the electronic device through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
输入装置530可设置为接收输入的数字或字符信息,以及产生与电子设备的用户设置以及功能控制有关的键信号输入。输出装置540可包括显示屏等显示设备。The input device 530 can be configured to receive input numbers or character information, and generate key signal input related to user settings and function control of the electronic device. The output device 540 may include a display device such as a display screen.
实施例六Embodiment six
本申请实施例六还提供一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由服务器的处理器执行时用于执行本申请任一实施例中的方法。Embodiment 6 of the present application further provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute the method in any embodiment of the present application when executed by a processor of the server.
通过以上关于实施方式的描述,所属领域的技术人员可以清楚地了解到,本申请可借助软件及通用硬件来实现,当然也可以通过硬件实现。基于这样的理解,本申请的技术方案可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如计算机的软盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、闪存(FLASH)、硬盘或光盘等,包括至少一个指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请多个实施例所述的方法。Through the above description about the implementation manners, those skilled in the art can clearly understand that the present application can be implemented by means of software and general hardware, and of course can also be implemented by means of hardware. Based on this understanding, the technical solution of the present application can be embodied in the form of software products, and the computer software products can be stored in computer-readable storage media, such as computer floppy disks, read-only memory (Read-Only Memory, ROM), Random access memory (Random Access Memory, RAM), flash memory (FLASH), hard disk or optical disc, etc., including at least one instruction to make a computer device (which can be a personal computer, server, or network device, etc.) execute multiple The method described in an example.
上述装置的实施例中,所包括的多个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,多个功能单元的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。In the embodiment of the above-mentioned device, the multiple units and modules included are only divided according to the functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the specific names of the multiple functional units It is only for the convenience of distinguishing each other, and is not used to limit the protection scope of the present application.

Claims (11)

  1. 一种视频编码的方法,包括:A method of video encoding, comprising:
    将包含亮度分量、色度分量以及阿尔法Alpha分量的视频帧划分成多个编码单元CU,其中,所述多个CU包括亮度编码块、色度编码块及Alpha编码块;Divide a video frame comprising a luma component, a chrominance component, and an alpha Alpha component into a plurality of coding units CU, wherein the plurality of CUs include a luma encoding block, a chrominance encoding block, and an Alpha encoding block;
    分别对所述亮度编码块、所述色度编码块和所述Alpha编码块进行编码压缩处理,并将编码压缩结果以及相关语法元素输入至码流进行传输,所述相关语法元素包括与所述Alpha编码块对应的语法元素。Perform encoding and compression processing on the luma encoding block, the chrominance encoding block, and the Alpha encoding block, and input the encoding and compression results and related syntax elements into a code stream for transmission, and the related syntax elements include the The syntax element corresponding to the Alpha code block.
  2. 根据权利要求1所述的方法,其中,所述编码压缩处理包括预测处理,所述分别对所述亮度编码块、所述色度编码块和所述Alpha编码块进行编码压缩处理,包括:The method according to claim 1, wherein the encoding and compression processing includes prediction processing, and performing encoding and compression processing on the brightness encoding block, the chrominance encoding block and the Alpha encoding block respectively includes:
    将所述多个CU划分成多个预测单元PU,所述多个PU包括亮度预测块、色度预测块以及Alpha预测块;dividing the plurality of CUs into a plurality of prediction units PU, the plurality of PUs including a luma prediction block, a chroma prediction block, and an Alpha prediction block;
    分别对所述亮度预测块、所述色度预测块以及所述Alpha预测块进行帧内预测和帧间预测,以确定所述亮度预测块对应的最优预测块、所述色度预测块对应的最优预测块以及所述Alpha预测块对应的最优预测块;Intra-frame prediction and inter-frame prediction are respectively performed on the luma prediction block, the chroma prediction block, and the Alpha prediction block, so as to determine the optimal prediction block corresponding to the luma prediction block and the corresponding optimal prediction block of the chroma prediction block. The optimal prediction block of and the optimal prediction block corresponding to the Alpha prediction block;
    分别计算所述亮度预测块与所述亮度预测块对应的最优预测块之间的残差信号、所述色度预测块与所述色度预测块对应的最优预测块之间的残差信号以及所述Alpha预测块与所述Alpha预测块对应的最优预测块之间的残差信号。respectively calculating the residual signal between the luma prediction block and the optimal prediction block corresponding to the luma prediction block, and the residual error between the chroma prediction block and the optimal prediction block corresponding to the chroma prediction block signal and a residual signal between the Alpha prediction block and the optimal prediction block corresponding to the Alpha prediction block.
  3. 根据权利要求2所述的方法,其中,所述编码压缩处理还包括变换量化处理;The method according to claim 2, wherein said encoding and compression processing further comprises transform and quantization processing;
    在分别计算所述亮度预测块与所述亮度预测块对应的最优预测块之间的残差信号、所述色度预测块与所述色度预测块对应的最优预测块之间的残差信号以及所述Alpha预测块与所述Alpha预测块对应的最优预测块之间的残差信号之后,还包括:respectively calculating the residual signal between the luma prediction block and the optimal prediction block corresponding to the luma prediction block, the residual signal between the chroma prediction block and the optimal prediction block corresponding to the chroma prediction block After the difference signal and the residual signal between the Alpha prediction block and the optimal prediction block corresponding to the Alpha prediction block, it also includes:
    将所述亮度预测块对应的残差信号、所述色度预测块对应的残差信号和所述Alpha预测块对应的残差信号划分成多个变换单元TU,所述多个TU包括亮度变换块、色度变换块以及Alpha变换块;Divide the residual signal corresponding to the luma prediction block, the residual signal corresponding to the chroma prediction block and the residual signal corresponding to the Alpha prediction block into a plurality of transform units TU, the plurality of TUs including luma transform block, chroma transform block, and alpha transform block;
    分别对所述亮度变换块、色度变换块以及Alpha变换块进行离散余弦变换处理和量化处理,获得所述亮度变换块对应的量化参数、色度变换块对应的量化参数以及Alpha变换块对应的量化参数。Perform discrete cosine transform processing and quantization processing on the luma transform block, chroma transform block, and Alpha transform block, respectively, to obtain quantization parameters corresponding to the luma transform block, quantization parameters corresponding to the chroma transform block, and alpha transform block corresponding quantization parameters.
  4. 根据权利要求3所述的方法,其中,所述编码压缩处理还包括熵编码处理;The method according to claim 3, wherein the encoding compression process further comprises an entropy encoding process;
    在获得所述亮度变换块对应的量化参数、色度变换块对应的量化参数以及Alpha变换块对应的量化参数之后,还包括:对所述亮度变换块对应的量化参数、所述色度变换块对应的量化参数以及所述Alpha变换块对应的量化参数进行熵编码,并将熵编码后的结果以比特流的形式输出。After obtaining the quantization parameter corresponding to the luma transformation block, the quantization parameter corresponding to the chroma transformation block, and the quantization parameter corresponding to the Alpha transformation block, it further includes: the quantization parameter corresponding to the luma transformation block, the chroma transformation block Entropy encoding is performed on the corresponding quantization parameters and the quantization parameters corresponding to the Alpha transformation block, and the entropy encoding result is output in the form of a bit stream.
  5. 根据权利要求4所述的方法,其中,所述相关语法元素包括熵编码阶段产生的熵编码语法;所述熵编码语法包括:包含Alpha分量的序列参数,以及包含Alpha分量的残差熵语法。The method according to claim 4, wherein the relevant syntax elements include entropy coding syntax generated in the entropy coding stage; the entropy coding syntax includes: sequence parameters including Alpha components, and residual entropy syntax including Alpha components.
  6. 根据权利要求1-5任一项所述的方法,其中,所述包含亮度分量、色度分量以及Alpha分量的视频帧采用如下方式获得:The method according to any one of claims 1-5, wherein the video frame comprising a luminance component, a chrominance component and an Alpha component is obtained in the following manner:
    从待编码的RGBA图像格式的视频帧中提取出所述视频帧中的RGB数据以及Alpha数据;Extract RGB data and Alpha data in the video frame from the video frame of the RGBA image format to be encoded;
    将所述RGB数据转换成YUV数据;Converting the RGB data into YUV data;
    将所述Alpha数据嵌入所述YUV数据中,生成包含亮度分量、色度分量以及阿尔法Alpha分量的视频帧。Embedding the Alpha data into the YUV data to generate a video frame including a brightness component, a chrominance component, and an Alpha component.
  7. 一种视频解码的方法,包括:A method for video decoding, comprising:
    接收视频帧的待解码视频码流,所述待解码视频码流中包括亮度比特流、色度比特流、阿尔法Alpha比特流以及相关语法元素;Receiving a video code stream of a video frame to be decoded, the video code stream to be decoded includes a luma bit stream, a chrominance bit stream, an Alpha Alpha bit stream and related syntax elements;
    根据所述相关语法元素,分别对所述亮度比特流、色度比特流、Alpha比特流进行解码,获得包含亮度数据、色度数据以及Alpha数据的重建视频帧。Decode the luminance bit stream, chrominance bit stream, and Alpha bit stream respectively according to the relevant syntax elements to obtain reconstructed video frames including luminance data, chrominance data, and Alpha data.
  8. 一种视频编码的装置,包括:A device for video encoding, comprising:
    CU划分模块,设置为将包含亮度分量、色度分量以及阿尔法Alpha分量的视频帧划分成多个编码单元CU,其中,所述多个CU包括亮度编码块、色度编码块及Alpha编码块;A CU division module configured to divide a video frame comprising a luma component, a chrominance component, and an alpha Alpha component into a plurality of coding units CU, wherein the plurality of CUs include a luma encoding block, a chrominance encoding block, and an Alpha encoding block;
    CU编码模块,设置为分别对所述亮度编码块、所述色度编码块和所述Alpha编码块进行编码压缩处理,并将编码压缩结果以及相关语法元素输入至码流进行传输,所述相关语法元素包括与所述Alpha编码块对应的语法元素。The CU encoding module is configured to perform encoding and compression processing on the luminance encoding block, the chrominance encoding block and the Alpha encoding block respectively, and input the encoding and compression results and related syntax elements into a code stream for transmission, and the related The syntax elements include syntax elements corresponding to the Alpha coding block.
  9. 一种视频解码的装置,装置包括:A video decoding device, the device comprising:
    码流接收模块,设置为接收视频帧的待解码视频码流,所述待解码视频码流中包括亮度比特流、色度比特流、阿尔法Alpha比特流以及相关语法元素;The code stream receiving module is configured to receive the video code stream of the video frame to be decoded, the video code stream to be decoded includes a luma bit stream, a chrominance bit stream, an Alpha Alpha bit stream and related syntax elements;
    解码模块,设置为根据所述相关语法元素,分别对所述亮度比特流、色度比特流、Alpha比特流进行解码,获得包含亮度数据、色度数据以及Alpha数据的重建视频帧。The decoding module is configured to decode the luminance bit stream, chrominance bit stream, and Alpha bit stream respectively according to the relevant syntax elements, to obtain reconstructed video frames including luminance data, chrominance data, and Alpha data.
  10. 一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如权利要求1-7中任一所述的方法。An electronic device, comprising a memory, a processor, and a computer program stored in the memory and operable on the processor, when the processor executes the program, the method according to any one of claims 1-7 is implemented.
  11. 一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如权利要求1-7任一所述的方法。A computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the method according to any one of claims 1-7 is implemented.
PCT/CN2022/113182 2021-08-20 2022-08-18 Video coding and decoding method and apparatus, electronic device and storage medium WO2023020560A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110962461.7A CN113613008A (en) 2021-08-20 2021-08-20 Video encoding and decoding method and device, electronic equipment and storage medium
CN202110962461.7 2021-08-20

Publications (1)

Publication Number Publication Date
WO2023020560A1 true WO2023020560A1 (en) 2023-02-23

Family

ID=78341516

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/113182 WO2023020560A1 (en) 2021-08-20 2022-08-18 Video coding and decoding method and apparatus, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN113613008A (en)
WO (1) WO2023020560A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116248895A (en) * 2023-05-06 2023-06-09 上海扬谷网络科技有限公司 Video cloud transcoding method and system for virtual reality panorama roaming

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113613008A (en) * 2021-08-20 2021-11-05 百果园技术(新加坡)有限公司 Video encoding and decoding method and device, electronic equipment and storage medium
CN115396730A (en) * 2022-07-21 2022-11-25 广州方硅信息技术有限公司 Video image processing method, computer device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050117789A1 (en) * 2003-11-21 2005-06-02 Samsung Electronics Co., Ltd. Apparatus and method for generating coded block pattern for alpha channel image and alpha channel image encoding/decoding apparatus and method using the same
US20090284651A1 (en) * 2008-05-19 2009-11-19 Microsoft Corporation Quantization and differential coding of alpha image data
CN105359521A (en) * 2013-06-28 2016-02-24 黑莓有限公司 Methods and devices for emulating low-fidelity coding in a high-fidelity coder
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

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005151207A (en) * 2003-11-17 2005-06-09 Canon Inc Image-coding method
KR100682929B1 (en) * 2004-03-05 2007-02-15 삼성전자주식회사 Apparatus and method of encoding/decoding image having gray alpha channel
EP1571850A3 (en) * 2004-03-05 2006-12-13 Samsung Electronics Co., Ltd. Apparatus and method for encoding and decoding image containing grayscale alpha channel image
JP4529615B2 (en) * 2004-09-24 2010-08-25 ソニー株式会社 Encoding apparatus, encoding method, encoding method program, and recording medium recording the encoding method program
CN101742317B (en) * 2009-12-31 2012-03-28 北京中科大洋科技发展股份有限公司 Video compressing and encoding method with alpha transparent channel
KR101830352B1 (en) * 2011-11-09 2018-02-21 에스케이 텔레콤주식회사 Method and Apparatus Video Encoding and Decoding using Skip Mode
US9986259B2 (en) * 2013-07-18 2018-05-29 Lg Electronics Inc. Method and apparatus for processing video signal
CN106375759B (en) * 2016-08-31 2018-03-02 深圳超多维科技有限公司 A kind of coding and decoding method and device of vedio data
US10165300B2 (en) * 2016-10-28 2018-12-25 Blackberry Limited 3D transform and inter prediction for video coding
CN108471536B (en) * 2018-03-14 2021-04-06 重庆虚拟实境科技有限公司 Alpha channel transmission method and device, terminal device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050117789A1 (en) * 2003-11-21 2005-06-02 Samsung Electronics Co., Ltd. Apparatus and method for generating coded block pattern for alpha channel image and alpha channel image encoding/decoding apparatus and method using the same
US20090284651A1 (en) * 2008-05-19 2009-11-19 Microsoft Corporation Quantization and differential coding of alpha image data
CN105359521A (en) * 2013-06-28 2016-02-24 黑莓有限公司 Methods and devices for emulating low-fidelity coding in a high-fidelity coder
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

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116248895A (en) * 2023-05-06 2023-06-09 上海扬谷网络科技有限公司 Video cloud transcoding method and system for virtual reality panorama roaming
CN116248895B (en) * 2023-05-06 2023-07-21 上海扬谷网络科技有限公司 Video cloud transcoding method and system for virtual reality panorama roaming

Also Published As

Publication number Publication date
CN113613008A (en) 2021-11-05

Similar Documents

Publication Publication Date Title
CN108028919B (en) Video or image coding and decoding method and device
JP7271683B2 (en) Encoders, decoders and corresponding intra-prediction methods
WO2023020560A1 (en) Video coding and decoding method and apparatus, electronic device and storage medium
US10038908B2 (en) Palette mode in high efficiency video coding (HEVC) screen content coding (SCC)
KR102071764B1 (en) Picture coding and decoding methods and devices
JP2017538381A (en) Inter-component prediction in video coding.
TWI739042B (en) A method for encoding video
CN113574894B (en) Video decoding method, video decoder, computer device, and medium
CN117998085A (en) Video coding method, device and storage medium
KR20070009486A (en) Method and apparatus for encoding and decoding image
CN107483942B (en) Decoding method of video data compressed code stream, encoding method and device of video data
CN112995664B (en) Image sampling format conversion method, computer-readable storage medium, and encoder
CN110999295A (en) Improvement of boundary forced partition
WO2023040600A1 (en) Image encoding method and apparatus, image decoding method and apparatus, electronic device, and medium
KR20130089461A (en) Method and apparatus for image encoding based on region characteristics, method and apparatus for image decoding based on region characteristics
CN117478915A (en) Encoder, decoder and corresponding methods for constructing MPM list of block applying multi-hypothesis prediction
CN113660489B (en) Decoding method, apparatus, decoder and storage medium for intra sub-division
JP7251882B2 (en) Efficient method of signaling the CBF flag
JP2023162243A (en) Encoder, decoder, and corresponding method using high-level flag with dct2 enabled
WO2021135856A1 (en) Video coding method and apparatus, video decoding method and apparatus, device, and storage medium
CN108574845B (en) Data compression method and device dynamically adopting multiple sampling formats
CN104918050A (en) Image compression method of reference pixel sample value set using dynamic arrangement recombination
KR102657540B1 (en) An encoder, a decoder, and corresponding methods that are used for transform process
CN114846789A (en) Decoder for indicating image segmentation information of a slice and corresponding method
CN108989820B (en) Data compression method and device adopting respective corresponding chroma sampling formats at all stages

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22857871

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE