Coding method, decoding method and related device

By performing frequency domain de-redundancy coding on frames between GOPs and performing secondary coding and compression based on the similarity of frame types, the problem of excessive redundant information in existing video coding standards is solved, achieving more efficient coding results.

WO2025200776A1PCT designated stage Publication Date: 2025-10-02HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/075405
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-27
Filing Date
2025-01-27
Publication Date
2025-10-02

AI Technical Summary

Technical Problem

Existing video coding standards still contain a large amount of redundant information after compressing video content, resulting in transmission and storage burdens.

Method used

Frequency domain de-redundancy coding is performed on frames between GOPs, and secondary coding and compression are performed using the similarity of frames of the same type, including inter-frame prediction coding of I frames and reference-based secondary compression of P/B frames, to reduce the time domain correlation within and between frames.

Benefits of technology

Effectively reduce redundant information in video content, improve encoding efficiency, reduce bitrate size, and enhance encoding effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025075405_02102025_PF_FP_ABST
    Figure CN2025075405_02102025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present application are a coding method, a decoding method and a related device. The method comprises: acquiring a first video bitstream, wherein the first video bitstream comprises at least two groups of pictures (GOPs), and the at least two GOPs comprise a first GOP and a second GOP; and on the basis of a first frame of the first GOP, coding a second frame of the second GOP to obtain a second video bitstream, wherein the first frame and the second frame are of the same type, and the position of the first frame in the first GOP corresponds to the position of the second frame in the second GOP. In the method, reference compression is performed by means of corresponding frames across GOPs, thereby completing frequency-domain redundancy removal. Moreover, the method can be combined with existing compression schemes for reuse, thereby achieving a higher gain.
Need to check novelty before this filing date? Find Prior Art

Description

A coding method, a decoding method and related equipment

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 27, 2024, with application number 202410371376.7 and application name “A coding method, a decoding method and related equipment”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The embodiments of the present application relate to the field of coding and decoding, and in particular to a coding method, a decoding method and related devices. Background Art

[0003] In recent years, video content has become a major component of Internet traffic. Video compression is crucial for video storage and transmission within limited Internet bandwidth. However, the data volume of video content is still enormous, creating a transmission and storage burden.

[0004] Traditional video coding standards, such as Advanced Video Coding (AVC), High Efficiency Video Coding (HEVC), and Versatile Video Coding (VVC), are all manually designed based on block segmentation, inter-frame prediction, and linear transformation. Furthermore, the resulting bitstream after compressing the video content still contains a large amount of redundant information.

[0005] Therefore, how to reduce redundant information in video content is of great significance. Summary of the Invention

[0006] The present invention provides an encoding method, a decoding method, and related devices that implement frequency domain redundancy removal by matching frames between groups of pictures (GOPs). These methods can be combined with existing compression schemes to achieve higher performance.

[0007] In a first aspect, the present application provides an encoding method, which is executed by an encoding device, or the method is executed by some components in the encoding device (such as a processor, a chip or a chip system, etc.), or the method can also be implemented by a logic module or software that can realize all or part of the functions of the encoding device. In the first aspect and its possible implementation, the method is described as being executed by an encoding device. In this method, the encoding device obtains a first video stream, the first video stream includes at least two GOPs, and the at least two GOPs include a first GOP and a second GOP (wherein, the image frame in the first GOP can be called a first frame, and the image frame in the second GOP can be called a second frame, and the number of the first frame and the second frame can be one or more); the encoding device encodes at least one second frame of the second GOP based on at least one first frame of the first GOP to obtain a second video stream. Wherein, the first frame and the second frame are of the same type, and the position of the first frame in the first GOP corresponds to the position of the second frame in the second GOP.

[0008] Based on the above scheme, on the one hand, the second frame of the second GOP is compressed using the first frame in the first GOP to achieve frequency domain redundancy removal. This can also be superimposed and multiplexed with existing compression schemes to achieve higher returns. Furthermore, redundancy removal is performed on corresponding frames between GOPs, leveraging the similarity of encoding results for corresponding frame types. Intra-coded frames (I frames) corresponding between segments undergo secondary encoding similar to inter-frame prediction coding to remove temporal correlations between corresponding intra-coded frames between GOPs. Inter-coded frames (P / B frames) corresponding between segments undergo secondary reference-based compression to further reduce data redundancy in inter-coded frames.

[0009] Optionally, in a possible implementation of the first aspect, the step of encoding at least one second frame of a second GOP based on at least one first frame of a first GOP to obtain a second video stream includes: obtaining first discrete cosine transform (DCT) data based on at least one first frame of the first GOP; obtaining second DCT data based on at least one second frame of the second GOP; determining differential DCT data of the second frame based on the first DCT data and the second DCT data, wherein the differential DCT data of the second frame is used to indicate the difference between the second DCT data and the first DCT data; and encoding the differential DCT data to obtain the second video stream. Furthermore, to improve the encoding effect, quantization processing can also be performed. For example, after obtaining the first DCT data and the second DCT data, the first DCT data and the second DCT data can be quantized using the same quantization parameter, and the quantized first DCT data and the quantized second DCT data can be differentially processed to obtain the differential DCT data of the second frame.

[0010] In this possible implementation, differential processing can be performed based on the DCT data of corresponding frames between GOPs to remove redundancy. On the one hand, the decoded DCT data of the segmented video stream (i.e., the second GOP) is highly consistent with the decoded DCT data of the reference segmented video stream (i.e., the first GOP), resulting in sparser differential DCT data and lower information entropy, thereby resulting in a smaller bitrate after differential DCT encoding. On the other hand, segmented video stream de-redundancy is performed in the frequency domain, fully utilizing the DCT data's ability to describe spatial and temporal prediction residuals, avoiding the efficiency reduction problem of traditional video stream compression based on secondary encoding, which involves performing secondary compression in the quantized and reconstructed pixel domain after re-encoding.

[0011] Optionally, in a possible implementation manner of the first aspect, the above step of: obtaining first DCT data based on at least one first frame of the first GOP includes: decoding the first frame of the first GOP to obtain the first DCT data.

[0012] In this possible implementation, the first frame can be directly decoded to obtain the first DCT data, and then the reference DCT data can be obtained based on the first DCT data as a reference, that is, the DCT data of the segmented video stream (i.e., the second GOP) after decoding is highly consistent with the DCT data of the reference segmented video stream (i.e., the first GOP) after decoding, thereby obtaining sparser reference DCT data and lower information entropy, so that a smaller bit stream is obtained after encoding the reference DCT.

[0013] Optionally, in a possible implementation of the first aspect, the step of obtaining the first DCT data based on at least one first frame of the first GOP includes: re-encoding the first frame of the first GOP based on encoding parameters obtained by decoding a second frame of the second GOP; and decoding the re-encoded first frame to obtain the first DCT data. Re-encoding may also be understood as full encoding, specifically including predictive encoding and entropy encoding. Correspondingly, re-decoding may also be understood as full decoding, specifically including predictive decoding and entropy decoding.

[0014] In this possible implementation, the first frame is re-encoded by coding parameters, thereby realizing a frequency domain de-redundant video stream compression method by reusing coding parameters between video segments, and an efficient frequency domain de-redundant lossy coding framework can be constructed.

[0015] Optionally, to improve the encoding effect, quantization processing can also be performed during the encoding process. For example, after decoding the re-encoded first frame to obtain the first DCT data, the first DCT data and the second DCT data can be quantized using the same quantization parameter, and the quantized first DCT data and the quantized second DCT data can be differentially processed to obtain the differential DCT data of the second frame. In this case, the quantizer design based on the re-encoded DCT data is simple and efficient, and the segmented video stream can obtain similar quantization results using the same quantization parameter, resulting in a smaller amount of data after differential processing.

[0016] Optionally, in a possible implementation of the first aspect, the step of encoding the differential DCT data to obtain the second video stream includes: encoding the differential DCT data to obtain reference DCT data for the second frame; integrating the reference DCT data with the header information of the second frame to obtain the encoded second frame; integrating the encoded second frame with the header information of the second GOP to obtain the encoded second GOP; and obtaining the second video stream based on the first GOP and the encoded second GOP. For example, assuming the second GOP includes multiple frames, each frame is encoded according to the above method, and each second frame is spliced ​​and then combined with the header information of the second GOP to obtain the encoded second GOP. Assuming the video stream includes multiple GOPs, the encoded GOPs are spliced ​​to obtain the encoded second video stream.

[0017] In this possible implementation, on the one hand, the second frame of the second GOP is compressed using the first frame in the first GOP to achieve frequency domain redundancy removal. This can be superimposed and multiplexed with existing compression schemes to achieve higher returns. Furthermore, redundancy removal is performed on corresponding frames between GOPs, leveraging the similarity of encoding results for corresponding frame types. Intra-coded frames (I frames) corresponding between segments undergo secondary encoding similar to inter-frame prediction coding to remove temporal correlations between corresponding intra-coded frames between GOPs. Inter-coded frames (P / B frames) corresponding between segments undergo secondary reference-based compression to further reduce data redundancy in inter-coded frames.

[0018] Optionally, in a possible implementation manner of the first aspect, the first frame and the second frame are any one of the following types: a key frame (I frame), a forward prediction frame (P frame), or a bidirectional prediction frame (B frame).

[0019] In this possible implementation, redundancy is removed for corresponding frames between GOPs, utilizing the similarity of the encoding results of corresponding frame types; secondary encoding similar to inter-frame prediction encoding is performed on the corresponding intra-frame coded frames between segments to remove the time domain correlation between the corresponding intra-frame coded frames between GOPs; and reference-based secondary compression is performed on the corresponding inter-frame coded frames (P / B frames) between segments to further reduce data redundancy of the inter-frame coded frames.

[0020] Optionally, in a possible implementation manner of the first aspect, the above steps further include: splitting the first video stream based on GOP length to obtain at least two GOPs, and the lengths of different GOPs in the first video stream are the same.

[0021] In this possible implementation, the segmentation of the first video stream according to GOP, combined with the subsequent reference encoding of frames in the second GOP based on the first GOP, can fully exploit the correlation between GOPs and achieve further redundancy removal and compression effects.

