Video decoding method, video encoding method, storage medium, electronic device and product
By introducing filter flags into the high-level syntax of video encoding and decoding, the redundant transmission problem of adaptive loop filters is solved, thus improving encoding and decoding performance.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2025-01-13
- Publication Date
- 2026-04-23
AI Technical Summary
In existing technologies, adaptive loop filters suffer from redundant transmission issues in video encoding and decoding, leading to a decrease in encoding and decoding performance.
By introducing filter flags in the high-level syntax of video encoding and decoding, tap coefficient information in filter parameters is implicitly transmitted, reducing redundant data transmission.
It improves the performance of video encoding and decoding and reduces redundant data in the video stream.
Smart Images

Figure CN2025072061_23042026_PF_FP_ABST
Abstract
Description
Video decoding methods, video encoding methods, storage media, electronic devices and products
[0001] This application claims priority and benefits to patent application No. 202410060332.2, filed with the China National Intellectual Property Administration on January 15, 2024, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application belongs to the field of video encoding and decoding technology, and in particular relates to a video decoding method, a video encoding method, a computer-readable storage medium, an electronic device, and a computer program product. Background Technology
[0003] The nonlinear limiting operation and the increasing number of filter taps used in Adaptive Loop Filtering (ALF) improve the filtering quality of ALF, but also require more parameters to be transmitted to the decoding end, resulting in redundant transmission and hindering the improvement of encoding and decoding performance. Summary of the Invention
[0004] This application aims to at least solve one of the technical problems existing in the prior art. To this end, this application proposes a video decoding method, a video encoding method, a computer-readable storage medium, an electronic device, and a computer program product, which can reduce redundant transmission and improve encoding and decoding performance.
[0005] In a first aspect, this application provides a video decoding method comprising: acquiring a video bitstream, the video bitstream including decoding indication information, the decoding indication information including at least one filter flag bit for indicating filter parameters; determining tap coefficient information in the filter parameters based on the value of the filter flag bit; and determining the filter parameters based on the tap coefficient information.
[0006] Secondly, this application provides a video encoding method including acquiring video data; encoding and compressing the video data to obtain a video stream, the video stream including decoding indication information, the decoding indication information including at least one filter flag bit for indicating filter parameters, the filter flag bit being determined based on tap coefficient information, the tap coefficient information being determined based on the filter parameters.
[0007] Thirdly, this application provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described video decoding method or video encoding method.
[0008] Fourthly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described video decoding method or video encoding method.
[0009] Fifthly, this application provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described video decoding method or video encoding method.
[0010] The video encoding method, video decoding method, computer-readable storage medium, and electronic device provided in this application introduce filter flag bits into the high-level syntax (i.e., decoding indication information) of video encoding and decoding to indicate the decoding of filter parameters with redundant data during transmission. This achieves implicit transmission of filter parameters with redundant data during transmission, reduces redundant data in the video bitstream, and thus helps improve encoding and decoding performance. Attached Figure Description
[0011] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0012] Figure 1 is a schematic diagram of the video encoding principle provided in an embodiment of this application;
[0013] Figure 2 is a schematic diagram of the inter-frame prediction principle provided in an embodiment of this application;
[0014] Figure 3 is a schematic diagram of the sheet structure provided in an embodiment of this application;
[0015] Figure 4 is a schematic diagram of the filtering principle of the universal video coding filter provided in the embodiments of this application;
[0016] Figure 5 is a schematic diagram of the shape of the filter provided in an embodiment of this application;
[0017] Figure 6 is a schematic diagram of the shape of the filter provided in an embodiment of this application;
[0018] Figure 7 is a schematic diagram of the video encoding and decoding system provided in an embodiment of this application;
[0019] Figures 8 to 16 are schematic flowcharts of the video decoding method provided in the embodiments of this application;
[0020] Figure 17 is a flowchart illustrating the video encoding method provided in an embodiment of this application;
[0021] Figure 18 is a schematic diagram of the video decoding device provided in an embodiment of this application;
[0022] Figure 19 is a schematic diagram of the video encoding device provided in an embodiment of this application;
[0023] Figure 20 is a schematic diagram of the structure of the electronic device provided in an embodiment of this application;
[0024] Figure 21 is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of this application. Detailed Implementation
[0025] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0026] The following is a description of some of the technical terms used in this application:
[0027] 1. Video encoding:
[0028] 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.
[0029] Please refer to Figure 1. Modern mainstream video coding technologies, taking the international video coding standards HEVC / H.265 (High Efficiency Video Coding), VVC, and AVS3 as examples, employ a hybrid coding framework to perform the following series of operations and processing on the input raw video signal:
[0030] (1) Block partition structure: The input video pictures are divided into several non-overlapping processing units based on their size. Each processing unit will undergo a similar compression operation. This processing unit is called a CTU or LCU. Further subdivisions can be made below the CTU to obtain one or more basic coding units, called CUs. Each CU is the most basic element in a coding process. The following describes the various coding methods that can be used for each CU.
[0031] (2) Predictive Coding: This includes intra-picture prediction and inter-frame prediction. The original video signal is predicted by the selected reconstructed video signal to obtain the residual video signal. The encoder needs to select the most suitable predictive coding mode from among many possible modes for the current CU and inform the decoder.
[0032] Currently, mainstream video coding standards such as HEVC, VVC (Versatile Video Coding), and AVS3 (Audio Video Coding Standard 3), the first-generation video coding standard AV1 (Alliance for Open Media Video 1) developed by the Open Media Alliance, and the second-generation video coding standard AV2 (Alliance for Open Media Video 2) developed by the Open Media Alliance, all adopt a block-based hybrid coding framework. They divide the raw video data into a series of coded blocks and combine video coding methods such as prediction, transform, and entropy coding to achieve video data compression. Among these, motion compensation is a commonly used prediction method in video coding. Motion compensation is based on the redundancy characteristics of video content in the temporal or spatial domains, deriving the predicted value of the current coded block from the already coded regions. These prediction methods include inter-frame prediction, intra-frame block copy prediction, and intra-frame string copy prediction, which may be used individually or in combination in specific coding implementations. For coded blocks that use these prediction methods, it is usually necessary to explicitly or implicitly encode one or more two-dimensional displacement vectors in the bitstream to indicate the displacement of the current block (or its sibling block) relative to one or more of its reference blocks.
[0033] It is important to note that the displacement vector may have different names depending on the prediction mode and implementation. This article will uniformly describe them as follows: 1) The displacement vector in inter-frame prediction is called the motion vector (MV); 2) The displacement vector in intra-frame block copying is called the block vector (BV); 3) The displacement vector in intra-frame string copying is called the string vector (SV). The following section introduces the relevant techniques in inter-frame prediction and intra-frame block copying prediction.
[0034] a. Intra-frame prediction: The predicted signal comes from a region within the same image that has already been encoded and reconstructed.
[0035] b. Inter-frame prediction: The predicted signal comes from other images that have already been encoded and are different from the current image (called reference images).
[0036] As shown in Figure 2, inter-frame prediction utilizes the correlation in the video's temporal domain to predict the pixels of the current image using pixels from neighboring encoded images. This effectively removes temporal redundancy and saves bits of encoded residual data. Here, P is the current frame, Pr is the reference frame, B is the current block to be encoded, and Br is the reference block for B. B' and B have the same coordinates in the image; Br's coordinates are (xr, yr), and B''s coordinates are (x, y). The displacement between the current encoded block and its reference block is called the motion vector (MV), i.e., MV = (xr - x, yr - y).
[0037] Considering the strong correlation between neighboring blocks in the temporal or spatial domains, MV prediction techniques can be used to further reduce the bits required to encode MVs. In H.265 / HEVC, inter-frame prediction includes two MV prediction techniques: Merge and AMVP.
[0038] (3) Transform Coding and Quantization: The residual video signal undergoes transformation operations such as Discrete Fourier Transform (DFT) and Discrete Cosine Transform (DCT) to convert the signal into the transform domain, which are called transform coefficients. In the transform domain, the signal undergoes further lossy quantization, losing some information, making 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 transforms for the current encoding CU and inform the decoder. The fineness of quantization is usually determined by the quantizer 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.
[0039] (4) Entropy Coding or Statistical Coding: The quantized transform domain signal is statistically compressed and encoded based on the frequency of each value, finally outputting a binary (0 or 1) compressed bitstream. Simultaneously, other information generated during encoding, such as the selected mode and motion vectors, also requires entropy coding to reduce the bit rate. Statistical coding is a lossless coding method that can effectively reduce the bit rate required to represent the same signal. Common statistical coding methods include Variable Length Coding (VLC) or Content Adaptive Binary Arithmetic Coding (CABAC).
[0040] (5) Loop Filtering: The encoded image undergoes inverse quantization (scaling & inv.transform), inverse transform, and prediction compensation operations (the reverse operations of (2) to (4) above) to obtain the reconstructed decoded image. Compared with the original image, the reconstructed image has some information that differs from the original image due to the influence of quantization, resulting in distortion. Filtering the reconstructed image, such as deblocking, Sample Adaptive Offset (SAO), or ALF filters, can effectively reduce the degree of distortion caused by quantization. Since these filtered reconstructed images will be used as a reference for subsequent encoded images to predict future signals, the above filtering operations are also called loop filtering, or filtering operations within the coding loop.
[0041] 2. Video Decoding: This is the inverse process of video encoding. Based on the encoding process described above, it can be seen that at the decoding end, for each CU, after obtaining the video bitstream, the decoder first performs entropy decoding to obtain various mode information and quantized transform coefficients. Each coefficient undergoes inverse quantization and inverse transform to obtain the residual signal. On the other hand, based on the known encoding mode information, the prediction signal corresponding to that CU can be obtained. Adding the two together yields the reconstructed signal. Finally, the reconstructed value of the decoded image needs to undergo loop filtering to generate the final output signal.
[0042] 3. Video stream structure
[0043] (1) Video sequence
[0044] A video sequence is the highest-level syntactic structure of a bitstream (i.e., a video bitstream). A video sequence begins with a first sequence header, and an end-of-sequence code or video edit code indicates the end of a video sequence. The sequence header between the first sequence header and the first occurrence of an end-of-sequence code or video edit code is a repeating sequence header. Each sequence header is followed by one or more coded images, each preceded by an image header. The coded images are arranged in bitstream order, which should be the same as the decoding order. The decoding order may differ from the display order.
[0045] (2) Image
[0046] An image can be a frame or a field, and its encoded data starts with the image start code and ends with the sequence start code, sequence end code, or the next image start code.
[0047] Image types include: I-frames; P-frames; and B-frames. A fully encoded frame is called an I-frame. A frame generated by referencing a previous I-frame and only containing the differences is called a P-frame. There is also a type of frame that is encoded by referencing both preceding and following frames, called a B-frame.
[0048] (3 pieces)
[0049] A slice is a rectangular region in an image (such as region A, region B, etc.), containing a portion of the image containing several maximum coding units. Slices should not overlap. The slice structure is shown in Figure 3.
[0050] (4) Maximum coding unit, coding tree and coding unit
[0051] The image is divided into maximum coding units (such as coding tree units (CTUs) in video coding). Maximum coding units should not overlap. The sample in the upper left corner of the maximum coding unit should not exceed the image boundary, while the sample in the lower right corner of the maximum coding unit can exceed the image boundary.
[0052] The coding tree determines how the largest coding unit is divided into multiple coding units (such as CUs in video coding), such as binary trees, quadtrees, and enhanced quadtrees. One coding unit can be a block of images.
[0053] The coding unit is divided into one or more transform blocks, which are the basic units for transform coding.
[0054] 4. ALF and Cross-Component Adaptive Loop Filtering (CCALF) in Versatile Video Coding (VVC)
[0055] As newly adopted loop filters in VVC, ALF and CCALF are Wiener filters that adaptively determine filter coefficients based on different video content, thereby reducing the mean square error (MSE) between the reconstructed and original components. The input to ALF is the reconstructed pixel values before ALF processing, and the output is an enhanced reconstructed luminance and chrominance image. As an adaptive filter, the Wiener filter can generate different filter coefficients for video content with different characteristics. Therefore, ALF first needs to classify the video content and apply the corresponding filter to each category. In the VVC design, each 4x4 block is divided into one of 25 categories based on its directionality and activity. The corresponding filter coefficients are calculated for each category of video content.
[0056] For the luma component, in addition to 4x4 block-level adaptation, VVC also supports CTU-level ALF adaptive switching. Each CTU can use the filter bank generated by the current slice, the filter bank generated by pre-coded slices, or a fixed set of filters from 16 offline-trained fixed filter banks. Within the CTU, each 4x4 block selects filters of the corresponding category from the filter bank based on its own category. The filter coefficients of the Adaptation Parameter Set (APS) and the corresponding clipping index are transmitted to the decoder via the ALF_APS. An ALF_APS can contain one luma filter bank (containing up to 25 filters) and up to 8 chroma filters.
[0057] CCALF uses the luminance component to correct the chrominance component. The processing flow of ALF and CCALF is shown in Figure 4. CCALF uses the luminance component as input and outputs the corrected value for the chrominance component. The two chrominance components can be independently controlled to use their corresponding corrected values. These corrected values, together with the output of the chrominance ALF, constitute the final chrominance component.
[0058] 4.1 ALF Filter Shape
[0059] In VVC[1], ALF uses two different rhombus filters as shown in Figure 5. The luminance component uses a 7x7 rhombus filter, and the chrominance component uses a 5x5 rhombus filter.
[0060] 4.2 Pixel Block Classification and Geometric Transformation
[0061] For the luma component, ALF adaptively uses different filters at the sub-block level (4x4), meaning each 4x4 pixel block needs to be divided into one of 25 classes. For the chroma component, ALF does not need to classify pixels at the sub-block level; all chroma pixels within a CTU use the same filter. The classification index C of the luma component pixel block is determined by the block's directionality D and quantized activity. The formula obtained jointly is as follows:
[0062] To calculate D and First, we need to calculate the horizontal, vertical, diagonal, and anti-diagonal gradient values for each pixel within the 4x4 pixel block: H k,l =|2R(k,l)-R(k-1,l)-R(k+1,l)|#(2-2) V k,l =|2R(k,l)-R(k,l-1)-R(k,l+1)|#(2-3) D0 k,l =|2R(k,l)-R(k-1,l-1)-R(k+1,l+1)|#(2-4) D1 k,l =|2R(k,l)-R(k-1,l+1)-R(k+1,l-1)|#(2-5)
[0063] Based on pixel gradients, the overall horizontal, vertical, diagonal, and anti-diagonal gradients of each 4x4 block are calculated as follows:
[0064] Where i and j represent the coordinates of the top-left pixel of the 4x4 pixel block, and R(k,l) represents the reconstructed pixel value at position (k,l) before ALF filtering.
[0065] After obtaining the gradient values of the pixel blocks, the maximum and minimum values of the gradients in the horizontal and vertical directions are respectively:
[0066] The maximum and minimum values of the gradients in the diagonal and anti-diagonal directions are respectively:
[0067] The directional feature D is derived by comparing the maximum and minimum values of the gradients in the four directions obtained from equations (2-8)-(2-9):
[0068] Step 1: If and If both conditions are met, then D is set to 0.
[0069] Step 2: If If yes, proceed to Step 3; otherwise, proceed to Step 4.
[0070] Step 3: If Then set D to 2; otherwise set D to 1.
[0071] Step 4: If Then D is set to 4; otherwise, D is set to 3.
[0072] Activity characteristic A is calculated using the following formula:
[0073] Activity feature A will be quantized to the range [0-4] as the quantized activity feature.
[0074] Before filtering each 4x4 luminance block, the filter coefficients and corresponding limiting values are geometrically transformed according to the gradient value of the current block, following the rules in Table 2-1. These transformations include no transformation, diagonal transformation, vertical flip, and rotation. Applying geometric transformation to the filter coefficients is equivalent to applying geometric transformation to the pixel values while keeping the coefficients unchanged before filtering. The purpose of geometric transformation is to align the directionality of different block contents as much as possible, thereby reducing the number of classifications required by ALF and allowing different pixels to share the same filter coefficients. Using geometric transformation can increase the actual classification from 25 classes to 100 classes without increasing the number of ALF filters, thus improving its adaptability.
[0075] Table 2-1 Geometric Transformation Based on Pixel Block Gradient Values
[0076] 4.3 ALF Filtering Process in VVC
[0077] At the decoding end, if the ALF flag at the CTU level is true, then each pixel R(i,j) in the current CTU will be filtered. The filtering process and output are as follows:
[0078] Where f(k,l) represents the filter tap coefficients, K(x,y) is the limiting function, and c(k,l) are the limiting operation parameters. The range of values for k and l is... to Where L is the length of the filter. The specific definition of the clipping function is K(x,y)=min(y,max(-y,x)). Clipping adds non-linearity to ALF, which can reduce the influence of pixels with excessively large differences in the surrounding pixels on the current pixel.
[0079] 5. ALF in Enhanced Compression Model (ECM) 8.0
[0080] ECM-8.0[2] removed the downsampling operation and virtual boundary restrictions when calculating gradients during ALF classification. At the same time, the basic unit of ALF classification operation changed from a 4x4 sub-block to a 2x2 sub-block. The shapes of the luminance and chrominance filters also changed accordingly.
[0081] 5.1 Enhanced Fixed Filter
[0082] For the luminance component, ECM-8.0 uses three different classifiers (C0, C1, and C2) and three different filter sets (F0, F1, and F2). Filter sets F0 and F1 contain fixed filters whose coefficients are generated offline based on classifiers C0 and C1. F2 contains filter coefficients generated from the content to be encoded, which need to be written into the bitstream and transmitted to the decoder.
[0083] 5.2 Classification Process
[0084] In ECM-8.0, each 2x2 sub-block is determined according to its directional characteristic D. i With activity characteristic A i Generate the corresponding category index C i As shown in the following formula:
[0085] Where i represents the classifier index, M D,i D represents the activity feature used by the corresponding classifier. i The total number.
[0086] Similar to the calculation process in VVC, the horizontal, vertical, diagonal, and anti-diagonal gradients of each pixel are generated using a 1-D Laplacian operator. For classifier C0, the gradient of its sub-block is generated by summing the pixel gradient values at all positions in the 4x4 region covering the target 2x2 sub-block. For classifiers C1 and C2, the gradient of their sub-blocks is generated by summing the pixel gradient values at all positions in the 12x12 region covering the target 2x2 sub-block. The horizontal, vertical, diagonal, and anti-diagonal sub-block gradients are defined as follows: Then the directional feature D i This is obtained by comparing the following two values with a set of thresholds:
[0087] Directional feature D2 uses the same thresholds 2 and 4.5 as VVC. For D0 and D1, the horizontal / vertical edge strength is calculated first. With diagonal edge strength Use the threshold Th = [1.25, 1.5, 2, 3, 4.5, 8]. When When, edge strength Set to 0; otherwise, It is to satisfy The largest integer. When When, edge strength Set to 0; otherwise To meet The largest integer in the range of 1. That is, when the horizontal / vertical edges are strong, the directional feature D i Generated from Table 2-2(a). Otherwise, directional feature D i Generated from Table 2-2(b).
[0088] Table 2-2 Edge Strength With D i mapping relationship
[0089] Activity characteristics A is the result of accumulating the gradients in the horizontal and vertical directions at the sub-block level. i It is generated by quantization, and its quantized value ranges from 0 to n. For n is set to 4; for and n is set to 15. An ALF_APS can transmit up to 4 sets of luminance component filters, and each filter set contains up to 25 filters.
[0090] 5.3 Classifier based on 2x2 sub-blocks
[0091] In ECM-8.0, the ALF classification process uses a new classifier. For a set of filters transmitted to the decoder, a flag indicates whether to use the original classifier or the new classifier. The new classifier cannot use geometric transformations. When using the new classifier, the pixels at all positions in a 2x2 sub-block are summed, and the class is determined based on the sum of the pixel values. index =(sum×25)>>(samplebitdepth+2)#(2-13)
[0092] 5.4 Filtering Process
[0093] First, two fixed filters, F0 and F1, using 13x13 diamond-shaped filters, generate two intermediate values, R0(x,y) and R1(x,y), for the current pixel to be filtered. Then, the online-generated filter F2 is applied to R0(x,y), R1(x,y), and surrounding pixels to generate the filtered pixel, as shown in the following formula:
[0094] Among them, f i,j G represents the difference between the surrounding pixels after the clipping operation and the current pixel R(x,y). i R represents the value after the limit operation. i-20 The difference between (x, y) and the current pixel. Filter coefficient c i i = 0, ... 21, needs to be transmitted to the decoding end.
[0095] In ECM-8.0, the brightness filter generated through online training contains four types of input: spatially adjacent samples, reconstructed samples before deblocking, extended samples generated by a fixed filter, and residual components. Their shapes are shown in Figure 6. Here, #0-#19 represent spatially adjacent samples, #20-#25 and #28-#29 represent samples generated by a fixed filter, #26, #27, and #30 represent reconstructed samples before deblocking, and #31 and #32 represent residual components. The filtering process, based on these different input types, is as follows:
[0096] Among them, f i,j G represents the difference between the surrounding pixel samples in the bounded spatial domain and the current sample R(x,y). i h represents the difference between the pixel sample generated after limiting and filtering with a fixed filter and the current sample R(x,y). i,j This represents the difference between the reconstructed sample before the deblocking effect (after clipping) and the current sample R(x,y). i This represents the residual component after clipping, rFiltered i This represents the residual component generated after being clipped and filtered using a fixed filter. The residual component uses the same fixed filter as the reconstructed component.
[0097] In ALF_APS, a flag is used to indicate whether only the residual components are used or both the residual components and the residual components filtered by the fixed filter are used.
[0098] 5.5 Classifiers Based on Residual Components
[0099] A classifier based on luminance residual components is used as the third classifier in ALF. For any 2x2 luminance sub-block, the sum of the absolute values of the residual components of all positions within the 8x8 region covering the current 2x2 sub-block is first calculated. Then, the classification is performed based on the accumulated sum using the following formula: classIdx=sum>>(samplebitdepth-4)#(2-16)
[0100] The final classIdx value ranges from 0 to 24. In ALF_APS, the classifier used needs to be transmitted for each filter bank.
[0101] 5.6 ALF coefficients and nonlinear amplitude limiting index transmission process.
[0102] For the current image to be filtered, its ALF coefficients can be selected from filter coefficients generated from the current image, filter coefficients generated from the encoded image, and pre-trained filter coefficients. If filter coefficients generated from the current image are selected, the filter-related parameters need to be transmitted to the decoder. An example ALF filter syntax element and transmission process are shown in Table 1 below:
[0103] `alf_comp_num_alt_filters_minus1+1` represents the number of filter banks used for the current color component (such as luma component, chroma component, and cross component). In ECM, the luma component supports a maximum of 4 filter banks, and the chroma component supports a maximum of 8 filter banks. For each filter bank, `alf_comp_clip_flag` is used to indicate whether the filters contained in the current filter bank use non-linear clipping.
[0104] A
[0105] `lf_comp_num_filters_signalled_minus1+1` indicates the number of filters in the current filter bank (in ECM, a filter bank for the luma component can contain a maximum of 25 filters, and a filter bank for the chroma component can contain a maximum of 1 filter. This syntax element is not required for the chroma component).
[0106] alf_comp_coeff() represents the tap coefficients of the transmission filter. If nonlinear clipping is used, the nonlinear clipping index alf_comp_clip_idx[altIdx][sfIdx][j] is transmitted for each tap coefficient of the filter.
[0107] The video decoding method and video encoding method provided in this application embodiment can be applied to a video encoding and decoding system. The video encoding and decoding system may include a content production device (corresponding to an encoding device) and a content presentation device (corresponding to a decoding device). The content production device may refer to the electronic device used by the provider of video data (e.g., the content creator of the video data). The electronic device may be a terminal (such as a PC (Personal Computer), a smart mobile device (such as a smartphone), etc.) or a server.
[0108] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The content presentation device can refer to the electronic device used by the user of the video data (e.g., the viewer of the video data, i.e., the business target). This electronic device can be a terminal (such as a PC, a smart mobile device (such as a smartphone), a VR device (such as a VR headset, VR glasses, etc.), a smart home appliance, an in-vehicle terminal, an aircraft, etc.), and it integrates a client application.
[0109] The client here can be a client capable of displaying data information such as text, images, audio, and video, including but not limited to multimedia clients (e.g., video clients), social clients (e.g., instant messaging clients), news applications (e.g., news clients), entertainment clients (e.g., game clients), shopping clients, in-vehicle clients, browsers, etc. This client can be a standalone client or an embedded sub-client integrated into another client (e.g., a social client); there is no limitation on this.
[0110] The content creation device and the content presentation device can be the same device or different devices. Both include multiple modules, each used to perform different functions. These modules can be integrated into the same electronic device or located in different electronic devices. The content creation device can be used to perform functions such as video data acquisition and encoding. Correspondingly, the content presentation device can be used to perform functions such as decoding, rendering, and displaying encapsulated files. Please refer to Figure 7, which is a schematic diagram of the framework of a video data encoding and decoding system provided in an embodiment of this application.
[0111] In Figure 7, on the content creation device side, the real-world visual scene is captured by a set of cameras or a camera device with multiple lenses and sensors. The captured camera images A are video data B, which includes multiple frames of captured images. Alternatively, on the content creation device side, multiple frames of screen content images A can serve as video data B. After content acquisition is complete, the video data B is encoded to obtain video stream C, which is then sent to the content presentation device.
[0112] On the content presentation device side, the video stream C is decoded, and then the decoded video data B' is rendered to obtain the rendered video D, which is then displayed based on the video D.
[0113] It is understood that the encoding and decoding technologies involved in this application can be implemented using cloud technology; for example, using a cloud server as a content production device. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to realize the computation, storage, processing, and sharing of data.
[0114] Based on the above introduction of basic concepts and related scenarios, embodiments of this application provide a video encoding method, a video decoding method, a video encoding device, a video decoding device, a computer storage medium, and an electronic device.
[0115] To support the video encoding method in this application, the embodiments of this application, based on existing technologies, add several descriptive fields at the system layer and define corresponding high-level syntax data structures. In the following sections, the above video encoding method will be described in detail with reference to various syntax tables.
[0116] Please refer to Figure 8. The video decoding method provided in this embodiment includes the following steps:
[0117] Step 011: Obtain the video stream, which includes decoding indication information, including at least one filter flag bit for indicating filter parameters;
[0118] Specifically, a bitstream, or video bitstream, is obtained by encoding and compressing video data (such as images captured by a camera or images of screen content generated by a computer).
[0119] The decoding end can obtain the video stream sent by the encoding end. The video stream contains decoding instruction information, and the decoding end can decode the video stream according to the decoding instruction information.
[0120] Decoding indication information is used to indicate the decoding of different data in the video stream. Decoding indication information includes the video sequence, which is the highest-level syntax structure of the video stream.
[0121] The decoding indication information includes at least one filter flag bit for indicating filter parameters, which is used to decode the filter parameters.
[0122] Optionally, the filter parameters may include tap coefficients and the corresponding nonlinear limiting indexes. If there are repeated parameters or parameters with preset values (such as 0) in the filter parameters, transmitting all of these parameters will generate a large amount of redundant data (such as transmitting multiple identical nonlinear limiting indices). Therefore, the filter parameters can be decoded and indicated by the filter flag bits, which helps to reduce redundant data.
[0123] Step 012: Determine the tap coefficient information in the filter parameters based on the value of the filter flag bit;
[0124] Among them, the tap coefficient information is used to characterize the specific information of the tap coefficients in the filter (such as the tap coefficients, the nonlinear limiting index corresponding to the tap coefficients, etc.), such as whether all the tap coefficients of the filter are 0, and whether the nonlinear limiting index corresponding to each tap coefficient is the same.
[0125] Specifically, when decoding is indicated by the filter flag, the tap coefficient information in the filter parameters can be determined by decoding the value of the filter flag. This allows for the determination of the specific details of the tap coefficient information in the filter, facilitating the subsequent decoding of the corresponding filter parameters based on the specific details of the tap coefficient information.
[0126] For example, based on the value of the filter flag, the tap coefficient information in the filter parameters can be determined to be that all the tap coefficients of the filter are 0, or based on the value of the filter flag, the tap coefficient information in the filter parameters can be determined to be that the nonlinear limiting index corresponding to each tap coefficient is the same.
[0127] Step 013: Determine the filter parameters based on the tap coefficient information.
[0128] Specifically, after determining the tap coefficient information, the corresponding filter parameters can be obtained by decoding based on the tap coefficient information.
[0129] For example, if the tap coefficient information is determined to be that all tap coefficients of the filter are 0, it can be inferred that all tap coefficients in the filter are 0; as another example, if the tap coefficient information is determined to be that the nonlinear limiting indexes corresponding to each tap coefficient are the same, it can be inferred that the nonlinear limiting indexes corresponding to each tap coefficient in the filter are preset indices.
[0130] Thus, by introducing filter flags into the high-level syntax (i.e., decoding indication information) of video encoding and decoding, the filtering parameters that will generate redundant data during transmission (such as the filtering parameters corresponding to tap coefficient information) are decoded and indicated. Therefore, the filtering parameters that will generate redundant data do not need to be transmitted in the video bitstream, realizing the implicit transmission of filtering parameters, which is beneficial to improving the bitrate of the video bitstream and improving encoding and decoding performance.
[0131] Referring to Figure 9, in some embodiments, the filter flags include a first tap flag, which indicates whether all tap coefficients in the corresponding filter are 0; when the first tap flag is a first preset value, it is determined that the tap coefficient information indicates that all tap coefficients in the filter are 0; when the first tap flag is a second preset value, it is determined that all tap coefficients in the filter included in the tap coefficient information are not 0, and the first preset value and the second preset value are different; Step 013: Based on the tap coefficient information, determine the filter parameters, including:
[0132] Step 01311: When the first tap flag indicates that all tap coefficients of the filter are 0, do not receive tap coefficient information and infer all tap coefficients of the filter.
[0133] Step 01312: When the first tap flag indicates that all tap coefficients of the filter are not all 0, obtain each tap coefficient of the filter based on the decoded tap coefficient information. The first preset value and the second preset value are different.
[0134] Specifically, in the existing design, even if all tap coefficients of a filter are 0, it is still necessary to transmit all tap coefficients for the filter, resulting in a large amount of redundancy in the transmitted tap coefficients. Therefore, a first tap flag can be set in the filter flag to indicate whether all tap coefficients in the filter are 0.
[0135] When the first tap flag is set to the first preset value, it indicates that all tap coefficients of the filter are 0, thus confirming that all tap coefficients of the filter are redundant data. All tap coefficients of the filter can be implicitly transmitted, meaning that the encoding end does not transmit tap coefficient information (i.e., all tap coefficients of the filter), and the decoding end does not need to receive this tap coefficient information. When the first tap flag is set to the first preset value, the decoding end can directly infer that all tap coefficients of the filter are 0.
[0136] When the first tap flag is set to the second preset value, it can indicate that all tap coefficients of the filter corresponding to the first tap flag are not all 0. In this case, there is no redundant data in the transmission of all tap coefficients of the filter. Therefore, all tap coefficients of the filter can be explicitly transmitted. The decoding end can obtain each tap coefficient transmitted in the filter based on the decoded tap coefficient information (i.e., each tap coefficient explicitly transmitted).
[0137] The first preset value can be 1 and the second preset value can be 0, or the first preset value can be 0 and the second preset value can be 1.
[0138] In one example, the transmission process of the syntax element corresponding to the first tap flag is shown in Table 2 below:
[0139] The first tap flag, alf_filt_coeff_all_zero[altIdx][sfIdx], being 1 indicates that all tap coefficients of the sfIdx-th filter in the altIdx-th filter bank are 0. If it is 0, it indicates that the tap coefficients of the corresponding filter are not all 0. The default value is 0.
[0140] Optionally, in existing designs, for tap coefficients of 0, the corresponding tap coefficients still need to be transmitted. In the embodiments of this application, when the tap coefficient is 0, the encoding and decoding ends can agree in advance that the value of the missing tap coefficient is 0. In this case, the video bitstream does not need to transmit tap coefficients with a value of 0 (or does not transmit the value of the tap coefficient). When the decoding end determines that there is a missing tap coefficient in the filter, it can determine that the missing tap coefficient is 0.
[0141] Referring to Figure 10, in some embodiments, the filter flag bit further includes a second tap flag bit. The second tap flag bit is used to indicate whether at least one filter in the corresponding filter group has all tap coefficients of 0. When the second tap flag bit is a first preset value, it is determined that the tap coefficient information indicates that at least one filter in the filter group has all tap coefficients of 0. When the second tap flag bit is a second preset value, it is determined that the tap coefficient information indicates that no filter in the filter group has all tap coefficients of 0.
[0142] Step 013: Based on the tap coefficient information, determine the filter parameters, including:
[0143] Step 01321: When the second tap flag indicates that all tap coefficients of at least one filter in the filter bank are 0, the tap coefficient information of at least one filter is not received, and the tap coefficients of at least one filter in the filter bank are inferred.
[0144] Step 01322: In the second tap flag indicating the filter bank, if there is no filter in the filter bank where all tap coefficients are 0, obtain the individual tap coefficients of each filter based on the decoded tap coefficient information.
[0145] Specifically, in the APS of the video bitstream, there are generally one or more filter groups, and each filter group includes one or more filters. In order to provide decoding indication for the filter parameters in each filter group, the filter flag can also be set with a second tap flag. The second tap flag is used to indicate whether at least one filter in the corresponding filter group has all tap coefficients of 0.
[0146] If the second tap flag in the current filter bank is the first preset value, it can be determined that at least one filter in the filter bank has all tap coefficients of 0. The second tap flag can also specifically indicate the filter whose tap coefficients are all 0 (e.g., the tap coefficients of the sfIdx filter in the altIdx filter bank are all 0). In this case, the tap coefficients of the sfIdx filter in the altIdx filter bank are redundant data. The tap coefficient information of this filter needs to be implicitly transmitted, that is, the encoder does not transmit the tap coefficient information of this filter (i.e., all tap coefficients of the sfIdx filter in the altIdx filter bank), and the decoder does not receive this tap coefficient information. The decoder can directly infer that all tap coefficients of this filter are 0. Alternatively, by decoding the first tap flag corresponding to each filter in the filter bank, the filter whose tap coefficients are all 0 can be determined based on the first tap flag. Alternatively, if the decoding end finds that any target filter in the filter bank has not transmitted tap coefficients during decoding, it can be determined that the tap coefficients of the target filter have been implicitly transmitted. In this case, it can be inferred that all tap coefficients of the target filter are 0.
[0147] If the second tap flag in the current filter bank is the second preset value, it can be determined that there is no filter in the filter bank where all tap coefficients are 0. In this case, each tap coefficient can be explicitly transmitted to the decoding end, without needing to transmit the first tap flag corresponding to each filter in the current filter bank. This reduces the transmission of redundant first tap flags, thus reducing redundant filter flags while still providing decoding indications for filter parameters with redundant data during transmission. The decoding end obtains each tap coefficient of each filter transmitted in the filter bank based on the decoded tap coefficient information (i.e., each explicitly transmitted tap coefficient).
[0148] In one example, the transmission process of the syntax element corresponding to the second tap flag is shown in Table 3 below:
[0149] The first tap flag, alf_filt_coeff_all_zero[altIdx][sfIdx], being 1 indicates that all tap coefficients of the sfIdx filter in the altIdx filter bank are 0, while being 0 indicates that the tap coefficients of the corresponding filter are not all 0. The default value is 0.
[0150] The second tap flag, alf_has_filt_coeff_all_zero[altIdx], being 1 indicates that the altIdx-th filter bank contains at least one filter whose tap coefficients are all 0. If it is 0, it indicates that the tap coefficients of all filters in the filter bank are not all 0.
[0151] Referring to Figure 11, in some embodiments, each filter is divided into one or more filter groups, each filter group is located in an adaptive parameter set, and the filter flag bit also includes a third tap flag bit, which is used to indicate whether at least one filter group in the adaptive parameter set contains at least one filter with all tap coefficients being 0; when the third tap flag bit is a first preset value, it is determined that the tap coefficient information indicates that at least one filter group in the adaptive parameter set contains at least one filter with all tap coefficients being 0; when the third tap flag bit is a second preset value, it is determined that the tap coefficient information indicates that no filter group in the adaptive parameter set contains a filter with all tap coefficients being 0.
[0152] Step 013: Based on the tap coefficient information, determine the filter parameters, including:
[0153] Step 01331: When the third tap flag indicates that at least one filter bank in the adaptive parameter set contains at least one filter with all tap coefficients being 0, the tap coefficient information of at least one filter is not received, and the tap coefficients of at least one filter in at least one filter bank in the adaptive parameter set are inferred.
[0154] Step 01332: When the third tap flag indicates that there is no filter bank in the adaptive parameter set that contains all tap coefficients of 0, obtain the tap coefficients of each filter in the adaptive parameter set based on the decoded tap coefficient information.
[0155] Specifically, in the APS of the video bitstream, there are generally one or more filter banks. In order to indicate whether at least one filter bank in the APS contains at least one filter with all tap coefficients being 0, a third tap flag can also be set in the filter flag bit. The third tap flag is used to indicate whether at least one filter bank in the adaptive parameter set contains at least one filter with all tap coefficients being 0.
[0156] If the third tap flag in the APS is the first preset value, it can be determined that at least one filter bank in the APS contains at least one filter whose tap coefficients are all 0. The third tap flag can also specifically indicate the filter whose tap coefficients are all 0 (e.g., the tap coefficients of the sfIdx filter in the altIdx filter bank are all 0). In this case, the tap coefficients of the sfIdx filter in the altIdx filter bank are redundant data. The tap coefficient information of this filter needs to be implicitly transmitted, that is, the encoder does not transmit the tap coefficient information of this filter (i.e., all tap coefficients of the sfIdx filter in the altIdx filter bank), and the decoder does not receive this tap coefficient information. The decoder can directly infer that all tap coefficients of this filter are 0. Alternatively, by decoding the corresponding second tap flag in each filter bank in the APS, the target filter bank containing filters whose tap coefficients are all 0 can be determined. Then, by decoding the first tap flag corresponding to each filter in the target filter bank, the filter whose tap coefficients are all 0 can be determined. Alternatively, if the decoding end finds that no tap coefficients are transmitted in any target filter in the APS during decoding, it can be determined that the tap coefficients of the target filter have been implicitly transmitted. In this case, it can be inferred that all tap coefficients of the target filter are 0.
[0157] If the third tap flag in the APS is the second preset value, it can be determined that there is no filter bank in the APS containing filters with all tap coefficients of 0. In this case, the tap coefficients of each filter can be explicitly transmitted to the decoding end, without needing to transmit the second tap flag corresponding to each filter bank, or the first and second tap flags corresponding to each filter. This reduces the transmission of redundant second and first tap flags, thus reducing redundant filter parameters while still providing decoding indications for filter parameters with redundant data during transmission. The decoding end directly obtains the individual tap coefficients of each filter transmitted in the APS based on the decoded tap coefficient information (i.e., the explicitly transmitted tap coefficients).
[0158] In one example, the transmission process of the syntax element corresponding to the third tap flag is shown in Table 4 below:
[0159] The third tap flag, alf_alt_filt_coeff_all_zero, being 1 indicates that at least one filter in the current APS-supported filter bank has all tap coefficients of 0. If it is 0, it indicates that not all tap coefficients of the filters in the current APS-supported filter bank are 0. The default value is 0.
[0160] The second tap flag, alf_has_filt_coeff_all_zero[altIdx], being 1 indicates that the altIdx-th filter bank contains at least one filter whose tap coefficients are all 0. If it is 0, it indicates that the tap coefficients of all filters in the filter bank are not all 0.
[0161] The first tap flag, alf_filt_coeff_all_zero[altIdx][sfIdx], being 1 indicates that all tap coefficients of the sfIdx-th filter in the altIdx-th filter bank are 0. If it is 0, it indicates that the tap coefficients of the corresponding filter are not all 0. The default value is 0.
[0162] Referring to Figure 12, in some embodiments, the filter flag bit includes a first index flag bit, which is used to indicate whether the nonlinear limiting index corresponding to all tap coefficients in the corresponding filter is the same; when the first index flag bit is a first preset value, it is determined that the nonlinear limiting index corresponding to all tap coefficients in the filter is the same; when the first index flag bit is a second preset value, it is determined that the nonlinear limiting index corresponding to all tap coefficients in the filter included in the tap coefficient information is not uniformly the same.
[0163] Step 013: Based on the tap coefficient information, determine the filter parameters, including:
[0164] Step 01341: When the first index flag indicates that the nonlinear limiting indexes corresponding to all tap coefficients in the filter are not the same, obtain the nonlinear limiting indexes corresponding to each tap coefficient of the filter based on the decoded tap coefficient information.
[0165] Step 01342: When the first index flag indicates that the nonlinear limiting indexes corresponding to all tap coefficients in the filter are not uniform, obtain the nonlinear limiting indexes corresponding to each tap coefficient of the filter based on the decoded tap coefficient information.
[0166] Specifically, in existing designs, even when all nonlinear limiting indices of a filter are identical, it is still necessary to transmit all nonlinear limiting indices for that filter, resulting in significant redundancy in the transmitted tap coefficients. Therefore, a first index flag can be set in the filter flags to indicate whether the nonlinear limiting indices corresponding to all tap coefficients in the corresponding filter are identical.
[0167] When the first index flag of the filter is decoded to the first preset value at the decoding end, it can be determined that the nonlinear limiting indexes corresponding to all tap coefficients in the filter are the same. At this time, there is redundant data in the transmission of the nonlinear limiting indexes corresponding to all tap coefficients of the filter. Therefore, the nonlinear limiting indexes corresponding to all tap coefficients of the filter can be implicitly transmitted. That is, the encoding end does not transmit the tap coefficient information of the filter (i.e., the nonlinear limiting indexes corresponding to all tap coefficients of the filter), and the decoding end does not receive the tap coefficient information. The decoding end can directly infer the nonlinear limiting indexes corresponding to all tap coefficients of the filter. If the inferred nonlinear limiting indexes corresponding to all tap coefficients of the filter are all preset indexes (such as nonlinear limiting indexes of 0, 1, 2 or 3).
[0168] If the first index flag of the filter is decoded to the second preset value by the decoding end, it can be determined that the nonlinear limiting indexes corresponding to all tap coefficients in the filter are not the same. At this time, the nonlinear limiting indexes corresponding to each tap coefficient can be explicitly transmitted to the decoding end. The decoding end can directly obtain the nonlinear limiting indexes corresponding to each tap coefficient transmitted in the filter based on the decoded tap coefficient information (i.e., the nonlinear limiting indexes corresponding to all tap coefficients explicitly transmitted).
[0169] In one example, the transmission process of the syntax element corresponding to the first index flag is shown in Table 5 below:
[0170] In this context, the first index flag, alf_filt_clip_all_same[altIdx][sfIdx], being 1 indicates that all tap coefficients of the sfIdx filter in the altIdx filter bank use the same nonlinear clipping index, while being 0 indicates that the nonlinear clipping indices of the corresponding filters are not all the same. The default value is 0.
[0171] Optionally, the filter flags may also include a second index flag, which indicates the nonlinear limiting index used by all tap coefficients of the corresponding filter.
[0172] When the decoding end decodes the first index flag of the filter to the first preset value, it can be determined that the nonlinear limiting index corresponding to all tap coefficients in the filter is the same. There is redundant data in the transmission of the nonlinear limiting index corresponding to all tap coefficients of the filter. Therefore, the nonlinear limiting index corresponding to all tap coefficients of the filter can be implicitly transmitted. The decoding end can directly determine that the nonlinear limiting index corresponding to all tap coefficients of the filter is the value of the second index flag. For example, if the nonlinear limiting index is 0, 1, 2 or 3, the nonlinear limiting index corresponding to the second index flag is the same as the nonlinear limiting index corresponding to all tap coefficients of the filter.
[0173] Thus, by introducing a second index flag indicating the nonlinear limiting index corresponding to all tap coefficients of the filter, the decoding indication is more accurate than determining the nonlinear limiting index of a filter where all tap coefficients have the same nonlinear limiting index as a preset index.
[0174] In one example, the transmission process of the syntax elements corresponding to the first and second index flags is shown in Table 6 below:
[0175] In this context, the first index flag, alf_filt_clip_all_same[altIdx][sfIdx], being 1 indicates that all tap coefficients of the sfIdx filter in the altIdx filter bank use the same nonlinear clipping index, while being 0 indicates that the nonlinear clipping indices of the corresponding filters are not all the same. The default value is 0.
[0176] The second index flag, alf_filt_same_clip_index[altIfx][sfIdx], represents the nonlinear clipping index used for all tap coefficients of the sfIdx filter in the altIdx filter bank.
[0177] Optionally, in existing designs, for tap coefficients of 0, it is still necessary to transmit the nonlinear limiting index corresponding to the tap coefficient. In this embodiment, when the tap coefficient is 0, the encoder and decoder can pre-agree that the nonlinear limiting index corresponding to the tap coefficient with a value of 0 is a preset index. In this case, the nonlinear limiting index corresponding to the tap coefficient with a value of 0 does not need to be transmitted in the video stream; the decoder can determine that the nonlinear limiting index corresponding to the tap coefficient with a value of 0 is the preset index during decoding.
[0178] Referring to Figure 13, in some embodiments, each filter is divided into one or more filter groups. The filter flag bit also includes a third index flag bit, which is used to indicate whether at least one filter in the corresponding filter group has the same nonlinear limiting index for all tap coefficients. When the third index flag bit is a first preset value, it is determined that the tap coefficient information indicates that at least one filter in the filter group has the same nonlinear limiting index for all tap coefficients. When the third index flag bit is a second preset value, it is determined that the tap coefficient information indicates that no filter in the filter group has the same nonlinear limiting index for all tap coefficients.
[0179] Step 013: Based on the tap coefficient information, determine the filter parameters, including:
[0180] Step 01351: When the third index flag indicates that at least one filter in the filter bank has the same nonlinear limiting index for all tap coefficients, the tap coefficient information of at least one filter is not received, and it is inferred that the nonlinear limiting index for all tap coefficients of at least one filter in the filter bank is a preset index.
[0181] Step 01352: When the third index flag indicates that there is no filter in the filter bank where all tap coefficients have the same nonlinear limiting index, obtain the nonlinear limiting index corresponding to the tap coefficients of each filter based on the decoded tap coefficient information.
[0182] Specifically, in the APS of the video bitstream, there are generally one or more filter groups. In order to decode the filter parameters of each filter group that have redundant data during transmission, a third index flag can also be set in the filter flag bit. The third index flag is used to indicate whether there is at least one filter in the corresponding filter group whose nonlinear limiting indexes corresponding to all tap coefficients are the same.
[0183] If the third index flag in the current filter bank is the first preset value, it can be determined that at least one filter in the filter bank has the same nonlinear limiting index for all tap coefficients. The third index flag can also specifically indicate the filter for which all tap coefficients have the same nonlinear limiting index (e.g., the nonlinear limiting index for the tap coefficients of the sfIdx filter in the altIdx filter bank is the same). In this case, the tap coefficients of the sfIdx filter in the altIdx filter bank are all redundant data. The tap coefficient information of this filter needs to be implicitly transmitted, that is, the encoder does not transmit the tap coefficient information of this filter (i.e., all tap coefficients of the sfIdx filter in the altIdx filter bank), and the decoder does not receive this tap coefficient information. The decoder can directly infer the nonlinear limiting index corresponding to all tap coefficients of this filter. For example, if the inferred nonlinear limiting index corresponding to all tap coefficients is a preset index (e.g., a nonlinear limiting index of 0, 1, 2, or 3). Alternatively, by decoding the first index flag corresponding to each filter in the filter bank, the filter whose nonlinear limiting index is the same for all tap coefficients can be determined based on the first index flag. Alternatively, if the decoding end detects that any target filter in the filter bank has not transmitted the nonlinear limiting index corresponding to its tap coefficients during decoding, it can be determined that the nonlinear limiting index corresponding to the tap coefficients of the target filter has been implicitly transmitted. In this case, it can be inferred that the nonlinear limiting index corresponding to the tap coefficients of the target filter is a preset index.
[0184] If the third index flag in the current filter bank is the second preset value, it can be determined that there is no filter in the filter bank where all tap coefficients have the same nonlinear limiting index. In this case, the nonlinear limiting index corresponding to each tap coefficient can be explicitly transmitted to the decoding end, without needing to transmit the first index flag corresponding to each filter in the current filter bank. This reduces the transmission of redundant first index flags, and reduces redundant filter indicator bits while ensuring the decoding indication of filter parameters with redundant data during transmission. Based on the decoded tap coefficient information (i.e., the nonlinear limiting index corresponding to all explicitly transmitted tap coefficients), the decoding end directly obtains the nonlinear limiting index corresponding to each tap coefficient of each filter transmitted in the filter bank.
[0185] In one example, the transmission process of the syntax element corresponding to the third index flag is shown in Table 7 below:
[0186] In this context, the third index flag, alf_has_filt_clip_all_same[altIdx], being 1 indicates that the altIdx-th filter bank contains at least one filter whose tap coefficients all have the same nonlinear clipping index. Being 0 indicates that the altIdx-th filter bank does not contain any filters whose tap coefficients use the same nonlinear clipping index. The default value is 0.
[0187] The first index flag, alf_filt_clip_all_same[altIdx][sfIdx], being 1 indicates that the nonlinear indices of the tap coefficients of the sfIdx-th filter in the altIdx-th filter bank are all the same; being 0 indicates that the nonlinear clipping indices of the tap coefficients of the corresponding filters are not all the same. The default value is 0.
[0188] The second index flag, alf_filt_same_clip_index[altIdx][sfIdx], represents the nonlinear clipping index shared by the tap coefficients of the sfIdx filter in the altIdx filter bank.
[0189] Referring to Figure 14, in some embodiments, each filter is divided into one or more filter groups. The filter flag bit also includes a fourth index flag bit, which is used to indicate whether the nonlinear limiting index corresponding to all tap coefficients of all filters in the corresponding filter group is the same. When the fourth index flag bit is a first preset value, it is determined that the nonlinear limiting index corresponding to all tap coefficients of all filters in the filter group is the same. When the fourth index flag bit is a second preset value, it is determined that the nonlinear limiting index corresponding to all tap coefficients of all filters in the filter group included in the tap coefficient information is not the same.
[0190] Step 013: Based on the tap coefficient information, determine the filter parameters, including:
[0191] Step 01361: When the fourth index flag indicates that the nonlinear limiting index corresponding to all tap coefficients of all filters in the filter bank is the same, the tap coefficient information of the filter bank is not received, and it is deduced that the nonlinear limiting index corresponding to all tap coefficients of all filters in the filter bank is the fifth index flag.
[0192] Step 01362: When the fourth index flag indicates that the nonlinear limiting indexes corresponding to all tap coefficients of all filters in the filter bank are not the same, obtain the nonlinear limiting indexes corresponding to each tap coefficient of each filter based on the decoded tap coefficient information.
[0193] Specifically, in existing designs, even when all tap coefficients in a filter bank have the same nonlinear limiting index, the nonlinear limiting index of the filter bank still needs to be transmitted. In this embodiment, when all tap coefficients in a filter bank have the same nonlinear limiting index, the encoder and decoder can pre-agree that the nonlinear limiting index of the filter bank with the same nonlinear limiting index for all tap coefficients is a preset index. In this case, the nonlinear limiting index of the filter bank with the same nonlinear limiting index for all tap coefficients does not need to be transmitted in the video stream.
[0194] If the fourth index flag in the current filter bank is the first preset value, it can be determined that the nonlinear limiting indexes corresponding to all tap coefficients of all filters in the filter bank are filter parameters with redundant data during transmission. Therefore, the nonlinear limiting indexes corresponding to all tap coefficients of the filter bank can be implicitly transmitted. That is, the encoder does not transmit the tap coefficient information of the filter bank (i.e., the nonlinear limiting indexes corresponding to all tap coefficients of the filter bank), and the decoder does not receive the tap coefficient information of the filter bank. Thus, it can be inferred that the nonlinear limiting indexes corresponding to all tap coefficients of all filters in the filter bank are preset indices.
[0195] If the fourth index flag in the current filter bank is the second preset value, it can be determined that the nonlinear limiting indices corresponding to all tap coefficients of all filters in the filter bank are not identical. The nonlinear limiting indices corresponding to each tap coefficient can be explicitly transmitted to the decoding end. The decoding end directly obtains the nonlinear limiting indices corresponding to each tap coefficient transmitted in the filter bank based on the decoded tap coefficient information (i.e., the explicitly transmitted nonlinear limiting indices corresponding to all tap coefficients). Alternatively, the decoding end can decode the third index flag to determine whether at least one filter in the filter bank has the same nonlinear limiting indices corresponding to all tap coefficients. This identifies the filter bank where the third index flag is the first preset value. Then, the first index flags corresponding to each filter in the filter bank where the third index flag is the first preset value are decoded to identify the filter where the first index flag is the first preset value. Thus, based on the tap coefficient information obtained by decoding each index flag, the nonlinear limiting indices corresponding to each tap coefficient of each filter in the filter bank are obtained.
[0196] Optionally, the filter flags may also include a fifth index flag, which indicates the nonlinear limiting index used by all tap coefficients of the corresponding filter bank.
[0197] When the decoding end decodes the fourth index flag of the filter bank to the first preset value, it can be determined that the nonlinear limiting index corresponding to all tap coefficients of all filters in the filter bank is a filter parameter with redundant data during transmission. Thus, it can be inferred that the nonlinear limiting index corresponding to all tap coefficients of all filters in the filter bank is the fifth index flag. If the fifth index flag is 0, 1, 2 or 3, the nonlinear limiting index corresponding to the fifth index flag is the same as the nonlinear limiting index corresponding to all tap coefficients of the filter bank.
[0198] Thus, by introducing a fifth index flag that indicates the nonlinear limiting index corresponding to all tap coefficients of the filter bank, the decoding indication is more accurate than determining the nonlinear limiting index of a filter bank where all tap coefficients have the same nonlinear limiting index as a preset index.
[0199] In one example, the transmission process of the syntax elements corresponding to the fourth and fifth index flags is shown in Table 8 below:
[0200] In this context, the fourth index flag, alf_filtset_all_filt_clip_same[altIdx], being 1 indicates that all filters in the altIdx-th filter bank use the same nonlinear clipping index for their tap coefficients; being 0 indicates that not all filters in the corresponding filter bank use the same nonlinear clipping index for their tap coefficients. The default value is 0.
[0201] The fifth index flag, alf_filtset_all_filt_clip_index[altIdx], indicates that all filters in the altIdx-th filter bank use the same nonlinear clipping index.
[0202] The third index flag, alf_has_filt_clip_all_same[altIdx], being 1 indicates that the altIdx-th filter bank contains at least one filter whose tap coefficients all have the same nonlinear clipping index. Being 0 indicates that the altIdx-th filter bank does not contain any filters whose tap coefficients use the same nonlinear clipping index. The default value is 0.
[0203] The first index flag, alf_filt_clip_all_same[altIdx][sfIdx], being 1 indicates that the nonlinear indices of the tap coefficients of the sfIdx-th filter in the altIdx-th filter bank are all the same; being 0 indicates that the nonlinear clipping indices of the tap coefficients of the corresponding filters are not all the same. The default value is 0.
[0204] The second index flag, alf_filt_same_clip_index[altIdx][sfIdx], represents the nonlinear clipping index shared by the tap coefficients of the sfIdx filter in the altIdx filter bank.
[0205] Referring to Figure 15, in some embodiments, each filter is divided into one or more filter groups, each filter group is located in an adaptive parameter set, and the filter flag bit also includes a sixth index flag bit. The sixth index flag bit is used to indicate whether at least one filter group in the adaptive parameter set contains at least one filter whose nonlinear limiting index is the same for all tap coefficients. When the sixth index flag bit is a first preset value, the tap coefficient information indicates that at least one filter group in the adaptive parameter set contains at least one filter whose nonlinear limiting index is the same for all tap coefficients. When the sixth index flag bit is a second preset value, the tap coefficient information indicates that no filter group in the adaptive parameter set contains a filter whose nonlinear limiting index is the same for all tap coefficients.
[0206] Step 013: Based on the tap coefficient information, determine the filter parameters, including:
[0207] Step 01371: When the sixth index flag indicates that at least one filter bank in the adaptive parameter set contains at least one filter whose nonlinear limiting index is the same for all tap coefficients, the tap coefficient information of at least one filter is not received, and it is inferred that the nonlinear limiting index corresponding to at least one filter of at least one filter bank in the adaptive parameter set is a preset index.
[0208] Step 01372: If, in the case that no filter bank in the adaptive parameter set contains a filter whose tap coefficients have the same nonlinear limiting index, the nonlinear limiting index corresponding to the tap coefficients of each filter is obtained based on the decoded tap coefficient information.
[0209] Specifically, in the APS of the video bitstream, there are generally one or more filter banks. In order to indicate whether at least one filter bank in the APS contains filters with the same nonlinear limiting index for all tap coefficients, a sixth index flag can also be set in the filter flag bit. The sixth index flag is used to indicate whether at least one filter bank in the adaptive parameter set contains filters with the same nonlinear limiting index for all tap coefficients.
[0210] If the sixth index flag in the APS is the first preset value, it can be determined that at least one filter bank in the APS contains at least one filter whose nonlinear limiting index is the same for all tap coefficients. The sixth index flag can also specifically indicate the filter whose nonlinear limiting index is the same for all tap coefficients (e.g., the nonlinear limiting index is the same for the tap coefficients of the sfIdx filter in the altIdx filter bank). In this case, the tap coefficients of the sfIdx filter in the altIdx filter bank are all redundant data. The tap coefficient information of this filter needs to be implicitly transmitted. That is, the encoder does not transmit the tap coefficient information of this filter (i.e., all tap coefficients of the sfIdx filter in the altIdx filter bank), and the decoder does not receive the tap coefficient information. The decoder can directly infer the nonlinear limiting index corresponding to all tap coefficients of this filter. If the inferred nonlinear limiting index is a preset index (e.g., a nonlinear limiting index of 0, 1, 2 or 3), then the nonlinear limiting index of all tap coefficients is obtained. Alternatively, by decoding the fourth index flag corresponding to each filter bank in the APS, a first target filter bank with the same nonlinear limiting index for all tap coefficients can be identified. If no first target filter bank with the same nonlinear limiting index for all tap coefficients exists, the third index flag corresponding to each filter bank is decoded to identify a second target filter bank containing filters with the same nonlinear limiting index for all tap coefficients. Then, the first index flag corresponding to each filter in the second target filter bank is decoded to identify filters with the same nonlinear limiting index for all tap coefficients, thus inferring that the nonlinear limiting index of all filters with the same nonlinear limiting index for all tap coefficients is a preset index. Alternatively, when the sixth index flag in the APS is a first preset value, the third index flag corresponding to each filter bank is directly decoded to identify a second target filter bank containing filters with the same nonlinear limiting index for all tap coefficients. Then, the first index flag corresponding to each filter in the second target filter bank is decoded to identify filters with the same nonlinear limiting index for all tap coefficients. Alternatively, if the decoding end finds that any target filter in the filter bank has not transmitted the nonlinear limiting index corresponding to the tap coefficients during decoding, it can be determined that the nonlinear limiting index corresponding to the tap coefficients of the target filter has been implicitly transmitted. In this case, it can be inferred that the nonlinear limiting index corresponding to the tap coefficients of the target filter is a preset index.
[0211] If the sixth index flag in the APS is the second preset value, it can be determined that there is no filter bank in the APS containing filters whose nonlinear limiting indices are all the same for all tap coefficients. In this case, the nonlinear limiting indices corresponding to the tap coefficients of each filter in the APS can be explicitly transmitted to the decoding end, without needing to transmit the third and fourth index flags corresponding to each filter bank, or the first and second index flags corresponding to each filter. This reduces redundant transmission of the first to fourth index flags, and reduces redundant filter indicator bits while ensuring the decoding indication of filter parameters with redundant data during transmission. The decoding end directly decodes the nonlinear limiting indices corresponding to each tap coefficient of each filter transmitted in the filter bank based on the decoded tap coefficient information (i.e., the explicitly transmitted nonlinear limiting indices corresponding to all tap coefficients).
[0212] In one example, the transmission process of the syntax element corresponding to the sixth index flag is shown in Table 9 below:
[0213] In this context, a sixth index flag, `alf_alt_has_filt_clip_all_same`, being 1 indicates that the current APS supports at least one filter bank containing filters that use the same nonlinear clipping index. A value of 0 indicates that none of the filters in the current APS-supported filter banks use the same nonlinear clipping index. The default value is 0.
[0214] The third index flag, alf_has_filt_clip_all_same[altIdx], being 1 indicates that the altIdx-th filter bank contains at least one filter whose tap coefficients all have the same nonlinear clipping index. Being 0 indicates that the altIdx-th filter bank does not contain any filters whose tap coefficients use the same nonlinear clipping index. The default value is 0.
[0215] The first index flag, alf_filt_clip_all_same[altIdx][sfIdx], being 1 indicates that the nonlinear indices of the tap coefficients of the sfIdx-th filter in the altIdx-th filter bank are all the same; being 0 indicates that the nonlinear clipping indices of the tap coefficients of the corresponding filters are not all the same. The default value is 0.
[0216] The second index flag, alf_filt_same_clip_index[altIdx][sfIdx], represents the nonlinear clipping index shared by the tap coefficients of the sfIdx filter in the altIdx filter bank.
[0217] In another example, the transmission process of the syntax element corresponding to the sixth index flag is shown in Table 10 below:
[0218] In this context, a sixth index flag, `alf_alt_has_filt_clip_all_same`, being 1 indicates that the current APS supports at least one filter bank containing filters that use the same nonlinear clipping index. A value of 0 indicates that none of the filters in the current APS-supported filter banks use the same nonlinear clipping index. The default value is 0.
[0219] The fourth index flag, alf_filtset_all_filt_clip_same[altIdx], being 1 indicates that all filters in the altIdx-th filter bank use the same nonlinear clipping index for their tap coefficients; being 0 indicates that not all filters in the corresponding filter bank use the same nonlinear clipping index for their tap coefficients. The default value is 0.
[0220] The fifth index flag, alf_filtset_all_filt_clip_index[altIdx], indicates that all filters in the altIdx-th filter bank use the same nonlinear clipping index.
[0221] The third index flag, alf_has_filt_clip_all_same[altIdx], being 1 indicates that the altIdx-th filter bank contains at least one filter whose tap coefficients all have the same nonlinear clipping index. Being 0 indicates that the altIdx-th filter bank does not contain any filters whose tap coefficients use the same nonlinear clipping index. The default value is 0.
[0222] The first index flag, alf_filt_clip_all_same[altIdx][sfIdx], being 1 indicates that the nonlinear indices of the tap coefficients of the sfIdx-th filter in the altIdx-th filter bank are all the same; being 0 indicates that the nonlinear clipping indices of the tap coefficients of the corresponding filters are not all the same. The default value is 0.
[0223] The second index flag, alf_filt_same_clip_index[altIdx][sfIdx], represents the nonlinear clipping index shared by the tap coefficients of the sfIdx filter in the altIdx filter bank.
[0224] Referring to Figure 16, in some embodiments, the filter flag bit further includes a seventh index flag bit, which is used to indicate that the nonlinear limiting index corresponding to all tap coefficients of all filters in all filter banks of the adaptive parameter set is the same; when the seventh index flag bit is a first preset value, it is determined that the nonlinear limiting index corresponding to all tap coefficients in the adaptive parameter set is the same; when the seventh index flag bit is a second preset value, it is determined that the nonlinear limiting index corresponding to all tap coefficients in the adaptive parameter set included in the tap coefficient information is not the same, and the first preset value and the second preset value are different.
[0225] Step 013: Based on the tap coefficient information, determine the filter parameters, including:
[0226] Step 01381: When the seventh index flag indicates that all tap coefficients in the adaptive parameter set have the same nonlinear limiting index, the tap coefficient information of the adaptive parameter set is not received, and it is inferred that the nonlinear limiting indexes corresponding to all tap coefficients in the adaptive parameter set are preset indices.
[0227] Step 01382: When the seventh index flag indicates that the nonlinear limiting indexes corresponding to all tap coefficients in the adaptive parameter set are not the same, obtain the nonlinear limiting indexes corresponding to each tap coefficient in the adaptive parameter set based on the decoded tap coefficient information.
[0228] Specifically, in existing designs, even when all tap coefficients of all filters in the adaptive parameter set have the same nonlinear limiting index, the nonlinear limiting index corresponding to the adaptive parameter set still needs to be transmitted. In this embodiment, when all tap coefficients in the adaptive parameter set have the same nonlinear limiting index, the encoder and decoder can pre-agree that the nonlinear limiting index of the adaptive parameter set, where all tap coefficients have the same nonlinear limiting index, is a preset index. In this case, the nonlinear limiting index of the adaptive parameter set, where all tap coefficients have the same nonlinear limiting index, does not need to be transmitted in the video stream.
[0229] If the seventh index flag in the current filter bank is the first preset value, it can be determined that all nonlinear limiting indices corresponding to the tap coefficients in the adaptive parameter set are filter parameters with redundant data during transmission. At this time, all nonlinear limiting indices in the adaptive parameter set are implicitly transmitted, that is, the encoder does not transmit the tap coefficient information of the adaptive parameter set (i.e., the nonlinear limiting indices corresponding to all tap coefficients in the adaptive parameter set), and the decoder does not receive the tap coefficient information of the adaptive parameter set. Thus, it can be inferred that all nonlinear limiting indices corresponding to the tap coefficients in the adaptive parameter set are preset indices.
[0230] If the seventh index flag in the current filter bank is the second preset value, it can be determined that the nonlinear limiting indices corresponding to all tap coefficients in the adaptive parameter set are not all the same. In this case, the nonlinear limiting indices corresponding to each tap coefficient can be explicitly transmitted to the decoding end. The decoding end directly obtains the nonlinear limiting indices corresponding to each tap coefficient transmitted in the adaptive parameter set based on the decoded tap coefficient information (i.e., the explicitly transmitted nonlinear limiting indices corresponding to all tap coefficients). Alternatively, the decoding end can decode the sixth index flag to determine whether at least one filter bank in the adaptive parameter set contains filters whose nonlinear limiting indices corresponding to all tap coefficients are the same. If the sixth index flag is the first preset value, the third index flag corresponding to each filter bank can be decoded further. In the filter banks where the third index flag is the first preset value, the filters whose first index flag value is the first preset value can be identified, and it can be inferred that the nonlinear limiting indices of the filters whose first index flag value is the first preset value are all preset indices. In this way, based on the tap coefficient information obtained by decoding each index flag, the nonlinear limiting indices corresponding to each tap coefficient of each filter in the filter bank can be obtained.
[0231] Optionally, the filter flags also include an eighth index flag, which indicates the nonlinear limiting index used by all tap coefficients of the corresponding adaptive parameter set.
[0232] When the decoding end decodes the filter bank and finds that the seventh index flag is the first preset value, it can be determined that the nonlinear limiting index corresponding to all tap coefficients of all filters in the adaptive parameter set is a filter parameter with redundant data during transmission. Thus, it can be determined that the nonlinear limiting index used by all tap coefficients of all filters in the adaptive parameter set is the eighth index flag. If the eighth index flag is 0, 1, 2 or 3, the nonlinear limiting index corresponding to the eighth index flag is the same as the nonlinear limiting index corresponding to all tap coefficients of the filter bank.
[0233] Thus, by introducing an eighth index flag that indicates the nonlinear limiting index corresponding to all tap coefficients of the adaptive parameter set, the decoding indication is more accurate than determining the nonlinear limiting index of the adaptive parameter set, where all tap coefficients have the same nonlinear limiting index, as a preset index.
[0234] In one example, the transmission process of the syntax elements corresponding to the seventh and eighth index flags is shown in Table 11 below:
[0235] In this configuration, the seventh index flag, alf_alt_all_filt_clip_same, being 1 indicates that all filters in the current APS-supported filter bank use the same nonlinear clipping index, while being 0 indicates that not all filters in the current APS-supported filter bank use the same nonlinear clipping index. The default value is 0.
[0236] The eighth index flag, alf_alt_all_filt_clip_index, indicates that all filters in the current filter bank supported by the APS use the same nonlinear clipping index.
[0237] The sixth index flag, alf_alt_has_filt_clip_all_same, being 1 indicates that the current APS supports at least one filter bank containing filters that use the same nonlinear clipping index. Being 0 indicates that none of the filters in the current APS-supported filter banks use the same nonlinear clipping index. The default value is 0.
[0238] The third index flag, alf_has_filt_clip_all_same[altIdx], being 1 indicates that the altIdx-th filter bank contains at least one filter whose tap coefficients all have the same nonlinear clipping index. Being 0 indicates that the altIdx-th filter bank does not contain any filters whose tap coefficients use the same nonlinear clipping index. The default value is 0.
[0239] The first index flag, alf_filt_clip_all_same[altIdx][sfIdx], being 1 indicates that the nonlinear indices of the tap coefficients of the sfIdx-th filter in the altIdx-th filter bank are all the same; being 0 indicates that the nonlinear clipping indices of the tap coefficients of the corresponding filters are not all the same. The default value is 0.
[0240] The second index flag, alf_filt_same_clip_index[altIdx][sfIdx], represents the nonlinear clipping index shared by the tap coefficients of the sfIdx filter in the altIdx filter bank.
[0241] In another example, the transmission process of the syntax elements corresponding to the seventh and eighth index flags is shown in Table 12 below:
[0242] In this configuration, the seventh index flag, alf_alt_all_filt_clip_same, being 1 indicates that all filters in the current APS-supported filter bank use the same nonlinear clipping index, while being 0 indicates that not all filters in the current APS-supported filter bank use the same nonlinear clipping index. The default value is 0.
[0243] The eighth index flag, alf_alt_all_filt_clip_index, indicates that all filters in the current filter bank supported by the APS use the same nonlinear clipping index.
[0244] The sixth index flag, alf_alt_has_filt_clip_all_same, being 1 indicates that the current APS supports at least one filter bank containing filters that use the same nonlinear clipping index. Being 0 indicates that none of the filters in the current APS-supported filter banks use the same nonlinear clipping index. The default value is 0.
[0245] The fourth index flag, alf_filtset_all_filt_clip_same[altIdx], being 1 indicates that all filters in the altIdx-th filter bank use the same nonlinear clipping index for their tap coefficients; being 0 indicates that not all filters in the corresponding filter bank use the same nonlinear clipping index for their tap coefficients. The default value is 0.
[0246] The fifth index flag, alf_filtset_all_filt_clip_index[altIdx], indicates that all filters in the altIdx-th filter bank use the same nonlinear clipping index.
[0247] The third index flag, alf_has_filt_clip_all_same[altIdx], being 1 indicates that the altIdx-th filter bank contains at least one filter whose tap coefficients all have the same nonlinear clipping index. Being 0 indicates that the altIdx-th filter bank does not contain any filters whose tap coefficients use the same nonlinear clipping index. The default value is 0.
[0248] The first index flag, alf_filt_clip_all_same[altIdx][sfIdx], being 1 indicates that the nonlinear indices of the tap coefficients of the sfIdx-th filter in the altIdx-th filter bank are all the same; being 0 indicates that the nonlinear clipping indices of the tap coefficients of the corresponding filters are not all the same. The default value is 0.
[0249] The second index flag, alf_filt_same_clip_index[altIdx][sfIdx], represents the nonlinear clipping index shared by the tap coefficients of the sfIdx filter in the altIdx filter bank.
[0250] In some implementations, if the filter flag is a preset value, the video stream does not signal the filter parameters indicated by the filter flag.
[0251] Specifically, when the filter flag is set to a preset value (such as a first preset value or a second preset value), it indicates that the filter parameter indicated by the filter flag is a filter parameter with redundant data during transmission. In this case, the filter parameter with redundant data during transmission is implicitly transmitted, and the filter parameter is not notified to the video stream via signaling, thereby reducing the redundant data in the video stream.
[0252] For example, when the first tap flag is a first preset value, it means that the tap coefficients of the filter corresponding to the first tap flag are all 0. In this case, the tap coefficients of the filter corresponding to the first tap flag can be implicitly transmitted in the video stream without signaling notification. As another example, when the first index flag is a first preset value, it means that the nonlinear limiting indices corresponding to the tap coefficients of the filter corresponding to the first index flag are all the same. In this case, the nonlinear limiting index of the filter corresponding to the first index flag can be implicitly transmitted in the video stream without signaling notification.
[0253] In some implementations, the filter flags include at least one of the following: a filter flag corresponding to the luminance component, a filter flag corresponding to the chrominance component, and a filter flag corresponding to the cross-component.
[0254] Specifically, there are corresponding filters for the luminance component, chrominance component, and cross-component filters. Therefore, for filter parameters with redundant data during transmission of the luminance component filter, a filter flag can be introduced for decoding indication to reduce the redundant data of the luminance component filter; for filter parameters with redundant data during transmission of the chrominance component filter, a corresponding filter flag can be introduced for decoding indication to reduce the redundant data of the chrominance component filter; and for redundant parameters of the cross-component filter, a corresponding filter flag can be introduced for decoding indication to reduce the redundant data of the cross-component filter.
[0255] Based on the methods described in the above embodiments, this application also provides a video encoding method. Please refer to Figure 17, which is a flowchart illustrating the video decoding method provided in this application, specifically including:
[0256] Step 021: Acquire video data;
[0257] Step 022: Encode and compress the video data to obtain a video stream. The video stream includes decoding indication information, which includes at least one filter flag bit for indicating filter parameters. The filter flag bit is determined based on the tap coefficient information, which is determined based on the filter parameters.
[0258] It should be noted that the video encoding process and the video decoding process are reversible. Therefore, the syntax definitions involved in the video encoding method provided in this application can be found in the above-described video decoding method embodiments, and will not be repeated here.
[0259] According to the method described in the above embodiments, this application also provides a video decoding device for performing the steps in the above video decoding method. Please refer to FIG18, which is a schematic structural diagram of the video decoding device 300 provided in this application embodiment. The video decoding device 300 includes a first acquisition module 301 and an encoding module 302, wherein:
[0260] The first acquisition module 301 is used to acquire a video stream, the video stream including decoding indication information, the decoding indication information including at least one filter flag bit for indicating filter parameters;
[0261] The decoding module 302 is used to determine the tap coefficient information in the filter parameters based on the value of the filter flag bit; and to determine the filter parameters based on the tap coefficient information.
[0262] It should be noted that the specific details of each module unit in the video decoding device 300 have been described in detail in the embodiments of the video encoding method, and will not be repeated here.
[0263] According to the method described in the above embodiments, this application also provides a video encoding apparatus for performing the steps in the above video encoding method. Please refer to FIG19, which is a schematic structural diagram of the video encoding apparatus 400 provided in this application embodiment. The video encoding apparatus 400 includes a second acquisition module 401 and an encoding module 402, wherein:
[0264] The second acquisition module 401 is used to acquire video data;
[0265] The encoding module 402 is used to encode and compress video data to obtain a video bitstream. The video bitstream includes decoding indication information, which includes at least one filter flag bit for indicating filter parameters. The filter flag bit is determined based on tap coefficient information, which is determined based on filter parameters.
[0266] It should be noted that the specific details of each module unit in the video decoding device 400 have been described in detail in the embodiments of the video decoding method described above, and will not be repeated here.
[0267] 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.
[0268] In some embodiments, the video encoding and video decoding devices in this application can be electronic devices or components within electronic devices, such as integrated circuits or chips. The electronic device can be a terminal or other devices besides a terminal. Exemplarily, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application does not specifically limit the scope of the electronic device.
[0269] In some embodiments, as shown in FIG20, this application embodiment also provides an electronic device 500, including a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor 501. When the program is executed by the processor 501, it implements the various processes of the above-described video decoding method and video encoding method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0270] It should be noted that the electronic devices in the embodiments of this application include the aforementioned mobile electronic devices and non-mobile electronic devices.
[0271] Figure 21 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of this application.
[0272] The electronic device 600 includes, but is not limited to, components such as: radio frequency unit 601, network module 602, audio output unit 603, input unit 604, sensor 605, display unit 606, user input unit 607, interface unit 608, memory 609, and processor 610.
[0273] Those skilled in the art will understand that the electronic device 600 may also include a power supply (such as a battery) for powering various components. The power supply can be logically connected to the processor 610 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. The electronic device structure shown in Figure 21 does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0274] It should be understood that, in this embodiment, the input unit 604 may include a graphics processing unit (GPU) 6041 and a microphone 6042. The GPU 6041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 606 may include a display panel 6061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 607 includes at least one of a touch panel 6071 and other input devices 6072. The touch panel 6071 is also called a touch screen. The touch panel 6071 may include a touch detection device and a touch controller. Other input devices 6072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0275] The memory 609 can be used to store software programs and various data. The memory 609 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 609 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 609 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0276] Processor 610 may include one or more processing units; processor 610 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 610.
[0277] This application also provides a non-transitory computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described video decoding method and video encoding method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0278] The processor is the processor in the electronic device described in the above embodiments. The computer-readable storage medium may be a computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc.
[0279] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the aforementioned video decoding method and video encoding method. The processor may be a processor in the electronic device described in the above embodiments. When executed by the processor, the computer program implements the various processes of the embodiments of the aforementioned video decoding method and video encoding method, achieving the same technical effects; therefore, to avoid repetition, further details are omitted here.
[0280] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
Claims
1. A video decoding method, characterized in that, include: Acquire a video stream, the video stream including decoding indication information, the decoding indication information including at least one filter flag bit for indicating filter parameters; Based on the values of the filter flag bits, the tap coefficient information in the filter parameters is determined; and The filter parameters are determined based on the tap coefficient information.
2. The method according to claim 1, characterized in that, The filter flag includes a first tap flag, which indicates whether all tap coefficients in the corresponding filter are 0. When the first tap flag is a first preset value, it is determined that the tap coefficient information indicates that all tap coefficients in the filter are 0. When the first tap flag is a second preset value, it is determined that all tap coefficients in the filter included in the tap coefficient information are not 0, and the first preset value and the second preset value are different.
3. The method according to claim 2, characterized in that, Determining the filter parameters based on the tap coefficient information includes: When the first tap flag indicates that all the tap coefficients of the filter are 0, the tap coefficient information is not received, and all the tap coefficients of the filter are inferred. When the first tap flag indicates that all the tap coefficients of the filter are not all 0, each of the tap coefficients of the filter is obtained based on the decoded tap coefficient information.
4. The method according to claim 1, characterized in that, Each filter is divided into one or more filter groups. The filter flags include a second tap flag, which indicates whether at least one filter in the corresponding filter group has all tap coefficients of 0. When the second tap flag is a first preset value, it is determined that the tap coefficient information indicates that at least one filter in the filter group has all tap coefficients of 0. When the second tap flag is a second preset value, it is determined that the tap coefficient information indicates that no filter in the filter group has all tap coefficients of 0. The first preset value and the second preset value are different.
5. The method according to claim 4, characterized in that, Determining the filter parameters based on the tap coefficient information includes: When the second tap flag indicates that all tap coefficients of at least one filter in the filter bank are 0, the tap coefficient information of the at least one filter is not received, and the tap coefficients of the at least one filter in the filter bank are inferred. When the second tap flag indicates that there is no filter in the filter bank where all tap coefficients are 0, the tap coefficients of each filter are obtained based on the decoded tap coefficient information.
6. The method according to claim 1, characterized in that, Each filter is divided into one or more filter groups, and each filter group is located in an adaptive parameter set. The filter flag includes a third tap flag, which indicates whether at least one filter group in the adaptive parameter set contains at least one filter with all tap coefficients equal to 0. If the third tap flag is a first preset value, it is determined that the tap coefficient information indicates that at least one filter group in the adaptive parameter set contains at least one filter with all tap coefficients equal to 0. If the third tap flag is a second preset value, it is determined that the tap coefficient information indicates that no filter group in the adaptive parameter set contains a filter with all tap coefficients equal to 0. The first preset value and the second preset value are different.
7. The method according to claim 6, characterized in that, Determining the filter parameters based on the tap coefficient information includes: When the third tap flag indicates that at least one filter bank in the adaptive parameter set contains at least one filter whose tap coefficients are all 0, the tap coefficient information of the at least one filter is not received, and the tap coefficients of the at least one filter in the at least one filter bank in the adaptive parameter set are inferred. When the third tap flag indicates that no filter bank in the adaptive parameter set contains a filter whose tap coefficients are all 0, the tap coefficients of each filter in the adaptive parameter set are obtained based on the decoded tap coefficient information.
8. The method according to claim 1, characterized in that, Also includes: If the tap coefficient is 0 after decoding, the nonlinear limiting index corresponding to the tap coefficient is determined to be the preset index.
9. The method according to claim 1, characterized in that, The filter flag includes a first index flag, which indicates whether the nonlinear limiting indexes corresponding to all tap coefficients in the corresponding filter are the same. When the first index flag is a first preset value, it is determined that the tap coefficient information indicates that the nonlinear limiting indexes corresponding to all tap coefficients in the filter are the same. When the first index flag is a second preset value, it is determined that the nonlinear limiting indexes corresponding to all tap coefficients in the filter included in the tap coefficient information are not all the same, and the first preset value and the second preset value are different.
10. The method according to claim 9, characterized in that, Determining the filter parameters based on the tap coefficient information includes: If the first index flag indicates that all tap coefficients in the filter have the same nonlinear limiting index, the tap coefficient information is not received, and it is inferred that all tap coefficients in the filter have the same nonlinear limiting index. When the first index flag indicates that the nonlinear limiting indexes corresponding to all tap coefficients in the filter are not uniform, the nonlinear limiting indexes corresponding to each tap coefficient of the filter are obtained based on the decoded tap coefficient information.
11. The method according to claim 1, characterized in that, The filter flags include a first index flag and a second index flag. The first index flag indicates whether the nonlinear limiting indexes corresponding to all tap coefficients in the corresponding filter are the same. The second index flag indicates the nonlinear limiting index shared by all tap coefficients in the corresponding filter. When the first index flag is a first preset value, it is determined that the tap coefficient information indicates that the nonlinear limiting indexes corresponding to all tap coefficients in the filter are the same. When the first index flag is a second preset value, it is determined that the nonlinear limiting indexes corresponding to all tap coefficients in the filter included in the tap coefficient information are not all the same, and the first preset value and the second preset value are different.
12. The method according to claim 11, characterized in that, Determining the filter parameters based on the tap coefficient information includes: If the first index flag indicates that all tap coefficients in the filter have the same nonlinear limiting index, the tap coefficient information is not received, and it is inferred that the nonlinear limiting index of all tap coefficients in the filter is the value of the second index flag. When the first index flag indicates that the nonlinear limiting indexes corresponding to all tap coefficients in the filter are not uniform, the nonlinear limiting indexes corresponding to each tap coefficient of the filter are obtained based on the decoded tap coefficient information.
13. The method according to claim 1, characterized in that, Each filter is divided into one or more filter groups. The filter flags include a third index flag, which indicates whether at least one filter in the corresponding filter group has the same nonlinear limiting index for all tap coefficients. When the third index flag is a first preset value, it is determined that the tap coefficient information indicates that at least one filter in the filter group has the same nonlinear limiting index for all tap coefficients. When the third index flag is a second preset value, it is determined that the tap coefficient information indicates that no filter in the filter group has the same nonlinear limiting index for all tap coefficients. The first preset value and the second preset value are different.
14. The method according to claim 13, characterized in that, Determining the filter parameters based on the tap coefficient information includes: If the third index flag indicates that all tap coefficients of at least one filter in the filter bank have the same nonlinear limiting index, the tap coefficient information of the at least one filter is not received, and it is inferred that all tap coefficients of the at least one filter in the filter bank have the same nonlinear limiting index. When the third index flag indicates that no filter in the filter bank has the same nonlinear limiting index for all tap coefficients, the nonlinear limiting index corresponding to the tap coefficient of each filter is obtained based on the decoded tap coefficient information.
15. The method according to claim 1, characterized in that, Each filter is divided into one or more filter groups. The filter flags include a fourth index flag, which indicates whether the nonlinear limiting indices corresponding to all tap coefficients of all filters in the corresponding filter group are the same. When the fourth index flag is a first preset value, it is determined that the tap coefficient information indicates that the nonlinear limiting indices corresponding to all tap coefficients of all filters in the filter group are the same. When the fourth index flag is a second preset value, it is determined that the nonlinear limiting indices corresponding to all tap coefficients of all filters in the filter group included in the tap coefficient information are not the same, and the first preset value and the second preset value are different.
16. The method according to claim 15, characterized in that, Determining the filter parameters based on the tap coefficient information includes: When the fourth index flag indicates that all tap coefficients of all filters in the filter bank have the same nonlinear limiting index, the tap coefficient information of the filter bank is not received, and it is inferred that the nonlinear limiting index of all tap coefficients of all filters in the filter bank is a preset index. When the fourth index flag indicates that the nonlinear limiting indexes corresponding to all tap coefficients of all filters in the filter bank are not uniformly the same, the nonlinear limiting indexes corresponding to each tap coefficient of each filter are obtained based on the decoded tap coefficient information.
17. The method according to claim 1, characterized in that, Each filter is divided into one or more filter groups. The filter flags also include a fourth index flag and a fifth index flag. The fourth index flag is used to indicate whether the nonlinear limiting index corresponding to all tap coefficients of all filters in the corresponding filter group is the same. The fifth index flag is used to indicate the nonlinear limiting index shared by all tap coefficients of the filter group. When the fourth index flag is a first preset value, it is determined that the tap coefficient information indicates that the nonlinear limiting indexes corresponding to all tap coefficients of all filters in the filter bank are the same; when the fourth index flag is a second preset value, it is determined that the nonlinear limiting indexes corresponding to all tap coefficients of all filters in the filter bank included in the tap coefficient information are not all the same, and the first preset value and the second preset value are different.
18. The method according to claim 17, characterized in that, Determining the filter parameters based on the tap coefficient information includes: When the fourth index flag indicates that the nonlinear limiting index corresponding to all tap coefficients of all filters in the filter bank is the same, the tap coefficient information of the filter bank is not received, and it is inferred that the nonlinear limiting index corresponding to all tap coefficients of all filters in the filter bank is the fifth index flag. When the fourth index flag indicates that the nonlinear limiting indexes corresponding to all tap coefficients of all filters in the filter bank are not uniformly the same, the nonlinear limiting indexes corresponding to each tap coefficient of each filter are obtained based on the decoded tap coefficient information.
19. The method according to claim 1, characterized in that, Each filter is divided into one or more filter groups, and each filter group is located in an adaptive parameter set. The filter flags include a sixth index flag, which indicates whether at least one filter group in the adaptive parameter set contains at least one filter whose nonlinear limiting index is the same for all tap coefficients. When the sixth index flag is a first preset value, it is determined that the tap coefficient information indicates that at least one filter group in the adaptive parameter set contains at least one filter whose nonlinear limiting index is the same for all tap coefficients. When the sixth index flag is the second preset value, it is determined that in each filter group of the adaptive parameter set indicated by the tap coefficient information, there is no filter group that contains a filter whose nonlinear limiting index is the same for all tap coefficients, and the first preset value and the second preset value are different.
20. The method according to claim 19, characterized in that, Determining the filter parameters based on the tap coefficient information includes: In the case where the sixth index flag indicates that at least one filter group in the adaptive parameter set contains at least one filter whose nonlinear limiting index is the same for all tap coefficients, the tap coefficient information of the at least one filter is not received, and it is inferred that in the adaptive parameter set, the nonlinear limiting index corresponding to all tap coefficients of the at least one filter in the at least one filter group is a preset index. If, in the sixth index flag indicating the filter banks in the adaptive parameter set, there is no filter bank containing all filters whose tap coefficients have the same nonlinear limiting index, the nonlinear limiting index corresponding to the tap coefficients of each filter is obtained based on the decoded tap coefficient information.
21. The method according to claim 1, characterized in that, The filter flag includes a seventh index flag, which indicates that all tap coefficients in the adaptive parameter set have the same nonlinear limiting index. When the seventh index flag is a first preset value, it is determined that the tap coefficient information indicates that all tap coefficients in the adaptive parameter set have the same nonlinear limiting index. When the seventh index flag is a second preset value, it is determined that the nonlinear limiting indexes of all tap coefficients in the adaptive parameter set included in the tap coefficient information are not all the same, and the first preset value and the second preset value are different.
22. The method according to claim 21, characterized in that, Determining the filter parameters based on the tap coefficient information includes: If the seventh index flag indicates that all tap coefficients in the adaptive parameter set have the same nonlinear limiting index, the tap coefficient information of the adaptive parameter set is not received, and it is inferred that the nonlinear limiting indexes corresponding to all tap coefficients in the adaptive parameter set are preset indices. When the seventh index flag indicates that the nonlinear limiting indices corresponding to all tap coefficients in the adaptive parameter set are not the same, the nonlinear limiting indexes corresponding to each tap coefficient in the adaptive parameter set are obtained based on decoding the tap coefficient information.
23. The method according to claim 1, characterized in that, The filter flags include a seventh index flag and an eighth index flag. The seventh index flag is used to indicate that the nonlinear limiting index corresponding to all tap coefficients of all filters in all filter banks of the adaptive parameter set is the same. The eighth index flag is used to indicate that the nonlinear limiting index is used by all tap coefficients of all filters in all filter banks of the adaptive parameter set. When the seventh index flag is a first preset value, it is determined that the nonlinear limiting index corresponding to all tap coefficients of all filters in all filter banks of the adaptive parameter set is the same; when the seventh index flag is a second preset value, it is determined that the nonlinear limiting index corresponding to all tap coefficients of all filters in all filter banks of the adaptive parameter set included in the tap coefficient information is not the same, and the first preset value and the second preset value are different.
24. The method according to claim 23, characterized in that, Determining the filter parameters based on the tap coefficient information includes: If the seventh index flag indicates that the nonlinear limiting indexes corresponding to all tap coefficients in the adaptive parameter set are the same, the tap coefficient information of the adaptive parameter set is not received, and the nonlinear limiting indexes corresponding to all tap coefficients in the adaptive parameter set are inferred to be the eighth index flag. When the seventh index flag indicates that the nonlinear limiting indexes corresponding to all tap coefficients of all filters in all filter banks of the adaptive parameter set are not all the same, the nonlinear limiting indexes corresponding to each tap coefficient in the adaptive parameter set are obtained based on decoding the tap coefficient information.
25. The method according to any one of claims 1-24, characterized in that, The filter flag bits include at least one of the filter flag bits corresponding to the luminance component, the filter flag bits corresponding to the chrominance component, and the filter flag bits corresponding to the cross-component.
26. The method according to any one of claims 1-25, characterized in that, Further includes: If the filter flag is a preset value, the video stream will not notify the filter parameters indicated by the filter flag via signaling.
27. The method according to claim 1, characterized in that, The filter parameters include tap coefficients and nonlinear limiting indexes. The video stream does not transmit the tap coefficients and the corresponding nonlinear limiting indexes when they are both zero.
28. A video encoding method, characterized in that, include: Acquire video data; The video data is encoded and compressed to obtain a video stream. The video stream includes decoding indication information, which includes at least one filter flag bit for indicating filter parameters. The filter flag bit is determined based on tap coefficient information, which is determined based on the filter parameters.
29. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the video decoding method as described in any one of claims 1-27 or the video encoding method as described in claim 28.
30. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the video decoding method as described in any one of claims 1-27 or the video encoding method as described in claim 28.
31. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the video decoding method as described in any one of claims 1-27 or the video encoding method as described in claim 28.