Video coding method, video decoding method, computer-readable medium and electronic device
Patent Information
- Application Number
- PCT/CN2026/087280
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-05-22
- Filing Date
- 2026-03-31
- Publication Date
- 2026-11-26
AI Technical Summary
In existing video encoding and decoding technologies, the encoding and decoding order and dependencies of syntax elements are fixed, which fails to effectively adapt to the frequency changes of different video content, resulting in limited encoding efficiency.
By selecting the target syntax element structure from at least two candidate syntax element structures, the decoding and encoding order of syntax elements can be flexibly adjusted, and the encoding and decoding process can be optimized based on the frequency and dependencies of syntax elements.
It improves the efficiency of video encoding and decoding, reduces the number of bits consumed by encoding syntax elements, and enhances overall encoding performance.
Smart Images

Figure CN2026087280_26112026_PF_FP_ABST
Abstract
Description
Video encoding and decoding methods, computer-readable media and electronic devices
[0001] This application claims priority to Chinese Patent Application No. 202510671674.2, filed on May 22, 2025, entitled "Video Coding / Decoding Method, Computer-Readable Medium and Electronic Device", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the fields of computer and communication technology, and more specifically, to video encoding and decoding methods, apparatus, computer-readable media, and electronic devices. Background Technology
[0003] In video encoding and decoding technology, syntax elements are used to describe various parameters and information of video content. For example, they can be used to describe information related to video frames during processes such as segmentation, prediction, transformation, quantization, and entropy coding. Syntax elements are crucial for video compression, transmission, and decoding. Furthermore, multiple syntax elements are involved in the video encoding and decoding process, and there is a certain encoding / decoding order among these elements, such as using a hierarchical order to encode or decode them.
[0004] Technical content
[0005] The embodiments of this application provide a video encoding / decoding method, apparatus, computer-readable medium, and electronic device, which can flexibly adjust the syntax element structure used in the encoding region, thereby improving the overall encoding / decoding efficiency.
[0006] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part by practice of this application.
[0007] This application provides a video decoding method, comprising: determining a target syntax element structure used by a current region to be decoded from at least two candidate syntax element structures, wherein the target syntax element structure is used to indicate the decoding order of a plurality of syntax elements of the current region to be decoded; decoding the plurality of syntax elements from a bitstream according to the decoding order of the plurality of syntax elements indicated by the target syntax element structure; and decoding the current region to be decoded according to the decoded plurality of syntax elements.
[0008] This application provides a video encoding method, comprising: selecting a target syntax element structure used by a current encoding region from at least two candidate syntax element structures, wherein the target syntax element structure is used to indicate the encoding order of a plurality of syntax elements in the current encoding region; and encoding the plurality of syntax elements in the current encoding region into a bitstream according to the encoding order of the plurality of syntax elements indicated by the target syntax element structure.
[0009] This application provides a video decoding apparatus, including: a determining unit configured to determine a target syntax element structure used by a current region to be decoded from at least two candidate syntax element structures, wherein the target syntax element structure is used to indicate the decoding order of multiple syntax elements of the current region to be decoded; and a decoding unit configured to decode the multiple syntax elements from a bitstream according to the decoding order of the multiple syntax elements indicated by the target syntax element structure, and to decode the current region to be decoded according to the decoded multiple syntax elements.
[0010] This application provides a video encoding apparatus, including: a determining unit configured to select a target syntax element structure used by a current encoding region from at least two candidate syntax element structures, wherein the syntax element structure is used to indicate the encoding order of a plurality of syntax elements in the current encoding region; and an encoding unit configured to encode the plurality of syntax elements of the current encoding region into a bitstream according to the encoding order of the plurality of syntax elements indicated by the target syntax element structure.
[0011] This application provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the video decoding method or video encoding method as described in the above embodiments.
[0012] This application provides an electronic device, including: one or more processors; and a storage device for storing one or more computer programs, which, when executed by the one or more processors, cause the electronic device to implement the video decoding method or video encoding method as described in the above embodiments.
[0013] This application provides a computer program product comprising a computer program stored in a computer-readable storage medium. An electronic device's processor reads and executes the computer program from the computer-readable storage medium, causing the electronic device to perform the video decoding or video encoding methods provided in the various optional embodiments described above.
[0014] This application provides a method for storing video streams, wherein the generated video streams are stored according to the video encoding method described in the above embodiments.
[0015] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application.
[0016] Brief description of the attached figures
[0017] Figure 1 illustrates a schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of this application can be applied;
[0018] Figure 2 shows a schematic diagram of the placement of the video encoding device and the video decoding device in the streaming system;
[0019] Figure 3 shows a basic flowchart of a video encoder;
[0020] Figure 4 shows a schematic diagram of an inter-frame prediction process;
[0021] Figure 5 shows a schematic diagram of an inter-frame prediction process;
[0022] Figure 6 shows a schematic diagram of the spatial neighboring blocks of the current block;
[0023] Figure 7 shows a schematic diagram of the syntax element structure according to some embodiments of this application;
[0024] Figure 8 shows a flowchart of a video decoding method according to some embodiments of this application;
[0025] Figure 9 shows a flowchart of a video encoding method according to some embodiments of this application;
[0026] Figure 10 shows a schematic diagram of the syntax element structure according to some embodiments of this application;
[0027] Figure 11 shows a schematic diagram of the syntax element structure according to some embodiments of this application;
[0028] Figure 12 shows a block diagram of a video decoding apparatus according to some embodiments of this application;
[0029] Figure 13 shows a block diagram of a video encoding apparatus according to some embodiments of this application;
[0030] Figure 14 shows a schematic diagram of the structure of a computer system suitable for implementing the computer device of the present application. Detailed Implementation
[0031] Exemplary embodiments will now be described in a more comprehensive manner with reference to the accompanying drawings. However, the exemplary embodiments can be implemented in various forms and should not be construed as limited to these examples; rather, these embodiments are provided so that this application will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art.
[0032] Furthermore, the features, structures, or characteristics described in this application can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to provide a full understanding of the embodiments of this application. However, those skilled in the art will recognize that when implementing the technical solutions of this application, not all the detailed features in the embodiments may be used, one or more specific details may be omitted, or other methods, elements, devices, steps, etc., may be employed.
[0033] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0034] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0035] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0036] It should be noted that "multiple" in this article refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0037] Figure 1 shows a schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of this application can be applied.
[0038] As shown in Figure 1, system architecture 100 includes multiple terminal devices that can communicate with each other via, for example, a network 150. For instance, system architecture 100 may include a first terminal device 110 and a second terminal device 120 interconnected via network 150. In the embodiment of Figure 1, the first terminal device 110 and the second terminal device 120 perform unidirectional data transmission.
[0039] For example, the first terminal device 110 can encode video data (e.g., a video image stream captured by the terminal device 110) to transmit it to the second terminal device 120 via the network 150. The encoded video data is transmitted in the form of one or more encoded video streams. The second terminal device 120 can receive the encoded video data from the network 150, decode the encoded video data to recover the video data, and display video images based on the recovered video data.
[0040] In some embodiments of this application, system architecture 100 may include a third terminal device 130 and a fourth terminal device 140 that perform bidirectional transmission of encoded video data, such as during a video conference. For bidirectional data transmission, each of the third terminal device 130 and the fourth terminal device 140 may encode video data (e.g., a video image stream captured by the terminal device) for transmission over network 150 to the other terminal device. Each of the third terminal device 130 and the fourth terminal device 140 may also receive encoded video data transmitted by the other terminal device, decode the encoded video data to recover the video data, and display the video images on an accessible display device based on the recovered video data.
[0041] In the embodiment shown in FIG1, the first terminal device 110, the second terminal device 120, the third terminal device 130 and the fourth terminal device 140 may be servers or terminals, but the principles disclosed in this application are not limited to these.
[0042] Servers can be standalone physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Terminals can be smartphones, tablets, laptops, desktop computers, smart speakers, smart voice interaction devices, smartwatches, smart home appliances, in-vehicle terminals, aircraft, etc., but are not limited to these.
[0043] The network 150 shown in Figure 1 represents any number of networks, including, for example, wired and / or wireless communication networks, that transmit encoded video data between the first terminal device 110, the second terminal device 120, the third terminal device 130, and the fourth terminal device 140. The communication network 150 may exchange data in circuit-switched and / or packet-switched channels. This network may include telecommunications networks, local area networks (LANs), wide area networks (WANs), and / or the Internet. For the purposes of this application, unless explained below, the architecture and topology of network 150 may be irrelevant to the operation of the disclosure herein.
[0044] In some embodiments of this application, Figure 2 illustrates the placement of the video encoding and decoding devices in a streaming environment. The subject matter disclosed in this application is equally applicable to other video-enabled applications, including, for example, video conferencing, digital television (TV), storing compressed video on digital media including CDs, DVDs, memory sticks, etc.
[0045] The streaming system may include an acquisition subsystem 213, which may include a video source 201 such as a digital camera, which creates an uncompressed video image stream 202. In an embodiment, the video image stream 202 includes samples captured by a digital camera. The video image stream 202 is depicted as a thick line to emphasize the high data volume of the video image stream compared to encoded video data 204 (or encoded video bitstream 204). The video image stream 202 may be processed by an electronic device 220, which includes a video encoding device 203 coupled to the video source 201. The video encoding device 203 may include hardware, software, or a combination of hardware and software to implement or enforce aspects of the disclosed subject matter as described in more detail below. The encoded video data 204 (or encoded video bitstream 204) is depicted as a thin line to emphasize the lower data volume of the encoded video data 204 (or encoded video bitstream 204), which may be stored on a streaming server 205 for future use. One or more streaming client subsystems, such as client subsystems 206 and 208 in FIG. 2, can access streaming server 205 to retrieve copies 207 and 209 of encoded video data 204. Client subsystem 206 may include, for example, a video decoding device 210 in electronic device 230. Video decoding device 210 decodes the incoming copy 207 of the encoded video data and produces an output video picture stream 211 that can be displayed on display 212 (e.g., a screen) or another presentation device. In some streaming systems, the encoded video data 204, video data 207, and video data 209 (e.g., video stream) may be encoded according to certain video encoding / compression standards.
[0046] It should be noted that electronic devices 220 and 230 may include other components not shown in the figures. For example, electronic device 220 may include a video decoding device, and electronic device 230 may also include a video encoding device.
[0047] In some embodiments of this application, taking High Efficiency Video Coding (HEVC) and Versatile Video Coding (VVC) from international video coding standards, as well as the Chinese national video coding standard AVS, as examples, after an input video frame image, the video frame image is divided into several non-overlapping processing units according to a block size. Each processing unit performs a similar compression operation. This processing unit is called a Coding Tree Unit (CTU) or Largest Coding Unit (LCU). The CTU can be further subdivided into more refined units to obtain one or more basic Coding Units (CUs). The CU is the most basic element in a coding process.
[0048] In other embodiments, this processing unit may also be called a tile, which is a rectangular area of a multimedia data frame that can be independently decoded and encoded. In the Alliance for Open Media Video 1 (AV1) standard, the tile can be further subdivided into one or more superblocks (SBs). The SB is the starting point for block partitioning and can be further divided into multiple subblocks. The superblocks are then further subdivided into one or more blocks. Each block is the most basic element in a coding process. In some embodiments, an SB may contain several blocks (Bs).
[0049] The above method of dividing video frame images can be called a block partition structure. The following introduces some concepts in the encoding process:
[0050] Predictive coding includes intra-frame prediction and inter-frame prediction. The original video signal is predicted from a selected reconstructed video signal to obtain a residual video signal. The encoder needs to decide which predictive coding mode to choose for the current coding unit (or coding block) and inform the decoder. Intra-frame prediction refers to the predicted signal coming from a region within the same image that has already been encoded and reconstructed; inter-frame prediction refers to the predicted signal coming from another encoded image (called a reference image) that is different from the current image.
[0051] Transform and Quantization: After the residual video signal undergoes transformation operations such as Discrete Fourier Transform (DFT) and Discrete Cosine Transform (DCT), the signal is transformed into the transform domain, and these are called transform coefficients. The transform coefficients are then subjected to lossy quantization, losing some information to make the quantized signal more suitable for compression. In some video coding standards, there may be more than one transform method to choose from. Therefore, the encoder needs to select one of the transform methods for the current coding unit (or coding block) and inform the decoder. The fineness of quantization is usually determined by the quantization parameter (QP). A larger QP value means that coefficients with a wider range of values will be quantized into the same output, which usually leads to greater distortion and a lower bit rate. Conversely, a smaller QP value means that coefficients with a smaller range of values will be quantized into the same output, which usually leads to less distortion and a higher bit rate.
[0052] Entropy coding, or statistical coding, involves statistically compressing the quantized transform-domain signal based on the frequency of each value, ultimately outputting a binary (0 or 1) compressed bitstream. Simultaneously, other information generated during encoding, such as the selected coding mode and motion vector data, also requires entropy coding to reduce the bit rate. Statistical coding is a lossless coding method that effectively reduces the bit rate required to represent the same signal. Common statistical coding methods include Variable Length Coding (VLC) and Content Adaptive Binary Arithmetic Coding (CABAC).
[0053] Context-Based Binary Arithmetic Coding (CABAC) primarily involves three steps: binarization, context modeling, and binary arithmetic coding. After binarizing the input syntax elements, the binary data can be encoded using either a regular coding mode or a bypass coding mode. The bypass coding mode eliminates the need to assign a specific probability model to each binary bit; the input binary bit bin value is directly encoded using a simple bypass encoder, thus accelerating the overall encoding and decoding speed. Generally, different syntax elements are not completely independent, and even identical syntax elements possess a certain degree of memory. Therefore, according to conditional entropy theory, using other encoded syntax elements for conditional coding can further improve coding performance compared to independent coding or memoryless coding. This encoded symbol information used as conditions is called the context. In the regular coding mode, the binary bits of the syntax elements sequentially enter the context modeler. The encoder assigns an appropriate probability model to each input binary bit based on the values of previously encoded syntax elements or binary bits; this process is called context modeling. The context model corresponding to a grammatical element can be located using the context index increment (ctxIdxInc) and the context index start (ctxIdxStart). After the bin value and the assigned probability model are fed into the binary arithmetic encoder for encoding, the context model needs to be updated based on the bin value, which is the adaptive process in encoding.
[0054] Loop Filtering: The transformed and quantized signal undergoes inverse quantization, inverse transform, and prediction compensation to obtain a reconstructed image. Due to the effects of quantization, the reconstructed image differs from the original image in some aspects, resulting in distortion. Therefore, filtering operations can be performed on the reconstructed image, such as deblocking filters (DB), sample adaptive offset (SAO), or adaptive loop filters (ALF), to effectively reduce the distortion caused by quantization. Since these filtered reconstructed images will serve as a reference for subsequent coded images to predict future image signals, the aforementioned filtering operations are also called loop filtering, i.e., filtering operations within the coding loop.
[0055] In some embodiments of this application, Figure 3 shows a basic flowchart of a video encoder, in which intra-frame prediction is used as an example for illustration. The original image signal s... k[x,y] and the predicted image signal Perform the difference operation to obtain the residual signal u. k [x,y], residual signal u k After transformation and quantization, [x,y] is obtained as quantization coefficients. These coefficients are then used to obtain the encoded bitstream through entropy encoding, and to obtain the reconstructed residual signal u′ through inverse quantization and inverse transform. k [x,y], predict image signal With the reconstructed residual signal u′ k [x,y] superimposed to generate image signals Image signal On one hand, the signal is input to the intra-frame mode decision module and the intra-frame prediction module for intra-frame prediction processing; on the other hand, the reconstructed image signal s′ is output through loop filtering. k [x,y], reconstruct the image signal s′ k [x,y] can be used as a reference image for the next frame for motion estimation and motion compensation prediction. Then, based on the motion compensation prediction result s′ r [x+m x ,y+m y ] and intra-frame prediction results Obtain the predicted image signal for the next frame. And continue repeating the above process until the encoding is complete.
[0056] Based on the above encoding process, at the decoding end, for each encoding unit (or encoding block), after acquiring the compressed bitstream (i.e., bitstream), entropy decoding is performed to obtain various mode information and quantization coefficients. Then, the quantization coefficients undergo inverse quantization and inverse transform processing to obtain the residual signal. On the other hand, based on the known encoding mode information, the prediction signal corresponding to the encoding unit (or encoding block) can be obtained. Then, the residual signal and the prediction signal are added together to obtain the reconstructed signal. The reconstructed signal then undergoes loop filtering and other operations to generate the final output signal.
[0057] In the field of coding technology, inter-frame prediction utilizes the correlation in the temporal domain of video, using pixels from neighboring encoded images to predict pixels in the current image. This effectively removes temporal redundancy and saves bits of encoded residual data. As shown in Figure 4, P represents the current frame. r B represents the reference frame, and B represents the current block. r This represents the reference block for B. The coordinates of B′ in the reference frame are the same as the coordinates of B in the current frame. r The coordinates are (x r ,y r The coordinates of B′ are (x, y). The displacement between the current block and its reference block is called the motion vector MV, where MV = (x, y).r -x,y r -y). In other words, inter-frame prediction refers to the process of searching for a reference block in neighboring encoded images (i.e., reference frames) based on the current block to be encoded in the current frame, with the aim of removing temporal redundancy in the video signal. As shown in Figure 5, the current block to be encoded in the current frame is searched within a certain range in the reference frame (i.e., the search area formed by the search box) according to block matching criteria to obtain the best matching block. In some embodiments, commonly used block matching criteria in video coding include: minimum mean square error (MSE), sum of absolute differences (SAD), and other matching criteria.
[0058] Considering the strong correlation between temporal and spatial neighboring blocks, MV prediction technology can be used to further reduce the bits required to encode MV. Specifically, for the current block using inter-frame prediction, an MV candidate list can be constructed, from which the predicted value closest to the motion vector of the current block is selected to predict the motion vector of the current block. The MV candidate list can typically be constructed by placing motion vectors from spatially neighboring blocks, motion vectors from temporally co-located blocks, and motion vector information from previous encoded blocks in a certain order. Figure 6 shows the candidate list construction method for using spatial motion vector prediction technology in HEVC, where the spatial motion vector candidate list is constructed in the order of A1->B1->B0->A0->B2.
[0059] For example, in H.265 / HEVC, inter-frame prediction includes two MV prediction techniques: merge and Advanced Motion Vector Prediction (AMVP). In merge mode, a candidate MV list is created for the current block, containing up to five candidate MVs (and their corresponding reference images). These five candidate MVs are iterated through, and the one with the lowest rate-distortion cost is selected as the optimal MV. If the codec creates the candidate list in the same way, the encoder only needs to transmit the index of the optimal MV in the candidate list. It's important to note that HEVC's MV prediction technique also has a skip mode, a special case of merge mode. After finding the optimal MV using merge mode, if the current block and the reference block are essentially the same, residual data does not need to be transmitted; only a skip flag and the MV's index (i.e., merge_idx) need to be transmitted.
[0060] Video signals, from the perspective of how they are acquired, can be divided into two types: those captured by cameras and those generated by computers. Due to differences in statistical characteristics, the corresponding compression encoding methods may also differ.
[0061] When writing syntax elements into the bitstream, it is necessary to consider the frequency of their occurrence and their interdependencies. Generally, the identifiers of more frequently occurring syntax elements can be subject to fewer constraints, while the identifiers of less frequently occurring syntax elements can be subject to more constraints. This results in less redundancy in the overall syntax element structure and achieves optimal encoding efficiency.
[0062] In some embodiments, the limiting conditions may refer to the context conditions, dependencies, or encoding rules set to identify the syntax element when encoding the syntax morpheme, that is, the context information or rules required to determine the value of the syntax element during encoding (e.g., the value of the previous syntax element, the current block type, adjacent block information, etc.).
[0063] In some embodiments, the frequency of occurrence of a syntax element can refer to the statistical number of times or the relative probability of that syntax element appearing per unit time or per unit bitstream length in the encoded output bitstream. In some embodiments, the interdependence of syntax elements can refer to whether a syntax element appears or how its semantics are resolved, and how it is resolved, is determined by the values of one or more previous syntax elements.
[0064] For example, taking the use of syntax elements to indicate whether it is in skip mode or merge mode as an example, referring to the syntax element structure shown in Figure 7, the root node is skip_flag, which is used to indicate whether the current coding unit adopts skip mode. From the perspective of the decoder, if the value of skip_flag is 1, it means that the current coding unit adopts skip mode, and then merge_idx can be further parsed to obtain the index of MV; if the value of skip_flag is 0, it means that skip mode is not adopted, and it is necessary to continue to determine whether the current coding unit adopts intra prediction mode or inter prediction mode.
[0065] If it is intra-frame mode (e.g., if the value of the flag indicating whether it is intra-frame prediction mode or inter-frame prediction mode is 1, then intra-frame prediction mode is selected), continue parsing intra_mpm; if it is inter-frame mode (e.g., if the value of the flag indicating whether it is intra-frame prediction mode or inter-frame prediction mode is 0, then inter-frame prediction mode is selected), continue parsing merge_flag.
[0066] `intra_mpm` indicates whether the Most Probable Mode (MPM) list is used in intra-prediction mode. If the value of `intra_mpm` is 1, it means the MPM list is used, and `mpm_idx` is parsed further; if the value of `intra_mpm` is 0, it means the MPM list is not used, and `intramode_idx` is parsed further to determine the index of the intra-prediction mode.
[0067] The `merge_flag` flag indicates whether to use merge mode in inter-frame prediction mode. If the value of `merge_flag` is 1, it means that merge mode is used and `merge_idx` is parsed. If the value of `merge_flag` is 0, it means that merge mode is not used and uni-pred or bi-pred is parsed to determine whether it is uni-pred or bi-pred prediction.
[0068] `uni-pred` or `bi-pred` indicates whether unidirectional or bidirectional prediction is used in inter-frame prediction in non-merge mode. If it is bidirectional prediction (e.g., a value of 1 for `uni-pred` or `bi-pred` indicates bidirectional prediction), twice the motion vector difference (MVD) and advanced motion vector prediction (AMVP) flag information are required, i.e., 2×(amvp_flag+mvd); if it is unidirectional prediction (e.g., a value of 0 for `uni-pred` or `bi-pred` indicates unidirectional prediction), only one motion vector difference and AMVP flag information are needed, i.e., `amvp_flag+mvd`.
[0069] For the syntax element structure shown in Figure 7, if a coding unit is to perform bidirectional prediction inter-frame coding in a non-merge mode, then before identifying the motion information of the coding unit, it is necessary to additionally identify the preconditions such as the current coding unit not selecting skip mode, being inter-frame coding, not being merge mode, and using bidirectional prediction. If the non-merge mode is a frequently occurring coding mode, then such a syntax element structure has a certain degree of system redundancy; conversely, if the skip mode is the most frequently occurring coding mode, and the non-merge mode inter-frame coding is a mode that is less likely to be selected, then the syntax element structure shown in Figure 7 is a more efficient and bit-saving approach.
[0070] However, related technologies use a fixed format for the order and dependencies of syntax elements in the coding unit, failing to consider that the frequency of each syntax element appearing in different video content varies, thus limiting encoding efficiency. Based on the above technical problems, this application proposes a novel video encoding / decoding technology that can flexibly select a suitable syntax element structure for the current coding region by comparing the structures of various candidate syntax elements, thereby improving the efficiency of video encoding / decoding.
[0071] The implementation details of the technical solutions in the embodiments of this application are described in detail below:
[0072] Figure 8 shows a flowchart of a video decoding method according to some embodiments of this application. This video decoding method can be executed by a device with computing processing capabilities, such as a terminal device or a server. Referring to Figure 8, the video decoding method includes at least steps S810 to S820, which are described in detail below:
[0073] In S810, a target syntax element structure is determined from at least two candidate syntax element structures. This target syntax element structure is used to indicate the decoding order of multiple syntax elements of the current region to be decoded.
[0074] In some embodiments, the syntax element structure can also be a decision tree of syntax elements, or a tree-shaped decision framework of syntax elements, comprising multiple nodes, wherein each node is divided into a root node, internal nodes, and leaf nodes. Each syntax element corresponds to a node in the decision tree. The root node is the starting point of the decision tree (i.e., the starting point of the decoding order), and the leaf node is the ending point of the decision tree (i.e., the ending point of the decoding order). The decision tree selects the optimal prediction mode for the coding unit through hierarchical syntax element judgments, in order to balance encoding / decoding efficiency and reconstruction quality.
[0075] In some embodiments, for the decoding end, the syntax element structure is mainly used to describe the decoding order between syntax elements. For example, the syntax element structure shown in Figure 7 describes the sequential decoding order and interdependencies between various syntax elements. In some embodiments, the candidate syntax element structure can be a pre-defined syntax element structure. For example, multiple syntax element structures can be set according to the syntax elements required at a certain stage of the encoding and decoding process. Different syntax element structures represent different decoding orders and dependencies of syntax elements.
[0076] In some embodiments, the current region to be decoded can be the current sequence, current image, current stripe, current CTU, or current block, etc. That is, the target syntax element structure can be applied to different levels, such as the current sequence, current image, current stripe, current CTU, current block, etc.
[0077] In some embodiments, the decoder can decode a flag bit from the video stream to indicate the target syntax element structure, and then determine the target syntax element structure used by the current region to be decoded from at least two candidate syntax element structures based on the value of the flag bit.
[0078] In some embodiments, the flags used to indicate the target syntax element structure may include one or more of the following: sequence-level flags, image-level flags, stripe-level flags, coding tree unit-level flags, and block-level flags. Specifically, the sequence-level flags indicate the target syntax element structure used in the current sequence, the image-level flags indicate the target syntax element structure used in the current image, the stripe-level flags indicate the target syntax element structure used in the current stripe, the coding tree unit-level flags indicate the target syntax element structure used in the current coding tree unit, and the block-level flags indicate the target syntax element structure used in the current block.
[0079] In some embodiments, if there are two candidate syntax element structures, i.e., including a first syntax element structure and a second syntax element structure, then if the flag used to indicate the target syntax element structure is a first value (e.g., 0 or 1), the current region to be decoded is indicated to use the first syntax element structure; if the flag used to indicate the syntax element structure is a second value, the current region to be decoded is indicated to use the second syntax element structure. In some embodiments, the first syntax element structure may be a default syntax element structure.
[0080] In some embodiments, if there are more than two candidate syntax element structures, a single bit can be used to indicate whether to select the default syntax element structure. If the bit indicates that the default syntax element structure should not be selected, additional bits can be used to indicate which specific syntax element structure to select.
[0081] In some embodiments, the decoding end can also determine the target syntax element structure used in the current region to be decoded through deduction. For example, the decoding end can count the frequency of multiple syntax elements appearing in the already decoded region to obtain syntax element statistics; then, based on the syntax element statistics, determine the target syntax element structure used in the current region to be decoded from at least two candidate syntax element structures. This is because if syntax elements that appear more frequently can be decoded (preferred judgment) first, the codec can prioritize processing high-probability events, complete the decision with fewer bits, and thus the encoding and decoding process will be more efficient and save the bits consumed by the encoded syntax elements. The multiple syntax elements in the already decoded region and the multiple syntax elements in the current region to be decoded can be the same or different. In some embodiments, the frequency of multiple syntax elements appearing in the already decoded region refers to the number of times or probability distribution of different syntax elements appearing in the already decoded region during the video decoding process. Therefore, in one embodiment, the frequency of each syntax element can be determined, and then, based on the positive correlation between the frequency of appearance and the decoding order (also known as the decision order or judgment order), the target syntax element structure used in the current region to be decoded can be determined from at least two candidate syntax element structures. In other words, the more times a grammatical element appears, the earlier it is decoded in the grammatical element structure (i.e., closer to the root node); conversely, the fewer times a grammatical element appears, the later it is decoded in the grammatical element structure (i.e., closer to the leaf node).
[0082] In some embodiments, the decoded region may include one or more of the following: a decoded target image, a decoded region in the current image, a decoded region adjacent to the current region to be decoded, and a decoded region located at the same position as the current region to be decoded in the reference region.
[0083] In some embodiments, if the decoded region includes a decoded target image, when calculating the frequency of occurrence of syntax elements in the decoded region, the frequency of occurrence of multiple syntax elements in the decoded target image can be calculated. These multiple syntax elements in the target image and the multiple syntax elements in the current region to be decoded may be the same or different. The decoding order of the target image precedes the decoding order of the current image containing the current region to be decoded. In other words, in this embodiment, the frequency of occurrence of syntax elements in previously decoded images can be calculated.
[0084] In some embodiments, the current image and the target image may have the same temporal hierarchy. It should be noted that having the same temporal hierarchy means that the image frames have similar positional relationships on the timeline or are in the same relative position within the reference structure. For example, in a typical Group of Pictures (GOP) structure, I-frames (keyframes) are usually at the highest level because they do not depend on any other frames for decoding; while P-frames and B-frames depend on I-frames or other P / B frames, and they are located at lower levels. If two image frames occupy the same position in their respective GOP structures (e.g., both are the first P-frame starting from an I-frame), then these two frames can be considered to have the same temporal hierarchy.
[0085] In some embodiments, if the decoded region includes a decoded region in the current image, when calculating the frequency of occurrence of syntax elements in the decoded region, the frequency of occurrence of multiple syntax elements in the decoded region in the current image can be calculated; wherein, the current image is the image containing the region to be decoded. In other words, in this embodiment, the frequency of occurrence of multiple syntax elements in previously decoded regions in the current image can be calculated. In some embodiments, the frequency of occurrence of multiple syntax elements in decoded regions adjacent to the current region to be decoded in the current image can be calculated.
[0086] In some embodiments, if the decoded region includes a decoded region adjacent to the current region to be decoded, or a decoded region located at the same position as the current region to be decoded in the reference region, when calculating the frequency of the syntax elements of the decoded region, the frequency of the syntax elements of the decoded regions spatially adjacent to the current region to be decoded can be calculated, or the frequency of the syntax elements of the decoded regions located at the same position in the reference region of the current region to be decoded can be calculated. For example, for a coded block, the frequency of the syntax elements of the decoded blocks surrounding the coded block can be calculated, or the frequency of the syntax elements of the co-occurring blocks of the coded block (such as the co-occurring blocks of the current block in the reference frame) can be calculated, or the frequency of the syntax elements of the decoded blocks surrounding the coded block and the frequency of the syntax elements of the co-occurring blocks in the temporal domain of the coded block can be calculated simultaneously.
[0087] It should be noted that the frequency calculation schemes for statistical syntax elements described in the above embodiments can be implemented individually or in combination. For example, the statistical results of multiple statistical schemes in the above embodiments can be combined to obtain the final statistical result.
[0088] In S820, the plurality of syntax elements are decoded from the bitstream according to the decoding order of the syntax elements indicated by the target syntax element structure, and the current region to be decoded is decoded based on the plurality of decoded syntax elements.
[0089] In some embodiments, the relevant information (multiple syntax elements) used in the decoding process of the current region to be decoded in the bitstream is obtained sequentially according to the decoding order of the syntax elements indicated by the target syntax element structure. These information include block partitioning information, prediction mode information, transformation and quantization information, etc. Then, the decoding process described in the foregoing embodiments of this application is used to perform decoding based on this information.
[0090] Figure 8 illustrates the technical solution of the embodiments of this application from the perspective of video decoding. The technical solution of the embodiments of this application will be described again below from the perspective of video encoding with reference to Figure 8.
[0091] Figure 9 illustrates a flowchart of a video encoding method according to some embodiments of this application. This video encoding method can be executed by a device with computing processing capabilities, such as a terminal device or a server. Referring to Figure 9, the video encoding method includes at least steps S910 to S920, which are described in detail below:
[0092] In S910, a target syntax element structure for the current encoding region is selected from at least two candidate syntax element structures. This target syntax element structure is used to indicate the encoding order of multiple syntax elements of the current encoding region.
[0093] In some embodiments, the target syntax element structure may be a decision tree comprising multiple nodes, each of the multiple syntax elements corresponding to a node in the decision tree, the root node of the decision tree being the starting point of the encoding order (decision order), and the leaf nodes of the decision tree being the ending point of the encoding order (decision order).
[0094] In some embodiments, for the encoding end, the syntax element structure is mainly used to describe the encoding order between syntax elements. For example, the syntax element structure shown in Figure 7 describes the sequential encoding order and interdependencies between various syntax elements. In some embodiments, the candidate syntax element structure can be a pre-defined syntax element structure. For example, multiple syntax element structures can be set according to the syntax elements required at a certain stage of the encoding and decoding process. Different syntax element structures represent different syntax element encoding orders and dependencies.
[0095] In some embodiments, the current coding region may be the current sequence, the current image, the current stripe, the current CTU, or the current block, etc.
[0096] In some embodiments, the encoder can determine the target syntax element structure used in the current encoding region through deduction. For example, the encoder can count the frequency of multiple syntax elements in the encoded region to obtain syntax element statistics; then, based on the syntax element statistics, it selects the target syntax element structure used in the current encoding region from at least two candidate syntax element structures. The syntax element with higher frequency appears earlier in the target syntax element structure, i.e., closer to the root node. This is because if syntax elements with higher frequency are encoded first, the encoder can prioritize processing high-probability events, directly entering low-overhead encoding paths from high-probability branches, making the encoding process more efficient and saving bits consumed by encoding syntax elements. Therefore, in some embodiments, the frequency of each syntax element can be determined, and then, based on the positive correlation between frequency and encoding order, the target syntax element structure used in the current encoding region can be selected from at least two candidate syntax element structures. That is, if a syntax element appears more frequently, its encoding order in the syntax element structure is earlier, i.e., closer to the root node; conversely, if a syntax element appears less frequently, its encoding order in the syntax element structure is later, i.e., closer to the leaf node. Among them, multiple syntax elements of the encoded region and multiple syntax elements of the currently encoded region can be the same or different.
[0097] In some embodiments, the encoded region may include one or more of the following: an encoded target image, an encoded region in the current image, an encoded region adjacent to the encoded region, and an encoded region in a reference region located at the same position as the encoded region.
[0098] If the encoded region includes an encoded target image, when calculating the frequency of syntax elements in the encoded region, the frequency of syntax elements in the encoded target image can be calculated to obtain syntax element statistics. The encoding order of the target image precedes the encoding order of the current image containing the current encoded region. In other words, in this embodiment, the frequency of syntax elements in previously encoded images can be calculated. In some embodiments, the temporal hierarchy of the current image and the target image can be the same.
[0099] In some embodiments, if the encoded region includes the encoded region in the current image, when calculating the frequency of syntax elements appearing in the encoded region, the frequency of syntax elements appearing in the encoded region in the current image can be calculated to obtain the syntax element statistics; wherein, the current image is the image containing the current encoded region. In other words, in this embodiment, the frequency of syntax elements appearing in previously encoded regions in the current image can be calculated. In some embodiments, the frequency of syntax elements appearing in encoded regions adjacent to the current encoded region in the current image can be calculated.
[0100] In some embodiments, the encoded region may include encoded regions adjacent to the current encoded region, and / or encoded regions in the reference region located at the same position as the current encoded region. When calculating the frequency of syntax elements in encoded regions, the frequency of syntax elements in spatially adjacent encoded regions of the current encoded region can be calculated, as can the frequency of syntax elements in encoded regions in the reference region located at the same position as the current encoded region. For example, for a coded block, the frequency of syntax elements in surrounding coded blocks can be calculated, as can the frequency of syntax elements in temporally co-located blocks of the coded block (such as co-located blocks of the current block in the reference frame) can be calculated, or the frequency of syntax elements in surrounding coded blocks and temporally co-located blocks of the coded block can be calculated simultaneously.
[0101] It should be noted that the frequency calculation schemes for statistical syntax elements described in the above embodiments can be implemented individually or in combination. For example, the statistical results of multiple statistical schemes in the above embodiments can be combined to obtain the final statistical result.
[0102] In some embodiments, the encoder can also calculate the number of encoded bits generated when encoding the syntax elements of the current encoding region using at least two candidate syntax element structures respectively; then the syntax element structure with the fewest encoded bits is used as the target syntax element structure, which can reduce the bits consumed by encoding syntax elements and improve encoding efficiency.
[0103] In S920, the multiple syntax elements of the current encoding region are encoded into the bitstream according to the encoding order of the multiple syntax elements indicated by the target syntax element structure.
[0104] In some embodiments, after determining the target syntax element structure, the encoder may add a flag bit to the video bitstream to indicate the target syntax element structure, so that the decoder can determine the target syntax element structure used in the current encoding region based on the flag bit decoded from the video bitstream.
[0105] In summary, the technical solution of this application can select a suitable syntax element structure for the current encoding region according to specific encoding and decoding conditions (such as video content characteristics), thereby achieving the goal of flexibly adjusting the syntax element structure. This is beneficial for optimizing the encoding and decoding order of corresponding syntax elements according to different encoding regions, and can also reduce unnecessary encoding and decoding processes and data redundancy of encoded syntax elements, thereby accelerating the entire encoding and decoding process, reducing computational complexity, and improving overall encoding and decoding efficiency.
[0106] The following section uses a specific grammatical element structure as an example to elaborate on the implementation details of the technical solution in the embodiments of this application:
[0107] In one specific embodiment of this application, taking the indication of whether it is a skip mode or a merge mode through syntax elements as an example, Figures 7, 10, and 11 show three candidate syntax element structures. The encoder and decoder can flexibly select the corresponding syntax element structure for syntax element encoding and decoding according to the actual situation. That is, each candidate syntax element structure is known to both the encoder and decoder. Once a syntax element structure is selected for the current encoding unit, both the encoder and decoder will perform encoding and decoding operations on the syntax element according to the same rule.
[0108] In some embodiments, the encoder can determine which candidate syntax element structure is most suitable for the current coding region based on statistical data of the frequency of syntax elements in previously encoded images. In some embodiments, the previously encoded images and the current image containing the current coding region can be restricted to having the same temporal level, i.e., they are in similar positions in the reference frame structure. In some embodiments, the decoder can also use the same rules to derive and select the appropriate syntax element structure, thus eliminating the need to identify the selection result using flag bits in the bitstream.
[0109] In some embodiments, the encoder can determine which candidate syntax element structure is most suitable for the current encoding region based on statistical data of the frequency of syntax elements in neighboring encoded regions in the current image. In some embodiments, the decoder can also use the same rules to deduce and select the corresponding syntax element structure, thus eliminating the need to identify the selection result using flags in the bitstream.
[0110] In some embodiments, the encoder can determine which candidate syntax element structure is most suitable for the current coding region based on the frequency statistics of syntax elements in spatially adjacent encoded regions and encoded regions at the same position in the encoded image. In some embodiments, the decoder can also use the same rules to derive and select the corresponding syntax element structure, thus eliminating the need to identify the selection result using flags in the bitstream.
[0111] In some embodiments, the encoder may also encode the syntax elements of the current encoding region using each candidate syntax element structure (as shown in Figures 7, 10 and 11), and then select the syntax element structure with the fewest generated encoding bits.
[0112] In some embodiments, after determining the syntax element structure to be used, the encoding end can identify the selected syntax element structure in the bitstream. The location of this identification in the video bitstream can be the initial position of a coding region. In some embodiments, the coding region can be an image sequence, an image, a stripe, or a CTU, etc., which contains one or more coding units. In some embodiments, the initial position of the identification in a coding region means that the identification can be located in the image sequence header, image header, stripe header, or CTU header.
[0113] In some embodiments, if the total number of candidate syntax element structures (including the default syntax element structure) is 2, then the identifier can be expressed by one bit. The specific expression method is as follows: if the flag bit is 0 (or 1), then the default syntax element structure (the syntax element structure shown in Figure 7) is selected; otherwise, another candidate syntax element structure is selected.
[0114] In some embodiments, if there are more than two candidate syntax element structures, the identifier will be more than one bit. Specifically, it can be expressed as follows: use one sign bit to indicate whether the default syntax element structure is selected. If the value of the identifier bit indicates that the default syntax element structure is not selected (e.g., the value is 0 or 1), then additional bits are used to indicate which specific candidate syntax element structure is selected.
[0115] In some embodiments, when there are two non-default syntax element structures (for example, the default syntax element structure is the syntax element structure shown in Figure 7, and the non-default syntax element structures are the syntax element structures shown in Figures 10 and 11), then the extra bit can be 1 bit, and the value of this bit is 0 or 1 to indicate which specific candidate syntax element structure is selected.
[0116] In some embodiments of this application, when decoding (or encoding) the current encoding region, the target syntax element structure used by the current encoding region is selected from at least two candidate syntax element structures. Then, according to the decoding order (or encoding order) of the syntax elements indicated by the selected target syntax element structure, multiple syntax elements are decoded from the video bitstream (or multiple syntax elements are encoded into the video bitstream). This allows for the selection of a suitable syntax element structure for the current encoding region based on specific encoding and decoding conditions (such as video content characteristics), achieving the goal of flexibly adjusting the syntax element structure. This is beneficial for optimizing the encoding and decoding order of corresponding syntax elements according to different encoding regions, and can also reduce unnecessary encoding and decoding processes and data redundancy of encoded syntax elements, accelerating the entire encoding and decoding process, reducing computational complexity, and improving overall encoding and decoding efficiency.
[0117] As can be seen, the technical solutions of this application can select a suitable syntax element structure for the current encoding region from a variety of syntax element arrangement orders (i.e., syntax element structures), reducing the cost of entropy coding and thus improving coding efficiency. The technical solutions of the various embodiments shown above can be used individually or in combination. Furthermore, the technical solutions of this application can be applied to video codecs, video pre- and post-processing, video compression, and other related products.
[0118] The following describes an apparatus embodiment of this application, which can be used to perform the methods described in the above embodiments of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the method embodiments described above.
[0119] Figure 12 shows a block diagram of a video decoding apparatus according to some embodiments of the present application. The video decoding apparatus can be installed in a device with computing processing capabilities, such as a terminal device or a server.
[0120] Referring to FIG12, a video decoding apparatus 1200 according to some embodiments of the present application includes: a determining unit 1202 and a decoding unit 1204.
[0121] The determining unit 1202 is configured to determine the target syntax element structure used by the current region to be decoded from at least two candidate syntax element structures, wherein the target syntax element structure is used to indicate the decoding order of multiple syntax elements of the current region to be decoded; the decoding unit 1204 is configured to decode the multiple syntax elements from the bitstream according to the decoding order of the multiple syntax elements indicated by the target syntax element structure, and decode the current region to be decoded according to the decoded multiple syntax elements.
[0122] Figure 13 shows a block diagram of a video encoding apparatus according to some embodiments of the present application. The video encoding apparatus can be installed in a device with computing processing capabilities, such as a terminal device or a server.
[0123] Referring to FIG13, a video encoding apparatus 1300 according to some embodiments of the present application includes: a determining unit 1302 and an encoding unit 1304.
[0124] The determining unit 1302 is configured to select a target syntax element structure used by the current encoding region from at least two candidate syntax element structures, wherein the target syntax element structure is used to indicate the encoding order of multiple syntax elements of the current encoding region; the encoding unit 1304 is configured to encode multiple syntax elements of the current encoding region into the bitstream according to the encoding order of the multiple syntax elements indicated by the target syntax element structure.
[0125] Figure 14 shows a schematic diagram of the structure of a computer system suitable for implementing the computer device of the present application. The computer device may be a video encoding device or a video decoding device in the foregoing embodiments.
[0126] It should be noted that the computer system 1400 of the computer device shown in Figure 14 is only an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0127] As shown in Figure 14, the computer system 1400 may include a Central Processing Unit (CPU) 1401, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 1402 or programs loaded from storage portion 1408 into Random Access Memory (RAM) 1403, such as performing the methods described in the above embodiments. The RAM 1403 also stores various programs and data required for system operation. The CPU 1401, ROM 1402, and RAM 1403 are interconnected via a bus 1404. An Input / Output (I / O) interface 1405 is also connected to the bus 1404.
[0128] The following components can be connected to I / O interface 1405: an input section 1406 including a keyboard, mouse, etc.; an output section 1407 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1408 including a hard disk, etc.; and a communication section 1409 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 1409 performs communication processing via a network such as the Internet. A drive 1410 is also connected to I / O interface 1405 as needed. Removable media 1411, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1410 as needed so that computer programs read from them can be installed into storage section 1408 as needed.
[0129] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1409, and / or installed from removable medium 1411. When the computer program is executed by central processing unit (CPU) 1401, it performs various functions defined in the system of this application.
[0130] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a computer program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. The transmitted data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0131] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and a computer program.
[0132] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.
[0133] In another aspect, this application also provides a computer-readable medium, which may be included in the computer device described in the above embodiments; or it may exist independently and not assembled into the computer device. The computer-readable medium carries one or more computer programs, which, when executed by the computer device, cause the computer device to perform the methods described in the above embodiments.
[0134] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0135] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, and includes several instructions to cause a computer device to execute the method according to the embodiments of this application.
[0136] For example, a computer device can be a video decoding device, in which case the video decoding device can perform the video decoding method shown in Figure 8; or, for instance, a computer device can be a video encoding device, in which case the video encoding device can perform the video encoding method shown in Figure 9.
[0137] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0138] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A video decoding method, executed by an electronic device, comprising: From at least two candidate syntax element structures, determine the target syntax element structure used by the current region to be decoded, the target syntax element structure being used to indicate the decoding order of multiple syntax elements of the current region to be decoded; According to the decoding order of the plurality of syntax elements indicated by the target syntax element structure, the plurality of syntax elements are decoded from the bitstream, and the current region to be decoded is decoded according to the plurality of syntax elements obtained by decoding.
2. The video decoding method according to claim 1, wherein, The target syntax element structure is a decision tree comprising multiple nodes, each syntax element corresponding to a node in the decision tree, the root node of the decision tree being the starting point of the decoding order, and the leaf nodes of the decision tree being the ending point of the decoding order.
3. The video decoding method according to claim 1 or 2, wherein, From at least two candidate syntax element structures, determine the target syntax element structure used by the current region to be decoded, including: Decode the flag bits used to indicate the structure of the target syntax element from the video stream; Based on the value of the flag bit, the target syntax element structure used by the current region to be decoded is determined from the at least two candidate syntax element structures.
4. The video decoding method according to claim 3, wherein, The flag bits include one or more of the following: sequence-level flag bits, image-level flag bits, stripe-level flag bits, coding tree unit-level flag bits, and block-level flag bits; The sequence-level flag is used to indicate the target syntax element structure used in the current sequence, the image-level flag is used to indicate the target syntax element structure used in the current image, the strip-level flag is used to indicate the target syntax element structure used in the current strip, the coding tree unit-level flag is used to indicate the target syntax element structure used in the current coding tree unit, and the block-level flag is used to indicate the target syntax element structure used in the current block.
5. The video decoding method according to claim 3 or 4, wherein, The candidate syntax element structure includes a first syntax element structure and a second syntax element structure; If the flag bit is a first value, it indicates that the current region to be decoded uses the first syntax element structure; if the flag bit is a second value, it indicates that the current region to be decoded uses the second syntax element structure.
6. The video decoding method according to claim 1 or 2, wherein, From at least two candidate syntax element structures, determine the target syntax element structure used by the current region to be decoded, including: The frequency of syntax elements in the decoded region is counted to obtain the syntax element statistics. Based on the statistical values of the syntax elements, the target syntax element structure used by the current region to be decoded is determined from the at least two candidate syntax element structures, wherein the syntax elements with higher frequency appear earlier in the target syntax element structure.
7. The video decoding method according to claim 6, wherein, The decoded region includes: a decoded target image, wherein the decoding order of the target image is prior to the decoding order of the current image containing the current region to be decoded.
8. The video decoding method according to claim 7, wherein, The current image and the target image have the same temporal hierarchy.
9. The video decoding method according to claim 6, wherein, in, The decoded region includes the decoded region in the current image, wherein the current image is the image containing the current region to be decoded.
10. The video decoding method according to claim 9, wherein, The decoded region in the current image is the decoded region in the current image that is adjacent to the current region to be decoded.
11. The video decoding method according to claim 6, wherein, Decoded regions include at least one of the following: The currently undecoded region is spatially adjacent to the already decoded region; The reference area is the decoded area that is in the same position as the current area to be decoded.
12. A video encoding method, performed by an electronic device, comprising: From at least two candidate syntax element structures, a target syntax element structure is selected for use in the current encoding region, the target syntax element structure being used to indicate the encoding order of multiple syntax elements in the current encoding region; According to the encoding order of the plurality of syntax elements indicated by the target syntax element structure, the plurality of syntax elements of the current encoding region are encoded into the bitstream.
13. The video encoding method according to claim 12, further comprising: Add a flag bit to the video bitstream to indicate the structure of the target syntax element.
14. The video encoding method according to claim 12 or 13, wherein, The target syntax element structure used by the current encoding region is selected from at least two candidate syntax element structures, including: Calculate the number of encoded bits generated by encoding multiple syntax elements of the current encoding region using the at least two candidate syntax element structures respectively; The syntax element structure with the fewest generated encoded bits is taken as the target syntax element structure.
15. A video decoding device, characterized in that, include: The determining unit is configured to determine, from at least two candidate syntax element structures, the target syntax element structure used to indicate the decoding order of multiple syntax elements of the current region to be decoded; The decoding unit is configured to decode the plurality of syntax elements from the bitstream according to the decoding order of the plurality of syntax elements indicated by the target syntax element structure, and to decode the current region to be decoded according to the decoded plurality of syntax elements.
16. A video encoding device, characterized in that, include: The determining unit is configured to select, from at least two candidate syntax element structures, the target syntax element structure used by the current encoding region, wherein the target syntax element structure is used to indicate the encoding order of multiple syntax elements of the current encoding region; The encoding unit is configured to encode the plurality of syntax elements of the current encoding region into a bitstream according to the encoding order of the plurality of syntax elements indicated by the target syntax element structure.
17. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the video decoding method according to any one of claims 1 to 11; or implements the video encoding method according to any one of claims 12 to 14.
18. A computer device, comprising: One or more processors; A memory for storing one or more computer programs that, when executed by one or more processors, cause the computer device to implement the video decoding method of any one of claims 1 to 11; or to implement the video encoding method of any one of claims 12 to 14.
19. A computer program product comprising a computer program stored in a computer-readable storage medium, wherein a processor of a computer device reads from the computer-readable storage medium and executes the computer program, causing the computer device to perform the video decoding method of any one of claims 1 to 11; or to perform the video encoding method of any one of claims 12 to 14.
20. A method for storing a video stream, comprising: A video stream is stored, wherein the video stream is generated by the video encoding method according to any one of claims 12 to 14.