[0022] In a second aspect, the present application provides a decoding method. The method is performed by a decoding device, or by some components of the decoding device (such as a processor, chip, or chip system), or the method can also be implemented by a logic module or software that can implement all or part of the functions of the decoding device. In the second aspect and its possible implementation, the method is described as being performed by a decoding device. In this method, the decoding device first obtains a second video stream, which includes at least two segments, including a first segment and a second segment. The decoding device then decodes at least one set of reference DCT data in the second segment based on at least one set of first discrete cosine transform (DCT) data in the first segment to obtain a first video stream. The reference DCT data is information in the second segment excluding header information. The position of the first DCT data in the first segment corresponds to the position of the reference DCT data in the second segment, and the type of the first DCT data corresponding to the first frame in the first segment is the same as the type of the reference DCT data corresponding to the second frame in the second segment.

[0023] Based on this solution, on the one hand, decoding can be performed using the DCT data between different segments of the code stream, thereby reducing the repeated decoding of redundant data. On the other hand, by performing reference decoding based on the DCT data of the corresponding frame in the second segment of the code stream based on the first segment of the code stream, the correlation between each GOP in the original video stream can be fully exploited, further reducing redundant decoding.

[0024] Optionally, in a possible implementation of the second aspect, the step of decoding reference DCT data of the second bitstream based on the first discrete cosine transform (DCT) data of the first bitstream to obtain the first video bitstream includes: obtaining first DCT data based on the first bitstream; obtaining reference DCT data based on the second bitstream; decoding the reference DCT data to obtain differential DCT data, the differential DCT data indicating the difference between the second DCT data and the first DCT data; adding the differential DCT data to the first DCT data to obtain second DCT data of the second frame; and encoding the second DCT data to obtain the first video bitstream. It is understood that if quantization is performed during encoding, dequantization is also required during decoding. For example, after decoding the first bitstream, the decoding device dequantizes the first DCT data. For another example, obtaining the second DCT data based on the differential DCT data and the first DCT data may include adding the first DCT data to the differential DCT data and dequantizing the result of the addition to obtain the second DCT data.

[0025] In this possible implementation, on the one hand, the second DCT data can be obtained based on the differential DCT data and the first DCT data. That is, during the decoding process, the second DCT data of the second segment of the code stream can be obtained by referencing the first DCT data of the first segment of the code stream, fully utilizing the DCT data's ability to describe spatial and temporal prediction residuals, thereby improving reconstruction quality. On the other hand, during the decoding process, the second DCT data of the second segment of the code stream can be obtained by directly adding the first DCT data of the first segment of the code stream to the differential DCT data, fully utilizing the DCT data's ability to describe spatial and temporal prediction residuals, thereby improving reconstruction quality.

[0026] Optionally, in a possible implementation manner of the second aspect, the above step of: obtaining the first DCT data based on the first segment of the code stream includes: decoding the first segment of the code stream to obtain the first DCT data.

[0027] In this possible implementation, the first code stream can be directly decoded to obtain first DCT data, and then the second DCT data can be obtained based on the first DCT data as a reference, and the second GOP corresponding to the second code stream can be restored based on the second DCT data.

[0028] Optionally, in a possible implementation of the second aspect, the above-mentioned step of obtaining the first DCT data based on the first segment of the code stream includes: re-decoding the first segment of the code stream; re-encoding the decoded first segment of the code stream based on the encoding parameters to obtain the reconstructed first segment of the code stream, the encoding parameters being obtained based on the reference DCT data corresponding to the decoded second segment of the code stream (decoding the reference DCT data simultaneously obtains differential DCT data and encoding parameters); decoding the reconstructed first segment of the code stream to obtain the first DCT data.

[0029] In this possible implementation, by re-encoding and then decoding the re-decoded first segment of the code stream by obtaining the coding parameters from the reference DCT data in the decoding second segment of the code stream, a more restored first DCT data can be obtained, thereby realizing a frequency domain de-redundant video stream decompression method for multiplexing coding parameters between video segments, and constructing an efficient frequency domain de-redundant lossy coding and decoding framework.

[0030] Optionally, if quantization is performed during encoding, dequantization is also required during decoding. For example, after decoding the first bitstream, the decoding device needs to perform dequantization to obtain the first DCT data. For example, after adding the first DCT data and the differential DCT data, dequantization is required to obtain the second DCT data.

[0031] Optionally, in a possible implementation of the second aspect, the step of encoding the second DCT data to obtain the first video stream includes: encoding the second DCT data; obtaining a reconstructed second frame based on the encoded second DCT data and header information of the second frame; obtaining a reconstructed second stream segment based on the reconstructed second frame and header information of the second stream segment; and obtaining the first video stream segment based on the first stream segment and the reconstructed second stream segment. For example, assuming that the second GOP corresponding to the second stream segment includes multiple frames, the multiple frames are restored and then combined with the header information of the second GOP to obtain the restored second GOP. assuming that the video stream includes multiple GOPs, each restored GOP is obtained based on the above method, and then the first video stream is obtained based on each GOP.

[0032] In this possible implementation, the relationship between the differential DCT data and the first DCT data can be used to restore the second frame in the second GOP, and the restored first video stream can be obtained based on the header information of the second frame and the header information of the second stream. It can also be understood that the reconstruction process of the second stream refers to the first stream, thereby reducing redundant decoding processes.

[0033] Optionally, in a possible implementation manner of the second aspect, the first frame and the second frame are any one of the following types: a key frame, a forward prediction frame, and a bidirectional prediction frame.

[0034] In this possible implementation, reconstruction is performed based on the redundancy of corresponding frames between different segments of code streams, and the similarity of encoding results of corresponding frame types is utilized to improve the reconstruction quality.

[0035] In a third aspect, the present application provides a data processing device, which is a coding device, or a component of a coding device (such as a processor, chip, or chip system), or a logic module or software that can implement all or part of the coding device's functions. The data processing device includes a transceiver unit and a processing unit.

[0036] The transceiver unit is configured to obtain a first video stream, where the first video stream includes at least two groups of pictures (GOPs), and the at least two GOPs include a first GOP and a second GOP;

[0037] A processing unit is used to encode at least one second frame of a second GOP based on at least one first frame of a first GOP to obtain a second video stream, wherein the first frame and the second frame are of the same type, and a position of the first frame in the first GOP corresponds to a position of the second frame in the second GOP.

[0038] Optionally, in a possible implementation of the third aspect, the above-mentioned processing unit is specifically used to obtain first discrete cosine transform DCT data based on at least one first frame of the first GOP; the processing unit is specifically used to obtain second DCT data based on at least one second frame of the second GOP; the processing unit is specifically used to determine differential DCT data of the second frame based on the first DCT data and the second DCT data, and the differential DCT data of the second frame is used to indicate the difference between the second DCT data and the first DCT data; the processing unit is specifically used to encode the differential DCT data to obtain a second video code stream.

[0039] Optionally, in a possible implementation manner of the third aspect, the above-mentioned processing unit is specifically used to decode the first frame of the first GOP to obtain the first DCT data.

[0040] Optionally, in a possible implementation of the third aspect, the above-mentioned processing unit is specifically used to re-encode the first frame of the first GOP based on the encoding parameters, and the encoding parameters are obtained based on decoding the second frame of the second GOP; the processing unit is specifically used to decode the re-encoded first frame to obtain the first DCT data.

[0041] Optionally, in a possible implementation of the third aspect, the above-mentioned processing unit is specifically used to encode the differential DCT data to obtain the reference DCT data of the second frame; the processing unit is specifically used to integrate the reference DCT data and the header information of the second frame to obtain the encoded second frame; the processing unit is specifically used to integrate the encoded second frame and the header information of the second GOP to obtain the encoded second GOP; the processing unit is specifically used to obtain the second video stream based on the first GOP and the encoded second GOP.

[0042] Optionally, in a possible implementation manner of the third aspect, the first frame and the second frame are any one of the following types: a key frame, a forward prediction frame, and a bidirectional prediction frame.

[0043] Optionally, the processing unit is further configured to split the first video stream based on a GOP length to obtain at least two GOPs, and the GOP lengths in the first video stream are the same.

[0044] In a fourth aspect, the present application provides a data processing device, which is a decoding device, or a component of a decoding device (such as a processor, chip, or chip system), or a logic module or software that can implement all or part of the functions of the decoding device. The data processing device includes a transceiver unit and a processing unit.

[0045] The transceiver unit is configured to obtain a second video stream, where the second video stream includes at least two stream segments, and the at least two stream segments include a first stream segment and a second stream segment;

[0046] The processing unit is configured to decode at least one set of reference discrete cosine transform (DCT) data in the second bitstream segment based on at least one set of first DCT data in the first bitstream segment to obtain a first video bitstream segment, wherein the reference DCT data is information in the second video bitstream segment excluding header information, wherein a position of the first DCT data in the first bitstream segment corresponds to a position of the reference DCT data in the second bitstream segment, and a type of the first DCT data corresponding to a first frame in the first bitstream segment is the same as a type of the reference DCT data corresponding to a second frame in the second bitstream segment.

[0047] Optionally, in a possible implementation of the fourth aspect, the above-mentioned processing unit is specifically used to obtain first DCT data based on the first segment of the code stream; the processing unit is specifically used to obtain reference DCT data based on the second segment of the code stream; the processing unit is specifically used to decode the reference DCT data to obtain differential DCT data, and the differential DCT data is used to indicate the difference between the second DCT data and the first DCT data; the processing unit is specifically used to add the differential DCT data and the first DCT data to obtain second DCT data of the second frame; the processing unit is specifically used to encode the second DCT data to obtain the first video code stream.

[0048] Optionally, in a possible implementation manner of the fourth aspect, the above-mentioned processing unit is specifically used to decode the first code stream to obtain the first DCT data.

[0049] Optionally, in a possible implementation of the fourth aspect, the above-mentioned processing unit is specifically used to re-decode the first segment of the code stream; the processing unit is specifically used to re-encode the decoded first segment of the code stream based on the encoding parameters to obtain the reconstructed first segment of the code stream, and the encoding parameters are obtained based on the reference DCT data corresponding to the decoded second segment of the code stream; the processing unit is specifically used to decode the reconstructed first segment of the code stream to obtain the first DCT data.

[0050] Optionally, in a possible implementation of the fourth aspect, the above-mentioned processing unit is specifically used to encode the second DCT data; the processing unit is specifically used to obtain the reconstructed second frame based on the encoded second DCT data and the header information of the second frame; the processing unit is specifically used to obtain the reconstructed second segment of the code stream based on the reconstructed second frame and the header information of the second segment of the code stream; the processing unit is specifically used to obtain the first video code stream based on the first segment of the code stream and the reconstructed second segment of the code stream.

[0051] Optionally, in a possible implementation manner of the fourth aspect, the first frame and the second frame are any one of the following types: a key frame, a forward prediction frame, and a bidirectional prediction frame.

[0052] In a fifth aspect, the present application provides a coding device comprising at least one processor coupled to a memory; the memory is used to store programs or instructions; and the at least one processor is used to execute the program or instructions so that the coding device implements a method of any possible implementation of the first aspect described above.

[0053] In a sixth aspect, the present application provides a decoding device comprising at least one processor coupled to a memory; the memory is used to store programs or instructions; and the at least one processor is used to execute the program or instructions so that the decoding device implements any possible implementation method of the aforementioned second aspect.

[0054] In a seventh aspect, the present application provides an encoding device, comprising at least one logic circuit and an input / output interface; the logic circuit is used to execute the method described in any possible implementation of the first aspect.

[0055] In an eighth aspect, the present application provides a decoding device comprising at least one logic circuit and an input / output interface; the logic circuit is used to execute a method as in any possible implementation of the second aspect described above.

[0056] In a ninth aspect, the present application provides a communication system, which includes an encoding device of any possible implementation method of the fifth aspect and a decoding device of any possible implementation method of the sixth aspect, or includes an encoding device of any possible implementation method of the seventh aspect and a decoding device of any possible implementation method of the eighth aspect.

[0057] In a tenth aspect, the present application provides a computer-readable storage medium for storing one or more computer-executable instructions. When the computer-executable instructions are executed by a processor, the processor executes the method described in any possible implementation of any of the first or second aspects above.

[0058] In an eleventh aspect, the present application provides a computer program product (or computer program). When the computer program in the computer program product is executed by the processor, the processor executes the method described in any possible implementation of any of the first or second aspects above.

[0059] A twelfth aspect of the present application provides a chip system, which includes at least one processor for supporting a data processing device to implement the method described in any possible implementation of any one of the first or second aspects above.

[0060] In one possible design, the chip system may further include a memory for storing program instructions and data necessary for the data processing device. The chip system may be composed of a chip alone or may include a chip and other discrete components. Optionally, the chip system may also include an interface circuit that provides program instructions and / or data to at least one processor.

[0061] In a thirteenth aspect, the present application provides a device for storing a code stream, characterized in that it includes at least one storage medium and a communication interface; the communication interface is used to receive or send the code stream; the at least one storage medium is used to store the code stream; the code stream is encoded by the encoder according to the method in the aforementioned first aspect or any possible implementation of the first aspect.

[0062] In a fourteenth aspect, the present application provides a method for storing a code stream, the method comprising: receiving a code stream through a communication interface; storing the code stream in one or more storage media, wherein the code stream is encoded by an encoder according to the method in the aforementioned first aspect or any possible implementation of the first aspect.

[0063] In a fifteenth aspect, the present application provides a system for distributing code streams, the system comprising at least one storage medium and a video streaming device; the at least one storage medium is used to store the code stream, which is encoded by the encoder according to the method in the aforementioned first aspect or any possible implementation of the first aspect; the video streaming device is used to respond to the request of the decoder so that the target code stream in the at least one storage medium can be sent to the decoder.

[0064] A sixteenth aspect of the present application provides a method for distributing a code stream, the method comprising: receiving a first request; selecting a target code stream from at least one storage medium in response to the first request; sending the target code stream to a destination device; at least one storage medium is used to store the code stream, the code stream being encoded by an encoder according to the method in the aforementioned first aspect or any possible implementation of the first aspect.

[0065] In a seventeenth aspect, the present application provides a system for processing a code stream, the system comprising an image source device, an encoder device, one or more storage media, and a destination device; the image source device is used to provide image data; the encoder device is used to obtain image data of the image source device through an interface, and encode the image data to obtain one or more code streams, the code streams being encoded by the encoder according to the method in the aforementioned first aspect or any possible implementation of the first aspect; the encoder device is used to store the one or more code streams in one or more storage media; or the encoder device is used to encapsulate the one or more code streams to obtain a transmission code stream; the encoder device is used to transmit the transmission code stream to the destination device via a communication link or a communication network; the destination device is used to decapsulate the transmission code stream to obtain one or more code streams; and the destination device is used to decode the one or more code streams to obtain decoded data.

[0066] Among them, the technical effects brought about by any design method in the third aspect to the seventeenth aspect can refer to the technical effects brought about by the different design methods in the above-mentioned first aspect and second aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figures 1 to 3 are schematic diagrams of several application scenarios provided by embodiments of the present application;

[0068] FIG4 is a schematic diagram of a flow chart of an encoding method provided in an embodiment of the present application;

[0069] FIG5 is a schematic diagram of segmenting a video stream according to GOP according to an embodiment of the present application;

[0070] FIG6 is a schematic diagram showing a corresponding relationship between a first frame and a second frame provided in an embodiment of the present application;

[0071] FIG7 is another schematic flow chart of the encoding method provided in an embodiment of the present application;

[0072] FIG8 is another schematic flow chart of the encoding method provided in an embodiment of the present application;

[0073] FIG9 is a schematic diagram of a second GOP after encoding provided by an embodiment of the present application;

[0074] FIG10 is a schematic flow chart of a decoding method provided in an embodiment of the present application;

[0075] FIG11 is another schematic flow chart of a decoding method provided in an embodiment of the present application;

[0076] FIG12 is another schematic flow chart of a decoding method according to an embodiment of the present application;

[0077] 13 to 15 are several structural schematic diagrams of data processing devices provided in embodiments of the present application. DETAILED DESCRIPTION

[0078] The following describes the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0079] To facilitate understanding, the following first introduces the relevant terms and concepts mainly involved in the embodiments of this application.

[0080] 1. Codec

[0081] A codec is a device or program that encodes or decodes a signal or data stream. A codec typically consists of an encoder and a decoder. An encoder encodes a signal or digital stream (usually for transmission, storage, or encryption) or extracts a coded stream. A decoder converts the coded stream back into a signal or digital stream.

[0082] The encoding in the embodiments of the present application may specifically be entropy encoding, and accordingly, the decoding may specifically be entropy decoding. Re-encoding may also be understood as full encoding, specifically including predictive encoding and entropy encoding. Correspondingly, re-decoding may also be understood as full decoding, including predictive decoding and entropy decoding.

[0083] 2. Group of pictures (GOP)

[0084] GOP is a concept in video coding that consists of a series of consecutive video frames. A GOP typically contains one I-frame, several P-frames, and several B-frames. I-frames are key frames, P-frames are forward-predicted frames, and B-frames are bidirectionally predicted frames. Within a GOP, the frames are ordered as follows: IPBBBPBBB..., but when displayed, they are ordered as follows: IBBBPBBBP.... This is because B-frames reference the two preceding and succeeding key frames or predicted frames, necessitating bidirectional prediction during decoding. P-frames, on the other hand, only reference the preceding key frame or predicted frame, requiring unidirectional prediction. Therefore, during decoding, the I-frame is decoded first, followed by the P-frame based on the I-frame, and finally the B-frame based on the I-frame and P-frames. This results in a complete video sequence.

[0085] 3. Discrete cosine transform (DCT)

[0086] The discrete cosine transform (DCT) is a mathematical transformation related to the Fourier transform. It is similar to the DCT but uses only real numbers. The DCT is a separable transform whose kernel is the cosine function. It is primarily used for data or image compression, converting spatial signals into the frequency domain and exhibiting excellent decorrelation performance.

[0087] 4. The terms "system" and "network" in the embodiments of the present application can be used interchangeably. "At least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, "at least one of A, B and C" includes A, B, C, AB, AC, BC or ABC. And, unless otherwise specified, the ordinal numbers such as "first" and "second" mentioned in the embodiments of the present application are used to distinguish multiple objects, and are not used to limit the order, timing, priority or importance of multiple objects.

[0088] Currently, the code stream obtained by compressing video content using existing coding methods still contains a large amount of redundant information. Therefore, how to reduce the redundant information in video content is of great significance.

[0089] To address the aforementioned technical issues, embodiments of the present application provide an encoding method, a decoding method, and related devices that can compress the second frame of a second GOP using the first frame of a first GOP to achieve frequency domain redundancy removal. These methods can also be combined with existing compression schemes for higher efficiency.

[0090] The following describes the application scenarios to which the method provided in the embodiments of the present application is applicable.

[0091] The method provided in the embodiments of the present application can be applied to business scenarios such as public cloud, private cloud, video surveillance, live broadcast technology, storage, and transmission.

[0092] Figure 1 illustrates an example application scenario provided by an embodiment of the present application. This application scenario can also be understood as a coding and decoding application scenario. The application scenario includes: a coding unit, a storage / transmission unit, and a decoding unit. The method provided by an embodiment of the present application can be applied in the coding unit / decoding unit.

[0093] The encoding unit is used to encode video data (such as images, videos, etc.) according to the encoding method provided in the embodiment of the present application.

[0094] The storage / transmission unit is used to store (terminal, video surveillance, public cloud, private cloud, etc.) or transmit (public cloud, private cloud, live broadcast technology, etc.) the encoded video data.

[0095] The decoding unit is used to decode the encoded video data according to the decoding method provided in the embodiment of the present application to restore the video data.

[0096] It can be understood that the number of the above-mentioned encoding units and decoding units can be one or more, or it can be understood that the method provided in the embodiment of the present application can be applied to a single compression scenario or to a multiple compression scenario (such as secondary compression, etc.), which is not specifically limited here.

[0097] The application scenarios mentioned above have multiple situations, which are described in detail below:

[0098] The first one is the storage application scenario.

[0099] The storage application scenarios include: terminal photo album, video surveillance, etc. The schematic diagram of this scenario is shown in Figure 2, which includes: encoding unit, saving unit, file loading unit and decoding unit.

[0100] The encoding unit is used to encode video data (such as images, videos, etc.) according to the encoding method provided in the embodiment of the present application to obtain a binary file or a code stream.

[0101] The storage unit is used to store the binary file or code stream output by the encoding unit.

[0102] The file loading unit is used to load binary files or code streams.

[0103] The decoding unit is used to decode the loaded binary file or code stream according to the decoding method provided in the embodiment of the present application to restore the video data.

[0104] The second type is the terminal-cloud interaction scenario.

[0105] The terminal-cloud interaction scenarios include live broadcast scenarios, public cloud, etc. The schematic diagram of this scenario is shown in Figure 3. The terminal side includes an encoding unit and a decoding unit, and the cloud side includes a decoding unit, an encoding unit, an AI encoding unit, and an AI decoding unit.

[0106] The terminal acquires video data and encodes it using the encoding unit to obtain a bitstream. The terminal sends the bitstream to the cloud. After receiving the bitstream, the cloud decodes the bitstream using the decoding unit to obtain reconstructed data. The reconstructed data is then encoded using the AI ​​encoding unit to obtain a bitstream. The cloud decodes the bitstream using the AI ​​decoding unit to obtain reconstructed data. The cloud encodes the reconstructed data using the encoding unit to obtain a bitstream. The cloud then sends the bitstream to the terminal. After receiving the bitstream, the terminal decodes the bitstream using the decoding unit to obtain reconstructed data.

[0107] It is understandable that the encoding methods used by the encoding unit and the AI ​​encoding unit in Figure 3 may be inconsistent (or it can be understood that the operations of the decoding unit and the AI ​​encoding unit in the cloud can be called transcoding operations, and the operations of the AI ​​decoding unit and the encoding unit in the cloud can be called transcoding operations). For example, the cloud usually has more computing power resources than the terminal, so an algorithm with high computing power requirements and higher compression efficiency (AI encoding) can be used to re-compress (transcode) the video data to obtain a higher compression multiple and save cloud storage space. The process of transcoding: decode first, then encode in another way.

[0108] Of course, the AI ​​encoding unit in FIG3 may also be replaced with another non-AI encoding method, and the AI ​​decoding unit in FIG3 may also be replaced with another non-AI decoding method.

[0109] It is understandable that the above scenarios are just examples, and there may be other scenarios in actual applications, which are not specifically limited here.

[0110] The method provided by the embodiment of the present application is described below. Please refer to Figure 4, which is a flow chart of the encoding method provided by the embodiment of the present application. The method may include steps 401 and 402. Steps 401 and 402 can be performed by an encoding device, or by some components in the encoding device (such as a processor, chip or chip system, etc.), or by a logic module or software that can realize all or part of the functions of the encoding device. The following description is based on the example of execution by an encoding device. The processing performed by a single execution subject in steps 401 and 402 can also be divided into executions by multiple execution subjects, and these execution subjects can be logically and / or physically separated.

[0111] Step 401: Obtain a first video stream.

[0112] In the embodiment of the present application, there are many ways for the encoding device to obtain the first video code stream, which can be through acquisition / shooting and preliminary encoding, or by receiving it from other devices, or by selecting it from a database, etc., which are not limited here.

[0113] The first video stream includes at least two groups of pictures (GOPs), wherein the at least two GOPs include a first GOP and a second GOP. The number of the at least two GOPs can be two or more, and the number of frames (e.g., B frames) in the first GOP and the second GOP can be multiple, without specific limitation herein. For a description of GOPs, please refer to the explanation of related terms above and will not be repeated here.

[0114] In addition, the first GOP and the second GOP in the embodiment of the present application may be adjacent GOPs, or may be separated by one or more GOPs, etc., which is not limited here.

[0115] Optionally, after obtaining the first video stream, the encoding device may split the first video stream based on the GOP length to obtain at least two GOPs. Alternatively, the encoding device may split the first video stream based on the GOP granularity to obtain n GOP segments, where the n GOP segments include the first GOP and the second GOP, and n is a positive integer greater than 1. It is understood that the lengths of different GOPs in the same first video stream are consistent (in this embodiment of the present application, the lengths of different GOPs in the first video stream are the same).

[0116] This method of segmenting the first video stream according to GOPs, combined with subsequent reference encoding of frames in the second GOP based on the first GOP, can fully explore the correlation between GOPs and achieve further redundancy removal and compression effects.

[0117] For example, the first video stream is grouped according to the GOP granularity to obtain n GOP segments as shown in Figure 5. For example, the first GOP is GOP1, and the second GOP is GOP2. For another example, the first GOP is GOP1, and the second GOP is GOP3. For another example, the first GOP is GOP3, and the second GOP is GOP4, etc.

[0118] In a possible implementation, after the acquisition device acquires video data and performs preliminary encoding, it sends the encoded first video stream to the encoding device.

[0119] In another possible implementation, the encoding device obtains video data and performs preliminary processing on the video data to obtain a first video code stream. The preliminary processing may at least include preliminary encoding. In addition, the preliminary processing may also include at least one of the following: transcoding, addition and deletion, and completion. The preliminary encoding in the embodiment of the present application may be any standard encoding method or non-standard encoding method. For example, the encoding method used in the preliminary encoding is H.261, H.263, H.264, H.266, Joint Photographic Expert Group (JPEG), Moving Pictures Experts Group (MPEG), etc., which are not limited here.

[0120] For example, the first video stream obtained by the encoding device is denoted as V. It uses the H.264 format and has a GOP length of 150 frames. The encoding device splits the first video stream V into six GOPs at the GOP granularity, denoted as V1, V2, V3, V4, V5, and V6. This embodiment can also be understood as performing a secondary compression on the initially compressed first video stream.

[0121] Step 402: Encode at least one second frame of a second GOP based on at least one first frame of a first GOP to obtain a second video stream.

[0122] After obtaining the first GOP and the second GOP, the encoding device may encode the second frame of the second GOP based on the first frame of the first GOP to obtain a second video code stream.

[0123] Among them, the first frame and the second frame have a corresponding relationship. The corresponding relationship may include at least one of the following: type correspondence or position correspondence, etc. The type of the first frame and the second frame is any of the following types: I frame, B frame or P frame, etc. Type correspondence can be understood as the same type or having some kind of association. Position correspondence can be understood as the position of the first frame in the first GOP corresponding to the position of the second frame in the second GOP. Position correspondence can also be understood as the correspondence of display order or decoding order. For example, the first frame and the second frame are of the same type, and the position of the first frame in the first GOP corresponds to the position of the second frame in the second GOP.

[0124] For example, FIG6 shows an example of a correspondence between a first frame and a second frame. The first frame is an I frame in the first GOP, and the second frame is an I frame in the second GOP. For another example, the first frame is the first B frame in the first GOP, and the second frame is the first B frame in the second GOP. For another example, the first frame is the second B frame in the first GOP, and the second frame is the second B frame in the second GOP. For another example, the first frame is a P frame in the first GOP, and the second frame is a P frame in the second GOP.

[0125] Optionally, this step specifically includes: the encoding device obtaining first DCT data based on at least one first frame of the first GOP, obtaining second DCT data based on at least one second frame of the second GOP, obtaining a differential DCT of the second frame based on the first DCT data and the second DCT data, and encoding the differential DCT data to obtain a second video stream. The differential DCT data is used to represent the difference between the first DCT data and the second DCT data.

[0126] Specifically, the first DCT data and the second DCT data are differentially processed to obtain differential DCT data. The differential DCT data is then encoded to obtain reference DCT data. The header information is then integrated to obtain the second video stream. The header information can be understood as a header field, such as a sequence parameter set (SPS), a frame-level parameter set (PPS), or a block parameter set (BPS), etc., which is not specifically limited here.

[0127] Furthermore, to improve the encoding effect, quantization processing can be performed. That is, after the encoding device obtains the first DCT data and the second DCT data, it can quantize the first DCT data and the second DCT data using the same quantization parameter, and perform differential processing on the quantized first DCT data and the quantized second DCT data to obtain a differential DCT.

[0128] The DCT data (e.g., first DCT data, second DCT data, differential DCT data, reference DCT data) can be understood as DCT coefficients, DCT graphs, DCT coefficient matrices, etc., and can be presented in graphs, tables, etc. Differential processing can be understood as numerical difference, which can be direct subtraction, multiplication by a correction coefficient followed by subtraction, subtraction followed by multiplication by a correction coefficient, etc., and the specifics are not limited here.

[0129] It should be noted that the number of the first and second frames described above can be one or more. If there are multiple first and second frames, this step is equivalent to performing pair-by-pair calculations to obtain multiple differential DCT data, and further encoding the differential DCT data to obtain reference DCT data. This application describes the processing flow of the first and second frames as an example. The pair-by-pair calculation process is similar to the description of the first and second frames and will not be repeated here.

[0130] The following first introduces the process of the encoding device obtaining each DCT data.

[0131] In the embodiment of the present application, based on multiple methods for obtaining the first DCT data, the different methods for obtaining each DCT data are described respectively:

[0132] First, the encoding device directly decodes the first frame to obtain the first DCT data.

[0133] In this approach, the encoding device decodes the first frame to obtain first DCT data and decodes the second frame to obtain second DCT data. Based on the first and second DCT data, differential DCT data is obtained. The differential DCT data is then encoded to obtain reference DCT data.

[0134] For example, an example of this approach is shown in FIG7 . Assume that the first GOP is GOPn-1 and the second GOP is GOPn, i.e., the first and second GOPs are adjacent. The encoding device decodes the first frame to obtain first DCT data and entropy decodes the second frame to obtain second DCT data. The first and second DCT data are quantized using the same quantization parameter, and a delta DCT is obtained by performing a differential operation on the quantized first and second DCT data. This delta DCT is then encoded to obtain reference DCT data.

[0135] In the second method, the encoding device re-encodes the first frame based on the encoding parameters, and then decodes the re-encoded first frame to obtain the first DCT data.

[0136] In this approach, the encoding device decodes the second frame to obtain second DCT data and encoding parameters. The encoding device then re-encodes the first frame based on the encoding parameters. The re-encoded first frame is decoded to obtain first DCT data. Differential DCT data is obtained based on the first and second DCT data. The differential DCT data is then encoded to obtain reference DCT data. For example, the encoding device may decode header information of the second frame to obtain the encoding parameters.

[0137] An example of this method is shown in Figure 8. Assume that the first GOP is GOPn-1 and the second GOP is GOPn, i.e., the first and second GOPs are adjacent. The encoding device decodes the second frame to obtain second DCT data and encoding parameters, and re-encodes the first frame based on the encoding parameters. The re-encoded first frame is decoded to obtain first DCT data. The first and second DCT data are quantized using the same quantization parameters, and a delta DCT (difference DCT data) is generated by performing a differential operation on the quantized first and second DCT data. This delta DCT is then encoded to obtain reference DCT data.

[0138] In this case, a secondary compression method based on frequency domain de-redundancy based on the reuse of coding parameters between video segments is proposed to construct an efficient frequency domain de-redundancy lossy coding framework. On the one hand, the DCT data of a segmented video stream (i.e., the second GOP) after decoding highly overlaps with the DCT data after decoding of other segmented video streams (i.e., the first GOP), thereby obtaining sparser differential DCT data and lower information entropy, so that a smaller bitstream is obtained after differential DCT encoding. On the other hand, segmented de-redundancy of the video stream is performed in the frequency domain, making full use of the DCT data's ability to describe spatial and temporal prediction residuals, avoiding the problem of reduced efficiency of secondary compression tools in the pixel domain after quantization and reconstruction in traditional secondary encoding. On the other hand, the quantizer design based on fully encoded DCT data is simple and efficient, and the segmented video stream can obtain similar quantization results using the same quantization parameters, making the amount of data after differential smaller.

[0139] It is understandable that the above two methods are just examples. In actual applications, other inter-GOP redundancy removal methods may also be used, which are not specifically limited here.

[0140] For example, continuing the above example of six GOPs, reference encoding is performed in such a way that V2 is encoded with reference to V1, V3 is encoded with reference to V2, V4 is encoded with reference to V3, and V6 is encoded with reference to V5. Taking V2 as an example, all frames in V2 (e.g., n frames, where n is a positive integer) perform the following steps: Decode V2 to obtain the second DCT data (2, n) and macroblock-by-macroblock encoding parameters for the second frame F(2, n). Use these encoding parameters to re-encode and decode the first frame F(1, n) in V1 to obtain the first DCT data (1, n). Quantize the first and second DCT data using the same quantization parameters to obtain DCT'(1, n) and DCT'(2, n). Perform segment-wise subtraction of DCT'(1, n) and DCT'(2, n) to obtain ΔDCT (i.e., differential DCT data). This ΔDCT is then encoded to obtain ΔDCT'(2, n) (i.e., reference DCT data). After executing this operation on all frames in V2, ΔDCT'(2, n) is obtained. In this example, n=1, 2, 3, ..., 150. Similarly, V3, V4, V5, and V6 obtain corresponding ΔDCT' in the same manner.

[0141] The above describes the method of obtaining each DCT data. The following describes the process of encoding the differential DCT data to obtain the second video stream:

[0142] After obtaining the differential DCT data, the encoding device can encode the differential DCT data to obtain reference DCT data for the second frame. The reference DCT data and the header information of the second frame are first combined to obtain the encoded second frame. The encoded second frames are then combined with the header information of the second GOP to obtain the encoded second GOP. Finally, the second video stream is obtained based on the first GOP and the encoded second GOP.

[0143] The GOP header information is used to indicate the GOP length, resolution, frame rate, reference structure (i.e., encoding by reference to corresponding frames), etc. The frame header information is used to indicate the quantization parameter QP, block partitioning parameters, prediction mode, etc.

[0144] Optionally, after the encoding device obtains the reference DCT data, it combines the header information of the second frame to obtain the encoded second frame. It should be noted that the number of the above-mentioned first frame and second frame can be one or more. When the number of the first frame and the second frame is multiple, multiple differential DCT data and multiple reference DCT data are calculated pair by pair. Then, multiple encoded second frames are obtained by combining the header information of the corresponding frames. The multiple encoded second frames are spliced ​​according to the order of each second frame in the original second GOP, and the spliced ​​multiple encoded second frames are combined with the second GOP header information to obtain the encoded second GOP (which can be called △V2). Then, based on the first GOP and the encoded second GOP, the second video stream is obtained. For example, the first GOP and the encoded second GOP are spliced ​​according to the order of each GOP in the first video stream to obtain the second video stream. This application describes the processing flow of the first frame and the second frame as an example. The pair-by-pair calculation process is similar to the description of the first frame and the second frame, and will not be repeated here.

[0145] It is understood that in step 401, the first video stream may include multiple GOPs, each of which includes multiple frames. The frames in the remaining GOPs, except for the first and second GOPs, are processed using the aforementioned process in step 402, and combined with the corresponding header information to obtain multiple encoded GOPs. The first GOP, the encoded second GOP, and the other encoded GOPs are then merged to obtain a second video stream.

[0146] For example, continuing with the above example of six GOPs, as shown in FIG9 , after obtaining the ΔDCT'(2, n) corresponding to each second frame, the ΔDCT'(2, n) is concatenated with the header information of each second frame to obtain a set of reference DCT data for each second frame. This is then combined with the header information of the second GOP to obtain the encoded second GOP (i.e., ΔV2). Similarly, V3, V4, V5, and V6 are encoded using the aforementioned method to obtain ΔV3, ΔV4, ΔV5, and ΔV6. V1, ΔV2, ΔV3, ΔV4, ΔV5, and ΔV6 are then merged to obtain the second video stream.

[0147] Optionally, after acquiring the second video code stream, the encoding device sends the second video code stream to the decoding device. Correspondingly, the decoding device receives the second video code stream sent by the encoding device.

[0148] In an embodiment of the present application, on the one hand, the first frame in the first GOP can be compressed with the second frame of the second GOP to complete frequency domain de-redundancy. And it can be superimposed and multiplexed with existing compression schemes to obtain higher benefits. On the other hand, the first video stream is segmented according to the GOP, and the reference encoding of the frames in the second GOP is performed based on the first GOP, which can fully exploit the correlation between the GOPs and achieve the effect of further removing redundancy and compression. On the other hand, segmentation is performed based on the inherent GOP structure of the first video stream, so that corresponding frames of the same frame type between GOPs can be referenced and de-redundant. On the other hand, de-redundancy is performed on corresponding frames between GOPs, utilizing the similarity of the encoding results of corresponding frame types; the corresponding intra-frame coded frames (I frames) between segments are secondary encoded similar to inter-frame prediction encoding to remove the time domain correlation between the corresponding intra-frame coded frames between GOPs; the corresponding inter-frame coded frames (P / B frames) between segments are secondary compressed based on reference to further reduce the data redundancy of the inter-frame coded frames.

[0149] Please refer to Figure 10, which is a flowchart of a decoding method provided in an embodiment of the present application. The method may include steps 1001 and 1002. Steps 1001 and 1002 can be performed by a decoding device, or by some components in the decoding device (such as a processor, chip or chip system, etc.), or by a logic module or software that can realize all or part of the functions of the decoding device. The following description is based on the example of execution by a decoding device. The processing performed by a single execution subject in steps 1001 and 1002 can also be divided into multiple execution subjects, which can be logically and / or physically separated.

[0150] Step 1001: Obtain a second video stream.

[0151] The decoding device obtains a second video stream, which includes at least two segments, including a first segment and a second segment. The second video stream can also be understood as a video stream after encoding the first video stream.

[0152] In the embodiment of the present application, there are multiple ways for the decoding device to obtain the second video code stream, which can be by receiving it from other devices (such as an encoding device), or by selecting it from a database, etc., which are not limited here.

[0153] Optionally, the decoding device receives the second video code stream sent by the encoding device.

[0154] The second video stream can be described with reference to the embodiment described in FIG4 above, and will not be further elaborated here. The first and second stream segments are adjacent streams, or two stream segments separated by one or more stream segments. For example, the first stream segment is the first GOP (i.e., V1) after encoding in the embodiment shown in FIG4 above, i.e., the first stream segment consists of the header information of the first GOP and the encoded frames in the original first GOP; the second stream segment is the second GOP (i.e., ΔV2) after encoding in the embodiment shown in FIG4 above, i.e., the second stream segment consists of the header information of the second GOP and the encoded frames in the original second GOP. For another example, the first stream segment is the first GOP (i.e., V1) after encoding in the embodiment shown in FIG4 above, i.e., the first stream segment consists of the header information of the first GOP and the encoded frames in the original first GOP; the second stream segment is the third GOP (i.e., ΔV3) after encoding in the embodiment shown in FIG4 above, i.e., the second stream segment consists of the header information of the third GOP and the encoded frames in the third GOP.

[0155] Step 1002: Decode at least one set of reference discrete cosine transform (DCT) data in the second bitstream based on at least one set of first DCT data in the first bitstream to obtain a first video bitstream.

[0156] After acquiring the second video stream, the decoding device decodes at least one set of reference discrete cosine transform (DCT) data in the second stream based on at least one set of first DCT data in the first stream to obtain the first video stream.

[0157] In this embodiment of the present application, the first bitstream is the encoded first GOP, and the second bitstream is the encoded second GOP. The second bitstream consists of the encoded second frames and the header information of the original second GOP, and each encoded second frame consists of reference DCT data and the header information of each second frame. The composition of the first and second GOPs is described above on the encoding side and will not be repeated here.

[0158] Therefore, the reference DCT data is the information of the second frame after encoding in the second segment of the code stream except for the header information, the position of the first DCT data in the first segment of the code stream corresponds to the position of the reference DCT data in the second segment of the code stream, and the first frame before encoding corresponding to the first DCT data in the first segment of the code stream is of the same type as the second frame before encoding corresponding to the reference DCT data in the second segment of the code stream.

[0159] Optionally, the decoding device first obtains at least one set of first DCT data based on the first bitstream and at least one set of reference DCT data based on the second bitstream. The reference DCT data is decoded to obtain differential DCT data, which represents the difference between the second DCT data and the first DCT data. The differential DCT data is added to the first DCT data to obtain second DCT data for the second frame. The second DCT data is then encoded to obtain the first video bitstream.

[0160] For example, the decoding device determines that the data in the first segment of the code stream other than the header information (including the header information of the original GOP and the header information of the first frame in the original GOP) is the first DCT data, and the decoding device determines that the data in the second segment of the code stream other than the header information (including the header information of the original GOP and the header information of the second frame in the original GOP) is the reference DCT data.

[0161] It is understandable that the process by which the decoding device performs addition processing on the differential DCT data and the first DCT data corresponds to the process of obtaining the differential DCT data based on the first DCT data and the second DCT data in the aforementioned encoding process (i.e., the addition process can also be understood as the inverse process of the difference processing). For example, the decoding device performs addition processing on the differential DCT data and the first DCT data to obtain the second DCT data. Of course, it is also possible to multiply by a correction coefficient before adding. Or, add and then multiply by a correction coefficient, etc. In addition, if quantization processing is performed during encoding, corresponding inverse quantization processing is required during decoding. For example, after the decoding device decodes the first segment of the code stream, it is necessary to perform inverse quantization processing to obtain the first DCT data. For example, after the first DCT data and the differential DCT data are added, it is necessary to perform inverse quantization processing to obtain the second DCT data.

[0162] Corresponding to the two situations in step 402 of the embodiment shown in FIG. 4 , in this embodiment, there are multiple ways for the decoding device to obtain the first DCT data and the second DCT data, which are described below respectively:

[0163] First, the decoding device directly decodes the first bit stream to obtain the first DCT data.

[0164] In this method, the decoding device decodes the first bitstream to obtain first DCT data, decodes the reference DCT data in the second bitstream to obtain differential DCT data, and then obtains second DCT data based on the differential DCT data and the first DCT data.

[0165] For example, an example of this approach is shown in FIG11 . Assume that the first bitstream segment is the encoded GOPn-1, and the second bitstream segment is the encoded GOPn, i.e., the first bitstream segment is adjacent to the second bitstream segment. The decoding device decodes the first bitstream segment to obtain first DCT data, and decodes the reference DCT data in the second bitstream segment to obtain differential DCT data. The differential DCT data is then added to the first DCT data to obtain second DCT data. Alternatively, the differential DCT data is added to the first DCT data and inversely quantized to obtain second DCT data. The second DCT data is then encoded to obtain the reconstructed second frame.

[0166] Second, the decoding device decodes the reconstructed code stream corresponding to the first code stream to obtain the first DCT data.

[0167] In this method, the decoding device decodes a set of reference DCT data in the second bitstream segment to obtain differential DCT data and encoding parameters. The decoding device then re-decodes the first bitstream segment and re-encodes the re-decoded first bitstream segment using the encoding parameters to obtain a reconstructed bitstream segment (i.e., the reconstructed first bitstream segment). The reconstructed bitstream segment is then decoded to obtain the first DCT data. The position of the first DCT data in the first bitstream segment corresponds to the position of the reference DCT data in the second bitstream segment, and the first frame before encoding corresponding to the first DCT data in the first bitstream segment is of the same type as the second frame before encoding corresponding to the reference DCT data in the second bitstream segment.

[0168] For example, an example of this approach is shown in FIG12 . Assume that the first bitstream segment is the encoded GOPn-1, and the second bitstream segment is the encoded GOPn, i.e., the first bitstream segment is adjacent to the second bitstream segment. The decoding device decodes the reference DCT data in the second bitstream segment to obtain differential DCT data and encoding parameters, re-decodes the first bitstream segment, and re-encodes the re-decoded first bitstream segment using the encoding parameters to obtain a reconstructed bitstream. The reconstructed bitstream is then decoded to obtain the first DCT data. The differential DCT data is then added to the first DCT data to obtain the second DCT data. Alternatively, the differential DCT data is added to the first DCT data and then inverse-quantized to obtain the second DCT data. The second DCT data is then subsequently encoded to obtain the reconstructed second frame.

[0169] It is understandable that the above two methods are just examples. In actual applications, other inter-GOP decoding methods can also be used, which are not specifically limited here.

[0170] For example, continuing with the six GOPs example in the above encoding method, reference decoding is performed by decoding △V2 with reference to V1, decoding △V3 with reference to △V2, decoding △V4 with reference to △V3, and decoding △V6 with reference to △V5. Taking △V2 as an example, all frames in △V2 (e.g., n frames, where n is a positive integer) perform the following steps: decode the first bitstream to obtain V1, decode the header information of the second bitstream to obtain encoding parameters, and use the encoding parameters to fully encode the decoded V1 to obtain the reconstructed bitstream V1'. Decode V1' and extract the DCT(1, n) (i.e., the first DCT data) of the first frame F(1, n) in V1'. The second bitstream is decoded to obtain ΔDCT(2,n) (i.e., differential DCT data) corresponding to the second frame. DCT(1,n) is then added to ΔDCT(2,n) and inversely quantized to obtain DCT(2,n) (i.e., second DCT data). In this embodiment of the present application, the first frame and the second frame are each a plurality of frames, such as n=1, 2, 3, ..., 150 in this example.

[0171] After obtaining the second DCT data, the decoding device encodes the second DCT data to obtain a first video code stream.

[0172] Optionally, after obtaining the second DCT data, the decoding device first encodes the second DCT data and obtains a reconstructed second frame based on the encoded second DCT data and header information of the original second frame. A reconstructed second segment of the code stream is then obtained based on the reconstructed second frame and header information of the second segment of the code stream. Furthermore, the first video code stream is obtained based on the first segment of the code stream and the reconstructed second segment of the code stream.

[0173] It is understood that, assuming the second bitstream includes multiple frames, after obtaining multiple reconstructed second frames according to the aforementioned method, the reconstructed second bitstream (which can also be understood as the restored second GOP) is obtained by combining the header information of the corresponding frames. Similarly, the process of step 1002 is also applied to all frames in the video bitstream encoded in step 1001, including all frames in the remaining bitstreams except the first bitstream and the second bitstream. Assuming the first video bitstream includes multiple GOPs, that is, the second video bitstream includes multiple bitstreams, after obtaining multiple reconstructed bitstreams according to the aforementioned method, they are spliced ​​to obtain the first video bitstream. For example, the first bitstream, the reconstructed second bitstream, and the other reconstructed bitstreams are merged to obtain the first video bitstream.

[0174] For example, continuing with the six GOPs example above, the second DCT data is encoded to obtain a reconstructed second frame. Accordingly, the above operations are performed on each set of reference DCT data in the second bitstream to obtain multiple reconstructed second frames. These reconstructed second frames are combined with the header information of the second bitstream (i.e., the header information of the original second GOP) to obtain a reconstructed second GOP (i.e., V2). Similarly, V3, V4, V5, and V6 are obtained in the same manner.

[0175] In the embodiments of the present application, on the one hand, decoding can be performed using parameters between different bitstream segments to reduce repeated decoding of redundant data. Specifically, the second DCT data of the second bitstream segment can be obtained by referencing the first DCT data of the first bitstream segment, fully leveraging the DCT data's ability to describe spatial and temporal prediction residuals to improve reconstruction quality. Furthermore, by performing reference decoding on the second bitstream segment based on the first bitstream segment, the correlation between the various GOPs in the original first video bitstream segment can be fully exploited, further reducing redundant decoding.

[0176] The above describes the method provided in the embodiment of the present application. The following describes the data processing device in the embodiment of the present application. Please refer to Figure 13, which shows an embodiment of a data processing device 1300 in the embodiment of the present application. This data processing device 1300 can implement the functions of the encoding device or decoding device in the above method embodiment, and thus can also achieve the beneficial effects of the above method embodiment. In the embodiment of the present application, the data processing device 1300 can be a data processing device, or it can be an integrated circuit or component within the data processing device, such as a chip. The data processing device 1300 includes: a transceiver unit 1301 and a processing unit 1302.

[0177] In one possible implementation, the data processing device 1300 is the encoding device in the embodiments shown in FIG. 1 to FIG. 12 . In this case, the functions of the various units are as follows:

[0178] The transceiver unit 1301 is configured to obtain a first video stream, where the first video stream includes at least two groups of pictures (GOPs), where the at least two GOPs include a first GOP and a second GOP.

[0179] The processing unit 1302 is used to encode at least one second frame of the second GOP based on at least one first frame of the first GOP to obtain a second video code stream, where the first frame and the second frame are of the same type, and the position of the first frame in the first GOP corresponds to the position of the second frame in the second GOP.

[0180] Optionally, the processing unit 1302 is specifically used to obtain first discrete cosine transform DCT data based on at least one first frame of the first GOP; the processing unit 1302 is specifically used to obtain second DCT data based on at least one second frame of the second GOP; the processing unit 1302 is specifically used to determine differential DCT data of the second frame based on the first DCT data and the second DCT data, and the differential DCT data of the second frame is used to indicate the difference between the second DCT data and the first DCT data; the processing unit 1302 is specifically used to encode the differential DCT data to obtain a second video stream.

[0181] Optionally, the processing unit 1302 is specifically configured to decode a first frame of a first GOP to obtain first DCT data.

[0182] Optionally, the processing unit 1302 is specifically configured to re-encode the first frame of the first GOP based on encoding parameters, where the encoding parameters are obtained based on decoding the second frame of the second GOP; the processing unit 1302 is specifically configured to decode the re-encoded first frame to obtain first DCT data.

[0183] Optionally, the processing unit 1302 is specifically used to encode the differential DCT data to obtain the reference DCT data of the second frame; the processing unit 1302 is specifically used to integrate the reference DCT data and the header information of the second frame to obtain the encoded second frame; the processing unit 1302 is specifically used to integrate the encoded second frame and the header information of the second GOP to obtain the encoded second GOP; the processing unit 1302 is specifically used to obtain the second video stream based on the first GOP and the encoded second GOP.

[0184] Optionally, the first frame and the second frame are any one of the following types: a key frame, a forward prediction frame, or a bidirectional prediction frame.

[0185] Optionally, the processing unit 1302 is further configured to split the first video stream based on a GOP length to obtain at least two GOPs, and the GOP lengths in the first video stream are the same.

[0186] In this embodiment, the operations performed by each unit in the data processing device are similar to the description of the encoding device in the embodiments shown in Figures 1 to 12 above, and will not be repeated here.

[0187] In this embodiment, processing unit 1302 can, on the one hand, encode the first frame in the first GOP with the second frame in the second GOP to achieve frequency domain redundancy removal. This can be superimposed and multiplexed with existing coding schemes to achieve higher efficiency. Furthermore, processing unit 1302 segments the first video stream according to GOPs and performs reference coding of frames in the second GOP based on the first GOP, fully exploiting inter-GOP correlations to achieve further redundancy removal and compression. Furthermore, processing unit 1302 segments the first video stream based on the inherent GOP structure, enabling reference and redundancy removal for corresponding frames of the same frame type between GOPs. Furthermore, redundancy removal is performed on corresponding frames between GOPs, leveraging the similarity of encoding results for corresponding frame types. Corresponding intra-coded frames (I frames) between segments undergo secondary encoding similar to inter-frame prediction coding to remove temporal correlations between corresponding intra-coded frames between GOPs. Reference-based secondary compression is performed on corresponding inter-coded frames (P / B frames) between segments to further reduce data redundancy in inter-coded frames.

[0188] In another possible implementation, the data processing device 1300 is the decoding device in the embodiments shown in FIG. 1 to FIG. 12 . In this case, the functions of the various units are as follows:

[0189] The transceiver unit 1301 is configured to obtain a second video stream, where the second video stream includes at least two stream segments, and the at least two stream segments include a first stream segment and a second stream segment.

[0190] The processing unit 1302 is configured to decode at least one set of reference discrete cosine transform (DCT) data in the second bitstream segment based on at least one set of first DCT data in the first bitstream segment to obtain a first video bitstream segment, where the reference DCT data is information in the second video bitstream segment excluding header information, a position of the first DCT data in the first bitstream segment corresponds to a position of the reference DCT data in the second bitstream segment, and a type of the first DCT data corresponding to a first frame in the first bitstream segment is the same as a type of the reference DCT data corresponding to a second frame in the second bitstream segment.

[0191] Optionally, the processing unit 1302 is specifically used to obtain first DCT data based on the first segment of the code stream; the processing unit 1302 is specifically used to obtain reference DCT data based on the second segment of the code stream; the processing unit 1302 is specifically used to decode the reference DCT data to obtain differential DCT data, and the differential DCT data is used to indicate the difference between the second DCT data and the first DCT data; the processing unit 1302 is specifically used to add the differential DCT data and the first DCT data to obtain second DCT data of the second frame; the processing unit 1302 is specifically used to encode the second DCT data to obtain the first video code stream.

[0192] Optionally, the processing unit 1302 is specifically configured to decode the first bit stream to obtain first DCT data.

[0193] Optionally, the processing unit 1302 is specifically used to re-decode the first segment of the code stream; the processing unit 1302 is specifically used to re-encode the decoded first segment of the code stream based on the encoding parameters to obtain the reconstructed first segment of the code stream, and the encoding parameters are obtained based on the reference DCT data corresponding to the decoded second segment of the code stream; the processing unit 1302 is specifically used to decode the reconstructed first segment of the code stream to obtain the first DCT data.

[0194] Optionally, the processing unit 1302 is specifically used to encode the second DCT data; the processing unit 1302 is specifically used to obtain a reconstructed second frame based on the encoded second DCT data and the header information of the second frame; the processing unit 1302 is specifically used to obtain a reconstructed second segment of the code stream based on the reconstructed second frame and the header information of the second segment of the code stream; the processing unit 1302 is specifically used to obtain a first video code stream based on the first segment of the code stream and the reconstructed second segment of the code stream.

[0195] Optionally, the first frame and the second frame are any one of the following types: a key frame, a forward prediction frame, or a bidirectional prediction frame.

[0196] In this embodiment, the operations performed by each unit in the data processing device are similar to the description of the decoding device in the embodiments shown in Figures 1 to 12 above, and will not be repeated here.

[0197] In this embodiment, processing unit 1302 can, on the one hand, decode DCT data between different bitstream segments to reduce repeated decoding of redundant data. Specifically, it can obtain the second DCT data of the second bitstream segment by referencing the first DCT data of the first bitstream segment, fully leveraging the DCT data's ability to describe spatial and temporal prediction residuals to improve reconstruction quality. Furthermore, processing unit 1302 can also perform reference decoding on the DCT data of corresponding frames in the second bitstream segment based on the first bitstream segment, fully exploiting the correlation between GOPs in the original video stream and further reducing redundant decoding.

[0198] Please refer to Figure 14, which is another schematic structural diagram of a data processing device 1400 provided in this application. The data processing device 1400 includes a logic circuit 1401 and an input / output interface 1402. The data processing device 1400 may be a chip or an integrated circuit.

[0199] The transceiver unit 1301 shown in FIG13 may be a communication interface, which may be the input / output interface 1402 in FIG14 , which may include an input interface and an output interface. Alternatively, the communication interface may be a transceiver circuit, which may include an input interface circuit and an output interface circuit. The processing unit 1302 shown in FIG13 may be the logic circuit 1401 in FIG14 .

[0200] Optionally, when the data processing device is the encoding device in the aforementioned embodiment, the logic circuit 1401 is used to perform the encoding and other operations in the embodiments shown in Figures 1 to 12. The input and output interface 1402 is used to perform the acquisition and other operations in the embodiments shown in Figures 1 to 12.

[0201] Optionally, when the data processing device is a decoding device in the aforementioned embodiment, the logic circuit 1401 is used to perform operations such as decoding in the embodiments shown in Figures 1 to 12. The input and output interface 1402 is used to perform operations such as acquiring in the embodiments shown in Figures 1 to 12.

[0202] The logic circuit 1401 and the input / output interface 1402 may also execute other steps executed by the encoding device or the decoding device in any embodiment and achieve corresponding beneficial effects, which will not be described in detail here.

[0203] Optionally, the logic circuit 1401 may be a processing device, and the functions of the processing device may be partially or entirely implemented by software. The functions of the processing device may be partially or entirely implemented by software.

[0204] Optionally, the processing device may include a memory and a processor, wherein the memory is used to store a computer program, and the processor reads and executes the computer program stored in the memory to perform corresponding processing and / or steps in any one of the method embodiments.

[0205] Alternatively, the processing device may include only a processor. A memory for storing the computer program is located outside the processing device, and the processor is connected to the memory via circuits / wires to read and execute the computer program stored in the memory. The memory and processor may be integrated or physically separate.

[0206] Optionally, the processing device may be one or more chips, or one or more integrated circuits. For example, the processing device may be one or more field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), system-on-chips (SoCs), central processor units (CPUs), network processors (NPs), digital signal processors (DSPs), microcontroller units (MCUs), programmable logic devices (PLDs), or other integrated chips, or any combination of the above chips or processors.

[0207] Please refer to Figure 15, which shows a data processing device 1500 involved in the above embodiments provided in an embodiment of the present application. The data processing device 1500 can specifically be a data processing device serving as an encoding device or a decoding device in the above embodiments.

[0208] Herein, a possible logical structure diagram of the data processing device 1500 is shown. The data processing device 1500 may include but is not limited to at least one processor 1501 and a communication port 1502 .

[0209] The transceiver unit 1301 shown in FIG13 may be a communication interface, which may be the communication port 1502 in FIG15 , which may include an input interface and an output interface. Alternatively, the communication port 1502 may be a transceiver circuit, which may include an input interface circuit and an output interface circuit.

[0210] Further optionally, the apparatus may also include at least one of a memory 1503 and a bus. In an embodiment of the present application, the at least one processor 1501 is used to control the actions of the data processing device 1500 .

[0211] In addition, processor 1501 can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and so on. Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0212] It should be noted that the data processing device 1500 shown in Figure 15 can be specifically used to implement the steps implemented by the encoding device or decoding device in the aforementioned method embodiment, and to achieve the corresponding technical effects of the encoding device or decoding device. The specific implementation methods of the data processing device shown in Figure 15 can refer to the description in the aforementioned method embodiment, and will not be repeated here.

[0213] An embodiment of the present application also provides a computer-readable storage medium storing one or more computer-executable instructions. When the computer-executable instructions are executed by a processor, the processor executes the method described in the possible implementation method of the image processing device (such as an encoding device or a decoding device) in the aforementioned embodiment.

[0214] An embodiment of the present application also provides a computer program product (or computer program) storing one or more computers. When the computer program product is executed by the processor, the processor executes the method of the possible implementation method of the above-mentioned image processing device.

[0215] An embodiment of the present application also provides a chip system, which includes at least one processor for supporting a terminal device to implement the functions involved in the possible implementation of the above-mentioned image processing device. Optionally, the chip system also includes an interface circuit, which provides program instructions and / or data to the at least one processor. In one possible design, the chip system may also include a memory for storing the necessary program instructions and data for the terminal device. The chip system can be composed of a chip, or it can include a chip and other discrete devices.

[0216] An embodiment of the present application further provides a readable storage medium, which stores a code stream encoded according to the method in the embodiments shown in Figures 1 to 12 above.

[0217] An embodiment of the present application further provides a device for storing a code stream, characterized in that it includes at least one storage medium and a communication interface; the communication interface is used to receive or send the code stream; the at least one storage medium is used to store the code stream; the code stream is encoded by an encoder according to the method in the embodiments shown in Figures 1 to 12 above.

[0218] An embodiment of the present application further provides a method for storing a code stream, the method comprising: receiving a code stream through a communication interface; and storing the code stream in one or more storage media, wherein the code stream is encoded by an encoder according to the method in the embodiments shown in Figures 1 to 12 above.

[0219] An embodiment of the present application further provides a system for distributing a bitstream, the system comprising at least one storage medium and a video streaming device; the at least one storage medium is used to store the bitstream, which is encoded by the encoder according to the method in the embodiments shown in Figures 1 to 12 above; the video streaming device is used to respond to a request from a decoder so that the target bitstream in the at least one storage medium can be sent to the decoder.

[0220] An embodiment of the present application further provides a method for distributing a bitstream, the method comprising: receiving a first request; selecting a target bitstream from at least one storage medium in response to the first request; and sending the target bitstream to a destination device; the at least one storage medium being used to store the bitstream, where the bitstream is encoded by an encoder according to the method in the embodiments shown in FIG. 1 to FIG. 12 .

[0221] An embodiment of the present application also provides a system for processing a code stream, which includes an image source device, an encoder device, one or more storage media, and a destination device; the image source device is used to provide image data; the encoder device is used to obtain image data from the image source device through an interface and encode the image data to obtain one or more code streams, where the code streams are encoded by the encoder according to the method in the embodiments shown in Figures 1 to 12 above; the encoder device is used to store the one or more code streams in one or more storage media; or the encoder device is used to encapsulate the one or more code streams to obtain a transmission code stream; the encoder device is used to transmit the transmission code stream to the destination device via a communication link or communication network; the destination device is used to decapsulate the transmission code stream to obtain one or more code streams; and the destination device is used to decode the one or more code streams to obtain decoded data.

[0222] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0223] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0224] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0225] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0226] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

Claims

1. A coding method, characterized in that: The method comprises: Acquire a first video stream, where the first video stream includes at least two groups of pictures (GOPs), and the at least two GOPs include a first GOP and a second GOP; At least one second frame of the second GOP is encoded based on at least one first frame of the first GOP to obtain a second video code stream, the first frame and the second frame are of the same type, and the position of the first frame in the first GOP corresponds to the position of the second frame in the second GOP.

2. The encoding method according to claim 1, wherein The encoding of at least one second frame of the second GOP based on at least one first frame of the first GOP to obtain a second video stream includes: obtaining first discrete cosine transform (DCT) data based on at least one first frame of the first GOP; decoding at least one second frame of the second GOP to obtain second DCT data; determining differential DCT data of the second frame based on the first DCT data and the second DCT data, wherein the differential DCT data of the second frame is used to indicate a difference between the second DCT data and the first DCT data; The differential DCT data is encoded to obtain the second video stream.

3. The encoding method according to claim 2, wherein: The obtaining first DCT data based on at least one first frame of the first GOP includes: The first frame of the first GOP is decoded to obtain the first DCT data.

4. The encoding method according to claim 2, wherein: The obtaining first DCT data based on at least one first frame of the first GOP includes: re-encoding the first frame of the first GOP based on encoding parameters obtained by decoding the second frame of the second GOP; The re-encoded first frame is decoded to obtain the first DCT data.

5. The encoding method according to any one of claims 2 to 4, characterized in that The encoding of the differential DCT data to obtain the second video stream includes: encoding the differential DCT data to obtain reference DCT data of the second frame; integrating the reference DCT data and header information of the second frame to obtain an encoded second frame; Integrating the encoded second frame and the header information of the second GOP to obtain an encoded second GOP; The first GOP and the encoded second GOP are integrated to obtain the second video stream.

6. The encoding method according to any one of claims 1 to 5, characterized in that: The first frame and the second frame are any one of the following types: a key frame, a forward prediction frame, and a bidirectional prediction frame.

7. A decoding method, characterized in that: The method comprises: Acquire a second video stream, where the second video stream includes at least two stream segments, and the at least two stream segments include a first stream segment and a second stream segment; At least one group of reference DCT data in the second segment of the code stream is decoded based on at least one group of first discrete cosine transform (DCT) data in the first segment of the code stream to obtain a first video code stream, wherein the reference DCT data is information in the second segment of the code stream excluding header information, a position of the first DCT data in the first segment of the code stream corresponds to a position of the reference DCT data in the second segment of the code stream, and a type of a first frame corresponding to the first DCT data in the first segment of the code stream is the same as a type of a second frame corresponding to the reference DCT data in the second segment of the code stream.

8. The decoding method according to claim 7, wherein: The decoding of at least one set of reference DCT data in the second segment of the code stream based on at least one set of first discrete cosine transform (DCT) data in the first segment of the code stream to obtain a first video code stream includes: Obtaining the first DCT data based on the first bit stream; Obtain the reference DCT data based on the second bit stream; decoding the reference DCT data to obtain differential DCT data, where the differential DCT data indicates a difference between the second DCT data and the first DCT data; adding the differential DCT data to the first DCT data to obtain the second DCT data; The second DCT data is encoded to obtain the first video code stream.

9. The decoding method according to claim 8, characterized in that The obtaining of the first DCT data based on the first bit stream includes: The first bit stream is decoded to obtain the first DCT data.

10. The decoding method according to claim 8, wherein: The obtaining of the first DCT data based on the first bit stream includes: re-decoding the first bitstream; re-encoding the decoded first bitstream segment based on encoding parameters to obtain a reconstructed first bitstream segment, wherein the encoding parameters are obtained by decoding the reference DCT data corresponding to the second bitstream segment; The reconstructed first bit stream is decoded to obtain the first DCT data.

11. The decoding method according to any one of claims 8 to 10, characterized in that: The encoding of the second DCT data to obtain the first video stream includes: encoding the second DCT data; Obtaining a reconstructed second frame based on the encoded second DCT data and the header information of the second frame; Obtaining a reconstructed second bitstream based on the reconstructed second frame and header information of the second bitstream; The first video stream is obtained based on the first stream and the reconstructed second stream.

12. The decoding method according to any one of claims 7 to 11, characterized in that: The first frame and the second frame are any one of the following types: a key frame, a forward prediction frame, and a bidirectional prediction frame.

13. An encoding device, characterized in that The encoding device comprises: A transceiver unit, configured to obtain a first video stream, wherein the first video stream includes at least two groups of pictures (GOPs), wherein the at least two GOPs include a first GOP and a second GOP; A processing unit is used to encode at least one second frame of the second GOP based on at least one first frame of the first GOP to obtain a second video code stream, wherein the first frame and the second frame are of the same type, and the position of the first frame in the first GOP corresponds to the position of the second frame in the second GOP.

14. A decoding device, characterized in that: The decoding device comprises: a transceiver unit, configured to obtain a second video stream, wherein the second video stream includes at least two stream segments, and the at least two stream segments include a first stream segment and a second stream segment; A processing unit is configured to decode at least one set of reference DCT data in the second segment of the code stream based on at least one set of first discrete cosine transform (DCT) data in the first segment of the code stream to obtain a first video code stream, wherein the reference DCT data is information in the second segment of the video code stream excluding header information, a position of the first DCT data in the first segment of the code stream corresponds to a position of the reference DCT data in the second segment of the code stream, and a type of the first DCT data corresponding to a first frame in the first segment of the code stream is the same as a type of the reference DCT data corresponding to a second frame in the second segment of the code stream.

15. An encoding device, characterized in that include: A processor, the processor is coupled to a memory, the memory is used to store a program or instruction, when the program or instruction is executed by the processor, the encoding device performs the method according to any one of claims 1 to 6.

16. A decoding device, characterized in that: include: A processor, the processor is coupled to a memory, the memory is used to store a program or instruction, when the program or instruction is executed by the processor, the decoding device performs the method according to any one of claims 7 to 12.

17. A coding and decoding system, characterized in that: The encoding and decoding system includes the encoding device according to claim 15 and / or the decoding device according to claim 16.

18. A computer-readable storage medium, characterized in that The medium stores instructions, and when the instructions are executed by a computer, the method according to any one of claims 1 to 12 is implemented.

19. A computer program product, characterized in that The method comprises instructions which, when executed on a computer, cause the computer to perform the method according to any one of claims 1 to 12.

20. A readable storage medium, characterized in that The readable medium stores a code stream encoded according to any one of the encoding methods according to claims 1 to 6.

21. A device for storing a code stream, characterized in that: including at least one storage medium and a communication interface; The communication interface is used to receive or send code streams; The at least one storage medium is used to store the code stream; The code stream is obtained by encoding by an encoder according to any one of the encoding methods according to claims 1 to 6.

22. A method for storing a code stream, characterized in that: include: Receive a code stream through a communication interface; The code stream is stored in one or more storage media, and the code stream is an encoder. Obtained by encoding according to any one of the encoding methods of claims 1 to 6.

23. A system for distributing code streams, characterized in that: including at least one storage medium and a video streaming device; The at least one storage medium is used to store a code stream, wherein the code stream is encoded by an encoder according to any one of the encoding methods of claims 1 to 6; The video stream device is configured to respond to a request from a decoder so that the target code stream in the at least one storage medium is sent to the decoder.

24. A method for distributing code streams, characterized in that: include: receiving a first request; In response to the first request, selecting a target code stream from at least one storage medium; Sending the target code stream to a destination device; The at least one storage medium is used to store a code stream, and the target code stream is obtained by encoding by an encoder according to any one of the encoding methods according to claims 1 to 6.

25. A system for processing a code stream, characterized in that: including an image source device, an encoder device, one or more storage media and a destination device; The image source device is used to provide image data; The encoder device is configured to obtain the image data of the image source device through an interface, and encode the image data to obtain one or more code streams, wherein the code streams are encoded by the encoder according to the encoding method according to any one of claims 1 to 6; The encoder device is used to store the one or more code streams in one or more storage media; or The encoder device is used to encapsulate the one or more code streams to obtain a transmission code stream; The encoder device is used to transmit the transmission code stream to the destination device through a communication link or a communication network; The destination device is configured to decapsulate the transport stream to obtain the one or more streams; The destination device is used to decode the one or more code streams to obtain decoded data.

Citation Information

Patent Citations

  • An apparatus, a method and a computer program for video coding and decoding

    CN104813662A

  • Method for encoding picture and device therefor

    JP1998145785A

  • Efficient adaptive streaming

    JP2021145343A

  • Video decoding method and apparatus based on parallel processing

    KR1020140052788A

  • Adaptive GOP structure with future reference frame in random access configuration for video coding

    US20190098301A1